… | |
… | |
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 |
20 | AC_SUBST(LSMDATE)dnl |
21 | AC_SUBST(LIBVERSION)dnl |
21 | AC_SUBST(LIBVERSION)dnl |
|
|
22 | |
22 | echo "" |
23 | echo "" |
23 | echo "configuring for rxvt $VERSION" |
24 | echo "configuring for rxvt $VERSION" |
24 | echo "" |
25 | echo "" |
25 | |
26 | |
26 | orig_CXXFLAGS="$CXXFLAGS" |
27 | orig_CXXFLAGS="$CXXFLAGS" |
27 | |
28 | |
28 | dnl# Checks for programs. |
29 | dnl# Checks for programs. |
29 | dnl AC_MAKE_SET |
|
|
30 | |
|
|
31 | AC_PROG_CC |
30 | AC_PROG_CC |
32 | AC_PROG_CXX |
31 | AC_PROG_CXX |
33 | AC_PROG_CPP |
32 | AC_PROG_CPP |
34 | AC_PROG_INSTALL |
33 | AC_PROG_INSTALL |
35 | |
34 | |
… | |
… | |
62 | dnl# -------------------------------------------------------------------------- |
61 | dnl# -------------------------------------------------------------------------- |
63 | dnl# Supply default CXXFLAGS, if not specified by `CXXFLAGS=flags ./configure' |
62 | dnl# Supply default CXXFLAGS, if not specified by `CXXFLAGS=flags ./configure' |
64 | dnl# |
63 | dnl# |
65 | if test -z "$orig_CXXFLAGS"; then |
64 | if test -z "$orig_CXXFLAGS"; then |
66 | if test x$GCC = xyes && test "x$GXX" = xyes; then |
65 | if test x$GCC = xyes && test "x$GXX" = xyes; then |
67 | CXXFLAGS="-g -O3 -fno-threadsafe-statics -fno-enforce-eh-specs" |
66 | CXXFLAGS="-g -O3 -fno-rtti -fvisibility-inlines-hidden -fno-threadsafe-statics -fno-enforce-eh-specs" |
68 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])], [], [CXXFLAGS="-g -O3"]) |
67 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])], [], [CXXFLAGS="-g -O3"]) |
69 | else |
68 | else |
70 | CXXFLAGS="-O" |
69 | CXXFLAGS="-O" |
71 | fi |
70 | fi |
72 | CFLAGS="$CXXFLAGS" |
71 | CFLAGS="$CXXFLAGS" |
… | |
… | |
130 | fi |
129 | fi |
131 | AC_SUBST(INSTALL_LIBRXVT) |
130 | AC_SUBST(INSTALL_LIBRXVT) |
132 | |
131 | |
133 | AC_ARG_ENABLE(everything, |
132 | AC_ARG_ENABLE(everything, |
134 | [ --enable-everything enable standard non-multichoice features |
133 | [ --enable-everything enable standard non-multichoice features |
135 | NOTE: this option is order dependent |
134 | NOTE: this option is order dependent], |
136 | NOTE: automatically enabled with --enable-shared], |
|
|
137 | [ |
135 | [ |
138 | if test x$enableval = xno; then |
136 | if test x$enableval = xno; then |
139 | support_frills=no |
137 | support_frills=no |
140 | support_inheritpixmap=no |
138 | support_inheritpixmap=no |
141 | support_fading=no |
139 | support_fading=no |
… | |
… | |
193 | support_perl=yes |
191 | support_perl=yes |
194 | codesets=all |
192 | codesets=all |
195 | fi |
193 | fi |
196 | ]) |
194 | ]) |
197 | |
195 | |
|
|
196 | WARNINGS=no |
|
|
197 | AC_ARG_ENABLE(warnings, |
|
|
198 | [ --enable-warnings turn on g++ warnings], |
|
|
199 | [if test x$enableval = xyes; then |
|
|
200 | WARNINGS=yes |
|
|
201 | fi]) |
|
|
202 | if test x$GXX = xyes; then |
|
|
203 | if test $WARNINGS = yes; then |
|
|
204 | save_CXXFLAGS="$CXXFLAGS" |
|
|
205 | CXXFLAGS="$CXXFLAGS -Wall -Wno-sign-compare -Wno-reorder -Wno-non-virtual-dtor" |
|
|
206 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])], [], [CXXFLAGS="$save_CXXFLAGS"]) |
|
|
207 | else |
|
|
208 | CXXFLAGS="$CXXFLAGS -w" |
|
|
209 | fi |
|
|
210 | fi |
|
|
211 | |
198 | AC_ARG_ENABLE(unicode3, |
212 | AC_ARG_ENABLE(unicode3, |
199 | [ --enable-unicode3 use 21 instead of 16 bits to represent unicode characters], |
213 | [ --enable-unicode3 use 21 instead of 16 bits to represent unicode characters], |
200 | [if test x$enableval = xyes -o x$enableval = xno; then |
214 | [if test x$enableval = xyes -o x$enableval = xno; then |
201 | support_unicode3=$enableval |
215 | support_unicode3=$enableval |
202 | fi]) |
216 | fi]) |
… | |
… | |
265 | [ --enable-xterm-scroll enable Xterm style scrollbar], |
279 | [ --enable-xterm-scroll enable Xterm style scrollbar], |
266 | [if test x$enableval = xyes -o x$enableval = xno; then |
280 | [if test x$enableval = xyes -o x$enableval = xno; then |
267 | support_scroll_xterm=$enableval |
281 | support_scroll_xterm=$enableval |
268 | fi]) |
282 | fi]) |
269 | |
283 | |
|
|
284 | AC_ARG_ENABLE(plain-scroll, |
|
|
285 | [ --enable-plain-scroll enable plain style scrollbar], |
|
|
286 | [if test x$enableval = xyes -o x$enableval = xno; then |
|
|
287 | support_scroll_plain=$enableval |
|
|
288 | fi]) |
|
|
289 | |
270 | AC_ARG_ENABLE(perl, |
290 | AC_ARG_ENABLE(perl, |
271 | [ --enable-perl enable embedded perl interpreter], |
291 | [ --enable-perl enable embedded perl interpreter], |
272 | [if test x$enableval = xyes -o x$enableval = xno; then |
292 | [if test x$enableval = xyes -o x$enableval = xno; then |
273 | support_perl=$enableval |
293 | support_perl=$enableval |
274 | fi]) |
294 | fi]) |
275 | |
295 | |
276 | AC_ARG_ENABLE(plain-scroll, |
|
|
277 | [ --enable-plain-scroll enable plain style scrollbar], |
|
|
278 | [if test x$enableval = xyes -o x$enableval = xno; then |
|
|
279 | support_scroll_plain=$enableval |
|
|
280 | fi]) |
|
|
281 | |
|
|
282 | AC_ARG_WITH(codesets, |
296 | AC_ARG_WITH(codesets, |
283 | [ --with-codesets=CS,... compile in additional codesets (jp,jp_ext,kr,zh,zh_ext,all)], |
297 | [ --with-codesets=CS,... compile in additional codesets (jp,jp_ext,kr,zh,zh_ext,all)], |
284 | [codesets="$withval"]) |
298 | [codesets="$withval"]) |
285 | |
299 | |
286 | AC_ARG_ENABLE(xim, |
300 | AC_ARG_ENABLE(xim, |
287 | [ --enable-xim XIM (X Input Method) protocol support], |
301 | [ --enable-xim XIM (X Input Method) protocol support], |
288 | [if test x$enableval = xyes -o x$enableval = xno; then |
302 | [if test x$enableval = xyes -o x$enableval = xno; then |
… | |
… | |
419 | AC_DEFINE_UNQUOTED(RXVT_TERMINFO, "$withval", Set TERMINFO value to the value given by configure) terminfo="$withval" |
433 | AC_DEFINE_UNQUOTED(RXVT_TERMINFO, "$withval", Set TERMINFO value to the value given by configure) terminfo="$withval" |
420 | fi]) |
434 | fi]) |
421 | |
435 | |
422 | dnl# -------------------------------------------------------------------------- |
436 | dnl# -------------------------------------------------------------------------- |
423 | |
437 | |
|
|
438 | LIBEV_M4_AVOID_LIBRT=1 |
|
|
439 | m4_include([libev/libev.m4]) |
|
|
440 | |
|
|
441 | dnl# -------------------------------------------------------------------------- |
|
|
442 | |
424 | AC_PATH_PROG(TIC, tic, :) |
443 | AC_PATH_PROG(TIC, tic, :) |
425 | |
|
|
426 | dnl# need a neat way to detect SVR4 or its features |
|
|
427 | dnl# in src/command.c we use these functions: |
|
|
428 | dnl# grantpt(), unlockpt(), ptsname(), which are defined in <sys/ptms.h> |
|
|
429 | dnl# - but are these also defined for other systems? |
|
|
430 | |
|
|
431 | dnl# hack to find if this is SVR4 -- who knows? |
|
|
432 | dnl## AC_MSG_CHECKING(for SVR4) |
|
|
433 | dnl## AC_EGREP_CPP(yes, |
|
|
434 | dnl## [#if defined (SVR4) || defined (_SVR4) || defined (__svr4__) |
|
|
435 | dnl## yes; |
|
|
436 | dnl## #endif |
|
|
437 | dnl## ], [AC_MSG_RESULT(yes); AC_DEFINE(PERHAPS_SVR4)], AC_MSG_RESULT(perhaps not?)) |
|
|
438 | |
444 | |
439 | AC_PATH_XTRA |
445 | AC_PATH_XTRA |
440 | |
446 | |
441 | AFTERIMAGE_CFLAGS= |
447 | AFTERIMAGE_CFLAGS= |
442 | AFTERIMAGE_LIBS= |
448 | AFTERIMAGE_LIBS= |
… | |
… | |
474 | fi |
480 | fi |
475 | |
481 | |
476 | dnl# -------------------------------------------------------------------------- |
482 | dnl# -------------------------------------------------------------------------- |
477 | dnl# CHECKING FOR HEADER FILES |
483 | dnl# CHECKING FOR HEADER FILES |
478 | dnl# -------------------------------------------------------------------------- |
484 | dnl# -------------------------------------------------------------------------- |
479 | AC_HEADER_SYS_WAIT |
|
|
480 | AC_CHECK_HEADERS( \ |
485 | AC_CHECK_HEADERS( \ |
481 | assert.h \ |
486 | assert.h \ |
482 | fcntl.h \ |
487 | fcntl.h \ |
483 | stdarg.h \ |
488 | stdarg.h \ |
484 | stdlib.h \ |
489 | stdlib.h \ |
… | |
… | |
495 | wchar.h \ |
500 | wchar.h \ |
496 | cwchar \ |
501 | cwchar \ |
497 | clocale \ |
502 | clocale \ |
498 | ) |
503 | ) |
499 | |
504 | |
500 | AC_HEADER_TIME |
|
|
501 | |
|
|
502 | dnl# check to allow both <termios.h> and <sys/ioctl.h> |
505 | dnl# check to allow both <termios.h> and <sys/ioctl.h> |
503 | AC_CACHE_CHECK(whether termios.h and sys/ioctl.h may both be included, rxvt_cv_header_sysioctl, |
506 | AC_CACHE_CHECK(whether termios.h and sys/ioctl.h may both be included, rxvt_cv_header_sysioctl, |
504 | [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <stdio.h> |
507 | [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <stdio.h> |
505 | #include <sys/ioctl.h> |
508 | #include <sys/ioctl.h> |
506 | #ifdef HAVE_TERMIOS_H |
509 | #ifdef HAVE_TERMIOS_H |
… | |
… | |
525 | [rxvt_xlib_illegal_access=yes],[rxvt_xlib_illegal_access=no] |
528 | [rxvt_xlib_illegal_access=yes],[rxvt_xlib_illegal_access=no] |
526 | )]) |
529 | )]) |
527 | if test x$rxvt_xlib_illegal_access = xyes; then |
530 | if test x$rxvt_xlib_illegal_access = xyes; then |
528 | AC_DEFINE(XLIB_ILLEGAL_ACCESS, 1, Define ONLY iff Xlib.h supports it) |
531 | AC_DEFINE(XLIB_ILLEGAL_ACCESS, 1, Define ONLY iff Xlib.h supports it) |
529 | fi |
532 | fi |
530 | |
|
|
531 | AC_C_CONST |
|
|
532 | AC_C_INLINE |
|
|
533 | |
|
|
534 | dnl> AC_HEADER_STDC dnl# skip this test, Sun always fails anyhow. |
|
|
535 | |
533 | |
536 | dnl# -------------------------------------------------------------------------- |
534 | dnl# -------------------------------------------------------------------------- |
537 | dnl# CHECKING FOR MISSING TYPEDEFS |
535 | dnl# CHECKING FOR MISSING TYPEDEFS |
538 | dnl# -------------------------------------------------------------------------- |
536 | dnl# -------------------------------------------------------------------------- |
539 | dnl# Missing typedefs and replacements |
537 | dnl# Missing typedefs and replacements |
… | |
… | |
623 | AC_SUBST(rxvt_u_intp_define) |
621 | AC_SUBST(rxvt_u_intp_define) |
624 | |
622 | |
625 | dnl# -------------------------------------------------------------------------- |
623 | dnl# -------------------------------------------------------------------------- |
626 | dnl# CHECKING FOR LIBRARY FUNCTIONS |
624 | dnl# CHECKING FOR LIBRARY FUNCTIONS |
627 | dnl# -------------------------------------------------------------------------- |
625 | dnl# -------------------------------------------------------------------------- |
628 | AC_TYPE_SIGNAL |
626 | AC_CHECK_FUNCS(unsetenv) |
629 | dnl> AC_FUNC_VPRINTF |
|
|
630 | |
|
|
631 | AC_CHECK_FUNCS( \ |
|
|
632 | unsetenv \ |
|
|
633 | setutent \ |
|
|
634 | on_exit \ |
|
|
635 | ) |
|
|
636 | |
627 | |
637 | UTMP_CHECK |
628 | UTMP_CHECK |
638 | |
629 | |
639 | dnl# -------------------------------------------------------------------------- |
630 | dnl# -------------------------------------------------------------------------- |
640 | |
631 | |
641 | dnl# find ttys/ttytab |
|
|
642 | AC_CACHE_CHECK(where ttys/ttytab is located, rxvt_cv_path_ttytab, |
|
|
643 | [for ttys_file in dnl |
|
|
644 | /etc/ttys /etc/ttytab; |
|
|
645 | do |
|
|
646 | if test -f "$ttys_file" ; then |
|
|
647 | rxvt_cv_path_ttytab=$ttys_file |
|
|
648 | break |
|
|
649 | fi |
|
|
650 | done |
|
|
651 | ]) |
|
|
652 | if test x$rxvt_cv_path_ttytab != x; then |
|
|
653 | AC_DEFINE_UNQUOTED(TTYTAB_FILENAME, "$rxvt_cv_path_ttytab", Define location of ttys/ttytab) |
|
|
654 | fi |
|
|
655 | |
|
|
656 | dnl# -------------------------------------------------------------------------- |
632 | dnl# -------------------------------------------------------------------------- |
657 | dnl# -------------------------------------------------------------------------- |
633 | dnl# -------------------------------------------------------------------------- |
658 | |
634 | |
659 | dnl# this is a really hack test for some basic Xlocale stuff |
635 | dnl# this is a really hack test for some basic Xlocale stuff |
660 | ac_save_LIBS=$LIBS |
636 | save_LIBS=$LIBS |
661 | ac_save_CFLAGS=$CFLAGS |
637 | save_CFLAGS=$CFLAGS |
662 | CFLAGS="$CFLAGS $X_CFLAGS" |
638 | CFLAGS="$CFLAGS $X_CFLAGS" |
663 | LIBS="$LIBS $X_LIBS $X_EXTRA_LIBS -lX11" |
639 | LIBS="$LIBS $X_LIBS $X_EXTRA_LIBS -lX11" |
664 | if test x$support_xim = xyes; then |
640 | if test x$support_xim = xyes; then |
665 | AC_CACHE_CHECK(for working Xlocale, rxvt_cv_func_xlocale, |
641 | AC_CACHE_CHECK(for working Xlocale, rxvt_cv_func_xlocale, |
666 | [AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <X11/Xlib.h> |
642 | [AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <X11/Xlib.h> |
… | |
… | |
697 | [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#define X_LOCALE 1 |
673 | [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#define X_LOCALE 1 |
698 | #include <X11/Xlocale.h>]], [[setlocale(LC_CTYPE, "");]])],[rxvt_cv_func_xsetlocale=yes],[rxvt_cv_func_xsetlocale=no])]) |
674 | #include <X11/Xlocale.h>]], [[setlocale(LC_CTYPE, "");]])],[rxvt_cv_func_xsetlocale=yes],[rxvt_cv_func_xsetlocale=no])]) |
699 | if test x$rxvt_cv_func_xsetlocale = xyes; then |
675 | if test x$rxvt_cv_func_xsetlocale = xyes; then |
700 | AC_DEFINE(HAVE_XSETLOCALE, 1, Define if setlocale (defined to Xsetlocale) works) |
676 | AC_DEFINE(HAVE_XSETLOCALE, 1, Define if setlocale (defined to Xsetlocale) works) |
701 | fi |
677 | fi |
702 | LIBS=$ac_save_LIBS |
678 | LIBS=$save_LIBS |
703 | CFLAGS=$ac_save_CFLAGS |
679 | CFLAGS=$save_CFLAGS |
704 | |
680 | |
705 | AC_CACHE_CHECK(for working plain setlocale, rxvt_cv_func_setlocale, |
681 | AC_CACHE_CHECK(for working plain setlocale, rxvt_cv_func_setlocale, |
706 | [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <clocale>]], [[setlocale(LC_CTYPE, "");]])],[rxvt_cv_func_setlocale=yes],[rxvt_cv_func_setlocale=no])]) |
682 | [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <clocale>]], [[setlocale(LC_CTYPE, "");]])],[rxvt_cv_func_setlocale=yes],[rxvt_cv_func_setlocale=no])]) |
707 | if test x$rxvt_cv_func_setlocale = xyes; then |
683 | if test x$rxvt_cv_func_setlocale = xyes; then |
708 | AC_DEFINE(HAVE_SETLOCALE, 1, Define if plain old setlocale works) |
684 | AC_DEFINE(HAVE_SETLOCALE, 1, Define if plain old setlocale works) |
… | |
… | |
724 | dnl# now add and remove other stuff |
700 | dnl# now add and remove other stuff |
725 | dnl# -------------------------------------------------------------------------- |
701 | dnl# -------------------------------------------------------------------------- |
726 | if test x$support_xft = xyes; then |
702 | if test x$support_xft = xyes; then |
727 | AC_PATH_PROG(PKG_CONFIG, pkg-config, no) |
703 | AC_PATH_PROG(PKG_CONFIG, pkg-config, no) |
728 | if test $PKG_CONFIG != no && $PKG_CONFIG --exists xft; then |
704 | if test $PKG_CONFIG != no && $PKG_CONFIG --exists xft; then |
729 | LIBS="$LIBS `$PKG_CONFIG xft --libs`" |
705 | X_LIBS="`$PKG_CONFIG xft --libs` $X_LIBS" |
730 | CPPFLAGS="$CPPFLAGS `$PKG_CONFIG xft --cflags`" |
706 | CPPFLAGS="$CPPFLAGS `$PKG_CONFIG xft --cflags`" |
731 | else |
707 | else |
732 | AC_PATH_PROG(XFT_CONFIG, xft-config, no) |
708 | AC_PATH_PROG(XFT_CONFIG, xft-config, no) |
733 | if test $XFT_CONFIG != no; then |
709 | if test $XFT_CONFIG != no; then |
734 | LIBS="$LIBS `$XFT_CONFIG --libs`" |
710 | X_LIBS="`$XFT_CONFIG --libs` $X_LIBS" |
735 | CPPFLAGS="$CPPFLAGS `$XFT_CONFIG --cflags`" |
711 | CPPFLAGS="$CPPFLAGS `$XFT_CONFIG --cflags`" |
736 | fi |
712 | fi |
737 | fi |
713 | fi |
738 | |
714 | |
|
|
715 | save_LIBS="$LIBS" |
|
|
716 | LIBS="$LIBS $X_LIBS" |
739 | AC_CHECK_HEADERS(X11/Xft/Xft.h,,[support_xft=no]) |
717 | AC_CHECK_HEADERS(X11/Xft/Xft.h,,[support_xft=no]) |
740 | AC_CHECK_LIB(Xft,XftDrawString32,,[support_xft=no]) |
718 | AC_CHECK_LIB(Xft,XftDrawString32,:,[support_xft=no]) |
|
|
719 | LIBS="$save_LIBS" |
741 | |
720 | |
742 | if test x$support_xft = xyes; then |
721 | if test x$support_xft = xyes; then |
743 | AC_DEFINE(XFT, 1, Define to enable xft support) |
722 | AC_DEFINE(XFT, 1, Define to enable xft support) |
744 | fi |
723 | fi |
745 | fi |
724 | fi |