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 *
dnl
dnl Author: Thomas E. Dickey 1995-on
dnl
-dnl $Id: aclocal.m4,v 1.440 2007/11/25 00:58:01 tom Exp $
+dnl $Id: aclocal.m4,v 1.452 2008/08/16 23:19:46 tom Exp $
dnl Macros used in NCURSES auto-configuration script.
dnl
dnl These macros are maintained separately from NCURSES. The copyright on
])dnl
dnl ---------------------------------------------------------------------------
-dnl CF_ADD_INCDIR version: 8 updated: 2007/07/30 19:22:58
+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,
fi
if test "$cf_have_incdir" = no ; then
- AC_VERBOSE(adding $cf_add_incdir to include-path)
+ 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%'`
fi
])dnl
dnl ---------------------------------------------------------------------------
-dnl CF_ADD_LIBDIR version: 5 updated: 2007/07/30 19:12:03
+dnl CF_ADD_LIBDIR version: 6 updated: 2008/02/09 13:15:34
dnl -------------
dnl Adds to the library-path
dnl
done
fi
if test "$cf_have_libdir" = no ; then
- AC_VERBOSE(adding $cf_add_libdir to library-path)
+ CF_VERBOSE(adding $cf_add_libdir to library-path)
ifelse($2,,LDFLAGS,$2)="-L$cf_add_libdir $ifelse($2,,LDFLAGS,[$]$2)"
fi
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
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
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.
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 ---------------------------------------------------------------------------
test "$cf_cv_func_nanosleep" = "yes" && AC_DEFINE(HAVE_NANOSLEEP)
])
dnl ---------------------------------------------------------------------------
+dnl CF_FUNC_OPENPTY version: 2 updated: 2008/04/12 19:49:01
+dnl ---------------
+dnl Check for openpty() function, along with <pty.h> header. It may need the
+dnl "util" library as well.
+AC_DEFUN([CF_FUNC_OPENPTY],
+[
+AC_CHECK_LIB(util,openpty,cf_cv_lib_util=yes,cf_cv_lib_util=no)
+AC_CACHE_CHECK(for openpty header,cf_cv_func_openpty,[
+ cf_save_LIBS="$LIBS"
+ test $cf_cv_lib_util = yes && LIBS="-lutil $LIBS"
+ for cf_header in pty.h libutil.h util.h
+ do
+ AC_TRY_LINK([
+#include <$cf_header>
+],[
+ int x = openpty((int *)0, (int *)0, (char *)0,
+ (struct termios *)0, (struct winsize *)0);
+],[
+ cf_cv_func_openpty=$cf_header
+ break
+],[
+ cf_cv_func_openpty=no
+])
+ done
+ LIBS="$cf_save_LIBS"
+])
+])dnl
+dnl ---------------------------------------------------------------------------
dnl CF_FUNC_POLL version: 4 updated: 2006/12/16 12:33:30
dnl ------------
dnl See if the poll function really works. Some platforms have poll(), but
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:
;;
Winline) #(vi
case $GCC_VERSION in
- 3.3*)
+ [[34]].*)
CF_VERBOSE(feature is broken in gcc $GCC_VERSION)
continue;;
esac
])
])dnl
dnl ---------------------------------------------------------------------------
-dnl CF_HASHED_DB_LIBS version: 6 updated: 2006/12/16 12:33:30
+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.
[
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([
])
])
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
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
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
$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
$1=`echo "$2" | sed -e 's/-l$3[[ ]]//g' -e 's/-l$3[$]//'`
])dnl
dnl ---------------------------------------------------------------------------
-dnl CF_RPATH_HACK version: 2 updated: 2007/11/24 19:09:03
+dnl CF_RPATH_HACK version: 3 updated: 2007/12/01 11:14:13
dnl -------------
AC_DEFUN([CF_RPATH_HACK],
[
cf_rpath_hack=
;;
esac
-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)
+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 CF_SHARED_OPTS version: 48 updated: 2008/06/14 15:08:17
dnl --------------
dnl --------------
dnl Attempt to determine the appropriate CC/LD options for creating a shared
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])
;;
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"
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_shared_soname' -o $[@]'
+ else
+ MK_SHARED_LIB='${CC} -shared -dy -G -h '$cf_shared_soname' -o $[@]'
+ fi
;;
sysv5uw7*|unix_sv*)
# tested with UnixWare 7.1.0 (gcc 2.95.2 and cc)
])
])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 <stdio.h>],
+[
+#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
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
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
])
fi
])
dnl ---------------------------------------------------------------------------
-dnl CF_WITH_LIBTOOL version: 18 updated: 2007/04/08 20:02:38
+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.
case $cf_cv_libtool_version in
1.[[5-9]]*|[[2-9]]*)
LIBTOOL_CXX="$LIBTOOL --tag=CXX"
+ LIBTOOL="$LIBTOOL --tag=CC"
;;
*)
LIBTOOL_CXX="$LIBTOOL"
])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
[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,
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