… | |
… | |
31 | AC_PROG_CC |
31 | AC_PROG_CC |
32 | AC_PROG_CXX |
32 | AC_PROG_CXX |
33 | AC_PROG_CPP |
33 | AC_PROG_CPP |
34 | AC_PROG_INSTALL |
34 | AC_PROG_INSTALL |
35 | |
35 | |
|
|
36 | AC_AIX |
|
|
37 | AC_ISC_POSIX |
36 | AC_LANG(C) |
38 | AC_LANG(C++) |
37 | |
39 | |
|
|
40 | dnl check wether we can link with gcc -lsupc++ |
|
|
41 | if test x$GCC = xyes && test x$GXX = xyes; then |
|
|
42 | dnl FreeBSD (at least up to 5.3) has a broken GCC, workaround it |
|
|
43 | AC_MSG_CHECKING([for working libsupc++]) |
|
|
44 | save_CXX="$CXX" |
|
|
45 | save_LIBS="$LIBS" |
|
|
46 | CXX="$CC" |
|
|
47 | LIBS="$LIBS -lsupc++" |
|
|
48 | LINKER="$CC" |
|
|
49 | AC_LINK_IFELSE( |
|
|
50 | [AC_LANG_PROGRAM([struct test { }; void f() try { throw new test; } catch (...) { throw; }])], |
|
|
51 | [AC_MSG_RESULT(ok)], |
|
|
52 | [ |
|
|
53 | AC_MSG_RESULT([no, making everything bigger and slower]) |
|
|
54 | LIBS="$save_LIBS" |
|
|
55 | LINKER="$save_CXX" |
|
|
56 | ] |
|
|
57 | ) |
|
|
58 | CXX="$save_CXX" |
|
|
59 | fi |
|
|
60 | AC_SUBST(LINKER,[$LINKER]) |
|
|
61 | |
|
|
62 | AC_LANG(C++) |
38 | dnl# -------------------------------------------------------------------------- |
63 | dnl# -------------------------------------------------------------------------- |
39 | dnl# Supply default CFLAGS, if not specified by `CFLAGS=flags ./configure' |
64 | dnl# Supply default CXXFLAGS, if not specified by `CXXFLAGS=flags ./configure' |
40 | dnl# |
65 | dnl# |
41 | if test -z "$orig_CXXFLAGS"; then |
66 | if test -z "$orig_CXXFLAGS"; then |
42 | if test x$GCC = xyes && test "x$GXX" = xyes; then |
67 | if test x$GCC = xyes && test "x$GXX" = xyes; then |
43 | CXXFLAGS="-g -O3" |
68 | CXXFLAGS="-g -O3 -fno-threadsafe-statics -fno-enforce-eh-specs" |
|
|
69 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [], [CXXFLAGS="-g -O3"]) |
44 | else |
70 | else |
45 | CXXFLAGS="-O" |
71 | CXXFLAGS="-O" |
46 | fi |
72 | fi |
47 | CFLAGS="$CXXFLAGS" |
73 | CFLAGS="$CXXFLAGS" |
48 | fi |
74 | fi |
49 | |
|
|
50 | LINKER="$CXX" |
|
|
51 | if test x$GCC = xyes && test x$GXX = xyes; then |
|
|
52 | AC_CHECK_LIB(supc++, main, [ |
|
|
53 | LINKER="$CC" |
|
|
54 | LIBS="$LIBS -lsupc++" |
|
|
55 | ]) |
|
|
56 | fi |
|
|
57 | AC_SUBST(LINKER,[$LINKER]) |
|
|
58 | |
75 | |
59 | AC_DEFINE(_GNU_SOURCE, 1, Use all glibc features.) |
76 | AC_DEFINE(_GNU_SOURCE, 1, Use all glibc features.) |
60 | |
77 | |
61 | case $host in |
78 | case $host in |
62 | *-*-solaris* ) |
79 | *-*-solaris* ) |
… | |
… | |
67 | esac |
84 | esac |
68 | |
85 | |
69 | dnl if test x$GXX = xyes; then |
86 | dnl if test x$GXX = xyes; then |
70 | dnl CXXFLAGS="$CXXFLAGS" dnl I once had -fno-exceptions, but I am using them now... |
87 | dnl CXXFLAGS="$CXXFLAGS" dnl I once had -fno-exceptions, but I am using them now... |
71 | dnl fi |
88 | dnl fi |
72 | |
|
|
73 | AC_LANG(C++) |
|
|
74 | |
|
|
75 | dnl# system hacks |
|
|
76 | AC_AIX |
|
|
77 | AC_ISC_POSIX |
|
|
78 | |
89 | |
79 | dnl# FreeBSD needs to link libxpg4 |
90 | dnl# FreeBSD needs to link libxpg4 |
80 | AC_CHECK_FUNC(setlocale, [], [AC_CHECK_LIB(xpg4, setlocale, [LIBS="$LIBS -lxpg4"])]) |
91 | AC_CHECK_FUNC(setlocale, [], [AC_CHECK_LIB(xpg4, setlocale, [LIBS="$LIBS -lxpg4"])]) |
81 | |
92 | |
82 | dnl# solaris needs to link libnsl and socket |
93 | dnl# solaris needs to link libnsl and socket |
… | |
… | |
518 | dnl# -------------------------------------------------------------------------- |
529 | dnl# -------------------------------------------------------------------------- |
519 | AC_HEADER_SYS_WAIT |
530 | AC_HEADER_SYS_WAIT |
520 | AC_CHECK_HEADERS( \ |
531 | AC_CHECK_HEADERS( \ |
521 | assert.h \ |
532 | assert.h \ |
522 | fcntl.h \ |
533 | fcntl.h \ |
523 | grp.h \ |
|
|
524 | libc.h \ |
|
|
525 | lastlog.h \ |
|
|
526 | stdarg.h \ |
534 | stdarg.h \ |
527 | stdlib.h \ |
535 | stdlib.h \ |
528 | string.h \ |
536 | string.h \ |
529 | termios.h \ |
537 | termios.h \ |
530 | unistd.h \ |
538 | unistd.h \ |
531 | sys/byteorder.h \ |
539 | sys/byteorder.h \ |
532 | sys/ioctl.h \ |
540 | sys/ioctl.h \ |
533 | sys/select.h \ |
541 | sys/select.h \ |
534 | sys/sockio.h \ |
542 | sys/sockio.h \ |
535 | sys/strredir.h \ |
543 | sys/strredir.h \ |
536 | sys/stropts.h \ |
|
|
537 | sys/time.h \ |
544 | sys/time.h \ |
538 | utmp.h \ |
545 | stdint.h \ |
539 | utmpx.h \ |
546 | wchar.h \ |
540 | stdint.h \ |
547 | cwchar \ |
541 | pty.h \ |
548 | clocale \ |
542 | util.h \ |
|
|
543 | libutil.h \ |
|
|
544 | wchar.h \ |
|
|
545 | cwchar \ |
|
|
546 | clocale \ |
|
|
547 | ) |
549 | ) |
548 | |
550 | |
549 | AC_HEADER_TIME |
551 | AC_HEADER_TIME |
550 | |
552 | |
551 | dnl# check to allow both <termios.h> and <sys/ioctl.h> |
553 | dnl# check to allow both <termios.h> and <sys/ioctl.h> |
… | |
… | |
626 | dnl AC_CHECK_SIZEOF(long, 4) |
628 | dnl AC_CHECK_SIZEOF(long, 4) |
627 | AC_CHECK_SIZEOF(long long, 8) |
629 | AC_CHECK_SIZEOF(long long, 8) |
628 | AC_CHECK_SIZEOF(int *, 4) |
630 | AC_CHECK_SIZEOF(int *, 4) |
629 | |
631 | |
630 | dnl# see usage below |
632 | dnl# see usage below |
631 | AC_DEFUN(RXVT_CHECK_SIZE, |
633 | AC_DEFUN([RXVT_CHECK_SIZE], |
632 | [AC_CACHE_CHECK([for $2], $1, |
634 | [AC_CACHE_CHECK([for $2], $1, |
633 | [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <stdint.h>]], [[$2 dummy;]])],[$1=yes],[dnl |
635 | [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <stdint.h>]], [[$2 dummy;]])],[$1=yes],[dnl |
634 | if test "$ac_cv_sizeof_char" -ge $3; then |
636 | if test "$ac_cv_sizeof_char" -ge $3; then |
635 | $1="$4 char" |
637 | $1="$4 char" |
636 | else |
638 | else |
… | |
… | |
705 | dnl# -------------------------------------------------------------------------- |
707 | dnl# -------------------------------------------------------------------------- |
706 | AC_TYPE_SIGNAL |
708 | AC_TYPE_SIGNAL |
707 | dnl> AC_FUNC_VPRINTF |
709 | dnl> AC_FUNC_VPRINTF |
708 | |
710 | |
709 | AC_CHECK_FUNCS( \ |
711 | AC_CHECK_FUNCS( \ |
710 | revoke \ |
|
|
711 | unsetenv \ |
712 | unsetenv \ |
712 | setutent \ |
713 | setutent \ |
713 | seteuid \ |
714 | seteuid \ |
714 | setresuid \ |
715 | setresuid \ |
715 | setreuid \ |
716 | setreuid \ |
716 | _getpty \ |
|
|
717 | getpt \ |
|
|
718 | posix_openpt \ |
|
|
719 | grantpt \ |
|
|
720 | unlockpt \ |
|
|
721 | isastream \ |
|
|
722 | on_exit \ |
717 | on_exit \ |
723 | nanosleep \ |
718 | nanosleep \ |
724 | updwtmp \ |
|
|
725 | updwtmpx \ |
|
|
726 | ttyslot \ |
|
|
727 | ) |
719 | ) |
728 | |
720 | |
729 | dnl# -------------------------------------------------------------------------- |
721 | UTMP_CHECK |
730 | dnl# DO ALL UTMP AND WTMP CHECKING |
|
|
731 | dnl# -------------------------------------------------------------------------- |
|
|
732 | dnl# check for host field in utmp structure |
|
|
733 | |
|
|
734 | dnl# -------------------------------------------- |
|
|
735 | AC_CHECK_HEADER(utmp.h, |
|
|
736 | [AC_CACHE_CHECK([for struct utmp], rxvt_cv_struct_utmp, |
|
|
737 | [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h> |
|
|
738 | #include <stdint.h> |
|
|
739 | #include <utmp.h>]], [[struct utmp ut;]])],[rxvt_cv_struct_utmp=yes],[rxvt_cv_struct_utmp=no])]) |
|
|
740 | if test x$rxvt_cv_struct_utmp = xyes; then |
|
|
741 | AC_DEFINE(HAVE_STRUCT_UTMP, 1, Define if utmp.h has struct utmp) |
|
|
742 | fi |
|
|
743 | ] |
|
|
744 | |
|
|
745 | AC_CACHE_CHECK(for ut_host in utmp struct, rxvt_cv_struct_utmp_host, |
|
|
746 | [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h> |
|
|
747 | #include <utmp.h>]], [[struct utmp ut; ut.ut_host;]])],[rxvt_cv_struct_utmp_host=yes],[rxvt_cv_struct_utmp_host=no])]) |
|
|
748 | if test x$rxvt_cv_struct_utmp_host = xyes; then |
|
|
749 | AC_DEFINE(HAVE_UTMP_HOST, 1, Define if struct utmp contains ut_host) |
|
|
750 | fi |
|
|
751 | |
|
|
752 | AC_CACHE_CHECK(for ut_pid in utmp struct, rxvt_cv_struct_utmp_pid, |
|
|
753 | [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h> |
|
|
754 | #include <utmp.h>]], [[struct utmp ut; ut.ut_pid;]])],[rxvt_cv_struct_utmp_pid=yes],[rxvt_cv_struct_utmp_pid=no])]) |
|
|
755 | if test x$rxvt_cv_struct_utmp_pid = xyes; then |
|
|
756 | AC_DEFINE(HAVE_UTMP_PID, 1, Define if struct utmp contains ut_pid) |
|
|
757 | fi |
|
|
758 | ) dnl# AC_CHECK_HEADER(utmp.h |
|
|
759 | |
|
|
760 | dnl# -------------------------------------------- |
|
|
761 | |
|
|
762 | AC_CHECK_HEADER(utmpx.h, |
|
|
763 | [AC_CACHE_CHECK([for struct utmpx], rxvt_cv_struct_utmpx, |
|
|
764 | [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h> |
|
|
765 | #include <utmpx.h>]], [[struct utmpx ut;]])],[rxvt_cv_struct_utmpx=yes],[rxvt_cv_struct_utmpx=no])]) |
|
|
766 | if test x$rxvt_cv_struct_utmpx = xyes; then |
|
|
767 | AC_DEFINE(HAVE_STRUCT_UTMPX, 1, Define if utmpx.h has struct utmpx) |
|
|
768 | fi |
|
|
769 | ] |
|
|
770 | |
|
|
771 | AC_CACHE_CHECK(for host in utmpx struct, rxvt_cv_struct_utmpx_host, |
|
|
772 | [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h> |
|
|
773 | #include <utmpx.h>]], [[struct utmpx utx; utx.ut_host;]])],[rxvt_cv_struct_utmpx_host=yes],[rxvt_cv_struct_utmpx_host=no])]) |
|
|
774 | if test x$rxvt_cv_struct_utmpx_host = xyes; then |
|
|
775 | AC_DEFINE(HAVE_UTMPX_HOST, 1, Define if struct utmpx contains ut_host) |
|
|
776 | fi |
|
|
777 | |
|
|
778 | AC_CACHE_CHECK(for session in utmpx struct, rxvt_cv_struct_utmpx_session, |
|
|
779 | [AC_TRY_COMPILE([#include <sys/types.h> |
|
|
780 | #include <utmpx.h>], |
|
|
781 | [struct utmpx utx; utx.ut_session;], |
|
|
782 | rxvt_cv_struct_utmpx_session=yes, rxvt_cv_struct_utmpx_session=no)]) |
|
|
783 | if test x$rxvt_cv_struct_utmpx_session = xyes; then |
|
|
784 | AC_DEFINE(HAVE_UTMPX_SESSION, 1, Define if struct utmpx contains ut_session) |
|
|
785 | fi |
|
|
786 | ) dnl# AC_CHECK_HEADER(utmpx.h |
|
|
787 | |
|
|
788 | dnl# -------------------------------------------------------------------------- |
|
|
789 | dnl# check for struct lastlog |
|
|
790 | AC_CACHE_CHECK(for struct lastlog, rxvt_cv_struct_lastlog, |
|
|
791 | [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h> |
|
|
792 | #include <utmp.h> |
|
|
793 | #ifdef HAVE_LASTLOG_H |
|
|
794 | #include <lastlog.h> |
|
|
795 | #endif |
|
|
796 | ]], [[struct lastlog ll;]])],[rxvt_cv_struct_lastlog=yes],[rxvt_cv_struct_lastlog=no])]) |
|
|
797 | if test x$rxvt_cv_struct_lastlog = xyes; then |
|
|
798 | AC_DEFINE(HAVE_STRUCT_LASTLOG, 1, Define if utmp.h or lastlog.h has struct lastlog) |
|
|
799 | fi |
|
|
800 | |
|
|
801 | dnl# check for struct lastlogx |
|
|
802 | AC_CACHE_CHECK(for struct lastlogx, rxvt_cv_struct_lastlogx, |
|
|
803 | [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h> |
|
|
804 | #include <utmpx.h> |
|
|
805 | #ifdef HAVE_LASTLOG_H |
|
|
806 | #include <lastlog.h> |
|
|
807 | #endif |
|
|
808 | ]], [[struct lastlogx ll;]])],[rxvt_cv_struct_lastlogx=yes],[rxvt_cv_struct_lastlogx=no])]) |
|
|
809 | if test x$rxvt_cv_struct_lastlogx = xyes; then |
|
|
810 | AC_DEFINE(HAVE_STRUCT_LASTLOGX, 1, Define if utmpx.h or lastlog.h has struct lastlogx) |
|
|
811 | fi |
|
|
812 | |
|
|
813 | dnl# -------------------------------------------------------------------------- |
|
|
814 | dnl# FIND FILES |
|
|
815 | dnl# -------------------------------------------------------------------------- |
|
|
816 | |
|
|
817 | dnl# find utmp |
|
|
818 | AC_CACHE_CHECK(where utmp is located, rxvt_cv_path_utmp, |
|
|
819 | [AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <stdio.h> |
|
|
820 | #include <sys/types.h> |
|
|
821 | #include <utmp.h> |
|
|
822 | #include <errno.h> |
|
|
823 | main() |
|
|
824 | { |
|
|
825 | char **u, *utmplist[] = { |
|
|
826 | "/var/run/utmp", "/var/adm/utmp", "/etc/utmp", "/usr/etc/utmp", "/usr/adm/utmp", NULL }; |
|
|
827 | FILE *a, *f=fopen("conftestval", "w"); |
|
|
828 | if (!f) exit(1); |
|
|
829 | #ifdef UTMP_FILE |
|
|
830 | fprintf(f, "%s\n", UTMP_FILE); |
|
|
831 | exit(0); |
|
|
832 | #endif |
|
|
833 | #ifdef _PATH_UTMP |
|
|
834 | fprintf(f, "%s\n", _PATH_UTMP); |
|
|
835 | exit(0); |
|
|
836 | #endif |
|
|
837 | for (u = utmplist; *u; u++) { |
|
|
838 | if ((a = fopen(*u, "r")) != NULL || errno == EACCES) { |
|
|
839 | fprintf(f, "%s\n", *u); |
|
|
840 | exit(0); |
|
|
841 | } |
|
|
842 | } |
|
|
843 | exit(0); |
|
|
844 | }]])],[rxvt_cv_path_utmp=`cat conftestval`],[rxvt_cv_path_utmp=],[dnl |
|
|
845 | AC_MSG_WARN(Define RXVT_UTMP_FILE in config.h manually)])]) |
|
|
846 | if test x$rxvt_cv_path_utmp != x; then |
|
|
847 | AC_DEFINE_UNQUOTED(RXVT_UTMP_FILE, "$rxvt_cv_path_utmp", Define location of utmp) |
|
|
848 | fi |
|
|
849 | |
|
|
850 | dnl# -------------------------------------------------------------------------- |
|
|
851 | |
|
|
852 | dnl# find utmpx - if a utmp file exists at the same location and is more than |
|
|
853 | dnl# a day newer, then dump the utmpx. People leave lots of junk around. |
|
|
854 | AC_CACHE_CHECK(where utmpx is located, rxvt_cv_path_utmpx, |
|
|
855 | [AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <stdio.h> |
|
|
856 | #include <sys/types.h> |
|
|
857 | #include <utmpx.h> |
|
|
858 | #include <errno.h> |
|
|
859 | #include <sys/stat.h> |
|
|
860 | #ifdef HAVE_STRING_H |
|
|
861 | #include <string.h> |
|
|
862 | #endif |
|
|
863 | main() |
|
|
864 | { |
|
|
865 | char **u, *p, *utmplist[] = { |
|
|
866 | #ifdef UTMPX_FILE |
|
|
867 | UTMPX_FILE, |
|
|
868 | #endif |
|
|
869 | #ifdef _PATH_UTMPX |
|
|
870 | _PATH_UTMPX, |
|
|
871 | #endif |
|
|
872 | "/var/adm/utmpx", "/etc/utmpx", NULL }; |
|
|
873 | FILE *a, *f=fopen("conftestval", "w"); |
|
|
874 | struct stat statu, statux; |
|
|
875 | if (!f) exit(1); |
|
|
876 | for (u = utmplist; *u; u++) { |
|
|
877 | if ((a = fopen(*u, "r")) != NULL || errno == EACCES) { |
|
|
878 | if (stat(*u, &statux) < 0) |
|
|
879 | continue; |
|
|
880 | p = strdup(*u); |
|
|
881 | p[strlen(p) - 1] = '\0'; |
|
|
882 | if (stat(p, &statu) >= 0 |
|
|
883 | && (statu.st_mtime - statux.st_mtime > 86400)) |
|
|
884 | continue; |
|
|
885 | fprintf(f, "%s\n", *u); |
|
|
886 | exit(0); |
|
|
887 | } |
|
|
888 | } |
|
|
889 | exit(0); |
|
|
890 | }]])],[rxvt_cv_path_utmpx=`cat conftestval`],[rxvt_cv_path_utmpx=],[dnl |
|
|
891 | AC_MSG_WARN(Define RXVT_UTMPX_FILE in config.h manually)])]) |
|
|
892 | if test x$rxvt_cv_path_utmpx != x; then |
|
|
893 | AC_DEFINE_UNQUOTED(RXVT_UTMPX_FILE, "$rxvt_cv_path_utmpx", Define location of utmpx) |
|
|
894 | fi |
|
|
895 | |
|
|
896 | dnl# -------------------------------------------------------------------------- |
|
|
897 | |
|
|
898 | dnl# find wtmp |
|
|
899 | AC_CACHE_CHECK(where wtmp is located, rxvt_cv_path_wtmp, |
|
|
900 | [AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <stdio.h> |
|
|
901 | #include <sys/types.h> |
|
|
902 | #ifdef HAVE_UTMP_H |
|
|
903 | #include <utmp.h> |
|
|
904 | #endif |
|
|
905 | #include <errno.h> |
|
|
906 | main() |
|
|
907 | { |
|
|
908 | char **w, *wtmplist[] = { |
|
|
909 | "/var/log/wtmp", "/var/adm/wtmp", "/etc/wtmp", "/usr/etc/wtmp", "/usr/adm/wtmp", NULL }; |
|
|
910 | FILE *a, *f=fopen("conftestval", "w"); |
|
|
911 | if (!f) exit(1); |
|
|
912 | #ifdef WTMP_FILE |
|
|
913 | fprintf(f, "%s\n", WTMP_FILE); |
|
|
914 | exit(0); |
|
|
915 | #endif |
|
|
916 | #ifdef _PATH_WTMP |
|
|
917 | fprintf(f, "%s\n", _PATH_WTMP); |
|
|
918 | exit(0); |
|
|
919 | #endif |
|
|
920 | for (w = wtmplist; *w; w++) { |
|
|
921 | if ((a = fopen(*w, "r")) != NULL || errno == EACCES) { |
|
|
922 | fprintf(f, "%s\n", *w); |
|
|
923 | exit(0); |
|
|
924 | } |
|
|
925 | } |
|
|
926 | exit(0); |
|
|
927 | }]])],[rxvt_cv_path_wtmp=`cat conftestval`],[rxvt_cv_path_wtmp=],[dnl |
|
|
928 | AC_MSG_WARN(Define RXVT_WTMP_FILE in config.h manually)])]) |
|
|
929 | if test x$rxvt_cv_path_wtmp != x; then |
|
|
930 | AC_DEFINE_UNQUOTED(RXVT_WTMP_FILE, "$rxvt_cv_path_wtmp", Define location of wtmp) |
|
|
931 | fi |
|
|
932 | dnl# -------------------------------------------------------------------------- |
|
|
933 | |
|
|
934 | dnl# find wtmpx |
|
|
935 | AC_CACHE_CHECK(where wtmpx is located, rxvt_cv_path_wtmpx, |
|
|
936 | [AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <stdio.h> |
|
|
937 | #ifdef HAVE_UTMPX_H |
|
|
938 | #include <utmpx.h> |
|
|
939 | #endif |
|
|
940 | #include <errno.h> |
|
|
941 | main() |
|
|
942 | { |
|
|
943 | char **w, *wtmplist[] = { |
|
|
944 | "/var/log/wtmpx", "/var/adm/wtmpx", NULL }; |
|
|
945 | FILE *a, *f=fopen("conftestval", "w"); |
|
|
946 | if (!f) exit(1); |
|
|
947 | #ifdef WTMPX_FILE |
|
|
948 | fprintf(f, "%s\n", WTMPX_FILE); |
|
|
949 | exit(0); |
|
|
950 | #endif |
|
|
951 | #ifdef _PATH_WTMPX |
|
|
952 | fprintf(f, "%s\n", _PATH_WTMPX); |
|
|
953 | exit(0); |
|
|
954 | #endif |
|
|
955 | for (w = wtmplist; *w; w++) { |
|
|
956 | if ((a = fopen(*w, "r")) != NULL || errno == EACCES) { |
|
|
957 | fprintf(f, "%s\n", *w); |
|
|
958 | exit(0); |
|
|
959 | } |
|
|
960 | } |
|
|
961 | exit(0); |
|
|
962 | }]])],[rxvt_cv_path_wtmpx=`cat conftestval`],[rxvt_cv_path_wtmpx=],[dnl |
|
|
963 | AC_MSG_WARN(Define RXVT_WTMPX_FILE in config.h manually)])]) |
|
|
964 | if test x$rxvt_cv_path_wtmpx != x; then |
|
|
965 | AC_DEFINE_UNQUOTED(RXVT_WTMPX_FILE, "$rxvt_cv_path_wtmpx", Define location of wtmpx) |
|
|
966 | fi |
|
|
967 | dnl# -------------------------------------------------------------------------- |
|
|
968 | |
|
|
969 | dnl# find lastlog |
|
|
970 | AC_CACHE_CHECK(where lastlog is located, rxvt_cv_path_lastlog, |
|
|
971 | [AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <stdio.h> |
|
|
972 | #include <sys/types.h> |
|
|
973 | #ifdef HAVE_UTMPX_H |
|
|
974 | #include <utmpx.h> |
|
|
975 | #elif defined(HAVE_UTMP_H) |
|
|
976 | #include <utmp.h> |
|
|
977 | #endif |
|
|
978 | #ifdef HAVE_LASTLOG_H |
|
|
979 | #include <lastlog.h> |
|
|
980 | #endif |
|
|
981 | #include <errno.h> |
|
|
982 | main() |
|
|
983 | { |
|
|
984 | char **w, *lastloglist[] = { "/var/log/lastlog", NULL }; |
|
|
985 | FILE *a, *f=fopen("conftestval", "w"); |
|
|
986 | if (!f) exit(1); |
|
|
987 | #ifdef LASTLOG_FILE |
|
|
988 | fprintf(f, "%s\n", LASTLOG_FILE); |
|
|
989 | exit(0); |
|
|
990 | #endif |
|
|
991 | #ifdef _PATH_LASTLOG |
|
|
992 | fprintf(f, "%s\n", _PATH_LASTLOG); |
|
|
993 | exit(0); |
|
|
994 | #endif |
|
|
995 | for (w = lastloglist; *w; w++) { |
|
|
996 | if ((a = fopen(*w, "r")) != NULL || errno == EACCES) { |
|
|
997 | fprintf(f, "%s\n", *w); |
|
|
998 | exit(0); |
|
|
999 | } |
|
|
1000 | } |
|
|
1001 | exit(0); |
|
|
1002 | }]])],[rxvt_cv_path_lastlog=`cat conftestval`],[rxvt_cv_path_lastlog=],[dnl |
|
|
1003 | AC_MSG_WARN(Define RXVT_LASTLOG_FILE in config.h manually)])]) |
|
|
1004 | if test x$rxvt_cv_path_lastlog != x; then |
|
|
1005 | AC_DEFINE_UNQUOTED(RXVT_LASTLOG_FILE, "$rxvt_cv_path_lastlog", Define location of lastlog) |
|
|
1006 | if test -d "$rxvt_cv_path_lastlog"; then |
|
|
1007 | AC_DEFINE(LASTLOG_IS_DIR, 1, Define if lastlog is provided via a directory) |
|
|
1008 | fi |
|
|
1009 | fi |
|
|
1010 | dnl# -------------------------------------------------------------------------- |
|
|
1011 | |
|
|
1012 | dnl# find lastlogx |
|
|
1013 | AC_CACHE_CHECK(where lastlogx is located, rxvt_cv_path_lastlogx, |
|
|
1014 | [AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <stdio.h> |
|
|
1015 | #ifdef HAVE_UTMPX_H |
|
|
1016 | #include <utmpx.h> |
|
|
1017 | #endif |
|
|
1018 | #include <errno.h> |
|
|
1019 | main() |
|
|
1020 | { |
|
|
1021 | char **w, *wtmplist[] = { "/var/log/lastlogx", "/var/adm/lastlogx", NULL }; |
|
|
1022 | FILE *a, *f=fopen("conftestval", "w"); |
|
|
1023 | if (!f) exit(1); |
|
|
1024 | #ifdef LASTLOGX_FILE |
|
|
1025 | fprintf(f, "%s\n", LASTLOGX_FILE); |
|
|
1026 | exit(0); |
|
|
1027 | #endif |
|
|
1028 | #ifdef _PATH_LASTLOGX |
|
|
1029 | fprintf(f, "%s\n", _PATH_LASTLOGX); |
|
|
1030 | exit(0); |
|
|
1031 | #endif |
|
|
1032 | for (w = wtmplist; *w; w++) { |
|
|
1033 | if ((a = fopen(*w, "r")) != NULL || errno == EACCES) { |
|
|
1034 | fprintf(f, "%s\n", *w); |
|
|
1035 | exit(0); |
|
|
1036 | } |
|
|
1037 | } |
|
|
1038 | exit(0); |
|
|
1039 | }]])],[rxvt_cv_path_lastlogx=`cat conftestval`],[rxvt_cv_path_lastlogx=],[dnl |
|
|
1040 | AC_MSG_WARN(Define RXVT_LASTLOGX_FILE in config.h manually)])]) |
|
|
1041 | if test x$rxvt_cv_path_lastlogx != x; then |
|
|
1042 | AC_DEFINE_UNQUOTED(RXVT_LASTLOGX_FILE, "$rxvt_cv_path_lastlogx", Define location of lastlogx) |
|
|
1043 | fi |
|
|
1044 | |
722 | |
1045 | dnl# -------------------------------------------------------------------------- |
723 | dnl# -------------------------------------------------------------------------- |
1046 | |
724 | |
1047 | dnl# find ttys/ttytab |
725 | dnl# find ttys/ttytab |
1048 | AC_CACHE_CHECK(where ttys/ttytab is located, rxvt_cv_path_ttytab, |
726 | AC_CACHE_CHECK(where ttys/ttytab is located, rxvt_cv_path_ttytab, |
… | |
… | |
1103 | [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <langinfo.h>]], [[nl_langinfo(CODESET);]])],[rxvt_cv_func_nl_langinfo=yes],[rxvt_cv_func_nl_langinfo=no])]) |
781 | [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <langinfo.h>]], [[nl_langinfo(CODESET);]])],[rxvt_cv_func_nl_langinfo=yes],[rxvt_cv_func_nl_langinfo=no])]) |
1104 | if test x$rxvt_cv_func_nl_langinfo = xyes; then |
782 | if test x$rxvt_cv_func_nl_langinfo = xyes; then |
1105 | AC_DEFINE(HAVE_NL_LANGINFO, 1, Define if nl_langinfo(CODESET) works) |
783 | AC_DEFINE(HAVE_NL_LANGINFO, 1, Define if nl_langinfo(CODESET) works) |
1106 | fi |
784 | fi |
1107 | |
785 | |
1108 | AC_CACHE_CHECK(for unix-compliant filehandle passing ability, rxvt_can_pass_fds, |
786 | SCM_RIGHTS_CHECK |
1109 | [AC_TRY_LINK([ |
|
|
1110 | #include <sys/types.h> |
|
|
1111 | #include <sys/socket.h> |
|
|
1112 | ],[ |
|
|
1113 | { |
|
|
1114 | msghdr msg; |
|
|
1115 | iovec iov; |
|
|
1116 | char buf [100]; |
|
|
1117 | char data = 0; |
|
|
1118 | |
|
|
1119 | iov.iov_base = &data; |
|
|
1120 | iov.iov_len = 1; |
|
|
1121 | |
|
|
1122 | msg.msg_iov = &iov; |
|
|
1123 | msg.msg_iovlen = 1; |
|
|
1124 | msg.msg_control = buf; |
|
|
1125 | msg.msg_controllen = sizeof buf; |
|
|
1126 | |
|
|
1127 | cmsghdr *cmsg = CMSG_FIRSTHDR (&msg); |
|
|
1128 | cmsg->cmsg_level = SOL_SOCKET; |
|
|
1129 | cmsg->cmsg_type = SCM_RIGHTS; |
|
|
1130 | cmsg->cmsg_len = 100; |
|
|
1131 | |
|
|
1132 | *(int *)CMSG_DATA (cmsg) = 5; |
|
|
1133 | |
|
|
1134 | return sendmsg (3, &msg, 0); |
|
|
1135 | } |
|
|
1136 | ],[rxvt_can_pass_fds=yes],[rxvt_can_pass_fds=no])]) |
|
|
1137 | if test x$rxvt_can_pass_fds = xyes; then |
|
|
1138 | AC_DEFINE(HAVE_UNIX_FDPASS, 1, Define if sys/socket.h defines the necessary macros/functions for file handle passing) |
|
|
1139 | else |
|
|
1140 | AC_MSG_ERROR([urxvt requires unix-compliant filehandle passing ability]) |
|
|
1141 | fi |
|
|
1142 | |
787 | |
1143 | AC_CACHE_CHECK(for broken XIM callback, rxvt_broken_ximcb, |
788 | AC_CACHE_CHECK(for broken XIM callback, rxvt_broken_ximcb, |
1144 | [AC_COMPILE_IFELSE([ |
789 | [AC_COMPILE_IFELSE([ |
1145 | #include <X11/Xlib.h> |
790 | #include <X11/Xlib.h> |
1146 | |
791 | |
… | |
… | |
1154 | |
799 | |
1155 | if test x$rxvt_broken_ximcb = xyes; then |
800 | if test x$rxvt_broken_ximcb = xyes; then |
1156 | AC_DEFINE(XIMCB_PROTO_BROKEN, 1, Define if your XIMCallback specifies XIC as first type.) |
801 | AC_DEFINE(XIMCB_PROTO_BROKEN, 1, Define if your XIMCallback specifies XIC as first type.) |
1157 | fi |
802 | fi |
1158 | |
803 | |
1159 | if test x$ac_cv_func_getpt = xno -a x$ac_cv_func_posix_openpt = xno; then |
804 | PTY_CHECK |
1160 | AC_CHECK_FUNC(openpty, [], [AC_CHECK_LIB(util, openpty, [LIBS="$LIBS -lutil"])]) |
|
|
1161 | fi |
|
|
1162 | |
|
|
1163 | dnl# if we don't guess right then it's up to the user |
|
|
1164 | AC_CACHE_CHECK(for pty/tty type, rxvt_cv_ptys, |
|
|
1165 | [if test x$ac_cv_func_openpty = xyes -o x$ac_cv_lib_util_openpty = xyes; then |
|
|
1166 | rxvt_cv_ptys=OPENPTY |
|
|
1167 | else if test x$ac_cv_func_getpt = xyes; then |
|
|
1168 | rxvt_cv_ptys=GLIBC |
|
|
1169 | else if test x$ac_cv_func_posix_openpt = xyes; then |
|
|
1170 | rxvt_cv_ptys=POSIX |
|
|
1171 | else if test x$ac_cv_func__getpty = xyes; then |
|
|
1172 | rxvt_cv_ptys=SGI4 |
|
|
1173 | else if test -c /dev/ttyp20; then |
|
|
1174 | rxvt_cv_ptys=SCO |
|
|
1175 | else if test -c /dev/ptym/clone; then |
|
|
1176 | rxvt_cv_ptys=HPUX |
|
|
1177 | else if test -c /dev/ptc -a -c /dev/pts; then |
|
|
1178 | rxvt_cv_ptys=PTC |
|
|
1179 | else if test -c /dev/ptc -a -d /dev/pts; then |
|
|
1180 | rxvt_cv_ptys=PTC |
|
|
1181 | else if test -c /dev/ptmx -a -c /dev/pts/0; then |
|
|
1182 | rxvt_cv_ptys=STREAMS |
|
|
1183 | else if test x$ac_cv_func_grantpt = xyes && test x$ac_cv_func_unlockpt = xyes; then |
|
|
1184 | dnl# catch CYGWIN |
|
|
1185 | rxvt_cv_ptys=STREAMS |
|
|
1186 | else |
|
|
1187 | rxvt_cv_ptys=BSD |
|
|
1188 | fi |
|
|
1189 | fi |
|
|
1190 | fi |
|
|
1191 | fi |
|
|
1192 | fi |
|
|
1193 | fi |
|
|
1194 | fi |
|
|
1195 | fi |
|
|
1196 | fi |
|
|
1197 | fi |
|
|
1198 | ]) |
|
|
1199 | |
|
|
1200 | if test x$rxvt_cv_ptys = xGLIBC; then |
|
|
1201 | AC_DEFINE(PTYS_ARE_GETPT, 1, Define for this pty type) |
|
|
1202 | fi |
|
|
1203 | if test x$rxvt_cv_ptys = xPOSIX; then |
|
|
1204 | AC_DEFINE(PTYS_ARE_POSIX, 1, Define for this pty type) |
|
|
1205 | fi |
|
|
1206 | if test x$rxvt_cv_ptys = xOPENPTY; then |
|
|
1207 | AC_DEFINE(PTYS_ARE_OPENPTY, 1, Define for this pty type) |
|
|
1208 | fi |
|
|
1209 | if test x$rxvt_cv_ptys = xSCO; then |
|
|
1210 | AC_DEFINE(PTYS_ARE_NUMERIC, 1, Define for this pty type) |
|
|
1211 | fi |
|
|
1212 | if test x$rxvt_cv_ptys = xSTREAMS; then |
|
|
1213 | AC_DEFINE(PTYS_ARE_PTMX, 1, Define for this pty type) |
|
|
1214 | fi |
|
|
1215 | if test x$rxvt_cv_ptys = xPTC; then |
|
|
1216 | AC_DEFINE(PTYS_ARE_PTC, 1, Define for this pty type) |
|
|
1217 | fi |
|
|
1218 | if test x$rxvt_cv_ptys = xSGI4; then |
|
|
1219 | AC_DEFINE(PTYS_ARE__GETPTY, 1, Define for this pty type) |
|
|
1220 | fi |
|
|
1221 | if test x$rxvt_cv_ptys = xHPUX; then |
|
|
1222 | AC_DEFINE(PTYS_ARE_CLONE, 1, Define for this pty type) |
|
|
1223 | fi |
|
|
1224 | if test x$rxvt_cv_ptys = xBSD -o x$rxvt_cv_ptys = xHPUX -o x$rxvt_cv_ptys = xPOSIX; then |
|
|
1225 | AC_DEFINE(PTYS_ARE_SEARCHED, 1, Define for this pty type) |
|
|
1226 | fi |
|
|
1227 | |
|
|
1228 | |
|
|
1229 | AS_MESSAGE(checking for pty ranges...) |
|
|
1230 | ptys=`echo /dev/pty??` |
|
|
1231 | pch1=`echo $ptys | tr ' ' '\012' | sed -e 's/^.*\(.\).$/\1/g' | sort -u | tr -d '\012'` |
|
|
1232 | pch2=`echo $ptys | tr ' ' '\012' | sed -e 's/^.*\(.\)$/\1/g' | sort -u | tr -d '\012'` |
|
|
1233 | if test x$pch1 != x; then |
|
|
1234 | AC_DEFINE_UNQUOTED(PTYCHAR1, "$pch1", Define for first char in devptyXX) |
|
|
1235 | fi |
|
|
1236 | if test x$pch2 != x; then |
|
|
1237 | AC_DEFINE_UNQUOTED(PTYCHAR2, "$pch2", Define for second char in devptyXX) |
|
|
1238 | fi |
|
|
1239 | |
805 | |
1240 | dnl# -------------------------------------------------------------------------- |
806 | dnl# -------------------------------------------------------------------------- |
1241 | dnl# now add and remove other stuff |
807 | dnl# now add and remove other stuff |
1242 | dnl# -------------------------------------------------------------------------- |
808 | dnl# -------------------------------------------------------------------------- |
1243 | if test x$support_xft = xyes; then |
809 | if test x$support_xft = xyes; then |
1244 | LIBS="$LIBS `pkg-config xft --libs`" |
810 | AC_PATH_PROG(PKG_CONFIG, pkg-config, no) |
|
|
811 | AC_PATH_PROG(XFT_CONFIG, xft-config, no) |
|
|
812 | if test $PKG_CONFIG != no && $PKG_CONFIG --exists xft; then |
|
|
813 | LIBS="$LIBS `$PKG_CONFIG xft --libs`" |
1245 | CPPFLAGS="$CPPFLAGS `pkg-config xft --cflags`" |
814 | CPPFLAGS="$CPPFLAGS `$PKG_CONFIG xft --cflags`" |
|
|
815 | else |
|
|
816 | if test $XFT_CONFIG != no; then |
|
|
817 | LIBS="$LIBS `$XFT_CONFIG --libs`" |
|
|
818 | CPPFLAGS="$CPPFLAGS `$XFT_CONFIG --cflags`" |
|
|
819 | fi |
|
|
820 | fi |
1246 | |
821 | |
1247 | AC_CHECK_HEADERS(X11/Xft/Xft.h,,[support_xft=no]) |
822 | AC_CHECK_HEADERS(X11/Xft/Xft.h,,[support_xft=no]) |
1248 | AC_CHECK_LIB(Xft,XftDrawString32,,[support_xft=no]) |
823 | AC_CHECK_LIB(Xft,XftDrawString32,,[support_xft=no]) |
1249 | |
824 | |
1250 | if test x$support_xft = xyes; then |
825 | if test x$support_xft = xyes; then |
… | |
… | |
1424 | AC_ARG_PROGRAM |
999 | AC_ARG_PROGRAM |
1425 | |
1000 | |
1426 | dnl# test for "sun" or "__sun__" before include sys_ioctl |
1001 | dnl# test for "sun" or "__sun__" before include sys_ioctl |
1427 | |
1002 | |
1428 | dnl# revert HAVE_BLAH_H into a "#include <blah.h>" |
1003 | dnl# revert HAVE_BLAH_H into a "#include <blah.h>" |
1429 | AC_DEFUN(RXVT_DEFINE_TO_INCLUDE, dnl |
1004 | AC_DEFUN([RXVT_DEFINE_TO_INCLUDE], dnl |
1430 | [if test "$$3" = "$4" -o "$$5" = "$6"; then |
1005 | [if test "$$3" = "$4" -o "$$5" = "$6"; then |
1431 | $1="#include <$2>" |
1006 | $1="#include <$2>" |
1432 | else |
1007 | else |
1433 | $1="/* #include <$2> */" |
1008 | $1="/* #include <$2> */" |
1434 | fi dnl |
1009 | fi dnl |
… | |
… | |
1476 | |
1051 | |
1477 | if test x$support_xpm = xyes; then |
1052 | if test x$support_xpm = xyes; then |
1478 | echo " Xpm library: $XPM_LIBS" |
1053 | echo " Xpm library: $XPM_LIBS" |
1479 | fi |
1054 | fi |
1480 | |
1055 | |
1481 | echo " |
|
|
1482 | The following are set in config.h |
|
|
1483 | " |
|
|
1484 | echo " pty/tty type: "$rxvt_cv_ptys |
|
|
1485 | if test x$support_utmp != xyes; then |
1056 | if test x$support_utmp != xyes; then |
1486 | echo " utmp support: disabled" |
1057 | echo " utmp support: disabled" |
1487 | echo |
1058 | echo |
1488 | else |
1059 | else |
1489 | echo " utmp support: enabled |
1060 | echo " utmp support: enabled |
1490 | utmp file: $rxvt_cv_path_utmp |
1061 | utmp file: $path_utmp |
1491 | utmpx file: $rxvt_cv_path_utmpx |
1062 | utmpx file: $path_utmpx |
1492 | wtmp file: $rxvt_cv_path_wtmp |
1063 | wtmp file: $path_wtmp |
1493 | wtmpx file: $rxvt_cv_path_wtmpx |
1064 | wtmpx file: $path_wtmpx |
1494 | lastlog file: $rxvt_cv_path_lastlog |
1065 | lastlog file: $path_lastlog |
1495 | ttys/ttytab file: $rxvt_cv_path_ttytab |
1066 | lastlogx file: $path_lastlogx" |
1496 | embedded perl: $support_perl" |
|
|
1497 | echo |
|
|
1498 | fi |
1067 | fi |
1499 | if test x$term != x; then |
1068 | if test x$term != x; then |
1500 | echo " set TERM to: $term" |
1069 | echo " set TERM to: $term" |
1501 | fi |
1070 | fi |
1502 | if test x$terminfo != x; then |
1071 | if test x$terminfo != x; then |
… | |
… | |
1506 | echo " resource class: $RESCLASS" |
1075 | echo " resource class: $RESCLASS" |
1507 | if test x$RESFALLBACK != x; then |
1076 | if test x$RESFALLBACK != x; then |
1508 | echo " resource class fallback: $RESFALLBACK" |
1077 | echo " resource class fallback: $RESFALLBACK" |
1509 | fi |
1078 | fi |
1510 | echo |
1079 | echo |
1511 | if test x$rxvt_cv_ptys = xUNKNOWN; then |
1080 | echo " embedded perl: $support_perl" |
1512 | echo ".----------------------------------------------------------------." |
1081 | echo |
1513 | echo ". WARNING: could not determine pty/tty type. Do not build until ." |
|
|
1514 | echo ". the appropriate PTYS_ARE_* is defined in config.h ." |
|
|
1515 | echo ".----------------------------------------------------------------." |
|
|
1516 | fi |
|
|
1517 | if test x$support_xpm = xneedsmanualspecification; then |
1082 | if test x$support_xpm = xneedsmanualspecification; then |
1518 | echo ".----------------------------------------------------------------." |
1083 | echo ".----------------------------------------------------------------." |
1519 | echo ". WARNING: --enable-xpm-background was specified however the ." |
1084 | echo ". WARNING: --enable-xpm-background was specified however the ." |
1520 | echo ". XPM includes files and libraries could not be found. ." |
1085 | echo ". XPM includes files and libraries could not be found. ." |
1521 | echo ". XPM backgrounds are now being DISABLED! If you want ." |
1086 | echo ". XPM backgrounds are now being DISABLED! If you want ." |