1 ## libtool.m4 - Configure libtool for the target system. -*-Shell-script-*-
2 ## Copyright (C) 1996-1998 Free Software Foundation, Inc.
3 ## Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
5 ## This program is free software; you can redistribute it and/or modify
6 ## it under the terms of the GNU General Public License as published by
7 ## the Free Software Foundation; either version 2 of the License, or
8 ## (at your option) any later version.
10 ## This program is distributed in the hope that it will be useful, but
11 ## WITHOUT ANY WARRANTY; without even the implied warranty of
12 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 ## General Public License for more details.
15 ## You should have received a copy of the GNU General Public License
16 ## along with this program; if not, write to the Free Software
17 ## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19 ## As a special exception to the GNU General Public License, if you
20 ## distribute this file as part of a program that contains a
21 ## configuration script generated by Autoconf, you may include it under
22 ## the same distribution terms that you use for the rest of that program.
24 # serial 29 AM_PROG_LIBTOOL
25 AC_DEFUN(AM_PROG_LIBTOOL,
26 [AC_REQUIRE([AM_ENABLE_SHARED])dnl
27 AC_REQUIRE([AM_ENABLE_STATIC])dnl
28 AC_REQUIRE([AC_CANONICAL_HOST])dnl
29 AC_REQUIRE([AC_CANONICAL_BUILD])dnl
30 AC_REQUIRE([AC_PROG_RANLIB])dnl
31 AC_REQUIRE([AC_PROG_CC])dnl
32 AC_REQUIRE([AM_PROG_LD])dnl
33 AC_REQUIRE([AM_PROG_NM])dnl
34 AC_REQUIRE([AM_SYS_NM_PARSE])dnl
35 AC_REQUIRE([AM_SYS_SYMBOL_UNDERSCORE])dnl
36 AC_REQUIRE([AC_PROG_LN_S])dnl
38 # Always use our own libtool.
39 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
42 # Check for any special flags to pass to ltconfig.
44 test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
45 test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
46 test "$silent" = yes && libtool_flags="$libtool_flags --silent"
47 test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
48 test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
50 # Some flags need to be propagated to the compiler or linker for good
54 # Find out which ABI we are using.
55 echo '[#]line __oline__ "configure"' > conftest.$ac_ext
56 if AC_TRY_EVAL(ac_compile); then
57 case "`/usr/bin/file conftest.o`" in
73 # On SCO OpenServer 5, we need -belf to get full-featured binaries.
75 CFLAGS="$CFLAGS -belf"
76 AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
77 [AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])])
78 if test x"$lt_cv_cc_needs_belf" != x"yes"; then
79 # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
85 AM_SYS_LIBTOOL_CYGWIN32
90 # enable the --disable-libtool-lock switch
92 AC_ARG_ENABLE(libtool-lock,
93 [ --disable-libtool-lock force libtool not to do file locking],
94 need_locks=$enableval,
97 if test x"$need_locks" = xno; then
98 libtool_flags="$libtool_flags --disable-lock"
102 # Actually configure libtool. ac_aux_dir is where install-sh is found.
103 CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
104 LD="$LD" NM="$NM" RANLIB="$RANLIB" LN_S="$LN_S" \
105 DLLTOOL="$DLLTOOL" AS="$AS" \
106 ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
107 $libtool_flags --no-verify $ac_aux_dir/ltmain.sh $host \
108 || AC_MSG_ERROR([libtool configure failed])
110 # Redirect the config.log output again, so that the ltconfig log is not
111 # clobbered by the next message.
115 # AM_ENABLE_SHARED - implement the --enable-shared flag
116 # Usage: AM_ENABLE_SHARED[(DEFAULT)]
117 # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
119 AC_DEFUN(AM_ENABLE_SHARED,
120 [define([AM_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
121 AC_ARG_ENABLE(shared,
122 changequote(<<, >>)dnl
123 << --enable-shared[=PKGS] build shared libraries [default=>>AM_ENABLE_SHARED_DEFAULT],
125 [p=${PACKAGE-default}
127 yes) enable_shared=yes ;;
128 no) enable_shared=no ;;
131 # Look at the argument we got. We use all the common list separators.
132 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
133 for pkg in $enableval; do
134 if test "X$pkg" = "X$p"; then
141 enable_shared=AM_ENABLE_SHARED_DEFAULT)dnl
144 # AM_DISABLE_SHARED - set the default shared flag to --disable-shared
145 AC_DEFUN(AM_DISABLE_SHARED,
146 [AM_ENABLE_SHARED(no)])
148 # AM_DISABLE_STATIC - set the default static flag to --disable-static
149 AC_DEFUN(AM_DISABLE_STATIC,
150 [AM_ENABLE_STATIC(no)])
152 # AM_ENABLE_STATIC - implement the --enable-static flag
153 # Usage: AM_ENABLE_STATIC[(DEFAULT)]
154 # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
156 AC_DEFUN(AM_ENABLE_STATIC,
157 [define([AM_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
158 AC_ARG_ENABLE(static,
159 changequote(<<, >>)dnl
160 << --enable-static[=PKGS] build static libraries [default=>>AM_ENABLE_STATIC_DEFAULT],
162 [p=${PACKAGE-default}
164 yes) enable_static=yes ;;
165 no) enable_static=no ;;
168 # Look at the argument we got. We use all the common list separators.
169 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
170 for pkg in $enableval; do
171 if test "X$pkg" = "X$p"; then
178 enable_static=AM_ENABLE_STATIC_DEFAULT)dnl
182 # AM_PROG_LD - find the path to the GNU or non-GNU linker
185 [ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
186 test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
187 AC_REQUIRE([AC_PROG_CC])dnl
188 AC_REQUIRE([AC_CANONICAL_HOST])dnl
189 AC_REQUIRE([AC_CANONICAL_BUILD])dnl
191 if test "$ac_cv_prog_gcc" = yes; then
192 # Check if gcc -print-prog-name=ld gives a path.
193 AC_MSG_CHECKING([for ld used by GCC])
194 ac_prog=`($CC -print-prog-name=ld) 2>&5`
196 # Accept absolute paths.
199 # Canonicalize the path of ld
200 re_direlt='/[^/][^/]*/\.\./'
201 sub_uncdrive='s%^\([A-Za-z]\):/%//\1/%'
203 while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
204 ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
208 # Convert to a UNC path for cygwin
209 test -z "$LD" && LD=`echo X$ac_prog | $Xsed -e "$sub_uncdrive"`
212 test -z "$LD" && LD="$ac_prog"
217 ## FIXME: The code fails later on if we try to use an $LD with
218 ## '\\' path separators.
222 # Canonicalize the path of ld
223 re_direlt='\\[^\\][^\\]*\\\.\.\(\\\)'
224 sub_uncdrive='s%^\([A-Za-z]\):\\%//\1/%'
226 sub_uncdir='s%\\%/%g'
227 while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
228 ac_prog=`echo $ac_prog| sed "s%$re_direlt%\1%"`
232 # Convert to a UNC path for cygwin
233 test -z "$LD" && LD=`echo X$ac_prog | sed -e 's%^X%%' -e "$sub_uncdrive" -e "$sub_uncdir"`
236 test -z "$LD" && LD="$ac_prog"
241 # If it fails, then pretend we aren't using GCC.
245 # If it is relative, then search for the first ld in PATH.
249 elif test "$with_gnu_ld" = yes; then
250 AC_MSG_CHECKING([for GNU ld])
252 AC_MSG_CHECKING([for non-GNU ld])
254 AC_CACHE_VAL(ac_cv_path_LD,
255 [if test -z "$LD"; then
256 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
257 for ac_dir in $PATH; do
258 test -z "$ac_dir" && ac_dir=.
259 if test -f "$ac_dir/$ac_prog"; then
260 ac_cv_path_LD="$ac_dir/$ac_prog"
261 # Check to see if the program is GNU ld. I'd rather use --version,
262 # but apparently some GNU ld's only accept -v.
263 # Break only if it was the GNU/non-GNU ld that we prefer.
264 if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
265 test "$with_gnu_ld" != no && break
267 test "$with_gnu_ld" != yes && break
273 ac_cv_path_LD="$LD" # Let the user override the test with a path.
276 if test -n "$LD"; then
281 test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
286 AC_DEFUN(AM_PROG_LD_GNU,
287 [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld,
288 [# I'd rather use --version here, but apparently some GNU ld's only accept -v.
289 if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
290 ac_cv_prog_gnu_ld=yes
296 # AM_PROG_NM - find the path to a BSD-compatible name lister
298 [AC_MSG_CHECKING([for BSD-compatible nm])
299 AC_CACHE_VAL(ac_cv_path_NM,
300 [if test -n "$NM"; then
301 # Let the user override the test.
304 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
305 for ac_dir in /usr/ucb /usr/ccs/bin $PATH /bin; do
306 test -z "$ac_dir" && ac_dir=.
307 if test -f $ac_dir/nm; then
308 # Check to see if the nm accepts a BSD-compat flag.
309 # Adding the `sed 1q' prevents false positives on HP-UX, which says:
310 # nm: unknown option "B" ignored
311 if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
312 ac_cv_path_NM="$ac_dir/nm -B"
313 elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
314 ac_cv_path_NM="$ac_dir/nm -p"
316 ac_cv_path_NM="$ac_dir/nm"
322 test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
329 # AM_SYS_NM_PARSE - Check for command ro grab the raw symbol name followed
330 # by C symbol name from nm.
331 AC_DEFUN(AM_SYS_NM_PARSE,
332 [AC_REQUIRE([AC_CANONICAL_HOST])dnl
333 AC_REQUIRE([AM_PROG_NM])dnl
334 # Check for command to grab the raw symbol name followed by C symbol from nm.
335 AC_MSG_CHECKING([command to parse $NM output])
336 AC_CACHE_VAL(ac_cv_sys_global_symbol_pipe,
337 [# These are sane defaults that work on at least a few old systems.
338 # {They come from Ultrix. What could be older than Ultrix?!! ;)}
341 # Character class describing NM global symbol codes.
342 ac_symcode='[BCDEGRSTU]'
344 # Regexp to match symbols that can be accessed directly from C.
345 ac_sympat='\([_A-Za-z][_A-Za-z0-9]*\)'
347 # Transform the above into a raw symbol and a C symbol.
350 # Define system-specific variables.
355 sunos* | cygwin32* | mingw32*)
356 ac_sympat='_\([_A-Za-z][_A-Za-z0-9]*\)'
360 # Cannot use undefined symbols on IRIX because inlined functions mess us up.
361 ac_symcode='[BCDEGRST]'
368 # If we're using GNU nm, then use its standard symbol codes.
369 if $NM -V 2>&1 | egrep '(GNU|with BFD)' > /dev/null; then
370 ac_symcode='[ABCDGISTUW]'
374 cygwin32* | mingw32*)
375 # We do not want undefined symbols on cygwin32. The user must
376 # arrange to define them via -l arguments.
377 ac_symcode='[ABCDGISTW]'
382 # Write the raw and C identifiers.
383 ac_cv_sys_global_symbol_pipe="sed -n -e 's/^.* $ac_symcode $ac_sympat$/$ac_symxfrm/p'"
385 # Check to see that the pipe works correctly.
387 cat > conftest.$ac_ext <<EOF
392 void nm_test_func(){}
396 int main(){nm_test_var='a';nm_test_func;return 0;}
398 if AC_TRY_EVAL(ac_compile); then
399 # Now try to grab the symbols.
401 if AC_TRY_EVAL(NM conftest.$ac_objext \| $ac_cv_sys_global_symbol_pipe \> $ac_nlist) && test -s "$ac_nlist"; then
403 # Try sorting and uniquifying the output.
404 if sort "$ac_nlist" | uniq > "$ac_nlist"T; then
405 mv -f "$ac_nlist"T "$ac_nlist"
406 ac_wcout=`wc "$ac_nlist" 2>/dev/null`
408 ac_count=`echo "X$ac_wcout" | sed -e 's,^X,,' -e 's/^[ ]*\([0-9][0-9]*\).*$/\1/'`
410 (test "$ac_count" -ge 0) 2>/dev/null || ac_count=-1
416 # Make sure that we snagged all the symbols we need.
417 if egrep ' nm_test_var$' "$ac_nlist" >/dev/null; then
418 if egrep ' nm_test_func$' "$ac_nlist" >/dev/null; then
419 cat <<EOF > conftest.c
425 # Now generate the symbol file.
426 sed 's/^.* \(.*\)$/extern char \1;/' < "$ac_nlist" >> conftest.c
428 cat <<EOF >> conftest.c
429 #if defined (__STDC__) && __STDC__
430 # define __ptr_t void *
432 # define __ptr_t char *
435 /* The number of symbols in dld_preloaded_symbols, -1 if unsorted. */
436 int dld_preloaded_symbol_count = $ac_count;
438 /* The mapping between symbol names and symbols. */
444 dld_preloaded_symbols[] =
448 sed 's/^\(.*\) \(.*\)$/ {"\1", (__ptr_t) \&\2},/' < "$ac_nlist" >> conftest.c
449 cat <<\EOF >> conftest.c
457 # Now try linking the two files.
458 mv conftest.$ac_objext conftestm.$ac_objext
460 ac_save_CFLAGS="$CFLAGS"
461 LIBS="conftestm.$ac_objext"
462 CFLAGS="$CFLAGS$no_builtin_flag"
463 if AC_TRY_EVAL(ac_link) && test -s conftest; then
466 echo "configure: failed program was:" >&AC_FD_CC
467 cat conftest.c >&AC_FD_CC
470 CFLAGS="$ac_save_CFLAGS"
472 echo "cannot find nm_test_func in $ac_nlist" >&AC_FD_CC
475 echo "cannot find nm_test_var in $ac_nlist" >&AC_FD_CC
478 echo "cannot run $ac_cv_sys_global_symbol_pipe" >&AC_FD_CC
481 echo "$progname: failed program was:" >&AC_FD_CC
482 cat conftest.c >&AC_FD_CC
486 # Do not use the global_symbol_pipe unless it works.
487 test "$ac_pipe_works" = yes || ac_cv_sys_global_symbol_pipe=
491 if test -z "$ac_cv_sys_global_symbol_pipe"; then
494 AC_MSG_RESULT($ac_result)
497 # AM_SYS_LIBTOOL_CYGWIN32 - find tools needed on cygwin32
498 AC_DEFUN(AM_SYS_LIBTOOL_CYGWIN32,
499 [AC_CHECK_TOOL(DLLTOOL, dlltool, false)
500 AC_CHECK_TOOL(AS, as, false)
503 # AM_SYS_SYMBOL_UNDERSCORE - does the compiler prefix global symbols
504 # with an underscore?
505 AC_DEFUN(AM_SYS_SYMBOL_UNDERSCORE,
506 [AC_REQUIRE([AM_PROG_NM])dnl
507 AC_REQUIRE([AM_SYS_NM_PARSE])dnl
508 AC_MSG_CHECKING([for _ prefix in compiled symbols])
509 AC_CACHE_VAL(ac_cv_sys_symbol_underscore,
510 [ac_cv_sys_symbol_underscore=no
511 cat > conftest.$ac_ext <<EOF
512 void nm_test_func(){}
513 int main(){nm_test_func;return 0;}
515 if AC_TRY_EVAL(ac_compile); then
516 # Now try to grab the symbols.
518 if AC_TRY_EVAL(NM conftest.$ac_objext \| $ac_cv_sys_global_symbol_pipe \> $ac_nlist) && test -s "$ac_nlist"; then
519 # See whether the symbols have a leading underscore.
520 if egrep '^_nm_test_func' "$ac_nlist" >/dev/null; then
521 ac_cv_sys_symbol_underscore=yes
523 if egrep '^nm_test_func ' "$ac_nlist" >/dev/null; then
526 echo "configure: cannot find nm_test_func in $ac_nlist" >&AC_FD_CC
530 echo "configure: cannot run $ac_cv_sys_global_symbol_pipe" >&AC_FD_CC
533 echo "configure: failed program was:" >&AC_FD_CC
534 cat conftest.c >&AC_FD_CC
538 AC_MSG_RESULT($ac_cv_sys_symbol_underscore)
539 if test x$ac_cv_sys_symbol_underscore = xyes; then
540 AC_DEFINE(WITH_SYMBOL_UNDERSCORE,1,
541 [define if compiled symbols have a leading underscore])
545 # Macro to add for using GNU gettext.
546 # Ulrich Drepper <drepper@cygnus.com>, 1995.
548 # Modified to never use included libintl.
549 # Owen Taylor <otaylor@redhat.com>, 12/15/1998
552 # This file can be copied and used freely without restrictions. It can
553 # be used in projects which are not available under the GNU Public License
554 # but which still want to provide support for the GNU gettext functionality.
555 # Please note that the actual code is *not* freely available.
559 AC_DEFUN(AM_GTK_WITH_NLS,
560 [AC_MSG_CHECKING([whether NLS is requested])
561 dnl Default is enabled NLS
563 [ --disable-nls do not use Native Language Support],
564 USE_NLS=$enableval, USE_NLS=yes)
565 AC_MSG_RESULT($USE_NLS)
568 USE_INCLUDED_LIBINTL=no
570 dnl If we use NLS figure out what method
571 if test "$USE_NLS" = "yes"; then
572 AC_DEFINE(ENABLE_NLS)
573 # AC_MSG_CHECKING([whether included gettext is requested])
574 # AC_ARG_WITH(included-gettext,
575 # [ --with-included-gettext use the GNU gettext library included here],
576 # nls_cv_force_use_gnu_gettext=$withval,
577 # nls_cv_force_use_gnu_gettext=no)
578 # AC_MSG_RESULT($nls_cv_force_use_gnu_gettext)
579 nls_cv_force_use_gnu_gettext="no"
581 nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
582 if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
583 dnl User does not insist on using GNU NLS library. Figure out what
584 dnl to use. If gettext or catgets are available (in this order) we
585 dnl use this. Else we have to fall back to GNU NLS library.
586 dnl catgets is only used if permitted by option --with-catgets.
591 AC_CHECK_HEADER(libintl.h,
592 [AC_CACHE_CHECK([for gettext in libc], gt_cv_func_gettext_libc,
593 [AC_TRY_LINK([#include <libintl.h>], [return (int) gettext ("")],
594 gt_cv_func_gettext_libc=yes, gt_cv_func_gettext_libc=no)])
596 if test "$gt_cv_func_gettext_libc" != "yes"; then
597 AC_CHECK_LIB(intl, bindtextdomain,
598 [AC_CACHE_CHECK([for gettext in libintl],
599 gt_cv_func_gettext_libintl,
600 [AC_CHECK_LIB(intl, gettext,
601 gt_cv_func_gettext_libintl=yes,
602 gt_cv_func_gettext_libintl=no)],
603 gt_cv_func_gettext_libintl=no)])
606 if test "$gt_cv_func_gettext_libc" = "yes" \
607 || test "$gt_cv_func_gettext_libintl" = "yes"; then
608 AC_DEFINE(HAVE_GETTEXT)
609 AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
610 [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl
611 if test "$MSGFMT" != "no"; then
612 AC_CHECK_FUNCS(dcgettext)
613 AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
614 AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
615 [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
616 AC_TRY_LINK(, [extern int _nl_msg_cat_cntr;
617 return _nl_msg_cat_cntr],
626 # Added by Martin Baulig 12/15/98 for libc5 systems
627 if test "$gt_cv_func_gettext_libc" != "yes" \
628 && test "$gt_cv_func_gettext_libintl" = "yes"; then
630 LIBS=`echo $LIBS | sed -e 's/-lintl//'`
634 if test "$CATOBJEXT" = "NONE"; then
635 AC_MSG_CHECKING([whether catgets can be used])
637 [ --with-catgets use catgets functions if available],
638 nls_cv_use_catgets=$withval, nls_cv_use_catgets=no)
639 AC_MSG_RESULT($nls_cv_use_catgets)
641 if test "$nls_cv_use_catgets" = "yes"; then
642 dnl No gettext in C library. Try catgets next.
643 AC_CHECK_LIB(i, main)
644 AC_CHECK_FUNC(catgets,
645 [AC_DEFINE(HAVE_CATGETS)
646 INTLOBJS="\$(CATOBJS)"
647 AC_PATH_PROG(GENCAT, gencat, no)dnl
648 # if test "$GENCAT" != "no"; then
649 # AC_PATH_PROG(GMSGFMT, gmsgfmt, no)
650 # if test "$GMSGFMT" = "no"; then
651 # AM_PATH_PROG_WITH_TEST(GMSGFMT, msgfmt,
652 # [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)
654 # AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
655 # [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
656 # USE_INCLUDED_LIBINTL=yes
660 # INTLDEPS='$(top_builddir)/intl/libintl.a'
662 # LIBS=`echo $LIBS | sed -e 's/-lintl//'`
663 # nls_cv_header_intl=intl/libintl.h
664 # nls_cv_header_libgt=intl/libgettext.h
670 if test "$CATOBJEXT" = "NONE"; then
671 dnl Neither gettext nor catgets in included in the C library.
672 dnl Fall back on GNU gettext library.
673 nls_cv_use_gnu_gettext=yes
677 if test "$nls_cv_use_gnu_gettext" != "yes"; then
678 AC_DEFINE(ENABLE_NLS)
680 # Unset this variable since we use the non-zero value as a flag.
682 # dnl Mark actions used to generate GNU NLS library.
683 # INTLOBJS="\$(GETTOBJS)"
684 # AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
685 # [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], msgfmt)
686 # AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
687 # AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
688 # [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
690 # USE_INCLUDED_LIBINTL=yes
694 # INTLDEPS='$(top_builddir)/intl/libintl.a'
696 # LIBS=`echo $LIBS | sed -e 's/-lintl//'`
697 # nls_cv_header_intl=intl/libintl.h
698 # nls_cv_header_libgt=intl/libgettext.h
701 dnl Test whether we really found GNU xgettext.
702 if test "$XGETTEXT" != ":"; then
703 dnl If it is no GNU xgettext we define it as : so that the
704 dnl Makefiles still can work.
705 if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
709 [found xgettext program is not GNU xgettext; ignore it])
714 # We need to process the po/ directory.
718 nls_cv_header_intl=intl/libintl.h
719 nls_cv_header_libgt=intl/libgettext.h
721 AC_LINK_FILES($nls_cv_header_libgt, $nls_cv_header_intl)
723 [case "$CONFIG_FILES" in *po/Makefile.in*)
724 sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile
728 # # If this is used in GNU gettext we have to set USE_NLS to `yes'
729 # # because some of the sources are only built for this goal.
730 # if test "$PACKAGE" = gettext; then
732 # USE_INCLUDED_LIBINTL=yes
735 dnl These rules are solely for the distribution goal. While doing this
736 dnl we only have to keep exactly one list of the available catalogs
738 for lang in $ALL_LINGUAS; do
739 GMOFILES="$GMOFILES $lang.gmo"
740 POFILES="$POFILES $lang.po"
743 dnl Make all variables we use known to autoconf.
744 AC_SUBST(USE_INCLUDED_LIBINTL)
747 AC_SUBST(DATADIRNAME)
757 AC_DEFUN(AM_GTK_GNU_GETTEXT,
758 [AC_REQUIRE([AC_PROG_MAKE_SET])dnl
759 AC_REQUIRE([AC_PROG_CC])dnl
760 AC_REQUIRE([AC_PROG_RANLIB])dnl
761 AC_REQUIRE([AC_ISC_POSIX])dnl
762 AC_REQUIRE([AC_HEADER_STDC])dnl
763 AC_REQUIRE([AC_C_CONST])dnl
764 AC_REQUIRE([AC_C_INLINE])dnl
765 AC_REQUIRE([AC_TYPE_OFF_T])dnl
766 AC_REQUIRE([AC_TYPE_SIZE_T])dnl
767 AC_REQUIRE([AC_FUNC_ALLOCA])dnl
768 AC_REQUIRE([AC_FUNC_MMAP])dnl
770 AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h string.h \
771 unistd.h sys/param.h])
772 AC_CHECK_FUNCS([getcwd munmap putenv setenv setlocale strchr strcasecmp \
773 strdup __argz_count __argz_stringify __argz_next])
775 if test "${ac_cv_func_stpcpy+set}" != "set"; then
776 AC_CHECK_FUNCS(stpcpy)
778 if test "${ac_cv_func_stpcpy}" = "yes"; then
779 AC_DEFINE(HAVE_STPCPY)
785 if test "x$CATOBJEXT" != "x"; then
786 if test "x$ALL_LINGUAS" = "x"; then
789 AC_MSG_CHECKING(for catalogs to be installed)
791 for lang in ${LINGUAS=$ALL_LINGUAS}; do
792 case "$ALL_LINGUAS" in
793 *$lang*) NEW_LINGUAS="$NEW_LINGUAS $lang" ;;
797 AC_MSG_RESULT($LINGUAS)
800 dnl Construct list of names of catalog files to be constructed.
801 if test -n "$LINGUAS"; then
802 for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
806 dnl The reference to <locale.h> in the installed <libintl.h> file
807 dnl must be resolved because we cannot expect the users of this
808 dnl to define HAVE_LOCALE_H.
809 if test $ac_cv_header_locale_h = yes; then
810 INCLUDE_LOCALE_H="#include <locale.h>"
813 /* The system does not provide the header <locale.h>. Take care yourself. */"
815 AC_SUBST(INCLUDE_LOCALE_H)
817 dnl Determine which catalog format we have (if any is needed)
818 dnl For now we know about two different formats:
819 dnl Linux libc-5 and the normal X/Open format
820 test -d intl || mkdir intl
821 if test "$CATOBJEXT" = ".cat"; then
822 AC_CHECK_HEADER(linux/version.h, msgformat=linux, msgformat=xopen)
824 dnl Transform the SED scripts while copying because some dumb SEDs
825 dnl cannot handle comments.
826 sed -e '/^#/d' $srcdir/intl/$msgformat-msg.sed > intl/po2msg.sed
828 dnl po2tbl.sed is always needed.
829 sed -e '/^#.*[^\\]$/d' -e '/^#$/d' \
830 $srcdir/intl/po2tbl.sed.in > intl/po2tbl.sed
832 dnl In the intl/Makefile.in we have a special dependency which makes
833 dnl only sense for gettext. We comment this out for non-gettext
835 if test "$PACKAGE" = "gettext"; then
845 dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
846 dnl find the mkinstalldirs script in another subdir but ($top_srcdir).
847 dnl Try to locate is.
849 if test -n "$ac_aux_dir"; then
850 MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs"
852 if test -z "$MKINSTALLDIRS"; then
853 MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
855 AC_SUBST(MKINSTALLDIRS)
857 dnl *** For now the libtool support in intl/Makefile is not for real.
861 dnl Generate list of files to be processed by xgettext which will
862 dnl be included in po/Makefile.
863 test -d po || mkdir po
864 if test "x$srcdir" != "x."; then
865 if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then
866 posrcprefix="$srcdir/"
868 posrcprefix="../$srcdir/"
874 sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \
875 < $srcdir/po/POTFILES.in > po/POTFILES