X-Git-Url: https://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=aclocal.m4;h=665c30f42eb23142a89fecf1b7b25ba688ba7115;hp=a3ba0e111dc0b7200f269821f106903457e53cf9;hb=60014650d5e3f088e2d5e8835925cce96db00c33;hpb=ca5fdd32fd43d84fe3d720cd5c07fba28fc506a4;ds=sidebyside diff --git a/aclocal.m4 b/aclocal.m4 index a3ba0e11..665c30f4 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -1,5 +1,5 @@ dnl*************************************************************************** -dnl Copyright (c) 1998-2006,2007 Free Software Foundation, Inc. * +dnl Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. * dnl * dnl Permission is hereby granted, free of charge, to any person obtaining a * dnl copy of this software and associated documentation files (the * @@ -28,7 +28,7 @@ dnl*************************************************************************** dnl dnl Author: Thomas E. Dickey 1995-on dnl -dnl $Id: aclocal.m4,v 1.415 2007/01/28 16:51:41 tom Exp $ +dnl $Id: aclocal.m4,v 1.445 2008/03/29 19:47:32 tom Exp $ dnl Macros used in NCURSES auto-configuration script. dnl dnl These macros are maintained separately from NCURSES. The copyright on @@ -166,6 +166,99 @@ fi AC_SUBST(EXTRA_CPPFLAGS) +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_ADD_INCDIR version: 9 updated: 2008/02/09 13:15:34 +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 ], + [printf("Hello")], + [], + [cf_have_incdir=yes]) + CPPFLAGS=$cf_save_CPPFLAGS + fi + fi + fi + + if test "$cf_have_incdir" = no ; then + CF_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: 6 updated: 2008/02/09 13:15:34 +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 + CF_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 @@ -220,7 +313,7 @@ fi fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_ANSI_CC_REQD version: 3 updated: 1997/09/06 13:40:44 +dnl CF_ANSI_CC_REQD version: 4 updated: 2008/03/23 14:48:54 dnl --------------- dnl For programs that must use an ANSI compiler, obtain compiler options that dnl will make it recognize prototypes. We'll do preprocessor checks in other @@ -229,7 +322,7 @@ dnl the preprocessor. AC_DEFUN([CF_ANSI_CC_REQD], [AC_REQUIRE([CF_ANSI_CC_CHECK]) if test "$cf_cv_ansi_cc" = "no"; then - AC_ERROR( + AC_MSG_ERROR( [Your compiler does not appear to recognize prototypes. You have the following choices: a. adjust your compiler options @@ -521,7 +614,7 @@ AC_MSG_RESULT($cf_cv_cgetent) test "$cf_cv_cgetent" = yes && AC_DEFINE(HAVE_BSD_CGETENT) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_CHECK_CACHE version: 10 updated: 2004/05/23 13:03:31 +dnl CF_CHECK_CACHE version: 11 updated: 2008/03/23 14:45:59 dnl -------------- dnl Check if we're accidentally using a cache from a different machine. dnl Derive the system name, as a check for reusing the autoconf cache. @@ -552,7 +645,7 @@ test -n "$cf_cv_system_name" && AC_MSG_RESULT(Configuring for $cf_cv_system_name if test ".$system_name" != ".$cf_cv_system_name" ; then AC_MSG_RESULT(Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)) - AC_ERROR("Please remove config.cache and try again.") + AC_MSG_ERROR("Please remove config.cache and try again.") fi ])dnl dnl --------------------------------------------------------------------------- @@ -612,6 +705,50 @@ fi ])dnl dnl --------------------------------------------------------------------------- +dnl CF_CHECK_GPM_WGETCH version: 1 updated: 2007/04/28 14:38:06 +dnl ------------------- +dnl Check if GPM is already linked with curses. If so - and if the linkage +dnl is not "weak" - warn about this because it can create problems linking +dnl applications with ncurses. +AC_DEFUN([CF_CHECK_GPM_WGETCH],[ +AC_CHECK_LIB(gpm,Gpm_Wgetch,[ + +AC_CACHE_CHECK(if GPM is weakly bound to curses library, cf_cv_check_gpm_wgetch,[ +cf_cv_check_gpm_wgetch=unknown +if test "$cross_compiling" != yes ; then + +cat >conftest.$ac_ext < +int main() +{ + Gpm_Wgetch(); + ${cf_cv_main_return:-return}(0); +} +CF_EOF + + cf_save_LIBS="$LIBS" + # This only works if we can look at the symbol table. If a shared + # library is stripped for install, we cannot use that. So we're forced + # to rely on the static library, noting that some packagers may not + # include it. + LIBS="-static -lgpm -dynamic $LIBS" + if AC_TRY_EVAL(ac_compile) ; then + if AC_TRY_EVAL(ac_link) ; then + cf_cv_check_gpm_wgetch=`nm conftest$ac_exeext | egrep '\' | egrep '\<[[vVwW]]\>'` + test -n "$cf_cv_check_gpm_wgetch" && cf_cv_check_gpm_wgetch=yes + test -z "$cf_cv_check_gpm_wgetch" && cf_cv_check_gpm_wgetch=no + fi + fi + rm -f conftest* + LIBS="$cf_save_LIBS" +fi +]) + +if test "$cf_cv_check_gpm_wgetch" != yes ; then + AC_MSG_WARN(GPM library is already linked with curses - read the FAQ) +fi +])])dnl +dnl --------------------------------------------------------------------------- dnl CF_CPP_PARAM_INIT version: 4 updated: 2001/04/07 22:31:18 dnl ----------------- dnl Check if the C++ compiler accepts duplicate parameter initialization. This @@ -703,82 +840,36 @@ fi test "$cf_cv_cpp_static_cast" = yes && AC_DEFINE(CPP_HAS_STATIC_CAST) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_CPP_VSCAN_FUNC version: 5 updated: 2001/12/02 01:39:28 -dnl ----------------- -dnl Check if the g++ compiler supports vscan function (not a standard feature). -AC_DEFUN([CF_CPP_VSCAN_FUNC], -[ -if test -n "$CXX"; then - -AC_LANG_SAVE -AC_LANG_CPLUSPLUS -AC_CHECK_HEADERS(strstream.h) - -AC_CACHE_CHECK(if $CXX supports vscan function,cf_cv_cpp_vscan_func,[ - for cf_vscan_func in strstream strstream_cast stdio - do - case $cf_vscan_func in #(vi - stdio) cf_vscan_defs=USE_STDIO_VSCAN ;; #(vi - strstream) cf_vscan_defs=USE_STRSTREAM_VSCAN ;; - strstream_cast) cf_vscan_defs=USE_STRSTREAM_VSCAN_CAST ;; - esac - AC_TRY_LINK([ -#include -#include -#define $cf_vscan_defs 1 -#if defined(USE_STDIO_VSCAN) -#elif defined(HAVE_STRSTREAM_H) && defined(USE_STRSTREAM_VSCAN) -#include -#endif - -int scanw(const char* fmt, ...) -{ - int result = -1; - char buf[BUFSIZ]; - - va_list args; - va_start(args, fmt); -#if defined(USE_STDIO_VSCAN) - if (::vsscanf(buf, fmt, args) != -1) - result = 0; -#elif defined(USE_STRSTREAM_VSCAN) - strstreambuf ss(buf, sizeof(buf)); - if (ss.vscan(fmt, args) != -1) - result = 0; -#elif defined(USE_STRSTREAM_VSCAN_CAST) - strstreambuf ss(buf, sizeof(buf)); - if (ss.vscan(fmt, (_IO_va_list)args) != -1) - result = 0; -#else -#error case $cf_vscan_func failed -#endif - va_end(args); - return result; -} -],[int tmp, foo = scanw("%d", &tmp)], - [cf_cv_cpp_vscan_func=$cf_vscan_func; break], - [cf_cv_cpp_vscan_func=no]) - test "$cf_cv_cpp_vscan_func" != no && break - done -]) - -AC_LANG_RESTORE +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 +dnl $2 is the threshold for gcc 4.x's option controlling maximum inline size +AC_DEFUN([CF_C_INLINE],[ +AC_C_INLINE +$1= +if test "$ac_cv_c_inline" != no ; then + $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 - -case $cf_cv_cpp_vscan_func in #(vi -stdio) #(vi - AC_DEFINE(CPP_HAS_VSCAN_FUNC) - AC_DEFINE(USE_STDIO_VSCAN) - ;; -strstream) - AC_DEFINE(CPP_HAS_VSCAN_FUNC) - AC_DEFINE(USE_STRSTREAM_VSCAN) - ;; -strstream_cast) - AC_DEFINE(CPP_HAS_VSCAN_FUNC) - AC_DEFINE(USE_STRSTREAM_VSCAN_CAST) - ;; -esac +AC_SUBST($1) ])dnl dnl --------------------------------------------------------------------------- dnl CF_DIRNAME version: 4 updated: 2002/12/21 19:25:52 @@ -1070,7 +1161,7 @@ esac ])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 @@ -1097,7 +1188,7 @@ if test "$GCC" = yes then AC_CHECKING([for $CC __attribute__ directives]) cat > conftest.$ac_ext < conftest.$ac_ext <$cf_dir/Makefile.out mv $cf_dir/Makefile.out $cf_dir/Makefile @@ -2040,8 +2183,11 @@ do prefix=$cf_prefix \ suffix=$cf_suffix \ subset=$cf_subset \ + TermlibRoot=$TINFO_NAME \ + TermlibSuffix=$TINFO_SUFFIX \ ShlibVer=$cf_cv_shlib_version \ ShlibVerInfix=$cf_cv_shlib_version_infix \ + ReLink=${cf_cv_do_relink-no} \ DoLinks=$cf_cv_do_symlinks \ rmSoLocs=$cf_cv_rm_so_locs \ ldconfig="$LDCONFIG" \ @@ -2138,7 +2284,7 @@ uninstall.man :: distclean :: rm -f config.cache config.log config.status Makefile include/ncurses_cfg.h - rm -f headers.sh headers.sed + rm -f headers.sh headers.sed mk_shared_lib.sh rm -rf \${DIRS_TO_MAKE} CF_EOF @@ -2770,7 +2916,7 @@ AC_ARG_WITH(manpage-tbl, AC_MSG_RESULT($MANPAGE_TBL) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_MAN_PAGES version: 32 updated: 2006/12/24 15:18:27 +dnl CF_MAN_PAGES version: 35 updated: 2007/03/31 11:47:29 dnl ------------ dnl Try to determine if the man-pages on the system are compressed, and if dnl so, what format is used. Use this information to construct a script that @@ -2836,7 +2982,7 @@ NCURSES_PATCH="$NCURSES_PATCH" NCURSES_OSPEED="$NCURSES_OSPEED" TERMINFO="$TERMINFO" -MKDIRS="sh `cd $srcdir && pwd`/mkinstalldirs" +MKDIRS="sh `cd $srcdir && pwd`/mkdirs.sh" INSTALL="$INSTALL" INSTALL_DATA="$INSTALL_DATA" @@ -2888,12 +3034,12 @@ case \$i in #(vi # replace variables in man page if test ! -f $cf_man_alias ; then cat >>$cf_man_alias <<-CF_EOF2 - s,@DATADIR@,\$datadir, - s,@TERMINFO@,\$TERMINFO, - s,@NCURSES_MAJOR@,\$NCURSES_MAJOR, - s,@NCURSES_MINOR@,\$NCURSES_MINOR, - s,@NCURSES_PATCH@,\$NCURSES_PATCH, - s,@NCURSES_OSPEED@,\$NCURSES_OSPEED, + s,@DATADIR@,\$datadir,g + s,@TERMINFO@,\$TERMINFO,g + s,@NCURSES_MAJOR@,\$NCURSES_MAJOR,g + s,@NCURSES_MINOR@,\$NCURSES_MINOR,g + s,@NCURSES_PATCH@,\$NCURSES_PATCH,g + s,@NCURSES_OSPEED@,\$NCURSES_OSPEED,g CF_EOF ifelse($1,,,[ for cf_name in $1 @@ -3010,6 +3156,7 @@ cat >>$cf_edit_man <>$cf_edit_man <&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 @@ -3295,7 +3445,7 @@ ifelse($1,,,[$1=$PATHSEP]) AC_SUBST(PATHSEP) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_PATH_SYNTAX version: 11 updated: 2006/09/02 08:55:46 +dnl CF_PATH_SYNTAX version: 12 updated: 2008/03/23 14:45:59 dnl -------------- dnl Check the argument to see that it looks like a pathname. Rewrite it if it dnl begins with one of the prefix/exec_prefix variables, and then again if the @@ -3327,7 +3477,7 @@ case ".[$]$1" in #(vi $1=`echo [$]$1 | sed -e s%NONE%$cf_path_syntax%` ;; *) - ifelse($2,,[AC_ERROR([expected a pathname, not \"[$]$1\"])],$2) + ifelse($2,,[AC_MSG_ERROR([expected a pathname, not \"[$]$1\"])],$2) ;; esac ])dnl @@ -3678,7 +3828,73 @@ $1=`echo "$2" | \ -e 's/-[[UD]]$3\(=[[^ ]]*\)\?[$]//g'` ])dnl dnl --------------------------------------------------------------------------- -dnl CF_SHARED_OPTS version: 42 updated: 2006/12/23 18:04:51 +dnl CF_REMOVE_LIB version: 1 updated: 2007/02/17 14:11:52 +dnl ------------- +dnl Remove the given library from the symbol +dnl +dnl $1 = target (which could be the same as the source variable) +dnl $2 = source (including '$') +dnl $3 = library to remove +define([CF_REMOVE_LIB], +[ +# remove $3 library from $2 +$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: 47 updated: 2008/03/23 14:48:54 dnl -------------- dnl -------------- dnl Attempt to determine the appropriate CC/LD options for creating a shared @@ -3724,7 +3940,7 @@ AC_DEFUN([CF_SHARED_OPTS], cf_cv_shlib_version=$withval ;; *) - AC_ERROR([option value must be one of: rel, abi, auto or no]) + AC_MSG_ERROR([option value must be one of: rel, abi, auto or no]) ;; esac ],[cf_cv_shlib_version=auto]) @@ -3755,14 +3971,27 @@ AC_DEFUN([CF_SHARED_OPTS], ;; cygwin*) CC_SHARED_OPTS= - MK_SHARED_LIB='${CC} ${CFLAGS} -shared -Wl,--out-implib=../lib/${IMPORT_LIB} -Wl,--export-all-symbols -o ../lib/${SHARED_LIB}' + MK_SHARED_LIB='sh ../mk_shared_lib.sh [$]@ [$]{CC} [$]{CFLAGS}' cf_cv_shlib_version=cygdll cf_cv_shlib_version_infix=cygdll + cat >mk_shared_lib.sh <<-CF_EOF + #!/bin/sh + SHARED_LIB=\[$]1 + IMPORT_LIB=\`echo "\[$]1" | sed -e 's/cyg/lib/' -e 's/[[0-9]]*\.dll[$]/.dll.a/'\` + shift + cat <<-EOF + Linking shared library + ** SHARED_LIB \[$]SHARED_LIB + ** IMPORT_LIB \[$]IMPORT_LIB +EOF + exec \[$]* -shared -Wl,--out-implib=../lib/\[$]{IMPORT_LIB} -Wl,--export-all-symbols -o ../lib/\[$]{SHARED_LIB} +CF_EOF + chmod +x mk_shared_lib.sh ;; darwin*) EXTRA_CFLAGS="-no-cpp-precomp" CC_SHARED_OPTS="-dynamic" - MK_SHARED_LIB='${CC} ${CFLAGS} -dynamiclib -install_name ${DESTDIR}${libdir}/`basename $[@]` -compatibility_version ${ABI_VERSION} -current_version ${ABI_VERSION} -o $[@]' + MK_SHARED_LIB='${CC} ${CFLAGS} -dynamiclib -install_name ${libdir}/`basename $[@]` -compatibility_version ${ABI_VERSION} -current_version ${ABI_VERSION} -o $[@]' test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=abi cf_cv_shlib_version_infix=yes AC_CACHE_CHECK([if ld -search_paths_first works], cf_cv_ldflags_search_paths_first, [ @@ -4041,6 +4270,41 @@ done fi ])dnl dnl --------------------------------------------------------------------------- +dnl CF_SIG_ATOMIC_T version: 2 updated: 2005/09/18 17:27:12 +dnl --------------- +dnl signal handler, but there are some gcc depedencies in that recommendation. +dnl Try anyway. +AC_DEFUN([CF_SIG_ATOMIC_T], +[ +AC_MSG_CHECKING(for signal global datatype) +AC_CACHE_VAL(cf_cv_sig_atomic_t,[ + for cf_type in \ + "volatile sig_atomic_t" \ + "sig_atomic_t" \ + "int" + do + AC_TRY_COMPILE([ +#include +#include +#include + +extern $cf_type x; +$cf_type x; +static void handler(int sig) +{ + x = 5; +}], + [signal(SIGINT, handler); + x = 1], + [cf_cv_sig_atomic_t=$cf_type], + [cf_cv_sig_atomic_t=no]) + test "$cf_cv_sig_atomic_t" != no && break + done + ]) +AC_MSG_RESULT($cf_cv_sig_atomic_t) +test "$cf_cv_sig_atomic_t" != no && AC_DEFINE_UNQUOTED(SIG_ATOMIC_T, $cf_cv_sig_atomic_t) +])dnl +dnl --------------------------------------------------------------------------- dnl CF_SIZECHANGE version: 8 updated: 2000/11/04 12:22:16 dnl ------------- dnl Check for definitions & structures needed for window size-changing @@ -4501,11 +4765,12 @@ AC_DEFUN([CF_UPPER], $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 @@ -4608,7 +4873,7 @@ if test "$with_dmalloc" = yes ; then fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_WITH_GPM version: 6 updated: 2006/12/17 11:12:09 +dnl CF_WITH_GPM version: 7 updated: 2008/03/23 14:48:54 dnl ----------- dnl dnl The option parameter (if neither yes/no) is assumed to be the name of @@ -4630,7 +4895,7 @@ if test "$with_gpm" != no ; then AC_DEFINE(HAVE_LIBGPM) else AC_CHECK_LIB(gpm,Gpm_Open,[:],[ - AC_ERROR(Cannot link with GPM library) + AC_MSG_ERROR(Cannot link with GPM library) fi with_gpm=yes ]) @@ -4641,7 +4906,7 @@ if test "$with_gpm" != no ; then fi ]) dnl --------------------------------------------------------------------------- -dnl CF_WITH_LIBTOOL version: 13 updated: 2007/01/27 17:52:16 +dnl CF_WITH_LIBTOOL version: 19 updated: 2008/03/29 15:46:43 dnl --------------- dnl Provide a configure option to incorporate libtool. Define several useful dnl symbols for the makefile rules. @@ -4690,7 +4955,7 @@ LIB_PREP="$RANLIB" # doing: LIB_CLEAN= LIB_COMPILE= -LIB_LINK= +LIB_LINK='${CC}' LIB_INSTALL= LIB_UNINSTALL= @@ -4716,12 +4981,12 @@ ifdef([AC_PROG_LIBTOOL],[ AC_MSG_ERROR(Cannot find libtool) fi ])dnl - LIB_CREATE='${LIBTOOL} --mode=link ${CC} -rpath ${DESTDIR}${libdir} -version-info `cut -f1 ${srcdir}/VERSION` -o' - LIB_OBJECT='${OBJECTS}.o=.lo)' + LIB_CREATE='${LIBTOOL} --mode=link ${CC} -rpath ${DESTDIR}${libdir} -version-info `cut -f1 ${srcdir}/VERSION` ${LIBTOOL_OPTS} -o' + LIB_OBJECT='${OBJECTS:.o=.lo}' LIB_SUFFIX=.la LIB_CLEAN='${LIBTOOL} --mode=clean' LIB_COMPILE='${LIBTOOL} --mode=compile' - LIB_LINK='${LIBTOOL} --mode=link' + LIB_LINK='${LIBTOOL} --mode=link ${CC} ${LIBTOOL_OPTS}' LIB_INSTALL='${LIBTOOL} --mode=install' LIB_UNINSTALL='${LIBTOOL} --mode=uninstall' LIB_PREP=: @@ -4735,13 +5000,14 @@ ifdef([AC_PROG_LIBTOOL],[ cf_cv_libtool_version=`$LIBTOOL --version 2>&1 | sed -e '/^$/d' |sed -e '2,$d' -e 's/([[^)]]*)//g' -e 's/^[[^1-9]]*//' -e 's/[[^0-9.]].*//'` AC_MSG_RESULT($cf_cv_libtool_version) if test -z "$cf_cv_libtool_version" ; then - AC_MSG_ERROR(This is not libtool) + AC_MSG_ERROR(This is not GNU libtool) fi # special hack to add --tag option for C++ compiler case $cf_cv_libtool_version in 1.[[5-9]]*|[[2-9]]*) LIBTOOL_CXX="$LIBTOOL --tag=CXX" + LIBTOOL="$LIBTOOL --tag=CC" ;; *) LIBTOOL_CXX="$LIBTOOL" @@ -4756,6 +5022,7 @@ test -z "$LIBTOOL" && ECHO_LT= AC_SUBST(LIBTOOL) AC_SUBST(LIBTOOL_CXX) +AC_SUBST(LIBTOOL_OPTS) AC_SUBST(LIB_CREATE) AC_SUBST(LIB_OBJECT) @@ -4770,7 +5037,7 @@ AC_SUBST(LIB_UNINSTALL) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_WITH_PATH version: 7 updated: 2006/08/03 15:20:08 +dnl CF_WITH_PATH version: 8 updated: 2007/05/13 13:16:35 dnl ------------ dnl Wrapper for AC_ARG_WITH to ensure that user supplies a pathname, not just dnl defaulting to yes/no. @@ -4784,7 +5051,9 @@ dnl AC_DEFUN([CF_WITH_PATH], [AC_ARG_WITH($1,[$2 ](default: ifelse($4,,empty,$4)),, ifelse($4,,[withval="${$3}"],[withval="${$3-ifelse($5,,$4,$5)}"]))dnl +if ifelse($5,,true,[test -n "$5"]) ; then CF_PATH_SYNTAX(withval) +fi $3="$withval" AC_SUBST($3)dnl ])dnl @@ -4831,6 +5100,32 @@ AC_SUBST($3)dnl ])dnl dnl --------------------------------------------------------------------------- +dnl CF_WITH_PTHREAD version: 1 updated: 2008/03/29 13:42:21 +dnl --------------- +dnl Check for POSIX thread library. +AC_DEFUN([CF_WITH_PTHREAD], +[ +AC_MSG_CHECKING(if you want to link with the pthread library) +AC_ARG_WITH(pthread, + [ --with-pthread use POSIX thread library], + [with_pthread=$withval], + [with_pthread=no]) +AC_MSG_RESULT($with_pthread) + +if test "$with_pthread" != no ; then + AC_CHECK_HEADER(pthread.h,[ + AC_DEFINE(HAVE_PTHREADS_H) + AC_CHECK_LIB(pthread,pthread_create,[ + LIBS="-lpthread $LIBS" + AC_DEFINE(HAVE_LIBPTHREADS) + with_pthread=yes + ],[ + AC_MSG_ERROR(Cannot link with pthread library) + ]) + ]) +fi +]) +dnl --------------------------------------------------------------------------- dnl CF_WITH_REL_VERSION version: 1 updated: 2003/09/20 18:12:49 dnl ------------------- dnl Allow library's release-version to be overridden. Generally this happens when a @@ -4894,7 +5189,7 @@ CF_NO_LEAKS_OPTION(valgrind, [USE_VALGRIND]) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_XOPEN_SOURCE version: 24 updated: 2006/04/02 16:41:09 +dnl CF_XOPEN_SOURCE version: 25 updated: 2007/01/29 18:36:38 dnl --------------- dnl Try to get _XOPEN_SOURCE defined properly that we can use POSIX functions, dnl or adapt to the vendor's definitions to get equivalent functionality, @@ -4928,7 +5223,7 @@ hpux*) #(vi irix[[56]].*) #(vi CPPFLAGS="$CPPFLAGS -D_SGI_SOURCE" ;; -linux*|gnu*) #(vi +linux*|gnu*|k*bsd*-gnu) #(vi CF_GNU_SOURCE ;; mirbsd*) #(vi