source: trunk/third/gettext/aclocal.m4 @ 16931

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