+AC_CACHE_CHECK(if we must define _GNU_SOURCE,cf_cv_gnu_source,[
+AC_TRY_COMPILE([#include <sys/types.h>],[
+#ifndef _XOPEN_SOURCE
+make an error
+#endif],
+ [cf_cv_gnu_source=no],
+ [cf_save="$CPPFLAGS"
+ CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
+ AC_TRY_COMPILE([#include <sys/types.h>],[
+#ifdef _XOPEN_SOURCE
+make an error
+#endif],
+ [cf_cv_gnu_source=no],
+ [cf_cv_gnu_source=yes])
+ CPPFLAGS="$cf_save"
+ ])
+])
+test "$cf_cv_gnu_source" = yes && CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_GPP_LIBRARY version: 8 updated: 2003/02/02 01:41:46
+dnl --------------
+dnl If we're trying to use g++, test if libg++ is installed (a rather common
+dnl problem :-). If we have the compiler but no library, we'll be able to
+dnl configure, but won't be able to build the c++ demo program.
+AC_DEFUN([CF_GPP_LIBRARY],
+[
+cf_cxx_library=unknown
+case $cf_cv_system_name in #(vi
+os2*) #(vi
+ cf_gpp_libname=gpp
+ ;;
+*)
+ cf_gpp_libname=g++
+ ;;
+esac
+if test "$GXX" = yes; then
+ AC_MSG_CHECKING([for lib$cf_gpp_libname])
+ cf_save="$LIBS"
+ LIBS="$LIBS -l$cf_gpp_libname"
+ AC_TRY_LINK([
+#include <$cf_gpp_libname/builtin.h>
+ ],
+ [two_arg_error_handler_t foo2 = lib_error_handler],
+ [cf_cxx_library=yes
+ CXXLIBS="$CXXLIBS -l$cf_gpp_libname"
+ if test "$cf_gpp_libname" = cpp ; then
+ AC_DEFINE(HAVE_GPP_BUILTIN_H)
+ else
+ AC_DEFINE(HAVE_GXX_BUILTIN_H)
+ fi],
+ [AC_TRY_LINK([
+#include <builtin.h>
+ ],
+ [two_arg_error_handler_t foo2 = lib_error_handler],
+ [cf_cxx_library=yes
+ CXXLIBS="$CXXLIBS -l$cf_gpp_libname"
+ AC_DEFINE(HAVE_BUILTIN_H)],
+ [cf_cxx_library=no])])
+ LIBS="$cf_save"
+ AC_MSG_RESULT($cf_cxx_library)
+fi
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_GXX_VERSION version: 5 updated: 2005/08/27 09:53:42
+dnl --------------
+dnl Check for version of g++
+AC_DEFUN([CF_GXX_VERSION],[
+AC_REQUIRE([AC_PROG_CPP])
+GXX_VERSION=none
+if test "$GXX" = yes; then
+ AC_MSG_CHECKING(version of g++)
+ GXX_VERSION="`${CXX-g++} --version| sed -e '2,$d' -e 's/^.*(GCC) //' -e 's/^[[^0-9.]]*//' -e 's/[[^0-9.]].*//'`"
+ test -z "$GXX_VERSION" && GXX_VERSION=unknown
+ AC_MSG_RESULT($GXX_VERSION)
+fi
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_GXX_WARNINGS version: 5 updated: 2005/08/13 14:54:38
+dnl ---------------
+dnl Check if the compiler supports useful warning options.
+dnl
+dnl Most of gcc's options apply to g++, except:
+dnl -Wbad-function-cast
+dnl -Wmissing-declarations
+dnl -Wnested-externs
+dnl
+dnl Omit a few (for now):
+dnl -Winline
+dnl
+dnl Parameter:
+dnl $1 is an optional list of g++ warning flags that a particular
+dnl application might want to use, e.g., "no-unused" for
+dnl -Wno-unused
+dnl Special:
+dnl If $with_ext_const is "yes", add a check for -Wwrite-strings
+dnl
+AC_DEFUN([CF_GXX_WARNINGS],
+[
+
+CF_INTEL_COMPILER(GXX,INTEL_CPLUSPLUS,CXXFLAGS)
+
+AC_REQUIRE([CF_GXX_VERSION])
+
+AC_LANG_SAVE
+AC_LANG_CPLUSPLUS
+
+cat > conftest.$ac_ext <<EOF
+#line __oline__ "configure"
+int main(int argc, char *argv[[]]) { return (argv[[argc-1]] == 0) ; }
+EOF
+
+if test "$INTEL_CPLUSPLUS" = yes
+then
+# The "-wdXXX" options suppress warnings:
+# remark #1419: external declaration in primary source file
+# remark #1682: implicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
+# remark #1683: explicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
+# remark #1684: conversion from pointer to same-sized integral type (potential portability problem)
+# remark #193: zero used for undefined preprocessing identifier
+# remark #593: variable "curs_sb_left_arrow" was set but never used
+# remark #810: conversion from "int" to "Dimension={unsigned short}" may lose significant bits
+# remark #869: parameter "tw" was never referenced
+# remark #981: operands are evaluated in unspecified order
+# warning #269: invalid format string conversion
+
+ AC_CHECKING([for $CC warning options])
+ cf_save_CXXFLAGS="$CXXFLAGS"
+ EXTRA_CXXFLAGS="-Wall"
+ for cf_opt in \
+ wd1419 \
+ wd1682 \
+ wd1683 \
+ wd1684 \
+ wd193 \
+ wd279 \
+ wd593 \
+ wd810 \
+ wd869 \
+ wd981
+ do
+ CXXFLAGS="$cf_save_CXXFLAGS $EXTRA_CXXFLAGS -$cf_opt"
+ if AC_TRY_EVAL(ac_compile); then
+ test -n "$verbose" && AC_MSG_RESULT(... -$cf_opt)
+ EXTRA_CXXFLAGS="$EXTRA_CXXFLAGS -$cf_opt"
+ fi
+ done
+ CXXFLAGS="$cf_save_CXXFLAGS"
+
+elif test "$GXX" = yes
+then
+ AC_CHECKING([for $CXX warning options])
+ cf_save_CXXFLAGS="$CXXFLAGS"
+ EXTRA_CXXFLAGS="-W -Wall"
+ cf_gxx_extra_warnings=""
+ test "$with_ext_const" = yes && cf_gxx_extra_warnings="Wwrite-strings"
+ case "$GCC_VERSION" in
+ [[1-2]].*)
+ ;;
+ *)
+ cf_gxx_extra_warnings="$cf_gxx_extra_warnings Weffc++"
+ ;;
+ esac
+ for cf_opt in \
+ Wabi \
+ fabi-version=0 \
+ Woverloaded-virtual \
+ Wsign-promo \
+ Wsynth \
+ Wold-style-cast \
+ Wcast-align \
+ Wcast-qual \
+ Wmissing-prototypes \
+ Wpointer-arith \
+ Wshadow \
+ Wstrict-prototypes \
+ Wundef $cf_gxx_extra_warnings $1
+ do
+ CXXFLAGS="$cf_save_CXXFLAGS $EXTRA_CXXFLAGS -Werror -$cf_opt"
+ if AC_TRY_EVAL(ac_compile); then
+ test -n "$verbose" && AC_MSG_RESULT(... -$cf_opt)
+ EXTRA_CXXFLAGS="$EXTRA_CXXFLAGS -$cf_opt"
+ else
+ test -n "$verbose" && AC_MSG_RESULT(... no -$cf_opt)
+ fi
+ done
+ CXXFLAGS="$cf_save_CXXFLAGS"
+fi
+
+rm -f conftest*
+AC_LANG_RESTORE
+AC_SUBST(EXTRA_CXXFLAGS)
+])dnl
+dnl ---------------------------------------------------------------------------
+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
+ AC_MSG_ERROR(Cannot determine version of db)
+else
+ CF_HASHED_DB_LIBS
+ if test "$cf_cv_hashed_db_libs" = unknown ; then
+ AC_MSG_ERROR(Cannot determine library for db)
+ elif test "$cf_cv_hashed_db_libs" != default ; then
+ LIBS="-l$cf_cv_hashed_db_libs $LIBS"
+ fi
+fi
+],[
+ AC_MSG_ERROR(Cannot find db.h)
+])
+])dnl
+dnl ---------------------------------------------------------------------------
+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_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 ''
+do
+ cf_save_libs="$LIBS"
+ if test -n "$cf_db_libs"; then
+ LIBS="-l$cf_db_libs $LIBS"
+ fi
+ CF_MSG_LOG(checking for library "$cf_db_libs")
+ AC_TRY_LINK([
+$ac_includes_default
+#include <db.h>
+],[
+ char *path = "/tmp/foo";
+#ifdef DB_VERSION_MAJOR
+#if DB_VERSION_MAJOR >= 4
+ DB *result = 0;
+ db_create(&result, NULL, 0);
+ result->open(result,
+ NULL,
+ path,
+ path,
+ DB_HASH,
+ DB_CREATE,
+ 0644);
+#elif DB_VERSION_MAJOR >= 3
+ DB *result = 0;
+ db_create(&result, NULL, 0);
+ result->open(result,
+ path,
+ path,
+ DB_HASH,
+ DB_CREATE,
+ 0644);
+#elif DB_VERSION_MAJOR >= 2
+ DB *result = 0;
+ db_open(path,
+ DB_HASH,
+ DB_CREATE,
+ 0644,
+ (DB_ENV *) 0,
+ (DB_INFO *) 0,
+ &result);
+#endif /* DB_VERSION_MAJOR */
+#else
+ DB *result = dbopen(path,
+ 2,
+ 0644,
+ DB_HASH,
+ 0);
+#endif
+ ${cf_cv_main_return:-return}(result != 0)
+],[
+ if test -n "$cf_db_libs" ; then
+ cf_cv_hashed_db_libs=$cf_db_libs
+ else
+ cf_cv_hashed_db_libs=default
+ fi
+ LIBS="$cf_save_libs"
+ break
+])
+ LIBS="$cf_save_libs"
+done
+])
+])dnl
+dnl ---------------------------------------------------------------------------
+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_DEFUN([CF_HASHED_DB_VERSION],
+[
+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 5
+do
+ CF_MSG_LOG(checking for db version $cf_db_version)
+ AC_TRY_COMPILE([
+$ac_includes_default
+#include <db.h>
+
+#ifdef DB_VERSION_MAJOR
+ /* db2 (DB_VERSION_MAJOR=2) has also DB_VERSION_MINOR, tested with 7 */
+#if $cf_db_version == DB_VERSION_MAJOR
+ /* ok */
+#else
+ make an error
+#endif
+#else
+#if $cf_db_version == 1
+ /* ok: assuming this is DB 1.8.5 */
+#else
+ make an error
+#endif
+#endif
+],[DBT *foo = 0],[
+ cf_cv_hashed_db_version=$cf_db_version
+ break
+ ])
+done
+])
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_HELP_MESSAGE version: 3 updated: 1998/01/14 10:56:23
+dnl ---------------
+dnl Insert text into the help-message, for readability, from AC_ARG_WITH.
+AC_DEFUN([CF_HELP_MESSAGE],
+[AC_DIVERT_HELP([$1])dnl
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_INCLUDE_DIRS version: 5 updated: 2006/10/14 15:23:15
+dnl ---------------
+dnl Construct the list of include-options according to whether we're building
+dnl in the source directory or using '--srcdir=DIR' option. If we're building
+dnl with gcc, don't append the includedir if it happens to be /usr/include,
+dnl since that usually breaks gcc's shadow-includes.
+AC_DEFUN([CF_INCLUDE_DIRS],
+[
+CPPFLAGS="-I. -I../include $CPPFLAGS"
+if test "$srcdir" != "."; then
+ CPPFLAGS="-I\${srcdir}/../include $CPPFLAGS"
+fi
+if test "$GCC" != yes; then
+ CPPFLAGS="$CPPFLAGS -I\${includedir}"
+elif test "$includedir" != "/usr/include"; then
+ if test "$includedir" = '${prefix}/include' ; then
+ if test $prefix != /usr ; then
+ CPPFLAGS="$CPPFLAGS -I\${includedir}"
+ fi
+ else
+ CPPFLAGS="$CPPFLAGS -I\${includedir}"
+ fi
+fi
+AC_SUBST(CPPFLAGS)
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_INTEL_COMPILER version: 3 updated: 2005/08/06 18:37:29
+dnl -----------------
+dnl Check if the given compiler is really the Intel compiler for Linux. It
+dnl tries to imitate gcc, but does not return an error when it finds a mismatch
+dnl between prototypes, e.g., as exercised by CF_MISSING_CHECK.
+dnl
+dnl This macro should be run "soon" after AC_PROG_CC or AC_PROG_CPLUSPLUS, to
+dnl ensure that it is not mistaken for gcc/g++. It is normally invoked from
+dnl the wrappers for gcc and g++ warnings.
+dnl
+dnl $1 = GCC (default) or GXX
+dnl $2 = INTEL_COMPILER (default) or INTEL_CPLUSPLUS
+dnl $3 = CFLAGS (default) or CXXFLAGS
+AC_DEFUN([CF_INTEL_COMPILER],[
+ifelse($2,,INTEL_COMPILER,[$2])=no
+
+if test "$ifelse($1,,[$1],GCC)" = yes ; then
+ case $host_os in
+ linux*|gnu*)
+ AC_MSG_CHECKING(if this is really Intel ifelse($1,GXX,C++,C) compiler)
+ cf_save_CFLAGS="$ifelse($3,,CFLAGS,[$3])"
+ ifelse($3,,CFLAGS,[$3])="$ifelse($3,,CFLAGS,[$3]) -no-gcc"
+ AC_TRY_COMPILE([],[
+#ifdef __INTEL_COMPILER
+#else
+make an error
+#endif
+],[ifelse($2,,INTEL_COMPILER,[$2])=yes
+cf_save_CFLAGS="$cf_save_CFLAGS -we147 -no-gcc"
+],[])
+ ifelse($3,,CFLAGS,[$3])="$cf_save_CFLAGS"
+ AC_MSG_RESULT($ifelse($2,,INTEL_COMPILER,[$2]))
+ ;;
+ esac
+fi
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_ISASCII version: 3 updated: 2000/08/12 23:18:52
+dnl ----------
+dnl Check if we have either a function or macro for 'isascii()'.
+AC_DEFUN([CF_ISASCII],
+[
+AC_MSG_CHECKING(for isascii)
+AC_CACHE_VAL(cf_cv_have_isascii,[
+ AC_TRY_LINK([#include <ctype.h>],[int x = isascii(' ')],
+ [cf_cv_have_isascii=yes],
+ [cf_cv_have_isascii=no])
+])dnl
+AC_MSG_RESULT($cf_cv_have_isascii)
+test "$cf_cv_have_isascii" = yes && AC_DEFINE(HAVE_ISASCII)
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_LARGEFILE version: 7 updated: 2007/06/02 11:58:50
+dnl ------------
+dnl Add checks for large file support.
+AC_DEFUN([CF_LARGEFILE],[
+ifdef([AC_FUNC_FSEEKO],[
+ AC_SYS_LARGEFILE
+ if test "$enable_largefile" != no ; then
+ AC_FUNC_FSEEKO
+
+ # Normally we would collect these definitions in the config.h,
+ # but (like _XOPEN_SOURCE), some environments rely on having these
+ # defined before any of the system headers are included. Another
+ # case comes up with C++, e.g., on AIX the compiler compiles the
+ # header files by themselves before looking at the body files it is
+ # told to compile. For ncurses, those header files do not include
+ # the config.h
+ test "$ac_cv_sys_large_files" != no && CPPFLAGS="$CPPFLAGS -D_LARGE_FILES "
+ test "$ac_cv_sys_largefile_source" != no && CPPFLAGS="$CPPFLAGS -D_LARGEFILE_SOURCE "
+ test "$ac_cv_sys_file_offset_bits" != no && CPPFLAGS="$CPPFLAGS -D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits "
+
+ AC_CACHE_CHECK(whether to use struct dirent64, cf_cv_struct_dirent64,[
+ AC_TRY_COMPILE([
+#include <sys/types.h>
+#include <dirent.h>
+ ],[
+ /* if transitional largefile support is setup, this is true */
+ extern struct dirent64 * readdir(DIR *);
+ struct dirent64 *x = readdir((DIR *)0);
+ struct dirent *y = readdir((DIR *)0);
+ int z = x - y;
+ ],
+ [cf_cv_struct_dirent64=yes],
+ [cf_cv_struct_dirent64=no])
+ ])
+ test "$cf_cv_struct_dirent64" = yes && AC_DEFINE(HAVE_STRUCT_DIRENT64)
+ fi
+])
+])
+dnl ---------------------------------------------------------------------------
+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
+dnl ensure that the linker picks up a given library based on its position in
+dnl the list of linker options and libraries.
+AC_DEFUN([CF_LDFLAGS_STATIC],[
+
+if test "$GCC" = yes ; then
+ 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
+ LDFLAGS_STATIC=-bstatic
+ LDFLAGS_SHARED=-bdynamic
+ ;;
+ hpux*) #( from ld manpage for hpux10.20, hpux11.11
+ # We could also use just "archive" and "shared".
+ LDFLAGS_STATIC=-Wl,-a,archive_shared
+ LDFLAGS_SHARED=-Wl,-a,shared_archive
+ ;;
+ irix*) #( from ld manpage IRIX64
+ LDFLAGS_STATIC=-Bstatic
+ LDFLAGS_SHARED=-Bdynamic
+ ;;
+ osf[[45]]*) #( from ld manpage osf4.0d, osf5.1
+ # alternative "-oldstyle_liblookup" (not in cc manpage)
+ LDFLAGS_STATIC=-noso
+ LDFLAGS_SHARED=-so_archive
+ ;;
+ solaris2*)
+ LDFLAGS_STATIC=-Bstatic
+ LDFLAGS_SHARED=-Bdynamic
+ ;;
+ esac
+fi
+
+AC_SUBST(LDFLAGS_STATIC)
+AC_SUBST(LDFLAGS_SHARED)
+])
+dnl ---------------------------------------------------------------------------
+dnl CF_LIBUTF8 version: 2 updated: 2002/01/19 22:51:32
+dnl ----------
+dnl Check for libutf8
+AC_DEFUN([CF_LIBUTF8],
+[
+AC_CACHE_CHECK(for putwc in libutf8,cf_cv_libutf8,[
+ cf_save_LIBS="$LIBS"
+ LIBS="-lutf8 $LIBS"
+AC_TRY_LINK([
+#include <libutf8.h>],[putwc(0,0);],
+ [cf_cv_libutf8=yes],
+ [cf_cv_libutf8=no])
+ LIBS="$cf_save_LIBS"
+])
+
+if test "$cf_cv_libutf8" = yes ; then
+ AC_DEFINE(HAVE_LIBUTF8_H)
+ LIBS="-lutf8 $LIBS"
+fi
+])dnl
+dnl ---------------------------------------------------------------------------
+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 #(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: 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
+dnl subdirectory is a library-source directory, modify the LIBS_TO_MAKE list in
+dnl the corresponding makefile to list the models that we'll generate.
+dnl
+dnl For shared libraries, make a list of symbolic links to construct when
+dnl generating each library. The convention used for Linux is the simplest
+dnl one:
+dnl lib<name>.so ->
+dnl lib<name>.so.<major> ->
+dnl lib<name>.so.<maj>.<minor>
+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
+ continue
+ elif test -f $srcdir/$cf_dir/modules; then
+
+ SHARED_LIB=
+ LIBS_TO_MAKE=
+ for cf_item in $cf_LIST_MODELS
+ do
+ 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
+ rel) #(vi
+ case "$cf_cv_system_name" in #(vi
+ darwin*)
+ case .${LIB_SUFFIX} in
+ .w*)
+ cf_suffix=`echo $cf_suffix | sed 's/^w//'`
+ cf_suffix=w'.${REL_VERSION}'"$cf_suffix"
+ ;;
+ *)
+ cf_suffix='.${REL_VERSION}'"$cf_suffix"
+ ;;
+ esac
+ ;; #(vi
+ *) cf_suffix="$cf_suffix"'.${REL_VERSION}' ;;
+ esac
+ ;;
+ abi)
+ case "$cf_cv_system_name" in #(vi
+ darwin*)
+ case .${LIB_SUFFIX} in
+ .w*)
+ cf_suffix=`echo $cf_suffix | sed 's/^w//'`
+ cf_suffix=w'.${ABI_VERSION}'"$cf_suffix"
+ ;;
+ *)
+ cf_suffix='.${ABI_VERSION}'"$cf_suffix"
+ ;;
+ esac
+ ;; #(vi
+ *) cf_suffix="$cf_suffix"'.${ABI_VERSION}' ;;
+ esac
+ ;;
+ esac
+ fi
+ # cygwin needs import library, and has unique naming convention
+ # 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
+ 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
+ LIBS_TO_MAKE="$LIBS_TO_MAKE ../lib/${cf_prefix}${cf_dir}${cf_suffix}"
+ done
+
+ 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 $cf_liblist |sed -e s%${LIB_NAME}${LIB_SUFFIX}%${TINFO_LIB_SUFFIX}%g`
+ ;;
+ *ticlib*)
+ cf_item=`echo $cf_liblist |sed -e s%${LIB_NAME}${LIB_SUFFIX}%${TICS_LIB_SUFFIX}%g`
+ ;;
+ *)
+ break
+ ;;
+ esac
+ if test -n "$cf_item"; then
+ LIBS_TO_MAKE="$cf_item $LIBS_TO_MAKE"
+ fi
+ else
+ break
+ fi
+ done
+ else
+ cf_subsets=`echo "$LIB_SUBSETS" | sed -e 's/^termlib.* //'`
+ fi
+
+ sed -e "s%@LIBS_TO_MAKE@%$LIBS_TO_MAKE%" \
+ -e "s%@SHARED_LIB@%$SHARED_LIB%" \
+ $cf_dir/Makefile >$cf_dir/Makefile.out
+ mv $cf_dir/Makefile.out $cf_dir/Makefile
+
+ $AWK -f $srcdir/mk-0th.awk \
+ libname="${cf_dir}${LIB_SUFFIX}" subsets="$LIB_SUBSETS" \
+ $srcdir/$cf_dir/modules >>$cf_dir/Makefile
+
+ for cf_subset in $cf_subsets
+ do
+ cf_subdirs=
+ for cf_item in $cf_LIST_MODELS
+ 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_depsuf)
+ CF_OBJ_SUBDIR($cf_item,cf_subdir)
+
+ # Test for case where we build libtinfo with a different name.
+ cf_libname=$cf_dir
+ if test $cf_dir = ncurses ; then
+ case $cf_subset in
+ *base*)
+ cf_libname=${cf_libname}$LIB_SUFFIX
+ ;;
+ *termlib*)
+ cf_libname=$TINFO_LIB_SUFFIX
+ ;;
+ ticlib*)
+ cf_libname=$TICS_LIB_SUFFIX
+ ;;
+ 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
+ # builds, but they are useful in porting, too.
+ cf_depend="../include/ncurses_cfg.h"
+ if test "$srcdir" = "."; then
+ cf_reldir="."
+ else
+ cf_reldir="\${srcdir}"
+ fi
+
+ if test -f $srcdir/$cf_dir/$cf_dir.priv.h; then
+ cf_depend="$cf_depend $cf_reldir/$cf_dir.priv.h"
+ elif test -f $srcdir/$cf_dir/curses.priv.h; then
+ cf_depend="$cf_depend $cf_reldir/curses.priv.h"
+ fi
+
+ cf_dir_suffix=
+ old_cf_suffix="$cf_suffix"
+ if test "$cf_cv_shlib_version_infix" = yes ; then
+ if test -n "$LIB_SUFFIX" ; then
+ case $LIB_SUFFIX in
+ w*)
+ cf_libname=`echo $cf_libname | sed 's/w$//'`
+ cf_suffix=`echo $cf_suffix | sed 's/^w//'`
+ cf_dir_suffix=w
+ ;;
+ esac
+ fi
+ fi
+
+ $AWK -f $srcdir/mk-1st.awk \
+ name=${cf_libname}${cf_dir_suffix} \
+ traces=$LIB_TRACING \
+ MODEL=$cf_ITEM \
+ model=$cf_subdir \
+ 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" \
+ overwrite=$WITH_OVERWRITE \
+ depend="$cf_depend" \
+ host="$host" \
+ $srcdir/$cf_dir/modules >>$cf_dir/Makefile
+
+ cf_suffix="$old_cf_suffix"
+
+ for cf_subdir2 in $cf_subdirs lib
+ do
+ test $cf_subdir = $cf_subdir2 && break
+ done
+ test "${cf_subset}.${cf_subdir2}" != "${cf_subset}.${cf_subdir}" && \
+ $AWK -f $srcdir/mk-2nd.awk \
+ name=$cf_dir \
+ traces=$LIB_TRACING \
+ MODEL=$cf_ITEM \
+ model=$cf_subdir \
+ subset=$cf_subset \
+ srcdir=$srcdir \
+ echo=$WITH_ECHO \
+ crenames=$cf_cv_prog_CC_c_o \
+ cxxrenames=$cf_cv_prog_CXX_c_o \
+ $srcdir/$cf_dir/modules >>$cf_dir/Makefile
+ cf_subdirs="$cf_subdirs $cf_subdir"
+ done
+ done
+ fi
+
+ echo ' cd '$cf_dir' && ${MAKE} ${CF_MFLAGS} [$]@' >>Makefile
+done
+
+for cf_dir in $SRC_SUBDIRS
+do
+ if test ! -d $srcdir/$cf_dir ; then
+ continue
+ fi
+
+ if test -f $cf_dir/Makefile ; then
+ case "$cf_dir" in
+ Ada95) #(vi
+ echo 'libs \' >> Makefile
+ echo 'install.libs \' >> Makefile
+ echo 'uninstall.libs ::' >> Makefile
+ echo ' cd '$cf_dir' && ${MAKE} ${CF_MFLAGS} [$]@' >> Makefile
+ ;;
+ esac
+ fi
+
+ if test -f $srcdir/$cf_dir/modules; then
+ echo >> Makefile
+ if test -f $srcdir/$cf_dir/headers; then
+cat >> Makefile <<CF_EOF
+install.includes \\
+uninstall.includes \\
+CF_EOF
+ fi
+if test "$cf_dir" != "c++" ; then
+echo 'lint \' >> Makefile
+fi
+cat >> Makefile <<CF_EOF
+libs \\
+lintlib \\
+install.libs \\
+uninstall.libs \\
+install.$cf_dir \\
+uninstall.$cf_dir ::
+ cd $cf_dir && \${MAKE} \${CF_MFLAGS} \[$]@
+CF_EOF
+ elif test -f $srcdir/$cf_dir/headers; then
+cat >> Makefile <<CF_EOF
+
+libs \\
+install.libs \\
+uninstall.libs \\
+install.includes \\
+uninstall.includes ::
+ cd $cf_dir && \${MAKE} \${CF_MFLAGS} \[$]@
+CF_EOF
+fi
+done
+
+cat >> Makefile <<CF_EOF
+
+install.libs uninstall.libs \\
+install.data uninstall.data ::
+$MAKE_TERMINFO cd misc && \${MAKE} \${CF_MFLAGS} \[$]@
+
+install.man \\
+uninstall.man ::
+ cd man && \${MAKE} \${CF_MFLAGS} \[$]@
+
+distclean ::
+ rm -f config.cache config.log config.status Makefile include/ncurses_cfg.h
+ rm -f headers.sh headers.sed mk_shared_lib.sh
+ rm -rf \${DIRS_TO_MAKE}
+CF_EOF
+
+# Special case: tack's manpage lives in its own directory.
+if test -d tack ; then
+if test -f $srcdir/$tack.h; then
+cat >> Makefile <<CF_EOF
+
+install.man \\
+uninstall.man ::
+ cd tack && \${MAKE} \${CF_MFLAGS} \[$]@
+CF_EOF
+fi
+fi
+
+dnl If we're installing into a subdirectory of /usr/include, etc., we should
+dnl prepend the subdirectory's name to the "#include" paths. It won't hurt
+dnl anything, and will make it more standardized. It's awkward to decide this
+dnl at configuration because of quoting, so we'll simply make all headers
+dnl installed via a script that can do the right thing.
+
+rm -f headers.sed headers.sh
+
+dnl ( generating this script makes the makefiles a little tidier :-)
+echo creating headers.sh
+cat >headers.sh <<CF_EOF
+#! /bin/sh
+# This shell script is generated by the 'configure' script. It is invoked in a
+# subdirectory of the build tree. It generates a sed-script in the parent
+# directory that is used to adjust includes for header files that reside in a
+# subdirectory of /usr/include, etc.
+PRG=""
+while test \[$]# != 3
+do
+PRG="\$PRG \[$]1"; shift
+done
+DST=\[$]1
+REF=\[$]2
+SRC=\[$]3
+TMPSRC=\${TMPDIR-/tmp}/\`basename \$SRC\`\$\$
+TMPSED=\${TMPDIR-/tmp}/headers.sed\$\$
+echo installing \$SRC in \$DST
+CF_EOF
+
+if test $WITH_CURSES_H = yes; then
+ cat >>headers.sh <<CF_EOF
+case \$DST in
+/*/include/*)
+ END=\`basename \$DST\`
+ for i in \`cat \$REF/../*/headers |fgrep -v "#"\`
+ do
+ NAME=\`basename \$i\`
+ echo "s/<\$NAME>/<\$END\/\$NAME>/" >> \$TMPSED
+ done
+ ;;
+*)
+ echo "" >> \$TMPSED
+ ;;
+esac
+CF_EOF
+
+else
+ cat >>headers.sh <<CF_EOF
+case \$DST in
+/*/include/*)
+ END=\`basename \$DST\`
+ for i in \`cat \$REF/../*/headers |fgrep -v "#"\`
+ do
+ NAME=\`basename \$i\`
+ if test "\$NAME" = "curses.h"
+ then
+ echo "s/<curses.h>/<ncurses.h>/" >> \$TMPSED
+ NAME=ncurses.h
+ fi
+ echo "s/<\$NAME>/<\$END\/\$NAME>/" >> \$TMPSED
+ done
+ ;;
+*)
+ echo "s/<curses.h>/<ncurses.h>/" >> \$TMPSED
+ ;;
+esac
+CF_EOF
+fi
+cat >>headers.sh <<CF_EOF
+rm -f \$TMPSRC
+sed -f \$TMPSED \$SRC > \$TMPSRC
+NAME=\`basename \$SRC\`
+CF_EOF
+if test $WITH_CURSES_H != yes; then
+ cat >>headers.sh <<CF_EOF
+test "\$NAME" = "curses.h" && NAME=ncurses.h
+CF_EOF
+fi
+cat >>headers.sh <<CF_EOF
+# Just in case someone gzip'd manpages, remove the conflicting copy.
+test -f \$DST/\$NAME.gz && rm -f \$DST/\$NAME.gz
+
+eval \$PRG \$TMPSRC \$DST/\$NAME
+rm -f \$TMPSRC \$TMPSED
+CF_EOF
+
+chmod 0755 headers.sh
+
+for cf_dir in $SRC_SUBDIRS
+do
+ if test ! -d $srcdir/$cf_dir ; then
+ continue
+ fi
+
+ if test -f $srcdir/$cf_dir/headers; then
+ $AWK -f $srcdir/mk-hdr.awk \
+ subset="$LIB_SUBSETS" \
+ compat="$WITH_CURSES_H" \
+ $srcdir/$cf_dir/headers >>$cf_dir/Makefile
+ fi
+
+ if test -f $srcdir/$cf_dir/modules; then
+ if test "$cf_dir" != "c++" ; then
+ cat >>$cf_dir/Makefile <<"CF_EOF"
+depend : ${AUTO_SRC}
+ makedepend -- ${CPPFLAGS} -- ${C_SRC}
+
+# DO NOT DELETE THIS LINE -- make depend depends on it.
+CF_EOF
+ fi
+ fi
+done
+
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_LIB_SONAME version: 3 updated: 2006/12/16 15:55:46
+dnl -------------
+dnl Find the and soname for the given shared library. Set the cache variable
+dnl cf_cv_$3_soname to this, unless it is not found. Then set the cache
+dnl variable to "unknown".
+dnl
+dnl $1 = headers
+dnl $2 = code
+dnl $3 = library name
+AC_DEFUN([CF_LIB_SONAME],
+[
+AC_CACHE_CHECK(for soname of $3 library,cf_cv_$3_soname,[
+
+cf_cv_$3_soname=unknown
+if test "$cross_compiling" != yes ; then
+cat >conftest.$ac_ext <<CF_EOF
+$1
+int main()
+{
+$2
+ ${cf_cv_main_return:-return}(0);
+}
+CF_EOF
+cf_save_LIBS="$LIBS"
+ LIBS="-l$3 $LIBS"
+ if AC_TRY_EVAL(ac_compile) ; then
+ if AC_TRY_EVAL(ac_link) ; then
+ cf_cv_$3_soname=`ldd conftest$ac_exeext 2>/dev/null | sed -e 's,^.*/,,' -e 's, .*$,,' | fgrep lib$3.`
+ test -z "$cf_cv_$3_soname" && cf_cv_$3_soname=unknown
+ fi
+ fi
+rm -f conftest*
+LIBS="$cf_save_LIBS"
+fi
+])
+])
+dnl ---------------------------------------------------------------------------
+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 (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'
+ $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'
+ $3='.dll.a'
+ ;;
+ darwin*)
+ $2='.dylib'
+ $3=[$]$2
+ ;;
+ hpux*)
+ case $target in
+ ia64*)
+ $2='.so'
+ $3=[$]$2
+ ;;
+ *)
+ $2='.sl'
+ $3=[$]$2
+ ;;
+ esac
+ ;;
+ *) $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
+dnl -----------
+dnl Compute the string to append to -library from the given model name
+dnl $1 = model name
+dnl $2 = variable to set
+dnl The variable $LIB_SUFFIX, if set, prepends the variable to set.
+AC_DEFUN([CF_LIB_TYPE],
+[
+ case $1 in
+ libtool) $2='' ;;
+ normal) $2='' ;;
+ debug) $2='_g' ;;
+ profile) $2='_p' ;;
+ shared) $2='' ;;
+ esac
+ test -n "$LIB_SUFFIX" && $2="${LIB_SUFFIX}[$]{$2}"
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_LINK_DATAONLY version: 8 updated: 2006/12/16 12:33:30
+dnl ----------------
+dnl Some systems have a non-ANSI linker that doesn't pull in modules that have
+dnl only data (i.e., no functions), for example NeXT. On those systems we'll
+dnl have to provide wrappers for global tables to ensure they're linked
+dnl properly.
+AC_DEFUN([CF_LINK_DATAONLY],
+[
+AC_MSG_CHECKING([if data-only library module links])
+AC_CACHE_VAL(cf_cv_link_dataonly,[
+ rm -f conftest.a
+ cat >conftest.$ac_ext <<EOF
+#line __oline__ "configure"
+int testdata[[3]] = { 123, 456, 789 };
+EOF
+ if AC_TRY_EVAL(ac_compile) ; then
+ mv conftest.o data.o && \
+ ( $AR $AR_OPTS conftest.a data.o ) 2>&AC_FD_CC 1>/dev/null
+ fi
+ rm -f conftest.$ac_ext data.o
+ cat >conftest.$ac_ext <<EOF
+#line __oline__ "configure"
+int testfunc()
+{
+#if defined(NeXT)
+ ${cf_cv_main_return:-return}(1); /* I'm told this linker is broken */
+#else
+ extern int testdata[[3]];
+ return testdata[[0]] == 123
+ && testdata[[1]] == 456
+ && testdata[[2]] == 789;
+#endif
+}
+EOF
+ if AC_TRY_EVAL(ac_compile); then
+ mv conftest.o func.o && \
+ ( $AR $AR_OPTS conftest.a func.o ) 2>&AC_FD_CC 1>/dev/null
+ fi
+ rm -f conftest.$ac_ext func.o
+ ( eval $RANLIB conftest.a ) 2>&AC_FD_CC >/dev/null
+ cf_saveLIBS="$LIBS"
+ LIBS="conftest.a $LIBS"
+ AC_TRY_RUN([
+ int main()
+ {
+ extern int testfunc();
+ ${cf_cv_main_return:-return} (!testfunc());
+ }
+ ],
+ [cf_cv_link_dataonly=yes],
+ [cf_cv_link_dataonly=no],
+ [cf_cv_link_dataonly=unknown])
+ LIBS="$cf_saveLIBS"
+ ])
+AC_MSG_RESULT($cf_cv_link_dataonly)
+
+if test "$cf_cv_link_dataonly" = no ; then
+ AC_DEFINE(BROKEN_LINKER)
+ BROKEN_LINKER=1
+fi
+
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_LINK_FUNCS version: 7 updated: 2006/12/16 12:33:30
+dnl -------------
+dnl Most Unix systems have both link and symlink, a few don't have symlink.
+dnl A few non-Unix systems implement symlink, but not link.
+dnl A few non-systems implement neither (or have nonfunctional versions).
+AC_DEFUN([CF_LINK_FUNCS],
+[
+AC_CHECK_FUNCS( \
+ remove \
+ unlink )
+
+if test "$cross_compiling" = yes ; then
+ AC_CHECK_FUNCS( \
+ link \
+ symlink )
+else
+ AC_CACHE_CHECK(if link/symlink functions work,cf_cv_link_funcs,[
+ cf_cv_link_funcs=
+ for cf_func in link symlink ; do
+ AC_TRY_RUN([
+#include <sys/types.h>
+#include <sys/stat.h>
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+int main()
+{
+ int fail = 0;
+ char *src = "config.log";
+ char *dst = "conftest.chk";
+ struct stat src_sb;
+ struct stat dst_sb;
+
+ stat(src, &src_sb);
+ fail = ($cf_func("config.log", "conftest.chk") < 0)
+ || (stat(dst, &dst_sb) < 0)
+ || (dst_sb.st_mtime != src_sb.st_mtime);
+#ifdef HAVE_UNLINK
+ unlink(dst);
+#else
+ remove(dst);
+#endif
+ ${cf_cv_main_return:-return} (fail);
+}
+ ],[
+ cf_cv_link_funcs="$cf_cv_link_funcs $cf_func"
+ eval 'ac_cv_func_'$cf_func'=yes'],[
+ eval 'ac_cv_func_'$cf_func'=no'],[
+ eval 'ac_cv_func_'$cf_func'=error'])
+ done
+ test -z "$cf_cv_link_funcs" && cf_cv_link_funcs=no
+ ])
+ test "$ac_cv_func_link" = yes && AC_DEFINE(HAVE_LINK)
+ test "$ac_cv_func_symlink" = yes && AC_DEFINE(HAVE_SYMLINK)
+fi
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_MAIN_RETURN version: 1 updated: 2006/12/10 09:51:54
+dnl --------------
+dnl Check if a return from main to the shell actually returns the same exit
+dnl code. This is true for almost any POSIX environment.
+dnl
+dnl Some very old environments did not flush stdout, etc., on an exit. That
+dnl would be a useful case to test for also.
+AC_DEFUN([CF_MAIN_RETURN],
+[
+cf_cv_main_return=return
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_MAKEFLAGS version: 12 updated: 2006/10/21 08:27:03
+dnl ------------
+dnl Some 'make' programs support ${MAKEFLAGS}, some ${MFLAGS}, to pass 'make'
+dnl options to lower-levels. It's very useful for "make -n" -- if we have it.
+dnl (GNU 'make' does both, something POSIX 'make', which happens to make the
+dnl ${MAKEFLAGS} variable incompatible because it adds the assignments :-)
+AC_DEFUN([CF_MAKEFLAGS],
+[
+AC_CACHE_CHECK(for makeflags variable, cf_cv_makeflags,[
+ cf_cv_makeflags=''
+ for cf_option in '-${MAKEFLAGS}' '${MFLAGS}'
+ do
+ cat >cf_makeflags.tmp <<CF_EOF
+SHELL = /bin/sh
+all :
+ @ echo '.$cf_option'
+CF_EOF
+ cf_result=`${MAKE-make} -k -f cf_makeflags.tmp 2>/dev/null | sed -e 's,[[ ]]*$,,'`
+ case "$cf_result" in
+ .*k)
+ cf_result=`${MAKE-make} -k -f cf_makeflags.tmp CC=cc 2>/dev/null`
+ case "$cf_result" in
+ .*CC=*) cf_cv_makeflags=
+ ;;
+ *) cf_cv_makeflags=$cf_option
+ ;;
+ esac
+ break
+ ;;
+ .-) ;;
+ *) echo "given option \"$cf_option\", no match \"$cf_result\""
+ ;;
+ esac
+ done
+ rm -f cf_makeflags.tmp
+])
+
+AC_SUBST(cf_cv_makeflags)
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_MAKE_TAGS version: 2 updated: 2000/10/04 09:18:40
+dnl ------------
+dnl Generate tags/TAGS targets for makefiles. Do not generate TAGS if we have
+dnl a monocase filesystem.
+AC_DEFUN([CF_MAKE_TAGS],[
+AC_REQUIRE([CF_MIXEDCASE_FILENAMES])
+AC_CHECK_PROG(MAKE_LOWER_TAGS, ctags, yes, no)
+
+if test "$cf_cv_mixedcase" = yes ; then
+ AC_CHECK_PROG(MAKE_UPPER_TAGS, etags, yes, no)
+else
+ MAKE_UPPER_TAGS=no
+fi
+
+if test "$MAKE_UPPER_TAGS" = yes ; then
+ MAKE_UPPER_TAGS=
+else
+ MAKE_UPPER_TAGS="#"
+fi
+AC_SUBST(MAKE_UPPER_TAGS)
+
+if test "$MAKE_LOWER_TAGS" = yes ; then
+ MAKE_LOWER_TAGS=
+else
+ MAKE_LOWER_TAGS="#"
+fi
+AC_SUBST(MAKE_LOWER_TAGS)
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_MANPAGE_FORMAT version: 7 updated: 2003/12/20 19:30:34
+dnl -----------------
+dnl Option to allow user to override automatic configuration of manpage format.
+dnl There are several special cases:
+dnl
+dnl gzip - man checks for, can display gzip'd files
+dnl compress - man checks for, can display compressed files
+dnl BSDI - files in the cat-directories are suffixed ".0"
+dnl formatted - installer should format (put files in cat-directory)
+dnl catonly - installer should only format, e.g., for a turnkey system.
+dnl
+dnl There are other configurations which this macro does not test, e.g., HPUX's
+dnl compressed manpages (but uncompressed manpages are fine, and HPUX's naming
+dnl convention would not match our use).
+AC_DEFUN([CF_MANPAGE_FORMAT],
+[
+AC_REQUIRE([CF_PATHSEP])
+AC_MSG_CHECKING(format of man-pages)
+
+AC_ARG_WITH(manpage-format,
+ [ --with-manpage-format specify manpage-format: gzip/compress/BSDI/normal and
+ optionally formatted/catonly, e.g., gzip,formatted],
+ [MANPAGE_FORMAT=$withval],
+ [MANPAGE_FORMAT=unknown])
+
+test -z "$MANPAGE_FORMAT" && MANPAGE_FORMAT=unknown
+MANPAGE_FORMAT=`echo "$MANPAGE_FORMAT" | sed -e 's/,/ /g'`
+
+cf_unknown=
+
+case $MANPAGE_FORMAT in
+unknown)
+ if test -z "$MANPATH" ; then
+ MANPATH="/usr/man:/usr/share/man"
+ fi
+
+ # look for the 'date' man-page (it's most likely to be installed!)
+ MANPAGE_FORMAT=
+ cf_preform=no
+ cf_catonly=yes
+ cf_example=date
+
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATHSEP}"
+ for cf_dir in $MANPATH; do
+ test -z "$cf_dir" && cf_dir=/usr/man
+ for cf_name in $cf_dir/man*/$cf_example.[[01]]* $cf_dir/cat*/$cf_example.[[01]]* $cf_dir/man*/$cf_example $cf_dir/cat*/$cf_example
+ do
+ cf_test=`echo $cf_name | sed -e 's/*//'`
+ if test "x$cf_test" = "x$cf_name" ; then
+
+ case "$cf_name" in
+ *.gz) MANPAGE_FORMAT="$MANPAGE_FORMAT gzip";;
+ *.Z) MANPAGE_FORMAT="$MANPAGE_FORMAT compress";;
+ *.0) MANPAGE_FORMAT="$MANPAGE_FORMAT BSDI";;
+ *) MANPAGE_FORMAT="$MANPAGE_FORMAT normal";;
+ esac
+
+ case "$cf_name" in
+ $cf_dir/man*)
+ cf_catonly=no
+ ;;
+ $cf_dir/cat*)
+ cf_preform=yes
+ ;;
+ esac
+ break
+ fi
+
+ # if we found a match in either man* or cat*, stop looking
+ if test -n "$MANPAGE_FORMAT" ; then
+ cf_found=no
+ test "$cf_preform" = yes && MANPAGE_FORMAT="$MANPAGE_FORMAT formatted"
+ test "$cf_catonly" = yes && MANPAGE_FORMAT="$MANPAGE_FORMAT catonly"
+ case "$cf_name" in
+ $cf_dir/cat*)
+ cf_found=yes
+ ;;
+ esac
+ test $cf_found=yes && break
+ fi
+ done
+ # only check the first directory in $MANPATH where we find manpages
+ if test -n "$MANPAGE_FORMAT" ; then
+ break
+ fi
+ done
+ # if we did not find the example, just assume it is normal
+ test -z "$MANPAGE_FORMAT" && MANPAGE_FORMAT=normal
+ IFS="$ac_save_ifs"
+ ;;
+*)
+ for cf_option in $MANPAGE_FORMAT; do
+ case $cf_option in #(vi
+ gzip|compress|BSDI|normal|formatted|catonly)
+ ;;
+ *)
+ cf_unknown="$cf_unknown $cf_option"
+ ;;
+ esac
+ done
+ ;;
+esac
+
+AC_MSG_RESULT($MANPAGE_FORMAT)
+if test -n "$cf_unknown" ; then
+ AC_MSG_WARN(Unexpected manpage-format $cf_unknown)
+fi
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_MANPAGE_RENAMES version: 7 updated: 2005/06/18 18:51:57
+dnl ------------------
+dnl The Debian people have their own naming convention for manpages. This
+dnl option lets us override the name of the file containing renaming, or
+dnl disable it altogether.
+AC_DEFUN([CF_MANPAGE_RENAMES],
+[
+AC_MSG_CHECKING(for manpage renaming)
+
+AC_ARG_WITH(manpage-renames,
+ [ --with-manpage-renames specify manpage-renaming],
+ [MANPAGE_RENAMES=$withval],
+ [MANPAGE_RENAMES=yes])
+
+case ".$MANPAGE_RENAMES" in #(vi
+.no) #(vi
+ ;;
+.|.yes)
+ # Debian 'man' program?
+ if test -f /etc/debian_version ; then
+ MANPAGE_RENAMES=`cd $srcdir && pwd`/man/man_db.renames
+ else
+ MANPAGE_RENAMES=no
+ fi
+ ;;
+esac
+
+if test "$MANPAGE_RENAMES" != no ; then
+ if test -f $srcdir/man/$MANPAGE_RENAMES ; then
+ MANPAGE_RENAMES=`cd $srcdir/man && pwd`/$MANPAGE_RENAMES
+ elif test ! -f $MANPAGE_RENAMES ; then
+ AC_MSG_ERROR(not a filename: $MANPAGE_RENAMES)
+ fi
+
+ test ! -d man && mkdir man
+
+ # Construct a sed-script to perform renaming within man-pages
+ if test -n "$MANPAGE_RENAMES" ; then
+ test ! -d man && mkdir man
+ sh $srcdir/man/make_sed.sh $MANPAGE_RENAMES >./edit_man.sed
+ fi
+fi
+
+AC_MSG_RESULT($MANPAGE_RENAMES)
+AC_SUBST(MANPAGE_RENAMES)
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_MANPAGE_SYMLINKS version: 4 updated: 2003/12/13 18:01:58
+dnl -------------------
+dnl Some people expect each tool to make all aliases for manpages in the
+dnl man-directory. This accommodates the older, less-capable implementations
+dnl of 'man', and is optional.
+AC_DEFUN([CF_MANPAGE_SYMLINKS],
+[
+AC_MSG_CHECKING(if manpage aliases will be installed)
+
+AC_ARG_WITH(manpage-aliases,
+ [ --with-manpage-aliases specify manpage-aliases using .so],
+ [MANPAGE_ALIASES=$withval],
+ [MANPAGE_ALIASES=yes])
+
+AC_MSG_RESULT($MANPAGE_ALIASES)
+
+if test "$LN_S" = "ln -s"; then
+ cf_use_symlinks=yes
+else
+ cf_use_symlinks=no
+fi
+
+MANPAGE_SYMLINKS=no
+if test "$MANPAGE_ALIASES" = yes ; then
+AC_MSG_CHECKING(if manpage symlinks should be used)
+
+AC_ARG_WITH(manpage-symlinks,
+ [ --with-manpage-symlinks specify manpage-aliases using symlinks],
+ [MANPAGE_SYMLINKS=$withval],
+ [MANPAGE_SYMLINKS=$cf_use_symlinks])
+
+if test "$$cf_use_symlinks" = no; then
+if test "$MANPAGE_SYMLINKS" = yes ; then
+ AC_MSG_WARN(cannot make symlinks, will use .so files)
+ MANPAGE_SYMLINKS=no
+fi