--- rxvt-unicode/configure.ac 2006/01/17 15:41:33 1.4 +++ rxvt-unicode/configure.ac 2006/01/20 23:53:21 1.13 @@ -1,4 +1,3 @@ -dnl# -*- sh -*- dnl# dnl# Process this file with autoconf to produce a configure script. dnl# @@ -33,31 +32,36 @@ AC_PROG_CXX AC_PROG_CPP AC_PROG_INSTALL -AC_PROG_AWK + +AC_AIX +AC_ISC_POSIX AC_LANG(C) +dnl check wetehr we can link with gcc -lsupc++ +LINKER="$CXX" +if test x$GCC = xyes && test x$GXX = xyes; then + AC_CHECK_LIB(supc++, main, [ + LINKER="$CC" + LIBS="$LIBS -lsupc++" + ]) +fi +AC_SUBST(LINKER,[$LINKER]) + +AC_LANG(C++) dnl# -------------------------------------------------------------------------- -dnl# Supply default CFLAGS, if not specified by `CFLAGS=flags ./configure' +dnl# Supply default CXXFLAGS, if not specified by `CXXFLAGS=flags ./configure' dnl# if test -z "$orig_CXXFLAGS"; then if test x$GCC = xyes && test "x$GXX" = xyes; then - CXXFLAGS="-g -O3" + CXXFLAGS="-g -O3 -fno-threadsafe-statics -fno-enforce-eh-specs" + AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [], [CXXFLAGS="-g -O3"]) else CXXFLAGS="-O" fi CFLAGS="$CXXFLAGS" fi -LINKER="$CXX" -if test x$GCC = xyes && test x$GXX = xyes; then - AC_CHECK_LIB(supc++, main, [ - LINKER="$CC" - LIBS="$LIBS -lsupc++" - ]) -fi -AC_SUBST(LINKER,[$LINKER]) - AC_DEFINE(_GNU_SOURCE, 1, Use all glibc features.) case $host in @@ -72,12 +76,6 @@ dnl CXXFLAGS="$CXXFLAGS" dnl I once had -fno-exceptions, but I am using them now... dnl fi -AC_LANG(C++) - -dnl# system hacks -AC_AIX -AC_ISC_POSIX - dnl# FreeBSD needs to link libxpg4 AC_CHECK_FUNC(setlocale, [], [AC_CHECK_LIB(xpg4, setlocale, [LIBS="$LIBS -lxpg4"])]) @@ -481,8 +479,6 @@ dnl# -------------------------------------------------------------------------- -AC_DEFINE(PROTOTYPES, 1, Define if you need function prototypes) - AC_PATH_PROG(MV, mv, mv) AC_PATH_PROG(RM, rm, rm) AC_PATH_PROG(CP, cp, cp) @@ -490,7 +486,6 @@ AC_PATH_PROG(SED, sed, sed) AC_PATH_PROG(ECHO, echo, echo) AC_PATH_PROG(CMP, cmp, cmp) -AC_PATH_PROG(TBL, tbl) AC_PATH_PROG(TIC, tic) dnl# need a neat way to detect SVR4 or its features @@ -633,7 +628,7 @@ AC_CHECK_SIZEOF(int *, 4) dnl# see usage below -AC_DEFUN(RXVT_CHECK_SIZE, +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 @@ -716,7 +711,7 @@ unsetenv \ setutent \ seteuid \ - setresuid \ + setresuid \ setreuid \ _getpty \ getpt \ @@ -740,7 +735,6 @@ AC_CHECK_HEADER(utmp.h, [AC_CACHE_CHECK([for struct utmp], rxvt_cv_struct_utmp, [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include -#include #include ]], [[struct utmp ut;]])],[rxvt_cv_struct_utmp=yes],[rxvt_cv_struct_utmp=no])]) if test x$rxvt_cv_struct_utmp = xyes; then AC_DEFINE(HAVE_STRUCT_UTMP, 1, Define if utmp.h has struct utmp) @@ -1431,7 +1425,7 @@ dnl# test for "sun" or "__sun__" before include sys_ioctl dnl# revert HAVE_BLAH_H into a "#include " -AC_DEFUN(RXVT_DEFINE_TO_INCLUDE, dnl +AC_DEFUN([RXVT_DEFINE_TO_INCLUDE], dnl [if test "$$3" = "$4" -o "$$5" = "$6"; then $1="#include <$2>" else