X-Git-Url: https://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=aclocal.m4;h=8fe0cf8db593bc9ff477a16f31266978b30e58c9;hp=faba48922c24ca08b3320579fcab6854f4f349df;hb=f6718d80c998008de6cfe8e6296bee3958ff86d7;hpb=396a05943b7da5039dd15d79c4385c7d2a75d6d4;ds=sidebyside diff --git a/aclocal.m4 b/aclocal.m4 index faba4892..8fe0cf8d 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -28,7 +28,7 @@ dnl*************************************************************************** dnl dnl Author: Thomas E. Dickey 1995-on dnl -dnl $Id: aclocal.m4,v 1.447 2008/04/12 23:49:55 tom Exp $ +dnl $Id: aclocal.m4,v 1.466 2008/10/04 21:21:40 tom Exp $ dnl Macros used in NCURSES auto-configuration script. dnl dnl These macros are maintained separately from NCURSES. The copyright on @@ -331,6 +331,30 @@ You have the following choices: fi ])dnl dnl --------------------------------------------------------------------------- +dnl CF_AWK_BIG_PRINTF version: 2 updated: 2008/10/04 17:16:18 +dnl ----------------- +dnl Check if awk can handle big strings using printf. Some older versions of +dnl awk choke on large strings passed via "%s". +dnl +dnl $1 = desired string size +dnl $2 = variable to set with result +AC_DEFUN([CF_AWK_BIG_PRINTF], +[ + case x$AWK in #(vi + x) + eval $2=no + ;; + *) #(vi + if ( ${AWK} 'BEGIN { xx = "x"; while (length(xx) < $1) { xx = xx "x"; }; printf("%s\n", xx); }' \ + | $AWK '{ printf "%d\n", length([$]0); }' | $AWK 'BEGIN { eqls=0; recs=0; } { recs++; if ([$]0 == 12000) eqls++; } END { if (recs != 1 || eqls != 1) exit 1; }' 2>/dev/null >/dev/null ) ; then + eval $2=yes + else + eval $2=no + fi + ;; + esac +])dnl +dnl --------------------------------------------------------------------------- dnl CF_BOOL_DECL version: 8 updated: 2004/01/30 15:51:18 dnl ------------ dnl Test if 'bool' is a builtin type in the configured C++ compiler. Some @@ -649,13 +673,14 @@ if test ".$system_name" != ".$cf_cv_system_name" ; then fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_CHECK_ERRNO version: 9 updated: 2001/12/30 18:03:23 +dnl CF_CHECK_ERRNO version: 10 updated: 2008/08/22 16:33:22 dnl -------------- dnl Check for data that is usually declared in or , e.g., dnl the 'errno' variable. Define a DECL_xxx symbol if we must declare it dnl ourselves. dnl dnl $1 = the name to check +dnl $2 = the assumed type AC_DEFUN([CF_CHECK_ERRNO], [ AC_CACHE_CHECK(if external $1 is declared, cf_cv_dcl_$1,[ @@ -666,7 +691,7 @@ AC_CACHE_CHECK(if external $1 is declared, cf_cv_dcl_$1,[ #include #include #include ], - [long x = (long) $1], + ifelse($2,,int,$2) x = (ifelse($2,,int,$2)) $1, [cf_cv_dcl_$1=yes], [cf_cv_dcl_$1=no]) ]) @@ -677,7 +702,7 @@ if test "$cf_cv_dcl_$1" = no ; then fi # It's possible (for near-UNIX clones) that the data doesn't exist -CF_CHECK_EXTERN_DATA($1,int) +CF_CHECK_EXTERN_DATA($1,ifelse($2,,int,$2)) ])dnl dnl --------------------------------------------------------------------------- dnl CF_CHECK_EXTERN_DATA version: 3 updated: 2001/12/30 18:03:23 @@ -920,6 +945,20 @@ if test "$with_no_leaks" = yes ; then fi ])dnl dnl --------------------------------------------------------------------------- +dnl CF_ENABLE_RPATH version: 1 updated: 2008/09/13 10:22:30 +dnl --------------- +dnl Check if the rpath option should be used, setting cache variable +dnl cf_cv_ld_rpath if so. +AC_DEFUN([CF_ENABLE_RPATH], +[ +AC_MSG_CHECKING(if rpath option should be used) +AC_ARG_ENABLE(rpath, +[ --enable-rpath use rpath option when generating shared libraries], +[cf_cv_ld_rpath=$enableval], +[cf_cv_ld_rpath=no]) +AC_MSG_RESULT($cf_cv_ld_rpath) +])dnl +dnl --------------------------------------------------------------------------- dnl CF_ERRNO version: 5 updated: 1997/11/30 12:44:39 dnl -------- dnl Check if 'errno' is declared in @@ -1278,7 +1317,7 @@ if test "$GCC" = yes ; then fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_GCC_WARNINGS version: 22 updated: 2007/07/29 09:55:12 +dnl CF_GCC_WARNINGS version: 23 updated: 2008/07/26 17:54:02 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: @@ -1373,7 +1412,7 @@ then ;; Winline) #(vi case $GCC_VERSION in - 3.3*) + [[34]].*) CF_VERBOSE(feature is broken in gcc $GCC_VERSION) continue;; esac @@ -1715,7 +1754,7 @@ fi ]) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_HASHED_DB_LIBS version: 7 updated: 2007/12/01 15:01:37 +dnl CF_HASHED_DB_LIBS version: 8 updated: 2008/08/04 06:18:06 dnl ----------------- dnl Given that we have the header and version for hashed database, find the dnl library information. @@ -1723,7 +1762,7 @@ AC_DEFUN([CF_HASHED_DB_LIBS], [ 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-$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 @@ -1949,7 +1988,7 @@ ifdef([AC_FUNC_FSEEKO],[ ]) ]) dnl --------------------------------------------------------------------------- -dnl CF_LDFLAGS_STATIC version: 2 updated: 2007/04/28 15:25:27 +dnl CF_LDFLAGS_STATIC version: 3 updated: 2008/07/05 13:56:40 dnl ----------------- dnl Check for compiler/linker flags used to temporarily force usage of static dnl libraries. This depends on the compiler and platform. Use this to help @@ -1958,8 +1997,16 @@ dnl the list of linker options and libraries. AC_DEFUN([CF_LDFLAGS_STATIC],[ if test "$GCC" = yes ; then - LDFLAGS_STATIC=-static - LDFLAGS_SHARED=-dynamic + case $cf_cv_system_name in #( + aix[[45]]*) #( gcc 4.2.4 linkage on AIX is broken + LDFLAGS_STATIC= + LDFLAGS_SHARED= + ;; + *) #( normally, except when broken + LDFLAGS_STATIC=-static + LDFLAGS_SHARED=-dynamic + ;; + esac else case $cf_cv_system_name in #( aix[[45]]*) #( from ld manpage @@ -2012,22 +2059,24 @@ if test "$cf_cv_libutf8" = yes ; then fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_LIB_PREFIX version: 7 updated: 2001/01/12 01:23:48 +dnl CF_LIB_PREFIX version: 8 updated: 2008/09/13 11:34:16 dnl ------------- dnl Compute the library-prefix for the given host system dnl $1 = variable to set AC_DEFUN([CF_LIB_PREFIX], [ - case $cf_cv_system_name in - OS/2*) LIB_PREFIX='' ;; - os2*) LIB_PREFIX='' ;; - *) LIB_PREFIX='lib' ;; + case $cf_cv_system_name in #(vi + OS/2*|os2*) #(vi + LIB_PREFIX='' + ;; + *) LIB_PREFIX='lib' + ;; esac ifelse($1,,,[$1=$LIB_PREFIX]) AC_SUBST(LIB_PREFIX) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_LIB_RULES version: 50 updated: 2007/03/24 18:26:59 +dnl CF_LIB_RULES version: 53 updated: 2008/09/20 19:51:59 dnl ------------ dnl Append definitions and rules for the given models to the subdirectory dnl Makefiles, and the recursion rule for the top-level Makefile. If the @@ -2044,6 +2093,12 @@ AC_DEFUN([CF_LIB_RULES], [ CF_LIB_PREFIX(cf_prefix) AC_REQUIRE([CF_SUBST_NCURSES_VERSION]) + +if test $cf_cv_shlib_version = cygdll ; then + TINFO_NAME=$TINFO_ARG_SUFFIX + TINFO_SUFFIX=.dll +fi + for cf_dir in $SRC_SUBDIRS do if test ! -d $srcdir/$cf_dir ; then @@ -2054,7 +2109,7 @@ do LIBS_TO_MAKE= for cf_item in $cf_LIST_MODELS do - CF_LIB_SUFFIX($cf_item,cf_suffix) + CF_LIB_SUFFIX($cf_item,cf_suffix,cf_depsuf) if test $cf_item = shared ; then if test "$cf_cv_do_symlinks" = yes ; then case "$cf_cv_shlib_version" in #(vi @@ -2096,7 +2151,8 @@ do # use autodetected ${cf_prefix} for import lib and static lib, but # use 'cyg' prefix for shared lib. if test $cf_cv_shlib_version = cygdll ; then - LIBS_TO_MAKE="$LIBS_TO_MAKE ../lib/cyg${cf_dir}\${ABI_VERSION}.dll" + cf_cygsuf=`echo "$cf_suffix" | sed -e 's/\.dll/\${ABI_VERSION}.dll/'` + LIBS_TO_MAKE="$LIBS_TO_MAKE ../lib/cyg${cf_dir}${cf_cygsuf}" continue fi fi @@ -2106,24 +2162,28 @@ do if test $cf_dir = ncurses ; then cf_subsets="$LIB_SUBSETS" cf_r_parts="$cf_subsets" + cf_liblist="$LIBS_TO_MAKE" while test -n "$cf_r_parts" do cf_l_parts=`echo "$cf_r_parts" |sed -e 's/ .*$//'` cf_r_parts=`echo "$cf_r_parts" |sed -e 's/^[[^ ]]* //'` if test "$cf_l_parts" != "$cf_r_parts" ; then + cf_item= case $cf_l_parts in #(vi *termlib*) #(vi - cf_item=`echo $LIBS_TO_MAKE |sed -e s%${LIB_NAME}${LIB_SUFFIX}%${TINFO_LIB_SUFFIX}%g` + cf_item=`echo $cf_liblist |sed -e s%${LIB_NAME}${LIB_SUFFIX}%${TINFO_LIB_SUFFIX}%g` ;; *ticlib*) - cf_item=`echo $LIBS_TO_MAKE |sed -e s%${LIB_NAME}${LIB_SUFFIX}%${TICS_LIB_SUFFIX}%g` + cf_item=`echo $cf_liblist |sed -e s%${LIB_NAME}${LIB_SUFFIX}%${TICS_LIB_SUFFIX}%g` ;; *) break ;; esac - LIBS_TO_MAKE="$cf_item $LIBS_TO_MAKE" + if test -n "$cf_item"; then + LIBS_TO_MAKE="$cf_item $LIBS_TO_MAKE" + fi else break fi @@ -2148,7 +2208,7 @@ do do echo "Appending rules for ${cf_item} model (${cf_dir}: ${cf_subset})" CF_UPPER(cf_ITEM,$cf_item) - CF_LIB_SUFFIX($cf_item,cf_suffix) + CF_LIB_SUFFIX($cf_item,cf_suffix,cf_depsuf) CF_OBJ_SUBDIR($cf_item,cf_subdir) # Test for case where we build libtinfo with a different name. @@ -2156,22 +2216,21 @@ do if test $cf_dir = ncurses ; then case $cf_subset in *base*) + cf_libname=${cf_libname}$LIB_SUFFIX ;; *termlib*) cf_libname=$TINFO_LIB_SUFFIX - if test -n "${DFT_ARG_SUFFIX}" ; then - # undo $LIB_SUFFIX add-on in CF_LIB_SUFFIX - cf_suffix=`echo $cf_suffix |sed -e "s%^${LIB_SUFFIX}%%"` - fi ;; ticlib*) cf_libname=$TICS_LIB_SUFFIX - if test -n "${DFT_ARG_SUFFIX}" ; then - # undo $LIB_SUFFIX add-on in CF_LIB_SUFFIX - cf_suffix=`echo $cf_suffix |sed -e "s%^${LIB_SUFFIX}%%"` - fi ;; esac + else + cf_libname=${cf_libname}$LIB_SUFFIX + fi + if test -n "${DFT_ARG_SUFFIX}" ; then + # undo $LIB_SUFFIX add-on in CF_LIB_SUFFIX + cf_suffix=`echo $cf_suffix |sed -e "s%^${LIB_SUFFIX}%%"` fi # These dependencies really are for development, not @@ -2480,34 +2539,62 @@ fi ]) ]) dnl --------------------------------------------------------------------------- -dnl CF_LIB_SUFFIX version: 13 updated: 2003/11/01 16:09:07 +dnl CF_LIB_SUFFIX version: 15 updated: 2008/09/13 11:54:48 dnl ------------- dnl Compute the library file-suffix from the given model name dnl $1 = model name -dnl $2 = variable to set +dnl $2 = variable to set (the nominal library suffix) +dnl $3 = dependency variable to set (actual filename) dnl The variable $LIB_SUFFIX, if set, prepends the variable to set. AC_DEFUN([CF_LIB_SUFFIX], [ AC_REQUIRE([CF_SUBST_NCURSES_VERSION]) case $1 in - libtool) $2='.la' ;; - normal) $2='.a' ;; - debug) $2='_g.a' ;; - profile) $2='_p.a' ;; + libtool) + $2='.la' + $3=[$]$2 + ;; + normal) + $2='.a' + $3=[$]$2 + ;; + debug) + $2='_g.a' + $3=[$]$2 + ;; + profile) + $2='_p.a' + $3=[$]$2 + ;; shared) case $cf_cv_system_name in - cygwin*) $2='.dll' ;; - darwin*) $2='.dylib' ;; + cygwin*) + $2='.dll' + $3='.dll.a' + ;; + darwin*) + $2='.dylib' + $3=[$]$2 + ;; hpux*) case $target in - ia64*) $2='.so' ;; - *) $2='.sl' ;; + ia64*) + $2='.so' + $3=[$]$2 + ;; + *) + $2='.sl' + $3=[$]$2 + ;; esac ;; - *) $2='.so' ;; + *) $2='.so' + $3=[$]$2 + ;; esac esac test -n "$LIB_SUFFIX" && $2="${LIB_SUFFIX}[$]{$2}" + test -n "$LIB_SUFFIX" && $3="${LIB_SUFFIX}[$]{$3}" ])dnl dnl --------------------------------------------------------------------------- dnl CF_LIB_TYPE version: 4 updated: 2000/10/20 22:57:49 @@ -3869,7 +3956,7 @@ define([CF_REMOVE_LIB], $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 CF_RPATH_HACK version: 4 updated: 2008/09/13 12:53:26 dnl ------------- AC_DEFUN([CF_RPATH_HACK], [ @@ -3881,48 +3968,46 @@ 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," - ;; + cf_rpath_hack="-Wl,-rpath," + ;; -R\ *) - cf_rpath_hack="-R " - ;; + cf_rpath_hack="-R " + ;; -R*) - cf_rpath_hack="-R" - ;; + cf_rpath_hack="-R" + ;; *) - cf_rpath_hack= - ;; + 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) + 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" + ;; + esac + cf_rpath_dst="$cf_rpath_dst $cf_rpath_src" + 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 CF_SHARED_OPTS version: 52 updated: 2008/09/13 11:54:48 dnl -------------- dnl -------------- dnl Attempt to determine the appropriate CC/LD options for creating a shared @@ -4057,8 +4142,10 @@ CF_EOF # tested with IRIX 5.2 and 'cc'. if test "$GCC" != yes; then CC_SHARED_OPTS='-KPIC' + MK_SHARED_LIB='${CC} -shared -rdata_shared -soname `basename $[@]` -o $[@]' + else + MK_SHARED_LIB='${CC} -shared -Wl,-soname,`basename $[@]` -o $[@]' fi - MK_SHARED_LIB='${CC} -shared -rdata_shared -soname `basename $[@]` -o $[@]' cf_cv_rm_so_locs=yes ;; linux*|gnu*|k*bsd*-gnu) @@ -4071,11 +4158,20 @@ CF_EOF EXTRA_LDFLAGS="-Wl,-rpath,\${libdir} $EXTRA_LDFLAGS" fi CF_SHARED_SONAME - MK_SHARED_LIB='${CC} ${CFLAGS} -shared -Wl,-soname,'$cf_shared_soname',-stats,-lc -o $[@]' + MK_SHARED_LIB='${CC} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname',-stats,-lc -o $[@]' ;; openbsd[[2-9]].*) + if test "$DFT_LWR_MODEL" = "shared" ; then + LOCAL_LDFLAGS="-Wl,-rpath,\$(LOCAL_LIBDIR)" + LOCAL_LDFLAGS2="$LOCAL_LDFLAGS" + fi + if test "$cf_cv_ld_rpath" = yes ; then + cf_ld_rpath_opt="-Wl,-rpath," + EXTRA_LDFLAGS="-Wl,-rpath,\${libdir} $EXTRA_LDFLAGS" + fi CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC" - MK_SHARED_LIB='${LD} -Bshareable -soname,`basename $[@].${ABI_VERSION}` -o $[@]' + CF_SHARED_SONAME + MK_SHARED_LIB='${CC} ${CFLAGS} -Wl,-Bshareable,-soname,'$cf_cv_shared_soname',-stats,-lc -o $[@]' ;; openbsd*|freebsd[[12]].*) CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC" @@ -4108,7 +4204,7 @@ CF_EOF fi fi CF_SHARED_SONAME - MK_SHARED_LIB='${CC} ${CFLAGS} -shared -Wl,-soname,'$cf_shared_soname' -o $[@]' + MK_SHARED_LIB='${CC} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname' -o $[@]' else MK_SHARED_LIB='${LD} -Bshareable -o $[@]' fi @@ -4158,9 +4254,7 @@ CF_EOF ;; solaris2*) # tested with SunOS 5.5.1 (solaris 2.5.1) and gcc 2.7.2 - if test "$GCC" != yes; then - CC_SHARED_OPTS='-KPIC' - fi + # tested with SunOS 5.10 (solaris 10) and gcc 3.4.3 if test "$DFT_LWR_MODEL" = "shared" ; then LOCAL_LDFLAGS="-R \$(LOCAL_LIBDIR):\${libdir}" LOCAL_LDFLAGS2="$LOCAL_LDFLAGS" @@ -4170,7 +4264,12 @@ CF_EOF EXTRA_LDFLAGS="$LOCAL_LDFLAGS $EXTRA_LDFLAGS" fi CF_SHARED_SONAME - MK_SHARED_LIB='${CC} -dy -G -h '$cf_shared_soname' -o $[@]' + if test "$GCC" != yes; then + CC_SHARED_OPTS='-xcode=pic32' + MK_SHARED_LIB='${CC} -dy -G -h '$cf_cv_shared_soname' -o $[@]' + else + MK_SHARED_LIB='${CC} -shared -dy -G -h '$cf_cv_shared_soname' -o $[@]' + fi ;; sysv5uw7*|unix_sv*) # tested with UnixWare 7.1.0 (gcc 2.95.2 and cc) @@ -4221,9 +4320,9 @@ CF_EOF AC_SUBST(INSTALL_LIB) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_SHARED_SONAME version: 2 updated: 2006/10/21 12:33:41 +dnl CF_SHARED_SONAME version: 3 updated: 2008/09/08 18:34:43 dnl ---------------- -dnl utility macro for CF_SHARED_OPTS, constructs "$cf_shared_soname" for +dnl utility macro for CF_SHARED_OPTS, constructs "$cf_cv_shared_soname" for dnl substitution into MK_SHARED_LIB string for the "-soname" (or similar) dnl option. dnl @@ -4233,9 +4332,9 @@ define([CF_SHARED_SONAME], [ test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=ifelse($1,,rel,$1) if test "$cf_cv_shlib_version" = rel; then - cf_shared_soname='`basename $[@] .${REL_VERSION}`.${ABI_VERSION}' + cf_cv_shared_soname='`basename $[@] .${REL_VERSION}`.${ABI_VERSION}' else - cf_shared_soname='`basename $[@]`' + cf_cv_shared_soname='`basename $[@]`' fi ]) dnl --------------------------------------------------------------------------- @@ -4851,6 +4950,32 @@ fi ]) ])dnl dnl --------------------------------------------------------------------------- +dnl CF_WEAK_SYMBOLS version: 1 updated: 2008/08/16 19:18:06 +dnl --------------- +dnl Check for compiler-support for weak symbols. +dnl This works with "recent" gcc. +AC_DEFUN([CF_WEAK_SYMBOLS],[ +AC_CACHE_CHECK(if $CC supports weak symbols,cf_cv_weak_symbols,[ + +AC_TRY_COMPILE([ +#include ], +[ +#if defined(__GNUC__) +# if defined __USE_ISOC99 +# define _cat_pragma(exp) _Pragma(#exp) +# define _weak_pragma(exp) _cat_pragma(weak name) +# else +# define _weak_pragma(exp) +# endif +# define _declare(name) __extension__ extern __typeof__(name) name +# define weak_symbol(name) _weak_pragma(name) _declare(name) __attribute__((weak)) +#endif + +weak_symbol(fopen); +],[cf_cv_weak_symbols=yes],[cf_cv_weak_symbols=no]) +]) +])dnl +dnl --------------------------------------------------------------------------- dnl CF_WITH_ABI_VERSION version: 1 updated: 2003/09/20 18:12:49 dnl ------------------- dnl Allow library's ABI to be overridden. Generally this happens when a @@ -5128,7 +5253,7 @@ AC_SUBST($3)dnl ])dnl dnl --------------------------------------------------------------------------- -dnl CF_WITH_PTHREAD version: 1 updated: 2008/03/29 13:42:21 +dnl CF_WITH_PTHREAD version: 2 updated: 2008/08/23 18:26:05 dnl --------------- dnl Check for POSIX thread library. AC_DEFUN([CF_WITH_PTHREAD], @@ -5143,13 +5268,24 @@ 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,[ + + AC_MSG_CHECKING(if we can link with the pthread library) + cf_save_LIBS="$LIBS" + LIBS="-lpthread $LIBS" + AC_TRY_LINK([ +#include +],[ + int rc = pthread_create(0,0,0,0); +],[with_pthread=yes],[with_pthread=no]) + LIBS="$cf_save_LIBS" + AC_MSG_RESULT($with_pthread) + + if test "$with_pthread" = yes ; then LIBS="-lpthread $LIBS" AC_DEFINE(HAVE_LIBPTHREADS) - with_pthread=yes - ],[ + else AC_MSG_ERROR(Cannot link with pthread library) - ]) + fi ]) fi ]) @@ -5217,7 +5353,7 @@ CF_NO_LEAKS_OPTION(valgrind, [USE_VALGRIND]) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_XOPEN_SOURCE version: 25 updated: 2007/01/29 18:36:38 +dnl CF_XOPEN_SOURCE version: 26 updated: 2008/07/27 11:26:57 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, @@ -5237,7 +5373,7 @@ case $host_os in #(vi aix[[45]]*) #(vi CPPFLAGS="$CPPFLAGS -D_ALL_SOURCE" ;; -freebsd*) #(vi +freebsd*|dragonfly*) #(vi # 5.x headers associate # _XOPEN_SOURCE=600 with _POSIX_C_SOURCE=200112L # _XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L