summaryrefslogtreecommitdiff
path: root/meta/recipes-core
diff options
context:
space:
mode:
authorRichard Purdie <rpurdie@linux.intel.com>2010-09-01 19:09:11 +0100
committerRichard Purdie <rpurdie@linux.intel.com>2010-09-01 19:09:57 +0100
commitd62ee7eaf2ba025c3f64b2d4e10dc7cec4637612 (patch)
treef36fe3008f36ff75cbdd31b630f8f13f1f205ebb /meta/recipes-core
parentcaab7fc509bf27706ff3248689f6afd04225cfda (diff)
downloadopenembedded-core-d62ee7eaf2ba025c3f64b2d4e10dc7cec4637612.tar.gz
openembedded-core-d62ee7eaf2ba025c3f64b2d4e10dc7cec4637612.tar.bz2
openembedded-core-d62ee7eaf2ba025c3f64b2d4e10dc7cec4637612.tar.xz
openembedded-core-d62ee7eaf2ba025c3f64b2d4e10dc7cec4637612.zip
packages: Separate out most of the remaining packages into recipes
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
Diffstat (limited to 'meta/recipes-core')
-rw-r--r--meta/recipes-core/coreutils/coreutils-6.9/futimens.patch61
-rw-r--r--meta/recipes-core/coreutils/coreutils-6.9/gnulib_m4.patch19
-rw-r--r--meta/recipes-core/coreutils/coreutils-6.9/man-touch.patch22
-rw-r--r--meta/recipes-core/coreutils/coreutils_6.9.bb78
-rw-r--r--meta/recipes-core/coreutils/coreutils_8.5.bb67
-rw-r--r--meta/recipes-core/ncurses/ncurses.inc99
-rw-r--r--meta/recipes-core/ncurses/ncurses/makefile_tweak.patch89
-rw-r--r--meta/recipes-core/ncurses/ncurses/visibility.patch4904
-rw-r--r--meta/recipes-core/ncurses/ncurses_5.4.bb8
-rw-r--r--meta/recipes-core/readline/files/acinclude.m41815
-rw-r--r--meta/recipes-core/readline/files/configure-fix.patch24
-rw-r--r--meta/recipes-core/readline/readline.inc34
-rw-r--r--meta/recipes-core/readline/readline_5.2.bb35
-rw-r--r--meta/recipes-core/readline/readline_6.1.bb3
-rw-r--r--meta/recipes-core/sysfsutils/sysfsutils_2.1.0.bb21
-rw-r--r--meta/recipes-core/util-linux/files/MCONFIG223
-rw-r--r--meta/recipes-core/util-linux/files/debian-bug392236.patch203
-rw-r--r--meta/recipes-core/util-linux/files/defines.h10
-rw-r--r--meta/recipes-core/util-linux/files/fdiskbsdlabel_thumb.diff12
-rw-r--r--meta/recipes-core/util-linux/files/fix-make-c.patch41
-rw-r--r--meta/recipes-core/util-linux/files/gcc34.patch23
-rw-r--r--meta/recipes-core/util-linux/files/glibc-fix.patch22
-rw-r--r--meta/recipes-core/util-linux/files/make_include17
-rw-r--r--meta/recipes-core/util-linux/files/optional-uuid.patch55
-rw-r--r--meta/recipes-core/util-linux/files/swapargs.h3
-rw-r--r--meta/recipes-core/util-linux/files/umount.diff19
-rw-r--r--meta/recipes-core/util-linux/files/uuid.patch22
-rw-r--r--meta/recipes-core/util-linux/util-linux-2.17.2/tls.patch70
-rw-r--r--meta/recipes-core/util-linux/util-linux-2.17.2/uclibc-compile.patch13
-rw-r--r--meta/recipes-core/util-linux/util-linux-2.17.2/util-linux-ng-replace-siginterrupt.patch23
-rw-r--r--meta/recipes-core/util-linux/util-linux.inc237
-rw-r--r--meta/recipes-core/util-linux/util-linux_2.17.2.bb11
32 files changed, 8283 insertions, 0 deletions
diff --git a/meta/recipes-core/coreutils/coreutils-6.9/futimens.patch b/meta/recipes-core/coreutils/coreutils-6.9/futimens.patch
new file mode 100644
index 000000000..953c2d17a
--- /dev/null
+++ b/meta/recipes-core/coreutils/coreutils-6.9/futimens.patch
@@ -0,0 +1,61 @@
+# coreutils uses gnulib which conflicts with newer libc header on futimens
+# this patch simply renames coreutils futimes to avoid confliction
+#
+# Signed-off-by Kevin Tian <kevin.tian@intel.com>, 2010-08-18
+# (this patch is licensed under GPLv2)
+
+diff --git a/lib/utimens.c b/lib/utimens.c
+index 71bc510..ae870b8 100644
+--- a/lib/utimens.c
++++ b/lib/utimens.c
+@@ -75,7 +75,7 @@ struct utimbuf
+ Return 0 on success, -1 (setting errno) on failure. */
+
+ int
+-futimens (int fd ATTRIBUTE_UNUSED,
++futimens_coreutils (int fd ATTRIBUTE_UNUSED,
+ char const *file, struct timespec const timespec[2])
+ {
+ /* Some Linux-based NFS clients are buggy, and mishandle time stamps
+@@ -185,5 +185,5 @@ futimens (int fd ATTRIBUTE_UNUSED,
+ int
+ utimens (char const *file, struct timespec const timespec[2])
+ {
+- return futimens (-1, file, timespec);
++ return futimens_coreutils (-1, file, timespec);
+ }
+diff --git a/lib/utimens.h b/lib/utimens.h
+index 0097aaa..13fc45a 100644
+--- a/lib/utimens.h
++++ b/lib/utimens.h
+@@ -1,3 +1,3 @@
+ #include <time.h>
+-int futimens (int, char const *, struct timespec const [2]);
++int futimens_coreutils (int, char const *, struct timespec const [2]);
+ int utimens (char const *, struct timespec const [2]);
+diff --git a/src/copy.c b/src/copy.c
+index 4bdb75c..04634f1 100644
+--- a/src/copy.c
++++ b/src/copy.c
+@@ -518,7 +518,7 @@ copy_reg (char const *src_name, char const *dst_name,
+ timespec[0] = get_stat_atime (src_sb);
+ timespec[1] = get_stat_mtime (src_sb);
+
+- if (futimens (dest_desc, dst_name, timespec) != 0)
++ if (futimens_coreutils (dest_desc, dst_name, timespec) != 0)
+ {
+ error (0, errno, _("preserving times for %s"), quote (dst_name));
+ if (x->require_preserve)
+diff --git a/src/touch.c b/src/touch.c
+index a79c26d..6ef317d 100644
+--- a/src/touch.c
++++ b/src/touch.c
+@@ -182,7 +182,7 @@ touch (const char *file)
+ t = timespec;
+ }
+
+- ok = (futimens (fd, (fd == STDOUT_FILENO ? NULL : file), t) == 0);
++ ok = (futimens_coreutils (fd, (fd == STDOUT_FILENO ? NULL : file), t) == 0);
+
+ if (fd == STDIN_FILENO)
+ {
diff --git a/meta/recipes-core/coreutils/coreutils-6.9/gnulib_m4.patch b/meta/recipes-core/coreutils/coreutils-6.9/gnulib_m4.patch
new file mode 100644
index 000000000..b42f5c9fa
--- /dev/null
+++ b/meta/recipes-core/coreutils/coreutils-6.9/gnulib_m4.patch
@@ -0,0 +1,19 @@
+# remove the line to cause recursive inclusion error from autoreconf, sicne
+# newer autoconf has included this definition. Simply rename it here.
+#
+# Signed-off-by Kevin Tian <kevin.tian@intel.com>, 2010-08-18
+# (this patch is licensed under GPLv2)
+
+diff --git a/extensions.m4 b/extensions.m4
+index 143a9e5..f6558f1 100644
+--- a/m4/extensions.m4
++++ b/m4/extensions.m4
+@@ -16,7 +16,7 @@
+ # ------------------------
+ # Enable extensions on systems that normally disable them,
+ # typically due to standards-conformance issues.
+-AC_DEFUN([AC_USE_SYSTEM_EXTENSIONS],
++AC_DEFUN([AC_USE_SYSTEM_EXTENSIONS_DUMMY],
+ [
+ AC_BEFORE([$0], [AC_COMPILE_IFELSE])
+ AC_BEFORE([$0], [AC_RUN_IFELSE])
diff --git a/meta/recipes-core/coreutils/coreutils-6.9/man-touch.patch b/meta/recipes-core/coreutils/coreutils-6.9/man-touch.patch
new file mode 100644
index 000000000..95a963892
--- /dev/null
+++ b/meta/recipes-core/coreutils/coreutils-6.9/man-touch.patch
@@ -0,0 +1,22 @@
+# man page for 'touch' is generated differently from others. All other utilities
+# are provided static man source files, while for 'touch' it requires help2man
+# to invoke "touch --help" and then convert the output into the manual. Since touch
+# is with target format which can't be invoked on build system, disable building
+# 'touch' man page here.
+#
+# Signed-off-by Kevin Tian <kevin.tian@intel.com>, 2010-08-18
+# (this patch is licensed under GPLv2)
+
+diff --git a/man/Makefile.am b/man/Makefile.am
+index 32df9d1..37b09e3 100644
+--- a/man/Makefile.am
++++ b/man/Makefile.am
+@@ -27,7 +27,7 @@ dist_man_MANS = \
+ paste.1 pathchk.1 pr.1 printenv.1 printf.1 ptx.1 pwd.1 readlink.1 \
+ rm.1 rmdir.1 seq.1 sha1sum.1 sha224sum.1 sha256sum.1 sha384sum.1 sha512sum.1 \
+ shred.1 shuf.1 sleep.1 sort.1 split.1 stat.1 \
+- su.1 sum.1 sync.1 tac.1 tail.1 tee.1 test.1 touch.1 tr.1 true.1 tsort.1 \
++ su.1 sum.1 sync.1 tac.1 tail.1 tee.1 test.1 tr.1 true.1 tsort.1 \
+ tty.1 unexpand.1 uniq.1 unlink.1 vdir.1 wc.1 \
+ whoami.1 yes.1 $(MAN)
+ optional_mans = \
diff --git a/meta/recipes-core/coreutils/coreutils_6.9.bb b/meta/recipes-core/coreutils/coreutils_6.9.bb
new file mode 100644
index 000000000..6a23f4f65
--- /dev/null
+++ b/meta/recipes-core/coreutils/coreutils_6.9.bb
@@ -0,0 +1,78 @@
+DESCRIPTION = "The GNU Core Utilities are the basic file, shell and text manipulation utilities of the GNU operating system. These are the core utilities which are expected to exist on every operating system"
+HOMEPAGE = "http://www.gnu.org/software/coreutils/"
+BUGTRACKER = "http://debbugs.gnu.org/coreutils"
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe \
+ file://src/ls.c;startline=4;endline=16;md5=482a96d4f25010a4e13f8743e0c3685e"
+PR = "r0"
+DEPENDS = "perl-native"
+
+inherit autotools gettext
+
+SRC_URI = "http://ftp.gnu.org/gnu/coreutils/${BP}.tar.bz2 \
+ file://gnulib_m4.patch \
+ file://futimens.patch \
+ file://man-touch.patch"
+
+# [ gets a special treatment and is not included in this
+bindir_progs = "base64 basename cksum comm csplit cut dir dircolors dirname du \
+ env expand expr factor fmt fold groups head hostid id install \
+ join link logname md5sum mkfifo nice nl nohup od paste pathchk \
+ pinky pr printenv printf ptx readlink seq sha1sum sha224sum sha256sum \
+ sha384sum sha512sum shred shuf sort split stat sum tac tail tee test \
+ tr tsort tty unexpand uniq unlink users vdir wc who whoami yes"
+
+# hostname gets a special treatment and is not included in this
+base_bindir_progs = "cat chgrp chmod chown cp date dd echo false kill ln ls mkdir \
+ mknod mv pwd rm rmdir sleep stty sync touch true uname"
+
+sbindir_progs= "chroot"
+
+do_install() {
+ autotools_do_install
+
+ for i in ${bindir_progs}; do mv ${D}${bindir}/$i ${D}${bindir}/$i.${PN}; done
+
+ install -d ${D}${base_bindir}
+ for i in ${base_bindir_progs}; do mv ${D}${bindir}/$i ${D}${base_bindir}/$i.${PN}; done
+
+ install -d ${D}${sbindir}
+ for i in ${sbindir_progs}; do mv ${D}${bindir}/$i ${D}${sbindir}/$i.${PN}; done
+
+ # [ requires special handling because [.coreutils will cause the sed stuff
+ # in update-alternatives to fail, therefore use lbracket - the name used
+ # for the actual source file.
+ mv ${D}${bindir}/[ ${D}${bindir}/lbracket.${PN}
+
+ # hostname and uptime separated. busybox's versions are preferred
+ mv ${D}${bindir}/hostname ${D}${base_bindir}/hostname.${PN}
+ mv ${D}${bindir}/uptime ${D}${bindir}/uptime.${PN}
+}
+
+pkg_postinst_${PN} () {
+ for i in ${bindir_progs}; do update-alternatives --install ${bindir}/$i $i $i.${PN} 100; done
+
+ for i in ${base_bindir_progs}; do update-alternatives --install ${base_bindir}/$i $i $i.${PN} 100; done
+
+ for i in ${sbindir_progs}; do update-alternatives --install ${sbindir}/$i $i $i.${PN} 100; done
+
+ # Special cases. uptime and hostname is broken, prefer busybox's version. [ needs to be treated separately.
+ update-alternatives --install ${bindir}/uptime uptime uptime.${PN} 10
+ update-alternatives --install ${base_bindir}/hostname hostname hostname.${PN} 10
+ update-alternatives --install '${bindir}/[' '[' 'lbracket.${PN}' 100
+}
+
+pkg_prerm_${PN} () {
+ for i in ${bindir_progs}; do update-alternatives --remove $i $i.${PN}; done
+
+ for i in ${base_bindir_progs}; do update-alternatives --remove $i $i.${PN}; done
+
+ for i in ${sbindir_progs}; do update-alternatives --remove $i $i.${PN}; done
+
+ # The special cases
+ update-alternatives --remove hostname hostname.${PN}
+ update-alternatives --remove uptime uptime.${PN}
+ update-alternatives --remove '[' 'lbracket.${PN}'
+}
+
+BBCLASSEXTEND = "native"
diff --git a/meta/recipes-core/coreutils/coreutils_8.5.bb b/meta/recipes-core/coreutils/coreutils_8.5.bb
new file mode 100644
index 000000000..5213fa293
--- /dev/null
+++ b/meta/recipes-core/coreutils/coreutils_8.5.bb
@@ -0,0 +1,67 @@
+DESCRIPTION = "The GNU Core Utilities are the basic file, shell and text manipulation utilities of the GNU operating system. These are the core utilities which are expected to exist on every operating system"
+HOMEPAGE = "http://www.gnu.org/software/coreutils/"
+BUGTRACKER = "http://debbugs.gnu.org/coreutils"
+LICENSE = "GPLv3+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504\
+ file://src/ls.c;startline=5;endline=16;md5=bb14ed3c4cda583abc85401304b5cd4e"
+PR = "r0"
+DEPENDS = "perl-native"
+
+inherit autotools gettext
+
+SRC_URI = "http://ftp.gnu.org/gnu/coreutils/${BP}.tar.gz"
+
+# [ gets a special treatment and is not included in this
+bindir_progs = "base64 basename chcon cksum comm csplit cut dir dircolors dirname du \
+ env expand expr factor fmt fold groups head hostid id install \
+ join link logname md5sum mkfifo mktemp nice nl nohup nproc od paste pathchk \
+ pinky pr printenv printf ptx readlink runcon seq sha1sum sha224sum sha256sum \
+ sha384sum sha512sum shred shuf sort split stat stdbuf sum tac tail tee test timeout\
+ tr truncate tsort tty unexpand uniq unlink uptime users vdir wc who whoami yes"
+
+# hostname gets a special treatment and is not included in this
+base_bindir_progs = "cat chgrp chmod chown cp date dd echo false kill ln ls mkdir \
+ mknod mv pwd rm rmdir sleep stty sync touch true uname"
+
+sbindir_progs= "chroot"
+
+do_install_append() {
+ for i in ${bindir_progs}; do mv ${D}${bindir}/$i ${D}${bindir}/$i.${PN}; done
+
+ install -d ${D}${base_bindir}
+ for i in ${base_bindir_progs}; do mv ${D}${bindir}/$i ${D}${base_bindir}/$i.${PN}; done
+
+ install -d ${D}${sbindir}
+ for i in ${sbindir_progs}; do mv ${D}${bindir}/$i ${D}${sbindir}/$i.${PN}; done
+
+ # [ requires special handling because [.coreutils will cause the sed stuff
+ # in update-alternatives to fail, therefore use lbracket - the name used
+ # for the actual source file.
+ mv ${D}${bindir}/[ ${D}${bindir}/lbracket.${PN}
+}
+
+pkg_postinst_${PN} () {
+ for i in ${bindir_progs}; do update-alternatives --install ${bindir}/$i $i $i.${PN} 100; done
+
+ for i in ${base_bindir_progs}; do update-alternatives --install ${base_bindir}/$i $i $i.${PN} 100; done
+
+ for i in ${sbindir_progs}; do update-alternatives --install ${sbindir}/$i $i $i.${PN} 100; done
+
+ # Special cases. [ needs to be treated separately.
+ update-alternatives --install '${bindir}/[' '[' 'lbracket.${PN}' 100
+}
+
+pkg_prerm_${PN} () {
+ for i in ${bindir_progs}; do update-alternatives --remove $i $i.${PN}; done
+
+ for i in ${base_bindir_progs}; do update-alternatives --remove $i $i.${PN}; done
+
+ for i in ${sbindir_progs}; do update-alternatives --remove $i $i.${PN}; done
+
+ # The special cases
+ update-alternatives --remove hostname hostname.${PN}
+ update-alternatives --remove uptime uptime.${PN}
+ update-alternatives --remove '[' 'lbracket.${PN}'
+}
+
+BBCLASSEXTEND = "native"
diff --git a/meta/recipes-core/ncurses/ncurses.inc b/meta/recipes-core/ncurses/ncurses.inc
new file mode 100644
index 000000000..259750cb4
--- /dev/null
+++ b/meta/recipes-core/ncurses/ncurses.inc
@@ -0,0 +1,99 @@
+DESCRIPTION = "Ncurses library"
+HOMEPAGE = "http://www.gnu.org/software/ncurses/ncurses.html"
+LICENSE = "MIT"
+SECTION = "libs"
+DEPENDS = "ncurses-native"
+DEPENDS_virtclass-native = ""
+PACKAGES_prepend = "ncurses-tools "
+PACKAGES_append = " ncurses-terminfo"
+FILES_ncurses_append = " ${datadir}/tabset"
+RSUGGESTS_${PN} = "ncurses-terminfo"
+RPROVIDES = "libncurses5"
+
+inherit autotools
+
+# This keeps only tput/tset in ncurses
+# clear/reset are in already busybox
+FILES_ncurses-tools = "${bindir}/tic ${bindir}/toe ${bindir}/infotocap ${bindir}/captoinfo ${bindir}/infocmp ${bindir}/clear.${PN} ${bindir}/reset.${PN} ${bindir}/tack "
+FILES_ncurses-terminfo = "${datadir}/terminfo"
+FILES_${PN} = "${bindir}/tput ${bindir}/tset ${libdir}/lib*.so.* /usr/share/tabset /etc/terminfo"
+
+PARALLEL_MAKE=""
+
+FILESPATH = "${FILE_DIRNAME}/local:${FILE_DIRNAME}/ncurses-${PV}-${PR}:${FILE_DIRNAME}/ncurses-${PV}:${FILE_DIRNAME}/ncurses:${FILE_DIRNAME}"
+
+EXTRA_OECONF = "--with-shared \
+ --with-libtool \
+ --without-profile \
+ --without-debug \
+ --disable-rpath \
+ --enable-echo \
+ --enable-const \
+ --without-ada \
+ --enable-termcap \
+ --without-cxx-binding \
+ --with-terminfo-dirs=${sysconfdir}/terminfo:${datadir}/terminfo \
+ --enable-overwrite \
+ --with-build-ldflags='' \
+ --with-build-ccflags='' "
+export BUILD_CCFLAGS = "-I${S}/ncurses -I${S}/include ${BUILD_CFLAGS}"
+export BUILD_LDFLAGS = ""
+export EXTRA_OEMAKE = '"BUILD_LDFLAGS=" "BUILD_CCFLAGS=${BUILD_CCFLAGS}"'
+
+# This is necessary so that the "tic" command executed during the install can
+# link with the correct libary in staging.
+export LD_LIBRARY_PATH = "${STAGING_LIBDIR_NATIVE}"
+
+do_install() {
+ autotools_do_install
+
+ ln -sf curses.h ${D}${includedir}/ncurses.h
+
+ # our ncurses has termcap support
+ ln -sf libncurses.so ${D}${libdir}/libtermcap.so
+ ln -sf libncurses.a ${D}${libdir}/libtermcap.a
+
+ # include some basic terminfo files
+ # stolen ;) from gentoo and modified a bit
+ for x in ansi console dumb linux rxvt screen sun vt{52,100,102,200,220} xterm-color xterm-xfree86
+ do
+ local termfile="$(find "${D}${datadir}/terminfo/" -name "${x}" 2>/dev/null)"
+ local basedir="$(basename $(dirname "${termfile}"))"
+
+ if [ -n "${termfile}" ]
+ then
+ install -d ${D}${sysconfdir}/terminfo/${basedir}
+ mv ${termfile} ${D}${sysconfdir}/terminfo/${basedir}/
+ ln -s /etc/terminfo/${basedir}/${x} \
+ ${D}${datadir}/terminfo/${basedir}/${x}
+ fi
+ done
+ # i think we can use xterm-color as default xterm
+ if [ -e ${D}${sysconfdir}/terminfo/x/xterm-color ]
+ then
+ ln -sf xterm-color ${D}${sysconfdir}/terminfo/x/xterm
+ fi
+
+ if [ "${PN}" = "ncurses" ]; then
+ mv ${D}${bindir}/clear ${D}${bindir}/clear.${PN}
+ mv ${D}${bindir}/reset ${D}${bindir}/reset.${PN}
+ fi
+}
+
+
+pkg_postinst_ncurses-tools () {
+ if [ "${PN}" = "ncurses" ]; then
+ update-alternatives --install ${bindir}/clear clear clear.${PN} 100
+ update-alternatives --install ${bindir}/reset reset reset.${PN} 100
+ fi
+}
+
+
+pkg_prerm_ncurses-tools () {
+ if [ "${PN}" = "ncurses" ]; then
+ update-alternatives --remove clear clear.${PN}
+ update-alternatives --remove reset reset.${PN}
+ fi
+}
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/meta/recipes-core/ncurses/ncurses/makefile_tweak.patch b/meta/recipes-core/ncurses/ncurses/makefile_tweak.patch
new file mode 100644
index 000000000..480855bcc
--- /dev/null
+++ b/meta/recipes-core/ncurses/ncurses/makefile_tweak.patch
@@ -0,0 +1,89 @@
+Libtool 2.2.2 needs to be able to use top_builddir. Automake usually exports
+this but ncurses doesn't use automake.
+
+RP 14/4/08
+
+Index: ncurses-5.4/ncurses/Makefile.in
+===================================================================
+--- ncurses-5.4.orig/ncurses/Makefile.in 2008-04-14 12:22:34.000000000 +0100
++++ ncurses-5.4/ncurses/Makefile.in 2008-04-14 12:22:53.000000000 +0100
+@@ -57,6 +57,7 @@
+ MODEL = @DFT_LWR_MODEL@
+ DESTDIR = @DESTDIR@
+ top_srcdir = @top_srcdir@
++top_builddir = @top_srcdir@
+ srcdir = @srcdir@
+ prefix = @prefix@
+ exec_prefix = @exec_prefix@
+Index: ncurses-5.4/form/Makefile.in
+===================================================================
+--- ncurses-5.4.orig/form/Makefile.in 2008-04-14 12:30:35.000000000 +0100
++++ ncurses-5.4/form/Makefile.in 2008-04-14 12:30:59.000000000 +0100
+@@ -51,6 +51,7 @@
+ MODEL = @DFT_LWR_MODEL@
+ DESTDIR = @DESTDIR@
+ srcdir = @srcdir@
++top_builddir = @top_srcdir@
+ prefix = @prefix@
+ exec_prefix = @exec_prefix@
+ bindir = @bindir@
+Index: ncurses-5.4/menu/Makefile.in
+===================================================================
+--- ncurses-5.4.orig/menu/Makefile.in 2008-04-14 12:29:00.000000000 +0100
++++ ncurses-5.4/menu/Makefile.in 2008-04-14 12:29:13.000000000 +0100
+@@ -51,6 +51,7 @@
+ MODEL = @DFT_LWR_MODEL@
+ DESTDIR = @DESTDIR@
+ srcdir = @srcdir@
++top_builddir = @top_srcdir@
+ prefix = @prefix@
+ exec_prefix = @exec_prefix@
+ bindir = @bindir@
+Index: ncurses-5.4/panel/Makefile.in
+===================================================================
+--- ncurses-5.4.orig/panel/Makefile.in 2008-04-14 12:27:40.000000000 +0100
++++ ncurses-5.4/panel/Makefile.in 2008-04-14 12:27:59.000000000 +0100
+@@ -51,6 +51,7 @@
+ MODEL = @DFT_LWR_MODEL@
+ DESTDIR = @DESTDIR@
+ srcdir = @srcdir@
++top_builddir = @top_srcdir@
+ prefix = @prefix@
+ exec_prefix = @exec_prefix@
+ bindir = @bindir@
+Index: ncurses-5.4/progs/Makefile.in
+===================================================================
+--- ncurses-5.4.orig/progs/Makefile.in 2008-04-14 12:24:37.000000000 +0100
++++ ncurses-5.4/progs/Makefile.in 2008-04-14 12:25:06.000000000 +0100
+@@ -54,6 +54,7 @@
+ MODEL = ../@DFT_OBJ_SUBDIR@
+ DESTDIR = @DESTDIR@
+ srcdir = @srcdir@
++top_builddir = @top_srcdir@
+ prefix = @prefix@
+ exec_prefix = @exec_prefix@
+ bindir = @bindir@
+Index: ncurses-5.4/tack/Makefile.in
+===================================================================
+--- ncurses-5.4.orig/tack/Makefile.in 2008-04-14 12:26:05.000000000 +0100
++++ ncurses-5.4/tack/Makefile.in 2008-04-14 12:26:26.000000000 +0100
+@@ -22,6 +22,7 @@
+ MODEL = ../@DFT_OBJ_SUBDIR@
+ DESTDIR = @DESTDIR@
+ srcdir = @srcdir@
++top_builddir = @top_srcdir@
+ prefix = @prefix@
+ exec_prefix = @exec_prefix@
+ bindir = @bindir@
+Index: ncurses-5.4/test/Makefile.in
+===================================================================
+--- ncurses-5.4.orig/test/Makefile.in 2008-04-14 12:32:37.000000000 +0100
++++ ncurses-5.4/test/Makefile.in 2008-04-14 12:32:56.000000000 +0100
+@@ -43,6 +43,7 @@
+
+ MODEL = ../@DFT_OBJ_SUBDIR@
+ srcdir = @srcdir@
++top_builddir = @top_srcdir@
+ prefix = @prefix@
+ exec_prefix = @exec_prefix@
+ libdir = @libdir@
diff --git a/meta/recipes-core/ncurses/ncurses/visibility.patch b/meta/recipes-core/ncurses/ncurses/visibility.patch
new file mode 100644
index 000000000..29cac5f1b
--- /dev/null
+++ b/meta/recipes-core/ncurses/ncurses/visibility.patch
@@ -0,0 +1,4904 @@
+
+#
+# Patch managed by http://www.holgerschurig.de/patcher.html
+#
+
+--- ncurses-5.4/ncurses/Makefile.in~visibility.patch
++++ ncurses-5.4/ncurses/Makefile.in
+@@ -107,7 +107,7 @@
+ CFLAGS_NORMAL = $(CCFLAGS)
+ CFLAGS_DEBUG = $(CCFLAGS) @CC_G_OPT@ -DTRACE
+ CFLAGS_PROFILE = $(CCFLAGS) -pg
+-CFLAGS_SHARED = $(CCFLAGS) @CC_SHARED_OPTS@
++CFLAGS_SHARED = $(CCFLAGS) @CC_SHARED_OPTS@ @LIBOPTS@
+
+ CFLAGS_DEFAULT = $(CFLAGS_@DFT_UPR_MODEL@)
+
+--- ncurses-5.4/panel/Makefile.in~visibility.patch
++++ ncurses-5.4/panel/Makefile.in
+@@ -88,7 +88,7 @@
+ CFLAGS_NORMAL = $(CCFLAGS)
+ CFLAGS_DEBUG = $(CCFLAGS) @CC_G_OPT@ -DTRACE
+ CFLAGS_PROFILE = $(CCFLAGS) -pg
+-CFLAGS_SHARED = $(CCFLAGS) @CC_SHARED_OPTS@
++CFLAGS_SHARED = $(CCFLAGS) @CC_SHARED_OPTS@ @LIBOPTS@
+
+ CFLAGS_DEFAULT = $(CFLAGS_@DFT_UPR_MODEL@)
+
+--- ncurses-5.4/menu/Makefile.in~visibility.patch
++++ ncurses-5.4/menu/Makefile.in
+@@ -87,7 +87,7 @@
+ CFLAGS_NORMAL = $(CCFLAGS)
+ CFLAGS_DEBUG = $(CCFLAGS) @CC_G_OPT@ -DTRACE
+ CFLAGS_PROFILE = $(CCFLAGS) -pg
+-CFLAGS_SHARED = $(CCFLAGS) @CC_SHARED_OPTS@
++CFLAGS_SHARED = $(CCFLAGS) @CC_SHARED_OPTS@ @LIBOPTS@
+
+ CFLAGS_DEFAULT = $(CFLAGS_@DFT_UPR_MODEL@)
+
+--- ncurses-5.4/c++/Makefile.in~visibility.patch
++++ ncurses-5.4/c++/Makefile.in
+@@ -80,7 +80,7 @@
+ CFLAGS_NORMAL = $(CCFLAGS)
+ CFLAGS_DEBUG = $(CCFLAGS) @CXX_G_OPT@ -DTRACE
+ CFLAGS_PROFILE = $(CCFLAGS) -pg
+-CFLAGS_SHARED = $(CCFLAGS) @CC_SHARED_OPTS@
++CFLAGS_SHARED = $(CCFLAGS) @CC_SHARED_OPTS@ @LIBOPTS@
+
+ CFLAGS_DEFAULT = $(CFLAGS_@DFT_UPR_MODEL@)
+
+--- ncurses-5.4/form/Makefile.in~visibility.patch
++++ ncurses-5.4/form/Makefile.in
+@@ -88,7 +88,7 @@
+ CFLAGS_NORMAL = $(CCFLAGS)
+ CFLAGS_DEBUG = $(CCFLAGS) @CC_G_OPT@ -DTRACE
+ CFLAGS_PROFILE = $(CCFLAGS) -pg
+-CFLAGS_SHARED = $(CCFLAGS) @CC_SHARED_OPTS@
++CFLAGS_SHARED = $(CCFLAGS) @CC_SHARED_OPTS@ @LIBOPTS@
+
+ CFLAGS_DEFAULT = $(CFLAGS_@DFT_UPR_MODEL@)
+
+--- ncurses-5.4/configure.in~visibility.patch
++++ ncurses-5.4/configure.in
+@@ -34,17 +34,20 @@
+ dnl See http://invisible-island.net/autoconf/ for additional information.
+ dnl
+ dnl ---------------------------------------------------------------------------
+-AC_PREREQ(2.13.20020210)
++AC_PREREQ(2.59)
+ AC_REVISION($Revision: 1.312 $)
+-AC_INIT(ncurses/base/lib_initscr.c)
++AC_INIT
++AC_CONFIG_SRCDIR([ncurses/base/lib_initscr.c])
+ AC_CONFIG_HEADER(include/ncurses_cfg.h:include/ncurses_cfg.hin)
+
++m4_include([m4/templates.m4])
++
+ CF_SUBST_NCURSES_VERSION
+
+ CF_WITH_REL_VERSION(NCURSES)
+ CF_WITH_ABI_VERSION
+
+-CF_CHECK_CACHE([AC_CANONICAL_SYSTEM])
++CF_CHECK_CACHE([AC_CANONICAL_TARGET([])])
+ AC_ARG_WITH(system-type,
+ [ --with-system-type=XXX test: override derived host system-type],
+ [AC_MSG_WARN(overriding system type to $withval)
+@@ -100,7 +103,7 @@
+ CF_GXX_VERSION
+ case $GXX_VERSION in
+ 1*|2.[[0-6]]*)
+- GXX=""; CXX=""; ac_cv_prog_gxx=no
++ GXX=""; CXX=""; ac_cv_cxx_compiler_gnu=no
+ cf_cxx_library=no
+ AC_MSG_WARN(templates do not work)
+ ;;
+@@ -176,7 +179,6 @@
+ AC_SUBST(DESTDIR)
+
+ ###############################################################################
+-CF_HELP_MESSAGE(Build-Tools Needed to Compile Temporary Applications for Cross-compiling:)
+ # If we're cross-compiling, allow the user to override the tools and their
+ # options. The configure script is oriented toward identifying the host
+ # compiler, etc., but we need a build compiler to generate parts of the source.
+@@ -213,7 +215,6 @@
+ AC_SUBST(BUILD_EXEEXT)
+
+ ###############################################################################
+-CF_HELP_MESSAGE(Options to Specify the Libraries Built/Used:)
+
+ ### Options to allow the user to specify the set of libraries which are used.
+ ### Use "--without-normal --with-shared" to allow the default model to be
+@@ -343,11 +344,11 @@
+
+ AC_MSG_CHECKING(for default loader flags)
+ case $DFT_LWR_MODEL in
+-libtool) LD_MODEL='' ;;
++libtool) LD_MODEL=''; LIBOPTS="-DNCURSES_DLL" ;;
+ normal) LD_MODEL='' ;;
+ debug) LD_MODEL=$CC_G_OPT ;;
+ profile) LD_MODEL='-pg';;
+-shared) LD_MODEL='' ;;
++shared) LD_MODEL=''; LIBOPTS="-DNCURSES_DLL" ;;
+ esac
+ AC_SUBST(LD_MODEL)dnl the type of link (e.g., -g or -pg)
+ AC_MSG_RESULT($LD_MODEL)
+@@ -363,14 +364,14 @@
+ if test "$CC_SHARED_OPTS" = "unknown"; then
+ for model in $cf_list_models; do
+ if test "$model" = "shared"; then
+- AC_ERROR(Shared libraries are not supported in this version)
++ AC_MSG_ERROR([Shared libraries are not supported in this version])
+ fi
+ done
+ fi
+
+-###############################################################################
+-CF_HELP_MESSAGE(Fine-Tuning Your Configuration:)
++AC_SUBST(LIBOPTS)
+
++###############################################################################
+ ### use option --disable-overwrite to leave out the link to -lcurses
+ AC_MSG_CHECKING(if you wish to install ncurses overwriting curses)
+ AC_ARG_ENABLE(overwrite,
+@@ -450,7 +451,7 @@
+ AC_ARG_ENABLE(big-core,
+ [ --disable-big-core assume machine has little memory],
+ [with_big_core=$enableval],
+- [AC_TRY_RUN([
++ [AC_RUN_IFELSE([AC_LANG_SOURCE([[
+ #include <stdlib.h>
+ #include <string.h>
+ int main() {
+@@ -459,10 +460,7 @@
+ if (s != 0)
+ s[0] = s[n-1] = 0;
+ exit(s == 0);
+-}],
+- [with_big_core=yes],
+- [with_big_core=no],
+- [with_big_core=no])])
++}]])],[with_big_core=yes],[with_big_core=no],[with_big_core=no])])
+ AC_MSG_RESULT($with_big_core)
+ test "$with_big_core" = "yes" && AC_DEFINE(HAVE_BIG_CORE)
+
+@@ -477,7 +475,7 @@
+ if test "$with_termcap" != "yes" ; then
+ if test "$use_database" = no ; then
+ if test -z "$with_fallback" ; then
+- AC_ERROR(You have disabled the database w/o specifying fallbacks)
++ AC_MSG_ERROR([You have disabled the database w/o specifying fallbacks])
+ fi
+ fi
+ AC_DEFINE(PURE_TERMINFO)
+@@ -614,10 +612,10 @@
+ test "$with_rcs_ids" = yes && AC_DEFINE(USE_RCS_IDS)
+
+ ###############################################################################
++
+ CF_MAN_PAGES([ captoinfo clear infocmp infotocap tic toe tput ])
+
+ ###############################################################################
+-CF_HELP_MESSAGE(Extensions:)
+
+ ### Note that some functions (such as const) are normally disabled anyway.
+ AC_MSG_CHECKING(if you want to build with function extensions)
+@@ -683,7 +681,6 @@
+
+ ###############################################################################
+ # These options are relatively safe to experiment with.
+-CF_HELP_MESSAGE(Development Code:)
+ AC_MSG_CHECKING(if you want all development code)
+ AC_ARG_WITH(develop,
+ [ --with-develop enable all development options],
+@@ -719,7 +716,6 @@
+
+ ###############################################################################
+ # These are just experimental, probably should not be in a package:
+-CF_HELP_MESSAGE(Experimental Code:)
+
+ AC_MSG_CHECKING(if you do not want to assume colors are white-on-black)
+ AC_ARG_ENABLE(assumed-color,
+@@ -828,7 +824,6 @@
+ AC_SUBST(TERMINFO_CAPS)
+
+ ###############################################################################
+-CF_HELP_MESSAGE(Testing/development Options:)
+
+ ### use option --disable-echo to suppress full display compiling commands
+ AC_MSG_CHECKING(if you want to display full commands during build)
+@@ -931,7 +926,7 @@
+ AC_SUBST(MATH_LIB)
+
+ ### Checks for header files.
+-AC_STDC_HEADERS
++AC_HEADER_STDC([])
+ AC_HEADER_DIRENT
+ AC_HEADER_TIME
+ CF_REGEX
+@@ -965,7 +960,7 @@
+ CF_SYS_TIME_SELECT
+
+ ### checks for compiler characteristics
+-AC_LANG_C
++AC_LANG([C])
+ AC_C_CONST
+ AC_C_INLINE
+ test "$ac_cv_c_inline" != no && AC_DEFINE(CC_HAS_INLINE_FUNCS)
+@@ -1040,7 +1035,7 @@
+
+ # Check for C++ compiler characteristics (and ensure that it's there!)
+ if test -n "$CXX" ; then
+- AC_LANG_CPLUSPLUS
++ AC_LANG([C++])
+ CF_STDCPP_LIBRARY
+
+ case $GXX_VERSION in
+@@ -1135,7 +1130,6 @@
+ fi
+ AC_SUBST(USE_CXX_BOOL)
+
+-CF_HELP_MESSAGE(Ada95 Binding Options:)
+
+ dnl Check for availability of GNU Ada Translator (GNAT).
+ dnl At the moment we support no other Ada95 compiler.
+@@ -1309,15 +1303,16 @@
+
+ ################################################################################
+ test "$use_database" = yes && SUB_MAKEFILES="$SUB_MAKEFILES misc/run_tic.sh:misc/run_tic.in"
+-AC_OUTPUT( \
++AC_CONFIG_FILES([\
+ include/MKterm.h.awk \
+ include/curses.head:include/curses.h.in \
+ include/termcap.h \
+ include/unctrl.h \
+ $SUB_MAKEFILES \
+- Makefile,[
++ Makefile])
++AC_CONFIG_COMMANDS([default],[
+ CF_LIB_RULES
+-],[
++],[[
+ ### Special initialization commands, used to pass information from the
+ ### configuration-run into config.status
+
+@@ -1348,5 +1343,6 @@
+ host="$host"
+ target="$target"
+
+-],cat)dnl
++]])
++AC_OUTPUT
+ ${MAKE-make} preinstall
+--- ncurses-5.4/include/ncurses_dll.h~visibility.patch
++++ ncurses-5.4/include/ncurses_dll.h
+@@ -7,8 +7,8 @@
+ /* but this structure may be useful at some point for an MSVC build */
+ /* so, for now unconditionally define the important flags */
+ /* "the right way" for proper static and dll+auto-import behavior */
+-#undef NCURSES_DLL
+-#define NCURSES_STATIC
++//#undef NCURSES_DLL
++//#define NCURSES_STATIC
+
+ #if defined(__CYGWIN__)
+ # if defined(NCURSES_DLL)
+@@ -32,12 +32,20 @@
+ # endif
+ # define NCURSES_API __cdecl
+ # define NCURSES_EXPORT(type) NCURSES_IMPEXP type NCURSES_API
+-# define NCURSES_EXPORT_VAR(type) NCURSES_IMPEXP type
++# define NCURSES_EXPORT_VAR(var) var NCURSES_IMPEXP
+ #endif
+
+ /* Take care of non-cygwin platforms */
+ #if !defined(NCURSES_IMPEXP)
+-# define NCURSES_IMPEXP /* nothing */
++# if defined(GCC_HASCLASSVISIBILITY)
++# if defined(NCURSES_DLL)
++# define NCURSES_IMPEXP __attribute__ ((visibility("default")))
++# else
++# define NCURSES_IMPEXP /* nothing */
++# endif
++# else
++# define NCURSES_IMPEXP /* nothing */
++# endif
+ #endif
+ #if !defined(NCURSES_API)
+ # define NCURSES_API /* nothing */
+@@ -46,7 +54,7 @@
+ # define NCURSES_EXPORT(type) NCURSES_IMPEXP type NCURSES_API
+ #endif
+ #if !defined(NCURSES_EXPORT_VAR)
+-# define NCURSES_EXPORT_VAR(type) NCURSES_IMPEXP type
++# define NCURSES_EXPORT_VAR(var) var NCURSES_IMPEXP
+ #endif
+
+ #endif /* NCURSES_DLL_H_incl */
+--- ncurses-5.4/form/fty_alnum.c~visibility.patch
++++ ncurses-5.4/form/fty_alnum.c
+@@ -132,6 +132,6 @@
+ NULL
+ };
+
+-NCURSES_EXPORT_VAR(FIELDTYPE*) TYPE_ALNUM = &typeALNUM;
++FIELDTYPE* NCURSES_EXPORT_VAR(TYPE_ALNUM) = &typeALNUM;
+
+ /* fty_alnum.c ends here */
+--- ncurses-5.4/form/fty_alpha.c~visibility.patch
++++ ncurses-5.4/form/fty_alpha.c
+@@ -133,6 +133,6 @@
+ NULL
+ };
+
+-NCURSES_EXPORT_VAR(FIELDTYPE*) TYPE_ALPHA = &typeALPHA;
++FIELDTYPE* NCURSES_EXPORT_VAR(TYPE_ALPHA) = &typeALPHA;
+
+ /* fty_alpha.c ends here */
+--- ncurses-5.4/form/fld_newftyp.c~visibility.patch
++++ ncurses-5.4/form/fld_newftyp.c
+@@ -48,7 +48,7 @@
+ NULL /* enumerate previous function */
+ };
+
+-NCURSES_EXPORT_VAR(const FIELDTYPE*) _nc_Default_FieldType = &default_fieldtype;
++const FIELDTYPE* NCURSES_EXPORT_VAR(_nc_Default_FieldType) = &default_fieldtype;
+
+ /*---------------------------------------------------------------------------
+ | Facility : libnform
+--- ncurses-5.4/form/form.h~visibility.patch
++++ ncurses-5.4/form/form.h
+@@ -248,24 +248,24 @@
+ /*************************
+ * standard field types *
+ *************************/
+-extern NCURSES_EXPORT_VAR(FIELDTYPE *) TYPE_ALPHA;
+-extern NCURSES_EXPORT_VAR(FIELDTYPE *) TYPE_ALNUM;
+-extern NCURSES_EXPORT_VAR(FIELDTYPE *) TYPE_ENUM;
+-extern NCURSES_EXPORT_VAR(FIELDTYPE *) TYPE_INTEGER;
+-extern NCURSES_EXPORT_VAR(FIELDTYPE *) TYPE_NUMERIC;
+-extern NCURSES_EXPORT_VAR(FIELDTYPE *) TYPE_REGEXP;
++extern FIELDTYPE * NCURSES_EXPORT_VAR(TYPE_ALPHA);
++extern FIELDTYPE * NCURSES_EXPORT_VAR(TYPE_ALNUM);
++extern FIELDTYPE * NCURSES_EXPORT_VAR(TYPE_ENUM);
++extern FIELDTYPE * NCURSES_EXPORT_VAR(TYPE_INTEGER);
++extern FIELDTYPE * NCURSES_EXPORT_VAR(TYPE_NUMERIC);
++extern FIELDTYPE * NCURSES_EXPORT_VAR(TYPE_REGEXP);
+
+ /************************************
+ * built-in additional field types *
+ * They are not defined in SVr4 *
+ ************************************/
+-extern NCURSES_EXPORT_VAR(FIELDTYPE *) TYPE_IPV4; /* Internet IP Version 4 address */
++extern FIELDTYPE * NCURSES_EXPORT_VAR(TYPE_IPV4); /* Internet IP Version 4 address */
+
+ /***********************
+ * Default objects *
+ ***********************/
+-extern NCURSES_EXPORT_VAR(FORM *) _nc_Default_Form;
+-extern NCURSES_EXPORT_VAR(FIELD *) _nc_Default_Field;
++extern FORM * NCURSES_EXPORT_VAR(_nc_Default_Form);
++extern FIELD * NCURSES_EXPORT_VAR(_nc_Default_Field);
+
+
+ /***********************
+--- ncurses-5.4/form/fty_int.c~visibility.patch
++++ ncurses-5.4/form/fty_int.c
+@@ -155,6 +155,6 @@
+ NULL
+ };
+
+-NCURSES_EXPORT_VAR(FIELDTYPE*) TYPE_INTEGER = &typeINTEGER;
++FIELDTYPE* NCURSES_EXPORT_VAR(TYPE_INTEGER) = &typeINTEGER;
+
+ /* fty_int.c ends here */
+--- ncurses-5.4/form/fty_num.c~visibility.patch
++++ ncurses-5.4/form/fty_num.c
+@@ -190,6 +190,6 @@
+ NULL
+ };
+
+-NCURSES_EXPORT_VAR(FIELDTYPE*) TYPE_NUMERIC = &typeNUMERIC;
++FIELDTYPE* NCURSES_EXPORT_VAR(TYPE_NUMERIC) = &typeNUMERIC;
+
+ /* fty_num.c ends here */
+--- ncurses-5.4/form/fty_regex.c~visibility.patch
++++ ncurses-5.4/form/fty_regex.c
+@@ -252,6 +252,6 @@
+ NULL
+ };
+
+-NCURSES_EXPORT_VAR(FIELDTYPE*) TYPE_REGEXP = &typeREGEXP;
++FIELDTYPE* NCURSES_EXPORT_VAR(TYPE_REGEXP) = &typeREGEXP;
+
+ /* fty_regex.c ends here */
+--- ncurses-5.4/form/frm_def.c~visibility.patch
++++ ncurses-5.4/form/frm_def.c
+@@ -60,7 +60,7 @@
+ NULL /* fieldterm */
+ };
+
+-NCURSES_EXPORT_VAR(FORM *) _nc_Default_Form = &default_form;
++FORM * NCURSES_EXPORT_VAR(_nc_Default_Form) = &default_form;
+
+ /*---------------------------------------------------------------------------
+ | Facility : libnform
+--- ncurses-5.4/form/fld_def.c~visibility.patch
++++ ncurses-5.4/form/fld_def.c
+@@ -63,7 +63,7 @@
+ (char *)0 /* usrptr */
+ };
+
+-NCURSES_EXPORT_VAR(FIELD *) _nc_Default_Field = &default_field;
++FIELD * NCURSES_EXPORT_VAR(_nc_Default_Field) = &default_field;
+
+ /*---------------------------------------------------------------------------
+ | Facility : libnform
+--- ncurses-5.4/form/fty_enum.c~visibility.patch
++++ ncurses-5.4/form/fty_enum.c
+@@ -290,6 +290,6 @@
+ Previous_Enum
+ };
+
+-NCURSES_EXPORT_VAR(FIELDTYPE*) TYPE_ENUM = &typeENUM;
++FIELDTYPE* NCURSES_EXPORT_VAR(TYPE_ENUM) = &typeENUM;
+
+ /* fty_enum.c ends here */
+--- ncurses-5.4/form/fty_ipv4.c~visibility.patch
++++ ncurses-5.4/form/fty_ipv4.c
+@@ -76,6 +76,6 @@
+ NULL
+ };
+
+-NCURSES_EXPORT_VAR(FIELDTYPE*) TYPE_IPV4 = &typeIPV4;
++FIELDTYPE* NCURSES_EXPORT_VAR(TYPE_IPV4) = &typeIPV4;
+
+ /* fty_ipv4.c ends here */
+--- ncurses-5.4/form/form.priv.h~visibility.patch
++++ ncurses-5.4/form/form.priv.h
+@@ -112,7 +112,7 @@
+ #define C_BLANK ' '
+ #define is_blank(c) ((c)==C_BLANK)
+
+-extern NCURSES_EXPORT_VAR(const FIELDTYPE *) _nc_Default_FieldType;
++extern const FIELDTYPE * NCURSES_EXPORT_VAR(_nc_Default_FieldType);
+
+ extern NCURSES_EXPORT(TypeArgument *) _nc_Make_Argument (const FIELDTYPE*,va_list*,int*);
+ extern NCURSES_EXPORT(TypeArgument *) _nc_Copy_Argument (const FIELDTYPE*,const TypeArgument*, int*);
+--- ncurses-5.4/include/tic.h~visibility.patch
++++ ncurses-5.4/include/tic.h
+@@ -117,7 +117,7 @@
+ #define DEBUG(n, a) /*nothing*/
+ #endif
+
+-extern NCURSES_EXPORT_VAR(unsigned) _nc_tracing;
++extern unsigned NCURSES_EXPORT_VAR(_nc_tracing);
+ extern NCURSES_EXPORT(void) _nc_tracef (char *, ...) GCC_PRINTFLIKE(1,2);
+ extern NCURSES_EXPORT(const char *) _nc_visbuf (const char *);
+ extern NCURSES_EXPORT(const char *) _nc_visbuf2 (int, const char *);
+@@ -151,7 +151,7 @@
+ char *tk_valstring; /* value of capability (if a string) */
+ };
+
+-extern NCURSES_EXPORT_VAR(struct token) _nc_curr_token;
++extern struct token NCURSES_EXPORT_VAR(_nc_curr_token);
+
+ /*
+ * List of keynames with their corresponding code.
+@@ -161,7 +161,7 @@
+ int code;
+ };
+
+-extern NCURSES_EXPORT_VAR(const struct kn) _nc_key_names[];
++extern const struct kn NCURSES_EXPORT_VAR(_nc_key_names[]);
+
+ /*
+ * Offsets to string capabilities, with the corresponding functionkey
+@@ -179,7 +179,7 @@
+
+ #else
+
+-extern NCURSES_EXPORT_VAR(struct tinfo_fkeys) _nc_tinfo_fkeys[];
++extern struct tinfo_fkeys NCURSES_EXPORT_VAR(_nc_tinfo_fkeys[]);
+
+ #endif
+
+@@ -204,11 +204,11 @@
+ const char *source;
+ };
+
+-extern NCURSES_EXPORT_VAR(const struct name_table_entry * const) _nc_info_hash_table[];
+-extern NCURSES_EXPORT_VAR(const struct name_table_entry * const) _nc_cap_hash_table[];
++extern const struct name_table_entry * const NCURSES_EXPORT_VAR(_nc_info_hash_table[]);
++extern const struct name_table_entry * const NCURSES_EXPORT_VAR(_nc_cap_hash_table[]);
+
+-extern NCURSES_EXPORT_VAR(const struct alias) _nc_capalias_table[];
+-extern NCURSES_EXPORT_VAR(const struct alias) _nc_infoalias_table[];
++extern const struct alias NCURSES_EXPORT_VAR(_nc_capalias_table[]);
++extern const struct alias NCURSES_EXPORT_VAR(_nc_infoalias_table[]);
+
+ extern NCURSES_EXPORT(const struct name_table_entry *) _nc_get_table (bool);
+ extern NCURSES_EXPORT(const struct name_table_entry * const *) _nc_get_hash_table (bool);
+@@ -255,13 +255,13 @@
+ extern NCURSES_EXPORT(void) _nc_panic_mode (char);
+ extern NCURSES_EXPORT(void) _nc_push_token (int);
+ extern NCURSES_EXPORT(void) _nc_reset_input (FILE *, char *);
+-extern NCURSES_EXPORT_VAR(int) _nc_curr_col;
+-extern NCURSES_EXPORT_VAR(int) _nc_curr_line;
+-extern NCURSES_EXPORT_VAR(int) _nc_syntax;
+-extern NCURSES_EXPORT_VAR(long) _nc_comment_end;
+-extern NCURSES_EXPORT_VAR(long) _nc_comment_start;
+-extern NCURSES_EXPORT_VAR(long) _nc_curr_file_pos;
+-extern NCURSES_EXPORT_VAR(long) _nc_start_line;
++extern int NCURSES_EXPORT_VAR(_nc_curr_col);
++extern int NCURSES_EXPORT_VAR(_nc_curr_line);
++extern int NCURSES_EXPORT_VAR(_nc_syntax);
++extern long NCURSES_EXPORT_VAR(_nc_comment_end);
++extern long NCURSES_EXPORT_VAR(_nc_comment_start);
++extern long NCURSES_EXPORT_VAR(_nc_curr_file_pos);
++extern long NCURSES_EXPORT_VAR(_nc_start_line);
+ #define SYN_TERMINFO 0
+ #define SYN_TERMCAP 1
+
+@@ -272,7 +272,7 @@
+ extern NCURSES_EXPORT(void) _nc_syserr_abort (const char *const,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
+ extern NCURSES_EXPORT(void) _nc_err_abort (const char *const,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
+ extern NCURSES_EXPORT(void) _nc_warning (const char *const,...) GCC_PRINTFLIKE(1,2);
+-extern NCURSES_EXPORT_VAR(bool) _nc_suppress_warnings;
++extern bool NCURSES_EXPORT_VAR(_nc_suppress_warnings);
+
+ /* comp_expand.c: expand string into readable form */
+ extern NCURSES_EXPORT(char *) _nc_tic_expand (const char *, bool, int);
+@@ -287,12 +287,12 @@
+ /* lib_tparm.c */
+ #define NUM_PARM 9
+
+-extern NCURSES_EXPORT_VAR(int) _nc_tparm_err;
++extern int NCURSES_EXPORT_VAR(_nc_tparm_err);
+
+ extern NCURSES_EXPORT(int) _nc_tparm_analyze(const char *string, char *p_is_s[NUM_PARM], int *popcount);
+
+ /* lib_tputs.c */
+-extern NCURSES_EXPORT_VAR(int) _nc_nulls_sent; /* Add one for every null sent */
++extern int NCURSES_EXPORT_VAR(_nc_nulls_sent); /* Add one for every null sent */
+
+ /* comp_main.c: compiler main */
+ extern const char * _nc_progname;
+--- ncurses-5.4/include/MKterm.h.awk.in~visibility.patch
++++ ncurses-5.4/include/MKterm.h.awk.in
+@@ -228,9 +228,9 @@
+ print " char * _termname; /* used for termname() */"
+ print "} TERMINAL;"
+ print ""
+- print "extern NCURSES_EXPORT_VAR(TERMINAL *) cur_term;"
++ print "extern TERMINAL * NCURSES_EXPORT_VAR(cur_term);"
+ print ""
+- print "#if BROKEN_LINKER"
++ print "#if defined(BROKEN_LINKER)"
+ print "#define boolnames _nc_boolnames()"
+ print "#define boolcodes _nc_boolcodes()"
+ print "#define boolfnames _nc_boolfnames()"
+@@ -253,15 +253,15 @@
+ print ""
+ print "#else"
+ print ""
+- print "extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) boolnames[];"
+- print "extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) boolcodes[];"
+- print "extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) boolfnames[];"
+- print "extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) numnames[];"
+- print "extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) numcodes[];"
+- print "extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) numfnames[];"
+- print "extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) strnames[];"
+- print "extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) strcodes[];"
+- print "extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) strfnames[];"
++ print "extern NCURSES_CONST char * const NCURSES_EXPORT_VAR(boolnames[]);"
++ print "extern NCURSES_CONST char * const NCURSES_EXPORT_VAR(boolcodes[]);"
++ print "extern NCURSES_CONST char * const NCURSES_EXPORT_VAR(boolfnames[]);"
++ print "extern NCURSES_CONST char * const NCURSES_EXPORT_VAR(numnames[]);"
++ print "extern NCURSES_CONST char * const NCURSES_EXPORT_VAR(numcodes[]);"
++ print "extern NCURSES_CONST char * const NCURSES_EXPORT_VAR(numfnames[]);"
++ print "extern NCURSES_CONST char * const NCURSES_EXPORT_VAR(strnames[]);"
++ print "extern NCURSES_CONST char * const NCURSES_EXPORT_VAR(strcodes[]);"
++ print "extern NCURSES_CONST char * const NCURSES_EXPORT_VAR(strfnames[]);"
+ print ""
+ print "#endif"
+ print ""
+@@ -287,7 +287,7 @@
+ print "#if !defined(__NCURSES_H)"
+ print "extern NCURSES_EXPORT(char *) tigetstr (NCURSES_CONST char *);"
+ print "extern NCURSES_EXPORT(char *) tparm (NCURSES_CONST char *, ...);"
+- print "extern NCURSES_EXPORT_VAR(char) ttytype[];"
++ print "extern char NCURSES_EXPORT_VAR(ttytype[]);"
+ print "extern NCURSES_EXPORT(int) putp (const char *);"
+ print "extern NCURSES_EXPORT(int) tigetflag (NCURSES_CONST char *);"
+ print "extern NCURSES_EXPORT(int) tigetnum (NCURSES_CONST char *);"
+--- ncurses-5.4/include/termcap.h.in~visibility.patch
++++ ncurses-5.4/include/termcap.h.in
+@@ -54,10 +54,10 @@
+ #undef NCURSES_OSPEED
+ #define NCURSES_OSPEED @NCURSES_OSPEED@
+
+-extern NCURSES_EXPORT_VAR(char) PC;
+-extern NCURSES_EXPORT_VAR(char *) UP;
+-extern NCURSES_EXPORT_VAR(char *) BC;
+-extern NCURSES_EXPORT_VAR(NCURSES_OSPEED) ospeed;
++extern char NCURSES_EXPORT_VAR(PC);
++extern char * NCURSES_EXPORT_VAR(UP);
++extern char * NCURSES_EXPORT_VAR(BC);
++extern NCURSES_OSPEED NCURSES_EXPORT_VAR(ospeed);
+
+ #if !defined(NCURSES_TERM_H_incl)
+ extern NCURSES_EXPORT(char *) tgetstr (NCURSES_CONST char *, char **);
+--- ncurses-5.4/include/term_entry.h~visibility.patch
++++ ncurses-5.4/include/term_entry.h
+@@ -90,8 +90,8 @@
+ #define ExtNumname(tp,i,names) EXT_NAMES(tp, i, NUMCOUNT, (i - (tp->num_Numbers - tp->ext_Numbers)) + tp->ext_Booleans, names)
+ #define ExtStrname(tp,i,names) EXT_NAMES(tp, i, STRCOUNT, (i - (tp->num_Strings - tp->ext_Strings)) + (tp->ext_Numbers + tp->ext_Booleans), names)
+
+-extern NCURSES_EXPORT_VAR(ENTRY *) _nc_head;
+-extern NCURSES_EXPORT_VAR(ENTRY *) _nc_tail;
++extern ENTRY * NCURSES_EXPORT_VAR(_nc_head);
++extern ENTRY * NCURSES_EXPORT_VAR(_nc_tail);
+ #define for_entry_list(qp) for (qp = _nc_head; qp; qp = qp->next)
+
+ #define MAX_LINE 132
+@@ -135,8 +135,8 @@
+
+ /* parse_entry.c: entry-parsing code */
+ #if NCURSES_XNAMES
+-extern NCURSES_EXPORT_VAR(bool) _nc_user_definable;
+-extern NCURSES_EXPORT_VAR(bool) _nc_disable_period;
++extern bool NCURSES_EXPORT_VAR(_nc_user_definable);
++extern bool NCURSES_EXPORT_VAR(_nc_disable_period);
+ #endif
+ extern NCURSES_EXPORT(int) _nc_parse_entry (ENTRY *, int, bool);
+ extern NCURSES_EXPORT(int) _nc_capcmp (const char *, const char *);
+--- ncurses-5.4/include/curses.h.in~visibility.patch
++++ ncurses-5.4/include/curses.h.in
+@@ -171,8 +171,8 @@
+ #define WA_VERTICAL A_VERTICAL
+
+ /* colors */
+-extern NCURSES_EXPORT_VAR(int) COLORS;
+-extern NCURSES_EXPORT_VAR(int) COLOR_PAIRS;
++extern int NCURSES_EXPORT_VAR(COLORS);
++extern int NCURSES_EXPORT_VAR(COLOR_PAIRS);
+
+ #define COLOR_BLACK 0
+ #define COLOR_RED 1
+@@ -186,10 +186,10 @@
+ /* line graphics */
+
+ #if @BROKEN_LINKER@
+-extern NCURSES_EXPORT_VAR(chtype*) _nc_acs_map(void);
++extern chtype* NCURSES_EXPORT_VAR(_nc_acs_map)(void);
+ #define acs_map (_nc_acs_map())
+ #else
+-extern NCURSES_EXPORT_VAR(chtype) acs_map[];
++extern chtype NCURSES_EXPORT_VAR(acs_map[]);
+ #endif
+
+ #define NCURSES_ACS(c) (acs_map[(unsigned char)c])
+@@ -369,20 +369,20 @@
+ #endif
+ };
+
+-extern NCURSES_EXPORT_VAR(WINDOW *) stdscr;
+-extern NCURSES_EXPORT_VAR(WINDOW *) curscr;
+-extern NCURSES_EXPORT_VAR(WINDOW *) newscr;
++extern WINDOW * NCURSES_EXPORT_VAR(stdscr);
++extern WINDOW * NCURSES_EXPORT_VAR(curscr);
++extern WINDOW * NCURSES_EXPORT_VAR(newscr);
+
+-extern NCURSES_EXPORT_VAR(int) LINES;
+-extern NCURSES_EXPORT_VAR(int) COLS;
+-extern NCURSES_EXPORT_VAR(int) TABSIZE;
++extern int NCURSES_EXPORT_VAR(LINES);
++extern int NCURSES_EXPORT_VAR(COLS);
++extern int NCURSES_EXPORT_VAR(TABSIZE);
+
+ /*
+ * This global was an undocumented feature under AIX curses.
+ */
+-extern NCURSES_EXPORT_VAR(int) ESCDELAY; /* ESC expire time in milliseconds */
++extern int NCURSES_EXPORT_VAR(ESCDELAY); /* ESC expire time in milliseconds */
+
+-extern NCURSES_EXPORT_VAR(char) ttytype[]; /* needed for backward compatibility */
++extern char NCURSES_EXPORT_VAR(ttytype[]); /* needed for backward compatibility */
+
+ /*
+ * These functions are extensions - not in XSI Curses.
+--- ncurses-5.4/include/curses.tail~visibility.patch
++++ ncurses-5.4/include/curses.tail
+@@ -110,7 +110,7 @@
+ #define TRACE_MAXIMUM ((1 << TRACE_SHIFT) - 1) /* maximum trace level */
+
+ #if defined(TRACE) || defined(NCURSES_TEST)
+-extern NCURSES_EXPORT_VAR(int) _nc_optimize_enable; /* enable optimizations */
++extern int NCURSES_EXPORT_VAR(_nc_optimize_enable); /* enable optimizations */
+ #ifdef _XOPEN_SOURCE_EXTENDED
+ extern NCURSES_EXPORT(const char *) _nc_viswbuf(const wchar_t *);
+ #endif
+--- ncurses-5.4/include/curses.wide~visibility.patch
++++ ncurses-5.4/include/curses.wide
+@@ -3,7 +3,7 @@
+
+ /* $Id: curses.wide,v 1.28 2004/01/03 20:35:14 tom Exp $ */
+
+-extern NCURSES_EXPORT_VAR(cchar_t *) _nc_wacs;
++extern cchar_t * NCURSES_EXPORT_VAR(_nc_wacs);
+
+ #define NCURSES_WACS(c) (&_nc_wacs[(unsigned char)c])
+
+--- ncurses-5.4/menu/menu.priv.h~visibility.patch
++++ ncurses-5.4/menu/menu.priv.h
+@@ -49,8 +49,8 @@
+ /* Backspace code */
+ #define BS (8)
+
+-extern NCURSES_EXPORT_VAR(ITEM) _nc_Default_Item;
+-extern NCURSES_EXPORT_VAR(MENU) _nc_Default_Menu;
++extern ITEM NCURSES_EXPORT_VAR(_nc_Default_Item);
++extern MENU NCURSES_EXPORT_VAR(_nc_Default_Menu);
+
+ /* Normalize item to default if none was given */
+ #define Normalize_Item( item ) ((item)=(item)?(item):&_nc_Default_Item)
+--- ncurses-5.4/menu/m_global.c~visibility.patch
++++ ncurses-5.4/menu/m_global.c
+@@ -41,7 +41,7 @@
+
+ static char mark[] = "-";
+
+-NCURSES_EXPORT_VAR(MENU) _nc_Default_Menu = {
++MENU NCURSES_EXPORT_VAR(_nc_Default_Menu) = {
+ 16, /* Nr. of chars high */
+ 1, /* Nr. of chars wide */
+ 16, /* Nr. of items high */
+@@ -80,7 +80,7 @@
+ 0 /* status */
+ };
+
+-NCURSES_EXPORT_VAR(ITEM) _nc_Default_Item = {
++ITEM NCURSES_EXPORT_VAR(_nc_Default_Item) = {
+ { (char *)0, 0 }, /* name */
+ { (char *)0, 0 }, /* description */
+ (MENU *)0, /* Pointer to parent menu */
+--- ncurses-5.4/ncurses/tty/lib_mvcur.c~visibility.patch
++++ ncurses-5.4/ncurses/tty/lib_mvcur.c
+@@ -937,7 +937,7 @@
+ }
+
+ #if defined(TRACE) || defined(NCURSES_TEST)
+-NCURSES_EXPORT_VAR(int) _nc_optimize_enable = OPTIMIZE_ALL;
++int NCURSES_EXPORT_VAR(_nc_optimize_enable) = OPTIMIZE_ALL;
+ #endif
+
+ #if defined(MAIN) || defined(NCURSES_TEST)
+@@ -950,7 +950,7 @@
+ #include <tic.h>
+ #include <dump_entry.h>
+
+-NCURSES_EXPORT_VAR(const char *) _nc_progname = "mvcur";
++const char * NCURSES_EXPORT_VAR(_nc_progname) = "mvcur";
+
+ static unsigned long xmits;
+
+--- ncurses-5.4/ncurses/tty/hardscroll.c~visibility.patch
++++ ncurses-5.4/ncurses/tty/hardscroll.c
+@@ -151,8 +151,7 @@
+
+ # undef screen_lines
+ # define screen_lines MAXLINES
+-NCURSES_EXPORT_VAR(int)
+-oldnums[MAXLINES];
++int NCURSES_EXPORT_VAR(oldnums[MAXLINES]);
+ # define OLDNUM(n) oldnums[n]
+ # define _tracef printf
+ # undef TR
+@@ -163,8 +162,7 @@
+ /* OLDNUM(n) indicates which line will be shifted to the position n.
+ if OLDNUM(n) == _NEWINDEX, then the line n in new, not shifted from
+ somewhere. */
+-NCURSES_EXPORT_VAR(int *)
+-_nc_oldnums = 0;
++int * NCURSES_EXPORT_VAR(_nc_oldnums) = 0;
+
+ # if USE_HASHMAP
+ static int oldnums_allocated = 0;
+--- ncurses-5.4/ncurses/base/lib_getch.c~visibility.patch
++++ ncurses-5.4/ncurses/base/lib_getch.c
+@@ -44,8 +44,7 @@
+
+ #include <fifo_defs.h>
+
+-NCURSES_EXPORT_VAR(int)
+-ESCDELAY = 1000; /* max interval betw. chars in funkeys, in millisecs */
++int NCURSES_EXPORT_VAR(ESCDELAY) = 1000; /* max interval betw. chars in funkeys, in millisecs */
+
+ #ifdef NCURSES_WGETCH_EVENTS
+ #define TWAIT_MASK 7
+--- ncurses-5.4/ncurses/base/lib_slk.c~visibility.patch
++++ ncurses-5.4/ncurses/base/lib_slk.c
+@@ -47,8 +47,7 @@
+ * We'd like to move these into the screen context structure, but cannot,
+ * because slk_init() is called before initscr()/newterm().
+ */
+-NCURSES_EXPORT_VAR(int)
+-_nc_slk_format = 0; /* one more than format specified in slk_init() */
++int NCURSES_EXPORT_VAR(_nc_slk_format) = 0; /* one more than format specified in slk_init() */
+
+ /*
+ * Paint the info line for the PC style SLK emulation.
+--- ncurses-5.4/ncurses/base/lib_color.c~visibility.patch
++++ ncurses-5.4/ncurses/base/lib_color.c
+@@ -48,8 +48,8 @@
+ * historical reasons. So we assign them in start_color() and also in
+ * set_term()'s screen-switching logic.
+ */
+-NCURSES_EXPORT_VAR(int) COLOR_PAIRS = 0;
+-NCURSES_EXPORT_VAR(int) COLORS = 0;
++int NCURSES_EXPORT_VAR(COLOR_PAIRS) = 0;
++int NCURSES_EXPORT_VAR(COLORS) = 0;
+
+ #define DATA(r,g,b) {r,g,b, 0,0,0, 0}
+
+--- ncurses-5.4/ncurses/tinfo/lib_termcap.c~visibility.patch
++++ ncurses-5.4/ncurses/tinfo/lib_termcap.c
+@@ -50,8 +50,8 @@
+ #define L_BRACK '['
+ #define SHIFT_OUT 017 /* ^N */
+
+-NCURSES_EXPORT_VAR(char *) UP = 0;
+-NCURSES_EXPORT_VAR(char *) BC = 0;
++char * NCURSES_EXPORT_VAR(UP) = 0;
++char * NCURSES_EXPORT_VAR(BC) = 0;
+
+ static char *fix_me = 0;
+
+--- ncurses-5.4/ncurses/tinfo/lib_cur_term.c~visibility.patch
++++ ncurses-5.4/ncurses/tinfo/lib_cur_term.c
+@@ -42,7 +42,7 @@
+
+ MODULE_ID("$Id: lib_cur_term.c,v 1.13 2003/12/27 18:21:30 tom Exp $")
+
+-NCURSES_EXPORT_VAR(TERMINAL *) cur_term = 0;
++TERMINAL * NCURSES_EXPORT_VAR(cur_term) = 0;
+
+ NCURSES_EXPORT(TERMINAL *)
+ set_curterm(TERMINAL * termp)
+--- ncurses-5.4/ncurses/tinfo/lib_setup.c~visibility.patch
++++ ncurses-5.4/ncurses/tinfo/lib_setup.c
+@@ -91,10 +91,10 @@
+ # endif
+ #endif
+
+-NCURSES_EXPORT_VAR(char) ttytype[NAMESIZE] = "";
+-NCURSES_EXPORT_VAR(int) LINES = 0;
+-NCURSES_EXPORT_VAR(int) COLS = 0;
+-NCURSES_EXPORT_VAR(int) TABSIZE = 0;
++char NCURSES_EXPORT_VAR(ttytype[NAMESIZE]) = "";
++int NCURSES_EXPORT_VAR(LINES) = 0;
++int NCURSES_EXPORT_VAR(COLS) = 0;
++int NCURSES_EXPORT_VAR(TABSIZE) = 0;
+
+ static int _use_env = TRUE;
+
+--- ncurses-5.4/ncurses/tinfo/MKnames.awk~visibility.patch
++++ ncurses-5.4/ncurses/tinfo/MKnames.awk
+@@ -10,7 +10,7 @@
+ print "#include <term.h>" > "namehdr"
+ print "#define DCL(it) static IT data##it[]" > "namehdr"
+ print "#else" > "namehdr"
+- print "#define DCL(it) NCURSES_EXPORT_VAR(IT) it[]" > "namehdr"
++ print "#define DCL(it) IT NCURSES_EXPORT_VAR(it[])" > "namehdr"
+ print "#endif" > "namehdr"
+ print "" > "namehdr"
+ print "/*" > "boolnames"
+--- ncurses-5.4/ncurses/tinfo/lib_tparm.c~visibility.patch
++++ ncurses-5.4/ncurses/tinfo/lib_tparm.c
+@@ -115,7 +115,7 @@
+ bool num_type;
+ } stack_frame;
+
+-NCURSES_EXPORT_VAR(int) _nc_tparm_err = 0;
++int NCURSES_EXPORT_VAR(_nc_tparm_err) = 0;
+
+ static stack_frame stack[STACKSIZE];
+ static int stack_ptr;
+--- ncurses-5.4/ncurses/tinfo/lib_tputs.c~visibility.patch
++++ ncurses-5.4/ncurses/tinfo/lib_tputs.c
+@@ -47,10 +47,10 @@
+
+ MODULE_ID("$Id: lib_tputs.c,v 1.62 2003/08/23 21:39:20 tom Exp $")
+
+-NCURSES_EXPORT_VAR(char) PC = 0; /* used by termcap library */
+-NCURSES_EXPORT_VAR(NCURSES_OSPEED) ospeed = 0; /* used by termcap library */
++char NCURSES_EXPORT_VAR(PC) = 0; /* used by termcap library */
++NCURSES_OSPEED NCURSES_EXPORT_VAR(ospeed) = 0; /* used by termcap library */
+
+-NCURSES_EXPORT_VAR(int) _nc_nulls_sent = 0; /* used by 'tack' program */
++int NCURSES_EXPORT_VAR(_nc_nulls_sent) = 0; /* used by 'tack' program */
+
+ static int (*my_outch) (int c) = _nc_outch;
+
+--- ncurses-5.4/ncurses/tinfo/comp_error.c~visibility.patch
++++ ncurses-5.4/ncurses/tinfo/comp_error.c
+@@ -42,9 +42,9 @@
+
+ MODULE_ID("$Id: comp_error.c,v 1.25 2002/09/07 20:05:07 tom Exp $")
+
+-NCURSES_EXPORT_VAR(bool) _nc_suppress_warnings = FALSE;
+-NCURSES_EXPORT_VAR(int) _nc_curr_line = 0; /* current line # in input */
+-NCURSES_EXPORT_VAR(int) _nc_curr_col = 0; /* current column # in input */
++bool NCURSES_EXPORT_VAR(_nc_suppress_warnings) = FALSE;
++int NCURSES_EXPORT_VAR(_nc_curr_line) = 0; /* current line # in input */
++int NCURSES_EXPORT_VAR(_nc_curr_col) = 0; /* current column # in input */
+
+ static const char *sourcename;
+ static char *termtype;
+--- ncurses-5.4/ncurses/tinfo/free_ttype.c~visibility.patch
++++ ncurses-5.4/ncurses/tinfo/free_ttype.c
+@@ -92,7 +92,7 @@
+ }
+
+ #if NCURSES_XNAMES
+-NCURSES_EXPORT_VAR(bool) _nc_user_definable = TRUE;
++bool NCURSES_EXPORT_VAR(_nc_user_definable) = TRUE;
+
+ NCURSES_EXPORT(int)
+ use_extended_names(bool flag)
+--- ncurses-5.4/ncurses/tinfo/comp_parse.c~visibility.patch
++++ ncurses-5.4/ncurses/tinfo/comp_parse.c
+@@ -78,8 +78,8 @@
+ * _nc_head _nc_tail
+ */
+
+-NCURSES_EXPORT_VAR(ENTRY *) _nc_head = 0;
+-NCURSES_EXPORT_VAR(ENTRY *) _nc_tail = 0;
++ENTRY * NCURSES_EXPORT_VAR(_nc_head) = 0;
++ENTRY * NCURSES_EXPORT_VAR(_nc_tail) = 0;
+
+ static void
+ enqueue(ENTRY * ep)
+--- ncurses-5.4/ncurses/tinfo/comp_scan.c~visibility.patch
++++ ncurses-5.4/ncurses/tinfo/comp_scan.c
+@@ -60,19 +60,13 @@
+
+ #define iswhite(ch) (ch == ' ' || ch == '\t')
+
+-NCURSES_EXPORT_VAR(int)
+-_nc_syntax = 0; /* termcap or terminfo? */
+-NCURSES_EXPORT_VAR(long)
+-_nc_curr_file_pos = 0; /* file offset of current line */
+-NCURSES_EXPORT_VAR(long)
+-_nc_comment_start = 0; /* start of comment range before name */
+-NCURSES_EXPORT_VAR(long)
+-_nc_comment_end = 0; /* end of comment range before name */
+-NCURSES_EXPORT_VAR(long)
+-_nc_start_line = 0; /* start line of current entry */
++int NCURSES_EXPORT_VAR(_nc_syntax) = 0; /* termcap or terminfo? */
++long NCURSES_EXPORT_VAR(_nc_curr_file_pos) = 0; /* file offset of current line */
++long NCURSES_EXPORT_VAR(_nc_comment_start) = 0; /* start of comment range before name */
++long NCURSES_EXPORT_VAR(_nc_comment_end) = 0; /* end of comment range before name */
++long NCURSES_EXPORT_VAR(_nc_start_line) = 0; /* start line of current entry */
+
+-NCURSES_EXPORT_VAR(struct token)
+-_nc_curr_token =
++struct token NCURSES_EXPORT_VAR(_nc_curr_token) =
+ {
+ 0, 0, 0
+ };
+@@ -90,8 +84,7 @@
+ static char *pushname;
+
+ #if NCURSES_EXT_FUNCS
+-NCURSES_EXPORT_VAR(bool)
+-_nc_disable_period = FALSE; /* used by tic -a option */
++bool NCURSES_EXPORT_VAR(_nc_disable_period) = FALSE; /* used by tic -a option */
+ #endif
+
+ static bool end_of_stream(void);
+--- ncurses-5.4/ncurses/tinfo/lib_acs.c~visibility.patch
++++ ncurses-5.4/ncurses/tinfo/lib_acs.c
+@@ -37,8 +37,7 @@
+ MODULE_ID("$Id: lib_acs.c,v 1.25 2002/12/28 16:26:46 tom Exp $")
+
+ #if BROKEN_LINKER
+-NCURSES_EXPORT_VAR(chtype *)
+-_nc_acs_map(void)
++chtype * NCURSES_EXPORT_VAR(_nc_acs_map)(void)
+ {
+ static chtype *the_map = 0;
+ if (the_map == 0)
+@@ -46,7 +45,7 @@
+ return the_map;
+ }
+ #else
+-NCURSES_EXPORT_VAR(chtype) acs_map[ACS_LEN] =
++chtype NCURSES_EXPORT_VAR(acs_map[ACS_LEN]) =
+ {
+ 0
+ };
+--- ncurses-5.4/ncurses/tinfo/lib_data.c~visibility.patch
++++ ncurses-5.4/ncurses/tinfo/lib_data.c
+@@ -46,14 +46,11 @@
+ * OS/2's native linker complains if we don't initialize public data when
+ * constructing a dll (reported by J.J.G.Ripoll).
+ */
+-NCURSES_EXPORT_VAR(WINDOW *)
+-stdscr = 0;
+-NCURSES_EXPORT_VAR(WINDOW *)
+-curscr = 0;
+-NCURSES_EXPORT_VAR(WINDOW *)
+-newscr = 0;
++WINDOW * NCURSES_EXPORT_VAR(stdscr) = 0;
++WINDOW * NCURSES_EXPORT_VAR(curscr) = 0;
++WINDOW * NCURSES_EXPORT_VAR(newscr) = 0;
+
+-NCURSES_EXPORT_VAR(SCREEN *) _nc_screen_chain = 0;
++SCREEN * NCURSES_EXPORT_VAR(_nc_screen_chain) = 0;
+
+ /*
+ * The variable 'SP' will be defined as a function on systems that cannot link
+@@ -87,5 +84,5 @@
+ }
+
+ #else
+-NCURSES_EXPORT_VAR(SCREEN *) SP = NULL; /* Some linkers require initialized data... */
++SCREEN * NCURSES_EXPORT_VAR(SP) = NULL; /* Some linkers require initialized data... */
+ #endif
+--- ncurses-5.4/ncurses/trace/lib_trace.c~visibility.patch
++++ ncurses-5.4/ncurses/trace/lib_trace.c
+@@ -42,11 +42,11 @@
+
+ MODULE_ID("$Id: lib_trace.c,v 1.53 2003/11/23 00:39:30 tom Exp $")
+
+-NCURSES_EXPORT_VAR(unsigned) _nc_tracing = 0; /* always define this */
++unsigned NCURSES_EXPORT_VAR(_nc_tracing) = 0; /* always define this */
+
+ #ifdef TRACE
+-NCURSES_EXPORT_VAR(const char *) _nc_tputs_trace = "";
+-NCURSES_EXPORT_VAR(long) _nc_outchars = 0;
++const char * NCURSES_EXPORT_VAR(_nc_tputs_trace) = "";
++long NCURSES_EXPORT_VAR(_nc_outchars) = 0;
+
+ static FILE *tracefp = 0; /* default to writing to stderr */
+
+--- ncurses-5.4/ncurses/curses.priv.h~visibility.patch
++++ ncurses-5.4/ncurses/curses.priv.h
+@@ -498,7 +498,7 @@
+ #endif
+ };
+
+-extern NCURSES_EXPORT_VAR(SCREEN *) _nc_screen_chain;
++extern SCREEN * NCURSES_EXPORT_VAR(_nc_screen_chain);
+
+ #if NCURSES_NOMACROS
+ #include <nomacros.h>
+@@ -752,9 +752,9 @@
+ extern NCURSES_EXPORT(int) _nc_retrace_int (int);
+ extern NCURSES_EXPORT(unsigned) _nc_retrace_unsigned (unsigned);
+ extern NCURSES_EXPORT(void) _nc_fifo_dump (void);
+-extern NCURSES_EXPORT_VAR(const char *) _nc_tputs_trace;
+-extern NCURSES_EXPORT_VAR(long) _nc_outchars;
+-extern NCURSES_EXPORT_VAR(unsigned) _nc_tracing;
++extern const char * NCURSES_EXPORT_VAR(_nc_tputs_trace);
++extern long NCURSES_EXPORT_VAR(_nc_outchars);
++extern unsigned NCURSES_EXPORT_VAR(_nc_tracing);
+
+ #if USE_WIDEC_SUPPORT
+ extern NCURSES_EXPORT(const char *) _nc_viswbuf2 (int, const wchar_t *);
+@@ -1055,7 +1055,7 @@
+ #endif
+
+ /* scroll indices */
+-extern NCURSES_EXPORT_VAR(int *) _nc_oldnums;
++extern int * NCURSES_EXPORT_VAR(_nc_oldnums);
+
+ #define USE_SETBUF_0 0
+
+@@ -1074,7 +1074,7 @@
+ extern NCURSES_EXPORT(void) _nc_set_screen (SCREEN *);
+ #else
+ /* current screen is private data; avoid possible linking conflicts too */
+-extern NCURSES_EXPORT_VAR(SCREEN *) SP;
++extern SCREEN * NCURSES_EXPORT_VAR(SP);
+ #define _nc_alloc_screen() ((SP = typeCalloc(SCREEN, 1)) != 0)
+ #define _nc_set_screen(sp) SP = sp
+ #endif
+@@ -1087,7 +1087,7 @@
+ #define screen_lines SP->_lines
+ #define screen_columns SP->_columns
+
+-extern NCURSES_EXPORT_VAR(int) _nc_slk_format; /* != 0 if slk_init() called */
++extern int NCURSES_EXPORT_VAR(_nc_slk_format); /* != 0 if slk_init() called */
+ extern NCURSES_EXPORT(int) _nc_slk_initialize (WINDOW *, int);
+
+ /*
+--- /dev/null
++++ ncurses-5.4/m4/cf.m4
+@@ -0,0 +1,3703 @@
++dnl***************************************************************************
++dnl Copyright (c) 1998-2003,2004 Free Software Foundation, Inc. *
++dnl *
++dnl Permission is hereby granted, free of charge, to any person obtaining a *
++dnl copy of this software and associated documentation files (the *
++dnl "Software"), to deal in the Software without restriction, including *
++dnl without limitation the rights to use, copy, modify, merge, publish, *
++dnl distribute, distribute with modifications, sublicense, and/or sell *
++dnl copies of the Software, and to permit persons to whom the Software is *
++dnl furnished to do so, subject to the following conditions: *
++dnl *
++dnl The above copyright notice and this permission notice shall be included *
++dnl in all copies or substantial portions of the Software. *
++dnl *
++dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
++dnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
++dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
++dnl IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
++dnl DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
++dnl OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
++dnl THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
++dnl *
++dnl Except as contained in this notice, the name(s) of the above copyright *
++dnl holders shall not be used in advertising or otherwise to promote the *
++dnl sale, use or other dealings in this Software without prior written *
++dnl authorization. *
++dnl***************************************************************************
++dnl
++dnl Author: Thomas E. Dickey 1995-2003
++dnl
++dnl $Id: aclocal.m4,v 1.333 2004/01/30 20:59:56 tom Exp $
++dnl Macros used in NCURSES auto-configuration script.
++dnl
++dnl See http://invisible-island.net/autoconf/ for additional information.
++dnl
++dnl ---------------------------------------------------------------------------
++dnl ---------------------------------------------------------------------------
++dnl CF_ADA_INCLUDE_DIRS version: 4 updated: 2002/12/01 00:12:15
++dnl -------------------
++dnl Construct the list of include-options for the C programs in the Ada95
++dnl binding.
++AC_DEFUN([CF_ADA_INCLUDE_DIRS],
++[
++ACPPFLAGS="-I. -I../../include $ACPPFLAGS"
++if test "$srcdir" != "."; then
++ ACPPFLAGS="-I\$(srcdir)/../../include $ACPPFLAGS"
++fi
++if test "$GCC" != yes; then
++ ACPPFLAGS="$ACPPFLAGS -I\$(includedir)"
++elif test "$includedir" != "/usr/include"; then
++ if test "$includedir" = '${prefix}/include' ; then
++ if test $prefix != /usr ; then
++ ACPPFLAGS="$ACPPFLAGS -I\$(includedir)"
++ fi
++ else
++ ACPPFLAGS="$ACPPFLAGS -I\$(includedir)"
++ fi
++fi
++AC_SUBST(ACPPFLAGS)
++])dnl
++dnl ---------------------------------------------------------------------------
++dnl CF_ADD_CFLAGS version: 5 updated: 2002/12/01 00:12:15
++dnl -------------
++dnl Copy non-preprocessor flags to $CFLAGS, preprocessor flags to $CPPFLAGS
++dnl The second parameter if given makes this macro verbose.
++AC_DEFUN([CF_ADD_CFLAGS],
++[
++cf_new_cflags=
++cf_new_cppflags=
++for cf_add_cflags in $1
++do
++ case $cf_add_cflags in #(vi
++ -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
++ case "$CPPFLAGS" in
++ *$cf_add_cflags) #(vi
++ ;;
++ *) #(vi
++ cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
++ ;;
++ esac
++ ;;
++ *)
++ cf_new_cflags="$cf_new_cflags $cf_add_cflags"
++ ;;
++ esac
++done
++
++if test -n "$cf_new_cflags" ; then
++ ifelse($2,,,[CF_VERBOSE(add to \$CFLAGS $cf_new_cflags)])
++ CFLAGS="$CFLAGS $cf_new_cflags"
++fi
++
++if test -n "$cf_new_cppflags" ; then
++ ifelse($2,,,[CF_VERBOSE(add to \$CPPFLAGS $cf_new_cppflags)])
++ CPPFLAGS="$cf_new_cppflags $CPPFLAGS"
++fi
++
++])dnl
++dnl ---------------------------------------------------------------------------
++dnl CF_ANSI_CC_CHECK version: 9 updated: 2001/12/30 17:53:34
++dnl ----------------
++dnl This is adapted from the macros 'fp_PROG_CC_STDC' and 'fp_C_PROTOTYPES'
++dnl in the sharutils 4.2 distribution.
++AC_DEFUN([CF_ANSI_CC_CHECK],
++[
++AC_CACHE_CHECK(for ${CC-cc} option to accept ANSI C, cf_cv_ansi_cc,[
++cf_cv_ansi_cc=no
++cf_save_CFLAGS="$CFLAGS"
++cf_save_CPPFLAGS="$CPPFLAGS"
++# Don't try gcc -ansi; that turns off useful extensions and
++# breaks some systems' header files.
++# AIX -qlanglvl=ansi
++# Ultrix and OSF/1 -std1
++# HP-UX -Aa -D_HPUX_SOURCE
++# SVR4 -Xc
++# UnixWare 1.2 (cannot use -Xc, since ANSI/POSIX clashes)
++for cf_arg in "-DCC_HAS_PROTOS" \
++ "" \
++ -qlanglvl=ansi \
++ -std1 \
++ -Ae \
++ "-Aa -D_HPUX_SOURCE" \
++ -Xc
++do
++ CF_ADD_CFLAGS($cf_arg)
++ AC_TRY_COMPILE(
++[
++#ifndef CC_HAS_PROTOS
++#if !defined(__STDC__) || (__STDC__ != 1)
++choke me
++#endif
++#endif
++],[
++ int test (int i, double x);
++ struct s1 {int (*f) (int a);};
++ struct s2 {int (*f) (double a);};],
++ [cf_cv_ansi_cc="$cf_arg"; break])
++done
++CFLAGS="$cf_save_CFLAGS"
++CPPFLAGS="$cf_save_CPPFLAGS"
++])
++
++if test "$cf_cv_ansi_cc" != "no"; then
++if test ".$cf_cv_ansi_cc" != ".-DCC_HAS_PROTOS"; then
++ CF_ADD_CFLAGS($cf_cv_ansi_cc)
++else
++ AC_DEFINE(CC_HAS_PROTOS)
++fi
++fi
++])dnl
++dnl ---------------------------------------------------------------------------
++dnl CF_ANSI_CC_REQD version: 3 updated: 1997/09/06 13:40:44
++dnl ---------------
++dnl For programs that must use an ANSI compiler, obtain compiler options that
++dnl will make it recognize prototypes. We'll do preprocessor checks in other
++dnl macros, since tools such as unproto can fake prototypes, but only part of
++dnl the preprocessor.
++AC_DEFUN([CF_ANSI_CC_REQD],
++[AC_REQUIRE([CF_ANSI_CC_CHECK])
++if test "$cf_cv_ansi_cc" = "no"; then
++ AC_ERROR(
++[Your compiler does not appear to recognize prototypes.
++You have the following choices:
++ a. adjust your compiler options
++ b. get an up-to-date compiler
++ c. use a wrapper such as unproto])
++fi
++])dnl
++dnl ---------------------------------------------------------------------------
++dnl CF_BOOL_DECL version: 8 updated: 2004/01/30 15:51:18
++dnl ------------
++dnl Test if 'bool' is a builtin type in the configured C++ compiler. Some
++dnl older compilers (e.g., gcc 2.5.8) don't support 'bool' directly; gcc
++dnl 2.6.3 does, in anticipation of the ANSI C++ standard.
++dnl
++dnl Treat the configuration-variable specially here, since we're directly
++dnl substituting its value (i.e., 1/0).
++dnl
++dnl $1 is the shell variable to store the result in, if not $cv_cv_builtin_bool
++AC_DEFUN([CF_BOOL_DECL],
++[
++AC_MSG_CHECKING(if we should include stdbool.h)
++
++AC_CACHE_VAL(cf_cv_header_stdbool_h,[
++ AC_TRY_COMPILE([],[bool foo = false],
++ [cf_cv_header_stdbool_h=0],
++ [AC_TRY_COMPILE([
++#ifndef __BEOS__
++#include <stdbool.h>
++#endif
++],[bool foo = false],
++ [cf_cv_header_stdbool_h=1],
++ [cf_cv_header_stdbool_h=0])])])
++
++if test "$cf_cv_header_stdbool_h" = 1
++then AC_MSG_RESULT(yes)
++else AC_MSG_RESULT(no)
++fi
++
++AC_MSG_CHECKING([for builtin bool type])
++
++AC_CACHE_VAL(ifelse($1,,cf_cv_builtin_bool,[$1]),[
++ AC_TRY_COMPILE([
++#include <stdio.h>
++#include <sys/types.h>
++],[bool x = false],
++ [ifelse($1,,cf_cv_builtin_bool,[$1])=1],
++ [ifelse($1,,cf_cv_builtin_bool,[$1])=0])
++ ])
++
++if test "$ifelse($1,,cf_cv_builtin_bool,[$1])" = 1
++then AC_MSG_RESULT(yes)
++else AC_MSG_RESULT(no)
++fi
++])dnl
++dnl ---------------------------------------------------------------------------
++dnl CF_BOOL_SIZE version: 10 updated: 2002/02/23 20:38:31
++dnl ------------
++dnl Test for the size of 'bool' in the configured C++ compiler (e.g., a type).
++dnl Don't bother looking for bool.h, since it's been deprecated.
++dnl
++dnl If the current compiler is C rather than C++, we get the bool definition
++dnl from <stdbool.h>.
++AC_DEFUN([CF_BOOL_SIZE],
++[
++AC_MSG_CHECKING([for size of bool])
++AC_CACHE_VAL(cf_cv_type_of_bool,[
++ rm -f cf_test.out
++ AC_TRY_RUN([
++#include <stdlib.h>
++#include <stdio.h>
++
++#if defined(__cplusplus)
++
++#ifdef HAVE_GXX_BUILTIN_H
++#include <g++/builtin.h>
++#elif HAVE_GPP_BUILTIN_H
++#include <gpp/builtin.h>
++#elif HAVE_BUILTIN_H
++#include <builtin.h>
++#endif
++
++#else
++
++#if $cf_cv_header_stdbool_h
++#include <stdbool.h>
++#endif
++
++#endif
++
++main()
++{
++ FILE *fp = fopen("cf_test.out", "w");
++ if (fp != 0) {
++ bool x = true;
++ if ((bool)(-x) >= 0)
++ fputs("unsigned ", fp);
++ if (sizeof(x) == sizeof(int)) fputs("int", fp);
++ else if (sizeof(x) == sizeof(char)) fputs("char", fp);
++ else if (sizeof(x) == sizeof(short))fputs("short",fp);
++ else if (sizeof(x) == sizeof(long)) fputs("long", fp);
++ fclose(fp);
++ }
++ exit(0);
++}
++ ],
++ [cf_cv_type_of_bool=`cat cf_test.out`
++ if test -z "$cf_cv_type_of_bool"; then
++ cf_cv_type_of_bool=unknown
++ fi],
++ [cf_cv_type_of_bool=unknown],
++ [cf_cv_type_of_bool=unknown])
++ ])
++ rm -f cf_test.out
++AC_MSG_RESULT($cf_cv_type_of_bool)
++if test "$cf_cv_type_of_bool" = unknown ; then
++ case .$NCURSES_BOOL in #(vi
++ .auto|.) NCURSES_BOOL=unsigned;;
++ esac
++ AC_MSG_WARN(Assuming $NCURSES_BOOL for type of bool)
++ cf_cv_type_of_bool=$NCURSES_BOOL
++fi
++])dnl
++dnl ---------------------------------------------------------------------------
++dnl CF_CFG_DEFAULTS version: 6 updated: 2003/07/12 15:15:19
++dnl ---------------
++dnl Determine the default configuration into which we'll install ncurses. This
++dnl can be overridden by the user's command-line options. There's two items to
++dnl look for:
++dnl 1. the prefix (e.g., /usr)
++dnl 2. the header files (e.g., /usr/include/ncurses)
++dnl We'll look for a previous installation of ncurses and use the same defaults.
++dnl
++dnl We don't use AC_PREFIX_DEFAULT, because it gets evaluated too soon, and
++dnl we don't use AC_PREFIX_PROGRAM, because we cannot distinguish ncurses's
++dnl programs from a vendor's.
++AC_DEFUN([CF_CFG_DEFAULTS],
++[
++AC_MSG_CHECKING(for prefix)
++if test "x$prefix" = "xNONE" ; then
++ case "$cf_cv_system_name" in
++ # non-vendor systems don't have a conflict
++ openbsd*|netbsd*|freebsd*|linux*|cygwin*|k*bsd*-gnu)
++ prefix=/usr
++ ;;
++ *) prefix=$ac_default_prefix
++ ;;
++ esac
++fi
++AC_MSG_RESULT($prefix)
++
++if test "x$prefix" = "xNONE" ; then
++AC_MSG_CHECKING(for default include-directory)
++test -n "$verbose" && echo 1>&AC_FD_MSG
++for cf_symbol in \
++ $includedir \
++ $includedir/ncurses \
++ $prefix/include \
++ $prefix/include/ncurses \
++ /usr/local/include \
++ /usr/local/include/ncurses \
++ /usr/include \
++ /usr/include/ncurses
++do
++ cf_dir=`eval echo $cf_symbol`
++ if test -f $cf_dir/curses.h ; then
++ if ( fgrep NCURSES_VERSION $cf_dir/curses.h 2>&1 >/dev/null ) ; then
++ includedir="$cf_symbol"
++ test -n "$verbose" && echo $ac_n " found " 1>&AC_FD_MSG
++ break
++ fi
++ fi
++ test -n "$verbose" && echo " tested $cf_dir" 1>&AC_FD_MSG
++done
++AC_MSG_RESULT($includedir)
++fi
++])dnl
++dnl ---------------------------------------------------------------------------
++dnl CF_CGETENT version: 3 updated: 2000/08/12 23:18:52
++dnl ----------
++dnl Check if the terminal-capability database functions are available. If not,
++dnl ncurses has a much-reduced version.
++AC_DEFUN([CF_CGETENT],[
++AC_MSG_CHECKING(for terminal-capability database functions)
++AC_CACHE_VAL(cf_cv_cgetent,[
++AC_TRY_LINK([
++#include <stdlib.h>],[
++ char temp[128];
++ char *buf = temp;
++ char *db_array = temp;
++ cgetent(&buf, /* int *, */ &db_array, "vt100");
++ cgetcap(buf, "tc", '=');
++ cgetmatch(buf, "tc");
++ ],
++ [cf_cv_cgetent=yes],
++ [cf_cv_cgetent=no])
++])
++AC_MSG_RESULT($cf_cv_cgetent)
++test "$cf_cv_cgetent" = yes && AC_DEFINE(HAVE_BSD_CGETENT)
++])dnl
++dnl ---------------------------------------------------------------------------
++dnl CF_CHECK_CACHE version: 9 updated: 2004/01/30 15:59:13
++dnl --------------
++dnl Check if we're accidentally using a cache from a different machine.
++dnl Derive the system name, as a check for reusing the autoconf cache.
++dnl
++dnl If we've packaged config.guess and config.sub, run that (since it does a
++dnl better job than uname). Normally we'll use AC_CANONICAL_HOST, but allow
++dnl an extra parameter that we may override, e.g., for AC_CANONICAL_SYSTEM
++dnl which is useful in cross-compiles.
++dnl
++dnl Note: we would use $ac_config_sub, but that is one of the places where
++dnl autoconf 2.5x broke compatibility with autoconf 2.13
++AC_DEFUN([CF_CHECK_CACHE],
++[
++if test -f $srcdir/config.guess ; then
++ ifelse([$1],,[AC_CANONICAL_HOST],[$1])
++ system_name="$host_os"
++else
++ system_name="`(uname -s -r) 2>/dev/null`"
++ if test -z "$system_name" ; then
++ system_name="`(hostname) 2>/dev/null`"
++ fi
++fi
++test -n "$system_name" && AC_DEFINE_UNQUOTED(SYSTEM_NAME,"$system_name")
++AC_CACHE_VAL(cf_cv_system_name,[cf_cv_system_name="$system_name"])
++
++test -z "$system_name" && system_name="$cf_cv_system_name"
++test -n "$cf_cv_system_name" && AC_MSG_RESULT(Configuring for $cf_cv_system_name)
++
++if test ".$system_name" != ".$cf_cv_system_name" ; then
++ AC_MSG_RESULT(Cached system name ($system_name) does not agree with actual ($cf_cv_system_name))
++ AC_ERROR("Please remove config.cache and try again.")
++fi
++])dnl
++dnl ---------------------------------------------------------------------------
++dnl CF_CHECK_ERRNO version: 9 updated: 2001/12/30 18:03:23
++dnl --------------
++dnl Check for data that is usually declared in <stdio.h> or <errno.h>, e.g.,
++dnl the 'errno' variable. Define a DECL_xxx symbol if we must declare it
++dnl ourselves.
++dnl
++dnl $1 = the name to check
++AC_DEFUN([CF_CHECK_ERRNO],
++[
++AC_CACHE_CHECK(if external $1 is declared, cf_cv_dcl_$1,[
++ AC_TRY_COMPILE([
++#ifdef HAVE_STDLIB_H
++#include <stdlib.h>
++#endif
++#include <stdio.h>
++#include <sys/types.h>
++#include <errno.h> ],
++ [long x = (long) $1],
++ [cf_cv_dcl_$1=yes],
++ [cf_cv_dcl_$1=no])
++])
++
++if test "$cf_cv_dcl_$1" = no ; then
++ CF_UPPER(cf_result,decl_$1)
++ AC_DEFINE_UNQUOTED($cf_result)
++fi
++
++# It's possible (for near-UNIX clones) that the data doesn't exist
++CF_CHECK_EXTERN_DATA($1,int)
++])dnl
++dnl ---------------------------------------------------------------------------
++dnl CF_CHECK_EXTERN_DATA version: 3 updated: 2001/12/30 18:03:23
++dnl --------------------
++dnl Check for existence of external data in the current set of libraries. If
++dnl we can modify it, it's real enough.
++dnl $1 = the name to check
++dnl $2 = its type
++AC_DEFUN([CF_CHECK_EXTERN_DATA],
++[
++AC_CACHE_CHECK(if external $1 exists, cf_cv_have_$1,[
++ AC_TRY_LINK([
++#undef $1
++extern $2 $1;
++],
++ [$1 = 2],
++ [cf_cv_have_$1=yes],
++ [cf_cv_have_$1=no])
++])
++
++if test "$cf_cv_have_$1" = yes ; then
++ CF_UPPER(cf_result,have_$1)
++ AC_DEFINE_UNQUOTED($cf_result)
++fi
++
++])dnl
++dnl ---------------------------------------------------------------------------
++dnl CF_CPP_PARAM_INIT version: 4 updated: 2001/04/07 22:31:18
++dnl -----------------
++dnl Check if the C++ compiler accepts duplicate parameter initialization. This
++dnl is a late feature for the standard and is not in some recent compilers
++dnl (1999/9/11).
++AC_DEFUN([CF_CPP_PARAM_INIT],
++[
++if test -n "$CXX"; then
++AC_CACHE_CHECK(if $CXX accepts parameter initialization,cf_cv_cpp_param_init,[
++ AC_LANG_SAVE
++ AC_LANG_CPLUSPLUS
++ AC_TRY_RUN([
++class TEST {
++private:
++ int value;
++public:
++ TEST(int x = 1);
++ ~TEST();
++};
++
++TEST::TEST(int x = 1) // some compilers do not like second initializer
++{
++ value = x;
++}
++void main() { }
++],
++ [cf_cv_cpp_param_init=yes],
++ [cf_cv_cpp_param_init=no],
++ [cf_cv_cpp_param_init=unknown])
++ AC_LANG_RESTORE
++])
++fi
++test "$cf_cv_cpp_param_init" = yes && AC_DEFINE(CPP_HAS_PARAM_INIT)
++])dnl
++dnl ---------------------------------------------------------------------------
++dnl CF_CPP_VSCAN_FUNC version: 5 updated: 2001/12/02 01:39:28
++dnl -----------------
++dnl Check if the g++ compiler supports vscan function (not a standard feature).
++AC_DEFUN([CF_CPP_VSCAN_FUNC],
++[
++if test -n "$CXX"; then
++
++AC_LANG_SAVE
++AC_LANG_CPLUSPLUS
++AC_CHECK_HEADERS(strstream.h)
++
++AC_CACHE_CHECK(if $CXX supports vscan function,cf_cv_cpp_vscan_func,[
++ for cf_vscan_func in strstream strstream_cast stdio
++ do
++ case $cf_vscan_func in #(vi
++ stdio) cf_vscan_defs=USE_STDIO_VSCAN ;; #(vi
++ strstream) cf_vscan_defs=USE_STRSTREAM_VSCAN ;;
++ strstream_cast) cf_vscan_defs=USE_STRSTREAM_VSCAN_CAST ;;
++ esac
++ AC_TRY_LINK([
++#include <stdio.h>
++#include <stdarg.h>
++#define $cf_vscan_defs 1
++#if defined(USE_STDIO_VSCAN)
++#elif defined(HAVE_STRSTREAM_H) && defined(USE_STRSTREAM_VSCAN)
++#include <strstream.h>
++#endif
++
++int scanw(const char* fmt, ...)
++{
++ int result = -1;
++ char buf[BUFSIZ];
++
++ va_list args;
++ va_start(args, fmt);
++#if defined(USE_STDIO_VSCAN)
++ if (::vsscanf(buf, fmt, args) != -1)
++ result = 0;
++#elif defined(USE_STRSTREAM_VSCAN)
++ strstreambuf ss(buf, sizeof(buf));
++ if (ss.vscan(fmt, args) != -1)
++ result = 0;
++#elif defined(USE_STRSTREAM_VSCAN_CAST)
++ strstreambuf ss(buf, sizeof(buf));
++ if (ss.vscan(fmt, (_IO_va_list)args) != -1)
++ result = 0;
++#else
++#error case $cf_vscan_func failed
++#endif
++ va_end(args);
++ return result;
++}
++],[int tmp, foo = scanw("%d", &tmp)],
++ [cf_cv_cpp_vscan_func=$cf_vscan_func; break],
++ [cf_cv_cpp_vscan_func=no])
++ test "$cf_cv_cpp_vscan_func" != no && break
++ done
++])
++
++AC_LANG_RESTORE
++fi
++
++case $cf_cv_cpp_vscan_func in #(vi
++stdio) #(vi
++ AC_DEFINE(CPP_HAS_VSCAN_FUNC)
++ AC_DEFINE(USE_STDIO_VSCAN)
++ ;;
++strstream)
++ AC_DEFINE(CPP_HAS_VSCAN_FUNC)
++ AC_DEFINE(USE_STRSTREAM_VSCAN)
++ ;;
++strstream_cast)
++ AC_DEFINE(CPP_HAS_VSCAN_FUNC)
++ AC_DEFINE(USE_STRSTREAM_VSCAN_CAST)
++ ;;
++esac
++])dnl
++dnl ---------------------------------------------------------------------------
++dnl CF_DIRNAME version: 4 updated: 2002/12/21 19:25:52
++dnl ----------
++dnl "dirname" is not portable, so we fake it with a shell script.
++AC_DEFUN([CF_DIRNAME],[$1=`echo $2 | sed -e 's%/[[^/]]*$%%'`])dnl
++dnl ---------------------------------------------------------------------------
++dnl CF_DIRS_TO_MAKE version: 3 updated: 2002/02/23 20:38:31
++dnl ---------------
++AC_DEFUN([CF_DIRS_TO_MAKE],
++[
++DIRS_TO_MAKE="lib"
++for cf_item in $cf_list_models
++do
++ CF_OBJ_SUBDIR($cf_item,cf_subdir)
++ for cf_item2 in $DIRS_TO_MAKE
++ do
++ test $cf_item2 = $cf_subdir && break
++ done
++ test ".$cf_item2" != ".$cf_subdir" && DIRS_TO_MAKE="$DIRS_TO_MAKE $cf_subdir"
++done
++for cf_dir in $DIRS_TO_MAKE
++do
++ test ! -d $cf_dir && mkdir $cf_dir
++done
++AC_SUBST(DIRS_TO_MAKE)
++])dnl
++dnl ---------------------------------------------------------------------------
++dnl CF_ERRNO version: 5 updated: 1997/11/30 12:44:39
++dnl --------
++dnl Check if 'errno' is declared in <errno.h>
++AC_DEFUN([CF_ERRNO],
++[
++CF_CHECK_ERRNO(errno)
++])dnl
++dnl ---------------------------------------------------------------------------
++dnl CF_ETIP_DEFINES version: 3 updated: 2003/03/22 19:13:43
++dnl ---------------
++dnl Test for conflicting definitions of exception in gcc 2.8.0, etc., between
++dnl math.h and builtin.h, only for ncurses
++AC_DEFUN([CF_ETIP_DEFINES],
++[
++AC_MSG_CHECKING(for special defines needed for etip.h)
++cf_save_CXXFLAGS="$CXXFLAGS"
++cf_result="none"
++for cf_math in "" MATH_H
++do
++for cf_excp in "" MATH_EXCEPTION
++do
++ CXXFLAGS="$cf_save_CXXFLAGS -I${srcdir}/c++ -I${srcdir}/menu -I${srcdir}/include"
++ test -n "$cf_math" && CXXFLAGS="$CXXFLAGS -DETIP_NEEDS_${cf_math}"
++ test -n "$cf_excp" && CXXFLAGS="$CXXFLAGS -DETIP_NEEDS_${cf_excp}"
++AC_TRY_COMPILE([
++#include <etip.h.in>
++],[],[
++ test -n "$cf_math" && AC_DEFINE_UNQUOTED(ETIP_NEEDS_${cf_math})
++ test -n "$cf_excp" && AC_DEFINE_UNQUOTED(ETIP_NEEDS_${cf_excp})
++ cf_result="$cf_math $cf_excp"
++ break
++],[])
++done
++done
++AC_MSG_RESULT($cf_result)
++CXXFLAGS="$cf_save_CXXFLAGS"
++])
++dnl ---------------------------------------------------------------------------
++dnl CF_FUNC_MEMMOVE version: 5 updated: 2000/08/12 23:18:52
++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);
++ exit (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_POLL version: 2 updated: 2000/02/06 01:38:04
++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);
++ exit(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: 9 updated: 2002/12/21 19:25:52
++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__ "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
++ 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
++ scanf|printf)
++ cat >conftest.h <<EOF
++#define GCC_$CF_ATTRIBUTE 1
++EOF
++ ;;
++ *)
++ 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
++ fi
++ done
++else
++ fgrep define conftest.i >>confdefs.h
++fi
++rm -rf conftest*
++fi
++])dnl
++dnl ---------------------------------------------------------------------------
++dnl CF_GCC_VERSION version: 3 updated: 2003/09/06 19:16:57
++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|sed -e '2,$d' -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: 15 updated: 2003/07/05 18:42:30
++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
++AC_DEFUN([CF_GCC_WARNINGS],
++[
++AC_REQUIRE([CF_GCC_VERSION])
++if test "$GCC" = yes
++then
++ cat > conftest.$ac_ext <<EOF
++#line __oline__ "configure"
++int main(int argc, char *argv[[]]) { return (argv[[argc-1]] == 0) ; }
++EOF
++ AC_CHECKING([for $CC warning options])
++ cf_save_CFLAGS="$CFLAGS"
++ EXTRA_CFLAGS="-W -Wall"
++ cf_warn_CONST=""
++ test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
++ for cf_opt in \
++ Wbad-function-cast \
++ Wcast-align \
++ Wcast-qual \
++ Winline \
++ Wmissing-declarations \
++ Wmissing-prototypes \
++ Wnested-externs \
++ Wpointer-arith \
++ Wshadow \
++ Wstrict-prototypes \
++ Wundef $cf_warn_CONST
++ 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
++ 3.3*)
++ CF_VERBOSE(feature is broken in gcc $GCC_VERSION)
++ continue;;
++ esac
++ ;;
++ esac
++ EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
++ fi
++ done
++ rm -f conftest*
++ CFLAGS="$cf_save_CFLAGS"
++fi
++AC_SUBST(EXTRA_CFLAGS)
++])dnl
++dnl ---------------------------------------------------------------------------
++dnl CF_GNAT_TRY_RUN version: 2 updated: 1998/07/19 00:25:18
++dnl ---------------
++dnl Verify that a test program compiles and runs with GNAT
++dnl $cf_ada_make is set to the program that compiles/links
++AC_DEFUN([CF_GNAT_TRY_RUN],
++[
++rm -f conftest*
++cat >>conftest.ads <<CF_EOF
++$1
++CF_EOF
++cat >>conftest.adb <<CF_EOF
++$2
++CF_EOF
++if ( $cf_ada_make 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 -f conftest*
++])dnl
++dnl ---------------------------------------------------------------------------
++dnl CF_GNAT_VERSION version: 11 updated: 2003/09/06 19:42:09
++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
++ 3.1[[1-9]]*|3.[[2-9]]*|[[4-9]].*)
++ cf_cv_prog_gnat_correct=yes
++ ;;
++ *) echo Unsupported GNAT version $cf_gnat_version. Required is 3.11 or better. Disabling Ada95 binding.
++ cf_cv_prog_gnat_correct=no
++ ;;
++esac
++case $cf_gnat_version in
++ 3.[[1-9]]*|[[4-9]].*)
++ cf_compile_generics=generics
++ cf_generic_objects="\$(GENOBJS)"
++ ;;
++ *) cf_compile_generics=
++ cf_generic_objects=
++ ;;
++esac
++])
++dnl ---------------------------------------------------------------------------
++dnl CF_GNU_SOURCE version: 3 updated: 2000/10/29 23:30:53
++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: 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: 3 updated: 2003/09/06 19:16:21
++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'`"
++ AC_MSG_RESULT($GXX_VERSION)
++fi
++])dnl
++dnl ---------------------------------------------------------------------------
++dnl CF_INCLUDE_DIRS version: 4 updated: 2002/12/01 00:12: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_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_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: 7 updated: 2001/01/12 01:23:48
++dnl -------------
++dnl Compute the library-prefix for the given host system
++dnl $1 = variable to set
++AC_DEFUN([CF_LIB_PREFIX],
++[
++ case $cf_cv_system_name in
++ OS/2*) LIB_PREFIX='' ;;
++ os2*) LIB_PREFIX='' ;;
++ *) LIB_PREFIX='lib' ;;
++ esac
++ifelse($1,,,[$1=$LIB_PREFIX])
++ AC_SUBST(LIB_PREFIX)
++])dnl
++dnl ---------------------------------------------------------------------------
++dnl CF_LIB_RULES version: 30 updated: 2004/01/10 15:50:50
++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 LIBRARIES 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])
++for cf_dir in $SRC_SUBDIRS
++do
++ if test -f $srcdir/$cf_dir/modules; then
++
++ IMPORT_LIB=
++ SHARED_LIB=
++ LIBS_TO_MAKE=
++ for cf_item in $CF_LIST_MODELS
++ do
++ CF_LIB_SUFFIX($cf_item,cf_suffix)
++ 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*) cf_suffix='.$(REL_VERSION)'"$cf_suffix" ;; #(vi
++ *) cf_suffix="$cf_suffix"'.$(REL_VERSION)' ;;
++ esac
++ ;;
++ abi)
++ case "$cf_cv_system_name" in #(vi
++ darwin*) cf_suffix='.$(ABI_VERSION)'"$cf_suffix" ;; #(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
++ SHARED_LIB="../lib/cyg${cf_dir}\$(ABI_VERSION).dll"
++ IMPORT_LIB="../lib/${cf_prefix}${cf_dir}.dll.a"
++ LIBS_TO_MAKE="$LIBS_TO_MAKE \$(SHARED_LIB) \$(IMPORT_LIB)"
++ 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_termlib=`echo "$cf_subsets" |sed -e 's/ .*$//'`
++ if test "$cf_termlib" != "$cf_subsets" ; then
++ cf_item=`echo $LIBS_TO_MAKE |sed -e s%$LIB_NAME%$TINFO_NAME%g`
++ LIBS_TO_MAKE="$cf_item $LIBS_TO_MAKE"
++ fi
++ else
++ cf_subsets=`echo "$LIB_SUBSETS" | sed -e 's/^termlib.* //'`
++ fi
++
++ sed -e "s%@LIBS_TO_MAKE@%$LIBS_TO_MAKE%" \
++ -e "s%@IMPORT_LIB@%$IMPORT_LIB%" \
++ -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_OBJ_SUBDIR($cf_item,cf_subdir)
++
++ # 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
++
++ $AWK -f $srcdir/mk-1st.awk \
++ name=$cf_dir \
++ traces=$LIB_TRACING \
++ MODEL=$CF_ITEM \
++ model=$cf_subdir \
++ prefix=$cf_prefix \
++ suffix=$cf_suffix \
++ subset=$cf_subset \
++ ShlibVer=$cf_cv_shlib_version \
++ ShlibVerInfix=$cf_cv_shlib_version_infix \
++ 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
++ 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 \
++ $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 -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.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
++ 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 -f $srcdir/$cf_dir/headers; then
++ cat >>$cf_dir/Makefile <<CF_EOF
++\$(DESTDIR)\$(includedir) :
++ sh \$(srcdir)/../mkinstalldirs \[$]@
++
++install \\
++install.libs \\
++install.includes :: \$(AUTO_SRC) \$(DESTDIR)\$(includedir) \\
++CF_EOF
++ j=""
++ for i in `cat $srcdir/$cf_dir/headers |fgrep -v "#"`
++ do
++ test -n "$j" && echo " $j \\" >>$cf_dir/Makefile
++ j=$i
++ done
++ echo " $j" >>$cf_dir/Makefile
++ for i in `cat $srcdir/$cf_dir/headers |fgrep -v "#"`
++ do
++ echo " @ (cd \$(DESTDIR)\$(includedir) && rm -f `basename $i`) ; ../headers.sh \$(INSTALL_DATA) \$(DESTDIR)\$(includedir) \$(srcdir) $i" >>$cf_dir/Makefile
++ test $i = curses.h && test $WITH_CURSES_H = yes && echo " @ (cd \$(DESTDIR)\$(includedir) && rm -f ncurses.h && \$(LN_S) curses.h ncurses.h)" >>$cf_dir/Makefile
++ done
++
++ cat >>$cf_dir/Makefile <<CF_EOF
++
++uninstall \\
++uninstall.libs \\
++uninstall.includes ::
++CF_EOF
++ for i in `cat $srcdir/$cf_dir/headers |fgrep -v "#"`
++ do
++ i=`basename $i`
++ echo " -@ (cd \$(DESTDIR)\$(includedir) && rm -f $i)" >>$cf_dir/Makefile
++ test $i = curses.h && echo " -@ (cd \$(DESTDIR)\$(includedir) && rm -f ncurses.h)" >>$cf_dir/Makefile
++ done
++ 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_SUFFIX version: 13 updated: 2003/11/01 16:09:07
++dnl -------------
++dnl Compute the library file-suffix 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_SUFFIX],
++[
++ AC_REQUIRE([CF_SUBST_NCURSES_VERSION])
++ case $1 in
++ libtool) $2='.la' ;;
++ normal) $2='.a' ;;
++ debug) $2='_g.a' ;;
++ profile) $2='_p.a' ;;
++ shared)
++ case $cf_cv_system_name in
++ cygwin*) $2='.dll' ;;
++ darwin*) $2='.dylib' ;;
++ hpux*)
++ case $target in
++ ia64*) $2='.so' ;;
++ *) $2='.sl' ;;
++ esac
++ ;;
++ *) $2='.so' ;;
++ esac
++ esac
++ test -n "$LIB_SUFFIX" && $2="${LIB_SUFFIX}[$]{$2}"
++])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: 6 updated: 2003/02/02 01:41:46
++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)
++ exit(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();
++ exit (!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: 5 updated: 2003/02/02 01:41:46
++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
++ exit (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_MAKEFLAGS version: 9 updated: 2001/12/30 18:17:27
++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`
++ 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 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: 6 updated: 2002/01/19 22:51:32
++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 >man/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
++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: 27 updated: 2003/12/20 20:39:45
++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_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*) #(vi
++ cf_so_strip="gz"
++ cf_compress=gzip
++ ;;
++esac
++
++cf_edit_man=man/edit_man.sh
++
++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_OSPEED="$NCURSES_OSPEED"
++TERMINFO="$TERMINFO"
++MKDIRS="sh `cd $srcdir && pwd`/mkinstalldirs"
++INSTALL="$INSTALL"
++INSTALL_DATA="$INSTALL_DATA"
++transform="$program_transform_name"
++
++TMP=\${TMPDIR-/tmp}/man\$\$
++trap "rm -f \$TMP" 0 1 2 5 15
++
++form=\[$]1
++shift || exit 1
++
++verb=\[$]1
++shift || exit 1
++
++mandir=\[$]1
++shift || exit 1
++
++srcdir=\[$]1
++shift || exit 1
++
++if test "\$form" = normal ; then
++ if test "$cf_format" = yes ; then
++ if test "$cf_inboth" = no ; then
++ sh \[$]0 format \$verb \$mandir \$srcdir \[$]*
++ exit $?
++ fi
++ fi
++ cf_subdir=\$mandir/man
++ cf_tables=$MANPAGE_TBL
++else
++ cf_subdir=\$mandir/cat
++ cf_tables=yes
++fi
++
++# process the list of source-files
++for i in \[$]* ; do
++case \$i in #(vi
++*.orig|*.rej) ;; #(vi
++*.[[0-9]]*)
++ section=\`expr "\$i" : '.*\\.\\([[0-9]]\\)[[xm]]*'\`;
++ if test \$verb = installing ; then
++ if test ! -d \$cf_subdir\${section} ; then
++ \$MKDIRS \$cf_subdir\$section
++ fi
++ fi
++ aliases=
++ source=\`basename \$i\`
++ inalias=\$source
++ test ! -f \$inalias && inalias="\$srcdir/\$inalias"
++ if test ! -f \$inalias ; then
++ echo .. skipped \$source
++ continue
++ fi
++CF_EOF
++
++if test "$MANPAGE_ALIASES" != no ; then
++cat >>$cf_edit_man <<CF_EOF
++ aliases=\`sed -f \$srcdir/manlinks.sed \$inalias | sort -u\`
++CF_EOF
++fi
++
++if test "$MANPAGE_RENAMES" = no ; then
++cat >>$cf_edit_man <<CF_EOF
++ # perform program transformations for section 1 man pages
++ if test \$section = 1 ; then
++ target=\$cf_subdir\${section}/\`echo \$source|sed "\${transform}"\`
++ else
++ target=\$cf_subdir\${section}/\$source
++ fi
++CF_EOF
++else
++cat >>$cf_edit_man <<CF_EOF
++ target=\`grep "^\$source" $MANPAGE_RENAMES | $AWK '{print \[$]2}'\`
++ if test -z "\$target" ; then
++ echo '? missing rename for '\$source
++ target="\$source"
++ fi
++ target="\$cf_subdir\${section}/\${target}"
++CF_EOF
++fi
++
++ # replace variables in man page
++ ifelse($1,,,[
++ for cf_name in $1
++ do
++cat >>$cf_edit_man <<CF_EOF
++ prog_$cf_name=\`echo $cf_name|sed "\${transform}"\`
++CF_EOF
++ done
++ ])
++cat >>$cf_edit_man <<CF_EOF
++ sed -e "s,@DATADIR@,\$datadir," \\
++ -e "s,@TERMINFO@,\$TERMINFO," \\
++ -e "s,@NCURSES_OSPEED@,\$NCURSES_OSPEED," \\
++CF_EOF
++
++ ifelse($1,,,[
++ for cf_name in $1
++ do
++ cf_NAME=`echo "$cf_name" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
++cat >>$cf_edit_man <<CF_EOF
++ -e "s,@$cf_NAME@,\$prog_$cf_name," \\
++CF_EOF
++ done
++ ])
++
++if test -f $MANPAGE_RENAMES ; then
++cat >>$cf_edit_man <<CF_EOF
++ < \$i | sed -f $srcdir/edit_man.sed >\$TMP
++CF_EOF
++else
++cat >>$cf_edit_man <<CF_EOF
++ < \$i >\$TMP
++CF_EOF
++fi
++
++cat >>$cf_edit_man <<CF_EOF
++if test \$cf_tables = yes ; then
++ tbl \$TMP >\$TMP.out
++ mv \$TMP.out \$TMP
++fi
++CF_EOF
++
++if test $with_curses_h != yes ; then
++cat >>$cf_edit_man <<CF_EOF
++ sed -e "/\#[ ]*include/s,curses.h,ncurses.h," < \$TMP >\$TMP.out
++ mv \$TMP.out \$TMP
++CF_EOF
++fi
++
++cat >>$cf_edit_man <<CF_EOF
++ if test \$form = format ; then
++ nroff -man \$TMP >\$TMP.out
++ mv \$TMP.out \$TMP
++ fi
++CF_EOF
++
++if test -n "$cf_compress" ; then
++cat >>$cf_edit_man <<CF_EOF
++ if test \$verb = installing ; then
++ if ( $cf_compress -f \$TMP )
++ then
++ mv \$TMP.$cf_so_strip \$TMP
++ fi
++ fi
++ target="\$target.$cf_so_strip"
++CF_EOF
++fi
++
++case "$MANPAGE_FORMAT" in #(vi
++*BSDI*)
++cat >>$cf_edit_man <<CF_EOF
++ if test \$form = format ; then
++ # BSDI installs only .0 suffixes in the cat directories
++ target="\`echo \$target|sed -e 's/\.[[1-9]]\+[[a-z]]*/.0/'\`"
++ fi
++CF_EOF
++ ;;
++esac
++
++cat >>$cf_edit_man <<CF_EOF
++ suffix=\`basename \$target | sed -e 's%^[[^.]]*%%'\`
++ if test \$verb = installing ; then
++ echo \$verb \$target
++ \$INSTALL_DATA \$TMP \$target
++ test -n "\$aliases" && (
++ cd \$cf_subdir\${section} && (
++ source=\`echo \$target |sed -e 's%^.*/\([[^/]][[^/]]*/[[^/]][[^/]]*$\)%\1%'\`
++ test -n "$cf_so_strip" && source=\`echo \$source |sed -e 's%\.$cf_so_strip\$%%'\`
++ target=\`basename \$target\`
++ for cf_alias in \$aliases
++ do
++ if test \$section = 1 ; then
++ cf_alias=\`echo \$cf_alias|sed "\${transform}"\`
++ fi
++
++ if test "$MANPAGE_SYMLINKS" = yes ; then
++ if test -f \$cf_alias\${suffix} ; then
++ if ( cmp -s \$target \$cf_alias\${suffix} )
++ then
++ continue
++ fi
++ fi
++ echo .. \$verb alias \$cf_alias\${suffix}
++ rm -f \$cf_alias\${suffix}
++ $LN_S \$target \$cf_alias\${suffix}
++ elif test "\$target" != "\$cf_alias\${suffix}" ; then
++ echo ".so \$source" >\$TMP
++CF_EOF
++if test -n "$cf_compress" ; then
++cat >>$cf_edit_man <<CF_EOF
++ if test -n "$cf_so_strip" ; then
++ $cf_compress -f \$TMP
++ mv \$TMP.$cf_so_strip \$TMP
++ fi
++CF_EOF
++fi
++cat >>$cf_edit_man <<CF_EOF
++ echo .. \$verb alias \$cf_alias\${suffix}
++ rm -f \$cf_alias\${suffix}
++ \$INSTALL_DATA \$TMP \$cf_alias\${suffix}
++ fi
++ done
++ )
++ )
++ elif test \$verb = removing ; then
++ echo \$verb \$target
++ rm -f \$target
++ test -n "\$aliases" && (
++ cd \$cf_subdir\${section} && (
++ for cf_alias in \$aliases
++ do
++ if test \$section = 1 ; then
++ cf_alias=\`echo \$cf_alias|sed "\${transform}"\`
++ fi
++
++ echo .. \$verb alias \$cf_alias\${suffix}
++ rm -f \$cf_alias\${suffix}
++ done
++ )
++ )
++ else
++# echo ".hy 0"
++ cat \$TMP
++ fi
++ ;;
++esac
++done
++
++if test $cf_inboth = yes ; then
++if test \$form != format ; then
++ sh \[$]0 format \$verb \$mandir \$srcdir \[$]*
++fi
++fi
++
++exit 0
++CF_EOF
++chmod 755 $cf_edit_man
++
++])dnl
++dnl ---------------------------------------------------------------------------
++dnl CF_MATH_LIB version: 5 updated: 2000/05/28 01:39:10
++dnl -----------
++dnl Checks for libraries. At least one UNIX system, Apple Macintosh
++dnl Rhapsody 5.5, does not have -lm. We cannot use the simpler
++dnl AC_CHECK_LIB(m,sin), because that fails for C++.
++AC_DEFUN([CF_MATH_LIB],
++[
++AC_CACHE_CHECK(if -lm needed for math functions,
++ cf_cv_need_libm,[
++ AC_TRY_LINK([
++ #include <stdio.h>
++ #include <math.h>
++ ],
++ [double x = rand(); printf("result = %g\n", ]ifelse($2,,sin(x),$2)[)],
++ [cf_cv_need_libm=no],
++ [cf_cv_need_libm=yes])])
++if test "$cf_cv_need_libm" = yes
++then
++ifelse($1,,[
++ LIBS="$LIBS -lm"
++],[$1=-lm])
++fi
++])
++dnl ---------------------------------------------------------------------------
++dnl CF_MIXEDCASE_FILENAMES version: 3 updated: 2003/09/20 17:07:55
++dnl ----------------------
++dnl Check if the file-system supports mixed-case filenames. If we're able to
++dnl create a lowercase name and see it as uppercase, it doesn't support that.
++AC_DEFUN([CF_MIXEDCASE_FILENAMES],
++[
++AC_CACHE_CHECK(if filesystem supports mixed-case filenames,cf_cv_mixedcase,[
++if test "$cross_compiling" = yes ; then
++ case $target_alias in #(vi
++ *-os2-emx*|*-msdosdjgpp*|*-cygwin*|*-mingw32*|*-uwin*) #(vi
++ cf_cv_mixedcase=no
++ ;;
++ *)
++ cf_cv_mixedcase=yes
++ ;;
++ esac
++else
++ rm -f conftest CONFTEST
++ echo test >conftest
++ if test -f CONFTEST ; then
++ cf_cv_mixedcase=no
++ else
++ cf_cv_mixedcase=yes
++ fi
++ rm -f conftest CONFTEST
++fi
++])
++test "$cf_cv_mixedcase" = yes && AC_DEFINE(MIXEDCASE_FILENAMES)
++])dnl
++dnl ---------------------------------------------------------------------------
++dnl CF_MKSTEMP version: 3 updated: 2001/11/08 20:59:59
++dnl ----------
++dnl Check for a working mkstemp. This creates two files, checks that they are
++dnl successfully created and distinct (AmigaOS apparently fails on the last).
++AC_DEFUN([CF_MKSTEMP],[
++AC_CACHE_CHECK(for working mkstemp, cf_cv_func_mkstemp,[
++rm -f conftest*
++AC_TRY_RUN([
++#include <sys/types.h>
++#include <stdlib.h>
++#include <stdio.h>
++#include <string.h>
++#include <sys/stat.h>
++int main()
++{
++ char *tmpl = "conftestXXXXXX";
++ char name[2][80];
++ int n;
++ int result = 0;
++ int fd;
++ struct stat sb;
++
++ umask(077);
++ for (n = 0; n < 2; ++n) {
++ strcpy(name[n], tmpl);
++ if ((fd = mkstemp(name[n])) >= 0) {
++ if (!strcmp(name[n], tmpl)
++ || stat(name[n], &sb) != 0
++ || (sb.st_mode & S_IFMT) != S_IFREG
++ || (sb.st_mode & 077) != 0) {
++ result = 1;
++ }
++ close(fd);
++ }
++ }
++ if (result == 0
++ && !strcmp(name[0], name[1]))
++ result = 1;
++ exit(result);
++}
++],[cf_cv_func_mkstemp=yes
++],[cf_cv_func_mkstemp=no
++],[AC_CHECK_FUNC(mkstemp)
++])
++])
++if test "$cf_cv_func_mkstemp" = yes ; then
++ AC_DEFINE(HAVE_MKSTEMP)
++fi
++])dnl
++dnl ---------------------------------------------------------------------------
++dnl CF_NUMBER_SYNTAX version: 1 updated: 2003/09/20 18:12:49
++dnl ----------------
++dnl Check if the given variable is a number. If not, report an error.
++dnl $1 is the variable
++dnl $2 is the message
++AC_DEFUN([CF_NUMBER_SYNTAX],[
++if test -n "$1" ; then
++ case $1 in #(vi
++ [[0-9]]*) #(vi
++ ;;
++ *)
++ AC_MSG_ERROR($2 is not a number: $1)
++ ;;
++ esac
++else
++ AC_MSG_ERROR($2 value is empty)
++fi
++])dnl
++dnl ---------------------------------------------------------------------------
++dnl CF_OBJ_SUBDIR version: 4 updated: 2002/02/23 20:38:31
++dnl -------------
++dnl Compute the object-directory name from the given model name
++AC_DEFUN([CF_OBJ_SUBDIR],
++[
++ case $1 in
++ libtool) $2='obj_lo' ;;
++ normal) $2='objects' ;;
++ debug) $2='obj_g' ;;
++ profile) $2='obj_p' ;;
++ shared)
++ case $cf_cv_system_name in #(vi
++ cygwin) #(vi
++ $2='objects' ;;
++ *)
++ $2='obj_s' ;;
++ esac
++ esac
++])dnl
++dnl ---------------------------------------------------------------------------
++dnl CF_PATHSEP version: 3 updated: 2001/01/12 01:23:53
++dnl ----------
++dnl Provide a value for the $PATH and similar separator
++AC_DEFUN([CF_PATHSEP],
++[
++ case $cf_cv_system_name in
++ os2*) PATHSEP=';' ;;
++ *) PATHSEP=':' ;;
++ esac
++ifelse($1,,,[$1=$PATHSEP])
++ AC_SUBST(PATHSEP)
++])dnl
++dnl ---------------------------------------------------------------------------
++dnl CF_PATH_SYNTAX version: 9 updated: 2002/09/17 23:03:38
++dnl --------------
++dnl Check the argument to see that it looks like a pathname. Rewrite it if it
++dnl begins with one of the prefix/exec_prefix variables, and then again if the
++dnl result begins with 'NONE'. This is necessary to work around autoconf's
++dnl delayed evaluation of those symbols.
++AC_DEFUN([CF_PATH_SYNTAX],[
++case ".[$]$1" in #(vi
++.\[$]\(*\)*|.\'*\'*) #(vi
++ ;;
++..|./*|.\\*) #(vi
++ ;;
++.[[a-zA-Z]]:[[\\/]]*) #(vi OS/2 EMX
++ ;;
++.\[$]{*prefix}*) #(vi
++ eval $1="[$]$1"
++ case ".[$]$1" in #(vi
++ .NONE/*)
++ $1=`echo [$]$1 | sed -e s%NONE%$ac_default_prefix%`
++ ;;
++ esac
++ ;; #(vi
++.NONE/*)
++ $1=`echo [$]$1 | sed -e s%NONE%$ac_default_prefix%`
++ ;;
++*)
++ ifelse($2,,[AC_ERROR([expected a pathname, not \"[$]$1\"])],$2)
++ ;;
++esac
++])dnl
++dnl ---------------------------------------------------------------------------
++dnl CF_PREDEFINE version: 1 updated: 2003/07/26 17:53:56
++dnl ------------
++dnl Add definitions to CPPFLAGS to ensure they're predefined for all compiles.
++dnl
++dnl $1 = symbol to test
++dnl $2 = value (if any) to use for a predefinition
++AC_DEFUN([CF_PREDEFINE],
++[
++AC_MSG_CHECKING(if we must define $1)
++AC_TRY_COMPILE([#include <sys/types.h>
++],[
++#ifndef $1
++make an error
++#endif],[cf_result=no],[cf_result=yes])
++AC_MSG_RESULT($cf_result)
++
++if test "$cf_result" = yes ; then
++ CPPFLAGS="$CPPFLAGS ifelse($2,,-D$1,[-D$1=$2])"
++elif test "x$2" != "x" ; then
++ AC_MSG_CHECKING(checking for compatible value versus $2)
++ AC_TRY_COMPILE([#include <sys/types.h>
++],[
++#if $1-$2 < 0
++make an error
++#endif],[cf_result=yes],[cf_result=no])
++ AC_MSG_RESULT($cf_result)
++ if test "$cf_result" = no ; then
++ # perhaps we can override it - try...
++ CPPFLAGS="$CPPFLAGS -D$1=$2"
++ fi
++fi
++])dnl
++dnl ---------------------------------------------------------------------------
++dnl CF_PROG_EXT version: 10 updated: 2004/01/03 19:28:18
++dnl -----------
++dnl Compute $PROG_EXT, used for non-Unix ports, such as OS/2 EMX.
++AC_DEFUN([CF_PROG_EXT],
++[
++AC_REQUIRE([CF_CHECK_CACHE])
++case $cf_cv_system_name in
++os2*)
++ CFLAGS="$CFLAGS -Zmt"
++ CPPFLAGS="$CPPFLAGS -D__ST_MT_ERRNO__"
++ CXXFLAGS="$CXXFLAGS -Zmt"
++ # autoconf's macro sets -Zexe and suffix both, which conflict:w
++ LDFLAGS="$LDFLAGS -Zmt -Zcrtdll"
++ ac_cv_exeext=.exe
++ ;;
++esac
++
++AC_EXEEXT
++AC_OBJEXT
++
++PROG_EXT="$EXEEXT"
++AC_SUBST(PROG_EXT)
++test -n "$PROG_EXT" && AC_DEFINE_UNQUOTED(PROG_EXT,"$PROG_EXT")
++])dnl
++dnl ---------------------------------------------------------------------------
++dnl CF_PROG_INSTALL version: 5 updated: 2002/12/21 22:46:07
++dnl ---------------
++dnl Force $INSTALL to be an absolute-path. Otherwise, edit_man.sh and the
++dnl misc/tabset install won't work properly. Usually this happens only when
++dnl using the fallback mkinstalldirs script
++AC_DEFUN([CF_PROG_INSTALL],
++[AC_PROG_INSTALL
++case $INSTALL in
++/*)
++ ;;
++*)
++ CF_DIRNAME(cf_dir,$INSTALL)
++ test -z "$cf_dir" && cf_dir=.
++ INSTALL=`cd $cf_dir && pwd`/`echo $INSTALL | sed -e 's%^.*/%%'`
++ ;;
++esac
++])dnl
++dnl ---------------------------------------------------------------------------
++dnl CF_PROG_LDCONFIG version: 1 updated: 2003/09/20 17:07:55
++dnl ----------------
++dnl Check for ldconfig, needed to fixup shared libraries that would be built
++dnl and then used in the install.
++AC_DEFUN([CF_PROG_LDCONFIG],[
++if test "$cross_compiling" = yes ; then
++ LDCONFIG=:
++else
++case "$cf_cv_system_name" in #(vi
++freebsd*) #(vi
++ test -z "$LDCONFIG" && LDCONFIG="/sbin/ldconfig -R"
++ ;;
++*) LDPATH=$PATH:/sbin:/usr/sbin
++ AC_PATH_PROG(LDCONFIG,ldconfig,,$LDPATH)
++ ;;
++esac
++fi
++AC_SUBST(LDCONFIG)
++])dnl
++dnl ---------------------------------------------------------------------------
++dnl CF_REGEX version: 3 updated: 1997/11/01 14:26:01
++dnl --------
++dnl Attempt to determine if we've got one of the flavors of regular-expression
++dnl code that we can support.
++AC_DEFUN([CF_REGEX],
++[
++AC_MSG_CHECKING([for regular-expression headers])
++AC_CACHE_VAL(cf_cv_regex,[
++AC_TRY_LINK([#include <sys/types.h>
++#include <regex.h>],[
++ regex_t *p;
++ int x = regcomp(p, "", 0);
++ int y = regexec(p, "", 0, 0, 0);
++ regfree(p);
++ ],[cf_cv_regex="regex.h"],[
++ AC_TRY_LINK([#include <regexp.h>],[
++ char *p = compile("", "", "", 0);
++ int x = step("", "");
++ ],[cf_cv_regex="regexp.h"],[
++ cf_save_LIBS="$LIBS"
++ LIBS="-lgen $LIBS"
++ AC_TRY_LINK([#include <regexpr.h>],[
++ char *p = compile("", "", "");
++ int x = step("", "");
++ ],[cf_cv_regex="regexpr.h"],[LIBS="$cf_save_LIBS"])])])
++])
++AC_MSG_RESULT($cf_cv_regex)
++case $cf_cv_regex in
++ regex.h) AC_DEFINE(HAVE_REGEX_H_FUNCS) ;;
++ regexp.h) AC_DEFINE(HAVE_REGEXP_H_FUNCS) ;;
++ regexpr.h) AC_DEFINE(HAVE_REGEXPR_H_FUNCS) ;;
++esac
++])dnl
++dnl ---------------------------------------------------------------------------
++dnl CF_SHARED_OPTS version: 30 updated: 2003/12/27 20:48:07
++dnl --------------
++dnl Attempt to determine the appropriate CC/LD options for creating a shared
++dnl library.
++dnl
++dnl Note: $(LOCAL_LDFLAGS) is used to link executables that will run within the
++dnl build-tree, i.e., by making use of the libraries that are compiled in ../lib
++dnl We avoid compiling-in a ../lib path for the shared library since that can
++dnl lead to unexpected results at runtime.
++dnl $(LOCAL_LDFLAGS2) has the same intention but assumes that the shared libraries
++dnl are compiled in ../../lib
++dnl
++dnl The variable 'cf_cv_do_symlinks' is used to control whether we configure
++dnl to install symbolic links to the rel/abi versions of shared libraries.
++dnl
++dnl The variable 'cf_cv_shlib_version' controls whether we use the rel or abi
++dnl version when making symbolic links.
++dnl
++dnl The variable 'cf_cv_shlib_version_infix' controls whether shared library
++dnl version numbers are infix (ex: libncurses.<ver>.dylib) or postfix
++dnl (ex: libncurses.so.<ver>).
++dnl
++dnl Some loaders leave 'so_locations' lying around. It's nice to clean up.
++AC_DEFUN([CF_SHARED_OPTS],
++[
++ AC_REQUIRE([CF_SUBST_NCURSES_VERSION])
++ LOCAL_LDFLAGS=
++ LOCAL_LDFLAGS2=
++ LD_SHARED_OPTS=
++ INSTALL_LIB="-m 644"
++
++ cf_cv_do_symlinks=no
++
++ AC_MSG_CHECKING(if release/abi version should be used for shared libs)
++ AC_ARG_WITH(shlib-version,
++ [ --with-shlib-version=X Specify rel or abi version for shared libs],
++ [test -z "$withval" && withval=auto
++ case $withval in #(vi
++ yes) #(vi
++ cf_cv_shlib_version=auto
++ ;;
++ rel|abi|auto|no) #(vi
++ cf_cv_shlib_version=$withval
++ ;;
++ *)
++ AC_ERROR([option value must be one of: rel, abi, auto or no])
++ ;;
++ esac
++ ],[cf_cv_shlib_version=auto])
++ AC_MSG_RESULT($cf_cv_shlib_version)
++
++ cf_cv_rm_so_locs=no
++
++ # Some less-capable ports of gcc support only -fpic
++ CC_SHARED_OPTS=
++ if test "$GCC" = yes
++ then
++ AC_MSG_CHECKING(which $CC option to use)
++ cf_save_CFLAGS="$CFLAGS"
++ for CC_SHARED_OPTS in -fPIC -fpic ''
++ do
++ CFLAGS="$cf_save_CFLAGS $CC_SHARED_OPTS"
++ AC_TRY_COMPILE([#include <stdio.h>],[int x = 1],[break],[])
++ done
++ AC_MSG_RESULT($CC_SHARED_OPTS)
++ CFLAGS="$cf_save_CFLAGS"
++ fi
++
++ cf_cv_shlib_version_infix=no
++
++ case $cf_cv_system_name in
++ beos*)
++ MK_SHARED_LIB='$(CC) -o $[@] -Xlinker -soname=`basename $[@]` -nostart -e 0'
++ ;;
++ cygwin*)
++ CC_SHARED_OPTS=
++ MK_SHARED_LIB='$(CC) -shared -Wl,--out-implib=$(IMPORT_LIB) -Wl,--export-all-symbols -o $(SHARED_LIB)'
++ cf_cv_shlib_version=cygdll
++ cf_cv_shlib_version_infix=cygdll
++ ;;
++ darwin*)
++ EXTRA_CFLAGS="-no-cpp-precomp"
++ CC_SHARED_OPTS="-dynamic"
++ MK_SHARED_LIB='$(CC) -dynamiclib -install_name $(DESTDIR)$(libdir)/`basename $[@]` -compatibility_version $(ABI_VERSION) -current_version $(ABI_VERSION) -o $[@]'
++ test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=abi
++ cf_cv_shlib_version_infix=yes
++ ;;
++ hpux*)
++ # (tested with gcc 2.7.2 -- I don't have c89)
++ if test "$GCC" = yes; then
++ LD_SHARED_OPTS='-Xlinker +b -Xlinker $(libdir)'
++ else
++ CC_SHARED_OPTS='+Z'
++ LD_SHARED_OPTS='-Wl,+b,$(libdir)'
++ fi
++ MK_SHARED_LIB='$(LD) +b $(libdir) -b -o $[@]'
++ # HP-UX shared libraries must be executable, and should be
++ # readonly to exploit a quirk in the memory manager.
++ INSTALL_LIB="-m 555"
++ ;;
++ irix*)
++ if test "$cf_cv_ld_rpath" = yes ; then
++ cf_ld_rpath_opt="-Wl,-rpath,"
++ EXTRA_LDFLAGS="-Wl,-rpath,\$(libdir) $EXTRA_LDFLAGS"
++ fi
++ # tested with IRIX 5.2 and 'cc'.
++ if test "$GCC" != yes; then
++ CC_SHARED_OPTS='-KPIC'
++ fi
++ MK_SHARED_LIB='$(LD) -shared -rdata_shared -soname `basename $[@]` -o $[@]'
++ cf_cv_rm_so_locs=yes
++ ;;
++ linux*|gnu*|k*bsd*-gnu)
++ if test "$DFT_LWR_MODEL" = "shared" ; then
++ LOCAL_LDFLAGS="-Wl,-rpath,`pwd`/lib"
++ LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
++ fi
++ if test "$cf_cv_ld_rpath" = yes ; then
++ cf_ld_rpath_opt="-Wl,-rpath,"
++ EXTRA_LDFLAGS="$LOCAL_LDFLAGS $EXTRA_LDFLAGS"
++ fi
++ test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
++ MK_SHARED_LIB='$(CC) -shared -Wl,-soname,`basename $[@] .$(REL_VERSION)`.$(ABI_VERSION),-stats,-lc -o $[@]'
++ ;;
++ openbsd2*)
++ CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
++ MK_SHARED_LIB='$(LD) -Bshareable -soname,`basename $[@].$(ABI_VERSION)` -o $[@]'
++ ;;
++ freebsd[[45]]*)
++ CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
++ MK_SHARED_LIB='$(LD) -Bshareable -soname=`basename $[@]` -o $[@]'
++ test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
++
++# This doesn't work - I keep getting spurious references to needing
++# libncurses.so.5.3 when ldd says it's resolved. LOCAL_LDFLAGS2 seems to be
++# no longer used anyway. And the rpath logic isn't relative - so I have to
++# add the local and install lib-directories:
++#
++# if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_ld_rpath" = yes ; then
++# LOCAL_LDFLAGS="-rpath `pwd`/lib"
++# LOCAL_LDFLAGS2="-rpath \$(libdir) $LOCAL_LDFLAGS"
++# cf_ld_rpath_opt="-rpath "
++# EXTRA_LDFLAGS="$LOCAL_LDFLAGS $EXTRA_LDFLAGS"
++# fi
++ ;;
++ openbsd*|freebsd*)
++ CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
++ MK_SHARED_LIB='$(LD) -Bshareable -o $[@]'
++ test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
++ ;;
++ netbsd*)
++ CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
++ test "$cf_cv_ld_rpath" = yes && cf_ld_rpath_opt="-Wl,-rpath,"
++ if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_ld_rpath" = yes ; then
++ LOCAL_LDFLAGS="-Wl,-rpath,`pwd`/lib"
++ LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
++ EXTRA_LDFLAGS="-Wl,-rpath,\$(libdir) $EXTRA_LDFLAGS"
++ MK_SHARED_LIB='$(CC) -shared -Wl,-soname,`basename $[@] .$(REL_VERSION)`.$(ABI_VERSION) -o $[@]'
++ if test "$cf_cv_shlib_version" = auto; then
++ if test ! -f /usr/libexec/ld.elf_so; then
++ cf_cv_shlib_version=rel
++ fi
++ fi
++ else
++ MK_SHARED_LIB='$(LD) -Bshareable -o $[@]'
++ fi
++ ;;
++ osf*|mls+*)
++ # tested with OSF/1 V3.2 and 'cc'
++ # tested with OSF/1 V3.2 and gcc 2.6.3 (but the c++ demo didn't
++ # link with shared libs).
++ MK_SHARED_LIB='$(LD) -set_version $(REL_VERSION):$(ABI_VERSION) -expect_unresolved "*" -shared -soname `basename $[@]`'
++ case $host_os in
++ osf4*)
++ MK_SHARED_LIB="${MK_SHARED_LIB} -msym"
++ ;;
++ esac
++ MK_SHARED_LIB="${MK_SHARED_LIB}"' -o $[@]'
++ if test "$DFT_LWR_MODEL" = "shared" ; then
++ LOCAL_LDFLAGS="-Wl,-rpath,`pwd`/lib"
++ LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
++ fi
++ if test "$cf_cv_ld_rpath" = yes ; then
++ cf_ld_rpath_opt="-rpath"
++ # EXTRA_LDFLAGS="$LOCAL_LDFLAGS $EXTRA_LDFLAGS"
++ fi
++ cf_cv_rm_so_locs=yes
++ ;;
++ sco3.2v5*) # (also uw2* and UW7) hops 13-Apr-98
++ # tested with osr5.0.5
++ if test "$GCC" != yes; then
++ CC_SHARED_OPTS='-belf -KPIC'
++ fi
++ MK_SHARED_LIB='$(LD) -dy -G -h `basename $[@] .$(REL_VERSION)`.$(ABI_VERSION) -o [$]@'
++ if test "$cf_cv_ld_rpath" = yes ; then
++ # only way is to set LD_RUN_PATH but no switch for it
++ RUN_PATH=$libdir
++ fi
++ test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
++ LINK_PROGS='LD_RUN_PATH=$(libdir)'
++ LINK_TESTS='Pwd=`pwd`;LD_RUN_PATH=`dirname $${Pwd}`/lib'
++ ;;
++ sunos4*)
++ # tested with SunOS 4.1.1 and gcc 2.7.0
++ if test "$GCC" != yes; then
++ CC_SHARED_OPTS='-KPIC'
++ fi
++ MK_SHARED_LIB='$(LD) -assert pure-text -o $[@]'
++ test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
++ ;;
++ solaris2*)
++ # tested with SunOS 5.5.1 (solaris 2.5.1) and gcc 2.7.2
++ if test "$GCC" != yes; then
++ CC_SHARED_OPTS='-KPIC'
++ fi
++ MK_SHARED_LIB='$(LD) -dy -G -h `basename $[@] .$(REL_VERSION)`.$(ABI_VERSION) -o $[@]'
++ if test "$DFT_LWR_MODEL" = "shared" ; then
++ LOCAL_LDFLAGS="-R `pwd`/lib:\$(libdir)"
++ LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
++ fi
++ if test "$cf_cv_ld_rpath" = yes ; then
++ cf_ld_rpath_opt="-R"
++ EXTRA_LDFLAGS="$LOCAL_LDFLAGS $EXTRA_LDFLAGS"
++ fi
++ test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
++ ;;
++ sysv5uw7*|unix_sv*)
++ # tested with UnixWare 7.1.0 (gcc 2.95.2 and cc)
++ if test "$GCC" != yes; then
++ CC_SHARED_OPTS='-KPIC'
++ fi
++ MK_SHARED_LIB='$(LD) -d y -G -o [$]@'
++ ;;
++ *)
++ CC_SHARED_OPTS='unknown'
++ MK_SHARED_LIB='echo unknown'
++ ;;
++ esac
++
++ # This works if the last tokens in $MK_SHARED_LIB are the -o target.
++ case "$cf_cv_shlib_version" in #(vi
++ rel|abi)
++ case "$MK_SHARED_LIB" in #(vi
++ *'-o $[@]')
++ test "$cf_cv_do_symlinks" = no && cf_cv_do_symlinks=yes
++ ;;
++ *)
++ AC_MSG_WARN(ignored --with-shlib-version)
++ ;;
++ esac
++ ;;
++ esac
++
++ if test -n "$cf_ld_rpath_opt" ; then
++ AC_MSG_CHECKING(if we need a space after rpath option)
++ cf_save_LIBS="$LIBS"
++ LIBS="$LIBS ${cf_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 && cf_ld_rpath_opt="$cf_ld_rpath_opt "
++ MK_SHARED_LIB="$MK_SHARED_LIB $cf_ld_rpath_opt\$(libdir)"
++ fi
++
++ AC_SUBST(CC_SHARED_OPTS)
++ AC_SUBST(LD_SHARED_OPTS)
++ AC_SUBST(MK_SHARED_LIB)
++ AC_SUBST(LINK_PROGS)
++ AC_SUBST(LINK_TESTS)
++ AC_SUBST(EXTRA_LDFLAGS)
++ AC_SUBST(LOCAL_LDFLAGS)
++ AC_SUBST(LOCAL_LDFLAGS2)
++ AC_SUBST(INSTALL_LIB)
++])dnl
++dnl ---------------------------------------------------------------------------
++dnl CF_SIZECHANGE version: 8 updated: 2000/11/04 12:22:16
++dnl -------------
++dnl Check for definitions & structures needed for window size-changing
++dnl FIXME: check that this works with "snake" (HP-UX 10.x)
++AC_DEFUN([CF_SIZECHANGE],
++[
++AC_REQUIRE([CF_STRUCT_TERMIOS])
++AC_CACHE_CHECK(declaration of size-change, cf_cv_sizechange,[
++ cf_cv_sizechange=unknown
++ cf_save_CPPFLAGS="$CPPFLAGS"
++
++for cf_opts in "" "NEED_PTEM_H"
++do
++
++ CPPFLAGS="$cf_save_CPPFLAGS"
++ test -n "$cf_opts" && CPPFLAGS="$CPPFLAGS -D$cf_opts"
++ AC_TRY_COMPILE([#include <sys/types.h>
++#ifdef HAVE_TERMIOS_H
++#include <termios.h>
++#else
++#ifdef HAVE_TERMIO_H
++#include <termio.h>
++#endif
++#endif
++#ifdef NEED_PTEM_H
++/* This is a workaround for SCO: they neglected to define struct winsize in
++ * termios.h -- it's only in termio.h and ptem.h
++ */
++#include <sys/stream.h>
++#include <sys/ptem.h>
++#endif
++#if !defined(sun) || !defined(HAVE_TERMIOS_H)
++#include <sys/ioctl.h>
++#endif
++],[
++#ifdef TIOCGSIZE
++ struct ttysize win; /* FIXME: what system is this? */
++ int y = win.ts_lines;
++ int x = win.ts_cols;
++#else
++#ifdef TIOCGWINSZ
++ struct winsize win;
++ int y = win.ws_row;
++ int x = win.ws_col;
++#else
++ no TIOCGSIZE or TIOCGWINSZ
++#endif /* TIOCGWINSZ */
++#endif /* TIOCGSIZE */
++ ],
++ [cf_cv_sizechange=yes],
++ [cf_cv_sizechange=no])
++
++ CPPFLAGS="$cf_save_CPPFLAGS"
++ if test "$cf_cv_sizechange" = yes ; then
++ echo "size-change succeeded ($cf_opts)" >&AC_FD_CC
++ test -n "$cf_opts" && cf_cv_sizechange="$cf_opts"
++ break
++ fi
++done
++])
++if test "$cf_cv_sizechange" != no ; then
++ AC_DEFINE(HAVE_SIZECHANGE)
++ case $cf_cv_sizechange in #(vi
++ NEED*)
++ AC_DEFINE_UNQUOTED($cf_cv_sizechange )
++ ;;
++ esac
++fi
++])dnl
++dnl ---------------------------------------------------------------------------
++dnl CF_SRC_MODULES version: 15 updated: 2004/01/10 16:05:16
++dnl --------------
++dnl For each parameter, test if the source-directory exists, and if it contains
++dnl a 'modules' file. If so, add to the list $cf_cv_src_modules which we'll
++dnl use in CF_LIB_RULES.
++dnl
++dnl This uses the configured value to make the lists SRC_SUBDIRS and
++dnl SUB_MAKEFILES which are used in the makefile-generation scheme.
++AC_DEFUN([CF_SRC_MODULES],
++[
++AC_MSG_CHECKING(for src modules)
++
++# dependencies and linker-arguments for test-programs
++TEST_DEPS="${LIB_DIR}/${LIB_PREFIX}${LIB_NAME}${DFT_DEP_SUFFIX} $TEST_DEPS"
++if test "$DFT_LWR_MODEL" = "libtool"; then
++ TEST_ARGS="${TEST_DEPS}"
++else
++ TEST_ARGS="-l${LIB_NAME}${DFT_ARG_SUFFIX} $TEST_ARGS"
++fi
++
++# dependencies and linker-arguments for utility-programs
++test "$with_termlib" != yes && PROG_ARGS="$TEST_ARGS"
++
++cf_cv_src_modules=
++for cf_dir in $1
++do
++ if test -f $srcdir/$cf_dir/modules; then
++
++ # We may/may not have tack in the distribution, though the
++ # makefile is.
++ if test $cf_dir = tack ; then
++ if test ! -f $srcdir/${cf_dir}/${cf_dir}.h; then
++ continue
++ fi
++ fi
++
++ if test -z "$cf_cv_src_modules"; then
++ cf_cv_src_modules=$cf_dir
++ else
++ cf_cv_src_modules="$cf_cv_src_modules $cf_dir"
++ fi
++
++ # Make the ncurses_cfg.h file record the library interface files as
++ # well. These are header files that are the same name as their
++ # directory. Ncurses is the only library that does not follow
++ # that pattern.
++ if test $cf_dir = tack ; then
++ continue
++ elif test -f $srcdir/${cf_dir}/${cf_dir}.h; then
++ CF_UPPER(cf_have_include,$cf_dir)
++ AC_DEFINE_UNQUOTED(HAVE_${cf_have_include}_H)
++ AC_DEFINE_UNQUOTED(HAVE_LIB${cf_have_include})
++ TEST_DEPS="${LIB_DIR}/${LIB_PREFIX}${cf_dir}${DFT_DEP_SUFFIX} $TEST_DEPS"
++ if test "$DFT_LWR_MODEL" = "libtool"; then
++ TEST_ARGS="${TEST_DEPS}"
++ else
++ TEST_ARGS="-l${cf_dir}${DFT_ARG_SUFFIX} $TEST_ARGS"
++ fi
++ fi
++ fi
++done
++AC_MSG_RESULT($cf_cv_src_modules)
++TEST_ARGS="-L${LIB_DIR} $TEST_ARGS"
++AC_SUBST(TEST_DEPS)
++AC_SUBST(TEST_ARGS)
++
++PROG_ARGS="-L${LIB_DIR} $PROG_ARGS"
++AC_SUBST(PROG_ARGS)
++
++SRC_SUBDIRS="man include"
++for cf_dir in $cf_cv_src_modules
++do
++ SRC_SUBDIRS="$SRC_SUBDIRS $cf_dir"
++done
++SRC_SUBDIRS="$SRC_SUBDIRS test"
++test -z "$MAKE_TERMINFO" && SRC_SUBDIRS="$SRC_SUBDIRS misc"
++test "$cf_with_cxx_binding" != no && SRC_SUBDIRS="$SRC_SUBDIRS c++"
++
++ADA_SUBDIRS=
++if test "$cf_cv_prog_gnat_correct" = yes && test -f $srcdir/Ada95/Makefile.in; then
++ SRC_SUBDIRS="$SRC_SUBDIRS Ada95"
++ ADA_SUBDIRS="gen src samples"
++fi
++
++SUB_MAKEFILES=
++for cf_dir in $SRC_SUBDIRS
++do
++ SUB_MAKEFILES="$SUB_MAKEFILES $cf_dir/Makefile"
++done
++
++if test -n "$ADA_SUBDIRS"; then
++ for cf_dir in $ADA_SUBDIRS
++ do
++ SUB_MAKEFILES="$SUB_MAKEFILES Ada95/$cf_dir/Makefile"
++ done
++ AC_SUBST(ADA_SUBDIRS)
++fi
++])dnl
++dnl ---------------------------------------------------------------------------
++dnl CF_STDCPP_LIBRARY version: 5 updated: 2000/08/12 23:18:52
++dnl -----------------
++dnl Check for -lstdc++, which is GNU's standard C++ library.
++AC_DEFUN([CF_STDCPP_LIBRARY],
++[
++if test -n "$GXX" ; then
++case $cf_cv_system_name in #(vi
++os2*) #(vi
++ cf_stdcpp_libname=stdcpp
++ ;;
++*)
++ cf_stdcpp_libname=stdc++
++ ;;
++esac
++AC_CACHE_CHECK(for library $cf_stdcpp_libname,cf_cv_libstdcpp,[
++ cf_save="$LIBS"
++ LIBS="$LIBS -l$cf_stdcpp_libname"
++AC_TRY_LINK([
++#include <strstream.h>],[
++char buf[80];
++strstreambuf foo(buf, sizeof(buf))
++],
++ [cf_cv_libstdcpp=yes],
++ [cf_cv_libstdcpp=no])
++ LIBS="$cf_save"
++])
++test "$cf_cv_libstdcpp" = yes && CXXLIBS="$CXXLIBS -l$cf_stdcpp_libname"
++fi
++])dnl
++dnl ---------------------------------------------------------------------------
++dnl CF_STRIP_G_OPT version: 3 updated: 2002/12/21 19:25:52
++dnl --------------
++dnl Remove "-g" option from the compiler options
++AC_DEFUN([CF_STRIP_G_OPT],
++[$1=`echo ${$1} | sed -e 's%-g %%' -e 's%-g$%%'`])dnl
++dnl ---------------------------------------------------------------------------
++dnl CF_STRUCT_SIGACTION version: 3 updated: 2000/08/12 23:18:52
++dnl -------------------
++dnl Check if we need _POSIX_SOURCE defined to use struct sigaction. We'll only
++dnl do this if we've found the sigaction function.
++dnl
++dnl If needed, define SVR4_ACTION.
++AC_DEFUN([CF_STRUCT_SIGACTION],[
++if test "$ac_cv_func_sigaction" = yes; then
++AC_MSG_CHECKING(whether sigaction needs _POSIX_SOURCE)
++AC_TRY_COMPILE([
++#include <sys/types.h>
++#include <signal.h>],
++ [struct sigaction act],
++ [sigact_bad=no],
++ [
++AC_TRY_COMPILE([
++#define _POSIX_SOURCE
++#include <sys/types.h>
++#include <signal.h>],
++ [struct sigaction act],
++ [sigact_bad=yes
++ AC_DEFINE(SVR4_ACTION)],
++ [sigact_bad=unknown])])
++AC_MSG_RESULT($sigact_bad)
++fi
++])dnl
++dnl ---------------------------------------------------------------------------
++dnl CF_STRUCT_TERMIOS version: 5 updated: 2000/11/04 12:22:46
++dnl -----------------
++dnl Some machines require _POSIX_SOURCE to completely define struct termios.
++dnl If so, define SVR4_TERMIO
++AC_DEFUN([CF_STRUCT_TERMIOS],[
++AC_CHECK_HEADERS( \
++termio.h \
++termios.h \
++unistd.h \
++)
++if test "$ISC" = yes ; then
++ AC_CHECK_HEADERS( sys/termio.h )
++fi
++if test "$ac_cv_header_termios_h" = yes ; then
++ case "$CFLAGS $CPPFLAGS" in
++ *-D_POSIX_SOURCE*)
++ termios_bad=dunno ;;
++ *) termios_bad=maybe ;;
++ esac
++ if test "$termios_bad" = maybe ; then
++ AC_MSG_CHECKING(whether termios.h needs _POSIX_SOURCE)
++ AC_TRY_COMPILE([#include <termios.h>],
++ [struct termios foo; int x = foo.c_iflag],
++ termios_bad=no, [
++ AC_TRY_COMPILE([
++#define _POSIX_SOURCE
++#include <termios.h>],
++ [struct termios foo; int x = foo.c_iflag],
++ termios_bad=unknown,
++ termios_bad=yes AC_DEFINE(SVR4_TERMIO))
++ ])
++ AC_MSG_RESULT($termios_bad)
++ fi
++fi
++])dnl
++dnl ---------------------------------------------------------------------------
++dnl CF_SUBST version: 2 updated: 1997/09/06 23:41:28
++dnl --------
++dnl Shorthand macro for substituting things that the user may override
++dnl with an environment variable.
++dnl
++dnl $1 = long/descriptive name
++dnl $2 = environment variable
++dnl $3 = default value
++AC_DEFUN([CF_SUBST],
++[AC_CACHE_VAL(cf_cv_subst_$2,[
++AC_MSG_CHECKING(for $1 (symbol $2))
++test -z "[$]$2" && $2=$3
++AC_MSG_RESULT([$]$2)
++AC_SUBST($2)
++cf_cv_subst_$2=[$]$2])
++$2=${cf_cv_subst_$2}
++])dnl
++dnl ---------------------------------------------------------------------------
++dnl CF_SUBST_NCURSES_VERSION version: 7 updated: 2003/06/07 16:22:51
++dnl ------------------------
++dnl Get the version-number for use in shared-library naming, etc.
++AC_DEFUN([CF_SUBST_NCURSES_VERSION],
++[
++NCURSES_MAJOR="`egrep '^NCURSES_MAJOR[[ ]]*=' $srcdir/dist.mk | sed -e 's/^[[^0-9]]*//'`"
++NCURSES_MINOR="`egrep '^NCURSES_MINOR[[ ]]*=' $srcdir/dist.mk | sed -e 's/^[[^0-9]]*//'`"
++NCURSES_PATCH="`egrep '^NCURSES_PATCH[[ ]]*=' $srcdir/dist.mk | sed -e 's/^[[^0-9]]*//'`"
++cf_cv_abi_version=${NCURSES_MAJOR}
++cf_cv_rel_version=${NCURSES_MAJOR}.${NCURSES_MINOR}
++dnl Show the computed version, for logging
++cf_cv_timestamp=`date`
++AC_MSG_RESULT(Configuring NCURSES $cf_cv_rel_version ABI $cf_cv_abi_version ($cf_cv_timestamp))
++dnl We need these values in the generated headers
++AC_SUBST(NCURSES_MAJOR)
++AC_SUBST(NCURSES_MINOR)
++AC_SUBST(NCURSES_PATCH)
++dnl We need these values in the generated makefiles
++AC_SUBST(cf_cv_rel_version)
++AC_SUBST(cf_cv_abi_version)
++AC_SUBST(cf_cv_builtin_bool)
++AC_SUBST(cf_cv_header_stdbool_h)
++AC_SUBST(cf_cv_type_of_bool)dnl
++])dnl
++dnl ---------------------------------------------------------------------------
++dnl CF_SYS_TIME_SELECT version: 4 updated: 2000/10/04 09:18:40
++dnl ------------------
++dnl Check if we can include <sys/time.h> with <sys/select.h>; this breaks on
++dnl older SCO configurations.
++AC_DEFUN([CF_SYS_TIME_SELECT],
++[
++AC_MSG_CHECKING(if sys/time.h works with sys/select.h)
++AC_CACHE_VAL(cf_cv_sys_time_select,[
++AC_TRY_COMPILE([
++#include <sys/types.h>
++#ifdef HAVE_SYS_TIME_H
++#include <sys/time.h>
++#endif
++#ifdef HAVE_SYS_SELECT_H
++#include <sys/select.h>
++#endif
++],[],[cf_cv_sys_time_select=yes],
++ [cf_cv_sys_time_select=no])
++ ])
++AC_MSG_RESULT($cf_cv_sys_time_select)
++test "$cf_cv_sys_time_select" = yes && AC_DEFINE(HAVE_SYS_TIME_SELECT)
++])dnl
++dnl ---------------------------------------------------------------------------
++dnl CF_TYPEOF_CHTYPE version: 4 updated: 2000/10/04 09:18:40
++dnl ----------------
++dnl Determine the type we should use for chtype (and attr_t, which is treated
++dnl as the same thing). We want around 32 bits, so on most machines want a
++dnl long, but on newer 64-bit machines, probably want an int. If we're using
++dnl wide characters, we have to have a type compatible with that, as well.
++AC_DEFUN([CF_TYPEOF_CHTYPE],
++[
++AC_REQUIRE([CF_UNSIGNED_LITERALS])
++AC_MSG_CHECKING([for type of chtype])
++AC_CACHE_VAL(cf_cv_typeof_chtype,[
++ AC_TRY_RUN([
++#ifdef USE_WIDEC_SUPPORT
++#include <stddef.h> /* we want wchar_t */
++#define WANT_BITS 39
++#else
++#define WANT_BITS 31
++#endif
++#include <stdio.h>
++int main()
++{
++ FILE *fp = fopen("cf_test.out", "w");
++ if (fp != 0) {
++ char *result = "long";
++#ifdef USE_WIDEC_SUPPORT
++ /*
++ * If wchar_t is smaller than a long, it must be an int or a
++ * short. We prefer not to use a short anyway.
++ */
++ if (sizeof(unsigned long) > sizeof(wchar_t))
++ result = "int";
++#endif
++ if (sizeof(unsigned long) > sizeof(unsigned int)) {
++ int n;
++ unsigned int x;
++ for (n = 0; n < WANT_BITS; n++) {
++ unsigned int y = (x >> n);
++ if (y != 1 || x == 0) {
++ x = 0;
++ break;
++ }
++ }
++ /*
++ * If x is nonzero, an int is big enough for the bits
++ * that we want.
++ */
++ result = (x != 0) ? "int" : "long";
++ }
++ fputs(result, fp);
++ fclose(fp);
++ }
++ exit(0);
++}
++ ],
++ [cf_cv_typeof_chtype=`cat cf_test.out`],
++ [cf_cv_typeof_chtype=long],
++ [cf_cv_typeof_chtype=long])
++ rm -f cf_test.out
++ ])
++AC_MSG_RESULT($cf_cv_typeof_chtype)
++
++AC_SUBST(cf_cv_typeof_chtype)
++AC_DEFINE_UNQUOTED(TYPEOF_CHTYPE,$cf_cv_typeof_chtype)
++
++cf_cv_1UL="1"
++test "$cf_cv_unsigned_literals" = yes && cf_cv_1UL="${cf_cv_1UL}U"
++test "$cf_cv_typeof_chtype" = long && cf_cv_1UL="${cf_cv_1UL}L"
++AC_SUBST(cf_cv_1UL)
++
++])dnl
++dnl ---------------------------------------------------------------------------
++dnl CF_TYPE_SIGACTION version: 3 updated: 2000/08/12 23:18:52
++dnl -----------------
++dnl
++AC_DEFUN([CF_TYPE_SIGACTION],
++[
++AC_MSG_CHECKING([for type sigaction_t])
++AC_CACHE_VAL(cf_cv_type_sigaction,[
++ AC_TRY_COMPILE([
++#include <signal.h>],
++ [sigaction_t x],
++ [cf_cv_type_sigaction=yes],
++ [cf_cv_type_sigaction=no])])
++AC_MSG_RESULT($cf_cv_type_sigaction)
++test "$cf_cv_type_sigaction" = yes && AC_DEFINE(HAVE_TYPE_SIGACTION)
++])dnl
++dnl ---------------------------------------------------------------------------
++dnl CF_UNSIGNED_LITERALS version: 2 updated: 1998/02/07 22:10:16
++dnl --------------------
++dnl Test if the compiler supports 'U' and 'L' suffixes. Only old compilers
++dnl won't, but they're still there.
++AC_DEFUN([CF_UNSIGNED_LITERALS],
++[
++AC_MSG_CHECKING([if unsigned literals are legal])
++AC_CACHE_VAL(cf_cv_unsigned_literals,[
++ AC_TRY_COMPILE([],[long x = 1L + 1UL + 1U + 1],
++ [cf_cv_unsigned_literals=yes],
++ [cf_cv_unsigned_literals=no])
++ ])
++AC_MSG_RESULT($cf_cv_unsigned_literals)
++])dnl
++dnl ---------------------------------------------------------------------------
++dnl CF_UPPER version: 5 updated: 2001/01/29 23:40:59
++dnl --------
++dnl Make an uppercase version of a variable
++dnl $1=uppercase($2)
++AC_DEFUN([CF_UPPER],
++[
++$1=`echo "$2" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
++])dnl
++dnl ---------------------------------------------------------------------------
++dnl CF_VERBOSE version: 2 updated: 1997/09/05 10:45:14
++dnl ----------
++dnl Use AC_VERBOSE w/o the warnings
++AC_DEFUN([CF_VERBOSE],
++[test -n "$verbose" && echo " $1" 1>&AC_FD_MSG
++])dnl
++dnl ---------------------------------------------------------------------------
++dnl CF_WCHAR_TYPE version: 2 updated: 2004/01/17 19:18:20
++dnl -------------
++dnl Check if type wide-character type $1 is declared, and if so, which header
++dnl file is needed. The second parameter is used to set a shell variable when
++dnl the type is not found. The first parameter sets a shell variable for the
++dnl opposite sense.
++AC_DEFUN([CF_WCHAR_TYPE],
++[
++# This is needed on Tru64 5.0 to declare $1
++AC_CACHE_CHECK(if we must include wchar.h to declare $1,cf_cv_$1,[
++AC_TRY_COMPILE([
++#include <stdlib.h>
++#include <stdarg.h>
++#include <stdio.h>
++#ifdef HAVE_LIBUTF8_H
++#include <libutf8.h>
++#endif],
++ [$1 state],
++ [cf_cv_$1=no],
++ [AC_TRY_COMPILE([
++#include <stdlib.h>
++#include <stdarg.h>
++#include <stdio.h>
++#include <wchar.h>
++#ifdef HAVE_LIBUTF8_H
++#include <libutf8.h>
++#endif],
++ [$1 value],
++ [cf_cv_$1=yes],
++ [cf_cv_$1=unknown])])])
++
++if test "$cf_cv_$1" = yes ; then
++ AC_DEFINE(NEED_WCHAR_H)
++ NEED_WCHAR_H=1
++fi
++
++ifelse($2,,,[
++# if we do not find $1 in either place, use substitution to provide a fallback.
++if test "$cf_cv_$1" = unknown ; then
++ $2=1
++fi
++])
++ifelse($3,,,[
++# if we find $1 in either place, use substitution to provide a fallback.
++if test "$cf_cv_$1" != unknown ; then
++ $3=1
++fi
++])
++])dnl
++dnl ---------------------------------------------------------------------------
++dnl CF_WITH_ABI_VERSION version: 1 updated: 2003/09/20 18:12:49
++dnl -------------------
++dnl Allow library's ABI to be overridden. Generally this happens when a
++dnl packager has incremented the ABI past that used in the original package,
++dnl and wishes to keep doing this.
++dnl
++dnl $1 is the package name, if any, to derive a corresponding {package}_ABI
++dnl symbol.
++AC_DEFUN([CF_WITH_ABI_VERSION],[
++test -z "$cf_cv_abi_version" && cf_cv_abi_version=0
++AC_ARG_WITH(abi-version,
++[ --with-abi-version=XXX override derived ABI version],
++[AC_MSG_WARN(overriding ABI version $cf_cv_abi_version to $withval)
++ cf_cv_abi_version=$withval])
++ CF_NUMBER_SYNTAX($cf_cv_abi_version,ABI version)
++ifelse($1,,,[
++$1_ABI=$cf_cv_abi_version
++])
++])dnl
++dnl ---------------------------------------------------------------------------
++dnl CF_WITH_DBMALLOC version: 2 updated: 2002/12/29 21:11:45
++dnl ----------------
++dnl Configure-option for dbmalloc
++AC_DEFUN([CF_WITH_DBMALLOC],[
++AC_MSG_CHECKING(if you want to link with dbmalloc for testing)
++AC_ARG_WITH(dbmalloc,
++ [ --with-dbmalloc test: use Conor Cahill's dbmalloc library],
++ [with_dbmalloc=$withval],
++ [with_dbmalloc=no])
++AC_MSG_RESULT($with_dbmalloc)
++if test $with_dbmalloc = yes ; then
++ AC_CHECK_LIB(dbmalloc,debug_malloc)
++fi
++])dnl
++dnl ---------------------------------------------------------------------------
++dnl CF_WITH_DMALLOC version: 2 updated: 2002/12/29 21:11:45
++dnl ---------------
++dnl Configure-option for dmalloc
++AC_DEFUN([CF_WITH_DMALLOC],[
++AC_MSG_CHECKING(if you want to link with dmalloc for testing)
++AC_ARG_WITH(dmalloc,
++ [ --with-dmalloc test: use Gray Watson's dmalloc library],
++ [with_dmalloc=$withval],
++ [with_dmalloc=no])
++AC_MSG_RESULT($with_dmalloc)
++if test $with_dmalloc = yes ; then
++ AC_CHECK_LIB(dmalloc,dmalloc_debug)
++fi
++])dnl
++dnl ---------------------------------------------------------------------------
++dnl CF_WITH_LIBTOOL version: 9 updated: 2004/01/16 14:55:37
++dnl ---------------
++dnl Provide a configure option to incorporate libtool. Define several useful
++dnl symbols for the makefile rules.
++dnl
++dnl The reference to AC_PROG_LIBTOOL does not normally work, since it uses
++dnl macros from libtool.m4 which is in the aclocal directory of automake.
++dnl Following is a simple script which turns on the AC_PROG_LIBTOOL macro.
++dnl But that still does not work properly since the macro is expanded outside
++dnl the CF_WITH_LIBTOOL macro:
++dnl
++dnl #!/bin/sh
++dnl ACLOCAL=`aclocal --print-ac-dir`
++dnl if test -z "$ACLOCAL" ; then
++dnl echo cannot find aclocal directory
++dnl exit 1
++dnl elif test ! -f $ACLOCAL/libtool.m4 ; then
++dnl echo cannot find libtool.m4 file
++dnl exit 1
++dnl fi
++dnl
++dnl LOCAL=aclocal.m4
++dnl ORIG=aclocal.m4.orig
++dnl
++dnl trap "mv $ORIG $LOCAL" 0 1 2 5 15
++dnl rm -f $ORIG
++dnl mv $LOCAL $ORIG
++dnl
++dnl # sed the LIBTOOL= assignment to omit the current directory?
++dnl sed -e 's/^LIBTOOL=.*/LIBTOOL=${LIBTOOL-libtool}/' $ACLOCAL/libtool.m4 >>$LOCAL
++dnl cat $ORIG >>$LOCAL
++dnl
++dnl autoconf-257 $*
++dnl
++AC_DEFUN([CF_WITH_LIBTOOL],
++[
++ifdef([AC_PROG_LIBTOOL],,[
++LIBTOOL=
++])
++# common library maintenance symbols that are convenient for libtool scripts:
++LIB_CREATE='$(AR) -cr'
++LIB_OBJECT='$(OBJECTS)'
++LIB_SUFFIX=.a
++LIB_PREP="$RANLIB"
++
++# symbols used to prop libtool up to enable it to determine what it should be
++# doing:
++LIB_CLEAN=
++LIB_COMPILE=
++LIB_LINK=
++LIB_INSTALL=
++LIB_UNINSTALL=
++
++AC_MSG_CHECKING(if you want to build libraries with libtool)
++AC_ARG_WITH(libtool,
++ [ --with-libtool generate libraries with libtool],
++ [with_libtool=$withval],
++ [with_libtool=no])
++AC_MSG_RESULT($with_libtool)
++if test "$with_libtool" != "no"; then
++ifdef([AC_PROG_LIBTOOL],[
++ # missing_content_AC_PROG_LIBTOOL{{
++ AC_PROG_LIBTOOL
++ # missing_content_AC_PROG_LIBTOOL}}
++],[
++ if test "$with_libtool" != "yes" ; then
++ CF_PATH_SYNTAX(with_libtool)
++ LIBTOOL=$with_libtool
++ else
++ AC_PATH_PROG(LIBTOOL,libtool)
++ fi
++ if test -z "$LIBTOOL" ; then
++ AC_MSG_ERROR(Cannot find libtool)
++ fi
++])dnl
++ LIB_CREATE='$(LIBTOOL) --mode=link $(CC) -rpath $(DESTDIR)$(libdir) -version-info `cut -f1 $(srcdir)/VERSION` -o'
++ LIB_OBJECT='$(OBJECTS:.o=.lo)'
++ LIB_SUFFIX=.la
++ LIB_CLEAN='$(LIBTOOL) --mode=clean'
++ LIB_COMPILE='$(LIBTOOL) --mode=compile'
++ LIB_LINK='$(LIBTOOL) --mode=link'
++ LIB_INSTALL='$(LIBTOOL) --mode=install'
++ LIB_UNINSTALL='$(LIBTOOL) --mode=uninstall'
++ LIB_PREP=:
++
++ # Show the version of libtool
++ AC_MSG_CHECKING(version of libtool)
++
++ # Save the version in a cache variable - this is not entirely a good
++ # thing, but the version string from libtool is very ugly, and for
++ # bug reports it might be useful to have the original string.
++ cf_cv_libtool_version=`$LIBTOOL --version 2>&1 | sed -e '2,$d' -e 's/([[^)]]*)//g' -e 's/^[[^1-9]]*//' -e 's/[[^0-9.]].*//'`
++ AC_MSG_RESULT($cf_cv_libtool_version)
++ if test -z "$cf_cv_libtool_version" ; then
++ AC_MSG_ERROR(This is not libtool)
++ fi
++
++ # special hack to add --tag option for C++ compiler
++ case $cf_cv_libtool_version in
++ 1.[[5-9]]*|[[2-9]]*)
++ LIBTOOL_CXX="$LIBTOOL --tag=CXX"
++ ;;
++ *)
++ LIBTOOL_CXX="$LIBTOOL"
++ ;;
++ esac
++else
++ LIBTOOL=""
++ LIBTOOL_CXX=""
++fi
++
++test -z "$LIBTOOL" && ECHO_LT=
++
++AC_SUBST(LIBTOOL)
++AC_SUBST(LIBTOOL_CXX)
++
++AC_SUBST(LIB_CREATE)
++AC_SUBST(LIB_OBJECT)
++AC_SUBST(LIB_SUFFIX)
++AC_SUBST(LIB_PREP)
++
++AC_SUBST(LIB_CLEAN)
++AC_SUBST(LIB_COMPILE)
++AC_SUBST(LIB_LINK)
++AC_SUBST(LIB_INSTALL)
++AC_SUBST(LIB_UNINSTALL)
++
++])dnl
++dnl ---------------------------------------------------------------------------
++dnl CF_WITH_PATH version: 6 updated: 1998/10/11 00:40:17
++dnl ------------
++dnl Wrapper for AC_ARG_WITH to ensure that user supplies a pathname, not just
++dnl defaulting to yes/no.
++dnl
++dnl $1 = option name
++dnl $2 = help-text
++dnl $3 = environment variable to set
++dnl $4 = default value, shown in the help-message, must be a constant
++dnl $5 = default value, if it's an expression & cannot be in the help-message
++dnl
++AC_DEFUN([CF_WITH_PATH],
++[AC_ARG_WITH($1,[$2 ](default: ifelse($4,,empty,$4)),,
++ifelse($4,,[withval="${$3}"],[withval="${$3-ifelse($5,,$4,$5)}"]))dnl
++CF_PATH_SYNTAX(withval)
++eval $3="$withval"
++AC_SUBST($3)dnl
++])dnl
++dnl ---------------------------------------------------------------------------
++dnl CF_WITH_PATHLIST version: 5 updated: 2001/12/10 01:28:30
++dnl ----------------
++dnl Process an option specifying a list of colon-separated paths.
++dnl
++dnl $1 = option name
++dnl $2 = help-text
++dnl $3 = environment variable to set
++dnl $4 = default value, shown in the help-message, must be a constant
++dnl $5 = default value, if it's an expression & cannot be in the help-message
++dnl $6 = flag to tell if we want to define or substitute
++dnl
++AC_DEFUN([CF_WITH_PATHLIST],[
++AC_REQUIRE([CF_PATHSEP])
++AC_ARG_WITH($1,[$2 ](default: ifelse($4,,empty,$4)),,
++ifelse($4,,[withval=${$3}],[withval=${$3-ifelse($5,,$4,$5)}]))dnl
++
++IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${PATHSEP}"
++cf_dst_path=
++for cf_src_path in $withval
++do
++ CF_PATH_SYNTAX(cf_src_path)
++ test -n "$cf_dst_path" && cf_dst_path="${cf_dst_path}:"
++ cf_dst_path="${cf_dst_path}${cf_src_path}"
++done
++IFS="$ac_save_ifs"
++
++ifelse($6,define,[
++# Strip single quotes from the value, e.g., when it was supplied as a literal
++# for $4 or $5.
++case $cf_dst_path in #(vi
++\'*)
++ cf_dst_path=`echo $cf_dst_path |sed -e s/\'// -e s/\'\$//`
++ ;;
++esac
++cf_dst_path=`echo "$cf_dst_path" | sed -e 's/\\\\/\\\\\\\\/g'`
++])
++
++eval '$3="$cf_dst_path"'
++AC_SUBST($3)dnl
++
++])dnl
++dnl ---------------------------------------------------------------------------
++dnl CF_WITH_REL_VERSION version: 1 updated: 2003/09/20 18:12:49
++dnl -------------------
++dnl Allow library's release-version to be overridden. Generally this happens when a
++dnl packager has incremented the release-version past that used in the original package,
++dnl and wishes to keep doing this.
++dnl
++dnl $1 is the package name, if any, to derive corresponding {package}_MAJOR
++dnl and {package}_MINOR symbols
++dnl symbol.
++AC_DEFUN([CF_WITH_REL_VERSION],[
++test -z "$cf_cv_rel_version" && cf_cv_rel_version=0.0
++AC_ARG_WITH(rel-version,
++[ --with-rel-version=XXX override derived release version],
++[AC_MSG_WARN(overriding release version $cf_cv_rel_version to $withval)
++ cf_cv_rel_version=$withval])
++ifelse($1,,[
++ CF_NUMBER_SYNTAX($cf_cv_rel_version,Release version)
++],[
++ $1_MAJOR=`echo "$cf_cv_rel_version" | sed -e 's/\..*//'`
++ $1_MINOR=`echo "$cf_cv_rel_version" | sed -e 's/^[[^.]]*//' -e 's/^\.//' -e 's/\..*//'`
++ CF_NUMBER_SYNTAX([$]$1_MAJOR,Release major-version)
++ CF_NUMBER_SYNTAX([$]$1_MINOR,Release minor-version)
++])
++])dnl
++dnl ---------------------------------------------------------------------------
++dnl CF_WITH_SYSMOUSE version: 2 updated: 2003/03/22 19:13:43
++dnl ----------------
++dnl If we can compile with sysmouse, make it available unless it is not wanted.
++AC_DEFUN([CF_WITH_SYSMOUSE],[
++# not everyone has "test -c"
++if test -c /dev/sysmouse 2>/dev/null ; then
++AC_MSG_CHECKING(if you want to use sysmouse)
++AC_ARG_WITH(sysmouse,
++ [ --with-sysmouse use sysmouse (FreeBSD console)],
++ [cf_with_sysmouse=$withval],
++ [cf_with_sysmouse=maybe])
++ if test "$cf_with_sysmouse" != no ; then
++ AC_TRY_COMPILE([
++#include <osreldate.h>
++#if (__FreeBSD_version >= 400017)
++#include <sys/consio.h>
++#include <sys/fbio.h>
++#else
++#include <machine/console.h>
++#endif
++],[
++ struct mouse_info the_mouse;
++ ioctl(0, CONS_MOUSECTL, &the_mouse);
++],[cf_with_sysmouse=yes],[cf_with_sysmouse=no])
++ fi
++AC_MSG_RESULT($cf_with_sysmouse)
++test "$cf_with_sysmouse" = yes && AC_DEFINE(USE_SYSMOUSE)
++fi
++])dnl
++dnl ---------------------------------------------------------------------------
++dnl CF_XOPEN_SOURCE version: 11 updated: 2004/01/26 20:58:41
++dnl ---------------
++dnl Try to get _XOPEN_SOURCE defined properly that we can use POSIX functions,
++dnl or adapt to the vendor's definitions to get equivalent functionality.
++AC_DEFUN([CF_XOPEN_SOURCE],[
++case $host_os in #(vi
++freebsd*) #(vi
++ CPPFLAGS="$CPPFLAGS -D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600"
++ ;;
++hpux*) #(vi
++ CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE"
++ ;;
++irix6.*) #(vi
++ CPPFLAGS="$CPPFLAGS -D_SGI_SOURCE"
++ ;;
++linux*) #(vi
++ CF_GNU_SOURCE
++ ;;
++mirbsd*) #(vi
++ # setting _XOPEN_SOURCE or _POSIX_SOURCE breaks <arpa/inet.h>
++ ;;
++netbsd*) #(vi
++ # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw
++ ;;
++openbsd*) #(vi
++ # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw
++ ;;
++osf[[45]]*) #(vi
++ CPPFLAGS="$CPPFLAGS -D_OSF_SOURCE"
++ ;;
++sco*) #(vi
++ # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer
++ ;;
++solaris*) #(vi
++ CPPFLAGS="$CPPFLAGS -D__EXTENSIONS__"
++ ;;
++*)
++ AC_CACHE_CHECK(if we should define _XOPEN_SOURCE,cf_cv_xopen_source,[
++ AC_TRY_COMPILE([#include <sys/types.h>],[
++#ifndef _XOPEN_SOURCE
++make an error
++#endif],
++ [cf_cv_xopen_source=no],
++ [cf_save="$CPPFLAGS"
++ CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=500"
++ AC_TRY_COMPILE([#include <sys/types.h>],[
++#ifdef _XOPEN_SOURCE
++make an error
++#endif],
++ [cf_cv_xopen_source=no],
++ [cf_cv_xopen_source=yes])
++ CPPFLAGS="$cf_save"
++ ])
++])
++test "$cf_cv_xopen_source" = yes && CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=500"
++
++ # FreeBSD 5.x headers demand this...
++ AC_CACHE_CHECK(if we should define _POSIX_C_SOURCE,cf_cv_xopen_source,[
++ AC_TRY_COMPILE([#include <sys/types.h>],[
++#ifndef _POSIX_C_SOURCE
++make an error
++#endif],
++ [cf_cv_xopen_source=no],
++ [cf_save="$CPPFLAGS"
++ CPPFLAGS="$CPPFLAGS -D_POSIX_C_SOURCE"
++ AC_TRY_COMPILE([#include <sys/types.h>],[
++#ifdef _POSIX_C_SOURCE
++make an error
++#endif],
++ [cf_cv_xopen_source=no],
++ [cf_cv_xopen_source=yes])
++ CPPFLAGS="$cf_save"
++ ])
++])
++test "$cf_cv_xopen_source" = yes && CPPFLAGS="$CPPFLAGS -D_POSIX_C_SOURCE"
++ ;;
++esac
++])
+--- /dev/null
++++ ncurses-5.4/m4/templates.m4
+@@ -0,0 +1,78 @@
++AH_TEMPLATE([BROKEN_LINKER], [too lazy to enter descriptions])
++AH_TEMPLATE([BSD_TPUTS], [too lazy to enter descriptions])
++AH_TEMPLATE([CC_HAS_INLINE_FUNCS], [too lazy to enter descriptions])
++AH_TEMPLATE([CC_HAS_PROTOS], [too lazy to enter descriptions])
++AH_TEMPLATE([CPP_HAS_PARAM_INIT], [too lazy to enter descriptions])
++AH_TEMPLATE([CPP_HAS_VSCAN_FUNC], [too lazy to enter descriptions])
++AH_TEMPLATE([HAVE_BIG_CORE], [too lazy to enter descriptions])
++AH_TEMPLATE([HAVE_BSD_CGETENT], [too lazy to enter descriptions])
++AH_TEMPLATE([HAVE_BUILTIN_H], [too lazy to enter descriptions])
++AH_TEMPLATE([HAVE_CURSES_VERSION], [too lazy to enter descriptions])
++AH_TEMPLATE([HAVE_GETTIMEOFDAY], [too lazy to enter descriptions])
++AH_TEMPLATE([HAVE_GPP_BUILTIN_H], [too lazy to enter descriptions])
++AH_TEMPLATE([HAVE_GXX_BUILTIN_H], [too lazy to enter descriptions])
++AH_TEMPLATE([HAVE_HAS_KEY], [too lazy to enter descriptions])
++AH_TEMPLATE([HAVE_ISASCII], [too lazy to enter descriptions])
++AH_TEMPLATE([HAVE_LIBGPM], [too lazy to enter descriptions])
++AH_TEMPLATE([HAVE_LIBUTF8_H], [too lazy to enter descriptions])
++AH_TEMPLATE([HAVE_MKSTEMP], [too lazy to enter descriptions])
++AH_TEMPLATE([HAVE_NC_ALLOC_H], [too lazy to enter descriptions])
++AH_TEMPLATE([HAVE_REGEXPR_H_FUNCS], [too lazy to enter descriptions])
++AH_TEMPLATE([HAVE_REGEXP_H_FUNCS], [too lazy to enter descriptions])
++AH_TEMPLATE([HAVE_REGEX_H_FUNCS], [too lazy to enter descriptions])
++AH_TEMPLATE([HAVE_RESIZETERM], [too lazy to enter descriptions])
++AH_TEMPLATE([HAVE_RESIZE_TERM], [too lazy to enter descriptions])
++AH_TEMPLATE([HAVE_SIZECHANGE], [too lazy to enter descriptions])
++AH_TEMPLATE([HAVE_SLK_COLOR], [too lazy to enter descriptions])
++AH_TEMPLATE([HAVE_SYS_TIME_SELECT], [too lazy to enter descriptions])
++AH_TEMPLATE([HAVE_TCGETATTR], [too lazy to enter descriptions])
++AH_TEMPLATE([HAVE_TYPE_SIGACTION], [too lazy to enter descriptions])
++AH_TEMPLATE([HAVE_USE_DEFAULT_COLORS], [too lazy to enter descriptions])
++AH_TEMPLATE([HAVE_VFSCANF], [too lazy to enter descriptions])
++AH_TEMPLATE([HAVE_VSSCANF], [too lazy to enter descriptions])
++AH_TEMPLATE([HAVE_WORKING_POLL], [too lazy to enter descriptions])
++AH_TEMPLATE([HAVE_WRESIZE], [too lazy to enter descriptions])
++AH_TEMPLATE([HAVE__DOSCAN], [too lazy to enter descriptions])
++AH_TEMPLATE([MIXEDCASE_FILENAMES], [too lazy to enter descriptions])
++AH_TEMPLATE([NCURSES_EXPANDED], [too lazy to enter descriptions])
++AH_TEMPLATE([NCURSES_EXT_FUNCS], [too lazy to enter descriptions])
++AH_TEMPLATE([NCURSES_NOMACROS], [too lazy to enter descriptions])
++AH_TEMPLATE([NCURSES_NO_PADDING], [too lazy to enter descriptions])
++AH_TEMPLATE([NCURSES_PATHSEP], [too lazy to enter descriptions])
++AH_TEMPLATE([NCURSES_VERSION_STRING], [too lazy to enter descriptions])
++AH_TEMPLATE([NDEBUG], [too lazy to enter descriptions])
++AH_TEMPLATE([NEED_WCHAR_H], [too lazy to enter descriptions])
++AH_TEMPLATE([NO_LEAKS], [too lazy to enter descriptions])
++AH_TEMPLATE([PROG_EXT], [too lazy to enter descriptions])
++AH_TEMPLATE([PURE_TERMINFO], [too lazy to enter descriptions])
++AH_TEMPLATE([SVR4_ACTION], [too lazy to enter descriptions])
++AH_TEMPLATE([SVR4_TERMIO], [too lazy to enter descriptions])
++AH_TEMPLATE([SYSTEM_NAME], [too lazy to enter descriptions])
++AH_TEMPLATE([TERMINFO], [too lazy to enter descriptions])
++AH_TEMPLATE([TERMINFO_DIRS], [too lazy to enter descriptions])
++AH_TEMPLATE([TERMPATH], [too lazy to enter descriptions])
++AH_TEMPLATE([TYPEOF_CHTYPE], [too lazy to enter descriptions])
++AH_TEMPLATE([USE_ASSUMED_COLOR], [too lazy to enter descriptions])
++AH_TEMPLATE([USE_COLORFGBG], [too lazy to enter descriptions])
++AH_TEMPLATE([USE_DATABASE], [too lazy to enter descriptions])
++AH_TEMPLATE([USE_GETCAP], [too lazy to enter descriptions])
++AH_TEMPLATE([USE_GETCAP_CACHE], [too lazy to enter descriptions])
++AH_TEMPLATE([USE_HARD_TABS], [too lazy to enter descriptions])
++AH_TEMPLATE([USE_HASHMAP], [too lazy to enter descriptions])
++AH_TEMPLATE([USE_HOME_TERMINFO], [too lazy to enter descriptions])
++AH_TEMPLATE([USE_LINKS], [too lazy to enter descriptions])
++AH_TEMPLATE([USE_MY_MEMMOVE], [too lazy to enter descriptions])
++AH_TEMPLATE([USE_OK_BCOPY], [too lazy to enter descriptions])
++AH_TEMPLATE([USE_RCS_IDS], [too lazy to enter descriptions])
++AH_TEMPLATE([USE_ROOT_ENVIRON], [too lazy to enter descriptions])
++AH_TEMPLATE([USE_SAFE_SPRINTF], [too lazy to enter descriptions])
++AH_TEMPLATE([USE_SCROLL_HINTS], [too lazy to enter descriptions])
++AH_TEMPLATE([USE_SIGWINCH], [too lazy to enter descriptions])
++AH_TEMPLATE([USE_STDIO_VSCAN], [too lazy to enter descriptions])
++AH_TEMPLATE([USE_STRSTREAM_VSCAN], [too lazy to enter descriptions])
++AH_TEMPLATE([USE_STRSTREAM_VSCAN_CAST], [too lazy to enter descriptions])
++AH_TEMPLATE([USE_SYMLINKS], [too lazy to enter descriptions])
++AH_TEMPLATE([USE_SYSMOUSE], [too lazy to enter descriptions])
++AH_TEMPLATE([USE_TERMCAP], [too lazy to enter descriptions])
++AH_TEMPLATE([USE_WIDEC_SUPPORT], [too lazy to enter descriptions])
++AH_TEMPLATE([USE_XMC_SUPPORT], [too lazy to enter descriptions])
diff --git a/meta/recipes-core/ncurses/ncurses_5.4.bb b/meta/recipes-core/ncurses/ncurses_5.4.bb
new file mode 100644
index 000000000..e69c1c067
--- /dev/null
+++ b/meta/recipes-core/ncurses/ncurses_5.4.bb
@@ -0,0 +1,8 @@
+PR = "r14"
+
+SRC_URI = "${GNU_MIRROR}/ncurses/ncurses-${PV}.tar.gz \
+ file://makefile_tweak.patch;patch=1 \
+ file://visibility.patch;patch=1"
+S = "${WORKDIR}/ncurses-${PV}"
+
+require ncurses.inc
diff --git a/meta/recipes-core/readline/files/acinclude.m4 b/meta/recipes-core/readline/files/acinclude.m4
new file mode 100644
index 000000000..8a45f9908
--- /dev/null
+++ b/meta/recipes-core/readline/files/acinclude.m4
@@ -0,0 +1,1815 @@
+dnl
+dnl Bash specific tests
+dnl
+dnl Some derived from PDKSH 5.1.3 autoconf tests
+dnl
+
+AC_DEFUN([BASH_C_LONG_LONG],
+[AC_CACHE_CHECK(for long long, ac_cv_c_long_long,
+[if test "$GCC" = yes; then
+ ac_cv_c_long_long=yes
+else
+AC_TRY_RUN([
+int
+main()
+{
+long long foo = 0;
+exit(sizeof(long long) < sizeof(long));
+}
+], ac_cv_c_long_long=yes, ac_cv_c_long_long=no)
+fi])
+if test $ac_cv_c_long_long = yes; then
+ AC_DEFINE(HAVE_LONG_LONG, 1, [Define if the `long long' type works.])
+fi
+])
+
+dnl
+dnl This is very similar to AC_C_LONG_DOUBLE, with the fix for IRIX
+dnl (< changed to <=) added.
+dnl
+AC_DEFUN([BASH_C_LONG_DOUBLE],
+[AC_CACHE_CHECK(for long double, ac_cv_c_long_double,
+[if test "$GCC" = yes; then
+ ac_cv_c_long_double=yes
+else
+AC_TRY_RUN([
+int
+main()
+{
+ /* The Stardent Vistra knows sizeof(long double), but does not
+ support it. */
+ long double foo = 0.0;
+ /* On Ultrix 4.3 cc, long double is 4 and double is 8. */
+ /* On IRIX 5.3, the compiler converts long double to double with a warning,
+ but compiles this successfully. */
+ exit(sizeof(long double) <= sizeof(double));
+}
+], ac_cv_c_long_double=yes, ac_cv_c_long_double=no)
+fi])
+if test $ac_cv_c_long_double = yes; then
+ AC_DEFINE(HAVE_LONG_DOUBLE, 1, [Define if the `long double' type works.])
+fi
+])
+
+dnl
+dnl Check for <inttypes.h>. This is separated out so that it can be
+dnl AC_REQUIREd.
+dnl
+dnl BASH_HEADER_INTTYPES
+AC_DEFUN([BASH_HEADER_INTTYPES],
+[
+ AC_CHECK_HEADERS(inttypes.h)
+])
+
+dnl
+dnl check for typedef'd symbols in header files, but allow the caller to
+dnl specify the include files to be checked in addition to the default
+dnl
+dnl BASH_CHECK_TYPE(TYPE, HEADERS, DEFAULT[, VALUE-IF-FOUND])
+AC_DEFUN([BASH_CHECK_TYPE],
+[
+AC_REQUIRE([AC_HEADER_STDC])dnl
+AC_REQUIRE([BASH_HEADER_INTTYPES])
+AC_MSG_CHECKING(for $1)
+AC_CACHE_VAL(bash_cv_type_$1,
+[AC_EGREP_CPP($1, [#include <sys/types.h>
+#if STDC_HEADERS
+#include <stdlib.h>
+#include <stddef.h>
+#endif
+#if HAVE_INTTYPES_H
+#include <inttypes.h>
+#endif
+$2
+], bash_cv_type_$1=yes, bash_cv_type_$1=no)])
+AC_MSG_RESULT($bash_cv_type_$1)
+ifelse($#, 4, [if test $bash_cv_type_$1 = yes; then
+ AC_DEFINE($4)
+ fi])
+if test $bash_cv_type_$1 = no; then
+ AC_DEFINE_UNQUOTED($1, $3)
+fi
+])
+
+dnl
+dnl BASH_CHECK_DECL(FUNC)
+dnl
+dnl Check for a declaration of FUNC in stdlib.h and inttypes.h like
+dnl AC_CHECK_DECL
+dnl
+AC_DEFUN([BASH_CHECK_DECL],
+[
+AC_REQUIRE([AC_HEADER_STDC])
+AC_REQUIRE([BASH_HEADER_INTTYPES])
+AC_CACHE_CHECK([for declaration of $1], bash_cv_decl_$1,
+[AC_TRY_LINK(
+[
+#if STDC_HEADERS
+# include <stdlib.h>
+#endif
+#if HAVE_INTTYPES_H
+# include <inttypes.h>
+#endif
+],
+[return !$1;],
+bash_cv_decl_$1=yes, bash_cv_decl_$1=no)])
+bash_tr_func=HAVE_DECL_`echo $1 | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
+if test $bash_cv_decl_$1 = yes; then
+ AC_DEFINE_UNQUOTED($bash_tr_func, 1)
+else
+ AC_DEFINE_UNQUOTED($bash_tr_func, 0)
+fi
+])
+
+AC_DEFUN([BASH_DECL_PRINTF],
+[AC_MSG_CHECKING(for declaration of printf in <stdio.h>)
+AC_CACHE_VAL(bash_cv_printf_declared,
+[AC_TRY_RUN([
+#include <stdio.h>
+#ifdef __STDC__
+typedef int (*_bashfunc)(const char *, ...);
+#else
+typedef int (*_bashfunc)();
+#endif
+main()
+{
+_bashfunc pf;
+pf = (_bashfunc) printf;
+exit(pf == 0);
+}
+], bash_cv_printf_declared=yes, bash_cv_printf_declared=no,
+ [AC_MSG_WARN(cannot check printf declaration if cross compiling -- defaulting to yes)
+ bash_cv_printf_declared=yes]
+)])
+AC_MSG_RESULT($bash_cv_printf_declared)
+if test $bash_cv_printf_declared = yes; then
+AC_DEFINE(PRINTF_DECLARED)
+fi
+])
+
+AC_DEFUN([BASH_DECL_SBRK],
+[AC_MSG_CHECKING(for declaration of sbrk in <unistd.h>)
+AC_CACHE_VAL(bash_cv_sbrk_declared,
+[AC_EGREP_HEADER(sbrk, unistd.h,
+ bash_cv_sbrk_declared=yes, bash_cv_sbrk_declared=no)])
+AC_MSG_RESULT($bash_cv_sbrk_declared)
+if test $bash_cv_sbrk_declared = yes; then
+AC_DEFINE(SBRK_DECLARED)
+fi
+])
+
+dnl
+dnl Check for sys_siglist[] or _sys_siglist[]
+dnl
+AC_DEFUN([BASH_DECL_UNDER_SYS_SIGLIST],
+[AC_MSG_CHECKING([for _sys_siglist in signal.h or unistd.h])
+AC_CACHE_VAL(bash_cv_decl_under_sys_siglist,
+[AC_TRY_COMPILE([
+#include <sys/types.h>
+#include <signal.h>
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif], [ char *msg = _sys_siglist[2]; ],
+ bash_cv_decl_under_sys_siglist=yes, bash_cv_decl_under_sys_siglist=no,
+ [AC_MSG_WARN(cannot check for _sys_siglist[] if cross compiling -- defaulting to no)])])dnl
+AC_MSG_RESULT($bash_cv_decl_under_sys_siglist)
+if test $bash_cv_decl_under_sys_siglist = yes; then
+AC_DEFINE(UNDER_SYS_SIGLIST_DECLARED)
+fi
+])
+
+AC_DEFUN([BASH_UNDER_SYS_SIGLIST],
+[AC_REQUIRE([BASH_DECL_UNDER_SYS_SIGLIST])
+AC_MSG_CHECKING([for _sys_siglist in system C library])
+AC_CACHE_VAL(bash_cv_under_sys_siglist,
+[AC_TRY_RUN([
+#include <sys/types.h>
+#include <signal.h>
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#ifndef UNDER_SYS_SIGLIST_DECLARED
+extern char *_sys_siglist[];
+#endif
+main()
+{
+char *msg = (char *)_sys_siglist[2];
+exit(msg == 0);
+}],
+ bash_cv_under_sys_siglist=yes, bash_cv_under_sys_siglist=no,
+ [AC_MSG_WARN(cannot check for _sys_siglist[] if cross compiling -- defaulting to no)
+ bash_cv_under_sys_siglist=no])])
+AC_MSG_RESULT($bash_cv_under_sys_siglist)
+if test $bash_cv_under_sys_siglist = yes; then
+AC_DEFINE(HAVE_UNDER_SYS_SIGLIST)
+fi
+])
+
+AC_DEFUN([BASH_SYS_SIGLIST],
+[
+AC_CHECK_DECLS([sys_siglist])
+AC_MSG_CHECKING([for sys_siglist in system C library])
+AC_CACHE_VAL(bash_cv_sys_siglist,
+[AC_TRY_RUN([
+#include <sys/types.h>
+#include <signal.h>
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#ifndef HAVE_DECL_SYS_SIGLIST
+extern char *sys_siglist[];
+#endif
+main()
+{
+char *msg = sys_siglist[2];
+exit(msg == 0);
+}],
+ bash_cv_sys_siglist=yes, bash_cv_sys_siglist=no,
+ [AC_MSG_WARN(cannot check for sys_siglist if cross compiling -- defaulting to no)
+ bash_cv_sys_siglist=no])])
+AC_MSG_RESULT($bash_cv_sys_siglist)
+if test $bash_cv_sys_siglist = yes; then
+AC_DEFINE(HAVE_SYS_SIGLIST)
+fi
+])
+
+dnl Check for the various permutations of sys_siglist and make sure we
+dnl compile in siglist.o if they're not defined
+AC_DEFUN([BASH_CHECK_SYS_SIGLIST], [
+AC_REQUIRE([BASH_SYS_SIGLIST])
+AC_REQUIRE([BASH_DECL_UNDER_SYS_SIGLIST])
+AC_REQUIRE([BASH_FUNC_STRSIGNAL])
+if test "$bash_cv_sys_siglist" = no && test "$bash_cv_under_sys_siglist" = no && test "$bash_cv_have_strsignal" = no; then
+ SIGLIST_O=siglist.o
+else
+ SIGLIST_O=
+fi
+AC_SUBST([SIGLIST_O])
+])
+
+dnl Check for sys_errlist[] and sys_nerr, check for declaration
+AC_DEFUN([BASH_SYS_ERRLIST],
+[AC_MSG_CHECKING([for sys_errlist and sys_nerr])
+AC_CACHE_VAL(bash_cv_sys_errlist,
+[AC_TRY_LINK([#include <errno.h>],
+[extern char *sys_errlist[];
+ extern int sys_nerr;
+ char *msg = sys_errlist[sys_nerr - 1];],
+ bash_cv_sys_errlist=yes, bash_cv_sys_errlist=no)])dnl
+AC_MSG_RESULT($bash_cv_sys_errlist)
+if test $bash_cv_sys_errlist = yes; then
+AC_DEFINE(HAVE_SYS_ERRLIST)
+fi
+])
+
+dnl
+dnl Check if dup2() does not clear the close on exec flag
+dnl
+AC_DEFUN([BASH_FUNC_DUP2_CLOEXEC_CHECK],
+[AC_MSG_CHECKING(if dup2 fails to clear the close-on-exec flag)
+AC_CACHE_VAL(bash_cv_dup2_broken,
+[AC_TRY_RUN([
+#include <sys/types.h>
+#include <fcntl.h>
+main()
+{
+ int fd1, fd2, fl;
+ fd1 = open("/dev/null", 2);
+ if (fcntl(fd1, 2, 1) < 0)
+ exit(1);
+ fd2 = dup2(fd1, 1);
+ if (fd2 < 0)
+ exit(2);
+ fl = fcntl(fd2, 1, 0);
+ /* fl will be 1 if dup2 did not reset the close-on-exec flag. */
+ exit(fl != 1);
+}
+], bash_cv_dup2_broken=yes, bash_cv_dup2_broken=no,
+ [AC_MSG_WARN(cannot check dup2 if cross compiling -- defaulting to no)
+ bash_cv_dup2_broken=no])
+])
+AC_MSG_RESULT($bash_cv_dup2_broken)
+if test $bash_cv_dup2_broken = yes; then
+AC_DEFINE(DUP2_BROKEN)
+fi
+])
+
+AC_DEFUN([BASH_FUNC_STRSIGNAL],
+[AC_MSG_CHECKING([for the existence of strsignal])
+AC_CACHE_VAL(bash_cv_have_strsignal,
+[AC_TRY_LINK([#include <sys/types.h>
+#include <signal.h>],
+[char *s = (char *)strsignal(2);],
+ bash_cv_have_strsignal=yes, bash_cv_have_strsignal=no)])
+AC_MSG_RESULT($bash_cv_have_strsignal)
+if test $bash_cv_have_strsignal = yes; then
+AC_DEFINE(HAVE_STRSIGNAL)
+fi
+])
+
+dnl Check to see if opendir will open non-directories (not a nice thing)
+AC_DEFUN([BASH_FUNC_OPENDIR_CHECK],
+[AC_REQUIRE([AC_HEADER_DIRENT])dnl
+AC_MSG_CHECKING(if opendir() opens non-directories)
+AC_CACHE_VAL(bash_cv_opendir_not_robust,
+[AC_TRY_RUN([
+#include <stdio.h>
+#include <sys/types.h>
+#include <fcntl.h>
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif /* HAVE_UNISTD_H */
+#if defined(HAVE_DIRENT_H)
+# include <dirent.h>
+#else
+# define dirent direct
+# ifdef HAVE_SYS_NDIR_H
+# include <sys/ndir.h>
+# endif /* SYSNDIR */
+# ifdef HAVE_SYS_DIR_H
+# include <sys/dir.h>
+# endif /* SYSDIR */
+# ifdef HAVE_NDIR_H
+# include <ndir.h>
+# endif
+#endif /* HAVE_DIRENT_H */
+main()
+{
+DIR *dir;
+int fd, err;
+err = mkdir("/tmp/bash-aclocal", 0700);
+if (err < 0) {
+ perror("mkdir");
+ exit(1);
+}
+unlink("/tmp/bash-aclocal/not_a_directory");
+fd = open("/tmp/bash-aclocal/not_a_directory", O_WRONLY|O_CREAT|O_EXCL, 0666);
+write(fd, "\n", 1);
+close(fd);
+dir = opendir("/tmp/bash-aclocal/not_a_directory");
+unlink("/tmp/bash-aclocal/not_a_directory");
+rmdir("/tmp/bash-aclocal");
+exit (dir == 0);
+}], bash_cv_opendir_not_robust=yes,bash_cv_opendir_not_robust=no,
+ [AC_MSG_WARN(cannot check opendir if cross compiling -- defaulting to no)
+ bash_cv_opendir_not_robust=no]
+)])
+AC_MSG_RESULT($bash_cv_opendir_not_robust)
+if test $bash_cv_opendir_not_robust = yes; then
+AC_DEFINE(OPENDIR_NOT_ROBUST)
+fi
+])
+
+dnl
+AH_TEMPLATE([VOID_SIGHANDLER], [Define if signal handlers return type void])
+AC_DEFUN([BASH_TYPE_SIGHANDLER],
+[AC_MSG_CHECKING([whether signal handlers are of type void])
+AC_CACHE_VAL(bash_cv_void_sighandler,
+[AC_TRY_COMPILE([#include <sys/types.h>
+#include <signal.h>
+#ifdef signal
+#undef signal
+#endif
+#ifdef __cplusplus
+extern "C"
+#endif
+void (*signal ()) ();],
+[int i;], bash_cv_void_sighandler=yes, bash_cv_void_sighandler=no)])dnl
+AC_MSG_RESULT($bash_cv_void_sighandler)
+if test $bash_cv_void_sighandler = yes; then
+AC_DEFINE(VOID_SIGHANDLER)
+fi
+])
+
+dnl
+dnl A signed 16-bit integer quantity
+dnl
+AC_DEFUN([BASH_TYPE_BITS16_T],
+[
+if test "$ac_cv_sizeof_short" = 2; then
+ AC_CHECK_TYPE(bits16_t, short)
+elif test "$ac_cv_sizeof_char" = 2; then
+ AC_CHECK_TYPE(bits16_t, char)
+else
+ AC_CHECK_TYPE(bits16_t, short)
+fi
+])
+
+dnl
+dnl An unsigned 16-bit integer quantity
+dnl
+AC_DEFUN([BASH_TYPE_U_BITS16_T],
+[
+if test "$ac_cv_sizeof_short" = 2; then
+ AC_CHECK_TYPE(u_bits16_t, unsigned short)
+elif test "$ac_cv_sizeof_char" = 2; then
+ AC_CHECK_TYPE(u_bits16_t, unsigned char)
+else
+ AC_CHECK_TYPE(u_bits16_t, unsigned short)
+fi
+])
+
+dnl
+dnl A signed 32-bit integer quantity
+dnl
+AC_DEFUN([BASH_TYPE_BITS32_T],
+[
+if test "$ac_cv_sizeof_int" = 4; then
+ AC_CHECK_TYPE(bits32_t, int)
+elif test "$ac_cv_sizeof_long" = 4; then
+ AC_CHECK_TYPE(bits32_t, long)
+else
+ AC_CHECK_TYPE(bits32_t, int)
+fi
+])
+
+dnl
+dnl An unsigned 32-bit integer quantity
+dnl
+AC_DEFUN([BASH_TYPE_U_BITS32_T],
+[
+if test "$ac_cv_sizeof_int" = 4; then
+ AC_CHECK_TYPE(u_bits32_t, unsigned int)
+elif test "$ac_cv_sizeof_long" = 4; then
+ AC_CHECK_TYPE(u_bits32_t, unsigned long)
+else
+ AC_CHECK_TYPE(u_bits32_t, unsigned int)
+fi
+])
+
+AC_DEFUN([BASH_TYPE_PTRDIFF_T],
+[
+if test "$ac_cv_sizeof_int" = "$ac_cv_sizeof_char_p"; then
+ AC_CHECK_TYPE(ptrdiff_t, int)
+elif test "$ac_cv_sizeof_long" = "$ac_cv_sizeof_char_p"; then
+ AC_CHECK_TYPE(ptrdiff_t, long)
+elif test "$ac_cv_type_long_long" = yes && test "$ac_cv_sizeof_long_long" = "$ac_cv_sizeof_char_p"; then
+ AC_CHECK_TYPE(ptrdiff_t, [long long])
+else
+ AC_CHECK_TYPE(ptrdiff_t, int)
+fi
+])
+
+dnl
+dnl A signed 64-bit quantity
+dnl
+AC_DEFUN([BASH_TYPE_BITS64_T],
+[
+if test "$ac_cv_sizeof_char_p" = 8; then
+ AC_CHECK_TYPE(bits64_t, char *)
+elif test "$ac_cv_sizeof_double" = 8; then
+ AC_CHECK_TYPE(bits64_t, double)
+elif test -n "$ac_cv_type_long_long" && test "$ac_cv_sizeof_long_long" = 8; then
+ AC_CHECK_TYPE(bits64_t, [long long])
+elif test "$ac_cv_sizeof_long" = 8; then
+ AC_CHECK_TYPE(bits64_t, long)
+else
+ AC_CHECK_TYPE(bits64_t, double)
+fi
+])
+
+AC_DEFUN([BASH_TYPE_LONG_LONG],
+[
+AC_CACHE_CHECK([for long long], bash_cv_type_long_long,
+[AC_TRY_LINK([
+long long ll = 1; int i = 63;],
+[
+long long llm = (long long) -1;
+return ll << i | ll >> i | llm / ll | llm % ll;
+], bash_cv_type_long_long='long long', bash_cv_type_long_long='long')])
+if test "$bash_cv_type_long_long" = 'long long'; then
+ AC_DEFINE(HAVE_LONG_LONG, 1)
+fi
+])
+
+AC_DEFUN([BASH_TYPE_UNSIGNED_LONG_LONG],
+[
+AC_CACHE_CHECK([for unsigned long long], bash_cv_type_unsigned_long_long,
+[AC_TRY_LINK([
+unsigned long long ull = 1; int i = 63;],
+[
+unsigned long long ullmax = (unsigned long long) -1;
+return ull << i | ull >> i | ullmax / ull | ullmax % ull;
+], bash_cv_type_unsigned_long_long='unsigned long long',
+ bash_cv_type_unsigned_long_long='unsigned long')])
+if test "$bash_cv_type_unsigned_long_long" = 'unsigned long long'; then
+ AC_DEFINE(HAVE_UNSIGNED_LONG_LONG, 1)
+fi
+])
+
+dnl
+dnl Type of struct rlimit fields: some systems (OSF/1, NetBSD, RISC/os 5.0)
+dnl have a rlim_t, others (4.4BSD based systems) use quad_t, others use
+dnl long and still others use int (HP-UX 9.01, SunOS 4.1.3). To simplify
+dnl matters, this just checks for rlim_t, quad_t, or long.
+dnl
+AC_DEFUN([BASH_TYPE_RLIMIT],
+[AC_MSG_CHECKING(for size and type of struct rlimit fields)
+AC_CACHE_VAL(bash_cv_type_rlimit,
+[AC_TRY_COMPILE([#include <sys/types.h>
+#include <sys/resource.h>],
+[rlim_t xxx;], bash_cv_type_rlimit=rlim_t,[
+AC_TRY_RUN([
+#include <sys/types.h>
+#include <sys/time.h>
+#include <sys/resource.h>
+main()
+{
+#ifdef HAVE_QUAD_T
+ struct rlimit rl;
+ if (sizeof(rl.rlim_cur) == sizeof(quad_t))
+ exit(0);
+#endif
+ exit(1);
+}], bash_cv_type_rlimit=quad_t, bash_cv_type_rlimit=long,
+ [AC_MSG_WARN(cannot check quad_t if cross compiling -- defaulting to long)
+ bash_cv_type_rlimit=long])])
+])
+AC_MSG_RESULT($bash_cv_type_rlimit)
+if test $bash_cv_type_rlimit = quad_t; then
+AC_DEFINE(RLIMTYPE, quad_t)
+elif test $bash_cv_type_rlimit = rlim_t; then
+AC_DEFINE(RLIMTYPE, rlim_t)
+fi
+])
+
+AC_DEFUN([BASH_FUNC_LSTAT],
+[dnl Cannot use AC_CHECK_FUNCS(lstat) because Linux defines lstat() as an
+dnl inline function in <sys/stat.h>.
+AC_CACHE_CHECK([for lstat], bash_cv_func_lstat,
+[AC_TRY_LINK([
+#include <sys/types.h>
+#include <sys/stat.h>
+],[ lstat(".",(struct stat *)0); ],
+bash_cv_func_lstat=yes, bash_cv_func_lstat=no)])
+if test $bash_cv_func_lstat = yes; then
+ AC_DEFINE(HAVE_LSTAT)
+fi
+])
+
+AC_DEFUN([BASH_FUNC_INET_ATON],
+[
+AC_CACHE_CHECK([for inet_aton], bash_cv_func_inet_aton,
+[AC_TRY_LINK([
+#include <sys/types.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+struct in_addr ap;], [ inet_aton("127.0.0.1", &ap); ],
+bash_cv_func_inet_aton=yes, bash_cv_func_inet_aton=no)])
+if test $bash_cv_func_inet_aton = yes; then
+ AC_DEFINE(HAVE_INET_ATON)
+else
+ AC_LIBOBJ(inet_aton)
+fi
+])
+
+AC_DEFUN([BASH_FUNC_GETENV],
+[AC_MSG_CHECKING(to see if getenv can be redefined)
+AC_CACHE_VAL(bash_cv_getenv_redef,
+[AC_TRY_RUN([
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif
+#ifndef __STDC__
+# ifndef const
+# define const
+# endif
+#endif
+char *
+getenv (name)
+#if defined (__linux__) || defined (__bsdi__) || defined (convex)
+ const char *name;
+#else
+ char const *name;
+#endif /* !__linux__ && !__bsdi__ && !convex */
+{
+return "42";
+}
+main()
+{
+char *s;
+/* The next allows this program to run, but does not allow bash to link
+ when it redefines getenv. I'm not really interested in figuring out
+ why not. */
+#if defined (NeXT)
+exit(1);
+#endif
+s = getenv("ABCDE");
+exit(s == 0); /* force optimizer to leave getenv in */
+}
+], bash_cv_getenv_redef=yes, bash_cv_getenv_redef=no,
+ [AC_MSG_WARN(cannot check getenv redefinition if cross compiling -- defaulting to yes)
+ bash_cv_getenv_redef=yes]
+)])
+AC_MSG_RESULT($bash_cv_getenv_redef)
+if test $bash_cv_getenv_redef = yes; then
+AC_DEFINE(CAN_REDEFINE_GETENV)
+fi
+])
+
+# We should check for putenv before calling this
+AC_DEFUN([BASH_FUNC_STD_PUTENV],
+[
+AC_REQUIRE([AC_HEADER_STDC])
+AC_REQUIRE([AC_C_PROTOTYPES])
+AC_CACHE_CHECK([for standard-conformant putenv declaration], bash_cv_std_putenv,
+[AC_TRY_LINK([
+#if STDC_HEADERS
+#include <stdlib.h>
+#include <stddef.h>
+#endif
+#ifndef __STDC__
+# ifndef const
+# define const
+# endif
+#endif
+#ifdef PROTOTYPES
+extern int putenv (char *);
+#else
+extern int putenv ();
+#endif
+],
+[return (putenv == 0);],
+bash_cv_std_putenv=yes, bash_cv_std_putenv=no
+)])
+if test $bash_cv_std_putenv = yes; then
+AC_DEFINE(HAVE_STD_PUTENV)
+fi
+])
+
+# We should check for unsetenv before calling this
+AC_DEFUN([BASH_FUNC_STD_UNSETENV],
+[
+AC_REQUIRE([AC_HEADER_STDC])
+AC_REQUIRE([AC_C_PROTOTYPES])
+AC_CACHE_CHECK([for standard-conformant unsetenv declaration], bash_cv_std_unsetenv,
+[AC_TRY_LINK([
+#if STDC_HEADERS
+#include <stdlib.h>
+#include <stddef.h>
+#endif
+#ifndef __STDC__
+# ifndef const
+# define const
+# endif
+#endif
+#ifdef PROTOTYPES
+extern int unsetenv (const char *);
+#else
+extern int unsetenv ();
+#endif
+],
+[return (unsetenv == 0);],
+bash_cv_std_unsetenv=yes, bash_cv_std_unsetenv=no
+)])
+if test $bash_cv_std_unsetenv = yes; then
+AC_DEFINE(HAVE_STD_UNSETENV)
+fi
+])
+
+AC_DEFUN([BASH_FUNC_ULIMIT_MAXFDS],
+[AC_MSG_CHECKING(whether ulimit can substitute for getdtablesize)
+AC_CACHE_VAL(bash_cv_ulimit_maxfds,
+[AC_TRY_RUN([
+main()
+{
+long maxfds = ulimit(4, 0L);
+exit (maxfds == -1L);
+}
+], bash_cv_ulimit_maxfds=yes, bash_cv_ulimit_maxfds=no,
+ [AC_MSG_WARN(cannot check ulimit if cross compiling -- defaulting to no)
+ bash_cv_ulimit_maxfds=no]
+)])
+AC_MSG_RESULT($bash_cv_ulimit_maxfds)
+if test $bash_cv_ulimit_maxfds = yes; then
+AC_DEFINE(ULIMIT_MAXFDS)
+fi
+])
+
+AC_DEFUN([BASH_FUNC_GETCWD],
+[AC_MSG_CHECKING([if getcwd() calls popen()])
+AC_CACHE_VAL(bash_cv_getcwd_calls_popen,
+[AC_TRY_RUN([
+#include <stdio.h>
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
+#ifndef __STDC__
+#ifndef const
+#define const
+#endif
+#endif
+
+int popen_called;
+
+FILE *
+popen(command, type)
+ const char *command;
+ const char *type;
+{
+ popen_called = 1;
+ return (FILE *)NULL;
+}
+
+FILE *_popen(command, type)
+ const char *command;
+ const char *type;
+{
+ return (popen (command, type));
+}
+
+int
+pclose(stream)
+FILE *stream;
+{
+ return 0;
+}
+
+int
+_pclose(stream)
+FILE *stream;
+{
+ return 0;
+}
+
+main()
+{
+ char lbuf[32];
+ popen_called = 0;
+ getcwd(lbuf, 32);
+ exit (popen_called);
+}
+], bash_cv_getcwd_calls_popen=no, bash_cv_getcwd_calls_popen=yes,
+ [AC_MSG_WARN(cannot check whether getcwd calls popen if cross compiling -- defaulting to no)
+ bash_cv_getcwd_calls_popen=no]
+)])
+AC_MSG_RESULT($bash_cv_getcwd_calls_popen)
+if test $bash_cv_getcwd_calls_popen = yes; then
+AC_DEFINE(GETCWD_BROKEN)
+AC_LIBOBJ(getcwd)
+fi
+])
+
+dnl
+dnl This needs BASH_CHECK_SOCKLIB, but since that's not called on every
+dnl system, we can't use AC_PREREQ
+dnl
+AC_DEFUN([BASH_FUNC_GETHOSTBYNAME],
+[if test "X$bash_cv_have_gethostbyname" = "X"; then
+_bash_needmsg=yes
+else
+AC_MSG_CHECKING(for gethostbyname in socket library)
+_bash_needmsg=
+fi
+AC_CACHE_VAL(bash_cv_have_gethostbyname,
+[AC_TRY_LINK([#include <netdb.h>],
+[ struct hostent *hp;
+ hp = gethostbyname("localhost");
+], bash_cv_have_gethostbyname=yes, bash_cv_have_gethostbyname=no)]
+)
+if test "X$_bash_needmsg" = Xyes; then
+ AC_MSG_CHECKING(for gethostbyname in socket library)
+fi
+AC_MSG_RESULT($bash_cv_have_gethostbyname)
+if test "$bash_cv_have_gethostbyname" = yes; then
+AC_DEFINE(HAVE_GETHOSTBYNAME)
+fi
+])
+
+AC_DEFUN([BASH_FUNC_FNMATCH_EXTMATCH],
+[AC_MSG_CHECKING(if fnmatch does extended pattern matching with FNM_EXTMATCH)
+AC_CACHE_VAL(bash_cv_fnm_extmatch,
+[AC_TRY_RUN([
+#include <fnmatch.h>
+
+main()
+{
+#ifdef FNM_EXTMATCH
+ exit (0);
+#else
+ exit (1);
+#endif
+}
+], bash_cv_fnm_extmatch=yes, bash_cv_fnm_extmatch=no,
+ [AC_MSG_WARN(cannot check FNM_EXTMATCH if cross compiling -- defaulting to no)
+ bash_cv_fnm_extmatch=no])
+])
+AC_MSG_RESULT($bash_cv_fnm_extmatch)
+if test $bash_cv_fnm_extmatch = yes; then
+AC_DEFINE(HAVE_LIBC_FNM_EXTMATCH)
+fi
+])
+
+AH_TEMPLATE([HAVE_POSIX_SIGSETJMP], [Define if we POSIX-style sigsetjmp/siglongjmp are available])
+AC_DEFUN([BASH_FUNC_POSIX_SETJMP],
+[AC_REQUIRE([BASH_SYS_SIGNAL_VINTAGE])
+AC_MSG_CHECKING(for presence of POSIX-style sigsetjmp/siglongjmp)
+AC_CACHE_VAL(bash_cv_func_sigsetjmp,
+[AC_TRY_RUN([
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#include <sys/types.h>
+#include <signal.h>
+#include <setjmp.h>
+
+main()
+{
+#if !defined (_POSIX_VERSION) || !defined (HAVE_POSIX_SIGNALS)
+exit (1);
+#else
+
+int code;
+sigset_t set, oset;
+sigjmp_buf xx;
+
+/* get the mask */
+sigemptyset(&set);
+sigemptyset(&oset);
+sigprocmask(SIG_BLOCK, (sigset_t *)NULL, &set);
+sigprocmask(SIG_BLOCK, (sigset_t *)NULL, &oset);
+
+/* save it */
+code = sigsetjmp(xx, 1);
+if (code)
+ exit(0); /* could get sigmask and compare to oset here. */
+
+/* change it */
+sigaddset(&set, SIGINT);
+sigprocmask(SIG_BLOCK, &set, (sigset_t *)NULL);
+
+/* and siglongjmp */
+siglongjmp(xx, 10);
+exit(1);
+#endif
+}], bash_cv_func_sigsetjmp=present, bash_cv_func_sigsetjmp=missing,
+ [AC_MSG_WARN(cannot check for sigsetjmp/siglongjmp if cross-compiling -- defaulting to missing)
+ bash_cv_func_sigsetjmp=missing]
+)])
+AC_MSG_RESULT($bash_cv_func_sigsetjmp)
+if test $bash_cv_func_sigsetjmp = present; then
+AC_DEFINE(HAVE_POSIX_SIGSETJMP)
+fi
+])
+
+AH_TEMPLATE([STRCOLL_BROKEN], [Define if strcoll is broken with respect to strcmp in the default locale.])
+AC_DEFUN([BASH_FUNC_STRCOLL],
+[
+AC_MSG_CHECKING(whether or not strcoll and strcmp differ)
+AC_CACHE_VAL(bash_cv_func_strcoll_broken,
+[AC_TRY_RUN([
+#include <stdio.h>
+#if defined (HAVE_LOCALE_H)
+#include <locale.h>
+#endif
+
+main(c, v)
+int c;
+char *v[];
+{
+ int r1, r2;
+ char *deflocale, *defcoll;
+
+#ifdef HAVE_SETLOCALE
+ deflocale = setlocale(LC_ALL, "");
+ defcoll = setlocale(LC_COLLATE, "");
+#endif
+
+#ifdef HAVE_STRCOLL
+ /* These two values are taken from tests/glob-test. */
+ r1 = strcoll("abd", "aXd");
+#else
+ r1 = 0;
+#endif
+ r2 = strcmp("abd", "aXd");
+
+ /* These two should both be greater than 0. It is permissible for
+ a system to return different values, as long as the sign is the
+ same. */
+
+ /* Exit with 1 (failure) if these two values are both > 0, since
+ this tests whether strcoll(3) is broken with respect to strcmp(3)
+ in the default locale. */
+ exit (r1 > 0 && r2 > 0);
+}
+], bash_cv_func_strcoll_broken=yes, bash_cv_func_strcoll_broken=no,
+ [AC_MSG_WARN(cannot check strcoll if cross compiling -- defaulting to no)
+ bash_cv_func_strcoll_broken=no]
+)])
+AC_MSG_RESULT($bash_cv_func_strcoll_broken)
+if test $bash_cv_func_strcoll_broken = yes; then
+AC_DEFINE(STRCOLL_BROKEN)
+fi
+])
+
+AC_DEFUN([BASH_FUNC_PRINTF_A_FORMAT],
+[AC_MSG_CHECKING([for printf floating point output in hex notation])
+AC_CACHE_VAL(bash_cv_printf_a_format,
+[AC_TRY_RUN([
+#include <stdio.h>
+#include <string.h>
+
+int
+main()
+{
+ double y = 0.0;
+ char abuf[1024];
+
+ sprintf(abuf, "%A", y);
+ exit(strchr(abuf, 'P') == (char *)0);
+}
+], bash_cv_printf_a_format=yes, bash_cv_printf_a_format=no,
+ [AC_MSG_WARN(cannot check printf if cross compiling -- defaulting to no)
+ bash_cv_printf_a_format=no]
+)])
+AC_MSG_RESULT($bash_cv_printf_a_format)
+if test $bash_cv_printf_a_format = yes; then
+AC_DEFINE(HAVE_PRINTF_A_FORMAT)
+fi
+])
+
+AC_DEFUN([BASH_STRUCT_TERMIOS_LDISC],
+[
+AC_CHECK_MEMBER(struct termios.c_line, AC_DEFINE(TERMIOS_LDISC), ,[
+#include <sys/types.h>
+#include <termios.h>
+])
+])
+
+AC_DEFUN([BASH_STRUCT_TERMIO_LDISC],
+[
+AC_CHECK_MEMBER(struct termio.c_line, AC_DEFINE(TERMIO_LDISC), ,[
+#include <sys/types.h>
+#include <termio.h>
+])
+])
+
+dnl
+dnl Like AC_STRUCT_ST_BLOCKS, but doesn't muck with LIBOBJS
+dnl
+dnl sets bash_cv_struct_stat_st_blocks
+dnl
+dnl unused for now; we'll see how AC_CHECK_MEMBERS works
+dnl
+AC_DEFUN([BASH_STRUCT_ST_BLOCKS],
+[
+AC_MSG_CHECKING([for struct stat.st_blocks])
+AC_CACHE_VAL(bash_cv_struct_stat_st_blocks,
+[AC_TRY_COMPILE(
+[
+#include <sys/types.h>
+#include <sys/stat.h>
+],
+[
+main()
+{
+static struct stat a;
+if (a.st_blocks) return 0;
+return 0;
+}
+], bash_cv_struct_stat_st_blocks=yes, bash_cv_struct_stat_st_blocks=no)
+])
+AC_MSG_RESULT($bash_cv_struct_stat_st_blocks)
+if test "$bash_cv_struct_stat_st_blocks" = "yes"; then
+AC_DEFINE(HAVE_STRUCT_STAT_ST_BLOCKS)
+fi
+])
+
+AC_DEFUN([BASH_CHECK_LIB_TERMCAP],
+[
+if test "X$bash_cv_termcap_lib" = "X"; then
+_bash_needmsg=yes
+else
+AC_MSG_CHECKING(which library has the termcap functions)
+_bash_needmsg=
+fi
+AC_CACHE_VAL(bash_cv_termcap_lib,
+[AC_CHECK_LIB(termcap, tgetent, bash_cv_termcap_lib=libtermcap,
+ [AC_CHECK_LIB(tinfo, tgetent, bash_cv_termcap_lib=libtinfo,
+ [AC_CHECK_LIB(curses, tgetent, bash_cv_termcap_lib=libcurses,
+ [AC_CHECK_LIB(ncurses, tgetent, bash_cv_termcap_lib=libncurses,
+ bash_cv_termcap_lib=gnutermcap)])])])])
+if test "X$_bash_needmsg" = "Xyes"; then
+AC_MSG_CHECKING(which library has the termcap functions)
+fi
+AC_MSG_RESULT(using $bash_cv_termcap_lib)
+if test $bash_cv_termcap_lib = gnutermcap && test -z "$prefer_curses"; then
+LDFLAGS="$LDFLAGS -L./lib/termcap"
+TERMCAP_LIB="./lib/termcap/libtermcap.a"
+TERMCAP_DEP="./lib/termcap/libtermcap.a"
+elif test $bash_cv_termcap_lib = libtermcap && test -z "$prefer_curses"; then
+TERMCAP_LIB=-ltermcap
+TERMCAP_DEP=
+elif test $bash_cv_termcap_lib = libtinfo; then
+TERMCAP_LIB=-ltinfo
+TERMCAP_DEP=
+elif test $bash_cv_termcap_lib = libncurses; then
+TERMCAP_LIB=-lncurses
+TERMCAP_DEP=
+else
+TERMCAP_LIB=-lcurses
+TERMCAP_DEP=
+fi
+])
+
+dnl
+dnl Check for the presence of getpeername in libsocket.
+dnl If libsocket is present, check for libnsl and add it to LIBS if
+dnl it's there, since most systems with libsocket require linking
+dnl with libnsl as well. This should only be called if getpeername
+dnl was not found in libc.
+dnl
+dnl NOTE: IF WE FIND GETPEERNAME, WE ASSUME THAT WE HAVE BIND/CONNECT
+dnl AS WELL
+dnl
+AC_DEFUN([BASH_CHECK_LIB_SOCKET],
+[
+if test "X$bash_cv_have_socklib" = "X"; then
+_bash_needmsg=
+else
+AC_MSG_CHECKING(for socket library)
+_bash_needmsg=yes
+fi
+AC_CACHE_VAL(bash_cv_have_socklib,
+[AC_CHECK_LIB(socket, getpeername,
+ bash_cv_have_socklib=yes, bash_cv_have_socklib=no, -lnsl)])
+if test "X$_bash_needmsg" = Xyes; then
+ AC_MSG_RESULT($bash_cv_have_socklib)
+ _bash_needmsg=
+fi
+if test $bash_cv_have_socklib = yes; then
+ # check for libnsl, add it to LIBS if present
+ if test "X$bash_cv_have_libnsl" = "X"; then
+ _bash_needmsg=
+ else
+ AC_MSG_CHECKING(for libnsl)
+ _bash_needmsg=yes
+ fi
+ AC_CACHE_VAL(bash_cv_have_libnsl,
+ [AC_CHECK_LIB(nsl, t_open,
+ bash_cv_have_libnsl=yes, bash_cv_have_libnsl=no)])
+ if test "X$_bash_needmsg" = Xyes; then
+ AC_MSG_RESULT($bash_cv_have_libnsl)
+ _bash_needmsg=
+ fi
+ if test $bash_cv_have_libnsl = yes; then
+ LIBS="-lsocket -lnsl $LIBS"
+ else
+ LIBS="-lsocket $LIBS"
+ fi
+ AC_DEFINE(HAVE_LIBSOCKET)
+ AC_DEFINE(HAVE_GETPEERNAME)
+fi
+])
+
+AH_TEMPLATE([STRUCT_DIRENT_HAS_D_INO], [Define if struct dirent has a d_ino member])
+AC_DEFUN([BASH_STRUCT_DIRENT_D_INO],
+[AC_REQUIRE([AC_HEADER_DIRENT])
+AC_MSG_CHECKING(if struct dirent has a d_ino member)
+AC_CACHE_VAL(bash_cv_dirent_has_dino,
+[AC_TRY_COMPILE([
+#include <stdio.h>
+#include <sys/types.h>
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif /* HAVE_UNISTD_H */
+#if defined(HAVE_DIRENT_H)
+# include <dirent.h>
+#else
+# define dirent direct
+# ifdef HAVE_SYS_NDIR_H
+# include <sys/ndir.h>
+# endif /* SYSNDIR */
+# ifdef HAVE_SYS_DIR_H
+# include <sys/dir.h>
+# endif /* SYSDIR */
+# ifdef HAVE_NDIR_H
+# include <ndir.h>
+# endif
+#endif /* HAVE_DIRENT_H */
+],[
+struct dirent d; int z; z = d.d_ino;
+], bash_cv_dirent_has_dino=yes, bash_cv_dirent_has_dino=no)])
+AC_MSG_RESULT($bash_cv_dirent_has_dino)
+if test $bash_cv_dirent_has_dino = yes; then
+AC_DEFINE(STRUCT_DIRENT_HAS_D_INO)
+fi
+])
+
+AH_TEMPLATE([STRUCT_DIRENT_HAS_D_FILENO], [Define if struct dirent has a d_fileno member])
+AC_DEFUN([BASH_STRUCT_DIRENT_D_FILENO],
+[AC_REQUIRE([AC_HEADER_DIRENT])
+AC_MSG_CHECKING(if struct dirent has a d_fileno member)
+AC_CACHE_VAL(bash_cv_dirent_has_d_fileno,
+[AC_TRY_COMPILE([
+#include <stdio.h>
+#include <sys/types.h>
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif /* HAVE_UNISTD_H */
+#if defined(HAVE_DIRENT_H)
+# include <dirent.h>
+#else
+# define dirent direct
+# ifdef HAVE_SYS_NDIR_H
+# include <sys/ndir.h>
+# endif /* SYSNDIR */
+# ifdef HAVE_SYS_DIR_H
+# include <sys/dir.h>
+# endif /* SYSDIR */
+# ifdef HAVE_NDIR_H
+# include <ndir.h>
+# endif
+#endif /* HAVE_DIRENT_H */
+],[
+struct dirent d; int z; z = d.d_fileno;
+], bash_cv_dirent_has_d_fileno=yes, bash_cv_dirent_has_d_fileno=no)])
+AC_MSG_RESULT($bash_cv_dirent_has_d_fileno)
+if test $bash_cv_dirent_has_d_fileno = yes; then
+AC_DEFINE(STRUCT_DIRENT_HAS_D_FILENO)
+fi
+])
+
+AC_DEFUN([BASH_STRUCT_TIMEVAL],
+[AC_MSG_CHECKING(for struct timeval in sys/time.h and time.h)
+AC_CACHE_VAL(bash_cv_struct_timeval,
+[
+AC_EGREP_HEADER(struct timeval, sys/time.h,
+ bash_cv_struct_timeval=yes,
+ AC_EGREP_HEADER(struct timeval, time.h,
+ bash_cv_struct_timeval=yes,
+ bash_cv_struct_timeval=no))
+])
+AC_MSG_RESULT($bash_cv_struct_timeval)
+if test $bash_cv_struct_timeval = yes; then
+ AC_DEFINE(HAVE_TIMEVAL)
+fi
+])
+
+AH_TEMPLATE([STRUCT_WINSIZE_IN_SYS_IOCTL], [Define if struct winsize is in sys/ioctl.h])
+AH_TEMPLATE([STRUCT_WINSIZE_IN_TERMIOS], [Define if struct winsize is in termios.h])
+AC_DEFUN([BASH_STRUCT_WINSIZE],
+[AC_MSG_CHECKING(for struct winsize in sys/ioctl.h and termios.h)
+AC_CACHE_VAL(bash_cv_struct_winsize_header,
+[AC_TRY_COMPILE([#include <sys/types.h>
+#include <sys/ioctl.h>], [struct winsize x;],
+ bash_cv_struct_winsize_header=ioctl_h,
+ [AC_TRY_COMPILE([#include <sys/types.h>
+#include <termios.h>], [struct winsize x;],
+ bash_cv_struct_winsize_header=termios_h, bash_cv_struct_winsize_header=other)
+])])
+if test $bash_cv_struct_winsize_header = ioctl_h; then
+ AC_MSG_RESULT(sys/ioctl.h)
+ AC_DEFINE(STRUCT_WINSIZE_IN_SYS_IOCTL)
+elif test $bash_cv_struct_winsize_header = termios_h; then
+ AC_MSG_RESULT(termios.h)
+ AC_DEFINE(STRUCT_WINSIZE_IN_TERMIOS)
+else
+ AC_MSG_RESULT(not found)
+fi
+])
+
+dnl Check type of signal routines (posix, 4.2bsd, 4.1bsd or v7)
+AH_TEMPLATE([HAVE_POSIX_SIGNALS], [Define if we have the POSIX signal routines])
+AH_TEMPLATE([HAVE_BSD_SIGNALS], [Define if we have the BSD signal routines])
+AH_TEMPLATE([HAVE_USG_SIGHOLD], [Define if we have the USG signal routines])
+AC_DEFUN([BASH_SYS_SIGNAL_VINTAGE],
+[AC_REQUIRE([AC_TYPE_SIGNAL])
+AC_MSG_CHECKING(for type of signal functions)
+AC_CACHE_VAL(bash_cv_signal_vintage,
+[
+ AC_MSG_WARN([checking for posix...])
+ AC_TRY_LINK([#include <signal.h>],[
+ sigset_t ss;
+ struct sigaction sa;
+ sigemptyset(&ss); sigsuspend(&ss);
+ sigaction(SIGINT, &sa, (struct sigaction *) 0);
+ sigprocmask(SIG_BLOCK, &ss, (sigset_t *) 0);
+ ], bash_cv_signal_vintage="posix",
+ [
+ AC_MSG_WARN([checking for 4.2bsd...])
+ AC_TRY_LINK([#include <signal.h>], [
+ int mask = sigmask(SIGINT);
+ sigsetmask(mask); sigblock(mask); sigpause(mask);
+ ], bash_cv_signal_vintage="4.2bsd",
+ [
+ AC_MSG_WARN([checking for svr3...])
+ AC_TRY_LINK([
+ #include <signal.h>
+ RETSIGTYPE foo() { }], [
+ int mask = sigmask(SIGINT);
+ sigset(SIGINT, foo); sigrelse(SIGINT);
+ sighold(SIGINT); sigpause(SIGINT);
+ ], bash_cv_signal_vintage="svr3", bash_cv_signal_vintage="v7"
+ )]
+ )]
+)
+])
+AC_MSG_RESULT($bash_cv_signal_vintage)
+if test "$bash_cv_signal_vintage" = "posix"; then
+AC_DEFINE(HAVE_POSIX_SIGNALS)
+elif test "$bash_cv_signal_vintage" = "4.2bsd"; then
+AC_DEFINE(HAVE_BSD_SIGNALS)
+elif test "$bash_cv_signal_vintage" = "svr3"; then
+AC_DEFINE(HAVE_USG_SIGHOLD)
+fi
+])
+
+dnl Check if the pgrp of setpgrp() can't be the pid of a zombie process.
+AC_DEFUN([BASH_SYS_PGRP_SYNC],
+[AC_REQUIRE([AC_FUNC_GETPGRP])
+AC_MSG_CHECKING(whether pgrps need synchronization)
+AC_CACHE_VAL(bash_cv_pgrp_pipe,
+[AC_TRY_RUN([
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif
+main()
+{
+# ifdef GETPGRP_VOID
+# define getpgID() getpgrp()
+# else
+# define getpgID() getpgrp(0)
+# define setpgid(x,y) setpgrp(x,y)
+# endif
+ int pid1, pid2, fds[2];
+ int status;
+ char ok;
+
+ switch (pid1 = fork()) {
+ case -1:
+ exit(1);
+ case 0:
+ setpgid(0, getpid());
+ exit(0);
+ }
+ setpgid(pid1, pid1);
+
+ sleep(2); /* let first child die */
+
+ if (pipe(fds) < 0)
+ exit(2);
+
+ switch (pid2 = fork()) {
+ case -1:
+ exit(3);
+ case 0:
+ setpgid(0, pid1);
+ ok = getpgID() == pid1;
+ write(fds[1], &ok, 1);
+ exit(0);
+ }
+ setpgid(pid2, pid1);
+
+ close(fds[1]);
+ if (read(fds[0], &ok, 1) != 1)
+ exit(4);
+ wait(&status);
+ wait(&status);
+ exit(ok ? 0 : 5);
+}
+], bash_cv_pgrp_pipe=no,bash_cv_pgrp_pipe=yes,
+ [AC_MSG_WARN(cannot check pgrp synchronization if cross compiling -- defaulting to no)
+ bash_cv_pgrp_pipe=no])
+])
+AC_MSG_RESULT($bash_cv_pgrp_pipe)
+if test $bash_cv_pgrp_pipe = yes; then
+AC_DEFINE(PGRP_PIPE)
+fi
+])
+
+AH_TEMPLATE([MUST_REINSTALL_SIGHANDLERS], [Define if signal handlers must be reinstalled when invoked.])
+AC_DEFUN([BASH_SYS_REINSTALL_SIGHANDLERS],
+[AC_REQUIRE([AC_TYPE_SIGNAL])
+AC_REQUIRE([BASH_SYS_SIGNAL_VINTAGE])
+AC_MSG_CHECKING([if signal handlers must be reinstalled when invoked])
+AC_CACHE_VAL(bash_cv_must_reinstall_sighandlers,
+[AC_TRY_RUN([
+#include <signal.h>
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
+typedef RETSIGTYPE sigfunc();
+
+int nsigint;
+
+#ifdef HAVE_POSIX_SIGNALS
+sigfunc *
+set_signal_handler(sig, handler)
+ int sig;
+ sigfunc *handler;
+{
+ struct sigaction act, oact;
+ act.sa_handler = handler;
+ act.sa_flags = 0;
+ sigemptyset (&act.sa_mask);
+ sigemptyset (&oact.sa_mask);
+ sigaction (sig, &act, &oact);
+ return (oact.sa_handler);
+}
+#else
+#define set_signal_handler(s, h) signal(s, h)
+#endif
+
+RETSIGTYPE
+sigint(s)
+int s;
+{
+ nsigint++;
+}
+
+main()
+{
+ nsigint = 0;
+ set_signal_handler(SIGINT, sigint);
+ kill((int)getpid(), SIGINT);
+ kill((int)getpid(), SIGINT);
+ exit(nsigint != 2);
+}
+], bash_cv_must_reinstall_sighandlers=no, bash_cv_must_reinstall_sighandlers=yes,
+ [AC_MSG_WARN(cannot check signal handling if cross compiling -- defaulting to no)
+ bash_cv_must_reinstall_sighandlers=no]
+)])
+AC_MSG_RESULT($bash_cv_must_reinstall_sighandlers)
+if test $bash_cv_must_reinstall_sighandlers = yes; then
+AC_DEFINE(MUST_REINSTALL_SIGHANDLERS)
+fi
+])
+
+dnl check that some necessary job control definitions are present
+AC_DEFUN([BASH_SYS_JOB_CONTROL_MISSING],
+[AC_REQUIRE([BASH_SYS_SIGNAL_VINTAGE])
+AC_MSG_CHECKING(for presence of necessary job control definitions)
+AC_CACHE_VAL(bash_cv_job_control_missing,
+[AC_TRY_RUN([
+#include <sys/types.h>
+#ifdef HAVE_SYS_WAIT_H
+#include <sys/wait.h>
+#endif
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#include <signal.h>
+
+/* Add more tests in here as appropriate. */
+main()
+{
+/* signal type */
+#if !defined (HAVE_POSIX_SIGNALS) && !defined (HAVE_BSD_SIGNALS)
+exit(1);
+#endif
+
+/* signals and tty control. */
+#if !defined (SIGTSTP) || !defined (SIGSTOP) || !defined (SIGCONT)
+exit (1);
+#endif
+
+/* process control */
+#if !defined (WNOHANG) || !defined (WUNTRACED)
+exit(1);
+#endif
+
+/* Posix systems have tcgetpgrp and waitpid. */
+#if defined (_POSIX_VERSION) && !defined (HAVE_TCGETPGRP)
+exit(1);
+#endif
+
+#if defined (_POSIX_VERSION) && !defined (HAVE_WAITPID)
+exit(1);
+#endif
+
+/* Other systems have TIOCSPGRP/TIOCGPRGP and wait3. */
+#if !defined (_POSIX_VERSION) && !defined (HAVE_WAIT3)
+exit(1);
+#endif
+
+exit(0);
+}], bash_cv_job_control_missing=present, bash_cv_job_control_missing=missing,
+ [AC_MSG_WARN(cannot check job control if cross-compiling -- defaulting to missing)
+ bash_cv_job_control_missing=missing]
+)])
+AC_MSG_RESULT($bash_cv_job_control_missing)
+if test $bash_cv_job_control_missing = missing; then
+AC_DEFINE(JOB_CONTROL_MISSING)
+fi
+])
+
+dnl check whether named pipes are present
+dnl this requires a previous check for mkfifo, but that is awkward to specify
+AC_DEFUN([BASH_SYS_NAMED_PIPES],
+[AC_MSG_CHECKING(for presence of named pipes)
+AC_CACHE_VAL(bash_cv_sys_named_pipes,
+[AC_TRY_RUN([
+#include <sys/types.h>
+#include <sys/stat.h>
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
+/* Add more tests in here as appropriate. */
+main()
+{
+int fd, err;
+
+#if defined (HAVE_MKFIFO)
+exit (0);
+#endif
+
+#if !defined (S_IFIFO) && (defined (_POSIX_VERSION) && !defined (S_ISFIFO))
+exit (1);
+#endif
+
+#if defined (NeXT)
+exit (1);
+#endif
+err = mkdir("/tmp/bash-aclocal", 0700);
+if (err < 0) {
+ perror ("mkdir");
+ exit(1);
+}
+fd = mknod ("/tmp/bash-aclocal/sh-np-autoconf", 0666 | S_IFIFO, 0);
+if (fd == -1) {
+ rmdir ("/tmp/bash-aclocal");
+ exit (1);
+}
+close(fd);
+unlink ("/tmp/bash-aclocal/sh-np-autoconf");
+rmdir ("/tmp/bash-aclocal");
+exit(0);
+}], bash_cv_sys_named_pipes=present, bash_cv_sys_named_pipes=missing,
+ [AC_MSG_WARN(cannot check for named pipes if cross-compiling -- defaulting to missing)
+ bash_cv_sys_named_pipes=missing]
+)])
+AC_MSG_RESULT($bash_cv_sys_named_pipes)
+if test $bash_cv_sys_named_pipes = missing; then
+AC_DEFINE(NAMED_PIPES_MISSING)
+fi
+])
+
+AC_DEFUN([BASH_SYS_DEFAULT_MAIL_DIR],
+[AC_MSG_CHECKING(for default mail directory)
+AC_CACHE_VAL(bash_cv_mail_dir,
+[if test -d /var/mail; then
+ bash_cv_mail_dir=/var/mail
+ elif test -d /var/spool/mail; then
+ bash_cv_mail_dir=/var/spool/mail
+ elif test -d /usr/mail; then
+ bash_cv_mail_dir=/usr/mail
+ elif test -d /usr/spool/mail; then
+ bash_cv_mail_dir=/usr/spool/mail
+ else
+ bash_cv_mail_dir=unknown
+ fi
+])
+AC_MSG_RESULT($bash_cv_mail_dir)
+AC_DEFINE_UNQUOTED(DEFAULT_MAIL_DIRECTORY, "$bash_cv_mail_dir")
+])
+
+AC_DEFUN([BASH_HAVE_TIOCGWINSZ],
+[AC_MSG_CHECKING(for TIOCGWINSZ in sys/ioctl.h)
+AC_CACHE_VAL(bash_cv_tiocgwinsz_in_ioctl,
+[AC_TRY_COMPILE([#include <sys/types.h>
+#include <sys/ioctl.h>], [int x = TIOCGWINSZ;],
+ bash_cv_tiocgwinsz_in_ioctl=yes,bash_cv_tiocgwinsz_in_ioctl=no)])
+AC_MSG_RESULT($bash_cv_tiocgwinsz_in_ioctl)
+if test $bash_cv_tiocgwinsz_in_ioctl = yes; then
+AC_DEFINE(GWINSZ_IN_SYS_IOCTL)
+fi
+])
+
+AH_TEMPLATE([TIOCSTAT_IN_SYS_IOCTL], [Define if TIOCSTAT is in sys/ioctl.h])
+AC_DEFUN([BASH_HAVE_TIOCSTAT],
+[AC_MSG_CHECKING(for TIOCSTAT in sys/ioctl.h)
+AC_CACHE_VAL(bash_cv_tiocstat_in_ioctl,
+[AC_TRY_COMPILE([#include <sys/types.h>
+#include <sys/ioctl.h>], [int x = TIOCSTAT;],
+ bash_cv_tiocstat_in_ioctl=yes,bash_cv_tiocstat_in_ioctl=no)])
+AC_MSG_RESULT($bash_cv_tiocstat_in_ioctl)
+if test $bash_cv_tiocstat_in_ioctl = yes; then
+AC_DEFINE(TIOCSTAT_IN_SYS_IOCTL)
+fi
+])
+
+AH_TEMPLATE([FIONREAD_IN_SYS_IOCTL], [Define if FIONREAD is in sys/ioctl.h])
+AC_DEFUN([BASH_HAVE_FIONREAD],
+[AC_MSG_CHECKING(for FIONREAD in sys/ioctl.h)
+AC_CACHE_VAL(bash_cv_fionread_in_ioctl,
+[AC_TRY_COMPILE([#include <sys/types.h>
+#include <sys/ioctl.h>], [int x = FIONREAD;],
+ bash_cv_fionread_in_ioctl=yes,bash_cv_fionread_in_ioctl=no)])
+AC_MSG_RESULT($bash_cv_fionread_in_ioctl)
+if test $bash_cv_fionread_in_ioctl = yes; then
+AC_DEFINE(FIONREAD_IN_SYS_IOCTL)
+fi
+])
+
+dnl
+dnl See if speed_t is declared in <sys/types.h>. Some versions of linux
+dnl require a definition of speed_t each time <termcap.h> is included,
+dnl but you can only get speed_t if you include <termios.h> (on some
+dnl versions) or <sys/types.h> (on others).
+dnl
+AH_TEMPLATE([SPEED_T_IN_SYS_TYPES], [Define if speed_t is in sys/types.h])
+AC_DEFUN([BASH_CHECK_SPEED_T],
+[AC_MSG_CHECKING(for speed_t in sys/types.h)
+AC_CACHE_VAL(bash_cv_speed_t_in_sys_types,
+[AC_TRY_COMPILE([#include <sys/types.h>], [speed_t x;],
+ bash_cv_speed_t_in_sys_types=yes,bash_cv_speed_t_in_sys_types=no)])
+AC_MSG_RESULT($bash_cv_speed_t_in_sys_types)
+if test $bash_cv_speed_t_in_sys_types = yes; then
+AC_DEFINE(SPEED_T_IN_SYS_TYPES)
+fi
+])
+
+AH_TEMPLATE([HAVE_GETPW_DECLS], [Define if getpw functions are declared in pwd.h])
+AC_DEFUN([BASH_CHECK_GETPW_FUNCS],
+[AC_MSG_CHECKING(whether getpw functions are declared in pwd.h)
+AC_CACHE_VAL(bash_cv_getpw_declared,
+[AC_EGREP_CPP(getpwuid,
+[
+#include <sys/types.h>
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif
+#include <pwd.h>
+],
+bash_cv_getpw_declared=yes,bash_cv_getpw_declared=no)])
+AC_MSG_RESULT($bash_cv_getpw_declared)
+if test $bash_cv_getpw_declared = yes; then
+AC_DEFINE(HAVE_GETPW_DECLS)
+fi
+])
+
+AC_DEFUN([BASH_CHECK_DEV_FD],
+[AC_MSG_CHECKING(whether /dev/fd is available)
+AC_CACHE_VAL(bash_cv_dev_fd,
+[if test -d /dev/fd && test -r /dev/fd/0; then
+ bash_cv_dev_fd=standard
+ elif test -d /proc/self/fd && test -r /proc/self/fd/0; then
+ bash_cv_dev_fd=whacky
+ else
+ bash_cv_dev_fd=absent
+ fi
+])
+AC_MSG_RESULT($bash_cv_dev_fd)
+if test $bash_cv_dev_fd = "standard"; then
+ AC_DEFINE(HAVE_DEV_FD)
+ AC_DEFINE(DEV_FD_PREFIX, "/dev/fd/")
+elif test $bash_cv_dev_fd = "whacky"; then
+ AC_DEFINE(HAVE_DEV_FD)
+ AC_DEFINE(DEV_FD_PREFIX, "/proc/self/fd/")
+fi
+])
+
+AC_DEFUN([BASH_CHECK_DEV_STDIN],
+[AC_MSG_CHECKING(whether /dev/stdin stdout stderr are available)
+AC_CACHE_VAL(bash_cv_dev_stdin,
+[if test -d /dev/fd && test -r /dev/stdin; then
+ bash_cv_dev_stdin=present
+ elif test -d /proc/self/fd && test -r /dev/stdin; then
+ bash_cv_dev_stdin=present
+ else
+ bash_cv_dev_stdin=absent
+ fi
+])
+AC_MSG_RESULT($bash_cv_dev_stdin)
+if test $bash_cv_dev_stdin = "present"; then
+ AC_DEFINE(HAVE_DEV_STDIN)
+fi
+])
+
+dnl
+dnl Check if HPUX needs _KERNEL defined for RLIMIT_* definitions
+dnl
+AC_DEFUN([BASH_CHECK_KERNEL_RLIMIT],
+[AC_MSG_CHECKING([whether $host_os needs _KERNEL for RLIMIT defines])
+AC_CACHE_VAL(bash_cv_kernel_rlimit,
+[AC_TRY_COMPILE([
+#include <sys/types.h>
+#include <sys/resource.h>
+],
+[
+ int f;
+ f = RLIMIT_DATA;
+], bash_cv_kernel_rlimit=no,
+[AC_TRY_COMPILE([
+#include <sys/types.h>
+#define _KERNEL
+#include <sys/resource.h>
+#undef _KERNEL
+],
+[
+ int f;
+ f = RLIMIT_DATA;
+], bash_cv_kernel_rlimit=yes, bash_cv_kernel_rlimit=no)]
+)])
+AC_MSG_RESULT($bash_cv_kernel_rlimit)
+if test $bash_cv_kernel_rlimit = yes; then
+AC_DEFINE(RLIMIT_NEEDS_KERNEL)
+fi
+])
+
+dnl
+dnl Check for 64-bit off_t -- used for malloc alignment
+dnl
+dnl C does not allow duplicate case labels, so the compile will fail if
+dnl sizeof(off_t) is > 4.
+dnl
+AC_DEFUN([BASH_CHECK_OFF_T_64],
+[AC_CACHE_CHECK(for 64-bit off_t, bash_cv_off_t_64,
+AC_TRY_COMPILE([
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#include <sys/types.h>
+],[
+switch (0) case 0: case (sizeof (off_t) <= 4):;
+], bash_cv_off_t_64=no, bash_cv_off_t_64=yes))
+if test $bash_cv_off_t_64 = yes; then
+ AC_DEFINE(HAVE_OFF_T_64)
+fi])
+
+AC_DEFUN([BASH_CHECK_RTSIGS],
+[AC_MSG_CHECKING(for unusable real-time signals due to large values)
+AC_CACHE_VAL(bash_cv_unusable_rtsigs,
+[AC_TRY_RUN([
+#include <sys/types.h>
+#include <signal.h>
+
+#ifndef NSIG
+# define NSIG 64
+#endif
+
+main ()
+{
+ int n_sigs = 2 * NSIG;
+#ifdef SIGRTMIN
+ int rtmin = SIGRTMIN;
+#else
+ int rtmin = 0;
+#endif
+
+ exit(rtmin < n_sigs);
+}], bash_cv_unusable_rtsigs=yes, bash_cv_unusable_rtsigs=no,
+ [AC_MSG_WARN(cannot check real-time signals if cross compiling -- defaulting to yes)
+ bash_cv_unusable_rtsigs=yes]
+)])
+AC_MSG_RESULT($bash_cv_unusable_rtsigs)
+if test $bash_cv_unusable_rtsigs = yes; then
+AC_DEFINE(UNUSABLE_RT_SIGNALS)
+fi
+])
+
+dnl
+dnl check for availability of multibyte characters and functions
+dnl
+AH_TEMPLATE([HAVE_MBSRTOWCS], [Define if we have the mbsrtowcs function])
+AH_TEMPLATE([HAVE_WCWIDTH], [Define if we have the wcwidth function])
+AH_TEMPLATE([HAVE_MBSTATE_T], [Define if we have mbstate_t])
+AH_TEMPLATE([HAVE_LANGINFO_CODESET], [Define if we have nl_langinfo and CODESET])
+AC_DEFUN([BASH_CHECK_MULTIBYTE],
+[
+AC_CHECK_HEADERS(wctype.h)
+AC_CHECK_HEADERS(wchar.h)
+AC_CHECK_HEADERS(langinfo.h)
+
+AC_CHECK_FUNC(mbsrtowcs, AC_DEFINE(HAVE_MBSRTOWCS))
+AC_CHECK_FUNC(wcwidth, AC_DEFINE(HAVE_WCWIDTH))
+
+AC_CACHE_CHECK([for mbstate_t], bash_cv_have_mbstate_t,
+[AC_TRY_RUN([
+#include <wchar.h>
+int
+main ()
+{
+ mbstate_t ps;
+ return 0;
+}], bash_cv_have_mbstate_t=yes, bash_cv_have_mbstate_t=no)])
+if test $bash_cv_have_mbstate_t = yes; then
+ AC_DEFINE(HAVE_MBSTATE_T)
+fi
+
+AC_CACHE_CHECK([for nl_langinfo and CODESET], bash_cv_langinfo_codeset,
+[AC_TRY_LINK(
+[#include <langinfo.h>],
+[char* cs = nl_langinfo(CODESET);],
+bash_cv_langinfo_codeset=yes, bash_cv_langinfo_codeset=no)])
+if test $bash_cv_langinfo_codeset = yes; then
+ AC_DEFINE(HAVE_LANGINFO_CODESET)
+fi
+
+])
+
+dnl need: prefix exec_prefix libdir includedir CC TERMCAP_LIB
+dnl require:
+dnl AC_PROG_CC
+dnl BASH_CHECK_LIB_TERMCAP
+
+AC_DEFUN([RL_LIB_READLINE_VERSION],
+[
+AC_REQUIRE([BASH_CHECK_LIB_TERMCAP])
+
+AC_MSG_CHECKING([version of installed readline library])
+
+# What a pain in the ass this is.
+
+# save cpp and ld options
+_save_CFLAGS="$CFLAGS"
+_save_LDFLAGS="$LDFLAGS"
+_save_LIBS="$LIBS"
+
+# Don't set ac_cv_rl_prefix if the caller has already assigned a value. This
+# allows the caller to do something like $_rl_prefix=$withval if the user
+# specifies --with-installed-readline=PREFIX as an argument to configure
+
+if test -z "$ac_cv_rl_prefix"; then
+test "x$prefix" = xNONE && ac_cv_rl_prefix=$ac_default_prefix || ac_cv_rl_prefix=${prefix}
+fi
+
+eval ac_cv_rl_includedir=${ac_cv_rl_prefix}/include
+eval ac_cv_rl_libdir=${ac_cv_rl_prefix}/lib
+
+LIBS="$LIBS -lreadline ${TERMCAP_LIB}"
+CFLAGS="$CFLAGS -I${ac_cv_rl_includedir}"
+LDFLAGS="$LDFLAGS -L${ac_cv_rl_libdir}"
+
+AC_TRY_RUN([
+#include <stdio.h>
+#include <readline/readline.h>
+
+main()
+{
+ FILE *fp;
+ fp = fopen("conftest.rlv", "w");
+ if (fp == 0) exit(1);
+ fprintf(fp, "%s\n", rl_library_version ? rl_library_version : "0.0");
+ fclose(fp);
+ exit(0);
+}
+],
+ac_cv_rl_version=`cat conftest.rlv`,
+ac_cv_rl_version='0.0',
+ac_cv_rl_version='4.2')
+
+CFLAGS="$_save_CFLAGS"
+LDFLAGS="$_save_LDFLAGS"
+LIBS="$_save_LIBS"
+
+RL_MAJOR=0
+RL_MINOR=0
+
+# (
+case "$ac_cv_rl_version" in
+2*|3*|4*|5*|6*|7*|8*|9*)
+ RL_MAJOR=`echo $ac_cv_rl_version | sed 's:\..*$::'`
+ RL_MINOR=`echo $ac_cv_rl_version | sed -e 's:^.*\.::' -e 's:[[a-zA-Z]]*$::'`
+ ;;
+esac
+
+# (((
+case $RL_MAJOR in
+[[0-9][0-9]]) _RL_MAJOR=$RL_MAJOR ;;
+[[0-9]]) _RL_MAJOR=0$RL_MAJOR ;;
+*) _RL_MAJOR=00 ;;
+esac
+
+# (((
+case $RL_MINOR in
+[[0-9][0-9]]) _RL_MINOR=$RL_MINOR ;;
+[[0-9]]) _RL_MINOR=0$RL_MINOR ;;
+*) _RL_MINOR=00 ;;
+esac
+
+RL_VERSION="0x${_RL_MAJOR}${_RL_MINOR}"
+
+# Readline versions greater than 4.2 have these defines in readline.h
+
+if test $ac_cv_rl_version = '0.0' ; then
+ AC_MSG_WARN([Could not test version of installed readline library.])
+elif test $RL_MAJOR -gt 4 || { test $RL_MAJOR = 4 && test $RL_MINOR -gt 2 ; } ; then
+ # set these for use by the caller
+ RL_PREFIX=$ac_cv_rl_prefix
+ RL_LIBDIR=$ac_cv_rl_libdir
+ RL_INCLUDEDIR=$ac_cv_rl_includedir
+ AC_MSG_RESULT($ac_cv_rl_version)
+else
+
+AC_DEFINE_UNQUOTED(RL_READLINE_VERSION, $RL_VERSION, [encoded version of the installed readline library])
+AC_DEFINE_UNQUOTED(RL_VERSION_MAJOR, $RL_MAJOR, [major version of installed readline library])
+AC_DEFINE_UNQUOTED(RL_VERSION_MINOR, $RL_MINOR, [minor version of installed readline library])
+
+AC_SUBST(RL_VERSION)
+AC_SUBST(RL_MAJOR)
+AC_SUBST(RL_MINOR)
+
+# set these for use by the caller
+RL_PREFIX=$ac_cv_rl_prefix
+RL_LIBDIR=$ac_cv_rl_libdir
+RL_INCLUDEDIR=$ac_cv_rl_includedir
+
+AC_MSG_RESULT($ac_cv_rl_version)
+
+fi
+])
diff --git a/meta/recipes-core/readline/files/configure-fix.patch b/meta/recipes-core/readline/files/configure-fix.patch
new file mode 100644
index 000000000..4100fe42a
--- /dev/null
+++ b/meta/recipes-core/readline/files/configure-fix.patch
@@ -0,0 +1,24 @@
+Without this it fails to link against libtermcap causing various missing symbols
+issues.
+
+RP - 8/10/08
+
+Index: readline-5.2/configure.in
+===================================================================
+--- readline-5.2.orig/configure.in 2008-10-08 09:58:52.000000000 +0100
++++ readline-5.2/configure.in 2008-10-08 09:59:03.000000000 +0100
+@@ -211,10 +211,10 @@
+ AC_MSG_CHECKING(configuration for building shared libraries)
+ eval `TERMCAP_LIB=$TERMCAP_LIB ${CONFIG_SHELL-/bin/sh} ${srcdir}/support/shobj-conf -C "${CC}" -c ${host_cpu} -o ${host_os} -v ${host_vendor}`
+
+-# case "$SHLIB_LIBS" in
+-# *curses*|*termcap*|*termlib*) ;;
+-# *) SHLIB_LIBS="$SHLIB_LIBS $TERMCAP_LIB" ;;
+-# esac
++ case "$SHLIB_LIBS" in
++ *curses*|*termcap*|*termlib*) ;;
++ *) SHLIB_LIBS="$SHLIB_LIBS $TERMCAP_LIB" ;;
++ esac
+
+ AC_SUBST(SHOBJ_CC)
+ AC_SUBST(SHOBJ_CFLAGS)
diff --git a/meta/recipes-core/readline/readline.inc b/meta/recipes-core/readline/readline.inc
new file mode 100644
index 000000000..35bc7ed94
--- /dev/null
+++ b/meta/recipes-core/readline/readline.inc
@@ -0,0 +1,34 @@
+DESCRIPTION = "The GNU Readline library provides a set of functions for use by applications that allow users to edit \
+command lines as they are typed in. Both Emacs and vi editing modes are available. The Readline library includes \
+additional functions to maintain a list of previously-entered command lines, to recall and perhaps reedit those \
+lines, and perform csh-like history expansion on previous commands."
+SECTION = "libs"
+PRIORITY = "optional"
+
+# GPLv2+ (< 6.0), GPLv3+ (>= 6.0)
+LICENSE = "GPLv3+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
+
+DEPENDS += "ncurses"
+
+SRC_URI = "${GNU_MIRROR}/readline/${BPN}-${PV}.tar.gz \
+ file://configure-fix.patch \
+ file://acinclude.m4"
+
+S = "${WORKDIR}/${BPN}-${PV}"
+
+inherit autotools
+
+LEAD_SONAME = "libreadline.so"
+
+do_configure_prepend () {
+ install -m 0644 ${WORKDIR}/acinclude.m4 ${S}/
+}
+
+do_install_append () {
+ # Make install doesn't properly install these
+ oe_libinstall -so -C shlib libhistory ${D}${libdir}
+ oe_libinstall -so -C shlib libreadline ${D}${libdir}
+}
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/meta/recipes-core/readline/readline_5.2.bb b/meta/recipes-core/readline/readline_5.2.bb
new file mode 100644
index 000000000..a62345c45
--- /dev/null
+++ b/meta/recipes-core/readline/readline_5.2.bb
@@ -0,0 +1,35 @@
+DESCRIPTION = "The GNU Readline library provides a set of functions for use by applications that allow users to edit \
+command lines as they are typed in. Both Emacs and vi editing modes are available. The Readline library includes \
+additional functions to maintain a list of previously-entered command lines, to recall and perhaps reedit those \
+lines, and perform csh-like history expansion on previous commands."
+SECTION = "libs"
+
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=03b36fdd84f74b8d8189a202b980b67f"
+
+DEPENDS += "ncurses"
+PRIORITY = "optional"
+
+PR = "r6"
+
+SRC_URI = "${GNU_MIRROR}/readline/${BPN}-${PV}.tar.gz \
+ file://configure-fix.patch \
+ file://acinclude.m4"
+
+S = "${WORKDIR}/${BPN}-${PV}"
+
+inherit autotools
+
+LEAD_SONAME = "libreadline.so"
+
+do_configure_prepend () {
+ install -m 0644 ${WORKDIR}/acinclude.m4 ${S}/
+}
+
+do_install_append () {
+ # Make install doesn't properly install these
+ oe_libinstall -so -C shlib libhistory ${D}${libdir}
+ oe_libinstall -so -C shlib libreadline ${D}${libdir}
+}
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/meta/recipes-core/readline/readline_6.1.bb b/meta/recipes-core/readline/readline_6.1.bb
new file mode 100644
index 000000000..c32755669
--- /dev/null
+++ b/meta/recipes-core/readline/readline_6.1.bb
@@ -0,0 +1,3 @@
+require readline.inc
+
+PR = "r0"
diff --git a/meta/recipes-core/sysfsutils/sysfsutils_2.1.0.bb b/meta/recipes-core/sysfsutils/sysfsutils_2.1.0.bb
new file mode 100644
index 000000000..5b513211d
--- /dev/null
+++ b/meta/recipes-core/sysfsutils/sysfsutils_2.1.0.bb
@@ -0,0 +1,21 @@
+DESCRIPTION = "system utilities based on sysfs."
+HOMEPAGE = "http://linux-diag.sourceforge.net/Sysfsutils.html"
+
+LICENSE = "GPLv2 & LGPLv2.1"
+LICENSE_${PN} = "GPLv2"
+LICENSE_libsysfs = "LGPLv2.1"
+LIC_FILES_CHKSUM = "file://COPYING;md5=3d06403ea54c7574a9e581c6478cc393 \
+ file://cmd/GPL;md5=d41d4e2e1e108554e0388ea4aecd8d27 \
+ file://lib/LGPL;md5=b75d069791103ffe1c0d6435deeff72e"
+PR = "r0"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/linux-diag/sysfsutils-${PV}.tar.gz"
+S = "${WORKDIR}/sysfsutils-${PV}"
+
+inherit autotools
+
+PACKAGES_prepend = "libsysfs libsysfs-dbg libsysfs-dev "
+FILES_libsysfs = "${libdir}/*.so.*"
+FILES_libsysfs-dev = "${libdir}/* ${includedir}"
+FILES_libsysfs-dbg = "${libdir}/.debug"
+FILES_${PN}-dbg = "${bindir}/.debug"
diff --git a/meta/recipes-core/util-linux/files/MCONFIG b/meta/recipes-core/util-linux/files/MCONFIG
new file mode 100644
index 000000000..3fea2c02d
--- /dev/null
+++ b/meta/recipes-core/util-linux/files/MCONFIG
@@ -0,0 +1,223 @@
+# MCONFIG -- Configuration stuff for util-linux
+# Created: Sat Feb 4 15:50:30 1995
+# Copyright 1995 Rickard E. Faith (faith@cs.unc.edu)
+
+# For a user-mode install, make (at least) three changes:
+# - remove the `-o root' part in INSTALLSUID
+# - set USE_TTY_GROUP=no
+# - define DESTDIR
+
+# Select for ARCH one of intel, alpha, sparc, arm, m68k, mips
+# Select for CPU i386 if the binaries must be able to run on an intel 386
+# (by default i486 code is generated, see below)
+CPU=$(shell uname -m)
+ARCH=$(shell echo $(CPU) | sed 's/i.86/intel/;s/arm.*/arm/')
+
+# If HAVE_PAM is set to "yes", then login, chfn, chsh, and newgrp
+# will use PAM for authentication. Additionally, passwd will not be
+# installed as it is not PAM aware.
+HAVE_PAM=no
+
+# If HAVE_SHADOW is set to "yes", then login, chfn, chsh, newgrp, passwd,
+# and vipw will not be built or installed from the login-utils
+# subdirectory.
+HAVE_SHADOW=yes
+
+# If HAVE_PASSWD is set to "yes", then passwd will not be built or
+# installed from the login-utils subdirectory (but login, chfn, chsh,
+# newgrp, and vipw *will* be installed).
+HAVE_PASSWD=no
+
+# If you use chfn and chsh from this package, REQUIRE_PASSWORD will require
+# non-root users to enter the account password before updating /etc/passwd.
+REQUIRE_PASSWORD=yes
+#REQUIRE_PASSWORD=no
+
+# If you use chsh from this package, ONLY_LISTED_SHELLS will require that
+# the selected shell be listed in /etc/shells -- otherwise only a warning is
+# printed. This prevents someone from setting their shell to /bin/false.
+ONLY_LISTED_SHELLS=yes
+#ONLY_LISTED_SHELLS=no
+
+
+# If HAVE_SYSVINIT is set to "yes", then simpleinit and shutdown will not
+# be built or installed from the login-utils subdirectory. (The shutdown
+# and halt that come with the SysVinit package should be used with the init
+# found in that package.)
+HAVE_SYSVINIT=no
+
+# If HAVE_SYSVINIT_UTILS is set to "yes", then last, mesg, and wall will
+# not be built or installed from the login-utils subdirectory. (The
+# shutdown and init from the SysVinit package do not depend on the last,
+# mesg, and wall from that package.)
+HAVE_SYSVINIT_UTILS=no
+
+# If HAVE_WRITE is set to "yes", then write will not be built or
+# installed from the misc-utils subdirectory.
+# (There is a network aware write in netwrite from NetKit 0.16 or later.)
+HAVE_WRITE=no
+
+# If HAVE_GETTY is set to "yes", then agetty will not be built or
+# installed from the login-utils subdirectory. Note that agetty can
+# co-exist with other gettys, so this option should never be used.
+HAVE_GETTY=no
+
+# If USE_TTY_GROUP is set to "yes", then wall and write will be installed
+# setgid to the "tty" group, and mesg will only set the group write bit.
+# Note that this is only useful if login/xterm/etc. change the group of the
+# user's tty to "tty" [The login in util-linux does this correctly, and
+# xterm will do it correctly if X is compiled with USE_TTY_GROUP set
+# properly.]
+USE_TTY_GROUP=no
+
+# If HAVE_KILL is set to "yes", then kill will not be built or
+# installed from the misc-utils subdirectory.
+# (There is also a kill in the procps package.)
+HAVE_KILL=no
+
+# If ALLOW_VCS_USE is set to "yes", then login will chown /dev/vcsN
+# to the current user, allowing her to make a screendump and do other
+# nifty things on the console, but also allowing him to keep an open
+# file descriptor after logging out to trick the next user.
+ALLOW_VCS_USE=yes
+
+# If HAVE_RESET is set to "yes", then reset won't be installed. The version
+# of reset that comes with the ncurses package is less aggressive.
+HAVE_RESET=yes
+
+# If HAVE_SLN is set to "yes", then sln won't be installed
+# (but the man page sln.8 will be installed anyway).
+# sln also comes with libc and glibc.
+HAVE_SLN=no
+
+# If HAVE_FDUTILS is set to "yes", then setfdprm won't be installed.
+HAVE_FDUTILS=no
+
+# If SILENT_PG is set to "yes", then pg will not ring the bell
+# when an invalid key is pressed
+SILENT_PG=no
+
+# If configure decides that Native Language Support (NLS) is available,
+# it sets MAY_ENABLE_NLS in defines.h. If you don't want NLS, set
+# DISABLE_NLS to "yes".
+DISABLE_NLS=no
+
+# Different optimizations for different cpus.
+# gcc 3.0 likes options -mcpu=i486 instead of -m486
+ifeq "$(ARCH)" "intel"
+ ifeq "$(HAVE_OLD_GCC)" "yes"
+ CPUHEAD=-m
+ else
+ CPUHEAD=-mcpu=i
+ endif
+ ifeq "$(CPU)" "i386"
+ CPUTAIL=386
+ else
+ CPUTAIL=486
+ endif
+ CPUOPT= $(CPUHEAD)$(CPUTAIL)
+ OPT= -pipe -O2 $(CPUOPT) -fomit-frame-pointer
+else
+ ifeq "$(ARCH)" "arm"
+ OPT= -pipe -O2 -fsigned-char -fomit-frame-pointer
+ else
+ OPT= -O2 -fomit-frame-pointer
+ endif
+endif
+
+WARNFLAGS = -Wall -Wmissing-prototypes -Wstrict-prototypes
+
+LIB=../lib
+
+ERR_O=$(LIB)/err.o
+
+# Set HAVE_SLANG to yes if you have slang (and prefer to use that for cfdisk)
+# (If neither HAVE_NCURSES nor HAVE_SLANG is defined, cfdisk is not made.)
+# HAVE_SLANG=yes
+# There is a subdirectory /usr/include/slang containing slcurses.h
+# SLANGFLAGS=-I/usr/include/slang
+# No such subdirectory - slcurses.h lives in /usr/include
+# (no extra definition required).
+LIBSLANG=-lslang
+
+#
+# Paths used for compilation (not all are actually used, see CFLAGS below)
+#
+DEV_DIR= /dev
+ETC_DIR= /etc
+SBIN_DIR= /sbin
+USRSBIN_DIR= /usr/sbin
+USRLIB_DIR= /usr/lib
+USRBIN_DIR= /usr/bin
+USRGAMES_DIR= /usr/games
+USRSHAREMISC_DIR=/usr/share/misc
+LOCALE_DIR= /usr/share/locale
+BIN_DIR= /bin
+VAR_PATH= /var
+LOG_DIR= /var/log
+MAN_DIR= /usr/share/man
+INFO_DIR= /usr/share/info
+
+#
+# Paths used for install
+#
+DEVDIR= $(DESTDIR)$(DEV_DIR)
+ETCDIR= $(DESTDIR)$(ETC_DIR)
+SBINDIR= $(DESTDIR)$(SBIN_DIR)
+USRSBINDIR= $(DESTDIR)$(USRSBIN_DIR)
+USRLIBDIR= $(DESTDIR)$(USRLIB_DIR)
+USRBINDIR= $(DESTDIR)$(USRBIN_DIR)
+USRGAMESDIR= $(DESTDIR)$(USRGAMES_DIR)
+USRSHAREMISCDIR=$(DESTDIR)$(USRSHAREMISC_DIR)
+LOCALEDIR= $(DESTDIR)$(LOCALE_DIR)
+BINDIR= $(DESTDIR)$(BIN_DIR)
+VARPATH= $(DESTDIR)$(VAR_PATH)
+LOGDIR= $(DESTDIR)$(LOG_DIR)
+MANDIR= $(DESTDIR)$(MAN_DIR)
+MAN1DIR= $(MANDIR)/man1
+MAN3DIR= $(MANDIR)/man3
+MAN5DIR= $(MANDIR)/man5
+MAN6DIR= $(MANDIR)/man6
+MAN8DIR= $(MANDIR)/man8
+INFODIR= $(DESTDIR)$(INFO_DIR)
+
+# Directory for shutdown, halt, reboot, etc.
+SHUTDOWNDIR= $(SBINDIR)
+
+# Modes
+DIRMODE= 755
+BINMODE= 755
+MANMODE= 644
+DATMODE= 644
+INFOMODE= 644
+SUIDMODE= 4755
+
+CHMOD= chmod
+INSTALL= install
+INSTALLDIR= $(INSTALL) -d -m $(DIRMODE)
+INSTALLBIN= $(INSTALL) -m $(BINMODE)
+INSTALLMAN= $(INSTALL) -m $(MANMODE)
+INSTALLDAT= $(INSTALL) -m $(DATMODE)
+INSTALLSUID= $(INSTALL) -m $(SUIDMODE)
+
+ifeq "$(DISABLE_NLS)" "yes"
+NLSFLAGS = -DDISABLE_NLS
+endif
+
+CFLAGS := $(OPT) -I$(LIB) $(WARNFLAGS) \
+ $(CURSESFLAGS) $(SLANGFLAGS) $(NLSFLAGS) \
+ -D_FILE_OFFSET_BITS=64 \
+ -DSBINDIR=\"$(SBIN_DIR)\" \
+ -DUSRSBINDIR=\"$(USRSBIN_DIR)\" \
+ -DLOGDIR=\"$(LOG_DIR)\" \
+ -DVARPATH=\"$(VAR_PATH)\" \
+ -DLOCALEDIR=\"$(LOCALE_DIR)\" \
+ $(CFLAGS)
+
+
+%.o: %.c
+ $(CC) -c $(CFLAGS) $< -o $@
+
+%: %.cc
+ $(CXX) $(CFLAGS) $< -o $@
+
diff --git a/meta/recipes-core/util-linux/files/debian-bug392236.patch b/meta/recipes-core/util-linux/files/debian-bug392236.patch
new file mode 100644
index 000000000..fcd2046e3
--- /dev/null
+++ b/meta/recipes-core/util-linux/files/debian-bug392236.patch
@@ -0,0 +1,203 @@
+Index: util-linux-2.12r/fdisk/llseek.c
+===================================================================
+--- util-linux-2.12r.orig/fdisk/llseek.c 2003-07-13 23:13:33.000000000 +0200
++++ util-linux-2.12r/fdisk/llseek.c 2007-04-04 19:01:14.000000000 +0200
+@@ -14,30 +14,23 @@
+
+ #ifdef __linux__
+
+-#ifdef HAVE_LLSEEK
+-#include <syscall.h>
+-
+-#else /* HAVE_LLSEEK */
++#include <sys/syscall.h>
++#ifndef HAVE_LLSEEK
+
+ #if defined(__alpha__) || defined(__ia64__) || defined(__s390x__)
+
+ #define my_llseek lseek
+
+ #else
+-#include <linux/unistd.h> /* for __NR__llseek */
+-
+-static int _llseek (unsigned int, unsigned long,
+- unsigned long, long long *, unsigned int);
+
+-#ifdef __NR__llseek
++#ifdef SYS__llseek
+
+-static _syscall5(int,_llseek,unsigned int,fd,unsigned long,offset_high,
+- unsigned long, offset_low,long long *,result,
+- unsigned int, origin)
++#define _llseek(fd, offset_high, offset_low, result, origin) \
++ syscall(SYS__llseek, fd, offset_high, offset_low, result, origin)
+
+ #else
+
+-/* no __NR__llseek on compilation machine - might give it explicitly */
++/* no SYS__llseek on compilation machine - might give it explicitly */
+ static int _llseek (unsigned int fd, unsigned long oh,
+ unsigned long ol, long long *result,
+ unsigned int origin) {
+Index: util-linux-2.12r/fdisk/sfdisk.c
+===================================================================
+--- util-linux-2.12r.orig/fdisk/sfdisk.c 2005-01-04 23:31:57.000000000 +0100
++++ util-linux-2.12r/fdisk/sfdisk.c 2007-04-04 19:01:14.000000000 +0200
+@@ -48,7 +48,7 @@
+ #include <sys/ioctl.h>
+ #include <sys/stat.h>
+ #include <sys/utsname.h>
+-#include <linux/unistd.h> /* _syscall */
++#include <sys/syscall.h>
+ #include "nls.h"
+ #include "common.h"
+
+@@ -177,9 +177,8 @@
+ #endif
+
+ #ifndef use_lseek
+-static __attribute__used
+-_syscall5(int, _llseek, unsigned int, fd, ulong, hi, ulong, lo,
+- loff_t *, res, unsigned int, wh);
++#define _llseek(fd, hi, lo, res, wh) \
++ syscall(SYS__llseek, fd, hi, lo, res, wh)
+ #endif
+
+ static int
+Index: util-linux-2.12r/lib/my_reboot.c
+===================================================================
+--- util-linux-2.12r.orig/lib/my_reboot.c 1999-07-09 04:56:36.000000000 +0200
++++ util-linux-2.12r/lib/my_reboot.c 2007-04-04 19:01:14.000000000 +0200
+@@ -23,10 +23,11 @@
+ #else /* no USE_LIBC */
+
+ /* direct syscall version */
+-#include <linux/unistd.h>
++#include <sys/syscall.h>
+
+-#ifdef _syscall3
+-_syscall3(int, reboot, int, magic, int, magic_too, int, cmd);
++#ifdef SYS_reboot
++#define reboot(magic, magic2, cmd) \
++ syscall(SYS_reboot, magic, magic2, cmd)
+ #else
+ /* Let us hope we have a 3-argument reboot here */
+ extern int reboot(int, int, int);
+Index: util-linux-2.12r/misc-utils/setterm.c
+===================================================================
+--- util-linux-2.12r.orig/misc-utils/setterm.c 2003-10-17 18:17:51.000000000 +0200
++++ util-linux-2.12r/misc-utils/setterm.c 2007-04-04 19:01:14.000000000 +0200
+@@ -119,14 +119,13 @@
+
+ #if __GNU_LIBRARY__ < 5
+ #ifndef __alpha__
+-# include <linux/unistd.h>
+-#define __NR_klogctl __NR_syslog
+-_syscall3(int, klogctl, int, type, char*, buf, int, len);
++# include <sys/syscall.h>
++#define klogctl(type, buf, len) \
++ syscall(SYS_syslog, type, buf, len)
+ #else /* __alpha__ */
+ #define klogctl syslog
+ #endif
+ #endif
+-extern int klogctl(int type, char *buf, int len);
+
+ /* Constants. */
+
+Index: util-linux-2.12r/mount/swapon.c
+===================================================================
+--- util-linux-2.12r.orig/mount/swapon.c 2004-12-22 10:50:19.000000000 +0100
++++ util-linux-2.12r/mount/swapon.c 2007-04-04 19:01:14.000000000 +0200
+@@ -82,11 +82,11 @@
+ #else
+ /* We want a swapon with two args, but have an old libc.
+ Build the kernel call by hand. */
+-#include <linux/unistd.h>
+-static
+-_syscall2(int, swapon, const char *, path, int, flags);
+-static
+-_syscall1(int, swapoff, const char *, path);
++#include <sys/syscall.h>
++#define swapon(path, flags) \
++ syscall(SYS_swapon, path, flags)
++#define swapoff(path) \
++ syscall(SYS_swapoff, path)
+ #endif
+ #else
+ /* just do as libc says */
+Index: util-linux-2.12r/mount/umount.c
+===================================================================
+--- util-linux-2.12r.orig/mount/umount.c 2007-04-04 19:01:14.000000000 +0200
++++ util-linux-2.12r/mount/umount.c 2007-04-04 19:02:22.000000000 +0200
+@@ -37,14 +37,13 @@
+ #else /* MNT_FORCE */
+
+ /* Does the present kernel source know about umount2? */
+-#include <linux/unistd.h>
+-#ifdef __NR_umount2
++#include <sys/syscall.h>
++#ifdef SYS_umount2
+
+-int umount2(const char *path, int flags);
++#define umount2(path, flags) \
++ syscall(SYS_umount2, path, flags)
+
+-_syscall2(int, umount2, const char *, path, int, flags);
+-
+-#else /* __NR_umount2 */
++#else /* SYS_umount2 */
+
+ static int
+ umount2(const char *path, int flags) {
+@@ -52,7 +51,7 @@
+ errno = ENOSYS;
+ return -1;
+ }
+-#endif /* __NR_umount2 */
++#endif /* SYS_umount2 */
+
+ #if !defined(MNT_FORCE)
+ /* dare not try to include <linux/mount.h> -- lots of errors */
+Index: util-linux-2.12r/partx/partx.c
+===================================================================
+--- util-linux-2.12r.orig/partx/partx.c 2004-08-23 22:13:27.000000000 +0200
++++ util-linux-2.12r/partx/partx.c 2007-04-04 19:01:14.000000000 +0200
+@@ -338,10 +338,9 @@
+ #endif
+
+ #ifdef NEED__llseek
+-#include <linux/unistd.h> /* _syscall */
+-static
+-_syscall5(int, _llseek, uint, fd, ulong, hi, ulong, lo,
+- long long *, res, uint, wh);
++#include <sys/syscall.h>
++#define _llseek(fd, hi, lo, res, wh) \
++ syscall(SYS__llseek, fd, hi, lo, res, wh)
+ #endif
+
+ static int
+Index: util-linux-2.12r/sys-utils/dmesg.c
+===================================================================
+--- util-linux-2.12r.orig/sys-utils/dmesg.c 2004-05-04 18:38:12.000000000 +0200
++++ util-linux-2.12r/sys-utils/dmesg.c 2007-04-04 19:01:14.000000000 +0200
+@@ -29,7 +29,7 @@
+ * Only function 3 is allowed to non-root processes.
+ */
+
+-#include <linux/unistd.h>
++#include <sys/syscall.h>
+ #include <stdio.h>
+ #include <getopt.h>
+ #include <stdlib.h>
+@@ -38,8 +38,8 @@
+ #if __GNU_LIBRARY__ < 5
+
+ #ifndef __alpha__
+-# define __NR_klogctl __NR_syslog
+- static inline _syscall3(int, klogctl, int, type, char *, b, int, len);
++# define klogctl(type, b, len) \
++ syscall(SYS_syslog, type, b, len)
+ #else /* __alpha__ */
+ #define klogctl syslog
+ #endif
diff --git a/meta/recipes-core/util-linux/files/defines.h b/meta/recipes-core/util-linux/files/defines.h
new file mode 100644
index 000000000..6ce6b86df
--- /dev/null
+++ b/meta/recipes-core/util-linux/files/defines.h
@@ -0,0 +1,10 @@
+#define UTIL_LINUX_VERSION "2.12"
+#define util_linux_version "util-linux-2.12"
+
+#define HAVE_blkpg_h
+#define HAVE_kd_h
+#define HAVE_locale_h
+#define HAVE_langinfo_h
+#define HAVE_sys_user_h
+#define HAVE_asm_types_h
+//#define NEED_tqueue_h
diff --git a/meta/recipes-core/util-linux/files/fdiskbsdlabel_thumb.diff b/meta/recipes-core/util-linux/files/fdiskbsdlabel_thumb.diff
new file mode 100644
index 000000000..e6f82b5b4
--- /dev/null
+++ b/meta/recipes-core/util-linux/files/fdiskbsdlabel_thumb.diff
@@ -0,0 +1,12 @@
+--- util-linux-2.12r/fdisk/fdiskbsdlabel.h.orig 2006-01-21 23:53:51.000000000 +0100
++++ util-linux-2.12r/fdisk/fdiskbsdlabel.h 2006-01-21 23:54:35.000000000 +0100
+@@ -52,6 +52,9 @@
+ #elif defined (__s390__) || defined (__s390x__)
+ #define BSD_LABELSECTOR 1
+ #define BSD_LABELOFFSET 0
++#elif defined (__thumb__)
++#define BSD_LABELSECTOR 1
++#define BSD_LABELOFFSET 0
+ #else
+ #error unknown architecture
+ #endif
diff --git a/meta/recipes-core/util-linux/files/fix-make-c.patch b/meta/recipes-core/util-linux/files/fix-make-c.patch
new file mode 100644
index 000000000..bf1082e85
--- /dev/null
+++ b/meta/recipes-core/util-linux/files/fix-make-c.patch
@@ -0,0 +1,41 @@
+From: Karel Zak <kzak@redhat.com>
+Date: Mon, 11 May 2009 09:49:00 +0000 (+0200)
+Subject: build-sys: fix "make -C" bug
+X-Git-Url: http://git.kernel.org/?p=utils%2Futil-linux-ng%2Futil-linux-ng.git;a=commitdiff_plain;h=2ef7d41e6bbb7c842c06e911ffc562335a467b5d
+
+build-sys: fix "make -C" bug
+
+Running:
+
+./configure --with-fsprobe=builtin
+make -C mount mount
+
+causes the following error:
+
+gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I.. -include ../config.h
+-I../include -DLOCALEDIR=\"/home/matthew/util-linux-ng/share/locale\"
+-fsigned-char -I../libs/blkid/src -g -O2 -MT mount-setproctitle.o
+-MD -MP -MF .deps/mount-setproctitle.Tpo -c -o mount-setproctitle.o
+`test -f '../lib/setproctitle.c' || echo './'`../lib/setproctitle.c mv
+-f .deps/mount-setproctitle.Tpo .deps/mount-setproctitle.Po
+make -C
+make: option requires an argument -- 'C'
+Usage: make [options] [target] ...
+...
+
+Reported-by: Matthew Burgess <matthew@linuxfromscratch.org>
+Signed-off-by: Karel Zak <kzak@redhat.com>
+---
+
+diff --git a/config/include-Makefile.am b/config/include-Makefile.am
+index b42a0c3..d5da619 100644
+--- a/config/include-Makefile.am
++++ b/config/include-Makefile.am
+@@ -17,6 +17,7 @@ dist_noinst_DATA = $(dist_man_MANS)
+ # Paths to in-tree libraries (use ul_ prefix to avoid possible collisions)
+ #
+ ul_libblkid_srcdir = $(top_srcdir)/libs/blkid/src
++ul_libblkid_builddir = $(top_builddir)/libs/blkid/src
+ ul_libblkid_la = $(top_builddir)/libs/blkid/src/libblkid.la
+
+ $(ul_libblkid_la):
diff --git a/meta/recipes-core/util-linux/files/gcc34.patch b/meta/recipes-core/util-linux/files/gcc34.patch
new file mode 100644
index 000000000..8c4a20cdc
--- /dev/null
+++ b/meta/recipes-core/util-linux/files/gcc34.patch
@@ -0,0 +1,23 @@
+
+#
+# Patch managed by http://www.holgerschurig.de/patcher.html
+#
+
+--- util-linux-2.12o/disk-utils/fsck.cramfs.c~gcc34
++++ util-linux-2.12o/disk-utils/fsck.cramfs.c
+@@ -77,15 +77,7 @@
+ #define PAD_SIZE 512
+
+ #include <asm/page.h>
+-#ifdef PAGE_SIZE
+-#define PAGE_CACHE_SIZE ((int) PAGE_SIZE)
+-#elif defined __ia64__
+-#define PAGE_CACHE_SIZE (16384)
+-#elif defined __alpha__
+-#define PAGE_CACHE_SIZE (8192)
+-#else
+ #define PAGE_CACHE_SIZE (4096)
+-#endif
+
+ /* Guarantee access to at least 8kB at a time */
+ #define ROMBUFFER_BITS 13
diff --git a/meta/recipes-core/util-linux/files/glibc-fix.patch b/meta/recipes-core/util-linux/files/glibc-fix.patch
new file mode 100644
index 000000000..6d0c2fcef
--- /dev/null
+++ b/meta/recipes-core/util-linux/files/glibc-fix.patch
@@ -0,0 +1,22 @@
+--- /tmp/cmos.c 2006-11-21 11:38:55.000000000 +0100
++++ util-linux-2.12r/hwclock/cmos.c 2006-11-21 11:41:45.458554000 +0100
+@@ -46,15 +46,16 @@
+
+ #include <unistd.h> /* for geteuid() */
+ #include <fcntl.h> /* for O_RDWR */
++#include <linux/version.h>
+ #include <errno.h>
+ #include "../defines.h" /* for HAVE_sys_io_h */
+ #include "nls.h"
+
+ #if defined(__i386__)
+-#ifdef HAVE_sys_io_h
+-#include <sys/io.h>
++#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 0)
++#include <asm/io.h>
+ #else
+-#include <asm/io.h> /* for inb, outb */
++#include <sys/io.h> /* for inb, outb */
+ #endif
+ #elif defined(__alpha__)
+ /* <asm/io.h> fails to compile, probably because of u8 etc */
diff --git a/meta/recipes-core/util-linux/files/make_include b/meta/recipes-core/util-linux/files/make_include
new file mode 100644
index 000000000..e6abcd91f
--- /dev/null
+++ b/meta/recipes-core/util-linux/files/make_include
@@ -0,0 +1,17 @@
+VERSION=2.12
+CC=gcc
+CFLAGS=
+LDFLAGS=
+HAVE_OLD_GCC=yes
+HAVE_RAW_H=yes
+HAVE_NCURSES=yes
+CURSESFLAGS=-DNCH=1
+LIBCURSES=-lncurses
+HAVE_TERMCAP=no
+NEED_LIBCRYPT=yes
+FOREIGN = --foreign-user
+HAVE_XGETTEXT=yes
+HAVE_OPENPTY=yes
+HAVE_PIVOT_ROOT=yes
+HAVE_GOOD_RPC=yes
+HAVE_ZLIB=yes
diff --git a/meta/recipes-core/util-linux/files/optional-uuid.patch b/meta/recipes-core/util-linux/files/optional-uuid.patch
new file mode 100644
index 000000000..2d0ea43cd
--- /dev/null
+++ b/meta/recipes-core/util-linux/files/optional-uuid.patch
@@ -0,0 +1,55 @@
+From: Karel Zak <kzak@redhat.com>
+Date: Tue, 12 May 2009 19:22:19 +0000 (+0200)
+Subject: blkid: make libuuid optional
+X-Git-Url: http://git.kernel.org/?p=utils%2Futil-linux-ng%2Futil-linux-ng.git;a=commitdiff_plain;h=cdd17c7a73cab10a34bf80616225b8215ac4e2ed
+
+blkid: make libuuid optional
+
+read.c:28:23: error: uuid/uuid.h: No such file or directory
+make[3]: *** [read.lo] Error 1
+make[3]: *** Waiting for unfinished jobs....
+
+Reported-by: Olaf <mailinglists@ban-solms.de>
+Signed-off-by: Karel Zak <kzak@redhat.com>
+---
+
+diff --git a/libs/blkid/src/config.c b/libs/blkid/src/config.c
+index 2e59218..9091736 100644
+--- a/libs/blkid/src/config.c
++++ b/libs/blkid/src/config.c
+@@ -24,9 +24,6 @@
+ #include <errno.h>
+ #endif
+ #include <stdint.h>
+-#ifdef HAVE_LIBUUID
+-#include <uuid/uuid.h>
+-#endif
+ #include <stdarg.h>
+
+ #include "blkdev.h"
+diff --git a/libs/blkid/src/evaluate.c b/libs/blkid/src/evaluate.c
+index a9c9fba..f0ae126 100644
+--- a/libs/blkid/src/evaluate.c
++++ b/libs/blkid/src/evaluate.c
+@@ -27,9 +27,6 @@
+ #include <errno.h>
+ #endif
+ #include <stdint.h>
+-#ifdef HAVE_LIBUUID
+-#include <uuid/uuid.h>
+-#endif
+ #include <stdarg.h>
+
+ #include "pathnames.h"
+diff --git a/libs/blkid/src/read.c b/libs/blkid/src/read.c
+index 4163874..b5e9cd0 100644
+--- a/libs/blkid/src/read.c
++++ b/libs/blkid/src/read.c
+@@ -25,7 +25,6 @@
+ #endif
+
+ #include "blkidP.h"
+-#include "uuid/uuid.h"
+
+ #ifdef HAVE_STRTOULL
+ #define STRTOULL strtoull /* defined in stdlib.h if you try hard enough */
diff --git a/meta/recipes-core/util-linux/files/swapargs.h b/meta/recipes-core/util-linux/files/swapargs.h
new file mode 100644
index 000000000..e960eef05
--- /dev/null
+++ b/meta/recipes-core/util-linux/files/swapargs.h
@@ -0,0 +1,3 @@
+#define SWAPON_HAS_TWO_ARGS
+#include <asm/page.h>
+#include <sys/swap.h>
diff --git a/meta/recipes-core/util-linux/files/umount.diff b/meta/recipes-core/util-linux/files/umount.diff
new file mode 100644
index 000000000..78330789e
--- /dev/null
+++ b/meta/recipes-core/util-linux/files/umount.diff
@@ -0,0 +1,19 @@
+*** util-linux-2.12r/mount/umount.c.orig 2005-09-10 20:07:38.000000000 +0200
+--- util-linux-2.12r/mount/umount.c 2006-06-07 21:14:04.000000000 +0200
+***************
+*** 40,46 ****
+ #include <linux/unistd.h>
+ #ifdef __NR_umount2
+
+! static int umount2(const char *path, int flags);
+
+ _syscall2(int, umount2, const char *, path, int, flags);
+
+--- 40,46 ----
+ #include <linux/unistd.h>
+ #ifdef __NR_umount2
+
+! int umount2(const char *path, int flags);
+
+ _syscall2(int, umount2, const char *, path, int, flags);
+
diff --git a/meta/recipes-core/util-linux/files/uuid.patch b/meta/recipes-core/util-linux/files/uuid.patch
new file mode 100644
index 000000000..3208e0a86
--- /dev/null
+++ b/meta/recipes-core/util-linux/files/uuid.patch
@@ -0,0 +1,22 @@
+Index: util-linux-ng-2.15/libs/blkid/src/Makefile.am
+===================================================================
+--- util-linux-ng-2.15.orig/libs/blkid/src/Makefile.am 2009-05-19 17:01:15.000000000 +0100
++++ util-linux-ng-2.15/libs/blkid/src/Makefile.am 2009-05-19 17:08:11.000000000 +0100
+@@ -7,7 +7,7 @@
+ common_ldadd =
+
+ if HAVE_UUID
+-common_ldadd += -luuid #TODO $(UUID_LIBS)
++common_ldadd += -luuid
+ endif
+
+ # includes
+@@ -26,7 +26,7 @@
+ $(top_srcdir)/lib/md5.c
+
+ libblkid_la_LIBADD = probers/libblkid_probers.la $(common_ldadd)
+-libblkid_la_DEPENDENCIES = $(libblkid_la_LIBADD) blkid.sym
++libblkid_la_DEPENDENCIES = probers/libblkid_probers.la blkid.sym
+
+ # TODO: for unknown reason "make distcheck" requires
+ # full path to the version script
diff --git a/meta/recipes-core/util-linux/util-linux-2.17.2/tls.patch b/meta/recipes-core/util-linux/util-linux-2.17.2/tls.patch
new file mode 100644
index 000000000..bdb29cae1
--- /dev/null
+++ b/meta/recipes-core/util-linux/util-linux-2.17.2/tls.patch
@@ -0,0 +1,70 @@
+Index: util-linux-ng-2.16/m4/tls.m4
+===================================================================
+--- util-linux-ng-2.16.orig/m4/tls.m4 2009-07-04 01:20:03.000000000 +0200
++++ util-linux-ng-2.16/m4/tls.m4 2009-07-30 01:57:30.151697033 +0200
+@@ -18,31 +18,26 @@
+ # version as well.
+ #
+ AC_DEFUN([AX_TLS], [
+- AC_MSG_CHECKING(for thread local storage (TLS) class)
+- AC_CACHE_VAL(ac_cv_tls, [
+- ax_tls_keywords="__thread __declspec(thread) none"
+- for ax_tls_keyword in $ax_tls_keywords; do
+- case $ax_tls_keyword in
+- none) ac_cv_tls=none ; break ;;
+- *)
+- AC_TRY_COMPILE(
+- [#include <stdlib.h>
+- static void
+- foo(void) {
+- static ] $ax_tls_keyword [ int bar;
+- exit(1);
+- }],
+- [],
+- [ac_cv_tls=$ax_tls_keyword ; break],
+- ac_cv_tls=none
+- )
+- esac
+- done
+-])
++ AC_CACHE_CHECK([for thread local storage (TLS) class],
++ ac_cv_tls,
++ [AC_LINK_IFELSE([__thread int a; int b; int main() { return a = b; }],
++ [chktls_save_LDFLAGS="$LDFLAGS"
++ LDFLAGS="-shared -Wl,--no-undefined $LDFLAGS"
++ chktls_save_CFLAGS="$CFLAGS"
++ CFLAGS="-fPIC $CFLAGS"
++ dnl If -shared works, test if TLS works in a shared library.
++ AC_LINK_IFELSE([int f() { return 0; }],
++ AC_LINK_IFELSE([__thread int a; int b; int f() { return a = b; }],
++ [ac_cv_tls=yes],
++ [ac_cv_tls=no]),
++ [ac_cv_tls=yes])
++ CFLAGS="$chktls_save_CFLAGS"
++ LDFLAGS="$chktls_save_LDFLAGS"], [ac_cv_tls=no])
++ ])
+
+- if test "$ac_cv_tls" != "none"; then
+- dnl AC_DEFINE([TLS], [], [If the compiler supports a TLS storage class define it to that here])
+- AC_DEFINE_UNQUOTED([TLS], $ac_cv_tls, [If the compiler supports a TLS storage class define it to that here])
+- fi
+- AC_MSG_RESULT($ac_cv_tls)
++ AS_IF([test "x$ac_cv_tls" = "xyes"],
++ [AC_DEFINE([TLS], 1,
++ [Define this if the compiler supports __thread for Thread-Local Storage])
++ $1],
++ [$2])
+ ])
+Index: util-linux-ng-2.16/shlibs/uuid/src/gen_uuid.c
+===================================================================
+--- util-linux-ng-2.16.orig/shlibs/uuid/src/gen_uuid.c 2009-07-30 02:31:48.518159459 +0200
++++ util-linux-ng-2.16/shlibs/uuid/src/gen_uuid.c 2009-07-30 02:32:04.867871183 +0200
+@@ -99,7 +99,7 @@
+ #endif
+
+ #ifdef TLS
+-#define THREAD_LOCAL static TLS
++#define THREAD_LOCAL static __thread
+ #else
+ #define THREAD_LOCAL static
+ #endif
diff --git a/meta/recipes-core/util-linux/util-linux-2.17.2/uclibc-compile.patch b/meta/recipes-core/util-linux/util-linux-2.17.2/uclibc-compile.patch
new file mode 100644
index 000000000..b2e8a8b95
--- /dev/null
+++ b/meta/recipes-core/util-linux/util-linux-2.17.2/uclibc-compile.patch
@@ -0,0 +1,13 @@
+Index: util-linux-ng-2.16/misc-utils/cal.c
+===================================================================
+--- util-linux-ng-2.16.orig/misc-utils/cal.c 2009-07-03 16:20:01.000000000 -0700
++++ util-linux-ng-2.16/misc-utils/cal.c 2009-07-18 23:21:37.000000000 -0700
+@@ -407,7 +407,7 @@
+ strcpy(day_headings,"");
+ strcpy(j_day_headings,"");
+
+-#ifdef HAVE_LANGINFO_H
++#ifdef HAVE_LANGINFO_H && !defined(__UCLIBC__)
+ # define weekday(wd) nl_langinfo(ABDAY_1+wd)
+ #else
+ # define weekday(wd) _time_info->abbrev_wkday[wd]
diff --git a/meta/recipes-core/util-linux/util-linux-2.17.2/util-linux-ng-replace-siginterrupt.patch b/meta/recipes-core/util-linux/util-linux-2.17.2/util-linux-ng-replace-siginterrupt.patch
new file mode 100644
index 000000000..4b5eb7376
--- /dev/null
+++ b/meta/recipes-core/util-linux/util-linux-2.17.2/util-linux-ng-replace-siginterrupt.patch
@@ -0,0 +1,23 @@
+Index: util-linux-ng-2.14/login-utils/login.c
+===================================================================
+--- util-linux-ng-2.14.orig/login-utils/login.c 2008-05-28 16:01:02.000000000 -0700
++++ util-linux-ng-2.14/login-utils/login.c 2009-03-04 18:31:42.000000000 -0800
+@@ -358,6 +358,7 @@
+ char *childArgv[10];
+ char *buff;
+ int childArgc = 0;
++ struct sigaction act;
+ #ifdef HAVE_SECURITY_PAM_MISC_H
+ int retcode;
+ pam_handle_t *pamh = NULL;
+@@ -373,7 +374,9 @@
+ pid = getpid();
+
+ signal(SIGALRM, timedout);
+- siginterrupt(SIGALRM,1); /* we have to interrupt syscalls like ioclt() */
++ (void) sigaction(SIGALRM, NULL, &act);
++ act.sa_flags &= ~SA_RESTART;
++ sigaction(SIGALRM, &act, NULL);
+ alarm((unsigned int)timeout);
+ signal(SIGQUIT, SIG_IGN);
+ signal(SIGINT, SIG_IGN);
diff --git a/meta/recipes-core/util-linux/util-linux.inc b/meta/recipes-core/util-linux/util-linux.inc
new file mode 100644
index 000000000..571b53c99
--- /dev/null
+++ b/meta/recipes-core/util-linux/util-linux.inc
@@ -0,0 +1,237 @@
+DESCRIPTION = "Util-linux is a suite of essential utilities for any Linux system."
+SECTION = "base"
+
+# note that `lscpu' is under GPLv3+
+LICENSE = "GPLv2+ & LGPLv2.1+ & BSD"
+LICENSE_util-linux-lscpu = "GPLv3+"
+
+LIC_FILES_CHKSUM = "file://README.licensing;md5=1530e36fe1304d4535513de90a290df9 \
+ file://COPYING;md5=59530bdf33659b29e73d4adb9f9f6552 \
+ file://licenses/COPYING.GPL;md5=8ca43cbc842c2336e835926c2166c28b \
+ file://licenses/COPYING.UCB;md5=263860f8968d8bafa5392cab74285262 \
+ file://getopt/COPYING;md5=8ca43cbc842c2336e835926c2166c28b"
+
+DEPENDS = "udev zlib ncurses virtual/libintl gettext"
+DEPENDS_virtclass-native = "zlib-native ncurses-native lzo-native gettext-native"
+
+inherit autotools
+
+SRC_URI = "${KERNELORG_MIRROR}/pub/linux/utils/util-linux-ng/v${MAJOR_VERSION}/util-linux-ng-${PV}.tar.bz2 \
+ file://MCONFIG \
+ file://swapargs.h \
+ file://defines.h \
+ file://make_include \
+ "
+
+PACKAGES_prepend = "util-linux-fdisk util-linux-cfdisk util-linux-sfdisk util-linux-swaponoff util-linux-losetup util-linux-umount util-linux-mount util-linux-readprofile "
+
+PACKAGES_virtclass-native = ""
+
+S = "${WORKDIR}/util-linux-ng-${PV}"
+
+EXTRA_OECONF = "--disable-use-tty-group --disable-makeinstall-chown --enable-elvtune --enable-init --enable-kill --enable-last \
+ --enable-mesg --enable-partx --enable-raw --enable-rdev --enable-reset \
+ --disable-login-utils --enable-write --enable-arch --enable-mount --with-fsprobe=builtin --enable-libuuid --enable-libblkid --enable-fsck"
+
+FILES_${PN}-doc += "/usr/share/getopt/getopt-*.*"
+
+FILES_util-linux-fdisk = "/sbin/fdisk.${PN}"
+FILES_util-linux-cfdisk = "/sbin/cfdisk"
+FILES_util-linux-sfdisk = "/sbin/sfdisk"
+FILES_util-linux-swaponoff = "/sbin/swapon.${PN} /sbin/swapoff.${PN}"
+FILES_util-linux-losetup = "/sbin/losetup.${PN}"
+FILES_util-linux-mount = "/bin/mount.${PN}"
+FILES_util-linux-umount = "/bin/umount.${PN}"
+FILES_util-linux-readprofile = "/usr/sbin/readprofile"
+
+RRECOMMENDS_${PN} = "util-linux-fdisk util-linux-cfdisk util-linux-sfdisk util-linux-mount util-linux-readprofile "
+RDEPENDS_${PN} = "util-linux-umount util-linux-swaponoff util-linux-losetup"
+
+RRECOMMENDS_${PN}_virtclass-native = ""
+RDEPENDS_${PN}_virtclass-native = ""
+
+do_compile () {
+ set -e
+ install ${WORKDIR}/MCONFIG ${S}/MCONFIG
+ install ${WORKDIR}/make_include ${S}/make_include
+ install ${WORKDIR}/swapargs.h ${S}/mount/swapargs.h
+ install ${WORKDIR}/defines.h ${S}/defines.h
+ oe_runmake ARCH=${TARGET_ARCH} CPU= CPUOPT= \
+ 'OPT=${CFLAGS}' 'CC=${CC}' 'LD=${LD}' \
+ 'LDFLAGS=${LDFLAGS}'
+}
+
+checklink() {
+ local targ link value
+ targ="$1"
+ link="$2"
+ ext="$3"
+ if test -h "$link"
+ then
+ value="$(readlink "$link")"
+ if test "$value" = "$targ"
+ then
+ rm "$link"
+ ln -s "$targ"."${PN}" "$link$ext"
+ return 0
+ else
+ echo "$link: '$value' found '$targ' expected" >&2
+ return 1
+ fi
+ else
+ echo "$link: not a symbolic link" >&2
+ return 1
+ fi
+}
+
+do_install () {
+ # with ccache the timestamps on compiled files may
+ # end up earlier than on their inputs, this allows
+ # for the resultant compilation in the install step.
+ oe_runmake ARCH=${TARGET_ARCH} CPU= CPUOPT= \
+ 'OPT=${CFLAGS}' 'CC=${CC}' 'LD=${LD}' \
+ 'LDFLAGS=${LDFLAGS}' 'DESTDIR=${D}' install
+
+ mkdir -p ${D}${base_bindir}
+
+ sbinprogs="agetty blockdev ctrlaltdel cfdisk vipw vigr"
+ sbinprogs_a="pivot_root hwclock mkswap shutdown mkfs.minix fsck.minix losetup swapon fdisk readprofile fsck blkid sln"
+ usrbinprogs_a="chfn chsh hexdump last logger mesg newgrp renice wall setsid chrt"
+ binprogs_a="dmesg kill more umount mount login reset"
+
+ if [ "${base_sbindir}" != "${sbindir}" ]; then
+ mkdir -p ${D}${base_sbindir}
+ for p in $sbinprogs $sbinprogs_a; do
+ if [ -f "${D}${sbindir}/$p" ]; then
+ mv "${D}${sbindir}/$p" "${D}${base_sbindir}/$p"
+ fi
+ done
+ fi
+
+ if [ "${base_bindir}" != "${bindir}" ]; then
+ mkdir -p ${D}${base_bindir}
+ for p in $binprogs_a; do
+ if [ -f "${D}${bindir}/$p" ]; then
+ mv "${D}${bindir}/$p" "${D}${base_bindir}/$p"
+ fi
+ done
+ fi
+
+ for p in $usrbinprogs_a; do
+ if [ -f "${D}${bindir}/$p" ]; then
+ mv "${D}${bindir}/$p" "${D}${bindir}/$p.${PN}"
+ fi
+ done
+
+ for p in $binprogs_a; do
+ if [ -f "${D}${base_bindir}/$p" ]; then
+ mv "${D}${base_bindir}/$p" "${D}${base_bindir}/$p.${PN}"
+ fi
+ done
+
+ for p in $sbinprogs_a; do
+ if [ -f "${D}${base_sbindir}/$p" ]; then
+ mv "${D}${base_sbindir}/$p" "${D}${base_sbindir}/$p.${PN}"
+ fi
+ done
+
+ install -d ${D}${sysconfdir}/default/
+ echo 'MOUNTALL="-t nonfs,nosmbfs,noncpfs"' > ${D}${sysconfdir}/default/mountall
+
+ ln -sf ${sbindir}/swapon ${D}${sbindir}/swapoff.${PN}
+ ln -sf ${sbindir}/shutdown ${D}${sbindir}/reboot.${PN}
+ ln -sf ${sbindir}/shutdown ${D}${sbindir}/halt.${PN}
+ ln -sf ${sbindir}/shutdown ${D}${sbindir}/fastboot
+ ln -sf ${sbindir}/shutdown ${D}${sbindir}/fasthalt
+}
+
+pkg_postinst_${PN} () {
+ update-alternatives --install ${base_bindir}/dmesg dmesg dmesg.${PN} 100
+ update-alternatives --install ${base_bindir}/kill kill kill.${PN} 100
+ update-alternatives --install ${base_bindir}/more more more.${PN} 100
+ update-alternatives --install ${base_sbindir}/mkswap mkswap mkswap.${PN} 100
+ test -x ${base_sbindir}/pivot_root.${PN} && \
+ update-alternatives --install ${base_sbindir}/pivot_root pivot_root pivot_root.${PN} 100
+# update-alternatives --install ${base_sbindir}/sln sln sln.${PN} 100
+ update-alternatives --install ${base_sbindir}/mkfs.minix mkfs.minix mkfs.minix.${PN} 100
+ update-alternatives --install ${base_sbindir}/fsck.minix fsck.minix fsck.minix.${PN} 100
+ update-alternatives --install ${bindir}/hexdump hexdump hexdump.${PN} 100
+ update-alternatives --install ${bindir}/last last last.${PN} 100
+ update-alternatives --install ${bindir}/logger logger logger.${PN} 100
+ update-alternatives --install ${bindir}/mesg mesg mesg.${PN} 100
+ update-alternatives --install ${bindir}/renice renice renice.${PN} 100
+ update-alternatives --install ${bindir}/wall wall wall.${PN} 100
+
+ # There seems to be problem, atleast on nslu2, with these, untill they are
+ # fixed the busybox ones have higher priority
+ update-alternatives --install ${base_sbindir}/hwclock hwclock hwclock.${PN} 10
+ update-alternatives --install ${base_sbindir}/shutdown shutdown shutdown.${PN} 10
+ update-alternatives --install ${base_sbindir}/reboot reboot reboot.${PN} 10
+ update-alternatives --install ${base_sbindir}/halt halt halt.${PN} 10
+}
+
+pkg_prerm_${PN} () {
+ test -x ${base_sbindir}/pivot_root.${PN} && \
+ update-alternatives --remove pivot_root pivot_root.${PN}
+ update-alternatives --remove dmesg dmesg.${PN}
+ update-alternatives --remove kill kill.${PN}
+ update-alternatives --remove more more.${PN}
+ update-alternatives --remove halt halt.${PN}
+ update-alternatives --remove hwclock hwclock.${PN}
+ update-alternatives --remove mkswap mkswap.${PN}
+ update-alternatives --remove reboot reboot.${PN}
+ update-alternatives --remove shutdown shutdown.${PN}
+# update-alternatives --remove sln sln.${PN}
+ update-alternatives --remove mkfs.minix mkfs.minix.${PN}
+ update-alternatives --remove fsck.minix fsck.minix.${PN}
+ update-alternatives --remove hexdump hexdump.${PN}
+ update-alternatives --remove last last.${PN}
+ update-alternatives --remove logger logger.${PN}
+ update-alternatives --remove mesg mesg.${PN}
+ update-alternatives --remove renice renice.${PN}
+ update-alternatives --remove wall wall.${PN}
+}
+
+pkg_postinst_util-linux-fdisk () {
+ update-alternatives --install ${base_sbindir}/fdisk fdisk fdisk.${PN} 100
+}
+
+pkg_prerm_util-linux-fdisk () {
+ update-alternatives --remove fdisk fdisk.${PN}
+}
+
+pkg_postinst_util-linux-mount () {
+ update-alternatives --install ${base_bindir}/mount mount mount.${PN} 100
+}
+
+pkg_prerm_util-linux-mount () {
+ update-alternatives --remove mount mount.${PN}
+}
+
+pkg_postinst_util-linux-umount () {
+ update-alternatives --install ${base_bindir}/umount umount umount.${PN} 100
+}
+
+pkg_prerm_util-linux-umount () {
+ update-alternatives --remove umount umount.${PN}
+}
+
+pkg_postinst_util-linux-losetup () {
+ update-alternatives --install ${base_sbindir}/losetup losetup losetup.${PN} 100
+}
+
+pkg_prerm_util-linux-losetup () {
+ update-alternatives --remove losetup losetup.${PN}
+}
+
+pkg_postinst_util-linux-swaponoff () {
+ update-alternatives --install ${base_sbindir}/swapoff swapoff swapoff.${PN} 100
+ update-alternatives --install ${base_sbindir}/swapon swapon swapon.${PN} 100
+}
+
+pkg_prerm_util-linux-swaponoff () {
+ update-alternatives --remove swapoff swapoff.${PN}
+ update-alternatives --remove swapon swapon.${PN}
+}
+
+BBCLASSEXTEND = "native"
diff --git a/meta/recipes-core/util-linux/util-linux_2.17.2.bb b/meta/recipes-core/util-linux/util-linux_2.17.2.bb
new file mode 100644
index 000000000..9efe64a6c
--- /dev/null
+++ b/meta/recipes-core/util-linux/util-linux_2.17.2.bb
@@ -0,0 +1,11 @@
+MAJOR_VERSION = "2.17"
+require util-linux.inc
+PR="r0"
+
+SRC_URI += "file://uclibc-compile.patch \
+ file://util-linux-ng-replace-siginterrupt.patch"
+
+# fallocate is glibc 2.10, fallocate64 is glibc 2.11
+# we need to disable it for older versions
+EXTRA_OECONF += "ac_cv_func_fallocate=no"
+EXTRA_OECONF_virtclass-native += "--disable-fallocate --disable-use-tty-group"