… | |
… | |
15 | DATE=`sed -n -e 's/^.*[ \t]DATE.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h` |
15 | DATE=`sed -n -e 's/^.*[ \t]DATE.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h` |
16 | dnl LIBVERSION=`sed -n -e 's/^.*[ \t]LIBVERSION.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h` |
16 | dnl LIBVERSION=`sed -n -e 's/^.*[ \t]LIBVERSION.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h` |
17 | changequote([, ])dnl |
17 | changequote([, ])dnl |
18 | AC_SUBST(VERSION)dnl |
18 | AC_SUBST(VERSION)dnl |
19 | AC_SUBST(DATE)dnl |
19 | AC_SUBST(DATE)dnl |
20 | AC_SUBST(LSMDATE)dnl |
|
|
21 | AC_SUBST(LIBVERSION)dnl |
20 | dnl AC_SUBST(LIBVERSION)dnl |
22 | |
21 | |
23 | echo "" |
22 | echo "" |
24 | echo "configuring for rxvt $VERSION" |
23 | echo "configuring for rxvt $VERSION" |
25 | echo "" |
24 | echo "" |
26 | |
25 | |
… | |
… | |
31 | AC_PROG_CXX |
30 | AC_PROG_CXX |
32 | AC_PROG_CPP |
31 | AC_PROG_CPP |
33 | AC_PROG_INSTALL |
32 | AC_PROG_INSTALL |
34 | |
33 | |
35 | AC_AIX |
34 | AC_AIX |
|
|
35 | AC_GNU_SOURCE |
36 | AC_ISC_POSIX |
36 | AC_ISC_POSIX |
37 | AC_LANG(C++) |
37 | AC_LANG(C++) |
38 | |
38 | |
39 | dnl check wether we can link with gcc -lsupc++ |
39 | dnl check wether we can link with gcc -lsupc++ |
40 | if test x$GCC = xyes && test x$GXX = xyes; then |
40 | if test x$GCC = xyes && test x$GXX = xyes; then |
… | |
… | |
69 | CXXFLAGS="-O" |
69 | CXXFLAGS="-O" |
70 | fi |
70 | fi |
71 | CFLAGS="$CXXFLAGS" |
71 | CFLAGS="$CXXFLAGS" |
72 | fi |
72 | fi |
73 | |
73 | |
74 | AC_DEFINE(_GNU_SOURCE, 1, Use all glibc features.) |
|
|
75 | |
|
|
76 | case $host in |
74 | case $host in |
77 | *-*-solaris* ) |
75 | *-*-solaris* ) |
78 | AC_DEFINE(_XOPEN_SOURCE, 500, Needed to get declarations for msg_control and msg_controllen on Solaris) |
76 | AC_DEFINE(_XOPEN_SOURCE, 500, Needed to get declarations for msg_control and msg_controllen on Solaris) |
79 | ;; |
77 | ;; |
80 | esac |
78 | esac |
81 | |
|
|
82 | dnl if test x$GXX = xyes; then |
|
|
83 | dnl CXXFLAGS="$CXXFLAGS" dnl I once had -fno-exceptions, but I am using them now... |
|
|
84 | dnl fi |
|
|
85 | |
79 | |
86 | dnl# FreeBSD needs to link libxpg4 |
80 | dnl# FreeBSD needs to link libxpg4 |
87 | AC_CHECK_FUNC(setlocale, [], [AC_CHECK_LIB(xpg4, setlocale, [LIBS="$LIBS -lxpg4"])]) |
81 | AC_CHECK_FUNC(setlocale, [], [AC_CHECK_LIB(xpg4, setlocale, [LIBS="$LIBS -lxpg4"])]) |
88 | |
82 | |
89 | dnl# solaris needs to link libnsl and socket |
83 | dnl# solaris needs to link libnsl and socket |
… | |
… | |
121 | |
115 | |
122 | dnl# -------------------------------------------------------------------------- |
116 | dnl# -------------------------------------------------------------------------- |
123 | dnl# CHECKING COMMAND LINE OPTIONS |
117 | dnl# CHECKING COMMAND LINE OPTIONS |
124 | dnl# -------------------------------------------------------------------------- |
118 | dnl# -------------------------------------------------------------------------- |
125 | |
119 | |
126 | if test "x$enable_shared" = xyes; then |
120 | dnl if test "x$enable_shared" = xyes; then |
127 | AC_DEFINE(LIBRXVT, 1, Build shared library version - specify via configure only) |
121 | dnl AC_DEFINE(LIBRXVT, 1, Build shared library version - specify via configure only) |
128 | INSTALL_LIBRXVT=yes |
122 | dnl INSTALL_LIBRXVT=yes |
129 | fi |
123 | dnl fi |
130 | AC_SUBST(INSTALL_LIBRXVT) |
124 | dnl AC_SUBST(INSTALL_LIBRXVT) |
131 | |
125 | |
132 | AC_ARG_ENABLE(everything, |
126 | AC_ARG_ENABLE(everything, |
133 | [ --enable-everything enable standard non-multichoice features |
127 | [ --enable-everything enable standard non-multichoice features |
134 | NOTE: this option is order dependent], |
128 | NOTE: this option is order dependent], |
135 | [ |
129 | [ |
… | |
… | |
481 | |
475 | |
482 | dnl# -------------------------------------------------------------------------- |
476 | dnl# -------------------------------------------------------------------------- |
483 | dnl# CHECKING FOR HEADER FILES |
477 | dnl# CHECKING FOR HEADER FILES |
484 | dnl# -------------------------------------------------------------------------- |
478 | dnl# -------------------------------------------------------------------------- |
485 | AC_CHECK_HEADERS( \ |
479 | AC_CHECK_HEADERS( \ |
486 | assert.h \ |
|
|
487 | fcntl.h \ |
|
|
488 | stdarg.h \ |
|
|
489 | stdlib.h \ |
|
|
490 | string.h \ |
|
|
491 | termios.h \ |
|
|
492 | unistd.h \ |
|
|
493 | sys/byteorder.h \ |
480 | sys/byteorder.h \ |
494 | sys/ioctl.h \ |
481 | sys/ioctl.h \ |
495 | sys/select.h \ |
|
|
496 | sys/sockio.h \ |
482 | sys/sockio.h \ |
497 | sys/strredir.h \ |
483 | sys/strredir.h \ |
498 | sys/time.h \ |
|
|
499 | stdint.h \ |
484 | stdint.h \ |
500 | wchar.h \ |
485 | wchar.h \ |
501 | cwchar \ |
486 | cwchar \ |
502 | clocale \ |
|
|
503 | ) |
487 | ) |
504 | |
|
|
505 | dnl# check to allow both <termios.h> and <sys/ioctl.h> |
|
|
506 | AC_CACHE_CHECK(whether termios.h and sys/ioctl.h may both be included, rxvt_cv_header_sysioctl, |
|
|
507 | [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <stdio.h> |
|
|
508 | #include <sys/ioctl.h> |
|
|
509 | #ifdef HAVE_TERMIOS_H |
|
|
510 | #include <termios.h> |
|
|
511 | #endif]], [[int a = ECHO;]])],[rxvt_cv_header_sysioctl=yes],[rxvt_cv_header_sysioctl=no])]) |
|
|
512 | |
488 | |
513 | AC_CACHE_CHECK([for XPointer], rxvt_cv_xpointer, |
489 | AC_CACHE_CHECK([for XPointer], rxvt_cv_xpointer, |
514 | [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <X11/Xlib.h>]], [[XPointer dummy;]])],[rxvt_cv_xpointer=yes],[rxvt_cv_xpointer=no])]) |
490 | [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <X11/Xlib.h>]], [[XPointer dummy;]])],[rxvt_cv_xpointer=yes],[rxvt_cv_xpointer=no])]) |
515 | if test x$rxvt_cv_xpointer = xyes; then |
491 | if test x$rxvt_cv_xpointer = xyes; then |
516 | AC_DEFINE(HAVE_XPOINTER, 1, Define if you have XPointer typedef) |
492 | AC_DEFINE(HAVE_XPOINTER, 1, Define if you have XPointer typedef) |
… | |
… | |
534 | dnl# -------------------------------------------------------------------------- |
510 | dnl# -------------------------------------------------------------------------- |
535 | dnl# CHECKING FOR MISSING TYPEDEFS |
511 | dnl# CHECKING FOR MISSING TYPEDEFS |
536 | dnl# -------------------------------------------------------------------------- |
512 | dnl# -------------------------------------------------------------------------- |
537 | dnl# Missing typedefs and replacements |
513 | dnl# Missing typedefs and replacements |
538 | AC_TYPE_MODE_T |
514 | AC_TYPE_MODE_T |
539 | dnl> AC_CHECK_TYPE(umode_t, int) |
|
|
540 | dnl> AC_CHECK_TYPE(off_t, long) |
|
|
541 | AC_TYPE_PID_T |
515 | AC_TYPE_PID_T |
542 | AC_TYPE_UID_T |
516 | AC_TYPE_UID_T |
543 | |
517 | AC_TYPE_INT16_T |
544 | AC_CHECK_SIZEOF(short, 2) |
518 | AC_TYPE_UINT16_T |
545 | AC_CHECK_SIZEOF(int, 4) |
519 | AC_TYPE_INT32_T |
546 | dnl AC_CHECK_SIZEOF(long, 4) |
520 | AC_TYPE_UINT32_T |
547 | AC_CHECK_SIZEOF(long long, 8) |
|
|
548 | AC_CHECK_SIZEOF(int *, 4) |
|
|
549 | |
|
|
550 | dnl# see usage below |
|
|
551 | AC_DEFUN([RXVT_CHECK_SIZE], |
|
|
552 | [AC_CACHE_CHECK([for $2], $1, |
|
|
553 | [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <stdint.h>]], [[$2 dummy;]])],[$1=yes],[dnl |
|
|
554 | if test "$ac_cv_sizeof_char" -ge $3; then |
|
|
555 | $1="$4 char" |
|
|
556 | else |
|
|
557 | if test "$ac_cv_sizeof_short" -ge $3; then |
|
|
558 | $1="$4 short" |
|
|
559 | else |
|
|
560 | if test "$ac_cv_sizeof_int" -ge $3; then |
|
|
561 | $1="$4 int" |
|
|
562 | else |
|
|
563 | if test "$ac_cv_sizeof_long" -ge $3; then |
|
|
564 | $1="$4 long" |
|
|
565 | else |
|
|
566 | if test "$ac_cv_sizeof_long_long" -ge $3; then |
|
|
567 | $1="$4 long long" |
|
|
568 | else |
|
|
569 | $1="$4 $5" # we _must_ have a (possibly wrong) default |
|
|
570 | fi |
|
|
571 | fi |
|
|
572 | fi |
|
|
573 | fi |
|
|
574 | fi])])] |
|
|
575 | if test x"$$1" != xyes; then |
|
|
576 | $6="typedef $$1 $2;" |
|
|
577 | else |
|
|
578 | if test x"$4" = x; then |
|
|
579 | $6="/* typedef $5 $2; */" |
|
|
580 | else |
|
|
581 | $6="/* typedef $4 $5 $2; */" |
|
|
582 | fi |
|
|
583 | fi dnl |
|
|
584 | ) |
|
|
585 | dnl# |
|
|
586 | dnl# Look for types the system may know about anyway. |
|
|
587 | dnl# |
|
|
588 | RXVT_CHECK_SIZE(rxvt_cv_int16_t, int16_t, 2, , short, rxvt_int16_typedef) |
|
|
589 | AC_SUBST(rxvt_int16_typedef) |
|
|
590 | RXVT_CHECK_SIZE(rxvt_cv_uint16_t, uint16_t, 2, unsigned, short, rxvt_uint16_typedef) |
|
|
591 | AC_SUBST(rxvt_uint16_typedef) |
|
|
592 | RXVT_CHECK_SIZE(rxvt_cv_int32_t, int32_t, 4, , int, rxvt_int32_typedef) |
|
|
593 | AC_SUBST(rxvt_int32_typedef) |
|
|
594 | RXVT_CHECK_SIZE(rxvt_cv_uint32_t, uint32_t, 4, unsigned, int, rxvt_uint32_typedef) |
|
|
595 | AC_SUBST(rxvt_uint32_typedef) |
|
|
596 | dnl RXVT_CHECK_SIZE(rxvt_cv_int64_t, int64_t, 8, , long long, rxvt_int64_typedef) |
|
|
597 | dnl AC_SUBST(rxvt_int64_typedef) |
|
|
598 | dnl RXVT_CHECK_SIZE(rxvt_cv_uint64_t, uint64_t, 8, unsigned, long long, rxvt_uint64_typedef) |
|
|
599 | dnl AC_SUBST(rxvt_uint64_typedef) |
|
|
600 | dnl# |
|
|
601 | dnl# Now look for another we use |
|
|
602 | dnl# |
|
|
603 | if test "$ac_cv_sizeof_int_p" -eq 8; then |
|
|
604 | rxvt_intp_define="#define intp_t int64_t" |
|
|
605 | rxvt_u_intp_define="#define u_intp_t u_int64_t" |
|
|
606 | else |
|
|
607 | if test "$ac_cv_sizeof_int_p" -eq 4; then |
|
|
608 | rxvt_intp_define="#define intp_t int32_t" |
|
|
609 | rxvt_u_intp_define="#define u_intp_t u_int32_t" |
|
|
610 | else |
|
|
611 | if test "$ac_cv_sizeof_int_p" -eq 2; then |
|
|
612 | rxvt_intp_define="#define intp_t int16_t" |
|
|
613 | rxvt_u_intp_define="#define u_intp_t u_int16_t" |
|
|
614 | else |
|
|
615 | rxvt_intp_define="#error set intp_t" |
|
|
616 | rxvt_u_intp_define="#error set u_intp_t" |
|
|
617 | fi |
|
|
618 | fi |
|
|
619 | fi |
|
|
620 | AC_SUBST(rxvt_intp_define) |
|
|
621 | AC_SUBST(rxvt_u_intp_define) |
|
|
622 | |
521 | |
623 | dnl# -------------------------------------------------------------------------- |
522 | dnl# -------------------------------------------------------------------------- |
624 | dnl# CHECKING FOR LIBRARY FUNCTIONS |
523 | dnl# CHECKING FOR LIBRARY FUNCTIONS |
625 | dnl# -------------------------------------------------------------------------- |
524 | dnl# -------------------------------------------------------------------------- |
626 | AC_CHECK_FUNCS(unsetenv) |
525 | AC_CHECK_FUNCS(unsetenv) |
… | |
… | |
814 | |
713 | |
815 | save_CXXFLAGS="$CXXFLAGS" |
714 | save_CXXFLAGS="$CXXFLAGS" |
816 | save_LIBS="$LIBS" |
715 | save_LIBS="$LIBS" |
817 | CXXFLAGS="$CXXFLAGS `$PERL -MExtUtils::Embed -e ccopts`" |
716 | CXXFLAGS="$CXXFLAGS `$PERL -MExtUtils::Embed -e ccopts`" |
818 | LIBS="$LIBS `$PERL -MExtUtils::Embed -e ldopts`" |
717 | LIBS="$LIBS `$PERL -MExtUtils::Embed -e ldopts`" |
819 | AC_TRY_LINK([ |
718 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[ |
820 | #include <EXTERN.h> |
719 | #include <EXTERN.h> |
821 | #include <perl.h> |
720 | #include <perl.h> |
822 | #include <XSUB.h> |
721 | #include <XSUB.h> |
823 | ],[ |
722 | ]], [[ |
824 | PerlInterpreter *perl = perl_alloc (); |
723 | PerlInterpreter *perl = perl_alloc (); |
825 | ],[rxvt_perl_link=yes],[rxvt_perl_link=no]) |
724 | ]])],[rxvt_perl_link=yes],[rxvt_perl_link=no]) |
826 | CXXFLAGS="$save_CXXFLAGS" |
725 | CXXFLAGS="$save_CXXFLAGS" |
827 | LIBS="$save_LIBS" |
726 | LIBS="$save_LIBS" |
828 | |
727 | |
829 | if test x$rxvt_perl_link = xyes; then |
728 | if test x$rxvt_perl_link = xyes; then |
830 | AC_MSG_RESULT(ok) |
729 | AC_MSG_RESULT(ok) |
… | |
… | |
861 | AC_SUBST(AFTERIMAGE_CFLAGS) |
760 | AC_SUBST(AFTERIMAGE_CFLAGS) |
862 | AC_SUBST(AFTERIMAGE_LIBS) |
761 | AC_SUBST(AFTERIMAGE_LIBS) |
863 | |
762 | |
864 | AC_ARG_PROGRAM |
763 | AC_ARG_PROGRAM |
865 | |
764 | |
866 | dnl# test for "sun" or "__sun__" before include sys_ioctl |
|
|
867 | |
|
|
868 | dnl# revert HAVE_BLAH_H into a "#include <blah.h>" |
765 | dnl# revert HAVE_BLAH_H into a "#include <blah.h>" |
869 | AC_DEFUN([RXVT_DEFINE_TO_INCLUDE], dnl |
766 | AC_DEFUN([RXVT_DEFINE_TO_INCLUDE], dnl |
870 | [if test "$$3" = "$4" -o "$$5" = "$6"; then |
767 | [if test "$$3" = "$4" -o "$$5" = "$6"; then |
871 | $1="#include <$2>" |
768 | $1="#include <$2>" |
872 | else |
769 | else |
873 | $1="/* #include <$2> */" |
770 | $1="/* #include <$2> */" |
874 | fi dnl |
771 | fi dnl |
875 | AC_SUBST($1)]) |
772 | AC_SUBST($1)]) |
876 | |
773 | |
877 | RXVT_DEFINE_TO_INCLUDE(include_stdint_h, stdint.h, ac_cv_header_stdint_h, yes, notset, dontmatch) |
774 | RXVT_DEFINE_TO_INCLUDE(include_stdint_h, stdint.h, ac_cv_header_stdint_h, yes, notset, dontmatch) |
878 | RXVT_DEFINE_TO_INCLUDE(include_stdarg_h, cstdarg, ac_cv_header_stdarg_h, yes, notset, dontmatch) |
|
|
879 | RXVT_DEFINE_TO_INCLUDE(include_stdlib_h, cstdlib, ac_cv_header_stdlib_h, yes, notset, dontmatch) |
|
|
880 | RXVT_DEFINE_TO_INCLUDE(include_unistd_h, unistd.h, ac_cv_header_unistd_h, yes, notset, dontmatch) |
|
|
881 | RXVT_DEFINE_TO_INCLUDE(include_string_h, cstring, ac_cv_header_string_h, yes, notset, dontmatch) |
|
|
882 | RXVT_DEFINE_TO_INCLUDE(include_fcntl_h, fcntl.h, ac_cv_header_fcntl_h, yes, notset, dontmatch) |
|
|
883 | RXVT_DEFINE_TO_INCLUDE(include_util_h, util.h, ac_cv_header_util_h, yes, notset, dontmatch) |
|
|
884 | RXVT_DEFINE_TO_INCLUDE(include_assert_h, assert.h, ac_cv_header_assert_h, yes, notset, dontmatch) |
|
|
885 | RXVT_DEFINE_TO_INCLUDE(include_sys_ioctl_h, sys/ioctl.h, rxvt_cv_header_sysioctl, yes, notset, dontmatch) |
775 | RXVT_DEFINE_TO_INCLUDE(include_sys_ioctl_h, sys/ioctl.h, ac_cv_header_sys_ioctl_h, yes, notset, dontmatch) |
886 | RXVT_DEFINE_TO_INCLUDE(include_sys_select_h, sys/select.h, ac_cv_header_sys_select_h, yes, notset, dontmatch) |
|
|
887 | RXVT_DEFINE_TO_INCLUDE(include_sys_strredir_h, sys/strredir.h, ac_cv_header_sys_strredir_h, yes, notset, dontmatch) |
776 | RXVT_DEFINE_TO_INCLUDE(include_sys_strredir_h, sys/strredir.h, ac_cv_header_sys_strredir_h, yes, notset, dontmatch) |
888 | RXVT_DEFINE_TO_INCLUDE(include_sys_time_h, sys/time.h, ac_cv_header_sys_time_h, yes, notset, dontmatch) |
|
|
889 | RXVT_DEFINE_TO_INCLUDE(include_time_h, time.h, ac_cv_header_sys_time_h, no, ac_cv_header_time, yes) |
|
|
890 | |
777 | |
891 | AC_CONFIG_FILES([Makefile \ |
778 | AC_CONFIG_FILES([Makefile \ |
892 | doc/Makefile \ |
779 | doc/Makefile \ |
893 | src/Makefile \ |
780 | src/Makefile \ |
894 | src/rxvtlib.h \ |
781 | src/rxvtlib.h \ |