Busybox: Upgrade to 1.21.1 (stable). lsof active.
[tomato.git] / release / src / router / snmp / aclocal.m4
blobad0babc6ea87c4bba1e660394902d05f8641890e
1 dnl @synopsis AC_PROMPT_USER_NO_DEFINE(VARIABLENAME,QUESTION,[DEFAULT])
2 dnl
3 dnl Asks a QUESTION and puts the results in VARIABLENAME with an optional
4 dnl DEFAULT value if the user merely hits return.
5 dnl
6 dnl @version 1.15
7 dnl @author Wes Hardaker <hardaker@users.sourceforge.net>
8 dnl
9 AC_DEFUN([AC_PROMPT_USER_NO_DEFINE],
10 dnl changequote(<<, >>) dnl
11 dnl <<
13 if test "x$defaults" = "xno"; then
14 echo $ac_n "$2 ($3): $ac_c"
15 read tmpinput
16 if test "$tmpinput" = "" -a "$3" != ""; then
17   tmpinput="$3"
19 eval $1=\"$tmpinput\"
20 else
21 tmpinput="$3"
22 eval $1=\"$tmpinput\"
25 dnl >>
26 dnl changequote([, ])
27 ) dnl done AC_PROMPT_USER
29 dnl @synopsis AC_PROMPT_USER(VARIABLENAME,QUESTION,[DEFAULT],QUOTED)
30 dnl
31 dnl Asks a QUESTION and puts the results in VARIABLENAME with an optional
32 dnl DEFAULT value if the user merely hits return.  Also calls 
33 dnl AC_DEFINE_UNQUOTED() on the VARIABLENAME for VARIABLENAMEs that should
34 dnl be entered into the config.h file as well.  If QUOTED is "quoted" then
35 dnl the result will be defined within quotes.
36 dnl
37 dnl @version 1.15
38 dnl @author Wes Hardaker <hardaker@users.sourceforge.net>
39 dnl
40 AC_DEFUN([AC_PROMPT_USER],
42 MSG_CHECK=`echo "$2" | tail -1`
43 AC_CACHE_CHECK($MSG_CHECK, ac_cv_user_prompt_$1,
44 [echo "" >&AC_FD_MSG
45 AC_PROMPT_USER_NO_DEFINE($1,[$2],$3)
46 eval ac_cv_user_prompt_$1=\$$1
47 echo $ac_n "setting $MSG_CHECK to...  $ac_c" >&AC_FD_MSG
49 if test "$ac_cv_user_prompt_$1" != "none"; then
50   if test "x$4" = "xquoted" -o "x$4" = "xQUOTED"; then
51     AC_DEFINE_UNQUOTED($1,"$ac_cv_user_prompt_$1")
52   else
53     AC_DEFINE_UNQUOTED($1,$ac_cv_user_prompt_$1)
54   fi
56 ]) dnl
58 dnl @synopsis AC_CHECK_STRUCT_FOR(INCLUDES,STRUCT,MEMBER,DEFINE,[no])
59 dnl
60 dnl Checks STRUCT for MEMBER and defines DEFINE if found.
61 dnl
62 dnl @version 1.15
63 dnl @author Wes Hardaker <hardaker@users.sourceforge.net>
64 dnl
65 AC_DEFUN(AC_CHECK_STRUCT_FOR,[
67 ac_safe_struct=`echo "$2" | sed 'y%./+-%__p_%'`
68 ac_safe_member=`echo "$3" | sed 'y%./+-%__p_%'`
69 ac_safe_all="ac_cv_struct_${ac_safe_struct}_has_${ac_safe_member}"
70 changequote(, )dnl
71   ac_uc_define=STRUCT_`echo "${ac_safe_struct}_HAS_${ac_safe_member}" | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
72 changequote([, ])dnl
74 AC_MSG_CHECKING([for $2.$3])
75 AC_CACHE_VAL($ac_safe_all,
77 if test "x$4" = "x"; then
78   defineit="= 0"
79 elif test "x$4" = "xno"; then
80   defineit=""
81 else
82   defineit="$4"
84 AC_TRY_COMPILE([
86 ],[
87 struct $2 testit; 
88 testit.$3 $defineit;
89 ], eval "${ac_safe_all}=yes", eval "${ac_safe_all}=no" )
92 if eval "test \"x$`echo ${ac_safe_all}`\" = \"xyes\""; then
93   AC_MSG_RESULT(yes)
94   AC_DEFINE_UNQUOTED($ac_uc_define)
95 else
96   AC_MSG_RESULT(no)
101 dnl AC_CHECK_IFNET_FOR(SUBSTRUCT,[no])
102 AC_DEFUN(AC_CHECK_IFNET_FOR,[
103 dnl check for $1 in struct ifnet
104 AC_CHECK_STRUCT_FOR([
105 #ifdef IFNET_NEEDS_KERNEL
106 #define _KERNEL 1
107 #endif
108 #include <sys/types.h>
109 #include <sys/socket.h>
110 #ifdef HAVE_SYS_TIME_H
111 #include <sys/time.h>
112 #endif
113 #include <net/if.h>
114 #ifdef HAVE_NET_IF_VAR_H
115 #include <net/if_var.h>
116 #endif
117 #ifdef HAVE_SYS_QUEUE_H
118 #include <sys/queue.h>
119 #endif
120 #ifdef linux
121 struct ifnet {
122         char    *if_name;               /* name, e.g. "en" or "lo" */
123         short   if_unit;                /* sub-unit for lower level driver */
124         short   if_mtu;                 /* maximum transmission unit */
125         short   if_flags;               /* up/down, broadcast, etc. */
126         int     if_metric;              /* routing metric (external only) */
127         char    if_hwaddr [6];          /* ethernet address */
128         int     if_type;                /* interface type: 1=generic,
129                                            28=slip, ether=6, loopback=24 */
130         int     if_speed;               /* interface speed: in bits/sec */
132         struct sockaddr if_addr;        /* interface's address */
133         struct sockaddr ifu_broadaddr;  /* broadcast address */
134         struct sockaddr ia_subnetmask;  /* interface's mask */
136         struct  ifqueue {
137                 int     ifq_len;
138                 int     ifq_drops;
139         } if_snd;                       /* output queue */
140         int     if_ibytes;              /* octets received on interface */
141         int     if_ipackets;            /* packets received on interface */
142         int     if_ierrors;             /* input errors on interface */
143         int     if_iqdrops;             /* input queue overruns */
144         int     if_obytes;              /* octets sent on interface */
145         int     if_opackets;            /* packets sent on interface */
146         int     if_oerrors;             /* output errors on interface */
147         int     if_collisions;          /* collisions on csma interfaces */
148 /* end statistics */
149         struct  ifnet *if_next;
151 #endif
152 ], ifnet, $1, $2)
156 dnl Add a search path to the LIBS and CFLAGS variables
158 AC_DEFUN(AC_ADD_SEARCH_PATH,[
159   if test "x$1" != x -a -d $1; then
160      if test -d $1/lib; then
161        LDFLAGS="-L$1/lib $LDFLAGS"
162      fi
163      if test -d $1/include; then
164         CPPFLAGS="-I$1/include $CPPFLAGS"
165      fi
166   fi
170 dnl Store information for displaying later.
172 AC_DEFUN(AC_MSG_CACHE_INIT,[
173   rm -f configure-summary
176 AC_DEFUN(AC_MSG_CACHE_ADD,[
177   cat >> configure-summary << EOF
178   $1
182 AC_DEFUN(AC_MSG_CACHE_DISPLAY,[
183   echo ""
184   echo "---------------------------------------------------------"
185   echo "            Net-SNMP configuration summary:"
186   echo "---------------------------------------------------------"
187   echo ""
188   cat configure-summary
189   echo ""
190   echo "---------------------------------------------------------"
191   echo ""
196 dnl Stuff taken from libtool.m4 from the libtool package
199 # libtool.m4 - Configure libtool for the host system. -*-Shell-script-*-
200 ## Copyright 1996, 1997, 1998, 1999, 2000, 2001
201 ## Free Software Foundation, Inc.
202 ## Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
204 ## This program is free software; you can redistribute it and/or modify
205 ## it under the terms of the GNU General Public License as published by
206 ## the Free Software Foundation; either version 2 of the License, or
207 ## (at your option) any later version.
209 ## This program is distributed in the hope that it will be useful, but
210 ## WITHOUT ANY WARRANTY; without even the implied warranty of
211 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
212 ## General Public License for more details.
214 ## You should have received a copy of the GNU General Public License
215 ## along with this program; if not, write to the Free Software
216 ## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
218 ## As a special exception to the GNU General Public License, if you
219 ## distribute this file as part of a program that contains a
220 ## configuration script generated by Autoconf, you may include it under
221 ## the same distribution terms that you use for the rest of that program.
223 # serial 46 AC_PROG_LIBTOOL
225 AC_DEFUN([AC_PROG_LIBTOOL],
226 [AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
228 # This can be used to rebuild libtool when needed
229 LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh"
231 # Always use our own libtool.
232 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
233 AC_SUBST(LIBTOOL)dnl
235 # Prevent multiple expansion
236 define([AC_PROG_LIBTOOL], [])
239 AC_DEFUN([AC_LIBTOOL_SETUP],
240 [AC_PREREQ(2.13)dnl
241 AC_REQUIRE([AC_ENABLE_SHARED])dnl
242 AC_REQUIRE([AC_ENABLE_STATIC])dnl
243 AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
244 AC_REQUIRE([AC_CANONICAL_HOST])dnl
245 AC_REQUIRE([AC_CANONICAL_BUILD])dnl
246 AC_REQUIRE([AC_PROG_CC])dnl
247 AC_REQUIRE([AC_PROG_LD])dnl
248 AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl
249 AC_REQUIRE([AC_PROG_NM])dnl
250 AC_REQUIRE([LT_AC_PROG_SED])dnl
252 AC_REQUIRE([AC_PROG_LN_S])dnl
253 AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl
254 AC_REQUIRE([AC_OBJEXT])dnl
255 AC_REQUIRE([AC_EXEEXT])dnl
258 _LT_AC_PROG_ECHO_BACKSLASH
259 # Only perform the check for file, if the check method requires it
260 case $deplibs_check_method in
261 file_magic*)
262   if test "$file_magic_cmd" = '$MAGIC_CMD'; then
263     AC_PATH_MAGIC
264   fi
265   ;;
266 esac
268 AC_CHECK_TOOL(RANLIB, ranlib, :)
269 AC_CHECK_TOOL(STRIP, strip, :)
271 ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no)
272 ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
273 enable_win32_dll=yes, enable_win32_dll=no)
275 AC_ARG_ENABLE(libtool-lock,
276   [  --disable-libtool-lock  avoid locking (might break parallel builds)])
277 test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
279 # Some flags need to be propagated to the compiler or linker for good
280 # libtool support.
281 case $host in
282 *-*-irix6*)
283   # Find out which ABI we are using.
284   echo '[#]line __oline__ "configure"' > conftest.$ac_ext
285   if AC_TRY_EVAL(ac_compile); then
286     case `/usr/bin/file conftest.$ac_objext` in
287     *32-bit*)
288       LD="${LD-ld} -32"
289       ;;
290     *N32*)
291       LD="${LD-ld} -n32"
292       ;;
293     *64-bit*)
294       LD="${LD-ld} -64"
295       ;;
296     esac
297   fi
298   rm -rf conftest*
299   ;;
301 *-*-sco3.2v5*)
302   # On SCO OpenServer 5, we need -belf to get full-featured binaries.
303   SAVE_CFLAGS="$CFLAGS"
304   CFLAGS="$CFLAGS -belf"
305   AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
306     [AC_LANG_SAVE
307      AC_LANG_C
308      AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
309      AC_LANG_RESTORE])
310   if test x"$lt_cv_cc_needs_belf" != x"yes"; then
311     # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
312     CFLAGS="$SAVE_CFLAGS"
313   fi
314   ;;
316 ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
317 [*-*-cygwin* | *-*-mingw* | *-*-pw32*)
318   AC_CHECK_TOOL(DLLTOOL, dlltool, false)
319   AC_CHECK_TOOL(AS, as, false)
320   AC_CHECK_TOOL(OBJDUMP, objdump, false)
322   # recent cygwin and mingw systems supply a stub DllMain which the user
323   # can override, but on older systems we have to supply one
324   AC_CACHE_CHECK([if libtool should supply DllMain function], lt_cv_need_dllmain,
325     [AC_TRY_LINK([],
326       [extern int __attribute__((__stdcall__)) DllMain(void*, int, void*);
327       DllMain (0, 0, 0);],
328       [lt_cv_need_dllmain=no],[lt_cv_need_dllmain=yes])])
330   case $host/$CC in
331   *-*-cygwin*/gcc*-mno-cygwin*|*-*-mingw*)
332     # old mingw systems require "-dll" to link a DLL, while more recent ones
333     # require "-mdll"
334     SAVE_CFLAGS="$CFLAGS"
335     CFLAGS="$CFLAGS -mdll"
336     AC_CACHE_CHECK([how to link DLLs], lt_cv_cc_dll_switch,
337       [AC_TRY_LINK([], [], [lt_cv_cc_dll_switch=-mdll],[lt_cv_cc_dll_switch=-dll])])
338     CFLAGS="$SAVE_CFLAGS" ;;
339   *-*-cygwin* | *-*-pw32*)
340     # cygwin systems need to pass --dll to the linker, and not link
341     # crt.o which will require a WinMain@16 definition.
342     lt_cv_cc_dll_switch="-Wl,--dll -nostartfiles" ;;
343   esac
344   ;;
345   ])
346 esac
348 _LT_AC_LTCONFIG_HACK
352 # AC_LIBTOOL_HEADER_ASSERT
353 # ------------------------
354 AC_DEFUN([AC_LIBTOOL_HEADER_ASSERT],
355 [AC_CACHE_CHECK([whether $CC supports assert without backlinking],
356     [lt_cv_func_assert_works],
357     [case $host in
358     *-*-solaris*)
359       if test "$GCC" = yes && test "$with_gnu_ld" != yes; then
360         case `$CC --version 2>/dev/null` in
361         [[12]].*) lt_cv_func_assert_works=no ;;
362         *)        lt_cv_func_assert_works=yes ;;
363         esac
364       fi
365       ;;
366     esac])
368 if test "x$lt_cv_func_assert_works" = xyes; then
369   AC_CHECK_HEADERS(assert.h)
371 ])# AC_LIBTOOL_HEADER_ASSERT
373 # _LT_AC_CHECK_DLFCN
374 # --------------------
375 AC_DEFUN([_LT_AC_CHECK_DLFCN],
376 [AC_CHECK_HEADERS(dlfcn.h)
377 ])# _LT_AC_CHECK_DLFCN
379 # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
380 # ---------------------------------
381 AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE],
382 [AC_REQUIRE([AC_CANONICAL_HOST])
383 AC_REQUIRE([AC_PROG_NM])
384 AC_REQUIRE([AC_OBJEXT])
385 # Check for command to grab the raw symbol name followed by C symbol from nm.
386 AC_MSG_CHECKING([command to parse $NM output])
387 AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], [dnl
389 # These are sane defaults that work on at least a few old systems.
390 # [They come from Ultrix.  What could be older than Ultrix?!! ;)]
392 # Character class describing NM global symbol codes.
393 symcode='[[BCDEGRST]]'
395 # Regexp to match symbols that can be accessed directly from C.
396 sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
398 # Transform the above into a raw symbol and a C symbol.
399 symxfrm='\1 \2\3 \3'
401 # Transform an extracted symbol line into a proper C declaration
402 lt_cv_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern char \1;/p'"
404 # Transform an extracted symbol line into symbol name and symbol address
405 lt_cv_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/  {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (lt_ptr) \&\2},/p'"
407 # Define system-specific variables.
408 case $host_os in
409 aix*)
410   symcode='[[BCDT]]'
411   ;;
412 cygwin* | mingw* | pw32*)
413   symcode='[[ABCDGISTW]]'
414   ;;
415 hpux*) # Its linker distinguishes data from code symbols
416   lt_cv_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern char \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
417   lt_cv_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/  {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (lt_ptr) \&\2},/p'"
418   ;;
419 irix* | nonstopux*)
420   symcode='[[BCDEGRST]]'
421   ;;
422 osf*)
423   symcode='[[BCDEGQRST]]'
424   ;;
425 solaris* | sysv5*)
426   symcode='[[BDT]]'
427   ;;
428 sysv4)
429   symcode='[[DFNSTU]]'
430   ;;
431 esac
433 # Handle CRLF in mingw tool chain
434 opt_cr=
435 case $host_os in
436 mingw*)
437   opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp
438   ;;
439 esac
441 # If we're using GNU nm, then use its standard symbol codes.
442 if $NM -V 2>&1 | egrep '(GNU|with BFD)' > /dev/null; then
443   symcode='[[ABCDGISTW]]'
446 # Try without a prefix undercore, then with it.
447 for ac_symprfx in "" "_"; do
449   # Write the raw and C identifiers.
450 lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[        ]]\($symcode$symcode*\)[[       ]][[    ]]*\($ac_symprfx\)$sympat$opt_cr$/$symxfrm/p'"
452   # Check to see that the pipe works correctly.
453   pipe_works=no
454   rm -f conftest*
455   cat > conftest.$ac_ext <<EOF
456 #ifdef __cplusplus
457 extern "C" {
458 #endif
459 char nm_test_var;
460 void nm_test_func(){}
461 #ifdef __cplusplus
463 #endif
464 int main(){nm_test_var='a';nm_test_func();return(0);}
467   if AC_TRY_EVAL(ac_compile); then
468     # Now try to grab the symbols.
469     nlist=conftest.nm
470     if AC_TRY_EVAL(NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) && test -s "$nlist"; then
471       # Try sorting and uniquifying the output.
472       if sort "$nlist" | uniq > "$nlist"T; then
473         mv -f "$nlist"T "$nlist"
474       else
475         rm -f "$nlist"T
476       fi
478       # Make sure that we snagged all the symbols we need.
479       if egrep ' nm_test_var$' "$nlist" >/dev/null; then
480         if egrep ' nm_test_func$' "$nlist" >/dev/null; then
481           cat <<EOF > conftest.$ac_ext
482 #ifdef __cplusplus
483 extern "C" {
484 #endif
487           # Now generate the symbol file.
488           eval "$lt_cv_global_symbol_to_cdecl"' < "$nlist" >> conftest.$ac_ext'
490           cat <<EOF >> conftest.$ac_ext
491 #if defined (__STDC__) && __STDC__
492 # define lt_ptr void *
493 #else
494 # define lt_ptr char *
495 # define const
496 #endif
498 /* The mapping between symbol names and symbols. */
499 const struct {
500   const char *name;
501   lt_ptr address;
503 lt_preloaded_symbols[[]] =
506           sed "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (lt_ptr) \&\2},/" < "$nlist" >> conftest.$ac_ext
507           cat <<\EOF >> conftest.$ac_ext
508   {0, (lt_ptr) 0}
511 #ifdef __cplusplus
513 #endif
515           # Now try linking the two files.
516           mv conftest.$ac_objext conftstm.$ac_objext
517           save_LIBS="$LIBS"
518           save_CFLAGS="$CFLAGS"
519           LIBS="conftstm.$ac_objext"
520           CFLAGS="$CFLAGS$no_builtin_flag"
521           if AC_TRY_EVAL(ac_link) && test -s conftest$ac_exeext; then
522             pipe_works=yes
523           fi
524           LIBS="$save_LIBS"
525           CFLAGS="$save_CFLAGS"
526         else
527           echo "cannot find nm_test_func in $nlist" >&AC_FD_CC
528         fi
529       else
530         echo "cannot find nm_test_var in $nlist" >&AC_FD_CC
531       fi
532     else
533       echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AC_FD_CC
534     fi
535   else
536     echo "$progname: failed program was:" >&AC_FD_CC
537     cat conftest.$ac_ext >&5
538   fi
539   rm -f conftest* conftst*
541   # Do not use the global_symbol_pipe unless it works.
542   if test "$pipe_works" = yes; then
543     break
544   else
545     lt_cv_sys_global_symbol_pipe=
546   fi
547 done
549 global_symbol_pipe="$lt_cv_sys_global_symbol_pipe"
550 if test -z "$lt_cv_sys_global_symbol_pipe"; then
551   global_symbol_to_cdecl=
552   global_symbol_to_c_name_address=
553 else
554   global_symbol_to_cdecl="$lt_cv_global_symbol_to_cdecl"
555   global_symbol_to_c_name_address="$lt_cv_global_symbol_to_c_name_address"
557 if test -z "$global_symbol_pipe$global_symbol_to_cdec$global_symbol_to_c_name_address";
558 then
559   AC_MSG_RESULT(failed)
560 else
561   AC_MSG_RESULT(ok)
563 ]) # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
565 # _LT_AC_LIBTOOL_SYS_PATH_SEPARATOR
566 # ---------------------------------
567 AC_DEFUN([_LT_AC_LIBTOOL_SYS_PATH_SEPARATOR],
568 [# Find the correct PATH separator.  Usually this is `:', but
569 # DJGPP uses `;' like DOS.
570 if test "X${PATH_SEPARATOR+set}" != Xset; then
571   UNAME=${UNAME-`uname 2>/dev/null`}
572   case X$UNAME in
573     *-DOS) lt_cv_sys_path_separator=';' ;;
574     *)     lt_cv_sys_path_separator=':' ;;
575   esac
576   PATH_SEPARATOR=$lt_cv_sys_path_separator
578 ])# _LT_AC_LIBTOOL_SYS_PATH_SEPARATOR
580 # _LT_AC_PROG_ECHO_BACKSLASH
581 # --------------------------
582 # Add some code to the start of the generated configure script which
583 # will find an echo command which doesn't interpret backslashes.
584 AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH],
585 [ifdef([AC_DIVERSION_NOTICE], [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)],
586                               [AC_DIVERT_PUSH(NOTICE)])
587 _LT_AC_LIBTOOL_SYS_PATH_SEPARATOR
589 # Check that we are running under the correct shell.
590 SHELL=${CONFIG_SHELL-/bin/sh}
592 case X$ECHO in
593 X*--fallback-echo)
594   # Remove one level of quotation (which was required for Make).
595   ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','`
596   ;;
597 esac
599 echo=${ECHO-echo}
600 if test "X[$]1" = X--no-reexec; then
601   # Discard the --no-reexec flag, and continue.
602   shift
603 elif test "X[$]1" = X--fallback-echo; then
604   # Avoid inline document here, it may be left over
605   :
606 elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
607   # Yippee, $echo works!
608   :
609 else
610   # Restart under the correct shell.
611   exec $SHELL "[$]0" --no-reexec ${1+"[$]@"}
614 if test "X[$]1" = X--fallback-echo; then
615   # used as fallback echo
616   shift
617   cat <<EOF
620   exit 0
623 # The HP-UX ksh and POSIX shell print the target directory to stdout
624 # if CDPATH is set.
625 if test "X${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
627 if test -z "$ECHO"; then
628 if test "X${echo_test_string+set}" != Xset; then
629 # find a string as large as possible, as long as the shell can cope with it
630   for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do
631     # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
632     if (echo_test_string="`eval $cmd`") 2>/dev/null &&
633        echo_test_string="`eval $cmd`" &&
634        (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null
635     then
636       break
637     fi
638   done
641 if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
642    echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
643    test "X$echo_testing_string" = "X$echo_test_string"; then
644   :
645 else
646   # The Solaris, AIX, and Digital Unix default echo programs unquote
647   # backslashes.  This makes it impossible to quote backslashes using
648   #   echo "$something" | sed 's/\\/\\\\/g'
649   #
650   # So, first we look for a working echo in the user's PATH.
652   IFS="${IFS=   }"; save_ifs="$IFS"; IFS=$PATH_SEPARATOR
653   for dir in $PATH /usr/ucb; do
654     if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
655        test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
656        echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
657        test "X$echo_testing_string" = "X$echo_test_string"; then
658       echo="$dir/echo"
659       break
660     fi
661   done
662   IFS="$save_ifs"
664   if test "X$echo" = Xecho; then
665     # We didn't find a better echo, so look for alternatives.
666     if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' &&
667        echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` &&
668        test "X$echo_testing_string" = "X$echo_test_string"; then
669       # This shell has a builtin print -r that does the trick.
670       echo='print -r'
671     elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) &&
672          test "X$CONFIG_SHELL" != X/bin/ksh; then
673       # If we have ksh, try running configure again with it.
674       ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
675       export ORIGINAL_CONFIG_SHELL
676       CONFIG_SHELL=/bin/ksh
677       export CONFIG_SHELL
678       exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"}
679     else
680       # Try using printf.
681       echo='printf %s\n'
682       if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
683          echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
684          test "X$echo_testing_string" = "X$echo_test_string"; then
685         # Cool, printf works
686         :
687       elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
688            test "X$echo_testing_string" = 'X\t' &&
689            echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
690            test "X$echo_testing_string" = "X$echo_test_string"; then
691         CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
692         export CONFIG_SHELL
693         SHELL="$CONFIG_SHELL"
694         export SHELL
695         echo="$CONFIG_SHELL [$]0 --fallback-echo"
696       elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
697            test "X$echo_testing_string" = 'X\t' &&
698            echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
699            test "X$echo_testing_string" = "X$echo_test_string"; then
700         echo="$CONFIG_SHELL [$]0 --fallback-echo"
701       else
702         # maybe with a smaller string...
703         prev=:
705         for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do
706           if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null
707           then
708             break
709           fi
710           prev="$cmd"
711         done
713         if test "$prev" != 'sed 50q "[$]0"'; then
714           echo_test_string=`eval $prev`
715           export echo_test_string
716           exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"}
717         else
718           # Oops.  We lost completely, so just stick with echo.
719           echo=echo
720         fi
721       fi
722     fi
723   fi
727 # Copy echo and quote the copy suitably for passing to libtool from
728 # the Makefile, instead of quoting the original, which is used later.
729 ECHO=$echo
730 if test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then
731    ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo"
734 AC_SUBST(ECHO)
735 AC_DIVERT_POP
736 ])# _LT_AC_PROG_ECHO_BACKSLASH
738 # _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
739 #                           ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
740 # ------------------------------------------------------------------
741 AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF],
742 [if test "$cross_compiling" = yes; then :
743   [$4]
744 else
745   AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl
746   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
747   lt_status=$lt_dlunknown
748   cat > conftest.$ac_ext <<EOF
749 [#line __oline__ "configure"
750 #include "confdefs.h"
752 #if HAVE_DLFCN_H
753 #include <dlfcn.h>
754 #endif
756 #include <stdio.h>
758 #ifdef RTLD_GLOBAL
759 #  define LT_DLGLOBAL           RTLD_GLOBAL
760 #else
761 #  ifdef DL_GLOBAL
762 #    define LT_DLGLOBAL         DL_GLOBAL
763 #  else
764 #    define LT_DLGLOBAL         0
765 #  endif
766 #endif
768 /* We may have to define LT_DLLAZY_OR_NOW in the command line if we
769    find out it does not work in some platform. */
770 #ifndef LT_DLLAZY_OR_NOW
771 #  ifdef RTLD_LAZY
772 #    define LT_DLLAZY_OR_NOW            RTLD_LAZY
773 #  else
774 #    ifdef DL_LAZY
775 #      define LT_DLLAZY_OR_NOW          DL_LAZY
776 #    else
777 #      ifdef RTLD_NOW
778 #        define LT_DLLAZY_OR_NOW        RTLD_NOW
779 #      else
780 #        ifdef DL_NOW
781 #          define LT_DLLAZY_OR_NOW      DL_NOW
782 #        else
783 #          define LT_DLLAZY_OR_NOW      0
784 #        endif
785 #      endif
786 #    endif
787 #  endif
788 #endif
790 #ifdef __cplusplus
791 extern "C" void exit (int);
792 #endif
794 void fnord() { int i=42;}
795 int main ()
797   void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
798   int status = $lt_dlunknown;
800   if (self)
801     {
802       if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
803       else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
804       /* dlclose (self); */
805     }
807     exit (status);
810   if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
811     (./conftest; exit; ) 2>/dev/null
812     lt_status=$?
813     case x$lt_status in
814       x$lt_dlno_uscore) $1 ;;
815       x$lt_dlneed_uscore) $2 ;;
816       x$lt_unknown|x*) $3 ;;
817     esac
818   else :
819     # compilation failed
820     $3
821   fi
823 rm -fr conftest*
824 ])# _LT_AC_TRY_DLOPEN_SELF
826 # AC_LIBTOOL_DLOPEN_SELF
827 # -------------------
828 AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF],
829 [if test "x$enable_dlopen" != xyes; then
830   enable_dlopen=unknown
831   enable_dlopen_self=unknown
832   enable_dlopen_self_static=unknown
833 else
834   lt_cv_dlopen=no
835   lt_cv_dlopen_libs=
837   case $host_os in
838   beos*)
839     lt_cv_dlopen="load_add_on"
840     lt_cv_dlopen_libs=
841     lt_cv_dlopen_self=yes
842     ;;
844   cygwin* | mingw* | pw32*)
845     lt_cv_dlopen="LoadLibrary"
846     lt_cv_dlopen_libs=
847    ;;
849   *)
850     AC_CHECK_FUNC([shl_load],
851           [lt_cv_dlopen="shl_load"],
852       [AC_CHECK_LIB([dld], [shl_load],
853             [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"],
854         [AC_CHECK_FUNC([dlopen],
855               [lt_cv_dlopen="dlopen"],
856           [AC_CHECK_LIB([dl], [dlopen],
857                 [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
858             [AC_CHECK_LIB([svld], [dlopen],
859                   [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
860               [AC_CHECK_LIB([dld], [dld_link],
861                     [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"])
862               ])
863             ])
864           ])
865         ])
866       ])
867     ;;
868   esac
870   if test "x$lt_cv_dlopen" != xno; then
871     enable_dlopen=yes
872   else
873     enable_dlopen=no
874   fi
876   case $lt_cv_dlopen in
877   dlopen)
878     save_CPPFLAGS="$CPPFLAGS"
879     AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl
880     test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
882     save_LDFLAGS="$LDFLAGS"
883     eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
885     save_LIBS="$LIBS"
886     LIBS="$lt_cv_dlopen_libs $LIBS"
888     AC_CACHE_CHECK([whether a program can dlopen itself],
889           lt_cv_dlopen_self, [dnl
890           _LT_AC_TRY_DLOPEN_SELF(
891             lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
892             lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
893     ])
895     if test "x$lt_cv_dlopen_self" = xyes; then
896       LDFLAGS="$LDFLAGS $link_static_flag"
897       AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
898           lt_cv_dlopen_self_static, [dnl
899           _LT_AC_TRY_DLOPEN_SELF(
900             lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
901             lt_cv_dlopen_self_static=no,  lt_cv_dlopen_self_static=cross)
902       ])
903     fi
905     CPPFLAGS="$save_CPPFLAGS"
906     LDFLAGS="$save_LDFLAGS"
907     LIBS="$save_LIBS"
908     ;;
909   esac
911   case $lt_cv_dlopen_self in
912   yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
913   *) enable_dlopen_self=unknown ;;
914   esac
916   case $lt_cv_dlopen_self_static in
917   yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
918   *) enable_dlopen_self_static=unknown ;;
919   esac
921 ])# AC_LIBTOOL_DLOPEN_SELF
923 AC_DEFUN([_LT_AC_LTCONFIG_HACK],
924 [AC_REQUIRE([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])dnl
925 # Sed substitution that helps us do robust quoting.  It backslashifies
926 # metacharacters that are still active within double-quoted strings.
927 Xsed='sed -e s/^X//'
928 sed_quote_subst='s/\([[\\"\\`$\\\\]]\)/\\\1/g'
930 # Same as above, but do not quote variable references.
931 double_quote_subst='s/\([[\\"\\`\\\\]]\)/\\\1/g'
933 # Sed substitution to delay expansion of an escaped shell variable in a
934 # double_quote_subst'ed string.
935 delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
937 # Constants:
938 rm="rm -f"
940 # Global variables:
941 default_ofile=libtool
942 can_build_shared=yes
944 # All known linkers require a `.a' archive for static linking (except M$VC,
945 # which needs '.lib').
946 libext=a
947 ltmain="$ac_aux_dir/ltmain.sh"
948 ofile="$default_ofile"
949 with_gnu_ld="$lt_cv_prog_gnu_ld"
950 need_locks="$enable_libtool_lock"
952 old_CC="$CC"
953 old_CFLAGS="$CFLAGS"
955 # Set sane defaults for various variables
956 test -z "$AR" && AR=ar
957 test -z "$AR_FLAGS" && AR_FLAGS=cru
958 test -z "$AS" && AS=as
959 test -z "$CC" && CC=cc
960 test -z "$DLLTOOL" && DLLTOOL=dlltool
961 test -z "$LD" && LD=ld
962 test -z "$LN_S" && LN_S="ln -s"
963 test -z "$MAGIC_CMD" && MAGIC_CMD=file
964 test -z "$NM" && NM=nm
965 test -z "$OBJDUMP" && OBJDUMP=objdump
966 test -z "$RANLIB" && RANLIB=:
967 test -z "$STRIP" && STRIP=:
968 test -z "$ac_objext" && ac_objext=o
970 if test x"$host" != x"$build"; then
971   ac_tool_prefix=${host_alias}-
972 else
973   ac_tool_prefix=
976 # Transform linux* to *-*-linux-gnu*, to support old configure scripts.
977 case $host_os in
978 linux-gnu*) ;;
979 linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
980 esac
982 case $host_os in
983 aix3*)
984   # AIX sometimes has problems with the GCC collect2 program.  For some
985   # reason, if we set the COLLECT_NAMES environment variable, the problems
986   # vanish in a puff of smoke.
987   if test "X${COLLECT_NAMES+set}" != Xset; then
988     COLLECT_NAMES=
989     export COLLECT_NAMES
990   fi
991   ;;
992 esac
994 # Determine commands to create old-style static archives.
995 old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs'
996 old_postinstall_cmds='chmod 644 $oldlib'
997 old_postuninstall_cmds=
999 if test -n "$RANLIB"; then
1000   case $host_os in
1001   openbsd*)
1002     old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds"
1003     ;;
1004   *)
1005     old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds"
1006     ;;
1007   esac
1008   old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
1011 # Allow CC to be a program name with arguments.
1012 set dummy $CC
1013 compiler="[$]2"
1015 ## FIXME: this should be a separate macro
1017 AC_MSG_CHECKING([for objdir])
1018 rm -f .libs 2>/dev/null
1019 mkdir .libs 2>/dev/null
1020 if test -d .libs; then
1021   objdir=.libs
1022 else
1023   # MS-DOS does not allow filenames that begin with a dot.
1024   objdir=_libs
1026 rmdir .libs 2>/dev/null
1027 AC_MSG_RESULT($objdir)
1029 ## END FIXME
1032 ## FIXME: this should be a separate macro
1034 AC_ARG_WITH(pic,
1035 [  --with-pic              try to use only PIC/non-PIC objects [default=use both]],
1036 pic_mode="$withval", pic_mode=default)
1037 test -z "$pic_mode" && pic_mode=default
1039 # We assume here that the value for lt_cv_prog_cc_pic will not be cached
1040 # in isolation, and that seeing it set (from the cache) indicates that
1041 # the associated values are set (in the cache) correctly too.
1042 AC_MSG_CHECKING([for $compiler option to produce PIC])
1043 AC_CACHE_VAL(lt_cv_prog_cc_pic,
1044 [ lt_cv_prog_cc_pic=
1045   lt_cv_prog_cc_shlib=
1046   lt_cv_prog_cc_wl=
1047   lt_cv_prog_cc_static=
1048   lt_cv_prog_cc_no_builtin=
1049   lt_cv_prog_cc_can_build_shared=$can_build_shared
1051   if test "$GCC" = yes; then
1052     lt_cv_prog_cc_wl='-Wl,'
1053     lt_cv_prog_cc_static='-static'
1055     case $host_os in
1056     aix*)
1057       # Below there is a dirty hack to force normal static linking with -ldl
1058       # The problem is because libdl dynamically linked with both libc and
1059       # libC (AIX C++ library), which obviously doesn't included in libraries
1060       # list by gcc. This cause undefined symbols with -static flags.
1061       # This hack allows C programs to be linked with "-static -ldl", but
1062       # not sure about C++ programs.
1063       lt_cv_prog_cc_static="$lt_cv_prog_cc_static ${lt_cv_prog_cc_wl}-lC"
1064       ;;
1065     amigaos*)
1066       # FIXME: we need at least 68020 code to build shared libraries, but
1067       # adding the `-m68020' flag to GCC prevents building anything better,
1068       # like `-m68040'.
1069       lt_cv_prog_cc_pic='-m68020 -resident32 -malways-restore-a4'
1070       ;;
1071     beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
1072       # PIC is the default for these OSes.
1073       ;;
1074     darwin* | rhapsody*)
1075       # PIC is the default on this platform
1076       # Common symbols not allowed in MH_DYLIB files
1077       lt_cv_prog_cc_pic='-fno-common'
1078       ;;
1079     cygwin* | mingw* | pw32* | os2*)
1080       # This hack is so that the source file can tell whether it is being
1081       # built for inclusion in a dll (and should export symbols for example).
1082       lt_cv_prog_cc_pic='-DDLL_EXPORT'
1083       ;;
1084     sysv4*MP*)
1085       if test -d /usr/nec; then
1086          lt_cv_prog_cc_pic=-Kconform_pic
1087       fi
1088       ;;
1089     *)
1090       lt_cv_prog_cc_pic='-fPIC'
1091       ;;
1092     esac
1093   else
1094     # PORTME Check for PIC flags for the system compiler.
1095     case $host_os in
1096     aix3* | aix4* | aix5*)
1097       lt_cv_prog_cc_wl='-Wl,'
1098       # All AIX code is PIC.
1099       if test "$host_cpu" = ia64; then
1100         # AIX 5 now supports IA64 processor
1101         lt_cv_prog_cc_static='-Bstatic'
1102       else
1103         lt_cv_prog_cc_static='-bnso -bI:/lib/syscalls.exp'
1104       fi
1105       ;;
1107     hpux9* | hpux10* | hpux11*)
1108       # Is there a better lt_cv_prog_cc_static that works with the bundled CC?
1109       lt_cv_prog_cc_wl='-Wl,'
1110       lt_cv_prog_cc_static="${lt_cv_prog_cc_wl}-a ${lt_cv_prog_cc_wl}archive"
1111       lt_cv_prog_cc_pic='+Z'
1112       ;;
1114     irix5* | irix6* | nonstopux*)
1115       lt_cv_prog_cc_wl='-Wl,'
1116       lt_cv_prog_cc_static='-non_shared'
1117       # PIC (with -KPIC) is the default.
1118       ;;
1120     cygwin* | mingw* | pw32* | os2*)
1121       # This hack is so that the source file can tell whether it is being
1122       # built for inclusion in a dll (and should export symbols for example).
1123       lt_cv_prog_cc_pic='-DDLL_EXPORT'
1124       ;;
1126     newsos6)
1127       lt_cv_prog_cc_pic='-KPIC'
1128       lt_cv_prog_cc_static='-Bstatic'
1129       ;;
1131     osf3* | osf4* | osf5*)
1132       # All OSF/1 code is PIC.
1133       lt_cv_prog_cc_wl='-Wl,'
1134       lt_cv_prog_cc_static='-non_shared'
1135       ;;
1137     sco3.2v5*)
1138       lt_cv_prog_cc_pic='-Kpic'
1139       lt_cv_prog_cc_static='-dn'
1140       lt_cv_prog_cc_shlib='-belf'
1141       ;;
1143     solaris*)
1144       lt_cv_prog_cc_pic='-KPIC'
1145       lt_cv_prog_cc_static='-Bstatic'
1146       lt_cv_prog_cc_wl='-Wl,'
1147       ;;
1149     sunos4*)
1150       lt_cv_prog_cc_pic='-PIC'
1151       lt_cv_prog_cc_static='-Bstatic'
1152       lt_cv_prog_cc_wl='-Qoption ld '
1153       ;;
1155     sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
1156       lt_cv_prog_cc_pic='-KPIC'
1157       lt_cv_prog_cc_static='-Bstatic'
1158       lt_cv_prog_cc_wl='-Wl,'
1159       ;;
1161     uts4*)
1162       lt_cv_prog_cc_pic='-pic'
1163       lt_cv_prog_cc_static='-Bstatic'
1164       ;;
1166     sysv4*MP*)
1167       if test -d /usr/nec ;then
1168         lt_cv_prog_cc_pic='-Kconform_pic'
1169         lt_cv_prog_cc_static='-Bstatic'
1170       fi
1171       ;;
1173     *)
1174       lt_cv_prog_cc_can_build_shared=no
1175       ;;
1176     esac
1177   fi
1179 if test -z "$lt_cv_prog_cc_pic"; then
1180   AC_MSG_RESULT([none])
1181 else
1182   AC_MSG_RESULT([$lt_cv_prog_cc_pic])
1184   # Check to make sure the pic_flag actually works.
1185   AC_MSG_CHECKING([if $compiler PIC flag $lt_cv_prog_cc_pic works])
1186   AC_CACHE_VAL(lt_cv_prog_cc_pic_works, [dnl
1187     save_CFLAGS="$CFLAGS"
1188     CFLAGS="$CFLAGS $lt_cv_prog_cc_pic -DPIC"
1189     AC_TRY_COMPILE([], [], [dnl
1190       case $host_os in
1191       hpux9* | hpux10* | hpux11*)
1192         # On HP-UX, both CC and GCC only warn that PIC is supported... then
1193         # they create non-PIC objects.  So, if there were any warnings, we
1194         # assume that PIC is not supported.
1195         if test -s conftest.err; then
1196           lt_cv_prog_cc_pic_works=no
1197         else
1198           lt_cv_prog_cc_pic_works=yes
1199         fi
1200         ;;
1201       *)
1202         lt_cv_prog_cc_pic_works=yes
1203         ;;
1204       esac
1205     ], [dnl
1206       lt_cv_prog_cc_pic_works=no
1207     ])
1208     CFLAGS="$save_CFLAGS"
1209   ])
1211   if test "X$lt_cv_prog_cc_pic_works" = Xno; then
1212     lt_cv_prog_cc_pic=
1213     lt_cv_prog_cc_can_build_shared=no
1214   else
1215     lt_cv_prog_cc_pic=" $lt_cv_prog_cc_pic"
1216   fi
1218   AC_MSG_RESULT([$lt_cv_prog_cc_pic_works])
1221 ## END FIXME
1223 # Check for any special shared library compilation flags.
1224 if test -n "$lt_cv_prog_cc_shlib"; then
1225   AC_MSG_WARN([\`$CC' requires \`$lt_cv_prog_cc_shlib' to build shared libraries])
1226   if echo "$old_CC $old_CFLAGS " | egrep -e "[[         ]]$lt_cv_prog_cc_shlib[[        ]]" >/dev/null; then :
1227   else
1228    AC_MSG_WARN([add \`$lt_cv_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure])
1229     lt_cv_prog_cc_can_build_shared=no
1230   fi
1233 ## FIXME: this should be a separate macro
1235 AC_MSG_CHECKING([if $compiler static flag $lt_cv_prog_cc_static works])
1236 AC_CACHE_VAL([lt_cv_prog_cc_static_works], [dnl
1237   lt_cv_prog_cc_static_works=no
1238   save_LDFLAGS="$LDFLAGS"
1239   LDFLAGS="$LDFLAGS $lt_cv_prog_cc_static"
1240   AC_TRY_LINK([], [], [lt_cv_prog_cc_static_works=yes])
1241   LDFLAGS="$save_LDFLAGS"
1244 # Belt *and* braces to stop my trousers falling down:
1245 test "X$lt_cv_prog_cc_static_works" = Xno && lt_cv_prog_cc_static=
1246 AC_MSG_RESULT([$lt_cv_prog_cc_static_works])
1248 pic_flag="$lt_cv_prog_cc_pic"
1249 special_shlib_compile_flags="$lt_cv_prog_cc_shlib"
1250 wl="$lt_cv_prog_cc_wl"
1251 link_static_flag="$lt_cv_prog_cc_static"
1252 no_builtin_flag="$lt_cv_prog_cc_no_builtin"
1253 can_build_shared="$lt_cv_prog_cc_can_build_shared"
1255 ## END FIXME
1258 ## FIXME: this should be a separate macro
1260 # Check to see if options -o and -c are simultaneously supported by compiler
1261 AC_MSG_CHECKING([if $compiler supports -c -o file.$ac_objext])
1262 AC_CACHE_VAL([lt_cv_compiler_c_o], [
1263 $rm -r conftest 2>/dev/null
1264 mkdir conftest
1265 cd conftest
1266 echo "int some_variable = 0;" > conftest.$ac_ext
1267 mkdir out
1268 # According to Tom Tromey, Ian Lance Taylor reported there are C compilers
1269 # that will create temporary files in the current directory regardless of
1270 # the output directory.  Thus, making CWD read-only will cause this test
1271 # to fail, enabling locking or at least warning the user not to do parallel
1272 # builds.
1273 chmod -w .
1274 save_CFLAGS="$CFLAGS"
1275 CFLAGS="$CFLAGS -o out/conftest2.$ac_objext"
1276 compiler_c_o=no
1277 if { (eval echo configure:__oline__: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>out/conftest.err; } && test -s out/conftest2.$ac_objext; then
1278   # The compiler can only warn and ignore the option if not recognized
1279   # So say no if there are warnings
1280   if test -s out/conftest.err; then
1281     lt_cv_compiler_c_o=no
1282   else
1283     lt_cv_compiler_c_o=yes
1284   fi
1285 else
1286   # Append any errors to the config.log.
1287   cat out/conftest.err 1>&AC_FD_CC
1288   lt_cv_compiler_c_o=no
1290 CFLAGS="$save_CFLAGS"
1291 chmod u+w .
1292 $rm conftest* out/*
1293 rmdir out
1294 cd ..
1295 rmdir conftest
1296 $rm -r conftest 2>/dev/null
1298 compiler_c_o=$lt_cv_compiler_c_o
1299 AC_MSG_RESULT([$compiler_c_o])
1301 if test x"$compiler_c_o" = x"yes"; then
1302   # Check to see if we can write to a .lo
1303   AC_MSG_CHECKING([if $compiler supports -c -o file.lo])
1304   AC_CACHE_VAL([lt_cv_compiler_o_lo], [
1305   lt_cv_compiler_o_lo=no
1306   save_CFLAGS="$CFLAGS"
1307   CFLAGS="$CFLAGS -c -o conftest.lo"
1308   save_objext="$ac_objext"
1309   ac_objext=lo
1310   AC_TRY_COMPILE([], [int some_variable = 0;], [dnl
1311     # The compiler can only warn and ignore the option if not recognized
1312     # So say no if there are warnings
1313     if test -s conftest.err; then
1314       lt_cv_compiler_o_lo=no
1315     else
1316       lt_cv_compiler_o_lo=yes
1317     fi
1318   ])
1319   ac_objext="$save_objext"
1320   CFLAGS="$save_CFLAGS"
1321   ])
1322   compiler_o_lo=$lt_cv_compiler_o_lo
1323   AC_MSG_RESULT([$compiler_o_lo])
1324 else
1325   compiler_o_lo=no
1328 ## END FIXME
1330 ## FIXME: this should be a separate macro
1332 # Check to see if we can do hard links to lock some files if needed
1333 hard_links="nottested"
1334 if test "$compiler_c_o" = no && test "$need_locks" != no; then
1335   # do not overwrite the value of need_locks provided by the user
1336   AC_MSG_CHECKING([if we can lock with hard links])
1337   hard_links=yes
1338   $rm conftest*
1339   ln conftest.a conftest.b 2>/dev/null && hard_links=no
1340   touch conftest.a
1341   ln conftest.a conftest.b 2>&5 || hard_links=no
1342   ln conftest.a conftest.b 2>/dev/null && hard_links=no
1343   AC_MSG_RESULT([$hard_links])
1344   if test "$hard_links" = no; then
1345     AC_MSG_WARN([\`$CC' does not support \`-c -o', so \`make -j' may be unsafe])
1346     need_locks=warn
1347   fi
1348 else
1349   need_locks=no
1352 ## END FIXME
1354 ## FIXME: this should be a separate macro
1356 if test "$GCC" = yes; then
1357   # Check to see if options -fno-rtti -fno-exceptions are supported by compiler
1358   AC_MSG_CHECKING([if $compiler supports -fno-rtti -fno-exceptions])
1359   echo "int some_variable = 0;" > conftest.$ac_ext
1360   save_CFLAGS="$CFLAGS"
1361   CFLAGS="$CFLAGS -fno-rtti -fno-exceptions -c conftest.$ac_ext"
1362   compiler_rtti_exceptions=no
1363   AC_TRY_COMPILE([], [int some_variable = 0;], [dnl
1364     # The compiler can only warn and ignore the option if not recognized
1365     # So say no if there are warnings
1366     if test -s conftest.err; then
1367       compiler_rtti_exceptions=no
1368     else
1369       compiler_rtti_exceptions=yes
1370     fi
1371   ])
1372   CFLAGS="$save_CFLAGS"
1373   AC_MSG_RESULT([$compiler_rtti_exceptions])
1375   if test "$compiler_rtti_exceptions" = "yes"; then
1376     no_builtin_flag=' -fno-builtin -fno-rtti -fno-exceptions'
1377   else
1378     no_builtin_flag=' -fno-builtin'
1379   fi
1382 ## END FIXME
1384 ## FIXME: this should be a separate macro
1386 # See if the linker supports building shared libraries.
1387 AC_MSG_CHECKING([whether the linker ($LD) supports shared libraries])
1389 allow_undefined_flag=
1390 no_undefined_flag=
1391 need_lib_prefix=unknown
1392 need_version=unknown
1393 # when you set need_version to no, make sure it does not cause -set_version
1394 # flags to be left without arguments
1395 archive_cmds=
1396 archive_expsym_cmds=
1397 old_archive_from_new_cmds=
1398 old_archive_from_expsyms_cmds=
1399 export_dynamic_flag_spec=
1400 whole_archive_flag_spec=
1401 thread_safe_flag_spec=
1402 hardcode_into_libs=no
1403 hardcode_libdir_flag_spec=
1404 hardcode_libdir_separator=
1405 hardcode_direct=no
1406 hardcode_minus_L=no
1407 hardcode_shlibpath_var=unsupported
1408 runpath_var=
1409 link_all_deplibs=unknown
1410 always_export_symbols=no
1411 export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | sed '\''s/.* //'\'' | sort | uniq > $export_symbols'
1412 # include_expsyms should be a list of space-separated symbols to be *always*
1413 # included in the symbol list
1414 include_expsyms=
1415 # exclude_expsyms can be an egrep regular expression of symbols to exclude
1416 # it will be wrapped by ` (' and `)$', so one must not match beginning or
1417 # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
1418 # as well as any symbol that contains `d'.
1419 exclude_expsyms="_GLOBAL_OFFSET_TABLE_"
1420 # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
1421 # platforms (ab)use it in PIC code, but their linkers get confused if
1422 # the symbol is explicitly referenced.  Since portable code cannot
1423 # rely on this symbol name, it's probably fine to never include it in
1424 # preloaded symbol tables.
1425 extract_expsyms_cmds=
1427 case $host_os in
1428 cygwin* | mingw* | pw32*)
1429   # FIXME: the MSVC++ port hasn't been tested in a loooong time
1430   # When not using gcc, we currently assume that we are using
1431   # Microsoft Visual C++.
1432   if test "$GCC" != yes; then
1433     with_gnu_ld=no
1434   fi
1435   ;;
1436 openbsd*)
1437   with_gnu_ld=no
1438   ;;
1439 esac
1441 ld_shlibs=yes
1442 if test "$with_gnu_ld" = yes; then
1443   # If archive_cmds runs LD, not CC, wlarc should be empty
1444   wlarc='${wl}'
1446   # See if GNU ld supports shared libraries.
1447   case $host_os in
1448   aix3* | aix4* | aix5*)
1449     # On AIX, the GNU linker is very broken
1450     # Note:Check GNU linker on AIX 5-IA64 when/if it becomes available.
1451     ld_shlibs=no
1452     cat <<EOF 1>&2
1454 *** Warning: the GNU linker, at least up to release 2.9.1, is reported
1455 *** to be unable to reliably create shared libraries on AIX.
1456 *** Therefore, libtool is disabling shared libraries support.  If you
1457 *** really care for shared libraries, you may want to modify your PATH
1458 *** so that a non-GNU linker is found, and then restart.
1461     ;;
1463   amigaos*)
1464     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)'
1465     hardcode_libdir_flag_spec='-L$libdir'
1466     hardcode_minus_L=yes
1468     # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
1469     # that the semantics of dynamic libraries on AmigaOS, at least up
1470     # to version 4, is to share data among multiple programs linked
1471     # with the same dynamic library.  Since this doesn't match the
1472     # behavior of shared libraries on other platforms, we can use
1473     # them.
1474     ld_shlibs=no
1475     ;;
1477   beos*)
1478     if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
1479       allow_undefined_flag=unsupported
1480       # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
1481       # support --undefined.  This deserves some investigation.  FIXME
1482       archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
1483     else
1484       ld_shlibs=no
1485     fi
1486     ;;
1488   cygwin* | mingw* | pw32*)
1489     # hardcode_libdir_flag_spec is actually meaningless, as there is
1490     # no search path for DLLs.
1491     hardcode_libdir_flag_spec='-L$libdir'
1492     allow_undefined_flag=unsupported
1493     always_export_symbols=yes
1495     extract_expsyms_cmds='test -f $output_objdir/impgen.c || \
1496       sed -e "/^# \/\* impgen\.c starts here \*\//,/^# \/\* impgen.c ends here \*\// { s/^# //;s/^# *$//; p; }" -e d < $''0 > $output_objdir/impgen.c~
1497       test -f $output_objdir/impgen.exe || (cd $output_objdir && \
1498       if test "x$HOST_CC" != "x" ; then $HOST_CC -o impgen impgen.c ; \
1499       else $CC -o impgen impgen.c ; fi)~
1500       $output_objdir/impgen $dir/$soroot > $output_objdir/$soname-def'
1502     old_archive_from_expsyms_cmds='$DLLTOOL --as=$AS --dllname $soname --def $output_objdir/$soname-def --output-lib $output_objdir/$newlib'
1504     # cygwin and mingw dlls have different entry points and sets of symbols
1505     # to exclude.
1506     # FIXME: what about values for MSVC?
1507     dll_entry=__cygwin_dll_entry@12
1508     dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12~
1509     case $host_os in
1510     mingw*)
1511       # mingw values
1512       dll_entry=_DllMainCRTStartup@12
1513       dll_exclude_symbols=DllMain@12,DllMainCRTStartup@12,DllEntryPoint@12~
1514       ;;
1515     esac
1517     # mingw and cygwin differ, and it's simplest to just exclude the union
1518     # of the two symbol sets.
1519     dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12,DllMainCRTStartup@12,DllEntryPoint@12
1521     # recent cygwin and mingw systems supply a stub DllMain which the user
1522     # can override, but on older systems we have to supply one (in ltdll.c)
1523     if test "x$lt_cv_need_dllmain" = "xyes"; then
1524       ltdll_obj='$output_objdir/$soname-ltdll.'"$ac_objext "
1525       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~
1526         test -f $output_objdir/$soname-ltdll.$ac_objext || (cd $output_objdir && $CC -c $soname-ltdll.c)~'
1527     else
1528       ltdll_obj=
1529       ltdll_cmds=
1530     fi
1532     # Extract the symbol export list from an `--export-all' def file,
1533     # then regenerate the def file from the symbol export list, so that
1534     # the compiled dll only exports the symbol export list.
1535     # Be careful not to strip the DATA tag left be newer dlltools.
1536     export_symbols_cmds="$ltdll_cmds"'
1537       $DLLTOOL --export-all --exclude-symbols '$dll_exclude_symbols' --output-def $output_objdir/$soname-def '$ltdll_obj'$libobjs $convenience~
1538       sed -e "1,/EXPORTS/d" -e "s/ @ [[0-9]]*//" -e "s/ *;.*$//" < $output_objdir/$soname-def > $export_symbols'
1540     # If the export-symbols file already is a .def file (1st line
1541     # is EXPORTS), use it as is.
1542     # If DATA tags from a recent dlltool are present, honour them!
1543     archive_expsym_cmds='if test "x`sed 1q $export_symbols`" = xEXPORTS; then
1544         cp $export_symbols $output_objdir/$soname-def;
1545       else
1546         echo EXPORTS > $output_objdir/$soname-def;
1547         _lt_hint=1;
1548         cat $export_symbols | while read symbol; do
1549          set dummy \$symbol;
1550          case \[$]# in
1551            2) echo "   \[$]2 @ \$_lt_hint ; " >> $output_objdir/$soname-def;;
1552            4) echo "   \[$]2 \[$]3 \[$]4 ; " >> $output_objdir/$soname-def; _lt_hint=`expr \$_lt_hint - 1`;;
1553            *) echo "     \[$]2 @ \$_lt_hint \[$]3 ; " >> $output_objdir/$soname-def;;
1554          esac;
1555          _lt_hint=`expr 1 + \$_lt_hint`;
1556         done;
1557       fi~
1558       '"$ltdll_cmds"'
1559       $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~
1560       $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~
1561       $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~
1562       $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~
1563       $CC $output_objdir/$soname-exp '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags'
1564     ;;
1566   netbsd*)
1567     if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
1568       archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
1569       wlarc=
1570     else
1571       archive_cmds='$CC -shared -nodefaultlibs $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
1572       archive_expsym_cmds='$CC -shared -nodefaultlibs $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
1573     fi
1574     ;;
1576   solaris* | sysv5*)
1577     if $LD -v 2>&1 | egrep 'BFD 2\.8' > /dev/null; then
1578       ld_shlibs=no
1579       cat <<EOF 1>&2
1581 *** Warning: The releases 2.8.* of the GNU linker cannot reliably
1582 *** create shared libraries on Solaris systems.  Therefore, libtool
1583 *** is disabling shared libraries support.  We urge you to upgrade GNU
1584 *** binutils to release 2.9.1 or newer.  Another option is to modify
1585 *** your PATH or compiler configuration so that the native linker is
1586 *** used, and then restart.
1589     elif $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
1590       archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
1591       archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
1592     else
1593       ld_shlibs=no
1594     fi
1595     ;;
1597   sunos4*)
1598     archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
1599     wlarc=
1600     hardcode_direct=yes
1601     hardcode_shlibpath_var=no
1602     ;;
1604   *)
1605     if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
1606       archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
1607       archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
1608     else
1609       ld_shlibs=no
1610     fi
1611     ;;
1612   esac
1614   if test "$ld_shlibs" = yes; then
1615     runpath_var=
1616     hardcode_libdir_flag_spec=
1617     export_dynamic_flag_spec='${wl}--export-dynamic'
1618     case $host_os in
1619     cygwin* | mingw* | pw32*)
1620       # dlltool doesn't understand --whole-archive et. al.
1621       whole_archive_flag_spec=
1622       ;;
1623     *)
1624       # ancient GNU ld didn't support --whole-archive et. al.
1625       if $LD --help 2>&1 | egrep 'no-whole-archive' > /dev/null; then
1626         whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
1627       else
1628         whole_archive_flag_spec=
1629       fi
1630       ;;
1631     esac
1632   fi
1633 else
1634   # PORTME fill in a description of your system's linker (not GNU ld)
1635   case $host_os in
1636   aix3*)
1637     allow_undefined_flag=unsupported
1638     always_export_symbols=yes
1639     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'
1640     # Note: this linker hardcodes the directories in LIBPATH if there
1641     # are no directories specified by -L.
1642     hardcode_minus_L=yes
1643     if test "$GCC" = yes && test -z "$link_static_flag"; then
1644       # Neither direct hardcoding nor static linking is supported with a
1645       # broken collect2.
1646       hardcode_direct=unsupported
1647     fi
1648     ;;
1650   aix4* | aix5*)
1651     if test "$host_cpu" = ia64; then
1652       # On IA64, the linker does run time linking by default, so we don't
1653       # have to do anything special.
1654       aix_use_runtimelinking=no
1655       exp_sym_flag='-Bexport'
1656       no_entry_flag=""
1657     else
1658       aix_use_runtimelinking=no
1660       # Test if we are trying to use run time linking or normal
1661       # AIX style linking. If -brtl is somewhere in LDFLAGS, we
1662       # need to do runtime linking.
1663       case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*)
1664         for ld_flag in $LDFLAGS; do
1665           case $ld_flag in
1666           *-brtl*)
1667             aix_use_runtimelinking=yes
1668             break
1669           ;;
1670           esac
1671         done
1672       esac
1674       exp_sym_flag='-bexport'
1675       no_entry_flag='-bnoentry'
1676     fi
1678     # When large executables or shared objects are built, AIX ld can
1679     # have problems creating the table of contents.  If linking a library
1680     # or program results in "error TOC overflow" add -mminimal-toc to
1681     # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
1682     # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
1684     hardcode_direct=yes
1685     archive_cmds=''
1686     hardcode_libdir_separator=':'
1687     if test "$GCC" = yes; then
1688       case $host_os in aix4.[[012]]|aix4.[[012]].*)
1689         collect2name=`${CC} -print-prog-name=collect2`
1690         if test -f "$collect2name" && \
1691           strings "$collect2name" | grep resolve_lib_name >/dev/null
1692         then
1693           # We have reworked collect2
1694           hardcode_direct=yes
1695         else
1696           # We have old collect2
1697           hardcode_direct=unsupported
1698           # It fails to find uninstalled libraries when the uninstalled
1699           # path is not listed in the libpath.  Setting hardcode_minus_L
1700           # to unsupported forces relinking
1701           hardcode_minus_L=yes
1702           hardcode_libdir_flag_spec='-L$libdir'
1703           hardcode_libdir_separator=
1704         fi
1705       esac
1707       shared_flag='-shared'
1708     else
1709       # not using gcc
1710       if test "$host_cpu" = ia64; then
1711         shared_flag='${wl}-G'
1712       else
1713         if test "$aix_use_runtimelinking" = yes; then
1714           shared_flag='${wl}-G'
1715         else
1716           shared_flag='${wl}-bM:SRE'
1717         fi
1718       fi
1719     fi
1721     # It seems that -bexpall can do strange things, so it is better to
1722     # generate a list of symbols to export.
1723     always_export_symbols=yes
1724     if test "$aix_use_runtimelinking" = yes; then
1725       # Warning - without using the other runtime loading flags (-brtl),
1726       # -berok will link without error, but may produce a broken library.
1727       allow_undefined_flag='-berok'
1728       hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:/usr/lib:/lib'
1729       archive_expsym_cmds="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag"
1730     else
1731       if test "$host_cpu" = ia64; then
1732         hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
1733         allow_undefined_flag="-z nodefs"
1734         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"
1735       else
1736         hardcode_libdir_flag_spec='${wl}-bnolibpath ${wl}-blibpath:$libdir:/usr/lib:/lib'
1737         # Warning - without using the other run time loading flags,
1738         # -berok will link without error, but may produce a broken library.
1739         allow_undefined_flag='${wl}-berok'
1740         # This is a bit strange, but is similar to how AIX traditionally builds
1741         # it's shared libraries.
1742         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'
1743       fi
1744     fi
1745     ;;
1747   amigaos*)
1748     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)'
1749     hardcode_libdir_flag_spec='-L$libdir'
1750     hardcode_minus_L=yes
1751     # see comment about different semantics on the GNU ld section
1752     ld_shlibs=no
1753     ;;
1755   cygwin* | mingw* | pw32*)
1756     # When not using gcc, we currently assume that we are using
1757     # Microsoft Visual C++.
1758     # hardcode_libdir_flag_spec is actually meaningless, as there is
1759     # no search path for DLLs.
1760     hardcode_libdir_flag_spec=' '
1761     allow_undefined_flag=unsupported
1762     # Tell ltmain to make .lib files, not .a files.
1763     libext=lib
1764     # FIXME: Setting linknames here is a bad hack.
1765     archive_cmds='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | sed -e '\''s/ -lc$//'\''` -link -dll~linknames='
1766     # The linker will automatically build a .lib file if we build a DLL.
1767     old_archive_from_new_cmds='true'
1768     # FIXME: Should let the user specify the lib program.
1769     old_archive_cmds='lib /OUT:$oldlib$oldobjs$old_deplibs'
1770     fix_srcfile_path='`cygpath -w "$srcfile"`'
1771     ;;
1773   darwin* | rhapsody*)
1774     case "$host_os" in
1775     rhapsody* | darwin1.[[012]])
1776       allow_undefined_flag='-undefined suppress'
1777       ;;
1778     *) # Darwin 1.3 on
1779       allow_undefined_flag='-flat_namespace -undefined suppress'
1780       ;;
1781     esac
1782     # FIXME: Relying on posixy $() will cause problems for
1783     #        cross-compilation, but unfortunately the echo tests do not
1784     #        yet detect zsh echo's removal of \ escapes.  Also zsh mangles
1785     #        `"' quotes if we put them in here... so don't!
1786     archive_cmds='$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs && $CC $(test .$module = .yes && echo -bundle || echo -dynamiclib) $allow_undefined_flag -o $lib ${lib}-master.o $deplibs$linker_flags $(test .$module != .yes && echo -install_name $rpath/$soname $verstring)'
1787     # We need to add '_' to the symbols in $export_symbols first
1788     #archive_expsym_cmds="$archive_cmds"' && strip -s $export_symbols'
1789     hardcode_direct=yes
1790     hardcode_shlibpath_var=no
1791     whole_archive_flag_spec='-all_load $convenience'
1792     ;;
1794   freebsd1*)
1795     ld_shlibs=no
1796     ;;
1798   # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
1799   # support.  Future versions do this automatically, but an explicit c++rt0.o
1800   # does not break anything, and helps significantly (at the cost of a little
1801   # extra space).
1802   freebsd2.2*)
1803     archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
1804     hardcode_libdir_flag_spec='-R$libdir'
1805     hardcode_direct=yes
1806     hardcode_shlibpath_var=no
1807     ;;
1809   # Unfortunately, older versions of FreeBSD 2 do not have this feature.
1810   freebsd2*)
1811     archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
1812     hardcode_direct=yes
1813     hardcode_minus_L=yes
1814     hardcode_shlibpath_var=no
1815     ;;
1817   # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
1818   freebsd*)
1819     archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
1820     hardcode_libdir_flag_spec='-R$libdir'
1821     hardcode_direct=yes
1822     hardcode_shlibpath_var=no
1823     ;;
1825   hpux9* | hpux10* | hpux11*)
1826     case $host_os in
1827     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' ;;
1828     *) archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' ;;
1829     esac
1830     hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
1831     hardcode_libdir_separator=:
1832     hardcode_direct=yes
1833     hardcode_minus_L=yes # Not in the search PATH, but as the default
1834                          # location of the library.
1835     export_dynamic_flag_spec='${wl}-E'
1836     ;;
1838   irix5* | irix6* | nonstopux*)
1839     if test "$GCC" = yes; then
1840       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'
1841       hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
1842     else
1843       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'
1844       hardcode_libdir_flag_spec='-rpath $libdir'
1845     fi
1846     hardcode_libdir_separator=:
1847     link_all_deplibs=yes
1848     ;;
1850   netbsd*)
1851     if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
1852       archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
1853     else
1854       archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
1855     fi
1856     hardcode_libdir_flag_spec='-R$libdir'
1857     hardcode_direct=yes
1858     hardcode_shlibpath_var=no
1859     ;;
1861   newsos6)
1862     archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
1863     hardcode_direct=yes
1864     hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
1865     hardcode_libdir_separator=:
1866     hardcode_shlibpath_var=no
1867     ;;
1869   openbsd*)
1870     hardcode_direct=yes
1871     hardcode_shlibpath_var=no
1872     if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
1873       archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
1874       hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
1875       export_dynamic_flag_spec='${wl}-E'
1876     else
1877       case "$host_os" in
1878       openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
1879         archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
1880         hardcode_libdir_flag_spec='-R$libdir'
1881         ;;
1882       *)
1883         archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
1884         hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
1885         ;;
1886       esac
1887     fi
1888     ;;
1890   os2*)
1891     hardcode_libdir_flag_spec='-L$libdir'
1892     hardcode_minus_L=yes
1893     allow_undefined_flag=unsupported
1894     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'
1895     old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
1896     ;;
1898   osf3*)
1899     if test "$GCC" = yes; then
1900       allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
1901       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'
1902     else
1903       allow_undefined_flag=' -expect_unresolved \*'
1904       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'
1905     fi
1906     hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
1907     hardcode_libdir_separator=:
1908     ;;
1910   osf4* | osf5*)        # as osf3* with the addition of -msym flag
1911     if test "$GCC" = yes; then
1912       allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
1913       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'
1914       hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
1915     else
1916       allow_undefined_flag=' -expect_unresolved \*'
1917       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'
1918       archive_expsym_cmds='for i in `cat $export_symbols`; do printf "-exported_symbol " >> $lib.exp; echo "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
1919       $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'
1921       #Both c and cxx compiler support -rpath directly
1922       hardcode_libdir_flag_spec='-rpath $libdir'
1923     fi
1924     hardcode_libdir_separator=:
1925     ;;
1927   sco3.2v5*)
1928     archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
1929     hardcode_shlibpath_var=no
1930     runpath_var=LD_RUN_PATH
1931     hardcode_runpath_var=yes
1932     export_dynamic_flag_spec='${wl}-Bexport'
1933     ;;
1935   solaris*)
1936     # gcc --version < 3.0 without binutils cannot create self contained
1937     # shared libraries reliably, requiring libgcc.a to resolve some of
1938     # the object symbols generated in some cases.  Libraries that use
1939     # assert need libgcc.a to resolve __eprintf, for example.  Linking
1940     # a copy of libgcc.a into every shared library to guarantee resolving
1941     # such symbols causes other problems:  According to Tim Van Holder
1942     # <tim.van.holder@pandora.be>, C++ libraries end up with a separate
1943     # (to the application) exception stack for one thing.
1944     no_undefined_flag=' -z defs'
1945     if test "$GCC" = yes; then
1946       case `$CC --version 2>/dev/null` in
1947       [[12]].*)
1948         cat <<EOF 1>&2
1950 *** Warning: Releases of GCC earlier than version 3.0 cannot reliably
1951 *** create self contained shared libraries on Solaris systems, without
1952 *** introducing a dependency on libgcc.a.  Therefore, libtool is disabling
1953 *** -no-undefined support, which will at least allow you to build shared
1954 *** libraries.  However, you may find that when you link such libraries
1955 *** into an application without using GCC, you have to manually add
1956 *** \`gcc --print-libgcc-file-name\` to the link command.  We urge you to
1957 *** upgrade to a newer version of GCC.  Another option is to rebuild your
1958 *** current GCC to use the GNU linker from GNU binutils 2.9.1 or newer.
1961         no_undefined_flag=
1962         ;;
1963       esac
1964     fi
1965     # $CC -shared without GNU ld will not create a library from C++
1966     # object files and a static libstdc++, better avoid it by now
1967     archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
1968     archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
1969                 $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
1970     hardcode_libdir_flag_spec='-R$libdir'
1971     hardcode_shlibpath_var=no
1972     case $host_os in
1973     solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
1974     *) # Supported since Solaris 2.6 (maybe 2.5.1?)
1975       whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;;
1976     esac
1977     link_all_deplibs=yes
1978     ;;
1980   sunos4*)
1981     if test "x$host_vendor" = xsequent; then
1982       # Use $CC to link under sequent, because it throws in some extra .o
1983       # files that make .init and .fini sections work.
1984       archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
1985     else
1986       archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
1987     fi
1988     hardcode_libdir_flag_spec='-L$libdir'
1989     hardcode_direct=yes
1990     hardcode_minus_L=yes
1991     hardcode_shlibpath_var=no
1992     ;;
1994   sysv4)
1995     case $host_vendor in
1996       sni)
1997         archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
1998         hardcode_direct=yes # is this really true???
1999         ;;
2000       siemens)
2001         ## LD is ld it makes a PLAMLIB
2002         ## CC just makes a GrossModule.
2003         archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags'
2004         reload_cmds='$CC -r -o $output$reload_objs'
2005         hardcode_direct=no
2006         ;;
2007       motorola)
2008         archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
2009         hardcode_direct=no #Motorola manual says yes, but my tests say they lie
2010         ;;
2011     esac
2012     runpath_var='LD_RUN_PATH'
2013     hardcode_shlibpath_var=no
2014     ;;
2016   sysv4.3*)
2017     archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
2018     hardcode_shlibpath_var=no
2019     export_dynamic_flag_spec='-Bexport'
2020     ;;
2022   sysv5*)
2023     no_undefined_flag=' -z text'
2024     # $CC -shared without GNU ld will not create a library from C++
2025     # object files and a static libstdc++, better avoid it by now
2026     archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
2027     archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
2028                 $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
2029     hardcode_libdir_flag_spec=
2030     hardcode_shlibpath_var=no
2031     runpath_var='LD_RUN_PATH'
2032     ;;
2034   uts4*)
2035     archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
2036     hardcode_libdir_flag_spec='-L$libdir'
2037     hardcode_shlibpath_var=no
2038     ;;
2040   dgux*)
2041     archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
2042     hardcode_libdir_flag_spec='-L$libdir'
2043     hardcode_shlibpath_var=no
2044     ;;
2046   sysv4*MP*)
2047     if test -d /usr/nec; then
2048       archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
2049       hardcode_shlibpath_var=no
2050       runpath_var=LD_RUN_PATH
2051       hardcode_runpath_var=yes
2052       ld_shlibs=yes
2053     fi
2054     ;;
2056   sysv4.2uw2*)
2057     archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags'
2058     hardcode_direct=yes
2059     hardcode_minus_L=no
2060     hardcode_shlibpath_var=no
2061     hardcode_runpath_var=yes
2062     runpath_var=LD_RUN_PATH
2063     ;;
2065   sysv5uw7* | unixware7*)
2066     no_undefined_flag='${wl}-z ${wl}text'
2067     if test "$GCC" = yes; then
2068       archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
2069     else
2070       archive_cmds='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
2071     fi
2072     runpath_var='LD_RUN_PATH'
2073     hardcode_shlibpath_var=no
2074     ;;
2076   *)
2077     ld_shlibs=no
2078     ;;
2079   esac
2081 AC_MSG_RESULT([$ld_shlibs])
2082 test "$ld_shlibs" = no && can_build_shared=no
2084 ## END FIXME
2086 ## FIXME: this should be a separate macro
2088 # Check hardcoding attributes.
2089 AC_MSG_CHECKING([how to hardcode library paths into programs])
2090 hardcode_action=
2091 if test -n "$hardcode_libdir_flag_spec" || \
2092    test -n "$runpath_var"; then
2094   # We can hardcode non-existant directories.
2095   if test "$hardcode_direct" != no &&
2096      # If the only mechanism to avoid hardcoding is shlibpath_var, we
2097      # have to relink, otherwise we might link with an installed library
2098      # when we should be linking with a yet-to-be-installed one
2099      ## test "$hardcode_shlibpath_var" != no &&
2100      test "$hardcode_minus_L" != no; then
2101     # Linking always hardcodes the temporary library directory.
2102     hardcode_action=relink
2103   else
2104     # We can link without hardcoding, and we can hardcode nonexisting dirs.
2105     hardcode_action=immediate
2106   fi
2107 else
2108   # We cannot hardcode anything, or else we can only hardcode existing
2109   # directories.
2110   hardcode_action=unsupported
2112 AC_MSG_RESULT([$hardcode_action])
2114 ## END FIXME
2116 ## FIXME: this should be a separate macro
2118 striplib=
2119 old_striplib=
2120 AC_MSG_CHECKING([whether stripping libraries is possible])
2121 if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then
2122   test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
2123   test -z "$striplib" && striplib="$STRIP --strip-unneeded"
2124   AC_MSG_RESULT([yes])
2125 else
2126   AC_MSG_RESULT([no])
2129 ## END FIXME
2131 reload_cmds='$LD$reload_flag -o $output$reload_objs'
2132 test -z "$deplibs_check_method" && deplibs_check_method=unknown
2134 ## FIXME: this should be a separate macro
2136 # PORTME Fill in your ld.so characteristics
2137 AC_MSG_CHECKING([dynamic linker characteristics])
2138 library_names_spec=
2139 libname_spec='lib$name'
2140 soname_spec=
2141 postinstall_cmds=
2142 postuninstall_cmds=
2143 finish_cmds=
2144 finish_eval=
2145 shlibpath_var=
2146 shlibpath_overrides_runpath=unknown
2147 version_type=none
2148 dynamic_linker="$host_os ld.so"
2149 sys_lib_dlsearch_path_spec="/lib /usr/lib"
2150 sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
2152 case $host_os in
2153 aix3*)
2154   version_type=linux
2155   library_names_spec='${libname}${release}.so$versuffix $libname.a'
2156   shlibpath_var=LIBPATH
2158   # AIX has no versioning support, so we append a major version to the name.
2159   soname_spec='${libname}${release}.so$major'
2160   ;;
2162 aix4* | aix5*)
2163   version_type=linux
2164   need_lib_prefix=no
2165   need_version=no
2166   hardcode_into_libs=yes
2167   if test "$host_cpu" = ia64; then
2168     # AIX 5 supports IA64
2169     library_names_spec='${libname}${release}.so$major ${libname}${release}.so$versuffix $libname.so'
2170     shlibpath_var=LD_LIBRARY_PATH
2171   else
2172     # With GCC up to 2.95.x, collect2 would create an import file
2173     # for dependence libraries.  The import file would start with
2174     # the line `#! .'.  This would cause the generated library to
2175     # depend on `.', always an invalid library.  This was fixed in
2176     # development snapshots of GCC prior to 3.0.
2177     case $host_os in
2178       aix4 | aix4.[[01]] | aix4.[[01]].*)
2179         if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
2180              echo ' yes '
2181              echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
2182           :
2183         else
2184           can_build_shared=no
2185         fi
2186         ;;
2187     esac
2188     # AIX (on Power*) has no versioning support, so currently we can
2189     # not hardcode correct soname into executable. Probably we can
2190     # add versioning support to collect2, so additional links can
2191     # be useful in future.
2192     if test "$aix_use_runtimelinking" = yes; then
2193       # If using run time linking (on AIX 4.2 or later) use lib<name>.so
2194       # instead of lib<name>.a to let people know that these are not
2195       # typical AIX shared libraries.
2196       library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
2197     else
2198       # We preserve .a as extension for shared libraries through AIX4.2
2199       # and later when we are not doing run time linking.
2200       library_names_spec='${libname}${release}.a $libname.a'
2201       soname_spec='${libname}${release}.so$major'
2202     fi
2203     shlibpath_var=LIBPATH
2204   fi
2205   hardcode_into_libs=yes
2206   ;;
2208 amigaos*)
2209   library_names_spec='$libname.ixlibrary $libname.a'
2210   # Create ${libname}_ixlibrary.a entries in /sys/libs.
2211   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'
2212   ;;
2214 beos*)
2215   library_names_spec='${libname}.so'
2216   dynamic_linker="$host_os ld.so"
2217   shlibpath_var=LIBRARY_PATH
2218   ;;
2220 bsdi4*)
2221   version_type=linux
2222   need_version=no
2223   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
2224   soname_spec='${libname}${release}.so$major'
2225   finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
2226   shlibpath_var=LD_LIBRARY_PATH
2227   sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
2228   sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
2229   export_dynamic_flag_spec=-rdynamic
2230   # the default ld.so.conf also contains /usr/contrib/lib and
2231   # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
2232   # libtool to hard-code these into programs
2233   ;;
2235 cygwin* | mingw* | pw32*)
2236   version_type=windows
2237   need_version=no
2238   need_lib_prefix=no
2239   case $GCC,$host_os in
2240   yes,cygwin*)
2241     library_names_spec='$libname.dll.a'
2242     soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | sed -e 's/[[.]]/-/g'`${versuffix}.dll'
2243     postinstall_cmds='dlpath=`bash 2>&1 -c '\''. $dir/${file}i;echo \$dlname'\''`~
2244       dldir=$destdir/`dirname \$dlpath`~
2245       test -d \$dldir || mkdir -p \$dldir~
2246       $install_prog .libs/$dlname \$dldir/$dlname'
2247     postuninstall_cmds='dldll=`bash 2>&1 -c '\''. $file; echo \$dlname'\''`~
2248       dlpath=$dir/\$dldll~
2249        $rm \$dlpath'
2250     ;;
2251   yes,mingw*)
2252     library_names_spec='${libname}`echo ${release} | sed -e 's/[[.]]/-/g'`${versuffix}.dll'
2253     sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | sed -e "s/^libraries://" -e "s/;/ /g" -e "s,=/,/,g"`
2254     ;;
2255   yes,pw32*)
2256     library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll'
2257     ;;
2258   *)
2259     library_names_spec='${libname}`echo ${release} | sed -e 's/[[.]]/-/g'`${versuffix}.dll $libname.lib'
2260     ;;
2261   esac
2262   dynamic_linker='Win32 ld.exe'
2263   # FIXME: first we should search . and the directory the executable is in
2264   shlibpath_var=PATH
2265   ;;
2267 darwin* | rhapsody*)
2268   dynamic_linker="$host_os dyld"
2269   version_type=darwin
2270   need_lib_prefix=no
2271   need_version=no
2272   # FIXME: Relying on posixy $() will cause problems for
2273   #        cross-compilation, but unfortunately the echo tests do not
2274   #        yet detect zsh echo's removal of \ escapes.
2275   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)'
2276   soname_spec='${libname}${release}${major}.$(test .$module = .yes && echo so || echo dylib)'
2277   shlibpath_overrides_runpath=yes
2278   shlibpath_var=DYLD_LIBRARY_PATH
2279   ;;
2281 freebsd1*)
2282   dynamic_linker=no
2283   ;;
2285 freebsd*)
2286   objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
2287   version_type=freebsd-$objformat
2288   case $version_type in
2289     freebsd-elf*)
2290       library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so'
2291       need_version=no
2292       need_lib_prefix=no
2293       ;;
2294     freebsd-*)
2295       library_names_spec='${libname}${release}.so$versuffix $libname.so$versuffix'
2296       need_version=yes
2297       ;;
2298   esac
2299   shlibpath_var=LD_LIBRARY_PATH
2300   case $host_os in
2301   freebsd2*)
2302     shlibpath_overrides_runpath=yes
2303     ;;
2304   *)
2305     shlibpath_overrides_runpath=no
2306     hardcode_into_libs=yes
2307     ;;
2308   esac
2309   ;;
2311 gnu*)
2312   version_type=linux
2313   need_lib_prefix=no
2314   need_version=no
2315   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so${major} ${libname}.so'
2316   soname_spec='${libname}${release}.so$major'
2317   shlibpath_var=LD_LIBRARY_PATH
2318   hardcode_into_libs=yes
2319   ;;
2321 hpux9* | hpux10* | hpux11*)
2322   # Give a soname corresponding to the major version so that dld.sl refuses to
2323   # link against other versions.
2324   dynamic_linker="$host_os dld.sl"
2325   version_type=sunos
2326   need_lib_prefix=no
2327   need_version=no
2328   shlibpath_var=SHLIB_PATH
2329   shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
2330   library_names_spec='${libname}${release}.sl$versuffix ${libname}${release}.sl$major $libname.sl'
2331   soname_spec='${libname}${release}.sl$major'
2332   # HP-UX runs *really* slowly unless shared libraries are mode 555.
2333   postinstall_cmds='chmod 555 $lib'
2334   ;;
2336 irix5* | irix6* | nonstopux*)
2337   case $host_os in
2338     nonstopux*) version_type=nonstopux ;;
2339     *)          version_type=irix ;;
2340   esac
2341   need_lib_prefix=no
2342   need_version=no
2343   soname_spec='${libname}${release}.so$major'
2344   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so $libname.so'
2345   case $host_os in
2346   irix5* | nonstopux*)
2347     libsuff= shlibsuff=
2348     ;;
2349   *)
2350     case $LD in # libtool.m4 will add one of these switches to LD
2351     *-32|*"-32 ") libsuff= shlibsuff= libmagic=32-bit;;
2352     *-n32|*"-n32 ") libsuff=32 shlibsuff=N32 libmagic=N32;;
2353     *-64|*"-64 ") libsuff=64 shlibsuff=64 libmagic=64-bit;;
2354     *) libsuff= shlibsuff= libmagic=never-match;;
2355     esac
2356     ;;
2357   esac
2358   shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
2359   shlibpath_overrides_runpath=no
2360   sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
2361   sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
2362   ;;
2364 # No shared lib support for Linux oldld, aout, or coff.
2365 linux-gnuoldld* | linux-gnuaout* | linux-gnucoff*)
2366   dynamic_linker=no
2367   ;;
2369 # This must be Linux ELF.
2370 linux-gnu*)
2371   version_type=linux
2372   need_lib_prefix=no
2373   need_version=no
2374   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
2375   soname_spec='${libname}${release}.so$major'
2376   finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
2377   shlibpath_var=LD_LIBRARY_PATH
2378   shlibpath_overrides_runpath=no
2379   # This implies no fast_install, which is unacceptable.
2380   # Some rework will be needed to allow for fast_install
2381   # before this can be enabled.
2382   hardcode_into_libs=yes
2384   # We used to test for /lib/ld.so.1 and disable shared libraries on
2385   # powerpc, because MkLinux only supported shared libraries with the
2386   # GNU dynamic linker.  Since this was broken with cross compilers,
2387   # most powerpc-linux boxes support dynamic linking these days and
2388   # people can always --disable-shared, the test was removed, and we
2389   # assume the GNU/Linux dynamic linker is in use.
2390   dynamic_linker='GNU/Linux ld.so'
2391   ;;
2393 netbsd*)
2394   version_type=sunos
2395   need_lib_prefix=no
2396   need_version=no
2397   if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
2398     library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
2399     finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
2400     dynamic_linker='NetBSD (a.out) ld.so'
2401   else
2402     library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so ${libname}.so'
2403     soname_spec='${libname}${release}.so$major'
2404     dynamic_linker='NetBSD ld.elf_so'
2405   fi
2406   shlibpath_var=LD_LIBRARY_PATH
2407   shlibpath_overrides_runpath=yes
2408   hardcode_into_libs=yes
2409   ;;
2411 newsos6)
2412   version_type=linux
2413   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
2414   shlibpath_var=LD_LIBRARY_PATH
2415   shlibpath_overrides_runpath=yes
2416   ;;
2418 openbsd*)
2419   version_type=sunos
2420   need_lib_prefix=no
2421   need_version=no
2422   if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
2423     case "$host_os" in
2424     openbsd2.[[89]] | openbsd2.[[89]].*)
2425       shlibpath_overrides_runpath=no
2426       ;;
2427     *)
2428       shlibpath_overrides_runpath=yes
2429       ;;
2430     esac
2431   else
2432     shlibpath_overrides_runpath=yes
2433   fi
2434   library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
2435   finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
2436   shlibpath_var=LD_LIBRARY_PATH
2437   ;;
2439 os2*)
2440   libname_spec='$name'
2441   need_lib_prefix=no
2442   library_names_spec='$libname.dll $libname.a'
2443   dynamic_linker='OS/2 ld.exe'
2444   shlibpath_var=LIBPATH
2445   ;;
2447 osf3* | osf4* | osf5*)
2448   version_type=osf
2449   need_version=no
2450   soname_spec='${libname}${release}.so$major'
2451   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
2452   shlibpath_var=LD_LIBRARY_PATH
2453   sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
2454   sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
2455   hardcode_into_libs=yes
2456   ;;
2458 sco3.2v5*)
2459   version_type=osf
2460   soname_spec='${libname}${release}.so$major'
2461   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
2462   shlibpath_var=LD_LIBRARY_PATH
2463   ;;
2465 solaris*)
2466   version_type=linux
2467   need_lib_prefix=no
2468   need_version=no
2469   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
2470   soname_spec='${libname}${release}.so$major'
2471   shlibpath_var=LD_LIBRARY_PATH
2472   shlibpath_overrides_runpath=yes
2473   hardcode_into_libs=yes
2474   # ldd complains unless libraries are executable
2475   postinstall_cmds='chmod +x $lib'
2476   ;;
2478 sunos4*)
2479   version_type=sunos
2480   library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
2481   finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
2482   shlibpath_var=LD_LIBRARY_PATH
2483   shlibpath_overrides_runpath=yes
2484   if test "$with_gnu_ld" = yes; then
2485     need_lib_prefix=no
2486   fi
2487   need_version=yes
2488   ;;
2490 sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
2491   version_type=linux
2492   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
2493   soname_spec='${libname}${release}.so$major'
2494   shlibpath_var=LD_LIBRARY_PATH
2495   case $host_vendor in
2496     sni)
2497       shlibpath_overrides_runpath=no
2498       need_lib_prefix=no
2499       export_dynamic_flag_spec='${wl}-Blargedynsym'
2500       runpath_var=LD_RUN_PATH
2501       ;;
2502     siemens)
2503       need_lib_prefix=no
2504       ;;
2505     motorola)
2506       need_lib_prefix=no
2507       need_version=no
2508       shlibpath_overrides_runpath=no
2509       sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
2510       ;;
2511   esac
2512   ;;
2514 uts4*)
2515   version_type=linux
2516   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
2517   soname_spec='${libname}${release}.so$major'
2518   shlibpath_var=LD_LIBRARY_PATH
2519   ;;
2521 dgux*)
2522   version_type=linux
2523   need_lib_prefix=no
2524   need_version=no
2525   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
2526   soname_spec='${libname}${release}.so$major'
2527   shlibpath_var=LD_LIBRARY_PATH
2528   ;;
2530 sysv4*MP*)
2531   if test -d /usr/nec ;then
2532     version_type=linux
2533     library_names_spec='$libname.so.$versuffix $libname.so.$major $libname.so'
2534     soname_spec='$libname.so.$major'
2535     shlibpath_var=LD_LIBRARY_PATH
2536   fi
2537   ;;
2540   dynamic_linker=no
2541   ;;
2542 esac
2543 AC_MSG_RESULT([$dynamic_linker])
2544 test "$dynamic_linker" = no && can_build_shared=no
2546 ## END FIXME
2548 ## FIXME: this should be a separate macro
2550 # Report the final consequences.
2551 AC_MSG_CHECKING([if libtool supports shared libraries])
2552 AC_MSG_RESULT([$can_build_shared])
2554 ## END FIXME
2556 ## FIXME: this should be a separate macro
2558 AC_MSG_CHECKING([whether to build shared libraries])
2559 test "$can_build_shared" = "no" && enable_shared=no
2561 # On AIX, shared libraries and static libraries use the same namespace, and
2562 # are all built from PIC.
2563 case "$host_os" in
2564 aix3*)
2565   test "$enable_shared" = yes && enable_static=no
2566   if test -n "$RANLIB"; then
2567     archive_cmds="$archive_cmds~\$RANLIB \$lib"
2568     postinstall_cmds='$RANLIB $lib'
2569   fi
2570   ;;
2572 aix4*)
2573   if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
2574     test "$enable_shared" = yes && enable_static=no
2575   fi
2576   ;;
2577 esac
2578 AC_MSG_RESULT([$enable_shared])
2580 ## END FIXME
2582 ## FIXME: this should be a separate macro
2584 AC_MSG_CHECKING([whether to build static libraries])
2585 # Make sure either enable_shared or enable_static is yes.
2586 test "$enable_shared" = yes || enable_static=yes
2587 AC_MSG_RESULT([$enable_static])
2589 ## END FIXME
2591 if test "$hardcode_action" = relink; then
2592   # Fast installation is not supported
2593   enable_fast_install=no
2594 elif test "$shlibpath_overrides_runpath" = yes ||
2595      test "$enable_shared" = no; then
2596   # Fast installation is not necessary
2597   enable_fast_install=needless
2600 variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
2601 if test "$GCC" = yes; then
2602   variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
2605 AC_LIBTOOL_DLOPEN_SELF
2607 ## FIXME: this should be a separate macro
2609 if test "$enable_shared" = yes && test "$GCC" = yes; then
2610   case $archive_cmds in
2611   *'~'*)
2612     # FIXME: we may have to deal with multi-command sequences.
2613     ;;
2614   '$CC '*)
2615     # Test whether the compiler implicitly links with -lc since on some
2616     # systems, -lgcc has to come before -lc. If gcc already passes -lc
2617     # to ld, don't add -lc before -lgcc.
2618     AC_MSG_CHECKING([whether -lc should be explicitly linked in])
2619     AC_CACHE_VAL([lt_cv_archive_cmds_need_lc],
2620     [$rm conftest*
2621     echo 'static int dummy;' > conftest.$ac_ext
2623     if AC_TRY_EVAL(ac_compile); then
2624       soname=conftest
2625       lib=conftest
2626       libobjs=conftest.$ac_objext
2627       deplibs=
2628       wl=$lt_cv_prog_cc_wl
2629       compiler_flags=-v
2630       linker_flags=-v
2631       verstring=
2632       output_objdir=.
2633       libname=conftest
2634       save_allow_undefined_flag=$allow_undefined_flag
2635       allow_undefined_flag=
2636       if AC_TRY_EVAL(archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1)
2637       then
2638         lt_cv_archive_cmds_need_lc=no
2639       else
2640         lt_cv_archive_cmds_need_lc=yes
2641       fi
2642       allow_undefined_flag=$save_allow_undefined_flag
2643     else
2644       cat conftest.err 1>&5
2645     fi])
2646     AC_MSG_RESULT([$lt_cv_archive_cmds_need_lc])
2647     ;;
2648   esac
2650 need_lc=${lt_cv_archive_cmds_need_lc-yes}
2652 ## END FIXME
2654 ## FIXME: this should be a separate macro
2656 # The second clause should only fire when bootstrapping the
2657 # libtool distribution, otherwise you forgot to ship ltmain.sh
2658 # with your package, and you will get complaints that there are
2659 # no rules to generate ltmain.sh.
2660 if test -f "$ltmain"; then
2661   :
2662 else
2663   # If there is no Makefile yet, we rely on a make rule to execute
2664   # `config.status --recheck' to rerun these tests and create the
2665   # libtool script then.
2666   test -f Makefile && make "$ltmain"
2669 if test -f "$ltmain"; then
2670   trap "$rm \"${ofile}T\"; exit 1" 1 2 15
2671   $rm -f "${ofile}T"
2673   echo creating $ofile
2675   # Now quote all the things that may contain metacharacters while being
2676   # careful not to overquote the AC_SUBSTed values.  We take copies of the
2677   # variables and quote the copies for generation of the libtool script.
2678   for var in echo old_CC old_CFLAGS SED \
2679     AR AR_FLAGS CC LD LN_S NM SHELL \
2680     reload_flag reload_cmds wl \
2681     pic_flag link_static_flag no_builtin_flag export_dynamic_flag_spec \
2682     thread_safe_flag_spec whole_archive_flag_spec libname_spec \
2683     library_names_spec soname_spec \
2684     RANLIB old_archive_cmds old_archive_from_new_cmds old_postinstall_cmds \
2685     old_postuninstall_cmds archive_cmds archive_expsym_cmds postinstall_cmds \
2686     postuninstall_cmds extract_expsyms_cmds old_archive_from_expsyms_cmds \
2687     old_striplib striplib file_magic_cmd export_symbols_cmds \
2688     deplibs_check_method allow_undefined_flag no_undefined_flag \
2689     finish_cmds finish_eval global_symbol_pipe global_symbol_to_cdecl \
2690     global_symbol_to_c_name_address \
2691     hardcode_libdir_flag_spec hardcode_libdir_separator  \
2692     sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
2693     compiler_c_o compiler_o_lo need_locks exclude_expsyms include_expsyms; do
2695     case $var in
2696     reload_cmds | old_archive_cmds | old_archive_from_new_cmds | \
2697     old_postinstall_cmds | old_postuninstall_cmds | \
2698     export_symbols_cmds | archive_cmds | archive_expsym_cmds | \
2699     extract_expsyms_cmds | old_archive_from_expsyms_cmds | \
2700     postinstall_cmds | postuninstall_cmds | \
2701     finish_cmds | sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
2702       # Double-quote double-evaled strings.
2703       eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
2704       ;;
2705     *)
2706       eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
2707       ;;
2708     esac
2709   done
2711   cat <<__EOF__ > "${ofile}T"
2712 #! $SHELL
2714 # `$echo "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
2715 # Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)
2716 # NOTE: Changes made to this file will be lost: look at ltmain.sh.
2718 # Copyright (C) 1996-2000 Free Software Foundation, Inc.
2719 # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
2721 # This program is free software; you can redistribute it and/or modify
2722 # it under the terms of the GNU General Public License as published by
2723 # the Free Software Foundation; either version 2 of the License, or
2724 # (at your option) any later version.
2726 # This program is distributed in the hope that it will be useful, but
2727 # WITHOUT ANY WARRANTY; without even the implied warranty of
2728 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
2729 # General Public License for more details.
2731 # You should have received a copy of the GNU General Public License
2732 # along with this program; if not, write to the Free Software
2733 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
2735 # As a special exception to the GNU General Public License, if you
2736 # distribute this file as part of a program that contains a
2737 # configuration script generated by Autoconf, you may include it under
2738 # the same distribution terms that you use for the rest of that program.
2740 # A sed that does not truncate output.
2741 SED=$lt_SED
2743 # Sed that helps us avoid accidentally triggering echo(1) options like -n.
2744 Xsed="${SED} -e s/^X//"
2746 # The HP-UX ksh and POSIX shell print the target directory to stdout
2747 # if CDPATH is set.
2748 if test "X\${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
2750 # ### BEGIN LIBTOOL CONFIG
2752 # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
2754 # Shell to use when invoking shell scripts.
2755 SHELL=$lt_SHELL
2757 # Whether or not to build shared libraries.
2758 build_libtool_libs=$enable_shared
2760 # Whether or not to build static libraries.
2761 build_old_libs=$enable_static
2763 # Whether or not to add -lc for building shared libraries.
2764 build_libtool_need_lc=$need_lc
2766 # Whether or not to optimize for fast installation.
2767 fast_install=$enable_fast_install
2769 # The host system.
2770 host_alias=$host_alias
2771 host=$host
2773 # An echo program that does not interpret backslashes.
2774 echo=$lt_echo
2776 # The archiver.
2777 AR=$lt_AR
2778 AR_FLAGS=$lt_AR_FLAGS
2780 # The default C compiler.
2781 CC=$lt_CC
2783 # Is the compiler the GNU C compiler?
2784 with_gcc=$GCC
2786 # The linker used to build libraries.
2787 LD=$lt_LD
2789 # Whether we need hard or soft links.
2790 LN_S=$lt_LN_S
2792 # A BSD-compatible nm program.
2793 NM=$lt_NM
2795 # A symbol stripping program
2796 STRIP=$STRIP
2798 # Used to examine libraries when file_magic_cmd begins "file"
2799 MAGIC_CMD=$MAGIC_CMD
2801 # Used on cygwin: DLL creation program.
2802 DLLTOOL="$DLLTOOL"
2804 # Used on cygwin: object dumper.
2805 OBJDUMP="$OBJDUMP"
2807 # Used on cygwin: assembler.
2808 AS="$AS"
2810 # The name of the directory that contains temporary libtool files.
2811 objdir=$objdir
2813 # How to create reloadable object files.
2814 reload_flag=$lt_reload_flag
2815 reload_cmds=$lt_reload_cmds
2817 # How to pass a linker flag through the compiler.
2818 wl=$lt_wl
2820 # Object file suffix (normally "o").
2821 objext="$ac_objext"
2823 # Old archive suffix (normally "a").
2824 libext="$libext"
2826 # Executable file suffix (normally "").
2827 exeext="$exeext"
2829 # Additional compiler flags for building library objects.
2830 pic_flag=$lt_pic_flag
2831 pic_mode=$pic_mode
2833 # Does compiler simultaneously support -c and -o options?
2834 compiler_c_o=$lt_compiler_c_o
2836 # Can we write directly to a .lo ?
2837 compiler_o_lo=$lt_compiler_o_lo
2839 # Must we lock files when doing compilation ?
2840 need_locks=$lt_need_locks
2842 # Do we need the lib prefix for modules?
2843 need_lib_prefix=$need_lib_prefix
2845 # Do we need a version for libraries?
2846 need_version=$need_version
2848 # Whether dlopen is supported.
2849 dlopen_support=$enable_dlopen
2851 # Whether dlopen of programs is supported.
2852 dlopen_self=$enable_dlopen_self
2854 # Whether dlopen of statically linked programs is supported.
2855 dlopen_self_static=$enable_dlopen_self_static
2857 # Compiler flag to prevent dynamic linking.
2858 link_static_flag=$lt_link_static_flag
2860 # Compiler flag to turn off builtin functions.
2861 no_builtin_flag=$lt_no_builtin_flag
2863 # Compiler flag to allow reflexive dlopens.
2864 export_dynamic_flag_spec=$lt_export_dynamic_flag_spec
2866 # Compiler flag to generate shared objects directly from archives.
2867 whole_archive_flag_spec=$lt_whole_archive_flag_spec
2869 # Compiler flag to generate thread-safe objects.
2870 thread_safe_flag_spec=$lt_thread_safe_flag_spec
2872 # Library versioning type.
2873 version_type=$version_type
2875 # Format of library name prefix.
2876 libname_spec=$lt_libname_spec
2878 # List of archive names.  First name is the real one, the rest are links.
2879 # The last name is the one that the linker finds with -lNAME.
2880 library_names_spec=$lt_library_names_spec
2882 # The coded name of the library, if different from the real name.
2883 soname_spec=$lt_soname_spec
2885 # Commands used to build and install an old-style archive.
2886 RANLIB=$lt_RANLIB
2887 old_archive_cmds=$lt_old_archive_cmds
2888 old_postinstall_cmds=$lt_old_postinstall_cmds
2889 old_postuninstall_cmds=$lt_old_postuninstall_cmds
2891 # Create an old-style archive from a shared archive.
2892 old_archive_from_new_cmds=$lt_old_archive_from_new_cmds
2894 # Create a temporary old-style archive to link instead of a shared archive.
2895 old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds
2897 # Commands used to build and install a shared archive.
2898 archive_cmds=$lt_archive_cmds
2899 archive_expsym_cmds=$lt_archive_expsym_cmds
2900 postinstall_cmds=$lt_postinstall_cmds
2901 postuninstall_cmds=$lt_postuninstall_cmds
2903 # Commands to strip libraries.
2904 old_striplib=$lt_old_striplib
2905 striplib=$lt_striplib
2907 # Method to check whether dependent libraries are shared objects.
2908 deplibs_check_method=$lt_deplibs_check_method
2910 # Command to use when deplibs_check_method == file_magic.
2911 file_magic_cmd=$lt_file_magic_cmd
2913 # Flag that allows shared libraries with undefined symbols to be built.
2914 allow_undefined_flag=$lt_allow_undefined_flag
2916 # Flag that forces no undefined symbols.
2917 no_undefined_flag=$lt_no_undefined_flag
2919 # Commands used to finish a libtool library installation in a directory.
2920 finish_cmds=$lt_finish_cmds
2922 # Same as above, but a single script fragment to be evaled but not shown.
2923 finish_eval=$lt_finish_eval
2925 # Take the output of nm and produce a listing of raw symbols and C names.
2926 global_symbol_pipe=$lt_global_symbol_pipe
2928 # Transform the output of nm in a proper C declaration
2929 global_symbol_to_cdecl=$lt_global_symbol_to_cdecl
2931 # Transform the output of nm in a C name address pair
2932 global_symbol_to_c_name_address=$lt_global_symbol_to_c_name_address
2934 # This is the shared library runtime path variable.
2935 runpath_var=$runpath_var
2937 # This is the shared library path variable.
2938 shlibpath_var=$shlibpath_var
2940 # Is shlibpath searched before the hard-coded library search path?
2941 shlibpath_overrides_runpath=$shlibpath_overrides_runpath
2943 # How to hardcode a shared library path into an executable.
2944 hardcode_action=$hardcode_action
2946 # Whether we should hardcode library paths into libraries.
2947 hardcode_into_libs=$hardcode_into_libs
2949 # Flag to hardcode \$libdir into a binary during linking.
2950 # This must work even if \$libdir does not exist.
2951 hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec
2953 # Whether we need a single -rpath flag with a separated argument.
2954 hardcode_libdir_separator=$lt_hardcode_libdir_separator
2956 # Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the
2957 # resulting binary.
2958 hardcode_direct=$hardcode_direct
2960 # Set to yes if using the -LDIR flag during linking hardcodes DIR into the
2961 # resulting binary.
2962 hardcode_minus_L=$hardcode_minus_L
2964 # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
2965 # the resulting binary.
2966 hardcode_shlibpath_var=$hardcode_shlibpath_var
2968 # Variables whose values should be saved in libtool wrapper scripts and
2969 # restored at relink time.
2970 variables_saved_for_relink="$variables_saved_for_relink"
2972 # Whether libtool must link a program against all its dependency libraries.
2973 link_all_deplibs=$link_all_deplibs
2975 # Compile-time system search path for libraries
2976 sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
2978 # Run-time system search path for libraries
2979 sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
2981 # Fix the shell variable \$srcfile for the compiler.
2982 fix_srcfile_path="$fix_srcfile_path"
2984 # Set to yes if exported symbols are required.
2985 always_export_symbols=$always_export_symbols
2987 # The commands to list exported symbols.
2988 export_symbols_cmds=$lt_export_symbols_cmds
2990 # The commands to extract the exported symbol list from a shared archive.
2991 extract_expsyms_cmds=$lt_extract_expsyms_cmds
2993 # Symbols that should not be listed in the preloaded symbols.
2994 exclude_expsyms=$lt_exclude_expsyms
2996 # Symbols that must always be exported.
2997 include_expsyms=$lt_include_expsyms
2999 # ### END LIBTOOL CONFIG
3001 __EOF__
3003   case $host_os in
3004   aix3*)
3005     cat <<\EOF >> "${ofile}T"
3007 # AIX sometimes has problems with the GCC collect2 program.  For some
3008 # reason, if we set the COLLECT_NAMES environment variable, the problems
3009 # vanish in a puff of smoke.
3010 if test "X${COLLECT_NAMES+set}" != Xset; then
3011   COLLECT_NAMES=
3012   export COLLECT_NAMES
3015     ;;
3016   esac
3018   case $host_os in
3019   cygwin* | mingw* | pw32* | os2*)
3020     cat <<'EOF' >> "${ofile}T"
3021       # This is a source program that is used to create dlls on Windows
3022       # Don't remove nor modify the starting and closing comments
3023 # /* ltdll.c starts here */
3024 # #define WIN32_LEAN_AND_MEAN
3025 # #include <windows.h>
3026 # #undef WIN32_LEAN_AND_MEAN
3027 # #include <stdio.h>
3029 # #ifndef __CYGWIN__
3030 # #  ifdef __CYGWIN32__
3031 # #    define __CYGWIN__ __CYGWIN32__
3032 # #  endif
3033 # #endif
3035 # #ifdef __cplusplus
3036 # extern "C" {
3037 # #endif
3038 # BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved);
3039 # #ifdef __cplusplus
3040 # }
3041 # #endif
3043 # #ifdef __CYGWIN__
3044 # #include <cygwin/cygwin_dll.h>
3045 # DECLARE_CYGWIN_DLL( DllMain );
3046 # #endif
3047 # HINSTANCE __hDllInstance_base;
3049 # BOOL APIENTRY
3050 # DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved)
3051 # {
3052 #   __hDllInstance_base = hInst;
3053 #   return TRUE;
3054 # }
3055 # /* ltdll.c ends here */
3056         # This is a source program that is used to create import libraries
3057         # on Windows for dlls which lack them. Don't remove nor modify the
3058         # starting and closing comments
3059 # /* impgen.c starts here */
3060 # /*   Copyright (C) 1999-2000 Free Software Foundation, Inc.
3062 #  This file is part of GNU libtool.
3064 #  This program is free software; you can redistribute it and/or modify
3065 #  it under the terms of the GNU General Public License as published by
3066 #  the Free Software Foundation; either version 2 of the License, or
3067 #  (at your option) any later version.
3069 #  This program is distributed in the hope that it will be useful,
3070 #  but WITHOUT ANY WARRANTY; without even the implied warranty of
3071 #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
3072 #  GNU General Public License for more details.
3074 #  You should have received a copy of the GNU General Public License
3075 #  along with this program; if not, write to the Free Software
3076 #  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
3077 #  */
3079 # #include <stdio.h>            /* for printf() */
3080 # #include <unistd.h>           /* for open(), lseek(), read() */
3081 # #include <fcntl.h>            /* for O_RDONLY, O_BINARY */
3082 # #include <string.h>           /* for strdup() */
3084 # /* O_BINARY isn't required (or even defined sometimes) under Unix */
3085 # #ifndef O_BINARY
3086 # #define O_BINARY 0
3087 # #endif
3089 # static unsigned int
3090 # pe_get16 (fd, offset)
3091 #      int fd;
3092 #      int offset;
3093 # {
3094 #   unsigned char b[2];
3095 #   lseek (fd, offset, SEEK_SET);
3096 #   read (fd, b, 2);
3097 #   return b[0] + (b[1]<<8);
3098 # }
3100 # static unsigned int
3101 # pe_get32 (fd, offset)
3102 #     int fd;
3103 #     int offset;
3104 # {
3105 #   unsigned char b[4];
3106 #   lseek (fd, offset, SEEK_SET);
3107 #   read (fd, b, 4);
3108 #   return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24);
3109 # }
3111 # static unsigned int
3112 # pe_as32 (ptr)
3113 #      void *ptr;
3114 # {
3115 #   unsigned char *b = ptr;
3116 #   return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24);
3117 # }
3119 # int
3120 # main (argc, argv)
3121 #     int argc;
3122 #     char *argv[];
3123 # {
3124 #     int dll;
3125 #     unsigned long pe_header_offset, opthdr_ofs, num_entries, i;
3126 #     unsigned long export_rva, export_size, nsections, secptr, expptr;
3127 #     unsigned long name_rvas, nexp;
3128 #     unsigned char *expdata, *erva;
3129 #     char *filename, *dll_name;
3131 #     filename = argv[1];
3133 #     dll = open(filename, O_RDONLY|O_BINARY);
3134 #     if (dll < 1)
3135 #       return 1;
3137 #     dll_name = filename;
3139 #     for (i=0; filename[i]; i++)
3140 #       if (filename[i] == '/' || filename[i] == '\\'  || filename[i] == ':')
3141 #           dll_name = filename + i +1;
3143 #     pe_header_offset = pe_get32 (dll, 0x3c);
3144 #     opthdr_ofs = pe_header_offset + 4 + 20;
3145 #     num_entries = pe_get32 (dll, opthdr_ofs + 92);
3147 #     if (num_entries < 1) /* no exports */
3148 #       return 1;
3150 #     export_rva = pe_get32 (dll, opthdr_ofs + 96);
3151 #     export_size = pe_get32 (dll, opthdr_ofs + 100);
3152 #     nsections = pe_get16 (dll, pe_header_offset + 4 +2);
3153 #     secptr = (pe_header_offset + 4 + 20 +
3154 #             pe_get16 (dll, pe_header_offset + 4 + 16));
3156 #     expptr = 0;
3157 #     for (i = 0; i < nsections; i++)
3158 #     {
3159 #       char sname[8];
3160 #       unsigned long secptr1 = secptr + 40 * i;
3161 #       unsigned long vaddr = pe_get32 (dll, secptr1 + 12);
3162 #       unsigned long vsize = pe_get32 (dll, secptr1 + 16);
3163 #       unsigned long fptr = pe_get32 (dll, secptr1 + 20);
3164 #       lseek(dll, secptr1, SEEK_SET);
3165 #       read(dll, sname, 8);
3166 #       if (vaddr <= export_rva && vaddr+vsize > export_rva)
3167 #       {
3168 #           expptr = fptr + (export_rva - vaddr);
3169 #           if (export_rva + export_size > vaddr + vsize)
3170 #               export_size = vsize - (export_rva - vaddr);
3171 #           break;
3172 #       }
3173 #     }
3175 #     expdata = (unsigned char*)malloc(export_size);
3176 #     lseek (dll, expptr, SEEK_SET);
3177 #     read (dll, expdata, export_size);
3178 #     erva = expdata - export_rva;
3180 #     nexp = pe_as32 (expdata+24);
3181 #     name_rvas = pe_as32 (expdata+32);
3183 #     printf ("EXPORTS\n");
3184 #     for (i = 0; i<nexp; i++)
3185 #     {
3186 #       unsigned long name_rva = pe_as32 (erva+name_rvas+i*4);
3187 #       printf ("\t%s @ %ld ;\n", erva+name_rva, 1+ i);
3188 #     }
3190 #     return 0;
3191 # }
3192 # /* impgen.c ends here */
3195     ;;
3196   esac
3198   # We use sed instead of cat because bash on DJGPP gets confused if
3199   # if finds mixed CR/LF and LF-only lines.  Since sed operates in
3200   # text mode, it properly converts lines to CR/LF.  This bash problem
3201   # is reportedly fixed, but why not run on old versions too?
3202   sed '$q' "$ltmain" >> "${ofile}T" || (rm -f "${ofile}T"; exit 1)
3204   mv -f "${ofile}T" "$ofile" || \
3205     (rm -f "$ofile" && cp "${ofile}T" "$ofile" && rm -f "${ofile}T")
3206   chmod +x "$ofile"
3209 ## END FIXME
3211 ])# _LT_AC_LTCONFIG_HACK
3213 # AC_LIBTOOL_DLOPEN - enable checks for dlopen support
3214 AC_DEFUN([AC_LIBTOOL_DLOPEN], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])])
3216 # AC_LIBTOOL_WIN32_DLL - declare package support for building win32 dll's
3217 AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])])
3219 # AC_ENABLE_SHARED - implement the --enable-shared flag
3220 # Usage: AC_ENABLE_SHARED[(DEFAULT)]
3221 #   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
3222 #   `yes'.
3223 AC_DEFUN([AC_ENABLE_SHARED],
3224 [define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
3225 AC_ARG_ENABLE(shared,
3226 changequote(<<, >>)dnl
3227 <<  --enable-shared[=PKGS]  build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT],
3228 changequote([, ])dnl
3229 [p=${PACKAGE-default}
3230 case $enableval in
3231 yes) enable_shared=yes ;;
3232 no) enable_shared=no ;;
3234   enable_shared=no
3235   # Look at the argument we got.  We use all the common list separators.
3236   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
3237   for pkg in $enableval; do
3238     if test "X$pkg" = "X$p"; then
3239       enable_shared=yes
3240     fi
3241   done
3242   IFS="$ac_save_ifs"
3243   ;;
3244 esac],
3245 enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl
3248 # AC_DISABLE_SHARED - set the default shared flag to --disable-shared
3249 AC_DEFUN([AC_DISABLE_SHARED],
3250 [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
3251 AC_ENABLE_SHARED(no)])
3253 # AC_ENABLE_STATIC - implement the --enable-static flag
3254 # Usage: AC_ENABLE_STATIC[(DEFAULT)]
3255 #   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
3256 #   `yes'.
3257 AC_DEFUN([AC_ENABLE_STATIC],
3258 [define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
3259 AC_ARG_ENABLE(static,
3260 changequote(<<, >>)dnl
3261 <<  --enable-static[=PKGS]  build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT],
3262 changequote([, ])dnl
3263 [p=${PACKAGE-default}
3264 case $enableval in
3265 yes) enable_static=yes ;;
3266 no) enable_static=no ;;
3268   enable_static=no
3269   # Look at the argument we got.  We use all the common list separators.
3270   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
3271   for pkg in $enableval; do
3272     if test "X$pkg" = "X$p"; then
3273       enable_static=yes
3274     fi
3275   done
3276   IFS="$ac_save_ifs"
3277   ;;
3278 esac],
3279 enable_static=AC_ENABLE_STATIC_DEFAULT)dnl
3282 # AC_DISABLE_STATIC - set the default static flag to --disable-static
3283 AC_DEFUN([AC_DISABLE_STATIC],
3284 [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
3285 AC_ENABLE_STATIC(no)])
3288 # AC_ENABLE_FAST_INSTALL - implement the --enable-fast-install flag
3289 # Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)]
3290 #   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
3291 #   `yes'.
3292 AC_DEFUN([AC_ENABLE_FAST_INSTALL],
3293 [define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
3294 AC_ARG_ENABLE(fast-install,
3295 changequote(<<, >>)dnl
3296 <<  --enable-fast-install[=PKGS]  optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT],
3297 changequote([, ])dnl
3298 [p=${PACKAGE-default}
3299 case $enableval in
3300 yes) enable_fast_install=yes ;;
3301 no) enable_fast_install=no ;;
3303   enable_fast_install=no
3304   # Look at the argument we got.  We use all the common list separators.
3305   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
3306   for pkg in $enableval; do
3307     if test "X$pkg" = "X$p"; then
3308       enable_fast_install=yes
3309     fi
3310   done
3311   IFS="$ac_save_ifs"
3312   ;;
3313 esac],
3314 enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl
3317 # AC_DISABLE_FAST_INSTALL - set the default to --disable-fast-install
3318 AC_DEFUN([AC_DISABLE_FAST_INSTALL],
3319 [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
3320 AC_ENABLE_FAST_INSTALL(no)])
3322 # AC_LIBTOOL_PICMODE - implement the --with-pic flag
3323 # Usage: AC_LIBTOOL_PICMODE[(MODE)]
3324 #   Where MODE is either `yes' or `no'.  If omitted, it defaults to
3325 #   `both'.
3326 AC_DEFUN([AC_LIBTOOL_PICMODE],
3327 [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
3328 pic_mode=ifelse($#,1,$1,default)])
3331 # AC_PATH_TOOL_PREFIX - find a file program which can recognise shared library
3332 AC_DEFUN([AC_PATH_TOOL_PREFIX],
3333 [AC_MSG_CHECKING([for $1])
3334 AC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
3335 [case $MAGIC_CMD in
3336   /*)
3337   lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
3338   ;;
3339   ?:/*)
3340   lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a dos path.
3341   ;;
3342   *)
3343   ac_save_MAGIC_CMD="$MAGIC_CMD"
3344   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3345 dnl $ac_dummy forces splitting on constant user-supplied paths.
3346 dnl POSIX.2 word splitting is done only on the output of word expansions,
3347 dnl not every word.  This closes a longstanding sh security hole.
3348   ac_dummy="ifelse([$2], , $PATH, [$2])"
3349   for ac_dir in $ac_dummy; do
3350     test -z "$ac_dir" && ac_dir=.
3351     if test -f $ac_dir/$1; then
3352       lt_cv_path_MAGIC_CMD="$ac_dir/$1"
3353       if test -n "$file_magic_test_file"; then
3354         case $deplibs_check_method in
3355         "file_magic "*)
3356           file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`"
3357           MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
3358           if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
3359             egrep "$file_magic_regex" > /dev/null; then
3360             :
3361           else
3362             cat <<EOF 1>&2
3364 *** Warning: the command libtool uses to detect shared libraries,
3365 *** $file_magic_cmd, produces output that libtool cannot recognize.
3366 *** The result is that libtool may fail to recognize shared libraries
3367 *** as such.  This will affect the creation of libtool libraries that
3368 *** depend on shared libraries, but programs linked with such libtool
3369 *** libraries will work regardless of this problem.  Nevertheless, you
3370 *** may want to report the problem to your system manager and/or to
3371 *** bug-libtool@gnu.org
3374           fi ;;
3375         esac
3376       fi
3377       break
3378     fi
3379   done
3380   IFS="$ac_save_ifs"
3381   MAGIC_CMD="$ac_save_MAGIC_CMD"
3382   ;;
3383 esac])
3384 MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
3385 if test -n "$MAGIC_CMD"; then
3386   AC_MSG_RESULT($MAGIC_CMD)
3387 else
3388   AC_MSG_RESULT(no)
3393 # AC_PATH_MAGIC - find a file program which can recognise a shared library
3394 AC_DEFUN([AC_PATH_MAGIC],
3395 [AC_REQUIRE([AC_CHECK_TOOL_PREFIX])dnl
3396 AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin:$PATH)
3397 if test -z "$lt_cv_path_MAGIC_CMD"; then
3398   if test -n "$ac_tool_prefix"; then
3399     AC_PATH_TOOL_PREFIX(file, /usr/bin:$PATH)
3400   else
3401     MAGIC_CMD=:
3402   fi
3407 # AC_PROG_LD - find the path to the GNU or non-GNU linker
3408 AC_DEFUN([AC_PROG_LD],
3409 [AC_ARG_WITH(gnu-ld,
3410 [  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]],
3411 test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
3412 AC_REQUIRE([AC_PROG_CC])dnl
3413 AC_REQUIRE([AC_CANONICAL_HOST])dnl
3414 AC_REQUIRE([AC_CANONICAL_BUILD])dnl
3415 AC_REQUIRE([_LT_AC_LIBTOOL_SYS_PATH_SEPARATOR])dnl
3416 ac_prog=ld
3417 if test "$GCC" = yes; then
3418   # Check if gcc -print-prog-name=ld gives a path.
3419   AC_MSG_CHECKING([for ld used by GCC])
3420   case $host in
3421   *-*-mingw*)
3422     # gcc leaves a trailing carriage return which upsets mingw
3423     ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
3424   *)
3425     ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
3426   esac
3427   case $ac_prog in
3428     # Accept absolute paths.
3429     [[\\/]]* | [[A-Za-z]]:[[\\/]]*)
3430       re_direlt='/[[^/]][[^/]]*/\.\./'
3431       # Canonicalize the path of ld
3432       ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
3433       while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
3434         ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
3435       done
3436       test -z "$LD" && LD="$ac_prog"
3437       ;;
3438   "")
3439     # If it fails, then pretend we aren't using GCC.
3440     ac_prog=ld
3441     ;;
3442   *)
3443     # If it is relative, then search for the first ld in PATH.
3444     with_gnu_ld=unknown
3445     ;;
3446   esac
3447 elif test "$with_gnu_ld" = yes; then
3448   AC_MSG_CHECKING([for GNU ld])
3449 else
3450   AC_MSG_CHECKING([for non-GNU ld])
3452 AC_CACHE_VAL(lt_cv_path_LD,
3453 [if test -z "$LD"; then
3454   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
3455   for ac_dir in $PATH; do
3456     test -z "$ac_dir" && ac_dir=.
3457     if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
3458       lt_cv_path_LD="$ac_dir/$ac_prog"
3459       # Check to see if the program is GNU ld.  I'd rather use --version,
3460       # but apparently some GNU ld's only accept -v.
3461       # Break only if it was the GNU/non-GNU ld that we prefer.
3462       if "$lt_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
3463         test "$with_gnu_ld" != no && break
3464       else
3465         test "$with_gnu_ld" != yes && break
3466       fi
3467     fi
3468   done
3469   IFS="$ac_save_ifs"
3470 else
3471   lt_cv_path_LD="$LD" # Let the user override the test with a path.
3472 fi])
3473 LD="$lt_cv_path_LD"
3474 if test -n "$LD"; then
3475   AC_MSG_RESULT($LD)
3476 else
3477   AC_MSG_RESULT(no)
3479 test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
3480 AC_PROG_LD_GNU
3483 # AC_PROG_LD_GNU -
3484 AC_DEFUN([AC_PROG_LD_GNU],
3485 [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
3486 [# I'd rather use --version here, but apparently some GNU ld's only accept -v.
3487 if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
3488   lt_cv_prog_gnu_ld=yes
3489 else
3490   lt_cv_prog_gnu_ld=no
3491 fi])
3492 with_gnu_ld=$lt_cv_prog_gnu_ld
3495 # AC_PROG_LD_RELOAD_FLAG - find reload flag for linker
3496 #   -- PORTME Some linkers may need a different reload flag.
3497 AC_DEFUN([AC_PROG_LD_RELOAD_FLAG],
3498 [AC_CACHE_CHECK([for $LD option to reload object files], lt_cv_ld_reload_flag,
3499 [lt_cv_ld_reload_flag='-r'])
3500 reload_flag=$lt_cv_ld_reload_flag
3501 test -n "$reload_flag" && reload_flag=" $reload_flag"
3504 # AC_DEPLIBS_CHECK_METHOD - how to check for library dependencies
3505 #  -- PORTME fill in with the dynamic library characteristics
3506 AC_DEFUN([AC_DEPLIBS_CHECK_METHOD],
3507 [AC_CACHE_CHECK([how to recognise dependent libraries],
3508 lt_cv_deplibs_check_method,
3509 [lt_cv_file_magic_cmd='$MAGIC_CMD'
3510 lt_cv_file_magic_test_file=
3511 lt_cv_deplibs_check_method='unknown'
3512 # Need to set the preceding variable on all platforms that support
3513 # interlibrary dependencies.
3514 # 'none' -- dependencies not supported.
3515 # `unknown' -- same as none, but documents that we really don't know.
3516 # 'pass_all' -- all dependencies passed with no checks.
3517 # 'test_compile' -- check by making test program.
3518 # 'file_magic [[regex]]' -- check by looking for files in library path
3519 # which responds to the $file_magic_cmd with a given egrep regex.
3520 # If you have `file' or equivalent on your system and you're not sure
3521 # whether `pass_all' will *always* work, you probably want this one.
3523 case $host_os in
3524 aix4* | aix5*)
3525   lt_cv_deplibs_check_method=pass_all
3526   ;;
3528 beos*)
3529   lt_cv_deplibs_check_method=pass_all
3530   ;;
3532 bsdi4*)
3533   lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
3534   lt_cv_file_magic_cmd='/usr/bin/file -L'
3535   lt_cv_file_magic_test_file=/shlib/libc.so
3536   ;;
3538 cygwin* | mingw* | pw32*)
3539   lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
3540   lt_cv_file_magic_cmd='$OBJDUMP -f'
3541   ;;
3543 darwin* | rhapsody*)
3544   lt_cv_deplibs_check_method='file_magic Mach-O dynamically linked shared library'
3545   lt_cv_file_magic_cmd='/usr/bin/file -L'
3546   case "$host_os" in
3547   rhapsody* | darwin1.[[012]])
3548     lt_cv_file_magic_test_file=`echo /System/Library/Frameworks/System.framework/Versions/*/System | head -1`
3549     ;;
3550   *) # Darwin 1.3 on
3551     lt_cv_file_magic_test_file='/usr/lib/libSystem.dylib'
3552     ;;
3553   esac
3554   ;;
3556 freebsd*)
3557   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
3558     case $host_cpu in
3559     i*86 )
3560       # Not sure whether the presence of OpenBSD here was a mistake.
3561       # Let's accept both of them until this is cleared up.
3562       lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD)/i[[3-9]]86 (compact )?demand paged shared library'
3563       lt_cv_file_magic_cmd=/usr/bin/file
3564       lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
3565       ;;
3566     esac
3567   else
3568     lt_cv_deplibs_check_method=pass_all
3569   fi
3570   ;;
3572 gnu*)
3573   lt_cv_deplibs_check_method=pass_all
3574   ;;
3576 hpux10.20*|hpux11*)
3577   lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library'
3578   lt_cv_file_magic_cmd=/usr/bin/file
3579   lt_cv_file_magic_test_file=/usr/lib/libc.sl
3580   ;;
3582 irix5* | irix6* | nonstopux*)
3583   case $host_os in
3584   irix5* | nonstopux*)
3585     # this will be overridden with pass_all, but let us keep it just in case
3586     lt_cv_deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1"
3587     ;;
3588   *)
3589     case $LD in
3590     *-32|*"-32 ") libmagic=32-bit;;
3591     *-n32|*"-n32 ") libmagic=N32;;
3592     *-64|*"-64 ") libmagic=64-bit;;
3593     *) libmagic=never-match;;
3594     esac
3595     # this will be overridden with pass_all, but let us keep it just in case
3596     lt_cv_deplibs_check_method="file_magic ELF ${libmagic} MSB mips-[[1234]] dynamic lib MIPS - version 1"
3597     ;;
3598   esac
3599   lt_cv_file_magic_test_file=`echo /lib${libsuff}/libc.so*`
3600   lt_cv_deplibs_check_method=pass_all
3601   ;;
3603 # This must be Linux ELF.
3604 linux-gnu*)
3605   case $host_cpu in
3606   alpha* | hppa* | i*86 | mips | mipsel | powerpc* | sparc* | ia64*)
3607     lt_cv_deplibs_check_method=pass_all ;;
3608   *)
3609     # glibc up to 2.1.1 does not perform some relocations on ARM
3610     lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' ;;
3611   esac
3612   lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
3613   ;;
3615 netbsd*)
3616   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
3617     lt_cv_deplibs_check_method='match_pattern /lib[[^/\.]]+\.so\.[[0-9]]+\.[[0-9]]+$'
3618   else
3619     lt_cv_deplibs_check_method='match_pattern /lib[[^/\.]]+\.so$'
3620   fi
3621   ;;
3623 newos6*)
3624   lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
3625   lt_cv_file_magic_cmd=/usr/bin/file
3626   lt_cv_file_magic_test_file=/usr/lib/libnls.so
3627   ;;
3629 openbsd*)
3630   lt_cv_file_magic_cmd=/usr/bin/file
3631   lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
3632   if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
3633     lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB shared object'
3634   else
3635     lt_cv_deplibs_check_method='file_magic OpenBSD.* shared library'
3636   fi
3637   ;;
3639 osf3* | osf4* | osf5*)
3640   # this will be overridden with pass_all, but let us keep it just in case
3641   lt_cv_deplibs_check_method='file_magic COFF format alpha shared library'
3642   lt_cv_file_magic_test_file=/shlib/libc.so
3643   lt_cv_deplibs_check_method=pass_all
3644   ;;
3646 sco3.2v5*)
3647   lt_cv_deplibs_check_method=pass_all
3648   ;;
3650 solaris*)
3651   lt_cv_deplibs_check_method=pass_all
3652   lt_cv_file_magic_test_file=/lib/libc.so
3653   ;;
3655 sysv5uw[[78]]* | sysv4*uw2*)
3656   lt_cv_deplibs_check_method=pass_all
3657   ;;
3659 sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
3660   case $host_vendor in
3661   motorola)
3662     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]]'
3663     lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
3664     ;;
3665   ncr)
3666     lt_cv_deplibs_check_method=pass_all
3667     ;;
3668   sequent)
3669     lt_cv_file_magic_cmd='/bin/file'
3670     lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
3671     ;;
3672   sni)
3673     lt_cv_file_magic_cmd='/bin/file'
3674     lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
3675     lt_cv_file_magic_test_file=/lib/libc.so
3676     ;;
3677   siemens)
3678     lt_cv_deplibs_check_method=pass_all
3679     ;;
3680   esac
3681   ;;
3682 esac
3684 file_magic_cmd=$lt_cv_file_magic_cmd
3685 deplibs_check_method=$lt_cv_deplibs_check_method
3689 # AC_PROG_NM - find the path to a BSD-compatible name lister
3690 AC_DEFUN([AC_PROG_NM],
3691 [AC_REQUIRE([_LT_AC_LIBTOOL_SYS_PATH_SEPARATOR])dnl
3692 AC_MSG_CHECKING([for BSD-compatible nm])
3693 AC_CACHE_VAL(lt_cv_path_NM,
3694 [if test -n "$NM"; then
3695   # Let the user override the test.
3696   lt_cv_path_NM="$NM"
3697 else
3698   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
3699   for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
3700     test -z "$ac_dir" && ac_dir=.
3701     tmp_nm=$ac_dir/${ac_tool_prefix}nm
3702     if test -f $tmp_nm || test -f $tmp_nm$ac_exeext ; then
3703       # Check to see if the nm accepts a BSD-compat flag.
3704       # Adding the `sed 1q' prevents false positives on HP-UX, which says:
3705       #   nm: unknown option "B" ignored
3706       # Tru64's nm complains that /dev/null is an invalid object file
3707       if ($tmp_nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep '(/dev/null|Invalid file or object type)' >/dev/null; then
3708         lt_cv_path_NM="$tmp_nm -B"
3709         break
3710       elif ($tmp_nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
3711         lt_cv_path_NM="$tmp_nm -p"
3712         break
3713       else
3714         lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
3715         continue # so that we can try to find one that supports BSD flags
3716       fi
3717     fi
3718   done
3719   IFS="$ac_save_ifs"
3720   test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm
3721 fi])
3722 NM="$lt_cv_path_NM"
3723 AC_MSG_RESULT([$NM])
3726 # AC_CHECK_LIBM - check for math library
3727 AC_DEFUN([AC_CHECK_LIBM],
3728 [AC_REQUIRE([AC_CANONICAL_HOST])dnl
3729 LIBM=
3730 case $host in
3731 *-*-beos* | *-*-cygwin* | *-*-pw32*)
3732   # These system don't have libm
3733   ;;
3734 *-ncr-sysv4.3*)
3735   AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
3736   AC_CHECK_LIB(m, main, LIBM="$LIBM -lm")
3737   ;;
3739   AC_CHECK_LIB(m, main, LIBM="-lm")
3740   ;;
3741 esac
3744 # AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for
3745 # the libltdl convenience library and LTDLINCL to the include flags for
3746 # the libltdl header and adds --enable-ltdl-convenience to the
3747 # configure arguments.  Note that LIBLTDL and LTDLINCL are not
3748 # AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called.  If DIR is not
3749 # provided, it is assumed to be `libltdl'.  LIBLTDL will be prefixed
3750 # with '${top_builddir}/' and LTDLINCL will be prefixed with
3751 # '${top_srcdir}/' (note the single quotes!).  If your package is not
3752 # flat and you're not using automake, define top_builddir and
3753 # top_srcdir appropriately in the Makefiles.
3754 AC_DEFUN([AC_LIBLTDL_CONVENIENCE],
3755 [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
3756   case $enable_ltdl_convenience in
3757   no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
3758   "") enable_ltdl_convenience=yes
3759       ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
3760   esac
3761   LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la
3762   LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
3763   # For backwards non-gettext consistent compatibility...
3764   INCLTDL="$LTDLINCL"
3767 # AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for
3768 # the libltdl installable library and LTDLINCL to the include flags for
3769 # the libltdl header and adds --enable-ltdl-install to the configure
3770 # arguments.  Note that LIBLTDL and LTDLINCL are not AC_SUBSTed, nor is
3771 # AC_CONFIG_SUBDIRS called.  If DIR is not provided and an installed
3772 # libltdl is not found, it is assumed to be `libltdl'.  LIBLTDL will
3773 # be prefixed with '${top_builddir}/' and LTDLINCL will be prefixed
3774 # with '${top_srcdir}/' (note the single quotes!).  If your package is
3775 # not flat and you're not using automake, define top_builddir and
3776 # top_srcdir appropriately in the Makefiles.
3777 # In the future, this macro may have to be called after AC_PROG_LIBTOOL.
3778 AC_DEFUN([AC_LIBLTDL_INSTALLABLE],
3779 [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
3780   AC_CHECK_LIB(ltdl, main,
3781   [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
3782   [if test x"$enable_ltdl_install" = xno; then
3783      AC_MSG_WARN([libltdl not installed, but installation disabled])
3784    else
3785      enable_ltdl_install=yes
3786    fi
3787   ])
3788   if test x"$enable_ltdl_install" = x"yes"; then
3789     ac_configure_args="$ac_configure_args --enable-ltdl-install"
3790     LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la
3791     LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
3792   else
3793     ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
3794     LIBLTDL="-lltdl"
3795     LTDLINCL=
3796   fi
3797   # For backwards non-gettext consistent compatibility...
3798   INCLTDL="$LTDLINCL"
3801 # old names
3802 AC_DEFUN([AM_PROG_LIBTOOL],   [AC_PROG_LIBTOOL])
3803 AC_DEFUN([AM_ENABLE_SHARED],  [AC_ENABLE_SHARED($@)])
3804 AC_DEFUN([AM_ENABLE_STATIC],  [AC_ENABLE_STATIC($@)])
3805 AC_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
3806 AC_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
3807 AC_DEFUN([AM_PROG_LD],        [AC_PROG_LD])
3808 AC_DEFUN([AM_PROG_NM],        [AC_PROG_NM])
3810 # This is just to silence aclocal about the macro not being used
3811 ifelse([AC_DISABLE_FAST_INSTALL])
3813 ############################################################
3814 # NOTE: This macro has been submitted for inclusion into   #
3815 #  GNU Autoconf as AC_PROG_SED.  When it is available in   #
3816 #  a released version of Autoconf we should remove this    #
3817 #  macro and use it instead.                               #
3818 ############################################################
3819 # LT_AC_PROG_SED
3820 # --------------
3821 # Check for a fully-functional sed program, that truncates
3822 # as few characters as possible.  Prefer GNU sed if found.
3823 AC_DEFUN([LT_AC_PROG_SED],
3824 [AC_MSG_CHECKING([for a sed that does not truncate output])
3825 AC_CACHE_VAL(lt_cv_path_SED,
3826 [# Loop through the user's path and test for sed and gsed.
3827 # Then use that list of sed's as ones to test for truncation.
3828 as_executable_p="test -f"
3829 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
3830 for as_dir in $PATH
3832   IFS=$as_save_IFS
3833   test -z "$as_dir" && as_dir=.
3834   for ac_prog in sed gsed; do
3835     for ac_exec_ext in '' $ac_executable_extensions; do
3836       if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
3837         _sed_list="$_sed_list $as_dir/$ac_prog$ac_exec_ext"
3838       fi
3839     done
3840   done
3841 done
3843   # Create a temporary directory, and hook for its removal unless debugging.
3844 $debug ||
3846   trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
3847   trap '{ (exit 1); exit 1; }' 1 2 13 15
3850 # Create a (secure) tmp directory for tmp files.
3851 : ${TMPDIR=/tmp}
3853   tmp=`(umask 077 && mktemp -d -q "$TMPDIR/sedXXXXXX") 2>/dev/null` &&
3854   test -n "$tmp" && test -d "$tmp"
3855 }  ||
3857   tmp=$TMPDIR/sed$$-$RANDOM
3858   (umask 077 && mkdir $tmp)
3859 } ||
3861    echo "$me: cannot create a temporary directory in $TMPDIR" >&2
3862    { (exit 1); exit 1; }
3864   _max=0
3865   _count=0
3866   # Add /usr/xpg4/bin/sed as it is typically found on Solaris
3867   # along with /bin/sed that truncates output.
3868   for _sed in $_sed_list /usr/xpg4/bin/sed; do
3869     test ! -f ${_sed} && break
3870     cat /dev/null > "$tmp/sed.in"
3871     _count=0
3872     echo ${ECHO_N-$ac_n} "0123456789${ECHO_C-$ac_c}" >"$tmp/sed.in"
3873     # Check for GNU sed and select it if it is found.
3874     if "${_sed}" --version 2>&1 < /dev/null | egrep '(GNU)' > /dev/null; then
3875       lt_cv_path_SED=${_sed}
3876       break
3877     fi
3878     while true; do
3879       cat "$tmp/sed.in" "$tmp/sed.in" >"$tmp/sed.tmp"
3880       mv "$tmp/sed.tmp" "$tmp/sed.in"
3881       cp "$tmp/sed.in" "$tmp/sed.nl"
3882       echo >>"$tmp/sed.nl"
3883       ${_sed} -e 's/a$//' < "$tmp/sed.nl" >"$tmp/sed.out" || break
3884       cmp -s "$tmp/sed.out" "$tmp/sed.nl" || break
3885       # 40000 chars as input seems more than enough
3886       test $_count -gt 10 && break
3887       _count=`expr $_count + 1`
3888       if test $_count -gt $_max; then
3889         _max=$_count
3890         lt_cv_path_SED=$_sed
3891       fi
3892     done
3893   done
3894   rm -rf "$tmp"
3896 if test "X$SED" != "X"; then
3897   lt_cv_path_SED=$SED
3898 else
3899   SED=$lt_cv_path_SED
3901 AC_MSG_RESULT([$SED])