source: trunk/third/gnome-vfs/aclocal.m4 @ 18126

Revision 18126, 167.4 KB checked in by ghudson, 22 years ago (diff)
This commit was generated by cvs2svn to compensate for changes in r18125, which included commits to RCS files with non-trunk default branches.
Line 
1dnl aclocal.m4 generated automatically by aclocal 1.4-p4
2
3dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
4dnl This file is free software; the Free Software Foundation
5dnl gives unlimited permission to copy and/or distribute it,
6dnl with or without modifications, as long as this notice is preserved.
7
8dnl This program is distributed in the hope that it will be useful,
9dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
10dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
11dnl PARTICULAR PURPOSE.
12
13AC_DEFUN(AM_GNOME_CHECK_TYPE,
14  [AC_CACHE_CHECK([$1 in <sys/types.h>], ac_cv_type_$1,
15     [AC_TRY_COMPILE([
16#include <sys/types.h>
17#if STDC_HEADERS
18#include <stdlib.h>
19#include <stddef.h>
20#endif
21],[$1 foo;],
22     ac_cv_type_$1=yes, ac_cv_type_$1=no)])
23   if test $ac_cv_type_$1 = no; then
24      AC_DEFINE($1, $2, $1)
25   fi
26])
27
28AC_DEFUN(AM_GNOME_SIZE_T,
29  [AM_GNOME_CHECK_TYPE(size_t, unsigned)
30   AC_PROVIDE([AC_TYPE_SIZE_T])
31])
32
33AC_DEFUN(AM_GNOME_OFF_T,
34  [AM_GNOME_CHECK_TYPE(off_t, long)
35   AC_PROVIDE([AC_TYPE_OFF_T])
36])
37
38
39# Do all the work for Automake.  This macro actually does too much --
40# some checks are only needed if your package does certain things.
41# But this isn't really a big deal.
42
43# serial 1
44
45dnl Usage:
46dnl AM_INIT_AUTOMAKE(package,version, [no-define])
47
48AC_DEFUN(AM_INIT_AUTOMAKE,
49[AC_REQUIRE([AC_PROG_INSTALL])
50PACKAGE=[$1]
51AC_SUBST(PACKAGE)
52VERSION=[$2]
53AC_SUBST(VERSION)
54dnl test to see if srcdir already configured
55if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
56  AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
57fi
58ifelse([$3],,
59AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
60AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
61AC_REQUIRE([AM_SANITY_CHECK])
62AC_REQUIRE([AC_ARG_PROGRAM])
63dnl FIXME This is truly gross.
64missing_dir=`cd $ac_aux_dir && pwd`
65AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
66AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
67AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
68AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
69AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
70AC_REQUIRE([AC_PROG_MAKE_SET])])
71
72#
73# Check to make sure that the build environment is sane.
74#
75
76AC_DEFUN(AM_SANITY_CHECK,
77[AC_MSG_CHECKING([whether build environment is sane])
78# Just in case
79sleep 1
80echo timestamp > conftestfile
81# Do `set' in a subshell so we don't clobber the current shell's
82# arguments.  Must try -L first in case configure is actually a
83# symlink; some systems play weird games with the mod time of symlinks
84# (eg FreeBSD returns the mod time of the symlink's containing
85# directory).
86if (
87   set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
88   if test "[$]*" = "X"; then
89      # -L didn't work.
90      set X `ls -t $srcdir/configure conftestfile`
91   fi
92   if test "[$]*" != "X $srcdir/configure conftestfile" \
93      && test "[$]*" != "X conftestfile $srcdir/configure"; then
94
95      # If neither matched, then we have a broken ls.  This can happen
96      # if, for instance, CONFIG_SHELL is bash and it inherits a
97      # broken ls alias from the environment.  This has actually
98      # happened.  Such a system could not be considered "sane".
99      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
100alias in your environment])
101   fi
102
103   test "[$]2" = conftestfile
104   )
105then
106   # Ok.
107   :
108else
109   AC_MSG_ERROR([newly created file is older than distributed files!
110Check your system clock])
111fi
112rm -f conftest*
113AC_MSG_RESULT(yes)])
114
115dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
116dnl The program must properly implement --version.
117AC_DEFUN(AM_MISSING_PROG,
118[AC_MSG_CHECKING(for working $2)
119# Run test in a subshell; some versions of sh will print an error if
120# an executable is not found, even if stderr is redirected.
121# Redirect stdin to placate older versions of autoconf.  Sigh.
122if ($2 --version) < /dev/null > /dev/null 2>&1; then
123   $1=$2
124   AC_MSG_RESULT(found)
125else
126   $1="$3/missing $2"
127   AC_MSG_RESULT(missing)
128fi
129AC_SUBST($1)])
130
131# gnome-common.m4
132#
133# This only for packages that are not in the GNOME CVS tree.
134
135dnl GNOME_COMMON_INIT
136
137AC_DEFUN([GNOME_COMMON_INIT],
138[
139        GNOME_ACLOCAL_DIR="$GNOME_COMMON_MACROS_DIR"
140        AC_SUBST(GNOME_ACLOCAL_DIR)
141
142        ACLOCAL="$ACLOCAL $ACLOCAL_FLAGS"
143])
144
145
146
147AC_DEFUN(XML_I18N_TOOLS_NEWER_THAN_0_9,[ true ])
148
149dnl AC_PROG_XML_I18N_TOOLS([MINIMUM-VERSION [,"G2" if always using --utf8] ])
150# serial 1 AC_PROG_XML_I18N_TOOLS
151AC_DEFUN(AC_PROG_XML_I18N_TOOLS,
152[
153  AC_DEFUN(X18T_PFORG1,  dnl and -u for G2
154        ifelse([$2],[G2],[ -u ], [ -p ]))
155  AC_DEFUN(X18T_XML_KIND,
156        ifelse([$2],[G2],[ -u ],[ $(XML_I18N_XML_KIND) ]))
157  AC_DEFUN(X18T_KEYS_KIND,
158        ifelse([$2],[G2],[ -u ],[ $(XML_I18N_KEYS_KIND) ]))
159
160  XML_I18N_MERGE_DESKTOP_RULE='%.desktop:   %.desktop.in   $(top_builddir)/xml-i18n-merge $(wildcard $(top_srcdir)/po/*.po) ; $(top_builddir)/xml-i18n-merge $(top_srcdir)/po $< [$]@ -d X18T_PFORG1'
161XML_I18N_MERGE_DIRECTORY_RULE='%.directory: %.directory.in $(top_builddir)/xml-i18n-merge $(wildcard $(top_srcdir)/po/*.po) ; $(top_builddir)/xml-i18n-merge $(top_srcdir)/po $< [$]@ -d X18T_PFORG1'
162     XML_I18N_MERGE_KEYS_RULE='%.keys:      %.keys.in      $(top_builddir)/xml-i18n-merge $(wildcard $(top_srcdir)/po/*.po) ; $(top_builddir)/xml-i18n-merge $(top_srcdir)/po $< [$]@ -k X18T_KEYS_KIND'
163      XML_I18N_MERGE_OAF_RULE='%.oaf:       %.oaf.in       $(top_builddir)/xml-i18n-merge $(wildcard $(top_srcdir)/po/*.po) ; $(top_builddir)/xml-i18n-merge $(top_srcdir)/po $< [$]@ -o -p'
164     XML_I18N_MERGE_PONG_RULE='%.pong:      %.pong.in      $(top_builddir)/xml-i18n-merge $(wildcard $(top_srcdir)/po/*.po) ; $(top_builddir)/xml-i18n-merge $(top_srcdir)/po $< [$]@ -x X18T_PFORG1'
165   XML_I18N_MERGE_SERVER_RULE='%.server:    %.server.in    $(top_builddir)/xml-i18n-merge $(wildcard $(top_srcdir)/po/*.po) ; $(top_builddir)/xml-i18n-merge $(top_srcdir)/po $< [$]@ -o -u'
166    XML_I18N_MERGE_SHEET_RULE='%.sheet:     %.sheet.in     $(top_builddir)/xml-i18n-merge $(wildcard $(top_srcdir)/po/*.po) ; $(top_builddir)/xml-i18n-merge $(top_srcdir)/po $< [$]@ -x -u'
167XML_I18N_MERGE_SOUNDLIST_RULE='%.soundlist: %.soundlist.in $(top_builddir)/xml-i18n-merge $(wildcard $(top_srcdir)/po/*.po) ; $(top_builddir)/xml-i18n-merge $(top_srcdir)/po $< [$]@ -d X18T_PFORG1'
168      XML_I18N_MERGE_XML_RULE='%.xml:       %.xml.in       $(top_builddir)/xml-i18n-merge $(wildcard $(top_srcdir)/po/*.po) ; $(top_builddir)/xml-i18n-merge $(top_srcdir)/po $< [$]@ -x X18T_XML_KIND'
169
170AC_SUBST(XML_I18N_MERGE_DESKTOP_RULE)
171AC_SUBST(XML_I18N_MERGE_DIRECTORY_RULE)
172AC_SUBST(XML_I18N_MERGE_KEYS_RULE)
173AC_SUBST(XML_I18N_MERGE_OAF_RULE)
174AC_SUBST(XML_I18N_MERGE_PONG_RULE)
175AC_SUBST(XML_I18N_MERGE_SERVER_RULE)
176AC_SUBST(XML_I18N_MERGE_SHEET_RULE)
177AC_SUBST(XML_I18N_MERGE_SOUNDLIST_RULE)
178AC_SUBST(XML_I18N_MERGE_XML_RULE)
179
180# Use the tools built into the package, not the ones that are installed.
181
182XML_I18N_EXTRACT='$(top_builddir)/xml-i18n-extract'
183AC_SUBST(XML_I18N_EXTRACT)dnl
184
185XML_I18N_MERGE='$(top_builddir)/xml-i18n-merge'
186AC_SUBST(XML_I18N_MERGE)dnl
187
188XML_I18N_UPDATE='$(top_builddir)/xml-i18n-update'
189AC_SUBST(XML_I18N_UPDATE)dnl
190
191AC_PATH_PROG(INTLTOOL_PERL, perl)
192if test -z "$INTLTOOL_PERL"; then
193   AC_MSG_ERROR([perl not found; required for xml-i18n-tools])
194fi
195if test -z "`$INTLTOOL_PERL -v | fgrep '5.' 2> /dev/null`"; then
196   AC_MSG_ERROR([perl 5.x required for xml-i18n-tools])
197fi
198
199dnl Remove Intltool [] tags from po/POTFILES
200dnl
201ifdef([AC_DIVERSION_ICMDS],[
202  AC_DIVERT_PUSH(AC_DIVERSION_ICMDS)
203      changequote(,)
204      mv -f po/POTFILES po/POTFILES.tmp
205      sed -e 's/\[.*\] *//' < po/POTFILES.tmp > po/POTFILES
206      rm -f po/POTFILES.tmp
207      changequote([,])
208  AC_DIVERT_POP()
209],[
210  ifdef([AC_CONFIG_COMMANDS_PRE],[
211    AC_CONFIG_COMMANDS_PRE([
212        changequote(,)
213        mv -f po/POTFILES po/POTFILES.tmp
214        sed -e 's/\[.*\] *//' < po/POTFILES.tmp > po/POTFILES
215        rm -f po/POTFILES.tmp
216        changequote([,])
217    ])
218  ])
219])
220
221dnl  manually sed perl in so people don't have to put the xml-i18n-tools scripts in their
222dnl  AC_OUTPUT
223AC_OUTPUT_COMMANDS([
224sed -e "s:@INTLTOOL_PERL@:${INTLTOOL_PERL}:;" < ${srcdir}/xml-i18n-extract.in > xml-i18n-extract.out
225if cmp -s xml-i18n-extract xml-i18n-extract.out 2>/dev/null; then
226  rm -f xml-i18n-extract.out
227else
228  mv -f xml-i18n-extract.out xml-i18n-extract
229fi
230chmod ugo+x xml-i18n-extract
231chmod u+w xml-i18n-extract
232
233sed -e "s:@INTLTOOL_PERL@:${INTLTOOL_PERL}:;" < ${srcdir}/xml-i18n-merge.in > xml-i18n-merge.out
234if cmp -s xml-i18n-merge xml-i18n-merge.out 2>/dev/null; then
235  rm -f xml-i18n-merge.out
236else
237  mv -f xml-i18n-merge.out xml-i18n-merge
238fi
239chmod ugo+x xml-i18n-merge
240chmod u+w xml-i18n-merge
241
242sed -e "s:@INTLTOOL_PERL@:${INTLTOOL_PERL}:;" < ${srcdir}/xml-i18n-update.in > xml-i18n-update.out
243if cmp -s xml-i18n-update xml-i18n-update.out 2>/dev/null; then
244  rm -f xml-i18n-update.out
245else
246  mv -f xml-i18n-update.out xml-i18n-update
247fi
248chmod ugo+x xml-i18n-update
249chmod u+w xml-i18n-update
250], INTLTOOL_PERL=${INTLTOOL_PERL})
251
252# Redirect the config.log output again, so that the ltconfig log is not
253# clobbered by the next message.
254exec 5>>./config.log
255])
256
257dnl old names
258AC_DEFUN(AM_PROG_XML_I18N_TOOLS, [indir([AC_PROG_XML_I18N_TOOLS])])dnl
259
260# Like AC_CONFIG_HEADER, but automatically create stamp file.
261
262AC_DEFUN(AM_CONFIG_HEADER,
263[AC_PREREQ([2.12])
264AC_CONFIG_HEADER([$1])
265dnl When config.status generates a header, we must update the stamp-h file.
266dnl This file resides in the same directory as the config header
267dnl that is generated.  We must strip everything past the first ":",
268dnl and everything past the last "/".
269AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
270ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
271<<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
272<<am_indx=1
273for am_file in <<$1>>; do
274  case " <<$>>CONFIG_HEADERS " in
275  *" <<$>>am_file "*<<)>>
276    echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
277    ;;
278  esac
279  am_indx=`expr "<<$>>am_indx" + 1`
280done<<>>dnl>>)
281changequote([,]))])
282
283# aclocal-include.m4
284#
285# This macro adds the name macrodir to the set of directories
286# that `aclocal' searches for macros. 
287
288# serial 1
289
290dnl AM_ACLOCAL_INCLUDE(macrodir)
291AC_DEFUN([AM_ACLOCAL_INCLUDE],
292[
293        AM_CONDITIONAL(INSIDE_GNOME_COMMON, test x = y)
294
295        test -n "$ACLOCAL_FLAGS" && ACLOCAL="$ACLOCAL $ACLOCAL_FLAGS"
296
297        for k in $1 ; do ACLOCAL="$ACLOCAL -I $k" ; done
298])
299
300# Define a conditional.
301
302AC_DEFUN(AM_CONDITIONAL,
303[AC_SUBST($1_TRUE)
304AC_SUBST($1_FALSE)
305if $2; then
306  $1_TRUE=
307  $1_FALSE='#'
308else
309  $1_TRUE='#'
310  $1_FALSE=
311fi])
312
313# Add --enable-maintainer-mode option to configure.
314# From Jim Meyering
315
316# serial 1
317
318AC_DEFUN(AM_MAINTAINER_MODE,
319[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
320  dnl maintainer-mode is disabled by default
321  AC_ARG_ENABLE(maintainer-mode,
322[  --enable-maintainer-mode enable make rules and dependencies not useful
323                          (and sometimes confusing) to the casual installer],
324      USE_MAINTAINER_MODE=$enableval,
325      USE_MAINTAINER_MODE=no)
326  AC_MSG_RESULT($USE_MAINTAINER_MODE)
327  AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes)
328  MAINT=$MAINTAINER_MODE_TRUE
329  AC_SUBST(MAINT)dnl
330]
331)
332
333#serial 1
334# This test replaces the one in autoconf.
335# Currently this macro should have the same name as the autoconf macro
336# because gettext's gettext.m4 (distributed in the automake package)
337# still uses it.  Otherwise, the use in gettext.m4 makes autoheader
338# give these diagnostics:
339#   configure.in:556: AC_TRY_COMPILE was called before AC_ISC_POSIX
340#   configure.in:556: AC_TRY_RUN was called before AC_ISC_POSIX
341
342undefine([AC_ISC_POSIX])
343
344AC_DEFUN([AC_ISC_POSIX],
345  [
346    dnl This test replaces the obsolescent AC_ISC_POSIX kludge.
347    AC_CHECK_LIB(cposix, strerror, [LIBS="$LIBS -lcposix"])
348  ]
349)
350
351# libtool.m4 - Configure libtool for the host system. -*-Shell-script-*-
352
353# serial 46 AC_PROG_LIBTOOL
354
355builtin([undefine],[symbols])
356
357AC_DEFUN([AC_PROG_LIBTOOL],
358[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
359
360# This can be used to rebuild libtool when needed
361LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh"
362
363# Always use our own libtool.
364LIBTOOL='$(SHELL) $(top_builddir)/libtool'
365AC_SUBST(LIBTOOL)dnl
366
367# Prevent multiple expansion
368define([AC_PROG_LIBTOOL], [])
369])
370
371AC_DEFUN([AC_LIBTOOL_SETUP],
372[AC_PREREQ(2.13)dnl
373AC_REQUIRE([AC_ENABLE_SHARED])dnl
374AC_REQUIRE([AC_ENABLE_STATIC])dnl
375AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
376AC_REQUIRE([AC_CANONICAL_HOST])dnl
377AC_REQUIRE([AC_CANONICAL_BUILD])dnl
378AC_REQUIRE([AC_PROG_CC])dnl
379AC_REQUIRE([AC_PROG_LD])dnl
380AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl
381AC_REQUIRE([AC_PROG_NM])dnl
382AC_REQUIRE([AC_PROG_LN_S])dnl
383AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl
384AC_REQUIRE([AC_OBJEXT])dnl
385AC_REQUIRE([AC_EXEEXT])dnl
386dnl
387
388_LT_AC_PROG_ECHO_BACKSLASH
389# Only perform the check for file, if the check method requires it
390case $deplibs_check_method in
391file_magic*)
392  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
393    AC_PATH_MAGIC
394  fi
395  ;;
396esac
397
398AC_CHECK_TOOL(RANLIB, ranlib, :)
399AC_CHECK_TOOL(STRIP, strip, :)
400
401ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no)
402ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
403enable_win32_dll=yes, enable_win32_dll=no)
404
405AC_ARG_ENABLE(libtool-lock,
406  [  --disable-libtool-lock  avoid locking (might break parallel builds)])
407test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
408
409# Some flags need to be propagated to the compiler or linker for good
410# libtool support.
411case $host in
412*-*-irix6*)
413  # Find out which ABI we are using.
414  echo '[#]line __oline__ "configure"' > conftest.$ac_ext
415  if AC_TRY_EVAL(ac_compile); then
416    case `/usr/bin/file conftest.$ac_objext` in
417    *32-bit*)
418      LD="${LD-ld} -32"
419      ;;
420    *N32*)
421      LD="${LD-ld} -n32"
422      ;;
423    *64-bit*)
424      LD="${LD-ld} -64"
425      ;;
426    esac
427  fi
428  rm -rf conftest*
429  ;;
430
431*-*-sco3.2v5*)
432  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
433  SAVE_CFLAGS="$CFLAGS"
434  CFLAGS="$CFLAGS -belf"
435  AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
436    [AC_LANG_SAVE
437     AC_LANG_C
438     AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
439     AC_LANG_RESTORE])
440  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
441    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
442    CFLAGS="$SAVE_CFLAGS"
443  fi
444  ;;
445
446ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
447[*-*-cygwin* | *-*-mingw* | *-*-pw32*)
448  AC_CHECK_TOOL(DLLTOOL, dlltool, false)
449  AC_CHECK_TOOL(AS, as, false)
450  AC_CHECK_TOOL(OBJDUMP, objdump, false)
451
452  # recent cygwin and mingw systems supply a stub DllMain which the user
453  # can override, but on older systems we have to supply one
454  AC_CACHE_CHECK([if libtool should supply DllMain function], lt_cv_need_dllmain,
455    [AC_TRY_LINK([],
456      [extern int __attribute__((__stdcall__)) DllMain(void*, int, void*);
457      DllMain (0, 0, 0);],
458      [lt_cv_need_dllmain=no],[lt_cv_need_dllmain=yes])])
459
460  case $host/$CC in
461  *-*-cygwin*/gcc*-mno-cygwin*|*-*-mingw*)
462    # old mingw systems require "-dll" to link a DLL, while more recent ones
463    # require "-mdll"
464    SAVE_CFLAGS="$CFLAGS"
465    CFLAGS="$CFLAGS -mdll"
466    AC_CACHE_CHECK([how to link DLLs], lt_cv_cc_dll_switch,
467      [AC_TRY_LINK([], [], [lt_cv_cc_dll_switch=-mdll],[lt_cv_cc_dll_switch=-dll])])
468    CFLAGS="$SAVE_CFLAGS" ;;
469  *-*-cygwin* | *-*-pw32*)
470    # cygwin systems need to pass --dll to the linker, and not link
471    # crt.o which will require a WinMain@16 definition.
472    lt_cv_cc_dll_switch="-Wl,--dll -nostartfiles" ;;
473  esac
474  ;;
475  ])
476esac
477
478_LT_AC_LTCONFIG_HACK
479
480])
481
482# _LT_AC_CHECK_DLFCN
483# --------------------
484AC_DEFUN(_LT_AC_CHECK_DLFCN,
485[AC_CHECK_HEADERS(dlfcn.h)
486])# _LT_AC_CHECK_DLFCN
487
488# AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
489# ---------------------------------
490AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE],
491[AC_REQUIRE([AC_CANONICAL_HOST])
492AC_REQUIRE([AC_PROG_NM])
493AC_REQUIRE([AC_OBJEXT])
494# Check for command to grab the raw symbol name followed by C symbol from nm.
495AC_MSG_CHECKING([command to parse $NM output])
496AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], [dnl
497
498# These are sane defaults that work on at least a few old systems.
499# [They come from Ultrix.  What could be older than Ultrix?!! ;)]
500
501# Character class describing NM global symbol codes.
502[symcode='[BCDEGRST]']
503
504# Regexp to match symbols that can be accessed directly from C.
505[sympat='\([_A-Za-z][_A-Za-z0-9]*\)']
506
507# Transform the above into a raw symbol and a C symbol.
508symxfrm='\1 \2\3 \3'
509
510# Transform an extracted symbol line into a proper C declaration
511lt_cv_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern char \1;/p'"
512
513# Transform an extracted symbol line into symbol name and symbol address
514lt_cv_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/  {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (lt_ptr) \&\2},/p'"
515
516# Define system-specific variables.
517case $host_os in
518aix*)
519  [symcode='[BCDT]']
520  ;;
521cygwin* | mingw* | pw32*)
522  [symcode='[ABCDGISTW]']
523  ;;
524hpux*) # Its linker distinguishes data from code symbols
525  lt_cv_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern char \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
526  lt_cv_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/  {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (lt_ptr) \&\2},/p'"
527  ;;
528irix*)
529  [symcode='[BCDEGRST]']
530  ;;
531solaris* | sysv5*)
532  [symcode='[BDT]']
533  ;;
534sysv4)
535  [symcode='[DFNSTU]']
536  ;;
537esac
538
539# Handle CRLF in mingw tool chain
540opt_cr=
541case $host_os in
542mingw*)
543  opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp
544  ;;
545esac
546
547# If we're using GNU nm, then use its standard symbol codes.
548if $NM -V 2>&1 | egrep '(GNU|with BFD)' > /dev/null; then
549  [symcode='[ABCDGISTW]']
550fi
551
552# Try without a prefix undercore, then with it.
553for ac_symprfx in "" "_"; do
554
555  # Write the raw and C identifiers.
556[lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[        ]\($symcode$symcode*\)[         ][      ]*\($ac_symprfx\)$sympat$opt_cr$/$symxfrm/p'"]
557
558  # Check to see that the pipe works correctly.
559  pipe_works=no
560  rm -f conftest*
561  cat > conftest.$ac_ext <<EOF
562#ifdef __cplusplus
563extern "C" {
564#endif
565char nm_test_var;
566void nm_test_func(){}
567#ifdef __cplusplus
568}
569#endif
570int main(){nm_test_var='a';nm_test_func();return(0);}
571EOF
572
573  if AC_TRY_EVAL(ac_compile); then
574    # Now try to grab the symbols.
575    nlist=conftest.nm
576    if AC_TRY_EVAL(NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) && test -s "$nlist"; then
577      # Try sorting and uniquifying the output.
578      if sort "$nlist" | uniq > "$nlist"T; then
579        mv -f "$nlist"T "$nlist"
580      else
581        rm -f "$nlist"T
582      fi
583
584      # Make sure that we snagged all the symbols we need.
585      if egrep ' nm_test_var$' "$nlist" >/dev/null; then
586        if egrep ' nm_test_func$' "$nlist" >/dev/null; then
587          cat <<EOF > conftest.$ac_ext
588#ifdef __cplusplus
589extern "C" {
590#endif
591
592EOF
593          # Now generate the symbol file.
594          eval "$lt_cv_global_symbol_to_cdecl"' < "$nlist" >> conftest.$ac_ext'
595
596          cat <<EOF >> conftest.$ac_ext
597#if defined (__STDC__) && __STDC__
598# define lt_ptr void *
599#else
600# define lt_ptr char *
601# define const
602#endif
603
604/* The mapping between symbol names and symbols. */
605const struct {
606  const char *name;
607  lt_ptr address;
608}
609[lt_preloaded_symbols[] =]
610{
611EOF
612          sed "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (lt_ptr) \&\2},/" < "$nlist" >> conftest.$ac_ext
613          cat <<\EOF >> conftest.$ac_ext
614  {0, (lt_ptr) 0}
615};
616
617#ifdef __cplusplus
618}
619#endif
620EOF
621          # Now try linking the two files.
622          mv conftest.$ac_objext conftstm.$ac_objext
623          save_LIBS="$LIBS"
624          save_CFLAGS="$CFLAGS"
625          LIBS="conftstm.$ac_objext"
626          CFLAGS="$CFLAGS$no_builtin_flag"
627          if AC_TRY_EVAL(ac_link) && test -s conftest; then
628            pipe_works=yes
629          fi
630          LIBS="$save_LIBS"
631          CFLAGS="$save_CFLAGS"
632        else
633          echo "cannot find nm_test_func in $nlist" >&AC_FD_CC
634        fi
635      else
636        echo "cannot find nm_test_var in $nlist" >&AC_FD_CC
637      fi
638    else
639      echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AC_FD_CC
640    fi
641  else
642    echo "$progname: failed program was:" >&AC_FD_CC
643    cat conftest.$ac_ext >&5
644  fi
645  rm -f conftest* conftst*
646
647  # Do not use the global_symbol_pipe unless it works.
648  if test "$pipe_works" = yes; then
649    break
650  else
651    lt_cv_sys_global_symbol_pipe=
652  fi
653done
654])
655global_symbol_pipe="$lt_cv_sys_global_symbol_pipe"
656if test -z "$lt_cv_sys_global_symbol_pipe"; then
657  global_symbol_to_cdecl=
658  global_symbol_to_c_name_address=
659else
660  global_symbol_to_cdecl="$lt_cv_global_symbol_to_cdecl"
661  global_symbol_to_c_name_address="$lt_cv_global_symbol_to_c_name_address"
662fi
663if test -z "$global_symbol_pipe$global_symbol_to_cdec$global_symbol_to_c_name_address";
664then
665  AC_MSG_RESULT(failed)
666else
667  AC_MSG_RESULT(ok)
668fi
669]) # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
670
671# _LT_AC_LIBTOOL_SYS_PATH_SEPARATOR
672# ---------------------------------
673AC_DEFUN([_LT_AC_LIBTOOL_SYS_PATH_SEPARATOR],
674[# Find the correct PATH separator.  Usually this is `:', but
675# DJGPP uses `;' like DOS.
676if test "X${PATH_SEPARATOR+set}" != Xset; then
677  UNAME=${UNAME-`uname 2>/dev/null`}
678  case X$UNAME in
679    *-DOS) lt_cv_sys_path_separator=';' ;;
680    *)     lt_cv_sys_path_separator=':' ;;
681  esac
682fi
683])# _LT_AC_LIBTOOL_SYS_PATH_SEPARATOR
684
685# _LT_AC_PROG_ECHO_BACKSLASH
686# --------------------------
687# Add some code to the start of the generated configure script which
688# will find an echo command which doesn;t interpret backslashes.
689AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH],
690[ifdef([AC_DIVERSION_NOTICE], [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)],
691                              [AC_DIVERT_PUSH(NOTICE)])
692_LT_AC_LIBTOOL_SYS_PATH_SEPARATOR
693
694# Check that we are running under the correct shell.
695SHELL=${CONFIG_SHELL-/bin/sh}
696
697case X$ECHO in
698X*--fallback-echo)
699  # Remove one level of quotation (which was required for Make).
700  ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','`
701  ;;
702esac
703
704echo=${ECHO-echo}
705if test "X[$]1" = X--no-reexec; then
706  # Discard the --no-reexec flag, and continue.
707  shift
708elif test "X[$]1" = X--fallback-echo; then
709  # Avoid inline document here, it may be left over
710  :
711elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
712  # Yippee, $echo works!
713  :
714else
715  # Restart under the correct shell.
716  exec $SHELL "[$]0" --no-reexec ${1+"[$]@"}
717fi
718
719if test "X[$]1" = X--fallback-echo; then
720  # used as fallback echo
721  shift
722  cat <<EOF
723$*
724EOF
725  exit 0
726fi
727
728# The HP-UX ksh and POSIX shell print the target directory to stdout
729# if CDPATH is set.
730if test "X${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
731
732if test -z "$ECHO"; then
733if test "X${echo_test_string+set}" != Xset; then
734# find a string as large as possible, as long as the shell can cope with it
735  for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do
736    # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
737    if (echo_test_string="`eval $cmd`") 2>/dev/null &&
738       echo_test_string="`eval $cmd`" &&
739       (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null
740    then
741      break
742    fi
743  done
744fi
745
746if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
747   echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
748   test "X$echo_testing_string" = "X$echo_test_string"; then
749  :
750else
751  # The Solaris, AIX, and Digital Unix default echo programs unquote
752  # backslashes.  This makes it impossible to quote backslashes using
753  #   echo "$something" | sed 's/\\/\\\\/g'
754  #
755  # So, first we look for a working echo in the user's PATH.
756
757  IFS="${IFS=   }"; save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}"
758  for dir in $PATH /usr/ucb; do
759    if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
760       test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
761       echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
762       test "X$echo_testing_string" = "X$echo_test_string"; then
763      echo="$dir/echo"
764      break
765    fi
766  done
767  IFS="$save_ifs"
768
769  if test "X$echo" = Xecho; then
770    # We didn't find a better echo, so look for alternatives.
771    if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' &&
772       echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` &&
773       test "X$echo_testing_string" = "X$echo_test_string"; then
774      # This shell has a builtin print -r that does the trick.
775      echo='print -r'
776    elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) &&
777         test "X$CONFIG_SHELL" != X/bin/ksh; then
778      # If we have ksh, try running configure again with it.
779      ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
780      export ORIGINAL_CONFIG_SHELL
781      CONFIG_SHELL=/bin/ksh
782      export CONFIG_SHELL
783      exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"}
784    else
785      # Try using printf.
786      echo='printf %s\n'
787      if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
788         echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
789         test "X$echo_testing_string" = "X$echo_test_string"; then
790        # Cool, printf works
791        :
792      elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
793           test "X$echo_testing_string" = 'X\t' &&
794           echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
795           test "X$echo_testing_string" = "X$echo_test_string"; then
796        CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
797        export CONFIG_SHELL
798        SHELL="$CONFIG_SHELL"
799        export SHELL
800        echo="$CONFIG_SHELL [$]0 --fallback-echo"
801      elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
802           test "X$echo_testing_string" = 'X\t' &&
803           echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
804           test "X$echo_testing_string" = "X$echo_test_string"; then
805        echo="$CONFIG_SHELL [$]0 --fallback-echo"
806      else
807        # maybe with a smaller string...
808        prev=:
809
810        for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do
811          if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null
812          then
813            break
814          fi
815          prev="$cmd"
816        done
817
818        if test "$prev" != 'sed 50q "[$]0"'; then
819          echo_test_string=`eval $prev`
820          export echo_test_string
821          exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"}
822        else
823          # Oops.  We lost completely, so just stick with echo.
824          echo=echo
825        fi
826      fi
827    fi
828  fi
829fi
830fi
831
832# Copy echo and quote the copy suitably for passing to libtool from
833# the Makefile, instead of quoting the original, which is used later.
834ECHO=$echo
835if test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then
836   ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo"
837fi
838
839AC_SUBST(ECHO)
840AC_DIVERT_POP
841])# _LT_AC_PROG_ECHO_BACKSLASH
842
843# _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
844#                           ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
845# ------------------------------------------------------------------
846AC_DEFUN(_LT_AC_TRY_DLOPEN_SELF,
847[if test "$cross_compiling" = yes; then :
848  [$4]
849else
850  AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl
851  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
852  lt_status=$lt_dlunknown
853  cat > conftest.$ac_ext <<EOF
854[#line __oline__ "configure"
855#include "confdefs.h"
856
857#if HAVE_DLFCN_H
858#include <dlfcn.h>
859#endif
860
861#include <stdio.h>
862
863#ifdef RTLD_GLOBAL
864#  define LT_DLGLOBAL           RTLD_GLOBAL
865#else
866#  ifdef DL_GLOBAL
867#    define LT_DLGLOBAL         DL_GLOBAL
868#  else
869#    define LT_DLGLOBAL         0
870#  endif
871#endif
872
873/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
874   find out it does not work in some platform. */
875#ifndef LT_DLLAZY_OR_NOW
876#  ifdef RTLD_LAZY
877#    define LT_DLLAZY_OR_NOW            RTLD_LAZY
878#  else
879#    ifdef DL_LAZY
880#      define LT_DLLAZY_OR_NOW          DL_LAZY
881#    else
882#      ifdef RTLD_NOW
883#        define LT_DLLAZY_OR_NOW        RTLD_NOW
884#      else
885#        ifdef DL_NOW
886#          define LT_DLLAZY_OR_NOW      DL_NOW
887#        else
888#          define LT_DLLAZY_OR_NOW      0
889#        endif
890#      endif
891#    endif
892#  endif
893#endif
894
895#ifdef __cplusplus
896extern "C" void exit (int);
897#endif
898
899void fnord() { int i=42;}
900int main ()
901{
902  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
903  int status = $lt_dlunknown;
904
905  if (self)
906    {
907      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
908      else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
909      /* dlclose (self); */
910    }
911
912    exit (status);
913}]
914EOF
915  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
916    (./conftest; exit; ) 2>/dev/null
917    lt_status=$?
918    case x$lt_status in
919      x$lt_dlno_uscore) $1 ;;
920      x$lt_dlneed_uscore) $2 ;;
921      x$lt_unknown|x*) $3 ;;
922    esac
923  else :
924    # compilation failed
925    $3
926  fi
927fi
928rm -fr conftest*
929])# _LT_AC_TRY_DLOPEN_SELF
930
931# AC_LIBTOOL_DLOPEN_SELF
932# -------------------
933AC_DEFUN(AC_LIBTOOL_DLOPEN_SELF,
934[if test "x$enable_dlopen" != xyes; then
935  enable_dlopen=unknown
936  enable_dlopen_self=unknown
937  enable_dlopen_self_static=unknown
938else
939  lt_cv_dlopen=no
940  lt_cv_dlopen_libs=
941
942  case $host_os in
943  beos*)
944    lt_cv_dlopen="load_add_on"
945    lt_cv_dlopen_libs=
946    lt_cv_dlopen_self=yes
947    ;;
948
949  cygwin* | mingw* | pw32*)
950    lt_cv_dlopen="LoadLibrary"
951    lt_cv_dlopen_libs=
952   ;;
953
954  *)
955    AC_CHECK_FUNC([shl_load],
956          [lt_cv_dlopen="shl_load"],
957      [AC_CHECK_LIB([dld], [shl_load],
958            [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"],
959        [AC_CHECK_FUNC([dlopen],
960              [lt_cv_dlopen="dlopen"],
961          [AC_CHECK_LIB([dl], [dlopen],
962                [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
963            [AC_CHECK_LIB([svld], [dlopen],
964                  [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
965              [AC_CHECK_LIB([dld], [dld_link],
966                    [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"])
967              ])
968            ])
969          ])
970        ])
971      ])
972    ;;
973  esac
974
975  if test "x$lt_cv_dlopen" != xno; then
976    enable_dlopen=yes
977  else
978    enable_dlopen=no
979  fi
980
981  case $lt_cv_dlopen in
982  dlopen)
983    save_CPPFLAGS="$CPPFLAGS"
984    AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl
985    test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
986
987    save_LDFLAGS="$LDFLAGS"
988    eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
989
990    save_LIBS="$LIBS"
991    LIBS="$lt_cv_dlopen_libs $LIBS"
992
993    AC_CACHE_CHECK([whether a program can dlopen itself],
994          lt_cv_dlopen_self, [dnl
995          _LT_AC_TRY_DLOPEN_SELF(
996            lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
997            lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
998    ])
999
1000    if test "x$lt_cv_dlopen_self" = xyes; then
1001      LDFLAGS="$LDFLAGS $link_static_flag"
1002      AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
1003          lt_cv_dlopen_self_static, [dnl
1004          _LT_AC_TRY_DLOPEN_SELF(
1005            lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
1006            lt_cv_dlopen_self_static=no,  lt_cv_dlopen_self_static=cross)
1007      ])
1008    fi
1009
1010    CPPFLAGS="$save_CPPFLAGS"
1011    LDFLAGS="$save_LDFLAGS"
1012    LIBS="$save_LIBS"
1013    ;;
1014  esac
1015
1016  case $lt_cv_dlopen_self in
1017  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
1018  *) enable_dlopen_self=unknown ;;
1019  esac
1020
1021  case $lt_cv_dlopen_self_static in
1022  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
1023  *) enable_dlopen_self_static=unknown ;;
1024  esac
1025fi
1026])# AC_LIBTOOL_DLOPEN_SELF
1027
1028AC_DEFUN([_LT_AC_LTCONFIG_HACK],
1029[AC_REQUIRE([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])dnl
1030# Sed substitution that helps us do robust quoting.  It backslashifies
1031# metacharacters that are still active within double-quoted strings.
1032Xsed='sed -e s/^X//'
1033[sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g']
1034
1035# Same as above, but do not quote variable references.
1036[double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g']
1037
1038# Sed substitution to delay expansion of an escaped shell variable in a
1039# double_quote_subst'ed string.
1040delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
1041
1042# Constants:
1043rm="rm -f"
1044
1045# Global variables:
1046default_ofile=libtool
1047can_build_shared=yes
1048
1049# All known linkers require a `.a' archive for static linking (except M$VC,
1050# which needs '.lib').
1051libext=a
1052ltmain="$ac_aux_dir/ltmain.sh"
1053ofile="$default_ofile"
1054with_gnu_ld="$lt_cv_prog_gnu_ld"
1055need_locks="$enable_libtool_lock"
1056
1057old_CC="$CC"
1058old_CFLAGS="$CFLAGS"
1059
1060# Set sane defaults for various variables
1061test -z "$AR" && AR=ar
1062test -z "$AR_FLAGS" && AR_FLAGS=cru
1063test -z "$AS" && AS=as
1064test -z "$CC" && CC=cc
1065test -z "$DLLTOOL" && DLLTOOL=dlltool
1066test -z "$LD" && LD=ld
1067test -z "$LN_S" && LN_S="ln -s"
1068test -z "$MAGIC_CMD" && MAGIC_CMD=file
1069test -z "$NM" && NM=nm
1070test -z "$OBJDUMP" && OBJDUMP=objdump
1071test -z "$RANLIB" && RANLIB=:
1072test -z "$STRIP" && STRIP=:
1073test -z "$ac_objext" && ac_objext=o
1074
1075if test x"$host" != x"$build"; then
1076  ac_tool_prefix=${host_alias}-
1077else
1078  ac_tool_prefix=
1079fi
1080
1081# Transform linux* to *-*-linux-gnu*, to support old configure scripts.
1082case $host_os in
1083linux-gnu*) ;;
1084linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
1085esac
1086
1087case $host_os in
1088aix3*)
1089  # AIX sometimes has problems with the GCC collect2 program.  For some
1090  # reason, if we set the COLLECT_NAMES environment variable, the problems
1091  # vanish in a puff of smoke.
1092  if test "X${COLLECT_NAMES+set}" != Xset; then
1093    COLLECT_NAMES=
1094    export COLLECT_NAMES
1095  fi
1096  ;;
1097esac
1098
1099# Determine commands to create old-style static archives.
1100old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs'
1101old_postinstall_cmds='chmod 644 $oldlib'
1102old_postuninstall_cmds=
1103
1104if test -n "$RANLIB"; then
1105  case $host_os in
1106  openbsd*)
1107    old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds"
1108    ;;
1109  *)
1110    old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds"
1111    ;;
1112  esac
1113  old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
1114fi
1115
1116# Allow CC to be a program name with arguments.
1117set dummy $CC
1118compiler="[$]2"
1119
1120AC_MSG_CHECKING([for objdir])
1121rm -f .libs 2>/dev/null
1122mkdir .libs 2>/dev/null
1123if test -d .libs; then
1124  objdir=.libs
1125else
1126  # MS-DOS does not allow filenames that begin with a dot.
1127  objdir=_libs
1128fi
1129rmdir .libs 2>/dev/null
1130AC_MSG_RESULT($objdir)
1131
1132
1133AC_ARG_WITH(pic,
1134[  --with-pic              try to use only PIC/non-PIC objects [default=use both]],
1135pic_mode="$withval", pic_mode=default)
1136test -z "$pic_mode" && pic_mode=default
1137
1138# We assume here that the value for lt_cv_prog_cc_pic will not be cached
1139# in isolation, and that seeing it set (from the cache) indicates that
1140# the associated values are set (in the cache) correctly too.
1141AC_MSG_CHECKING([for $compiler option to produce PIC])
1142AC_CACHE_VAL(lt_cv_prog_cc_pic,
1143[ lt_cv_prog_cc_pic=
1144  lt_cv_prog_cc_shlib=
1145  lt_cv_prog_cc_wl=
1146  lt_cv_prog_cc_static=
1147  lt_cv_prog_cc_no_builtin=
1148  lt_cv_prog_cc_can_build_shared=$can_build_shared
1149
1150  if test "$GCC" = yes; then
1151    lt_cv_prog_cc_wl='-Wl,'
1152    lt_cv_prog_cc_static='-static'
1153
1154    case $host_os in
1155    aix*)
1156      # Below there is a dirty hack to force normal static linking with -ldl
1157      # The problem is because libdl dynamically linked with both libc and
1158      # libC (AIX C++ library), which obviously doesn't included in libraries
1159      # list by gcc. This cause undefined symbols with -static flags.
1160      # This hack allows C programs to be linked with "-static -ldl", but
1161      # not sure about C++ programs.
1162      lt_cv_prog_cc_static="$lt_cv_prog_cc_static ${lt_cv_prog_cc_wl}-lC"
1163      ;;
1164    amigaos*)
1165      # FIXME: we need at least 68020 code to build shared libraries, but
1166      # adding the `-m68020' flag to GCC prevents building anything better,
1167      # like `-m68040'.
1168      lt_cv_prog_cc_pic='-m68020 -resident32 -malways-restore-a4'
1169      ;;
1170    beos* | irix5* | irix6* | osf3* | osf4* | osf5*)
1171      # PIC is the default for these OSes.
1172      ;;
1173    darwin* | rhapsody*)
1174      # PIC is the default on this platform
1175      # Common symbols not allowed in MH_DYLIB files
1176      lt_cv_prog_cc_pic='-fno-common'
1177      ;;
1178    cygwin* | mingw* | pw32* | os2*)
1179      # This hack is so that the source file can tell whether it is being
1180      # built for inclusion in a dll (and should export symbols for example).
1181      lt_cv_prog_cc_pic='-DDLL_EXPORT'
1182      ;;
1183    sysv4*MP*)
1184      if test -d /usr/nec; then
1185         lt_cv_prog_cc_pic=-Kconform_pic
1186      fi
1187      ;;
1188    *)
1189      lt_cv_prog_cc_pic='-fPIC'
1190      ;;
1191    esac
1192  else
1193    # PORTME Check for PIC flags for the system compiler.
1194    case $host_os in
1195    aix3* | aix4* | aix5*)
1196      lt_cv_prog_cc_wl='-Wl,'
1197      # All AIX code is PIC.
1198      if test "$host_cpu" = ia64; then
1199        # AIX 5 now supports IA64 processor
1200        lt_cv_prog_cc_static='-Bstatic'
1201      else
1202        lt_cv_prog_cc_static='-bnso -bI:/lib/syscalls.exp'
1203      fi
1204      ;;
1205
1206    hpux9* | hpux10* | hpux11*)
1207      # Is there a better lt_cv_prog_cc_static that works with the bundled CC?
1208      lt_cv_prog_cc_wl='-Wl,'
1209      lt_cv_prog_cc_static="${lt_cv_prog_cc_wl}-a ${lt_cv_prog_cc_wl}archive"
1210      lt_cv_prog_cc_pic='+Z'
1211      ;;
1212
1213    irix5* | irix6*)
1214      lt_cv_prog_cc_wl='-Wl,'
1215      lt_cv_prog_cc_static='-non_shared'
1216      # PIC (with -KPIC) is the default.
1217      ;;
1218
1219    cygwin* | mingw* | pw32* | os2*)
1220      # This hack is so that the source file can tell whether it is being
1221      # built for inclusion in a dll (and should export symbols for example).
1222      lt_cv_prog_cc_pic='-DDLL_EXPORT'
1223      ;;
1224
1225    newsos6)
1226      lt_cv_prog_cc_pic='-KPIC'
1227      lt_cv_prog_cc_static='-Bstatic'
1228      ;;
1229
1230    osf3* | osf4* | osf5*)
1231      # All OSF/1 code is PIC.
1232      lt_cv_prog_cc_wl='-Wl,'
1233      lt_cv_prog_cc_static='-non_shared'
1234      ;;
1235
1236    sco3.2v5*)
1237      lt_cv_prog_cc_pic='-Kpic'
1238      lt_cv_prog_cc_static='-dn'
1239      lt_cv_prog_cc_shlib='-belf'
1240      ;;
1241
1242    solaris*)
1243      lt_cv_prog_cc_pic='-KPIC'
1244      lt_cv_prog_cc_static='-Bstatic'
1245      lt_cv_prog_cc_wl='-Wl,'
1246      ;;
1247
1248    sunos4*)
1249      lt_cv_prog_cc_pic='-PIC'
1250      lt_cv_prog_cc_static='-Bstatic'
1251      lt_cv_prog_cc_wl='-Qoption ld '
1252      ;;
1253
1254    sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
1255      lt_cv_prog_cc_pic='-KPIC'
1256      lt_cv_prog_cc_static='-Bstatic'
1257      if test "x$host_vendor" = xsni; then
1258        lt_cv_prog_cc_wl='-LD'
1259      else
1260        lt_cv_prog_cc_wl='-Wl,'
1261      fi
1262      ;;
1263
1264    uts4*)
1265      lt_cv_prog_cc_pic='-pic'
1266      lt_cv_prog_cc_static='-Bstatic'
1267      ;;
1268
1269    sysv4*MP*)
1270      if test -d /usr/nec ;then
1271        lt_cv_prog_cc_pic='-Kconform_pic'
1272        lt_cv_prog_cc_static='-Bstatic'
1273      fi
1274      ;;
1275
1276    *)
1277      lt_cv_prog_cc_can_build_shared=no
1278      ;;
1279    esac
1280  fi
1281])
1282if test -z "$lt_cv_prog_cc_pic"; then
1283  AC_MSG_RESULT([none])
1284else
1285  AC_MSG_RESULT([$lt_cv_prog_cc_pic])
1286
1287  # Check to make sure the pic_flag actually works.
1288  AC_MSG_CHECKING([if $compiler PIC flag $lt_cv_prog_cc_pic works])
1289  AC_CACHE_VAL(lt_cv_prog_cc_pic_works, [dnl
1290    save_CFLAGS="$CFLAGS"
1291    CFLAGS="$CFLAGS $lt_cv_prog_cc_pic -DPIC"
1292    AC_TRY_COMPILE([], [], [dnl
1293      case $host_os in
1294      hpux9* | hpux10* | hpux11*)
1295        # On HP-UX, both CC and GCC only warn that PIC is supported... then
1296        # they create non-PIC objects.  So, if there were any warnings, we
1297        # assume that PIC is not supported.
1298        if test -s conftest.err; then
1299          lt_cv_prog_cc_pic_works=no
1300        else
1301          lt_cv_prog_cc_pic_works=yes
1302        fi
1303        ;;
1304      *)
1305        lt_cv_prog_cc_pic_works=yes
1306        ;;
1307      esac
1308    ], [dnl
1309      lt_cv_prog_cc_pic_works=no
1310    ])
1311    CFLAGS="$save_CFLAGS"
1312  ])
1313
1314  if test "X$lt_cv_prog_cc_pic_works" = Xno; then
1315    lt_cv_prog_cc_pic=
1316    lt_cv_prog_cc_can_build_shared=no
1317  else
1318    lt_cv_prog_cc_pic=" $lt_cv_prog_cc_pic"
1319  fi
1320
1321  AC_MSG_RESULT([$lt_cv_prog_cc_pic_works])
1322fi
1323
1324# Check for any special shared library compilation flags.
1325if test -n "$lt_cv_prog_cc_shlib"; then
1326  AC_MSG_WARN([\`$CC' requires \`$lt_cv_prog_cc_shlib' to build shared libraries])
1327  if echo "$old_CC $old_CFLAGS " | [egrep -e "[         ]$lt_cv_prog_cc_shlib[  ]"] >/dev/null; then :
1328  else
1329   AC_MSG_WARN([add \`$lt_cv_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure])
1330    lt_cv_prog_cc_can_build_shared=no
1331  fi
1332fi
1333
1334AC_MSG_CHECKING([if $compiler static flag $lt_cv_prog_cc_static works])
1335AC_CACHE_VAL([lt_cv_prog_cc_static_works], [dnl
1336  lt_cv_prog_cc_static_works=no
1337  save_LDFLAGS="$LDFLAGS"
1338  LDFLAGS="$LDFLAGS $lt_cv_prog_cc_static"
1339  AC_TRY_LINK([], [], [lt_cv_prog_cc_static_works=yes])
1340  LDFLAGS="$save_LDFLAGS"
1341])
1342
1343# Belt *and* braces to stop my trousers falling down:
1344test "X$lt_cv_prog_cc_static_works" = Xno && lt_cv_prog_cc_static=
1345AC_MSG_RESULT([$lt_cv_prog_cc_static_works])
1346
1347pic_flag="$lt_cv_prog_cc_pic"
1348special_shlib_compile_flags="$lt_cv_prog_cc_shlib"
1349wl="$lt_cv_prog_cc_wl"
1350link_static_flag="$lt_cv_prog_cc_static"
1351no_builtin_flag="$lt_cv_prog_cc_no_builtin"
1352can_build_shared="$lt_cv_prog_cc_can_build_shared"
1353
1354
1355# Check to see if options -o and -c are simultaneously supported by compiler
1356AC_MSG_CHECKING([if $compiler supports -c -o file.$ac_objext])
1357AC_CACHE_VAL([lt_cv_compiler_c_o], [
1358$rm -r conftest 2>/dev/null
1359mkdir conftest
1360cd conftest
1361echo "int some_variable = 0;" > conftest.$ac_ext
1362mkdir out
1363# According to Tom Tromey, Ian Lance Taylor reported there are C compilers
1364# that will create temporary files in the current directory regardless of
1365# the output directory.  Thus, making CWD read-only will cause this test
1366# to fail, enabling locking or at least warning the user not to do parallel
1367# builds.
1368chmod -w .
1369save_CFLAGS="$CFLAGS"
1370CFLAGS="$CFLAGS -o out/conftest2.$ac_objext"
1371compiler_c_o=no
1372if { (eval echo configure:__oline__: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>out/conftest.err; } && test -s out/conftest2.$ac_objext; then
1373  # The compiler can only warn and ignore the option if not recognized
1374  # So say no if there are warnings
1375  if test -s out/conftest.err; then
1376    lt_cv_compiler_c_o=no
1377  else
1378    lt_cv_compiler_c_o=yes
1379  fi
1380else
1381  # Append any errors to the config.log.
1382  cat out/conftest.err 1>&AC_FD_CC
1383  lt_cv_compiler_c_o=no
1384fi
1385CFLAGS="$save_CFLAGS"
1386chmod u+w .
1387$rm conftest* out/*
1388rmdir out
1389cd ..
1390rmdir conftest
1391$rm -r conftest 2>/dev/null
1392])
1393compiler_c_o=$lt_cv_compiler_c_o
1394AC_MSG_RESULT([$compiler_c_o])
1395
1396if test x"$compiler_c_o" = x"yes"; then
1397  # Check to see if we can write to a .lo
1398  AC_MSG_CHECKING([if $compiler supports -c -o file.lo])
1399  AC_CACHE_VAL([lt_cv_compiler_o_lo], [
1400  lt_cv_compiler_o_lo=no
1401  save_CFLAGS="$CFLAGS"
1402  CFLAGS="$CFLAGS -c -o conftest.lo"
1403  save_objext="$ac_objext"
1404  ac_objext=lo
1405  AC_TRY_COMPILE([], [int some_variable = 0;], [dnl
1406    # The compiler can only warn and ignore the option if not recognized
1407    # So say no if there are warnings
1408    if test -s conftest.err; then
1409      lt_cv_compiler_o_lo=no
1410    else
1411      lt_cv_compiler_o_lo=yes
1412    fi
1413  ])
1414  ac_objext="$save_objext"
1415  CFLAGS="$save_CFLAGS"
1416  ])
1417  compiler_o_lo=$lt_cv_compiler_o_lo
1418  AC_MSG_RESULT([$compiler_o_lo])
1419else
1420  compiler_o_lo=no
1421fi
1422
1423# Check to see if we can do hard links to lock some files if needed
1424hard_links="nottested"
1425if test "$compiler_c_o" = no && test "$need_locks" != no; then
1426  # do not overwrite the value of need_locks provided by the user
1427  AC_MSG_CHECKING([if we can lock with hard links])
1428  hard_links=yes
1429  $rm conftest*
1430  ln conftest.a conftest.b 2>/dev/null && hard_links=no
1431  touch conftest.a
1432  ln conftest.a conftest.b 2>&5 || hard_links=no
1433  ln conftest.a conftest.b 2>/dev/null && hard_links=no
1434  AC_MSG_RESULT([$hard_links])
1435  if test "$hard_links" = no; then
1436    AC_MSG_WARN([\`$CC' does not support \`-c -o', so \`make -j' may be unsafe])
1437    need_locks=warn
1438  fi
1439else
1440  need_locks=no
1441fi
1442
1443if test "$GCC" = yes; then
1444  # Check to see if options -fno-rtti -fno-exceptions are supported by compiler
1445  AC_MSG_CHECKING([if $compiler supports -fno-rtti -fno-exceptions])
1446  echo "int some_variable = 0;" > conftest.$ac_ext
1447  save_CFLAGS="$CFLAGS"
1448  CFLAGS="$CFLAGS -fno-rtti -fno-exceptions -c conftest.$ac_ext"
1449  compiler_rtti_exceptions=no
1450  AC_TRY_COMPILE([], [int some_variable = 0;], [dnl
1451    # The compiler can only warn and ignore the option if not recognized
1452    # So say no if there are warnings
1453    if test -s conftest.err; then
1454      compiler_rtti_exceptions=no
1455    else
1456      compiler_rtti_exceptions=yes
1457    fi
1458  ])
1459  CFLAGS="$save_CFLAGS"
1460  AC_MSG_RESULT([$compiler_rtti_exceptions])
1461
1462  if test "$compiler_rtti_exceptions" = "yes"; then
1463    no_builtin_flag=' -fno-builtin -fno-rtti -fno-exceptions'
1464  else
1465    no_builtin_flag=' -fno-builtin'
1466  fi
1467fi
1468
1469# See if the linker supports building shared libraries.
1470AC_MSG_CHECKING([whether the linker ($LD) supports shared libraries])
1471
1472allow_undefined_flag=
1473no_undefined_flag=
1474need_lib_prefix=unknown
1475need_version=unknown
1476# when you set need_version to no, make sure it does not cause -set_version
1477# flags to be left without arguments
1478archive_cmds=
1479archive_expsym_cmds=
1480old_archive_from_new_cmds=
1481old_archive_from_expsyms_cmds=
1482export_dynamic_flag_spec=
1483whole_archive_flag_spec=
1484thread_safe_flag_spec=
1485hardcode_into_libs=no
1486hardcode_libdir_flag_spec=
1487hardcode_libdir_separator=
1488hardcode_direct=no
1489hardcode_minus_L=no
1490hardcode_shlibpath_var=unsupported
1491runpath_var=
1492link_all_deplibs=unknown
1493always_export_symbols=no
1494export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | sed '\''s/.* //'\'' | sort | uniq > $export_symbols'
1495# include_expsyms should be a list of space-separated symbols to be *always*
1496# included in the symbol list
1497include_expsyms=
1498# exclude_expsyms can be an egrep regular expression of symbols to exclude
1499# it will be wrapped by ` (' and `)$', so one must not match beginning or
1500# end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
1501# as well as any symbol that contains `d'.
1502exclude_expsyms="_GLOBAL_OFFSET_TABLE_"
1503# Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
1504# platforms (ab)use it in PIC code, but their linkers get confused if
1505# the symbol is explicitly referenced.  Since portable code cannot
1506# rely on this symbol name, it's probably fine to never include it in
1507# preloaded symbol tables.
1508extract_expsyms_cmds=
1509
1510case $host_os in
1511cygwin* | mingw* | pw32*)
1512  # FIXME: the MSVC++ port hasn't been tested in a loooong time
1513  # When not using gcc, we currently assume that we are using
1514  # Microsoft Visual C++.
1515  if test "$GCC" != yes; then
1516    with_gnu_ld=no
1517  fi
1518  ;;
1519openbsd*)
1520  with_gnu_ld=no
1521  ;;
1522esac
1523
1524ld_shlibs=yes
1525if test "$with_gnu_ld" = yes; then
1526  # If archive_cmds runs LD, not CC, wlarc should be empty
1527  wlarc='${wl}'
1528
1529  # See if GNU ld supports shared libraries.
1530  case $host_os in
1531  aix3* | aix4* | aix5*)
1532    # On AIX, the GNU linker is very broken
1533    # Note:Check GNU linker on AIX 5-IA64 when/if it becomes available.
1534    ld_shlibs=no
1535    cat <<EOF 1>&2
1536
1537*** Warning: the GNU linker, at least up to release 2.9.1, is reported
1538*** to be unable to reliably create shared libraries on AIX.
1539*** Therefore, libtool is disabling shared libraries support.  If you
1540*** really care for shared libraries, you may want to modify your PATH
1541*** so that a non-GNU linker is found, and then restart.
1542
1543EOF
1544    ;;
1545
1546  amigaos*)
1547    archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
1548    hardcode_libdir_flag_spec='-L$libdir'
1549    hardcode_minus_L=yes
1550
1551    # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
1552    # that the semantics of dynamic libraries on AmigaOS, at least up
1553    # to version 4, is to share data among multiple programs linked
1554    # with the same dynamic library.  Since this doesn't match the
1555    # behavior of shared libraries on other platforms, we can use
1556    # them.
1557    ld_shlibs=no
1558    ;;
1559
1560  beos*)
1561    if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
1562      allow_undefined_flag=unsupported
1563      # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
1564      # support --undefined.  This deserves some investigation.  FIXME
1565      archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
1566    else
1567      ld_shlibs=no
1568    fi
1569    ;;
1570
1571  cygwin* | mingw* | pw32*)
1572    # hardcode_libdir_flag_spec is actually meaningless, as there is
1573    # no search path for DLLs.
1574    hardcode_libdir_flag_spec='-L$libdir'
1575    allow_undefined_flag=unsupported
1576    always_export_symbols=yes
1577
1578    extract_expsyms_cmds='test -f $output_objdir/impgen.c || \
1579      sed -e "/^# \/\* impgen\.c starts here \*\//,/^# \/\* impgen.c ends here \*\// { s/^# //;s/^# *$//; p; }" -e d < $''0 > $output_objdir/impgen.c~
1580      test -f $output_objdir/impgen.exe || (cd $output_objdir && \
1581      if test "x$HOST_CC" != "x" ; then $HOST_CC -o impgen impgen.c ; \
1582      else $CC -o impgen impgen.c ; fi)~
1583      $output_objdir/impgen $dir/$soroot > $output_objdir/$soname-def'
1584
1585    old_archive_from_expsyms_cmds='$DLLTOOL --as=$AS --dllname $soname --def $output_objdir/$soname-def --output-lib $output_objdir/$newlib'
1586
1587    # cygwin and mingw dlls have different entry points and sets of symbols
1588    # to exclude.
1589    # FIXME: what about values for MSVC?
1590    dll_entry=__cygwin_dll_entry@12
1591    dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12~
1592    case $host_os in
1593    mingw*)
1594      # mingw values
1595      dll_entry=_DllMainCRTStartup@12
1596      dll_exclude_symbols=DllMain@12,DllMainCRTStartup@12,DllEntryPoint@12~
1597      ;;
1598    esac
1599
1600    # mingw and cygwin differ, and it's simplest to just exclude the union
1601    # of the two symbol sets.
1602    dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12,DllMainCRTStartup@12,DllEntryPoint@12
1603
1604    # recent cygwin and mingw systems supply a stub DllMain which the user
1605    # can override, but on older systems we have to supply one (in ltdll.c)
1606    if test "x$lt_cv_need_dllmain" = "xyes"; then
1607      ltdll_obj='$output_objdir/$soname-ltdll.'"$ac_objext "
1608      ltdll_cmds='test -f $output_objdir/$soname-ltdll.c || sed -e "/^# \/\* ltdll\.c starts here \*\//,/^# \/\* ltdll.c ends here \*\// { s/^# //; p; }" -e d < [$]0 > $output_objdir/$soname-ltdll.c~
1609        test -f $output_objdir/$soname-ltdll.$ac_objext || (cd $output_objdir && $CC -c $soname-ltdll.c)~'
1610    else
1611      ltdll_obj=
1612      ltdll_cmds=
1613    fi
1614
1615    # Extract the symbol export list from an `--export-all' def file,
1616    # then regenerate the def file from the symbol export list, so that
1617    # the compiled dll only exports the symbol export list.
1618    # Be careful not to strip the DATA tag left be newer dlltools.
1619    export_symbols_cmds="$ltdll_cmds"'
1620      $DLLTOOL --export-all --exclude-symbols '$dll_exclude_symbols' --output-def $output_objdir/$soname-def '$ltdll_obj'$libobjs $convenience~
1621      [sed -e "1,/EXPORTS/d" -e "s/ @ [0-9]*//" -e "s/ *;.*$//"] < $output_objdir/$soname-def > $export_symbols'
1622
1623    # If the export-symbols file already is a .def file (1st line
1624    # is EXPORTS), use it as is.
1625    # If DATA tags from a recent dlltool are present, honour them!
1626    archive_expsym_cmds='if test "x`head -1 $export_symbols`" = xEXPORTS; then
1627        cp $export_symbols $output_objdir/$soname-def;
1628      else
1629        echo EXPORTS > $output_objdir/$soname-def;
1630        _lt_hint=1;
1631        cat $export_symbols | while read symbol; do
1632         set dummy \$symbol;
1633         case \[$]# in
1634           2) echo "   \[$]2 @ \$_lt_hint ; " >> $output_objdir/$soname-def;;
1635           *) echo "     \[$]2 @ \$_lt_hint \[$]3 ; " >> $output_objdir/$soname-def;;
1636         esac;
1637         _lt_hint=`expr 1 + \$_lt_hint`;
1638        done;
1639      fi~
1640      '"$ltdll_cmds"'
1641      $CC -Wl,--base-file,$output_objdir/$soname-base '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags~
1642      $DLLTOOL --as=$AS --dllname $soname --exclude-symbols '$dll_exclude_symbols' --def $output_objdir/$soname-def --base-file $output_objdir/$soname-base --output-exp $output_objdir/$soname-exp~
1643      $CC -Wl,--base-file,$output_objdir/$soname-base $output_objdir/$soname-exp '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags~
1644      $DLLTOOL --as=$AS --dllname $soname --exclude-symbols '$dll_exclude_symbols' --def $output_objdir/$soname-def --base-file $output_objdir/$soname-base --output-exp $output_objdir/$soname-exp --output-lib $output_objdir/$libname.dll.a~
1645      $CC $output_objdir/$soname-exp '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags'
1646    ;;
1647
1648  netbsd*)
1649    if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
1650      archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
1651      wlarc=
1652    else
1653      archive_cmds='$CC -shared -nodefaultlibs $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
1654      archive_expsym_cmds='$CC -shared -nodefaultlibs $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
1655    fi
1656    ;;
1657
1658  solaris* | sysv5*)
1659    if $LD -v 2>&1 | egrep 'BFD 2\.8' > /dev/null; then
1660      ld_shlibs=no
1661      cat <<EOF 1>&2
1662
1663*** Warning: The releases 2.8.* of the GNU linker cannot reliably
1664*** create shared libraries on Solaris systems.  Therefore, libtool
1665*** is disabling shared libraries support.  We urge you to upgrade GNU
1666*** binutils to release 2.9.1 or newer.  Another option is to modify
1667*** your PATH or compiler configuration so that the native linker is
1668*** used, and then restart.
1669
1670EOF
1671    elif $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
1672      archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
1673      archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
1674    else
1675      ld_shlibs=no
1676    fi
1677    ;;
1678
1679  sunos4*)
1680    archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
1681    wlarc=
1682    hardcode_direct=yes
1683    hardcode_shlibpath_var=no
1684    ;;
1685
1686  *)
1687    if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
1688      archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
1689      archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
1690    else
1691      ld_shlibs=no
1692    fi
1693    ;;
1694  esac
1695
1696  if test "$ld_shlibs" = yes; then
1697    runpath_var=LD_RUN_PATH
1698    hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir'
1699    export_dynamic_flag_spec='${wl}--export-dynamic'
1700    case $host_os in
1701    cygwin* | mingw* | pw32*)
1702      # dlltool doesn't understand --whole-archive et. al.
1703      whole_archive_flag_spec=
1704      ;;
1705    *)
1706      # ancient GNU ld didn't support --whole-archive et. al.
1707      if $LD --help 2>&1 | egrep 'no-whole-archive' > /dev/null; then
1708        whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
1709      else
1710        whole_archive_flag_spec=
1711      fi
1712      ;;
1713    esac
1714  fi
1715else
1716  # PORTME fill in a description of your system's linker (not GNU ld)
1717  case $host_os in
1718  aix3*)
1719    allow_undefined_flag=unsupported
1720    always_export_symbols=yes
1721    archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
1722    # Note: this linker hardcodes the directories in LIBPATH if there
1723    # are no directories specified by -L.
1724    hardcode_minus_L=yes
1725    if test "$GCC" = yes && test -z "$link_static_flag"; then
1726      # Neither direct hardcoding nor static linking is supported with a
1727      # broken collect2.
1728      hardcode_direct=unsupported
1729    fi
1730    ;;
1731
1732  aix4* | aix5*)
1733    if test "$host_cpu" = ia64; then
1734      # On IA64, the linker does run time linking by default, so we don't
1735      # have to do anything special.
1736      aix_use_runtimelinking=no
1737      exp_sym_flag='-Bexport'
1738      no_entry_flag=""
1739    else
1740      aix_use_runtimelinking=no
1741
1742      # Test if we are trying to use run time linking or normal
1743      # AIX style linking. If -brtl is somewhere in LDFLAGS, we
1744      # need to do runtime linking.
1745      case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*)
1746        for ld_flag in $LDFLAGS; do
1747          if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
1748            aix_use_runtimelinking=yes
1749            break
1750          fi
1751        done
1752      esac
1753
1754      exp_sym_flag='-bexport'
1755      no_entry_flag='-bnoentry'
1756    fi
1757
1758    # When large executables or shared objects are built, AIX ld can
1759    # have problems creating the table of contents.  If linking a library
1760    # or program results in "error TOC overflow" add -mminimal-toc to
1761    # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
1762    # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
1763
1764    hardcode_direct=yes
1765    archive_cmds=''
1766    hardcode_libdir_separator=':'
1767    if test "$GCC" = yes; then
1768      case $host_os in aix4.[[012]]|aix4.[[012]].*)
1769        collect2name=`${CC} -print-prog-name=collect2`
1770        if test -f "$collect2name" && \
1771          strings "$collect2name" | grep resolve_lib_name >/dev/null
1772        then
1773          # We have reworked collect2
1774          hardcode_direct=yes
1775        else
1776          # We have old collect2
1777          hardcode_direct=unsupported
1778          # It fails to find uninstalled libraries when the uninstalled
1779          # path is not listed in the libpath.  Setting hardcode_minus_L
1780          # to unsupported forces relinking
1781          hardcode_minus_L=yes
1782          hardcode_libdir_flag_spec='-L$libdir'
1783          hardcode_libdir_separator=
1784        fi
1785      esac
1786
1787      shared_flag='-shared'
1788    else
1789      # not using gcc
1790      if test "$host_cpu" = ia64; then
1791        shared_flag='${wl}-G'
1792      else
1793        if test "$aix_use_runtimelinking" = yes; then
1794          shared_flag='${wl}-G'
1795        else
1796          shared_flag='${wl}-bM:SRE'
1797        fi
1798      fi
1799    fi
1800
1801    # It seems that -bexpall can do strange things, so it is better to
1802    # generate a list of symbols to export.
1803    always_export_symbols=yes
1804    if test "$aix_use_runtimelinking" = yes; then
1805      # Warning - without using the other runtime loading flags (-brtl),
1806      # -berok will link without error, but may produce a broken library.
1807      allow_undefined_flag='-berok'
1808      hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:/usr/lib:/lib'
1809      archive_expsym_cmds="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag"
1810    else
1811      if test "$host_cpu" = ia64; then
1812        hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
1813        allow_undefined_flag="-z nodefs"
1814        archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname ${wl}-h$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
1815      else
1816        hardcode_libdir_flag_spec='${wl}-bnolibpath ${wl}-blibpath:$libdir:/usr/lib:/lib'
1817        # Warning - without using the other run time loading flags,
1818        # -berok will link without error, but may produce a broken library.
1819        allow_undefined_flag='${wl}-berok'
1820        # This is a bit strange, but is similar to how AIX traditionally builds
1821        # it's shared libraries.
1822        archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"' ~$AR -crlo $objdir/$libname$release.a $objdir/$soname'
1823      fi
1824    fi
1825    ;;
1826
1827  amigaos*)
1828    archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
1829    hardcode_libdir_flag_spec='-L$libdir'
1830    hardcode_minus_L=yes
1831    # see comment about different semantics on the GNU ld section
1832    ld_shlibs=no
1833    ;;
1834
1835  cygwin* | mingw* | pw32*)
1836    # When not using gcc, we currently assume that we are using
1837    # Microsoft Visual C++.
1838    # hardcode_libdir_flag_spec is actually meaningless, as there is
1839    # no search path for DLLs.
1840    hardcode_libdir_flag_spec=' '
1841    allow_undefined_flag=unsupported
1842    # Tell ltmain to make .lib files, not .a files.
1843    libext=lib
1844    # FIXME: Setting linknames here is a bad hack.
1845    archive_cmds='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | sed -e '\''s/ -lc$//'\''` -link -dll~linknames='
1846    # The linker will automatically build a .lib file if we build a DLL.
1847    old_archive_from_new_cmds='true'
1848    # FIXME: Should let the user specify the lib program.
1849    old_archive_cmds='lib /OUT:$oldlib$oldobjs$old_deplibs'
1850    fix_srcfile_path='`cygpath -w "$srcfile"`'
1851    ;;
1852
1853  darwin* | rhapsody*)
1854    case "$host_os" in
1855    rhapsody* | darwin1.[[012]])
1856      allow_undefined_flag='-undefined suppress'
1857      ;;
1858    *) # Darwin 1.3 on
1859      allow_undefined_flag='-flat_namespace -undefined suppress'
1860      ;;
1861    esac
1862    # FIXME: Relying on posixy $() will cause problems for
1863    #        cross-compilation, but unfortunately the echo tests do not
1864    #        yet detect zsh echo's removal of \ escapes.
1865    archive_cmds='$nonopt $(test "x$module" = xyes && echo -bundle || echo -dynamiclib) $allow_undefined_flag -o $lib $libobjs $deplibs$linker_flags -install_name $rpath/$soname $verstring'
1866    # We need to add '_' to the symbols in $export_symbols first
1867    #archive_expsym_cmds="$archive_cmds"' && strip -s $export_symbols'
1868    hardcode_direct=yes
1869    hardcode_shlibpath_var=no
1870    whole_archive_flag_spec='-all_load $convenience'
1871    ;;
1872
1873  freebsd1*)
1874    ld_shlibs=no
1875    ;;
1876
1877  # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
1878  # support.  Future versions do this automatically, but an explicit c++rt0.o
1879  # does not break anything, and helps significantly (at the cost of a little
1880  # extra space).
1881  freebsd2.2*)
1882    archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
1883    hardcode_libdir_flag_spec='-R$libdir'
1884    hardcode_direct=yes
1885    hardcode_shlibpath_var=no
1886    ;;
1887
1888  # Unfortunately, older versions of FreeBSD 2 do not have this feature.
1889  freebsd2*)
1890    archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
1891    hardcode_direct=yes
1892    hardcode_minus_L=yes
1893    hardcode_shlibpath_var=no
1894    ;;
1895
1896  # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
1897  freebsd*)
1898    archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
1899    hardcode_libdir_flag_spec='-R$libdir'
1900    hardcode_direct=yes
1901    hardcode_shlibpath_var=no
1902    ;;
1903
1904  hpux9* | hpux10* | hpux11*)
1905    case $host_os in
1906    hpux9*) archive_cmds='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' ;;
1907    *) archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' ;;
1908    esac
1909    hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
1910    hardcode_libdir_separator=:
1911    hardcode_direct=yes
1912    hardcode_minus_L=yes # Not in the search PATH, but as the default
1913                         # location of the library.
1914    export_dynamic_flag_spec='${wl}-E'
1915    ;;
1916
1917  irix5* | irix6*)
1918    if test "$GCC" = yes; then
1919      archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
1920    else
1921      archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
1922    fi
1923    hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
1924    hardcode_libdir_separator=:
1925    link_all_deplibs=yes
1926    ;;
1927
1928  netbsd*)
1929    if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
1930      archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
1931    else
1932      archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
1933    fi
1934    hardcode_libdir_flag_spec='-R$libdir'
1935    hardcode_direct=yes
1936    hardcode_shlibpath_var=no
1937    ;;
1938
1939  newsos6)
1940    archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
1941    hardcode_direct=yes
1942    hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
1943    hardcode_libdir_separator=:
1944    hardcode_shlibpath_var=no
1945    ;;
1946
1947  openbsd*)
1948    hardcode_direct=yes
1949    hardcode_shlibpath_var=no
1950    if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
1951      archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $linker_flags'
1952      hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
1953      export_dynamic_flag_spec='${wl}-E'
1954    else
1955      case "$host_os" in
1956      openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
1957        archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
1958        hardcode_libdir_flag_spec='-R$libdir'
1959        ;;
1960      *)
1961        archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $linker_flags'
1962        hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
1963        ;;
1964      esac
1965    fi
1966    ;;
1967
1968  os2*)
1969    hardcode_libdir_flag_spec='-L$libdir'
1970    hardcode_minus_L=yes
1971    allow_undefined_flag=unsupported
1972    archive_cmds='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
1973    old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
1974    ;;
1975
1976  osf3*)
1977    if test "$GCC" = yes; then
1978      allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
1979      archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
1980    else
1981      allow_undefined_flag=' -expect_unresolved \*'
1982      archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
1983    fi
1984    hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
1985    hardcode_libdir_separator=:
1986    ;;
1987
1988  osf4* | osf5*)        # as osf3* with the addition of -msym flag
1989    if test "$GCC" = yes; then
1990      allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
1991      archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
1992      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
1993    else
1994      allow_undefined_flag=' -expect_unresolved \*'
1995      archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
1996      archive_expsym_cmds='for i in `cat $export_symbols`; do printf "-exported_symbol " >> $lib.exp; echo "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
1997      $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib~$rm $lib.exp'
1998
1999      #Both c and cxx compiler support -rpath directly
2000      hardcode_libdir_flag_spec='-rpath $libdir'
2001    fi
2002    hardcode_libdir_separator=:
2003    ;;
2004
2005  sco3.2v5*)
2006    archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
2007    hardcode_shlibpath_var=no
2008    runpath_var=LD_RUN_PATH
2009    hardcode_runpath_var=yes
2010    export_dynamic_flag_spec='${wl}-Bexport'
2011    ;;
2012
2013  solaris*)
2014    no_undefined_flag=' -z defs'
2015    # $CC -shared without GNU ld will not create a library from C++
2016    # object files and a static libstdc++, better avoid it by now
2017    archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
2018    archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
2019                $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
2020    hardcode_libdir_flag_spec='-R$libdir'
2021    hardcode_shlibpath_var=no
2022    case $host_os in
2023    [solaris2.[0-5] | solaris2.[0-5].*]) ;;
2024    *) # Supported since Solaris 2.6 (maybe 2.5.1?)
2025      whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;;
2026    esac
2027    link_all_deplibs=yes
2028    ;;
2029
2030  sunos4*)
2031    if test "x$host_vendor" = xsequent; then
2032      # Use $CC to link under sequent, because it throws in some extra .o
2033      # files that make .init and .fini sections work.
2034      archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
2035    else
2036      archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
2037    fi
2038    hardcode_libdir_flag_spec='-L$libdir'
2039    hardcode_direct=yes
2040    hardcode_minus_L=yes
2041    hardcode_shlibpath_var=no
2042    ;;
2043
2044  sysv4)
2045    if test "x$host_vendor" = xsno; then
2046      archive_cmds='$LD -G -Bsymbolic -h $soname -o $lib $libobjs $deplibs $linker_flags'
2047      hardcode_direct=yes # is this really true???
2048    else
2049      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
2050      hardcode_direct=no #Motorola manual says yes, but my tests say they lie
2051    fi
2052    runpath_var='LD_RUN_PATH'
2053    hardcode_shlibpath_var=no
2054    ;;
2055
2056  sysv4.3*)
2057    archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
2058    hardcode_shlibpath_var=no
2059    export_dynamic_flag_spec='-Bexport'
2060    ;;
2061
2062  sysv5*)
2063    no_undefined_flag=' -z text'
2064    # $CC -shared without GNU ld will not create a library from C++
2065    # object files and a static libstdc++, better avoid it by now
2066    archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
2067    archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
2068                $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
2069    hardcode_libdir_flag_spec=
2070    hardcode_shlibpath_var=no
2071    runpath_var='LD_RUN_PATH'
2072    ;;
2073
2074  uts4*)
2075    archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
2076    hardcode_libdir_flag_spec='-L$libdir'
2077    hardcode_shlibpath_var=no
2078    ;;
2079
2080  dgux*)
2081    archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
2082    hardcode_libdir_flag_spec='-L$libdir'
2083    hardcode_shlibpath_var=no
2084    ;;
2085
2086  sysv4*MP*)
2087    if test -d /usr/nec; then
2088      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
2089      hardcode_shlibpath_var=no
2090      runpath_var=LD_RUN_PATH
2091      hardcode_runpath_var=yes
2092      ld_shlibs=yes
2093    fi
2094    ;;
2095
2096  sysv4.2uw2*)
2097    archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags'
2098    hardcode_direct=yes
2099    hardcode_minus_L=no
2100    hardcode_shlibpath_var=no
2101    hardcode_runpath_var=yes
2102    runpath_var=LD_RUN_PATH
2103    ;;
2104
2105  sysv5uw7* | unixware7*)
2106    no_undefined_flag='${wl}-z ${wl}text'
2107    if test "$GCC" = yes; then
2108      archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
2109    else
2110      archive_cmds='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
2111    fi
2112    runpath_var='LD_RUN_PATH'
2113    hardcode_shlibpath_var=no
2114    ;;
2115
2116  *)
2117    ld_shlibs=no
2118    ;;
2119  esac
2120fi
2121AC_MSG_RESULT([$ld_shlibs])
2122test "$ld_shlibs" = no && can_build_shared=no
2123
2124# Check hardcoding attributes.
2125AC_MSG_CHECKING([how to hardcode library paths into programs])
2126hardcode_action=
2127if test -n "$hardcode_libdir_flag_spec" || \
2128   test -n "$runpath_var"; then
2129
2130  # We can hardcode non-existant directories.
2131  if test "$hardcode_direct" != no &&
2132     # If the only mechanism to avoid hardcoding is shlibpath_var, we
2133     # have to relink, otherwise we might link with an installed library
2134     # when we should be linking with a yet-to-be-installed one
2135     ## test "$hardcode_shlibpath_var" != no &&
2136     test "$hardcode_minus_L" != no; then
2137    # Linking always hardcodes the temporary library directory.
2138    hardcode_action=relink
2139  else
2140    # We can link without hardcoding, and we can hardcode nonexisting dirs.
2141    hardcode_action=immediate
2142  fi
2143else
2144  # We cannot hardcode anything, or else we can only hardcode existing
2145  # directories.
2146  hardcode_action=unsupported
2147fi
2148AC_MSG_RESULT([$hardcode_action])
2149
2150striplib=
2151old_striplib=
2152AC_MSG_CHECKING([whether stripping libraries is possible])
2153if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then
2154  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
2155  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
2156  AC_MSG_RESULT([yes])
2157else
2158  AC_MSG_RESULT([no])
2159fi
2160
2161reload_cmds='$LD$reload_flag -o $output$reload_objs'
2162test -z "$deplibs_check_method" && deplibs_check_method=unknown
2163
2164# PORTME Fill in your ld.so characteristics
2165AC_MSG_CHECKING([dynamic linker characteristics])
2166library_names_spec=
2167libname_spec='lib$name'
2168soname_spec=
2169postinstall_cmds=
2170postuninstall_cmds=
2171finish_cmds=
2172finish_eval=
2173shlibpath_var=
2174shlibpath_overrides_runpath=unknown
2175version_type=none
2176dynamic_linker="$host_os ld.so"
2177sys_lib_dlsearch_path_spec="/lib /usr/lib"
2178sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
2179
2180case $host_os in
2181aix3*)
2182  version_type=linux
2183  library_names_spec='${libname}${release}.so$versuffix $libname.a'
2184  shlibpath_var=LIBPATH
2185
2186  # AIX has no versioning support, so we append a major version to the name.
2187  soname_spec='${libname}${release}.so$major'
2188  ;;
2189
2190aix4* | aix5*)
2191  version_type=linux
2192  if test "$host_cpu" = ia64; then
2193    # AIX 5 supports IA64
2194    library_names_spec='${libname}${release}.so$major ${libname}${release}.so$versuffix $libname.so'
2195    shlibpath_var=LD_LIBRARY_PATH
2196  else
2197    # With GCC up to 2.95.x, collect2 would create an import file
2198    # for dependence libraries.  The import file would start with
2199    # the line `#! .'.  This would cause the generated library to
2200    # depend on `.', always an invalid library.  This was fixed in
2201    # development snapshots of GCC prior to 3.0.
2202    case $host_os in
2203      [ aix4 | aix4.[01] | aix4.[01].*)]
2204      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
2205           echo ' yes '
2206           echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
2207        :
2208      else
2209        can_build_shared=no
2210      fi
2211      ;;
2212    esac
2213    # AIX (on Power*) has no versioning support, so currently we can
2214    # not hardcode correct soname into executable. Probably we can
2215    # add versioning support to collect2, so additional links can
2216    # be useful in future.
2217    if test "$aix_use_runtimelinking" = yes; then
2218      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
2219      # instead of lib<name>.a to let people know that these are not
2220      # typical AIX shared libraries.
2221      library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
2222    else
2223      # We preserve .a as extension for shared libraries through AIX4.2
2224      # and later when we are not doing run time linking.
2225      library_names_spec='${libname}${release}.a $libname.a'
2226      soname_spec='${libname}${release}.so$major'
2227    fi
2228    shlibpath_var=LIBPATH
2229  fi
2230  ;;
2231
2232amigaos*)
2233  library_names_spec='$libname.ixlibrary $libname.a'
2234  # Create ${libname}_ixlibrary.a entries in /sys/libs.
2235  finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | [$Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\'']`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "(cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a)"; (cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a) || exit 1; done'
2236  ;;
2237
2238beos*)
2239  library_names_spec='${libname}.so'
2240  dynamic_linker="$host_os ld.so"
2241  shlibpath_var=LIBRARY_PATH
2242  ;;
2243
2244bsdi4*)
2245  version_type=linux
2246  need_version=no
2247  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
2248  soname_spec='${libname}${release}.so$major'
2249  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
2250  shlibpath_var=LD_LIBRARY_PATH
2251  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
2252  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
2253  export_dynamic_flag_spec=-rdynamic
2254  # the default ld.so.conf also contains /usr/contrib/lib and
2255  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
2256  # libtool to hard-code these into programs
2257  ;;
2258
2259cygwin* | mingw* | pw32*)
2260  version_type=windows
2261  need_version=no
2262  need_lib_prefix=no
2263  case $GCC,$host_os in
2264  yes,cygwin*)
2265    library_names_spec='$libname.dll.a'
2266    soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | [sed -e 's/[.]/-/g']`${versuffix}.dll'
2267    postinstall_cmds='dlpath=`bash 2>&1 -c '\''. $dir/${file}i;echo \$dlname'\''`~
2268      dldir=$destdir/`dirname \$dlpath`~
2269      test -d \$dldir || mkdir -p \$dldir~
2270      $install_prog .libs/$dlname \$dldir/$dlname'
2271    postuninstall_cmds='dldll=`bash 2>&1 -c '\''. $file; echo \$dlname'\''`~
2272      dlpath=$dir/\$dldll~
2273       $rm \$dlpath'
2274    ;;
2275  yes,mingw*)
2276    library_names_spec='${libname}`echo ${release} | [sed -e 's/[.]/-/g']`${versuffix}.dll'
2277    sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | sed -e "s/^libraries://" -e "s/;/ /g"`
2278    ;;
2279  yes,pw32*)
2280    library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll'
2281    ;;
2282  *)
2283    library_names_spec='${libname}`echo ${release} | [sed -e 's/[.]/-/g']`${versuffix}.dll $libname.lib'
2284    ;;
2285  esac
2286  dynamic_linker='Win32 ld.exe'
2287  # FIXME: first we should search . and the directory the executable is in
2288  shlibpath_var=PATH
2289  ;;
2290
2291darwin* | rhapsody*)
2292  dynamic_linker="$host_os dyld"
2293  version_type=darwin
2294  need_lib_prefix=no
2295  need_version=no
2296  # FIXME: Relying on posixy $() will cause problems for
2297  #        cross-compilation, but unfortunately the echo tests do not
2298  #        yet detect zsh echo's removal of \ escapes.
2299  library_names_spec='${libname}${release}${versuffix}.$(test .$module = .yes && echo so || echo dylib) ${libname}${release}${major}.$(test .$module = .yes && echo so || echo dylib) ${libname}.$(test .$module = .yes && echo so || echo dylib)'
2300  soname_spec='${libname}${release}${major}.$(test .$module = .yes && echo so || echo dylib)'
2301  shlibpath_overrides_runpath=yes
2302  shlibpath_var=DYLD_LIBRARY_PATH
2303  ;;
2304
2305freebsd1*)
2306  dynamic_linker=no
2307  ;;
2308
2309freebsd*)
2310  objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
2311  version_type=freebsd-$objformat
2312  case $version_type in
2313    freebsd-elf*)
2314      library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so'
2315      need_version=no
2316      need_lib_prefix=no
2317      ;;
2318    freebsd-*)
2319      library_names_spec='${libname}${release}.so$versuffix $libname.so$versuffix'
2320      need_version=yes
2321      ;;
2322  esac
2323  shlibpath_var=LD_LIBRARY_PATH
2324  case $host_os in
2325  freebsd2*)
2326    shlibpath_overrides_runpath=yes
2327    ;;
2328  *)
2329    shlibpath_overrides_runpath=no
2330    hardcode_into_libs=yes
2331    ;;
2332  esac
2333  ;;
2334
2335gnu*)
2336  version_type=linux
2337  need_lib_prefix=no
2338  need_version=no
2339  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so${major} ${libname}.so'
2340  soname_spec='${libname}${release}.so$major'
2341  shlibpath_var=LD_LIBRARY_PATH
2342  hardcode_into_libs=yes
2343  ;;
2344
2345hpux9* | hpux10* | hpux11*)
2346  # Give a soname corresponding to the major version so that dld.sl refuses to
2347  # link against other versions.
2348  dynamic_linker="$host_os dld.sl"
2349  version_type=sunos
2350  need_lib_prefix=no
2351  need_version=no
2352  shlibpath_var=SHLIB_PATH
2353  shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
2354  library_names_spec='${libname}${release}.sl$versuffix ${libname}${release}.sl$major $libname.sl'
2355  soname_spec='${libname}${release}.sl$major'
2356  # HP-UX runs *really* slowly unless shared libraries are mode 555.
2357  postinstall_cmds='chmod 555 $lib'
2358  ;;
2359
2360irix5* | irix6*)
2361  version_type=irix
2362  need_lib_prefix=no
2363  need_version=no
2364  soname_spec='${libname}${release}.so$major'
2365  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so $libname.so'
2366  case $host_os in
2367  irix5*)
2368    libsuff= shlibsuff=
2369    ;;
2370  *)
2371    case $LD in # libtool.m4 will add one of these switches to LD
2372    *-32|*"-32 ") libsuff= shlibsuff= libmagic=32-bit;;
2373    *-n32|*"-n32 ") libsuff=32 shlibsuff=N32 libmagic=N32;;
2374    *-64|*"-64 ") libsuff=64 shlibsuff=64 libmagic=64-bit;;
2375    *) libsuff= shlibsuff= libmagic=never-match;;
2376    esac
2377    ;;
2378  esac
2379  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
2380  shlibpath_overrides_runpath=no
2381  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
2382  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
2383  ;;
2384
2385# No shared lib support for Linux oldld, aout, or coff.
2386linux-gnuoldld* | linux-gnuaout* | linux-gnucoff*)
2387  dynamic_linker=no
2388  ;;
2389
2390# This must be Linux ELF.
2391linux-gnu*)
2392  version_type=linux
2393  need_lib_prefix=no
2394  need_version=no
2395  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
2396  soname_spec='${libname}${release}.so$major'
2397  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
2398  shlibpath_var=LD_LIBRARY_PATH
2399  shlibpath_overrides_runpath=no
2400  # This implies no fast_install, which is unacceptable.
2401  # Some rework will be needed to allow for fast_install
2402  # before this can be enabled.
2403  hardcode_into_libs=yes
2404
2405  # We used to test for /lib/ld.so.1 and disable shared libraries on
2406  # powerpc, because MkLinux only supported shared libraries with the
2407  # GNU dynamic linker.  Since this was broken with cross compilers,
2408  # most powerpc-linux boxes support dynamic linking these days and
2409  # people can always --disable-shared, the test was removed, and we
2410  # assume the GNU/Linux dynamic linker is in use.
2411  dynamic_linker='GNU/Linux ld.so'
2412  ;;
2413
2414netbsd*)
2415  version_type=sunos
2416  need_lib_prefix=no
2417  need_version=no
2418  if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
2419    library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
2420    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
2421    dynamic_linker='NetBSD (a.out) ld.so'
2422  else
2423    library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so ${libname}.so'
2424    soname_spec='${libname}${release}.so$major'
2425    dynamic_linker='NetBSD ld.elf_so'
2426  fi
2427  shlibpath_var=LD_LIBRARY_PATH
2428  shlibpath_overrides_runpath=yes
2429  hardcode_into_libs=yes
2430  ;;
2431
2432newsos6)
2433  version_type=linux
2434  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
2435  shlibpath_var=LD_LIBRARY_PATH
2436  shlibpath_overrides_runpath=yes
2437  ;;
2438
2439openbsd*)
2440  version_type=sunos
2441  need_lib_prefix=no
2442  need_version=no
2443  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
2444    case "$host_os" in
2445    openbsd2.[[89]] | openbsd2.[[89]].*)
2446      shlibpath_overrides_runpath=no
2447      ;;
2448    *)
2449      shlibpath_overrides_runpath=yes
2450      ;;
2451    esac
2452  else
2453    shlibpath_overrides_runpath=yes
2454  fi
2455  library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
2456  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
2457  shlibpath_var=LD_LIBRARY_PATH
2458  ;;
2459
2460os2*)
2461  libname_spec='$name'
2462  need_lib_prefix=no
2463  library_names_spec='$libname.dll $libname.a'
2464  dynamic_linker='OS/2 ld.exe'
2465  shlibpath_var=LIBPATH
2466  ;;
2467
2468osf3* | osf4* | osf5*)
2469  version_type=osf
2470  need_version=no
2471  soname_spec='${libname}${release}.so'
2472  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so'
2473  shlibpath_var=LD_LIBRARY_PATH
2474  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
2475  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
2476  ;;
2477
2478sco3.2v5*)
2479  version_type=osf
2480  soname_spec='${libname}${release}.so$major'
2481  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
2482  shlibpath_var=LD_LIBRARY_PATH
2483  ;;
2484
2485solaris*)
2486  version_type=linux
2487  need_lib_prefix=no
2488  need_version=no
2489  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
2490  soname_spec='${libname}${release}.so$major'
2491  shlibpath_var=LD_LIBRARY_PATH
2492  shlibpath_overrides_runpath=yes
2493  hardcode_into_libs=yes
2494  # ldd complains unless libraries are executable
2495  postinstall_cmds='chmod +x $lib'
2496  ;;
2497
2498sunos4*)
2499  version_type=sunos
2500  library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
2501  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
2502  shlibpath_var=LD_LIBRARY_PATH
2503  shlibpath_overrides_runpath=yes
2504  if test "$with_gnu_ld" = yes; then
2505    need_lib_prefix=no
2506  fi
2507  need_version=yes
2508  ;;
2509
2510sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
2511  version_type=linux
2512  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
2513  soname_spec='${libname}${release}.so$major'
2514  shlibpath_var=LD_LIBRARY_PATH
2515  case $host_vendor in
2516    sni)
2517      shlibpath_overrides_runpath=no
2518      ;;
2519    motorola)
2520      need_lib_prefix=no
2521      need_version=no
2522      shlibpath_overrides_runpath=no
2523      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
2524      ;;
2525  esac
2526  ;;
2527
2528uts4*)
2529  version_type=linux
2530  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
2531  soname_spec='${libname}${release}.so$major'
2532  shlibpath_var=LD_LIBRARY_PATH
2533  ;;
2534
2535dgux*)
2536  version_type=linux
2537  need_lib_prefix=no
2538  need_version=no
2539  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
2540  soname_spec='${libname}${release}.so$major'
2541  shlibpath_var=LD_LIBRARY_PATH
2542  ;;
2543
2544sysv4*MP*)
2545  if test -d /usr/nec ;then
2546    version_type=linux
2547    library_names_spec='$libname.so.$versuffix $libname.so.$major $libname.so'
2548    soname_spec='$libname.so.$major'
2549    shlibpath_var=LD_LIBRARY_PATH
2550  fi
2551  ;;
2552
2553*)
2554  dynamic_linker=no
2555  ;;
2556esac
2557AC_MSG_RESULT([$dynamic_linker])
2558test "$dynamic_linker" = no && can_build_shared=no
2559
2560# Report the final consequences.
2561AC_MSG_CHECKING([if libtool supports shared libraries])
2562AC_MSG_RESULT([$can_build_shared])
2563
2564AC_MSG_CHECKING([whether to build shared libraries])
2565test "$can_build_shared" = "no" && enable_shared=no
2566
2567# On AIX, shared libraries and static libraries use the same namespace, and
2568# are all built from PIC.
2569case "$host_os" in
2570aix3*)
2571  test "$enable_shared" = yes && enable_static=no
2572  if test -n "$RANLIB"; then
2573    archive_cmds="$archive_cmds~\$RANLIB \$lib"
2574    postinstall_cmds='$RANLIB $lib'
2575  fi
2576  ;;
2577
2578aix4*)
2579  if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
2580    test "$enable_shared" = yes && enable_static=no
2581  fi
2582  ;;
2583esac
2584AC_MSG_RESULT([$enable_shared])
2585
2586AC_MSG_CHECKING([whether to build static libraries])
2587# Make sure either enable_shared or enable_static is yes.
2588test "$enable_shared" = yes || enable_static=yes
2589AC_MSG_RESULT([$enable_static])
2590
2591if test "$hardcode_action" = relink; then
2592  # Fast installation is not supported
2593  enable_fast_install=no
2594elif test "$shlibpath_overrides_runpath" = yes ||
2595     test "$enable_shared" = no; then
2596  # Fast installation is not necessary
2597  enable_fast_install=needless
2598fi
2599
2600variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
2601if test "$GCC" = yes; then
2602  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
2603fi
2604
2605AC_LIBTOOL_DLOPEN_SELF
2606
2607if test "$enable_shared" = yes && test "$GCC" = yes; then
2608  case $archive_cmds in
2609  *'~'*)
2610    # FIXME: we may have to deal with multi-command sequences.
2611    ;;
2612  '$CC '*)
2613    # Test whether the compiler implicitly links with -lc since on some
2614    # systems, -lgcc has to come before -lc. If gcc already passes -lc
2615    # to ld, don't add -lc before -lgcc.
2616    AC_MSG_CHECKING([whether -lc should be explicitly linked in])
2617    AC_CACHE_VAL([lt_cv_archive_cmds_need_lc],
2618    [$rm conftest*
2619    echo 'static int dummy;' > conftest.$ac_ext
2620
2621    if AC_TRY_EVAL(ac_compile); then
2622      soname=conftest
2623      lib=conftest
2624      libobjs=conftest.$ac_objext
2625      deplibs=
2626      wl=$lt_cv_prog_cc_wl
2627      compiler_flags=-v
2628      linker_flags=-v
2629      verstring=
2630      output_objdir=.
2631      libname=conftest
2632      save_allow_undefined_flag=$allow_undefined_flag
2633      allow_undefined_flag=
2634      if AC_TRY_EVAL(archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1)
2635      then
2636        lt_cv_archive_cmds_need_lc=no
2637      else
2638        lt_cv_archive_cmds_need_lc=yes
2639      fi
2640      allow_undefined_flag=$save_allow_undefined_flag
2641    else
2642      cat conftest.err 1>&5
2643    fi])
2644    AC_MSG_RESULT([$lt_cv_archive_cmds_need_lc])
2645    ;;
2646  esac
2647fi
2648need_lc=${lt_cv_archive_cmds_need_lc-yes}
2649
2650# The second clause should only fire when bootstrapping the
2651# libtool distribution, otherwise you forgot to ship ltmain.sh
2652# with your package, and you will get complaints that there are
2653# no rules to generate ltmain.sh.
2654if test -f "$ltmain"; then
2655  :
2656else
2657  # If there is no Makefile yet, we rely on a make rule to execute
2658  # `config.status --recheck' to rerun these tests and create the
2659  # libtool script then.
2660  test -f Makefile && make "$ltmain"
2661fi
2662
2663if test -f "$ltmain"; then
2664  trap "$rm \"${ofile}T\"; exit 1" 1 2 15
2665  $rm -f "${ofile}T"
2666
2667  echo creating $ofile
2668
2669  # Now quote all the things that may contain metacharacters while being
2670  # careful not to overquote the AC_SUBSTed values.  We take copies of the
2671  # variables and quote the copies for generation of the libtool script.
2672  for var in echo old_CC old_CFLAGS \
2673    AR AR_FLAGS CC LD LN_S NM SHELL \
2674    reload_flag reload_cmds wl \
2675    pic_flag link_static_flag no_builtin_flag export_dynamic_flag_spec \
2676    thread_safe_flag_spec whole_archive_flag_spec libname_spec \
2677    library_names_spec soname_spec \
2678    RANLIB old_archive_cmds old_archive_from_new_cmds old_postinstall_cmds \
2679    old_postuninstall_cmds archive_cmds archive_expsym_cmds postinstall_cmds \
2680    postuninstall_cmds extract_expsyms_cmds old_archive_from_expsyms_cmds \
2681    old_striplib striplib file_magic_cmd export_symbols_cmds \
2682    deplibs_check_method allow_undefined_flag no_undefined_flag \
2683    finish_cmds finish_eval global_symbol_pipe global_symbol_to_cdecl \
2684    global_symbol_to_c_name_address \
2685    hardcode_libdir_flag_spec hardcode_libdir_separator  \
2686    sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
2687    compiler_c_o compiler_o_lo need_locks exclude_expsyms include_expsyms; do
2688
2689    case $var in
2690    reload_cmds | old_archive_cmds | old_archive_from_new_cmds | \
2691    old_postinstall_cmds | old_postuninstall_cmds | \
2692    export_symbols_cmds | archive_cmds | archive_expsym_cmds | \
2693    extract_expsyms_cmds | old_archive_from_expsyms_cmds | \
2694    postinstall_cmds | postuninstall_cmds | \
2695    finish_cmds | sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
2696      # Double-quote double-evaled strings.
2697      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
2698      ;;
2699    *)
2700      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
2701      ;;
2702    esac
2703  done
2704
2705  cat <<__EOF__ > "${ofile}T"
2706#! $SHELL
2707
2708# `$echo "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
2709# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)
2710# NOTE: Changes made to this file will be lost: look at ltmain.sh.
2711#
2712# Copyright (C) 1996-2000 Free Software Foundation, Inc.
2713# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
2714#
2715# This program is free software; you can redistribute it and/or modify
2716# it under the terms of the GNU General Public License as published by
2717# the Free Software Foundation; either version 2 of the License, or
2718# (at your option) any later version.
2719#
2720# This program is distributed in the hope that it will be useful, but
2721# WITHOUT ANY WARRANTY; without even the implied warranty of
2722# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
2723# General Public License for more details.
2724#
2725# You should have received a copy of the GNU General Public License
2726# along with this program; if not, write to the Free Software
2727# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
2728#
2729# As a special exception to the GNU General Public License, if you
2730# distribute this file as part of a program that contains a
2731# configuration script generated by Autoconf, you may include it under
2732# the same distribution terms that you use for the rest of that program.
2733
2734# Sed that helps us avoid accidentally triggering echo(1) options like -n.
2735Xsed="sed -e s/^X//"
2736
2737# The HP-UX ksh and POSIX shell print the target directory to stdout
2738# if CDPATH is set.
2739if test "X\${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
2740
2741# ### BEGIN LIBTOOL CONFIG
2742
2743# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
2744
2745# Shell to use when invoking shell scripts.
2746SHELL=$lt_SHELL
2747
2748# Whether or not to build shared libraries.
2749build_libtool_libs=$enable_shared
2750
2751# Whether or not to build static libraries.
2752build_old_libs=$enable_static
2753
2754# Whether or not to add -lc for building shared libraries.
2755build_libtool_need_lc=$need_lc
2756
2757# Whether or not to optimize for fast installation.
2758fast_install=$enable_fast_install
2759
2760# The host system.
2761host_alias=$host_alias
2762host=$host
2763
2764# An echo program that does not interpret backslashes.
2765echo=$lt_echo
2766
2767# The archiver.
2768AR=$lt_AR
2769AR_FLAGS=$lt_AR_FLAGS
2770
2771# The default C compiler.
2772CC=$lt_CC
2773
2774# Is the compiler the GNU C compiler?
2775with_gcc=$GCC
2776
2777# The linker used to build libraries.
2778LD=$lt_LD
2779
2780# Whether we need hard or soft links.
2781LN_S=$lt_LN_S
2782
2783# A BSD-compatible nm program.
2784NM=$lt_NM
2785
2786# A symbol stripping program
2787STRIP=$STRIP
2788
2789# Used to examine libraries when file_magic_cmd begins "file"
2790MAGIC_CMD=$MAGIC_CMD
2791
2792# Used on cygwin: DLL creation program.
2793DLLTOOL="$DLLTOOL"
2794
2795# Used on cygwin: object dumper.
2796OBJDUMP="$OBJDUMP"
2797
2798# Used on cygwin: assembler.
2799AS="$AS"
2800
2801# The name of the directory that contains temporary libtool files.
2802objdir=$objdir
2803
2804# How to create reloadable object files.
2805reload_flag=$lt_reload_flag
2806reload_cmds=$lt_reload_cmds
2807
2808# How to pass a linker flag through the compiler.
2809wl=$lt_wl
2810
2811# Object file suffix (normally "o").
2812objext="$ac_objext"
2813
2814# Old archive suffix (normally "a").
2815libext="$libext"
2816
2817# Executable file suffix (normally "").
2818exeext="$exeext"
2819
2820# Additional compiler flags for building library objects.
2821pic_flag=$lt_pic_flag
2822pic_mode=$pic_mode
2823
2824# Does compiler simultaneously support -c and -o options?
2825compiler_c_o=$lt_compiler_c_o
2826
2827# Can we write directly to a .lo ?
2828compiler_o_lo=$lt_compiler_o_lo
2829
2830# Must we lock files when doing compilation ?
2831need_locks=$lt_need_locks
2832
2833# Do we need the lib prefix for modules?
2834need_lib_prefix=$need_lib_prefix
2835
2836# Do we need a version for libraries?
2837need_version=$need_version
2838
2839# Whether dlopen is supported.
2840dlopen_support=$enable_dlopen
2841
2842# Whether dlopen of programs is supported.
2843dlopen_self=$enable_dlopen_self
2844
2845# Whether dlopen of statically linked programs is supported.
2846dlopen_self_static=$enable_dlopen_self_static
2847
2848# Compiler flag to prevent dynamic linking.
2849link_static_flag=$lt_link_static_flag
2850
2851# Compiler flag to turn off builtin functions.
2852no_builtin_flag=$lt_no_builtin_flag
2853
2854# Compiler flag to allow reflexive dlopens.
2855export_dynamic_flag_spec=$lt_export_dynamic_flag_spec
2856
2857# Compiler flag to generate shared objects directly from archives.
2858whole_archive_flag_spec=$lt_whole_archive_flag_spec
2859
2860# Compiler flag to generate thread-safe objects.
2861thread_safe_flag_spec=$lt_thread_safe_flag_spec
2862
2863# Library versioning type.
2864version_type=$version_type
2865
2866# Format of library name prefix.
2867libname_spec=$lt_libname_spec
2868
2869# List of archive names.  First name is the real one, the rest are links.
2870# The last name is the one that the linker finds with -lNAME.
2871library_names_spec=$lt_library_names_spec
2872
2873# The coded name of the library, if different from the real name.
2874soname_spec=$lt_soname_spec
2875
2876# Commands used to build and install an old-style archive.
2877RANLIB=$lt_RANLIB
2878old_archive_cmds=$lt_old_archive_cmds
2879old_postinstall_cmds=$lt_old_postinstall_cmds
2880old_postuninstall_cmds=$lt_old_postuninstall_cmds
2881
2882# Create an old-style archive from a shared archive.
2883old_archive_from_new_cmds=$lt_old_archive_from_new_cmds
2884
2885# Create a temporary old-style archive to link instead of a shared archive.
2886old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds
2887
2888# Commands used to build and install a shared archive.
2889archive_cmds=$lt_archive_cmds
2890archive_expsym_cmds=$lt_archive_expsym_cmds
2891postinstall_cmds=$lt_postinstall_cmds
2892postuninstall_cmds=$lt_postuninstall_cmds
2893
2894# Commands to strip libraries.
2895old_striplib=$lt_old_striplib
2896striplib=$lt_striplib
2897
2898# Method to check whether dependent libraries are shared objects.
2899deplibs_check_method=$lt_deplibs_check_method
2900
2901# Command to use when deplibs_check_method == file_magic.
2902file_magic_cmd=$lt_file_magic_cmd
2903
2904# Flag that allows shared libraries with undefined symbols to be built.
2905allow_undefined_flag=$lt_allow_undefined_flag
2906
2907# Flag that forces no undefined symbols.
2908no_undefined_flag=$lt_no_undefined_flag
2909
2910# Commands used to finish a libtool library installation in a directory.
2911finish_cmds=$lt_finish_cmds
2912
2913# Same as above, but a single script fragment to be evaled but not shown.
2914finish_eval=$lt_finish_eval
2915
2916# Take the output of nm and produce a listing of raw symbols and C names.
2917global_symbol_pipe=$lt_global_symbol_pipe
2918
2919# Transform the output of nm in a proper C declaration
2920global_symbol_to_cdecl=$lt_global_symbol_to_cdecl
2921
2922# Transform the output of nm in a C name address pair
2923global_symbol_to_c_name_address=$lt_global_symbol_to_c_name_address
2924
2925# This is the shared library runtime path variable.
2926runpath_var=$runpath_var
2927
2928# This is the shared library path variable.
2929shlibpath_var=$shlibpath_var
2930
2931# Is shlibpath searched before the hard-coded library search path?
2932shlibpath_overrides_runpath=$shlibpath_overrides_runpath
2933
2934# How to hardcode a shared library path into an executable.
2935hardcode_action=$hardcode_action
2936
2937# Whether we should hardcode library paths into libraries.
2938hardcode_into_libs=$hardcode_into_libs
2939
2940# Flag to hardcode \$libdir into a binary during linking.
2941# This must work even if \$libdir does not exist.
2942hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec
2943
2944# Whether we need a single -rpath flag with a separated argument.
2945hardcode_libdir_separator=$lt_hardcode_libdir_separator
2946
2947# Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the
2948# resulting binary.
2949hardcode_direct=$hardcode_direct
2950
2951# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
2952# resulting binary.
2953hardcode_minus_L=$hardcode_minus_L
2954
2955# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
2956# the resulting binary.
2957hardcode_shlibpath_var=$hardcode_shlibpath_var
2958
2959# Variables whose values should be saved in libtool wrapper scripts and
2960# restored at relink time.
2961variables_saved_for_relink="$variables_saved_for_relink"
2962
2963# Whether libtool must link a program against all its dependency libraries.
2964link_all_deplibs=$link_all_deplibs
2965
2966# Compile-time system search path for libraries
2967sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
2968
2969# Run-time system search path for libraries
2970sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
2971
2972# Fix the shell variable \$srcfile for the compiler.
2973fix_srcfile_path="$fix_srcfile_path"
2974
2975# Set to yes if exported symbols are required.
2976always_export_symbols=$always_export_symbols
2977
2978# The commands to list exported symbols.
2979export_symbols_cmds=$lt_export_symbols_cmds
2980
2981# The commands to extract the exported symbol list from a shared archive.
2982extract_expsyms_cmds=$lt_extract_expsyms_cmds
2983
2984# Symbols that should not be listed in the preloaded symbols.
2985exclude_expsyms=$lt_exclude_expsyms
2986
2987# Symbols that must always be exported.
2988include_expsyms=$lt_include_expsyms
2989
2990# ### END LIBTOOL CONFIG
2991
2992__EOF__
2993
2994  case $host_os in
2995  aix3*)
2996    cat <<\EOF >> "${ofile}T"
2997
2998# AIX sometimes has problems with the GCC collect2 program.  For some
2999# reason, if we set the COLLECT_NAMES environment variable, the problems
3000# vanish in a puff of smoke.
3001if test "X${COLLECT_NAMES+set}" != Xset; then
3002  COLLECT_NAMES=
3003  export COLLECT_NAMES
3004fi
3005EOF
3006    ;;
3007  esac
3008
3009  case $host_os in
3010  cygwin* | mingw* | pw32* | os2*)
3011    cat <<'EOF' >> "${ofile}T"
3012      # This is a source program that is used to create dlls on Windows
3013      # Don't remove nor modify the starting and closing comments
3014# /* ltdll.c starts here */
3015# #define WIN32_LEAN_AND_MEAN
3016# #include <windows.h>
3017# #undef WIN32_LEAN_AND_MEAN
3018# #include <stdio.h>
3019#
3020# #ifndef __CYGWIN__
3021# #  ifdef __CYGWIN32__
3022# #    define __CYGWIN__ __CYGWIN32__
3023# #  endif
3024# #endif
3025#
3026# #ifdef __cplusplus
3027# extern "C" {
3028# #endif
3029# BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved);
3030# #ifdef __cplusplus
3031# }
3032# #endif
3033#
3034# #ifdef __CYGWIN__
3035# #include <cygwin/cygwin_dll.h>
3036# DECLARE_CYGWIN_DLL( DllMain );
3037# #endif
3038# HINSTANCE __hDllInstance_base;
3039#
3040# BOOL APIENTRY
3041# DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved)
3042# {
3043#   __hDllInstance_base = hInst;
3044#   return TRUE;
3045# }
3046# /* ltdll.c ends here */
3047        # This is a source program that is used to create import libraries
3048        # on Windows for dlls which lack them. Don't remove nor modify the
3049        # starting and closing comments
3050# /* impgen.c starts here */
3051# /*   Copyright (C) 1999-2000 Free Software Foundation, Inc.
3052#
3053#  This file is part of GNU libtool.
3054#
3055#  This program is free software; you can redistribute it and/or modify
3056#  it under the terms of the GNU General Public License as published by
3057#  the Free Software Foundation; either version 2 of the License, or
3058#  (at your option) any later version.
3059#
3060#  This program is distributed in the hope that it will be useful,
3061#  but WITHOUT ANY WARRANTY; without even the implied warranty of
3062#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
3063#  GNU General Public License for more details.
3064#
3065#  You should have received a copy of the GNU General Public License
3066#  along with this program; if not, write to the Free Software
3067#  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
3068#  */
3069#
3070# #include <stdio.h>            /* for printf() */
3071# #include <unistd.h>           /* for open(), lseek(), read() */
3072# #include <fcntl.h>            /* for O_RDONLY, O_BINARY */
3073# #include <string.h>           /* for strdup() */
3074#
3075# /* O_BINARY isn't required (or even defined sometimes) under Unix */
3076# #ifndef O_BINARY
3077# #define O_BINARY 0
3078# #endif
3079#
3080# static unsigned int
3081# pe_get16 (fd, offset)
3082#      int fd;
3083#      int offset;
3084# {
3085#   unsigned char b[2];
3086#   lseek (fd, offset, SEEK_SET);
3087#   read (fd, b, 2);
3088#   return b[0] + (b[1]<<8);
3089# }
3090#
3091# static unsigned int
3092# pe_get32 (fd, offset)
3093#     int fd;
3094#     int offset;
3095# {
3096#   unsigned char b[4];
3097#   lseek (fd, offset, SEEK_SET);
3098#   read (fd, b, 4);
3099#   return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24);
3100# }
3101#
3102# static unsigned int
3103# pe_as32 (ptr)
3104#      void *ptr;
3105# {
3106#   unsigned char *b = ptr;
3107#   return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24);
3108# }
3109#
3110# int
3111# main (argc, argv)
3112#     int argc;
3113#     char *argv[];
3114# {
3115#     int dll;
3116#     unsigned long pe_header_offset, opthdr_ofs, num_entries, i;
3117#     unsigned long export_rva, export_size, nsections, secptr, expptr;
3118#     unsigned long name_rvas, nexp;
3119#     unsigned char *expdata, *erva;
3120#     char *filename, *dll_name;
3121#
3122#     filename = argv[1];
3123#
3124#     dll = open(filename, O_RDONLY|O_BINARY);
3125#     if (dll < 1)
3126#       return 1;
3127#
3128#     dll_name = filename;
3129#
3130#     for (i=0; filename[i]; i++)
3131#       if (filename[i] == '/' || filename[i] == '\\'  || filename[i] == ':')
3132#           dll_name = filename + i +1;
3133#
3134#     pe_header_offset = pe_get32 (dll, 0x3c);
3135#     opthdr_ofs = pe_header_offset + 4 + 20;
3136#     num_entries = pe_get32 (dll, opthdr_ofs + 92);
3137#
3138#     if (num_entries < 1) /* no exports */
3139#       return 1;
3140#
3141#     export_rva = pe_get32 (dll, opthdr_ofs + 96);
3142#     export_size = pe_get32 (dll, opthdr_ofs + 100);
3143#     nsections = pe_get16 (dll, pe_header_offset + 4 +2);
3144#     secptr = (pe_header_offset + 4 + 20 +
3145#             pe_get16 (dll, pe_header_offset + 4 + 16));
3146#
3147#     expptr = 0;
3148#     for (i = 0; i < nsections; i++)
3149#     {
3150#       char sname[8];
3151#       unsigned long secptr1 = secptr + 40 * i;
3152#       unsigned long vaddr = pe_get32 (dll, secptr1 + 12);
3153#       unsigned long vsize = pe_get32 (dll, secptr1 + 16);
3154#       unsigned long fptr = pe_get32 (dll, secptr1 + 20);
3155#       lseek(dll, secptr1, SEEK_SET);
3156#       read(dll, sname, 8);
3157#       if (vaddr <= export_rva && vaddr+vsize > export_rva)
3158#       {
3159#           expptr = fptr + (export_rva - vaddr);
3160#           if (export_rva + export_size > vaddr + vsize)
3161#               export_size = vsize - (export_rva - vaddr);
3162#           break;
3163#       }
3164#     }
3165#
3166#     expdata = (unsigned char*)malloc(export_size);
3167#     lseek (dll, expptr, SEEK_SET);
3168#     read (dll, expdata, export_size);
3169#     erva = expdata - export_rva;
3170#
3171#     nexp = pe_as32 (expdata+24);
3172#     name_rvas = pe_as32 (expdata+32);
3173#
3174#     printf ("EXPORTS\n");
3175#     for (i = 0; i<nexp; i++)
3176#     {
3177#       unsigned long name_rva = pe_as32 (erva+name_rvas+i*4);
3178#       printf ("\t%s @ %ld ;\n", erva+name_rva, 1+ i);
3179#     }
3180#
3181#     return 0;
3182# }
3183# /* impgen.c ends here */
3184
3185EOF
3186    ;;
3187  esac
3188
3189  # We use sed instead of cat because bash on DJGPP gets confused if
3190  # if finds mixed CR/LF and LF-only lines.  Since sed operates in
3191  # text mode, it properly converts lines to CR/LF.  This bash problem
3192  # is reportedly fixed, but why not run on old versions too?
3193  sed '$q' "$ltmain" >> "${ofile}T" || (rm -f "${ofile}T"; exit 1)
3194
3195  mv -f "${ofile}T" "$ofile" || \
3196    (rm -f "$ofile" && cp "${ofile}T" "$ofile" && rm -f "${ofile}T")
3197  chmod +x "$ofile"
3198fi
3199
3200])# _LT_AC_LTCONFIG_HACK
3201
3202# AC_LIBTOOL_DLOPEN - enable checks for dlopen support
3203AC_DEFUN([AC_LIBTOOL_DLOPEN], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])])
3204
3205# AC_LIBTOOL_WIN32_DLL - declare package support for building win32 dll's
3206AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])])
3207
3208# AC_ENABLE_SHARED - implement the --enable-shared flag
3209# Usage: AC_ENABLE_SHARED[(DEFAULT)]
3210#   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
3211#   `yes'.
3212AC_DEFUN([AC_ENABLE_SHARED],
3213[define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
3214AC_ARG_ENABLE(shared,
3215changequote(<<, >>)dnl
3216<<  --enable-shared[=PKGS]  build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT],
3217changequote([, ])dnl
3218[p=${PACKAGE-default}
3219case $enableval in
3220yes) enable_shared=yes ;;
3221no) enable_shared=no ;;
3222*)
3223  enable_shared=no
3224  # Look at the argument we got.  We use all the common list separators.
3225  IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
3226  for pkg in $enableval; do
3227    if test "X$pkg" = "X$p"; then
3228      enable_shared=yes
3229    fi
3230  done
3231  IFS="$ac_save_ifs"
3232  ;;
3233esac],
3234enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl
3235])
3236
3237# AC_DISABLE_SHARED - set the default shared flag to --disable-shared
3238AC_DEFUN([AC_DISABLE_SHARED],
3239[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
3240AC_ENABLE_SHARED(no)])
3241
3242# AC_ENABLE_STATIC - implement the --enable-static flag
3243# Usage: AC_ENABLE_STATIC[(DEFAULT)]
3244#   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
3245#   `yes'.
3246AC_DEFUN([AC_ENABLE_STATIC],
3247[define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
3248AC_ARG_ENABLE(static,
3249changequote(<<, >>)dnl
3250<<  --enable-static[=PKGS]  build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT],
3251changequote([, ])dnl
3252[p=${PACKAGE-default}
3253case $enableval in
3254yes) enable_static=yes ;;
3255no) enable_static=no ;;
3256*)
3257  enable_static=no
3258  # Look at the argument we got.  We use all the common list separators.
3259  IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
3260  for pkg in $enableval; do
3261    if test "X$pkg" = "X$p"; then
3262      enable_static=yes
3263    fi
3264  done
3265  IFS="$ac_save_ifs"
3266  ;;
3267esac],
3268enable_static=AC_ENABLE_STATIC_DEFAULT)dnl
3269])
3270
3271# AC_DISABLE_STATIC - set the default static flag to --disable-static
3272AC_DEFUN([AC_DISABLE_STATIC],
3273[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
3274AC_ENABLE_STATIC(no)])
3275
3276
3277# AC_ENABLE_FAST_INSTALL - implement the --enable-fast-install flag
3278# Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)]
3279#   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
3280#   `yes'.
3281AC_DEFUN([AC_ENABLE_FAST_INSTALL],
3282[define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
3283AC_ARG_ENABLE(fast-install,
3284changequote(<<, >>)dnl
3285<<  --enable-fast-install[=PKGS]  optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT],
3286changequote([, ])dnl
3287[p=${PACKAGE-default}
3288case $enableval in
3289yes) enable_fast_install=yes ;;
3290no) enable_fast_install=no ;;
3291*)
3292  enable_fast_install=no
3293  # Look at the argument we got.  We use all the common list separators.
3294  IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
3295  for pkg in $enableval; do
3296    if test "X$pkg" = "X$p"; then
3297      enable_fast_install=yes
3298    fi
3299  done
3300  IFS="$ac_save_ifs"
3301  ;;
3302esac],
3303enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl
3304])
3305
3306# AC_DISABLE_FAST_INSTALL - set the default to --disable-fast-install
3307AC_DEFUN([AC_DISABLE_FAST_INSTALL],
3308[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
3309AC_ENABLE_FAST_INSTALL(no)])
3310
3311# AC_LIBTOOL_PICMODE - implement the --with-pic flag
3312# Usage: AC_LIBTOOL_PICMODE[(MODE)]
3313#   Where MODE is either `yes' or `no'.  If omitted, it defaults to
3314#   `both'.
3315AC_DEFUN([AC_LIBTOOL_PICMODE],
3316[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
3317pic_mode=ifelse($#,1,$1,default)])
3318
3319
3320# AC_PATH_TOOL_PREFIX - find a file program which can recognise shared library
3321AC_DEFUN([AC_PATH_TOOL_PREFIX],
3322[AC_MSG_CHECKING([for $1])
3323AC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
3324[case $MAGIC_CMD in
3325  /*)
3326  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
3327  ;;
3328  ?:/*)
3329  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a dos path.
3330  ;;
3331  *)
3332  ac_save_MAGIC_CMD="$MAGIC_CMD"
3333  IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3334dnl $ac_dummy forces splitting on constant user-supplied paths.
3335dnl POSIX.2 word splitting is done only on the output of word expansions,
3336dnl not every word.  This closes a longstanding sh security hole.
3337  ac_dummy="ifelse([$2], , $PATH, [$2])"
3338  for ac_dir in $ac_dummy; do
3339    test -z "$ac_dir" && ac_dir=.
3340    if test -f $ac_dir/$1; then
3341      lt_cv_path_MAGIC_CMD="$ac_dir/$1"
3342      if test -n "$file_magic_test_file"; then
3343        case $deplibs_check_method in
3344        "file_magic "*)
3345          file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`"
3346          MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
3347          if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
3348            egrep "$file_magic_regex" > /dev/null; then
3349            :
3350          else
3351            cat <<EOF 1>&2
3352
3353*** Warning: the command libtool uses to detect shared libraries,
3354*** $file_magic_cmd, produces output that libtool cannot recognize.
3355*** The result is that libtool may fail to recognize shared libraries
3356*** as such.  This will affect the creation of libtool libraries that
3357*** depend on shared libraries, but programs linked with such libtool
3358*** libraries will work regardless of this problem.  Nevertheless, you
3359*** may want to report the problem to your system manager and/or to
3360*** bug-libtool@gnu.org
3361
3362EOF
3363          fi ;;
3364        esac
3365      fi
3366      break
3367    fi
3368  done
3369  IFS="$ac_save_ifs"
3370  MAGIC_CMD="$ac_save_MAGIC_CMD"
3371  ;;
3372esac])
3373MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
3374if test -n "$MAGIC_CMD"; then
3375  AC_MSG_RESULT($MAGIC_CMD)
3376else
3377  AC_MSG_RESULT(no)
3378fi
3379])
3380
3381
3382# AC_PATH_MAGIC - find a file program which can recognise a shared library
3383AC_DEFUN([AC_PATH_MAGIC],
3384[AC_REQUIRE([AC_CHECK_TOOL_PREFIX])dnl
3385AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin:$PATH)
3386if test -z "$lt_cv_path_MAGIC_CMD"; then
3387  if test -n "$ac_tool_prefix"; then
3388    AC_PATH_TOOL_PREFIX(file, /usr/bin:$PATH)
3389  else
3390    MAGIC_CMD=:
3391  fi
3392fi
3393])
3394
3395
3396# AC_PROG_LD - find the path to the GNU or non-GNU linker
3397AC_DEFUN([AC_PROG_LD],
3398[AC_ARG_WITH(gnu-ld,
3399[  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]],
3400test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
3401AC_REQUIRE([AC_PROG_CC])dnl
3402AC_REQUIRE([AC_CANONICAL_HOST])dnl
3403AC_REQUIRE([AC_CANONICAL_BUILD])dnl
3404ac_prog=ld
3405if test "$GCC" = yes; then
3406  # Check if gcc -print-prog-name=ld gives a path.
3407  AC_MSG_CHECKING([for ld used by GCC])
3408  case $host in
3409  *-*-mingw*)
3410    # gcc leaves a trailing carriage return which upsets mingw
3411    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
3412  *)
3413    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
3414  esac
3415  case $ac_prog in
3416    # Accept absolute paths.
3417    [[\\/]* | [A-Za-z]:[\\/]*)]
3418      [re_direlt='/[^/][^/]*/\.\./']
3419      # Canonicalize the path of ld
3420      ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
3421      while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
3422        ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
3423      done
3424      test -z "$LD" && LD="$ac_prog"
3425      ;;
3426  "")
3427    # If it fails, then pretend we aren't using GCC.
3428    ac_prog=ld
3429    ;;
3430  *)
3431    # If it is relative, then search for the first ld in PATH.
3432    with_gnu_ld=unknown
3433    ;;
3434  esac
3435elif test "$with_gnu_ld" = yes; then
3436  AC_MSG_CHECKING([for GNU ld])
3437else
3438  AC_MSG_CHECKING([for non-GNU ld])
3439fi
3440AC_CACHE_VAL(lt_cv_path_LD,
3441[if test -z "$LD"; then
3442  IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
3443  for ac_dir in $PATH; do
3444    test -z "$ac_dir" && ac_dir=.
3445    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
3446      lt_cv_path_LD="$ac_dir/$ac_prog"
3447      # Check to see if the program is GNU ld.  I'd rather use --version,
3448      # but apparently some GNU ld's only accept -v.
3449      # Break only if it was the GNU/non-GNU ld that we prefer.
3450      if "$lt_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
3451        test "$with_gnu_ld" != no && break
3452      else
3453        test "$with_gnu_ld" != yes && break
3454      fi
3455    fi
3456  done
3457  IFS="$ac_save_ifs"
3458else
3459  lt_cv_path_LD="$LD" # Let the user override the test with a path.
3460fi])
3461LD="$lt_cv_path_LD"
3462if test -n "$LD"; then
3463  AC_MSG_RESULT($LD)
3464else
3465  AC_MSG_RESULT(no)
3466fi
3467test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
3468AC_PROG_LD_GNU
3469])
3470
3471# AC_PROG_LD_GNU -
3472AC_DEFUN([AC_PROG_LD_GNU],
3473[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
3474[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
3475if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
3476  lt_cv_prog_gnu_ld=yes
3477else
3478  lt_cv_prog_gnu_ld=no
3479fi])
3480with_gnu_ld=$lt_cv_prog_gnu_ld
3481])
3482
3483# AC_PROG_LD_RELOAD_FLAG - find reload flag for linker
3484#   -- PORTME Some linkers may need a different reload flag.
3485AC_DEFUN([AC_PROG_LD_RELOAD_FLAG],
3486[AC_CACHE_CHECK([for $LD option to reload object files], lt_cv_ld_reload_flag,
3487[lt_cv_ld_reload_flag='-r'])
3488reload_flag=$lt_cv_ld_reload_flag
3489test -n "$reload_flag" && reload_flag=" $reload_flag"
3490])
3491
3492# AC_DEPLIBS_CHECK_METHOD - how to check for library dependencies
3493#  -- PORTME fill in with the dynamic library characteristics
3494AC_DEFUN([AC_DEPLIBS_CHECK_METHOD],
3495[AC_CACHE_CHECK([how to recognise dependant libraries],
3496lt_cv_deplibs_check_method,
3497[lt_cv_file_magic_cmd='$MAGIC_CMD'
3498lt_cv_file_magic_test_file=
3499lt_cv_deplibs_check_method='unknown'
3500# Need to set the preceding variable on all platforms that support
3501# interlibrary dependencies.
3502# 'none' -- dependencies not supported.
3503# `unknown' -- same as none, but documents that we really don't know.
3504# 'pass_all' -- all dependencies passed with no checks.
3505# 'test_compile' -- check by making test program.
3506# ['file_magic [regex]'] -- check by looking for files in library path
3507# which responds to the $file_magic_cmd with a given egrep regex.
3508# If you have `file' or equivalent on your system and you're not sure
3509# whether `pass_all' will *always* work, you probably want this one.
3510
3511case $host_os in
3512aix4* | aix5*)
3513  lt_cv_deplibs_check_method=pass_all
3514  ;;
3515
3516beos*)
3517  lt_cv_deplibs_check_method=pass_all
3518  ;;
3519
3520bsdi4*)
3521  [lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)']
3522  lt_cv_file_magic_cmd='/usr/bin/file -L'
3523  lt_cv_file_magic_test_file=/shlib/libc.so
3524  ;;
3525
3526cygwin* | mingw* | pw32*)
3527  lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
3528  lt_cv_file_magic_cmd='$OBJDUMP -f'
3529  ;;
3530
3531darwin* | rhapsody*)
3532  lt_cv_deplibs_check_method='file_magic Mach-O dynamically linked shared library'
3533  lt_cv_file_magic_cmd='/usr/bin/file -L'
3534  case "$host_os" in
3535  rhapsody* | darwin1.[[012]])
3536    lt_cv_file_magic_test_file=`echo /System/Library/Frameworks/System.framework/Versions/*/System | head -1`
3537    ;;
3538  *) # Darwin 1.3 on
3539    lt_cv_file_magic_test_file='/usr/lib/libSystem.dylib'
3540    ;;
3541  esac
3542  ;;
3543
3544freebsd*)
3545  if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
3546    case $host_cpu in
3547    i*86 )
3548      # Not sure whether the presence of OpenBSD here was a mistake.
3549      # Let's accept both of them until this is cleared up.
3550      [lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD)/i[3-9]86 (compact )?demand paged shared library']
3551      lt_cv_file_magic_cmd=/usr/bin/file
3552      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
3553      ;;
3554    esac
3555  else
3556    lt_cv_deplibs_check_method=pass_all
3557  fi
3558  ;;
3559
3560gnu*)
3561  lt_cv_deplibs_check_method=pass_all
3562  ;;
3563
3564hpux10.20*|hpux11*)
3565  [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library']
3566  lt_cv_file_magic_cmd=/usr/bin/file
3567  lt_cv_file_magic_test_file=/usr/lib/libc.sl
3568  ;;
3569
3570irix5* | irix6*)
3571  case $host_os in
3572  irix5*)
3573    # this will be overridden with pass_all, but let us keep it just in case
3574    lt_cv_deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1"
3575    ;;
3576  *)
3577    case $LD in
3578    *-32|*"-32 ") libmagic=32-bit;;
3579    *-n32|*"-n32 ") libmagic=N32;;
3580    *-64|*"-64 ") libmagic=64-bit;;
3581    *) libmagic=never-match;;
3582    esac
3583    # this will be overridden with pass_all, but let us keep it just in case
3584    [lt_cv_deplibs_check_method="file_magic ELF ${libmagic} MSB mips-[1234] dynamic lib MIPS - version 1"]
3585    ;;
3586  esac
3587  lt_cv_file_magic_test_file=`echo /lib${libsuff}/libc.so*`
3588  lt_cv_deplibs_check_method=pass_all
3589  ;;
3590
3591# This must be Linux ELF.
3592linux-gnu*)
3593  case $host_cpu in
3594  alpha* | hppa* | i*86 | powerpc* | sparc* | ia64* )
3595    lt_cv_deplibs_check_method=pass_all ;;
3596  *)
3597    # glibc up to 2.1.1 does not perform some relocations on ARM
3598    [lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;;]
3599  esac
3600  lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
3601  ;;
3602
3603netbsd*)
3604  if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
3605    [lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$']
3606  else
3607    [lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so$']
3608  fi
3609  ;;
3610
3611newos6*)
3612  [lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)']
3613  lt_cv_file_magic_cmd=/usr/bin/file
3614  lt_cv_file_magic_test_file=/usr/lib/libnls.so
3615  ;;
3616
3617openbsd*)
3618  lt_cv_file_magic_cmd=/usr/bin/file
3619  lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
3620  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
3621    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB shared object'
3622  else
3623    lt_cv_deplibs_check_method='file_magic OpenBSD.* shared library'
3624  fi
3625  ;;
3626
3627osf3* | osf4* | osf5*)
3628  # this will be overridden with pass_all, but let us keep it just in case
3629  lt_cv_deplibs_check_method='file_magic COFF format alpha shared library'
3630  lt_cv_file_magic_test_file=/shlib/libc.so
3631  lt_cv_deplibs_check_method=pass_all
3632  ;;
3633
3634sco3.2v5*)
3635  lt_cv_deplibs_check_method=pass_all
3636  ;;
3637
3638solaris*)
3639  lt_cv_deplibs_check_method=pass_all
3640  lt_cv_file_magic_test_file=/lib/libc.so
3641  ;;
3642
3643[sysv5uw[78]* | sysv4*uw2*)]
3644  lt_cv_deplibs_check_method=pass_all
3645  ;;
3646
3647sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
3648  case $host_vendor in
3649  motorola)
3650    [lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]']
3651    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
3652    ;;
3653  ncr)
3654    lt_cv_deplibs_check_method=pass_all
3655    ;;
3656  sequent)
3657    lt_cv_file_magic_cmd='/bin/file'
3658    [lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )']
3659    ;;
3660  sni)
3661    lt_cv_file_magic_cmd='/bin/file'
3662    [lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib"]
3663    lt_cv_file_magic_test_file=/lib/libc.so
3664    ;;
3665  esac
3666  ;;
3667esac
3668])
3669file_magic_cmd=$lt_cv_file_magic_cmd
3670deplibs_check_method=$lt_cv_deplibs_check_method
3671])
3672
3673
3674# AC_PROG_NM - find the path to a BSD-compatible name lister
3675AC_DEFUN([AC_PROG_NM],
3676[AC_MSG_CHECKING([for BSD-compatible nm])
3677AC_CACHE_VAL(lt_cv_path_NM,
3678[if test -n "$NM"; then
3679  # Let the user override the test.
3680  lt_cv_path_NM="$NM"
3681else
3682  IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
3683  for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
3684    test -z "$ac_dir" && ac_dir=.
3685    tmp_nm=$ac_dir/${ac_tool_prefix}nm
3686    if test -f $tmp_nm || test -f $tmp_nm$ac_exeext ; then
3687      # Check to see if the nm accepts a BSD-compat flag.
3688      # Adding the `sed 1q' prevents false positives on HP-UX, which says:
3689      #   nm: unknown option "B" ignored
3690      # Tru64's nm complains that /dev/null is an invalid object file
3691      if ($tmp_nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep '(/dev/null|Invalid file or object type)' >/dev/null; then
3692        lt_cv_path_NM="$tmp_nm -B"
3693        break
3694      elif ($tmp_nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
3695        lt_cv_path_NM="$tmp_nm -p"
3696        break
3697      else
3698        lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
3699        continue # so that we can try to find one that supports BSD flags
3700      fi
3701    fi
3702  done
3703  IFS="$ac_save_ifs"
3704  test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm
3705fi])
3706NM="$lt_cv_path_NM"
3707AC_MSG_RESULT([$NM])
3708])
3709
3710# AC_CHECK_LIBM - check for math library
3711AC_DEFUN([AC_CHECK_LIBM],
3712[AC_REQUIRE([AC_CANONICAL_HOST])dnl
3713LIBM=
3714case $host in
3715*-*-beos* | *-*-cygwin* | *-*-pw32*)
3716  # These system don't have libm
3717  ;;
3718*-ncr-sysv4.3*)
3719  AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
3720  AC_CHECK_LIB(m, main, LIBM="$LIBM -lm")
3721  ;;
3722*)
3723  AC_CHECK_LIB(m, main, LIBM="-lm")
3724  ;;
3725esac
3726])
3727
3728# AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for
3729# the libltdl convenience library and INCLTDL to the include flags for
3730# the libltdl header and adds --enable-ltdl-convenience to the
3731# configure arguments.  Note that LIBLTDL and INCLTDL are not
3732# AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called.  If DIR is not
3733# provided, it is assumed to be `libltdl'.  LIBLTDL will be prefixed
3734# with '${top_builddir}/' and INCLTDL will be prefixed with
3735# '${top_srcdir}/' (note the single quotes!).  If your package is not
3736# flat and you're not using automake, define top_builddir and
3737# top_srcdir appropriately in the Makefiles.
3738AC_DEFUN([AC_LIBLTDL_CONVENIENCE],
3739[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
3740  case $enable_ltdl_convenience in
3741  no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
3742  "") enable_ltdl_convenience=yes
3743      ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
3744  esac
3745  LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la
3746  INCLTDL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
3747])
3748
3749# AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for
3750# the libltdl installable library and INCLTDL to the include flags for
3751# the libltdl header and adds --enable-ltdl-install to the configure
3752# arguments.  Note that LIBLTDL and INCLTDL are not AC_SUBSTed, nor is
3753# AC_CONFIG_SUBDIRS called.  If DIR is not provided and an installed
3754# libltdl is not found, it is assumed to be `libltdl'.  LIBLTDL will
3755# be prefixed with '${top_builddir}/' and INCLTDL will be prefixed
3756# with '${top_srcdir}/' (note the single quotes!).  If your package is
3757# not flat and you're not using automake, define top_builddir and
3758# top_srcdir appropriately in the Makefiles.
3759# In the future, this macro may have to be called after AC_PROG_LIBTOOL.
3760AC_DEFUN([AC_LIBLTDL_INSTALLABLE],
3761[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
3762  AC_CHECK_LIB(ltdl, main,
3763  [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
3764  [if test x"$enable_ltdl_install" = xno; then
3765     AC_MSG_WARN([libltdl not installed, but installation disabled])
3766   else
3767     enable_ltdl_install=yes
3768   fi
3769  ])
3770  if test x"$enable_ltdl_install" = x"yes"; then
3771    ac_configure_args="$ac_configure_args --enable-ltdl-install"
3772    LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la
3773    INCLTDL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
3774  else
3775    ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
3776    LIBLTDL="-lltdl"
3777    INCLTDL=
3778  fi
3779])
3780
3781# old names
3782AC_DEFUN([AM_PROG_LIBTOOL],   [AC_PROG_LIBTOOL])
3783AC_DEFUN([AM_ENABLE_SHARED],  [AC_ENABLE_SHARED($@)])
3784AC_DEFUN([AM_ENABLE_STATIC],  [AC_ENABLE_STATIC($@)])
3785AC_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
3786AC_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
3787AC_DEFUN([AM_PROG_LD],        [AC_PROG_LD])
3788AC_DEFUN([AM_PROG_NM],        [AC_PROG_NM])
3789
3790# This is just to silence aclocal about the macro not being used
3791ifelse([AC_DISABLE_FAST_INSTALL])
3792
3793
3794dnl PKG_CHECK_MODULES(GSTUFF, gtk+-2.0 >= 1.3 glib = 1.3.4, action-if, action-not)
3795dnl defines GSTUFF_LIBS, GSTUFF_CFLAGS, see pkg-config man page
3796dnl also defines GSTUFF_PKG_ERRORS on error
3797AC_DEFUN(PKG_CHECK_MODULES, [
3798  succeeded=no
3799
3800  if test -z "$PKG_CONFIG"; then
3801    AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
3802  fi
3803
3804  if test "$PKG_CONFIG" = "no" ; then
3805     echo "*** The pkg-config script could not be found. Make sure it is"
3806     echo "*** in your path, or set the PKG_CONFIG environment variable"
3807     echo "*** to the full path to pkg-config."
3808     echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config."
3809  else
3810     if ! $PKG_CONFIG --atleast-pkgconfig-version 0.7.0; then
3811        echo "*** Your version of pkg-config is too old. You need version 0.7.0 or newer."
3812        echo "*** See http://www.freedesktop.org/software/pkgconfig"
3813     else
3814        AC_MSG_CHECKING(for $2)
3815
3816        if $PKG_CONFIG --exists "$2" ; then
3817            AC_MSG_RESULT(yes)
3818            succeeded=yes
3819
3820            AC_MSG_CHECKING($1_CFLAGS)
3821            $1_CFLAGS=`$PKG_CONFIG --cflags "$2"`
3822            AC_MSG_RESULT($$1_CFLAGS)
3823
3824            AC_MSG_CHECKING($1_LIBS)
3825            $1_LIBS=`$PKG_CONFIG --libs "$2"`
3826            AC_MSG_RESULT($$1_LIBS)
3827        else
3828            $1_CFLAGS=""
3829            $1_LIBS=""
3830            ## If we have a custom action on failure, don't print errors, but
3831            ## do set a variable so people can do so.
3832            $1_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"`
3833            ifelse([$4], ,echo $$1_PKG_ERRORS,)
3834        fi
3835
3836        AC_SUBST($1_CFLAGS)
3837        AC_SUBST($1_LIBS)
3838     fi
3839  fi
3840
3841  if test $succeeded = yes; then
3842     ifelse([$3], , :, [$3])
3843  else
3844     ifelse([$4], , AC_MSG_ERROR([Library requirements ($2) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them.]), [$4])
3845  fi
3846])
3847
3848
3849
3850dnl
3851dnl GNOME_INIT_HOOK (script-if-gnome-enabled, [failflag], [additional-inits])
3852dnl
3853dnl if failflag is "fail" then GNOME_INIT_HOOK will abort if gnomeConf.sh
3854dnl is not found.
3855dnl
3856
3857AC_DEFUN([GNOME_INIT_HOOK],[
3858        AC_SUBST(GNOME_LIBS)
3859        AC_SUBST(GNOMEUI_LIBS)
3860        AC_SUBST(GNOMEGNORBA_LIBS)
3861        AC_SUBST(GTKXMHTML_LIBS)
3862        AC_SUBST(ZVT_LIBS)
3863        AC_SUBST(GNOME_LIBDIR)
3864        AC_SUBST(GNOME_INCLUDEDIR)
3865
3866        AC_ARG_WITH(gnome-includes,
3867        [  --with-gnome-includes   Specify location of GNOME headers],[
3868        CFLAGS="$CFLAGS -I$withval"
3869        ])
3870       
3871        AC_ARG_WITH(gnome-libs,
3872        [  --with-gnome-libs       Specify location of GNOME libs],[
3873        LDFLAGS="$LDFLAGS -L$withval"
3874        gnome_prefix=$withval
3875        ])
3876
3877        AC_ARG_WITH(gnome,
3878        [  --with-gnome            Specify prefix for GNOME files],
3879                if test x$withval = xyes; then
3880                        want_gnome=yes
3881                        dnl Note that an empty true branch is not
3882                        dnl valid sh syntax.
3883                        ifelse([$1], [], :, [$1])
3884                else
3885                        if test "x$withval" = xno; then
3886                                want_gnome=no
3887                        else
3888                                want_gnome=yes
3889                                LDFLAGS="$LDFLAGS -L$withval/lib"
3890                                CFLAGS="$CFLAGS -I$withval/include"
3891                                gnome_prefix=$withval/lib
3892                        fi
3893                fi,
3894                want_gnome=yes)
3895
3896        if test "x$want_gnome" = xyes; then
3897
3898            AC_PATH_PROG(GNOME_CONFIG,gnome-config,no)
3899            if test "$GNOME_CONFIG" = "no"; then
3900              no_gnome_config="yes"
3901            else
3902              AC_MSG_CHECKING(if $GNOME_CONFIG works)
3903              if $GNOME_CONFIG --libs-only-l gnome >/dev/null 2>&1; then
3904                AC_MSG_RESULT(yes)
3905                GNOME_GNORBA_HOOK([],$2)
3906                GNOME_LIBS="`$GNOME_CONFIG --libs-only-l gnome`"
3907                GNOMEUI_LIBS="`$GNOME_CONFIG --libs-only-l gnomeui`"
3908                GNOMEGNORBA_LIBS="`$GNOME_CONFIG --libs-only-l gnorba gnomeui`"
3909                GTKXMHTML_LIBS="`$GNOME_CONFIG --libs-only-l gtkxmhtml`"
3910                ZVT_LIBS="`$GNOME_CONFIG --libs-only-l zvt`"
3911                GNOME_LIBDIR="`$GNOME_CONFIG --libs-only-L gnorba gnomeui`"
3912                GNOME_INCLUDEDIR="`$GNOME_CONFIG --cflags gnorba gnomeui`"
3913                $1
3914              else
3915                AC_MSG_RESULT(no)
3916                no_gnome_config="yes"
3917              fi
3918            fi
3919
3920            if test x$exec_prefix = xNONE; then
3921                if test x$prefix = xNONE; then
3922                    gnome_prefix=$ac_default_prefix/lib
3923                else
3924                    gnome_prefix=$prefix/lib
3925                fi
3926            else
3927                gnome_prefix=`eval echo \`echo $libdir\``
3928            fi
3929       
3930            if test "$no_gnome_config" = "yes"; then
3931              AC_MSG_CHECKING(for gnomeConf.sh file in $gnome_prefix)
3932              if test -f $gnome_prefix/gnomeConf.sh; then
3933                AC_MSG_RESULT(found)
3934                echo "loading gnome configuration from" \
3935                     "$gnome_prefix/gnomeConf.sh"
3936                . $gnome_prefix/gnomeConf.sh
3937                $1
3938              else
3939                AC_MSG_RESULT(not found)
3940                if test x$2 = xfail; then
3941                  AC_MSG_ERROR(Could not find the gnomeConf.sh file that is generated by gnome-libs install)
3942                fi
3943              fi
3944            fi
3945        fi
3946
3947        if test -n "$3"; then
3948          n="$3"
3949          for i in $n; do
3950            AC_MSG_CHECKING(extra library \"$i\")
3951            case $i in
3952              applets)
3953                AC_SUBST(GNOME_APPLETS_LIBS)
3954                GNOME_APPLETS_LIBS=`$GNOME_CONFIG --libs-only-l applets`
3955                AC_MSG_RESULT($GNOME_APPLETS_LIBS);;
3956              docklets)
3957                AC_SUBST(GNOME_DOCKLETS_LIBS)
3958                GNOME_DOCKLETS_LIBS=`$GNOME_CONFIG --libs-only-l docklets`
3959                AC_MSG_RESULT($GNOME_DOCKLETS_LIBS);;
3960              capplet)
3961                AC_SUBST(GNOME_CAPPLET_LIBS)
3962                GNOME_CAPPLET_LIBS=`$GNOME_CONFIG --libs-only-l capplet`
3963                AC_MSG_RESULT($GNOME_CAPPLET_LIBS);;
3964              *)
3965                AC_MSG_RESULT(unknown library)
3966            esac
3967            EXTRA_INCLUDEDIR=`$GNOME_CONFIG --cflags $i`
3968            GNOME_INCLUDEDIR="$GNOME_INCLUDEDIR $EXTRA_INCLUDEDIR"
3969          done
3970        fi
3971])
3972
3973dnl
3974dnl GNOME_INIT ([additional-inits])
3975dnl
3976
3977AC_DEFUN([GNOME_INIT],[
3978        GNOME_INIT_HOOK([],fail,$1)
3979])
3980
3981dnl
3982dnl GNOME_GNORBA_HOOK (script-if-gnorba-found, failflag)
3983dnl
3984dnl if failflag is "failure" it aborts if gnorba is not found.
3985dnl
3986
3987AC_DEFUN([GNOME_GNORBA_HOOK],[
3988        GNOME_ORBIT_HOOK([],$2)
3989        AC_CACHE_CHECK([for gnorba libraries],gnome_cv_gnorba_found,[
3990                gnome_cv_gnorba_found=no
3991                if test x$gnome_cv_orbit_found = xyes; then
3992                        GNORBA_CFLAGS="`gnome-config --cflags gnorba gnomeui`"
3993                        GNORBA_LIBS="`gnome-config --libs gnorba gnomeui`"
3994                        if test -n "$GNORBA_LIBS"; then
3995                                gnome_cv_gnorba_found=yes
3996                        fi
3997                fi
3998        ])
3999        AM_CONDITIONAL(HAVE_GNORBA, test x$gnome_cv_gnorba_found = xyes)
4000        if test x$gnome_cv_orbit_found = xyes; then
4001                $1
4002                GNORBA_CFLAGS="`gnome-config --cflags gnorba gnomeui`"
4003                GNORBA_LIBS="`gnome-config --libs gnorba gnomeui`"
4004                AC_SUBST(GNORBA_CFLAGS)
4005                AC_SUBST(GNORBA_LIBS)
4006        else
4007                if test x$2 = xfailure; then
4008                        AC_MSG_ERROR(gnorba library not installed or installation problem)
4009                fi
4010        fi
4011])
4012
4013AC_DEFUN([GNOME_GNORBA_CHECK], [
4014        GNOME_GNORBA_HOOK([],failure)
4015])
4016
4017dnl
4018dnl GNOME_ORBIT_HOOK (script-if-orbit-found, failflag)
4019dnl
4020dnl if failflag is "failure" it aborts if orbit is not found.
4021dnl
4022
4023AC_DEFUN([GNOME_ORBIT_HOOK],[
4024        AC_PATH_PROG(ORBIT_CONFIG,orbit-config,no)
4025        AC_PATH_PROG(ORBIT_IDL,orbit-idl,no)
4026        AC_CACHE_CHECK([for working ORBit environment],gnome_cv_orbit_found,[
4027                if test x$ORBIT_CONFIG = xno -o x$ORBIT_IDL = xno; then
4028                        gnome_cv_orbit_found=no
4029                else
4030                        gnome_cv_orbit_found=yes
4031                fi
4032        ])
4033        AM_CONDITIONAL(HAVE_ORBIT, test x$gnome_cv_orbit_found = xyes)
4034        if test x$gnome_cv_orbit_found = xyes; then
4035                $1
4036                ORBIT_CFLAGS=`orbit-config --cflags client server`
4037                ORBIT_LIBS=`orbit-config --use-service=name --libs client server`
4038                AC_SUBST(ORBIT_CFLAGS)
4039                AC_SUBST(ORBIT_LIBS)
4040        else
4041                if test x$2 = xfailure; then
4042                        AC_MSG_ERROR(ORBit not installed or installation problem)
4043                fi
4044        fi
4045])
4046
4047AC_DEFUN([GNOME_ORBIT_CHECK], [
4048        GNOME_ORBIT_HOOK([],failure)
4049])
4050
4051# Configure paths for GLIB
4052# Owen Taylor     97-11-3
4053
4054dnl AM_PATH_GLIB([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]])
4055dnl Test for GLIB, and define GLIB_CFLAGS and GLIB_LIBS, if "gmodule" or
4056dnl gthread is specified in MODULES, pass to glib-config
4057dnl
4058AC_DEFUN(AM_PATH_GLIB,
4059[dnl
4060dnl Get the cflags and libraries from the glib-config script
4061dnl
4062AC_ARG_WITH(glib-prefix,[  --with-glib-prefix=PFX   Prefix where GLIB is installed (optional)],
4063            glib_config_prefix="$withval", glib_config_prefix="")
4064AC_ARG_WITH(glib-exec-prefix,[  --with-glib-exec-prefix=PFX Exec prefix where GLIB is installed (optional)],
4065            glib_config_exec_prefix="$withval", glib_config_exec_prefix="")
4066AC_ARG_ENABLE(glibtest, [  --disable-glibtest       Do not try to compile and run a test GLIB program],
4067                    , enable_glibtest=yes)
4068
4069  if test x$glib_config_exec_prefix != x ; then
4070     glib_config_args="$glib_config_args --exec-prefix=$glib_config_exec_prefix"
4071     if test x${GLIB_CONFIG+set} != xset ; then
4072        GLIB_CONFIG=$glib_config_exec_prefix/bin/glib-config
4073     fi
4074  fi
4075  if test x$glib_config_prefix != x ; then
4076     glib_config_args="$glib_config_args --prefix=$glib_config_prefix"
4077     if test x${GLIB_CONFIG+set} != xset ; then
4078        GLIB_CONFIG=$glib_config_prefix/bin/glib-config
4079     fi
4080  fi
4081
4082  for module in . $4
4083  do
4084      case "$module" in
4085         gmodule)
4086             glib_config_args="$glib_config_args gmodule"
4087         ;;
4088         gthread)
4089             glib_config_args="$glib_config_args gthread"
4090         ;;
4091      esac
4092  done
4093
4094  AC_PATH_PROG(GLIB_CONFIG, glib-config, no)
4095  min_glib_version=ifelse([$1], ,0.99.7,$1)
4096  AC_MSG_CHECKING(for GLIB - version >= $min_glib_version)
4097  no_glib=""
4098  if test "$GLIB_CONFIG" = "no" ; then
4099    no_glib=yes
4100  else
4101    GLIB_CFLAGS=`$GLIB_CONFIG $glib_config_args --cflags`
4102    GLIB_LIBS=`$GLIB_CONFIG $glib_config_args --libs`
4103    glib_config_major_version=`$GLIB_CONFIG $glib_config_args --version | \
4104           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
4105    glib_config_minor_version=`$GLIB_CONFIG $glib_config_args --version | \
4106           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
4107    glib_config_micro_version=`$GLIB_CONFIG $glib_config_args --version | \
4108           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
4109    if test "x$enable_glibtest" = "xyes" ; then
4110      ac_save_CFLAGS="$CFLAGS"
4111      ac_save_LIBS="$LIBS"
4112      CFLAGS="$CFLAGS $GLIB_CFLAGS"
4113      LIBS="$GLIB_LIBS $LIBS"
4114dnl
4115dnl Now check if the installed GLIB is sufficiently new. (Also sanity
4116dnl checks the results of glib-config to some extent
4117dnl
4118      rm -f conf.glibtest
4119      AC_TRY_RUN([
4120#include <glib.h>
4121#include <stdio.h>
4122#include <stdlib.h>
4123
4124int
4125main ()
4126{
4127  int major, minor, micro;
4128  char *tmp_version;
4129
4130  system ("touch conf.glibtest");
4131
4132  /* HP/UX 9 (%@#!) writes to sscanf strings */
4133  tmp_version = g_strdup("$min_glib_version");
4134  if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
4135     printf("%s, bad version string\n", "$min_glib_version");
4136     exit(1);
4137   }
4138
4139  if ((glib_major_version != $glib_config_major_version) ||
4140      (glib_minor_version != $glib_config_minor_version) ||
4141      (glib_micro_version != $glib_config_micro_version))
4142    {
4143      printf("\n*** 'glib-config --version' returned %d.%d.%d, but GLIB (%d.%d.%d)\n",
4144             $glib_config_major_version, $glib_config_minor_version, $glib_config_micro_version,
4145             glib_major_version, glib_minor_version, glib_micro_version);
4146      printf ("*** was found! If glib-config was correct, then it is best\n");
4147      printf ("*** to remove the old version of GLIB. You may also be able to fix the error\n");
4148      printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
4149      printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
4150      printf("*** required on your system.\n");
4151      printf("*** If glib-config was wrong, set the environment variable GLIB_CONFIG\n");
4152      printf("*** to point to the correct copy of glib-config, and remove the file config.cache\n");
4153      printf("*** before re-running configure\n");
4154    }
4155  else if ((glib_major_version != GLIB_MAJOR_VERSION) ||
4156           (glib_minor_version != GLIB_MINOR_VERSION) ||
4157           (glib_micro_version != GLIB_MICRO_VERSION))
4158    {
4159      printf("*** GLIB header files (version %d.%d.%d) do not match\n",
4160             GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION, GLIB_MICRO_VERSION);
4161      printf("*** library (version %d.%d.%d)\n",
4162             glib_major_version, glib_minor_version, glib_micro_version);
4163    }
4164  else
4165    {
4166      if ((glib_major_version > major) ||
4167        ((glib_major_version == major) && (glib_minor_version > minor)) ||
4168        ((glib_major_version == major) && (glib_minor_version == minor) && (glib_micro_version >= micro)))
4169      {
4170        return 0;
4171       }
4172     else
4173      {
4174        printf("\n*** An old version of GLIB (%d.%d.%d) was found.\n",
4175               glib_major_version, glib_minor_version, glib_micro_version);
4176        printf("*** You need a version of GLIB newer than %d.%d.%d. The latest version of\n",
4177               major, minor, micro);
4178        printf("*** GLIB is always available from ftp://ftp.gtk.org.\n");
4179        printf("***\n");
4180        printf("*** If you have already installed a sufficiently new version, this error\n");
4181        printf("*** probably means that the wrong copy of the glib-config shell script is\n");
4182        printf("*** being found. The easiest way to fix this is to remove the old version\n");
4183        printf("*** of GLIB, but you can also set the GLIB_CONFIG environment to point to the\n");
4184        printf("*** correct copy of glib-config. (In this case, you will have to\n");
4185        printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
4186        printf("*** so that the correct libraries are found at run-time))\n");
4187      }
4188    }
4189  return 1;
4190}
4191],, no_glib=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
4192       CFLAGS="$ac_save_CFLAGS"
4193       LIBS="$ac_save_LIBS"
4194     fi
4195  fi
4196  if test "x$no_glib" = x ; then
4197     AC_MSG_RESULT(yes)
4198     ifelse([$2], , :, [$2])     
4199  else
4200     AC_MSG_RESULT(no)
4201     if test "$GLIB_CONFIG" = "no" ; then
4202       echo "*** The glib-config script installed by GLIB could not be found"
4203       echo "*** If GLIB was installed in PREFIX, make sure PREFIX/bin is in"
4204       echo "*** your path, or set the GLIB_CONFIG environment variable to the"
4205       echo "*** full path to glib-config."
4206     else
4207       if test -f conf.glibtest ; then
4208        :
4209       else
4210          echo "*** Could not run GLIB test program, checking why..."
4211          CFLAGS="$CFLAGS $GLIB_CFLAGS"
4212          LIBS="$LIBS $GLIB_LIBS"
4213          AC_TRY_LINK([
4214#include <glib.h>
4215#include <stdio.h>
4216],      [ return ((glib_major_version) || (glib_minor_version) || (glib_micro_version)); ],
4217        [ echo "*** The test program compiled, but did not run. This usually means"
4218          echo "*** that the run-time linker is not finding GLIB or finding the wrong"
4219          echo "*** version of GLIB. If it is not finding GLIB, you'll need to set your"
4220          echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
4221          echo "*** to the installed location  Also, make sure you have run ldconfig if that"
4222          echo "*** is required on your system"
4223          echo "***"
4224          echo "*** If you have an old version installed, it is best to remove it, although"
4225          echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"
4226          echo "***"
4227          echo "*** If you have a RedHat 5.0 system, you should remove the GTK package that"
4228          echo "*** came with the system with the command"
4229          echo "***"
4230          echo "***    rpm --erase --nodeps gtk gtk-devel" ],
4231        [ echo "*** The test program failed to compile or link. See the file config.log for the"
4232          echo "*** exact error that occured. This usually means GLIB was incorrectly installed"
4233          echo "*** or that you have moved GLIB since it was installed. In the latter case, you"
4234          echo "*** may want to edit the glib-config script: $GLIB_CONFIG" ])
4235          CFLAGS="$ac_save_CFLAGS"
4236          LIBS="$ac_save_LIBS"
4237       fi
4238     fi
4239     GLIB_CFLAGS=""
4240     GLIB_LIBS=""
4241     ifelse([$3], , :, [$3])
4242  fi
4243  AC_SUBST(GLIB_CFLAGS)
4244  AC_SUBST(GLIB_LIBS)
4245  rm -f conf.glibtest
4246])
4247
4248# Configure paths for GTK+
4249# Owen Taylor     97-11-3
4250
4251dnl AM_PATH_GTK([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]])
4252dnl Test for GTK, and define GTK_CFLAGS and GTK_LIBS
4253dnl
4254AC_DEFUN(AM_PATH_GTK,
4255[dnl
4256dnl Get the cflags and libraries from the gtk-config script
4257dnl
4258AC_ARG_WITH(gtk-prefix,[  --with-gtk-prefix=PFX   Prefix where GTK is installed (optional)],
4259            gtk_config_prefix="$withval", gtk_config_prefix="")
4260AC_ARG_WITH(gtk-exec-prefix,[  --with-gtk-exec-prefix=PFX Exec prefix where GTK is installed (optional)],
4261            gtk_config_exec_prefix="$withval", gtk_config_exec_prefix="")
4262AC_ARG_ENABLE(gtktest, [  --disable-gtktest       Do not try to compile and run a test GTK program],
4263                    , enable_gtktest=yes)
4264
4265  for module in . $4
4266  do
4267      case "$module" in
4268         gthread)
4269             gtk_config_args="$gtk_config_args gthread"
4270         ;;
4271      esac
4272  done
4273
4274  if test x$gtk_config_exec_prefix != x ; then
4275     gtk_config_args="$gtk_config_args --exec-prefix=$gtk_config_exec_prefix"
4276     if test x${GTK_CONFIG+set} != xset ; then
4277        GTK_CONFIG=$gtk_config_exec_prefix/bin/gtk-config
4278     fi
4279  fi
4280  if test x$gtk_config_prefix != x ; then
4281     gtk_config_args="$gtk_config_args --prefix=$gtk_config_prefix"
4282     if test x${GTK_CONFIG+set} != xset ; then
4283        GTK_CONFIG=$gtk_config_prefix/bin/gtk-config
4284     fi
4285  fi
4286
4287  AC_PATH_PROG(GTK_CONFIG, gtk-config, no)
4288  min_gtk_version=ifelse([$1], ,0.99.7,$1)
4289  AC_MSG_CHECKING(for GTK - version >= $min_gtk_version)
4290  no_gtk=""
4291  if test "$GTK_CONFIG" = "no" ; then
4292    no_gtk=yes
4293  else
4294    GTK_CFLAGS=`$GTK_CONFIG $gtk_config_args --cflags`
4295    GTK_LIBS=`$GTK_CONFIG $gtk_config_args --libs`
4296    gtk_config_major_version=`$GTK_CONFIG $gtk_config_args --version | \
4297           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
4298    gtk_config_minor_version=`$GTK_CONFIG $gtk_config_args --version | \
4299           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
4300    gtk_config_micro_version=`$GTK_CONFIG $gtk_config_args --version | \
4301           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
4302    if test "x$enable_gtktest" = "xyes" ; then
4303      ac_save_CFLAGS="$CFLAGS"
4304      ac_save_LIBS="$LIBS"
4305      CFLAGS="$CFLAGS $GTK_CFLAGS"
4306      LIBS="$GTK_LIBS $LIBS"
4307dnl
4308dnl Now check if the installed GTK is sufficiently new. (Also sanity
4309dnl checks the results of gtk-config to some extent
4310dnl
4311      rm -f conf.gtktest
4312      AC_TRY_RUN([
4313#include <gtk/gtk.h>
4314#include <stdio.h>
4315#include <stdlib.h>
4316
4317int
4318main ()
4319{
4320  int major, minor, micro;
4321  char *tmp_version;
4322
4323  system ("touch conf.gtktest");
4324
4325  /* HP/UX 9 (%@#!) writes to sscanf strings */
4326  tmp_version = g_strdup("$min_gtk_version");
4327  if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
4328     printf("%s, bad version string\n", "$min_gtk_version");
4329     exit(1);
4330   }
4331
4332  if ((gtk_major_version != $gtk_config_major_version) ||
4333      (gtk_minor_version != $gtk_config_minor_version) ||
4334      (gtk_micro_version != $gtk_config_micro_version))
4335    {
4336      printf("\n*** 'gtk-config --version' returned %d.%d.%d, but GTK+ (%d.%d.%d)\n",
4337             $gtk_config_major_version, $gtk_config_minor_version, $gtk_config_micro_version,
4338             gtk_major_version, gtk_minor_version, gtk_micro_version);
4339      printf ("*** was found! If gtk-config was correct, then it is best\n");
4340      printf ("*** to remove the old version of GTK+. You may also be able to fix the error\n");
4341      printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
4342      printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
4343      printf("*** required on your system.\n");
4344      printf("*** If gtk-config was wrong, set the environment variable GTK_CONFIG\n");
4345      printf("*** to point to the correct copy of gtk-config, and remove the file config.cache\n");
4346      printf("*** before re-running configure\n");
4347    }
4348#if defined (GTK_MAJOR_VERSION) && defined (GTK_MINOR_VERSION) && defined (GTK_MICRO_VERSION)
4349  else if ((gtk_major_version != GTK_MAJOR_VERSION) ||
4350           (gtk_minor_version != GTK_MINOR_VERSION) ||
4351           (gtk_micro_version != GTK_MICRO_VERSION))
4352    {
4353      printf("*** GTK+ header files (version %d.%d.%d) do not match\n",
4354             GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION);
4355      printf("*** library (version %d.%d.%d)\n",
4356             gtk_major_version, gtk_minor_version, gtk_micro_version);
4357    }
4358#endif /* defined (GTK_MAJOR_VERSION) ... */
4359  else
4360    {
4361      if ((gtk_major_version > major) ||
4362        ((gtk_major_version == major) && (gtk_minor_version > minor)) ||
4363        ((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro)))
4364      {
4365        return 0;
4366       }
4367     else
4368      {
4369        printf("\n*** An old version of GTK+ (%d.%d.%d) was found.\n",
4370               gtk_major_version, gtk_minor_version, gtk_micro_version);
4371        printf("*** You need a version of GTK+ newer than %d.%d.%d. The latest version of\n",
4372               major, minor, micro);
4373        printf("*** GTK+ is always available from ftp://ftp.gtk.org.\n");
4374        printf("***\n");
4375        printf("*** If you have already installed a sufficiently new version, this error\n");
4376        printf("*** probably means that the wrong copy of the gtk-config shell script is\n");
4377        printf("*** being found. The easiest way to fix this is to remove the old version\n");
4378        printf("*** of GTK+, but you can also set the GTK_CONFIG environment to point to the\n");
4379        printf("*** correct copy of gtk-config. (In this case, you will have to\n");
4380        printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
4381        printf("*** so that the correct libraries are found at run-time))\n");
4382      }
4383    }
4384  return 1;
4385}
4386],, no_gtk=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
4387       CFLAGS="$ac_save_CFLAGS"
4388       LIBS="$ac_save_LIBS"
4389     fi
4390  fi
4391  if test "x$no_gtk" = x ; then
4392     AC_MSG_RESULT(yes)
4393     ifelse([$2], , :, [$2])     
4394  else
4395     AC_MSG_RESULT(no)
4396     if test "$GTK_CONFIG" = "no" ; then
4397       echo "*** The gtk-config script installed by GTK could not be found"
4398       echo "*** If GTK was installed in PREFIX, make sure PREFIX/bin is in"
4399       echo "*** your path, or set the GTK_CONFIG environment variable to the"
4400       echo "*** full path to gtk-config."
4401     else
4402       if test -f conf.gtktest ; then
4403        :
4404       else
4405          echo "*** Could not run GTK test program, checking why..."
4406          CFLAGS="$CFLAGS $GTK_CFLAGS"
4407          LIBS="$LIBS $GTK_LIBS"
4408          AC_TRY_LINK([
4409#include <gtk/gtk.h>
4410#include <stdio.h>
4411],      [ return ((gtk_major_version) || (gtk_minor_version) || (gtk_micro_version)); ],
4412        [ echo "*** The test program compiled, but did not run. This usually means"
4413          echo "*** that the run-time linker is not finding GTK or finding the wrong"
4414          echo "*** version of GTK. If it is not finding GTK, you'll need to set your"
4415          echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
4416          echo "*** to the installed location  Also, make sure you have run ldconfig if that"
4417          echo "*** is required on your system"
4418          echo "***"
4419          echo "*** If you have an old version installed, it is best to remove it, although"
4420          echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"
4421          echo "***"
4422          echo "*** If you have a RedHat 5.0 system, you should remove the GTK package that"
4423          echo "*** came with the system with the command"
4424          echo "***"
4425          echo "***    rpm --erase --nodeps gtk gtk-devel" ],
4426        [ echo "*** The test program failed to compile or link. See the file config.log for the"
4427          echo "*** exact error that occured. This usually means GTK was incorrectly installed"
4428          echo "*** or that you have moved GTK since it was installed. In the latter case, you"
4429          echo "*** may want to edit the gtk-config script: $GTK_CONFIG" ])
4430          CFLAGS="$ac_save_CFLAGS"
4431          LIBS="$ac_save_LIBS"
4432       fi
4433     fi
4434     GTK_CFLAGS=""
4435     GTK_LIBS=""
4436     ifelse([$3], , :, [$3])
4437  fi
4438  AC_SUBST(GTK_CFLAGS)
4439  AC_SUBST(GTK_LIBS)
4440  rm -f conf.gtktest
4441])
4442
4443dnl GNOME_COMPILE_WARNINGS
4444dnl Turn on many useful compiler warnings
4445dnl For now, only works on GCC
4446AC_DEFUN([GNOME_COMPILE_WARNINGS],[
4447  AC_ARG_ENABLE(compile-warnings,
4448    [  --enable-compile-warnings=[no/minimum/yes]       Turn on compiler warnings.],,enable_compile_warnings=minimum)
4449
4450  AC_MSG_CHECKING(what warning flags to pass to the C compiler)
4451  warnCFLAGS=
4452  if test "x$GCC" != xyes; then
4453    enable_compile_warnings=no
4454  fi
4455
4456  if test "x$enable_compile_warnings" != "xno"; then
4457    if test "x$GCC" = "xyes"; then
4458      case " $CFLAGS " in
4459      *[\ \     ]-Wall[\ \      ]*) ;;
4460      *) warnCFLAGS="-Wall -Wunused" ;;
4461      esac
4462
4463      ## -W is not all that useful.  And it cannot be controlled
4464      ## with individual -Wno-xxx flags, unlike -Wall
4465      if test "x$enable_compile_warnings" = "xyes"; then
4466        warnCFLAGS="$warnCFLAGS -Wmissing-prototypes -Wmissing-declarations"
4467      fi
4468    fi
4469  fi
4470  AC_MSG_RESULT($warnCFLAGS)
4471
4472  AC_ARG_ENABLE(iso-c,
4473    [  --enable-iso-c          Try to warn if code is not ISO C ],,
4474    enable_iso_c=no)
4475
4476  AC_MSG_CHECKING(what language compliance flags to pass to the C compiler)
4477  complCFLAGS=
4478  if test "x$enable_iso_c" != "xno"; then
4479    if test "x$GCC" = "xyes"; then
4480      case " $CFLAGS " in
4481      *[\ \     ]-ansi[\ \      ]*) ;;
4482      *) complCFLAGS="$complCFLAGS -ansi" ;;
4483      esac
4484
4485      case " $CFLAGS " in
4486      *[\ \     ]-pedantic[\ \  ]*) ;;
4487      *) complCFLAGS="$complCFLAGS -pedantic" ;;
4488      esac
4489    fi
4490  fi
4491  AC_MSG_RESULT($complCFLAGS)
4492  if test "x$cflags_set" != "xyes"; then
4493    CFLAGS="$CFLAGS $warnCFLAGS $complCFLAGS"
4494    cflags_set=yes
4495    AC_SUBST(cflags_set)
4496  fi
4497])
4498
4499dnl For C++, do basically the same thing.
4500
4501AC_DEFUN([GNOME_CXX_WARNINGS],[
4502  AC_ARG_ENABLE(cxx-warnings,
4503    [  --enable-cxx-warnings=[no/minimum/yes]   Turn on compiler warnings.],,enable_cxx_warnings=minimum)
4504
4505  AC_MSG_CHECKING(what warning flags to pass to the C++ compiler)
4506  warnCXXFLAGS=
4507  if test "x$GCC" != xyes; then
4508    enable_compile_warnings=no
4509  fi
4510  if test "x$enable_cxx_warnings" != "xno"; then
4511    if test "x$GCC" = "xyes"; then
4512      case " $CXXFLAGS " in
4513      *[\ \     ]-Wall[\ \      ]*) ;;
4514      *) warnCXXFLAGS="-Wall -Wno-unused" ;;
4515      esac
4516
4517      ## -W is not all that useful.  And it cannot be controlled
4518      ## with individual -Wno-xxx flags, unlike -Wall
4519      if test "x$enable_cxx_warnings" = "xyes"; then
4520        warnCXXFLAGS="$warnCXXFLAGS -Wmissing-prototypes -Wmissing-declarations -Wshadow -Woverloaded-virtual"
4521      fi
4522    fi
4523  fi
4524  AC_MSG_RESULT($warnCXXFLAGS)
4525
4526   AC_ARG_ENABLE(iso-cxx,
4527     [  --enable-iso-cxx          Try to warn if code is not ISO C++ ],,
4528     enable_iso_cxx=no)
4529
4530   AC_MSG_CHECKING(what language compliance flags to pass to the C++ compiler)
4531   complCXXFLAGS=
4532   if test "x$enable_iso_cxx" != "xno"; then
4533     if test "x$GCC" = "xyes"; then
4534      case " $CXXFLAGS " in
4535      *[\ \     ]-ansi[\ \      ]*) ;;
4536      *) complCXXFLAGS="$complCXXFLAGS -ansi" ;;
4537      esac
4538
4539      case " $CXXFLAGS " in
4540      *[\ \     ]-pedantic[\ \  ]*) ;;
4541      *) complCXXFLAGS="$complCXXFLAGS -pedantic" ;;
4542      esac
4543     fi
4544   fi
4545  AC_MSG_RESULT($complCXXFLAGS)
4546  if test "x$cxxflags_set" != "xyes"; then
4547    CXXFLAGS="$CXXFLAGS $warnCXXFLAGS $complCXXFLAGS"
4548    cxxflags_set=yes
4549    AC_SUBST(cxxflags_set)
4550  fi
4551])
4552
4553dnl
4554dnl And better, use gthreads instead...
4555dnl
4556
4557AC_DEFUN([GNOME_PTHREAD_CHECK],[
4558        PTHREAD_LIB=""
4559        AC_CHECK_LIB(pthread, pthread_create, PTHREAD_LIB="-lpthread",
4560                [AC_CHECK_LIB(pthreads, pthread_create, PTHREAD_LIB="-lpthreads",
4561                    [AC_CHECK_LIB(c_r, pthread_create, PTHREAD_LIB="-lc_r",
4562                        [AC_CHECK_LIB(pthread, __pthread_attr_init_system, PTHREAD_LIB="-lpthread",
4563                                [AC_CHECK_FUNC(pthread_create)]
4564                        )]
4565                    )]
4566                )]
4567        )
4568        AC_SUBST(PTHREAD_LIB)
4569        AC_PROVIDE([GNOME_PTHREAD_CHECK])
4570])
4571
4572# Macro to add for using GNU gettext.
4573# Ulrich Drepper <drepper@cygnus.com>, 1995.
4574#
4575# Modified to never use included libintl.
4576# Owen Taylor <otaylor@redhat.com>, 12/15/1998
4577#
4578#
4579# This file can be copied and used freely without restrictions.  It can
4580# be used in projects which are not available under the GNU Public License
4581# but which still want to provide support for the GNU gettext functionality.
4582# Please note that the actual code is *not* freely available.
4583
4584# serial 5
4585
4586AC_DEFUN([AM_GNOME_WITH_NLS],
4587  [AC_MSG_CHECKING([whether NLS is requested])
4588    dnl Default is enabled NLS
4589    AC_ARG_ENABLE(nls,
4590      [  --disable-nls           do not use Native Language Support],
4591      USE_NLS=$enableval, USE_NLS=yes)
4592    AC_MSG_RESULT($USE_NLS)
4593    AC_SUBST(USE_NLS)
4594
4595    BUILD_INCLUDED_LIBINTL=no
4596    USE_INCLUDED_LIBINTL=no
4597
4598    dnl If we use NLS figure out what method
4599    if test "$USE_NLS" = "yes"; then
4600#      AC_DEFINE(ENABLE_NLS)
4601#      AC_MSG_CHECKING([whether included gettext is requested])
4602#      AC_ARG_WITH(included-gettext,
4603#        [  --with-included-gettext use the GNU gettext library included here],
4604#        nls_cv_force_use_gnu_gettext=$withval,
4605#        nls_cv_force_use_gnu_gettext=no)
4606#      AC_MSG_RESULT($nls_cv_force_use_gnu_gettext)
4607      nls_cv_force_use_gnu_gettext="no"
4608
4609      nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
4610      if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
4611        dnl User does not insist on using GNU NLS library.  Figure out what
4612        dnl to use.  If gettext or catgets are available (in this order) we
4613        dnl use this.  Else we have to fall back to GNU NLS library.
4614        dnl catgets is only used if permitted by option --with-catgets.
4615        nls_cv_header_intl=
4616        nls_cv_header_libgt=
4617        CATOBJEXT=NONE
4618
4619        AC_CHECK_HEADER(libintl.h,
4620          [AC_CACHE_CHECK([for gettext in libc], gt_cv_func_gettext_libc,
4621            [AC_TRY_LINK([#include <libintl.h>], [return (int) gettext ("")],
4622               gt_cv_func_gettext_libc=yes, gt_cv_func_gettext_libc=no)])
4623
4624           if test "$gt_cv_func_gettext_libc" != "yes"; then
4625             AC_CHECK_LIB(intl, bindtextdomain,
4626               [AC_CACHE_CHECK([for gettext in libintl],
4627                 gt_cv_func_gettext_libintl,
4628                 [AC_CHECK_LIB(intl, gettext,
4629                  gt_cv_func_gettext_libintl=yes,
4630                  gt_cv_func_gettext_libintl=no)],
4631                 gt_cv_func_gettext_libintl=no)])
4632           fi
4633
4634           if test "$gt_cv_func_gettext_libc" = "yes" \
4635              || test "$gt_cv_func_gettext_libintl" = "yes"; then
4636              AC_DEFINE(HAVE_GETTEXT)
4637              AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
4638                [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl
4639              if test "$MSGFMT" != "no"; then
4640                AC_CHECK_FUNCS(dcgettext)
4641                AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
4642                AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
4643                  [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
4644                AC_TRY_LINK(, [extern int _nl_msg_cat_cntr;
4645                               return _nl_msg_cat_cntr],
4646                  [CATOBJEXT=.gmo
4647                   DATADIRNAME=share],
4648                  [CATOBJEXT=.mo
4649                   DATADIRNAME=lib])
4650                INSTOBJEXT=.mo
4651              fi
4652            fi
4653
4654            # Added by Martin Baulig 12/15/98 for libc5 systems
4655            if test "$gt_cv_func_gettext_libc" != "yes" \
4656               && test "$gt_cv_func_gettext_libintl" = "yes"; then
4657               INTLLIBS=-lintl
4658               LIBS=`echo $LIBS | sed -e 's/-lintl//'`
4659            fi
4660        ])
4661
4662        if test "$CATOBJEXT" = "NONE"; then
4663          AC_MSG_CHECKING([whether catgets can be used])
4664          AC_ARG_WITH(catgets,
4665            [  --with-catgets          use catgets functions if available],
4666            nls_cv_use_catgets=$withval, nls_cv_use_catgets=no)
4667          AC_MSG_RESULT($nls_cv_use_catgets)
4668
4669          if test "$nls_cv_use_catgets" = "yes"; then
4670            dnl No gettext in C library.  Try catgets next.
4671            AC_CHECK_LIB(i, main)
4672            AC_CHECK_FUNC(catgets,
4673              [AC_DEFINE(HAVE_CATGETS)
4674               INTLOBJS="\$(CATOBJS)"
4675               AC_PATH_PROG(GENCAT, gencat, no)dnl
4676#              if test "$GENCAT" != "no"; then
4677#                AC_PATH_PROG(GMSGFMT, gmsgfmt, no)
4678#                if test "$GMSGFMT" = "no"; then
4679#                  AM_PATH_PROG_WITH_TEST(GMSGFMT, msgfmt,
4680#                   [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)
4681#                fi
4682#                AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
4683#                  [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
4684#                USE_INCLUDED_LIBINTL=yes
4685#                CATOBJEXT=.cat
4686#                INSTOBJEXT=.cat
4687#                DATADIRNAME=lib
4688#                INTLDEPS='$(top_builddir)/intl/libintl.a'
4689#                INTLLIBS=$INTLDEPS
4690#                LIBS=`echo $LIBS | sed -e 's/-lintl//'`
4691#                nls_cv_header_intl=intl/libintl.h
4692#                nls_cv_header_libgt=intl/libgettext.h
4693#              fi
4694            ])
4695          fi
4696        fi
4697
4698        if test "$CATOBJEXT" = "NONE"; then
4699          dnl Neither gettext nor catgets in included in the C library.
4700          dnl Fall back on GNU gettext library.
4701          nls_cv_use_gnu_gettext=yes
4702        fi
4703      fi
4704
4705      if test "$nls_cv_use_gnu_gettext" != "yes"; then
4706        AC_DEFINE(ENABLE_NLS)
4707      else
4708         # Unset this variable since we use the non-zero value as a flag.
4709         CATOBJEXT=
4710#        dnl Mark actions used to generate GNU NLS library.
4711#        INTLOBJS="\$(GETTOBJS)"
4712#        AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
4713#         [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], msgfmt)
4714#        AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
4715#        AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
4716#         [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
4717#        AC_SUBST(MSGFMT)
4718#       USE_INCLUDED_LIBINTL=yes
4719#        CATOBJEXT=.gmo
4720#        INSTOBJEXT=.mo
4721#        DATADIRNAME=share
4722#       INTLDEPS='$(top_builddir)/intl/libintl.a'
4723#       INTLLIBS=$INTLDEPS
4724#       LIBS=`echo $LIBS | sed -e 's/-lintl//'`
4725#        nls_cv_header_intl=intl/libintl.h
4726#        nls_cv_header_libgt=intl/libgettext.h
4727      fi
4728
4729      dnl Test whether we really found GNU xgettext.
4730      if test "$XGETTEXT" != ":"; then
4731        dnl If it is no GNU xgettext we define it as : so that the
4732        dnl Makefiles still can work.
4733        if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
4734          : ;
4735        else
4736          AC_MSG_RESULT(
4737            [found xgettext program is not GNU xgettext; ignore it])
4738          XGETTEXT=":"
4739        fi
4740      fi
4741
4742      # We need to process the po/ directory.
4743      POSUB=po
4744    else
4745      DATADIRNAME=share
4746      nls_cv_header_intl=intl/libintl.h
4747      nls_cv_header_libgt=intl/libgettext.h
4748    fi
4749    AC_LINK_FILES($nls_cv_header_libgt, $nls_cv_header_intl)
4750    AC_OUTPUT_COMMANDS(
4751     [case "$CONFIG_FILES" in *po/Makefile.in*)
4752        sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile
4753      esac])
4754
4755
4756#    # If this is used in GNU gettext we have to set USE_NLS to `yes'
4757#    # because some of the sources are only built for this goal.
4758#    if test "$PACKAGE" = gettext; then
4759#      USE_NLS=yes
4760#      USE_INCLUDED_LIBINTL=yes
4761#    fi
4762
4763    dnl These rules are solely for the distribution goal.  While doing this
4764    dnl we only have to keep exactly one list of the available catalogs
4765    dnl in configure.in.
4766    for lang in $ALL_LINGUAS; do
4767      GMOFILES="$GMOFILES $lang.gmo"
4768      POFILES="$POFILES $lang.po"
4769    done
4770
4771    dnl Make all variables we use known to autoconf.
4772    AC_SUBST(BUILD_INCLUDED_LIBINTL)
4773    AC_SUBST(USE_INCLUDED_LIBINTL)
4774    AC_SUBST(CATALOGS)
4775    AC_SUBST(CATOBJEXT)
4776    AC_SUBST(DATADIRNAME)
4777    AC_SUBST(GMOFILES)
4778    AC_SUBST(INSTOBJEXT)
4779    AC_SUBST(INTLDEPS)
4780    AC_SUBST(INTLLIBS)
4781    AC_SUBST(INTLOBJS)
4782    AC_SUBST(POFILES)
4783    AC_SUBST(POSUB)
4784  ])
4785
4786AC_DEFUN([AM_GNOME_GETTEXT],
4787  [AC_REQUIRE([AC_PROG_MAKE_SET])dnl
4788   AC_REQUIRE([AC_PROG_CC])dnl
4789   AC_REQUIRE([AC_PROG_RANLIB])dnl
4790   AC_REQUIRE([AC_ISC_POSIX])dnl
4791   AC_REQUIRE([AC_HEADER_STDC])dnl
4792   AC_REQUIRE([AC_C_CONST])dnl
4793   AC_REQUIRE([AC_C_INLINE])dnl
4794   AC_REQUIRE([AC_TYPE_OFF_T])dnl
4795   AC_REQUIRE([AC_TYPE_SIZE_T])dnl
4796   AC_REQUIRE([AC_FUNC_ALLOCA])dnl
4797   AC_REQUIRE([AC_FUNC_MMAP])dnl
4798
4799   AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h string.h \
4800unistd.h sys/param.h])
4801   AC_CHECK_FUNCS([getcwd munmap putenv setenv setlocale strchr strcasecmp \
4802strdup __argz_count __argz_stringify __argz_next])
4803
4804   if test "${ac_cv_func_stpcpy+set}" != "set"; then
4805     AC_CHECK_FUNCS(stpcpy)
4806   fi
4807   if test "${ac_cv_func_stpcpy}" = "yes"; then
4808     AC_DEFINE(HAVE_STPCPY)
4809   fi
4810
4811   AM_LC_MESSAGES
4812   AM_GNOME_WITH_NLS
4813
4814   if test "x$CATOBJEXT" != "x"; then
4815     if test "x$ALL_LINGUAS" = "x"; then
4816       LINGUAS=
4817     else
4818       AC_MSG_CHECKING(for catalogs to be installed)
4819       NEW_LINGUAS=
4820       if test "x$LINGUAS" = "x"; then
4821           LINGUAS=$ALL_LINGUAS
4822       fi
4823       for lang in $LINGUAS; do
4824         case "$ALL_LINGUAS" in
4825          *\ $lang\ *|$lang\ *|*\ $lang) NEW_LINGUAS="$NEW_LINGUAS $lang" ;;
4826         esac
4827       done
4828       LINGUAS=$NEW_LINGUAS
4829       AC_MSG_RESULT($LINGUAS)
4830     fi
4831
4832     dnl Construct list of names of catalog files to be constructed.
4833     if test -n "$LINGUAS"; then
4834       for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
4835     fi
4836   fi
4837
4838   dnl The reference to <locale.h> in the installed <libintl.h> file
4839   dnl must be resolved because we cannot expect the users of this
4840   dnl to define HAVE_LOCALE_H.
4841   if test $ac_cv_header_locale_h = yes; then
4842     INCLUDE_LOCALE_H="#include <locale.h>"
4843   else
4844     INCLUDE_LOCALE_H="\
4845/* The system does not provide the header <locale.h>.  Take care yourself.  */"
4846   fi
4847   AC_SUBST(INCLUDE_LOCALE_H)
4848
4849   dnl Determine which catalog format we have (if any is needed)
4850   dnl For now we know about two different formats:
4851   dnl   Linux libc-5 and the normal X/Open format
4852   test -d intl || mkdir intl
4853   if test "$CATOBJEXT" = ".cat"; then
4854     AC_CHECK_HEADER(linux/version.h, msgformat=linux, msgformat=xopen)
4855
4856     dnl Transform the SED scripts while copying because some dumb SEDs
4857     dnl cannot handle comments.
4858     sed -e '/^#/d' $srcdir/intl/$msgformat-msg.sed > intl/po2msg.sed
4859   fi
4860   dnl po2tbl.sed is always needed.
4861   sed -e '/^#.*[^\\]$/d' -e '/^#$/d' \
4862     $srcdir/intl/po2tbl.sed.in > intl/po2tbl.sed
4863
4864   dnl In the intl/Makefile.in we have a special dependency which makes
4865   dnl only sense for gettext.  We comment this out for non-gettext
4866   dnl packages.
4867   if test "$PACKAGE" = "gettext"; then
4868     GT_NO="#NO#"
4869     GT_YES=
4870   else
4871     GT_NO=
4872     GT_YES="#YES#"
4873   fi
4874   AC_SUBST(GT_NO)
4875   AC_SUBST(GT_YES)
4876
4877   dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
4878   dnl find the mkinstalldirs script in another subdir but ($top_srcdir).
4879   dnl Try to locate is.
4880   MKINSTALLDIRS=
4881   if test -n "$ac_aux_dir"; then
4882     MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs"
4883   fi
4884   if test -z "$MKINSTALLDIRS"; then
4885     MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
4886   fi
4887   AC_SUBST(MKINSTALLDIRS)
4888
4889   dnl *** For now the libtool support in intl/Makefile is not for real.
4890   l=
4891   AC_SUBST(l)
4892
4893   dnl Generate list of files to be processed by xgettext which will
4894   dnl be included in po/Makefile.
4895   test -d po || mkdir po
4896   if test "x$srcdir" != "x."; then
4897     if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then
4898       posrcprefix="$srcdir/"
4899     else
4900       posrcprefix="../$srcdir/"
4901     fi
4902   else
4903     posrcprefix="../"
4904   fi
4905   rm -f po/POTFILES
4906   sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \
4907        < $srcdir/po/POTFILES.in > po/POTFILES
4908  ])
4909
4910
4911# Search path for a program which passes the given test.
4912# Ulrich Drepper <drepper@cygnus.com>, 1996.
4913#
4914# This file can be copied and used freely without restrictions.  It can
4915# be used in projects which are not available under the GNU General Public
4916# License but which still want to provide support for the GNU gettext
4917# functionality.
4918# Please note that the actual code of GNU gettext is covered by the GNU
4919# General Public License and is *not* in the public domain.
4920
4921# serial 2
4922
4923dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
4924dnl   TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
4925AC_DEFUN([AM_PATH_PROG_WITH_TEST],
4926[# Extract the first word of "$2", so it can be a program name with args.
4927set dummy $2; ac_word=[$]2
4928AC_MSG_CHECKING([for $ac_word])
4929AC_CACHE_VAL(ac_cv_path_$1,
4930[case "[$]$1" in
4931  /*)
4932  ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
4933  ;;
4934  *)
4935  IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
4936  for ac_dir in ifelse([$5], , $PATH, [$5]); do
4937    test -z "$ac_dir" && ac_dir=.
4938    if test -f $ac_dir/$ac_word; then
4939      if [$3]; then
4940        ac_cv_path_$1="$ac_dir/$ac_word"
4941        break
4942      fi
4943    fi
4944  done
4945  IFS="$ac_save_ifs"
4946dnl If no 4th arg is given, leave the cache variable unset,
4947dnl so AC_PATH_PROGS will keep looking.
4948ifelse([$4], , , [  test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
4949])dnl
4950  ;;
4951esac])dnl
4952$1="$ac_cv_path_$1"
4953if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
4954  AC_MSG_RESULT([$]$1)
4955else
4956  AC_MSG_RESULT(no)
4957fi
4958AC_SUBST($1)dnl
4959])
4960
4961# Check whether LC_MESSAGES is available in <locale.h>.
4962# Ulrich Drepper <drepper@cygnus.com>, 1995.
4963#
4964# This file can be copied and used freely without restrictions.  It can
4965# be used in projects which are not available under the GNU General Public
4966# License but which still want to provide support for the GNU gettext
4967# functionality.
4968# Please note that the actual code of GNU gettext is covered by the GNU
4969# General Public License and is *not* in the public domain.
4970
4971# serial 2
4972
4973AC_DEFUN([AM_LC_MESSAGES],
4974  [if test $ac_cv_header_locale_h = yes; then
4975    AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
4976      [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
4977       am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
4978    if test $am_cv_val_LC_MESSAGES = yes; then
4979      AC_DEFINE(HAVE_LC_MESSAGES, 1,
4980        [Define if your <locale.h> file defines LC_MESSAGES.])
4981    fi
4982  fi])
4983
4984dnl AM_PATH_GCONF([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]])
4985dnl Test for GCONF, and define GCONF_CFLAGS and GCONF_LIBS
4986dnl
4987AC_DEFUN(AM_PATH_GCONF,
4988[dnl
4989dnl Get the cflags and libraries from the gconf-config script
4990dnl
4991AC_ARG_WITH(gconf-prefix,[  --with-gconf-prefix=PFX   Prefix where GCONF is installed (optional)],
4992            gconf_config_prefix="$withval", gconf_config_prefix="")
4993AC_ARG_WITH(gconf-exec-prefix,[  --with-gconf-exec-prefix=PFX Exec prefix where GCONF is installed (optional)],
4994            gconf_config_exec_prefix="$withval", gconf_config_exec_prefix="")
4995AC_ARG_ENABLE(gconftest, [  --disable-gconftest       Do not try to compile and run a test GCONF program],
4996                    , enable_gconftest=yes)
4997
4998  gconf_config_args="$gconf_config_args"
4999
5000  if test x$gconf_config_exec_prefix != x ; then
5001     gconf_config_args="$gconf_config_args --exec-prefix=$gconf_config_exec_prefix"
5002     if test x${GCONF_CONFIG+set} != xset ; then
5003        GCONF_CONFIG=$gconf_config_exec_prefix/bin/gconf-config
5004     fi
5005  fi
5006  if test x$gconf_config_prefix != x ; then
5007     gconf_config_args="$gconf_config_args --prefix=$gconf_config_prefix"
5008     if test x${GCONF_CONFIG+set} != xset ; then
5009        GCONF_CONFIG=$gconf_config_prefix/bin/gconf-config
5010     fi
5011  fi
5012
5013  AC_PATH_PROG(GCONF_CONFIG, gconf-config, no)
5014  min_gconf_version=ifelse([$1], , 0.5, $1)
5015  AC_MSG_CHECKING(for GCONF - version >= $min_gconf_version)
5016  no_gconf=""
5017  if test "$GCONF_CONFIG" = "no" ; then
5018    no_gconf=yes
5019  else
5020    GCONF_CFLAGS="`$GCONF_CONFIG  $gconf_config_args --cflags $4`"
5021    GCONF_LIBS="`$GCONF_CONFIG  $gconf_config_args --libs $4`"
5022    gconf_config_major_version=`$GCONF_CONFIG $gconf_config_args --version | \
5023           sed -e 's,^[[^0-9.]]*,,g' -e 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
5024    gconf_config_minor_version=`$GCONF_CONFIG $gconf_config_args --version | \
5025           sed -e 's,^[[^0-9.]]*,,g' -e 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
5026    gconf_config_micro_version=`$GCONF_CONFIG $gconf_config_args --version | \
5027           sed -e 's,^[[^0-9\.]]*,,g' -e 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
5028  fi
5029  if test "x$no_gconf" = x ; then
5030     AC_MSG_RESULT(yes)
5031     ifelse([$2], , :, [$2])     
5032  else
5033     AC_MSG_RESULT(no)
5034     if test "$GCONF_CONFIG" = "no" ; then
5035       echo "*** The gconf-config script installed by GCONF could not be found"
5036       echo "*** If GCONF was installed in PREFIX, make sure PREFIX/bin is in"
5037       echo "*** your path, or set the GCONF_CONFIG environment variable to the"
5038       echo "*** full path to gconf-config."
5039     else
5040        :
5041     fi
5042     GCONF_CFLAGS=""
5043     GCONF_LIBS=""
5044     ifelse([$3], , :, [$3])
5045  fi
5046  AC_SUBST(GCONF_CFLAGS)
5047  AC_SUBST(GCONF_LIBS)
5048  rm -f conf.gconftest
5049])
5050
5051dnl AM_GCONF_SOURCE
5052dnl Define GCONF_SCHEMA_CONFIG_SOURCE
5053dnl
5054AC_DEFUN(AM_GCONF_SOURCE,
5055[
5056if test "x$GCONF_SCHEMA_INSTALL_SOURCE" = "x"; then
5057  GCONF_SCHEMA_CONFIG_SOURCE=`gconftool --get-default-source`
5058else
5059  GCONF_SCHEMA_CONFIG_SOURCE=$GCONF_SCHEMA_INSTALL_SOURCE
5060fi
5061
5062AC_ARG_WITH(gconf-source,
5063[  --with-gconf-source=sourceaddress      Where to install schema files.],GCONF_SCHEMA_CONFIG_SOURCE="$withval",)
5064
5065  AC_SUBST(GCONF_SCHEMA_CONFIG_SOURCE)
5066  AC_MSG_RESULT("Using config source $GCONF_SCHEMA_CONFIG_SOURCE for schema installation")
5067])
5068
5069dnl
5070dnl Check for struct linger
5071dnl
5072AC_DEFUN([AC_STRUCT_LINGER], [
5073av_struct_linger=no
5074AC_MSG_CHECKING(struct linger is available)
5075AC_TRY_RUN([
5076#include <sys/types.h>
5077#include <sys/socket.h>
5078
5079struct linger li;
5080
5081int main ()
5082{
5083    li.l_onoff = 1;
5084    li.l_linger = 120;
5085    return 0;
5086}
5087],[
5088AC_DEFINE(HAVE_STRUCT_LINGER)
5089av_struct_linger=yes
5090],[
5091av_struct_linger=no
5092],[
5093av_struct_linger=no
5094])
5095AC_MSG_RESULT($av_struct_linger)
5096])
5097
5098#serial 2
5099
5100# Test for the GNU C Library, version 2.1 or newer.
5101# From Bruno Haible.
5102
5103AC_DEFUN([jm_GLIBC21],
5104  [
5105    AC_CACHE_CHECK(whether we are using the GNU C Library 2.1 or newer,
5106      ac_cv_gnu_library_2_1,
5107      [AC_EGREP_CPP([Lucky GNU user],
5108        [
5109#include <features.h>
5110#ifdef __GNU_LIBRARY__
5111 #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2)
5112  Lucky GNU user
5113 #endif
5114#endif
5115        ],
5116        ac_cv_gnu_library_2_1=yes,
5117        ac_cv_gnu_library_2_1=no)
5118      ]
5119    )
5120    AC_SUBST(GLIBC21)
5121    GLIBC21="$ac_cv_gnu_library_2_1"
5122  ]
5123)
5124
Note: See TracBrowser for help on using the repository browser.