--- rxvt-unicode/configure.ac 2006/01/21 18:15:07 1.15 +++ rxvt-unicode/configure.ac 2006/01/22 04:09:17 1.20 @@ -35,16 +35,27 @@ AC_AIX AC_ISC_POSIX +AC_LANG(C++) -AC_LANG(C) - -dnl check wetehr we can link with gcc -lsupc++ -LINKER="$CXX" +dnl check wether we can link with gcc -lsupc++ if test x$GCC = xyes && test x$GXX = xyes; then - AC_CHECK_LIB(supc++, main, [ - LINKER="$CC" - LIBS="$LIBS -lsupc++" - ]) + dnl FreeBSD (at least up to 5.3) has a broken GCC, workaround it + AC_MSG_CHECKING([for working libsupc++]) + save_CXX="$CXX" + save_LIBS="$LIBS" + CXX="$CC" + LIBS="$LIBS -lsupc++" + LINKER="$CC" + AC_LINK_IFELSE( + [AC_LANG_PROGRAM([struct test { }; void f() try { throw new test; } catch (...) { throw; }])], + [AC_MSG_RESULT(ok)], + [ + AC_MSG_RESULT([no, making everything bigger and slower]) + LIBS="$save_LIBS" + LINKER="$save_CXX" + ] + ) + CXX="$save_CXX" fi AC_SUBST(LINKER,[$LINKER]) @@ -772,40 +783,7 @@ AC_DEFINE(HAVE_NL_LANGINFO, 1, Define if nl_langinfo(CODESET) works) fi -AC_CACHE_CHECK(for unix-compliant filehandle passing ability, rxvt_can_pass_fds, -[AC_TRY_LINK([ -#include -#include -],[ -{ - msghdr msg; - iovec iov; - char buf [100]; - char data = 0; - - iov.iov_base = &data; - iov.iov_len = 1; - - msg.msg_iov = &iov; - msg.msg_iovlen = 1; - msg.msg_control = buf; - msg.msg_controllen = sizeof buf; - - cmsghdr *cmsg = CMSG_FIRSTHDR (&msg); - cmsg->cmsg_level = SOL_SOCKET; - cmsg->cmsg_type = SCM_RIGHTS; - cmsg->cmsg_len = 100; - - *(int *)CMSG_DATA (cmsg) = 5; - - return sendmsg (3, &msg, 0); -} -],[rxvt_can_pass_fds=yes],[rxvt_can_pass_fds=no])]) -if test x$rxvt_can_pass_fds = xyes; then - AC_DEFINE(HAVE_UNIX_FDPASS, 1, Define if sys/socket.h defines the necessary macros/functions for file handle passing) -else - AC_MSG_ERROR([urxvt requires unix-compliant filehandle passing ability]) -fi +SCM_RIGHTS_CHECK AC_CACHE_CHECK(for broken XIM callback, rxvt_broken_ximcb, [AC_COMPILE_IFELSE([ @@ -829,8 +807,17 @@ dnl# now add and remove other stuff dnl# -------------------------------------------------------------------------- if test x$support_xft = xyes; then - LIBS="$LIBS `pkg-config xft --libs`" - CPPFLAGS="$CPPFLAGS `pkg-config xft --cflags`" + AC_PATH_PROG(PKG_CONFIG, pkg-config, no) + AC_PATH_PROG(XFT_CONFIG, xft-config, no) + if test $PKG_CONFIG != no && $PKG_CONFIG --exists xft; then + LIBS="$LIBS `$PKG_CONFIG xft --libs`" + CPPFLAGS="$CPPFLAGS `$PKG_CONFIG xft --cflags`" + else + if test $XFT_CONFIG != no; then + LIBS="$LIBS `$XFT_CONFIG --libs`" + CPPFLAGS="$CPPFLAGS `$XFT_CONFIG --cflags`" + fi + fi AC_CHECK_HEADERS(X11/Xft/Xft.h,,[support_xft=no]) AC_CHECK_LIB(Xft,XftDrawString32,,[support_xft=no]) @@ -1066,22 +1053,17 @@ echo " Xpm library: $XPM_LIBS" fi -echo " -The following are set in config.h -" if test x$support_utmp != xyes; then echo " utmp support: disabled" echo else echo " utmp support: enabled - utmp file: $rxvt_cv_path_utmp - utmpx file: $rxvt_cv_path_utmpx - wtmp file: $rxvt_cv_path_wtmp - wtmpx file: $rxvt_cv_path_wtmpx - lastlog file: $rxvt_cv_path_lastlog - ttys/ttytab file: $rxvt_cv_path_ttytab - embedded perl: $support_perl" - echo + utmp file: $path_utmp + utmpx file: $path_utmpx + wtmp file: $path_wtmp + wtmpx file: $path_wtmpx + lastlog file: $path_lastlog + lastlogx file: $path_lastlogx" fi if test x$term != x; then echo " set TERM to: $term" @@ -1095,6 +1077,8 @@ echo " resource class fallback: $RESFALLBACK" fi echo +echo " embedded perl: $support_perl" +echo if test x$support_xpm = xneedsmanualspecification; then echo ".----------------------------------------------------------------." echo ". WARNING: --enable-xpm-background was specified however the ."