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