+cf_save_LIBS="$LIBS"
+
+AC_TRY_LINK([$1],[$2],[
+ cf_cv_find_linkage_$3=yes
+ cf_cv_header_path_$3=/usr/include
+ cf_cv_library_path_$3=/usr/lib
+],[
+
+LIBS="-l$3 $7 $cf_save_LIBS"
+
+AC_TRY_LINK([$1],[$2],[
+ cf_cv_find_linkage_$3=yes
+ cf_cv_header_path_$3=/usr/include
+ cf_cv_library_path_$3=/usr/lib
+ cf_cv_library_file_$3="-l$3"
+],[
+ cf_cv_find_linkage_$3=no
+ LIBS="$cf_save_LIBS"
+
+ CF_VERBOSE(find linkage for $3 library)
+ CF_MSG_LOG([Searching for headers in [FIND_LINKAGE]($3,$6)])
+
+ cf_save_CPPFLAGS="$CPPFLAGS"
+ cf_test_CPPFLAGS="$CPPFLAGS"
+
+ CF_HEADER_PATH(cf_search,ifelse([$6],,[$3],[$6]))
+ for cf_cv_header_path_$3 in $cf_search
+ do
+ if test -d $cf_cv_header_path_$3 ; then
+ CF_VERBOSE(... testing $cf_cv_header_path_$3)
+ CPPFLAGS="$cf_save_CPPFLAGS -I$cf_cv_header_path_$3"
+ AC_TRY_COMPILE([$1],[$2],[
+ CF_VERBOSE(... found $3 headers in $cf_cv_header_path_$3)
+ cf_cv_find_linkage_$3=maybe
+ cf_test_CPPFLAGS="$CPPFLAGS"
+ break],[
+ CPPFLAGS="$cf_save_CPPFLAGS"
+ ])
+ fi
+ done
+
+ if test "$cf_cv_find_linkage_$3" = maybe ; then
+
+ CF_MSG_LOG([Searching for $3 library in [FIND_LINKAGE]($3,$6)])
+
+ cf_save_LIBS="$LIBS"
+ cf_save_LDFLAGS="$LDFLAGS"
+
+ ifelse([$6],,,[
+ CPPFLAGS="$cf_test_CPPFLAGS"
+ LIBS="-l$3 $7 $cf_save_LIBS"
+ AC_TRY_LINK([$1],[$2],[
+ CF_VERBOSE(... found $3 library in system)
+ cf_cv_find_linkage_$3=yes])
+ CPPFLAGS="$cf_save_CPPFLAGS"
+ LIBS="$cf_save_LIBS"
+ ])
+
+ if test "$cf_cv_find_linkage_$3" != yes ; then
+ CF_LIBRARY_PATH(cf_search,$3)
+ for cf_cv_library_path_$3 in $cf_search
+ do
+ if test -d $cf_cv_library_path_$3 ; then
+ CF_VERBOSE(... testing $cf_cv_library_path_$3)
+ CPPFLAGS="$cf_test_CPPFLAGS"
+ LIBS="-l$3 $7 $cf_save_LIBS"
+ LDFLAGS="$cf_save_LDFLAGS -L$cf_cv_library_path_$3"
+ AC_TRY_LINK([$1],[$2],[
+ CF_VERBOSE(... found $3 library in $cf_cv_library_path_$3)
+ cf_cv_find_linkage_$3=yes
+ cf_cv_library_file_$3="-l$3"
+ break],[
+ CPPFLAGS="$cf_save_CPPFLAGS"
+ LIBS="$cf_save_LIBS"
+ LDFLAGS="$cf_save_LDFLAGS"
+ ])
+ fi
+ done
+ CPPFLAGS="$cf_save_CPPFLAGS"
+ LDFLAGS="$cf_save_LDFLAGS"
+ fi
+
+ else
+ cf_cv_find_linkage_$3=no
+ fi
+ ],$7)
+])
+
+LIBS="$cf_save_LIBS"
+
+if test "$cf_cv_find_linkage_$3" = yes ; then
+ifelse([$4],,[
+ CF_ADD_INCDIR($cf_cv_header_path_$3)
+ CF_ADD_LIBDIR($cf_cv_library_path_$3)
+ CF_ADD_LIB($3)
+],[$4])
+else
+ifelse([$5],,AC_MSG_WARN(Cannot find $3 library),[$5])
+fi
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_FUNC_DLSYM version: 2 updated: 2010/05/29 16:31:02
+dnl -------------
+dnl Test for dlsym() and related functions, as well as libdl.
+dnl
+dnl Sets
+dnl $cf_have_dlsym
+dnl $cf_have_libdl
+AC_DEFUN([CF_FUNC_DLSYM],[
+cf_have_dlsym=no
+AC_CHECK_FUNC(dlsym,cf_have_dlsym=yes,[
+
+cf_have_libdl=no
+AC_CHECK_LIB(dl,dlsym,[
+ cf_have_dlsym=yes
+ cf_have_libdl=yes])])
+
+if test "$cf_have_dlsym" = yes ; then
+ test "$cf_have_libdl" = yes && CF_ADD_LIB(dl)
+
+ AC_MSG_CHECKING(whether able to link to dl*() functions)
+ AC_TRY_LINK([#include <dlfcn.h>],[
+ void *obj;
+ if ((obj = dlopen("filename", 0)) != 0) {
+ if (dlsym(obj, "symbolname") == 0) {
+ dlclose(obj);
+ }
+ }],[
+ AC_DEFINE(HAVE_LIBDL)],[
+ AC_MSG_ERROR(Cannot link test program for libdl)])
+ AC_MSG_RESULT(ok)
+else
+ AC_MSG_ERROR(Cannot find dlsym function)
+fi
+])
+dnl ---------------------------------------------------------------------------
+dnl CF_FUNC_MEMMOVE version: 7 updated: 2006/12/16 12:33:30
+dnl ---------------
+dnl Check for memmove, or a bcopy that can handle overlapping copy. If neither
+dnl is found, add our own version of memmove to the list of objects.
+AC_DEFUN([CF_FUNC_MEMMOVE],
+[
+AC_CHECK_FUNC(memmove,,[
+AC_CHECK_FUNC(bcopy,[
+ AC_CACHE_CHECK(if bcopy does overlapping moves,cf_cv_good_bcopy,[
+ AC_TRY_RUN([
+int main() {
+ static char data[] = "abcdefghijklmnopqrstuwwxyz";
+ char temp[40];
+ bcopy(data, temp, sizeof(data));
+ bcopy(temp+10, temp, 15);
+ bcopy(temp+5, temp+15, 10);
+ ${cf_cv_main_return:-return} (strcmp(temp, "klmnopqrstuwwxypqrstuwwxyz"));
+}
+ ],
+ [cf_cv_good_bcopy=yes],
+ [cf_cv_good_bcopy=no],
+ [cf_cv_good_bcopy=unknown])
+ ])
+ ],[cf_cv_good_bcopy=no])
+ if test "$cf_cv_good_bcopy" = yes ; then
+ AC_DEFINE(USE_OK_BCOPY)
+ else
+ AC_DEFINE(USE_MY_MEMMOVE)
+ fi
+])])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_FUNC_NANOSLEEP version: 3 updated: 2006/12/16 12:33:30
+dnl -----------------
+dnl Check for existence of workable nanosleep() function. Some systems, e.g.,
+dnl AIX 4.x, provide a non-working version.
+AC_DEFUN([CF_FUNC_NANOSLEEP],[
+AC_CACHE_CHECK(if nanosleep really works,cf_cv_func_nanosleep,[
+AC_TRY_RUN([
+#include <stdio.h>
+#include <errno.h>
+#include <time.h>
+
+#ifdef HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+
+int main() {
+ struct timespec ts1, ts2;
+ int code;
+ ts1.tv_sec = 0;
+ ts1.tv_nsec = 750000000;
+ ts2.tv_sec = 0;
+ ts2.tv_nsec = 0;
+ errno = 0;
+ code = nanosleep(&ts1, &ts2); /* on failure errno is ENOSYS. */
+ ${cf_cv_main_return:-return}(code != 0);
+}
+],
+ [cf_cv_func_nanosleep=yes],
+ [cf_cv_func_nanosleep=no],
+ [cf_cv_func_nanosleep=unknown])])
+
+test "$cf_cv_func_nanosleep" = "yes" && AC_DEFINE(HAVE_NANOSLEEP)
+])
+dnl ---------------------------------------------------------------------------
+dnl CF_FUNC_OPENPTY version: 3 updated: 2010/05/29 16:31:02
+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 && CF_ADD_LIB(util)
+ 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
+dnl it does not work for terminals or files.
+AC_DEFUN([CF_FUNC_POLL],[
+AC_CACHE_CHECK(if poll really works,cf_cv_working_poll,[
+AC_TRY_RUN([
+#include <stdio.h>
+#ifdef HAVE_POLL_H
+#include <poll.h>
+#else
+#include <sys/poll.h>
+#endif
+int main() {
+ struct pollfd myfds;
+ int ret;
+
+ myfds.fd = 0;
+ myfds.events = POLLIN;
+
+ ret = poll(&myfds, 1, 100);
+ ${cf_cv_main_return:-return}(ret != 0);
+}],
+ [cf_cv_working_poll=yes],
+ [cf_cv_working_poll=no],
+ [cf_cv_working_poll=unknown])])
+test "$cf_cv_working_poll" = "yes" && AC_DEFINE(HAVE_WORKING_POLL)
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_FUNC_TERMIOS version: 2 updated: 2000/07/22 23:37:24
+dnl ---------------
+dnl Some old/broken variations define tcgetattr() only as a macro in
+dnl termio(s).h
+AC_DEFUN([CF_FUNC_TERMIOS],[
+AC_REQUIRE([CF_STRUCT_TERMIOS])
+AC_CACHE_CHECK(for tcgetattr, cf_cv_have_tcgetattr,[
+AC_TRY_LINK([
+#include <sys/types.h>
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#ifdef HAVE_TERMIOS_H
+#include <termios.h>
+#define TTY struct termios
+#else
+#ifdef HAVE_TERMIO_H
+#include <termio.h>
+#define TTY struct termio
+#endif
+#endif
+],[
+TTY foo;
+tcgetattr(1, &foo);],
+[cf_cv_have_tcgetattr=yes],
+[cf_cv_have_tcgetattr=no])])
+test "$cf_cv_have_tcgetattr" = yes && AC_DEFINE(HAVE_TCGETATTR)
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_FUNC_VSSCANF version: 3 updated: 2001/12/19 00:50:10
+dnl ---------------
+dnl Check for vsscanf() function, which is in c9x but generally not in earlier
+dnl versions of C. It is in the GNU C library, and can often be simulated by
+dnl other functions.
+AC_DEFUN([CF_FUNC_VSSCANF],
+[
+AC_CACHE_CHECK(for vsscanf function or workaround,cf_cv_func_vsscanf,[
+AC_TRY_LINK([
+#include <stdarg.h>
+#include <stdio.h>],[
+ va_list ap;
+ vsscanf("from", "%d", ap)],[cf_cv_func_vsscanf=vsscanf],[
+AC_TRY_LINK([
+#include <stdarg.h>
+#include <stdio.h>],[
+ FILE strbuf;
+ char *str = "from";
+
+ strbuf._flag = _IOREAD;
+ strbuf._ptr = strbuf._base = (unsigned char *) str;
+ strbuf._cnt = strlen(str);
+ strbuf._file = _NFILE;
+ return (vfscanf(&strbuf, "%d", ap))],[cf_cv_func_vsscanf=vfscanf],[
+AC_TRY_LINK([
+#include <stdarg.h>
+#include <stdio.h>],[
+ FILE strbuf;
+ char *str = "from";
+
+ strbuf._flag = _IOREAD;
+ strbuf._ptr = strbuf._base = (unsigned char *) str;
+ strbuf._cnt = strlen(str);
+ strbuf._file = _NFILE;
+ return (_doscan(&strbuf, "%d", ap))],[cf_cv_func_vsscanf=_doscan],[
+cf_cv_func_vsscanf=no])])])])
+
+case $cf_cv_func_vsscanf in #(vi
+vsscanf) AC_DEFINE(HAVE_VSSCANF);; #(vi
+vfscanf) AC_DEFINE(HAVE_VFSCANF);; #(vi
+_doscan) AC_DEFINE(HAVE__DOSCAN);;
+esac
+
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_GCC_ATTRIBUTES version: 14 updated: 2010/10/23 15:52:32
+dnl -----------------
+dnl Test for availability of useful gcc __attribute__ directives to quiet
+dnl compiler warnings. Though useful, not all are supported -- and contrary
+dnl to documentation, unrecognized directives cause older compilers to barf.
+AC_DEFUN([CF_GCC_ATTRIBUTES],
+[
+if test "$GCC" = yes
+then
+cat > conftest.i <<EOF
+#ifndef GCC_PRINTF
+#define GCC_PRINTF 0
+#endif
+#ifndef GCC_SCANF
+#define GCC_SCANF 0
+#endif
+#ifndef GCC_NORETURN
+#define GCC_NORETURN /* nothing */
+#endif
+#ifndef GCC_UNUSED
+#define GCC_UNUSED /* nothing */
+#endif
+EOF
+if test "$GCC" = yes
+then
+ AC_CHECKING([for $CC __attribute__ directives])
+cat > conftest.$ac_ext <<EOF
+#line __oline__ "${as_me:-configure}"
+#include "confdefs.h"
+#include "conftest.h"
+#include "conftest.i"
+#if GCC_PRINTF
+#define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
+#else
+#define GCC_PRINTFLIKE(fmt,var) /*nothing*/
+#endif
+#if GCC_SCANF
+#define GCC_SCANFLIKE(fmt,var) __attribute__((format(scanf,fmt,var)))
+#else
+#define GCC_SCANFLIKE(fmt,var) /*nothing*/
+#endif
+extern void wow(char *,...) GCC_SCANFLIKE(1,2);
+extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
+extern void foo(void) GCC_NORETURN;
+int main(int argc GCC_UNUSED, char *argv[[]] GCC_UNUSED) { return 0; }
+EOF
+ cf_printf_attribute=no
+ cf_scanf_attribute=no
+ for cf_attribute in scanf printf unused noreturn
+ do
+ CF_UPPER(cf_ATTRIBUTE,$cf_attribute)
+ cf_directive="__attribute__(($cf_attribute))"
+ echo "checking for $CC $cf_directive" 1>&AC_FD_CC
+
+ case $cf_attribute in #(vi
+ printf) #(vi
+ cf_printf_attribute=yes
+ cat >conftest.h <<EOF
+#define GCC_$cf_ATTRIBUTE 1
+EOF
+ ;;
+ scanf) #(vi
+ cf_scanf_attribute=yes
+ cat >conftest.h <<EOF
+#define GCC_$cf_ATTRIBUTE 1
+EOF
+ ;;
+ *) #(vi
+ cat >conftest.h <<EOF
+#define GCC_$cf_ATTRIBUTE $cf_directive
+EOF
+ ;;
+ esac
+
+ if AC_TRY_EVAL(ac_compile); then
+ test -n "$verbose" && AC_MSG_RESULT(... $cf_attribute)
+ cat conftest.h >>confdefs.h
+ case $cf_attribute in #(vi
+ printf) #(vi
+ if test "$cf_printf_attribute" = no ; then
+ cat >>confdefs.h <<EOF
+#define GCC_PRINTFLIKE(fmt,var) /* nothing */
+EOF
+ else
+ cat >>confdefs.h <<EOF
+#define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
+EOF
+ fi
+ ;;
+ scanf) #(vi
+ if test "$cf_scanf_attribute" = no ; then
+ cat >>confdefs.h <<EOF
+#define GCC_SCANFLIKE(fmt,var) /* nothing */
+EOF
+ else
+ cat >>confdefs.h <<EOF
+#define GCC_SCANFLIKE(fmt,var) __attribute__((format(scanf,fmt,var)))
+EOF
+ fi
+ ;;
+ esac
+ fi
+ done
+else
+ fgrep define conftest.i >>confdefs.h
+fi
+rm -rf conftest*
+fi
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_GCC_VERSION version: 5 updated: 2010/04/24 11:02:31
+dnl --------------
+dnl Find version of gcc
+AC_DEFUN([CF_GCC_VERSION],[
+AC_REQUIRE([AC_PROG_CC])
+GCC_VERSION=none
+if test "$GCC" = yes ; then
+ AC_MSG_CHECKING(version of $CC)
+ GCC_VERSION="`${CC} --version 2>/dev/null | sed -e '2,$d' -e 's/^.*(GCC) //' -e 's/^[[^0-9.]]*//' -e 's/[[^0-9.]].*//'`"
+ test -z "$GCC_VERSION" && GCC_VERSION=unknown
+ AC_MSG_RESULT($GCC_VERSION)
+fi
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_GCC_WARNINGS version: 27 updated: 2010/10/23 15:52:32
+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:
+dnl
+dnl -Wconversion (useful in older versions of gcc, but not in gcc 2.7.x)
+dnl -Wredundant-decls (system headers make this too noisy)
+dnl -Wtraditional (combines too many unrelated messages, only a few useful)
+dnl -Wwrite-strings (too noisy, but should review occasionally). This
+dnl is enabled for ncurses using "--enable-const".
+dnl -pedantic
+dnl
+dnl Parameter:
+dnl $1 is an optional list of gcc 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_GCC_WARNINGS],
+[
+AC_REQUIRE([CF_GCC_VERSION])
+CF_INTEL_COMPILER(GCC,INTEL_COMPILER,CFLAGS)
+
+cat > conftest.$ac_ext <<EOF
+#line __oline__ "${as_me:-configure}"
+int main(int argc, char *argv[[]]) { return (argv[[argc-1]] == 0) ; }
+EOF
+
+if test "$INTEL_COMPILER" = yes
+then
+# The "-wdXXX" options suppress warnings:
+# remark #1419: external declaration in primary source file
+# 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 #279: controlling expression is constant
+
+ AC_CHECKING([for $CC warning options])
+ cf_save_CFLAGS="$CFLAGS"
+ EXTRA_CFLAGS="-Wall"
+ for cf_opt in \
+ wd1419 \
+ wd1683 \
+ wd1684 \
+ wd193 \
+ wd593 \
+ wd279 \
+ wd810 \
+ wd869 \
+ wd981
+ do
+ CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
+ if AC_TRY_EVAL(ac_compile); then
+ test -n "$verbose" && AC_MSG_RESULT(... -$cf_opt)
+ EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
+ fi
+ done
+ CFLAGS="$cf_save_CFLAGS"
+
+elif test "$GCC" = yes
+then
+ AC_CHECKING([for $CC warning options])
+ cf_save_CFLAGS="$CFLAGS"
+ EXTRA_CFLAGS=
+ cf_warn_CONST=""
+ test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
+ for cf_opt in W Wall \
+ Wbad-function-cast \
+ Wcast-align \
+ Wcast-qual \
+ Winline \
+ Wmissing-declarations \
+ Wmissing-prototypes \
+ Wnested-externs \
+ Wpointer-arith \
+ Wshadow \
+ Wstrict-prototypes \
+ Wundef $cf_warn_CONST $1
+ do
+ CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
+ if AC_TRY_EVAL(ac_compile); then
+ test -n "$verbose" && AC_MSG_RESULT(... -$cf_opt)
+ case $cf_opt in #(vi
+ Wcast-qual) #(vi
+ CPPFLAGS="$CPPFLAGS -DXTSTRINGDEFINES"
+ ;;
+ Winline) #(vi
+ case $GCC_VERSION in
+ [[34]].*)
+ CF_VERBOSE(feature is broken in gcc $GCC_VERSION)
+ continue;;
+ esac
+ ;;
+ esac
+ EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
+ fi
+ done
+ CFLAGS="$cf_save_CFLAGS"
+fi
+rm -rf conftest*
+
+AC_SUBST(EXTRA_CFLAGS)
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_GNAT_GENERICS version: 1 updated: 2010/11/13 14:15:18
+dnl ----------------
+AC_DEFUN([CF_GNAT_GENERICS],
+[
+AC_MSG_CHECKING(if GNAT supports generics)
+case $cf_gnat_version in #(vi
+3.[[1-9]]*|[[4-9]].*) #(vi
+ cf_gnat_generics=yes
+ ;;
+*)
+ cf_gnat_generics=no
+ ;;
+esac
+AC_MSG_RESULT($cf_gnat_generics)
+
+if test "$cf_gnat_generics" = yes
+then
+ cf_compile_generics=generics
+ cf_generic_objects="\${GENOBJS}"
+else
+ cf_compile_generics=
+ cf_generic_objects=
+fi
+
+AC_SUBST(cf_compile_generics)
+AC_SUBST(cf_generic_objects)
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_GNAT_PRAGMA_UNREF version: 1 updated: 2010/06/19 15:22:18
+dnl --------------------
+dnl Check if the gnat pragma "Unreferenced" works.
+AC_DEFUN([CF_GNAT_PRAGMA_UNREF],[
+AC_CACHE_CHECK(if GNAT pragma Unreferenced works,cf_cv_pragma_unreferenced,[
+CF_GNAT_TRY_LINK([procedure conftest;],
+[with Text_IO;
+with GNAT.OS_Lib;
+procedure conftest is
+ test : Integer;
+ pragma Unreferenced (test);
+begin
+ test := 1;
+ Text_IO.Put ("Hello World");
+ Text_IO.New_Line;
+ GNAT.OS_Lib.OS_Exit (0);
+end conftest;],
+ [cf_cv_pragma_unreferenced=yes],
+ [cf_cv_pragma_unreferenced=no])])
+
+# if the pragma is supported, use it (needed in the Trace code).
+if test $cf_cv_pragma_unreferenced = yes ; then
+ PRAGMA_UNREF=TRUE
+else
+ PRAGMA_UNREF=FALSE
+fi
+AC_SUBST(PRAGMA_UNREF)
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_GNAT_PROJECTS version: 1 updated: 2010/11/13 14:15:18
+dnl ----------------
+AC_DEFUN([CF_GNAT_PROJECTS],
+[
+AC_MSG_CHECKING(if GNAT supports project files)
+case $cf_gnat_version in #(vi
+3.[[0-9]]*) #(vi
+ cf_gnat_projects=no
+ ;;
+*)
+ case $cf_cv_system_name in #(vi
+ cygwin*) #(vi
+ cf_gnat_projects=no
+ ;;
+ *)
+ cf_gnat_projects=yes
+ ;;
+ esac
+ ;;
+esac
+AC_MSG_RESULT($cf_gnat_projects)
+
+if test "$cf_gnat_projects" = yes
+then
+ USE_OLD_MAKERULES="#"
+ USE_GNAT_PROJECTS=""
+else
+ USE_OLD_MAKERULES=""
+ USE_GNAT_PROJECTS="#"
+fi
+
+AC_SUBST(USE_OLD_MAKERULES)
+AC_SUBST(USE_GNAT_PROJECTS)
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_GNAT_TRY_LINK version: 2 updated: 2010/08/14 18:25:37
+dnl ----------------
+dnl Verify that a test program compiles/links with GNAT.
+dnl $cf_ada_make is set to the program that compiles/links
+dnl $ADAFLAGS may be set to the GNAT flags.
+dnl
+dnl $1 is the text of the spec
+dnl $2 is the text of the body
+dnl $3 is the shell command to execute if successful
+dnl $4 is the shell command to execute if not successful
+AC_DEFUN([CF_GNAT_TRY_LINK],
+[
+rm -rf conftest*
+cat >>conftest.ads <<CF_EOF
+$1
+CF_EOF
+cat >>conftest.adb <<CF_EOF
+$2
+CF_EOF
+if ( $cf_ada_make $ADAFLAGS conftest 1>&AC_FD_CC 2>&1 ) ; then
+ifelse($3,, :,[ $3])
+ifelse($4,,,[else
+ $4])
+fi
+rm -rf conftest*
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_GNAT_TRY_RUN version: 4 updated: 2010/08/14 18:25:37
+dnl ---------------
+dnl Verify that a test program compiles and runs with GNAT
+dnl $cf_ada_make is set to the program that compiles/links
+dnl $ADAFLAGS may be set to the GNAT flags.
+dnl
+dnl $1 is the text of the spec
+dnl $2 is the text of the body
+dnl $3 is the shell command to execute if successful
+dnl $4 is the shell command to execute if not successful
+AC_DEFUN([CF_GNAT_TRY_RUN],
+[
+rm -rf conftest*
+cat >>conftest.ads <<CF_EOF
+$1
+CF_EOF
+cat >>conftest.adb <<CF_EOF
+$2
+CF_EOF
+if ( $cf_ada_make $ADAFLAGS conftest 1>&AC_FD_CC 2>&1 ) ; then
+ if ( ./conftest 1>&AC_FD_CC 2>&1 ) ; then
+ifelse($3,, :,[ $3])
+ifelse($4,,,[ else
+ $4])
+ fi
+ifelse($4,,,[else
+ $4])
+fi
+rm -rf conftest*
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_GNAT_VERSION version: 16 updated: 2010/11/13 14:15:18
+dnl ---------------
+dnl Verify version of GNAT.
+AC_DEFUN([CF_GNAT_VERSION],
+[
+AC_MSG_CHECKING(for gnat version)
+cf_gnat_version=`${cf_ada_make:-gnatmake} -v 2>&1 | \
+ grep '[[0-9]].[[0-9]][[0-9]]*' |\
+ sed -e '2,$d' -e 's/[[^0-9 \.]]//g' -e 's/^[[ ]]*//' -e 's/ .*//'`
+AC_MSG_RESULT($cf_gnat_version)
+
+case $cf_gnat_version in #(vi
+3.1[[1-9]]*|3.[[2-9]]*|[[4-9]].*) #(vi
+ cf_cv_prog_gnat_correct=yes
+ ;;
+*)
+ AC_MSG_WARN(Unsupported GNAT version $cf_gnat_version. We require 3.11 or better. Disabling Ada95 binding.)
+ cf_cv_prog_gnat_correct=no
+ ;;
+esac
+
+CF_GNAT_GENERICS
+CF_GNAT_PROJECTS
+])
+dnl ---------------------------------------------------------------------------
+dnl CF_GNU_SOURCE version: 6 updated: 2005/07/09 13:23:07
+dnl -------------
+dnl Check if we must define _GNU_SOURCE to get a reasonable value for
+dnl _XOPEN_SOURCE, upon which many POSIX definitions depend. This is a defect
+dnl (or misfeature) of glibc2, which breaks portability of many applications,
+dnl since it is interwoven with GNU extensions.
+dnl
+dnl Well, yes we could work around it...
+AC_DEFUN([CF_GNU_SOURCE],
+[
+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: 10 updated: 2010/05/29 16:31:02
+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"
+ CF_ADD_LIB($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
+ CF_ADD_LIB($cf_gpp_libname,CXXLIBS)
+ 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
+ CF_ADD_LIB($cf_gpp_libname,CXXLIBS)
+ 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: 6 updated: 2010/10/23 15:44:18
+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: 6 updated: 2010/08/14 18:25:37
+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 -rf conftest*
+AC_LANG_RESTORE
+AC_SUBST(EXTRA_CXXFLAGS)
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_HASHED_DB version: 4 updated: 2010/05/29 16:31:02
+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
+ CF_ADD_LIB($cf_cv_hashed_db_libs)
+ fi
+fi
+],[
+ AC_MSG_ERROR(Cannot find db.h)
+])
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_HASHED_DB_LIBS version: 9 updated: 2010/05/29 16:31:02
+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
+ CF_ADD_LIB($cf_db_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_HEADER_PATH version: 12 updated: 2010/05/05 05:22:40
+dnl --------------
+dnl Construct a search-list of directories for a nonstandard header-file
+dnl
+dnl Parameters
+dnl $1 = the variable to return as result
+dnl $2 = the package name
+AC_DEFUN([CF_HEADER_PATH],
+[
+$1=
+
+# collect the current set of include-directories from compiler flags
+cf_header_path_list=""
+if test -n "${CFLAGS}${CPPFLAGS}" ; then
+ for cf_header_path in $CPPFLAGS $CFLAGS
+ do
+ case $cf_header_path in #(vi
+ -I*)
+ cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
+ CF_ADD_SUBDIR_PATH($1,$2,include,$cf_header_path,NONE)
+ cf_header_path_list="$cf_header_path_list [$]$1"
+ ;;
+ esac
+ done
+fi
+
+# add the variations for the package we are looking for
+CF_SUBDIR_PATH($1,$2,include)
+
+test "$includedir" != NONE && \
+test "$includedir" != "/usr/include" && \
+test -d "$includedir" && {
+ test -d $includedir && $1="[$]$1 $includedir"
+ test -d $includedir/$2 && $1="[$]$1 $includedir/$2"
+}
+
+test "$oldincludedir" != NONE && \
+test "$oldincludedir" != "/usr/include" && \
+test -d "$oldincludedir" && {
+ test -d $oldincludedir && $1="[$]$1 $oldincludedir"
+ test -d $oldincludedir/$2 && $1="[$]$1 $oldincludedir/$2"
+}
+
+$1="[$]$1 $cf_header_path_list"
+])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: 6 updated: 2009/01/06 19:37:40
+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="$CPPFLAGS -I. -I../include"
+if test "$srcdir" != "."; then
+ CPPFLAGS="$CPPFLAGS -I\${srcdir}/../include"
+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: 4 updated: 2010/05/26 05:38:42
+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: 8 updated: 2010/10/23 14:39:56
+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 #(
+ OS/2*|os2*|aix[[4]]*|solaris2.1[[0-9]]|darwin*) #( vi
+ LDFLAGS_STATIC=
+ LDFLAGS_SHARED=
+ ;;
+ *) #( normally, except when broken
+ LDFLAGS_STATIC=-static
+ LDFLAGS_SHARED=-dynamic
+ ;;
+ esac
+else
+ case $cf_cv_system_name in #(
+ aix[[456]]*) #( 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
+
+if test -n "$LDFLAGS_STATIC" && test -n "$LDFLAGS_SHARED"
+then
+ AC_MSG_CHECKING(if linker supports switching between static/dynamic)
+
+ rm -f libconftest.a
+ cat >conftest.$ac_ext <<EOF
+#line __oline__ "configure"
+#include <stdio.h>
+int cf_ldflags_static(FILE *fp) { return fflush(fp); }
+EOF
+ if AC_TRY_EVAL(ac_compile) ; then
+ ( $AR $ARFLAGS libconftest.a conftest.o ) 2>&AC_FD_CC 1>/dev/null
+ ( eval $RANLIB libconftest.a ) 2>&AC_FD_CC >/dev/null
+ fi
+ rm -f conftest.*
+
+ cf_save_LIBS="$LIBS"
+
+ LIBS="$LDFLAGS_STATIC -L`pwd` -lconftest $LDFLAGS_DYNAMIC $LIBS"
+ AC_TRY_LINK([
+#line __oline__ "configure"
+#include <stdio.h>
+int cf_ldflags_static(FILE *fp);
+],[
+ return cf_ldflags_static(stdin);
+],[cf_ldflags_static=yes],[cf_ldflags_static=no])
+
+ rm -f libconftest.*
+ LIBS="$cf_save_LIBS"
+
+ AC_MSG_RESULT($cf_ldflags_static)
+
+ if test $cf_ldflags_static != yes
+ then
+ LDFLAGS_STATIC=
+ LDFLAGS_SHARED=
+ fi
+else
+ LDFLAGS_STATIC=
+ LDFLAGS_SHARED=
+fi
+
+AC_SUBST(LDFLAGS_STATIC)
+AC_SUBST(LDFLAGS_SHARED)
+])
+dnl ---------------------------------------------------------------------------
+dnl CF_LD_RPATH_OPT version: 3 updated: 2010/06/02 05:03:05
+dnl ---------------
+dnl For the given system and compiler, find the compiler flags to pass to the
+dnl loader to use the "rpath" feature.
+AC_DEFUN([CF_LD_RPATH_OPT],
+[
+AC_REQUIRE([CF_CHECK_CACHE])
+
+LD_RPATH_OPT=
+AC_MSG_CHECKING(for an rpath option)
+case $cf_cv_system_name in #(vi
+irix*) #(vi
+ if test "$GCC" = yes; then
+ LD_RPATH_OPT="-Wl,-rpath,"
+ else
+ LD_RPATH_OPT="-rpath "
+ fi
+ ;;
+linux*|gnu*|k*bsd*-gnu) #(vi
+ LD_RPATH_OPT="-Wl,-rpath,"
+ ;;
+openbsd[[2-9]].*) #(vi
+ LD_RPATH_OPT="-Wl,-rpath,"
+ ;;
+freebsd*) #(vi
+ LD_RPATH_OPT="-rpath "
+ ;;
+netbsd*) #(vi
+ LD_RPATH_OPT="-Wl,-rpath,"
+ ;;
+osf*|mls+*) #(vi
+ LD_RPATH_OPT="-rpath "
+ ;;
+solaris2*) #(vi
+ LD_RPATH_OPT="-R"
+ ;;
+*)
+ ;;
+esac
+AC_MSG_RESULT($LD_RPATH_OPT)
+
+case "x$LD_RPATH_OPT" in #(vi
+x-R*)
+ AC_MSG_CHECKING(if we need a space after rpath option)
+ cf_save_LIBS="$LIBS"
+ CF_ADD_LIBS(${LD_RPATH_OPT}$libdir)
+ AC_TRY_LINK(, , cf_rpath_space=no, cf_rpath_space=yes)
+ LIBS="$cf_save_LIBS"
+ AC_MSG_RESULT($cf_rpath_space)
+ test "$cf_rpath_space" = yes && LD_RPATH_OPT="$LD_RPATH_OPT "
+ ;;
+esac
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_LIBRARY_PATH version: 9 updated: 2010/03/28 12:52:50
+dnl ---------------
+dnl Construct a search-list of directories for a nonstandard library-file
+dnl
+dnl Parameters
+dnl $1 = the variable to return as result
+dnl $2 = the package name
+AC_DEFUN([CF_LIBRARY_PATH],
+[
+$1=
+cf_library_path_list=""
+if test -n "${LDFLAGS}${LIBS}" ; then
+ for cf_library_path in $LDFLAGS $LIBS
+ do
+ case $cf_library_path in #(vi
+ -L*)
+ cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
+ CF_ADD_SUBDIR_PATH($1,$2,lib,$cf_library_path,NONE)
+ cf_library_path_list="$cf_library_path_list [$]$1"
+ ;;
+ esac
+ done
+fi
+
+CF_SUBDIR_PATH($1,$2,lib)
+
+$1="$cf_library_path_list [$]$1"
+])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: 61 updated: 2010/10/23 16:10:30
+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
+
+if test -n "$TINFO_SUFFIX" ; then
+ case $TINFO_SUFFIX in
+ tw*)
+ TINFO_NAME="${TINFO_NAME}tw"
+ TINFO_SUFFIX=`echo $TINFO_SUFFIX | sed 's/^tw//'`
+ ;;
+ t*)
+ TINFO_NAME="${TINFO_NAME}t"
+ TINFO_SUFFIX=`echo $TINFO_SUFFIX | sed 's/^t//'`
+ ;;
+ w*)
+ TINFO_NAME="${TINFO_NAME}w"
+ TINFO_SUFFIX=`echo $TINFO_SUFFIX | sed 's/^w//'`
+ ;;
+ esac
+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
+ .tw*)
+ cf_suffix=`echo $cf_suffix | sed 's/^tw//'`
+ cf_suffix=tw'.${REL_VERSION}'"$cf_suffix"
+ ;;
+ .t*)
+ cf_suffix=`echo $cf_suffix | sed 's/^t//'`
+ cf_suffix=t'.${REL_VERSION}'"$cf_suffix"
+ ;;
+ .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
+ .tw*)
+ cf_suffix=`echo $cf_suffix | sed 's/^tw//'`
+ cf_suffix=tw'.${ABI_VERSION}'"$cf_suffix"
+ ;;
+ .t*)
+ cf_suffix=`echo $cf_suffix | sed 's/^t//'`
+ cf_suffix=t'.${ABI_VERSION}'"$cf_suffix"
+ ;;
+ .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
+ tw*)
+ cf_libname=`echo $cf_libname | sed 's/tw$//'`
+ cf_suffix=`echo $cf_suffix | sed 's/^tw//'`
+ cf_dir_suffix=tw
+ ;;
+ t*)
+ cf_libname=`echo $cf_libname | sed 's/t$//'`
+ cf_suffix=`echo $cf_suffix | sed 's/^t//'`
+ cf_dir_suffix=t
+ ;;
+ 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 \
+ SymLink="$LN_S" \
+ 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" \
+ libtool_version="$LIBTOOL_VERSION" \
+ $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} \[$]@
+CF_EOF
+
+if test "x$cf_with_manpages" = xyes; then
+cat >> Makefile <<CF_EOF
+
+install.man \\
+uninstall.man ::
+ cd man && \${MAKE} \${CF_MFLAGS} \[$]@
+CF_EOF
+fi
+
+cat >> Makefile <<CF_EOF
+
+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 -f edit_man.* man_alias.*
+ rm -rf \${DIRS_TO_MAKE}
+CF_EOF
+
+# Special case: tack's manpage lives in its own directory.
+if test "x$cf_with_manpages" = xyes; then
+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
+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
+AC_SUBST(LIBS_TO_MAKE)
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_LIB_SONAME version: 5 updated: 2010/08/14 18:25:37
+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"
+ CF_ADD_LIB($3)
+ 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 -rf conftest*
+LIBS="$cf_save_LIBS"
+fi
+])
+])
+dnl ---------------------------------------------------------------------------
+dnl CF_LIB_SUFFIX version: 16 updated: 2008/12/27 12:30:03
+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 #(vi
+ libtool) #(vi
+ $2='.la'
+ $3=[$]$2
+ ;;
+ normal) #(vi
+ $2='.a'
+ $3=[$]$2
+ ;;
+ debug) #(vi
+ $2='_g.a'
+ $3=[$]$2
+ ;;
+ profile) #(vi
+ $2='_p.a'
+ $3=[$]$2
+ ;;
+ shared) #(vi
+ case $cf_cv_system_name in
+ aix[[56]]*) #(vi
+ $2='.a'
+ $3=[$]$2
+ ;;
+ cygwin*) #(vi
+ $2='.dll'
+ $3='.dll.a'
+ ;;
+ darwin*) #(vi
+ $2='.dylib'
+ $3=[$]$2
+ ;;
+ hpux*) #(vi
+ case $target in
+ ia64*) #(vi
+ $2='.so'
+ $3=[$]$2
+ ;;
+ *) #(vi
+ $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: 9 updated: 2009/01/01 20:21:38
+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 $ARFLAGS 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 $ARFLAGS 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: 13 updated: 2010/10/23 15:52:32
+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: 6 updated: 2010/10/23 15:52:32
+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_PROGS(CTAGS, exctags ctags)
+AC_CHECK_PROGS(ETAGS, exetags etags)
+
+AC_CHECK_PROG(MAKE_LOWER_TAGS, ${CTAGS:-ctags}, yes, no)
+
+if test "$cf_cv_mixedcase" = yes ; then
+ AC_CHECK_PROG(MAKE_UPPER_TAGS, ${ETAGS:-etags}, yes, no)
+else
+ MAKE_UPPER_TAGS=no
+fi
+
+if test "$MAKE_UPPER_TAGS" = yes ; then
+ MAKE_UPPER_TAGS=
+else
+ MAKE_UPPER_TAGS="#"
+fi
+
+if test "$MAKE_LOWER_TAGS" = yes ; then
+ MAKE_LOWER_TAGS=
+else
+ MAKE_LOWER_TAGS="#"
+fi
+
+AC_SUBST(CTAGS)
+AC_SUBST(ETAGS)
+
+AC_SUBST(MAKE_UPPER_TAGS)
+AC_SUBST(MAKE_LOWER_TAGS)
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_MANPAGE_FORMAT version: 9 updated: 2010/10/23 16:10:30
+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}${PATH_SEPARATOR}"
+ 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: 5 updated: 2010/07/24 17:12:40
+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)
+
+case "x$LN_S" in #(vi
+xln*) #(vi
+ cf_use_symlinks=yes
+ ;;
+*)
+ cf_use_symlinks=no
+ ;;
+esac
+
+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
+fi
+
+AC_MSG_RESULT($MANPAGE_SYMLINKS)
+fi
+
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_MANPAGE_TBL version: 3 updated: 2002/01/19 22:51:32
+dnl --------------
+dnl This option causes manpages to be run through tbl(1) to generate tables
+dnl correctly.
+AC_DEFUN([CF_MANPAGE_TBL],
+[
+AC_MSG_CHECKING(for manpage tbl)
+
+AC_ARG_WITH(manpage-tbl,
+ [ --with-manpage-tbl specify manpage processing with tbl],
+ [MANPAGE_TBL=$withval],
+ [MANPAGE_TBL=no])
+
+AC_MSG_RESULT($MANPAGE_TBL)
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_MAN_PAGES version: 39 updated: 2010/10/23 15:44:18
+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
+dnl will install man-pages.
+AC_DEFUN([CF_MAN_PAGES],
+[
+CF_HELP_MESSAGE(Options to Specify How Manpages are Installed:)
+CF_MANPAGE_FORMAT
+CF_MANPAGE_RENAMES
+CF_MANPAGE_SYMLINKS
+CF_MANPAGE_TBL
+
+ if test "$prefix" = "NONE" ; then
+ cf_prefix="$ac_default_prefix"
+ else
+ cf_prefix="$prefix"
+ fi
+
+ case "$MANPAGE_FORMAT" in # (vi
+ *catonly*) # (vi
+ cf_format=yes
+ cf_inboth=no
+ ;;
+ *formatted*) # (vi
+ cf_format=yes
+ cf_inboth=yes
+ ;;
+ *)
+ cf_format=no
+ cf_inboth=no
+ ;;
+ esac
+
+test ! -d man && mkdir man
+
+cf_so_strip=
+cf_compress=
+case "$MANPAGE_FORMAT" in #(vi
+*compress*) #(vi
+ cf_so_strip="Z"
+ cf_compress=compress
+ ;;
+*gzip*)
+ cf_so_strip="gz"
+ cf_compress=gzip
+ ;;
+esac
+
+cf_edit_man=./edit_man.sh
+cf_man_alias=`pwd`/man_alias.sed
+
+cat >$cf_edit_man <<CF_EOF
+#! /bin/sh
+# this script is generated by the configure-script CF_MAN_PAGES macro.
+
+prefix="$cf_prefix"
+datadir="$datadir"
+
+NCURSES_MAJOR="$NCURSES_MAJOR"
+NCURSES_MINOR="$NCURSES_MINOR"
+NCURSES_PATCH="$NCURSES_PATCH"
+
+NCURSES_OSPEED="$NCURSES_OSPEED"
+TERMINFO="$TERMINFO"