diff options
author | Qing He <qing.he@intel.com> | 2010-12-30 16:54:28 +0800 |
---|---|---|
committer | Saul Wold <sgw@linux.intel.com> | 2011-01-02 01:25:40 -0800 |
commit | 5a859fcadc738b16132a4735f2a27a67473c3c9e (patch) | |
tree | 303a3c732e256387331cfc4e79d1ae867a74ca6a /meta/recipes-core | |
parent | f13cb20ed19c41b9ff85ef1c9ec0883a21d1d5bf (diff) | |
download | poky-5a859fcadc738b16132a4735f2a27a67473c3c9e.tar.gz |
ncurses: upgrade to version 5.7
from 5.4
Largely based on the recipe from OpenEmbedded project
ncurses: fix LIC_FILES_CHKSUM
Signed-off-by: Qing He <qing.he@intel.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Diffstat (limited to 'meta/recipes-core')
-rw-r--r-- | meta/recipes-core/ncurses/ncurses-5.7/config.cache | 4 | ||||
-rw-r--r-- | meta/recipes-core/ncurses/ncurses-5.7/tic-hang.patch | 25 | ||||
-rw-r--r-- | meta/recipes-core/ncurses/ncurses/makefile_tweak.patch | 89 | ||||
-rw-r--r-- | meta/recipes-core/ncurses/ncurses/visibility.patch | 4904 | ||||
-rw-r--r-- | meta/recipes-core/ncurses/ncurses_5.4.bb | 11 | ||||
-rw-r--r-- | meta/recipes-core/ncurses/ncurses_5.7.bb | 242 |
6 files changed, 271 insertions, 5004 deletions
diff --git a/meta/recipes-core/ncurses/ncurses-5.7/config.cache b/meta/recipes-core/ncurses/ncurses-5.7/config.cache new file mode 100644 index 0000000000..6a9217d5bb --- /dev/null +++ b/meta/recipes-core/ncurses/ncurses-5.7/config.cache | |||
@@ -0,0 +1,4 @@ | |||
1 | #! /bin/sh | ||
2 | |||
3 | cf_cv_func_nanosleep=yes | ||
4 | cf_cv_func_mkstemp=yes | ||
diff --git a/meta/recipes-core/ncurses/ncurses-5.7/tic-hang.patch b/meta/recipes-core/ncurses/ncurses-5.7/tic-hang.patch new file mode 100644 index 0000000000..1678b885c4 --- /dev/null +++ b/meta/recipes-core/ncurses/ncurses-5.7/tic-hang.patch | |||
@@ -0,0 +1,25 @@ | |||
1 | 'tic' of some linux distributions (e.g. fedora 11) hang in an infinite | ||
2 | loop when processing the original file. | ||
3 | |||
4 | Index: ncurses-5.7/misc/terminfo.src | ||
5 | =================================================================== | ||
6 | --- ncurses-5.7.orig/misc/terminfo.src | ||
7 | +++ ncurses-5.7/misc/terminfo.src | ||
8 | @@ -3706,12 +3706,11 @@ konsole-xf3x|KDE console window with key | ||
9 | # The value for kbs reflects local customization rather than the settings used | ||
10 | # for XFree86 xterm. | ||
11 | konsole-xf4x|KDE console window with keyboard for XFree86 4.x xterm, | ||
12 | - kend=\EOF, khome=\EOH, use=konsole+pcfkeys, | ||
13 | - use=konsole-vt100, | ||
14 | -# Konsole does not implement shifted cursor-keys. | ||
15 | -konsole+pcfkeys|konsole subset of xterm+pcfkeys, | ||
16 | - kLFT@, kRIT@, kcbt=\E[Z, kind@, kri@, kDN@, kUP@, use=xterm+pcc2, | ||
17 | - use=xterm+pcf0, | ||
18 | + kend=\EOF, kf1=\EOP, kf13=\EO2P, kf14=\EO2Q, kf15=\EO2R, | ||
19 | + kf16=\EO2S, kf17=\E[15;2~, kf18=\E[17;2~, kf19=\E[18;2~, | ||
20 | + kf2=\EOQ, kf20=\E[19;2~, kf21=\E[20;2~, kf22=\E[21;2~, | ||
21 | + kf23=\E[23;2~, kf24=\E[24;2~, kf3=\EOR, kf4=\EOS, | ||
22 | + khome=\EOH, use=konsole-vt100, | ||
23 | # KDE's "vt100" keyboard has no relationship to any terminal that DEC made, but | ||
24 | # it is still useful for deriving the other entries. | ||
25 | konsole-vt100|KDE console window with vt100 (sic) keyboard, | ||
diff --git a/meta/recipes-core/ncurses/ncurses/makefile_tweak.patch b/meta/recipes-core/ncurses/ncurses/makefile_tweak.patch deleted file mode 100644 index 480855bcc6..0000000000 --- a/meta/recipes-core/ncurses/ncurses/makefile_tweak.patch +++ /dev/null | |||
@@ -1,89 +0,0 @@ | |||
1 | Libtool 2.2.2 needs to be able to use top_builddir. Automake usually exports | ||
2 | this but ncurses doesn't use automake. | ||
3 | |||
4 | RP 14/4/08 | ||
5 | |||
6 | Index: 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@ | ||
18 | Index: 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@ | ||
30 | Index: 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@ | ||
42 | Index: 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@ | ||
54 | Index: 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@ | ||
66 | Index: 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@ | ||
78 | Index: 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 deleted file mode 100644 index 29cac5f1b8..0000000000 --- a/meta/recipes-core/ncurses/ncurses/visibility.patch +++ /dev/null | |||
@@ -1,4904 +0,0 @@ | |||
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 deleted file mode 100644 index 60e07fd859..0000000000 --- a/meta/recipes-core/ncurses/ncurses_5.4.bb +++ /dev/null | |||
@@ -1,11 +0,0 @@ | |||
1 | PR = "r14" | ||
2 | |||
3 | SRC_URI = "${GNU_MIRROR}/ncurses/ncurses-${PV}.tar.gz \ | ||
4 | file://makefile_tweak.patch;patch=1 \ | ||
5 | file://visibility.patch;patch=1" | ||
6 | |||
7 | SRC_URI[md5sum] = "069c8880072060373290a4fefff43520" | ||
8 | SRC_URI[sha256sum] = "5abce063cf431790f4e6a801a96c7eea0b33a41ecd0970f6312f52575c083b36" | ||
9 | S = "${WORKDIR}/ncurses-${PV}" | ||
10 | |||
11 | require ncurses.inc | ||
diff --git a/meta/recipes-core/ncurses/ncurses_5.7.bb b/meta/recipes-core/ncurses/ncurses_5.7.bb new file mode 100644 index 0000000000..33cc16105b --- /dev/null +++ b/meta/recipes-core/ncurses/ncurses_5.7.bb | |||
@@ -0,0 +1,242 @@ | |||
1 | DESCRIPTION = "Ncurses library" | ||
2 | HOMEPAGE = "http://www.gnu.org/software/ncurses/ncurses.html" | ||
3 | LICENSE = "MIT" | ||
4 | LIC_FILES_CHKSUM = "file://ncurses/base/version.c;beginline=1;endline=27;md5=cbc180a8c44ca642e97c35452fab5f66" | ||
5 | SECTION = "libs" | ||
6 | PATCHDATE = "20100501" | ||
7 | PKGV = "${PV}+${PATCHDATE}" | ||
8 | PR = "r0" | ||
9 | |||
10 | DEPENDS = "ncurses-native unifdef-native" | ||
11 | DEPENDS_virtclass-native = "unifdef-native" | ||
12 | |||
13 | inherit autotools binconfig | ||
14 | |||
15 | SRC_URI = "${GNU_MIRROR}/ncurses/ncurses-${PV}.tar.gz;name=tarball \ | ||
16 | ftp://invisible-island.net/ncurses/5.7/ncurses-5.7-20100424-patch.sh.bz2;apply=yes;name=p20100424sh \ | ||
17 | \ | ||
18 | ftp://invisible-island.net/ncurses/5.7/ncurses-5.7-${PATCHDATE}.patch.gz;name=p20100501 \ | ||
19 | file://tic-hang.patch \ | ||
20 | file://config.cache \ | ||
21 | " | ||
22 | |||
23 | SRC_URI[tarball.md5sum] = "cce05daf61a64501ef6cd8da1f727ec6" | ||
24 | SRC_URI[tarball.sha256sum] = "0a9bdea5c7de8ded5c9327ed642915f2cc380753f12d4ad120ef7da3ea3498f4" | ||
25 | SRC_URI[p20100424sh.md5sum] = "3a5f76613f0f7ec3e0e73b835bc24864" | ||
26 | SRC_URI[p20100424sh.sha256sum] = "1e9d70d2d1fe1fea471868832c52f1b9cc6065132102e49e2a3755f2f4f5be53" | ||
27 | SRC_URI[p20100501.md5sum] = "6518cfa5d45e9069a1e042468161448b" | ||
28 | SRC_URI[p20100501.sha256sum] = "a97ccc30e4bd6fbb89564f3058db0fe84bd35cfefee831556c500793b477abde" | ||
29 | |||
30 | PARALLEL_MAKE = "" | ||
31 | EXTRA_AUTORECONF = "-I m4" | ||
32 | CONFIG_SITE =+ "${WORKDIR}/config.cache" | ||
33 | |||
34 | # Whether to enable separate widec libraries; must be 'true' or 'false' | ||
35 | # | ||
36 | # TODO: remove this variable when widec is supported in every setup? | ||
37 | ENABLE_WIDEC = "true" | ||
38 | |||
39 | # _GNU_SOURCE is required for widec stuff and is detected automatically | ||
40 | # for target objects. But it must be set manually for native and sdk | ||
41 | # builds. | ||
42 | BUILD_CPPFLAGS += "-D_GNU_SOURCE" | ||
43 | |||
44 | # Override the function from the autotools class; ncurses requires a | ||
45 | # patched autoconf213 to generate the configure script. This autoconf | ||
46 | # is not available so that the shipped script will be used. | ||
47 | do_configure() { | ||
48 | # check does not work with cross-compiling and is generally | ||
49 | # broken because it requires stdin to be pollable (which is | ||
50 | # not the case for /dev/null redirections) | ||
51 | export cf_cv_working_poll=yes | ||
52 | |||
53 | for i in \ | ||
54 | 'narrowc' \ | ||
55 | 'widec --enable-widec --without-progs'; do | ||
56 | set -- $i | ||
57 | mkdir -p $1 | ||
58 | cd $1 | ||
59 | shift | ||
60 | |||
61 | oe_runconf \ | ||
62 | --disable-static \ | ||
63 | --without-debug \ | ||
64 | --without-ada \ | ||
65 | --without-gpm \ | ||
66 | --enable-hard-tabs \ | ||
67 | --enable-xmc-glitch \ | ||
68 | --enable-colorfgbg \ | ||
69 | --with-termpath='${sysconfdir}/termcap:${datadir}/misc/termcap' \ | ||
70 | --with-terminfo-dirs='${sysconfdir}/terminfo:${datadir}/terminfo' \ | ||
71 | --with-shared \ | ||
72 | --disable-big-core \ | ||
73 | --program-prefix= \ | ||
74 | --with-ticlib \ | ||
75 | --with-termlib=tinfo \ | ||
76 | --enable-sigwinch \ | ||
77 | --enable-pc-files \ | ||
78 | --disable-rpath-hack \ | ||
79 | "$@" | ||
80 | cd .. | ||
81 | done | ||
82 | } | ||
83 | |||
84 | do_compile() { | ||
85 | oe_runmake -C narrowc libs | ||
86 | oe_runmake -C narrowc/progs | ||
87 | |||
88 | ! ${ENABLE_WIDEC} || \ | ||
89 | oe_runmake -C widec libs | ||
90 | } | ||
91 | |||
92 | # set of expected differences between narrowc and widec header | ||
93 | # | ||
94 | # TODO: the NCURSES_CH_T difference can cause real problems :( | ||
95 | _unifdef_cleanup = " \ | ||
96 | -e '\!/\* \$Id: curses.wide,v!,\!/\* \$Id: curses.tail,v!d' \ | ||
97 | -e '/^#define NCURSES_CH_T /d' \ | ||
98 | -e '/^#include <wchar.h>/d' \ | ||
99 | -e '\!^/\* .* \*/!d' \ | ||
100 | " | ||
101 | |||
102 | do_test[dirs] = "${S}" | ||
103 | do_test() { | ||
104 | ${ENABLE_WIDEC} || return 0 | ||
105 | |||
106 | # make sure that the narrow and widec header are compatible | ||
107 | # and differ only in minor details. | ||
108 | unifdef -k narrowc/include/curses.h | \ | ||
109 | sed ${_unifdef_cleanup} > curses-narrowc.h | ||
110 | unifdef -k widec/include/curses.h | \ | ||
111 | sed ${_unifdef_cleanup} > curses-widec.h | ||
112 | |||
113 | diff curses-narrowc.h curses-widec.h | ||
114 | } | ||
115 | |||
116 | _install_opts = "\ | ||
117 | DESTDIR='${D}' \ | ||
118 | PKG_CONFIG_LIBDIR='${libdir}/pkgconfig' \ | ||
119 | install.libs install.includes install.man \ | ||
120 | " | ||
121 | |||
122 | do_install() { | ||
123 | # Order of installation is important; widec installs a 'curses.h' | ||
124 | # header with more definitions and must be installed last hence. | ||
125 | # Compatibility of these headers will be checked in 'do_test()'. | ||
126 | oe_runmake -C narrowc ${_install_opts} \ | ||
127 | install.data install.progs | ||
128 | |||
129 | ! ${ENABLE_WIDEC} || \ | ||
130 | oe_runmake -C widec ${_install_opts} | ||
131 | |||
132 | |||
133 | cd narrowc | ||
134 | |||
135 | # include some basic terminfo files | ||
136 | # stolen ;) from gentoo and modified a bit | ||
137 | for x in ansi console dumb linux rxvt screen sun vt{52,100,102,200,220} xterm-color xterm-xfree86 | ||
138 | do | ||
139 | local termfile="$(find "${D}${datadir}/terminfo/" -name "${x}" 2>/dev/null)" | ||
140 | local basedir="$(basename $(dirname "${termfile}"))" | ||
141 | |||
142 | if [ -n "${termfile}" ] | ||
143 | then | ||
144 | install -d ${D}${sysconfdir}/terminfo/${basedir} | ||
145 | mv ${termfile} ${D}${sysconfdir}/terminfo/${basedir}/ | ||
146 | ln -s /etc/terminfo/${basedir}/${x} \ | ||
147 | ${D}${datadir}/terminfo/${basedir}/${x} | ||
148 | fi | ||
149 | done | ||
150 | # i think we can use xterm-color as default xterm | ||
151 | if [ -e ${D}${sysconfdir}/terminfo/x/xterm-color ] | ||
152 | then | ||
153 | ln -sf xterm-color ${D}${sysconfdir}/terminfo/x/xterm | ||
154 | fi | ||
155 | |||
156 | if [ "${PN}" = "ncurses" ]; then | ||
157 | mv ${D}${bindir}/clear ${D}${bindir}/clear.${PN} | ||
158 | mv ${D}${bindir}/reset ${D}${bindir}/reset.${PN} | ||
159 | fi | ||
160 | |||
161 | |||
162 | # create linker scripts for libcurses.so and libncurses to | ||
163 | # link against -ltinfo when needed. Some builds might break | ||
164 | # else when '-Wl,--no-copy-dt-needed-entries' has been set in | ||
165 | # linker flags. | ||
166 | for i in libncurses libncursesw; do | ||
167 | f=${D}${libdir}/$i.so | ||
168 | test -h $f || continue | ||
169 | rm -f $f | ||
170 | echo '/* GNU ld script */' >$f | ||
171 | echo "INPUT($i.so.5 AS_NEEDED(-ltinfo))" >>$f | ||
172 | done | ||
173 | |||
174 | # create libtermcap.so linker script for backward compatibility | ||
175 | f=${D}${libdir}/libtermcap.so | ||
176 | echo '/* GNU ld script */' >$f | ||
177 | echo 'INPUT(AS_NEEDED(-ltinfo))' >>$f | ||
178 | } | ||
179 | |||
180 | python populate_packages_prepend () { | ||
181 | libdir = bb.data.expand("${libdir}", d) | ||
182 | pnbase = bb.data.expand("${PN}-lib%s", d) | ||
183 | do_split_packages(d, libdir, '^lib(.*)\.so\..*', pnbase, 'ncurses %s library', prepend=True, extra_depends = '', allow_links=True) | ||
184 | } | ||
185 | |||
186 | |||
187 | pkg_postinst_ncurses-tools () { | ||
188 | if [ "${PN}" = "ncurses" ]; then | ||
189 | update-alternatives --install ${bindir}/clear clear clear.${PN} 100 | ||
190 | update-alternatives --install ${bindir}/reset reset reset.${PN} 100 | ||
191 | fi | ||
192 | } | ||
193 | |||
194 | pkg_prerm_ncurses-tools () { | ||
195 | if [ "${PN}" = "ncurses" ]; then | ||
196 | update-alternatives --remove clear clear.${PN} | ||
197 | update-alternatives --remove reset reset.${PN} | ||
198 | fi | ||
199 | } | ||
200 | |||
201 | BBCLASSEXTEND = "native nativesdk" | ||
202 | |||
203 | PACKAGES += " \ | ||
204 | ${PN}-tools \ | ||
205 | ${PN}-terminfo \ | ||
206 | ${PN}-terminfo-base \ | ||
207 | " | ||
208 | |||
209 | FILES_${PN} = "\ | ||
210 | ${bindir}/tput \ | ||
211 | ${bindir}/tset \ | ||
212 | ${bindir}/ncurses5-config \ | ||
213 | ${bindir}/ncursesw5-config \ | ||
214 | ${datadir}/tabset \ | ||
215 | " | ||
216 | |||
217 | # This keeps only tput/tset in ncurses | ||
218 | # clear/reset are in already busybox | ||
219 | FILES_${PN}-tools = "\ | ||
220 | ${bindir}/tic \ | ||
221 | ${bindir}/toe \ | ||
222 | ${bindir}/infotocap \ | ||
223 | ${bindir}/captoinfo \ | ||
224 | ${bindir}/infocmp \ | ||
225 | ${bindir}/clear.${PN} \ | ||
226 | ${bindir}/reset.${PN} \ | ||
227 | ${bindir}/tack \ | ||
228 | ${bindir}/tabs \ | ||
229 | " | ||
230 | # 'reset' is a symlink to 'tset' which is in the 'ncurses' package | ||
231 | RDEPENDS_${PN}-tools = "${PN}" | ||
232 | |||
233 | FILES_${PN}-terminfo = "\ | ||
234 | ${datadir}/terminfo \ | ||
235 | " | ||
236 | |||
237 | FILES_${PN}-terminfo-base = "\ | ||
238 | ${sysconfdir}/terminfo \ | ||
239 | " | ||
240 | |||
241 | RSUGGESTS_${PN}-libtinfo = "${PN}-terminfo" | ||
242 | RRECOMMENDS_${PN}-libtinfo = "${PN}-terminfo-base" | ||