--- rxvt-unicode/autoconf/configure.in 2004/12/20 16:47:14 1.42 +++ rxvt-unicode/autoconf/configure.in 2005/02/16 21:21:43 1.51 @@ -2,17 +2,20 @@ dnl# dnl# Process this file with autoconf to produce a configure script. dnl# +orig_CXXFLAGS="$CXXFLAGS" + AC_INIT AC_CONFIG_SRCDIR([src/feature.h]) AC_CONFIG_AUX_DIR(autoconf) AC_CONFIG_HEADER(config.h:autoconf/config.h.in) +AC_CANONICAL_HOST + dnl RXVT version changequote(, )dnl VERSION=`sed -n -e 's/^.*[ \t]VERSION.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h` DATE=`sed -n -e 's/^.*[ \t]DATE.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h` -LSMDATE=`sed -n -e 's/^.*[ \t]LSMDATE.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h` -LIBVERSION=`sed -n -e 's/^.*[ \t]LIBVERSION.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h` +dnl LIBVERSION=`sed -n -e 's/^.*[ \t]LIBVERSION.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h` changequote([, ])dnl AC_SUBST(VERSION)dnl AC_SUBST(DATE)dnl @@ -33,6 +36,17 @@ AC_LANG(C) +dnl# -------------------------------------------------------------------------- +dnl# Supply default CFLAGS, if not specified by `CFLAGS=flags ./configure' +dnl# +if test -z "$orig_CXXFLAGS"; then + CXXFLAGS='-O' + if test x$GCC = xyes && test "x$GXX" = xyes; then + CXXFLAGS="-g -O3" + fi + CFLAGS="$CXXFLAGS" +fi + LINKER="$CXX" if test x$GCC = xyes && test x$GXX = xyes; then AC_CHECK_LIB(supc++, main, [ @@ -42,7 +56,15 @@ fi AC_SUBST(LINKER,[$LINKER]) -CPPFLAGS="-D_GNU_SOURCE -D_XOPEN_SOURCE=2" +AC_DEFINE(_GNU_SOURCE, 1, Use all glibc features.) + +case $host in + *-*-solaris* ) + AC_DEFINE(_XOPEN_SOURCE_EXTENDED, 1, Needed to get declarations for msg_control and msg_controllen on Solaris) + AC_DEFINE(_XOPEN_SOURCE, 2, Needed to get declarations for msg_control and msg_controllen on Solaris) + AC_DEFINE(__EXTENSIONS__, 1, Needed to get declarations for msg_control and msg_controllen on Solaris) + ;; +esac dnl if test x$GXX = xyes; then dnl CXXFLAGS="$CXXFLAGS" dnl I once had -fno-exceptions, but I am using them now... @@ -61,14 +83,13 @@ AC_CHECK_LIB(nsl, gethostbyname, [LIBS="$LIBS -lnsl"]) AC_CHECK_LIB(socket, socket, [LIBS="$LIBS -lsocket"]) -AC_ENABLE_SHARED(no)dnl# libtool -AC_ENABLE_STATIC(yes)dnl# libtool -AC_PROG_LIBTOOL()dnl# libtool +dnl AC_ENABLE_SHARED(no)dnl# libtool +dnl AC_ENABLE_STATIC(yes)dnl# libtool +dnl AC_PROG_LIBTOOL()dnl# libtool MALLOC_TYPE=S support_addstrings=no support_frills=no -support_linespace=no support_inheritpixmap=no support_tinting=no support_fading=no @@ -114,7 +135,6 @@ [if test x$enableval = xyes; then support_24bit=yes support_frills=yes - support_linespace=yes support_inheritpixmap=yes support_tinting=yes support_fading=yes @@ -350,12 +370,6 @@ support_frills=$enableval fi]) -AC_ARG_ENABLE(linespace, - [ --enable-linespace enable support for linespace], - [if test x$enableval = xyes -o x$enableval = xno; then - support_linespace=$enableval - fi]) - AC_ARG_ENABLE(24bit, [ --enable-24bit enable support for using 24bit visuals if available], [if test x$enableval = xyes -o x$enableval = xno; then @@ -445,21 +459,6 @@ AC_DEFINE(PROTOTYPES, 1, Define if you need function prototypes) -dnl# -------------------------------------------------------------------------- -dnl# Supply default CFLAGS, if not specified by `CFLAGS=flags ./configure' -dnl# -if test -z "$CFLAGS"; then - if test -z "$CCOPTS"; then - CCOPTS='-O' -dnl> if test "x$GCC" = xyes; then -dnl> if test x$system = xLinux; then -dnl> CCOPTS="$CCOPTS "'-O2 -fno-strength-reduce' -dnl> fi -dnl> fi - fi - CFLAGS="$CCOPTS" -fi - AC_PATH_PROG(MV, mv, mv) AC_PATH_PROG(RM, rm, rm) AC_PATH_PROG(CP, cp, cp) @@ -520,6 +519,10 @@ utmp.h \ utmpx.h \ stdint.h \ + pty.h \ + wchar.h \ + cwchar \ + clocale \ ) AC_HEADER_TIME @@ -607,19 +610,19 @@ AC_DEFUN(RXVT_CHECK_SIZE, [AC_CACHE_CHECK([for $2], $1, [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], [[$2 dummy;]])],[$1=yes],[dnl -if test $ac_cv_sizeof_char -ge $3; then +if test "$ac_cv_sizeof_char" -ge $3; then $1="$4 char" else - if test $ac_cv_sizeof_short -ge $3; then + if test "$ac_cv_sizeof_short" -ge $3; then $1="$4 short" else - if test $ac_cv_sizeof_int -ge $3; then + if test "$ac_cv_sizeof_int" -ge $3; then $1="$4 int" else - if test $ac_cv_sizeof_long -ge $3; then + if test "$ac_cv_sizeof_long" -ge $3; then $1="$4 long" else - if test $ac_cv_sizeof_long_long -ge $3; then + if test "$ac_cv_sizeof_long_long" -ge $3; then $1="$4 long long" else $1="$4 $5" # we _must_ have a (possibly wrong) default @@ -656,15 +659,15 @@ dnl# dnl# Now look for another we use dnl# -if test $ac_cv_sizeof_int_p -eq 8; then +if test "$ac_cv_sizeof_int_p" -eq 8; then rxvt_intp_define="#define intp_t int64_t" rxvt_u_intp_define="#define u_intp_t u_int64_t" else - if test $ac_cv_sizeof_int_p -eq 4; then + if test "$ac_cv_sizeof_int_p" -eq 4; then rxvt_intp_define="#define intp_t int32_t" rxvt_u_intp_define="#define u_intp_t u_int32_t" else - if test $ac_cv_sizeof_int_p -eq 2; then + if test "$ac_cv_sizeof_int_p" -eq 2; then rxvt_intp_define="#define intp_t int16_t" rxvt_u_intp_define="#define u_intp_t u_int16_t" else @@ -706,6 +709,7 @@ on_exit \ nanosleep \ updwtmp \ + updwtmpx \ ttyslot \ ) dnl# Note: On NetBSD, openpty() exists in libutil. Don't pull it in @@ -758,8 +762,16 @@ if test x$rxvt_cv_struct_utmpx_host = xyes; then AC_DEFINE(HAVE_UTMPX_HOST, 1, Define if struct utmpx contains ut_host) fi -) dnl# AC_CHECK_HEADER(utmpx.h +AC_CACHE_CHECK(for session in utmpx struct, rxvt_cv_struct_utmpx_session, +[AC_TRY_COMPILE([#include +#include ], +[struct utmpx utx; utx.ut_session;], +rxvt_cv_struct_utmpx_session=yes, rxvt_cv_struct_utmpx_session=no)]) +if test x$rxvt_cv_struct_utmpx_session = xyes; then + AC_DEFINE(HAVE_UTMPX_SESSION, 1, Define if struct utmpx contains ut_session) +fi +) dnl# AC_CHECK_HEADER(utmpx.h dnl# -------------------------------------------------------------------------- dnl# check for struct lastlog @@ -1225,9 +1237,6 @@ if test x$support_frills = xyes; then AC_DEFINE(ENABLE_FRILLS, 1, Define if you want handling for rarely used but handy features) fi -if test x$support_linespace = xno; then - AC_DEFINE(NO_LINESPACE, 1, Define if you don't want support linespace) -fi if test x$support_24bit = xyes; then AC_DEFINE(PREFER_24BIT, 1, Define to use a 24 bit visual if the screen has 24 bit mode, even if the default is 8 bit) fi @@ -1365,9 +1374,7 @@ Makefile \ doc/Makefile \ src/Makefile \ -src/test/Makefile \ src/rxvtlib.h \ -W11/Makefile \ ]) AC_OUTPUT