summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core
diff options
context:
space:
mode:
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 0000000000..953c2d17a9
--- /dev/null
+++ b/meta/recipes-core/coreutils/coreutils-6.9/futimens.patch
@@ -0,0 +1,61 @@
1# coreutils uses gnulib which conflicts with newer libc header on futimens
2# this patch simply renames coreutils futimes to avoid confliction
3#
4# Signed-off-by Kevin Tian <kevin.tian@intel.com>, 2010-08-18
5# (this patch is licensed under GPLv2)
6
7diff --git a/lib/utimens.c b/lib/utimens.c
8index 71bc510..ae870b8 100644
9--- a/lib/utimens.c
10+++ b/lib/utimens.c
11@@ -75,7 +75,7 @@ struct utimbuf
12 Return 0 on success, -1 (setting errno) on failure. */
13
14 int
15-futimens (int fd ATTRIBUTE_UNUSED,
16+futimens_coreutils (int fd ATTRIBUTE_UNUSED,
17 char const *file, struct timespec const timespec[2])
18 {
19 /* Some Linux-based NFS clients are buggy, and mishandle time stamps
20@@ -185,5 +185,5 @@ futimens (int fd ATTRIBUTE_UNUSED,
21 int
22 utimens (char const *file, struct timespec const timespec[2])
23 {
24- return futimens (-1, file, timespec);
25+ return futimens_coreutils (-1, file, timespec);
26 }
27diff --git a/lib/utimens.h b/lib/utimens.h
28index 0097aaa..13fc45a 100644
29--- a/lib/utimens.h
30+++ b/lib/utimens.h
31@@ -1,3 +1,3 @@
32 #include <time.h>
33-int futimens (int, char const *, struct timespec const [2]);
34+int futimens_coreutils (int, char const *, struct timespec const [2]);
35 int utimens (char const *, struct timespec const [2]);
36diff --git a/src/copy.c b/src/copy.c
37index 4bdb75c..04634f1 100644
38--- a/src/copy.c
39+++ b/src/copy.c
40@@ -518,7 +518,7 @@ copy_reg (char const *src_name, char const *dst_name,
41 timespec[0] = get_stat_atime (src_sb);
42 timespec[1] = get_stat_mtime (src_sb);
43
44- if (futimens (dest_desc, dst_name, timespec) != 0)
45+ if (futimens_coreutils (dest_desc, dst_name, timespec) != 0)
46 {
47 error (0, errno, _("preserving times for %s"), quote (dst_name));
48 if (x->require_preserve)
49diff --git a/src/touch.c b/src/touch.c
50index a79c26d..6ef317d 100644
51--- a/src/touch.c
52+++ b/src/touch.c
53@@ -182,7 +182,7 @@ touch (const char *file)
54 t = timespec;
55 }
56
57- ok = (futimens (fd, (fd == STDOUT_FILENO ? NULL : file), t) == 0);
58+ ok = (futimens_coreutils (fd, (fd == STDOUT_FILENO ? NULL : file), t) == 0);
59
60 if (fd == STDIN_FILENO)
61 {
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 0000000000..b42f5c9faa
--- /dev/null
+++ b/meta/recipes-core/coreutils/coreutils-6.9/gnulib_m4.patch
@@ -0,0 +1,19 @@
1# remove the line to cause recursive inclusion error from autoreconf, sicne
2# newer autoconf has included this definition. Simply rename it here.
3#
4# Signed-off-by Kevin Tian <kevin.tian@intel.com>, 2010-08-18
5# (this patch is licensed under GPLv2)
6
7diff --git a/extensions.m4 b/extensions.m4
8index 143a9e5..f6558f1 100644
9--- a/m4/extensions.m4
10+++ b/m4/extensions.m4
11@@ -16,7 +16,7 @@
12 # ------------------------
13 # Enable extensions on systems that normally disable them,
14 # typically due to standards-conformance issues.
15-AC_DEFUN([AC_USE_SYSTEM_EXTENSIONS],
16+AC_DEFUN([AC_USE_SYSTEM_EXTENSIONS_DUMMY],
17 [
18 AC_BEFORE([$0], [AC_COMPILE_IFELSE])
19 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 0000000000..95a9638921
--- /dev/null
+++ b/meta/recipes-core/coreutils/coreutils-6.9/man-touch.patch
@@ -0,0 +1,22 @@
1# man page for 'touch' is generated differently from others. All other utilities
2# are provided static man source files, while for 'touch' it requires help2man
3# to invoke "touch --help" and then convert the output into the manual. Since touch
4# is with target format which can't be invoked on build system, disable building
5# 'touch' man page here.
6#
7# Signed-off-by Kevin Tian <kevin.tian@intel.com>, 2010-08-18
8# (this patch is licensed under GPLv2)
9
10diff --git a/man/Makefile.am b/man/Makefile.am
11index 32df9d1..37b09e3 100644
12--- a/man/Makefile.am
13+++ b/man/Makefile.am
14@@ -27,7 +27,7 @@ dist_man_MANS = \
15 paste.1 pathchk.1 pr.1 printenv.1 printf.1 ptx.1 pwd.1 readlink.1 \
16 rm.1 rmdir.1 seq.1 sha1sum.1 sha224sum.1 sha256sum.1 sha384sum.1 sha512sum.1 \
17 shred.1 shuf.1 sleep.1 sort.1 split.1 stat.1 \
18- su.1 sum.1 sync.1 tac.1 tail.1 tee.1 test.1 touch.1 tr.1 true.1 tsort.1 \
19+ su.1 sum.1 sync.1 tac.1 tail.1 tee.1 test.1 tr.1 true.1 tsort.1 \
20 tty.1 unexpand.1 uniq.1 unlink.1 vdir.1 wc.1 \
21 whoami.1 yes.1 $(MAN)
22 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 0000000000..6a23f4f65f
--- /dev/null
+++ b/meta/recipes-core/coreutils/coreutils_6.9.bb
@@ -0,0 +1,78 @@
1DESCRIPTION = "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"
2HOMEPAGE = "http://www.gnu.org/software/coreutils/"
3BUGTRACKER = "http://debbugs.gnu.org/coreutils"
4LICENSE = "GPLv2+"
5LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe \
6 file://src/ls.c;startline=4;endline=16;md5=482a96d4f25010a4e13f8743e0c3685e"
7PR = "r0"
8DEPENDS = "perl-native"
9
10inherit autotools gettext
11
12SRC_URI = "http://ftp.gnu.org/gnu/coreutils/${BP}.tar.bz2 \
13 file://gnulib_m4.patch \
14 file://futimens.patch \
15 file://man-touch.patch"
16
17# [ gets a special treatment and is not included in this
18bindir_progs = "base64 basename cksum comm csplit cut dir dircolors dirname du \
19 env expand expr factor fmt fold groups head hostid id install \
20 join link logname md5sum mkfifo nice nl nohup od paste pathchk \
21 pinky pr printenv printf ptx readlink seq sha1sum sha224sum sha256sum \
22 sha384sum sha512sum shred shuf sort split stat sum tac tail tee test \
23 tr tsort tty unexpand uniq unlink users vdir wc who whoami yes"
24
25# hostname gets a special treatment and is not included in this
26base_bindir_progs = "cat chgrp chmod chown cp date dd echo false kill ln ls mkdir \
27 mknod mv pwd rm rmdir sleep stty sync touch true uname"
28
29sbindir_progs= "chroot"
30
31do_install() {
32 autotools_do_install
33
34 for i in ${bindir_progs}; do mv ${D}${bindir}/$i ${D}${bindir}/$i.${PN}; done
35
36 install -d ${D}${base_bindir}
37 for i in ${base_bindir_progs}; do mv ${D}${bindir}/$i ${D}${base_bindir}/$i.${PN}; done
38
39 install -d ${D}${sbindir}
40 for i in ${sbindir_progs}; do mv ${D}${bindir}/$i ${D}${sbindir}/$i.${PN}; done
41
42 # [ requires special handling because [.coreutils will cause the sed stuff
43 # in update-alternatives to fail, therefore use lbracket - the name used
44 # for the actual source file.
45 mv ${D}${bindir}/[ ${D}${bindir}/lbracket.${PN}
46
47 # hostname and uptime separated. busybox's versions are preferred
48 mv ${D}${bindir}/hostname ${D}${base_bindir}/hostname.${PN}
49 mv ${D}${bindir}/uptime ${D}${bindir}/uptime.${PN}
50}
51
52pkg_postinst_${PN} () {
53 for i in ${bindir_progs}; do update-alternatives --install ${bindir}/$i $i $i.${PN} 100; done
54
55 for i in ${base_bindir_progs}; do update-alternatives --install ${base_bindir}/$i $i $i.${PN} 100; done
56
57 for i in ${sbindir_progs}; do update-alternatives --install ${sbindir}/$i $i $i.${PN} 100; done
58
59 # Special cases. uptime and hostname is broken, prefer busybox's version. [ needs to be treated separately.
60 update-alternatives --install ${bindir}/uptime uptime uptime.${PN} 10
61 update-alternatives --install ${base_bindir}/hostname hostname hostname.${PN} 10
62 update-alternatives --install '${bindir}/[' '[' 'lbracket.${PN}' 100
63}
64
65pkg_prerm_${PN} () {
66 for i in ${bindir_progs}; do update-alternatives --remove $i $i.${PN}; done
67
68 for i in ${base_bindir_progs}; do update-alternatives --remove $i $i.${PN}; done
69
70 for i in ${sbindir_progs}; do update-alternatives --remove $i $i.${PN}; done
71
72 # The special cases
73 update-alternatives --remove hostname hostname.${PN}
74 update-alternatives --remove uptime uptime.${PN}
75 update-alternatives --remove '[' 'lbracket.${PN}'
76}
77
78BBCLASSEXTEND = "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 0000000000..5213fa2937
--- /dev/null
+++ b/meta/recipes-core/coreutils/coreutils_8.5.bb
@@ -0,0 +1,67 @@
1DESCRIPTION = "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"
2HOMEPAGE = "http://www.gnu.org/software/coreutils/"
3BUGTRACKER = "http://debbugs.gnu.org/coreutils"
4LICENSE = "GPLv3+"
5LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504\
6 file://src/ls.c;startline=5;endline=16;md5=bb14ed3c4cda583abc85401304b5cd4e"
7PR = "r0"
8DEPENDS = "perl-native"
9
10inherit autotools gettext
11
12SRC_URI = "http://ftp.gnu.org/gnu/coreutils/${BP}.tar.gz"
13
14# [ gets a special treatment and is not included in this
15bindir_progs = "base64 basename chcon cksum comm csplit cut dir dircolors dirname du \
16 env expand expr factor fmt fold groups head hostid id install \
17 join link logname md5sum mkfifo mktemp nice nl nohup nproc od paste pathchk \
18 pinky pr printenv printf ptx readlink runcon seq sha1sum sha224sum sha256sum \
19 sha384sum sha512sum shred shuf sort split stat stdbuf sum tac tail tee test timeout\
20 tr truncate tsort tty unexpand uniq unlink uptime users vdir wc who whoami yes"
21
22# hostname gets a special treatment and is not included in this
23base_bindir_progs = "cat chgrp chmod chown cp date dd echo false kill ln ls mkdir \
24 mknod mv pwd rm rmdir sleep stty sync touch true uname"
25
26sbindir_progs= "chroot"
27
28do_install_append() {
29 for i in ${bindir_progs}; do mv ${D}${bindir}/$i ${D}${bindir}/$i.${PN}; done
30
31 install -d ${D}${base_bindir}
32 for i in ${base_bindir_progs}; do mv ${D}${bindir}/$i ${D}${base_bindir}/$i.${PN}; done
33
34 install -d ${D}${sbindir}
35 for i in ${sbindir_progs}; do mv ${D}${bindir}/$i ${D}${sbindir}/$i.${PN}; done
36
37 # [ requires special handling because [.coreutils will cause the sed stuff
38 # in update-alternatives to fail, therefore use lbracket - the name used
39 # for the actual source file.
40 mv ${D}${bindir}/[ ${D}${bindir}/lbracket.${PN}
41}
42
43pkg_postinst_${PN} () {
44 for i in ${bindir_progs}; do update-alternatives --install ${bindir}/$i $i $i.${PN} 100; done
45
46 for i in ${base_bindir_progs}; do update-alternatives --install ${base_bindir}/$i $i $i.${PN} 100; done
47
48 for i in ${sbindir_progs}; do update-alternatives --install ${sbindir}/$i $i $i.${PN} 100; done
49
50 # Special cases. [ needs to be treated separately.
51 update-alternatives --install '${bindir}/[' '[' 'lbracket.${PN}' 100
52}
53
54pkg_prerm_${PN} () {
55 for i in ${bindir_progs}; do update-alternatives --remove $i $i.${PN}; done
56
57 for i in ${base_bindir_progs}; do update-alternatives --remove $i $i.${PN}; done
58
59 for i in ${sbindir_progs}; do update-alternatives --remove $i $i.${PN}; done
60
61 # The special cases
62 update-alternatives --remove hostname hostname.${PN}
63 update-alternatives --remove uptime uptime.${PN}
64 update-alternatives --remove '[' 'lbracket.${PN}'
65}
66
67BBCLASSEXTEND = "native"
diff --git a/meta/recipes-core/ncurses/ncurses.inc b/meta/recipes-core/ncurses/ncurses.inc
new file mode 100644
index 0000000000..259750cb46
--- /dev/null
+++ b/meta/recipes-core/ncurses/ncurses.inc
@@ -0,0 +1,99 @@
1DESCRIPTION = "Ncurses library"
2HOMEPAGE = "http://www.gnu.org/software/ncurses/ncurses.html"
3LICENSE = "MIT"
4SECTION = "libs"
5DEPENDS = "ncurses-native"
6DEPENDS_virtclass-native = ""
7PACKAGES_prepend = "ncurses-tools "
8PACKAGES_append = " ncurses-terminfo"
9FILES_ncurses_append = " ${datadir}/tabset"
10RSUGGESTS_${PN} = "ncurses-terminfo"
11RPROVIDES = "libncurses5"
12
13inherit autotools
14
15# This keeps only tput/tset in ncurses
16# clear/reset are in already busybox
17FILES_ncurses-tools = "${bindir}/tic ${bindir}/toe ${bindir}/infotocap ${bindir}/captoinfo ${bindir}/infocmp ${bindir}/clear.${PN} ${bindir}/reset.${PN} ${bindir}/tack "
18FILES_ncurses-terminfo = "${datadir}/terminfo"
19FILES_${PN} = "${bindir}/tput ${bindir}/tset ${libdir}/lib*.so.* /usr/share/tabset /etc/terminfo"
20
21PARALLEL_MAKE=""
22
23FILESPATH = "${FILE_DIRNAME}/local:${FILE_DIRNAME}/ncurses-${PV}-${PR}:${FILE_DIRNAME}/ncurses-${PV}:${FILE_DIRNAME}/ncurses:${FILE_DIRNAME}"
24
25EXTRA_OECONF = "--with-shared \
26 --with-libtool \
27 --without-profile \
28 --without-debug \
29 --disable-rpath \
30 --enable-echo \
31 --enable-const \
32 --without-ada \
33 --enable-termcap \
34 --without-cxx-binding \
35 --with-terminfo-dirs=${sysconfdir}/terminfo:${datadir}/terminfo \
36 --enable-overwrite \
37 --with-build-ldflags='' \
38 --with-build-ccflags='' "
39export BUILD_CCFLAGS = "-I${S}/ncurses -I${S}/include ${BUILD_CFLAGS}"
40export BUILD_LDFLAGS = ""
41export EXTRA_OEMAKE = '"BUILD_LDFLAGS=" "BUILD_CCFLAGS=${BUILD_CCFLAGS}"'
42
43# This is necessary so that the "tic" command executed during the install can
44# link with the correct libary in staging.
45export LD_LIBRARY_PATH = "${STAGING_LIBDIR_NATIVE}"
46
47do_install() {
48 autotools_do_install
49
50 ln -sf curses.h ${D}${includedir}/ncurses.h
51
52 # our ncurses has termcap support
53 ln -sf libncurses.so ${D}${libdir}/libtermcap.so
54 ln -sf libncurses.a ${D}${libdir}/libtermcap.a
55
56 # include some basic terminfo files
57 # stolen ;) from gentoo and modified a bit
58 for x in ansi console dumb linux rxvt screen sun vt{52,100,102,200,220} xterm-color xterm-xfree86
59 do
60 local termfile="$(find "${D}${datadir}/terminfo/" -name "${x}" 2>/dev/null)"
61 local basedir="$(basename $(dirname "${termfile}"))"
62
63 if [ -n "${termfile}" ]
64 then
65 install -d ${D}${sysconfdir}/terminfo/${basedir}
66 mv ${termfile} ${D}${sysconfdir}/terminfo/${basedir}/
67 ln -s /etc/terminfo/${basedir}/${x} \
68 ${D}${datadir}/terminfo/${basedir}/${x}
69 fi
70 done
71 # i think we can use xterm-color as default xterm
72 if [ -e ${D}${sysconfdir}/terminfo/x/xterm-color ]
73 then
74 ln -sf xterm-color ${D}${sysconfdir}/terminfo/x/xterm
75 fi
76
77 if [ "${PN}" = "ncurses" ]; then
78 mv ${D}${bindir}/clear ${D}${bindir}/clear.${PN}
79 mv ${D}${bindir}/reset ${D}${bindir}/reset.${PN}
80 fi
81}
82
83
84pkg_postinst_ncurses-tools () {
85 if [ "${PN}" = "ncurses" ]; then
86 update-alternatives --install ${bindir}/clear clear clear.${PN} 100
87 update-alternatives --install ${bindir}/reset reset reset.${PN} 100
88 fi
89}
90
91
92pkg_prerm_ncurses-tools () {
93 if [ "${PN}" = "ncurses" ]; then
94 update-alternatives --remove clear clear.${PN}
95 update-alternatives --remove reset reset.${PN}
96 fi
97}
98
99BBCLASSEXTEND = "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 0000000000..480855bcc6
--- /dev/null
+++ b/meta/recipes-core/ncurses/ncurses/makefile_tweak.patch
@@ -0,0 +1,89 @@
1Libtool 2.2.2 needs to be able to use top_builddir. Automake usually exports
2this but ncurses doesn't use automake.
3
4RP 14/4/08
5
6Index: ncurses-5.4/ncurses/Makefile.in
7===================================================================
8--- ncurses-5.4.orig/ncurses/Makefile.in 2008-04-14 12:22:34.000000000 +0100
9+++ ncurses-5.4/ncurses/Makefile.in 2008-04-14 12:22:53.000000000 +0100
10@@ -57,6 +57,7 @@
11 MODEL = @DFT_LWR_MODEL@
12 DESTDIR = @DESTDIR@
13 top_srcdir = @top_srcdir@
14+top_builddir = @top_srcdir@
15 srcdir = @srcdir@
16 prefix = @prefix@
17 exec_prefix = @exec_prefix@
18Index: ncurses-5.4/form/Makefile.in
19===================================================================
20--- ncurses-5.4.orig/form/Makefile.in 2008-04-14 12:30:35.000000000 +0100
21+++ ncurses-5.4/form/Makefile.in 2008-04-14 12:30:59.000000000 +0100
22@@ -51,6 +51,7 @@
23 MODEL = @DFT_LWR_MODEL@
24 DESTDIR = @DESTDIR@
25 srcdir = @srcdir@
26+top_builddir = @top_srcdir@
27 prefix = @prefix@
28 exec_prefix = @exec_prefix@
29 bindir = @bindir@
30Index: ncurses-5.4/menu/Makefile.in
31===================================================================
32--- ncurses-5.4.orig/menu/Makefile.in 2008-04-14 12:29:00.000000000 +0100
33+++ ncurses-5.4/menu/Makefile.in 2008-04-14 12:29:13.000000000 +0100
34@@ -51,6 +51,7 @@
35 MODEL = @DFT_LWR_MODEL@
36 DESTDIR = @DESTDIR@
37 srcdir = @srcdir@
38+top_builddir = @top_srcdir@
39 prefix = @prefix@
40 exec_prefix = @exec_prefix@
41 bindir = @bindir@
42Index: ncurses-5.4/panel/Makefile.in
43===================================================================
44--- ncurses-5.4.orig/panel/Makefile.in 2008-04-14 12:27:40.000000000 +0100
45+++ ncurses-5.4/panel/Makefile.in 2008-04-14 12:27:59.000000000 +0100
46@@ -51,6 +51,7 @@
47 MODEL = @DFT_LWR_MODEL@
48 DESTDIR = @DESTDIR@
49 srcdir = @srcdir@
50+top_builddir = @top_srcdir@
51 prefix = @prefix@
52 exec_prefix = @exec_prefix@
53 bindir = @bindir@
54Index: ncurses-5.4/progs/Makefile.in
55===================================================================
56--- ncurses-5.4.orig/progs/Makefile.in 2008-04-14 12:24:37.000000000 +0100
57+++ ncurses-5.4/progs/Makefile.in 2008-04-14 12:25:06.000000000 +0100
58@@ -54,6 +54,7 @@
59 MODEL = ../@DFT_OBJ_SUBDIR@
60 DESTDIR = @DESTDIR@
61 srcdir = @srcdir@
62+top_builddir = @top_srcdir@
63 prefix = @prefix@
64 exec_prefix = @exec_prefix@
65 bindir = @bindir@
66Index: ncurses-5.4/tack/Makefile.in
67===================================================================
68--- ncurses-5.4.orig/tack/Makefile.in 2008-04-14 12:26:05.000000000 +0100
69+++ ncurses-5.4/tack/Makefile.in 2008-04-14 12:26:26.000000000 +0100
70@@ -22,6 +22,7 @@
71 MODEL = ../@DFT_OBJ_SUBDIR@
72 DESTDIR = @DESTDIR@
73 srcdir = @srcdir@
74+top_builddir = @top_srcdir@
75 prefix = @prefix@
76 exec_prefix = @exec_prefix@
77 bindir = @bindir@
78Index: ncurses-5.4/test/Makefile.in
79===================================================================
80--- ncurses-5.4.orig/test/Makefile.in 2008-04-14 12:32:37.000000000 +0100
81+++ ncurses-5.4/test/Makefile.in 2008-04-14 12:32:56.000000000 +0100
82@@ -43,6 +43,7 @@
83
84 MODEL = ../@DFT_OBJ_SUBDIR@
85 srcdir = @srcdir@
86+top_builddir = @top_srcdir@
87 prefix = @prefix@
88 exec_prefix = @exec_prefix@
89 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 0000000000..29cac5f1b8
--- /dev/null
+++ b/meta/recipes-core/ncurses/ncurses/visibility.patch
@@ -0,0 +1,4904 @@
1
2#
3# Patch managed by http://www.holgerschurig.de/patcher.html
4#
5
6--- ncurses-5.4/ncurses/Makefile.in~visibility.patch
7+++ ncurses-5.4/ncurses/Makefile.in
8@@ -107,7 +107,7 @@
9 CFLAGS_NORMAL = $(CCFLAGS)
10 CFLAGS_DEBUG = $(CCFLAGS) @CC_G_OPT@ -DTRACE
11 CFLAGS_PROFILE = $(CCFLAGS) -pg
12-CFLAGS_SHARED = $(CCFLAGS) @CC_SHARED_OPTS@
13+CFLAGS_SHARED = $(CCFLAGS) @CC_SHARED_OPTS@ @LIBOPTS@
14
15 CFLAGS_DEFAULT = $(CFLAGS_@DFT_UPR_MODEL@)
16
17--- ncurses-5.4/panel/Makefile.in~visibility.patch
18+++ ncurses-5.4/panel/Makefile.in
19@@ -88,7 +88,7 @@
20 CFLAGS_NORMAL = $(CCFLAGS)
21 CFLAGS_DEBUG = $(CCFLAGS) @CC_G_OPT@ -DTRACE
22 CFLAGS_PROFILE = $(CCFLAGS) -pg
23-CFLAGS_SHARED = $(CCFLAGS) @CC_SHARED_OPTS@
24+CFLAGS_SHARED = $(CCFLAGS) @CC_SHARED_OPTS@ @LIBOPTS@
25
26 CFLAGS_DEFAULT = $(CFLAGS_@DFT_UPR_MODEL@)
27
28--- ncurses-5.4/menu/Makefile.in~visibility.patch
29+++ ncurses-5.4/menu/Makefile.in
30@@ -87,7 +87,7 @@
31 CFLAGS_NORMAL = $(CCFLAGS)
32 CFLAGS_DEBUG = $(CCFLAGS) @CC_G_OPT@ -DTRACE
33 CFLAGS_PROFILE = $(CCFLAGS) -pg
34-CFLAGS_SHARED = $(CCFLAGS) @CC_SHARED_OPTS@
35+CFLAGS_SHARED = $(CCFLAGS) @CC_SHARED_OPTS@ @LIBOPTS@
36
37 CFLAGS_DEFAULT = $(CFLAGS_@DFT_UPR_MODEL@)
38
39--- ncurses-5.4/c++/Makefile.in~visibility.patch
40+++ ncurses-5.4/c++/Makefile.in
41@@ -80,7 +80,7 @@
42 CFLAGS_NORMAL = $(CCFLAGS)
43 CFLAGS_DEBUG = $(CCFLAGS) @CXX_G_OPT@ -DTRACE
44 CFLAGS_PROFILE = $(CCFLAGS) -pg
45-CFLAGS_SHARED = $(CCFLAGS) @CC_SHARED_OPTS@
46+CFLAGS_SHARED = $(CCFLAGS) @CC_SHARED_OPTS@ @LIBOPTS@
47
48 CFLAGS_DEFAULT = $(CFLAGS_@DFT_UPR_MODEL@)
49
50--- ncurses-5.4/form/Makefile.in~visibility.patch
51+++ ncurses-5.4/form/Makefile.in
52@@ -88,7 +88,7 @@
53 CFLAGS_NORMAL = $(CCFLAGS)
54 CFLAGS_DEBUG = $(CCFLAGS) @CC_G_OPT@ -DTRACE
55 CFLAGS_PROFILE = $(CCFLAGS) -pg
56-CFLAGS_SHARED = $(CCFLAGS) @CC_SHARED_OPTS@
57+CFLAGS_SHARED = $(CCFLAGS) @CC_SHARED_OPTS@ @LIBOPTS@
58
59 CFLAGS_DEFAULT = $(CFLAGS_@DFT_UPR_MODEL@)
60
61--- ncurses-5.4/configure.in~visibility.patch
62+++ ncurses-5.4/configure.in
63@@ -34,17 +34,20 @@
64 dnl See http://invisible-island.net/autoconf/ for additional information.
65 dnl
66 dnl ---------------------------------------------------------------------------
67-AC_PREREQ(2.13.20020210)
68+AC_PREREQ(2.59)
69 AC_REVISION($Revision: 1.312 $)
70-AC_INIT(ncurses/base/lib_initscr.c)
71+AC_INIT
72+AC_CONFIG_SRCDIR([ncurses/base/lib_initscr.c])
73 AC_CONFIG_HEADER(include/ncurses_cfg.h:include/ncurses_cfg.hin)
74
75+m4_include([m4/templates.m4])
76+
77 CF_SUBST_NCURSES_VERSION
78
79 CF_WITH_REL_VERSION(NCURSES)
80 CF_WITH_ABI_VERSION
81
82-CF_CHECK_CACHE([AC_CANONICAL_SYSTEM])
83+CF_CHECK_CACHE([AC_CANONICAL_TARGET([])])
84 AC_ARG_WITH(system-type,
85 [ --with-system-type=XXX test: override derived host system-type],
86 [AC_MSG_WARN(overriding system type to $withval)
87@@ -100,7 +103,7 @@
88 CF_GXX_VERSION
89 case $GXX_VERSION in
90 1*|2.[[0-6]]*)
91- GXX=""; CXX=""; ac_cv_prog_gxx=no
92+ GXX=""; CXX=""; ac_cv_cxx_compiler_gnu=no
93 cf_cxx_library=no
94 AC_MSG_WARN(templates do not work)
95 ;;
96@@ -176,7 +179,6 @@
97 AC_SUBST(DESTDIR)
98
99 ###############################################################################
100-CF_HELP_MESSAGE(Build-Tools Needed to Compile Temporary Applications for Cross-compiling:)
101 # If we're cross-compiling, allow the user to override the tools and their
102 # options. The configure script is oriented toward identifying the host
103 # compiler, etc., but we need a build compiler to generate parts of the source.
104@@ -213,7 +215,6 @@
105 AC_SUBST(BUILD_EXEEXT)
106
107 ###############################################################################
108-CF_HELP_MESSAGE(Options to Specify the Libraries Built/Used:)
109
110 ### Options to allow the user to specify the set of libraries which are used.
111 ### Use "--without-normal --with-shared" to allow the default model to be
112@@ -343,11 +344,11 @@
113
114 AC_MSG_CHECKING(for default loader flags)
115 case $DFT_LWR_MODEL in
116-libtool) LD_MODEL='' ;;
117+libtool) LD_MODEL=''; LIBOPTS="-DNCURSES_DLL" ;;
118 normal) LD_MODEL='' ;;
119 debug) LD_MODEL=$CC_G_OPT ;;
120 profile) LD_MODEL='-pg';;
121-shared) LD_MODEL='' ;;
122+shared) LD_MODEL=''; LIBOPTS="-DNCURSES_DLL" ;;
123 esac
124 AC_SUBST(LD_MODEL)dnl the type of link (e.g., -g or -pg)
125 AC_MSG_RESULT($LD_MODEL)
126@@ -363,14 +364,14 @@
127 if test "$CC_SHARED_OPTS" = "unknown"; then
128 for model in $cf_list_models; do
129 if test "$model" = "shared"; then
130- AC_ERROR(Shared libraries are not supported in this version)
131+ AC_MSG_ERROR([Shared libraries are not supported in this version])
132 fi
133 done
134 fi
135
136-###############################################################################
137-CF_HELP_MESSAGE(Fine-Tuning Your Configuration:)
138+AC_SUBST(LIBOPTS)
139
140+###############################################################################
141 ### use option --disable-overwrite to leave out the link to -lcurses
142 AC_MSG_CHECKING(if you wish to install ncurses overwriting curses)
143 AC_ARG_ENABLE(overwrite,
144@@ -450,7 +451,7 @@
145 AC_ARG_ENABLE(big-core,
146 [ --disable-big-core assume machine has little memory],
147 [with_big_core=$enableval],
148- [AC_TRY_RUN([
149+ [AC_RUN_IFELSE([AC_LANG_SOURCE([[
150 #include <stdlib.h>
151 #include <string.h>
152 int main() {
153@@ -459,10 +460,7 @@
154 if (s != 0)
155 s[0] = s[n-1] = 0;
156 exit(s == 0);
157-}],
158- [with_big_core=yes],
159- [with_big_core=no],
160- [with_big_core=no])])
161+}]])],[with_big_core=yes],[with_big_core=no],[with_big_core=no])])
162 AC_MSG_RESULT($with_big_core)
163 test "$with_big_core" = "yes" && AC_DEFINE(HAVE_BIG_CORE)
164
165@@ -477,7 +475,7 @@
166 if test "$with_termcap" != "yes" ; then
167 if test "$use_database" = no ; then
168 if test -z "$with_fallback" ; then
169- AC_ERROR(You have disabled the database w/o specifying fallbacks)
170+ AC_MSG_ERROR([You have disabled the database w/o specifying fallbacks])
171 fi
172 fi
173 AC_DEFINE(PURE_TERMINFO)
174@@ -614,10 +612,10 @@
175 test "$with_rcs_ids" = yes && AC_DEFINE(USE_RCS_IDS)
176
177 ###############################################################################
178+
179 CF_MAN_PAGES([ captoinfo clear infocmp infotocap tic toe tput ])
180
181 ###############################################################################
182-CF_HELP_MESSAGE(Extensions:)
183
184 ### Note that some functions (such as const) are normally disabled anyway.
185 AC_MSG_CHECKING(if you want to build with function extensions)
186@@ -683,7 +681,6 @@
187
188 ###############################################################################
189 # These options are relatively safe to experiment with.
190-CF_HELP_MESSAGE(Development Code:)
191 AC_MSG_CHECKING(if you want all development code)
192 AC_ARG_WITH(develop,
193 [ --with-develop enable all development options],
194@@ -719,7 +716,6 @@
195
196 ###############################################################################
197 # These are just experimental, probably should not be in a package:
198-CF_HELP_MESSAGE(Experimental Code:)
199
200 AC_MSG_CHECKING(if you do not want to assume colors are white-on-black)
201 AC_ARG_ENABLE(assumed-color,
202@@ -828,7 +824,6 @@
203 AC_SUBST(TERMINFO_CAPS)
204
205 ###############################################################################
206-CF_HELP_MESSAGE(Testing/development Options:)
207
208 ### use option --disable-echo to suppress full display compiling commands
209 AC_MSG_CHECKING(if you want to display full commands during build)
210@@ -931,7 +926,7 @@
211 AC_SUBST(MATH_LIB)
212
213 ### Checks for header files.
214-AC_STDC_HEADERS
215+AC_HEADER_STDC([])
216 AC_HEADER_DIRENT
217 AC_HEADER_TIME
218 CF_REGEX
219@@ -965,7 +960,7 @@
220 CF_SYS_TIME_SELECT
221
222 ### checks for compiler characteristics
223-AC_LANG_C
224+AC_LANG([C])
225 AC_C_CONST
226 AC_C_INLINE
227 test "$ac_cv_c_inline" != no && AC_DEFINE(CC_HAS_INLINE_FUNCS)
228@@ -1040,7 +1035,7 @@
229
230 # Check for C++ compiler characteristics (and ensure that it's there!)
231 if test -n "$CXX" ; then
232- AC_LANG_CPLUSPLUS
233+ AC_LANG([C++])
234 CF_STDCPP_LIBRARY
235
236 case $GXX_VERSION in
237@@ -1135,7 +1130,6 @@
238 fi
239 AC_SUBST(USE_CXX_BOOL)
240
241-CF_HELP_MESSAGE(Ada95 Binding Options:)
242
243 dnl Check for availability of GNU Ada Translator (GNAT).
244 dnl At the moment we support no other Ada95 compiler.
245@@ -1309,15 +1303,16 @@
246
247 ################################################################################
248 test "$use_database" = yes && SUB_MAKEFILES="$SUB_MAKEFILES misc/run_tic.sh:misc/run_tic.in"
249-AC_OUTPUT( \
250+AC_CONFIG_FILES([\
251 include/MKterm.h.awk \
252 include/curses.head:include/curses.h.in \
253 include/termcap.h \
254 include/unctrl.h \
255 $SUB_MAKEFILES \
256- Makefile,[
257+ Makefile])
258+AC_CONFIG_COMMANDS([default],[
259 CF_LIB_RULES
260-],[
261+],[[
262 ### Special initialization commands, used to pass information from the
263 ### configuration-run into config.status
264
265@@ -1348,5 +1343,6 @@
266 host="$host"
267 target="$target"
268
269-],cat)dnl
270+]])
271+AC_OUTPUT
272 ${MAKE-make} preinstall
273--- ncurses-5.4/include/ncurses_dll.h~visibility.patch
274+++ ncurses-5.4/include/ncurses_dll.h
275@@ -7,8 +7,8 @@
276 /* but this structure may be useful at some point for an MSVC build */
277 /* so, for now unconditionally define the important flags */
278 /* "the right way" for proper static and dll+auto-import behavior */
279-#undef NCURSES_DLL
280-#define NCURSES_STATIC
281+//#undef NCURSES_DLL
282+//#define NCURSES_STATIC
283
284 #if defined(__CYGWIN__)
285 # if defined(NCURSES_DLL)
286@@ -32,12 +32,20 @@
287 # endif
288 # define NCURSES_API __cdecl
289 # define NCURSES_EXPORT(type) NCURSES_IMPEXP type NCURSES_API
290-# define NCURSES_EXPORT_VAR(type) NCURSES_IMPEXP type
291+# define NCURSES_EXPORT_VAR(var) var NCURSES_IMPEXP
292 #endif
293
294 /* Take care of non-cygwin platforms */
295 #if !defined(NCURSES_IMPEXP)
296-# define NCURSES_IMPEXP /* nothing */
297+# if defined(GCC_HASCLASSVISIBILITY)
298+# if defined(NCURSES_DLL)
299+# define NCURSES_IMPEXP __attribute__ ((visibility("default")))
300+# else
301+# define NCURSES_IMPEXP /* nothing */
302+# endif
303+# else
304+# define NCURSES_IMPEXP /* nothing */
305+# endif
306 #endif
307 #if !defined(NCURSES_API)
308 # define NCURSES_API /* nothing */
309@@ -46,7 +54,7 @@
310 # define NCURSES_EXPORT(type) NCURSES_IMPEXP type NCURSES_API
311 #endif
312 #if !defined(NCURSES_EXPORT_VAR)
313-# define NCURSES_EXPORT_VAR(type) NCURSES_IMPEXP type
314+# define NCURSES_EXPORT_VAR(var) var NCURSES_IMPEXP
315 #endif
316
317 #endif /* NCURSES_DLL_H_incl */
318--- ncurses-5.4/form/fty_alnum.c~visibility.patch
319+++ ncurses-5.4/form/fty_alnum.c
320@@ -132,6 +132,6 @@
321 NULL
322 };
323
324-NCURSES_EXPORT_VAR(FIELDTYPE*) TYPE_ALNUM = &typeALNUM;
325+FIELDTYPE* NCURSES_EXPORT_VAR(TYPE_ALNUM) = &typeALNUM;
326
327 /* fty_alnum.c ends here */
328--- ncurses-5.4/form/fty_alpha.c~visibility.patch
329+++ ncurses-5.4/form/fty_alpha.c
330@@ -133,6 +133,6 @@
331 NULL
332 };
333
334-NCURSES_EXPORT_VAR(FIELDTYPE*) TYPE_ALPHA = &typeALPHA;
335+FIELDTYPE* NCURSES_EXPORT_VAR(TYPE_ALPHA) = &typeALPHA;
336
337 /* fty_alpha.c ends here */
338--- ncurses-5.4/form/fld_newftyp.c~visibility.patch
339+++ ncurses-5.4/form/fld_newftyp.c
340@@ -48,7 +48,7 @@
341 NULL /* enumerate previous function */
342 };
343
344-NCURSES_EXPORT_VAR(const FIELDTYPE*) _nc_Default_FieldType = &default_fieldtype;
345+const FIELDTYPE* NCURSES_EXPORT_VAR(_nc_Default_FieldType) = &default_fieldtype;
346
347 /*---------------------------------------------------------------------------
348 | Facility : libnform
349--- ncurses-5.4/form/form.h~visibility.patch
350+++ ncurses-5.4/form/form.h
351@@ -248,24 +248,24 @@
352 /*************************
353 * standard field types *
354 *************************/
355-extern NCURSES_EXPORT_VAR(FIELDTYPE *) TYPE_ALPHA;
356-extern NCURSES_EXPORT_VAR(FIELDTYPE *) TYPE_ALNUM;
357-extern NCURSES_EXPORT_VAR(FIELDTYPE *) TYPE_ENUM;
358-extern NCURSES_EXPORT_VAR(FIELDTYPE *) TYPE_INTEGER;
359-extern NCURSES_EXPORT_VAR(FIELDTYPE *) TYPE_NUMERIC;
360-extern NCURSES_EXPORT_VAR(FIELDTYPE *) TYPE_REGEXP;
361+extern FIELDTYPE * NCURSES_EXPORT_VAR(TYPE_ALPHA);
362+extern FIELDTYPE * NCURSES_EXPORT_VAR(TYPE_ALNUM);
363+extern FIELDTYPE * NCURSES_EXPORT_VAR(TYPE_ENUM);
364+extern FIELDTYPE * NCURSES_EXPORT_VAR(TYPE_INTEGER);
365+extern FIELDTYPE * NCURSES_EXPORT_VAR(TYPE_NUMERIC);
366+extern FIELDTYPE * NCURSES_EXPORT_VAR(TYPE_REGEXP);
367
368 /************************************
369 * built-in additional field types *
370 * They are not defined in SVr4 *
371 ************************************/
372-extern NCURSES_EXPORT_VAR(FIELDTYPE *) TYPE_IPV4; /* Internet IP Version 4 address */
373+extern FIELDTYPE * NCURSES_EXPORT_VAR(TYPE_IPV4); /* Internet IP Version 4 address */
374
375 /***********************
376 * Default objects *
377 ***********************/
378-extern NCURSES_EXPORT_VAR(FORM *) _nc_Default_Form;
379-extern NCURSES_EXPORT_VAR(FIELD *) _nc_Default_Field;
380+extern FORM * NCURSES_EXPORT_VAR(_nc_Default_Form);
381+extern FIELD * NCURSES_EXPORT_VAR(_nc_Default_Field);
382
383
384 /***********************
385--- ncurses-5.4/form/fty_int.c~visibility.patch
386+++ ncurses-5.4/form/fty_int.c
387@@ -155,6 +155,6 @@
388 NULL
389 };
390
391-NCURSES_EXPORT_VAR(FIELDTYPE*) TYPE_INTEGER = &typeINTEGER;
392+FIELDTYPE* NCURSES_EXPORT_VAR(TYPE_INTEGER) = &typeINTEGER;
393
394 /* fty_int.c ends here */
395--- ncurses-5.4/form/fty_num.c~visibility.patch
396+++ ncurses-5.4/form/fty_num.c
397@@ -190,6 +190,6 @@
398 NULL
399 };
400
401-NCURSES_EXPORT_VAR(FIELDTYPE*) TYPE_NUMERIC = &typeNUMERIC;
402+FIELDTYPE* NCURSES_EXPORT_VAR(TYPE_NUMERIC) = &typeNUMERIC;
403
404 /* fty_num.c ends here */
405--- ncurses-5.4/form/fty_regex.c~visibility.patch
406+++ ncurses-5.4/form/fty_regex.c
407@@ -252,6 +252,6 @@
408 NULL
409 };
410
411-NCURSES_EXPORT_VAR(FIELDTYPE*) TYPE_REGEXP = &typeREGEXP;
412+FIELDTYPE* NCURSES_EXPORT_VAR(TYPE_REGEXP) = &typeREGEXP;
413
414 /* fty_regex.c ends here */
415--- ncurses-5.4/form/frm_def.c~visibility.patch
416+++ ncurses-5.4/form/frm_def.c
417@@ -60,7 +60,7 @@
418 NULL /* fieldterm */
419 };
420
421-NCURSES_EXPORT_VAR(FORM *) _nc_Default_Form = &default_form;
422+FORM * NCURSES_EXPORT_VAR(_nc_Default_Form) = &default_form;
423
424 /*---------------------------------------------------------------------------
425 | Facility : libnform
426--- ncurses-5.4/form/fld_def.c~visibility.patch
427+++ ncurses-5.4/form/fld_def.c
428@@ -63,7 +63,7 @@
429 (char *)0 /* usrptr */
430 };
431
432-NCURSES_EXPORT_VAR(FIELD *) _nc_Default_Field = &default_field;
433+FIELD * NCURSES_EXPORT_VAR(_nc_Default_Field) = &default_field;
434
435 /*---------------------------------------------------------------------------
436 | Facility : libnform
437--- ncurses-5.4/form/fty_enum.c~visibility.patch
438+++ ncurses-5.4/form/fty_enum.c
439@@ -290,6 +290,6 @@
440 Previous_Enum
441 };
442
443-NCURSES_EXPORT_VAR(FIELDTYPE*) TYPE_ENUM = &typeENUM;
444+FIELDTYPE* NCURSES_EXPORT_VAR(TYPE_ENUM) = &typeENUM;
445
446 /* fty_enum.c ends here */
447--- ncurses-5.4/form/fty_ipv4.c~visibility.patch
448+++ ncurses-5.4/form/fty_ipv4.c
449@@ -76,6 +76,6 @@
450 NULL
451 };
452
453-NCURSES_EXPORT_VAR(FIELDTYPE*) TYPE_IPV4 = &typeIPV4;
454+FIELDTYPE* NCURSES_EXPORT_VAR(TYPE_IPV4) = &typeIPV4;
455
456 /* fty_ipv4.c ends here */
457--- ncurses-5.4/form/form.priv.h~visibility.patch
458+++ ncurses-5.4/form/form.priv.h
459@@ -112,7 +112,7 @@
460 #define C_BLANK ' '
461 #define is_blank(c) ((c)==C_BLANK)
462
463-extern NCURSES_EXPORT_VAR(const FIELDTYPE *) _nc_Default_FieldType;
464+extern const FIELDTYPE * NCURSES_EXPORT_VAR(_nc_Default_FieldType);
465
466 extern NCURSES_EXPORT(TypeArgument *) _nc_Make_Argument (const FIELDTYPE*,va_list*,int*);
467 extern NCURSES_EXPORT(TypeArgument *) _nc_Copy_Argument (const FIELDTYPE*,const TypeArgument*, int*);
468--- ncurses-5.4/include/tic.h~visibility.patch
469+++ ncurses-5.4/include/tic.h
470@@ -117,7 +117,7 @@
471 #define DEBUG(n, a) /*nothing*/
472 #endif
473
474-extern NCURSES_EXPORT_VAR(unsigned) _nc_tracing;
475+extern unsigned NCURSES_EXPORT_VAR(_nc_tracing);
476 extern NCURSES_EXPORT(void) _nc_tracef (char *, ...) GCC_PRINTFLIKE(1,2);
477 extern NCURSES_EXPORT(const char *) _nc_visbuf (const char *);
478 extern NCURSES_EXPORT(const char *) _nc_visbuf2 (int, const char *);
479@@ -151,7 +151,7 @@
480 char *tk_valstring; /* value of capability (if a string) */
481 };
482
483-extern NCURSES_EXPORT_VAR(struct token) _nc_curr_token;
484+extern struct token NCURSES_EXPORT_VAR(_nc_curr_token);
485
486 /*
487 * List of keynames with their corresponding code.
488@@ -161,7 +161,7 @@
489 int code;
490 };
491
492-extern NCURSES_EXPORT_VAR(const struct kn) _nc_key_names[];
493+extern const struct kn NCURSES_EXPORT_VAR(_nc_key_names[]);
494
495 /*
496 * Offsets to string capabilities, with the corresponding functionkey
497@@ -179,7 +179,7 @@
498
499 #else
500
501-extern NCURSES_EXPORT_VAR(struct tinfo_fkeys) _nc_tinfo_fkeys[];
502+extern struct tinfo_fkeys NCURSES_EXPORT_VAR(_nc_tinfo_fkeys[]);
503
504 #endif
505
506@@ -204,11 +204,11 @@
507 const char *source;
508 };
509
510-extern NCURSES_EXPORT_VAR(const struct name_table_entry * const) _nc_info_hash_table[];
511-extern NCURSES_EXPORT_VAR(const struct name_table_entry * const) _nc_cap_hash_table[];
512+extern const struct name_table_entry * const NCURSES_EXPORT_VAR(_nc_info_hash_table[]);
513+extern const struct name_table_entry * const NCURSES_EXPORT_VAR(_nc_cap_hash_table[]);
514
515-extern NCURSES_EXPORT_VAR(const struct alias) _nc_capalias_table[];
516-extern NCURSES_EXPORT_VAR(const struct alias) _nc_infoalias_table[];
517+extern const struct alias NCURSES_EXPORT_VAR(_nc_capalias_table[]);
518+extern const struct alias NCURSES_EXPORT_VAR(_nc_infoalias_table[]);
519
520 extern NCURSES_EXPORT(const struct name_table_entry *) _nc_get_table (bool);
521 extern NCURSES_EXPORT(const struct name_table_entry * const *) _nc_get_hash_table (bool);
522@@ -255,13 +255,13 @@
523 extern NCURSES_EXPORT(void) _nc_panic_mode (char);
524 extern NCURSES_EXPORT(void) _nc_push_token (int);
525 extern NCURSES_EXPORT(void) _nc_reset_input (FILE *, char *);
526-extern NCURSES_EXPORT_VAR(int) _nc_curr_col;
527-extern NCURSES_EXPORT_VAR(int) _nc_curr_line;
528-extern NCURSES_EXPORT_VAR(int) _nc_syntax;
529-extern NCURSES_EXPORT_VAR(long) _nc_comment_end;
530-extern NCURSES_EXPORT_VAR(long) _nc_comment_start;
531-extern NCURSES_EXPORT_VAR(long) _nc_curr_file_pos;
532-extern NCURSES_EXPORT_VAR(long) _nc_start_line;
533+extern int NCURSES_EXPORT_VAR(_nc_curr_col);
534+extern int NCURSES_EXPORT_VAR(_nc_curr_line);
535+extern int NCURSES_EXPORT_VAR(_nc_syntax);
536+extern long NCURSES_EXPORT_VAR(_nc_comment_end);
537+extern long NCURSES_EXPORT_VAR(_nc_comment_start);
538+extern long NCURSES_EXPORT_VAR(_nc_curr_file_pos);
539+extern long NCURSES_EXPORT_VAR(_nc_start_line);
540 #define SYN_TERMINFO 0
541 #define SYN_TERMCAP 1
542
543@@ -272,7 +272,7 @@
544 extern NCURSES_EXPORT(void) _nc_syserr_abort (const char *const,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
545 extern NCURSES_EXPORT(void) _nc_err_abort (const char *const,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
546 extern NCURSES_EXPORT(void) _nc_warning (const char *const,...) GCC_PRINTFLIKE(1,2);
547-extern NCURSES_EXPORT_VAR(bool) _nc_suppress_warnings;
548+extern bool NCURSES_EXPORT_VAR(_nc_suppress_warnings);
549
550 /* comp_expand.c: expand string into readable form */
551 extern NCURSES_EXPORT(char *) _nc_tic_expand (const char *, bool, int);
552@@ -287,12 +287,12 @@
553 /* lib_tparm.c */
554 #define NUM_PARM 9
555
556-extern NCURSES_EXPORT_VAR(int) _nc_tparm_err;
557+extern int NCURSES_EXPORT_VAR(_nc_tparm_err);
558
559 extern NCURSES_EXPORT(int) _nc_tparm_analyze(const char *string, char *p_is_s[NUM_PARM], int *popcount);
560
561 /* lib_tputs.c */
562-extern NCURSES_EXPORT_VAR(int) _nc_nulls_sent; /* Add one for every null sent */
563+extern int NCURSES_EXPORT_VAR(_nc_nulls_sent); /* Add one for every null sent */
564
565 /* comp_main.c: compiler main */
566 extern const char * _nc_progname;
567--- ncurses-5.4/include/MKterm.h.awk.in~visibility.patch
568+++ ncurses-5.4/include/MKterm.h.awk.in
569@@ -228,9 +228,9 @@
570 print " char * _termname; /* used for termname() */"
571 print "} TERMINAL;"
572 print ""
573- print "extern NCURSES_EXPORT_VAR(TERMINAL *) cur_term;"
574+ print "extern TERMINAL * NCURSES_EXPORT_VAR(cur_term);"
575 print ""
576- print "#if BROKEN_LINKER"
577+ print "#if defined(BROKEN_LINKER)"
578 print "#define boolnames _nc_boolnames()"
579 print "#define boolcodes _nc_boolcodes()"
580 print "#define boolfnames _nc_boolfnames()"
581@@ -253,15 +253,15 @@
582 print ""
583 print "#else"
584 print ""
585- print "extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) boolnames[];"
586- print "extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) boolcodes[];"
587- print "extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) boolfnames[];"
588- print "extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) numnames[];"
589- print "extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) numcodes[];"
590- print "extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) numfnames[];"
591- print "extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) strnames[];"
592- print "extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) strcodes[];"
593- print "extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) strfnames[];"
594+ print "extern NCURSES_CONST char * const NCURSES_EXPORT_VAR(boolnames[]);"
595+ print "extern NCURSES_CONST char * const NCURSES_EXPORT_VAR(boolcodes[]);"
596+ print "extern NCURSES_CONST char * const NCURSES_EXPORT_VAR(boolfnames[]);"
597+ print "extern NCURSES_CONST char * const NCURSES_EXPORT_VAR(numnames[]);"
598+ print "extern NCURSES_CONST char * const NCURSES_EXPORT_VAR(numcodes[]);"
599+ print "extern NCURSES_CONST char * const NCURSES_EXPORT_VAR(numfnames[]);"
600+ print "extern NCURSES_CONST char * const NCURSES_EXPORT_VAR(strnames[]);"
601+ print "extern NCURSES_CONST char * const NCURSES_EXPORT_VAR(strcodes[]);"
602+ print "extern NCURSES_CONST char * const NCURSES_EXPORT_VAR(strfnames[]);"
603 print ""
604 print "#endif"
605 print ""
606@@ -287,7 +287,7 @@
607 print "#if !defined(__NCURSES_H)"
608 print "extern NCURSES_EXPORT(char *) tigetstr (NCURSES_CONST char *);"
609 print "extern NCURSES_EXPORT(char *) tparm (NCURSES_CONST char *, ...);"
610- print "extern NCURSES_EXPORT_VAR(char) ttytype[];"
611+ print "extern char NCURSES_EXPORT_VAR(ttytype[]);"
612 print "extern NCURSES_EXPORT(int) putp (const char *);"
613 print "extern NCURSES_EXPORT(int) tigetflag (NCURSES_CONST char *);"
614 print "extern NCURSES_EXPORT(int) tigetnum (NCURSES_CONST char *);"
615--- ncurses-5.4/include/termcap.h.in~visibility.patch
616+++ ncurses-5.4/include/termcap.h.in
617@@ -54,10 +54,10 @@
618 #undef NCURSES_OSPEED
619 #define NCURSES_OSPEED @NCURSES_OSPEED@
620
621-extern NCURSES_EXPORT_VAR(char) PC;
622-extern NCURSES_EXPORT_VAR(char *) UP;
623-extern NCURSES_EXPORT_VAR(char *) BC;
624-extern NCURSES_EXPORT_VAR(NCURSES_OSPEED) ospeed;
625+extern char NCURSES_EXPORT_VAR(PC);
626+extern char * NCURSES_EXPORT_VAR(UP);
627+extern char * NCURSES_EXPORT_VAR(BC);
628+extern NCURSES_OSPEED NCURSES_EXPORT_VAR(ospeed);
629
630 #if !defined(NCURSES_TERM_H_incl)
631 extern NCURSES_EXPORT(char *) tgetstr (NCURSES_CONST char *, char **);
632--- ncurses-5.4/include/term_entry.h~visibility.patch
633+++ ncurses-5.4/include/term_entry.h
634@@ -90,8 +90,8 @@
635 #define ExtNumname(tp,i,names) EXT_NAMES(tp, i, NUMCOUNT, (i - (tp->num_Numbers - tp->ext_Numbers)) + tp->ext_Booleans, names)
636 #define ExtStrname(tp,i,names) EXT_NAMES(tp, i, STRCOUNT, (i - (tp->num_Strings - tp->ext_Strings)) + (tp->ext_Numbers + tp->ext_Booleans), names)
637
638-extern NCURSES_EXPORT_VAR(ENTRY *) _nc_head;
639-extern NCURSES_EXPORT_VAR(ENTRY *) _nc_tail;
640+extern ENTRY * NCURSES_EXPORT_VAR(_nc_head);
641+extern ENTRY * NCURSES_EXPORT_VAR(_nc_tail);
642 #define for_entry_list(qp) for (qp = _nc_head; qp; qp = qp->next)
643
644 #define MAX_LINE 132
645@@ -135,8 +135,8 @@
646
647 /* parse_entry.c: entry-parsing code */
648 #if NCURSES_XNAMES
649-extern NCURSES_EXPORT_VAR(bool) _nc_user_definable;
650-extern NCURSES_EXPORT_VAR(bool) _nc_disable_period;
651+extern bool NCURSES_EXPORT_VAR(_nc_user_definable);
652+extern bool NCURSES_EXPORT_VAR(_nc_disable_period);
653 #endif
654 extern NCURSES_EXPORT(int) _nc_parse_entry (ENTRY *, int, bool);
655 extern NCURSES_EXPORT(int) _nc_capcmp (const char *, const char *);
656--- ncurses-5.4/include/curses.h.in~visibility.patch
657+++ ncurses-5.4/include/curses.h.in
658@@ -171,8 +171,8 @@
659 #define WA_VERTICAL A_VERTICAL
660
661 /* colors */
662-extern NCURSES_EXPORT_VAR(int) COLORS;
663-extern NCURSES_EXPORT_VAR(int) COLOR_PAIRS;
664+extern int NCURSES_EXPORT_VAR(COLORS);
665+extern int NCURSES_EXPORT_VAR(COLOR_PAIRS);
666
667 #define COLOR_BLACK 0
668 #define COLOR_RED 1
669@@ -186,10 +186,10 @@
670 /* line graphics */
671
672 #if @BROKEN_LINKER@
673-extern NCURSES_EXPORT_VAR(chtype*) _nc_acs_map(void);
674+extern chtype* NCURSES_EXPORT_VAR(_nc_acs_map)(void);
675 #define acs_map (_nc_acs_map())
676 #else
677-extern NCURSES_EXPORT_VAR(chtype) acs_map[];
678+extern chtype NCURSES_EXPORT_VAR(acs_map[]);
679 #endif
680
681 #define NCURSES_ACS(c) (acs_map[(unsigned char)c])
682@@ -369,20 +369,20 @@
683 #endif
684 };
685
686-extern NCURSES_EXPORT_VAR(WINDOW *) stdscr;
687-extern NCURSES_EXPORT_VAR(WINDOW *) curscr;
688-extern NCURSES_EXPORT_VAR(WINDOW *) newscr;
689+extern WINDOW * NCURSES_EXPORT_VAR(stdscr);
690+extern WINDOW * NCURSES_EXPORT_VAR(curscr);
691+extern WINDOW * NCURSES_EXPORT_VAR(newscr);
692
693-extern NCURSES_EXPORT_VAR(int) LINES;
694-extern NCURSES_EXPORT_VAR(int) COLS;
695-extern NCURSES_EXPORT_VAR(int) TABSIZE;
696+extern int NCURSES_EXPORT_VAR(LINES);
697+extern int NCURSES_EXPORT_VAR(COLS);
698+extern int NCURSES_EXPORT_VAR(TABSIZE);
699
700 /*
701 * This global was an undocumented feature under AIX curses.
702 */
703-extern NCURSES_EXPORT_VAR(int) ESCDELAY; /* ESC expire time in milliseconds */
704+extern int NCURSES_EXPORT_VAR(ESCDELAY); /* ESC expire time in milliseconds */
705
706-extern NCURSES_EXPORT_VAR(char) ttytype[]; /* needed for backward compatibility */
707+extern char NCURSES_EXPORT_VAR(ttytype[]); /* needed for backward compatibility */
708
709 /*
710 * These functions are extensions - not in XSI Curses.
711--- ncurses-5.4/include/curses.tail~visibility.patch
712+++ ncurses-5.4/include/curses.tail
713@@ -110,7 +110,7 @@
714 #define TRACE_MAXIMUM ((1 << TRACE_SHIFT) - 1) /* maximum trace level */
715
716 #if defined(TRACE) || defined(NCURSES_TEST)
717-extern NCURSES_EXPORT_VAR(int) _nc_optimize_enable; /* enable optimizations */
718+extern int NCURSES_EXPORT_VAR(_nc_optimize_enable); /* enable optimizations */
719 #ifdef _XOPEN_SOURCE_EXTENDED
720 extern NCURSES_EXPORT(const char *) _nc_viswbuf(const wchar_t *);
721 #endif
722--- ncurses-5.4/include/curses.wide~visibility.patch
723+++ ncurses-5.4/include/curses.wide
724@@ -3,7 +3,7 @@
725
726 /* $Id: curses.wide,v 1.28 2004/01/03 20:35:14 tom Exp $ */
727
728-extern NCURSES_EXPORT_VAR(cchar_t *) _nc_wacs;
729+extern cchar_t * NCURSES_EXPORT_VAR(_nc_wacs);
730
731 #define NCURSES_WACS(c) (&_nc_wacs[(unsigned char)c])
732
733--- ncurses-5.4/menu/menu.priv.h~visibility.patch
734+++ ncurses-5.4/menu/menu.priv.h
735@@ -49,8 +49,8 @@
736 /* Backspace code */
737 #define BS (8)
738
739-extern NCURSES_EXPORT_VAR(ITEM) _nc_Default_Item;
740-extern NCURSES_EXPORT_VAR(MENU) _nc_Default_Menu;
741+extern ITEM NCURSES_EXPORT_VAR(_nc_Default_Item);
742+extern MENU NCURSES_EXPORT_VAR(_nc_Default_Menu);
743
744 /* Normalize item to default if none was given */
745 #define Normalize_Item( item ) ((item)=(item)?(item):&_nc_Default_Item)
746--- ncurses-5.4/menu/m_global.c~visibility.patch
747+++ ncurses-5.4/menu/m_global.c
748@@ -41,7 +41,7 @@
749
750 static char mark[] = "-";
751
752-NCURSES_EXPORT_VAR(MENU) _nc_Default_Menu = {
753+MENU NCURSES_EXPORT_VAR(_nc_Default_Menu) = {
754 16, /* Nr. of chars high */
755 1, /* Nr. of chars wide */
756 16, /* Nr. of items high */
757@@ -80,7 +80,7 @@
758 0 /* status */
759 };
760
761-NCURSES_EXPORT_VAR(ITEM) _nc_Default_Item = {
762+ITEM NCURSES_EXPORT_VAR(_nc_Default_Item) = {
763 { (char *)0, 0 }, /* name */
764 { (char *)0, 0 }, /* description */
765 (MENU *)0, /* Pointer to parent menu */
766--- ncurses-5.4/ncurses/tty/lib_mvcur.c~visibility.patch
767+++ ncurses-5.4/ncurses/tty/lib_mvcur.c
768@@ -937,7 +937,7 @@
769 }
770
771 #if defined(TRACE) || defined(NCURSES_TEST)
772-NCURSES_EXPORT_VAR(int) _nc_optimize_enable = OPTIMIZE_ALL;
773+int NCURSES_EXPORT_VAR(_nc_optimize_enable) = OPTIMIZE_ALL;
774 #endif
775
776 #if defined(MAIN) || defined(NCURSES_TEST)
777@@ -950,7 +950,7 @@
778 #include <tic.h>
779 #include <dump_entry.h>
780
781-NCURSES_EXPORT_VAR(const char *) _nc_progname = "mvcur";
782+const char * NCURSES_EXPORT_VAR(_nc_progname) = "mvcur";
783
784 static unsigned long xmits;
785
786--- ncurses-5.4/ncurses/tty/hardscroll.c~visibility.patch
787+++ ncurses-5.4/ncurses/tty/hardscroll.c
788@@ -151,8 +151,7 @@
789
790 # undef screen_lines
791 # define screen_lines MAXLINES
792-NCURSES_EXPORT_VAR(int)
793-oldnums[MAXLINES];
794+int NCURSES_EXPORT_VAR(oldnums[MAXLINES]);
795 # define OLDNUM(n) oldnums[n]
796 # define _tracef printf
797 # undef TR
798@@ -163,8 +162,7 @@
799 /* OLDNUM(n) indicates which line will be shifted to the position n.
800 if OLDNUM(n) == _NEWINDEX, then the line n in new, not shifted from
801 somewhere. */
802-NCURSES_EXPORT_VAR(int *)
803-_nc_oldnums = 0;
804+int * NCURSES_EXPORT_VAR(_nc_oldnums) = 0;
805
806 # if USE_HASHMAP
807 static int oldnums_allocated = 0;
808--- ncurses-5.4/ncurses/base/lib_getch.c~visibility.patch
809+++ ncurses-5.4/ncurses/base/lib_getch.c
810@@ -44,8 +44,7 @@
811
812 #include <fifo_defs.h>
813
814-NCURSES_EXPORT_VAR(int)
815-ESCDELAY = 1000; /* max interval betw. chars in funkeys, in millisecs */
816+int NCURSES_EXPORT_VAR(ESCDELAY) = 1000; /* max interval betw. chars in funkeys, in millisecs */
817
818 #ifdef NCURSES_WGETCH_EVENTS
819 #define TWAIT_MASK 7
820--- ncurses-5.4/ncurses/base/lib_slk.c~visibility.patch
821+++ ncurses-5.4/ncurses/base/lib_slk.c
822@@ -47,8 +47,7 @@
823 * We'd like to move these into the screen context structure, but cannot,
824 * because slk_init() is called before initscr()/newterm().
825 */
826-NCURSES_EXPORT_VAR(int)
827-_nc_slk_format = 0; /* one more than format specified in slk_init() */
828+int NCURSES_EXPORT_VAR(_nc_slk_format) = 0; /* one more than format specified in slk_init() */
829
830 /*
831 * Paint the info line for the PC style SLK emulation.
832--- ncurses-5.4/ncurses/base/lib_color.c~visibility.patch
833+++ ncurses-5.4/ncurses/base/lib_color.c
834@@ -48,8 +48,8 @@
835 * historical reasons. So we assign them in start_color() and also in
836 * set_term()'s screen-switching logic.
837 */
838-NCURSES_EXPORT_VAR(int) COLOR_PAIRS = 0;
839-NCURSES_EXPORT_VAR(int) COLORS = 0;
840+int NCURSES_EXPORT_VAR(COLOR_PAIRS) = 0;
841+int NCURSES_EXPORT_VAR(COLORS) = 0;
842
843 #define DATA(r,g,b) {r,g,b, 0,0,0, 0}
844
845--- ncurses-5.4/ncurses/tinfo/lib_termcap.c~visibility.patch
846+++ ncurses-5.4/ncurses/tinfo/lib_termcap.c
847@@ -50,8 +50,8 @@
848 #define L_BRACK '['
849 #define SHIFT_OUT 017 /* ^N */
850
851-NCURSES_EXPORT_VAR(char *) UP = 0;
852-NCURSES_EXPORT_VAR(char *) BC = 0;
853+char * NCURSES_EXPORT_VAR(UP) = 0;
854+char * NCURSES_EXPORT_VAR(BC) = 0;
855
856 static char *fix_me = 0;
857
858--- ncurses-5.4/ncurses/tinfo/lib_cur_term.c~visibility.patch
859+++ ncurses-5.4/ncurses/tinfo/lib_cur_term.c
860@@ -42,7 +42,7 @@
861
862 MODULE_ID("$Id: lib_cur_term.c,v 1.13 2003/12/27 18:21:30 tom Exp $")
863
864-NCURSES_EXPORT_VAR(TERMINAL *) cur_term = 0;
865+TERMINAL * NCURSES_EXPORT_VAR(cur_term) = 0;
866
867 NCURSES_EXPORT(TERMINAL *)
868 set_curterm(TERMINAL * termp)
869--- ncurses-5.4/ncurses/tinfo/lib_setup.c~visibility.patch
870+++ ncurses-5.4/ncurses/tinfo/lib_setup.c
871@@ -91,10 +91,10 @@
872 # endif
873 #endif
874
875-NCURSES_EXPORT_VAR(char) ttytype[NAMESIZE] = "";
876-NCURSES_EXPORT_VAR(int) LINES = 0;
877-NCURSES_EXPORT_VAR(int) COLS = 0;
878-NCURSES_EXPORT_VAR(int) TABSIZE = 0;
879+char NCURSES_EXPORT_VAR(ttytype[NAMESIZE]) = "";
880+int NCURSES_EXPORT_VAR(LINES) = 0;
881+int NCURSES_EXPORT_VAR(COLS) = 0;
882+int NCURSES_EXPORT_VAR(TABSIZE) = 0;
883
884 static int _use_env = TRUE;
885
886--- ncurses-5.4/ncurses/tinfo/MKnames.awk~visibility.patch
887+++ ncurses-5.4/ncurses/tinfo/MKnames.awk
888@@ -10,7 +10,7 @@
889 print "#include <term.h>" > "namehdr"
890 print "#define DCL(it) static IT data##it[]" > "namehdr"
891 print "#else" > "namehdr"
892- print "#define DCL(it) NCURSES_EXPORT_VAR(IT) it[]" > "namehdr"
893+ print "#define DCL(it) IT NCURSES_EXPORT_VAR(it[])" > "namehdr"
894 print "#endif" > "namehdr"
895 print "" > "namehdr"
896 print "/*" > "boolnames"
897--- ncurses-5.4/ncurses/tinfo/lib_tparm.c~visibility.patch
898+++ ncurses-5.4/ncurses/tinfo/lib_tparm.c
899@@ -115,7 +115,7 @@
900 bool num_type;
901 } stack_frame;
902
903-NCURSES_EXPORT_VAR(int) _nc_tparm_err = 0;
904+int NCURSES_EXPORT_VAR(_nc_tparm_err) = 0;
905
906 static stack_frame stack[STACKSIZE];
907 static int stack_ptr;
908--- ncurses-5.4/ncurses/tinfo/lib_tputs.c~visibility.patch
909+++ ncurses-5.4/ncurses/tinfo/lib_tputs.c
910@@ -47,10 +47,10 @@
911
912 MODULE_ID("$Id: lib_tputs.c,v 1.62 2003/08/23 21:39:20 tom Exp $")
913
914-NCURSES_EXPORT_VAR(char) PC = 0; /* used by termcap library */
915-NCURSES_EXPORT_VAR(NCURSES_OSPEED) ospeed = 0; /* used by termcap library */
916+char NCURSES_EXPORT_VAR(PC) = 0; /* used by termcap library */
917+NCURSES_OSPEED NCURSES_EXPORT_VAR(ospeed) = 0; /* used by termcap library */
918
919-NCURSES_EXPORT_VAR(int) _nc_nulls_sent = 0; /* used by 'tack' program */
920+int NCURSES_EXPORT_VAR(_nc_nulls_sent) = 0; /* used by 'tack' program */
921
922 static int (*my_outch) (int c) = _nc_outch;
923
924--- ncurses-5.4/ncurses/tinfo/comp_error.c~visibility.patch
925+++ ncurses-5.4/ncurses/tinfo/comp_error.c
926@@ -42,9 +42,9 @@
927
928 MODULE_ID("$Id: comp_error.c,v 1.25 2002/09/07 20:05:07 tom Exp $")
929
930-NCURSES_EXPORT_VAR(bool) _nc_suppress_warnings = FALSE;
931-NCURSES_EXPORT_VAR(int) _nc_curr_line = 0; /* current line # in input */
932-NCURSES_EXPORT_VAR(int) _nc_curr_col = 0; /* current column # in input */
933+bool NCURSES_EXPORT_VAR(_nc_suppress_warnings) = FALSE;
934+int NCURSES_EXPORT_VAR(_nc_curr_line) = 0; /* current line # in input */
935+int NCURSES_EXPORT_VAR(_nc_curr_col) = 0; /* current column # in input */
936
937 static const char *sourcename;
938 static char *termtype;
939--- ncurses-5.4/ncurses/tinfo/free_ttype.c~visibility.patch
940+++ ncurses-5.4/ncurses/tinfo/free_ttype.c
941@@ -92,7 +92,7 @@
942 }
943
944 #if NCURSES_XNAMES
945-NCURSES_EXPORT_VAR(bool) _nc_user_definable = TRUE;
946+bool NCURSES_EXPORT_VAR(_nc_user_definable) = TRUE;
947
948 NCURSES_EXPORT(int)
949 use_extended_names(bool flag)
950--- ncurses-5.4/ncurses/tinfo/comp_parse.c~visibility.patch
951+++ ncurses-5.4/ncurses/tinfo/comp_parse.c
952@@ -78,8 +78,8 @@
953 * _nc_head _nc_tail
954 */
955
956-NCURSES_EXPORT_VAR(ENTRY *) _nc_head = 0;
957-NCURSES_EXPORT_VAR(ENTRY *) _nc_tail = 0;
958+ENTRY * NCURSES_EXPORT_VAR(_nc_head) = 0;
959+ENTRY * NCURSES_EXPORT_VAR(_nc_tail) = 0;
960
961 static void
962 enqueue(ENTRY * ep)
963--- ncurses-5.4/ncurses/tinfo/comp_scan.c~visibility.patch
964+++ ncurses-5.4/ncurses/tinfo/comp_scan.c
965@@ -60,19 +60,13 @@
966
967 #define iswhite(ch) (ch == ' ' || ch == '\t')
968
969-NCURSES_EXPORT_VAR(int)
970-_nc_syntax = 0; /* termcap or terminfo? */
971-NCURSES_EXPORT_VAR(long)
972-_nc_curr_file_pos = 0; /* file offset of current line */
973-NCURSES_EXPORT_VAR(long)
974-_nc_comment_start = 0; /* start of comment range before name */
975-NCURSES_EXPORT_VAR(long)
976-_nc_comment_end = 0; /* end of comment range before name */
977-NCURSES_EXPORT_VAR(long)
978-_nc_start_line = 0; /* start line of current entry */
979+int NCURSES_EXPORT_VAR(_nc_syntax) = 0; /* termcap or terminfo? */
980+long NCURSES_EXPORT_VAR(_nc_curr_file_pos) = 0; /* file offset of current line */
981+long NCURSES_EXPORT_VAR(_nc_comment_start) = 0; /* start of comment range before name */
982+long NCURSES_EXPORT_VAR(_nc_comment_end) = 0; /* end of comment range before name */
983+long NCURSES_EXPORT_VAR(_nc_start_line) = 0; /* start line of current entry */
984
985-NCURSES_EXPORT_VAR(struct token)
986-_nc_curr_token =
987+struct token NCURSES_EXPORT_VAR(_nc_curr_token) =
988 {
989 0, 0, 0
990 };
991@@ -90,8 +84,7 @@
992 static char *pushname;
993
994 #if NCURSES_EXT_FUNCS
995-NCURSES_EXPORT_VAR(bool)
996-_nc_disable_period = FALSE; /* used by tic -a option */
997+bool NCURSES_EXPORT_VAR(_nc_disable_period) = FALSE; /* used by tic -a option */
998 #endif
999
1000 static bool end_of_stream(void);
1001--- ncurses-5.4/ncurses/tinfo/lib_acs.c~visibility.patch
1002+++ ncurses-5.4/ncurses/tinfo/lib_acs.c
1003@@ -37,8 +37,7 @@
1004 MODULE_ID("$Id: lib_acs.c,v 1.25 2002/12/28 16:26:46 tom Exp $")
1005
1006 #if BROKEN_LINKER
1007-NCURSES_EXPORT_VAR(chtype *)
1008-_nc_acs_map(void)
1009+chtype * NCURSES_EXPORT_VAR(_nc_acs_map)(void)
1010 {
1011 static chtype *the_map = 0;
1012 if (the_map == 0)
1013@@ -46,7 +45,7 @@
1014 return the_map;
1015 }
1016 #else
1017-NCURSES_EXPORT_VAR(chtype) acs_map[ACS_LEN] =
1018+chtype NCURSES_EXPORT_VAR(acs_map[ACS_LEN]) =
1019 {
1020 0
1021 };
1022--- ncurses-5.4/ncurses/tinfo/lib_data.c~visibility.patch
1023+++ ncurses-5.4/ncurses/tinfo/lib_data.c
1024@@ -46,14 +46,11 @@
1025 * OS/2's native linker complains if we don't initialize public data when
1026 * constructing a dll (reported by J.J.G.Ripoll).
1027 */
1028-NCURSES_EXPORT_VAR(WINDOW *)
1029-stdscr = 0;
1030-NCURSES_EXPORT_VAR(WINDOW *)
1031-curscr = 0;
1032-NCURSES_EXPORT_VAR(WINDOW *)
1033-newscr = 0;
1034+WINDOW * NCURSES_EXPORT_VAR(stdscr) = 0;
1035+WINDOW * NCURSES_EXPORT_VAR(curscr) = 0;
1036+WINDOW * NCURSES_EXPORT_VAR(newscr) = 0;
1037
1038-NCURSES_EXPORT_VAR(SCREEN *) _nc_screen_chain = 0;
1039+SCREEN * NCURSES_EXPORT_VAR(_nc_screen_chain) = 0;
1040
1041 /*
1042 * The variable 'SP' will be defined as a function on systems that cannot link
1043@@ -87,5 +84,5 @@
1044 }
1045
1046 #else
1047-NCURSES_EXPORT_VAR(SCREEN *) SP = NULL; /* Some linkers require initialized data... */
1048+SCREEN * NCURSES_EXPORT_VAR(SP) = NULL; /* Some linkers require initialized data... */
1049 #endif
1050--- ncurses-5.4/ncurses/trace/lib_trace.c~visibility.patch
1051+++ ncurses-5.4/ncurses/trace/lib_trace.c
1052@@ -42,11 +42,11 @@
1053
1054 MODULE_ID("$Id: lib_trace.c,v 1.53 2003/11/23 00:39:30 tom Exp $")
1055
1056-NCURSES_EXPORT_VAR(unsigned) _nc_tracing = 0; /* always define this */
1057+unsigned NCURSES_EXPORT_VAR(_nc_tracing) = 0; /* always define this */
1058
1059 #ifdef TRACE
1060-NCURSES_EXPORT_VAR(const char *) _nc_tputs_trace = "";
1061-NCURSES_EXPORT_VAR(long) _nc_outchars = 0;
1062+const char * NCURSES_EXPORT_VAR(_nc_tputs_trace) = "";
1063+long NCURSES_EXPORT_VAR(_nc_outchars) = 0;
1064
1065 static FILE *tracefp = 0; /* default to writing to stderr */
1066
1067--- ncurses-5.4/ncurses/curses.priv.h~visibility.patch
1068+++ ncurses-5.4/ncurses/curses.priv.h
1069@@ -498,7 +498,7 @@
1070 #endif
1071 };
1072
1073-extern NCURSES_EXPORT_VAR(SCREEN *) _nc_screen_chain;
1074+extern SCREEN * NCURSES_EXPORT_VAR(_nc_screen_chain);
1075
1076 #if NCURSES_NOMACROS
1077 #include <nomacros.h>
1078@@ -752,9 +752,9 @@
1079 extern NCURSES_EXPORT(int) _nc_retrace_int (int);
1080 extern NCURSES_EXPORT(unsigned) _nc_retrace_unsigned (unsigned);
1081 extern NCURSES_EXPORT(void) _nc_fifo_dump (void);
1082-extern NCURSES_EXPORT_VAR(const char *) _nc_tputs_trace;
1083-extern NCURSES_EXPORT_VAR(long) _nc_outchars;
1084-extern NCURSES_EXPORT_VAR(unsigned) _nc_tracing;
1085+extern const char * NCURSES_EXPORT_VAR(_nc_tputs_trace);
1086+extern long NCURSES_EXPORT_VAR(_nc_outchars);
1087+extern unsigned NCURSES_EXPORT_VAR(_nc_tracing);
1088
1089 #if USE_WIDEC_SUPPORT
1090 extern NCURSES_EXPORT(const char *) _nc_viswbuf2 (int, const wchar_t *);
1091@@ -1055,7 +1055,7 @@
1092 #endif
1093
1094 /* scroll indices */
1095-extern NCURSES_EXPORT_VAR(int *) _nc_oldnums;
1096+extern int * NCURSES_EXPORT_VAR(_nc_oldnums);
1097
1098 #define USE_SETBUF_0 0
1099
1100@@ -1074,7 +1074,7 @@
1101 extern NCURSES_EXPORT(void) _nc_set_screen (SCREEN *);
1102 #else
1103 /* current screen is private data; avoid possible linking conflicts too */
1104-extern NCURSES_EXPORT_VAR(SCREEN *) SP;
1105+extern SCREEN * NCURSES_EXPORT_VAR(SP);
1106 #define _nc_alloc_screen() ((SP = typeCalloc(SCREEN, 1)) != 0)
1107 #define _nc_set_screen(sp) SP = sp
1108 #endif
1109@@ -1087,7 +1087,7 @@
1110 #define screen_lines SP->_lines
1111 #define screen_columns SP->_columns
1112
1113-extern NCURSES_EXPORT_VAR(int) _nc_slk_format; /* != 0 if slk_init() called */
1114+extern int NCURSES_EXPORT_VAR(_nc_slk_format); /* != 0 if slk_init() called */
1115 extern NCURSES_EXPORT(int) _nc_slk_initialize (WINDOW *, int);
1116
1117 /*
1118--- /dev/null
1119+++ ncurses-5.4/m4/cf.m4
1120@@ -0,0 +1,3703 @@
1121+dnl***************************************************************************
1122+dnl Copyright (c) 1998-2003,2004 Free Software Foundation, Inc. *
1123+dnl *
1124+dnl Permission is hereby granted, free of charge, to any person obtaining a *
1125+dnl copy of this software and associated documentation files (the *
1126+dnl "Software"), to deal in the Software without restriction, including *
1127+dnl without limitation the rights to use, copy, modify, merge, publish, *
1128+dnl distribute, distribute with modifications, sublicense, and/or sell *
1129+dnl copies of the Software, and to permit persons to whom the Software is *
1130+dnl furnished to do so, subject to the following conditions: *
1131+dnl *
1132+dnl The above copyright notice and this permission notice shall be included *
1133+dnl in all copies or substantial portions of the Software. *
1134+dnl *
1135+dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
1136+dnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
1137+dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
1138+dnl IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
1139+dnl DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
1140+dnl OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
1141+dnl THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
1142+dnl *
1143+dnl Except as contained in this notice, the name(s) of the above copyright *
1144+dnl holders shall not be used in advertising or otherwise to promote the *
1145+dnl sale, use or other dealings in this Software without prior written *
1146+dnl authorization. *
1147+dnl***************************************************************************
1148+dnl
1149+dnl Author: Thomas E. Dickey 1995-2003
1150+dnl
1151+dnl $Id: aclocal.m4,v 1.333 2004/01/30 20:59:56 tom Exp $
1152+dnl Macros used in NCURSES auto-configuration script.
1153+dnl
1154+dnl See http://invisible-island.net/autoconf/ for additional information.
1155+dnl
1156+dnl ---------------------------------------------------------------------------
1157+dnl ---------------------------------------------------------------------------
1158+dnl CF_ADA_INCLUDE_DIRS version: 4 updated: 2002/12/01 00:12:15
1159+dnl -------------------
1160+dnl Construct the list of include-options for the C programs in the Ada95
1161+dnl binding.
1162+AC_DEFUN([CF_ADA_INCLUDE_DIRS],
1163+[
1164+ACPPFLAGS="-I. -I../../include $ACPPFLAGS"
1165+if test "$srcdir" != "."; then
1166+ ACPPFLAGS="-I\$(srcdir)/../../include $ACPPFLAGS"
1167+fi
1168+if test "$GCC" != yes; then
1169+ ACPPFLAGS="$ACPPFLAGS -I\$(includedir)"
1170+elif test "$includedir" != "/usr/include"; then
1171+ if test "$includedir" = '${prefix}/include' ; then
1172+ if test $prefix != /usr ; then
1173+ ACPPFLAGS="$ACPPFLAGS -I\$(includedir)"
1174+ fi
1175+ else
1176+ ACPPFLAGS="$ACPPFLAGS -I\$(includedir)"
1177+ fi
1178+fi
1179+AC_SUBST(ACPPFLAGS)
1180+])dnl
1181+dnl ---------------------------------------------------------------------------
1182+dnl CF_ADD_CFLAGS version: 5 updated: 2002/12/01 00:12:15
1183+dnl -------------
1184+dnl Copy non-preprocessor flags to $CFLAGS, preprocessor flags to $CPPFLAGS
1185+dnl The second parameter if given makes this macro verbose.
1186+AC_DEFUN([CF_ADD_CFLAGS],
1187+[
1188+cf_new_cflags=
1189+cf_new_cppflags=
1190+for cf_add_cflags in $1
1191+do
1192+ case $cf_add_cflags in #(vi
1193+ -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
1194+ case "$CPPFLAGS" in
1195+ *$cf_add_cflags) #(vi
1196+ ;;
1197+ *) #(vi
1198+ cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
1199+ ;;
1200+ esac
1201+ ;;
1202+ *)
1203+ cf_new_cflags="$cf_new_cflags $cf_add_cflags"
1204+ ;;
1205+ esac
1206+done
1207+
1208+if test -n "$cf_new_cflags" ; then
1209+ ifelse($2,,,[CF_VERBOSE(add to \$CFLAGS $cf_new_cflags)])
1210+ CFLAGS="$CFLAGS $cf_new_cflags"
1211+fi
1212+
1213+if test -n "$cf_new_cppflags" ; then
1214+ ifelse($2,,,[CF_VERBOSE(add to \$CPPFLAGS $cf_new_cppflags)])
1215+ CPPFLAGS="$cf_new_cppflags $CPPFLAGS"
1216+fi
1217+
1218+])dnl
1219+dnl ---------------------------------------------------------------------------
1220+dnl CF_ANSI_CC_CHECK version: 9 updated: 2001/12/30 17:53:34
1221+dnl ----------------
1222+dnl This is adapted from the macros 'fp_PROG_CC_STDC' and 'fp_C_PROTOTYPES'
1223+dnl in the sharutils 4.2 distribution.
1224+AC_DEFUN([CF_ANSI_CC_CHECK],
1225+[
1226+AC_CACHE_CHECK(for ${CC-cc} option to accept ANSI C, cf_cv_ansi_cc,[
1227+cf_cv_ansi_cc=no
1228+cf_save_CFLAGS="$CFLAGS"
1229+cf_save_CPPFLAGS="$CPPFLAGS"
1230+# Don't try gcc -ansi; that turns off useful extensions and
1231+# breaks some systems' header files.
1232+# AIX -qlanglvl=ansi
1233+# Ultrix and OSF/1 -std1
1234+# HP-UX -Aa -D_HPUX_SOURCE
1235+# SVR4 -Xc
1236+# UnixWare 1.2 (cannot use -Xc, since ANSI/POSIX clashes)
1237+for cf_arg in "-DCC_HAS_PROTOS" \
1238+ "" \
1239+ -qlanglvl=ansi \
1240+ -std1 \
1241+ -Ae \
1242+ "-Aa -D_HPUX_SOURCE" \
1243+ -Xc
1244+do
1245+ CF_ADD_CFLAGS($cf_arg)
1246+ AC_TRY_COMPILE(
1247+[
1248+#ifndef CC_HAS_PROTOS
1249+#if !defined(__STDC__) || (__STDC__ != 1)
1250+choke me
1251+#endif
1252+#endif
1253+],[
1254+ int test (int i, double x);
1255+ struct s1 {int (*f) (int a);};
1256+ struct s2 {int (*f) (double a);};],
1257+ [cf_cv_ansi_cc="$cf_arg"; break])
1258+done
1259+CFLAGS="$cf_save_CFLAGS"
1260+CPPFLAGS="$cf_save_CPPFLAGS"
1261+])
1262+
1263+if test "$cf_cv_ansi_cc" != "no"; then
1264+if test ".$cf_cv_ansi_cc" != ".-DCC_HAS_PROTOS"; then
1265+ CF_ADD_CFLAGS($cf_cv_ansi_cc)
1266+else
1267+ AC_DEFINE(CC_HAS_PROTOS)
1268+fi
1269+fi
1270+])dnl
1271+dnl ---------------------------------------------------------------------------
1272+dnl CF_ANSI_CC_REQD version: 3 updated: 1997/09/06 13:40:44
1273+dnl ---------------
1274+dnl For programs that must use an ANSI compiler, obtain compiler options that
1275+dnl will make it recognize prototypes. We'll do preprocessor checks in other
1276+dnl macros, since tools such as unproto can fake prototypes, but only part of
1277+dnl the preprocessor.
1278+AC_DEFUN([CF_ANSI_CC_REQD],
1279+[AC_REQUIRE([CF_ANSI_CC_CHECK])
1280+if test "$cf_cv_ansi_cc" = "no"; then
1281+ AC_ERROR(
1282+[Your compiler does not appear to recognize prototypes.
1283+You have the following choices:
1284+ a. adjust your compiler options
1285+ b. get an up-to-date compiler
1286+ c. use a wrapper such as unproto])
1287+fi
1288+])dnl
1289+dnl ---------------------------------------------------------------------------
1290+dnl CF_BOOL_DECL version: 8 updated: 2004/01/30 15:51:18
1291+dnl ------------
1292+dnl Test if 'bool' is a builtin type in the configured C++ compiler. Some
1293+dnl older compilers (e.g., gcc 2.5.8) don't support 'bool' directly; gcc
1294+dnl 2.6.3 does, in anticipation of the ANSI C++ standard.
1295+dnl
1296+dnl Treat the configuration-variable specially here, since we're directly
1297+dnl substituting its value (i.e., 1/0).
1298+dnl
1299+dnl $1 is the shell variable to store the result in, if not $cv_cv_builtin_bool
1300+AC_DEFUN([CF_BOOL_DECL],
1301+[
1302+AC_MSG_CHECKING(if we should include stdbool.h)
1303+
1304+AC_CACHE_VAL(cf_cv_header_stdbool_h,[
1305+ AC_TRY_COMPILE([],[bool foo = false],
1306+ [cf_cv_header_stdbool_h=0],
1307+ [AC_TRY_COMPILE([
1308+#ifndef __BEOS__
1309+#include <stdbool.h>
1310+#endif
1311+],[bool foo = false],
1312+ [cf_cv_header_stdbool_h=1],
1313+ [cf_cv_header_stdbool_h=0])])])
1314+
1315+if test "$cf_cv_header_stdbool_h" = 1
1316+then AC_MSG_RESULT(yes)
1317+else AC_MSG_RESULT(no)
1318+fi
1319+
1320+AC_MSG_CHECKING([for builtin bool type])
1321+
1322+AC_CACHE_VAL(ifelse($1,,cf_cv_builtin_bool,[$1]),[
1323+ AC_TRY_COMPILE([
1324+#include <stdio.h>
1325+#include <sys/types.h>
1326+],[bool x = false],
1327+ [ifelse($1,,cf_cv_builtin_bool,[$1])=1],
1328+ [ifelse($1,,cf_cv_builtin_bool,[$1])=0])
1329+ ])
1330+
1331+if test "$ifelse($1,,cf_cv_builtin_bool,[$1])" = 1
1332+then AC_MSG_RESULT(yes)
1333+else AC_MSG_RESULT(no)
1334+fi
1335+])dnl
1336+dnl ---------------------------------------------------------------------------
1337+dnl CF_BOOL_SIZE version: 10 updated: 2002/02/23 20:38:31
1338+dnl ------------
1339+dnl Test for the size of 'bool' in the configured C++ compiler (e.g., a type).
1340+dnl Don't bother looking for bool.h, since it's been deprecated.
1341+dnl
1342+dnl If the current compiler is C rather than C++, we get the bool definition
1343+dnl from <stdbool.h>.
1344+AC_DEFUN([CF_BOOL_SIZE],
1345+[
1346+AC_MSG_CHECKING([for size of bool])
1347+AC_CACHE_VAL(cf_cv_type_of_bool,[
1348+ rm -f cf_test.out
1349+ AC_TRY_RUN([
1350+#include <stdlib.h>
1351+#include <stdio.h>
1352+
1353+#if defined(__cplusplus)
1354+
1355+#ifdef HAVE_GXX_BUILTIN_H
1356+#include <g++/builtin.h>
1357+#elif HAVE_GPP_BUILTIN_H
1358+#include <gpp/builtin.h>
1359+#elif HAVE_BUILTIN_H
1360+#include <builtin.h>
1361+#endif
1362+
1363+#else
1364+
1365+#if $cf_cv_header_stdbool_h
1366+#include <stdbool.h>
1367+#endif
1368+
1369+#endif
1370+
1371+main()
1372+{
1373+ FILE *fp = fopen("cf_test.out", "w");
1374+ if (fp != 0) {
1375+ bool x = true;
1376+ if ((bool)(-x) >= 0)
1377+ fputs("unsigned ", fp);
1378+ if (sizeof(x) == sizeof(int)) fputs("int", fp);
1379+ else if (sizeof(x) == sizeof(char)) fputs("char", fp);
1380+ else if (sizeof(x) == sizeof(short))fputs("short",fp);
1381+ else if (sizeof(x) == sizeof(long)) fputs("long", fp);
1382+ fclose(fp);
1383+ }
1384+ exit(0);
1385+}
1386+ ],
1387+ [cf_cv_type_of_bool=`cat cf_test.out`
1388+ if test -z "$cf_cv_type_of_bool"; then
1389+ cf_cv_type_of_bool=unknown
1390+ fi],
1391+ [cf_cv_type_of_bool=unknown],
1392+ [cf_cv_type_of_bool=unknown])
1393+ ])
1394+ rm -f cf_test.out
1395+AC_MSG_RESULT($cf_cv_type_of_bool)
1396+if test "$cf_cv_type_of_bool" = unknown ; then
1397+ case .$NCURSES_BOOL in #(vi
1398+ .auto|.) NCURSES_BOOL=unsigned;;
1399+ esac
1400+ AC_MSG_WARN(Assuming $NCURSES_BOOL for type of bool)
1401+ cf_cv_type_of_bool=$NCURSES_BOOL
1402+fi
1403+])dnl
1404+dnl ---------------------------------------------------------------------------
1405+dnl CF_CFG_DEFAULTS version: 6 updated: 2003/07/12 15:15:19
1406+dnl ---------------
1407+dnl Determine the default configuration into which we'll install ncurses. This
1408+dnl can be overridden by the user's command-line options. There's two items to
1409+dnl look for:
1410+dnl 1. the prefix (e.g., /usr)
1411+dnl 2. the header files (e.g., /usr/include/ncurses)
1412+dnl We'll look for a previous installation of ncurses and use the same defaults.
1413+dnl
1414+dnl We don't use AC_PREFIX_DEFAULT, because it gets evaluated too soon, and
1415+dnl we don't use AC_PREFIX_PROGRAM, because we cannot distinguish ncurses's
1416+dnl programs from a vendor's.
1417+AC_DEFUN([CF_CFG_DEFAULTS],
1418+[
1419+AC_MSG_CHECKING(for prefix)
1420+if test "x$prefix" = "xNONE" ; then
1421+ case "$cf_cv_system_name" in
1422+ # non-vendor systems don't have a conflict
1423+ openbsd*|netbsd*|freebsd*|linux*|cygwin*|k*bsd*-gnu)
1424+ prefix=/usr
1425+ ;;
1426+ *) prefix=$ac_default_prefix
1427+ ;;
1428+ esac
1429+fi
1430+AC_MSG_RESULT($prefix)
1431+
1432+if test "x$prefix" = "xNONE" ; then
1433+AC_MSG_CHECKING(for default include-directory)
1434+test -n "$verbose" && echo 1>&AC_FD_MSG
1435+for cf_symbol in \
1436+ $includedir \
1437+ $includedir/ncurses \
1438+ $prefix/include \
1439+ $prefix/include/ncurses \
1440+ /usr/local/include \
1441+ /usr/local/include/ncurses \
1442+ /usr/include \
1443+ /usr/include/ncurses
1444+do
1445+ cf_dir=`eval echo $cf_symbol`
1446+ if test -f $cf_dir/curses.h ; then
1447+ if ( fgrep NCURSES_VERSION $cf_dir/curses.h 2>&1 >/dev/null ) ; then
1448+ includedir="$cf_symbol"
1449+ test -n "$verbose" && echo $ac_n " found " 1>&AC_FD_MSG
1450+ break
1451+ fi
1452+ fi
1453+ test -n "$verbose" && echo " tested $cf_dir" 1>&AC_FD_MSG
1454+done
1455+AC_MSG_RESULT($includedir)
1456+fi
1457+])dnl
1458+dnl ---------------------------------------------------------------------------
1459+dnl CF_CGETENT version: 3 updated: 2000/08/12 23:18:52
1460+dnl ----------
1461+dnl Check if the terminal-capability database functions are available. If not,
1462+dnl ncurses has a much-reduced version.
1463+AC_DEFUN([CF_CGETENT],[
1464+AC_MSG_CHECKING(for terminal-capability database functions)
1465+AC_CACHE_VAL(cf_cv_cgetent,[
1466+AC_TRY_LINK([
1467+#include <stdlib.h>],[
1468+ char temp[128];
1469+ char *buf = temp;
1470+ char *db_array = temp;
1471+ cgetent(&buf, /* int *, */ &db_array, "vt100");
1472+ cgetcap(buf, "tc", '=');
1473+ cgetmatch(buf, "tc");
1474+ ],
1475+ [cf_cv_cgetent=yes],
1476+ [cf_cv_cgetent=no])
1477+])
1478+AC_MSG_RESULT($cf_cv_cgetent)
1479+test "$cf_cv_cgetent" = yes && AC_DEFINE(HAVE_BSD_CGETENT)
1480+])dnl
1481+dnl ---------------------------------------------------------------------------
1482+dnl CF_CHECK_CACHE version: 9 updated: 2004/01/30 15:59:13
1483+dnl --------------
1484+dnl Check if we're accidentally using a cache from a different machine.
1485+dnl Derive the system name, as a check for reusing the autoconf cache.
1486+dnl
1487+dnl If we've packaged config.guess and config.sub, run that (since it does a
1488+dnl better job than uname). Normally we'll use AC_CANONICAL_HOST, but allow
1489+dnl an extra parameter that we may override, e.g., for AC_CANONICAL_SYSTEM
1490+dnl which is useful in cross-compiles.
1491+dnl
1492+dnl Note: we would use $ac_config_sub, but that is one of the places where
1493+dnl autoconf 2.5x broke compatibility with autoconf 2.13
1494+AC_DEFUN([CF_CHECK_CACHE],
1495+[
1496+if test -f $srcdir/config.guess ; then
1497+ ifelse([$1],,[AC_CANONICAL_HOST],[$1])
1498+ system_name="$host_os"
1499+else
1500+ system_name="`(uname -s -r) 2>/dev/null`"
1501+ if test -z "$system_name" ; then
1502+ system_name="`(hostname) 2>/dev/null`"
1503+ fi
1504+fi
1505+test -n "$system_name" && AC_DEFINE_UNQUOTED(SYSTEM_NAME,"$system_name")
1506+AC_CACHE_VAL(cf_cv_system_name,[cf_cv_system_name="$system_name"])
1507+
1508+test -z "$system_name" && system_name="$cf_cv_system_name"
1509+test -n "$cf_cv_system_name" && AC_MSG_RESULT(Configuring for $cf_cv_system_name)
1510+
1511+if test ".$system_name" != ".$cf_cv_system_name" ; then
1512+ AC_MSG_RESULT(Cached system name ($system_name) does not agree with actual ($cf_cv_system_name))
1513+ AC_ERROR("Please remove config.cache and try again.")
1514+fi
1515+])dnl
1516+dnl ---------------------------------------------------------------------------
1517+dnl CF_CHECK_ERRNO version: 9 updated: 2001/12/30 18:03:23
1518+dnl --------------
1519+dnl Check for data that is usually declared in <stdio.h> or <errno.h>, e.g.,
1520+dnl the 'errno' variable. Define a DECL_xxx symbol if we must declare it
1521+dnl ourselves.
1522+dnl
1523+dnl $1 = the name to check
1524+AC_DEFUN([CF_CHECK_ERRNO],
1525+[
1526+AC_CACHE_CHECK(if external $1 is declared, cf_cv_dcl_$1,[
1527+ AC_TRY_COMPILE([
1528+#ifdef HAVE_STDLIB_H
1529+#include <stdlib.h>
1530+#endif
1531+#include <stdio.h>
1532+#include <sys/types.h>
1533+#include <errno.h> ],
1534+ [long x = (long) $1],
1535+ [cf_cv_dcl_$1=yes],
1536+ [cf_cv_dcl_$1=no])
1537+])
1538+
1539+if test "$cf_cv_dcl_$1" = no ; then
1540+ CF_UPPER(cf_result,decl_$1)
1541+ AC_DEFINE_UNQUOTED($cf_result)
1542+fi
1543+
1544+# It's possible (for near-UNIX clones) that the data doesn't exist
1545+CF_CHECK_EXTERN_DATA($1,int)
1546+])dnl
1547+dnl ---------------------------------------------------------------------------
1548+dnl CF_CHECK_EXTERN_DATA version: 3 updated: 2001/12/30 18:03:23
1549+dnl --------------------
1550+dnl Check for existence of external data in the current set of libraries. If
1551+dnl we can modify it, it's real enough.
1552+dnl $1 = the name to check
1553+dnl $2 = its type
1554+AC_DEFUN([CF_CHECK_EXTERN_DATA],
1555+[
1556+AC_CACHE_CHECK(if external $1 exists, cf_cv_have_$1,[
1557+ AC_TRY_LINK([
1558+#undef $1
1559+extern $2 $1;
1560+],
1561+ [$1 = 2],
1562+ [cf_cv_have_$1=yes],
1563+ [cf_cv_have_$1=no])
1564+])
1565+
1566+if test "$cf_cv_have_$1" = yes ; then
1567+ CF_UPPER(cf_result,have_$1)
1568+ AC_DEFINE_UNQUOTED($cf_result)
1569+fi
1570+
1571+])dnl
1572+dnl ---------------------------------------------------------------------------
1573+dnl CF_CPP_PARAM_INIT version: 4 updated: 2001/04/07 22:31:18
1574+dnl -----------------
1575+dnl Check if the C++ compiler accepts duplicate parameter initialization. This
1576+dnl is a late feature for the standard and is not in some recent compilers
1577+dnl (1999/9/11).
1578+AC_DEFUN([CF_CPP_PARAM_INIT],
1579+[
1580+if test -n "$CXX"; then
1581+AC_CACHE_CHECK(if $CXX accepts parameter initialization,cf_cv_cpp_param_init,[
1582+ AC_LANG_SAVE
1583+ AC_LANG_CPLUSPLUS
1584+ AC_TRY_RUN([
1585+class TEST {
1586+private:
1587+ int value;
1588+public:
1589+ TEST(int x = 1);
1590+ ~TEST();
1591+};
1592+
1593+TEST::TEST(int x = 1) // some compilers do not like second initializer
1594+{
1595+ value = x;
1596+}
1597+void main() { }
1598+],
1599+ [cf_cv_cpp_param_init=yes],
1600+ [cf_cv_cpp_param_init=no],
1601+ [cf_cv_cpp_param_init=unknown])
1602+ AC_LANG_RESTORE
1603+])
1604+fi
1605+test "$cf_cv_cpp_param_init" = yes && AC_DEFINE(CPP_HAS_PARAM_INIT)
1606+])dnl
1607+dnl ---------------------------------------------------------------------------
1608+dnl CF_CPP_VSCAN_FUNC version: 5 updated: 2001/12/02 01:39:28
1609+dnl -----------------
1610+dnl Check if the g++ compiler supports vscan function (not a standard feature).
1611+AC_DEFUN([CF_CPP_VSCAN_FUNC],
1612+[
1613+if test -n "$CXX"; then
1614+
1615+AC_LANG_SAVE
1616+AC_LANG_CPLUSPLUS
1617+AC_CHECK_HEADERS(strstream.h)
1618+
1619+AC_CACHE_CHECK(if $CXX supports vscan function,cf_cv_cpp_vscan_func,[
1620+ for cf_vscan_func in strstream strstream_cast stdio
1621+ do
1622+ case $cf_vscan_func in #(vi
1623+ stdio) cf_vscan_defs=USE_STDIO_VSCAN ;; #(vi
1624+ strstream) cf_vscan_defs=USE_STRSTREAM_VSCAN ;;
1625+ strstream_cast) cf_vscan_defs=USE_STRSTREAM_VSCAN_CAST ;;
1626+ esac
1627+ AC_TRY_LINK([
1628+#include <stdio.h>
1629+#include <stdarg.h>
1630+#define $cf_vscan_defs 1
1631+#if defined(USE_STDIO_VSCAN)
1632+#elif defined(HAVE_STRSTREAM_H) && defined(USE_STRSTREAM_VSCAN)
1633+#include <strstream.h>
1634+#endif
1635+
1636+int scanw(const char* fmt, ...)
1637+{
1638+ int result = -1;
1639+ char buf[BUFSIZ];
1640+
1641+ va_list args;
1642+ va_start(args, fmt);
1643+#if defined(USE_STDIO_VSCAN)
1644+ if (::vsscanf(buf, fmt, args) != -1)
1645+ result = 0;
1646+#elif defined(USE_STRSTREAM_VSCAN)
1647+ strstreambuf ss(buf, sizeof(buf));
1648+ if (ss.vscan(fmt, args) != -1)
1649+ result = 0;
1650+#elif defined(USE_STRSTREAM_VSCAN_CAST)
1651+ strstreambuf ss(buf, sizeof(buf));
1652+ if (ss.vscan(fmt, (_IO_va_list)args) != -1)
1653+ result = 0;
1654+#else
1655+#error case $cf_vscan_func failed
1656+#endif
1657+ va_end(args);
1658+ return result;
1659+}
1660+],[int tmp, foo = scanw("%d", &tmp)],
1661+ [cf_cv_cpp_vscan_func=$cf_vscan_func; break],
1662+ [cf_cv_cpp_vscan_func=no])
1663+ test "$cf_cv_cpp_vscan_func" != no && break
1664+ done
1665+])
1666+
1667+AC_LANG_RESTORE
1668+fi
1669+
1670+case $cf_cv_cpp_vscan_func in #(vi
1671+stdio) #(vi
1672+ AC_DEFINE(CPP_HAS_VSCAN_FUNC)
1673+ AC_DEFINE(USE_STDIO_VSCAN)
1674+ ;;
1675+strstream)
1676+ AC_DEFINE(CPP_HAS_VSCAN_FUNC)
1677+ AC_DEFINE(USE_STRSTREAM_VSCAN)
1678+ ;;
1679+strstream_cast)
1680+ AC_DEFINE(CPP_HAS_VSCAN_FUNC)
1681+ AC_DEFINE(USE_STRSTREAM_VSCAN_CAST)
1682+ ;;
1683+esac
1684+])dnl
1685+dnl ---------------------------------------------------------------------------
1686+dnl CF_DIRNAME version: 4 updated: 2002/12/21 19:25:52
1687+dnl ----------
1688+dnl "dirname" is not portable, so we fake it with a shell script.
1689+AC_DEFUN([CF_DIRNAME],[$1=`echo $2 | sed -e 's%/[[^/]]*$%%'`])dnl
1690+dnl ---------------------------------------------------------------------------
1691+dnl CF_DIRS_TO_MAKE version: 3 updated: 2002/02/23 20:38:31
1692+dnl ---------------
1693+AC_DEFUN([CF_DIRS_TO_MAKE],
1694+[
1695+DIRS_TO_MAKE="lib"
1696+for cf_item in $cf_list_models
1697+do
1698+ CF_OBJ_SUBDIR($cf_item,cf_subdir)
1699+ for cf_item2 in $DIRS_TO_MAKE
1700+ do
1701+ test $cf_item2 = $cf_subdir && break
1702+ done
1703+ test ".$cf_item2" != ".$cf_subdir" && DIRS_TO_MAKE="$DIRS_TO_MAKE $cf_subdir"
1704+done
1705+for cf_dir in $DIRS_TO_MAKE
1706+do
1707+ test ! -d $cf_dir && mkdir $cf_dir
1708+done
1709+AC_SUBST(DIRS_TO_MAKE)
1710+])dnl
1711+dnl ---------------------------------------------------------------------------
1712+dnl CF_ERRNO version: 5 updated: 1997/11/30 12:44:39
1713+dnl --------
1714+dnl Check if 'errno' is declared in <errno.h>
1715+AC_DEFUN([CF_ERRNO],
1716+[
1717+CF_CHECK_ERRNO(errno)
1718+])dnl
1719+dnl ---------------------------------------------------------------------------
1720+dnl CF_ETIP_DEFINES version: 3 updated: 2003/03/22 19:13:43
1721+dnl ---------------
1722+dnl Test for conflicting definitions of exception in gcc 2.8.0, etc., between
1723+dnl math.h and builtin.h, only for ncurses
1724+AC_DEFUN([CF_ETIP_DEFINES],
1725+[
1726+AC_MSG_CHECKING(for special defines needed for etip.h)
1727+cf_save_CXXFLAGS="$CXXFLAGS"
1728+cf_result="none"
1729+for cf_math in "" MATH_H
1730+do
1731+for cf_excp in "" MATH_EXCEPTION
1732+do
1733+ CXXFLAGS="$cf_save_CXXFLAGS -I${srcdir}/c++ -I${srcdir}/menu -I${srcdir}/include"
1734+ test -n "$cf_math" && CXXFLAGS="$CXXFLAGS -DETIP_NEEDS_${cf_math}"
1735+ test -n "$cf_excp" && CXXFLAGS="$CXXFLAGS -DETIP_NEEDS_${cf_excp}"
1736+AC_TRY_COMPILE([
1737+#include <etip.h.in>
1738+],[],[
1739+ test -n "$cf_math" && AC_DEFINE_UNQUOTED(ETIP_NEEDS_${cf_math})
1740+ test -n "$cf_excp" && AC_DEFINE_UNQUOTED(ETIP_NEEDS_${cf_excp})
1741+ cf_result="$cf_math $cf_excp"
1742+ break
1743+],[])
1744+done
1745+done
1746+AC_MSG_RESULT($cf_result)
1747+CXXFLAGS="$cf_save_CXXFLAGS"
1748+])
1749+dnl ---------------------------------------------------------------------------
1750+dnl CF_FUNC_MEMMOVE version: 5 updated: 2000/08/12 23:18:52
1751+dnl ---------------
1752+dnl Check for memmove, or a bcopy that can handle overlapping copy. If neither
1753+dnl is found, add our own version of memmove to the list of objects.
1754+AC_DEFUN([CF_FUNC_MEMMOVE],
1755+[
1756+AC_CHECK_FUNC(memmove,,[
1757+AC_CHECK_FUNC(bcopy,[
1758+ AC_CACHE_CHECK(if bcopy does overlapping moves,cf_cv_good_bcopy,[
1759+ AC_TRY_RUN([
1760+int main() {
1761+ static char data[] = "abcdefghijklmnopqrstuwwxyz";
1762+ char temp[40];
1763+ bcopy(data, temp, sizeof(data));
1764+ bcopy(temp+10, temp, 15);
1765+ bcopy(temp+5, temp+15, 10);
1766+ exit (strcmp(temp, "klmnopqrstuwwxypqrstuwwxyz"));
1767+}
1768+ ],
1769+ [cf_cv_good_bcopy=yes],
1770+ [cf_cv_good_bcopy=no],
1771+ [cf_cv_good_bcopy=unknown])
1772+ ])
1773+ ],[cf_cv_good_bcopy=no])
1774+ if test "$cf_cv_good_bcopy" = yes ; then
1775+ AC_DEFINE(USE_OK_BCOPY)
1776+ else
1777+ AC_DEFINE(USE_MY_MEMMOVE)
1778+ fi
1779+])])dnl
1780+dnl ---------------------------------------------------------------------------
1781+dnl CF_FUNC_POLL version: 2 updated: 2000/02/06 01:38:04
1782+dnl ------------
1783+dnl See if the poll function really works. Some platforms have poll(), but
1784+dnl it does not work for terminals or files.
1785+AC_DEFUN([CF_FUNC_POLL],[
1786+AC_CACHE_CHECK(if poll really works,cf_cv_working_poll,[
1787+AC_TRY_RUN([
1788+#include <stdio.h>
1789+#ifdef HAVE_POLL_H
1790+#include <poll.h>
1791+#else
1792+#include <sys/poll.h>
1793+#endif
1794+int main() {
1795+ struct pollfd myfds;
1796+ int ret;
1797+
1798+ myfds.fd = 0;
1799+ myfds.events = POLLIN;
1800+
1801+ ret = poll(&myfds, 1, 100);
1802+ exit(ret != 0);
1803+}],
1804+ [cf_cv_working_poll=yes],
1805+ [cf_cv_working_poll=no],
1806+ [cf_cv_working_poll=unknown])])
1807+test "$cf_cv_working_poll" = "yes" && AC_DEFINE(HAVE_WORKING_POLL)
1808+])dnl
1809+dnl ---------------------------------------------------------------------------
1810+dnl CF_FUNC_TERMIOS version: 2 updated: 2000/07/22 23:37:24
1811+dnl ---------------
1812+dnl Some old/broken variations define tcgetattr() only as a macro in
1813+dnl termio(s).h
1814+AC_DEFUN([CF_FUNC_TERMIOS],[
1815+AC_REQUIRE([CF_STRUCT_TERMIOS])
1816+AC_CACHE_CHECK(for tcgetattr, cf_cv_have_tcgetattr,[
1817+AC_TRY_LINK([
1818+#include <sys/types.h>
1819+#ifdef HAVE_UNISTD_H
1820+#include <unistd.h>
1821+#endif
1822+#ifdef HAVE_TERMIOS_H
1823+#include <termios.h>
1824+#define TTY struct termios
1825+#else
1826+#ifdef HAVE_TERMIO_H
1827+#include <termio.h>
1828+#define TTY struct termio
1829+#endif
1830+#endif
1831+],[
1832+TTY foo;
1833+tcgetattr(1, &foo);],
1834+[cf_cv_have_tcgetattr=yes],
1835+[cf_cv_have_tcgetattr=no])])
1836+test "$cf_cv_have_tcgetattr" = yes && AC_DEFINE(HAVE_TCGETATTR)
1837+])dnl
1838+dnl ---------------------------------------------------------------------------
1839+dnl CF_FUNC_VSSCANF version: 3 updated: 2001/12/19 00:50:10
1840+dnl ---------------
1841+dnl Check for vsscanf() function, which is in c9x but generally not in earlier
1842+dnl versions of C. It is in the GNU C library, and can often be simulated by
1843+dnl other functions.
1844+AC_DEFUN([CF_FUNC_VSSCANF],
1845+[
1846+AC_CACHE_CHECK(for vsscanf function or workaround,cf_cv_func_vsscanf,[
1847+AC_TRY_LINK([
1848+#include <stdarg.h>
1849+#include <stdio.h>],[
1850+ va_list ap;
1851+ vsscanf("from", "%d", ap)],[cf_cv_func_vsscanf=vsscanf],[
1852+AC_TRY_LINK([
1853+#include <stdarg.h>
1854+#include <stdio.h>],[
1855+ FILE strbuf;
1856+ char *str = "from";
1857+
1858+ strbuf._flag = _IOREAD;
1859+ strbuf._ptr = strbuf._base = (unsigned char *) str;
1860+ strbuf._cnt = strlen(str);
1861+ strbuf._file = _NFILE;
1862+ return (vfscanf(&strbuf, "%d", ap))],[cf_cv_func_vsscanf=vfscanf],[
1863+AC_TRY_LINK([
1864+#include <stdarg.h>
1865+#include <stdio.h>],[
1866+ FILE strbuf;
1867+ char *str = "from";
1868+
1869+ strbuf._flag = _IOREAD;
1870+ strbuf._ptr = strbuf._base = (unsigned char *) str;
1871+ strbuf._cnt = strlen(str);
1872+ strbuf._file = _NFILE;
1873+ return (_doscan(&strbuf, "%d", ap))],[cf_cv_func_vsscanf=_doscan],[
1874+cf_cv_func_vsscanf=no])])])])
1875+
1876+case $cf_cv_func_vsscanf in #(vi
1877+vsscanf) AC_DEFINE(HAVE_VSSCANF);; #(vi
1878+vfscanf) AC_DEFINE(HAVE_VFSCANF);; #(vi
1879+_doscan) AC_DEFINE(HAVE__DOSCAN);;
1880+esac
1881+
1882+])dnl
1883+dnl ---------------------------------------------------------------------------
1884+dnl CF_GCC_ATTRIBUTES version: 9 updated: 2002/12/21 19:25:52
1885+dnl -----------------
1886+dnl Test for availability of useful gcc __attribute__ directives to quiet
1887+dnl compiler warnings. Though useful, not all are supported -- and contrary
1888+dnl to documentation, unrecognized directives cause older compilers to barf.
1889+AC_DEFUN([CF_GCC_ATTRIBUTES],
1890+[
1891+if test "$GCC" = yes
1892+then
1893+cat > conftest.i <<EOF
1894+#ifndef GCC_PRINTF
1895+#define GCC_PRINTF 0
1896+#endif
1897+#ifndef GCC_SCANF
1898+#define GCC_SCANF 0
1899+#endif
1900+#ifndef GCC_NORETURN
1901+#define GCC_NORETURN /* nothing */
1902+#endif
1903+#ifndef GCC_UNUSED
1904+#define GCC_UNUSED /* nothing */
1905+#endif
1906+EOF
1907+if test "$GCC" = yes
1908+then
1909+ AC_CHECKING([for $CC __attribute__ directives])
1910+cat > conftest.$ac_ext <<EOF
1911+#line __oline__ "configure"
1912+#include "confdefs.h"
1913+#include "conftest.h"
1914+#include "conftest.i"
1915+#if GCC_PRINTF
1916+#define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
1917+#else
1918+#define GCC_PRINTFLIKE(fmt,var) /*nothing*/
1919+#endif
1920+#if GCC_SCANF
1921+#define GCC_SCANFLIKE(fmt,var) __attribute__((format(scanf,fmt,var)))
1922+#else
1923+#define GCC_SCANFLIKE(fmt,var) /*nothing*/
1924+#endif
1925+extern void wow(char *,...) GCC_SCANFLIKE(1,2);
1926+extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
1927+extern void foo(void) GCC_NORETURN;
1928+int main(int argc GCC_UNUSED, char *argv[[]] GCC_UNUSED) { return 0; }
1929+EOF
1930+ for cf_attribute in scanf printf unused noreturn
1931+ do
1932+ CF_UPPER(CF_ATTRIBUTE,$cf_attribute)
1933+ cf_directive="__attribute__(($cf_attribute))"
1934+ echo "checking for $CC $cf_directive" 1>&AC_FD_CC
1935+ case $cf_attribute in
1936+ scanf|printf)
1937+ cat >conftest.h <<EOF
1938+#define GCC_$CF_ATTRIBUTE 1
1939+EOF
1940+ ;;
1941+ *)
1942+ cat >conftest.h <<EOF
1943+#define GCC_$CF_ATTRIBUTE $cf_directive
1944+EOF
1945+ ;;
1946+ esac
1947+ if AC_TRY_EVAL(ac_compile); then
1948+ test -n "$verbose" && AC_MSG_RESULT(... $cf_attribute)
1949+ cat conftest.h >>confdefs.h
1950+ fi
1951+ done
1952+else
1953+ fgrep define conftest.i >>confdefs.h
1954+fi
1955+rm -rf conftest*
1956+fi
1957+])dnl
1958+dnl ---------------------------------------------------------------------------
1959+dnl CF_GCC_VERSION version: 3 updated: 2003/09/06 19:16:57
1960+dnl --------------
1961+dnl Find version of gcc
1962+AC_DEFUN([CF_GCC_VERSION],[
1963+AC_REQUIRE([AC_PROG_CC])
1964+GCC_VERSION=none
1965+if test "$GCC" = yes ; then
1966+ AC_MSG_CHECKING(version of $CC)
1967+ GCC_VERSION="`${CC} --version|sed -e '2,$d' -e 's/^[[^0-9.]]*//' -e 's/[[^0-9.]].*//'`"
1968+ test -z "$GCC_VERSION" && GCC_VERSION=unknown
1969+ AC_MSG_RESULT($GCC_VERSION)
1970+fi
1971+])dnl
1972+dnl ---------------------------------------------------------------------------
1973+dnl CF_GCC_WARNINGS version: 15 updated: 2003/07/05 18:42:30
1974+dnl ---------------
1975+dnl Check if the compiler supports useful warning options. There's a few that
1976+dnl we don't use, simply because they're too noisy:
1977+dnl
1978+dnl -Wconversion (useful in older versions of gcc, but not in gcc 2.7.x)
1979+dnl -Wredundant-decls (system headers make this too noisy)
1980+dnl -Wtraditional (combines too many unrelated messages, only a few useful)
1981+dnl -Wwrite-strings (too noisy, but should review occasionally). This
1982+dnl is enabled for ncurses using "--enable-const".
1983+dnl -pedantic
1984+dnl
1985+AC_DEFUN([CF_GCC_WARNINGS],
1986+[
1987+AC_REQUIRE([CF_GCC_VERSION])
1988+if test "$GCC" = yes
1989+then
1990+ cat > conftest.$ac_ext <<EOF
1991+#line __oline__ "configure"
1992+int main(int argc, char *argv[[]]) { return (argv[[argc-1]] == 0) ; }
1993+EOF
1994+ AC_CHECKING([for $CC warning options])
1995+ cf_save_CFLAGS="$CFLAGS"
1996+ EXTRA_CFLAGS="-W -Wall"
1997+ cf_warn_CONST=""
1998+ test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
1999+ for cf_opt in \
2000+ Wbad-function-cast \
2001+ Wcast-align \
2002+ Wcast-qual \
2003+ Winline \
2004+ Wmissing-declarations \
2005+ Wmissing-prototypes \
2006+ Wnested-externs \
2007+ Wpointer-arith \
2008+ Wshadow \
2009+ Wstrict-prototypes \
2010+ Wundef $cf_warn_CONST
2011+ do
2012+ CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
2013+ if AC_TRY_EVAL(ac_compile); then
2014+ test -n "$verbose" && AC_MSG_RESULT(... -$cf_opt)
2015+ case $cf_opt in #(vi
2016+ Wcast-qual) #(vi
2017+ CPPFLAGS="$CPPFLAGS -DXTSTRINGDEFINES"
2018+ ;;
2019+ Winline) #(vi
2020+ case $GCC_VERSION in
2021+ 3.3*)
2022+ CF_VERBOSE(feature is broken in gcc $GCC_VERSION)
2023+ continue;;
2024+ esac
2025+ ;;
2026+ esac
2027+ EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
2028+ fi
2029+ done
2030+ rm -f conftest*
2031+ CFLAGS="$cf_save_CFLAGS"
2032+fi
2033+AC_SUBST(EXTRA_CFLAGS)
2034+])dnl
2035+dnl ---------------------------------------------------------------------------
2036+dnl CF_GNAT_TRY_RUN version: 2 updated: 1998/07/19 00:25:18
2037+dnl ---------------
2038+dnl Verify that a test program compiles and runs with GNAT
2039+dnl $cf_ada_make is set to the program that compiles/links
2040+AC_DEFUN([CF_GNAT_TRY_RUN],
2041+[
2042+rm -f conftest*
2043+cat >>conftest.ads <<CF_EOF
2044+$1
2045+CF_EOF
2046+cat >>conftest.adb <<CF_EOF
2047+$2
2048+CF_EOF
2049+if ( $cf_ada_make conftest 1>&AC_FD_CC 2>&1 ) ; then
2050+ if ( ./conftest 1>&AC_FD_CC 2>&1 ) ; then
2051+ifelse($3,, :,[ $3])
2052+ifelse($4,,,[ else
2053+ $4])
2054+ fi
2055+ifelse($4,,,[else
2056+ $4])
2057+fi
2058+rm -f conftest*
2059+])dnl
2060+dnl ---------------------------------------------------------------------------
2061+dnl CF_GNAT_VERSION version: 11 updated: 2003/09/06 19:42:09
2062+dnl ---------------
2063+dnl Verify version of GNAT.
2064+AC_DEFUN([CF_GNAT_VERSION],
2065+[
2066+AC_MSG_CHECKING(for gnat version)
2067+cf_gnat_version=`${cf_ada_make-gnatmake} -v 2>&1 | grep '[[0-9]].[[0-9]][[0-9]]*' |\
2068+ sed -e '2,$d' -e 's/[[^0-9 \.]]//g' -e 's/^[[ ]]*//' -e 's/ .*//'`
2069+AC_MSG_RESULT($cf_gnat_version)
2070+
2071+case $cf_gnat_version in
2072+ 3.1[[1-9]]*|3.[[2-9]]*|[[4-9]].*)
2073+ cf_cv_prog_gnat_correct=yes
2074+ ;;
2075+ *) echo Unsupported GNAT version $cf_gnat_version. Required is 3.11 or better. Disabling Ada95 binding.
2076+ cf_cv_prog_gnat_correct=no
2077+ ;;
2078+esac
2079+case $cf_gnat_version in
2080+ 3.[[1-9]]*|[[4-9]].*)
2081+ cf_compile_generics=generics
2082+ cf_generic_objects="\$(GENOBJS)"
2083+ ;;
2084+ *) cf_compile_generics=
2085+ cf_generic_objects=
2086+ ;;
2087+esac
2088+])
2089+dnl ---------------------------------------------------------------------------
2090+dnl CF_GNU_SOURCE version: 3 updated: 2000/10/29 23:30:53
2091+dnl -------------
2092+dnl Check if we must define _GNU_SOURCE to get a reasonable value for
2093+dnl _XOPEN_SOURCE, upon which many POSIX definitions depend. This is a defect
2094+dnl (or misfeature) of glibc2, which breaks portability of many applications,
2095+dnl since it is interwoven with GNU extensions.
2096+dnl
2097+dnl Well, yes we could work around it...
2098+AC_DEFUN([CF_GNU_SOURCE],
2099+[
2100+AC_CACHE_CHECK(if we must define _GNU_SOURCE,cf_cv_gnu_source,[
2101+AC_TRY_COMPILE([#include <sys/types.h>],[
2102+#ifndef _XOPEN_SOURCE
2103+make an error
2104+#endif],
2105+ [cf_cv_gnu_source=no],
2106+ [cf_save="$CPPFLAGS"
2107+ CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
2108+ AC_TRY_COMPILE([#include <sys/types.h>],[
2109+#ifdef _XOPEN_SOURCE
2110+make an error
2111+#endif],
2112+ [cf_cv_gnu_source=no],
2113+ [cf_cv_gnu_source=yes])
2114+ CPPFLAGS="$cf_save"
2115+ ])
2116+])
2117+test "$cf_cv_gnu_source" = yes && CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
2118+])dnl
2119+dnl ---------------------------------------------------------------------------
2120+dnl CF_GPP_LIBRARY version: 8 updated: 2003/02/02 01:41:46
2121+dnl --------------
2122+dnl If we're trying to use g++, test if libg++ is installed (a rather common
2123+dnl problem :-). If we have the compiler but no library, we'll be able to
2124+dnl configure, but won't be able to build the c++ demo program.
2125+AC_DEFUN([CF_GPP_LIBRARY],
2126+[
2127+cf_cxx_library=unknown
2128+case $cf_cv_system_name in #(vi
2129+os2*) #(vi
2130+ cf_gpp_libname=gpp
2131+ ;;
2132+*)
2133+ cf_gpp_libname=g++
2134+ ;;
2135+esac
2136+if test "$GXX" = yes; then
2137+ AC_MSG_CHECKING([for lib$cf_gpp_libname])
2138+ cf_save="$LIBS"
2139+ LIBS="$LIBS -l$cf_gpp_libname"
2140+ AC_TRY_LINK([
2141+#include <$cf_gpp_libname/builtin.h>
2142+ ],
2143+ [two_arg_error_handler_t foo2 = lib_error_handler],
2144+ [cf_cxx_library=yes
2145+ CXXLIBS="$CXXLIBS -l$cf_gpp_libname"
2146+ if test "$cf_gpp_libname" = cpp ; then
2147+ AC_DEFINE(HAVE_GPP_BUILTIN_H)
2148+ else
2149+ AC_DEFINE(HAVE_GXX_BUILTIN_H)
2150+ fi],
2151+ [AC_TRY_LINK([
2152+#include <builtin.h>
2153+ ],
2154+ [two_arg_error_handler_t foo2 = lib_error_handler],
2155+ [cf_cxx_library=yes
2156+ CXXLIBS="$CXXLIBS -l$cf_gpp_libname"
2157+ AC_DEFINE(HAVE_BUILTIN_H)],
2158+ [cf_cxx_library=no])])
2159+ LIBS="$cf_save"
2160+ AC_MSG_RESULT($cf_cxx_library)
2161+fi
2162+])dnl
2163+dnl ---------------------------------------------------------------------------
2164+dnl CF_GXX_VERSION version: 3 updated: 2003/09/06 19:16:21
2165+dnl --------------
2166+dnl Check for version of g++
2167+AC_DEFUN([CF_GXX_VERSION],[
2168+AC_REQUIRE([AC_PROG_CPP])
2169+GXX_VERSION=none
2170+if test "$GXX" = yes; then
2171+ AC_MSG_CHECKING(version of g++)
2172+ GXX_VERSION="`${CXX-g++} --version|sed -e '2,$d'`"
2173+ AC_MSG_RESULT($GXX_VERSION)
2174+fi
2175+])dnl
2176+dnl ---------------------------------------------------------------------------
2177+dnl CF_INCLUDE_DIRS version: 4 updated: 2002/12/01 00:12:15
2178+dnl ---------------
2179+dnl Construct the list of include-options according to whether we're building
2180+dnl in the source directory or using '--srcdir=DIR' option. If we're building
2181+dnl with gcc, don't append the includedir if it happens to be /usr/include,
2182+dnl since that usually breaks gcc's shadow-includes.
2183+AC_DEFUN([CF_INCLUDE_DIRS],
2184+[
2185+CPPFLAGS="-I. -I../include $CPPFLAGS"
2186+if test "$srcdir" != "."; then
2187+ CPPFLAGS="-I\$(srcdir)/../include $CPPFLAGS"
2188+fi
2189+if test "$GCC" != yes; then
2190+ CPPFLAGS="$CPPFLAGS -I\$(includedir)"
2191+elif test "$includedir" != "/usr/include"; then
2192+ if test "$includedir" = '${prefix}/include' ; then
2193+ if test $prefix != /usr ; then
2194+ CPPFLAGS="$CPPFLAGS -I\$(includedir)"
2195+ fi
2196+ else
2197+ CPPFLAGS="$CPPFLAGS -I\$(includedir)"
2198+ fi
2199+fi
2200+AC_SUBST(CPPFLAGS)
2201+])dnl
2202+dnl ---------------------------------------------------------------------------
2203+dnl CF_ISASCII version: 3 updated: 2000/08/12 23:18:52
2204+dnl ----------
2205+dnl Check if we have either a function or macro for 'isascii()'.
2206+AC_DEFUN([CF_ISASCII],
2207+[
2208+AC_MSG_CHECKING(for isascii)
2209+AC_CACHE_VAL(cf_cv_have_isascii,[
2210+ AC_TRY_LINK([#include <ctype.h>],[int x = isascii(' ')],
2211+ [cf_cv_have_isascii=yes],
2212+ [cf_cv_have_isascii=no])
2213+])dnl
2214+AC_MSG_RESULT($cf_cv_have_isascii)
2215+test "$cf_cv_have_isascii" = yes && AC_DEFINE(HAVE_ISASCII)
2216+])dnl
2217+dnl ---------------------------------------------------------------------------
2218+dnl CF_LIBUTF8 version: 2 updated: 2002/01/19 22:51:32
2219+dnl ----------
2220+dnl Check for libutf8
2221+AC_DEFUN([CF_LIBUTF8],
2222+[
2223+AC_CACHE_CHECK(for putwc in libutf8,cf_cv_libutf8,[
2224+ cf_save_LIBS="$LIBS"
2225+ LIBS="-lutf8 $LIBS"
2226+AC_TRY_LINK([
2227+#include <libutf8.h>],[putwc(0,0);],
2228+ [cf_cv_libutf8=yes],
2229+ [cf_cv_libutf8=no])
2230+ LIBS="$cf_save_LIBS"
2231+])
2232+
2233+if test "$cf_cv_libutf8" = yes ; then
2234+ AC_DEFINE(HAVE_LIBUTF8_H)
2235+ LIBS="-lutf8 $LIBS"
2236+fi
2237+])dnl
2238+dnl ---------------------------------------------------------------------------
2239+dnl CF_LIB_PREFIX version: 7 updated: 2001/01/12 01:23:48
2240+dnl -------------
2241+dnl Compute the library-prefix for the given host system
2242+dnl $1 = variable to set
2243+AC_DEFUN([CF_LIB_PREFIX],
2244+[
2245+ case $cf_cv_system_name in
2246+ OS/2*) LIB_PREFIX='' ;;
2247+ os2*) LIB_PREFIX='' ;;
2248+ *) LIB_PREFIX='lib' ;;
2249+ esac
2250+ifelse($1,,,[$1=$LIB_PREFIX])
2251+ AC_SUBST(LIB_PREFIX)
2252+])dnl
2253+dnl ---------------------------------------------------------------------------
2254+dnl CF_LIB_RULES version: 30 updated: 2004/01/10 15:50:50
2255+dnl ------------
2256+dnl Append definitions and rules for the given models to the subdirectory
2257+dnl Makefiles, and the recursion rule for the top-level Makefile. If the
2258+dnl subdirectory is a library-source directory, modify the LIBRARIES list in
2259+dnl the corresponding makefile to list the models that we'll generate.
2260+dnl
2261+dnl For shared libraries, make a list of symbolic links to construct when
2262+dnl generating each library. The convention used for Linux is the simplest
2263+dnl one:
2264+dnl lib<name>.so ->
2265+dnl lib<name>.so.<major> ->
2266+dnl lib<name>.so.<maj>.<minor>
2267+AC_DEFUN([CF_LIB_RULES],
2268+[
2269+CF_LIB_PREFIX(cf_prefix)
2270+AC_REQUIRE([CF_SUBST_NCURSES_VERSION])
2271+for cf_dir in $SRC_SUBDIRS
2272+do
2273+ if test -f $srcdir/$cf_dir/modules; then
2274+
2275+ IMPORT_LIB=
2276+ SHARED_LIB=
2277+ LIBS_TO_MAKE=
2278+ for cf_item in $CF_LIST_MODELS
2279+ do
2280+ CF_LIB_SUFFIX($cf_item,cf_suffix)
2281+ if test $cf_item = shared ; then
2282+ if test "$cf_cv_do_symlinks" = yes ; then
2283+ case "$cf_cv_shlib_version" in #(vi
2284+ rel) #(vi
2285+ case "$cf_cv_system_name" in #(vi
2286+ darwin*) cf_suffix='.$(REL_VERSION)'"$cf_suffix" ;; #(vi
2287+ *) cf_suffix="$cf_suffix"'.$(REL_VERSION)' ;;
2288+ esac
2289+ ;;
2290+ abi)
2291+ case "$cf_cv_system_name" in #(vi
2292+ darwin*) cf_suffix='.$(ABI_VERSION)'"$cf_suffix" ;; #(vi
2293+ *) cf_suffix="$cf_suffix"'.$(ABI_VERSION)' ;;
2294+ esac
2295+ ;;
2296+ esac
2297+ fi
2298+ # cygwin needs import library, and has unique naming convention
2299+ # use autodetected ${cf_prefix} for import lib and static lib, but
2300+ # use 'cyg' prefix for shared lib.
2301+ if test $cf_cv_shlib_version = cygdll ; then
2302+ SHARED_LIB="../lib/cyg${cf_dir}\$(ABI_VERSION).dll"
2303+ IMPORT_LIB="../lib/${cf_prefix}${cf_dir}.dll.a"
2304+ LIBS_TO_MAKE="$LIBS_TO_MAKE \$(SHARED_LIB) \$(IMPORT_LIB)"
2305+ continue
2306+ fi
2307+ fi
2308+ LIBS_TO_MAKE="$LIBS_TO_MAKE ../lib/${cf_prefix}${cf_dir}${cf_suffix}"
2309+ done
2310+
2311+ if test $cf_dir = ncurses ; then
2312+ cf_subsets="$LIB_SUBSETS"
2313+ cf_termlib=`echo "$cf_subsets" |sed -e 's/ .*$//'`
2314+ if test "$cf_termlib" != "$cf_subsets" ; then
2315+ cf_item=`echo $LIBS_TO_MAKE |sed -e s%$LIB_NAME%$TINFO_NAME%g`
2316+ LIBS_TO_MAKE="$cf_item $LIBS_TO_MAKE"
2317+ fi
2318+ else
2319+ cf_subsets=`echo "$LIB_SUBSETS" | sed -e 's/^termlib.* //'`
2320+ fi
2321+
2322+ sed -e "s%@LIBS_TO_MAKE@%$LIBS_TO_MAKE%" \
2323+ -e "s%@IMPORT_LIB@%$IMPORT_LIB%" \
2324+ -e "s%@SHARED_LIB@%$SHARED_LIB%" \
2325+ $cf_dir/Makefile >$cf_dir/Makefile.out
2326+ mv $cf_dir/Makefile.out $cf_dir/Makefile
2327+
2328+ $AWK -f $srcdir/mk-0th.awk \
2329+ libname="${cf_dir}${LIB_SUFFIX}" subsets="$LIB_SUBSETS" \
2330+ $srcdir/$cf_dir/modules >>$cf_dir/Makefile
2331+
2332+ for cf_subset in $cf_subsets
2333+ do
2334+ cf_subdirs=
2335+ for cf_item in $CF_LIST_MODELS
2336+ do
2337+ echo "Appending rules for ${cf_item} model (${cf_dir}: ${cf_subset})"
2338+ CF_UPPER(CF_ITEM,$cf_item)
2339+ CF_LIB_SUFFIX($cf_item,cf_suffix)
2340+ CF_OBJ_SUBDIR($cf_item,cf_subdir)
2341+
2342+ # These dependencies really are for development, not
2343+ # builds, but they are useful in porting, too.
2344+ cf_depend="../include/ncurses_cfg.h"
2345+ if test "$srcdir" = "."; then
2346+ cf_reldir="."
2347+ else
2348+ cf_reldir="\$(srcdir)"
2349+ fi
2350+
2351+ if test -f $srcdir/$cf_dir/$cf_dir.priv.h; then
2352+ cf_depend="$cf_depend $cf_reldir/$cf_dir.priv.h"
2353+ elif test -f $srcdir/$cf_dir/curses.priv.h; then
2354+ cf_depend="$cf_depend $cf_reldir/curses.priv.h"
2355+ fi
2356+
2357+ $AWK -f $srcdir/mk-1st.awk \
2358+ name=$cf_dir \
2359+ traces=$LIB_TRACING \
2360+ MODEL=$CF_ITEM \
2361+ model=$cf_subdir \
2362+ prefix=$cf_prefix \
2363+ suffix=$cf_suffix \
2364+ subset=$cf_subset \
2365+ ShlibVer=$cf_cv_shlib_version \
2366+ ShlibVerInfix=$cf_cv_shlib_version_infix \
2367+ DoLinks=$cf_cv_do_symlinks \
2368+ rmSoLocs=$cf_cv_rm_so_locs \
2369+ ldconfig="$LDCONFIG" \
2370+ overwrite=$WITH_OVERWRITE \
2371+ depend="$cf_depend" \
2372+ host="$host" \
2373+ $srcdir/$cf_dir/modules >>$cf_dir/Makefile
2374+ for cf_subdir2 in $cf_subdirs lib
2375+ do
2376+ test $cf_subdir = $cf_subdir2 && break
2377+ done
2378+ test "${cf_subset}.${cf_subdir2}" != "${cf_subset}.${cf_subdir}" && \
2379+ $AWK -f $srcdir/mk-2nd.awk \
2380+ name=$cf_dir \
2381+ traces=$LIB_TRACING \
2382+ MODEL=$CF_ITEM \
2383+ model=$cf_subdir \
2384+ subset=$cf_subset \
2385+ srcdir=$srcdir \
2386+ echo=$WITH_ECHO \
2387+ $srcdir/$cf_dir/modules >>$cf_dir/Makefile
2388+ cf_subdirs="$cf_subdirs $cf_subdir"
2389+ done
2390+ done
2391+ fi
2392+
2393+ echo ' cd '$cf_dir' && $(MAKE) $(CF_MFLAGS) [$]@' >>Makefile
2394+done
2395+
2396+for cf_dir in $SRC_SUBDIRS
2397+do
2398+ if test -f $cf_dir/Makefile ; then
2399+ case "$cf_dir" in
2400+ Ada95) #(vi
2401+ echo 'libs \' >> Makefile
2402+ echo 'install.libs \' >> Makefile
2403+ echo 'uninstall.libs ::' >> Makefile
2404+ echo ' cd '$cf_dir' && $(MAKE) $(CF_MFLAGS) [$]@' >> Makefile
2405+ ;;
2406+ esac
2407+ fi
2408+
2409+ if test -f $srcdir/$cf_dir/modules; then
2410+ echo >> Makefile
2411+ if test -f $srcdir/$cf_dir/headers; then
2412+cat >> Makefile <<CF_EOF
2413+install.includes \\
2414+uninstall.includes \\
2415+CF_EOF
2416+ fi
2417+if test "$cf_dir" != "c++" ; then
2418+echo 'lint \' >> Makefile
2419+fi
2420+cat >> Makefile <<CF_EOF
2421+libs \\
2422+lintlib \\
2423+install.libs \\
2424+uninstall.libs \\
2425+install.$cf_dir \\
2426+uninstall.$cf_dir ::
2427+ cd $cf_dir && \$(MAKE) \$(CF_MFLAGS) \[$]@
2428+CF_EOF
2429+ elif test -f $srcdir/$cf_dir/headers; then
2430+cat >> Makefile <<CF_EOF
2431+
2432+libs \\
2433+install.libs \\
2434+uninstall.libs \\
2435+install.includes \\
2436+uninstall.includes ::
2437+ cd $cf_dir && \$(MAKE) \$(CF_MFLAGS) \[$]@
2438+CF_EOF
2439+fi
2440+done
2441+
2442+cat >> Makefile <<CF_EOF
2443+
2444+install.data \\
2445+uninstall.data ::
2446+$MAKE_TERMINFO cd misc && \$(MAKE) \$(CF_MFLAGS) \[$]@
2447+
2448+install.man \\
2449+uninstall.man ::
2450+ cd man && \$(MAKE) \$(CF_MFLAGS) \[$]@
2451+
2452+distclean ::
2453+ rm -f config.cache config.log config.status Makefile include/ncurses_cfg.h
2454+ rm -f headers.sh headers.sed
2455+ rm -rf \$(DIRS_TO_MAKE)
2456+CF_EOF
2457+
2458+# Special case: tack's manpage lives in its own directory.
2459+if test -d tack ; then
2460+if test -f $srcdir/$tack.h; then
2461+cat >> Makefile <<CF_EOF
2462+
2463+install.man \\
2464+uninstall.man ::
2465+ cd tack && \$(MAKE) \$(CF_MFLAGS) \[$]@
2466+CF_EOF
2467+fi
2468+fi
2469+
2470+dnl If we're installing into a subdirectory of /usr/include, etc., we should
2471+dnl prepend the subdirectory's name to the "#include" paths. It won't hurt
2472+dnl anything, and will make it more standardized. It's awkward to decide this
2473+dnl at configuration because of quoting, so we'll simply make all headers
2474+dnl installed via a script that can do the right thing.
2475+
2476+rm -f headers.sed headers.sh
2477+
2478+dnl ( generating this script makes the makefiles a little tidier :-)
2479+echo creating headers.sh
2480+cat >headers.sh <<CF_EOF
2481+#! /bin/sh
2482+# This shell script is generated by the 'configure' script. It is invoked in a
2483+# subdirectory of the build tree. It generates a sed-script in the parent
2484+# directory that is used to adjust includes for header files that reside in a
2485+# subdirectory of /usr/include, etc.
2486+PRG=""
2487+while test \[$]# != 3
2488+do
2489+PRG="\$PRG \[$]1"; shift
2490+done
2491+DST=\[$]1
2492+REF=\[$]2
2493+SRC=\[$]3
2494+TMPSRC=\${TMPDIR-/tmp}/\`basename \$SRC\`\$\$
2495+TMPSED=\${TMPDIR-/tmp}/headers.sed\$\$
2496+echo installing \$SRC in \$DST
2497+CF_EOF
2498+if test $WITH_CURSES_H = yes; then
2499+ cat >>headers.sh <<CF_EOF
2500+case \$DST in
2501+/*/include/*)
2502+ END=\`basename \$DST\`
2503+ for i in \`cat \$REF/../*/headers |fgrep -v "#"\`
2504+ do
2505+ NAME=\`basename \$i\`
2506+ echo "s/<\$NAME>/<\$END\/\$NAME>/" >> \$TMPSED
2507+ done
2508+ ;;
2509+*)
2510+ echo "" >> \$TMPSED
2511+ ;;
2512+esac
2513+CF_EOF
2514+else
2515+ cat >>headers.sh <<CF_EOF
2516+case \$DST in
2517+/*/include/*)
2518+ END=\`basename \$DST\`
2519+ for i in \`cat \$REF/../*/headers |fgrep -v "#"\`
2520+ do
2521+ NAME=\`basename \$i\`
2522+ if test "\$NAME" = "curses.h"
2523+ then
2524+ echo "s/<curses.h>/<ncurses.h>/" >> \$TMPSED
2525+ NAME=ncurses.h
2526+ fi
2527+ echo "s/<\$NAME>/<\$END\/\$NAME>/" >> \$TMPSED
2528+ done
2529+ ;;
2530+*)
2531+ echo "s/<curses.h>/<ncurses.h>/" >> \$TMPSED
2532+ ;;
2533+esac
2534+CF_EOF
2535+fi
2536+cat >>headers.sh <<CF_EOF
2537+rm -f \$TMPSRC
2538+sed -f \$TMPSED \$SRC > \$TMPSRC
2539+NAME=\`basename \$SRC\`
2540+CF_EOF
2541+if test $WITH_CURSES_H != yes; then
2542+ cat >>headers.sh <<CF_EOF
2543+test "\$NAME" = "curses.h" && NAME=ncurses.h
2544+CF_EOF
2545+fi
2546+cat >>headers.sh <<CF_EOF
2547+# Just in case someone gzip'd manpages, remove the conflicting copy.
2548+test -f \$DST/\$NAME.gz && rm -f \$DST/\$NAME.gz
2549+
2550+eval \$PRG \$TMPSRC \$DST/\$NAME
2551+rm -f \$TMPSRC \$TMPSED
2552+CF_EOF
2553+
2554+chmod 0755 headers.sh
2555+
2556+for cf_dir in $SRC_SUBDIRS
2557+do
2558+ if test -f $srcdir/$cf_dir/headers; then
2559+ cat >>$cf_dir/Makefile <<CF_EOF
2560+\$(DESTDIR)\$(includedir) :
2561+ sh \$(srcdir)/../mkinstalldirs \[$]@
2562+
2563+install \\
2564+install.libs \\
2565+install.includes :: \$(AUTO_SRC) \$(DESTDIR)\$(includedir) \\
2566+CF_EOF
2567+ j=""
2568+ for i in `cat $srcdir/$cf_dir/headers |fgrep -v "#"`
2569+ do
2570+ test -n "$j" && echo " $j \\" >>$cf_dir/Makefile
2571+ j=$i
2572+ done
2573+ echo " $j" >>$cf_dir/Makefile
2574+ for i in `cat $srcdir/$cf_dir/headers |fgrep -v "#"`
2575+ do
2576+ echo " @ (cd \$(DESTDIR)\$(includedir) && rm -f `basename $i`) ; ../headers.sh \$(INSTALL_DATA) \$(DESTDIR)\$(includedir) \$(srcdir) $i" >>$cf_dir/Makefile
2577+ 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
2578+ done
2579+
2580+ cat >>$cf_dir/Makefile <<CF_EOF
2581+
2582+uninstall \\
2583+uninstall.libs \\
2584+uninstall.includes ::
2585+CF_EOF
2586+ for i in `cat $srcdir/$cf_dir/headers |fgrep -v "#"`
2587+ do
2588+ i=`basename $i`
2589+ echo " -@ (cd \$(DESTDIR)\$(includedir) && rm -f $i)" >>$cf_dir/Makefile
2590+ test $i = curses.h && echo " -@ (cd \$(DESTDIR)\$(includedir) && rm -f ncurses.h)" >>$cf_dir/Makefile
2591+ done
2592+ fi
2593+
2594+ if test -f $srcdir/$cf_dir/modules; then
2595+ if test "$cf_dir" != "c++" ; then
2596+ cat >>$cf_dir/Makefile <<"CF_EOF"
2597+depend : $(AUTO_SRC)
2598+ makedepend -- $(CPPFLAGS) -- $(C_SRC)
2599+
2600+# DO NOT DELETE THIS LINE -- make depend depends on it.
2601+CF_EOF
2602+ fi
2603+ fi
2604+done
2605+
2606+])dnl
2607+dnl ---------------------------------------------------------------------------
2608+dnl CF_LIB_SUFFIX version: 13 updated: 2003/11/01 16:09:07
2609+dnl -------------
2610+dnl Compute the library file-suffix from the given model name
2611+dnl $1 = model name
2612+dnl $2 = variable to set
2613+dnl The variable $LIB_SUFFIX, if set, prepends the variable to set.
2614+AC_DEFUN([CF_LIB_SUFFIX],
2615+[
2616+ AC_REQUIRE([CF_SUBST_NCURSES_VERSION])
2617+ case $1 in
2618+ libtool) $2='.la' ;;
2619+ normal) $2='.a' ;;
2620+ debug) $2='_g.a' ;;
2621+ profile) $2='_p.a' ;;
2622+ shared)
2623+ case $cf_cv_system_name in
2624+ cygwin*) $2='.dll' ;;
2625+ darwin*) $2='.dylib' ;;
2626+ hpux*)
2627+ case $target in
2628+ ia64*) $2='.so' ;;
2629+ *) $2='.sl' ;;
2630+ esac
2631+ ;;
2632+ *) $2='.so' ;;
2633+ esac
2634+ esac
2635+ test -n "$LIB_SUFFIX" && $2="${LIB_SUFFIX}[$]{$2}"
2636+])dnl
2637+dnl ---------------------------------------------------------------------------
2638+dnl CF_LIB_TYPE version: 4 updated: 2000/10/20 22:57:49
2639+dnl -----------
2640+dnl Compute the string to append to -library from the given model name
2641+dnl $1 = model name
2642+dnl $2 = variable to set
2643+dnl The variable $LIB_SUFFIX, if set, prepends the variable to set.
2644+AC_DEFUN([CF_LIB_TYPE],
2645+[
2646+ case $1 in
2647+ libtool) $2='' ;;
2648+ normal) $2='' ;;
2649+ debug) $2='_g' ;;
2650+ profile) $2='_p' ;;
2651+ shared) $2='' ;;
2652+ esac
2653+ test -n "$LIB_SUFFIX" && $2="${LIB_SUFFIX}[$]{$2}"
2654+])dnl
2655+dnl ---------------------------------------------------------------------------
2656+dnl CF_LINK_DATAONLY version: 6 updated: 2003/02/02 01:41:46
2657+dnl ----------------
2658+dnl Some systems have a non-ANSI linker that doesn't pull in modules that have
2659+dnl only data (i.e., no functions), for example NeXT. On those systems we'll
2660+dnl have to provide wrappers for global tables to ensure they're linked
2661+dnl properly.
2662+AC_DEFUN([CF_LINK_DATAONLY],
2663+[
2664+AC_MSG_CHECKING([if data-only library module links])
2665+AC_CACHE_VAL(cf_cv_link_dataonly,[
2666+ rm -f conftest.a
2667+ cat >conftest.$ac_ext <<EOF
2668+#line __oline__ "configure"
2669+int testdata[[3]] = { 123, 456, 789 };
2670+EOF
2671+ if AC_TRY_EVAL(ac_compile) ; then
2672+ mv conftest.o data.o && \
2673+ ( $AR $AR_OPTS conftest.a data.o ) 2>&AC_FD_CC 1>/dev/null
2674+ fi
2675+ rm -f conftest.$ac_ext data.o
2676+ cat >conftest.$ac_ext <<EOF
2677+#line __oline__ "configure"
2678+int testfunc()
2679+{
2680+#if defined(NeXT)
2681+ exit(1); /* I'm told this linker is broken */
2682+#else
2683+ extern int testdata[[3]];
2684+ return testdata[[0]] == 123
2685+ && testdata[[1]] == 456
2686+ && testdata[[2]] == 789;
2687+#endif
2688+}
2689+EOF
2690+ if AC_TRY_EVAL(ac_compile); then
2691+ mv conftest.o func.o && \
2692+ ( $AR $AR_OPTS conftest.a func.o ) 2>&AC_FD_CC 1>/dev/null
2693+ fi
2694+ rm -f conftest.$ac_ext func.o
2695+ ( eval $RANLIB conftest.a ) 2>&AC_FD_CC >/dev/null
2696+ cf_saveLIBS="$LIBS"
2697+ LIBS="conftest.a $LIBS"
2698+ AC_TRY_RUN([
2699+ int main()
2700+ {
2701+ extern int testfunc();
2702+ exit (!testfunc());
2703+ }
2704+ ],
2705+ [cf_cv_link_dataonly=yes],
2706+ [cf_cv_link_dataonly=no],
2707+ [cf_cv_link_dataonly=unknown])
2708+ LIBS="$cf_saveLIBS"
2709+ ])
2710+AC_MSG_RESULT($cf_cv_link_dataonly)
2711+
2712+if test "$cf_cv_link_dataonly" = no ; then
2713+ AC_DEFINE(BROKEN_LINKER)
2714+ BROKEN_LINKER=1
2715+fi
2716+
2717+])dnl
2718+dnl ---------------------------------------------------------------------------
2719+dnl CF_LINK_FUNCS version: 5 updated: 2003/02/02 01:41:46
2720+dnl -------------
2721+dnl Most Unix systems have both link and symlink, a few don't have symlink.
2722+dnl A few non-Unix systems implement symlink, but not link.
2723+dnl A few non-systems implement neither (or have nonfunctional versions).
2724+AC_DEFUN([CF_LINK_FUNCS],
2725+[
2726+AC_CHECK_FUNCS( \
2727+ remove \
2728+ unlink )
2729+
2730+if test "$cross_compiling" = yes ; then
2731+ AC_CHECK_FUNCS( \
2732+ link \
2733+ symlink )
2734+else
2735+ AC_CACHE_CHECK(if link/symlink functions work,cf_cv_link_funcs,[
2736+ cf_cv_link_funcs=
2737+ for cf_func in link symlink ; do
2738+ AC_TRY_RUN([
2739+#include <sys/types.h>
2740+#include <sys/stat.h>
2741+#ifdef HAVE_UNISTD_H
2742+#include <unistd.h>
2743+#endif
2744+int main()
2745+{
2746+ int fail = 0;
2747+ char *src = "config.log";
2748+ char *dst = "conftest.chk";
2749+ struct stat src_sb;
2750+ struct stat dst_sb;
2751+
2752+ stat(src, &src_sb);
2753+ fail = ($cf_func("config.log", "conftest.chk") < 0)
2754+ || (stat(dst, &dst_sb) < 0)
2755+ || (dst_sb.st_mtime != src_sb.st_mtime);
2756+#ifdef HAVE_UNLINK
2757+ unlink(dst);
2758+#else
2759+ remove(dst);
2760+#endif
2761+ exit (fail);
2762+}
2763+ ],[
2764+ cf_cv_link_funcs="$cf_cv_link_funcs $cf_func"
2765+ eval 'ac_cv_func_'$cf_func'=yes'],[
2766+ eval 'ac_cv_func_'$cf_func'=no'],[
2767+ eval 'ac_cv_func_'$cf_func'=error'])
2768+ done
2769+ test -z "$cf_cv_link_funcs" && cf_cv_link_funcs=no
2770+ ])
2771+ test "$ac_cv_func_link" = yes && AC_DEFINE(HAVE_LINK)
2772+ test "$ac_cv_func_symlink" = yes && AC_DEFINE(HAVE_SYMLINK)
2773+fi
2774+])dnl
2775+dnl ---------------------------------------------------------------------------
2776+dnl CF_MAKEFLAGS version: 9 updated: 2001/12/30 18:17:27
2777+dnl ------------
2778+dnl Some 'make' programs support $(MAKEFLAGS), some $(MFLAGS), to pass 'make'
2779+dnl options to lower-levels. It's very useful for "make -n" -- if we have it.
2780+dnl (GNU 'make' does both, something POSIX 'make', which happens to make the
2781+dnl $(MAKEFLAGS) variable incompatible because it adds the assignments :-)
2782+AC_DEFUN([CF_MAKEFLAGS],
2783+[
2784+AC_CACHE_CHECK(for makeflags variable, cf_cv_makeflags,[
2785+ cf_cv_makeflags=''
2786+ for cf_option in '-$(MAKEFLAGS)' '$(MFLAGS)'
2787+ do
2788+ cat >cf_makeflags.tmp <<CF_EOF
2789+SHELL = /bin/sh
2790+all :
2791+ @ echo '.$cf_option'
2792+CF_EOF
2793+ cf_result=`${MAKE-make} -k -f cf_makeflags.tmp 2>/dev/null`
2794+ case "$cf_result" in
2795+ .*k)
2796+ cf_result=`${MAKE-make} -k -f cf_makeflags.tmp CC=cc 2>/dev/null`
2797+ case "$cf_result" in
2798+ .*CC=*) cf_cv_makeflags=
2799+ ;;
2800+ *) cf_cv_makeflags=$cf_option
2801+ ;;
2802+ esac
2803+ break
2804+ ;;
2805+ *) echo no match "$cf_result"
2806+ ;;
2807+ esac
2808+ done
2809+ rm -f cf_makeflags.tmp
2810+])
2811+
2812+AC_SUBST(cf_cv_makeflags)
2813+])dnl
2814+dnl ---------------------------------------------------------------------------
2815+dnl CF_MAKE_TAGS version: 2 updated: 2000/10/04 09:18:40
2816+dnl ------------
2817+dnl Generate tags/TAGS targets for makefiles. Do not generate TAGS if we have
2818+dnl a monocase filesystem.
2819+AC_DEFUN([CF_MAKE_TAGS],[
2820+AC_REQUIRE([CF_MIXEDCASE_FILENAMES])
2821+AC_CHECK_PROG(MAKE_LOWER_TAGS, ctags, yes, no)
2822+
2823+if test "$cf_cv_mixedcase" = yes ; then
2824+ AC_CHECK_PROG(MAKE_UPPER_TAGS, etags, yes, no)
2825+else
2826+ MAKE_UPPER_TAGS=no
2827+fi
2828+
2829+if test "$MAKE_UPPER_TAGS" = yes ; then
2830+ MAKE_UPPER_TAGS=
2831+else
2832+ MAKE_UPPER_TAGS="#"
2833+fi
2834+AC_SUBST(MAKE_UPPER_TAGS)
2835+
2836+if test "$MAKE_LOWER_TAGS" = yes ; then
2837+ MAKE_LOWER_TAGS=
2838+else
2839+ MAKE_LOWER_TAGS="#"
2840+fi
2841+AC_SUBST(MAKE_LOWER_TAGS)
2842+])dnl
2843+dnl ---------------------------------------------------------------------------
2844+dnl CF_MANPAGE_FORMAT version: 7 updated: 2003/12/20 19:30:34
2845+dnl -----------------
2846+dnl Option to allow user to override automatic configuration of manpage format.
2847+dnl There are several special cases:
2848+dnl
2849+dnl gzip - man checks for, can display gzip'd files
2850+dnl compress - man checks for, can display compressed files
2851+dnl BSDI - files in the cat-directories are suffixed ".0"
2852+dnl formatted - installer should format (put files in cat-directory)
2853+dnl catonly - installer should only format, e.g., for a turnkey system.
2854+dnl
2855+dnl There are other configurations which this macro does not test, e.g., HPUX's
2856+dnl compressed manpages (but uncompressed manpages are fine, and HPUX's naming
2857+dnl convention would not match our use).
2858+AC_DEFUN([CF_MANPAGE_FORMAT],
2859+[
2860+AC_REQUIRE([CF_PATHSEP])
2861+AC_MSG_CHECKING(format of man-pages)
2862+
2863+AC_ARG_WITH(manpage-format,
2864+ [ --with-manpage-format specify manpage-format: gzip/compress/BSDI/normal and
2865+ optionally formatted/catonly, e.g., gzip,formatted],
2866+ [MANPAGE_FORMAT=$withval],
2867+ [MANPAGE_FORMAT=unknown])
2868+
2869+test -z "$MANPAGE_FORMAT" && MANPAGE_FORMAT=unknown
2870+MANPAGE_FORMAT=`echo "$MANPAGE_FORMAT" | sed -e 's/,/ /g'`
2871+
2872+cf_unknown=
2873+
2874+case $MANPAGE_FORMAT in
2875+unknown)
2876+ if test -z "$MANPATH" ; then
2877+ MANPATH="/usr/man:/usr/share/man"
2878+ fi
2879+
2880+ # look for the 'date' man-page (it's most likely to be installed!)
2881+ MANPAGE_FORMAT=
2882+ cf_preform=no
2883+ cf_catonly=yes
2884+ cf_example=date
2885+
2886+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATHSEP}"
2887+ for cf_dir in $MANPATH; do
2888+ test -z "$cf_dir" && cf_dir=/usr/man
2889+ 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
2890+ do
2891+ cf_test=`echo $cf_name | sed -e 's/*//'`
2892+ if test "x$cf_test" = "x$cf_name" ; then
2893+
2894+ case "$cf_name" in
2895+ *.gz) MANPAGE_FORMAT="$MANPAGE_FORMAT gzip";;
2896+ *.Z) MANPAGE_FORMAT="$MANPAGE_FORMAT compress";;
2897+ *.0) MANPAGE_FORMAT="$MANPAGE_FORMAT BSDI";;
2898+ *) MANPAGE_FORMAT="$MANPAGE_FORMAT normal";;
2899+ esac
2900+
2901+ case "$cf_name" in
2902+ $cf_dir/man*)
2903+ cf_catonly=no
2904+ ;;
2905+ $cf_dir/cat*)
2906+ cf_preform=yes
2907+ ;;
2908+ esac
2909+ break
2910+ fi
2911+
2912+ # if we found a match in either man* or cat*, stop looking
2913+ if test -n "$MANPAGE_FORMAT" ; then
2914+ cf_found=no
2915+ test "$cf_preform" = yes && MANPAGE_FORMAT="$MANPAGE_FORMAT formatted"
2916+ test "$cf_catonly" = yes && MANPAGE_FORMAT="$MANPAGE_FORMAT catonly"
2917+ case "$cf_name" in
2918+ $cf_dir/cat*)
2919+ cf_found=yes
2920+ ;;
2921+ esac
2922+ test $cf_found=yes && break
2923+ fi
2924+ done
2925+ # only check the first directory in $MANPATH where we find manpages
2926+ if test -n "$MANPAGE_FORMAT" ; then
2927+ break
2928+ fi
2929+ done
2930+ # if we did not find the example, just assume it is normal
2931+ test -z "$MANPAGE_FORMAT" && MANPAGE_FORMAT=normal
2932+ IFS="$ac_save_ifs"
2933+ ;;
2934+*)
2935+ for cf_option in $MANPAGE_FORMAT; do
2936+ case $cf_option in #(vi
2937+ gzip|compress|BSDI|normal|formatted|catonly)
2938+ ;;
2939+ *)
2940+ cf_unknown="$cf_unknown $cf_option"
2941+ ;;
2942+ esac
2943+ done
2944+ ;;
2945+esac
2946+
2947+AC_MSG_RESULT($MANPAGE_FORMAT)
2948+if test -n "$cf_unknown" ; then
2949+ AC_MSG_WARN(Unexpected manpage-format $cf_unknown)
2950+fi
2951+])dnl
2952+dnl ---------------------------------------------------------------------------
2953+dnl CF_MANPAGE_RENAMES version: 6 updated: 2002/01/19 22:51:32
2954+dnl ------------------
2955+dnl The Debian people have their own naming convention for manpages. This
2956+dnl option lets us override the name of the file containing renaming, or
2957+dnl disable it altogether.
2958+AC_DEFUN([CF_MANPAGE_RENAMES],
2959+[
2960+AC_MSG_CHECKING(for manpage renaming)
2961+
2962+AC_ARG_WITH(manpage-renames,
2963+ [ --with-manpage-renames specify manpage-renaming],
2964+ [MANPAGE_RENAMES=$withval],
2965+ [MANPAGE_RENAMES=yes])
2966+
2967+case ".$MANPAGE_RENAMES" in #(vi
2968+.no) #(vi
2969+ ;;
2970+.|.yes)
2971+ # Debian 'man' program?
2972+ if test -f /etc/debian_version ; then
2973+ MANPAGE_RENAMES=`cd $srcdir && pwd`/man/man_db.renames
2974+ else
2975+ MANPAGE_RENAMES=no
2976+ fi
2977+ ;;
2978+esac
2979+
2980+if test "$MANPAGE_RENAMES" != no ; then
2981+ if test -f $srcdir/man/$MANPAGE_RENAMES ; then
2982+ MANPAGE_RENAMES=`cd $srcdir/man && pwd`/$MANPAGE_RENAMES
2983+ elif test ! -f $MANPAGE_RENAMES ; then
2984+ AC_MSG_ERROR(not a filename: $MANPAGE_RENAMES)
2985+ fi
2986+
2987+ test ! -d man && mkdir man
2988+
2989+ # Construct a sed-script to perform renaming within man-pages
2990+ if test -n "$MANPAGE_RENAMES" ; then
2991+ test ! -d man && mkdir man
2992+ sh $srcdir/man/make_sed.sh $MANPAGE_RENAMES >man/edit_man.sed
2993+ fi
2994+fi
2995+
2996+AC_MSG_RESULT($MANPAGE_RENAMES)
2997+AC_SUBST(MANPAGE_RENAMES)
2998+])dnl
2999+dnl ---------------------------------------------------------------------------
3000+dnl CF_MANPAGE_SYMLINKS version: 4 updated: 2003/12/13 18:01:58
3001+dnl -------------------
3002+dnl Some people expect each tool to make all aliases for manpages in the
3003+dnl man-directory. This accommodates the older, less-capable implementations
3004+dnl of 'man', and is optional.
3005+AC_DEFUN([CF_MANPAGE_SYMLINKS],
3006+[
3007+AC_MSG_CHECKING(if manpage aliases will be installed)
3008+
3009+AC_ARG_WITH(manpage-aliases,
3010+ [ --with-manpage-aliases specify manpage-aliases using .so],
3011+ [MANPAGE_ALIASES=$withval],
3012+ [MANPAGE_ALIASES=yes])
3013+
3014+AC_MSG_RESULT($MANPAGE_ALIASES)
3015+
3016+if test "$LN_S" = "ln -s"; then
3017+ cf_use_symlinks=yes
3018+else
3019+ cf_use_symlinks=no
3020+fi
3021+
3022+MANPAGE_SYMLINKS=no
3023+if test "$MANPAGE_ALIASES" = yes ; then
3024+AC_MSG_CHECKING(if manpage symlinks should be used)
3025+
3026+AC_ARG_WITH(manpage-symlinks,
3027+ [ --with-manpage-symlinks specify manpage-aliases using symlinks],
3028+ [MANPAGE_SYMLINKS=$withval],
3029+ [MANPAGE_SYMLINKS=$cf_use_symlinks])
3030+
3031+if test "$$cf_use_symlinks" = no; then
3032+if test "$MANPAGE_SYMLINKS" = yes ; then
3033+ AC_MSG_WARN(cannot make symlinks, will use .so files)
3034+ MANPAGE_SYMLINKS=no
3035+fi
3036+fi
3037+
3038+AC_MSG_RESULT($MANPAGE_SYMLINKS)
3039+fi
3040+
3041+])dnl
3042+dnl ---------------------------------------------------------------------------
3043+dnl CF_MANPAGE_TBL version: 3 updated: 2002/01/19 22:51:32
3044+dnl --------------
3045+dnl This option causes manpages to be run through tbl(1) to generate tables
3046+dnl correctly.
3047+AC_DEFUN([CF_MANPAGE_TBL],
3048+[
3049+AC_MSG_CHECKING(for manpage tbl)
3050+
3051+AC_ARG_WITH(manpage-tbl,
3052+ [ --with-manpage-tbl specify manpage processing with tbl],
3053+ [MANPAGE_TBL=$withval],
3054+ [MANPAGE_TBL=no])
3055+
3056+AC_MSG_RESULT($MANPAGE_TBL)
3057+])dnl
3058+dnl ---------------------------------------------------------------------------
3059+dnl CF_MAN_PAGES version: 27 updated: 2003/12/20 20:39:45
3060+dnl ------------
3061+dnl Try to determine if the man-pages on the system are compressed, and if
3062+dnl so, what format is used. Use this information to construct a script that
3063+dnl will install man-pages.
3064+AC_DEFUN([CF_MAN_PAGES],
3065+[
3066+CF_MANPAGE_FORMAT
3067+CF_MANPAGE_RENAMES
3068+CF_MANPAGE_SYMLINKS
3069+CF_MANPAGE_TBL
3070+
3071+ if test "$prefix" = "NONE" ; then
3072+ cf_prefix="$ac_default_prefix"
3073+ else
3074+ cf_prefix="$prefix"
3075+ fi
3076+
3077+ case "$MANPAGE_FORMAT" in # (vi
3078+ *catonly*) # (vi
3079+ cf_format=yes
3080+ cf_inboth=no
3081+ ;;
3082+ *formatted*) # (vi
3083+ cf_format=yes
3084+ cf_inboth=yes
3085+ ;;
3086+ *)
3087+ cf_format=no
3088+ cf_inboth=no
3089+ ;;
3090+ esac
3091+
3092+test ! -d man && mkdir man
3093+
3094+cf_so_strip=
3095+cf_compress=
3096+case "$MANPAGE_FORMAT" in #(vi
3097+*compress*) #(vi
3098+ cf_so_strip="Z"
3099+ cf_compress=compress
3100+ ;;
3101+*gzip*) #(vi
3102+ cf_so_strip="gz"
3103+ cf_compress=gzip
3104+ ;;
3105+esac
3106+
3107+cf_edit_man=man/edit_man.sh
3108+
3109+cat >$cf_edit_man <<CF_EOF
3110+#! /bin/sh
3111+# this script is generated by the configure-script CF_MAN_PAGES macro.
3112+prefix="$cf_prefix"
3113+datadir="$datadir"
3114+NCURSES_OSPEED="$NCURSES_OSPEED"
3115+TERMINFO="$TERMINFO"
3116+MKDIRS="sh `cd $srcdir && pwd`/mkinstalldirs"
3117+INSTALL="$INSTALL"
3118+INSTALL_DATA="$INSTALL_DATA"
3119+transform="$program_transform_name"
3120+
3121+TMP=\${TMPDIR-/tmp}/man\$\$
3122+trap "rm -f \$TMP" 0 1 2 5 15
3123+
3124+form=\[$]1
3125+shift || exit 1
3126+
3127+verb=\[$]1
3128+shift || exit 1
3129+
3130+mandir=\[$]1
3131+shift || exit 1
3132+
3133+srcdir=\[$]1
3134+shift || exit 1
3135+
3136+if test "\$form" = normal ; then
3137+ if test "$cf_format" = yes ; then
3138+ if test "$cf_inboth" = no ; then
3139+ sh \[$]0 format \$verb \$mandir \$srcdir \[$]*
3140+ exit $?
3141+ fi
3142+ fi
3143+ cf_subdir=\$mandir/man
3144+ cf_tables=$MANPAGE_TBL
3145+else
3146+ cf_subdir=\$mandir/cat
3147+ cf_tables=yes
3148+fi
3149+
3150+# process the list of source-files
3151+for i in \[$]* ; do
3152+case \$i in #(vi
3153+*.orig|*.rej) ;; #(vi
3154+*.[[0-9]]*)
3155+ section=\`expr "\$i" : '.*\\.\\([[0-9]]\\)[[xm]]*'\`;
3156+ if test \$verb = installing ; then
3157+ if test ! -d \$cf_subdir\${section} ; then
3158+ \$MKDIRS \$cf_subdir\$section
3159+ fi
3160+ fi
3161+ aliases=
3162+ source=\`basename \$i\`
3163+ inalias=\$source
3164+ test ! -f \$inalias && inalias="\$srcdir/\$inalias"
3165+ if test ! -f \$inalias ; then
3166+ echo .. skipped \$source
3167+ continue
3168+ fi
3169+CF_EOF
3170+
3171+if test "$MANPAGE_ALIASES" != no ; then
3172+cat >>$cf_edit_man <<CF_EOF
3173+ aliases=\`sed -f \$srcdir/manlinks.sed \$inalias | sort -u\`
3174+CF_EOF
3175+fi
3176+
3177+if test "$MANPAGE_RENAMES" = no ; then
3178+cat >>$cf_edit_man <<CF_EOF
3179+ # perform program transformations for section 1 man pages
3180+ if test \$section = 1 ; then
3181+ target=\$cf_subdir\${section}/\`echo \$source|sed "\${transform}"\`
3182+ else
3183+ target=\$cf_subdir\${section}/\$source
3184+ fi
3185+CF_EOF
3186+else
3187+cat >>$cf_edit_man <<CF_EOF
3188+ target=\`grep "^\$source" $MANPAGE_RENAMES | $AWK '{print \[$]2}'\`
3189+ if test -z "\$target" ; then
3190+ echo '? missing rename for '\$source
3191+ target="\$source"
3192+ fi
3193+ target="\$cf_subdir\${section}/\${target}"
3194+CF_EOF
3195+fi
3196+
3197+ # replace variables in man page
3198+ ifelse($1,,,[
3199+ for cf_name in $1
3200+ do
3201+cat >>$cf_edit_man <<CF_EOF
3202+ prog_$cf_name=\`echo $cf_name|sed "\${transform}"\`
3203+CF_EOF
3204+ done
3205+ ])
3206+cat >>$cf_edit_man <<CF_EOF
3207+ sed -e "s,@DATADIR@,\$datadir," \\
3208+ -e "s,@TERMINFO@,\$TERMINFO," \\
3209+ -e "s,@NCURSES_OSPEED@,\$NCURSES_OSPEED," \\
3210+CF_EOF
3211+
3212+ ifelse($1,,,[
3213+ for cf_name in $1
3214+ do
3215+ cf_NAME=`echo "$cf_name" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
3216+cat >>$cf_edit_man <<CF_EOF
3217+ -e "s,@$cf_NAME@,\$prog_$cf_name," \\
3218+CF_EOF
3219+ done
3220+ ])
3221+
3222+if test -f $MANPAGE_RENAMES ; then
3223+cat >>$cf_edit_man <<CF_EOF
3224+ < \$i | sed -f $srcdir/edit_man.sed >\$TMP
3225+CF_EOF
3226+else
3227+cat >>$cf_edit_man <<CF_EOF
3228+ < \$i >\$TMP
3229+CF_EOF
3230+fi
3231+
3232+cat >>$cf_edit_man <<CF_EOF
3233+if test \$cf_tables = yes ; then
3234+ tbl \$TMP >\$TMP.out
3235+ mv \$TMP.out \$TMP
3236+fi
3237+CF_EOF
3238+
3239+if test $with_curses_h != yes ; then
3240+cat >>$cf_edit_man <<CF_EOF
3241+ sed -e "/\#[ ]*include/s,curses.h,ncurses.h," < \$TMP >\$TMP.out
3242+ mv \$TMP.out \$TMP
3243+CF_EOF
3244+fi
3245+
3246+cat >>$cf_edit_man <<CF_EOF
3247+ if test \$form = format ; then
3248+ nroff -man \$TMP >\$TMP.out
3249+ mv \$TMP.out \$TMP
3250+ fi
3251+CF_EOF
3252+
3253+if test -n "$cf_compress" ; then
3254+cat >>$cf_edit_man <<CF_EOF
3255+ if test \$verb = installing ; then
3256+ if ( $cf_compress -f \$TMP )
3257+ then
3258+ mv \$TMP.$cf_so_strip \$TMP
3259+ fi
3260+ fi
3261+ target="\$target.$cf_so_strip"
3262+CF_EOF
3263+fi
3264+
3265+case "$MANPAGE_FORMAT" in #(vi
3266+*BSDI*)
3267+cat >>$cf_edit_man <<CF_EOF
3268+ if test \$form = format ; then
3269+ # BSDI installs only .0 suffixes in the cat directories
3270+ target="\`echo \$target|sed -e 's/\.[[1-9]]\+[[a-z]]*/.0/'\`"
3271+ fi
3272+CF_EOF
3273+ ;;
3274+esac
3275+
3276+cat >>$cf_edit_man <<CF_EOF
3277+ suffix=\`basename \$target | sed -e 's%^[[^.]]*%%'\`
3278+ if test \$verb = installing ; then
3279+ echo \$verb \$target
3280+ \$INSTALL_DATA \$TMP \$target
3281+ test -n "\$aliases" && (
3282+ cd \$cf_subdir\${section} && (
3283+ source=\`echo \$target |sed -e 's%^.*/\([[^/]][[^/]]*/[[^/]][[^/]]*$\)%\1%'\`
3284+ test -n "$cf_so_strip" && source=\`echo \$source |sed -e 's%\.$cf_so_strip\$%%'\`
3285+ target=\`basename \$target\`
3286+ for cf_alias in \$aliases
3287+ do
3288+ if test \$section = 1 ; then
3289+ cf_alias=\`echo \$cf_alias|sed "\${transform}"\`
3290+ fi
3291+
3292+ if test "$MANPAGE_SYMLINKS" = yes ; then
3293+ if test -f \$cf_alias\${suffix} ; then
3294+ if ( cmp -s \$target \$cf_alias\${suffix} )
3295+ then
3296+ continue
3297+ fi
3298+ fi
3299+ echo .. \$verb alias \$cf_alias\${suffix}
3300+ rm -f \$cf_alias\${suffix}
3301+ $LN_S \$target \$cf_alias\${suffix}
3302+ elif test "\$target" != "\$cf_alias\${suffix}" ; then
3303+ echo ".so \$source" >\$TMP
3304+CF_EOF
3305+if test -n "$cf_compress" ; then
3306+cat >>$cf_edit_man <<CF_EOF
3307+ if test -n "$cf_so_strip" ; then
3308+ $cf_compress -f \$TMP
3309+ mv \$TMP.$cf_so_strip \$TMP
3310+ fi
3311+CF_EOF
3312+fi
3313+cat >>$cf_edit_man <<CF_EOF
3314+ echo .. \$verb alias \$cf_alias\${suffix}
3315+ rm -f \$cf_alias\${suffix}
3316+ \$INSTALL_DATA \$TMP \$cf_alias\${suffix}
3317+ fi
3318+ done
3319+ )
3320+ )
3321+ elif test \$verb = removing ; then
3322+ echo \$verb \$target
3323+ rm -f \$target
3324+ test -n "\$aliases" && (
3325+ cd \$cf_subdir\${section} && (
3326+ for cf_alias in \$aliases
3327+ do
3328+ if test \$section = 1 ; then
3329+ cf_alias=\`echo \$cf_alias|sed "\${transform}"\`
3330+ fi
3331+
3332+ echo .. \$verb alias \$cf_alias\${suffix}
3333+ rm -f \$cf_alias\${suffix}
3334+ done
3335+ )
3336+ )
3337+ else
3338+# echo ".hy 0"
3339+ cat \$TMP
3340+ fi
3341+ ;;
3342+esac
3343+done
3344+
3345+if test $cf_inboth = yes ; then
3346+if test \$form != format ; then
3347+ sh \[$]0 format \$verb \$mandir \$srcdir \[$]*
3348+fi
3349+fi
3350+
3351+exit 0
3352+CF_EOF
3353+chmod 755 $cf_edit_man
3354+
3355+])dnl
3356+dnl ---------------------------------------------------------------------------
3357+dnl CF_MATH_LIB version: 5 updated: 2000/05/28 01:39:10
3358+dnl -----------
3359+dnl Checks for libraries. At least one UNIX system, Apple Macintosh
3360+dnl Rhapsody 5.5, does not have -lm. We cannot use the simpler
3361+dnl AC_CHECK_LIB(m,sin), because that fails for C++.
3362+AC_DEFUN([CF_MATH_LIB],
3363+[
3364+AC_CACHE_CHECK(if -lm needed for math functions,
3365+ cf_cv_need_libm,[
3366+ AC_TRY_LINK([
3367+ #include <stdio.h>
3368+ #include <math.h>
3369+ ],
3370+ [double x = rand(); printf("result = %g\n", ]ifelse($2,,sin(x),$2)[)],
3371+ [cf_cv_need_libm=no],
3372+ [cf_cv_need_libm=yes])])
3373+if test "$cf_cv_need_libm" = yes
3374+then
3375+ifelse($1,,[
3376+ LIBS="$LIBS -lm"
3377+],[$1=-lm])
3378+fi
3379+])
3380+dnl ---------------------------------------------------------------------------
3381+dnl CF_MIXEDCASE_FILENAMES version: 3 updated: 2003/09/20 17:07:55
3382+dnl ----------------------
3383+dnl Check if the file-system supports mixed-case filenames. If we're able to
3384+dnl create a lowercase name and see it as uppercase, it doesn't support that.
3385+AC_DEFUN([CF_MIXEDCASE_FILENAMES],
3386+[
3387+AC_CACHE_CHECK(if filesystem supports mixed-case filenames,cf_cv_mixedcase,[
3388+if test "$cross_compiling" = yes ; then
3389+ case $target_alias in #(vi
3390+ *-os2-emx*|*-msdosdjgpp*|*-cygwin*|*-mingw32*|*-uwin*) #(vi
3391+ cf_cv_mixedcase=no
3392+ ;;
3393+ *)
3394+ cf_cv_mixedcase=yes
3395+ ;;
3396+ esac
3397+else
3398+ rm -f conftest CONFTEST
3399+ echo test >conftest
3400+ if test -f CONFTEST ; then
3401+ cf_cv_mixedcase=no
3402+ else
3403+ cf_cv_mixedcase=yes
3404+ fi
3405+ rm -f conftest CONFTEST
3406+fi
3407+])
3408+test "$cf_cv_mixedcase" = yes && AC_DEFINE(MIXEDCASE_FILENAMES)
3409+])dnl
3410+dnl ---------------------------------------------------------------------------
3411+dnl CF_MKSTEMP version: 3 updated: 2001/11/08 20:59:59
3412+dnl ----------
3413+dnl Check for a working mkstemp. This creates two files, checks that they are
3414+dnl successfully created and distinct (AmigaOS apparently fails on the last).
3415+AC_DEFUN([CF_MKSTEMP],[
3416+AC_CACHE_CHECK(for working mkstemp, cf_cv_func_mkstemp,[
3417+rm -f conftest*
3418+AC_TRY_RUN([
3419+#include <sys/types.h>
3420+#include <stdlib.h>
3421+#include <stdio.h>
3422+#include <string.h>
3423+#include <sys/stat.h>
3424+int main()
3425+{
3426+ char *tmpl = "conftestXXXXXX";
3427+ char name[2][80];
3428+ int n;
3429+ int result = 0;
3430+ int fd;
3431+ struct stat sb;
3432+
3433+ umask(077);
3434+ for (n = 0; n < 2; ++n) {
3435+ strcpy(name[n], tmpl);
3436+ if ((fd = mkstemp(name[n])) >= 0) {
3437+ if (!strcmp(name[n], tmpl)
3438+ || stat(name[n], &sb) != 0
3439+ || (sb.st_mode & S_IFMT) != S_IFREG
3440+ || (sb.st_mode & 077) != 0) {
3441+ result = 1;
3442+ }
3443+ close(fd);
3444+ }
3445+ }
3446+ if (result == 0
3447+ && !strcmp(name[0], name[1]))
3448+ result = 1;
3449+ exit(result);
3450+}
3451+],[cf_cv_func_mkstemp=yes
3452+],[cf_cv_func_mkstemp=no
3453+],[AC_CHECK_FUNC(mkstemp)
3454+])
3455+])
3456+if test "$cf_cv_func_mkstemp" = yes ; then
3457+ AC_DEFINE(HAVE_MKSTEMP)
3458+fi
3459+])dnl
3460+dnl ---------------------------------------------------------------------------
3461+dnl CF_NUMBER_SYNTAX version: 1 updated: 2003/09/20 18:12:49
3462+dnl ----------------
3463+dnl Check if the given variable is a number. If not, report an error.
3464+dnl $1 is the variable
3465+dnl $2 is the message
3466+AC_DEFUN([CF_NUMBER_SYNTAX],[
3467+if test -n "$1" ; then
3468+ case $1 in #(vi
3469+ [[0-9]]*) #(vi
3470+ ;;
3471+ *)
3472+ AC_MSG_ERROR($2 is not a number: $1)
3473+ ;;
3474+ esac
3475+else
3476+ AC_MSG_ERROR($2 value is empty)
3477+fi
3478+])dnl
3479+dnl ---------------------------------------------------------------------------
3480+dnl CF_OBJ_SUBDIR version: 4 updated: 2002/02/23 20:38:31
3481+dnl -------------
3482+dnl Compute the object-directory name from the given model name
3483+AC_DEFUN([CF_OBJ_SUBDIR],
3484+[
3485+ case $1 in
3486+ libtool) $2='obj_lo' ;;
3487+ normal) $2='objects' ;;
3488+ debug) $2='obj_g' ;;
3489+ profile) $2='obj_p' ;;
3490+ shared)
3491+ case $cf_cv_system_name in #(vi
3492+ cygwin) #(vi
3493+ $2='objects' ;;
3494+ *)
3495+ $2='obj_s' ;;
3496+ esac
3497+ esac
3498+])dnl
3499+dnl ---------------------------------------------------------------------------
3500+dnl CF_PATHSEP version: 3 updated: 2001/01/12 01:23:53
3501+dnl ----------
3502+dnl Provide a value for the $PATH and similar separator
3503+AC_DEFUN([CF_PATHSEP],
3504+[
3505+ case $cf_cv_system_name in
3506+ os2*) PATHSEP=';' ;;
3507+ *) PATHSEP=':' ;;
3508+ esac
3509+ifelse($1,,,[$1=$PATHSEP])
3510+ AC_SUBST(PATHSEP)
3511+])dnl
3512+dnl ---------------------------------------------------------------------------
3513+dnl CF_PATH_SYNTAX version: 9 updated: 2002/09/17 23:03:38
3514+dnl --------------
3515+dnl Check the argument to see that it looks like a pathname. Rewrite it if it
3516+dnl begins with one of the prefix/exec_prefix variables, and then again if the
3517+dnl result begins with 'NONE'. This is necessary to work around autoconf's
3518+dnl delayed evaluation of those symbols.
3519+AC_DEFUN([CF_PATH_SYNTAX],[
3520+case ".[$]$1" in #(vi
3521+.\[$]\(*\)*|.\'*\'*) #(vi
3522+ ;;
3523+..|./*|.\\*) #(vi
3524+ ;;
3525+.[[a-zA-Z]]:[[\\/]]*) #(vi OS/2 EMX
3526+ ;;
3527+.\[$]{*prefix}*) #(vi
3528+ eval $1="[$]$1"
3529+ case ".[$]$1" in #(vi
3530+ .NONE/*)
3531+ $1=`echo [$]$1 | sed -e s%NONE%$ac_default_prefix%`
3532+ ;;
3533+ esac
3534+ ;; #(vi
3535+.NONE/*)
3536+ $1=`echo [$]$1 | sed -e s%NONE%$ac_default_prefix%`
3537+ ;;
3538+*)
3539+ ifelse($2,,[AC_ERROR([expected a pathname, not \"[$]$1\"])],$2)
3540+ ;;
3541+esac
3542+])dnl
3543+dnl ---------------------------------------------------------------------------
3544+dnl CF_PREDEFINE version: 1 updated: 2003/07/26 17:53:56
3545+dnl ------------
3546+dnl Add definitions to CPPFLAGS to ensure they're predefined for all compiles.
3547+dnl
3548+dnl $1 = symbol to test
3549+dnl $2 = value (if any) to use for a predefinition
3550+AC_DEFUN([CF_PREDEFINE],
3551+[
3552+AC_MSG_CHECKING(if we must define $1)
3553+AC_TRY_COMPILE([#include <sys/types.h>
3554+],[
3555+#ifndef $1
3556+make an error
3557+#endif],[cf_result=no],[cf_result=yes])
3558+AC_MSG_RESULT($cf_result)
3559+
3560+if test "$cf_result" = yes ; then
3561+ CPPFLAGS="$CPPFLAGS ifelse($2,,-D$1,[-D$1=$2])"
3562+elif test "x$2" != "x" ; then
3563+ AC_MSG_CHECKING(checking for compatible value versus $2)
3564+ AC_TRY_COMPILE([#include <sys/types.h>
3565+],[
3566+#if $1-$2 < 0
3567+make an error
3568+#endif],[cf_result=yes],[cf_result=no])
3569+ AC_MSG_RESULT($cf_result)
3570+ if test "$cf_result" = no ; then
3571+ # perhaps we can override it - try...
3572+ CPPFLAGS="$CPPFLAGS -D$1=$2"
3573+ fi
3574+fi
3575+])dnl
3576+dnl ---------------------------------------------------------------------------
3577+dnl CF_PROG_EXT version: 10 updated: 2004/01/03 19:28:18
3578+dnl -----------
3579+dnl Compute $PROG_EXT, used for non-Unix ports, such as OS/2 EMX.
3580+AC_DEFUN([CF_PROG_EXT],
3581+[
3582+AC_REQUIRE([CF_CHECK_CACHE])
3583+case $cf_cv_system_name in
3584+os2*)
3585+ CFLAGS="$CFLAGS -Zmt"
3586+ CPPFLAGS="$CPPFLAGS -D__ST_MT_ERRNO__"
3587+ CXXFLAGS="$CXXFLAGS -Zmt"
3588+ # autoconf's macro sets -Zexe and suffix both, which conflict:w
3589+ LDFLAGS="$LDFLAGS -Zmt -Zcrtdll"
3590+ ac_cv_exeext=.exe
3591+ ;;
3592+esac
3593+
3594+AC_EXEEXT
3595+AC_OBJEXT
3596+
3597+PROG_EXT="$EXEEXT"
3598+AC_SUBST(PROG_EXT)
3599+test -n "$PROG_EXT" && AC_DEFINE_UNQUOTED(PROG_EXT,"$PROG_EXT")
3600+])dnl
3601+dnl ---------------------------------------------------------------------------
3602+dnl CF_PROG_INSTALL version: 5 updated: 2002/12/21 22:46:07
3603+dnl ---------------
3604+dnl Force $INSTALL to be an absolute-path. Otherwise, edit_man.sh and the
3605+dnl misc/tabset install won't work properly. Usually this happens only when
3606+dnl using the fallback mkinstalldirs script
3607+AC_DEFUN([CF_PROG_INSTALL],
3608+[AC_PROG_INSTALL
3609+case $INSTALL in
3610+/*)
3611+ ;;
3612+*)
3613+ CF_DIRNAME(cf_dir,$INSTALL)
3614+ test -z "$cf_dir" && cf_dir=.
3615+ INSTALL=`cd $cf_dir && pwd`/`echo $INSTALL | sed -e 's%^.*/%%'`
3616+ ;;
3617+esac
3618+])dnl
3619+dnl ---------------------------------------------------------------------------
3620+dnl CF_PROG_LDCONFIG version: 1 updated: 2003/09/20 17:07:55
3621+dnl ----------------
3622+dnl Check for ldconfig, needed to fixup shared libraries that would be built
3623+dnl and then used in the install.
3624+AC_DEFUN([CF_PROG_LDCONFIG],[
3625+if test "$cross_compiling" = yes ; then
3626+ LDCONFIG=:
3627+else
3628+case "$cf_cv_system_name" in #(vi
3629+freebsd*) #(vi
3630+ test -z "$LDCONFIG" && LDCONFIG="/sbin/ldconfig -R"
3631+ ;;
3632+*) LDPATH=$PATH:/sbin:/usr/sbin
3633+ AC_PATH_PROG(LDCONFIG,ldconfig,,$LDPATH)
3634+ ;;
3635+esac
3636+fi
3637+AC_SUBST(LDCONFIG)
3638+])dnl
3639+dnl ---------------------------------------------------------------------------
3640+dnl CF_REGEX version: 3 updated: 1997/11/01 14:26:01
3641+dnl --------
3642+dnl Attempt to determine if we've got one of the flavors of regular-expression
3643+dnl code that we can support.
3644+AC_DEFUN([CF_REGEX],
3645+[
3646+AC_MSG_CHECKING([for regular-expression headers])
3647+AC_CACHE_VAL(cf_cv_regex,[
3648+AC_TRY_LINK([#include <sys/types.h>
3649+#include <regex.h>],[
3650+ regex_t *p;
3651+ int x = regcomp(p, "", 0);
3652+ int y = regexec(p, "", 0, 0, 0);
3653+ regfree(p);
3654+ ],[cf_cv_regex="regex.h"],[
3655+ AC_TRY_LINK([#include <regexp.h>],[
3656+ char *p = compile("", "", "", 0);
3657+ int x = step("", "");
3658+ ],[cf_cv_regex="regexp.h"],[
3659+ cf_save_LIBS="$LIBS"
3660+ LIBS="-lgen $LIBS"
3661+ AC_TRY_LINK([#include <regexpr.h>],[
3662+ char *p = compile("", "", "");
3663+ int x = step("", "");
3664+ ],[cf_cv_regex="regexpr.h"],[LIBS="$cf_save_LIBS"])])])
3665+])
3666+AC_MSG_RESULT($cf_cv_regex)
3667+case $cf_cv_regex in
3668+ regex.h) AC_DEFINE(HAVE_REGEX_H_FUNCS) ;;
3669+ regexp.h) AC_DEFINE(HAVE_REGEXP_H_FUNCS) ;;
3670+ regexpr.h) AC_DEFINE(HAVE_REGEXPR_H_FUNCS) ;;
3671+esac
3672+])dnl
3673+dnl ---------------------------------------------------------------------------
3674+dnl CF_SHARED_OPTS version: 30 updated: 2003/12/27 20:48:07
3675+dnl --------------
3676+dnl Attempt to determine the appropriate CC/LD options for creating a shared
3677+dnl library.
3678+dnl
3679+dnl Note: $(LOCAL_LDFLAGS) is used to link executables that will run within the
3680+dnl build-tree, i.e., by making use of the libraries that are compiled in ../lib
3681+dnl We avoid compiling-in a ../lib path for the shared library since that can
3682+dnl lead to unexpected results at runtime.
3683+dnl $(LOCAL_LDFLAGS2) has the same intention but assumes that the shared libraries
3684+dnl are compiled in ../../lib
3685+dnl
3686+dnl The variable 'cf_cv_do_symlinks' is used to control whether we configure
3687+dnl to install symbolic links to the rel/abi versions of shared libraries.
3688+dnl
3689+dnl The variable 'cf_cv_shlib_version' controls whether we use the rel or abi
3690+dnl version when making symbolic links.
3691+dnl
3692+dnl The variable 'cf_cv_shlib_version_infix' controls whether shared library
3693+dnl version numbers are infix (ex: libncurses.<ver>.dylib) or postfix
3694+dnl (ex: libncurses.so.<ver>).
3695+dnl
3696+dnl Some loaders leave 'so_locations' lying around. It's nice to clean up.
3697+AC_DEFUN([CF_SHARED_OPTS],
3698+[
3699+ AC_REQUIRE([CF_SUBST_NCURSES_VERSION])
3700+ LOCAL_LDFLAGS=
3701+ LOCAL_LDFLAGS2=
3702+ LD_SHARED_OPTS=
3703+ INSTALL_LIB="-m 644"
3704+
3705+ cf_cv_do_symlinks=no
3706+
3707+ AC_MSG_CHECKING(if release/abi version should be used for shared libs)
3708+ AC_ARG_WITH(shlib-version,
3709+ [ --with-shlib-version=X Specify rel or abi version for shared libs],
3710+ [test -z "$withval" && withval=auto
3711+ case $withval in #(vi
3712+ yes) #(vi
3713+ cf_cv_shlib_version=auto
3714+ ;;
3715+ rel|abi|auto|no) #(vi
3716+ cf_cv_shlib_version=$withval
3717+ ;;
3718+ *)
3719+ AC_ERROR([option value must be one of: rel, abi, auto or no])
3720+ ;;
3721+ esac
3722+ ],[cf_cv_shlib_version=auto])
3723+ AC_MSG_RESULT($cf_cv_shlib_version)
3724+
3725+ cf_cv_rm_so_locs=no
3726+
3727+ # Some less-capable ports of gcc support only -fpic
3728+ CC_SHARED_OPTS=
3729+ if test "$GCC" = yes
3730+ then
3731+ AC_MSG_CHECKING(which $CC option to use)
3732+ cf_save_CFLAGS="$CFLAGS"
3733+ for CC_SHARED_OPTS in -fPIC -fpic ''
3734+ do
3735+ CFLAGS="$cf_save_CFLAGS $CC_SHARED_OPTS"
3736+ AC_TRY_COMPILE([#include <stdio.h>],[int x = 1],[break],[])
3737+ done
3738+ AC_MSG_RESULT($CC_SHARED_OPTS)
3739+ CFLAGS="$cf_save_CFLAGS"
3740+ fi
3741+
3742+ cf_cv_shlib_version_infix=no
3743+
3744+ case $cf_cv_system_name in
3745+ beos*)
3746+ MK_SHARED_LIB='$(CC) -o $[@] -Xlinker -soname=`basename $[@]` -nostart -e 0'
3747+ ;;
3748+ cygwin*)
3749+ CC_SHARED_OPTS=
3750+ MK_SHARED_LIB='$(CC) -shared -Wl,--out-implib=$(IMPORT_LIB) -Wl,--export-all-symbols -o $(SHARED_LIB)'
3751+ cf_cv_shlib_version=cygdll
3752+ cf_cv_shlib_version_infix=cygdll
3753+ ;;
3754+ darwin*)
3755+ EXTRA_CFLAGS="-no-cpp-precomp"
3756+ CC_SHARED_OPTS="-dynamic"
3757+ MK_SHARED_LIB='$(CC) -dynamiclib -install_name $(DESTDIR)$(libdir)/`basename $[@]` -compatibility_version $(ABI_VERSION) -current_version $(ABI_VERSION) -o $[@]'
3758+ test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=abi
3759+ cf_cv_shlib_version_infix=yes
3760+ ;;
3761+ hpux*)
3762+ # (tested with gcc 2.7.2 -- I don't have c89)
3763+ if test "$GCC" = yes; then
3764+ LD_SHARED_OPTS='-Xlinker +b -Xlinker $(libdir)'
3765+ else
3766+ CC_SHARED_OPTS='+Z'
3767+ LD_SHARED_OPTS='-Wl,+b,$(libdir)'
3768+ fi
3769+ MK_SHARED_LIB='$(LD) +b $(libdir) -b -o $[@]'
3770+ # HP-UX shared libraries must be executable, and should be
3771+ # readonly to exploit a quirk in the memory manager.
3772+ INSTALL_LIB="-m 555"
3773+ ;;
3774+ irix*)
3775+ if test "$cf_cv_ld_rpath" = yes ; then
3776+ cf_ld_rpath_opt="-Wl,-rpath,"
3777+ EXTRA_LDFLAGS="-Wl,-rpath,\$(libdir) $EXTRA_LDFLAGS"
3778+ fi
3779+ # tested with IRIX 5.2 and 'cc'.
3780+ if test "$GCC" != yes; then
3781+ CC_SHARED_OPTS='-KPIC'
3782+ fi
3783+ MK_SHARED_LIB='$(LD) -shared -rdata_shared -soname `basename $[@]` -o $[@]'
3784+ cf_cv_rm_so_locs=yes
3785+ ;;
3786+ linux*|gnu*|k*bsd*-gnu)
3787+ if test "$DFT_LWR_MODEL" = "shared" ; then
3788+ LOCAL_LDFLAGS="-Wl,-rpath,`pwd`/lib"
3789+ LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
3790+ fi
3791+ if test "$cf_cv_ld_rpath" = yes ; then
3792+ cf_ld_rpath_opt="-Wl,-rpath,"
3793+ EXTRA_LDFLAGS="$LOCAL_LDFLAGS $EXTRA_LDFLAGS"
3794+ fi
3795+ test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
3796+ MK_SHARED_LIB='$(CC) -shared -Wl,-soname,`basename $[@] .$(REL_VERSION)`.$(ABI_VERSION),-stats,-lc -o $[@]'
3797+ ;;
3798+ openbsd2*)
3799+ CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
3800+ MK_SHARED_LIB='$(LD) -Bshareable -soname,`basename $[@].$(ABI_VERSION)` -o $[@]'
3801+ ;;
3802+ freebsd[[45]]*)
3803+ CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
3804+ MK_SHARED_LIB='$(LD) -Bshareable -soname=`basename $[@]` -o $[@]'
3805+ test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
3806+
3807+# This doesn't work - I keep getting spurious references to needing
3808+# libncurses.so.5.3 when ldd says it's resolved. LOCAL_LDFLAGS2 seems to be
3809+# no longer used anyway. And the rpath logic isn't relative - so I have to
3810+# add the local and install lib-directories:
3811+#
3812+# if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_ld_rpath" = yes ; then
3813+# LOCAL_LDFLAGS="-rpath `pwd`/lib"
3814+# LOCAL_LDFLAGS2="-rpath \$(libdir) $LOCAL_LDFLAGS"
3815+# cf_ld_rpath_opt="-rpath "
3816+# EXTRA_LDFLAGS="$LOCAL_LDFLAGS $EXTRA_LDFLAGS"
3817+# fi
3818+ ;;
3819+ openbsd*|freebsd*)
3820+ CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
3821+ MK_SHARED_LIB='$(LD) -Bshareable -o $[@]'
3822+ test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
3823+ ;;
3824+ netbsd*)
3825+ CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
3826+ test "$cf_cv_ld_rpath" = yes && cf_ld_rpath_opt="-Wl,-rpath,"
3827+ if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_ld_rpath" = yes ; then
3828+ LOCAL_LDFLAGS="-Wl,-rpath,`pwd`/lib"
3829+ LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
3830+ EXTRA_LDFLAGS="-Wl,-rpath,\$(libdir) $EXTRA_LDFLAGS"
3831+ MK_SHARED_LIB='$(CC) -shared -Wl,-soname,`basename $[@] .$(REL_VERSION)`.$(ABI_VERSION) -o $[@]'
3832+ if test "$cf_cv_shlib_version" = auto; then
3833+ if test ! -f /usr/libexec/ld.elf_so; then
3834+ cf_cv_shlib_version=rel
3835+ fi
3836+ fi
3837+ else
3838+ MK_SHARED_LIB='$(LD) -Bshareable -o $[@]'
3839+ fi
3840+ ;;
3841+ osf*|mls+*)
3842+ # tested with OSF/1 V3.2 and 'cc'
3843+ # tested with OSF/1 V3.2 and gcc 2.6.3 (but the c++ demo didn't
3844+ # link with shared libs).
3845+ MK_SHARED_LIB='$(LD) -set_version $(REL_VERSION):$(ABI_VERSION) -expect_unresolved "*" -shared -soname `basename $[@]`'
3846+ case $host_os in
3847+ osf4*)
3848+ MK_SHARED_LIB="${MK_SHARED_LIB} -msym"
3849+ ;;
3850+ esac
3851+ MK_SHARED_LIB="${MK_SHARED_LIB}"' -o $[@]'
3852+ if test "$DFT_LWR_MODEL" = "shared" ; then
3853+ LOCAL_LDFLAGS="-Wl,-rpath,`pwd`/lib"
3854+ LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
3855+ fi
3856+ if test "$cf_cv_ld_rpath" = yes ; then
3857+ cf_ld_rpath_opt="-rpath"
3858+ # EXTRA_LDFLAGS="$LOCAL_LDFLAGS $EXTRA_LDFLAGS"
3859+ fi
3860+ cf_cv_rm_so_locs=yes
3861+ ;;
3862+ sco3.2v5*) # (also uw2* and UW7) hops 13-Apr-98
3863+ # tested with osr5.0.5
3864+ if test "$GCC" != yes; then
3865+ CC_SHARED_OPTS='-belf -KPIC'
3866+ fi
3867+ MK_SHARED_LIB='$(LD) -dy -G -h `basename $[@] .$(REL_VERSION)`.$(ABI_VERSION) -o [$]@'
3868+ if test "$cf_cv_ld_rpath" = yes ; then
3869+ # only way is to set LD_RUN_PATH but no switch for it
3870+ RUN_PATH=$libdir
3871+ fi
3872+ test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
3873+ LINK_PROGS='LD_RUN_PATH=$(libdir)'
3874+ LINK_TESTS='Pwd=`pwd`;LD_RUN_PATH=`dirname $${Pwd}`/lib'
3875+ ;;
3876+ sunos4*)
3877+ # tested with SunOS 4.1.1 and gcc 2.7.0
3878+ if test "$GCC" != yes; then
3879+ CC_SHARED_OPTS='-KPIC'
3880+ fi
3881+ MK_SHARED_LIB='$(LD) -assert pure-text -o $[@]'
3882+ test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
3883+ ;;
3884+ solaris2*)
3885+ # tested with SunOS 5.5.1 (solaris 2.5.1) and gcc 2.7.2
3886+ if test "$GCC" != yes; then
3887+ CC_SHARED_OPTS='-KPIC'
3888+ fi
3889+ MK_SHARED_LIB='$(LD) -dy -G -h `basename $[@] .$(REL_VERSION)`.$(ABI_VERSION) -o $[@]'
3890+ if test "$DFT_LWR_MODEL" = "shared" ; then
3891+ LOCAL_LDFLAGS="-R `pwd`/lib:\$(libdir)"
3892+ LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
3893+ fi
3894+ if test "$cf_cv_ld_rpath" = yes ; then
3895+ cf_ld_rpath_opt="-R"
3896+ EXTRA_LDFLAGS="$LOCAL_LDFLAGS $EXTRA_LDFLAGS"
3897+ fi
3898+ test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
3899+ ;;
3900+ sysv5uw7*|unix_sv*)
3901+ # tested with UnixWare 7.1.0 (gcc 2.95.2 and cc)
3902+ if test "$GCC" != yes; then
3903+ CC_SHARED_OPTS='-KPIC'
3904+ fi
3905+ MK_SHARED_LIB='$(LD) -d y -G -o [$]@'
3906+ ;;
3907+ *)
3908+ CC_SHARED_OPTS='unknown'
3909+ MK_SHARED_LIB='echo unknown'
3910+ ;;
3911+ esac
3912+
3913+ # This works if the last tokens in $MK_SHARED_LIB are the -o target.
3914+ case "$cf_cv_shlib_version" in #(vi
3915+ rel|abi)
3916+ case "$MK_SHARED_LIB" in #(vi
3917+ *'-o $[@]')
3918+ test "$cf_cv_do_symlinks" = no && cf_cv_do_symlinks=yes
3919+ ;;
3920+ *)
3921+ AC_MSG_WARN(ignored --with-shlib-version)
3922+ ;;
3923+ esac
3924+ ;;
3925+ esac
3926+
3927+ if test -n "$cf_ld_rpath_opt" ; then
3928+ AC_MSG_CHECKING(if we need a space after rpath option)
3929+ cf_save_LIBS="$LIBS"
3930+ LIBS="$LIBS ${cf_ld_rpath_opt}$libdir"
3931+ AC_TRY_LINK(, , cf_rpath_space=no, cf_rpath_space=yes)
3932+ LIBS="$cf_save_LIBS"
3933+ AC_MSG_RESULT($cf_rpath_space)
3934+ test "$cf_rpath_space" = yes && cf_ld_rpath_opt="$cf_ld_rpath_opt "
3935+ MK_SHARED_LIB="$MK_SHARED_LIB $cf_ld_rpath_opt\$(libdir)"
3936+ fi
3937+
3938+ AC_SUBST(CC_SHARED_OPTS)
3939+ AC_SUBST(LD_SHARED_OPTS)
3940+ AC_SUBST(MK_SHARED_LIB)
3941+ AC_SUBST(LINK_PROGS)
3942+ AC_SUBST(LINK_TESTS)
3943+ AC_SUBST(EXTRA_LDFLAGS)
3944+ AC_SUBST(LOCAL_LDFLAGS)
3945+ AC_SUBST(LOCAL_LDFLAGS2)
3946+ AC_SUBST(INSTALL_LIB)
3947+])dnl
3948+dnl ---------------------------------------------------------------------------
3949+dnl CF_SIZECHANGE version: 8 updated: 2000/11/04 12:22:16
3950+dnl -------------
3951+dnl Check for definitions & structures needed for window size-changing
3952+dnl FIXME: check that this works with "snake" (HP-UX 10.x)
3953+AC_DEFUN([CF_SIZECHANGE],
3954+[
3955+AC_REQUIRE([CF_STRUCT_TERMIOS])
3956+AC_CACHE_CHECK(declaration of size-change, cf_cv_sizechange,[
3957+ cf_cv_sizechange=unknown
3958+ cf_save_CPPFLAGS="$CPPFLAGS"
3959+
3960+for cf_opts in "" "NEED_PTEM_H"
3961+do
3962+
3963+ CPPFLAGS="$cf_save_CPPFLAGS"
3964+ test -n "$cf_opts" && CPPFLAGS="$CPPFLAGS -D$cf_opts"
3965+ AC_TRY_COMPILE([#include <sys/types.h>
3966+#ifdef HAVE_TERMIOS_H
3967+#include <termios.h>
3968+#else
3969+#ifdef HAVE_TERMIO_H
3970+#include <termio.h>
3971+#endif
3972+#endif
3973+#ifdef NEED_PTEM_H
3974+/* This is a workaround for SCO: they neglected to define struct winsize in
3975+ * termios.h -- it's only in termio.h and ptem.h
3976+ */
3977+#include <sys/stream.h>
3978+#include <sys/ptem.h>
3979+#endif
3980+#if !defined(sun) || !defined(HAVE_TERMIOS_H)
3981+#include <sys/ioctl.h>
3982+#endif
3983+],[
3984+#ifdef TIOCGSIZE
3985+ struct ttysize win; /* FIXME: what system is this? */
3986+ int y = win.ts_lines;
3987+ int x = win.ts_cols;
3988+#else
3989+#ifdef TIOCGWINSZ
3990+ struct winsize win;
3991+ int y = win.ws_row;
3992+ int x = win.ws_col;
3993+#else
3994+ no TIOCGSIZE or TIOCGWINSZ
3995+#endif /* TIOCGWINSZ */
3996+#endif /* TIOCGSIZE */
3997+ ],
3998+ [cf_cv_sizechange=yes],
3999+ [cf_cv_sizechange=no])
4000+
4001+ CPPFLAGS="$cf_save_CPPFLAGS"
4002+ if test "$cf_cv_sizechange" = yes ; then
4003+ echo "size-change succeeded ($cf_opts)" >&AC_FD_CC
4004+ test -n "$cf_opts" && cf_cv_sizechange="$cf_opts"
4005+ break
4006+ fi
4007+done
4008+])
4009+if test "$cf_cv_sizechange" != no ; then
4010+ AC_DEFINE(HAVE_SIZECHANGE)
4011+ case $cf_cv_sizechange in #(vi
4012+ NEED*)
4013+ AC_DEFINE_UNQUOTED($cf_cv_sizechange )
4014+ ;;
4015+ esac
4016+fi
4017+])dnl
4018+dnl ---------------------------------------------------------------------------
4019+dnl CF_SRC_MODULES version: 15 updated: 2004/01/10 16:05:16
4020+dnl --------------
4021+dnl For each parameter, test if the source-directory exists, and if it contains
4022+dnl a 'modules' file. If so, add to the list $cf_cv_src_modules which we'll
4023+dnl use in CF_LIB_RULES.
4024+dnl
4025+dnl This uses the configured value to make the lists SRC_SUBDIRS and
4026+dnl SUB_MAKEFILES which are used in the makefile-generation scheme.
4027+AC_DEFUN([CF_SRC_MODULES],
4028+[
4029+AC_MSG_CHECKING(for src modules)
4030+
4031+# dependencies and linker-arguments for test-programs
4032+TEST_DEPS="${LIB_DIR}/${LIB_PREFIX}${LIB_NAME}${DFT_DEP_SUFFIX} $TEST_DEPS"
4033+if test "$DFT_LWR_MODEL" = "libtool"; then
4034+ TEST_ARGS="${TEST_DEPS}"
4035+else
4036+ TEST_ARGS="-l${LIB_NAME}${DFT_ARG_SUFFIX} $TEST_ARGS"
4037+fi
4038+
4039+# dependencies and linker-arguments for utility-programs
4040+test "$with_termlib" != yes && PROG_ARGS="$TEST_ARGS"
4041+
4042+cf_cv_src_modules=
4043+for cf_dir in $1
4044+do
4045+ if test -f $srcdir/$cf_dir/modules; then
4046+
4047+ # We may/may not have tack in the distribution, though the
4048+ # makefile is.
4049+ if test $cf_dir = tack ; then
4050+ if test ! -f $srcdir/${cf_dir}/${cf_dir}.h; then
4051+ continue
4052+ fi
4053+ fi
4054+
4055+ if test -z "$cf_cv_src_modules"; then
4056+ cf_cv_src_modules=$cf_dir
4057+ else
4058+ cf_cv_src_modules="$cf_cv_src_modules $cf_dir"
4059+ fi
4060+
4061+ # Make the ncurses_cfg.h file record the library interface files as
4062+ # well. These are header files that are the same name as their
4063+ # directory. Ncurses is the only library that does not follow
4064+ # that pattern.
4065+ if test $cf_dir = tack ; then
4066+ continue
4067+ elif test -f $srcdir/${cf_dir}/${cf_dir}.h; then
4068+ CF_UPPER(cf_have_include,$cf_dir)
4069+ AC_DEFINE_UNQUOTED(HAVE_${cf_have_include}_H)
4070+ AC_DEFINE_UNQUOTED(HAVE_LIB${cf_have_include})
4071+ TEST_DEPS="${LIB_DIR}/${LIB_PREFIX}${cf_dir}${DFT_DEP_SUFFIX} $TEST_DEPS"
4072+ if test "$DFT_LWR_MODEL" = "libtool"; then
4073+ TEST_ARGS="${TEST_DEPS}"
4074+ else
4075+ TEST_ARGS="-l${cf_dir}${DFT_ARG_SUFFIX} $TEST_ARGS"
4076+ fi
4077+ fi
4078+ fi
4079+done
4080+AC_MSG_RESULT($cf_cv_src_modules)
4081+TEST_ARGS="-L${LIB_DIR} $TEST_ARGS"
4082+AC_SUBST(TEST_DEPS)
4083+AC_SUBST(TEST_ARGS)
4084+
4085+PROG_ARGS="-L${LIB_DIR} $PROG_ARGS"
4086+AC_SUBST(PROG_ARGS)
4087+
4088+SRC_SUBDIRS="man include"
4089+for cf_dir in $cf_cv_src_modules
4090+do
4091+ SRC_SUBDIRS="$SRC_SUBDIRS $cf_dir"
4092+done
4093+SRC_SUBDIRS="$SRC_SUBDIRS test"
4094+test -z "$MAKE_TERMINFO" && SRC_SUBDIRS="$SRC_SUBDIRS misc"
4095+test "$cf_with_cxx_binding" != no && SRC_SUBDIRS="$SRC_SUBDIRS c++"
4096+
4097+ADA_SUBDIRS=
4098+if test "$cf_cv_prog_gnat_correct" = yes && test -f $srcdir/Ada95/Makefile.in; then
4099+ SRC_SUBDIRS="$SRC_SUBDIRS Ada95"
4100+ ADA_SUBDIRS="gen src samples"
4101+fi
4102+
4103+SUB_MAKEFILES=
4104+for cf_dir in $SRC_SUBDIRS
4105+do
4106+ SUB_MAKEFILES="$SUB_MAKEFILES $cf_dir/Makefile"
4107+done
4108+
4109+if test -n "$ADA_SUBDIRS"; then
4110+ for cf_dir in $ADA_SUBDIRS
4111+ do
4112+ SUB_MAKEFILES="$SUB_MAKEFILES Ada95/$cf_dir/Makefile"
4113+ done
4114+ AC_SUBST(ADA_SUBDIRS)
4115+fi
4116+])dnl
4117+dnl ---------------------------------------------------------------------------
4118+dnl CF_STDCPP_LIBRARY version: 5 updated: 2000/08/12 23:18:52
4119+dnl -----------------
4120+dnl Check for -lstdc++, which is GNU's standard C++ library.
4121+AC_DEFUN([CF_STDCPP_LIBRARY],
4122+[
4123+if test -n "$GXX" ; then
4124+case $cf_cv_system_name in #(vi
4125+os2*) #(vi
4126+ cf_stdcpp_libname=stdcpp
4127+ ;;
4128+*)
4129+ cf_stdcpp_libname=stdc++
4130+ ;;
4131+esac
4132+AC_CACHE_CHECK(for library $cf_stdcpp_libname,cf_cv_libstdcpp,[
4133+ cf_save="$LIBS"
4134+ LIBS="$LIBS -l$cf_stdcpp_libname"
4135+AC_TRY_LINK([
4136+#include <strstream.h>],[
4137+char buf[80];
4138+strstreambuf foo(buf, sizeof(buf))
4139+],
4140+ [cf_cv_libstdcpp=yes],
4141+ [cf_cv_libstdcpp=no])
4142+ LIBS="$cf_save"
4143+])
4144+test "$cf_cv_libstdcpp" = yes && CXXLIBS="$CXXLIBS -l$cf_stdcpp_libname"
4145+fi
4146+])dnl
4147+dnl ---------------------------------------------------------------------------
4148+dnl CF_STRIP_G_OPT version: 3 updated: 2002/12/21 19:25:52
4149+dnl --------------
4150+dnl Remove "-g" option from the compiler options
4151+AC_DEFUN([CF_STRIP_G_OPT],
4152+[$1=`echo ${$1} | sed -e 's%-g %%' -e 's%-g$%%'`])dnl
4153+dnl ---------------------------------------------------------------------------
4154+dnl CF_STRUCT_SIGACTION version: 3 updated: 2000/08/12 23:18:52
4155+dnl -------------------
4156+dnl Check if we need _POSIX_SOURCE defined to use struct sigaction. We'll only
4157+dnl do this if we've found the sigaction function.
4158+dnl
4159+dnl If needed, define SVR4_ACTION.
4160+AC_DEFUN([CF_STRUCT_SIGACTION],[
4161+if test "$ac_cv_func_sigaction" = yes; then
4162+AC_MSG_CHECKING(whether sigaction needs _POSIX_SOURCE)
4163+AC_TRY_COMPILE([
4164+#include <sys/types.h>
4165+#include <signal.h>],
4166+ [struct sigaction act],
4167+ [sigact_bad=no],
4168+ [
4169+AC_TRY_COMPILE([
4170+#define _POSIX_SOURCE
4171+#include <sys/types.h>
4172+#include <signal.h>],
4173+ [struct sigaction act],
4174+ [sigact_bad=yes
4175+ AC_DEFINE(SVR4_ACTION)],
4176+ [sigact_bad=unknown])])
4177+AC_MSG_RESULT($sigact_bad)
4178+fi
4179+])dnl
4180+dnl ---------------------------------------------------------------------------
4181+dnl CF_STRUCT_TERMIOS version: 5 updated: 2000/11/04 12:22:46
4182+dnl -----------------
4183+dnl Some machines require _POSIX_SOURCE to completely define struct termios.
4184+dnl If so, define SVR4_TERMIO
4185+AC_DEFUN([CF_STRUCT_TERMIOS],[
4186+AC_CHECK_HEADERS( \
4187+termio.h \
4188+termios.h \
4189+unistd.h \
4190+)
4191+if test "$ISC" = yes ; then
4192+ AC_CHECK_HEADERS( sys/termio.h )
4193+fi
4194+if test "$ac_cv_header_termios_h" = yes ; then
4195+ case "$CFLAGS $CPPFLAGS" in
4196+ *-D_POSIX_SOURCE*)
4197+ termios_bad=dunno ;;
4198+ *) termios_bad=maybe ;;
4199+ esac
4200+ if test "$termios_bad" = maybe ; then
4201+ AC_MSG_CHECKING(whether termios.h needs _POSIX_SOURCE)
4202+ AC_TRY_COMPILE([#include <termios.h>],
4203+ [struct termios foo; int x = foo.c_iflag],
4204+ termios_bad=no, [
4205+ AC_TRY_COMPILE([
4206+#define _POSIX_SOURCE
4207+#include <termios.h>],
4208+ [struct termios foo; int x = foo.c_iflag],
4209+ termios_bad=unknown,
4210+ termios_bad=yes AC_DEFINE(SVR4_TERMIO))
4211+ ])
4212+ AC_MSG_RESULT($termios_bad)
4213+ fi
4214+fi
4215+])dnl
4216+dnl ---------------------------------------------------------------------------
4217+dnl CF_SUBST version: 2 updated: 1997/09/06 23:41:28
4218+dnl --------
4219+dnl Shorthand macro for substituting things that the user may override
4220+dnl with an environment variable.
4221+dnl
4222+dnl $1 = long/descriptive name
4223+dnl $2 = environment variable
4224+dnl $3 = default value
4225+AC_DEFUN([CF_SUBST],
4226+[AC_CACHE_VAL(cf_cv_subst_$2,[
4227+AC_MSG_CHECKING(for $1 (symbol $2))
4228+test -z "[$]$2" && $2=$3
4229+AC_MSG_RESULT([$]$2)
4230+AC_SUBST($2)
4231+cf_cv_subst_$2=[$]$2])
4232+$2=${cf_cv_subst_$2}
4233+])dnl
4234+dnl ---------------------------------------------------------------------------
4235+dnl CF_SUBST_NCURSES_VERSION version: 7 updated: 2003/06/07 16:22:51
4236+dnl ------------------------
4237+dnl Get the version-number for use in shared-library naming, etc.
4238+AC_DEFUN([CF_SUBST_NCURSES_VERSION],
4239+[
4240+NCURSES_MAJOR="`egrep '^NCURSES_MAJOR[[ ]]*=' $srcdir/dist.mk | sed -e 's/^[[^0-9]]*//'`"
4241+NCURSES_MINOR="`egrep '^NCURSES_MINOR[[ ]]*=' $srcdir/dist.mk | sed -e 's/^[[^0-9]]*//'`"
4242+NCURSES_PATCH="`egrep '^NCURSES_PATCH[[ ]]*=' $srcdir/dist.mk | sed -e 's/^[[^0-9]]*//'`"
4243+cf_cv_abi_version=${NCURSES_MAJOR}
4244+cf_cv_rel_version=${NCURSES_MAJOR}.${NCURSES_MINOR}
4245+dnl Show the computed version, for logging
4246+cf_cv_timestamp=`date`
4247+AC_MSG_RESULT(Configuring NCURSES $cf_cv_rel_version ABI $cf_cv_abi_version ($cf_cv_timestamp))
4248+dnl We need these values in the generated headers
4249+AC_SUBST(NCURSES_MAJOR)
4250+AC_SUBST(NCURSES_MINOR)
4251+AC_SUBST(NCURSES_PATCH)
4252+dnl We need these values in the generated makefiles
4253+AC_SUBST(cf_cv_rel_version)
4254+AC_SUBST(cf_cv_abi_version)
4255+AC_SUBST(cf_cv_builtin_bool)
4256+AC_SUBST(cf_cv_header_stdbool_h)
4257+AC_SUBST(cf_cv_type_of_bool)dnl
4258+])dnl
4259+dnl ---------------------------------------------------------------------------
4260+dnl CF_SYS_TIME_SELECT version: 4 updated: 2000/10/04 09:18:40
4261+dnl ------------------
4262+dnl Check if we can include <sys/time.h> with <sys/select.h>; this breaks on
4263+dnl older SCO configurations.
4264+AC_DEFUN([CF_SYS_TIME_SELECT],
4265+[
4266+AC_MSG_CHECKING(if sys/time.h works with sys/select.h)
4267+AC_CACHE_VAL(cf_cv_sys_time_select,[
4268+AC_TRY_COMPILE([
4269+#include <sys/types.h>
4270+#ifdef HAVE_SYS_TIME_H
4271+#include <sys/time.h>
4272+#endif
4273+#ifdef HAVE_SYS_SELECT_H
4274+#include <sys/select.h>
4275+#endif
4276+],[],[cf_cv_sys_time_select=yes],
4277+ [cf_cv_sys_time_select=no])
4278+ ])
4279+AC_MSG_RESULT($cf_cv_sys_time_select)
4280+test "$cf_cv_sys_time_select" = yes && AC_DEFINE(HAVE_SYS_TIME_SELECT)
4281+])dnl
4282+dnl ---------------------------------------------------------------------------
4283+dnl CF_TYPEOF_CHTYPE version: 4 updated: 2000/10/04 09:18:40
4284+dnl ----------------
4285+dnl Determine the type we should use for chtype (and attr_t, which is treated
4286+dnl as the same thing). We want around 32 bits, so on most machines want a
4287+dnl long, but on newer 64-bit machines, probably want an int. If we're using
4288+dnl wide characters, we have to have a type compatible with that, as well.
4289+AC_DEFUN([CF_TYPEOF_CHTYPE],
4290+[
4291+AC_REQUIRE([CF_UNSIGNED_LITERALS])
4292+AC_MSG_CHECKING([for type of chtype])
4293+AC_CACHE_VAL(cf_cv_typeof_chtype,[
4294+ AC_TRY_RUN([
4295+#ifdef USE_WIDEC_SUPPORT
4296+#include <stddef.h> /* we want wchar_t */
4297+#define WANT_BITS 39
4298+#else
4299+#define WANT_BITS 31
4300+#endif
4301+#include <stdio.h>
4302+int main()
4303+{
4304+ FILE *fp = fopen("cf_test.out", "w");
4305+ if (fp != 0) {
4306+ char *result = "long";
4307+#ifdef USE_WIDEC_SUPPORT
4308+ /*
4309+ * If wchar_t is smaller than a long, it must be an int or a
4310+ * short. We prefer not to use a short anyway.
4311+ */
4312+ if (sizeof(unsigned long) > sizeof(wchar_t))
4313+ result = "int";
4314+#endif
4315+ if (sizeof(unsigned long) > sizeof(unsigned int)) {
4316+ int n;
4317+ unsigned int x;
4318+ for (n = 0; n < WANT_BITS; n++) {
4319+ unsigned int y = (x >> n);
4320+ if (y != 1 || x == 0) {
4321+ x = 0;
4322+ break;
4323+ }
4324+ }
4325+ /*
4326+ * If x is nonzero, an int is big enough for the bits
4327+ * that we want.
4328+ */
4329+ result = (x != 0) ? "int" : "long";
4330+ }
4331+ fputs(result, fp);
4332+ fclose(fp);
4333+ }
4334+ exit(0);
4335+}
4336+ ],
4337+ [cf_cv_typeof_chtype=`cat cf_test.out`],
4338+ [cf_cv_typeof_chtype=long],
4339+ [cf_cv_typeof_chtype=long])
4340+ rm -f cf_test.out
4341+ ])
4342+AC_MSG_RESULT($cf_cv_typeof_chtype)
4343+
4344+AC_SUBST(cf_cv_typeof_chtype)
4345+AC_DEFINE_UNQUOTED(TYPEOF_CHTYPE,$cf_cv_typeof_chtype)
4346+
4347+cf_cv_1UL="1"
4348+test "$cf_cv_unsigned_literals" = yes && cf_cv_1UL="${cf_cv_1UL}U"
4349+test "$cf_cv_typeof_chtype" = long && cf_cv_1UL="${cf_cv_1UL}L"
4350+AC_SUBST(cf_cv_1UL)
4351+
4352+])dnl
4353+dnl ---------------------------------------------------------------------------
4354+dnl CF_TYPE_SIGACTION version: 3 updated: 2000/08/12 23:18:52
4355+dnl -----------------
4356+dnl
4357+AC_DEFUN([CF_TYPE_SIGACTION],
4358+[
4359+AC_MSG_CHECKING([for type sigaction_t])
4360+AC_CACHE_VAL(cf_cv_type_sigaction,[
4361+ AC_TRY_COMPILE([
4362+#include <signal.h>],
4363+ [sigaction_t x],
4364+ [cf_cv_type_sigaction=yes],
4365+ [cf_cv_type_sigaction=no])])
4366+AC_MSG_RESULT($cf_cv_type_sigaction)
4367+test "$cf_cv_type_sigaction" = yes && AC_DEFINE(HAVE_TYPE_SIGACTION)
4368+])dnl
4369+dnl ---------------------------------------------------------------------------
4370+dnl CF_UNSIGNED_LITERALS version: 2 updated: 1998/02/07 22:10:16
4371+dnl --------------------
4372+dnl Test if the compiler supports 'U' and 'L' suffixes. Only old compilers
4373+dnl won't, but they're still there.
4374+AC_DEFUN([CF_UNSIGNED_LITERALS],
4375+[
4376+AC_MSG_CHECKING([if unsigned literals are legal])
4377+AC_CACHE_VAL(cf_cv_unsigned_literals,[
4378+ AC_TRY_COMPILE([],[long x = 1L + 1UL + 1U + 1],
4379+ [cf_cv_unsigned_literals=yes],
4380+ [cf_cv_unsigned_literals=no])
4381+ ])
4382+AC_MSG_RESULT($cf_cv_unsigned_literals)
4383+])dnl
4384+dnl ---------------------------------------------------------------------------
4385+dnl CF_UPPER version: 5 updated: 2001/01/29 23:40:59
4386+dnl --------
4387+dnl Make an uppercase version of a variable
4388+dnl $1=uppercase($2)
4389+AC_DEFUN([CF_UPPER],
4390+[
4391+$1=`echo "$2" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
4392+])dnl
4393+dnl ---------------------------------------------------------------------------
4394+dnl CF_VERBOSE version: 2 updated: 1997/09/05 10:45:14
4395+dnl ----------
4396+dnl Use AC_VERBOSE w/o the warnings
4397+AC_DEFUN([CF_VERBOSE],
4398+[test -n "$verbose" && echo " $1" 1>&AC_FD_MSG
4399+])dnl
4400+dnl ---------------------------------------------------------------------------
4401+dnl CF_WCHAR_TYPE version: 2 updated: 2004/01/17 19:18:20
4402+dnl -------------
4403+dnl Check if type wide-character type $1 is declared, and if so, which header
4404+dnl file is needed. The second parameter is used to set a shell variable when
4405+dnl the type is not found. The first parameter sets a shell variable for the
4406+dnl opposite sense.
4407+AC_DEFUN([CF_WCHAR_TYPE],
4408+[
4409+# This is needed on Tru64 5.0 to declare $1
4410+AC_CACHE_CHECK(if we must include wchar.h to declare $1,cf_cv_$1,[
4411+AC_TRY_COMPILE([
4412+#include <stdlib.h>
4413+#include <stdarg.h>
4414+#include <stdio.h>
4415+#ifdef HAVE_LIBUTF8_H
4416+#include <libutf8.h>
4417+#endif],
4418+ [$1 state],
4419+ [cf_cv_$1=no],
4420+ [AC_TRY_COMPILE([
4421+#include <stdlib.h>
4422+#include <stdarg.h>
4423+#include <stdio.h>
4424+#include <wchar.h>
4425+#ifdef HAVE_LIBUTF8_H
4426+#include <libutf8.h>
4427+#endif],
4428+ [$1 value],
4429+ [cf_cv_$1=yes],
4430+ [cf_cv_$1=unknown])])])
4431+
4432+if test "$cf_cv_$1" = yes ; then
4433+ AC_DEFINE(NEED_WCHAR_H)
4434+ NEED_WCHAR_H=1
4435+fi
4436+
4437+ifelse($2,,,[
4438+# if we do not find $1 in either place, use substitution to provide a fallback.
4439+if test "$cf_cv_$1" = unknown ; then
4440+ $2=1
4441+fi
4442+])
4443+ifelse($3,,,[
4444+# if we find $1 in either place, use substitution to provide a fallback.
4445+if test "$cf_cv_$1" != unknown ; then
4446+ $3=1
4447+fi
4448+])
4449+])dnl
4450+dnl ---------------------------------------------------------------------------
4451+dnl CF_WITH_ABI_VERSION version: 1 updated: 2003/09/20 18:12:49
4452+dnl -------------------
4453+dnl Allow library's ABI to be overridden. Generally this happens when a
4454+dnl packager has incremented the ABI past that used in the original package,
4455+dnl and wishes to keep doing this.
4456+dnl
4457+dnl $1 is the package name, if any, to derive a corresponding {package}_ABI
4458+dnl symbol.
4459+AC_DEFUN([CF_WITH_ABI_VERSION],[
4460+test -z "$cf_cv_abi_version" && cf_cv_abi_version=0
4461+AC_ARG_WITH(abi-version,
4462+[ --with-abi-version=XXX override derived ABI version],
4463+[AC_MSG_WARN(overriding ABI version $cf_cv_abi_version to $withval)
4464+ cf_cv_abi_version=$withval])
4465+ CF_NUMBER_SYNTAX($cf_cv_abi_version,ABI version)
4466+ifelse($1,,,[
4467+$1_ABI=$cf_cv_abi_version
4468+])
4469+])dnl
4470+dnl ---------------------------------------------------------------------------
4471+dnl CF_WITH_DBMALLOC version: 2 updated: 2002/12/29 21:11:45
4472+dnl ----------------
4473+dnl Configure-option for dbmalloc
4474+AC_DEFUN([CF_WITH_DBMALLOC],[
4475+AC_MSG_CHECKING(if you want to link with dbmalloc for testing)
4476+AC_ARG_WITH(dbmalloc,
4477+ [ --with-dbmalloc test: use Conor Cahill's dbmalloc library],
4478+ [with_dbmalloc=$withval],
4479+ [with_dbmalloc=no])
4480+AC_MSG_RESULT($with_dbmalloc)
4481+if test $with_dbmalloc = yes ; then
4482+ AC_CHECK_LIB(dbmalloc,debug_malloc)
4483+fi
4484+])dnl
4485+dnl ---------------------------------------------------------------------------
4486+dnl CF_WITH_DMALLOC version: 2 updated: 2002/12/29 21:11:45
4487+dnl ---------------
4488+dnl Configure-option for dmalloc
4489+AC_DEFUN([CF_WITH_DMALLOC],[
4490+AC_MSG_CHECKING(if you want to link with dmalloc for testing)
4491+AC_ARG_WITH(dmalloc,
4492+ [ --with-dmalloc test: use Gray Watson's dmalloc library],
4493+ [with_dmalloc=$withval],
4494+ [with_dmalloc=no])
4495+AC_MSG_RESULT($with_dmalloc)
4496+if test $with_dmalloc = yes ; then
4497+ AC_CHECK_LIB(dmalloc,dmalloc_debug)
4498+fi
4499+])dnl
4500+dnl ---------------------------------------------------------------------------
4501+dnl CF_WITH_LIBTOOL version: 9 updated: 2004/01/16 14:55:37
4502+dnl ---------------
4503+dnl Provide a configure option to incorporate libtool. Define several useful
4504+dnl symbols for the makefile rules.
4505+dnl
4506+dnl The reference to AC_PROG_LIBTOOL does not normally work, since it uses
4507+dnl macros from libtool.m4 which is in the aclocal directory of automake.
4508+dnl Following is a simple script which turns on the AC_PROG_LIBTOOL macro.
4509+dnl But that still does not work properly since the macro is expanded outside
4510+dnl the CF_WITH_LIBTOOL macro:
4511+dnl
4512+dnl #!/bin/sh
4513+dnl ACLOCAL=`aclocal --print-ac-dir`
4514+dnl if test -z "$ACLOCAL" ; then
4515+dnl echo cannot find aclocal directory
4516+dnl exit 1
4517+dnl elif test ! -f $ACLOCAL/libtool.m4 ; then
4518+dnl echo cannot find libtool.m4 file
4519+dnl exit 1
4520+dnl fi
4521+dnl
4522+dnl LOCAL=aclocal.m4
4523+dnl ORIG=aclocal.m4.orig
4524+dnl
4525+dnl trap "mv $ORIG $LOCAL" 0 1 2 5 15
4526+dnl rm -f $ORIG
4527+dnl mv $LOCAL $ORIG
4528+dnl
4529+dnl # sed the LIBTOOL= assignment to omit the current directory?
4530+dnl sed -e 's/^LIBTOOL=.*/LIBTOOL=${LIBTOOL-libtool}/' $ACLOCAL/libtool.m4 >>$LOCAL
4531+dnl cat $ORIG >>$LOCAL
4532+dnl
4533+dnl autoconf-257 $*
4534+dnl
4535+AC_DEFUN([CF_WITH_LIBTOOL],
4536+[
4537+ifdef([AC_PROG_LIBTOOL],,[
4538+LIBTOOL=
4539+])
4540+# common library maintenance symbols that are convenient for libtool scripts:
4541+LIB_CREATE='$(AR) -cr'
4542+LIB_OBJECT='$(OBJECTS)'
4543+LIB_SUFFIX=.a
4544+LIB_PREP="$RANLIB"
4545+
4546+# symbols used to prop libtool up to enable it to determine what it should be
4547+# doing:
4548+LIB_CLEAN=
4549+LIB_COMPILE=
4550+LIB_LINK=
4551+LIB_INSTALL=
4552+LIB_UNINSTALL=
4553+
4554+AC_MSG_CHECKING(if you want to build libraries with libtool)
4555+AC_ARG_WITH(libtool,
4556+ [ --with-libtool generate libraries with libtool],
4557+ [with_libtool=$withval],
4558+ [with_libtool=no])
4559+AC_MSG_RESULT($with_libtool)
4560+if test "$with_libtool" != "no"; then
4561+ifdef([AC_PROG_LIBTOOL],[
4562+ # missing_content_AC_PROG_LIBTOOL{{
4563+ AC_PROG_LIBTOOL
4564+ # missing_content_AC_PROG_LIBTOOL}}
4565+],[
4566+ if test "$with_libtool" != "yes" ; then
4567+ CF_PATH_SYNTAX(with_libtool)
4568+ LIBTOOL=$with_libtool
4569+ else
4570+ AC_PATH_PROG(LIBTOOL,libtool)
4571+ fi
4572+ if test -z "$LIBTOOL" ; then
4573+ AC_MSG_ERROR(Cannot find libtool)
4574+ fi
4575+])dnl
4576+ LIB_CREATE='$(LIBTOOL) --mode=link $(CC) -rpath $(DESTDIR)$(libdir) -version-info `cut -f1 $(srcdir)/VERSION` -o'
4577+ LIB_OBJECT='$(OBJECTS:.o=.lo)'
4578+ LIB_SUFFIX=.la
4579+ LIB_CLEAN='$(LIBTOOL) --mode=clean'
4580+ LIB_COMPILE='$(LIBTOOL) --mode=compile'
4581+ LIB_LINK='$(LIBTOOL) --mode=link'
4582+ LIB_INSTALL='$(LIBTOOL) --mode=install'
4583+ LIB_UNINSTALL='$(LIBTOOL) --mode=uninstall'
4584+ LIB_PREP=:
4585+
4586+ # Show the version of libtool
4587+ AC_MSG_CHECKING(version of libtool)
4588+
4589+ # Save the version in a cache variable - this is not entirely a good
4590+ # thing, but the version string from libtool is very ugly, and for
4591+ # bug reports it might be useful to have the original string.
4592+ cf_cv_libtool_version=`$LIBTOOL --version 2>&1 | sed -e '2,$d' -e 's/([[^)]]*)//g' -e 's/^[[^1-9]]*//' -e 's/[[^0-9.]].*//'`
4593+ AC_MSG_RESULT($cf_cv_libtool_version)
4594+ if test -z "$cf_cv_libtool_version" ; then
4595+ AC_MSG_ERROR(This is not libtool)
4596+ fi
4597+
4598+ # special hack to add --tag option for C++ compiler
4599+ case $cf_cv_libtool_version in
4600+ 1.[[5-9]]*|[[2-9]]*)
4601+ LIBTOOL_CXX="$LIBTOOL --tag=CXX"
4602+ ;;
4603+ *)
4604+ LIBTOOL_CXX="$LIBTOOL"
4605+ ;;
4606+ esac
4607+else
4608+ LIBTOOL=""
4609+ LIBTOOL_CXX=""
4610+fi
4611+
4612+test -z "$LIBTOOL" && ECHO_LT=
4613+
4614+AC_SUBST(LIBTOOL)
4615+AC_SUBST(LIBTOOL_CXX)
4616+
4617+AC_SUBST(LIB_CREATE)
4618+AC_SUBST(LIB_OBJECT)
4619+AC_SUBST(LIB_SUFFIX)
4620+AC_SUBST(LIB_PREP)
4621+
4622+AC_SUBST(LIB_CLEAN)
4623+AC_SUBST(LIB_COMPILE)
4624+AC_SUBST(LIB_LINK)
4625+AC_SUBST(LIB_INSTALL)
4626+AC_SUBST(LIB_UNINSTALL)
4627+
4628+])dnl
4629+dnl ---------------------------------------------------------------------------
4630+dnl CF_WITH_PATH version: 6 updated: 1998/10/11 00:40:17
4631+dnl ------------
4632+dnl Wrapper for AC_ARG_WITH to ensure that user supplies a pathname, not just
4633+dnl defaulting to yes/no.
4634+dnl
4635+dnl $1 = option name
4636+dnl $2 = help-text
4637+dnl $3 = environment variable to set
4638+dnl $4 = default value, shown in the help-message, must be a constant
4639+dnl $5 = default value, if it's an expression & cannot be in the help-message
4640+dnl
4641+AC_DEFUN([CF_WITH_PATH],
4642+[AC_ARG_WITH($1,[$2 ](default: ifelse($4,,empty,$4)),,
4643+ifelse($4,,[withval="${$3}"],[withval="${$3-ifelse($5,,$4,$5)}"]))dnl
4644+CF_PATH_SYNTAX(withval)
4645+eval $3="$withval"
4646+AC_SUBST($3)dnl
4647+])dnl
4648+dnl ---------------------------------------------------------------------------
4649+dnl CF_WITH_PATHLIST version: 5 updated: 2001/12/10 01:28:30
4650+dnl ----------------
4651+dnl Process an option specifying a list of colon-separated paths.
4652+dnl
4653+dnl $1 = option name
4654+dnl $2 = help-text
4655+dnl $3 = environment variable to set
4656+dnl $4 = default value, shown in the help-message, must be a constant
4657+dnl $5 = default value, if it's an expression & cannot be in the help-message
4658+dnl $6 = flag to tell if we want to define or substitute
4659+dnl
4660+AC_DEFUN([CF_WITH_PATHLIST],[
4661+AC_REQUIRE([CF_PATHSEP])
4662+AC_ARG_WITH($1,[$2 ](default: ifelse($4,,empty,$4)),,
4663+ifelse($4,,[withval=${$3}],[withval=${$3-ifelse($5,,$4,$5)}]))dnl
4664+
4665+IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${PATHSEP}"
4666+cf_dst_path=
4667+for cf_src_path in $withval
4668+do
4669+ CF_PATH_SYNTAX(cf_src_path)
4670+ test -n "$cf_dst_path" && cf_dst_path="${cf_dst_path}:"
4671+ cf_dst_path="${cf_dst_path}${cf_src_path}"
4672+done
4673+IFS="$ac_save_ifs"
4674+
4675+ifelse($6,define,[
4676+# Strip single quotes from the value, e.g., when it was supplied as a literal
4677+# for $4 or $5.
4678+case $cf_dst_path in #(vi
4679+\'*)
4680+ cf_dst_path=`echo $cf_dst_path |sed -e s/\'// -e s/\'\$//`
4681+ ;;
4682+esac
4683+cf_dst_path=`echo "$cf_dst_path" | sed -e 's/\\\\/\\\\\\\\/g'`
4684+])
4685+
4686+eval '$3="$cf_dst_path"'
4687+AC_SUBST($3)dnl
4688+
4689+])dnl
4690+dnl ---------------------------------------------------------------------------
4691+dnl CF_WITH_REL_VERSION version: 1 updated: 2003/09/20 18:12:49
4692+dnl -------------------
4693+dnl Allow library's release-version to be overridden. Generally this happens when a
4694+dnl packager has incremented the release-version past that used in the original package,
4695+dnl and wishes to keep doing this.
4696+dnl
4697+dnl $1 is the package name, if any, to derive corresponding {package}_MAJOR
4698+dnl and {package}_MINOR symbols
4699+dnl symbol.
4700+AC_DEFUN([CF_WITH_REL_VERSION],[
4701+test -z "$cf_cv_rel_version" && cf_cv_rel_version=0.0
4702+AC_ARG_WITH(rel-version,
4703+[ --with-rel-version=XXX override derived release version],
4704+[AC_MSG_WARN(overriding release version $cf_cv_rel_version to $withval)
4705+ cf_cv_rel_version=$withval])
4706+ifelse($1,,[
4707+ CF_NUMBER_SYNTAX($cf_cv_rel_version,Release version)
4708+],[
4709+ $1_MAJOR=`echo "$cf_cv_rel_version" | sed -e 's/\..*//'`
4710+ $1_MINOR=`echo "$cf_cv_rel_version" | sed -e 's/^[[^.]]*//' -e 's/^\.//' -e 's/\..*//'`
4711+ CF_NUMBER_SYNTAX([$]$1_MAJOR,Release major-version)
4712+ CF_NUMBER_SYNTAX([$]$1_MINOR,Release minor-version)
4713+])
4714+])dnl
4715+dnl ---------------------------------------------------------------------------
4716+dnl CF_WITH_SYSMOUSE version: 2 updated: 2003/03/22 19:13:43
4717+dnl ----------------
4718+dnl If we can compile with sysmouse, make it available unless it is not wanted.
4719+AC_DEFUN([CF_WITH_SYSMOUSE],[
4720+# not everyone has "test -c"
4721+if test -c /dev/sysmouse 2>/dev/null ; then
4722+AC_MSG_CHECKING(if you want to use sysmouse)
4723+AC_ARG_WITH(sysmouse,
4724+ [ --with-sysmouse use sysmouse (FreeBSD console)],
4725+ [cf_with_sysmouse=$withval],
4726+ [cf_with_sysmouse=maybe])
4727+ if test "$cf_with_sysmouse" != no ; then
4728+ AC_TRY_COMPILE([
4729+#include <osreldate.h>
4730+#if (__FreeBSD_version >= 400017)
4731+#include <sys/consio.h>
4732+#include <sys/fbio.h>
4733+#else
4734+#include <machine/console.h>
4735+#endif
4736+],[
4737+ struct mouse_info the_mouse;
4738+ ioctl(0, CONS_MOUSECTL, &the_mouse);
4739+],[cf_with_sysmouse=yes],[cf_with_sysmouse=no])
4740+ fi
4741+AC_MSG_RESULT($cf_with_sysmouse)
4742+test "$cf_with_sysmouse" = yes && AC_DEFINE(USE_SYSMOUSE)
4743+fi
4744+])dnl
4745+dnl ---------------------------------------------------------------------------
4746+dnl CF_XOPEN_SOURCE version: 11 updated: 2004/01/26 20:58:41
4747+dnl ---------------
4748+dnl Try to get _XOPEN_SOURCE defined properly that we can use POSIX functions,
4749+dnl or adapt to the vendor's definitions to get equivalent functionality.
4750+AC_DEFUN([CF_XOPEN_SOURCE],[
4751+case $host_os in #(vi
4752+freebsd*) #(vi
4753+ CPPFLAGS="$CPPFLAGS -D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600"
4754+ ;;
4755+hpux*) #(vi
4756+ CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE"
4757+ ;;
4758+irix6.*) #(vi
4759+ CPPFLAGS="$CPPFLAGS -D_SGI_SOURCE"
4760+ ;;
4761+linux*) #(vi
4762+ CF_GNU_SOURCE
4763+ ;;
4764+mirbsd*) #(vi
4765+ # setting _XOPEN_SOURCE or _POSIX_SOURCE breaks <arpa/inet.h>
4766+ ;;
4767+netbsd*) #(vi
4768+ # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw
4769+ ;;
4770+openbsd*) #(vi
4771+ # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw
4772+ ;;
4773+osf[[45]]*) #(vi
4774+ CPPFLAGS="$CPPFLAGS -D_OSF_SOURCE"
4775+ ;;
4776+sco*) #(vi
4777+ # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer
4778+ ;;
4779+solaris*) #(vi
4780+ CPPFLAGS="$CPPFLAGS -D__EXTENSIONS__"
4781+ ;;
4782+*)
4783+ AC_CACHE_CHECK(if we should define _XOPEN_SOURCE,cf_cv_xopen_source,[
4784+ AC_TRY_COMPILE([#include <sys/types.h>],[
4785+#ifndef _XOPEN_SOURCE
4786+make an error
4787+#endif],
4788+ [cf_cv_xopen_source=no],
4789+ [cf_save="$CPPFLAGS"
4790+ CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=500"
4791+ AC_TRY_COMPILE([#include <sys/types.h>],[
4792+#ifdef _XOPEN_SOURCE
4793+make an error
4794+#endif],
4795+ [cf_cv_xopen_source=no],
4796+ [cf_cv_xopen_source=yes])
4797+ CPPFLAGS="$cf_save"
4798+ ])
4799+])
4800+test "$cf_cv_xopen_source" = yes && CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=500"
4801+
4802+ # FreeBSD 5.x headers demand this...
4803+ AC_CACHE_CHECK(if we should define _POSIX_C_SOURCE,cf_cv_xopen_source,[
4804+ AC_TRY_COMPILE([#include <sys/types.h>],[
4805+#ifndef _POSIX_C_SOURCE
4806+make an error
4807+#endif],
4808+ [cf_cv_xopen_source=no],
4809+ [cf_save="$CPPFLAGS"
4810+ CPPFLAGS="$CPPFLAGS -D_POSIX_C_SOURCE"
4811+ AC_TRY_COMPILE([#include <sys/types.h>],[
4812+#ifdef _POSIX_C_SOURCE
4813+make an error
4814+#endif],
4815+ [cf_cv_xopen_source=no],
4816+ [cf_cv_xopen_source=yes])
4817+ CPPFLAGS="$cf_save"
4818+ ])
4819+])
4820+test "$cf_cv_xopen_source" = yes && CPPFLAGS="$CPPFLAGS -D_POSIX_C_SOURCE"
4821+ ;;
4822+esac
4823+])
4824--- /dev/null
4825+++ ncurses-5.4/m4/templates.m4
4826@@ -0,0 +1,78 @@
4827+AH_TEMPLATE([BROKEN_LINKER], [too lazy to enter descriptions])
4828+AH_TEMPLATE([BSD_TPUTS], [too lazy to enter descriptions])
4829+AH_TEMPLATE([CC_HAS_INLINE_FUNCS], [too lazy to enter descriptions])
4830+AH_TEMPLATE([CC_HAS_PROTOS], [too lazy to enter descriptions])
4831+AH_TEMPLATE([CPP_HAS_PARAM_INIT], [too lazy to enter descriptions])
4832+AH_TEMPLATE([CPP_HAS_VSCAN_FUNC], [too lazy to enter descriptions])
4833+AH_TEMPLATE([HAVE_BIG_CORE], [too lazy to enter descriptions])
4834+AH_TEMPLATE([HAVE_BSD_CGETENT], [too lazy to enter descriptions])
4835+AH_TEMPLATE([HAVE_BUILTIN_H], [too lazy to enter descriptions])
4836+AH_TEMPLATE([HAVE_CURSES_VERSION], [too lazy to enter descriptions])
4837+AH_TEMPLATE([HAVE_GETTIMEOFDAY], [too lazy to enter descriptions])
4838+AH_TEMPLATE([HAVE_GPP_BUILTIN_H], [too lazy to enter descriptions])
4839+AH_TEMPLATE([HAVE_GXX_BUILTIN_H], [too lazy to enter descriptions])
4840+AH_TEMPLATE([HAVE_HAS_KEY], [too lazy to enter descriptions])
4841+AH_TEMPLATE([HAVE_ISASCII], [too lazy to enter descriptions])
4842+AH_TEMPLATE([HAVE_LIBGPM], [too lazy to enter descriptions])
4843+AH_TEMPLATE([HAVE_LIBUTF8_H], [too lazy to enter descriptions])
4844+AH_TEMPLATE([HAVE_MKSTEMP], [too lazy to enter descriptions])
4845+AH_TEMPLATE([HAVE_NC_ALLOC_H], [too lazy to enter descriptions])
4846+AH_TEMPLATE([HAVE_REGEXPR_H_FUNCS], [too lazy to enter descriptions])
4847+AH_TEMPLATE([HAVE_REGEXP_H_FUNCS], [too lazy to enter descriptions])
4848+AH_TEMPLATE([HAVE_REGEX_H_FUNCS], [too lazy to enter descriptions])
4849+AH_TEMPLATE([HAVE_RESIZETERM], [too lazy to enter descriptions])
4850+AH_TEMPLATE([HAVE_RESIZE_TERM], [too lazy to enter descriptions])
4851+AH_TEMPLATE([HAVE_SIZECHANGE], [too lazy to enter descriptions])
4852+AH_TEMPLATE([HAVE_SLK_COLOR], [too lazy to enter descriptions])
4853+AH_TEMPLATE([HAVE_SYS_TIME_SELECT], [too lazy to enter descriptions])
4854+AH_TEMPLATE([HAVE_TCGETATTR], [too lazy to enter descriptions])
4855+AH_TEMPLATE([HAVE_TYPE_SIGACTION], [too lazy to enter descriptions])
4856+AH_TEMPLATE([HAVE_USE_DEFAULT_COLORS], [too lazy to enter descriptions])
4857+AH_TEMPLATE([HAVE_VFSCANF], [too lazy to enter descriptions])
4858+AH_TEMPLATE([HAVE_VSSCANF], [too lazy to enter descriptions])
4859+AH_TEMPLATE([HAVE_WORKING_POLL], [too lazy to enter descriptions])
4860+AH_TEMPLATE([HAVE_WRESIZE], [too lazy to enter descriptions])
4861+AH_TEMPLATE([HAVE__DOSCAN], [too lazy to enter descriptions])
4862+AH_TEMPLATE([MIXEDCASE_FILENAMES], [too lazy to enter descriptions])
4863+AH_TEMPLATE([NCURSES_EXPANDED], [too lazy to enter descriptions])
4864+AH_TEMPLATE([NCURSES_EXT_FUNCS], [too lazy to enter descriptions])
4865+AH_TEMPLATE([NCURSES_NOMACROS], [too lazy to enter descriptions])
4866+AH_TEMPLATE([NCURSES_NO_PADDING], [too lazy to enter descriptions])
4867+AH_TEMPLATE([NCURSES_PATHSEP], [too lazy to enter descriptions])
4868+AH_TEMPLATE([NCURSES_VERSION_STRING], [too lazy to enter descriptions])
4869+AH_TEMPLATE([NDEBUG], [too lazy to enter descriptions])
4870+AH_TEMPLATE([NEED_WCHAR_H], [too lazy to enter descriptions])
4871+AH_TEMPLATE([NO_LEAKS], [too lazy to enter descriptions])
4872+AH_TEMPLATE([PROG_EXT], [too lazy to enter descriptions])
4873+AH_TEMPLATE([PURE_TERMINFO], [too lazy to enter descriptions])
4874+AH_TEMPLATE([SVR4_ACTION], [too lazy to enter descriptions])
4875+AH_TEMPLATE([SVR4_TERMIO], [too lazy to enter descriptions])
4876+AH_TEMPLATE([SYSTEM_NAME], [too lazy to enter descriptions])
4877+AH_TEMPLATE([TERMINFO], [too lazy to enter descriptions])
4878+AH_TEMPLATE([TERMINFO_DIRS], [too lazy to enter descriptions])
4879+AH_TEMPLATE([TERMPATH], [too lazy to enter descriptions])
4880+AH_TEMPLATE([TYPEOF_CHTYPE], [too lazy to enter descriptions])
4881+AH_TEMPLATE([USE_ASSUMED_COLOR], [too lazy to enter descriptions])
4882+AH_TEMPLATE([USE_COLORFGBG], [too lazy to enter descriptions])
4883+AH_TEMPLATE([USE_DATABASE], [too lazy to enter descriptions])
4884+AH_TEMPLATE([USE_GETCAP], [too lazy to enter descriptions])
4885+AH_TEMPLATE([USE_GETCAP_CACHE], [too lazy to enter descriptions])
4886+AH_TEMPLATE([USE_HARD_TABS], [too lazy to enter descriptions])
4887+AH_TEMPLATE([USE_HASHMAP], [too lazy to enter descriptions])
4888+AH_TEMPLATE([USE_HOME_TERMINFO], [too lazy to enter descriptions])
4889+AH_TEMPLATE([USE_LINKS], [too lazy to enter descriptions])
4890+AH_TEMPLATE([USE_MY_MEMMOVE], [too lazy to enter descriptions])
4891+AH_TEMPLATE([USE_OK_BCOPY], [too lazy to enter descriptions])
4892+AH_TEMPLATE([USE_RCS_IDS], [too lazy to enter descriptions])
4893+AH_TEMPLATE([USE_ROOT_ENVIRON], [too lazy to enter descriptions])
4894+AH_TEMPLATE([USE_SAFE_SPRINTF], [too lazy to enter descriptions])
4895+AH_TEMPLATE([USE_SCROLL_HINTS], [too lazy to enter descriptions])
4896+AH_TEMPLATE([USE_SIGWINCH], [too lazy to enter descriptions])
4897+AH_TEMPLATE([USE_STDIO_VSCAN], [too lazy to enter descriptions])
4898+AH_TEMPLATE([USE_STRSTREAM_VSCAN], [too lazy to enter descriptions])
4899+AH_TEMPLATE([USE_STRSTREAM_VSCAN_CAST], [too lazy to enter descriptions])
4900+AH_TEMPLATE([USE_SYMLINKS], [too lazy to enter descriptions])
4901+AH_TEMPLATE([USE_SYSMOUSE], [too lazy to enter descriptions])
4902+AH_TEMPLATE([USE_TERMCAP], [too lazy to enter descriptions])
4903+AH_TEMPLATE([USE_WIDEC_SUPPORT], [too lazy to enter descriptions])
4904+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 0000000000..e69c1c0673
--- /dev/null
+++ b/meta/recipes-core/ncurses/ncurses_5.4.bb
@@ -0,0 +1,8 @@
1PR = "r14"
2
3SRC_URI = "${GNU_MIRROR}/ncurses/ncurses-${PV}.tar.gz \
4 file://makefile_tweak.patch;patch=1 \
5 file://visibility.patch;patch=1"
6S = "${WORKDIR}/ncurses-${PV}"
7
8require 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 0000000000..8a45f99084
--- /dev/null
+++ b/meta/recipes-core/readline/files/acinclude.m4
@@ -0,0 +1,1815 @@
1dnl
2dnl Bash specific tests
3dnl
4dnl Some derived from PDKSH 5.1.3 autoconf tests
5dnl
6
7AC_DEFUN([BASH_C_LONG_LONG],
8[AC_CACHE_CHECK(for long long, ac_cv_c_long_long,
9[if test "$GCC" = yes; then
10 ac_cv_c_long_long=yes
11else
12AC_TRY_RUN([
13int
14main()
15{
16long long foo = 0;
17exit(sizeof(long long) < sizeof(long));
18}
19], ac_cv_c_long_long=yes, ac_cv_c_long_long=no)
20fi])
21if test $ac_cv_c_long_long = yes; then
22 AC_DEFINE(HAVE_LONG_LONG, 1, [Define if the `long long' type works.])
23fi
24])
25
26dnl
27dnl This is very similar to AC_C_LONG_DOUBLE, with the fix for IRIX
28dnl (< changed to <=) added.
29dnl
30AC_DEFUN([BASH_C_LONG_DOUBLE],
31[AC_CACHE_CHECK(for long double, ac_cv_c_long_double,
32[if test "$GCC" = yes; then
33 ac_cv_c_long_double=yes
34else
35AC_TRY_RUN([
36int
37main()
38{
39 /* The Stardent Vistra knows sizeof(long double), but does not
40 support it. */
41 long double foo = 0.0;
42 /* On Ultrix 4.3 cc, long double is 4 and double is 8. */
43 /* On IRIX 5.3, the compiler converts long double to double with a warning,
44 but compiles this successfully. */
45 exit(sizeof(long double) <= sizeof(double));
46}
47], ac_cv_c_long_double=yes, ac_cv_c_long_double=no)
48fi])
49if test $ac_cv_c_long_double = yes; then
50 AC_DEFINE(HAVE_LONG_DOUBLE, 1, [Define if the `long double' type works.])
51fi
52])
53
54dnl
55dnl Check for <inttypes.h>. This is separated out so that it can be
56dnl AC_REQUIREd.
57dnl
58dnl BASH_HEADER_INTTYPES
59AC_DEFUN([BASH_HEADER_INTTYPES],
60[
61 AC_CHECK_HEADERS(inttypes.h)
62])
63
64dnl
65dnl check for typedef'd symbols in header files, but allow the caller to
66dnl specify the include files to be checked in addition to the default
67dnl
68dnl BASH_CHECK_TYPE(TYPE, HEADERS, DEFAULT[, VALUE-IF-FOUND])
69AC_DEFUN([BASH_CHECK_TYPE],
70[
71AC_REQUIRE([AC_HEADER_STDC])dnl
72AC_REQUIRE([BASH_HEADER_INTTYPES])
73AC_MSG_CHECKING(for $1)
74AC_CACHE_VAL(bash_cv_type_$1,
75[AC_EGREP_CPP($1, [#include <sys/types.h>
76#if STDC_HEADERS
77#include <stdlib.h>
78#include <stddef.h>
79#endif
80#if HAVE_INTTYPES_H
81#include <inttypes.h>
82#endif
83$2
84], bash_cv_type_$1=yes, bash_cv_type_$1=no)])
85AC_MSG_RESULT($bash_cv_type_$1)
86ifelse($#, 4, [if test $bash_cv_type_$1 = yes; then
87 AC_DEFINE($4)
88 fi])
89if test $bash_cv_type_$1 = no; then
90 AC_DEFINE_UNQUOTED($1, $3)
91fi
92])
93
94dnl
95dnl BASH_CHECK_DECL(FUNC)
96dnl
97dnl Check for a declaration of FUNC in stdlib.h and inttypes.h like
98dnl AC_CHECK_DECL
99dnl
100AC_DEFUN([BASH_CHECK_DECL],
101[
102AC_REQUIRE([AC_HEADER_STDC])
103AC_REQUIRE([BASH_HEADER_INTTYPES])
104AC_CACHE_CHECK([for declaration of $1], bash_cv_decl_$1,
105[AC_TRY_LINK(
106[
107#if STDC_HEADERS
108# include <stdlib.h>
109#endif
110#if HAVE_INTTYPES_H
111# include <inttypes.h>
112#endif
113],
114[return !$1;],
115bash_cv_decl_$1=yes, bash_cv_decl_$1=no)])
116bash_tr_func=HAVE_DECL_`echo $1 | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
117if test $bash_cv_decl_$1 = yes; then
118 AC_DEFINE_UNQUOTED($bash_tr_func, 1)
119else
120 AC_DEFINE_UNQUOTED($bash_tr_func, 0)
121fi
122])
123
124AC_DEFUN([BASH_DECL_PRINTF],
125[AC_MSG_CHECKING(for declaration of printf in <stdio.h>)
126AC_CACHE_VAL(bash_cv_printf_declared,
127[AC_TRY_RUN([
128#include <stdio.h>
129#ifdef __STDC__
130typedef int (*_bashfunc)(const char *, ...);
131#else
132typedef int (*_bashfunc)();
133#endif
134main()
135{
136_bashfunc pf;
137pf = (_bashfunc) printf;
138exit(pf == 0);
139}
140], bash_cv_printf_declared=yes, bash_cv_printf_declared=no,
141 [AC_MSG_WARN(cannot check printf declaration if cross compiling -- defaulting to yes)
142 bash_cv_printf_declared=yes]
143)])
144AC_MSG_RESULT($bash_cv_printf_declared)
145if test $bash_cv_printf_declared = yes; then
146AC_DEFINE(PRINTF_DECLARED)
147fi
148])
149
150AC_DEFUN([BASH_DECL_SBRK],
151[AC_MSG_CHECKING(for declaration of sbrk in <unistd.h>)
152AC_CACHE_VAL(bash_cv_sbrk_declared,
153[AC_EGREP_HEADER(sbrk, unistd.h,
154 bash_cv_sbrk_declared=yes, bash_cv_sbrk_declared=no)])
155AC_MSG_RESULT($bash_cv_sbrk_declared)
156if test $bash_cv_sbrk_declared = yes; then
157AC_DEFINE(SBRK_DECLARED)
158fi
159])
160
161dnl
162dnl Check for sys_siglist[] or _sys_siglist[]
163dnl
164AC_DEFUN([BASH_DECL_UNDER_SYS_SIGLIST],
165[AC_MSG_CHECKING([for _sys_siglist in signal.h or unistd.h])
166AC_CACHE_VAL(bash_cv_decl_under_sys_siglist,
167[AC_TRY_COMPILE([
168#include <sys/types.h>
169#include <signal.h>
170#ifdef HAVE_UNISTD_H
171#include <unistd.h>
172#endif], [ char *msg = _sys_siglist[2]; ],
173 bash_cv_decl_under_sys_siglist=yes, bash_cv_decl_under_sys_siglist=no,
174 [AC_MSG_WARN(cannot check for _sys_siglist[] if cross compiling -- defaulting to no)])])dnl
175AC_MSG_RESULT($bash_cv_decl_under_sys_siglist)
176if test $bash_cv_decl_under_sys_siglist = yes; then
177AC_DEFINE(UNDER_SYS_SIGLIST_DECLARED)
178fi
179])
180
181AC_DEFUN([BASH_UNDER_SYS_SIGLIST],
182[AC_REQUIRE([BASH_DECL_UNDER_SYS_SIGLIST])
183AC_MSG_CHECKING([for _sys_siglist in system C library])
184AC_CACHE_VAL(bash_cv_under_sys_siglist,
185[AC_TRY_RUN([
186#include <sys/types.h>
187#include <signal.h>
188#ifdef HAVE_UNISTD_H
189#include <unistd.h>
190#endif
191#ifndef UNDER_SYS_SIGLIST_DECLARED
192extern char *_sys_siglist[];
193#endif
194main()
195{
196char *msg = (char *)_sys_siglist[2];
197exit(msg == 0);
198}],
199 bash_cv_under_sys_siglist=yes, bash_cv_under_sys_siglist=no,
200 [AC_MSG_WARN(cannot check for _sys_siglist[] if cross compiling -- defaulting to no)
201 bash_cv_under_sys_siglist=no])])
202AC_MSG_RESULT($bash_cv_under_sys_siglist)
203if test $bash_cv_under_sys_siglist = yes; then
204AC_DEFINE(HAVE_UNDER_SYS_SIGLIST)
205fi
206])
207
208AC_DEFUN([BASH_SYS_SIGLIST],
209[
210AC_CHECK_DECLS([sys_siglist])
211AC_MSG_CHECKING([for sys_siglist in system C library])
212AC_CACHE_VAL(bash_cv_sys_siglist,
213[AC_TRY_RUN([
214#include <sys/types.h>
215#include <signal.h>
216#ifdef HAVE_UNISTD_H
217#include <unistd.h>
218#endif
219#ifndef HAVE_DECL_SYS_SIGLIST
220extern char *sys_siglist[];
221#endif
222main()
223{
224char *msg = sys_siglist[2];
225exit(msg == 0);
226}],
227 bash_cv_sys_siglist=yes, bash_cv_sys_siglist=no,
228 [AC_MSG_WARN(cannot check for sys_siglist if cross compiling -- defaulting to no)
229 bash_cv_sys_siglist=no])])
230AC_MSG_RESULT($bash_cv_sys_siglist)
231if test $bash_cv_sys_siglist = yes; then
232AC_DEFINE(HAVE_SYS_SIGLIST)
233fi
234])
235
236dnl Check for the various permutations of sys_siglist and make sure we
237dnl compile in siglist.o if they're not defined
238AC_DEFUN([BASH_CHECK_SYS_SIGLIST], [
239AC_REQUIRE([BASH_SYS_SIGLIST])
240AC_REQUIRE([BASH_DECL_UNDER_SYS_SIGLIST])
241AC_REQUIRE([BASH_FUNC_STRSIGNAL])
242if test "$bash_cv_sys_siglist" = no && test "$bash_cv_under_sys_siglist" = no && test "$bash_cv_have_strsignal" = no; then
243 SIGLIST_O=siglist.o
244else
245 SIGLIST_O=
246fi
247AC_SUBST([SIGLIST_O])
248])
249
250dnl Check for sys_errlist[] and sys_nerr, check for declaration
251AC_DEFUN([BASH_SYS_ERRLIST],
252[AC_MSG_CHECKING([for sys_errlist and sys_nerr])
253AC_CACHE_VAL(bash_cv_sys_errlist,
254[AC_TRY_LINK([#include <errno.h>],
255[extern char *sys_errlist[];
256 extern int sys_nerr;
257 char *msg = sys_errlist[sys_nerr - 1];],
258 bash_cv_sys_errlist=yes, bash_cv_sys_errlist=no)])dnl
259AC_MSG_RESULT($bash_cv_sys_errlist)
260if test $bash_cv_sys_errlist = yes; then
261AC_DEFINE(HAVE_SYS_ERRLIST)
262fi
263])
264
265dnl
266dnl Check if dup2() does not clear the close on exec flag
267dnl
268AC_DEFUN([BASH_FUNC_DUP2_CLOEXEC_CHECK],
269[AC_MSG_CHECKING(if dup2 fails to clear the close-on-exec flag)
270AC_CACHE_VAL(bash_cv_dup2_broken,
271[AC_TRY_RUN([
272#include <sys/types.h>
273#include <fcntl.h>
274main()
275{
276 int fd1, fd2, fl;
277 fd1 = open("/dev/null", 2);
278 if (fcntl(fd1, 2, 1) < 0)
279 exit(1);
280 fd2 = dup2(fd1, 1);
281 if (fd2 < 0)
282 exit(2);
283 fl = fcntl(fd2, 1, 0);
284 /* fl will be 1 if dup2 did not reset the close-on-exec flag. */
285 exit(fl != 1);
286}
287], bash_cv_dup2_broken=yes, bash_cv_dup2_broken=no,
288 [AC_MSG_WARN(cannot check dup2 if cross compiling -- defaulting to no)
289 bash_cv_dup2_broken=no])
290])
291AC_MSG_RESULT($bash_cv_dup2_broken)
292if test $bash_cv_dup2_broken = yes; then
293AC_DEFINE(DUP2_BROKEN)
294fi
295])
296
297AC_DEFUN([BASH_FUNC_STRSIGNAL],
298[AC_MSG_CHECKING([for the existence of strsignal])
299AC_CACHE_VAL(bash_cv_have_strsignal,
300[AC_TRY_LINK([#include <sys/types.h>
301#include <signal.h>],
302[char *s = (char *)strsignal(2);],
303 bash_cv_have_strsignal=yes, bash_cv_have_strsignal=no)])
304AC_MSG_RESULT($bash_cv_have_strsignal)
305if test $bash_cv_have_strsignal = yes; then
306AC_DEFINE(HAVE_STRSIGNAL)
307fi
308])
309
310dnl Check to see if opendir will open non-directories (not a nice thing)
311AC_DEFUN([BASH_FUNC_OPENDIR_CHECK],
312[AC_REQUIRE([AC_HEADER_DIRENT])dnl
313AC_MSG_CHECKING(if opendir() opens non-directories)
314AC_CACHE_VAL(bash_cv_opendir_not_robust,
315[AC_TRY_RUN([
316#include <stdio.h>
317#include <sys/types.h>
318#include <fcntl.h>
319#ifdef HAVE_UNISTD_H
320# include <unistd.h>
321#endif /* HAVE_UNISTD_H */
322#if defined(HAVE_DIRENT_H)
323# include <dirent.h>
324#else
325# define dirent direct
326# ifdef HAVE_SYS_NDIR_H
327# include <sys/ndir.h>
328# endif /* SYSNDIR */
329# ifdef HAVE_SYS_DIR_H
330# include <sys/dir.h>
331# endif /* SYSDIR */
332# ifdef HAVE_NDIR_H
333# include <ndir.h>
334# endif
335#endif /* HAVE_DIRENT_H */
336main()
337{
338DIR *dir;
339int fd, err;
340err = mkdir("/tmp/bash-aclocal", 0700);
341if (err < 0) {
342 perror("mkdir");
343 exit(1);
344}
345unlink("/tmp/bash-aclocal/not_a_directory");
346fd = open("/tmp/bash-aclocal/not_a_directory", O_WRONLY|O_CREAT|O_EXCL, 0666);
347write(fd, "\n", 1);
348close(fd);
349dir = opendir("/tmp/bash-aclocal/not_a_directory");
350unlink("/tmp/bash-aclocal/not_a_directory");
351rmdir("/tmp/bash-aclocal");
352exit (dir == 0);
353}], bash_cv_opendir_not_robust=yes,bash_cv_opendir_not_robust=no,
354 [AC_MSG_WARN(cannot check opendir if cross compiling -- defaulting to no)
355 bash_cv_opendir_not_robust=no]
356)])
357AC_MSG_RESULT($bash_cv_opendir_not_robust)
358if test $bash_cv_opendir_not_robust = yes; then
359AC_DEFINE(OPENDIR_NOT_ROBUST)
360fi
361])
362
363dnl
364AH_TEMPLATE([VOID_SIGHANDLER], [Define if signal handlers return type void])
365AC_DEFUN([BASH_TYPE_SIGHANDLER],
366[AC_MSG_CHECKING([whether signal handlers are of type void])
367AC_CACHE_VAL(bash_cv_void_sighandler,
368[AC_TRY_COMPILE([#include <sys/types.h>
369#include <signal.h>
370#ifdef signal
371#undef signal
372#endif
373#ifdef __cplusplus
374extern "C"
375#endif
376void (*signal ()) ();],
377[int i;], bash_cv_void_sighandler=yes, bash_cv_void_sighandler=no)])dnl
378AC_MSG_RESULT($bash_cv_void_sighandler)
379if test $bash_cv_void_sighandler = yes; then
380AC_DEFINE(VOID_SIGHANDLER)
381fi
382])
383
384dnl
385dnl A signed 16-bit integer quantity
386dnl
387AC_DEFUN([BASH_TYPE_BITS16_T],
388[
389if test "$ac_cv_sizeof_short" = 2; then
390 AC_CHECK_TYPE(bits16_t, short)
391elif test "$ac_cv_sizeof_char" = 2; then
392 AC_CHECK_TYPE(bits16_t, char)
393else
394 AC_CHECK_TYPE(bits16_t, short)
395fi
396])
397
398dnl
399dnl An unsigned 16-bit integer quantity
400dnl
401AC_DEFUN([BASH_TYPE_U_BITS16_T],
402[
403if test "$ac_cv_sizeof_short" = 2; then
404 AC_CHECK_TYPE(u_bits16_t, unsigned short)
405elif test "$ac_cv_sizeof_char" = 2; then
406 AC_CHECK_TYPE(u_bits16_t, unsigned char)
407else
408 AC_CHECK_TYPE(u_bits16_t, unsigned short)
409fi
410])
411
412dnl
413dnl A signed 32-bit integer quantity
414dnl
415AC_DEFUN([BASH_TYPE_BITS32_T],
416[
417if test "$ac_cv_sizeof_int" = 4; then
418 AC_CHECK_TYPE(bits32_t, int)
419elif test "$ac_cv_sizeof_long" = 4; then
420 AC_CHECK_TYPE(bits32_t, long)
421else
422 AC_CHECK_TYPE(bits32_t, int)
423fi
424])
425
426dnl
427dnl An unsigned 32-bit integer quantity
428dnl
429AC_DEFUN([BASH_TYPE_U_BITS32_T],
430[
431if test "$ac_cv_sizeof_int" = 4; then
432 AC_CHECK_TYPE(u_bits32_t, unsigned int)
433elif test "$ac_cv_sizeof_long" = 4; then
434 AC_CHECK_TYPE(u_bits32_t, unsigned long)
435else
436 AC_CHECK_TYPE(u_bits32_t, unsigned int)
437fi
438])
439
440AC_DEFUN([BASH_TYPE_PTRDIFF_T],
441[
442if test "$ac_cv_sizeof_int" = "$ac_cv_sizeof_char_p"; then
443 AC_CHECK_TYPE(ptrdiff_t, int)
444elif test "$ac_cv_sizeof_long" = "$ac_cv_sizeof_char_p"; then
445 AC_CHECK_TYPE(ptrdiff_t, long)
446elif test "$ac_cv_type_long_long" = yes && test "$ac_cv_sizeof_long_long" = "$ac_cv_sizeof_char_p"; then
447 AC_CHECK_TYPE(ptrdiff_t, [long long])
448else
449 AC_CHECK_TYPE(ptrdiff_t, int)
450fi
451])
452
453dnl
454dnl A signed 64-bit quantity
455dnl
456AC_DEFUN([BASH_TYPE_BITS64_T],
457[
458if test "$ac_cv_sizeof_char_p" = 8; then
459 AC_CHECK_TYPE(bits64_t, char *)
460elif test "$ac_cv_sizeof_double" = 8; then
461 AC_CHECK_TYPE(bits64_t, double)
462elif test -n "$ac_cv_type_long_long" && test "$ac_cv_sizeof_long_long" = 8; then
463 AC_CHECK_TYPE(bits64_t, [long long])
464elif test "$ac_cv_sizeof_long" = 8; then
465 AC_CHECK_TYPE(bits64_t, long)
466else
467 AC_CHECK_TYPE(bits64_t, double)
468fi
469])
470
471AC_DEFUN([BASH_TYPE_LONG_LONG],
472[
473AC_CACHE_CHECK([for long long], bash_cv_type_long_long,
474[AC_TRY_LINK([
475long long ll = 1; int i = 63;],
476[
477long long llm = (long long) -1;
478return ll << i | ll >> i | llm / ll | llm % ll;
479], bash_cv_type_long_long='long long', bash_cv_type_long_long='long')])
480if test "$bash_cv_type_long_long" = 'long long'; then
481 AC_DEFINE(HAVE_LONG_LONG, 1)
482fi
483])
484
485AC_DEFUN([BASH_TYPE_UNSIGNED_LONG_LONG],
486[
487AC_CACHE_CHECK([for unsigned long long], bash_cv_type_unsigned_long_long,
488[AC_TRY_LINK([
489unsigned long long ull = 1; int i = 63;],
490[
491unsigned long long ullmax = (unsigned long long) -1;
492return ull << i | ull >> i | ullmax / ull | ullmax % ull;
493], bash_cv_type_unsigned_long_long='unsigned long long',
494 bash_cv_type_unsigned_long_long='unsigned long')])
495if test "$bash_cv_type_unsigned_long_long" = 'unsigned long long'; then
496 AC_DEFINE(HAVE_UNSIGNED_LONG_LONG, 1)
497fi
498])
499
500dnl
501dnl Type of struct rlimit fields: some systems (OSF/1, NetBSD, RISC/os 5.0)
502dnl have a rlim_t, others (4.4BSD based systems) use quad_t, others use
503dnl long and still others use int (HP-UX 9.01, SunOS 4.1.3). To simplify
504dnl matters, this just checks for rlim_t, quad_t, or long.
505dnl
506AC_DEFUN([BASH_TYPE_RLIMIT],
507[AC_MSG_CHECKING(for size and type of struct rlimit fields)
508AC_CACHE_VAL(bash_cv_type_rlimit,
509[AC_TRY_COMPILE([#include <sys/types.h>
510#include <sys/resource.h>],
511[rlim_t xxx;], bash_cv_type_rlimit=rlim_t,[
512AC_TRY_RUN([
513#include <sys/types.h>
514#include <sys/time.h>
515#include <sys/resource.h>
516main()
517{
518#ifdef HAVE_QUAD_T
519 struct rlimit rl;
520 if (sizeof(rl.rlim_cur) == sizeof(quad_t))
521 exit(0);
522#endif
523 exit(1);
524}], bash_cv_type_rlimit=quad_t, bash_cv_type_rlimit=long,
525 [AC_MSG_WARN(cannot check quad_t if cross compiling -- defaulting to long)
526 bash_cv_type_rlimit=long])])
527])
528AC_MSG_RESULT($bash_cv_type_rlimit)
529if test $bash_cv_type_rlimit = quad_t; then
530AC_DEFINE(RLIMTYPE, quad_t)
531elif test $bash_cv_type_rlimit = rlim_t; then
532AC_DEFINE(RLIMTYPE, rlim_t)
533fi
534])
535
536AC_DEFUN([BASH_FUNC_LSTAT],
537[dnl Cannot use AC_CHECK_FUNCS(lstat) because Linux defines lstat() as an
538dnl inline function in <sys/stat.h>.
539AC_CACHE_CHECK([for lstat], bash_cv_func_lstat,
540[AC_TRY_LINK([
541#include <sys/types.h>
542#include <sys/stat.h>
543],[ lstat(".",(struct stat *)0); ],
544bash_cv_func_lstat=yes, bash_cv_func_lstat=no)])
545if test $bash_cv_func_lstat = yes; then
546 AC_DEFINE(HAVE_LSTAT)
547fi
548])
549
550AC_DEFUN([BASH_FUNC_INET_ATON],
551[
552AC_CACHE_CHECK([for inet_aton], bash_cv_func_inet_aton,
553[AC_TRY_LINK([
554#include <sys/types.h>
555#include <netinet/in.h>
556#include <arpa/inet.h>
557struct in_addr ap;], [ inet_aton("127.0.0.1", &ap); ],
558bash_cv_func_inet_aton=yes, bash_cv_func_inet_aton=no)])
559if test $bash_cv_func_inet_aton = yes; then
560 AC_DEFINE(HAVE_INET_ATON)
561else
562 AC_LIBOBJ(inet_aton)
563fi
564])
565
566AC_DEFUN([BASH_FUNC_GETENV],
567[AC_MSG_CHECKING(to see if getenv can be redefined)
568AC_CACHE_VAL(bash_cv_getenv_redef,
569[AC_TRY_RUN([
570#ifdef HAVE_UNISTD_H
571# include <unistd.h>
572#endif
573#ifndef __STDC__
574# ifndef const
575# define const
576# endif
577#endif
578char *
579getenv (name)
580#if defined (__linux__) || defined (__bsdi__) || defined (convex)
581 const char *name;
582#else
583 char const *name;
584#endif /* !__linux__ && !__bsdi__ && !convex */
585{
586return "42";
587}
588main()
589{
590char *s;
591/* The next allows this program to run, but does not allow bash to link
592 when it redefines getenv. I'm not really interested in figuring out
593 why not. */
594#if defined (NeXT)
595exit(1);
596#endif
597s = getenv("ABCDE");
598exit(s == 0); /* force optimizer to leave getenv in */
599}
600], bash_cv_getenv_redef=yes, bash_cv_getenv_redef=no,
601 [AC_MSG_WARN(cannot check getenv redefinition if cross compiling -- defaulting to yes)
602 bash_cv_getenv_redef=yes]
603)])
604AC_MSG_RESULT($bash_cv_getenv_redef)
605if test $bash_cv_getenv_redef = yes; then
606AC_DEFINE(CAN_REDEFINE_GETENV)
607fi
608])
609
610# We should check for putenv before calling this
611AC_DEFUN([BASH_FUNC_STD_PUTENV],
612[
613AC_REQUIRE([AC_HEADER_STDC])
614AC_REQUIRE([AC_C_PROTOTYPES])
615AC_CACHE_CHECK([for standard-conformant putenv declaration], bash_cv_std_putenv,
616[AC_TRY_LINK([
617#if STDC_HEADERS
618#include <stdlib.h>
619#include <stddef.h>
620#endif
621#ifndef __STDC__
622# ifndef const
623# define const
624# endif
625#endif
626#ifdef PROTOTYPES
627extern int putenv (char *);
628#else
629extern int putenv ();
630#endif
631],
632[return (putenv == 0);],
633bash_cv_std_putenv=yes, bash_cv_std_putenv=no
634)])
635if test $bash_cv_std_putenv = yes; then
636AC_DEFINE(HAVE_STD_PUTENV)
637fi
638])
639
640# We should check for unsetenv before calling this
641AC_DEFUN([BASH_FUNC_STD_UNSETENV],
642[
643AC_REQUIRE([AC_HEADER_STDC])
644AC_REQUIRE([AC_C_PROTOTYPES])
645AC_CACHE_CHECK([for standard-conformant unsetenv declaration], bash_cv_std_unsetenv,
646[AC_TRY_LINK([
647#if STDC_HEADERS
648#include <stdlib.h>
649#include <stddef.h>
650#endif
651#ifndef __STDC__
652# ifndef const
653# define const
654# endif
655#endif
656#ifdef PROTOTYPES
657extern int unsetenv (const char *);
658#else
659extern int unsetenv ();
660#endif
661],
662[return (unsetenv == 0);],
663bash_cv_std_unsetenv=yes, bash_cv_std_unsetenv=no
664)])
665if test $bash_cv_std_unsetenv = yes; then
666AC_DEFINE(HAVE_STD_UNSETENV)
667fi
668])
669
670AC_DEFUN([BASH_FUNC_ULIMIT_MAXFDS],
671[AC_MSG_CHECKING(whether ulimit can substitute for getdtablesize)
672AC_CACHE_VAL(bash_cv_ulimit_maxfds,
673[AC_TRY_RUN([
674main()
675{
676long maxfds = ulimit(4, 0L);
677exit (maxfds == -1L);
678}
679], bash_cv_ulimit_maxfds=yes, bash_cv_ulimit_maxfds=no,
680 [AC_MSG_WARN(cannot check ulimit if cross compiling -- defaulting to no)
681 bash_cv_ulimit_maxfds=no]
682)])
683AC_MSG_RESULT($bash_cv_ulimit_maxfds)
684if test $bash_cv_ulimit_maxfds = yes; then
685AC_DEFINE(ULIMIT_MAXFDS)
686fi
687])
688
689AC_DEFUN([BASH_FUNC_GETCWD],
690[AC_MSG_CHECKING([if getcwd() calls popen()])
691AC_CACHE_VAL(bash_cv_getcwd_calls_popen,
692[AC_TRY_RUN([
693#include <stdio.h>
694#ifdef HAVE_UNISTD_H
695#include <unistd.h>
696#endif
697
698#ifndef __STDC__
699#ifndef const
700#define const
701#endif
702#endif
703
704int popen_called;
705
706FILE *
707popen(command, type)
708 const char *command;
709 const char *type;
710{
711 popen_called = 1;
712 return (FILE *)NULL;
713}
714
715FILE *_popen(command, type)
716 const char *command;
717 const char *type;
718{
719 return (popen (command, type));
720}
721
722int
723pclose(stream)
724FILE *stream;
725{
726 return 0;
727}
728
729int
730_pclose(stream)
731FILE *stream;
732{
733 return 0;
734}
735
736main()
737{
738 char lbuf[32];
739 popen_called = 0;
740 getcwd(lbuf, 32);
741 exit (popen_called);
742}
743], bash_cv_getcwd_calls_popen=no, bash_cv_getcwd_calls_popen=yes,
744 [AC_MSG_WARN(cannot check whether getcwd calls popen if cross compiling -- defaulting to no)
745 bash_cv_getcwd_calls_popen=no]
746)])
747AC_MSG_RESULT($bash_cv_getcwd_calls_popen)
748if test $bash_cv_getcwd_calls_popen = yes; then
749AC_DEFINE(GETCWD_BROKEN)
750AC_LIBOBJ(getcwd)
751fi
752])
753
754dnl
755dnl This needs BASH_CHECK_SOCKLIB, but since that's not called on every
756dnl system, we can't use AC_PREREQ
757dnl
758AC_DEFUN([BASH_FUNC_GETHOSTBYNAME],
759[if test "X$bash_cv_have_gethostbyname" = "X"; then
760_bash_needmsg=yes
761else
762AC_MSG_CHECKING(for gethostbyname in socket library)
763_bash_needmsg=
764fi
765AC_CACHE_VAL(bash_cv_have_gethostbyname,
766[AC_TRY_LINK([#include <netdb.h>],
767[ struct hostent *hp;
768 hp = gethostbyname("localhost");
769], bash_cv_have_gethostbyname=yes, bash_cv_have_gethostbyname=no)]
770)
771if test "X$_bash_needmsg" = Xyes; then
772 AC_MSG_CHECKING(for gethostbyname in socket library)
773fi
774AC_MSG_RESULT($bash_cv_have_gethostbyname)
775if test "$bash_cv_have_gethostbyname" = yes; then
776AC_DEFINE(HAVE_GETHOSTBYNAME)
777fi
778])
779
780AC_DEFUN([BASH_FUNC_FNMATCH_EXTMATCH],
781[AC_MSG_CHECKING(if fnmatch does extended pattern matching with FNM_EXTMATCH)
782AC_CACHE_VAL(bash_cv_fnm_extmatch,
783[AC_TRY_RUN([
784#include <fnmatch.h>
785
786main()
787{
788#ifdef FNM_EXTMATCH
789 exit (0);
790#else
791 exit (1);
792#endif
793}
794], bash_cv_fnm_extmatch=yes, bash_cv_fnm_extmatch=no,
795 [AC_MSG_WARN(cannot check FNM_EXTMATCH if cross compiling -- defaulting to no)
796 bash_cv_fnm_extmatch=no])
797])
798AC_MSG_RESULT($bash_cv_fnm_extmatch)
799if test $bash_cv_fnm_extmatch = yes; then
800AC_DEFINE(HAVE_LIBC_FNM_EXTMATCH)
801fi
802])
803
804AH_TEMPLATE([HAVE_POSIX_SIGSETJMP], [Define if we POSIX-style sigsetjmp/siglongjmp are available])
805AC_DEFUN([BASH_FUNC_POSIX_SETJMP],
806[AC_REQUIRE([BASH_SYS_SIGNAL_VINTAGE])
807AC_MSG_CHECKING(for presence of POSIX-style sigsetjmp/siglongjmp)
808AC_CACHE_VAL(bash_cv_func_sigsetjmp,
809[AC_TRY_RUN([
810#ifdef HAVE_UNISTD_H
811#include <unistd.h>
812#endif
813#include <sys/types.h>
814#include <signal.h>
815#include <setjmp.h>
816
817main()
818{
819#if !defined (_POSIX_VERSION) || !defined (HAVE_POSIX_SIGNALS)
820exit (1);
821#else
822
823int code;
824sigset_t set, oset;
825sigjmp_buf xx;
826
827/* get the mask */
828sigemptyset(&set);
829sigemptyset(&oset);
830sigprocmask(SIG_BLOCK, (sigset_t *)NULL, &set);
831sigprocmask(SIG_BLOCK, (sigset_t *)NULL, &oset);
832
833/* save it */
834code = sigsetjmp(xx, 1);
835if (code)
836 exit(0); /* could get sigmask and compare to oset here. */
837
838/* change it */
839sigaddset(&set, SIGINT);
840sigprocmask(SIG_BLOCK, &set, (sigset_t *)NULL);
841
842/* and siglongjmp */
843siglongjmp(xx, 10);
844exit(1);
845#endif
846}], bash_cv_func_sigsetjmp=present, bash_cv_func_sigsetjmp=missing,
847 [AC_MSG_WARN(cannot check for sigsetjmp/siglongjmp if cross-compiling -- defaulting to missing)
848 bash_cv_func_sigsetjmp=missing]
849)])
850AC_MSG_RESULT($bash_cv_func_sigsetjmp)
851if test $bash_cv_func_sigsetjmp = present; then
852AC_DEFINE(HAVE_POSIX_SIGSETJMP)
853fi
854])
855
856AH_TEMPLATE([STRCOLL_BROKEN], [Define if strcoll is broken with respect to strcmp in the default locale.])
857AC_DEFUN([BASH_FUNC_STRCOLL],
858[
859AC_MSG_CHECKING(whether or not strcoll and strcmp differ)
860AC_CACHE_VAL(bash_cv_func_strcoll_broken,
861[AC_TRY_RUN([
862#include <stdio.h>
863#if defined (HAVE_LOCALE_H)
864#include <locale.h>
865#endif
866
867main(c, v)
868int c;
869char *v[];
870{
871 int r1, r2;
872 char *deflocale, *defcoll;
873
874#ifdef HAVE_SETLOCALE
875 deflocale = setlocale(LC_ALL, "");
876 defcoll = setlocale(LC_COLLATE, "");
877#endif
878
879#ifdef HAVE_STRCOLL
880 /* These two values are taken from tests/glob-test. */
881 r1 = strcoll("abd", "aXd");
882#else
883 r1 = 0;
884#endif
885 r2 = strcmp("abd", "aXd");
886
887 /* These two should both be greater than 0. It is permissible for
888 a system to return different values, as long as the sign is the
889 same. */
890
891 /* Exit with 1 (failure) if these two values are both > 0, since
892 this tests whether strcoll(3) is broken with respect to strcmp(3)
893 in the default locale. */
894 exit (r1 > 0 && r2 > 0);
895}
896], bash_cv_func_strcoll_broken=yes, bash_cv_func_strcoll_broken=no,
897 [AC_MSG_WARN(cannot check strcoll if cross compiling -- defaulting to no)
898 bash_cv_func_strcoll_broken=no]
899)])
900AC_MSG_RESULT($bash_cv_func_strcoll_broken)
901if test $bash_cv_func_strcoll_broken = yes; then
902AC_DEFINE(STRCOLL_BROKEN)
903fi
904])
905
906AC_DEFUN([BASH_FUNC_PRINTF_A_FORMAT],
907[AC_MSG_CHECKING([for printf floating point output in hex notation])
908AC_CACHE_VAL(bash_cv_printf_a_format,
909[AC_TRY_RUN([
910#include <stdio.h>
911#include <string.h>
912
913int
914main()
915{
916 double y = 0.0;
917 char abuf[1024];
918
919 sprintf(abuf, "%A", y);
920 exit(strchr(abuf, 'P') == (char *)0);
921}
922], bash_cv_printf_a_format=yes, bash_cv_printf_a_format=no,
923 [AC_MSG_WARN(cannot check printf if cross compiling -- defaulting to no)
924 bash_cv_printf_a_format=no]
925)])
926AC_MSG_RESULT($bash_cv_printf_a_format)
927if test $bash_cv_printf_a_format = yes; then
928AC_DEFINE(HAVE_PRINTF_A_FORMAT)
929fi
930])
931
932AC_DEFUN([BASH_STRUCT_TERMIOS_LDISC],
933[
934AC_CHECK_MEMBER(struct termios.c_line, AC_DEFINE(TERMIOS_LDISC), ,[
935#include <sys/types.h>
936#include <termios.h>
937])
938])
939
940AC_DEFUN([BASH_STRUCT_TERMIO_LDISC],
941[
942AC_CHECK_MEMBER(struct termio.c_line, AC_DEFINE(TERMIO_LDISC), ,[
943#include <sys/types.h>
944#include <termio.h>
945])
946])
947
948dnl
949dnl Like AC_STRUCT_ST_BLOCKS, but doesn't muck with LIBOBJS
950dnl
951dnl sets bash_cv_struct_stat_st_blocks
952dnl
953dnl unused for now; we'll see how AC_CHECK_MEMBERS works
954dnl
955AC_DEFUN([BASH_STRUCT_ST_BLOCKS],
956[
957AC_MSG_CHECKING([for struct stat.st_blocks])
958AC_CACHE_VAL(bash_cv_struct_stat_st_blocks,
959[AC_TRY_COMPILE(
960[
961#include <sys/types.h>
962#include <sys/stat.h>
963],
964[
965main()
966{
967static struct stat a;
968if (a.st_blocks) return 0;
969return 0;
970}
971], bash_cv_struct_stat_st_blocks=yes, bash_cv_struct_stat_st_blocks=no)
972])
973AC_MSG_RESULT($bash_cv_struct_stat_st_blocks)
974if test "$bash_cv_struct_stat_st_blocks" = "yes"; then
975AC_DEFINE(HAVE_STRUCT_STAT_ST_BLOCKS)
976fi
977])
978
979AC_DEFUN([BASH_CHECK_LIB_TERMCAP],
980[
981if test "X$bash_cv_termcap_lib" = "X"; then
982_bash_needmsg=yes
983else
984AC_MSG_CHECKING(which library has the termcap functions)
985_bash_needmsg=
986fi
987AC_CACHE_VAL(bash_cv_termcap_lib,
988[AC_CHECK_LIB(termcap, tgetent, bash_cv_termcap_lib=libtermcap,
989 [AC_CHECK_LIB(tinfo, tgetent, bash_cv_termcap_lib=libtinfo,
990 [AC_CHECK_LIB(curses, tgetent, bash_cv_termcap_lib=libcurses,
991 [AC_CHECK_LIB(ncurses, tgetent, bash_cv_termcap_lib=libncurses,
992 bash_cv_termcap_lib=gnutermcap)])])])])
993if test "X$_bash_needmsg" = "Xyes"; then
994AC_MSG_CHECKING(which library has the termcap functions)
995fi
996AC_MSG_RESULT(using $bash_cv_termcap_lib)
997if test $bash_cv_termcap_lib = gnutermcap && test -z "$prefer_curses"; then
998LDFLAGS="$LDFLAGS -L./lib/termcap"
999TERMCAP_LIB="./lib/termcap/libtermcap.a"
1000TERMCAP_DEP="./lib/termcap/libtermcap.a"
1001elif test $bash_cv_termcap_lib = libtermcap && test -z "$prefer_curses"; then
1002TERMCAP_LIB=-ltermcap
1003TERMCAP_DEP=
1004elif test $bash_cv_termcap_lib = libtinfo; then
1005TERMCAP_LIB=-ltinfo
1006TERMCAP_DEP=
1007elif test $bash_cv_termcap_lib = libncurses; then
1008TERMCAP_LIB=-lncurses
1009TERMCAP_DEP=
1010else
1011TERMCAP_LIB=-lcurses
1012TERMCAP_DEP=
1013fi
1014])
1015
1016dnl
1017dnl Check for the presence of getpeername in libsocket.
1018dnl If libsocket is present, check for libnsl and add it to LIBS if
1019dnl it's there, since most systems with libsocket require linking
1020dnl with libnsl as well. This should only be called if getpeername
1021dnl was not found in libc.
1022dnl
1023dnl NOTE: IF WE FIND GETPEERNAME, WE ASSUME THAT WE HAVE BIND/CONNECT
1024dnl AS WELL
1025dnl
1026AC_DEFUN([BASH_CHECK_LIB_SOCKET],
1027[
1028if test "X$bash_cv_have_socklib" = "X"; then
1029_bash_needmsg=
1030else
1031AC_MSG_CHECKING(for socket library)
1032_bash_needmsg=yes
1033fi
1034AC_CACHE_VAL(bash_cv_have_socklib,
1035[AC_CHECK_LIB(socket, getpeername,
1036 bash_cv_have_socklib=yes, bash_cv_have_socklib=no, -lnsl)])
1037if test "X$_bash_needmsg" = Xyes; then
1038 AC_MSG_RESULT($bash_cv_have_socklib)
1039 _bash_needmsg=
1040fi
1041if test $bash_cv_have_socklib = yes; then
1042 # check for libnsl, add it to LIBS if present
1043 if test "X$bash_cv_have_libnsl" = "X"; then
1044 _bash_needmsg=
1045 else
1046 AC_MSG_CHECKING(for libnsl)
1047 _bash_needmsg=yes
1048 fi
1049 AC_CACHE_VAL(bash_cv_have_libnsl,
1050 [AC_CHECK_LIB(nsl, t_open,
1051 bash_cv_have_libnsl=yes, bash_cv_have_libnsl=no)])
1052 if test "X$_bash_needmsg" = Xyes; then
1053 AC_MSG_RESULT($bash_cv_have_libnsl)
1054 _bash_needmsg=
1055 fi
1056 if test $bash_cv_have_libnsl = yes; then
1057 LIBS="-lsocket -lnsl $LIBS"
1058 else
1059 LIBS="-lsocket $LIBS"
1060 fi
1061 AC_DEFINE(HAVE_LIBSOCKET)
1062 AC_DEFINE(HAVE_GETPEERNAME)
1063fi
1064])
1065
1066AH_TEMPLATE([STRUCT_DIRENT_HAS_D_INO], [Define if struct dirent has a d_ino member])
1067AC_DEFUN([BASH_STRUCT_DIRENT_D_INO],
1068[AC_REQUIRE([AC_HEADER_DIRENT])
1069AC_MSG_CHECKING(if struct dirent has a d_ino member)
1070AC_CACHE_VAL(bash_cv_dirent_has_dino,
1071[AC_TRY_COMPILE([
1072#include <stdio.h>
1073#include <sys/types.h>
1074#ifdef HAVE_UNISTD_H
1075# include <unistd.h>
1076#endif /* HAVE_UNISTD_H */
1077#if defined(HAVE_DIRENT_H)
1078# include <dirent.h>
1079#else
1080# define dirent direct
1081# ifdef HAVE_SYS_NDIR_H
1082# include <sys/ndir.h>
1083# endif /* SYSNDIR */
1084# ifdef HAVE_SYS_DIR_H
1085# include <sys/dir.h>
1086# endif /* SYSDIR */
1087# ifdef HAVE_NDIR_H
1088# include <ndir.h>
1089# endif
1090#endif /* HAVE_DIRENT_H */
1091],[
1092struct dirent d; int z; z = d.d_ino;
1093], bash_cv_dirent_has_dino=yes, bash_cv_dirent_has_dino=no)])
1094AC_MSG_RESULT($bash_cv_dirent_has_dino)
1095if test $bash_cv_dirent_has_dino = yes; then
1096AC_DEFINE(STRUCT_DIRENT_HAS_D_INO)
1097fi
1098])
1099
1100AH_TEMPLATE([STRUCT_DIRENT_HAS_D_FILENO], [Define if struct dirent has a d_fileno member])
1101AC_DEFUN([BASH_STRUCT_DIRENT_D_FILENO],
1102[AC_REQUIRE([AC_HEADER_DIRENT])
1103AC_MSG_CHECKING(if struct dirent has a d_fileno member)
1104AC_CACHE_VAL(bash_cv_dirent_has_d_fileno,
1105[AC_TRY_COMPILE([
1106#include <stdio.h>
1107#include <sys/types.h>
1108#ifdef HAVE_UNISTD_H
1109# include <unistd.h>
1110#endif /* HAVE_UNISTD_H */
1111#if defined(HAVE_DIRENT_H)
1112# include <dirent.h>
1113#else
1114# define dirent direct
1115# ifdef HAVE_SYS_NDIR_H
1116# include <sys/ndir.h>
1117# endif /* SYSNDIR */
1118# ifdef HAVE_SYS_DIR_H
1119# include <sys/dir.h>
1120# endif /* SYSDIR */
1121# ifdef HAVE_NDIR_H
1122# include <ndir.h>
1123# endif
1124#endif /* HAVE_DIRENT_H */
1125],[
1126struct dirent d; int z; z = d.d_fileno;
1127], bash_cv_dirent_has_d_fileno=yes, bash_cv_dirent_has_d_fileno=no)])
1128AC_MSG_RESULT($bash_cv_dirent_has_d_fileno)
1129if test $bash_cv_dirent_has_d_fileno = yes; then
1130AC_DEFINE(STRUCT_DIRENT_HAS_D_FILENO)
1131fi
1132])
1133
1134AC_DEFUN([BASH_STRUCT_TIMEVAL],
1135[AC_MSG_CHECKING(for struct timeval in sys/time.h and time.h)
1136AC_CACHE_VAL(bash_cv_struct_timeval,
1137[
1138AC_EGREP_HEADER(struct timeval, sys/time.h,
1139 bash_cv_struct_timeval=yes,
1140 AC_EGREP_HEADER(struct timeval, time.h,
1141 bash_cv_struct_timeval=yes,
1142 bash_cv_struct_timeval=no))
1143])
1144AC_MSG_RESULT($bash_cv_struct_timeval)
1145if test $bash_cv_struct_timeval = yes; then
1146 AC_DEFINE(HAVE_TIMEVAL)
1147fi
1148])
1149
1150AH_TEMPLATE([STRUCT_WINSIZE_IN_SYS_IOCTL], [Define if struct winsize is in sys/ioctl.h])
1151AH_TEMPLATE([STRUCT_WINSIZE_IN_TERMIOS], [Define if struct winsize is in termios.h])
1152AC_DEFUN([BASH_STRUCT_WINSIZE],
1153[AC_MSG_CHECKING(for struct winsize in sys/ioctl.h and termios.h)
1154AC_CACHE_VAL(bash_cv_struct_winsize_header,
1155[AC_TRY_COMPILE([#include <sys/types.h>
1156#include <sys/ioctl.h>], [struct winsize x;],
1157 bash_cv_struct_winsize_header=ioctl_h,
1158 [AC_TRY_COMPILE([#include <sys/types.h>
1159#include <termios.h>], [struct winsize x;],
1160 bash_cv_struct_winsize_header=termios_h, bash_cv_struct_winsize_header=other)
1161])])
1162if test $bash_cv_struct_winsize_header = ioctl_h; then
1163 AC_MSG_RESULT(sys/ioctl.h)
1164 AC_DEFINE(STRUCT_WINSIZE_IN_SYS_IOCTL)
1165elif test $bash_cv_struct_winsize_header = termios_h; then
1166 AC_MSG_RESULT(termios.h)
1167 AC_DEFINE(STRUCT_WINSIZE_IN_TERMIOS)
1168else
1169 AC_MSG_RESULT(not found)
1170fi
1171])
1172
1173dnl Check type of signal routines (posix, 4.2bsd, 4.1bsd or v7)
1174AH_TEMPLATE([HAVE_POSIX_SIGNALS], [Define if we have the POSIX signal routines])
1175AH_TEMPLATE([HAVE_BSD_SIGNALS], [Define if we have the BSD signal routines])
1176AH_TEMPLATE([HAVE_USG_SIGHOLD], [Define if we have the USG signal routines])
1177AC_DEFUN([BASH_SYS_SIGNAL_VINTAGE],
1178[AC_REQUIRE([AC_TYPE_SIGNAL])
1179AC_MSG_CHECKING(for type of signal functions)
1180AC_CACHE_VAL(bash_cv_signal_vintage,
1181[
1182 AC_MSG_WARN([checking for posix...])
1183 AC_TRY_LINK([#include <signal.h>],[
1184 sigset_t ss;
1185 struct sigaction sa;
1186 sigemptyset(&ss); sigsuspend(&ss);
1187 sigaction(SIGINT, &sa, (struct sigaction *) 0);
1188 sigprocmask(SIG_BLOCK, &ss, (sigset_t *) 0);
1189 ], bash_cv_signal_vintage="posix",
1190 [
1191 AC_MSG_WARN([checking for 4.2bsd...])
1192 AC_TRY_LINK([#include <signal.h>], [
1193 int mask = sigmask(SIGINT);
1194 sigsetmask(mask); sigblock(mask); sigpause(mask);
1195 ], bash_cv_signal_vintage="4.2bsd",
1196 [
1197 AC_MSG_WARN([checking for svr3...])
1198 AC_TRY_LINK([
1199 #include <signal.h>
1200 RETSIGTYPE foo() { }], [
1201 int mask = sigmask(SIGINT);
1202 sigset(SIGINT, foo); sigrelse(SIGINT);
1203 sighold(SIGINT); sigpause(SIGINT);
1204 ], bash_cv_signal_vintage="svr3", bash_cv_signal_vintage="v7"
1205 )]
1206 )]
1207)
1208])
1209AC_MSG_RESULT($bash_cv_signal_vintage)
1210if test "$bash_cv_signal_vintage" = "posix"; then
1211AC_DEFINE(HAVE_POSIX_SIGNALS)
1212elif test "$bash_cv_signal_vintage" = "4.2bsd"; then
1213AC_DEFINE(HAVE_BSD_SIGNALS)
1214elif test "$bash_cv_signal_vintage" = "svr3"; then
1215AC_DEFINE(HAVE_USG_SIGHOLD)
1216fi
1217])
1218
1219dnl Check if the pgrp of setpgrp() can't be the pid of a zombie process.
1220AC_DEFUN([BASH_SYS_PGRP_SYNC],
1221[AC_REQUIRE([AC_FUNC_GETPGRP])
1222AC_MSG_CHECKING(whether pgrps need synchronization)
1223AC_CACHE_VAL(bash_cv_pgrp_pipe,
1224[AC_TRY_RUN([
1225#ifdef HAVE_UNISTD_H
1226# include <unistd.h>
1227#endif
1228main()
1229{
1230# ifdef GETPGRP_VOID
1231# define getpgID() getpgrp()
1232# else
1233# define getpgID() getpgrp(0)
1234# define setpgid(x,y) setpgrp(x,y)
1235# endif
1236 int pid1, pid2, fds[2];
1237 int status;
1238 char ok;
1239
1240 switch (pid1 = fork()) {
1241 case -1:
1242 exit(1);
1243 case 0:
1244 setpgid(0, getpid());
1245 exit(0);
1246 }
1247 setpgid(pid1, pid1);
1248
1249 sleep(2); /* let first child die */
1250
1251 if (pipe(fds) < 0)
1252 exit(2);
1253
1254 switch (pid2 = fork()) {
1255 case -1:
1256 exit(3);
1257 case 0:
1258 setpgid(0, pid1);
1259 ok = getpgID() == pid1;
1260 write(fds[1], &ok, 1);
1261 exit(0);
1262 }
1263 setpgid(pid2, pid1);
1264
1265 close(fds[1]);
1266 if (read(fds[0], &ok, 1) != 1)
1267 exit(4);
1268 wait(&status);
1269 wait(&status);
1270 exit(ok ? 0 : 5);
1271}
1272], bash_cv_pgrp_pipe=no,bash_cv_pgrp_pipe=yes,
1273 [AC_MSG_WARN(cannot check pgrp synchronization if cross compiling -- defaulting to no)
1274 bash_cv_pgrp_pipe=no])
1275])
1276AC_MSG_RESULT($bash_cv_pgrp_pipe)
1277if test $bash_cv_pgrp_pipe = yes; then
1278AC_DEFINE(PGRP_PIPE)
1279fi
1280])
1281
1282AH_TEMPLATE([MUST_REINSTALL_SIGHANDLERS], [Define if signal handlers must be reinstalled when invoked.])
1283AC_DEFUN([BASH_SYS_REINSTALL_SIGHANDLERS],
1284[AC_REQUIRE([AC_TYPE_SIGNAL])
1285AC_REQUIRE([BASH_SYS_SIGNAL_VINTAGE])
1286AC_MSG_CHECKING([if signal handlers must be reinstalled when invoked])
1287AC_CACHE_VAL(bash_cv_must_reinstall_sighandlers,
1288[AC_TRY_RUN([
1289#include <signal.h>
1290#ifdef HAVE_UNISTD_H
1291#include <unistd.h>
1292#endif
1293
1294typedef RETSIGTYPE sigfunc();
1295
1296int nsigint;
1297
1298#ifdef HAVE_POSIX_SIGNALS
1299sigfunc *
1300set_signal_handler(sig, handler)
1301 int sig;
1302 sigfunc *handler;
1303{
1304 struct sigaction act, oact;
1305 act.sa_handler = handler;
1306 act.sa_flags = 0;
1307 sigemptyset (&act.sa_mask);
1308 sigemptyset (&oact.sa_mask);
1309 sigaction (sig, &act, &oact);
1310 return (oact.sa_handler);
1311}
1312#else
1313#define set_signal_handler(s, h) signal(s, h)
1314#endif
1315
1316RETSIGTYPE
1317sigint(s)
1318int s;
1319{
1320 nsigint++;
1321}
1322
1323main()
1324{
1325 nsigint = 0;
1326 set_signal_handler(SIGINT, sigint);
1327 kill((int)getpid(), SIGINT);
1328 kill((int)getpid(), SIGINT);
1329 exit(nsigint != 2);
1330}
1331], bash_cv_must_reinstall_sighandlers=no, bash_cv_must_reinstall_sighandlers=yes,
1332 [AC_MSG_WARN(cannot check signal handling if cross compiling -- defaulting to no)
1333 bash_cv_must_reinstall_sighandlers=no]
1334)])
1335AC_MSG_RESULT($bash_cv_must_reinstall_sighandlers)
1336if test $bash_cv_must_reinstall_sighandlers = yes; then
1337AC_DEFINE(MUST_REINSTALL_SIGHANDLERS)
1338fi
1339])
1340
1341dnl check that some necessary job control definitions are present
1342AC_DEFUN([BASH_SYS_JOB_CONTROL_MISSING],
1343[AC_REQUIRE([BASH_SYS_SIGNAL_VINTAGE])
1344AC_MSG_CHECKING(for presence of necessary job control definitions)
1345AC_CACHE_VAL(bash_cv_job_control_missing,
1346[AC_TRY_RUN([
1347#include <sys/types.h>
1348#ifdef HAVE_SYS_WAIT_H
1349#include <sys/wait.h>
1350#endif
1351#ifdef HAVE_UNISTD_H
1352#include <unistd.h>
1353#endif
1354#include <signal.h>
1355
1356/* Add more tests in here as appropriate. */
1357main()
1358{
1359/* signal type */
1360#if !defined (HAVE_POSIX_SIGNALS) && !defined (HAVE_BSD_SIGNALS)
1361exit(1);
1362#endif
1363
1364/* signals and tty control. */
1365#if !defined (SIGTSTP) || !defined (SIGSTOP) || !defined (SIGCONT)
1366exit (1);
1367#endif
1368
1369/* process control */
1370#if !defined (WNOHANG) || !defined (WUNTRACED)
1371exit(1);
1372#endif
1373
1374/* Posix systems have tcgetpgrp and waitpid. */
1375#if defined (_POSIX_VERSION) && !defined (HAVE_TCGETPGRP)
1376exit(1);
1377#endif
1378
1379#if defined (_POSIX_VERSION) && !defined (HAVE_WAITPID)
1380exit(1);
1381#endif
1382
1383/* Other systems have TIOCSPGRP/TIOCGPRGP and wait3. */
1384#if !defined (_POSIX_VERSION) && !defined (HAVE_WAIT3)
1385exit(1);
1386#endif
1387
1388exit(0);
1389}], bash_cv_job_control_missing=present, bash_cv_job_control_missing=missing,
1390 [AC_MSG_WARN(cannot check job control if cross-compiling -- defaulting to missing)
1391 bash_cv_job_control_missing=missing]
1392)])
1393AC_MSG_RESULT($bash_cv_job_control_missing)
1394if test $bash_cv_job_control_missing = missing; then
1395AC_DEFINE(JOB_CONTROL_MISSING)
1396fi
1397])
1398
1399dnl check whether named pipes are present
1400dnl this requires a previous check for mkfifo, but that is awkward to specify
1401AC_DEFUN([BASH_SYS_NAMED_PIPES],
1402[AC_MSG_CHECKING(for presence of named pipes)
1403AC_CACHE_VAL(bash_cv_sys_named_pipes,
1404[AC_TRY_RUN([
1405#include <sys/types.h>
1406#include <sys/stat.h>
1407#ifdef HAVE_UNISTD_H
1408#include <unistd.h>
1409#endif
1410
1411/* Add more tests in here as appropriate. */
1412main()
1413{
1414int fd, err;
1415
1416#if defined (HAVE_MKFIFO)
1417exit (0);
1418#endif
1419
1420#if !defined (S_IFIFO) && (defined (_POSIX_VERSION) && !defined (S_ISFIFO))
1421exit (1);
1422#endif
1423
1424#if defined (NeXT)
1425exit (1);
1426#endif
1427err = mkdir("/tmp/bash-aclocal", 0700);
1428if (err < 0) {
1429 perror ("mkdir");
1430 exit(1);
1431}
1432fd = mknod ("/tmp/bash-aclocal/sh-np-autoconf", 0666 | S_IFIFO, 0);
1433if (fd == -1) {
1434 rmdir ("/tmp/bash-aclocal");
1435 exit (1);
1436}
1437close(fd);
1438unlink ("/tmp/bash-aclocal/sh-np-autoconf");
1439rmdir ("/tmp/bash-aclocal");
1440exit(0);
1441}], bash_cv_sys_named_pipes=present, bash_cv_sys_named_pipes=missing,
1442 [AC_MSG_WARN(cannot check for named pipes if cross-compiling -- defaulting to missing)
1443 bash_cv_sys_named_pipes=missing]
1444)])
1445AC_MSG_RESULT($bash_cv_sys_named_pipes)
1446if test $bash_cv_sys_named_pipes = missing; then
1447AC_DEFINE(NAMED_PIPES_MISSING)
1448fi
1449])
1450
1451AC_DEFUN([BASH_SYS_DEFAULT_MAIL_DIR],
1452[AC_MSG_CHECKING(for default mail directory)
1453AC_CACHE_VAL(bash_cv_mail_dir,
1454[if test -d /var/mail; then
1455 bash_cv_mail_dir=/var/mail
1456 elif test -d /var/spool/mail; then
1457 bash_cv_mail_dir=/var/spool/mail
1458 elif test -d /usr/mail; then
1459 bash_cv_mail_dir=/usr/mail
1460 elif test -d /usr/spool/mail; then
1461 bash_cv_mail_dir=/usr/spool/mail
1462 else
1463 bash_cv_mail_dir=unknown
1464 fi
1465])
1466AC_MSG_RESULT($bash_cv_mail_dir)
1467AC_DEFINE_UNQUOTED(DEFAULT_MAIL_DIRECTORY, "$bash_cv_mail_dir")
1468])
1469
1470AC_DEFUN([BASH_HAVE_TIOCGWINSZ],
1471[AC_MSG_CHECKING(for TIOCGWINSZ in sys/ioctl.h)
1472AC_CACHE_VAL(bash_cv_tiocgwinsz_in_ioctl,
1473[AC_TRY_COMPILE([#include <sys/types.h>
1474#include <sys/ioctl.h>], [int x = TIOCGWINSZ;],
1475 bash_cv_tiocgwinsz_in_ioctl=yes,bash_cv_tiocgwinsz_in_ioctl=no)])
1476AC_MSG_RESULT($bash_cv_tiocgwinsz_in_ioctl)
1477if test $bash_cv_tiocgwinsz_in_ioctl = yes; then
1478AC_DEFINE(GWINSZ_IN_SYS_IOCTL)
1479fi
1480])
1481
1482AH_TEMPLATE([TIOCSTAT_IN_SYS_IOCTL], [Define if TIOCSTAT is in sys/ioctl.h])
1483AC_DEFUN([BASH_HAVE_TIOCSTAT],
1484[AC_MSG_CHECKING(for TIOCSTAT in sys/ioctl.h)
1485AC_CACHE_VAL(bash_cv_tiocstat_in_ioctl,
1486[AC_TRY_COMPILE([#include <sys/types.h>
1487#include <sys/ioctl.h>], [int x = TIOCSTAT;],
1488 bash_cv_tiocstat_in_ioctl=yes,bash_cv_tiocstat_in_ioctl=no)])
1489AC_MSG_RESULT($bash_cv_tiocstat_in_ioctl)
1490if test $bash_cv_tiocstat_in_ioctl = yes; then
1491AC_DEFINE(TIOCSTAT_IN_SYS_IOCTL)
1492fi
1493])
1494
1495AH_TEMPLATE([FIONREAD_IN_SYS_IOCTL], [Define if FIONREAD is in sys/ioctl.h])
1496AC_DEFUN([BASH_HAVE_FIONREAD],
1497[AC_MSG_CHECKING(for FIONREAD in sys/ioctl.h)
1498AC_CACHE_VAL(bash_cv_fionread_in_ioctl,
1499[AC_TRY_COMPILE([#include <sys/types.h>
1500#include <sys/ioctl.h>], [int x = FIONREAD;],
1501 bash_cv_fionread_in_ioctl=yes,bash_cv_fionread_in_ioctl=no)])
1502AC_MSG_RESULT($bash_cv_fionread_in_ioctl)
1503if test $bash_cv_fionread_in_ioctl = yes; then
1504AC_DEFINE(FIONREAD_IN_SYS_IOCTL)
1505fi
1506])
1507
1508dnl
1509dnl See if speed_t is declared in <sys/types.h>. Some versions of linux
1510dnl require a definition of speed_t each time <termcap.h> is included,
1511dnl but you can only get speed_t if you include <termios.h> (on some
1512dnl versions) or <sys/types.h> (on others).
1513dnl
1514AH_TEMPLATE([SPEED_T_IN_SYS_TYPES], [Define if speed_t is in sys/types.h])
1515AC_DEFUN([BASH_CHECK_SPEED_T],
1516[AC_MSG_CHECKING(for speed_t in sys/types.h)
1517AC_CACHE_VAL(bash_cv_speed_t_in_sys_types,
1518[AC_TRY_COMPILE([#include <sys/types.h>], [speed_t x;],
1519 bash_cv_speed_t_in_sys_types=yes,bash_cv_speed_t_in_sys_types=no)])
1520AC_MSG_RESULT($bash_cv_speed_t_in_sys_types)
1521if test $bash_cv_speed_t_in_sys_types = yes; then
1522AC_DEFINE(SPEED_T_IN_SYS_TYPES)
1523fi
1524])
1525
1526AH_TEMPLATE([HAVE_GETPW_DECLS], [Define if getpw functions are declared in pwd.h])
1527AC_DEFUN([BASH_CHECK_GETPW_FUNCS],
1528[AC_MSG_CHECKING(whether getpw functions are declared in pwd.h)
1529AC_CACHE_VAL(bash_cv_getpw_declared,
1530[AC_EGREP_CPP(getpwuid,
1531[
1532#include <sys/types.h>
1533#ifdef HAVE_UNISTD_H
1534# include <unistd.h>
1535#endif
1536#include <pwd.h>
1537],
1538bash_cv_getpw_declared=yes,bash_cv_getpw_declared=no)])
1539AC_MSG_RESULT($bash_cv_getpw_declared)
1540if test $bash_cv_getpw_declared = yes; then
1541AC_DEFINE(HAVE_GETPW_DECLS)
1542fi
1543])
1544
1545AC_DEFUN([BASH_CHECK_DEV_FD],
1546[AC_MSG_CHECKING(whether /dev/fd is available)
1547AC_CACHE_VAL(bash_cv_dev_fd,
1548[if test -d /dev/fd && test -r /dev/fd/0; then
1549 bash_cv_dev_fd=standard
1550 elif test -d /proc/self/fd && test -r /proc/self/fd/0; then
1551 bash_cv_dev_fd=whacky
1552 else
1553 bash_cv_dev_fd=absent
1554 fi
1555])
1556AC_MSG_RESULT($bash_cv_dev_fd)
1557if test $bash_cv_dev_fd = "standard"; then
1558 AC_DEFINE(HAVE_DEV_FD)
1559 AC_DEFINE(DEV_FD_PREFIX, "/dev/fd/")
1560elif test $bash_cv_dev_fd = "whacky"; then
1561 AC_DEFINE(HAVE_DEV_FD)
1562 AC_DEFINE(DEV_FD_PREFIX, "/proc/self/fd/")
1563fi
1564])
1565
1566AC_DEFUN([BASH_CHECK_DEV_STDIN],
1567[AC_MSG_CHECKING(whether /dev/stdin stdout stderr are available)
1568AC_CACHE_VAL(bash_cv_dev_stdin,
1569[if test -d /dev/fd && test -r /dev/stdin; then
1570 bash_cv_dev_stdin=present
1571 elif test -d /proc/self/fd && test -r /dev/stdin; then
1572 bash_cv_dev_stdin=present
1573 else
1574 bash_cv_dev_stdin=absent
1575 fi
1576])
1577AC_MSG_RESULT($bash_cv_dev_stdin)
1578if test $bash_cv_dev_stdin = "present"; then
1579 AC_DEFINE(HAVE_DEV_STDIN)
1580fi
1581])
1582
1583dnl
1584dnl Check if HPUX needs _KERNEL defined for RLIMIT_* definitions
1585dnl
1586AC_DEFUN([BASH_CHECK_KERNEL_RLIMIT],
1587[AC_MSG_CHECKING([whether $host_os needs _KERNEL for RLIMIT defines])
1588AC_CACHE_VAL(bash_cv_kernel_rlimit,
1589[AC_TRY_COMPILE([
1590#include <sys/types.h>
1591#include <sys/resource.h>
1592],
1593[
1594 int f;
1595 f = RLIMIT_DATA;
1596], bash_cv_kernel_rlimit=no,
1597[AC_TRY_COMPILE([
1598#include <sys/types.h>
1599#define _KERNEL
1600#include <sys/resource.h>
1601#undef _KERNEL
1602],
1603[
1604 int f;
1605 f = RLIMIT_DATA;
1606], bash_cv_kernel_rlimit=yes, bash_cv_kernel_rlimit=no)]
1607)])
1608AC_MSG_RESULT($bash_cv_kernel_rlimit)
1609if test $bash_cv_kernel_rlimit = yes; then
1610AC_DEFINE(RLIMIT_NEEDS_KERNEL)
1611fi
1612])
1613
1614dnl
1615dnl Check for 64-bit off_t -- used for malloc alignment
1616dnl
1617dnl C does not allow duplicate case labels, so the compile will fail if
1618dnl sizeof(off_t) is > 4.
1619dnl
1620AC_DEFUN([BASH_CHECK_OFF_T_64],
1621[AC_CACHE_CHECK(for 64-bit off_t, bash_cv_off_t_64,
1622AC_TRY_COMPILE([
1623#ifdef HAVE_UNISTD_H
1624#include <unistd.h>
1625#endif
1626#include <sys/types.h>
1627],[
1628switch (0) case 0: case (sizeof (off_t) <= 4):;
1629], bash_cv_off_t_64=no, bash_cv_off_t_64=yes))
1630if test $bash_cv_off_t_64 = yes; then
1631 AC_DEFINE(HAVE_OFF_T_64)
1632fi])
1633
1634AC_DEFUN([BASH_CHECK_RTSIGS],
1635[AC_MSG_CHECKING(for unusable real-time signals due to large values)
1636AC_CACHE_VAL(bash_cv_unusable_rtsigs,
1637[AC_TRY_RUN([
1638#include <sys/types.h>
1639#include <signal.h>
1640
1641#ifndef NSIG
1642# define NSIG 64
1643#endif
1644
1645main ()
1646{
1647 int n_sigs = 2 * NSIG;
1648#ifdef SIGRTMIN
1649 int rtmin = SIGRTMIN;
1650#else
1651 int rtmin = 0;
1652#endif
1653
1654 exit(rtmin < n_sigs);
1655}], bash_cv_unusable_rtsigs=yes, bash_cv_unusable_rtsigs=no,
1656 [AC_MSG_WARN(cannot check real-time signals if cross compiling -- defaulting to yes)
1657 bash_cv_unusable_rtsigs=yes]
1658)])
1659AC_MSG_RESULT($bash_cv_unusable_rtsigs)
1660if test $bash_cv_unusable_rtsigs = yes; then
1661AC_DEFINE(UNUSABLE_RT_SIGNALS)
1662fi
1663])
1664
1665dnl
1666dnl check for availability of multibyte characters and functions
1667dnl
1668AH_TEMPLATE([HAVE_MBSRTOWCS], [Define if we have the mbsrtowcs function])
1669AH_TEMPLATE([HAVE_WCWIDTH], [Define if we have the wcwidth function])
1670AH_TEMPLATE([HAVE_MBSTATE_T], [Define if we have mbstate_t])
1671AH_TEMPLATE([HAVE_LANGINFO_CODESET], [Define if we have nl_langinfo and CODESET])
1672AC_DEFUN([BASH_CHECK_MULTIBYTE],
1673[
1674AC_CHECK_HEADERS(wctype.h)
1675AC_CHECK_HEADERS(wchar.h)
1676AC_CHECK_HEADERS(langinfo.h)
1677
1678AC_CHECK_FUNC(mbsrtowcs, AC_DEFINE(HAVE_MBSRTOWCS))
1679AC_CHECK_FUNC(wcwidth, AC_DEFINE(HAVE_WCWIDTH))
1680
1681AC_CACHE_CHECK([for mbstate_t], bash_cv_have_mbstate_t,
1682[AC_TRY_RUN([
1683#include <wchar.h>
1684int
1685main ()
1686{
1687 mbstate_t ps;
1688 return 0;
1689}], bash_cv_have_mbstate_t=yes, bash_cv_have_mbstate_t=no)])
1690if test $bash_cv_have_mbstate_t = yes; then
1691 AC_DEFINE(HAVE_MBSTATE_T)
1692fi
1693
1694AC_CACHE_CHECK([for nl_langinfo and CODESET], bash_cv_langinfo_codeset,
1695[AC_TRY_LINK(
1696[#include <langinfo.h>],
1697[char* cs = nl_langinfo(CODESET);],
1698bash_cv_langinfo_codeset=yes, bash_cv_langinfo_codeset=no)])
1699if test $bash_cv_langinfo_codeset = yes; then
1700 AC_DEFINE(HAVE_LANGINFO_CODESET)
1701fi
1702
1703])
1704
1705dnl need: prefix exec_prefix libdir includedir CC TERMCAP_LIB
1706dnl require:
1707dnl AC_PROG_CC
1708dnl BASH_CHECK_LIB_TERMCAP
1709
1710AC_DEFUN([RL_LIB_READLINE_VERSION],
1711[
1712AC_REQUIRE([BASH_CHECK_LIB_TERMCAP])
1713
1714AC_MSG_CHECKING([version of installed readline library])
1715
1716# What a pain in the ass this is.
1717
1718# save cpp and ld options
1719_save_CFLAGS="$CFLAGS"
1720_save_LDFLAGS="$LDFLAGS"
1721_save_LIBS="$LIBS"
1722
1723# Don't set ac_cv_rl_prefix if the caller has already assigned a value. This
1724# allows the caller to do something like $_rl_prefix=$withval if the user
1725# specifies --with-installed-readline=PREFIX as an argument to configure
1726
1727if test -z "$ac_cv_rl_prefix"; then
1728test "x$prefix" = xNONE && ac_cv_rl_prefix=$ac_default_prefix || ac_cv_rl_prefix=${prefix}
1729fi
1730
1731eval ac_cv_rl_includedir=${ac_cv_rl_prefix}/include
1732eval ac_cv_rl_libdir=${ac_cv_rl_prefix}/lib
1733
1734LIBS="$LIBS -lreadline ${TERMCAP_LIB}"
1735CFLAGS="$CFLAGS -I${ac_cv_rl_includedir}"
1736LDFLAGS="$LDFLAGS -L${ac_cv_rl_libdir}"
1737
1738AC_TRY_RUN([
1739#include <stdio.h>
1740#include <readline/readline.h>
1741
1742main()
1743{
1744 FILE *fp;
1745 fp = fopen("conftest.rlv", "w");
1746 if (fp == 0) exit(1);
1747 fprintf(fp, "%s\n", rl_library_version ? rl_library_version : "0.0");
1748 fclose(fp);
1749 exit(0);
1750}
1751],
1752ac_cv_rl_version=`cat conftest.rlv`,
1753ac_cv_rl_version='0.0',
1754ac_cv_rl_version='4.2')
1755
1756CFLAGS="$_save_CFLAGS"
1757LDFLAGS="$_save_LDFLAGS"
1758LIBS="$_save_LIBS"
1759
1760RL_MAJOR=0
1761RL_MINOR=0
1762
1763# (
1764case "$ac_cv_rl_version" in
17652*|3*|4*|5*|6*|7*|8*|9*)
1766 RL_MAJOR=`echo $ac_cv_rl_version | sed 's:\..*$::'`
1767 RL_MINOR=`echo $ac_cv_rl_version | sed -e 's:^.*\.::' -e 's:[[a-zA-Z]]*$::'`
1768 ;;
1769esac
1770
1771# (((
1772case $RL_MAJOR in
1773[[0-9][0-9]]) _RL_MAJOR=$RL_MAJOR ;;
1774[[0-9]]) _RL_MAJOR=0$RL_MAJOR ;;
1775*) _RL_MAJOR=00 ;;
1776esac
1777
1778# (((
1779case $RL_MINOR in
1780[[0-9][0-9]]) _RL_MINOR=$RL_MINOR ;;
1781[[0-9]]) _RL_MINOR=0$RL_MINOR ;;
1782*) _RL_MINOR=00 ;;
1783esac
1784
1785RL_VERSION="0x${_RL_MAJOR}${_RL_MINOR}"
1786
1787# Readline versions greater than 4.2 have these defines in readline.h
1788
1789if test $ac_cv_rl_version = '0.0' ; then
1790 AC_MSG_WARN([Could not test version of installed readline library.])
1791elif test $RL_MAJOR -gt 4 || { test $RL_MAJOR = 4 && test $RL_MINOR -gt 2 ; } ; then
1792 # set these for use by the caller
1793 RL_PREFIX=$ac_cv_rl_prefix
1794 RL_LIBDIR=$ac_cv_rl_libdir
1795 RL_INCLUDEDIR=$ac_cv_rl_includedir
1796 AC_MSG_RESULT($ac_cv_rl_version)
1797else
1798
1799AC_DEFINE_UNQUOTED(RL_READLINE_VERSION, $RL_VERSION, [encoded version of the installed readline library])
1800AC_DEFINE_UNQUOTED(RL_VERSION_MAJOR, $RL_MAJOR, [major version of installed readline library])
1801AC_DEFINE_UNQUOTED(RL_VERSION_MINOR, $RL_MINOR, [minor version of installed readline library])
1802
1803AC_SUBST(RL_VERSION)
1804AC_SUBST(RL_MAJOR)
1805AC_SUBST(RL_MINOR)
1806
1807# set these for use by the caller
1808RL_PREFIX=$ac_cv_rl_prefix
1809RL_LIBDIR=$ac_cv_rl_libdir
1810RL_INCLUDEDIR=$ac_cv_rl_includedir
1811
1812AC_MSG_RESULT($ac_cv_rl_version)
1813
1814fi
1815])
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 0000000000..4100fe42a7
--- /dev/null
+++ b/meta/recipes-core/readline/files/configure-fix.patch
@@ -0,0 +1,24 @@
1Without this it fails to link against libtermcap causing various missing symbols
2issues.
3
4RP - 8/10/08
5
6Index: readline-5.2/configure.in
7===================================================================
8--- readline-5.2.orig/configure.in 2008-10-08 09:58:52.000000000 +0100
9+++ readline-5.2/configure.in 2008-10-08 09:59:03.000000000 +0100
10@@ -211,10 +211,10 @@
11 AC_MSG_CHECKING(configuration for building shared libraries)
12 eval `TERMCAP_LIB=$TERMCAP_LIB ${CONFIG_SHELL-/bin/sh} ${srcdir}/support/shobj-conf -C "${CC}" -c ${host_cpu} -o ${host_os} -v ${host_vendor}`
13
14-# case "$SHLIB_LIBS" in
15-# *curses*|*termcap*|*termlib*) ;;
16-# *) SHLIB_LIBS="$SHLIB_LIBS $TERMCAP_LIB" ;;
17-# esac
18+ case "$SHLIB_LIBS" in
19+ *curses*|*termcap*|*termlib*) ;;
20+ *) SHLIB_LIBS="$SHLIB_LIBS $TERMCAP_LIB" ;;
21+ esac
22
23 AC_SUBST(SHOBJ_CC)
24 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 0000000000..35bc7ed946
--- /dev/null
+++ b/meta/recipes-core/readline/readline.inc
@@ -0,0 +1,34 @@
1DESCRIPTION = "The GNU Readline library provides a set of functions for use by applications that allow users to edit \
2command lines as they are typed in. Both Emacs and vi editing modes are available. The Readline library includes \
3additional functions to maintain a list of previously-entered command lines, to recall and perhaps reedit those \
4lines, and perform csh-like history expansion on previous commands."
5SECTION = "libs"
6PRIORITY = "optional"
7
8# GPLv2+ (< 6.0), GPLv3+ (>= 6.0)
9LICENSE = "GPLv3+"
10LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
11
12DEPENDS += "ncurses"
13
14SRC_URI = "${GNU_MIRROR}/readline/${BPN}-${PV}.tar.gz \
15 file://configure-fix.patch \
16 file://acinclude.m4"
17
18S = "${WORKDIR}/${BPN}-${PV}"
19
20inherit autotools
21
22LEAD_SONAME = "libreadline.so"
23
24do_configure_prepend () {
25 install -m 0644 ${WORKDIR}/acinclude.m4 ${S}/
26}
27
28do_install_append () {
29 # Make install doesn't properly install these
30 oe_libinstall -so -C shlib libhistory ${D}${libdir}
31 oe_libinstall -so -C shlib libreadline ${D}${libdir}
32}
33
34BBCLASSEXTEND = "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 0000000000..a62345c45e
--- /dev/null
+++ b/meta/recipes-core/readline/readline_5.2.bb
@@ -0,0 +1,35 @@
1DESCRIPTION = "The GNU Readline library provides a set of functions for use by applications that allow users to edit \
2command lines as they are typed in. Both Emacs and vi editing modes are available. The Readline library includes \
3additional functions to maintain a list of previously-entered command lines, to recall and perhaps reedit those \
4lines, and perform csh-like history expansion on previous commands."
5SECTION = "libs"
6
7LICENSE = "GPLv2+"
8LIC_FILES_CHKSUM = "file://COPYING;md5=03b36fdd84f74b8d8189a202b980b67f"
9
10DEPENDS += "ncurses"
11PRIORITY = "optional"
12
13PR = "r6"
14
15SRC_URI = "${GNU_MIRROR}/readline/${BPN}-${PV}.tar.gz \
16 file://configure-fix.patch \
17 file://acinclude.m4"
18
19S = "${WORKDIR}/${BPN}-${PV}"
20
21inherit autotools
22
23LEAD_SONAME = "libreadline.so"
24
25do_configure_prepend () {
26 install -m 0644 ${WORKDIR}/acinclude.m4 ${S}/
27}
28
29do_install_append () {
30 # Make install doesn't properly install these
31 oe_libinstall -so -C shlib libhistory ${D}${libdir}
32 oe_libinstall -so -C shlib libreadline ${D}${libdir}
33}
34
35BBCLASSEXTEND = "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 0000000000..c32755669c
--- /dev/null
+++ b/meta/recipes-core/readline/readline_6.1.bb
@@ -0,0 +1,3 @@
1require readline.inc
2
3PR = "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 0000000000..5b513211dc
--- /dev/null
+++ b/meta/recipes-core/sysfsutils/sysfsutils_2.1.0.bb
@@ -0,0 +1,21 @@
1DESCRIPTION = "system utilities based on sysfs."
2HOMEPAGE = "http://linux-diag.sourceforge.net/Sysfsutils.html"
3
4LICENSE = "GPLv2 & LGPLv2.1"
5LICENSE_${PN} = "GPLv2"
6LICENSE_libsysfs = "LGPLv2.1"
7LIC_FILES_CHKSUM = "file://COPYING;md5=3d06403ea54c7574a9e581c6478cc393 \
8 file://cmd/GPL;md5=d41d4e2e1e108554e0388ea4aecd8d27 \
9 file://lib/LGPL;md5=b75d069791103ffe1c0d6435deeff72e"
10PR = "r0"
11
12SRC_URI = "${SOURCEFORGE_MIRROR}/linux-diag/sysfsutils-${PV}.tar.gz"
13S = "${WORKDIR}/sysfsutils-${PV}"
14
15inherit autotools
16
17PACKAGES_prepend = "libsysfs libsysfs-dbg libsysfs-dev "
18FILES_libsysfs = "${libdir}/*.so.*"
19FILES_libsysfs-dev = "${libdir}/* ${includedir}"
20FILES_libsysfs-dbg = "${libdir}/.debug"
21FILES_${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 0000000000..3fea2c02d7
--- /dev/null
+++ b/meta/recipes-core/util-linux/files/MCONFIG
@@ -0,0 +1,223 @@
1# MCONFIG -- Configuration stuff for util-linux
2# Created: Sat Feb 4 15:50:30 1995
3# Copyright 1995 Rickard E. Faith (faith@cs.unc.edu)
4
5# For a user-mode install, make (at least) three changes:
6# - remove the `-o root' part in INSTALLSUID
7# - set USE_TTY_GROUP=no
8# - define DESTDIR
9
10# Select for ARCH one of intel, alpha, sparc, arm, m68k, mips
11# Select for CPU i386 if the binaries must be able to run on an intel 386
12# (by default i486 code is generated, see below)
13CPU=$(shell uname -m)
14ARCH=$(shell echo $(CPU) | sed 's/i.86/intel/;s/arm.*/arm/')
15
16# If HAVE_PAM is set to "yes", then login, chfn, chsh, and newgrp
17# will use PAM for authentication. Additionally, passwd will not be
18# installed as it is not PAM aware.
19HAVE_PAM=no
20
21# If HAVE_SHADOW is set to "yes", then login, chfn, chsh, newgrp, passwd,
22# and vipw will not be built or installed from the login-utils
23# subdirectory.
24HAVE_SHADOW=yes
25
26# If HAVE_PASSWD is set to "yes", then passwd will not be built or
27# installed from the login-utils subdirectory (but login, chfn, chsh,
28# newgrp, and vipw *will* be installed).
29HAVE_PASSWD=no
30
31# If you use chfn and chsh from this package, REQUIRE_PASSWORD will require
32# non-root users to enter the account password before updating /etc/passwd.
33REQUIRE_PASSWORD=yes
34#REQUIRE_PASSWORD=no
35
36# If you use chsh from this package, ONLY_LISTED_SHELLS will require that
37# the selected shell be listed in /etc/shells -- otherwise only a warning is
38# printed. This prevents someone from setting their shell to /bin/false.
39ONLY_LISTED_SHELLS=yes
40#ONLY_LISTED_SHELLS=no
41
42
43# If HAVE_SYSVINIT is set to "yes", then simpleinit and shutdown will not
44# be built or installed from the login-utils subdirectory. (The shutdown
45# and halt that come with the SysVinit package should be used with the init
46# found in that package.)
47HAVE_SYSVINIT=no
48
49# If HAVE_SYSVINIT_UTILS is set to "yes", then last, mesg, and wall will
50# not be built or installed from the login-utils subdirectory. (The
51# shutdown and init from the SysVinit package do not depend on the last,
52# mesg, and wall from that package.)
53HAVE_SYSVINIT_UTILS=no
54
55# If HAVE_WRITE is set to "yes", then write will not be built or
56# installed from the misc-utils subdirectory.
57# (There is a network aware write in netwrite from NetKit 0.16 or later.)
58HAVE_WRITE=no
59
60# If HAVE_GETTY is set to "yes", then agetty will not be built or
61# installed from the login-utils subdirectory. Note that agetty can
62# co-exist with other gettys, so this option should never be used.
63HAVE_GETTY=no
64
65# If USE_TTY_GROUP is set to "yes", then wall and write will be installed
66# setgid to the "tty" group, and mesg will only set the group write bit.
67# Note that this is only useful if login/xterm/etc. change the group of the
68# user's tty to "tty" [The login in util-linux does this correctly, and
69# xterm will do it correctly if X is compiled with USE_TTY_GROUP set
70# properly.]
71USE_TTY_GROUP=no
72
73# If HAVE_KILL is set to "yes", then kill will not be built or
74# installed from the misc-utils subdirectory.
75# (There is also a kill in the procps package.)
76HAVE_KILL=no
77
78# If ALLOW_VCS_USE is set to "yes", then login will chown /dev/vcsN
79# to the current user, allowing her to make a screendump and do other
80# nifty things on the console, but also allowing him to keep an open
81# file descriptor after logging out to trick the next user.
82ALLOW_VCS_USE=yes
83
84# If HAVE_RESET is set to "yes", then reset won't be installed. The version
85# of reset that comes with the ncurses package is less aggressive.
86HAVE_RESET=yes
87
88# If HAVE_SLN is set to "yes", then sln won't be installed
89# (but the man page sln.8 will be installed anyway).
90# sln also comes with libc and glibc.
91HAVE_SLN=no
92
93# If HAVE_FDUTILS is set to "yes", then setfdprm won't be installed.
94HAVE_FDUTILS=no
95
96# If SILENT_PG is set to "yes", then pg will not ring the bell
97# when an invalid key is pressed
98SILENT_PG=no
99
100# If configure decides that Native Language Support (NLS) is available,
101# it sets MAY_ENABLE_NLS in defines.h. If you don't want NLS, set
102# DISABLE_NLS to "yes".
103DISABLE_NLS=no
104
105# Different optimizations for different cpus.
106# gcc 3.0 likes options -mcpu=i486 instead of -m486
107ifeq "$(ARCH)" "intel"
108 ifeq "$(HAVE_OLD_GCC)" "yes"
109 CPUHEAD=-m
110 else
111 CPUHEAD=-mcpu=i
112 endif
113 ifeq "$(CPU)" "i386"
114 CPUTAIL=386
115 else
116 CPUTAIL=486
117 endif
118 CPUOPT= $(CPUHEAD)$(CPUTAIL)
119 OPT= -pipe -O2 $(CPUOPT) -fomit-frame-pointer
120else
121 ifeq "$(ARCH)" "arm"
122 OPT= -pipe -O2 -fsigned-char -fomit-frame-pointer
123 else
124 OPT= -O2 -fomit-frame-pointer
125 endif
126endif
127
128WARNFLAGS = -Wall -Wmissing-prototypes -Wstrict-prototypes
129
130LIB=../lib
131
132ERR_O=$(LIB)/err.o
133
134# Set HAVE_SLANG to yes if you have slang (and prefer to use that for cfdisk)
135# (If neither HAVE_NCURSES nor HAVE_SLANG is defined, cfdisk is not made.)
136# HAVE_SLANG=yes
137# There is a subdirectory /usr/include/slang containing slcurses.h
138# SLANGFLAGS=-I/usr/include/slang
139# No such subdirectory - slcurses.h lives in /usr/include
140# (no extra definition required).
141LIBSLANG=-lslang
142
143#
144# Paths used for compilation (not all are actually used, see CFLAGS below)
145#
146DEV_DIR= /dev
147ETC_DIR= /etc
148SBIN_DIR= /sbin
149USRSBIN_DIR= /usr/sbin
150USRLIB_DIR= /usr/lib
151USRBIN_DIR= /usr/bin
152USRGAMES_DIR= /usr/games
153USRSHAREMISC_DIR=/usr/share/misc
154LOCALE_DIR= /usr/share/locale
155BIN_DIR= /bin
156VAR_PATH= /var
157LOG_DIR= /var/log
158MAN_DIR= /usr/share/man
159INFO_DIR= /usr/share/info
160
161#
162# Paths used for install
163#
164DEVDIR= $(DESTDIR)$(DEV_DIR)
165ETCDIR= $(DESTDIR)$(ETC_DIR)
166SBINDIR= $(DESTDIR)$(SBIN_DIR)
167USRSBINDIR= $(DESTDIR)$(USRSBIN_DIR)
168USRLIBDIR= $(DESTDIR)$(USRLIB_DIR)
169USRBINDIR= $(DESTDIR)$(USRBIN_DIR)
170USRGAMESDIR= $(DESTDIR)$(USRGAMES_DIR)
171USRSHAREMISCDIR=$(DESTDIR)$(USRSHAREMISC_DIR)
172LOCALEDIR= $(DESTDIR)$(LOCALE_DIR)
173BINDIR= $(DESTDIR)$(BIN_DIR)
174VARPATH= $(DESTDIR)$(VAR_PATH)
175LOGDIR= $(DESTDIR)$(LOG_DIR)
176MANDIR= $(DESTDIR)$(MAN_DIR)
177MAN1DIR= $(MANDIR)/man1
178MAN3DIR= $(MANDIR)/man3
179MAN5DIR= $(MANDIR)/man5
180MAN6DIR= $(MANDIR)/man6
181MAN8DIR= $(MANDIR)/man8
182INFODIR= $(DESTDIR)$(INFO_DIR)
183
184# Directory for shutdown, halt, reboot, etc.
185SHUTDOWNDIR= $(SBINDIR)
186
187# Modes
188DIRMODE= 755
189BINMODE= 755
190MANMODE= 644
191DATMODE= 644
192INFOMODE= 644
193SUIDMODE= 4755
194
195CHMOD= chmod
196INSTALL= install
197INSTALLDIR= $(INSTALL) -d -m $(DIRMODE)
198INSTALLBIN= $(INSTALL) -m $(BINMODE)
199INSTALLMAN= $(INSTALL) -m $(MANMODE)
200INSTALLDAT= $(INSTALL) -m $(DATMODE)
201INSTALLSUID= $(INSTALL) -m $(SUIDMODE)
202
203ifeq "$(DISABLE_NLS)" "yes"
204NLSFLAGS = -DDISABLE_NLS
205endif
206
207CFLAGS := $(OPT) -I$(LIB) $(WARNFLAGS) \
208 $(CURSESFLAGS) $(SLANGFLAGS) $(NLSFLAGS) \
209 -D_FILE_OFFSET_BITS=64 \
210 -DSBINDIR=\"$(SBIN_DIR)\" \
211 -DUSRSBINDIR=\"$(USRSBIN_DIR)\" \
212 -DLOGDIR=\"$(LOG_DIR)\" \
213 -DVARPATH=\"$(VAR_PATH)\" \
214 -DLOCALEDIR=\"$(LOCALE_DIR)\" \
215 $(CFLAGS)
216
217
218%.o: %.c
219 $(CC) -c $(CFLAGS) $< -o $@
220
221%: %.cc
222 $(CXX) $(CFLAGS) $< -o $@
223
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 0000000000..fcd2046e34
--- /dev/null
+++ b/meta/recipes-core/util-linux/files/debian-bug392236.patch
@@ -0,0 +1,203 @@
1Index: util-linux-2.12r/fdisk/llseek.c
2===================================================================
3--- util-linux-2.12r.orig/fdisk/llseek.c 2003-07-13 23:13:33.000000000 +0200
4+++ util-linux-2.12r/fdisk/llseek.c 2007-04-04 19:01:14.000000000 +0200
5@@ -14,30 +14,23 @@
6
7 #ifdef __linux__
8
9-#ifdef HAVE_LLSEEK
10-#include <syscall.h>
11-
12-#else /* HAVE_LLSEEK */
13+#include <sys/syscall.h>
14+#ifndef HAVE_LLSEEK
15
16 #if defined(__alpha__) || defined(__ia64__) || defined(__s390x__)
17
18 #define my_llseek lseek
19
20 #else
21-#include <linux/unistd.h> /* for __NR__llseek */
22-
23-static int _llseek (unsigned int, unsigned long,
24- unsigned long, long long *, unsigned int);
25
26-#ifdef __NR__llseek
27+#ifdef SYS__llseek
28
29-static _syscall5(int,_llseek,unsigned int,fd,unsigned long,offset_high,
30- unsigned long, offset_low,long long *,result,
31- unsigned int, origin)
32+#define _llseek(fd, offset_high, offset_low, result, origin) \
33+ syscall(SYS__llseek, fd, offset_high, offset_low, result, origin)
34
35 #else
36
37-/* no __NR__llseek on compilation machine - might give it explicitly */
38+/* no SYS__llseek on compilation machine - might give it explicitly */
39 static int _llseek (unsigned int fd, unsigned long oh,
40 unsigned long ol, long long *result,
41 unsigned int origin) {
42Index: util-linux-2.12r/fdisk/sfdisk.c
43===================================================================
44--- util-linux-2.12r.orig/fdisk/sfdisk.c 2005-01-04 23:31:57.000000000 +0100
45+++ util-linux-2.12r/fdisk/sfdisk.c 2007-04-04 19:01:14.000000000 +0200
46@@ -48,7 +48,7 @@
47 #include <sys/ioctl.h>
48 #include <sys/stat.h>
49 #include <sys/utsname.h>
50-#include <linux/unistd.h> /* _syscall */
51+#include <sys/syscall.h>
52 #include "nls.h"
53 #include "common.h"
54
55@@ -177,9 +177,8 @@
56 #endif
57
58 #ifndef use_lseek
59-static __attribute__used
60-_syscall5(int, _llseek, unsigned int, fd, ulong, hi, ulong, lo,
61- loff_t *, res, unsigned int, wh);
62+#define _llseek(fd, hi, lo, res, wh) \
63+ syscall(SYS__llseek, fd, hi, lo, res, wh)
64 #endif
65
66 static int
67Index: util-linux-2.12r/lib/my_reboot.c
68===================================================================
69--- util-linux-2.12r.orig/lib/my_reboot.c 1999-07-09 04:56:36.000000000 +0200
70+++ util-linux-2.12r/lib/my_reboot.c 2007-04-04 19:01:14.000000000 +0200
71@@ -23,10 +23,11 @@
72 #else /* no USE_LIBC */
73
74 /* direct syscall version */
75-#include <linux/unistd.h>
76+#include <sys/syscall.h>
77
78-#ifdef _syscall3
79-_syscall3(int, reboot, int, magic, int, magic_too, int, cmd);
80+#ifdef SYS_reboot
81+#define reboot(magic, magic2, cmd) \
82+ syscall(SYS_reboot, magic, magic2, cmd)
83 #else
84 /* Let us hope we have a 3-argument reboot here */
85 extern int reboot(int, int, int);
86Index: util-linux-2.12r/misc-utils/setterm.c
87===================================================================
88--- util-linux-2.12r.orig/misc-utils/setterm.c 2003-10-17 18:17:51.000000000 +0200
89+++ util-linux-2.12r/misc-utils/setterm.c 2007-04-04 19:01:14.000000000 +0200
90@@ -119,14 +119,13 @@
91
92 #if __GNU_LIBRARY__ < 5
93 #ifndef __alpha__
94-# include <linux/unistd.h>
95-#define __NR_klogctl __NR_syslog
96-_syscall3(int, klogctl, int, type, char*, buf, int, len);
97+# include <sys/syscall.h>
98+#define klogctl(type, buf, len) \
99+ syscall(SYS_syslog, type, buf, len)
100 #else /* __alpha__ */
101 #define klogctl syslog
102 #endif
103 #endif
104-extern int klogctl(int type, char *buf, int len);
105
106 /* Constants. */
107
108Index: util-linux-2.12r/mount/swapon.c
109===================================================================
110--- util-linux-2.12r.orig/mount/swapon.c 2004-12-22 10:50:19.000000000 +0100
111+++ util-linux-2.12r/mount/swapon.c 2007-04-04 19:01:14.000000000 +0200
112@@ -82,11 +82,11 @@
113 #else
114 /* We want a swapon with two args, but have an old libc.
115 Build the kernel call by hand. */
116-#include <linux/unistd.h>
117-static
118-_syscall2(int, swapon, const char *, path, int, flags);
119-static
120-_syscall1(int, swapoff, const char *, path);
121+#include <sys/syscall.h>
122+#define swapon(path, flags) \
123+ syscall(SYS_swapon, path, flags)
124+#define swapoff(path) \
125+ syscall(SYS_swapoff, path)
126 #endif
127 #else
128 /* just do as libc says */
129Index: util-linux-2.12r/mount/umount.c
130===================================================================
131--- util-linux-2.12r.orig/mount/umount.c 2007-04-04 19:01:14.000000000 +0200
132+++ util-linux-2.12r/mount/umount.c 2007-04-04 19:02:22.000000000 +0200
133@@ -37,14 +37,13 @@
134 #else /* MNT_FORCE */
135
136 /* Does the present kernel source know about umount2? */
137-#include <linux/unistd.h>
138-#ifdef __NR_umount2
139+#include <sys/syscall.h>
140+#ifdef SYS_umount2
141
142-int umount2(const char *path, int flags);
143+#define umount2(path, flags) \
144+ syscall(SYS_umount2, path, flags)
145
146-_syscall2(int, umount2, const char *, path, int, flags);
147-
148-#else /* __NR_umount2 */
149+#else /* SYS_umount2 */
150
151 static int
152 umount2(const char *path, int flags) {
153@@ -52,7 +51,7 @@
154 errno = ENOSYS;
155 return -1;
156 }
157-#endif /* __NR_umount2 */
158+#endif /* SYS_umount2 */
159
160 #if !defined(MNT_FORCE)
161 /* dare not try to include <linux/mount.h> -- lots of errors */
162Index: util-linux-2.12r/partx/partx.c
163===================================================================
164--- util-linux-2.12r.orig/partx/partx.c 2004-08-23 22:13:27.000000000 +0200
165+++ util-linux-2.12r/partx/partx.c 2007-04-04 19:01:14.000000000 +0200
166@@ -338,10 +338,9 @@
167 #endif
168
169 #ifdef NEED__llseek
170-#include <linux/unistd.h> /* _syscall */
171-static
172-_syscall5(int, _llseek, uint, fd, ulong, hi, ulong, lo,
173- long long *, res, uint, wh);
174+#include <sys/syscall.h>
175+#define _llseek(fd, hi, lo, res, wh) \
176+ syscall(SYS__llseek, fd, hi, lo, res, wh)
177 #endif
178
179 static int
180Index: util-linux-2.12r/sys-utils/dmesg.c
181===================================================================
182--- util-linux-2.12r.orig/sys-utils/dmesg.c 2004-05-04 18:38:12.000000000 +0200
183+++ util-linux-2.12r/sys-utils/dmesg.c 2007-04-04 19:01:14.000000000 +0200
184@@ -29,7 +29,7 @@
185 * Only function 3 is allowed to non-root processes.
186 */
187
188-#include <linux/unistd.h>
189+#include <sys/syscall.h>
190 #include <stdio.h>
191 #include <getopt.h>
192 #include <stdlib.h>
193@@ -38,8 +38,8 @@
194 #if __GNU_LIBRARY__ < 5
195
196 #ifndef __alpha__
197-# define __NR_klogctl __NR_syslog
198- static inline _syscall3(int, klogctl, int, type, char *, b, int, len);
199+# define klogctl(type, b, len) \
200+ syscall(SYS_syslog, type, b, len)
201 #else /* __alpha__ */
202 #define klogctl syslog
203 #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 0000000000..6ce6b86df5
--- /dev/null
+++ b/meta/recipes-core/util-linux/files/defines.h
@@ -0,0 +1,10 @@
1#define UTIL_LINUX_VERSION "2.12"
2#define util_linux_version "util-linux-2.12"
3
4#define HAVE_blkpg_h
5#define HAVE_kd_h
6#define HAVE_locale_h
7#define HAVE_langinfo_h
8#define HAVE_sys_user_h
9#define HAVE_asm_types_h
10//#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 0000000000..e6f82b5b46
--- /dev/null
+++ b/meta/recipes-core/util-linux/files/fdiskbsdlabel_thumb.diff
@@ -0,0 +1,12 @@
1--- util-linux-2.12r/fdisk/fdiskbsdlabel.h.orig 2006-01-21 23:53:51.000000000 +0100
2+++ util-linux-2.12r/fdisk/fdiskbsdlabel.h 2006-01-21 23:54:35.000000000 +0100
3@@ -52,6 +52,9 @@
4 #elif defined (__s390__) || defined (__s390x__)
5 #define BSD_LABELSECTOR 1
6 #define BSD_LABELOFFSET 0
7+#elif defined (__thumb__)
8+#define BSD_LABELSECTOR 1
9+#define BSD_LABELOFFSET 0
10 #else
11 #error unknown architecture
12 #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 0000000000..bf1082e85c
--- /dev/null
+++ b/meta/recipes-core/util-linux/files/fix-make-c.patch
@@ -0,0 +1,41 @@
1From: Karel Zak <kzak@redhat.com>
2Date: Mon, 11 May 2009 09:49:00 +0000 (+0200)
3Subject: build-sys: fix "make -C" bug
4X-Git-Url: http://git.kernel.org/?p=utils%2Futil-linux-ng%2Futil-linux-ng.git;a=commitdiff_plain;h=2ef7d41e6bbb7c842c06e911ffc562335a467b5d
5
6build-sys: fix "make -C" bug
7
8Running:
9
10./configure --with-fsprobe=builtin
11make -C mount mount
12
13causes the following error:
14
15gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I.. -include ../config.h
16-I../include -DLOCALEDIR=\"/home/matthew/util-linux-ng/share/locale\"
17-fsigned-char -I../libs/blkid/src -g -O2 -MT mount-setproctitle.o
18-MD -MP -MF .deps/mount-setproctitle.Tpo -c -o mount-setproctitle.o
19`test -f '../lib/setproctitle.c' || echo './'`../lib/setproctitle.c mv
20-f .deps/mount-setproctitle.Tpo .deps/mount-setproctitle.Po
21make -C
22make: option requires an argument -- 'C'
23Usage: make [options] [target] ...
24...
25
26Reported-by: Matthew Burgess <matthew@linuxfromscratch.org>
27Signed-off-by: Karel Zak <kzak@redhat.com>
28---
29
30diff --git a/config/include-Makefile.am b/config/include-Makefile.am
31index b42a0c3..d5da619 100644
32--- a/config/include-Makefile.am
33+++ b/config/include-Makefile.am
34@@ -17,6 +17,7 @@ dist_noinst_DATA = $(dist_man_MANS)
35 # Paths to in-tree libraries (use ul_ prefix to avoid possible collisions)
36 #
37 ul_libblkid_srcdir = $(top_srcdir)/libs/blkid/src
38+ul_libblkid_builddir = $(top_builddir)/libs/blkid/src
39 ul_libblkid_la = $(top_builddir)/libs/blkid/src/libblkid.la
40
41 $(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 0000000000..8c4a20cdca
--- /dev/null
+++ b/meta/recipes-core/util-linux/files/gcc34.patch
@@ -0,0 +1,23 @@
1
2#
3# Patch managed by http://www.holgerschurig.de/patcher.html
4#
5
6--- util-linux-2.12o/disk-utils/fsck.cramfs.c~gcc34
7+++ util-linux-2.12o/disk-utils/fsck.cramfs.c
8@@ -77,15 +77,7 @@
9 #define PAD_SIZE 512
10
11 #include <asm/page.h>
12-#ifdef PAGE_SIZE
13-#define PAGE_CACHE_SIZE ((int) PAGE_SIZE)
14-#elif defined __ia64__
15-#define PAGE_CACHE_SIZE (16384)
16-#elif defined __alpha__
17-#define PAGE_CACHE_SIZE (8192)
18-#else
19 #define PAGE_CACHE_SIZE (4096)
20-#endif
21
22 /* Guarantee access to at least 8kB at a time */
23 #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 0000000000..6d0c2fcefa
--- /dev/null
+++ b/meta/recipes-core/util-linux/files/glibc-fix.patch
@@ -0,0 +1,22 @@
1--- /tmp/cmos.c 2006-11-21 11:38:55.000000000 +0100
2+++ util-linux-2.12r/hwclock/cmos.c 2006-11-21 11:41:45.458554000 +0100
3@@ -46,15 +46,16 @@
4
5 #include <unistd.h> /* for geteuid() */
6 #include <fcntl.h> /* for O_RDWR */
7+#include <linux/version.h>
8 #include <errno.h>
9 #include "../defines.h" /* for HAVE_sys_io_h */
10 #include "nls.h"
11
12 #if defined(__i386__)
13-#ifdef HAVE_sys_io_h
14-#include <sys/io.h>
15+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 0)
16+#include <asm/io.h>
17 #else
18-#include <asm/io.h> /* for inb, outb */
19+#include <sys/io.h> /* for inb, outb */
20 #endif
21 #elif defined(__alpha__)
22 /* <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 0000000000..e6abcd91f7
--- /dev/null
+++ b/meta/recipes-core/util-linux/files/make_include
@@ -0,0 +1,17 @@
1VERSION=2.12
2CC=gcc
3CFLAGS=
4LDFLAGS=
5HAVE_OLD_GCC=yes
6HAVE_RAW_H=yes
7HAVE_NCURSES=yes
8CURSESFLAGS=-DNCH=1
9LIBCURSES=-lncurses
10HAVE_TERMCAP=no
11NEED_LIBCRYPT=yes
12FOREIGN = --foreign-user
13HAVE_XGETTEXT=yes
14HAVE_OPENPTY=yes
15HAVE_PIVOT_ROOT=yes
16HAVE_GOOD_RPC=yes
17HAVE_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 0000000000..2d0ea43cd2
--- /dev/null
+++ b/meta/recipes-core/util-linux/files/optional-uuid.patch
@@ -0,0 +1,55 @@
1From: Karel Zak <kzak@redhat.com>
2Date: Tue, 12 May 2009 19:22:19 +0000 (+0200)
3Subject: blkid: make libuuid optional
4X-Git-Url: http://git.kernel.org/?p=utils%2Futil-linux-ng%2Futil-linux-ng.git;a=commitdiff_plain;h=cdd17c7a73cab10a34bf80616225b8215ac4e2ed
5
6blkid: make libuuid optional
7
8read.c:28:23: error: uuid/uuid.h: No such file or directory
9make[3]: *** [read.lo] Error 1
10make[3]: *** Waiting for unfinished jobs....
11
12Reported-by: Olaf <mailinglists@ban-solms.de>
13Signed-off-by: Karel Zak <kzak@redhat.com>
14---
15
16diff --git a/libs/blkid/src/config.c b/libs/blkid/src/config.c
17index 2e59218..9091736 100644
18--- a/libs/blkid/src/config.c
19+++ b/libs/blkid/src/config.c
20@@ -24,9 +24,6 @@
21 #include <errno.h>
22 #endif
23 #include <stdint.h>
24-#ifdef HAVE_LIBUUID
25-#include <uuid/uuid.h>
26-#endif
27 #include <stdarg.h>
28
29 #include "blkdev.h"
30diff --git a/libs/blkid/src/evaluate.c b/libs/blkid/src/evaluate.c
31index a9c9fba..f0ae126 100644
32--- a/libs/blkid/src/evaluate.c
33+++ b/libs/blkid/src/evaluate.c
34@@ -27,9 +27,6 @@
35 #include <errno.h>
36 #endif
37 #include <stdint.h>
38-#ifdef HAVE_LIBUUID
39-#include <uuid/uuid.h>
40-#endif
41 #include <stdarg.h>
42
43 #include "pathnames.h"
44diff --git a/libs/blkid/src/read.c b/libs/blkid/src/read.c
45index 4163874..b5e9cd0 100644
46--- a/libs/blkid/src/read.c
47+++ b/libs/blkid/src/read.c
48@@ -25,7 +25,6 @@
49 #endif
50
51 #include "blkidP.h"
52-#include "uuid/uuid.h"
53
54 #ifdef HAVE_STRTOULL
55 #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 0000000000..e960eef05f
--- /dev/null
+++ b/meta/recipes-core/util-linux/files/swapargs.h
@@ -0,0 +1,3 @@
1#define SWAPON_HAS_TWO_ARGS
2#include <asm/page.h>
3#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 0000000000..78330789ef
--- /dev/null
+++ b/meta/recipes-core/util-linux/files/umount.diff
@@ -0,0 +1,19 @@
1*** util-linux-2.12r/mount/umount.c.orig 2005-09-10 20:07:38.000000000 +0200
2--- util-linux-2.12r/mount/umount.c 2006-06-07 21:14:04.000000000 +0200
3***************
4*** 40,46 ****
5 #include <linux/unistd.h>
6 #ifdef __NR_umount2
7
8! static int umount2(const char *path, int flags);
9
10 _syscall2(int, umount2, const char *, path, int, flags);
11
12--- 40,46 ----
13 #include <linux/unistd.h>
14 #ifdef __NR_umount2
15
16! int umount2(const char *path, int flags);
17
18 _syscall2(int, umount2, const char *, path, int, flags);
19
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 0000000000..3208e0a865
--- /dev/null
+++ b/meta/recipes-core/util-linux/files/uuid.patch
@@ -0,0 +1,22 @@
1Index: util-linux-ng-2.15/libs/blkid/src/Makefile.am
2===================================================================
3--- util-linux-ng-2.15.orig/libs/blkid/src/Makefile.am 2009-05-19 17:01:15.000000000 +0100
4+++ util-linux-ng-2.15/libs/blkid/src/Makefile.am 2009-05-19 17:08:11.000000000 +0100
5@@ -7,7 +7,7 @@
6 common_ldadd =
7
8 if HAVE_UUID
9-common_ldadd += -luuid #TODO $(UUID_LIBS)
10+common_ldadd += -luuid
11 endif
12
13 # includes
14@@ -26,7 +26,7 @@
15 $(top_srcdir)/lib/md5.c
16
17 libblkid_la_LIBADD = probers/libblkid_probers.la $(common_ldadd)
18-libblkid_la_DEPENDENCIES = $(libblkid_la_LIBADD) blkid.sym
19+libblkid_la_DEPENDENCIES = probers/libblkid_probers.la blkid.sym
20
21 # TODO: for unknown reason "make distcheck" requires
22 # 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 0000000000..bdb29cae1f
--- /dev/null
+++ b/meta/recipes-core/util-linux/util-linux-2.17.2/tls.patch
@@ -0,0 +1,70 @@
1Index: util-linux-ng-2.16/m4/tls.m4
2===================================================================
3--- util-linux-ng-2.16.orig/m4/tls.m4 2009-07-04 01:20:03.000000000 +0200
4+++ util-linux-ng-2.16/m4/tls.m4 2009-07-30 01:57:30.151697033 +0200
5@@ -18,31 +18,26 @@
6 # version as well.
7 #
8 AC_DEFUN([AX_TLS], [
9- AC_MSG_CHECKING(for thread local storage (TLS) class)
10- AC_CACHE_VAL(ac_cv_tls, [
11- ax_tls_keywords="__thread __declspec(thread) none"
12- for ax_tls_keyword in $ax_tls_keywords; do
13- case $ax_tls_keyword in
14- none) ac_cv_tls=none ; break ;;
15- *)
16- AC_TRY_COMPILE(
17- [#include <stdlib.h>
18- static void
19- foo(void) {
20- static ] $ax_tls_keyword [ int bar;
21- exit(1);
22- }],
23- [],
24- [ac_cv_tls=$ax_tls_keyword ; break],
25- ac_cv_tls=none
26- )
27- esac
28- done
29-])
30+ AC_CACHE_CHECK([for thread local storage (TLS) class],
31+ ac_cv_tls,
32+ [AC_LINK_IFELSE([__thread int a; int b; int main() { return a = b; }],
33+ [chktls_save_LDFLAGS="$LDFLAGS"
34+ LDFLAGS="-shared -Wl,--no-undefined $LDFLAGS"
35+ chktls_save_CFLAGS="$CFLAGS"
36+ CFLAGS="-fPIC $CFLAGS"
37+ dnl If -shared works, test if TLS works in a shared library.
38+ AC_LINK_IFELSE([int f() { return 0; }],
39+ AC_LINK_IFELSE([__thread int a; int b; int f() { return a = b; }],
40+ [ac_cv_tls=yes],
41+ [ac_cv_tls=no]),
42+ [ac_cv_tls=yes])
43+ CFLAGS="$chktls_save_CFLAGS"
44+ LDFLAGS="$chktls_save_LDFLAGS"], [ac_cv_tls=no])
45+ ])
46
47- if test "$ac_cv_tls" != "none"; then
48- dnl AC_DEFINE([TLS], [], [If the compiler supports a TLS storage class define it to that here])
49- AC_DEFINE_UNQUOTED([TLS], $ac_cv_tls, [If the compiler supports a TLS storage class define it to that here])
50- fi
51- AC_MSG_RESULT($ac_cv_tls)
52+ AS_IF([test "x$ac_cv_tls" = "xyes"],
53+ [AC_DEFINE([TLS], 1,
54+ [Define this if the compiler supports __thread for Thread-Local Storage])
55+ $1],
56+ [$2])
57 ])
58Index: util-linux-ng-2.16/shlibs/uuid/src/gen_uuid.c
59===================================================================
60--- util-linux-ng-2.16.orig/shlibs/uuid/src/gen_uuid.c 2009-07-30 02:31:48.518159459 +0200
61+++ util-linux-ng-2.16/shlibs/uuid/src/gen_uuid.c 2009-07-30 02:32:04.867871183 +0200
62@@ -99,7 +99,7 @@
63 #endif
64
65 #ifdef TLS
66-#define THREAD_LOCAL static TLS
67+#define THREAD_LOCAL static __thread
68 #else
69 #define THREAD_LOCAL static
70 #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 0000000000..b2e8a8b95a
--- /dev/null
+++ b/meta/recipes-core/util-linux/util-linux-2.17.2/uclibc-compile.patch
@@ -0,0 +1,13 @@
1Index: util-linux-ng-2.16/misc-utils/cal.c
2===================================================================
3--- util-linux-ng-2.16.orig/misc-utils/cal.c 2009-07-03 16:20:01.000000000 -0700
4+++ util-linux-ng-2.16/misc-utils/cal.c 2009-07-18 23:21:37.000000000 -0700
5@@ -407,7 +407,7 @@
6 strcpy(day_headings,"");
7 strcpy(j_day_headings,"");
8
9-#ifdef HAVE_LANGINFO_H
10+#ifdef HAVE_LANGINFO_H && !defined(__UCLIBC__)
11 # define weekday(wd) nl_langinfo(ABDAY_1+wd)
12 #else
13 # 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 0000000000..4b5eb73760
--- /dev/null
+++ b/meta/recipes-core/util-linux/util-linux-2.17.2/util-linux-ng-replace-siginterrupt.patch
@@ -0,0 +1,23 @@
1Index: util-linux-ng-2.14/login-utils/login.c
2===================================================================
3--- util-linux-ng-2.14.orig/login-utils/login.c 2008-05-28 16:01:02.000000000 -0700
4+++ util-linux-ng-2.14/login-utils/login.c 2009-03-04 18:31:42.000000000 -0800
5@@ -358,6 +358,7 @@
6 char *childArgv[10];
7 char *buff;
8 int childArgc = 0;
9+ struct sigaction act;
10 #ifdef HAVE_SECURITY_PAM_MISC_H
11 int retcode;
12 pam_handle_t *pamh = NULL;
13@@ -373,7 +374,9 @@
14 pid = getpid();
15
16 signal(SIGALRM, timedout);
17- siginterrupt(SIGALRM,1); /* we have to interrupt syscalls like ioclt() */
18+ (void) sigaction(SIGALRM, NULL, &act);
19+ act.sa_flags &= ~SA_RESTART;
20+ sigaction(SIGALRM, &act, NULL);
21 alarm((unsigned int)timeout);
22 signal(SIGQUIT, SIG_IGN);
23 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 0000000000..571b53c99c
--- /dev/null
+++ b/meta/recipes-core/util-linux/util-linux.inc
@@ -0,0 +1,237 @@
1DESCRIPTION = "Util-linux is a suite of essential utilities for any Linux system."
2SECTION = "base"
3
4# note that `lscpu' is under GPLv3+
5LICENSE = "GPLv2+ & LGPLv2.1+ & BSD"
6LICENSE_util-linux-lscpu = "GPLv3+"
7
8LIC_FILES_CHKSUM = "file://README.licensing;md5=1530e36fe1304d4535513de90a290df9 \
9 file://COPYING;md5=59530bdf33659b29e73d4adb9f9f6552 \
10 file://licenses/COPYING.GPL;md5=8ca43cbc842c2336e835926c2166c28b \
11 file://licenses/COPYING.UCB;md5=263860f8968d8bafa5392cab74285262 \
12 file://getopt/COPYING;md5=8ca43cbc842c2336e835926c2166c28b"
13
14DEPENDS = "udev zlib ncurses virtual/libintl gettext"
15DEPENDS_virtclass-native = "zlib-native ncurses-native lzo-native gettext-native"
16
17inherit autotools
18
19SRC_URI = "${KERNELORG_MIRROR}/pub/linux/utils/util-linux-ng/v${MAJOR_VERSION}/util-linux-ng-${PV}.tar.bz2 \
20 file://MCONFIG \
21 file://swapargs.h \
22 file://defines.h \
23 file://make_include \
24 "
25
26PACKAGES_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 "
27
28PACKAGES_virtclass-native = ""
29
30S = "${WORKDIR}/util-linux-ng-${PV}"
31
32EXTRA_OECONF = "--disable-use-tty-group --disable-makeinstall-chown --enable-elvtune --enable-init --enable-kill --enable-last \
33 --enable-mesg --enable-partx --enable-raw --enable-rdev --enable-reset \
34 --disable-login-utils --enable-write --enable-arch --enable-mount --with-fsprobe=builtin --enable-libuuid --enable-libblkid --enable-fsck"
35
36FILES_${PN}-doc += "/usr/share/getopt/getopt-*.*"
37
38FILES_util-linux-fdisk = "/sbin/fdisk.${PN}"
39FILES_util-linux-cfdisk = "/sbin/cfdisk"
40FILES_util-linux-sfdisk = "/sbin/sfdisk"
41FILES_util-linux-swaponoff = "/sbin/swapon.${PN} /sbin/swapoff.${PN}"
42FILES_util-linux-losetup = "/sbin/losetup.${PN}"
43FILES_util-linux-mount = "/bin/mount.${PN}"
44FILES_util-linux-umount = "/bin/umount.${PN}"
45FILES_util-linux-readprofile = "/usr/sbin/readprofile"
46
47RRECOMMENDS_${PN} = "util-linux-fdisk util-linux-cfdisk util-linux-sfdisk util-linux-mount util-linux-readprofile "
48RDEPENDS_${PN} = "util-linux-umount util-linux-swaponoff util-linux-losetup"
49
50RRECOMMENDS_${PN}_virtclass-native = ""
51RDEPENDS_${PN}_virtclass-native = ""
52
53do_compile () {
54 set -e
55 install ${WORKDIR}/MCONFIG ${S}/MCONFIG
56 install ${WORKDIR}/make_include ${S}/make_include
57 install ${WORKDIR}/swapargs.h ${S}/mount/swapargs.h
58 install ${WORKDIR}/defines.h ${S}/defines.h
59 oe_runmake ARCH=${TARGET_ARCH} CPU= CPUOPT= \
60 'OPT=${CFLAGS}' 'CC=${CC}' 'LD=${LD}' \
61 'LDFLAGS=${LDFLAGS}'
62}
63
64checklink() {
65 local targ link value
66 targ="$1"
67 link="$2"
68 ext="$3"
69 if test -h "$link"
70 then
71 value="$(readlink "$link")"
72 if test "$value" = "$targ"
73 then
74 rm "$link"
75 ln -s "$targ"."${PN}" "$link$ext"
76 return 0
77 else
78 echo "$link: '$value' found '$targ' expected" >&2
79 return 1
80 fi
81 else
82 echo "$link: not a symbolic link" >&2
83 return 1
84 fi
85}
86
87do_install () {
88 # with ccache the timestamps on compiled files may
89 # end up earlier than on their inputs, this allows
90 # for the resultant compilation in the install step.
91 oe_runmake ARCH=${TARGET_ARCH} CPU= CPUOPT= \
92 'OPT=${CFLAGS}' 'CC=${CC}' 'LD=${LD}' \
93 'LDFLAGS=${LDFLAGS}' 'DESTDIR=${D}' install
94
95 mkdir -p ${D}${base_bindir}
96
97 sbinprogs="agetty blockdev ctrlaltdel cfdisk vipw vigr"
98 sbinprogs_a="pivot_root hwclock mkswap shutdown mkfs.minix fsck.minix losetup swapon fdisk readprofile fsck blkid sln"
99 usrbinprogs_a="chfn chsh hexdump last logger mesg newgrp renice wall setsid chrt"
100 binprogs_a="dmesg kill more umount mount login reset"
101
102 if [ "${base_sbindir}" != "${sbindir}" ]; then
103 mkdir -p ${D}${base_sbindir}
104 for p in $sbinprogs $sbinprogs_a; do
105 if [ -f "${D}${sbindir}/$p" ]; then
106 mv "${D}${sbindir}/$p" "${D}${base_sbindir}/$p"
107 fi
108 done
109 fi
110
111 if [ "${base_bindir}" != "${bindir}" ]; then
112 mkdir -p ${D}${base_bindir}
113 for p in $binprogs_a; do
114 if [ -f "${D}${bindir}/$p" ]; then
115 mv "${D}${bindir}/$p" "${D}${base_bindir}/$p"
116 fi
117 done
118 fi
119
120 for p in $usrbinprogs_a; do
121 if [ -f "${D}${bindir}/$p" ]; then
122 mv "${D}${bindir}/$p" "${D}${bindir}/$p.${PN}"
123 fi
124 done
125
126 for p in $binprogs_a; do
127 if [ -f "${D}${base_bindir}/$p" ]; then
128 mv "${D}${base_bindir}/$p" "${D}${base_bindir}/$p.${PN}"
129 fi
130 done
131
132 for p in $sbinprogs_a; do
133 if [ -f "${D}${base_sbindir}/$p" ]; then
134 mv "${D}${base_sbindir}/$p" "${D}${base_sbindir}/$p.${PN}"
135 fi
136 done
137
138 install -d ${D}${sysconfdir}/default/
139 echo 'MOUNTALL="-t nonfs,nosmbfs,noncpfs"' > ${D}${sysconfdir}/default/mountall
140
141 ln -sf ${sbindir}/swapon ${D}${sbindir}/swapoff.${PN}
142 ln -sf ${sbindir}/shutdown ${D}${sbindir}/reboot.${PN}
143 ln -sf ${sbindir}/shutdown ${D}${sbindir}/halt.${PN}
144 ln -sf ${sbindir}/shutdown ${D}${sbindir}/fastboot
145 ln -sf ${sbindir}/shutdown ${D}${sbindir}/fasthalt
146}
147
148pkg_postinst_${PN} () {
149 update-alternatives --install ${base_bindir}/dmesg dmesg dmesg.${PN} 100
150 update-alternatives --install ${base_bindir}/kill kill kill.${PN} 100
151 update-alternatives --install ${base_bindir}/more more more.${PN} 100
152 update-alternatives --install ${base_sbindir}/mkswap mkswap mkswap.${PN} 100
153 test -x ${base_sbindir}/pivot_root.${PN} && \
154 update-alternatives --install ${base_sbindir}/pivot_root pivot_root pivot_root.${PN} 100
155# update-alternatives --install ${base_sbindir}/sln sln sln.${PN} 100
156 update-alternatives --install ${base_sbindir}/mkfs.minix mkfs.minix mkfs.minix.${PN} 100
157 update-alternatives --install ${base_sbindir}/fsck.minix fsck.minix fsck.minix.${PN} 100
158 update-alternatives --install ${bindir}/hexdump hexdump hexdump.${PN} 100
159 update-alternatives --install ${bindir}/last last last.${PN} 100
160 update-alternatives --install ${bindir}/logger logger logger.${PN} 100
161 update-alternatives --install ${bindir}/mesg mesg mesg.${PN} 100
162 update-alternatives --install ${bindir}/renice renice renice.${PN} 100
163 update-alternatives --install ${bindir}/wall wall wall.${PN} 100
164
165 # There seems to be problem, atleast on nslu2, with these, untill they are
166 # fixed the busybox ones have higher priority
167 update-alternatives --install ${base_sbindir}/hwclock hwclock hwclock.${PN} 10
168 update-alternatives --install ${base_sbindir}/shutdown shutdown shutdown.${PN} 10
169 update-alternatives --install ${base_sbindir}/reboot reboot reboot.${PN} 10
170 update-alternatives --install ${base_sbindir}/halt halt halt.${PN} 10
171}
172
173pkg_prerm_${PN} () {
174 test -x ${base_sbindir}/pivot_root.${PN} && \
175 update-alternatives --remove pivot_root pivot_root.${PN}
176 update-alternatives --remove dmesg dmesg.${PN}
177 update-alternatives --remove kill kill.${PN}
178 update-alternatives --remove more more.${PN}
179 update-alternatives --remove halt halt.${PN}
180 update-alternatives --remove hwclock hwclock.${PN}
181 update-alternatives --remove mkswap mkswap.${PN}
182 update-alternatives --remove reboot reboot.${PN}
183 update-alternatives --remove shutdown shutdown.${PN}
184# update-alternatives --remove sln sln.${PN}
185 update-alternatives --remove mkfs.minix mkfs.minix.${PN}
186 update-alternatives --remove fsck.minix fsck.minix.${PN}
187 update-alternatives --remove hexdump hexdump.${PN}
188 update-alternatives --remove last last.${PN}
189 update-alternatives --remove logger logger.${PN}
190 update-alternatives --remove mesg mesg.${PN}
191 update-alternatives --remove renice renice.${PN}
192 update-alternatives --remove wall wall.${PN}
193}
194
195pkg_postinst_util-linux-fdisk () {
196 update-alternatives --install ${base_sbindir}/fdisk fdisk fdisk.${PN} 100
197}
198
199pkg_prerm_util-linux-fdisk () {
200 update-alternatives --remove fdisk fdisk.${PN}
201}
202
203pkg_postinst_util-linux-mount () {
204 update-alternatives --install ${base_bindir}/mount mount mount.${PN} 100
205}
206
207pkg_prerm_util-linux-mount () {
208 update-alternatives --remove mount mount.${PN}
209}
210
211pkg_postinst_util-linux-umount () {
212 update-alternatives --install ${base_bindir}/umount umount umount.${PN} 100
213}
214
215pkg_prerm_util-linux-umount () {
216 update-alternatives --remove umount umount.${PN}
217}
218
219pkg_postinst_util-linux-losetup () {
220 update-alternatives --install ${base_sbindir}/losetup losetup losetup.${PN} 100
221}
222
223pkg_prerm_util-linux-losetup () {
224 update-alternatives --remove losetup losetup.${PN}
225}
226
227pkg_postinst_util-linux-swaponoff () {
228 update-alternatives --install ${base_sbindir}/swapoff swapoff swapoff.${PN} 100
229 update-alternatives --install ${base_sbindir}/swapon swapon swapon.${PN} 100
230}
231
232pkg_prerm_util-linux-swaponoff () {
233 update-alternatives --remove swapoff swapoff.${PN}
234 update-alternatives --remove swapon swapon.${PN}
235}
236
237BBCLASSEXTEND = "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 0000000000..9efe64a6c6
--- /dev/null
+++ b/meta/recipes-core/util-linux/util-linux_2.17.2.bb
@@ -0,0 +1,11 @@
1MAJOR_VERSION = "2.17"
2require util-linux.inc
3PR="r0"
4
5SRC_URI += "file://uclibc-compile.patch \
6 file://util-linux-ng-replace-siginterrupt.patch"
7
8# fallocate is glibc 2.10, fallocate64 is glibc 2.11
9# we need to disable it for older versions
10EXTRA_OECONF += "ac_cv_func_fallocate=no"
11EXTRA_OECONF_virtclass-native += "--disable-fallocate --disable-use-tty-group"