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