1 | dnl# -*- sh -*- |
1 | dnl# -*- sh -*- |
2 | dnl# |
2 | dnl# |
3 | dnl# Process this file with autoconf to produce a configure script. |
3 | dnl# Process this file with autoconf to produce a configure script. |
4 | dnl# |
4 | dnl# |
5 | AC_INIT(src/feature.h) |
5 | AC_INIT |
|
|
6 | AC_CONFIG_SRCDIR([src/feature.h]) |
6 | AC_CONFIG_AUX_DIR(autoconf) |
7 | AC_CONFIG_AUX_DIR(autoconf) |
7 | AC_CONFIG_HEADER(config.h:autoconf/config.h.in) |
8 | AC_CONFIG_HEADER(config.h:autoconf/config.h.in) |
8 | |
9 | |
9 | dnl RXVT version |
10 | dnl RXVT version |
10 | changequote(, )dnl |
11 | changequote(, )dnl |
… | |
… | |
510 | |
511 | |
511 | AC_HEADER_TIME |
512 | AC_HEADER_TIME |
512 | |
513 | |
513 | dnl# check to allow both <termios.h> and <sys/ioctl.h> |
514 | dnl# check to allow both <termios.h> and <sys/ioctl.h> |
514 | AC_CACHE_CHECK(whether termios.h and sys/ioctl.h may both be included, rxvt_cv_header_sysioctl, |
515 | AC_CACHE_CHECK(whether termios.h and sys/ioctl.h may both be included, rxvt_cv_header_sysioctl, |
515 | [AC_TRY_COMPILE([#include <stdio.h> |
516 | [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <stdio.h> |
516 | #include <sys/ioctl.h> |
517 | #include <sys/ioctl.h> |
517 | #ifdef HAVE_TERMIOS_H |
518 | #ifdef HAVE_TERMIOS_H |
518 | #include <termios.h> |
519 | #include <termios.h> |
519 | #endif], [int a = ECHO;], rxvt_cv_header_sysioctl=yes, rxvt_cv_header_sysioctl=no)]) |
520 | #endif]], [[int a = ECHO;]])],[rxvt_cv_header_sysioctl=yes],[rxvt_cv_header_sysioctl=no])]) |
520 | |
521 | |
521 | dnl# ELF systems may want to store paths for dynamic libraries. |
522 | dnl# ELF systems may want to store paths for dynamic libraries. |
522 | dnl# Lets see if the compiler can accept "-Rpath" or "-Wl,-Rpath" |
523 | dnl# Lets see if the compiler can accept "-Rpath" or "-Wl,-Rpath" |
523 | dnl# At least one version of SunOS wants "-R path" but it's not checked yet. |
524 | dnl# At least one version of SunOS wants "-R path" but it's not checked yet. |
524 | if test -n "$GCC"; then |
525 | if test -n "$GCC"; then |
… | |
… | |
533 | ac_save_CFLAGS=$CFLAGS |
534 | ac_save_CFLAGS=$CFLAGS |
534 | ac_save_LIBS=$LIBS |
535 | ac_save_LIBS=$LIBS |
535 | CFLAGS="$CFLAGS $X_CFLAGS" |
536 | CFLAGS="$CFLAGS $X_CFLAGS" |
536 | LIBS=`echo "$LIBS $X_LIBS $X_EXTRA_LIBS -lX11" | sed "$R_TRANSLATE"` |
537 | LIBS=`echo "$LIBS $X_LIBS $X_EXTRA_LIBS -lX11" | sed "$R_TRANSLATE"` |
537 | AC_CACHE_CHECK([for -rpath dynamic library path recording], rxvt_cv_rpath, |
538 | AC_CACHE_CHECK([for -rpath dynamic library path recording], rxvt_cv_rpath, |
538 | [AC_TRY_RUN([ |
539 | [AC_RUN_IFELSE([AC_LANG_SOURCE([[ |
539 | main() |
540 | main() |
540 | { |
541 | { |
541 | exit(0); |
542 | exit(0); |
542 | (void) XOpenDisplay("foobar"); |
543 | (void) XOpenDisplay("foobar"); |
543 | }], rxvt_cv_rpath=yes, rxvt_cv_rpath=no, dnl |
544 | }]])],[rxvt_cv_rpath=yes],[rxvt_cv_rpath=no],[dnl |
544 | AC_MSG_WARN([You may need to check the LIBS line]))]) |
545 | AC_MSG_WARN(You may need to check the LIBS line)])]) |
545 | if test x$rxvt_cv_rpath != xyes; then |
546 | if test x$rxvt_cv_rpath != xyes; then |
546 | changequote(, )dnl |
547 | changequote(, )dnl |
547 | R_TRANSLATE='s/-L\([^ ]*\)/-L\1 '$LDARG'-R\1/g' |
548 | R_TRANSLATE='s/-L\([^ ]*\)/-L\1 '$LDARG'-R\1/g' |
548 | changequote([, ])dnl |
549 | changequote([, ])dnl |
549 | LIBS=`echo "$ac_save_LIBS $X_LIBS $X_EXTRA_LIBS -lX11" | sed "$R_TRANSLATE"` |
550 | LIBS=`echo "$ac_save_LIBS $X_LIBS $X_EXTRA_LIBS -lX11" | sed "$R_TRANSLATE"` |
550 | AC_CACHE_CHECK([for -R dynamic library path recording], rxvt_cv_R, |
551 | AC_CACHE_CHECK([for -R dynamic library path recording], rxvt_cv_R, |
551 | [AC_TRY_RUN([ |
552 | [AC_RUN_IFELSE([AC_LANG_SOURCE([[ |
552 | main() |
553 | main() |
553 | { |
554 | { |
554 | exit(0); |
555 | exit(0); |
555 | (void) XOpenDisplay("foobar"); |
556 | (void) XOpenDisplay("foobar"); |
556 | }], rxvt_cv_R=yes, rxvt_cv_R=no, rxvt_cv_R=no)]) |
557 | }]])],[rxvt_cv_R=yes],[rxvt_cv_R=no],[rxvt_cv_R=no])]) |
557 | if test x$rxvt_cv_R != xyes; then |
558 | if test x$rxvt_cv_R != xyes; then |
558 | LIBS="$ac_save_LIBS $X_LIBS $X_EXTRA_LIBS -lX11" |
559 | LIBS="$ac_save_LIBS $X_LIBS $X_EXTRA_LIBS -lX11" |
559 | fi |
560 | fi |
560 | fi |
561 | fi |
561 | |
562 | |
562 | AC_CACHE_CHECK([for XPointer], rxvt_cv_xpointer, |
563 | AC_CACHE_CHECK([for XPointer], rxvt_cv_xpointer, |
563 | [AC_TRY_COMPILE([#include <X11/Xlib.h>], [XPointer dummy;], |
564 | [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <X11/Xlib.h>]], [[XPointer dummy;]])],[rxvt_cv_xpointer=yes],[rxvt_cv_xpointer=no])]) |
564 | rxvt_cv_xpointer=yes, rxvt_cv_xpointer=no)]) |
|
|
565 | if test x$rxvt_cv_xpointer = xyes; then |
565 | if test x$rxvt_cv_xpointer = xyes; then |
566 | AC_DEFINE(HAVE_XPOINTER, 1, Define if you have XPointer typedef) |
566 | AC_DEFINE(HAVE_XPOINTER, 1, Define if you have XPointer typedef) |
567 | fi |
567 | fi |
568 | LIBS=$ac_save_LIBS |
568 | LIBS=$ac_save_LIBS |
569 | CFLAGS=$ac_save_CFLAGS |
569 | CFLAGS=$ac_save_CFLAGS |
… | |
… | |
593 | AC_CHECK_SIZEOF(int *, 4) |
593 | AC_CHECK_SIZEOF(int *, 4) |
594 | |
594 | |
595 | dnl# see usage below |
595 | dnl# see usage below |
596 | AC_DEFUN(RXVT_CHECK_SIZE, |
596 | AC_DEFUN(RXVT_CHECK_SIZE, |
597 | [AC_CACHE_CHECK([for $2], $1, |
597 | [AC_CACHE_CHECK([for $2], $1, |
598 | [AC_TRY_COMPILE([#include <stdint.h>], $2 dummy;, |
598 | [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <stdint.h>]], [[$2 dummy;]])],[$1=yes],[dnl |
599 | [$1=yes], |
|
|
600 | [dnl |
|
|
601 | if test $ac_cv_sizeof_char -ge $3; then |
599 | if test $ac_cv_sizeof_char -ge $3; then |
602 | $1="$4 char" |
600 | $1="$4 char" |
603 | else |
601 | else |
604 | if test $ac_cv_sizeof_short -ge $3; then |
602 | if test $ac_cv_sizeof_short -ge $3; then |
605 | $1="$4 short" |
603 | $1="$4 short" |
… | |
… | |
707 | dnl# check for host field in utmp structure |
705 | dnl# check for host field in utmp structure |
708 | |
706 | |
709 | dnl# -------------------------------------------- |
707 | dnl# -------------------------------------------- |
710 | AC_CHECK_HEADER(utmp.h, |
708 | AC_CHECK_HEADER(utmp.h, |
711 | [AC_CACHE_CHECK([for struct utmp], rxvt_cv_struct_utmp, |
709 | [AC_CACHE_CHECK([for struct utmp], rxvt_cv_struct_utmp, |
712 | [AC_TRY_COMPILE([#include <sys/types.h> |
710 | [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h> |
713 | #include <stdint.h> |
711 | #include <stdint.h> |
714 | #include <utmp.h>], |
712 | #include <utmp.h>]], [[struct utmp ut;]])],[rxvt_cv_struct_utmp=yes],[rxvt_cv_struct_utmp=no])]) |
715 | [struct utmp ut;], |
|
|
716 | rxvt_cv_struct_utmp=yes, rxvt_cv_struct_utmp=no)]) |
|
|
717 | if test x$rxvt_cv_struct_utmp = xyes; then |
713 | if test x$rxvt_cv_struct_utmp = xyes; then |
718 | AC_DEFINE(HAVE_STRUCT_UTMP, 1, Define if utmp.h has struct utmp) |
714 | AC_DEFINE(HAVE_STRUCT_UTMP, 1, Define if utmp.h has struct utmp) |
719 | fi |
715 | fi |
720 | ] |
716 | ] |
721 | |
717 | |
722 | AC_CACHE_CHECK(for ut_host in utmp struct, rxvt_cv_struct_utmp_host, |
718 | AC_CACHE_CHECK(for ut_host in utmp struct, rxvt_cv_struct_utmp_host, |
723 | [AC_TRY_COMPILE([#include <sys/types.h> |
719 | [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h> |
724 | #include <utmp.h>], |
720 | #include <utmp.h>]], [[struct utmp ut; ut.ut_host;]])],[rxvt_cv_struct_utmp_host=yes],[rxvt_cv_struct_utmp_host=no])]) |
725 | [struct utmp ut; ut.ut_host;], |
|
|
726 | rxvt_cv_struct_utmp_host=yes, rxvt_cv_struct_utmp_host=no)]) |
|
|
727 | if test x$rxvt_cv_struct_utmp_host = xyes; then |
721 | if test x$rxvt_cv_struct_utmp_host = xyes; then |
728 | AC_DEFINE(HAVE_UTMP_HOST, 1, Define if struct utmp contains ut_host) |
722 | AC_DEFINE(HAVE_UTMP_HOST, 1, Define if struct utmp contains ut_host) |
729 | fi |
723 | fi |
730 | |
724 | |
731 | AC_CACHE_CHECK(for ut_pid in utmp struct, rxvt_cv_struct_utmp_pid, |
725 | AC_CACHE_CHECK(for ut_pid in utmp struct, rxvt_cv_struct_utmp_pid, |
732 | [AC_TRY_COMPILE([#include <sys/types.h> |
726 | [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h> |
733 | #include <utmp.h>], |
727 | #include <utmp.h>]], [[struct utmp ut; ut.ut_pid;]])],[rxvt_cv_struct_utmp_pid=yes],[rxvt_cv_struct_utmp_pid=no])]) |
734 | [struct utmp ut; ut.ut_pid;], |
|
|
735 | rxvt_cv_struct_utmp_pid=yes, rxvt_cv_struct_utmp_pid=no)]) |
|
|
736 | if test x$rxvt_cv_struct_utmp_pid = xyes; then |
728 | if test x$rxvt_cv_struct_utmp_pid = xyes; then |
737 | AC_DEFINE(HAVE_UTMP_PID, 1, Define if struct utmp contains ut_pid) |
729 | AC_DEFINE(HAVE_UTMP_PID, 1, Define if struct utmp contains ut_pid) |
738 | fi |
730 | fi |
739 | ) dnl# AC_CHECK_HEADER(utmp.h |
731 | ) dnl# AC_CHECK_HEADER(utmp.h |
740 | |
732 | |
741 | dnl# -------------------------------------------- |
733 | dnl# -------------------------------------------- |
742 | |
734 | |
743 | AC_CHECK_HEADER(utmpx.h, |
735 | AC_CHECK_HEADER(utmpx.h, |
744 | [AC_CACHE_CHECK([for struct utmpx], rxvt_cv_struct_utmpx, |
736 | [AC_CACHE_CHECK([for struct utmpx], rxvt_cv_struct_utmpx, |
745 | [AC_TRY_COMPILE([#include <sys/types.h> |
737 | [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h> |
746 | #include <utmpx.h>], |
738 | #include <utmpx.h>]], [[struct utmpx ut;]])],[rxvt_cv_struct_utmpx=yes],[rxvt_cv_struct_utmpx=no])]) |
747 | [struct utmpx ut;], |
|
|
748 | rxvt_cv_struct_utmpx=yes, rxvt_cv_struct_utmpx=no)]) |
|
|
749 | if test x$rxvt_cv_struct_utmpx = xyes; then |
739 | if test x$rxvt_cv_struct_utmpx = xyes; then |
750 | AC_DEFINE(HAVE_STRUCT_UTMPX, 1, Define if utmpx.h has struct utmpx) |
740 | AC_DEFINE(HAVE_STRUCT_UTMPX, 1, Define if utmpx.h has struct utmpx) |
751 | fi |
741 | fi |
752 | ] |
742 | ] |
753 | |
743 | |
754 | AC_CACHE_CHECK(for host in utmpx struct, rxvt_cv_struct_utmpx_host, |
744 | AC_CACHE_CHECK(for host in utmpx struct, rxvt_cv_struct_utmpx_host, |
755 | [AC_TRY_COMPILE([#include <sys/types.h> |
745 | [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h> |
756 | #include <utmpx.h>], |
746 | #include <utmpx.h>]], [[struct utmpx utx; utx.ut_host;]])],[rxvt_cv_struct_utmpx_host=yes],[rxvt_cv_struct_utmpx_host=no])]) |
757 | [struct utmpx utx; utx.ut_host;], |
|
|
758 | rxvt_cv_struct_utmpx_host=yes, rxvt_cv_struct_utmpx_host=no)]) |
|
|
759 | if test x$rxvt_cv_struct_utmpx_host = xyes; then |
747 | if test x$rxvt_cv_struct_utmpx_host = xyes; then |
760 | AC_DEFINE(HAVE_UTMPX_HOST, 1, Define if struct utmpx contains ut_host) |
748 | AC_DEFINE(HAVE_UTMPX_HOST, 1, Define if struct utmpx contains ut_host) |
761 | fi |
749 | fi |
762 | ) dnl# AC_CHECK_HEADER(utmpx.h |
750 | ) dnl# AC_CHECK_HEADER(utmpx.h |
763 | |
751 | |
764 | |
752 | |
765 | dnl# -------------------------------------------------------------------------- |
753 | dnl# -------------------------------------------------------------------------- |
766 | dnl# check for struct lastlog |
754 | dnl# check for struct lastlog |
767 | AC_CACHE_CHECK(for struct lastlog, rxvt_cv_struct_lastlog, |
755 | AC_CACHE_CHECK(for struct lastlog, rxvt_cv_struct_lastlog, |
768 | [AC_TRY_COMPILE([#include <sys/types.h> |
756 | [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h> |
769 | #include <utmp.h> |
757 | #include <utmp.h> |
770 | #ifdef HAVE_LASTLOG_H |
758 | #ifdef HAVE_LASTLOG_H |
771 | #include <lastlog.h> |
759 | #include <lastlog.h> |
772 | #endif |
760 | #endif |
773 | ], |
|
|
774 | [struct lastlog ll;], |
|
|
775 | rxvt_cv_struct_lastlog=yes, rxvt_cv_struct_lastlog=no)]) |
761 | ]], [[struct lastlog ll;]])],[rxvt_cv_struct_lastlog=yes],[rxvt_cv_struct_lastlog=no])]) |
776 | if test x$rxvt_cv_struct_lastlog = xyes; then |
762 | if test x$rxvt_cv_struct_lastlog = xyes; then |
777 | AC_DEFINE(HAVE_STRUCT_LASTLOG, 1, Define if utmp.h or lastlog.h has struct lastlog) |
763 | AC_DEFINE(HAVE_STRUCT_LASTLOG, 1, Define if utmp.h or lastlog.h has struct lastlog) |
778 | fi |
764 | fi |
779 | |
765 | |
780 | dnl# check for struct lastlogx |
766 | dnl# check for struct lastlogx |
781 | AC_CACHE_CHECK(for struct lastlogx, rxvt_cv_struct_lastlogx, |
767 | AC_CACHE_CHECK(for struct lastlogx, rxvt_cv_struct_lastlogx, |
782 | [AC_TRY_COMPILE([#include <sys/types.h> |
768 | [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h> |
783 | #include <utmpx.h> |
769 | #include <utmpx.h> |
784 | #ifdef HAVE_LASTLOG_H |
770 | #ifdef HAVE_LASTLOG_H |
785 | #include <lastlog.h> |
771 | #include <lastlog.h> |
786 | #endif |
772 | #endif |
787 | ], |
|
|
788 | [struct lastlogx ll;], |
|
|
789 | rxvt_cv_struct_lastlogx=yes, rxvt_cv_struct_lastlogx=no)]) |
773 | ]], [[struct lastlogx ll;]])],[rxvt_cv_struct_lastlogx=yes],[rxvt_cv_struct_lastlogx=no])]) |
790 | if test x$rxvt_cv_struct_lastlogx = xyes; then |
774 | if test x$rxvt_cv_struct_lastlogx = xyes; then |
791 | AC_DEFINE(HAVE_STRUCT_LASTLOGX, 1, Define if utmpx.h or lastlog.h has struct lastlogx) |
775 | AC_DEFINE(HAVE_STRUCT_LASTLOGX, 1, Define if utmpx.h or lastlog.h has struct lastlogx) |
792 | fi |
776 | fi |
793 | |
777 | |
794 | dnl# -------------------------------------------------------------------------- |
778 | dnl# -------------------------------------------------------------------------- |
795 | dnl# FIND FILES |
779 | dnl# FIND FILES |
796 | dnl# -------------------------------------------------------------------------- |
780 | dnl# -------------------------------------------------------------------------- |
797 | |
781 | |
798 | dnl# find utmp |
782 | dnl# find utmp |
799 | AC_CACHE_CHECK(where utmp is located, rxvt_cv_path_utmp, |
783 | AC_CACHE_CHECK(where utmp is located, rxvt_cv_path_utmp, |
800 | [AC_TRY_RUN([#include <stdio.h> |
784 | [AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <stdio.h> |
801 | #include <sys/types.h> |
785 | #include <sys/types.h> |
802 | #include <utmp.h> |
786 | #include <utmp.h> |
803 | #include <errno.h> |
787 | #include <errno.h> |
804 | main() |
788 | main() |
805 | { |
789 | { |
… | |
… | |
820 | fprintf(f, "%s\n", *u); |
804 | fprintf(f, "%s\n", *u); |
821 | exit(0); |
805 | exit(0); |
822 | } |
806 | } |
823 | } |
807 | } |
824 | exit(0); |
808 | exit(0); |
825 | }], rxvt_cv_path_utmp=`cat conftestval`, rxvt_cv_path_utmp=, dnl |
809 | }]])],[rxvt_cv_path_utmp=`cat conftestval`],[rxvt_cv_path_utmp=],[dnl |
826 | AC_MSG_WARN([Define RXVT_UTMP_FILE in config.h manually]))]) |
810 | AC_MSG_WARN(Define RXVT_UTMP_FILE in config.h manually)])]) |
827 | if test x$rxvt_cv_path_utmp != x; then |
811 | if test x$rxvt_cv_path_utmp != x; then |
828 | AC_DEFINE_UNQUOTED(RXVT_UTMP_FILE, "$rxvt_cv_path_utmp", Define location of utmp) |
812 | AC_DEFINE_UNQUOTED(RXVT_UTMP_FILE, "$rxvt_cv_path_utmp", Define location of utmp) |
829 | fi |
813 | fi |
830 | |
814 | |
831 | dnl# -------------------------------------------------------------------------- |
815 | dnl# -------------------------------------------------------------------------- |
832 | |
816 | |
833 | dnl# find utmpx - if a utmp file exists at the same location and is more than |
817 | dnl# find utmpx - if a utmp file exists at the same location and is more than |
834 | dnl# a day newer, then dump the utmpx. People leave lots of junk around. |
818 | dnl# a day newer, then dump the utmpx. People leave lots of junk around. |
835 | AC_CACHE_CHECK(where utmpx is located, rxvt_cv_path_utmpx, |
819 | AC_CACHE_CHECK(where utmpx is located, rxvt_cv_path_utmpx, |
836 | [AC_TRY_RUN([#include <stdio.h> |
820 | [AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <stdio.h> |
837 | #include <sys/types.h> |
821 | #include <sys/types.h> |
838 | #include <utmpx.h> |
822 | #include <utmpx.h> |
839 | #include <errno.h> |
823 | #include <errno.h> |
840 | #include <sys/stat.h> |
824 | #include <sys/stat.h> |
841 | #ifdef HAVE_STRING_H |
825 | #ifdef HAVE_STRING_H |
… | |
… | |
866 | fprintf(f, "%s\n", *u); |
850 | fprintf(f, "%s\n", *u); |
867 | exit(0); |
851 | exit(0); |
868 | } |
852 | } |
869 | } |
853 | } |
870 | exit(0); |
854 | exit(0); |
871 | }], rxvt_cv_path_utmpx=`cat conftestval`, rxvt_cv_path_utmpx=, dnl |
855 | }]])],[rxvt_cv_path_utmpx=`cat conftestval`],[rxvt_cv_path_utmpx=],[dnl |
872 | AC_MSG_WARN([Define RXVT_UTMPX_FILE in config.h manually]))]) |
856 | AC_MSG_WARN(Define RXVT_UTMPX_FILE in config.h manually)])]) |
873 | if test x$rxvt_cv_path_utmpx != x; then |
857 | if test x$rxvt_cv_path_utmpx != x; then |
874 | AC_DEFINE_UNQUOTED(RXVT_UTMPX_FILE, "$rxvt_cv_path_utmpx", Define location of utmpx) |
858 | AC_DEFINE_UNQUOTED(RXVT_UTMPX_FILE, "$rxvt_cv_path_utmpx", Define location of utmpx) |
875 | fi |
859 | fi |
876 | |
860 | |
877 | dnl# -------------------------------------------------------------------------- |
861 | dnl# -------------------------------------------------------------------------- |
878 | |
862 | |
879 | dnl# find wtmp |
863 | dnl# find wtmp |
880 | AC_CACHE_CHECK(where wtmp is located, rxvt_cv_path_wtmp, |
864 | AC_CACHE_CHECK(where wtmp is located, rxvt_cv_path_wtmp, |
881 | [AC_TRY_RUN([#include <stdio.h> |
865 | [AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <stdio.h> |
882 | #include <sys/types.h> |
866 | #include <sys/types.h> |
883 | #ifdef HAVE_UTMP_H |
867 | #ifdef HAVE_UTMP_H |
884 | #include <utmp.h> |
868 | #include <utmp.h> |
885 | #endif |
869 | #endif |
886 | #include <errno.h> |
870 | #include <errno.h> |
… | |
… | |
903 | fprintf(f, "%s\n", *w); |
887 | fprintf(f, "%s\n", *w); |
904 | exit(0); |
888 | exit(0); |
905 | } |
889 | } |
906 | } |
890 | } |
907 | exit(0); |
891 | exit(0); |
908 | }], rxvt_cv_path_wtmp=`cat conftestval`, rxvt_cv_path_wtmp=, dnl |
892 | }]])],[rxvt_cv_path_wtmp=`cat conftestval`],[rxvt_cv_path_wtmp=],[dnl |
909 | AC_MSG_WARN([Define RXVT_WTMP_FILE in config.h manually]))]) |
893 | AC_MSG_WARN(Define RXVT_WTMP_FILE in config.h manually)])]) |
910 | if test x$rxvt_cv_path_wtmp != x; then |
894 | if test x$rxvt_cv_path_wtmp != x; then |
911 | AC_DEFINE_UNQUOTED(RXVT_WTMP_FILE, "$rxvt_cv_path_wtmp", Define location of wtmp) |
895 | AC_DEFINE_UNQUOTED(RXVT_WTMP_FILE, "$rxvt_cv_path_wtmp", Define location of wtmp) |
912 | fi |
896 | fi |
913 | dnl# -------------------------------------------------------------------------- |
897 | dnl# -------------------------------------------------------------------------- |
914 | |
898 | |
915 | dnl# find wtmpx |
899 | dnl# find wtmpx |
916 | AC_CACHE_CHECK(where wtmpx is located, rxvt_cv_path_wtmpx, |
900 | AC_CACHE_CHECK(where wtmpx is located, rxvt_cv_path_wtmpx, |
917 | [AC_TRY_RUN([#include <stdio.h> |
901 | [AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <stdio.h> |
918 | #ifdef HAVE_UTMPX_H |
902 | #ifdef HAVE_UTMPX_H |
919 | #include <utmpx.h> |
903 | #include <utmpx.h> |
920 | #endif |
904 | #endif |
921 | #include <errno.h> |
905 | #include <errno.h> |
922 | main() |
906 | main() |
… | |
… | |
938 | fprintf(f, "%s\n", *w); |
922 | fprintf(f, "%s\n", *w); |
939 | exit(0); |
923 | exit(0); |
940 | } |
924 | } |
941 | } |
925 | } |
942 | exit(0); |
926 | exit(0); |
943 | }], rxvt_cv_path_wtmpx=`cat conftestval`, rxvt_cv_path_wtmpx=, dnl |
927 | }]])],[rxvt_cv_path_wtmpx=`cat conftestval`],[rxvt_cv_path_wtmpx=],[dnl |
944 | AC_MSG_WARN([Define RXVT_WTMPX_FILE in config.h manually]))]) |
928 | AC_MSG_WARN(Define RXVT_WTMPX_FILE in config.h manually)])]) |
945 | if test x$rxvt_cv_path_wtmpx != x; then |
929 | if test x$rxvt_cv_path_wtmpx != x; then |
946 | AC_DEFINE_UNQUOTED(RXVT_WTMPX_FILE, "$rxvt_cv_path_wtmpx", Define location of wtmpx) |
930 | AC_DEFINE_UNQUOTED(RXVT_WTMPX_FILE, "$rxvt_cv_path_wtmpx", Define location of wtmpx) |
947 | fi |
931 | fi |
948 | dnl# -------------------------------------------------------------------------- |
932 | dnl# -------------------------------------------------------------------------- |
949 | |
933 | |
950 | dnl# find lastlog |
934 | dnl# find lastlog |
951 | AC_CACHE_CHECK(where lastlog is located, rxvt_cv_path_lastlog, |
935 | AC_CACHE_CHECK(where lastlog is located, rxvt_cv_path_lastlog, |
952 | [AC_TRY_RUN([#include <stdio.h> |
936 | [AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <stdio.h> |
953 | #include <sys/types.h> |
937 | #include <sys/types.h> |
954 | #ifdef HAVE_UTMPX_H |
938 | #ifdef HAVE_UTMPX_H |
955 | #include <utmpx.h> |
939 | #include <utmpx.h> |
956 | #elif defined(HAVE_UTMP_H) |
940 | #elif defined(HAVE_UTMP_H) |
957 | #include <utmp.h> |
941 | #include <utmp.h> |
… | |
… | |
978 | fprintf(f, "%s\n", *w); |
962 | fprintf(f, "%s\n", *w); |
979 | exit(0); |
963 | exit(0); |
980 | } |
964 | } |
981 | } |
965 | } |
982 | exit(0); |
966 | exit(0); |
983 | }], rxvt_cv_path_lastlog=`cat conftestval`, rxvt_cv_path_lastlog=, dnl |
967 | }]])],[rxvt_cv_path_lastlog=`cat conftestval`],[rxvt_cv_path_lastlog=],[dnl |
984 | AC_MSG_WARN([Define RXVT_LASTLOG_FILE in config.h manually]))]) |
968 | AC_MSG_WARN(Define RXVT_LASTLOG_FILE in config.h manually)])]) |
985 | if test x$rxvt_cv_path_lastlog != x; then |
969 | if test x$rxvt_cv_path_lastlog != x; then |
986 | AC_DEFINE_UNQUOTED(RXVT_LASTLOG_FILE, "$rxvt_cv_path_lastlog", Define location of lastlog) |
970 | AC_DEFINE_UNQUOTED(RXVT_LASTLOG_FILE, "$rxvt_cv_path_lastlog", Define location of lastlog) |
987 | if test -d "$rxvt_cv_path_lastlog"; then |
971 | if test -d "$rxvt_cv_path_lastlog"; then |
988 | AC_DEFINE(LASTLOG_IS_DIR, 1, Define if lastlog is provided via a directory) |
972 | AC_DEFINE(LASTLOG_IS_DIR, 1, Define if lastlog is provided via a directory) |
989 | fi |
973 | fi |
990 | fi |
974 | fi |
991 | dnl# -------------------------------------------------------------------------- |
975 | dnl# -------------------------------------------------------------------------- |
992 | |
976 | |
993 | dnl# find lastlogx |
977 | dnl# find lastlogx |
994 | AC_CACHE_CHECK(where lastlogx is located, rxvt_cv_path_lastlogx, |
978 | AC_CACHE_CHECK(where lastlogx is located, rxvt_cv_path_lastlogx, |
995 | [AC_TRY_RUN([#include <stdio.h> |
979 | [AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <stdio.h> |
996 | #ifdef HAVE_UTMPX_H |
980 | #ifdef HAVE_UTMPX_H |
997 | #include <utmpx.h> |
981 | #include <utmpx.h> |
998 | #endif |
982 | #endif |
999 | #include <errno.h> |
983 | #include <errno.h> |
1000 | main() |
984 | main() |
… | |
… | |
1015 | fprintf(f, "%s\n", *w); |
999 | fprintf(f, "%s\n", *w); |
1016 | exit(0); |
1000 | exit(0); |
1017 | } |
1001 | } |
1018 | } |
1002 | } |
1019 | exit(0); |
1003 | exit(0); |
1020 | }], rxvt_cv_path_lastlogx=`cat conftestval`, rxvt_cv_path_lastlogx=, dnl |
1004 | }]])],[rxvt_cv_path_lastlogx=`cat conftestval`],[rxvt_cv_path_lastlogx=],[dnl |
1021 | AC_MSG_WARN([Define RXVT_LASTLOGX_FILE in config.h manually]))]) |
1005 | AC_MSG_WARN(Define RXVT_LASTLOGX_FILE in config.h manually)])]) |
1022 | if test x$rxvt_cv_path_lastlogx != x; then |
1006 | if test x$rxvt_cv_path_lastlogx != x; then |
1023 | AC_DEFINE_UNQUOTED(RXVT_LASTLOGX_FILE, "$rxvt_cv_path_lastlogx", Define location of lastlogx) |
1007 | AC_DEFINE_UNQUOTED(RXVT_LASTLOGX_FILE, "$rxvt_cv_path_lastlogx", Define location of lastlogx) |
1024 | fi |
1008 | fi |
1025 | |
1009 | |
1026 | dnl# -------------------------------------------------------------------------- |
1010 | dnl# -------------------------------------------------------------------------- |
… | |
… | |
1050 | LIBS="$LIBS $X_LIBS $X_EXTRA_LIBS -lX11" |
1034 | LIBS="$LIBS $X_LIBS $X_EXTRA_LIBS -lX11" |
1051 | if test x$rxvt_cv_rpath = xyes -o x$rxvt_cv_R = xyes; then |
1035 | if test x$rxvt_cv_rpath = xyes -o x$rxvt_cv_R = xyes; then |
1052 | LIBS=`echo $LIBS | sed "$R_TRANSLATE"` |
1036 | LIBS=`echo $LIBS | sed "$R_TRANSLATE"` |
1053 | fi |
1037 | fi |
1054 | AC_CACHE_CHECK(for working Xlocale, rxvt_cv_func_xlocale, |
1038 | AC_CACHE_CHECK(for working Xlocale, rxvt_cv_func_xlocale, |
1055 | [AC_TRY_RUN([#include <X11/Xlib.h> |
1039 | [AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <X11/Xlib.h> |
1056 | main() { |
1040 | main() { |
1057 | char *p; |
1041 | char *p; |
1058 | if ((p = XSetLocaleModifiers("@im=none")) != NULL && *p) |
1042 | if ((p = XSetLocaleModifiers("@im=none")) != NULL && *p) |
1059 | exit (XSupportsLocale() ? 0 : 1); |
1043 | exit (XSupportsLocale() ? 0 : 1); |
1060 | else |
1044 | else |
1061 | exit (1);}], dnl |
1045 | exit (1);}]])],[dnl |
1062 | rxvt_cv_func_xlocale=yes, rxvt_cv_func_xlocale=no, dnl |
1046 | rxvt_cv_func_xlocale=yes],[rxvt_cv_func_xlocale=no],[dnl |
1063 | AC_MSG_WARN([Define NO_XLOCALE in config.h manually]))]) |
1047 | AC_MSG_WARN(Define NO_XLOCALE in config.h manually)])]) |
1064 | if test x$rxvt_cv_func_xlocale = xyes; then |
1048 | if test x$rxvt_cv_func_xlocale = xyes; then |
1065 | AC_DEFINE(HAVE_XLOCALE, 1, Define if Xlocale support works) |
1049 | AC_DEFINE(HAVE_XLOCALE, 1, Define if Xlocale support works) |
1066 | fi |
1050 | fi |
1067 | |
1051 | |
1068 | AC_CACHE_CHECK(for working X setlocale, rxvt_cv_func_xsetlocale, |
1052 | AC_CACHE_CHECK(for working X setlocale, rxvt_cv_func_xsetlocale, |
1069 | [AC_TRY_LINK([#define X_LOCALE 1 |
1053 | [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#define X_LOCALE 1 |
1070 | #include <X11/Xlocale.h>], |
1054 | #include <X11/Xlocale.h>]], [[setlocale(LC_CTYPE, "");]])],[rxvt_cv_func_xsetlocale=yes],[rxvt_cv_func_xsetlocale=no])]) |
1071 | [setlocale(LC_CTYPE, "");], |
|
|
1072 | rxvt_cv_func_xsetlocale=yes, rxvt_cv_func_xsetlocale=no)]) |
|
|
1073 | if test x$rxvt_cv_func_xsetlocale = xyes; then |
1055 | if test x$rxvt_cv_func_xsetlocale = xyes; then |
1074 | AC_DEFINE(HAVE_XSETLOCALE, 1, Define if setlocale (defined to Xsetlocale) works) |
1056 | AC_DEFINE(HAVE_XSETLOCALE, 1, Define if setlocale (defined to Xsetlocale) works) |
1075 | fi |
1057 | fi |
1076 | LIBS=$ac_save_LIBS |
1058 | LIBS=$ac_save_LIBS |
1077 | CFLAGS=$ac_save_CFLAGS |
1059 | CFLAGS=$ac_save_CFLAGS |
1078 | |
1060 | |
1079 | AC_CACHE_CHECK(for working plain setlocale, rxvt_cv_func_setlocale, |
1061 | AC_CACHE_CHECK(for working plain setlocale, rxvt_cv_func_setlocale, |
1080 | [AC_TRY_LINK([#include <clocale>], |
1062 | [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <clocale>]], [[setlocale(LC_CTYPE, "");]])],[rxvt_cv_func_setlocale=yes],[rxvt_cv_func_setlocale=no])]) |
1081 | [setlocale(LC_CTYPE, "");], |
|
|
1082 | rxvt_cv_func_setlocale=yes, rxvt_cv_func_setlocale=no)]) |
|
|
1083 | if test x$rxvt_cv_func_setlocale = xyes; then |
1063 | if test x$rxvt_cv_func_setlocale = xyes; then |
1084 | AC_DEFINE(HAVE_SETLOCALE, 1, Define if plain old setlocale works) |
1064 | AC_DEFINE(HAVE_SETLOCALE, 1, Define if plain old setlocale works) |
1085 | fi |
1065 | fi |
1086 | |
1066 | |
1087 | AC_CACHE_CHECK(for working nl_langinfo, rxvt_cv_func_nl_langinfo, |
1067 | AC_CACHE_CHECK(for working nl_langinfo, rxvt_cv_func_nl_langinfo, |
1088 | [AC_TRY_LINK([#include <langinfo.h>], |
1068 | [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <langinfo.h>]], [[nl_langinfo(CODESET);]])],[rxvt_cv_func_nl_langinfo=yes],[rxvt_cv_func_nl_langinfo=no])]) |
1089 | [nl_langinfo(CODESET);], |
|
|
1090 | rxvt_cv_func_nl_langinfo=yes, rxvt_cv_func_nl_langinfo=no)]) |
|
|
1091 | if test x$rxvt_cv_func_nl_langinfo = xyes; then |
1069 | if test x$rxvt_cv_func_nl_langinfo = xyes; then |
1092 | AC_DEFINE(HAVE_NL_LANGINFO, 1, Define if nl_langinfo(CODESET) works) |
1070 | AC_DEFINE(HAVE_NL_LANGINFO, 1, Define if nl_langinfo(CODESET) works) |
1093 | fi |
1071 | fi |
1094 | |
1072 | |
1095 | AC_CACHE_CHECK(for broken XIM callback, rxvt_broken_ximcb, |
1073 | AC_CACHE_CHECK(for broken XIM callback, rxvt_broken_ximcb, |
… | |
… | |
1107 | if test x$rxvt_broken_ximcb = xyes; then |
1085 | if test x$rxvt_broken_ximcb = xyes; then |
1108 | AC_DEFINE(XIMCB_PROTO_BROKEN, 1, Define if your XIMCallback specifies XIC as first type.) |
1086 | AC_DEFINE(XIMCB_PROTO_BROKEN, 1, Define if your XIMCallback specifies XIC as first type.) |
1109 | fi |
1087 | fi |
1110 | |
1088 | |
1111 | AC_CACHE_CHECK(for getpt, rxvt_cv_func_getpt, |
1089 | AC_CACHE_CHECK(for getpt, rxvt_cv_func_getpt, |
1112 | [AC_TRY_LINK([#define _GNU_SOURCE |
1090 | [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#define _GNU_SOURCE |
1113 | #ifdef HAVE_STDLIB_H |
1091 | #ifdef HAVE_STDLIB_H |
1114 | # include <cstdlib> |
1092 | # include <cstdlib> |
1115 | #endif], |
1093 | #endif]], [[(void)getpt();]])],[rxvt_cv_func_getpt=yes],[rxvt_cv_func_getpt=no])]) |
1116 | [(void)getpt();], |
|
|
1117 | rxvt_cv_func_getpt=yes, rxvt_cv_func_getpt=no)]) |
|
|
1118 | if test x$rxvt_cv_func_getpt = xyes; then |
1094 | if test x$rxvt_cv_func_getpt = xyes; then |
1119 | AC_DEFINE(HAVE_GETPT, 1, Define if you have _GNU_SOURCE getpt() ) |
1095 | AC_DEFINE(HAVE_GETPT, 1, Define if you have _GNU_SOURCE getpt() ) |
1120 | fi |
1096 | fi |
1121 | |
1097 | |
1122 | dnl# if we don't guess right then it's up to the user |
1098 | dnl# if we don't guess right then it's up to the user |
… | |
… | |
1180 | if test x$rxvt_cv_ptys = xBSD -o x$rxvt_cv_ptys = xHPUX -o x$rxvt_cv_ptys = xGLIBC; then |
1156 | if test x$rxvt_cv_ptys = xBSD -o x$rxvt_cv_ptys = xHPUX -o x$rxvt_cv_ptys = xGLIBC; then |
1181 | AC_DEFINE(PTYS_ARE_SEARCHED, 1, Define for this pty type) |
1157 | AC_DEFINE(PTYS_ARE_SEARCHED, 1, Define for this pty type) |
1182 | fi |
1158 | fi |
1183 | |
1159 | |
1184 | |
1160 | |
1185 | AC_CHECKING(for pty ranges) |
1161 | AS_MESSAGE(checking for pty ranges...) |
1186 | ptys=`echo /dev/pty??` |
1162 | ptys=`echo /dev/pty??` |
1187 | pch1=`echo $ptys | tr ' ' '\012' | sed -e 's/^.*\(.\).$/\1/g' | sort -u | tr -d '\012'` |
1163 | pch1=`echo $ptys | tr ' ' '\012' | sed -e 's/^.*\(.\).$/\1/g' | sort -u | tr -d '\012'` |
1188 | pch2=`echo $ptys | tr ' ' '\012' | sed -e 's/^.*\(.\)$/\1/g' | sort -u | tr -d '\012'` |
1164 | pch2=`echo $ptys | tr ' ' '\012' | sed -e 's/^.*\(.\)$/\1/g' | sort -u | tr -d '\012'` |
1189 | if test x$pch1 != x; then |
1165 | if test x$pch1 != x; then |
1190 | AC_DEFINE_UNQUOTED(PTYCHAR1, "$pch1", Define for first char in devptyXX) |
1166 | AC_DEFINE_UNQUOTED(PTYCHAR1, "$pch1", Define for first char in devptyXX) |
… | |
… | |
1367 | if test x$support_xft = xyes; then |
1343 | if test x$support_xft = xyes; then |
1368 | AC_DEFINE(XFT, 1, Define to enable xft support) |
1344 | AC_DEFINE(XFT, 1, Define to enable xft support) |
1369 | fi |
1345 | fi |
1370 | fi |
1346 | fi |
1371 | |
1347 | |
1372 | AC_OUTPUT(autoconf/Make.common \ |
1348 | AC_CONFIG_FILES([autoconf/Make.common \ |
1373 | Makefile \ |
1349 | Makefile \ |
1374 | doc/Makefile \ |
1350 | doc/Makefile \ |
1375 | src/Makefile \ |
1351 | src/Makefile \ |
1376 | src/test/Makefile \ |
1352 | src/test/Makefile \ |
1377 | src/rxvtlib.h \ |
1353 | src/rxvtlib.h \ |
1378 | W11/Makefile \ |
1354 | W11/Makefile \ |
1379 | ) |
1355 | ]) |
|
|
1356 | AC_OUTPUT |
1380 | |
1357 | |
1381 | echo "Configuration: |
1358 | echo "Configuration: |
1382 | |
1359 | |
1383 | Rxvt version: $VERSION : $DATE |
1360 | Rxvt version: $VERSION : $DATE |
1384 | Source code location: $srcdir |
1361 | Source code location: $srcdir |