Commit | Line | Data |
---|---|---|
252b5132 RH |
1 | dnl aclocal.m4 generated automatically by aclocal 1.4 |
2 | ||
3 | dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. | |
4 | dnl This file is free software; the Free Software Foundation | |
5 | dnl gives unlimited permission to copy and/or distribute it, | |
6 | dnl with or without modifications, as long as this notice is preserved. | |
7 | ||
8 | dnl This program is distributed in the hope that it will be useful, | |
9 | dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without | |
10 | dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A | |
11 | dnl PARTICULAR PURPOSE. | |
12 | ||
13 | dnl GAS_CHECK_DECL_NEEDED(name, typedefname, typedef, headers) | |
14 | AC_DEFUN(GAS_CHECK_DECL_NEEDED,[ | |
15 | AC_MSG_CHECKING(whether declaration is required for $1) | |
16 | AC_CACHE_VAL(gas_cv_decl_needed_$1, | |
17 | AC_TRY_LINK([$4], | |
18 | [ | |
19 | typedef $3; | |
20 | $2 x; | |
21 | x = ($2) $1; | |
22 | ], gas_cv_decl_needed_$1=no, gas_cv_decl_needed_$1=yes))dnl | |
23 | AC_MSG_RESULT($gas_cv_decl_needed_$1) | |
24 | if test $gas_cv_decl_needed_$1 = yes; then | |
25 | AC_DEFINE([NEED_DECLARATION_]translit($1, [a-z], [A-Z]), 1, | |
26 | [Define if $1 is not declared in system header files.]) | |
27 | fi | |
28 | ])dnl | |
29 | dnl | |
30 | dnl Some non-ANSI preprocessors botch requoting inside strings. That's bad | |
31 | dnl enough, but on some of those systems, the assert macro relies on requoting | |
32 | dnl working properly! | |
33 | dnl GAS_WORKING_ASSERT | |
34 | AC_DEFUN(GAS_WORKING_ASSERT, | |
35 | [AC_MSG_CHECKING([for working assert macro]) | |
36 | AC_CACHE_VAL(gas_cv_assert_ok, | |
37 | AC_TRY_LINK([#include <assert.h> | |
38 | #include <stdio.h>], [ | |
39 | /* check for requoting problems */ | |
40 | static int a, b, c, d; | |
41 | static char *s; | |
42 | assert (!strcmp(s, "foo bar baz quux")); | |
43 | /* check for newline handling */ | |
44 | assert (a == b | |
45 | || c == d); | |
46 | ], gas_cv_assert_ok=yes, gas_cv_assert_ok=no))dnl | |
47 | AC_MSG_RESULT($gas_cv_assert_ok) | |
48 | test $gas_cv_assert_ok = yes || AC_DEFINE(BROKEN_ASSERT, 1, [assert broken?]) | |
49 | ])dnl | |
50 | dnl | |
51 | dnl Since many Bourne shell implementations lack subroutines, use this | |
52 | dnl hack to simplify the code in configure.in. | |
53 | dnl GAS_UNIQ(listvar) | |
54 | AC_DEFUN(GAS_UNIQ, | |
55 | [_gas_uniq_list="[$]$1" | |
56 | _gas_uniq_newlist="" | |
57 | dnl Protect against empty input list. | |
58 | for _gas_uniq_i in _gas_uniq_dummy [$]_gas_uniq_list ; do | |
59 | case [$]_gas_uniq_i in | |
60 | _gas_uniq_dummy) ;; | |
61 | *) case " [$]_gas_uniq_newlist " in | |
62 | *" [$]_gas_uniq_i "*) ;; | |
63 | *) _gas_uniq_newlist="[$]_gas_uniq_newlist [$]_gas_uniq_i" ;; | |
64 | esac ;; | |
65 | esac | |
66 | done | |
67 | $1=[$]_gas_uniq_newlist | |
68 | ])dnl | |
69 | ||
70 | # Do all the work for Automake. This macro actually does too much -- | |
71 | # some checks are only needed if your package does certain things. | |
72 | # But this isn't really a big deal. | |
73 | ||
74 | # serial 1 | |
75 | ||
76 | dnl Usage: | |
77 | dnl AM_INIT_AUTOMAKE(package,version, [no-define]) | |
78 | ||
79 | AC_DEFUN(AM_INIT_AUTOMAKE, | |
80 | [AC_REQUIRE([AC_PROG_INSTALL]) | |
81 | PACKAGE=[$1] | |
82 | AC_SUBST(PACKAGE) | |
83 | VERSION=[$2] | |
84 | AC_SUBST(VERSION) | |
85 | dnl test to see if srcdir already configured | |
86 | if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then | |
87 | AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) | |
88 | fi | |
89 | ifelse([$3],, | |
90 | AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) | |
91 | AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])) | |
92 | AC_REQUIRE([AM_SANITY_CHECK]) | |
93 | AC_REQUIRE([AC_ARG_PROGRAM]) | |
94 | dnl FIXME This is truly gross. | |
95 | missing_dir=`cd $ac_aux_dir && pwd` | |
96 | AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir) | |
97 | AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir) | |
98 | AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir) | |
99 | AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir) | |
100 | AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir) | |
101 | AC_REQUIRE([AC_PROG_MAKE_SET])]) | |
102 | ||
103 | # | |
104 | # Check to make sure that the build environment is sane. | |
105 | # | |
106 | ||
107 | AC_DEFUN(AM_SANITY_CHECK, | |
108 | [AC_MSG_CHECKING([whether build environment is sane]) | |
109 | # Just in case | |
110 | sleep 1 | |
111 | echo timestamp > conftestfile | |
112 | # Do `set' in a subshell so we don't clobber the current shell's | |
113 | # arguments. Must try -L first in case configure is actually a | |
114 | # symlink; some systems play weird games with the mod time of symlinks | |
115 | # (eg FreeBSD returns the mod time of the symlink's containing | |
116 | # directory). | |
117 | if ( | |
118 | set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` | |
119 | if test "[$]*" = "X"; then | |
120 | # -L didn't work. | |
121 | set X `ls -t $srcdir/configure conftestfile` | |
122 | fi | |
123 | if test "[$]*" != "X $srcdir/configure conftestfile" \ | |
124 | && test "[$]*" != "X conftestfile $srcdir/configure"; then | |
125 | ||
126 | # If neither matched, then we have a broken ls. This can happen | |
127 | # if, for instance, CONFIG_SHELL is bash and it inherits a | |
128 | # broken ls alias from the environment. This has actually | |
129 | # happened. Such a system could not be considered "sane". | |
130 | AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken | |
131 | alias in your environment]) | |
132 | fi | |
133 | ||
134 | test "[$]2" = conftestfile | |
135 | ) | |
136 | then | |
137 | # Ok. | |
138 | : | |
139 | else | |
140 | AC_MSG_ERROR([newly created file is older than distributed files! | |
141 | Check your system clock]) | |
142 | fi | |
143 | rm -f conftest* | |
144 | AC_MSG_RESULT(yes)]) | |
145 | ||
146 | dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY) | |
147 | dnl The program must properly implement --version. | |
148 | AC_DEFUN(AM_MISSING_PROG, | |
149 | [AC_MSG_CHECKING(for working $2) | |
150 | # Run test in a subshell; some versions of sh will print an error if | |
151 | # an executable is not found, even if stderr is redirected. | |
152 | # Redirect stdin to placate older versions of autoconf. Sigh. | |
153 | if ($2 --version) < /dev/null > /dev/null 2>&1; then | |
154 | $1=$2 | |
155 | AC_MSG_RESULT(found) | |
156 | else | |
157 | $1="$3/missing $2" | |
158 | AC_MSG_RESULT(missing) | |
159 | fi | |
160 | AC_SUBST($1)]) | |
161 | ||
162 | ||
bedf545c ILT |
163 | # serial 35 AC_PROG_LIBTOOL |
164 | AC_DEFUN(AC_PROG_LIBTOOL, | |
165 | [AC_REQUIRE([AC_LIBTOOL_SETUP])dnl | |
166 | ||
167 | # Save cache, so that ltconfig can load it | |
168 | AC_CACHE_SAVE | |
169 | ||
170 | # Actually configure libtool. ac_aux_dir is where install-sh is found. | |
171 | CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \ | |
172 | LD="$LD" NM="$NM" RANLIB="$RANLIB" LN_S="$LN_S" \ | |
173 | DLLTOOL="$DLLTOOL" AS="$AS" \ | |
174 | ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \ | |
175 | $libtool_flags --no-verify $ac_aux_dir/ltmain.sh $host \ | |
176 | || AC_MSG_ERROR([libtool configure failed]) | |
177 | ||
178 | # Reload cache, that may have been modified by ltconfig | |
179 | AC_CACHE_LOAD | |
180 | ||
181 | # This can be used to rebuild libtool when needed | |
182 | LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh" | |
183 | ||
184 | # Always use our own libtool. | |
185 | LIBTOOL='$(SHELL) $(top_builddir)/libtool' | |
186 | AC_SUBST(LIBTOOL)dnl | |
187 | ||
188 | # Redirect the config.log output again, so that the ltconfig log is not | |
189 | # clobbered by the next message. | |
190 | exec 5>>./config.log | |
191 | ]) | |
192 | ||
193 | AC_DEFUN(AC_LIBTOOL_SETUP, | |
194 | [AC_PREREQ(2.13)dnl | |
195 | AC_REQUIRE([AC_ENABLE_SHARED])dnl | |
196 | AC_REQUIRE([AC_ENABLE_STATIC])dnl | |
197 | AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl | |
252b5132 RH |
198 | AC_REQUIRE([AC_CANONICAL_HOST])dnl |
199 | AC_REQUIRE([AC_CANONICAL_BUILD])dnl | |
200 | AC_REQUIRE([AC_PROG_RANLIB])dnl | |
201 | AC_REQUIRE([AC_PROG_CC])dnl | |
bedf545c ILT |
202 | AC_REQUIRE([AC_PROG_LD])dnl |
203 | AC_REQUIRE([AC_PROG_NM])dnl | |
204 | AC_REQUIRE([AC_SYS_NM_PARSE])dnl | |
205 | AC_REQUIRE([AC_SYS_SYMBOL_UNDERSCORE])dnl | |
252b5132 RH |
206 | AC_REQUIRE([AC_PROG_LN_S])dnl |
207 | dnl | |
252b5132 RH |
208 | |
209 | # Check for any special flags to pass to ltconfig. | |
bedf545c | 210 | libtool_flags="--cache-file=$cache_file" |
252b5132 RH |
211 | test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared" |
212 | test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static" | |
bedf545c ILT |
213 | test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install" |
214 | test "$lt_dlopen" = yes && libtool_flags="$libtool_flags --enable-dlopen" | |
252b5132 RH |
215 | test "$silent" = yes && libtool_flags="$libtool_flags --silent" |
216 | test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc" | |
217 | test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld" | |
218 | ||
219 | # Some flags need to be propagated to the compiler or linker for good | |
220 | # libtool support. | |
221 | case "$host" in | |
222 | *-*-irix6*) | |
223 | # Find out which ABI we are using. | |
224 | echo '[#]line __oline__ "configure"' > conftest.$ac_ext | |
225 | if AC_TRY_EVAL(ac_compile); then | |
226 | case "`/usr/bin/file conftest.o`" in | |
227 | *32-bit*) | |
228 | LD="${LD-ld} -32" | |
229 | ;; | |
230 | *N32*) | |
231 | LD="${LD-ld} -n32" | |
232 | ;; | |
233 | *64-bit*) | |
234 | LD="${LD-ld} -64" | |
235 | ;; | |
236 | esac | |
237 | fi | |
238 | rm -rf conftest* | |
239 | ;; | |
240 | ||
241 | *-*-sco3.2v5*) | |
242 | # On SCO OpenServer 5, we need -belf to get full-featured binaries. | |
bedf545c | 243 | SAVE_CFLAGS="$CFLAGS" |
252b5132 | 244 | CFLAGS="$CFLAGS -belf" |
bedf545c ILT |
245 | AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, |
246 | [AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])]) | |
247 | if test x"$lt_cv_cc_needs_belf" != x"yes"; then | |
248 | # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf | |
249 | CFLAGS="$SAVE_CFLAGS" | |
250 | fi | |
252b5132 RH |
251 | ;; |
252 | ||
253 | *-*-cygwin*) | |
bedf545c | 254 | AC_SYS_LIBTOOL_CYGWIN |
252b5132 RH |
255 | ;; |
256 | ||
257 | esac | |
258 | ||
bedf545c | 259 | # enable the --disable-libtool-lock switch |
252b5132 | 260 | |
bedf545c ILT |
261 | AC_ARG_ENABLE(libtool-lock, |
262 | [ --disable-libtool-lock force libtool not to do file locking], | |
263 | need_locks=$enableval, | |
264 | need_locks=yes) | |
265 | ||
266 | if test x"$need_locks" = xno; then | |
267 | libtool_flags="$libtool_flags --disable-lock" | |
268 | fi | |
252b5132 RH |
269 | ]) |
270 | ||
bedf545c ILT |
271 | # AC_LIBTOOL_DLOPEN - check for dlopen support |
272 | AC_DEFUN(AC_LIBTOOL_DLOPEN, [lt_dlopen=yes]) | |
273 | ||
274 | # AC_ENABLE_SHARED - implement the --enable-shared flag | |
275 | # Usage: AC_ENABLE_SHARED[(DEFAULT)] | |
252b5132 RH |
276 | # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to |
277 | # `yes'. | |
bedf545c ILT |
278 | AC_DEFUN(AC_ENABLE_SHARED, |
279 | [define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl | |
252b5132 RH |
280 | AC_ARG_ENABLE(shared, |
281 | changequote(<<, >>)dnl | |
bedf545c | 282 | << --enable-shared[=PKGS] build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT], |
252b5132 RH |
283 | changequote([, ])dnl |
284 | [p=${PACKAGE-default} | |
285 | case "$enableval" in | |
286 | yes) enable_shared=yes ;; | |
287 | no) enable_shared=no ;; | |
288 | *) | |
289 | enable_shared=no | |
290 | # Look at the argument we got. We use all the common list separators. | |
291 | IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:," | |
292 | for pkg in $enableval; do | |
293 | if test "X$pkg" = "X$p"; then | |
294 | enable_shared=yes | |
295 | fi | |
296 | done | |
297 | IFS="$ac_save_ifs" | |
298 | ;; | |
299 | esac], | |
bedf545c | 300 | enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl |
252b5132 RH |
301 | ]) |
302 | ||
bedf545c ILT |
303 | # AC_DISABLE_SHARED - set the default shared flag to --disable-shared |
304 | AC_DEFUN(AC_DISABLE_SHARED, | |
305 | [AC_ENABLE_SHARED(no)]) | |
252b5132 | 306 | |
bedf545c ILT |
307 | # AC_ENABLE_STATIC - implement the --enable-static flag |
308 | # Usage: AC_ENABLE_STATIC[(DEFAULT)] | |
252b5132 RH |
309 | # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to |
310 | # `yes'. | |
bedf545c ILT |
311 | AC_DEFUN(AC_ENABLE_STATIC, |
312 | [define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl | |
252b5132 RH |
313 | AC_ARG_ENABLE(static, |
314 | changequote(<<, >>)dnl | |
bedf545c | 315 | << --enable-static[=PKGS] build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT], |
252b5132 RH |
316 | changequote([, ])dnl |
317 | [p=${PACKAGE-default} | |
318 | case "$enableval" in | |
319 | yes) enable_static=yes ;; | |
320 | no) enable_static=no ;; | |
321 | *) | |
322 | enable_static=no | |
323 | # Look at the argument we got. We use all the common list separators. | |
324 | IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:," | |
325 | for pkg in $enableval; do | |
326 | if test "X$pkg" = "X$p"; then | |
327 | enable_static=yes | |
328 | fi | |
329 | done | |
330 | IFS="$ac_save_ifs" | |
331 | ;; | |
332 | esac], | |
bedf545c ILT |
333 | enable_static=AC_ENABLE_STATIC_DEFAULT)dnl |
334 | ]) | |
335 | ||
336 | # AC_DISABLE_STATIC - set the default static flag to --disable-static | |
337 | AC_DEFUN(AC_DISABLE_STATIC, | |
338 | [AC_ENABLE_STATIC(no)]) | |
339 | ||
340 | ||
341 | # AC_ENABLE_FAST_INSTALL - implement the --enable-fast-install flag | |
342 | # Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)] | |
343 | # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to | |
344 | # `yes'. | |
345 | AC_DEFUN(AC_ENABLE_FAST_INSTALL, | |
346 | [define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl | |
347 | AC_ARG_ENABLE(fast-install, | |
348 | changequote(<<, >>)dnl | |
349 | << --enable-fast-install[=PKGS] optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT], | |
350 | changequote([, ])dnl | |
351 | [p=${PACKAGE-default} | |
352 | case "$enableval" in | |
353 | yes) enable_fast_install=yes ;; | |
354 | no) enable_fast_install=no ;; | |
355 | *) | |
356 | enable_fast_install=no | |
357 | # Look at the argument we got. We use all the common list separators. | |
358 | IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:," | |
359 | for pkg in $enableval; do | |
360 | if test "X$pkg" = "X$p"; then | |
361 | enable_fast_install=yes | |
362 | fi | |
363 | done | |
364 | IFS="$ac_save_ifs" | |
365 | ;; | |
366 | esac], | |
367 | enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl | |
252b5132 RH |
368 | ]) |
369 | ||
bedf545c ILT |
370 | # AC_ENABLE_FAST_INSTALL - set the default to --disable-fast-install |
371 | AC_DEFUN(AC_DISABLE_FAST_INSTALL, | |
372 | [AC_ENABLE_FAST_INSTALL(no)]) | |
373 | ||
252b5132 | 374 | |
bedf545c ILT |
375 | # AC_PROG_LD - find the path to the GNU or non-GNU linker |
376 | AC_DEFUN(AC_PROG_LD, | |
252b5132 RH |
377 | [AC_ARG_WITH(gnu-ld, |
378 | [ --with-gnu-ld assume the C compiler uses GNU ld [default=no]], | |
379 | test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no) | |
bedf545c ILT |
380 | AC_REQUIRE([AC_PROG_CC])dnl |
381 | AC_REQUIRE([AC_CANONICAL_HOST])dnl | |
382 | AC_REQUIRE([AC_CANONICAL_BUILD])dnl | |
252b5132 RH |
383 | ac_prog=ld |
384 | if test "$ac_cv_prog_gcc" = yes; then | |
385 | # Check if gcc -print-prog-name=ld gives a path. | |
386 | AC_MSG_CHECKING([for ld used by GCC]) | |
387 | ac_prog=`($CC -print-prog-name=ld) 2>&5` | |
388 | case "$ac_prog" in | |
bedf545c | 389 | # Accept absolute paths. |
252b5132 | 390 | changequote(,)dnl |
bedf545c ILT |
391 | /* | [A-Za-z]:[\\/]*) |
392 | re_direlt='/[^/][^/]*/\.\./' | |
252b5132 | 393 | changequote([,])dnl |
bedf545c ILT |
394 | # Canonicalize the path of ld |
395 | ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'` | |
396 | while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do | |
397 | ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` | |
398 | done | |
399 | test -z "$LD" && LD="$ac_prog" | |
400 | ;; | |
252b5132 RH |
401 | "") |
402 | # If it fails, then pretend we aren't using GCC. | |
403 | ac_prog=ld | |
404 | ;; | |
405 | *) | |
406 | # If it is relative, then search for the first ld in PATH. | |
407 | with_gnu_ld=unknown | |
408 | ;; | |
409 | esac | |
410 | elif test "$with_gnu_ld" = yes; then | |
411 | AC_MSG_CHECKING([for GNU ld]) | |
412 | else | |
413 | AC_MSG_CHECKING([for non-GNU ld]) | |
414 | fi | |
415 | AC_CACHE_VAL(ac_cv_path_LD, | |
416 | [if test -z "$LD"; then | |
417 | IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" | |
418 | for ac_dir in $PATH; do | |
419 | test -z "$ac_dir" && ac_dir=. | |
420 | if test -f "$ac_dir/$ac_prog"; then | |
421 | ac_cv_path_LD="$ac_dir/$ac_prog" | |
422 | # Check to see if the program is GNU ld. I'd rather use --version, | |
423 | # but apparently some GNU ld's only accept -v. | |
424 | # Break only if it was the GNU/non-GNU ld that we prefer. | |
425 | if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then | |
426 | test "$with_gnu_ld" != no && break | |
427 | else | |
bedf545c | 428 | test "$with_gnu_ld" != yes && break |
252b5132 RH |
429 | fi |
430 | fi | |
431 | done | |
432 | IFS="$ac_save_ifs" | |
433 | else | |
434 | ac_cv_path_LD="$LD" # Let the user override the test with a path. | |
435 | fi]) | |
436 | LD="$ac_cv_path_LD" | |
437 | if test -n "$LD"; then | |
438 | AC_MSG_RESULT($LD) | |
439 | else | |
440 | AC_MSG_RESULT(no) | |
441 | fi | |
442 | test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH]) | |
443 | AC_SUBST(LD) | |
bedf545c | 444 | AC_PROG_LD_GNU |
252b5132 RH |
445 | ]) |
446 | ||
bedf545c | 447 | AC_DEFUN(AC_PROG_LD_GNU, |
252b5132 RH |
448 | [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld, |
449 | [# I'd rather use --version here, but apparently some GNU ld's only accept -v. | |
450 | if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then | |
451 | ac_cv_prog_gnu_ld=yes | |
452 | else | |
453 | ac_cv_prog_gnu_ld=no | |
454 | fi]) | |
455 | ]) | |
456 | ||
bedf545c ILT |
457 | # AC_PROG_NM - find the path to a BSD-compatible name lister |
458 | AC_DEFUN(AC_PROG_NM, | |
252b5132 RH |
459 | [AC_MSG_CHECKING([for BSD-compatible nm]) |
460 | AC_CACHE_VAL(ac_cv_path_NM, | |
461 | [if test -n "$NM"; then | |
462 | # Let the user override the test. | |
463 | ac_cv_path_NM="$NM" | |
464 | else | |
465 | IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" | |
bedf545c | 466 | for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do |
252b5132 RH |
467 | test -z "$ac_dir" && ac_dir=. |
468 | if test -f $ac_dir/nm; then | |
469 | # Check to see if the nm accepts a BSD-compat flag. | |
470 | # Adding the `sed 1q' prevents false positives on HP-UX, which says: | |
471 | # nm: unknown option "B" ignored | |
472 | if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then | |
bedf545c ILT |
473 | ac_cv_path_NM="$ac_dir/nm -B" |
474 | break | |
252b5132 | 475 | elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then |
bedf545c ILT |
476 | ac_cv_path_NM="$ac_dir/nm -p" |
477 | break | |
252b5132 | 478 | else |
bedf545c ILT |
479 | ac_cv_path_NM=${ac_cv_path_NM="$ac_dir/nm"} # keep the first match, but |
480 | continue # so that we can try to find one that supports BSD flags | |
252b5132 | 481 | fi |
252b5132 RH |
482 | fi |
483 | done | |
484 | IFS="$ac_save_ifs" | |
485 | test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm | |
486 | fi]) | |
487 | NM="$ac_cv_path_NM" | |
488 | AC_MSG_RESULT([$NM]) | |
489 | AC_SUBST(NM) | |
490 | ]) | |
491 | ||
bedf545c ILT |
492 | # AC_SYS_NM_PARSE - Check for command to grab the raw symbol name followed |
493 | # by C symbol name from nm. | |
494 | AC_DEFUN(AC_SYS_NM_PARSE, | |
495 | [AC_REQUIRE([AC_CANONICAL_HOST])dnl | |
496 | AC_REQUIRE([AC_PROG_NM])dnl | |
497 | # Check for command to grab the raw symbol name followed by C symbol from nm. | |
498 | AC_MSG_CHECKING([command to parse $NM output]) | |
499 | AC_CACHE_VAL(ac_cv_sys_global_symbol_pipe, | |
500 | [# These are sane defaults that work on at least a few old systems. | |
501 | # {They come from Ultrix. What could be older than Ultrix?!! ;)} | |
502 | ||
503 | changequote(,)dnl | |
504 | # Character class describing NM global symbol codes. | |
505 | ac_symcode='[BCDEGRST]' | |
506 | ||
507 | # Regexp to match symbols that can be accessed directly from C. | |
508 | ac_sympat='\([_A-Za-z][_A-Za-z0-9]*\)' | |
509 | ||
510 | # Transform the above into a raw symbol and a C symbol. | |
511 | ac_symxfrm='\1 \2\3 \3' | |
512 | ||
513 | # Transform an extracted symbol line into a proper C declaration | |
514 | ac_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern char \1;/p'" | |
515 | ||
516 | # Define system-specific variables. | |
517 | case "$host_os" in | |
518 | aix*) | |
519 | ac_symcode='[BCDT]' | |
520 | ;; | |
521 | cygwin* | mingw*) | |
522 | ac_symcode='[ABCDGISTW]' | |
523 | ;; | |
524 | hpux*) | |
525 | ac_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern char \1();/p' -e 's/^. .* \(.*\)$/extern char \1;/p'" | |
526 | ;; | |
527 | irix*) | |
528 | ac_symcode='[BCDEGRST]' | |
529 | ;; | |
530 | solaris*) | |
531 | ac_symcode='[BDT]' | |
532 | ;; | |
533 | esac | |
534 | ||
535 | # If we're using GNU nm, then use its standard symbol codes. | |
536 | if $NM -V 2>&1 | egrep '(GNU|with BFD)' > /dev/null; then | |
537 | ac_symcode='[ABCDGISTW]' | |
538 | fi | |
539 | changequote([,])dnl | |
540 | ||
541 | # Try without a prefix undercore, then with it. | |
542 | for ac_symprfx in "" "_"; do | |
543 | ||
544 | ac_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($ac_symcode\)[ ][ ]*\($ac_symprfx\)$ac_sympat$/$ac_symxfrm/p'" | |
545 | ||
546 | # Check to see that the pipe works correctly. | |
547 | ac_pipe_works=no | |
548 | rm -f conftest.$ac_ext | |
549 | cat > conftest.$ac_ext <<EOF | |
550 | #ifdef __cplusplus | |
551 | extern "C" { | |
552 | #endif | |
553 | char nm_test_var; | |
554 | void nm_test_func(){} | |
555 | #ifdef __cplusplus | |
556 | } | |
557 | #endif | |
558 | int main(){nm_test_var='a';nm_test_func;return 0;} | |
559 | EOF | |
560 | ||
561 | if AC_TRY_EVAL(ac_compile); then | |
562 | # Now try to grab the symbols. | |
563 | ac_nlist=conftest.nm | |
564 | ||
565 | if AC_TRY_EVAL(NM conftest.$ac_objext \| $ac_cv_sys_global_symbol_pipe \> $ac_nlist) && test -s "$ac_nlist"; then | |
566 | ||
567 | # Try sorting and uniquifying the output. | |
568 | if sort "$ac_nlist" | uniq > "$ac_nlist"T; then | |
569 | mv -f "$ac_nlist"T "$ac_nlist" | |
570 | else | |
571 | rm -f "$ac_nlist"T | |
572 | fi | |
573 | ||
574 | # Make sure that we snagged all the symbols we need. | |
575 | if egrep ' nm_test_var$' "$ac_nlist" >/dev/null; then | |
576 | if egrep ' nm_test_func$' "$ac_nlist" >/dev/null; then | |
577 | cat <<EOF > conftest.c | |
578 | #ifdef __cplusplus | |
579 | extern "C" { | |
580 | #endif | |
581 | ||
582 | EOF | |
583 | # Now generate the symbol file. | |
584 | eval "$ac_global_symbol_to_cdecl"' < "$ac_nlist" >> conftest.c' | |
585 | ||
586 | cat <<EOF >> conftest.c | |
587 | #if defined (__STDC__) && __STDC__ | |
588 | # define lt_ptr_t void * | |
589 | #else | |
590 | # define lt_ptr_t char * | |
591 | # define const | |
592 | #endif | |
593 | ||
594 | /* The mapping between symbol names and symbols. */ | |
595 | const struct { | |
596 | const char *name; | |
597 | lt_ptr_t address; | |
598 | } | |
599 | changequote(,)dnl | |
600 | lt_preloaded_symbols[] = | |
601 | changequote([,])dnl | |
602 | { | |
603 | EOF | |
604 | sed 's/^. \(.*\) \(.*\)$/ {"\2", (lt_ptr_t) \&\2},/' < "$ac_nlist" >> conftest.c | |
605 | cat <<\EOF >> conftest.c | |
606 | {0, (lt_ptr_t) 0} | |
607 | }; | |
608 | ||
609 | #ifdef __cplusplus | |
610 | } | |
611 | #endif | |
612 | EOF | |
613 | # Now try linking the two files. | |
614 | mv conftest.$ac_objext conftestm.$ac_objext | |
615 | ac_save_LIBS="$LIBS" | |
616 | ac_save_CFLAGS="$CFLAGS" | |
617 | LIBS="conftestm.$ac_objext" | |
618 | CFLAGS="$CFLAGS$no_builtin_flag" | |
619 | if AC_TRY_EVAL(ac_link) && test -s conftest; then | |
620 | ac_pipe_works=yes | |
621 | else | |
622 | echo "configure: failed program was:" >&AC_FD_CC | |
623 | cat conftest.c >&AC_FD_CC | |
624 | fi | |
625 | LIBS="$ac_save_LIBS" | |
626 | CFLAGS="$ac_save_CFLAGS" | |
627 | else | |
628 | echo "cannot find nm_test_func in $ac_nlist" >&AC_FD_CC | |
629 | fi | |
630 | else | |
631 | echo "cannot find nm_test_var in $ac_nlist" >&AC_FD_CC | |
632 | fi | |
633 | else | |
634 | echo "cannot run $ac_cv_sys_global_symbol_pipe" >&AC_FD_CC | |
635 | fi | |
636 | else | |
637 | echo "$progname: failed program was:" >&AC_FD_CC | |
638 | cat conftest.c >&AC_FD_CC | |
639 | fi | |
640 | rm -rf conftest* | |
641 | ||
642 | # Do not use the global_symbol_pipe unless it works. | |
643 | if test "$ac_pipe_works" = yes; then | |
644 | if test x"$ac_symprfx" = x"_"; then | |
645 | ac_cv_sys_symbol_underscore=yes | |
646 | else | |
647 | ac_cv_sys_symbol_underscore=no | |
648 | fi | |
649 | break | |
650 | else | |
651 | ac_cv_sys_global_symbol_pipe= | |
652 | fi | |
653 | done | |
654 | ]) | |
655 | ||
656 | ac_result=yes | |
657 | if test -z "$ac_cv_sys_global_symbol_pipe"; then | |
658 | ac_result=no | |
659 | fi | |
660 | AC_MSG_RESULT($ac_result) | |
661 | ]) | |
662 | ||
663 | # AC_SYS_LIBTOOL_CYGWIN - find tools needed on cygwin | |
664 | AC_DEFUN(AC_SYS_LIBTOOL_CYGWIN, | |
252b5132 RH |
665 | [AC_CHECK_TOOL(DLLTOOL, dlltool, false) |
666 | AC_CHECK_TOOL(AS, as, false) | |
667 | ]) | |
668 | ||
bedf545c ILT |
669 | # AC_SYS_SYMBOL_UNDERSCORE - does the compiler prefix global symbols |
670 | # with an underscore? | |
671 | AC_DEFUN(AC_SYS_SYMBOL_UNDERSCORE, | |
672 | [AC_REQUIRE([AC_PROG_NM])dnl | |
673 | AC_REQUIRE([AC_SYS_NM_PARSE])dnl | |
674 | AC_MSG_CHECKING([for _ prefix in compiled symbols]) | |
675 | AC_CACHE_VAL(ac_cv_sys_symbol_underscore, | |
676 | [ac_cv_sys_symbol_underscore=no | |
677 | cat > conftest.$ac_ext <<EOF | |
678 | void nm_test_func(){} | |
679 | int main(){nm_test_func;return 0;} | |
680 | EOF | |
681 | if AC_TRY_EVAL(ac_compile); then | |
682 | # Now try to grab the symbols. | |
683 | ac_nlist=conftest.nm | |
684 | if AC_TRY_EVAL(NM conftest.$ac_objext \| $ac_cv_sys_global_symbol_pipe \> $ac_nlist) && test -s "$ac_nlist"; then | |
685 | # See whether the symbols have a leading underscore. | |
686 | if egrep '^. _nm_test_func' "$ac_nlist" >/dev/null; then | |
687 | ac_cv_sys_symbol_underscore=yes | |
688 | else | |
689 | if egrep '^. nm_test_func ' "$ac_nlist" >/dev/null; then | |
690 | : | |
691 | else | |
692 | echo "configure: cannot find nm_test_func in $ac_nlist" >&AC_FD_CC | |
693 | fi | |
694 | fi | |
695 | else | |
696 | echo "configure: cannot run $ac_cv_sys_global_symbol_pipe" >&AC_FD_CC | |
697 | fi | |
698 | else | |
699 | echo "configure: failed program was:" >&AC_FD_CC | |
700 | cat conftest.c >&AC_FD_CC | |
701 | fi | |
702 | rm -rf conftest* | |
703 | ]) | |
704 | AC_MSG_RESULT($ac_cv_sys_symbol_underscore) | |
705 | USE_SYMBOL_UNDERSCORE=${ac_cv_sys_symbol_underscore=no} | |
706 | AC_SUBST(USE_SYMBOL_UNDERSCORE)dnl | |
707 | ]) | |
708 | ||
709 | # AC_CHECK_LIBM - check for math library | |
710 | AC_DEFUN(AC_CHECK_LIBM, [ | |
711 | AC_CHECK_LIB(mw, _mwvalidcheckl) | |
712 | AC_CHECK_LIB(m, cos) | |
713 | ]) | |
714 | ||
715 | # AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for | |
716 | # the libltdl convenience library, adds --enable-ltdl-convenience to | |
717 | # the configure arguments. Note that LIBLTDL is not AC_SUBSTed, nor | |
718 | # is AC_CONFIG_SUBDIRS called. If DIR is not provided, it is assumed | |
719 | # to be `${top_builddir}/libltdl'. Make sure you start DIR with | |
720 | # '${top_builddir}/' (note the single quotes!) if your package is not | |
721 | # flat, and, if you're not using automake, define top_builddir as | |
722 | # appropriate in the Makefiles. | |
723 | AC_DEFUN(AC_LIBLTDL_CONVENIENCE, [ | |
724 | case "$enable_ltdl_convenience" in | |
725 | no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;; | |
726 | "") enable_ltdl_convenience=yes | |
727 | ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;; | |
728 | esac | |
729 | LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdlc.la | |
730 | ]) | |
731 | ||
732 | # AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for | |
733 | # the libltdl installable library, and adds --enable-ltdl-install to | |
734 | # the configure arguments. Note that LIBLTDL is not AC_SUBSTed, nor | |
735 | # is AC_CONFIG_SUBDIRS called. If DIR is not provided, it is assumed | |
736 | # to be `${top_builddir}/libltdl'. Make sure you start DIR with | |
737 | # '${top_builddir}/' (note the single quotes!) if your package is not | |
738 | # flat, and, if you're not using automake, define top_builddir as | |
739 | # appropriate in the Makefiles. | |
740 | # In the future, this macro may have to be called after AC_PROG_LIBTOOL. | |
741 | AC_DEFUN(AC_LIBLTDL_INSTALLABLE, [ | |
742 | AC_CHECK_LIB(ltdl, main, LIBLTDL="-lltdl", [ | |
743 | case "$enable_ltdl_install" in | |
744 | no) AC_MSG_WARN([libltdl not installed, but installation disabled]) ;; | |
745 | "") enable_ltdl_install=yes | |
746 | ac_configure_args="$ac_configure_args --enable-ltdl-install" ;; | |
747 | esac | |
748 | ]) | |
749 | if test x"$enable_ltdl_install" != x"no"; then | |
750 | LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdl.la | |
751 | fi | |
752 | ]) | |
753 | ||
754 | dnl old names | |
755 | AC_DEFUN(AM_PROG_LIBTOOL, [indir([AC_PROG_LIBTOOL])])dnl | |
756 | AC_DEFUN(AM_ENABLE_SHARED, [indir([AC_ENABLE_SHARED], $@)])dnl | |
757 | AC_DEFUN(AM_ENABLE_STATIC, [indir([AC_ENABLE_STATIC], $@)])dnl | |
758 | AC_DEFUN(AM_DISABLE_SHARED, [indir([AC_DISABLE_SHARED], $@)])dnl | |
759 | AC_DEFUN(AM_DISABLE_STATIC, [indir([AC_DISABLE_STATIC], $@)])dnl | |
760 | AC_DEFUN(AM_PROG_LD, [indir([AC_PROG_LD])])dnl | |
761 | AC_DEFUN(AM_PROG_NM, [indir([AC_PROG_NM])])dnl | |
762 | AC_DEFUN(AM_SYS_NM_PARSE, [indir([AC_SYS_NM_PARSE])])dnl | |
763 | AC_DEFUN(AM_SYS_SYMBOL_UNDERSCORE, [indir([AC_SYS_SYMBOL_UNDERSCORE])])dnl | |
764 | AC_DEFUN(AM_SYS_LIBTOOL_CYGWIN, [indir([AC_SYS_LIBTOOL_CYGWIN])])dnl | |
765 | ||
252b5132 RH |
766 | # Like AC_CONFIG_HEADER, but automatically create stamp file. |
767 | ||
768 | AC_DEFUN(AM_CONFIG_HEADER, | |
769 | [AC_PREREQ([2.12]) | |
770 | AC_CONFIG_HEADER([$1]) | |
771 | dnl When config.status generates a header, we must update the stamp-h file. | |
772 | dnl This file resides in the same directory as the config header | |
773 | dnl that is generated. We must strip everything past the first ":", | |
774 | dnl and everything past the last "/". | |
775 | AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl | |
776 | ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>, | |
777 | <<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>, | |
778 | <<am_indx=1 | |
779 | for am_file in <<$1>>; do | |
780 | case " <<$>>CONFIG_HEADERS " in | |
781 | *" <<$>>am_file "*<<)>> | |
782 | echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx | |
783 | ;; | |
784 | esac | |
785 | am_indx=`expr "<<$>>am_indx" + 1` | |
786 | done<<>>dnl>>) | |
787 | changequote([,]))]) | |
788 | ||
789 | ||
790 | dnl AM_PROG_LEX | |
791 | dnl Look for flex, lex or missing, then run AC_PROG_LEX and AC_DECL_YYTEXT | |
792 | AC_DEFUN(AM_PROG_LEX, | |
793 | [missing_dir=ifelse([$1],,`cd $ac_aux_dir && pwd`,$1) | |
794 | AC_CHECK_PROGS(LEX, flex lex, "$missing_dir/missing flex") | |
795 | AC_PROG_LEX | |
796 | AC_DECL_YYTEXT]) | |
797 | ||
798 | # This file is derived from `gettext.m4'. The difference is that the | |
799 | # included macros assume Cygnus-style source and build trees. | |
800 | ||
801 | # Macro to add for using GNU gettext. | |
802 | # Ulrich Drepper <drepper@cygnus.com>, 1995. | |
803 | # | |
804 | # This file file be copied and used freely without restrictions. It can | |
805 | # be used in projects which are not available under the GNU Public License | |
806 | # but which still want to provide support for the GNU gettext functionality. | |
807 | # Please note that the actual code is *not* freely available. | |
808 | ||
809 | # serial 3 | |
810 | ||
811 | AC_DEFUN(CY_WITH_NLS, | |
812 | [AC_MSG_CHECKING([whether NLS is requested]) | |
813 | dnl Default is enabled NLS | |
814 | AC_ARG_ENABLE(nls, | |
815 | [ --disable-nls do not use Native Language Support], | |
816 | USE_NLS=$enableval, USE_NLS=yes) | |
817 | AC_MSG_RESULT($USE_NLS) | |
818 | AC_SUBST(USE_NLS) | |
819 | ||
820 | USE_INCLUDED_LIBINTL=no | |
821 | ||
822 | dnl If we use NLS figure out what method | |
823 | if test "$USE_NLS" = "yes"; then | |
824 | AC_DEFINE(ENABLE_NLS, 1, [Define to 1 if NLS is requested]) | |
825 | AC_MSG_CHECKING([whether included gettext is requested]) | |
826 | AC_ARG_WITH(included-gettext, | |
827 | [ --with-included-gettext use the GNU gettext library included here], | |
828 | nls_cv_force_use_gnu_gettext=$withval, | |
829 | nls_cv_force_use_gnu_gettext=no) | |
830 | AC_MSG_RESULT($nls_cv_force_use_gnu_gettext) | |
831 | ||
832 | nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext" | |
833 | if test "$nls_cv_force_use_gnu_gettext" != "yes"; then | |
834 | dnl User does not insist on using GNU NLS library. Figure out what | |
835 | dnl to use. If gettext or catgets are available (in this order) we | |
836 | dnl use this. Else we have to fall back to GNU NLS library. | |
837 | dnl catgets is only used if permitted by option --with-catgets. | |
838 | nls_cv_header_intl= | |
839 | nls_cv_header_libgt= | |
840 | CATOBJEXT=NONE | |
841 | ||
842 | AC_CHECK_HEADER(libintl.h, | |
843 | [AC_CACHE_CHECK([for gettext in libc], gt_cv_func_gettext_libc, | |
844 | [AC_TRY_LINK([#include <libintl.h>], [return (int) gettext ("")], | |
845 | gt_cv_func_gettext_libc=yes, gt_cv_func_gettext_libc=no)]) | |
846 | ||
847 | if test "$gt_cv_func_gettext_libc" != "yes"; then | |
848 | AC_CHECK_LIB(intl, bindtextdomain, | |
849 | [AC_CACHE_CHECK([for gettext in libintl], | |
850 | gt_cv_func_gettext_libintl, | |
851 | [AC_TRY_LINK([], [return (int) gettext ("")], | |
852 | gt_cv_func_gettext_libintl=yes, | |
853 | gt_cv_func_gettext_libintl=no)])]) | |
854 | fi | |
855 | ||
856 | if test "$gt_cv_func_gettext_libc" = "yes" \ | |
857 | || test "$gt_cv_func_gettext_libintl" = "yes"; then | |
858 | AC_DEFINE(HAVE_GETTEXT, 1, | |
859 | [Define as 1 if you have gettext and don't want to use GNU gettext.]) | |
860 | AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt, | |
861 | [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl | |
862 | if test "$MSGFMT" != "no"; then | |
863 | AC_CHECK_FUNCS(dcgettext) | |
864 | AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT) | |
865 | AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext, | |
866 | [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :) | |
867 | AC_TRY_LINK(, [extern int _nl_msg_cat_cntr; | |
868 | return _nl_msg_cat_cntr], | |
869 | [CATOBJEXT=.gmo | |
870 | DATADIRNAME=share], | |
871 | [CATOBJEXT=.mo | |
872 | DATADIRNAME=lib]) | |
873 | INSTOBJEXT=.mo | |
874 | fi | |
875 | fi | |
876 | ]) | |
877 | ||
878 | dnl In the standard gettext, we would now check for catgets. | |
879 | dnl However, we never want to use catgets for our releases. | |
880 | ||
881 | if test "$CATOBJEXT" = "NONE"; then | |
882 | dnl Neither gettext nor catgets in included in the C library. | |
883 | dnl Fall back on GNU gettext library. | |
884 | nls_cv_use_gnu_gettext=yes | |
885 | fi | |
886 | fi | |
887 | ||
888 | if test "$nls_cv_use_gnu_gettext" = "yes"; then | |
889 | dnl Mark actions used to generate GNU NLS library. | |
890 | INTLOBJS="\$(GETTOBJS)" | |
891 | AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt, | |
892 | [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], msgfmt) | |
893 | AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT) | |
894 | AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext, | |
895 | [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :) | |
896 | AC_SUBST(MSGFMT) | |
897 | USE_INCLUDED_LIBINTL=yes | |
898 | CATOBJEXT=.gmo | |
899 | INSTOBJEXT=.mo | |
900 | DATADIRNAME=share | |
901 | INTLDEPS='$(top_builddir)/../intl/libintl.a' | |
902 | INTLLIBS=$INTLDEPS | |
903 | LIBS=`echo $LIBS | sed -e 's/-lintl//'` | |
904 | nls_cv_header_intl=libintl.h | |
905 | nls_cv_header_libgt=libgettext.h | |
906 | fi | |
907 | ||
908 | dnl Test whether we really found GNU xgettext. | |
909 | if test "$XGETTEXT" != ":"; then | |
910 | dnl If it is no GNU xgettext we define it as : so that the | |
911 | dnl Makefiles still can work. | |
912 | if $XGETTEXT --omit-header /dev/null 2> /dev/null; then | |
913 | : ; | |
914 | else | |
915 | AC_MSG_RESULT( | |
916 | [found xgettext programs is not GNU xgettext; ignore it]) | |
917 | XGETTEXT=":" | |
918 | fi | |
919 | fi | |
920 | ||
921 | # We need to process the po/ directory. | |
922 | POSUB=po | |
923 | else | |
924 | DATADIRNAME=share | |
925 | nls_cv_header_intl=libintl.h | |
926 | nls_cv_header_libgt=libgettext.h | |
927 | fi | |
928 | ||
929 | # If this is used in GNU gettext we have to set USE_NLS to `yes' | |
930 | # because some of the sources are only built for this goal. | |
931 | if test "$PACKAGE" = gettext; then | |
932 | USE_NLS=yes | |
933 | USE_INCLUDED_LIBINTL=yes | |
934 | fi | |
935 | ||
936 | dnl These rules are solely for the distribution goal. While doing this | |
937 | dnl we only have to keep exactly one list of the available catalogs | |
938 | dnl in configure.in. | |
939 | for lang in $ALL_LINGUAS; do | |
940 | GMOFILES="$GMOFILES $lang.gmo" | |
941 | POFILES="$POFILES $lang.po" | |
942 | done | |
943 | ||
944 | dnl Make all variables we use known to autoconf. | |
945 | AC_SUBST(USE_INCLUDED_LIBINTL) | |
946 | AC_SUBST(CATALOGS) | |
947 | AC_SUBST(CATOBJEXT) | |
948 | AC_SUBST(DATADIRNAME) | |
949 | AC_SUBST(GMOFILES) | |
950 | AC_SUBST(INSTOBJEXT) | |
951 | AC_SUBST(INTLDEPS) | |
952 | AC_SUBST(INTLLIBS) | |
953 | AC_SUBST(INTLOBJS) | |
954 | AC_SUBST(POFILES) | |
955 | AC_SUBST(POSUB) | |
956 | ]) | |
957 | ||
958 | AC_DEFUN(CY_GNU_GETTEXT, | |
959 | [AC_REQUIRE([AC_PROG_MAKE_SET])dnl | |
960 | AC_REQUIRE([AC_PROG_CC])dnl | |
961 | AC_REQUIRE([AC_PROG_RANLIB])dnl | |
962 | AC_REQUIRE([AC_ISC_POSIX])dnl | |
963 | AC_REQUIRE([AC_HEADER_STDC])dnl | |
964 | AC_REQUIRE([AC_C_CONST])dnl | |
965 | AC_REQUIRE([AC_C_INLINE])dnl | |
966 | AC_REQUIRE([AC_TYPE_OFF_T])dnl | |
967 | AC_REQUIRE([AC_TYPE_SIZE_T])dnl | |
968 | AC_REQUIRE([AC_FUNC_ALLOCA])dnl | |
969 | AC_REQUIRE([AC_FUNC_MMAP])dnl | |
970 | ||
971 | AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h string.h \ | |
972 | unistd.h values.h sys/param.h]) | |
973 | AC_CHECK_FUNCS([getcwd munmap putenv setenv setlocale strchr strcasecmp \ | |
974 | __argz_count __argz_stringify __argz_next]) | |
975 | ||
976 | if test "${ac_cv_func_stpcpy+set}" != "set"; then | |
977 | AC_CHECK_FUNCS(stpcpy) | |
978 | fi | |
979 | if test "${ac_cv_func_stpcpy}" = "yes"; then | |
980 | AC_DEFINE(HAVE_STPCPY, 1, [Define if you have the stpcpy function]) | |
981 | fi | |
982 | ||
983 | AM_LC_MESSAGES | |
984 | CY_WITH_NLS | |
985 | ||
986 | if test "x$CATOBJEXT" != "x"; then | |
987 | if test "x$ALL_LINGUAS" = "x"; then | |
988 | LINGUAS= | |
989 | else | |
990 | AC_MSG_CHECKING(for catalogs to be installed) | |
991 | NEW_LINGUAS= | |
992 | for lang in ${LINGUAS=$ALL_LINGUAS}; do | |
993 | case "$ALL_LINGUAS" in | |
994 | *$lang*) NEW_LINGUAS="$NEW_LINGUAS $lang" ;; | |
995 | esac | |
996 | done | |
997 | LINGUAS=$NEW_LINGUAS | |
998 | AC_MSG_RESULT($LINGUAS) | |
999 | fi | |
1000 | ||
1001 | dnl Construct list of names of catalog files to be constructed. | |
1002 | if test -n "$LINGUAS"; then | |
1003 | for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done | |
1004 | fi | |
1005 | fi | |
1006 | ||
1007 | dnl The reference to <locale.h> in the installed <libintl.h> file | |
1008 | dnl must be resolved because we cannot expect the users of this | |
1009 | dnl to define HAVE_LOCALE_H. | |
1010 | if test $ac_cv_header_locale_h = yes; then | |
1011 | INCLUDE_LOCALE_H="#include <locale.h>" | |
1012 | else | |
1013 | INCLUDE_LOCALE_H="\ | |
1014 | /* The system does not provide the header <locale.h>. Take care yourself. */" | |
1015 | fi | |
1016 | AC_SUBST(INCLUDE_LOCALE_H) | |
1017 | ||
1018 | dnl Determine which catalog format we have (if any is needed) | |
1019 | dnl For now we know about two different formats: | |
1020 | dnl Linux libc-5 and the normal X/Open format | |
1021 | if test -f $srcdir/po2tbl.sed.in; then | |
1022 | if test "$CATOBJEXT" = ".cat"; then | |
1023 | AC_CHECK_HEADER(linux/version.h, msgformat=linux, msgformat=xopen) | |
1024 | ||
1025 | dnl Transform the SED scripts while copying because some dumb SEDs | |
1026 | dnl cannot handle comments. | |
1027 | sed -e '/^#/d' $srcdir/$msgformat-msg.sed > po2msg.sed | |
1028 | fi | |
1029 | dnl po2tbl.sed is always needed. | |
1030 | sed -e '/^#.*[^\\]$/d' -e '/^#$/d' \ | |
1031 | $srcdir/po2tbl.sed.in > po2tbl.sed | |
1032 | fi | |
1033 | ||
1034 | dnl In the intl/Makefile.in we have a special dependency which makes | |
1035 | dnl only sense for gettext. We comment this out for non-gettext | |
1036 | dnl packages. | |
1037 | if test "$PACKAGE" = "gettext"; then | |
1038 | GT_NO="#NO#" | |
1039 | GT_YES= | |
1040 | else | |
1041 | GT_NO= | |
1042 | GT_YES="#YES#" | |
1043 | fi | |
1044 | AC_SUBST(GT_NO) | |
1045 | AC_SUBST(GT_YES) | |
1046 | ||
1047 | MKINSTALLDIRS="\$(srcdir)/../../mkinstalldirs" | |
1048 | AC_SUBST(MKINSTALLDIRS) | |
1049 | ||
1050 | dnl *** For now the libtool support in intl/Makefile is not for real. | |
1051 | l= | |
1052 | AC_SUBST(l) | |
1053 | ||
1054 | dnl Generate list of files to be processed by xgettext which will | |
1055 | dnl be included in po/Makefile. But only do this if the po directory | |
1056 | dnl exists in srcdir. | |
1057 | if test -d $srcdir/po; then | |
1058 | test -d po || mkdir po | |
1059 | if test "x$srcdir" != "x."; then | |
1060 | if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then | |
1061 | posrcprefix="$srcdir/" | |
1062 | else | |
1063 | posrcprefix="../$srcdir/" | |
1064 | fi | |
1065 | else | |
1066 | posrcprefix="../" | |
1067 | fi | |
1068 | rm -f po/POTFILES | |
1069 | sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \ | |
1070 | < $srcdir/po/POTFILES.in > po/POTFILES | |
1071 | fi | |
1072 | ]) | |
1073 | ||
1074 | # Search path for a program which passes the given test. | |
1075 | # Ulrich Drepper <drepper@cygnus.com>, 1996. | |
1076 | # | |
1077 | # This file file be copied and used freely without restrictions. It can | |
1078 | # be used in projects which are not available under the GNU Public License | |
1079 | # but which still want to provide support for the GNU gettext functionality. | |
1080 | # Please note that the actual code is *not* freely available. | |
1081 | ||
1082 | # serial 1 | |
1083 | ||
1084 | dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR, | |
1085 | dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]]) | |
1086 | AC_DEFUN(AM_PATH_PROG_WITH_TEST, | |
1087 | [# Extract the first word of "$2", so it can be a program name with args. | |
1088 | set dummy $2; ac_word=[$]2 | |
1089 | AC_MSG_CHECKING([for $ac_word]) | |
1090 | AC_CACHE_VAL(ac_cv_path_$1, | |
1091 | [case "[$]$1" in | |
1092 | /*) | |
1093 | ac_cv_path_$1="[$]$1" # Let the user override the test with a path. | |
1094 | ;; | |
1095 | *) | |
1096 | IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" | |
1097 | for ac_dir in ifelse([$5], , $PATH, [$5]); do | |
1098 | test -z "$ac_dir" && ac_dir=. | |
1099 | if test -f $ac_dir/$ac_word; then | |
1100 | if [$3]; then | |
1101 | ac_cv_path_$1="$ac_dir/$ac_word" | |
1102 | break | |
1103 | fi | |
1104 | fi | |
1105 | done | |
1106 | IFS="$ac_save_ifs" | |
1107 | dnl If no 4th arg is given, leave the cache variable unset, | |
1108 | dnl so AC_PATH_PROGS will keep looking. | |
1109 | ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4" | |
1110 | ])dnl | |
1111 | ;; | |
1112 | esac])dnl | |
1113 | $1="$ac_cv_path_$1" | |
1114 | if test -n "[$]$1"; then | |
1115 | AC_MSG_RESULT([$]$1) | |
1116 | else | |
1117 | AC_MSG_RESULT(no) | |
1118 | fi | |
1119 | AC_SUBST($1)dnl | |
1120 | ]) | |
1121 | ||
1122 | # Check whether LC_MESSAGES is available in <locale.h>. | |
1123 | # Ulrich Drepper <drepper@cygnus.com>, 1995. | |
1124 | # | |
1125 | # This file file be copied and used freely without restrictions. It can | |
1126 | # be used in projects which are not available under the GNU Public License | |
1127 | # but which still want to provide support for the GNU gettext functionality. | |
1128 | # Please note that the actual code is *not* freely available. | |
1129 | ||
1130 | # serial 1 | |
1131 | ||
1132 | AC_DEFUN(AM_LC_MESSAGES, | |
1133 | [if test $ac_cv_header_locale_h = yes; then | |
1134 | AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES, | |
1135 | [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES], | |
1136 | am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)]) | |
1137 | if test $am_cv_val_LC_MESSAGES = yes; then | |
1138 | AC_DEFINE(HAVE_LC_MESSAGES, 1, | |
1139 | [Define if your locale.h file contains LC_MESSAGES.]) | |
1140 | fi | |
1141 | fi]) | |
1142 | ||
1143 | # Add --enable-maintainer-mode option to configure. | |
1144 | # From Jim Meyering | |
1145 | ||
1146 | # serial 1 | |
1147 | ||
1148 | AC_DEFUN(AM_MAINTAINER_MODE, | |
1149 | [AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) | |
1150 | dnl maintainer-mode is disabled by default | |
1151 | AC_ARG_ENABLE(maintainer-mode, | |
1152 | [ --enable-maintainer-mode enable make rules and dependencies not useful | |
1153 | (and sometimes confusing) to the casual installer], | |
1154 | USE_MAINTAINER_MODE=$enableval, | |
1155 | USE_MAINTAINER_MODE=no) | |
1156 | AC_MSG_RESULT($USE_MAINTAINER_MODE) | |
1157 | AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes) | |
1158 | MAINT=$MAINTAINER_MODE_TRUE | |
1159 | AC_SUBST(MAINT)dnl | |
1160 | ] | |
1161 | ) | |
1162 | ||
1163 | # Define a conditional. | |
1164 | ||
1165 | AC_DEFUN(AM_CONDITIONAL, | |
1166 | [AC_SUBST($1_TRUE) | |
1167 | AC_SUBST($1_FALSE) | |
1168 | if $2; then | |
1169 | $1_TRUE= | |
1170 | $1_FALSE='#' | |
1171 | else | |
1172 | $1_TRUE='#' | |
1173 | $1_FALSE= | |
1174 | fi]) | |
1175 |