dnl
dnl Author: Thomas E. Dickey 1995-on
dnl
-dnl $Id: aclocal.m4,v 1.435 2007/07/14 13:40:10 tom Exp $
+dnl $Id: aclocal.m4,v 1.442 2007/12/01 20:02:42 tom Exp $
dnl Macros used in NCURSES auto-configuration script.
dnl
dnl These macros are maintained separately from NCURSES. The copyright on
AC_SUBST(EXTRA_CPPFLAGS)
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_ADD_INCDIR version: 8 updated: 2007/07/30 19:22:58
+dnl -------------
+dnl Add an include-directory to $CPPFLAGS. Don't add /usr/include, since it's
+dnl redundant. We don't normally need to add -I/usr/local/include for gcc,
+dnl but old versions (and some misinstalled ones) need that. To make things
+dnl worse, gcc 3.x may give error messages if -I/usr/local/include is added to
+dnl the include-path).
+AC_DEFUN([CF_ADD_INCDIR],
+[
+if test -n "$1" ; then
+ for cf_add_incdir in $1
+ do
+ while test $cf_add_incdir != /usr/include
+ do
+ if test -d $cf_add_incdir
+ then
+ cf_have_incdir=no
+ if test -n "$CFLAGS$CPPFLAGS" ; then
+ # a loop is needed to ensure we can add subdirs of existing dirs
+ for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
+ if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
+ cf_have_incdir=yes; break
+ fi
+ done
+ fi
+
+ if test "$cf_have_incdir" = no ; then
+ if test "$cf_add_incdir" = /usr/local/include ; then
+ if test "$GCC" = yes
+ then
+ cf_save_CPPFLAGS=$CPPFLAGS
+ CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
+ AC_TRY_COMPILE([#include <stdio.h>],
+ [printf("Hello")],
+ [],
+ [cf_have_incdir=yes])
+ CPPFLAGS=$cf_save_CPPFLAGS
+ fi
+ fi
+ fi
+
+ if test "$cf_have_incdir" = no ; then
+ AC_VERBOSE(adding $cf_add_incdir to include-path)
+ ifelse($2,,CPPFLAGS,$2)="-I$cf_add_incdir $ifelse($2,,CPPFLAGS,[$]$2)"
+
+ cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
+ test "$cf_top_incdir" = "$cf_add_incdir" && break
+ cf_add_incdir="$cf_top_incdir"
+ else
+ break
+ fi
+ fi
+ done
+ done
+fi
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_ADD_LIBDIR version: 5 updated: 2007/07/30 19:12:03
+dnl -------------
+dnl Adds to the library-path
+dnl
+dnl Some machines have trouble with multiple -L options.
+dnl
+dnl $1 is the (list of) directory(s) to add
+dnl $2 is the optional name of the variable to update (default LDFLAGS)
+dnl
+AC_DEFUN([CF_ADD_LIBDIR],
+[
+if test -n "$1" ; then
+ for cf_add_libdir in $1
+ do
+ if test $cf_add_libdir = /usr/lib ; then
+ :
+ elif test -d $cf_add_libdir
+ then
+ cf_have_libdir=no
+ if test -n "$LDFLAGS$LIBS" ; then
+ # a loop is needed to ensure we can add subdirs of existing dirs
+ for cf_test_libdir in $LDFLAGS $LIBS ; do
+ if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
+ cf_have_libdir=yes; break
+ fi
+ done
+ fi
+ if test "$cf_have_libdir" = no ; then
+ AC_VERBOSE(adding $cf_add_libdir to library-path)
+ ifelse($2,,LDFLAGS,$2)="-L$cf_add_libdir $ifelse($2,,LDFLAGS,[$]$2)"
+ fi
+ fi
+ done
+fi
])dnl
dnl ---------------------------------------------------------------------------
dnl CF_ANSI_CC_CHECK version: 9 updated: 2001/12/30 17:53:34
test "$cf_cv_cpp_static_cast" = yes && AC_DEFINE(CPP_HAS_STATIC_CAST)
])dnl
dnl ---------------------------------------------------------------------------
-dnl CF_C_INLINE version: 1 updated: 2007/04/28 15:03:44
+dnl CF_C_INLINE version: 2 updated: 2007/08/11 14:09:50
dnl -----------
dnl Check if the C compiler supports "inline".
dnl $1 is the name of a shell variable to set if inline is supported
AC_C_INLINE
$1=
if test "$ac_cv_c_inline" != no ; then
- $1=inline
- if test "$GCC" = yes
- then
- AC_CACHE_CHECK(if gcc supports options to tune inlining,cf_cv_gcc_inline,[
- cf_save_CFLAGS=$CFLAGS
- CFLAGS="$CFLAGS --param max-inline-insns-single=$2"
- AC_TRY_COMPILE([inline int foo(void) { return 1; }],
- [${cf_cv_main_return:-return} foo()],
- [cf_cv_gcc_inline=yes],
- [cf_cv_gcc_inline=no])
- CFLAGS=$cf_save_CFLAGS
- ])
- if test "$cf_cv_gcc_inline" = yes ; then
- CF_ADD_CFLAGS([--param max-inline-insns-single=$2])
- fi
- fi
+ $1=inline
+ if test "$INTEL_COMPILER" = yes
+ then
+ :
+ elif test "$GCC" = yes
+ then
+ AC_CACHE_CHECK(if gcc supports options to tune inlining,cf_cv_gcc_inline,[
+ cf_save_CFLAGS=$CFLAGS
+ CFLAGS="$CFLAGS --param max-inline-insns-single=$2"
+ AC_TRY_COMPILE([inline int foo(void) { return 1; }],
+ [${cf_cv_main_return:-return} foo()],
+ [cf_cv_gcc_inline=yes],
+ [cf_cv_gcc_inline=no])
+ CFLAGS=$cf_save_CFLAGS
+ ])
+ if test "$cf_cv_gcc_inline" = yes ; then
+ CF_ADD_CFLAGS([--param max-inline-insns-single=$2])
+ fi
+ fi
fi
AC_SUBST($1)
])dnl
])dnl
dnl ---------------------------------------------------------------------------
-dnl CF_GCC_ATTRIBUTES version: 10 updated: 2005/05/28 13:16:28
+dnl CF_GCC_ATTRIBUTES version: 11 updated: 2007/07/29 09:55:12
dnl -----------------
dnl Test for availability of useful gcc __attribute__ directives to quiet
dnl compiler warnings. Though useful, not all are supported -- and contrary
then
AC_CHECKING([for $CC __attribute__ directives])
cat > conftest.$ac_ext <<EOF
-#line __oline__ "configure"
+#line __oline__ "${as_me-configure}"
#include "confdefs.h"
#include "conftest.h"
#include "conftest.i"
fi
])dnl
dnl ---------------------------------------------------------------------------
-dnl CF_GCC_WARNINGS version: 21 updated: 2007/06/27 18:12:15
+dnl CF_GCC_WARNINGS version: 22 updated: 2007/07/29 09:55:12
dnl ---------------
dnl Check if the compiler supports useful warning options. There's a few that
dnl we don't use, simply because they're too noisy:
CF_INTEL_COMPILER(GCC,INTEL_COMPILER,CFLAGS)
cat > conftest.$ac_ext <<EOF
-#line __oline__ "configure"
+#line __oline__ "${as_me-configure}"
int main(int argc, char *argv[[]]) { return (argv[[argc-1]] == 0) ; }
EOF
AC_SUBST(EXTRA_CXXFLAGS)
])dnl
dnl ---------------------------------------------------------------------------
-dnl CF_HASHED_DB version: 1 updated: 2006/08/19 09:16:14
+dnl CF_HASHED_DB version: 3 updated: 2007/11/24 17:43:37
dnl ------------
dnl Look for an instance of the Berkeley hashed database.
+dnl
+dnl $1 = optional parameter, to specify install-prefix for the database.
AC_DEFUN([CF_HASHED_DB],
[
+ifelse([$1],,,[
+case $1 in #(vi
+yes|*able*) #(vi
+ ;;
+*)
+ if test -d "$1" ; then
+ CF_ADD_INCDIR($1/include)
+ CF_ADD_LIBDIR($1/lib)
+ fi
+esac
+])
AC_CHECK_HEADER(db.h,[
CF_HASHED_DB_VERSION
if test "$cf_cv_hashed_db_version" = unknown ; then
])
])dnl
dnl ---------------------------------------------------------------------------
-dnl CF_HASHED_DB_LIBS version: 6 updated: 2006/12/16 12:33:30
+dnl CF_HASHED_DB_LIBS version: 7 updated: 2007/12/01 15:01:37
dnl -----------------
dnl Given that we have the header and version for hashed database, find the
dnl library information.
[
AC_CACHE_CHECK(for db libraries, cf_cv_hashed_db_libs,[
cf_cv_hashed_db_libs=unknown
-for cf_db_libs in db$cf_cv_hashed_db_version db ''
+for cf_db_libs in db$cf_cv_hashed_db_version db-$cf_cv_hashed_db_version db ''
do
cf_save_libs="$LIBS"
if test -n "$cf_db_libs"; then
])
])dnl
dnl ---------------------------------------------------------------------------
-dnl CF_HASHED_DB_VERSION version: 2 updated: 2006/08/19 15:12:49
+dnl CF_HASHED_DB_VERSION version: 3 updated: 2007/12/01 15:01:37
dnl --------------------
dnl Given that we have the header file for hashed database, find the version
dnl information.
AC_CACHE_CHECK(for version of db, cf_cv_hashed_db_version,[
cf_cv_hashed_db_version=unknown
-for cf_db_version in 1 2 3 4
+for cf_db_version in 1 2 3 4 5
do
CF_MSG_LOG(checking for db version $cf_db_version)
AC_TRY_COMPILE([
fi
])dnl
dnl ---------------------------------------------------------------------------
-dnl CF_MSG_LOG version: 3 updated: 1997/09/07 14:05:52
+dnl CF_MSG_LOG version: 4 updated: 2007/07/29 09:55:12
dnl ----------
dnl Write a debug message to config.log, along with the line number in the
dnl configure script.
AC_DEFUN([CF_MSG_LOG],[
-echo "(line __oline__) testing $* ..." 1>&AC_FD_CC
+echo "${as_me-configure}:__oline__: testing $* ..." 1>&AC_FD_CC
])dnl
dnl ---------------------------------------------------------------------------
dnl CF_NCURSES_ABI_6 version: 1 updated: 2005/09/17 18:42:49
$1=`echo "$2" | sed -e 's/-l$3[[ ]]//g' -e 's/-l$3[$]//'`
])dnl
dnl ---------------------------------------------------------------------------
+dnl CF_RPATH_HACK version: 3 updated: 2007/12/01 11:14:13
+dnl -------------
+AC_DEFUN([CF_RPATH_HACK],
+[
+AC_REQUIRE([CF_SHARED_OPTS])
+AC_MSG_CHECKING(for updated LDFLAGS)
+if test -n "$LDFLAGS" ; then
+AC_MSG_RESULT(maybe)
+CF_VERBOSE(...checking LDFLAGS $LDFLAGS)
+CF_VERBOSE(...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS)
+case "$EXTRA_LDFLAGS" in #(vi
+-Wl,-rpath,*) #(vi
+ cf_rpath_hack="-Wl,-rpath,"
+ ;;
+-R\ *)
+ cf_rpath_hack="-R "
+ ;;
+-R*)
+ cf_rpath_hack="-R"
+ ;;
+*)
+ cf_rpath_hack=
+ ;;
+esac
+if test -n "$cf_rpath_hack" ; then
+ cf_rpath_dst=
+ for cf_rpath_src in $LDFLAGS
+ do
+ CF_VERBOSE(Filtering $cf_rpath_src)
+ case $cf_rpath_src in #(vi
+ -L*) #(vi
+ if test "$cf_rpath_hack" = "-R " ; then
+ cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e 's%-L%-R %'`
+ else
+ cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e s%-L%$cf_rpath_hack%`
+ fi
+ CF_VERBOSE(...Filter $cf_rpath_tmp)
+ EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS"
+ ;;
+ *)
+ cf_rpath_dst="$cf_rpath_dst $cf_rpath_src"
+ ;;
+ esac
+ done
+ LDFLAGS=$cf_rpath_dst
+ CF_VERBOSE(...checked LDFLAGS $LDFLAGS)
+ CF_VERBOSE(...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS)
+fi
+else
+AC_MSG_RESULT(no)
+fi
+])dnl
+dnl ---------------------------------------------------------------------------
dnl CF_SHARED_OPTS version: 46 updated: 2007/02/24 18:58:09
dnl --------------
dnl --------------
$1=`echo "$2" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
])dnl
dnl ---------------------------------------------------------------------------
-dnl CF_VERBOSE version: 2 updated: 1997/09/05 10:45:14
+dnl CF_VERBOSE version: 3 updated: 2007/07/29 09:55:12
dnl ----------
dnl Use AC_VERBOSE w/o the warnings
AC_DEFUN([CF_VERBOSE],
[test -n "$verbose" && echo " $1" 1>&AC_FD_MSG
+CF_MSG_LOG([$1])
])dnl
dnl ---------------------------------------------------------------------------
dnl CF_WCHAR_TYPE version: 2 updated: 2004/01/17 19:18:20