1dnl
2dnl This file contains local autoconf functions.
3dnl
4
5dnl -------------------------------------------------------------------------
6dnl Output stylize macros for configure (help/runtime)
7dnl -------------------------------------------------------------------------
8
9dnl
10dnl PHP_HELP_SEPARATOR(title)
11dnl
12dnl Adds separator title into the configure --help display.
13dnl
14AC_DEFUN([PHP_HELP_SEPARATOR],[
15AC_ARG_ENABLE([],[
16$1
17],[])
18])
19
20dnl
21dnl PHP_CONFIGURE_PART(title)
22dnl
23dnl Adds separator title configure output (idea borrowed from mm)
24dnl
25AC_DEFUN([PHP_CONFIGURE_PART],[
26  AC_MSG_RESULT()
27  AC_MSG_RESULT([${T_MD}$1${T_ME}])
28])
29
30dnl -------------------------------------------------------------------------
31dnl Build system helper macros
32dnl -------------------------------------------------------------------------
33
34dnl
35dnl PHP_DEF_HAVE(what)
36dnl
37dnl Generates 'AC_DEFINE(HAVE_WHAT, 1, [ ])'
38dnl
39AC_DEFUN([PHP_DEF_HAVE],[AC_DEFINE([HAVE_]translit($1,a-z_.-,A-Z___), 1, [ ])])
40
41dnl
42dnl PHP_RUN_ONCE(namespace, variable, code)
43dnl
44dnl execute code, if variable is not set in namespace
45dnl
46AC_DEFUN([PHP_RUN_ONCE],[
47  changequote({,})
48  unique=`echo $2|$SED 's/[^a-zA-Z0-9]/_/g'`
49  changequote([,])
50  cmd="echo $ac_n \"\$$1$unique$ac_c\""
51  if test -n "$unique" && test "`eval $cmd`" = "" ; then
52    eval "$1$unique=set"
53    $3
54  fi
55])
56
57dnl
58dnl PHP_EXPAND_PATH(path, variable)
59dnl
60dnl expands path to an absolute path and assigns it to variable
61dnl
62AC_DEFUN([PHP_EXPAND_PATH],[
63  if test -z "$1" || echo "$1" | grep '^/' >/dev/null ; then
64    $2=$1
65  else
66    changequote({,})
67    ep_dir=`echo $1|$SED 's%/*[^/][^/]*/*$%%'`
68    changequote([,])
69    ep_realdir=`(cd "$ep_dir" && pwd)`
70    $2="$ep_realdir"/`basename "$1"`
71  fi
72])
73
74dnl
75dnl PHP_DEFINE(WHAT [, value[, directory]])
76dnl
77dnl Creates builddir/include/what.h and in there #define WHAT value
78dnl
79AC_DEFUN([PHP_DEFINE],[
80  [echo "#define ]$1[]ifelse([$2],,[ 1],[ $2])[" > ]ifelse([$3],,[include],[$3])[/php_]translit($1,A-Z,a-z)[.h]
81])
82
83dnl
84dnl PHP_SUBST(varname)
85dnl
86dnl Adds variable with it's value into Makefile, e.g.:
87dnl CC = gcc
88dnl
89AC_DEFUN([PHP_SUBST],[
90  PHP_VAR_SUBST="$PHP_VAR_SUBST $1"
91])
92
93dnl
94dnl PHP_SUBST_OLD(varname)
95dnl
96dnl Same as PHP_SUBST() but also substitutes all @VARNAME@
97dnl instances in every file passed to AC_OUTPUT
98dnl
99AC_DEFUN([PHP_SUBST_OLD],[
100  PHP_SUBST($1)
101  AC_SUBST($1)
102])
103
104dnl
105dnl PHP_OUTPUT(file)
106dnl
107dnl Adds "file" to the list of files generated by AC_OUTPUT
108dnl This macro can be used several times.
109dnl
110AC_DEFUN([PHP_OUTPUT],[
111  PHP_OUTPUT_FILES="$PHP_OUTPUT_FILES $1"
112])
113
114
115dnl -------------------------------------------------------------------------
116dnl Build system base macros
117dnl -------------------------------------------------------------------------
118
119dnl
120dnl PHP_CANONICAL_HOST_TARGET
121dnl
122AC_DEFUN([PHP_CANONICAL_HOST_TARGET],[
123  AC_REQUIRE([AC_CANONICAL_HOST])dnl
124  AC_REQUIRE([AC_CANONICAL_TARGET])dnl
125  dnl Make sure we do not continue if host_alias is empty.
126  if test -z "$host_alias" && test -n "$host"; then
127    host_alias=$host
128  fi
129  if test -z "$host_alias"; then
130    AC_MSG_ERROR([host_alias is not set!])
131  fi
132])
133
134dnl
135dnl PHP_INIT_BUILD_SYSTEM
136dnl
137AC_DEFUN([PHP_INIT_BUILD_SYSTEM],[
138AC_REQUIRE([PHP_CANONICAL_HOST_TARGET])dnl
139test -d include || $php_shtool mkdir include
140> Makefile.objects
141> Makefile.fragments
142dnl We need to play tricks here to avoid matching the grep line itself
143pattern=define
144$EGREP $pattern'.*include/php' $srcdir/configure|$SED 's/.*>//'|xargs touch 2>/dev/null
145])
146
147dnl
148dnl PHP_GEN_GLOBAL_MAKEFILE
149dnl
150dnl Generates the global makefile.
151dnl
152AC_DEFUN([PHP_GEN_GLOBAL_MAKEFILE],[
153  cat >Makefile <<EOF
154srcdir = $abs_srcdir
155builddir = $abs_builddir
156top_srcdir = $abs_srcdir
157top_builddir = $abs_builddir
158EOF
159  for i in $PHP_VAR_SUBST; do
160    eval echo "$i = \$$i" >> Makefile
161  done
162
163  cat $abs_srcdir/Makefile.global Makefile.fragments Makefile.objects >> Makefile
164])
165
166dnl
167dnl PHP_ADD_MAKEFILE_FRAGMENT([srcfile [, ext_srcdir [, ext_builddir]]])
168dnl
169dnl Processes a file called Makefile.frag in the source directory
170dnl of the most recently added extension. $(srcdir) and $(builddir)
171dnl are substituted with the proper paths. Can be used to supply
172dnl custom rules and/or additional targets.
173dnl
174AC_DEFUN([PHP_ADD_MAKEFILE_FRAGMENT],[
175  ifelse($1,,src=$ext_srcdir/Makefile.frag,src=$1)
176  ifelse($2,,ac_srcdir=$ext_srcdir,ac_srcdir=$2)
177  ifelse($3,,ac_builddir=$ext_builddir,ac_builddir=$3)
178  test -f "$src" && $SED -e "s#\$(srcdir)#$ac_srcdir#g" -e "s#\$(builddir)#$ac_builddir#g" $src  >> Makefile.fragments
179])
180
181dnl
182dnl PHP_ADD_SOURCES(source-path, sources [, special-flags [, type]])
183dnl
184dnl Adds sources which are located relative to source-path to the
185dnl array of type type.  Sources are processed with optional
186dnl special-flags which are passed to the compiler.  Sources
187dnl can be either written in C or C++ (filenames shall end in .c
188dnl or .cpp, respectively).
189dnl
190dnl Note: If source-path begins with a "/", the "/" is removed and
191dnl the path is interpreted relative to the top build-directory.
192dnl
193dnl which array to append to?
194AC_DEFUN([PHP_ADD_SOURCES],[
195  PHP_ADD_SOURCES_X($1, $2, $3, ifelse($4,sapi,PHP_SAPI_OBJS,PHP_GLOBAL_OBJS))
196])
197
198dnl
199dnl _PHP_ASSIGN_BUILD_VARS(type)
200dnl internal, don't use
201AC_DEFUN([_PHP_ASSIGN_BUILD_VARS],[
202ifelse($1,shared,[
203  b_c_pre=$shared_c_pre
204  b_cxx_pre=$shared_cxx_pre
205  b_c_meta=$shared_c_meta
206  b_cxx_meta=$shared_cxx_meta
207  b_c_post=$shared_c_post
208  b_cxx_post=$shared_cxx_post
209],[
210  b_c_pre=$php_c_pre
211  b_cxx_pre=$php_cxx_pre
212  b_c_meta=$php_c_meta
213  b_cxx_meta=$php_cxx_meta
214  b_c_post=$php_c_post
215  b_cxx_post=$php_cxx_post
216])dnl
217  b_lo=[$]$1_lo
218])
219
220dnl
221dnl PHP_ADD_SOURCES_X(source-path, sources[, special-flags[, target-var[, shared[, special-post-flags]]]])
222dnl
223dnl Additional to PHP_ADD_SOURCES (see above), this lets you set the
224dnl name of the array target-var directly, as well as whether
225dnl shared objects will be built from the sources.
226dnl
227dnl Should not be used directly.
228dnl
229AC_DEFUN([PHP_ADD_SOURCES_X],[
230dnl relative to source- or build-directory?
231dnl ac_srcdir/ac_bdir include trailing slash
232  case $1 in
233  ""[)] ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
234  /*[)] ac_srcdir=`echo "$1"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
235  *[)] ac_srcdir="$abs_srcdir/$1/"; ac_bdir="$1/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
236  esac
237
238dnl how to build .. shared or static?
239  ifelse($5,yes,_PHP_ASSIGN_BUILD_VARS(shared),_PHP_ASSIGN_BUILD_VARS(php))
240
241dnl iterate over the sources
242  old_IFS=[$]IFS
243  for ac_src in $2; do
244
245dnl remove the suffix
246      IFS=.
247      set $ac_src
248      ac_obj=[$]1
249      IFS=$old_IFS
250
251dnl append to the array which has been dynamically chosen at m4 time
252      $4="[$]$4 [$]ac_bdir[$]ac_obj.lo"
253
254dnl choose the right compiler/flags/etc. for the source-file
255      case $ac_src in
256        *.c[)] ac_comp="$b_c_pre $3 $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $6$b_c_post" ;;
257        *.s[)] ac_comp="$b_c_pre $3 $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $6$b_c_post" ;;
258        *.S[)] ac_comp="$b_c_pre $3 $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $6$b_c_post" ;;
259        *.cpp|*.cc|*.cxx[)] ac_comp="$b_cxx_pre $3 $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $6$b_cxx_post" ;;
260      esac
261
262dnl create a rule for the object/source combo
263    cat >>Makefile.objects<<EOF
264$ac_bdir[$]ac_obj.lo: $ac_srcdir[$]ac_src
265	$ac_comp
266EOF
267  done
268])
269
270dnl -------------------------------------------------------------------------
271dnl Compiler characteristics checks
272dnl -------------------------------------------------------------------------
273
274dnl
275dnl PHP_TARGET_RDYNAMIC
276dnl
277dnl Checks whether -rdynamic is supported by the compiler.  This
278dnl is necessary for some targets to populate the global symbol
279dnl table.  Otherwise, dynamic modules would not be able to resolve
280dnl PHP-related symbols.
281dnl
282dnl If successful, adds -rdynamic to PHP_LDFLAGS.
283dnl
284AC_DEFUN([PHP_TARGET_RDYNAMIC],[
285  if test -n "$GCC"; then
286    PHP_CHECK_GCC_ARG(-rdynamic, gcc_rdynamic=yes)
287    if test "$gcc_rdynamic" = "yes"; then
288      PHP_LDFLAGS="$PHP_LDFLAGS -rdynamic"
289    fi
290  fi
291])
292
293dnl
294dnl PHP_RUNPATH_SWITCH
295dnl
296dnl Checks for -R, etc. switch
297dnl
298AC_DEFUN([PHP_RUNPATH_SWITCH],[
299AC_MSG_CHECKING([if compiler supports -R])
300AC_CACHE_VAL(php_cv_cc_dashr,[
301  SAVE_LIBS=$LIBS
302  LIBS="-R /usr/$PHP_LIBDIR $LIBS"
303  AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])],[php_cv_cc_dashr=yes],[php_cv_cc_dashr=no])
304  LIBS=$SAVE_LIBS])
305AC_MSG_RESULT([$php_cv_cc_dashr])
306if test $php_cv_cc_dashr = "yes"; then
307  ld_runpath_switch=-R
308else
309  AC_MSG_CHECKING([if compiler supports -Wl,-rpath,])
310  AC_CACHE_VAL(php_cv_cc_rpath,[
311    SAVE_LIBS=$LIBS
312    LIBS="-Wl,-rpath,/usr/$PHP_LIBDIR $LIBS"
313    AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])],[php_cv_cc_rpath=yes],[php_cv_cc_rpath=no])
314    LIBS=$SAVE_LIBS])
315  AC_MSG_RESULT([$php_cv_cc_rpath])
316  if test $php_cv_cc_rpath = "yes"; then
317    ld_runpath_switch=-Wl,-rpath,
318  else
319    dnl something innocuous
320    ld_runpath_switch=-L
321  fi
322fi
323if test "$PHP_RPATH" = "no"; then
324  ld_runpath_switch=
325fi
326])
327
328dnl
329dnl PHP_CHECK_GCC_ARG(arg, action-if-found, action-if-not-found)
330dnl
331AC_DEFUN([PHP_CHECK_GCC_ARG],[
332  gcc_arg_name=[ac_cv_gcc_arg]translit($1,A-Z=-,a-z__)
333  AC_CACHE_CHECK([whether $CC supports $1], [ac_cv_gcc_arg]translit($1,A-Z=-,a-z__), [
334  echo 'void somefunc() { };' > conftest.c
335  cmd='$CC $1 -c conftest.c'
336  if eval $cmd 2>&1 | $EGREP -e $1 >/dev/null ; then
337    ac_result=no
338  else
339    ac_result=yes
340  fi
341  eval $gcc_arg_name=$ac_result
342  rm -f conftest.*
343  ])
344  if eval test "\$$gcc_arg_name" = "yes"; then
345    $2
346  else
347    :
348    $3
349  fi
350])
351
352dnl
353dnl PHP_LIBGCC_LIBPATH(gcc)
354dnl
355dnl Stores the location of libgcc in libgcc_libpath
356dnl
357AC_DEFUN([PHP_LIBGCC_LIBPATH],[
358  changequote({,})
359  libgcc_libpath=`$1 --print-libgcc-file-name|$SED 's%/*[^/][^/]*$%%'`
360  changequote([,])
361])
362
363dnl -------------------------------------------------------------------------
364dnl Macros to modify LIBS, INCLUDES, etc. variables
365dnl -------------------------------------------------------------------------
366
367dnl
368dnl PHP_REMOVE_USR_LIB(NAME)
369dnl
370dnl Removes all -L/usr/$PHP_LIBDIR entries from variable NAME
371dnl
372AC_DEFUN([PHP_REMOVE_USR_LIB],[
373  unset ac_new_flags
374  for i in [$]$1; do
375    case [$]i in
376    -L/usr/$PHP_LIBDIR|-L/usr/$PHP_LIBDIR/[)] ;;
377    *[)] ac_new_flags="[$]ac_new_flags [$]i" ;;
378    esac
379  done
380  $1=[$]ac_new_flags
381])
382
383dnl
384dnl PHP_EVAL_LIBLINE(libline, SHARED-LIBADD)
385dnl
386dnl Use this macro, if you need to add libraries and or library search
387dnl paths to the PHP build system which are only given in compiler
388dnl notation.
389dnl
390AC_DEFUN([PHP_EVAL_LIBLINE],[
391  for ac_i in $1; do
392    case $ac_i in
393    -pthread[)]
394      if test "$ext_shared" = "yes"; then
395        $2="[$]$2 -pthread"
396      else
397        PHP_RUN_ONCE(EXTRA_LDFLAGS, [$ac_i], [EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ac_i"])
398        PHP_RUN_ONCE(EXTRA_LDFLAGS_PROGRAM, [$ac_i],
399            [EXTRA_LDFLAGS_PROGRAM="$EXTRA_LDFLAGS_PROGRAM $ac_i"])
400      fi
401    ;;
402    -l*[)]
403      ac_ii=`echo $ac_i|cut -c 3-`
404      PHP_ADD_LIBRARY($ac_ii,1,$2)
405    ;;
406    -L*[)]
407      ac_ii=`echo $ac_i|cut -c 3-`
408      PHP_ADD_LIBPATH($ac_ii,$2)
409    ;;
410    esac
411  done
412])
413
414dnl
415dnl PHP_EVAL_INCLINE(headerline)
416dnl
417dnl Use this macro, if you need to add header search paths to the PHP
418dnl build system which are only given in compiler notation.
419dnl
420AC_DEFUN([PHP_EVAL_INCLINE],[
421  for ac_i in $1; do
422    case $ac_i in
423    -I*[)]
424      ac_ii=`echo $ac_i|cut -c 3-`
425      PHP_ADD_INCLUDE($ac_ii)
426    ;;
427    esac
428  done
429])
430
431dnl internal, don't use
432AC_DEFUN([_PHP_ADD_LIBPATH_GLOBAL],[
433  PHP_RUN_ONCE(LIBPATH, $1, [
434    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$1"
435    LDFLAGS="$LDFLAGS -L$1"
436    PHP_RPATHS="$PHP_RPATHS $1"
437  ])
438])dnl
439dnl
440dnl
441dnl PHP_ADD_LIBPATH(path [, SHARED-LIBADD])
442dnl
443dnl Adds a path to linkpath/runpath (LDFLAGS)
444dnl
445AC_DEFUN([PHP_ADD_LIBPATH],[
446  if test "$1" != "/usr/$PHP_LIBDIR" && test "$1" != "/usr/lib"; then
447    PHP_EXPAND_PATH($1, ai_p)
448    ifelse([$2],,[
449      _PHP_ADD_LIBPATH_GLOBAL([$ai_p])
450    ],[
451      if test "$ext_shared" = "yes"; then
452        $2="-L$ai_p [$]$2"
453        test -n "$ld_runpath_switch" && $2="$ld_runpath_switch$ai_p [$]$2"
454      else
455        _PHP_ADD_LIBPATH_GLOBAL([$ai_p])
456      fi
457    ])
458  fi
459])
460
461dnl
462dnl PHP_UTILIZE_RPATHS()
463dnl
464dnl builds RPATHS/LDFLAGS from PHP_RPATHS
465dnl
466AC_DEFUN([PHP_UTILIZE_RPATHS],[
467  OLD_RPATHS=$PHP_RPATHS
468  unset PHP_RPATHS
469
470  for i in $OLD_RPATHS; do
471dnl Can be passed to native cc/libtool
472    PHP_LDFLAGS="$PHP_LDFLAGS -L$i"
473dnl Libtool-specific
474    PHP_RPATHS="$PHP_RPATHS -R $i"
475dnl cc-specific
476    NATIVE_RPATHS="$NATIVE_RPATHS $ld_runpath_switch$i"
477  done
478
479  if test "$PHP_RPATH" = "no"; then
480    unset PHP_RPATHS
481    unset NATIVE_RPATHS
482  fi
483])
484
485dnl
486dnl PHP_ADD_INCLUDE(path [,before])
487dnl
488dnl add an include path.
489dnl if before is 1, add in the beginning of INCLUDES.
490dnl
491AC_DEFUN([PHP_ADD_INCLUDE],[
492  if test "$1" != "/usr/include"; then
493    PHP_EXPAND_PATH($1, ai_p)
494    PHP_RUN_ONCE(INCLUDEPATH, $ai_p, [
495      if test "$2"; then
496        INCLUDES="-I$ai_p $INCLUDES"
497      else
498        INCLUDES="$INCLUDES -I$ai_p"
499      fi
500    ])
501  fi
502])
503
504dnl internal, don't use
505AC_DEFUN([_PHP_X_ADD_LIBRARY],[dnl
506  ifelse([$2],,$3="-l$1 [$]$3", $3="[$]$3 -l$1") dnl
507])dnl
508dnl
509dnl internal, don't use
510AC_DEFUN([_PHP_ADD_LIBRARY_SKELETON],[
511  case $1 in
512  c|c_r|pthread*[)] ;;
513  *[)] ifelse($3,,[
514    _PHP_X_ADD_LIBRARY($1,$2,$5)
515  ],[
516    if test "$ext_shared" = "yes"; then
517      _PHP_X_ADD_LIBRARY($1,$2,$3)
518    else
519      $4($1,$2)
520    fi
521  ]) ;;
522  esac
523])dnl
524dnl
525dnl
526dnl PHP_ADD_LIBRARY(library[, append[, shared-libadd]])
527dnl
528dnl add a library to the link line
529dnl
530AC_DEFUN([PHP_ADD_LIBRARY],[
531  _PHP_ADD_LIBRARY_SKELETON([$1],[$2],[$3],[PHP_ADD_LIBRARY],[LIBS])
532])
533
534dnl
535dnl PHP_ADD_LIBRARY_DEFER(library[, append[, shared-libadd]])
536dnl
537dnl add a library to the link line (deferred, not used during configure)
538dnl
539AC_DEFUN([PHP_ADD_LIBRARY_DEFER],[
540  _PHP_ADD_LIBRARY_SKELETON([$1],[$2],[$3],[PHP_ADD_LIBRARY_DEFER],[DLIBS])
541])
542
543dnl
544dnl PHP_ADD_LIBRARY_WITH_PATH(library, path[, shared-libadd])
545dnl
546dnl add a library to the link line and path to linkpath/runpath.
547dnl if shared-libadd is not empty and $ext_shared is yes,
548dnl shared-libadd will be assigned the library information
549dnl
550AC_DEFUN([PHP_ADD_LIBRARY_WITH_PATH],[
551ifelse($3,,[
552  if test -n "$2"; then
553    PHP_ADD_LIBPATH($2)
554  fi
555  PHP_ADD_LIBRARY($1)
556],[
557  if test "$ext_shared" = "yes"; then
558    $3="-l$1 [$]$3"
559    if test -n "$2"; then
560      PHP_ADD_LIBPATH($2,$3)
561    fi
562  else
563    PHP_ADD_LIBRARY_WITH_PATH($1,$2)
564  fi
565])
566])
567
568dnl
569dnl PHP_ADD_LIBRARY_DEFER_WITH_PATH(library, path[, shared-libadd])
570dnl
571dnl add a library to the link line (deferred)
572dnl and path to linkpath/runpath (not deferred)
573dnl if shared-libadd is not empty and $ext_shared is yes,
574dnl shared-libadd will be assigned the library information
575dnl
576AC_DEFUN([PHP_ADD_LIBRARY_DEFER_WITH_PATH],[
577ifelse($3,,[
578  if test -n "$2"; then
579    PHP_ADD_LIBPATH($2)
580  fi
581  PHP_ADD_LIBRARY_DEFER($1)
582],[
583  if test "$ext_shared" = "yes"; then
584    $3="-l$1 [$]$3"
585    if test -n "$2"; then
586      PHP_ADD_LIBPATH($2,$3)
587    fi
588  else
589    PHP_ADD_LIBRARY_DEFER_WITH_PATH($1,$2)
590  fi
591])
592])
593
594dnl
595dnl PHP_ADD_FRAMEWORK(framework [,before])
596dnl
597dnl add a (Darwin / Mac OS X) framework to the link
598dnl line. if before is 1, the framework is added
599dnl to the beginning of the line.
600dnl
601AC_DEFUN([PHP_ADD_FRAMEWORK], [
602  PHP_RUN_ONCE(FRAMEWORKS, $1, [
603    if test "$2"; then
604      PHP_FRAMEWORKS="-framework $1 $PHP_FRAMEWORKS"
605    else
606      PHP_FRAMEWORKS="$PHP_FRAMEWORKS -framework $1"
607    fi
608  ])
609])
610
611dnl
612dnl PHP_ADD_FRAMEWORKPATH(path [,before])
613dnl
614dnl add a (Darwin / Mac OS X) framework path to the link
615dnl and include lines. default paths include (but are
616dnl not limited to) /Local/Library/Frameworks and
617dnl /System/Library/Frameworks, so these don't need
618dnl to be specifically added. if before is 1, the
619dnl framework path is added to the beginning of the
620dnl relevant lines.
621dnl
622AC_DEFUN([PHP_ADD_FRAMEWORKPATH], [
623  PHP_EXPAND_PATH($1, ai_p)
624  PHP_RUN_ONCE(FRAMEWORKPATH, $ai_p, [
625    if test "$2"; then
626      PHP_FRAMEWORKPATH="-F$ai_p $PHP_FRAMEWORKPATH"
627    else
628      PHP_FRAMEWORKPATH="$PHP_FRAMEWORKPATH -F$ai_p"
629    fi
630  ])
631])
632
633dnl
634dnl PHP_ADD_FRAMEWORK_WITH_PATH(framework, path)
635dnl
636dnl Adds a (Darwin / Mac OS X) framework path and the
637dnl framework itself to the link and include lines.
638dnl
639AC_DEFUN([PHP_ADD_FRAMEWORK_WITH_PATH], [
640  PHP_ADD_FRAMEWORKPATH($2)
641  PHP_ADD_FRAMEWORK($1)
642])
643
644dnl
645dnl PHP_SET_LIBTOOL_VARIABLE(var)
646dnl
647dnl Set libtool variable
648dnl
649AC_DEFUN([PHP_SET_LIBTOOL_VARIABLE],[
650  if test -z "$LIBTOOL"; then
651    LIBTOOL='$(SHELL) $(top_builddir)/libtool $1'
652  else
653    LIBTOOL="$LIBTOOL $1"
654  fi
655])
656
657dnl -------------------------------------------------------------------------
658dnl Wrapper macros for AC_ARG_WITH / AC_ARG_ENABLE
659dnl -------------------------------------------------------------------------
660
661dnl PHP_ARG_ANALYZE_EX
662dnl internal
663AC_DEFUN([PHP_ARG_ANALYZE_EX],[
664ext_output="yes, shared"
665ext_shared=yes
666case [$]$1 in
667shared,*[)]
668  $1=`echo "[$]$1"|$SED 's/^shared,//'`
669  ;;
670shared[)]
671  $1=yes
672  ;;
673no[)]
674  ext_output=no
675  ext_shared=no
676  ;;
677*[)]
678  ext_output=yes
679  ext_shared=no
680  ;;
681esac
682
683PHP_ALWAYS_SHARED([$1])
684])
685
686dnl PHP_ARG_ANALYZE
687dnl internal
688AC_DEFUN([PHP_ARG_ANALYZE],[
689ifelse([$3],yes,[PHP_ARG_ANALYZE_EX([$1])],[ext_output=ifelse([$]$1,,no,[$]$1)])
690ifelse([$2],,,[AC_MSG_RESULT([$ext_output])])
691])
692
693dnl
694dnl PHP_ARG_WITH(arg-name, check message, help text[, default-val[, extension-or-not]])
695dnl Sets PHP_ARG_NAME either to the user value or to the default value.
696dnl default-val defaults to no.  This will also set the variable ext_shared,
697dnl and will overwrite any previous variable of that name.
698dnl If extension-or-not is yes (default), then do the ENABLE_ALL check and run
699dnl the PHP_ARG_ANALYZE_EX.
700dnl
701AC_DEFUN([PHP_ARG_WITH],[
702php_with_[]translit($1,A-Z0-9-,a-z0-9_)=ifelse($4,,no,$4)
703PHP_REAL_ARG_WITH([$1],[$2],[$3],[$4],PHP_[]translit($1,a-z0-9-,A-Z0-9_),[ifelse($5,,yes,$5)])
704])
705
706dnl PHP_REAL_ARG_WITH
707dnl internal
708AC_DEFUN([PHP_REAL_ARG_WITH],[
709ifelse([$2],,,[AC_MSG_CHECKING([$2])])
710AC_ARG_WITH($1,[$3],$5=[$]withval,
711[
712  $5=ifelse($4,,no,$4)
713  ifelse($6,yes,[test "$PHP_ENABLE_ALL" && $5=$PHP_ENABLE_ALL])
714])
715PHP_ARG_ANALYZE($5,[$2],$6)
716])
717
718dnl
719dnl PHP_ARG_ENABLE(arg-name, check message, help text[, default-val[, extension-or-not]])
720dnl Sets PHP_ARG_NAME either to the user value or to the default value.
721dnl default-val defaults to no.  This will also set the variable ext_shared,
722dnl and will overwrite any previous variable of that name.
723dnl If extension-or-not is yes (default), then do the ENABLE_ALL check and run
724dnl the PHP_ARG_ANALYZE_EX.
725dnl
726AC_DEFUN([PHP_ARG_ENABLE],[
727php_enable_[]translit($1,A-Z0-9-,a-z0-9_)=ifelse($4,,no,$4)
728PHP_REAL_ARG_ENABLE([$1],[$2],[$3],[$4],PHP_[]translit($1,a-z0-9-,A-Z0-9_),[ifelse($5,,yes,$5)])
729])
730
731dnl PHP_REAL_ARG_ENABLE
732dnl internal
733AC_DEFUN([PHP_REAL_ARG_ENABLE],[
734ifelse([$2],,,[AC_MSG_CHECKING([$2])])
735AC_ARG_ENABLE($1,[$3],$5=[$]enableval,
736[
737  $5=ifelse($4,,no,$4)
738  ifelse($6,yes,[test "$PHP_ENABLE_ALL" && $5=$PHP_ENABLE_ALL])
739])
740PHP_ARG_ANALYZE($5,[$2],$6)
741])
742
743dnl -------------------------------------------------------------------------
744dnl Build macros
745dnl -------------------------------------------------------------------------
746
747dnl
748dnl PHP_BUILD_THREAD_SAFE
749dnl
750AC_DEFUN([PHP_BUILD_THREAD_SAFE],[
751  enable_maintainer_zts=yes
752  if test "$pthreads_working" != "yes"; then
753    AC_MSG_ERROR([ZTS currently requires working POSIX threads. We were unable to verify that your system supports Pthreads.])
754  fi
755])
756
757dnl
758dnl PHP_REQUIRE_CXX
759dnl
760AC_DEFUN([PHP_REQUIRE_CXX],[
761  if test -z "$php_cxx_done"; then
762    AC_PROG_CXX
763    AC_PROG_CXXCPP
764    PHP_ADD_LIBRARY(stdc++)
765    php_cxx_done=yes
766  fi
767])
768
769dnl
770dnl PHP_BUILD_SHARED
771dnl
772AC_DEFUN([PHP_BUILD_SHARED],[
773  PHP_BUILD_PROGRAM
774  OVERALL_TARGET=libphp[]$PHP_MAJOR_VERSION[.la]
775  php_sapi_module=shared
776
777  php_c_pre=$shared_c_pre
778  php_c_meta=$shared_c_meta
779  php_c_post=$shared_c_post
780  php_cxx_pre=$shared_cxx_pre
781  php_cxx_meta=$shared_cxx_meta
782  php_cxx_post=$shared_cxx_post
783  php_lo=$shared_lo
784])
785
786dnl
787dnl PHP_BUILD_STATIC
788dnl
789AC_DEFUN([PHP_BUILD_STATIC],[
790  PHP_BUILD_PROGRAM
791  OVERALL_TARGET=libphp[]$PHP_MAJOR_VERSION[.la]
792  php_sapi_module=static
793])
794
795dnl
796dnl PHP_BUILD_BUNDLE
797dnl
798AC_DEFUN([PHP_BUILD_BUNDLE],[
799  PHP_BUILD_PROGRAM
800  OVERALL_TARGET=libs/libphp[]$PHP_MAJOR_VERSION[.bundle]
801  php_sapi_module=static
802])
803
804dnl
805dnl PHP_BUILD_PROGRAM
806dnl
807AC_DEFUN([PHP_BUILD_PROGRAM],[
808  php_c_pre='$(LIBTOOL) --mode=compile $(CC)'
809  php_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS)'
810  php_c_post=
811  php_cxx_pre='$(LIBTOOL) --mode=compile $(CXX)'
812  php_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS)'
813  php_cxx_post=
814  php_lo=lo
815
816  case $with_pic in
817    yes) pic_setting='-prefer-pic';;
818    no)  pic_setting='-prefer-non-pic';;
819  esac
820
821  shared_c_pre='$(LIBTOOL) --mode=compile $(CC)'
822  shared_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) '$pic_setting
823  shared_c_post=
824  shared_cxx_pre='$(LIBTOOL) --mode=compile $(CXX)'
825  shared_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS) '$pic_setting
826  shared_cxx_post=
827  shared_lo=lo
828])
829
830dnl
831dnl PHP_SHARED_MODULE(module-name, object-var, build-dir, cxx, zend_ext)
832dnl
833dnl Basically sets up the link-stage for building module-name
834dnl from object_var in build-dir.
835dnl
836AC_DEFUN([PHP_SHARED_MODULE],[
837  install_modules="install-modules"
838  suffix=la
839
840  case $host_alias in
841    *aix*[)]
842      additional_flags="-Wl,-G"
843      ;;
844  esac
845
846  if test "x$5" = "xyes"; then
847    PHP_ZEND_EX="$PHP_ZEND_EX \$(phplibdir)/$1.$suffix"
848  else
849    PHP_MODULES="$PHP_MODULES \$(phplibdir)/$1.$suffix"
850  fi
851  PHP_SUBST($2)
852  cat >>Makefile.objects<<EOF
853\$(phplibdir)/$1.$suffix: $3/$1.$suffix
854	\$(LIBTOOL) --mode=install cp $3/$1.$suffix \$(phplibdir)
855
856$3/$1.$suffix: \$($2) \$(translit($1,a-z_-,A-Z__)_SHARED_DEPENDENCIES)
857	\$(LIBTOOL) --mode=link ifelse($4,,[\$(CC)],[\$(CXX)]) \$(COMMON_FLAGS) \$(CFLAGS_CLEAN) \$(EXTRA_CFLAGS) \$(LDFLAGS) $additional_flags -o [\$]@ -export-dynamic -avoid-version -prefer-pic -module -rpath \$(phplibdir) \$(EXTRA_LDFLAGS) \$($2) \$(translit($1,a-z_-,A-Z__)_SHARED_LIBADD)
858
859EOF
860])
861
862dnl
863dnl PHP_SELECT_SAPI(name, type[, sources [, extra-cflags [, build-target]]])
864dnl
865dnl Selects the SAPI name and type (static, shared, bundle, program)
866dnl and optionally also the source-files for the SAPI-specific
867dnl objects.
868dnl
869AC_DEFUN([PHP_SELECT_SAPI],[
870  if test "$2" = "program"; then
871    PHP_BINARIES="$PHP_BINARIES $1"
872  elif test "$PHP_SAPI" != "none"; then
873    AC_MSG_ERROR([
874+--------------------------------------------------------------------+
875|                        *** ATTENTION ***                           |
876|                                                                    |
877| You've configured multiple SAPIs to be build. You can build only   |
878| one SAPI module plus CGI, CLI and FPM binaries at the same time.   |
879+--------------------------------------------------------------------+
880])
881  else
882    PHP_SAPI=$1
883  fi
884
885  PHP_ADD_BUILD_DIR([sapi/$1])
886
887  PHP_INSTALLED_SAPIS="$PHP_INSTALLED_SAPIS $1"
888
889  ifelse($2,program,[
890    PHP_BUILD_PROGRAM
891    install_binaries="install-binaries"
892    install_binary_targets="$install_binary_targets install-$1"
893    PHP_SUBST(PHP_[]translit($1,a-z0-9-,A-Z0-9_)[]_OBJS)
894    ifelse($3,,,[PHP_ADD_SOURCES_X([sapi/$1],[$3],[$4],PHP_[]translit($1,a-z0-9-,A-Z0-9_)[]_OBJS)])
895  ],[
896    case "$2" in
897    static[)] PHP_BUILD_STATIC;;
898    shared[)] PHP_BUILD_SHARED;;
899    bundle[)] PHP_BUILD_BUNDLE;;
900    esac
901    install_sapi="install-sapi"
902    ifelse($3,,,[PHP_ADD_SOURCES([sapi/$1],[$3],[$4],[sapi])])
903  ])
904])
905
906dnl deprecated
907AC_DEFUN([PHP_EXTENSION],[
908  sources=`$AWK -f $abs_srcdir/build/scan_makefile_in.awk < []PHP_EXT_SRCDIR($1)[]/Makefile.in`
909
910  PHP_NEW_EXTENSION($1, $sources, $2, $3)
911
912  if test -r "$ext_srcdir/Makefile.frag"; then
913    PHP_ADD_MAKEFILE_FRAGMENT
914  fi
915])
916
917AC_DEFUN([PHP_ADD_BUILD_DIR],[
918  ifelse($2,,[
919    BUILD_DIR="$BUILD_DIR $1"
920  ], [
921    $php_shtool mkdir -p $1
922  ])
923])
924
925AC_DEFUN([PHP_GEN_BUILD_DIRS],[
926  $php_shtool mkdir -p $BUILD_DIR
927])
928
929dnl
930dnl PHP_NEW_EXTENSION(extname, sources [, shared [, sapi_class [, extra-cflags [, cxx [, zend_ext]]]]])
931dnl
932dnl Includes an extension in the build.
933dnl
934dnl "extname" is the name of the extension.
935dnl "sources" is a list of files relative to the subdir which are used
936dnl to build the extension.
937dnl "shared" can be set to "shared" or "yes" to build the extension as
938dnl a dynamically loadable library. Optional parameter "sapi_class" can
939dnl be set to "cli" to mark extension build only with CLI or CGI sapi's.
940dnl "extra-cflags" are passed to the compiler, with
941dnl @ext_srcdir@ and @ext_builddir@ being substituted.
942dnl "cxx" can be used to indicate that a C++ shared module is desired.
943dnl "zend_ext" indicates a zend extension.
944AC_DEFUN([PHP_NEW_EXTENSION],[
945  ext_builddir=[]PHP_EXT_BUILDDIR($1)
946  ext_srcdir=[]PHP_EXT_SRCDIR($1)
947  ext_dir=[]PHP_EXT_DIR($1)
948
949  ifelse($5,,ac_extra=,[ac_extra=`echo "$5"|$SED s#@ext_srcdir@#$ext_srcdir#g|$SED s#@ext_builddir@#$ext_builddir#g`])
950
951  if test "$3" != "shared" && test "$3" != "yes" && test "$4" != "cli"; then
952dnl ---------------------------------------------- Static module
953    [PHP_]translit($1,a-z_-,A-Z__)[_SHARED]=no
954    PHP_ADD_SOURCES($ext_dir,$2,$ac_extra,)
955    EXT_STATIC="$EXT_STATIC $1;$ext_dir"
956    if test "$3" != "nocli"; then
957      EXT_CLI_STATIC="$EXT_CLI_STATIC $1;$ext_dir"
958    fi
959  else
960    if test "$3" = "shared" || test "$3" = "yes"; then
961dnl ---------------------------------------------- Shared module
962      [PHP_]translit($1,a-z_-,A-Z__)[_SHARED]=yes
963      PHP_ADD_SOURCES_X($ext_dir,$2,$ac_extra,shared_objects_$1,yes)
964      PHP_SHARED_MODULE($1,shared_objects_$1, $ext_builddir, $6, $7)
965      AC_DEFINE_UNQUOTED([COMPILE_DL_]translit($1,a-z_-,A-Z__), 1, Whether to build $1 as dynamic module)
966    fi
967  fi
968
969  if test "$3" != "shared" && test "$3" != "yes" && test "$4" = "cli"; then
970dnl ---------------------------------------------- CLI static module
971    [PHP_]translit($1,a-z_-,A-Z__)[_SHARED]=no
972    case "$PHP_SAPI" in
973      cgi|embed|phpdbg[)]
974        PHP_ADD_SOURCES($ext_dir,$2,$ac_extra,)
975        EXT_STATIC="$EXT_STATIC $1;$ext_dir"
976        ;;
977      *[)]
978        PHP_ADD_SOURCES($ext_dir,$2,$ac_extra,cli)
979        ;;
980    esac
981    EXT_CLI_STATIC="$EXT_CLI_STATIC $1;$ext_dir"
982  fi
983  PHP_ADD_BUILD_DIR($ext_builddir)
984
985dnl Set for phpize builds only
986dnl ---------------------------
987  if test "$ext_builddir" = "."; then
988    PHP_PECL_EXTENSION=$1
989    PHP_SUBST(PHP_PECL_EXTENSION)
990  fi
991])
992
993dnl
994dnl PHP_WITH_SHARED
995dnl
996dnl Checks whether $withval is "shared" or starts with "shared,XXX"
997dnl and sets $shared to "yes" or "no", and removes "shared,?" stuff
998dnl from $withval.
999dnl
1000AC_DEFUN([PHP_WITH_SHARED],[
1001  PHP_ARG_ANALYZE_EX(withval)
1002  shared=$ext_shared
1003  unset ext_shared ext_output
1004])
1005
1006dnl
1007dnl PHP_ADD_EXTENSION_DEP(extname, depends [, depconf])
1008dnl
1009dnl This macro is scanned by genif.sh when it builds the internal functions
1010dnl list, so that modules can be init'd in the correct order
1011dnl $1 = name of extension, $2 = extension upon which it depends
1012dnl $3 = optional: if true, it's ok for $2 to have not been configured
1013dnl default is false and should halt the build.
1014dnl To be effective, this macro must be invoked *after* PHP_NEW_EXTENSION.
1015dnl The extension on which it depends must also have been configured.
1016dnl See ADD_EXTENSION_DEP in win32 build
1017dnl
1018AC_DEFUN([PHP_ADD_EXTENSION_DEP], [
1019  am_i_shared=$[PHP_]translit($1,a-z_-,A-Z__)[_SHARED]
1020  is_it_shared=$[PHP_]translit($2,a-z_-,A-Z__)[_SHARED]
1021  is_it_enabled=$[PHP_]translit($2,a-z_-,A-Z__)
1022  if test "$am_i_shared" = "no" && test "$is_it_shared" = "yes" ; then
1023    AC_MSG_ERROR([
1024You've configured extension $1 to build statically, but it
1025depends on extension $2, which you've configured to build shared.
1026You either need to build $1 shared or build $2 statically for the
1027build to be successful.
1028])
1029  fi
1030  if test "x$is_it_enabled" = "xno" && test "x$3" != "xtrue"; then
1031    AC_MSG_ERROR([
1032You've configured extension $1, which depends on extension $2,
1033but you've either not enabled $2, or have disabled it.
1034])
1035  fi
1036  dnl Some systems require that we link $2 to $1 when building
1037])
1038
1039dnl -------------------------------------------------------------------------
1040dnl Checks for structures, typedefs, broken functions, etc.
1041dnl -------------------------------------------------------------------------
1042
1043dnl Internal helper macros
1044dnl
1045dnl _PHP_DEF_HAVE_FILE(what, filename)
1046AC_DEFUN([_PHP_DEF_HAVE_FILE], [
1047  php_def_have_what=HAVE_[]`echo $1 | tr 'abcdefghijklmnopqrstuvwxyz-' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_' `
1048  echo "#define $php_def_have_what 1" >> $2
1049])
1050dnl
1051dnl _PHP_CHECK_SIZEOF(type, cross-value, extra-headers [, found-action [, not-found-action]])
1052dnl
1053AC_DEFUN([_PHP_CHECK_SIZEOF], [
1054  php_cache_value=php_cv_sizeof_[]$1
1055  AC_CACHE_VAL(php_cv_sizeof_[]$1, [
1056    old_LIBS=$LIBS
1057    LIBS=
1058    old_LDFLAGS=$LDFLAGS
1059    LDFLAGS=
1060    AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <stdio.h>
1061#if STDC_HEADERS
1062#include <stdlib.h>
1063#include <stddef.h>
1064#endif
1065#ifdef HAVE_INTTYPES_H
1066#include <inttypes.h>
1067#endif
1068#ifdef HAVE_UNISTD_H
1069#include <unistd.h>
1070#endif
1071$3
1072
1073int main()
1074{
1075	FILE *fp = fopen("conftestval", "w");
1076	if (!fp) return(1);
1077	fprintf(fp, "%d\n", sizeof($1));
1078	return(0);
1079}
1080  ]])], [
1081    eval $php_cache_value=`cat conftestval`
1082  ], [
1083    eval $php_cache_value=0
1084  ], [
1085    ifelse([$2],,[eval $php_cache_value=0], [eval $php_cache_value=$2])
1086])
1087  LDFLAGS=$old_LDFLAGS
1088  LIBS=$old_LIBS
1089])
1090  if eval test "\$$php_cache_value" != "0"; then
1091ifelse([$4],[],:,[$4])
1092ifelse([$5],[],,[else $5])
1093  fi
1094])
1095
1096dnl
1097dnl PHP_CHECK_SIZEOF(type, cross-value, extra-headers)
1098dnl
1099AC_DEFUN([PHP_CHECK_SIZEOF], [
1100  AC_MSG_CHECKING([size of $1])
1101  _PHP_CHECK_SIZEOF($1, $2, $3, [
1102    AC_DEFINE_UNQUOTED([SIZEOF_]translit($1,a-z,A-Z_), [$]php_cv_sizeof_[]$1, [Size of $1])
1103    AC_DEFINE_UNQUOTED([HAVE_]translit($1,a-z,A-Z_), 1, [Whether $1 is available])
1104  ])
1105  AC_MSG_RESULT([[$][php_cv_sizeof_]translit($1, ,_)])
1106])
1107
1108dnl
1109dnl PHP_CHECK_TYPES(type-list, include-file [, extra-headers])
1110dnl
1111AC_DEFUN([PHP_CHECK_TYPES], [
1112  for php_typename in $1; do
1113    AC_MSG_CHECKING([whether $php_typename exists])
1114    _PHP_CHECK_SIZEOF($php_typename, 0, $3, [
1115      _PHP_DEF_HAVE_FILE($php_typename, $2)
1116      AC_MSG_RESULT([yes])
1117    ], [
1118      AC_MSG_RESULT([no])
1119    ])
1120  done
1121])
1122
1123dnl
1124dnl PHP_CHECK_IN_ADDR_T
1125dnl
1126AC_DEFUN([PHP_CHECK_IN_ADDR_T], [
1127dnl AIX keeps in_addr_t in /usr/include/netinet/in.h
1128AC_MSG_CHECKING([for in_addr_t])
1129AC_CACHE_VAL(ac_cv_type_in_addr_t,
1130[AC_EGREP_CPP(dnl
1131changequote(<<,>>)dnl
1132<<in_addr_t[^a-zA-Z_0-9]>>dnl
1133changequote([,]), [#include <sys/types.h>
1134#if STDC_HEADERS
1135#include <stdlib.h>
1136#include <stddef.h>
1137#endif
1138#ifdef HAVE_NETINET_IN_H
1139#include <netinet/in.h>
1140#endif], ac_cv_type_in_addr_t=yes, ac_cv_type_in_addr_t=no)])dnl
1141AC_MSG_RESULT([$ac_cv_type_in_addr_t])
1142if test $ac_cv_type_in_addr_t = no; then
1143  AC_DEFINE(in_addr_t, u_int, [ ])
1144fi
1145])
1146
1147dnl
1148dnl PHP_TIME_R_TYPE
1149dnl
1150dnl Check type of reentrant time-related functions
1151dnl Type can be: irix, hpux or POSIX
1152dnl
1153AC_DEFUN([PHP_TIME_R_TYPE],[
1154AC_CACHE_CHECK(for type of reentrant time-related functions, ac_cv_time_r_type,[
1155AC_RUN_IFELSE([AC_LANG_SOURCE([[
1156#include <time.h>
1157
1158main() {
1159char buf[27];
1160struct tm t;
1161time_t old = 0;
1162int r, s;
1163
1164s = gmtime_r(&old, &t);
1165r = (int) asctime_r(&t, buf, 26);
1166if (r == s && s == 0) return (0);
1167return (1);
1168}
1169]])],[
1170  ac_cv_time_r_type=hpux
1171],[
1172  AC_RUN_IFELSE([AC_LANG_SOURCE([[
1173#include <time.h>
1174main() {
1175  struct tm t, *s;
1176  time_t old = 0;
1177  char buf[27], *p;
1178
1179  s = gmtime_r(&old, &t);
1180  p = asctime_r(&t, buf, 26);
1181  if (p == buf && s == &t) return (0);
1182  return (1);
1183}
1184  ]])],[
1185    ac_cv_time_r_type=irix
1186  ],[
1187    ac_cv_time_r_type=POSIX
1188  ],[
1189    ac_cv_time_r_type=POSIX
1190  ])
1191],[
1192  ac_cv_time_r_type=POSIX
1193])
1194])
1195  case $ac_cv_time_r_type in
1196  hpux[)] AC_DEFINE(PHP_HPUX_TIME_R,1,[Whether you have HP-UX 10.x]) ;;
1197  irix[)] AC_DEFINE(PHP_IRIX_TIME_R,1,[Whether you have IRIX-style functions]) ;;
1198  esac
1199])
1200
1201dnl
1202dnl PHP_DOES_PWRITE_WORK
1203dnl internal
1204AC_DEFUN([PHP_DOES_PWRITE_WORK],[
1205  AC_RUN_IFELSE([AC_LANG_SOURCE([[
1206#include <sys/types.h>
1207#include <sys/stat.h>
1208#include <fcntl.h>
1209#include <unistd.h>
1210#include <errno.h>
1211$1
1212    int main() {
1213    int fd = open("conftest_in", O_WRONLY|O_CREAT, 0600);
1214
1215    if (fd < 0) return 1;
1216    if (pwrite(fd, "text", 4, 0) != 4) return 1;
1217    /* Linux glibc breakage until 2.2.5 */
1218    if (pwrite(fd, "text", 4, -1) != -1 || errno != EINVAL) return 1;
1219    return 0;
1220    }
1221
1222  ]])],[
1223    ac_cv_pwrite=yes
1224  ],[
1225    ac_cv_pwrite=no
1226  ],[
1227    ac_cv_pwrite=no
1228  ])
1229])
1230
1231dnl PHP_DOES_PREAD_WORK
1232dnl internal
1233AC_DEFUN([PHP_DOES_PREAD_WORK],[
1234  echo test > conftest_in
1235  AC_RUN_IFELSE([AC_LANG_SOURCE([[
1236#include <sys/types.h>
1237#include <sys/stat.h>
1238#include <fcntl.h>
1239#include <unistd.h>
1240#include <errno.h>
1241$1
1242    int main() {
1243    char buf[3];
1244    int fd = open("conftest_in", O_RDONLY);
1245    if (fd < 0) return 1;
1246    if (pread(fd, buf, 2, 0) != 2) return 1;
1247    /* Linux glibc breakage until 2.2.5 */
1248    if (pread(fd, buf, 2, -1) != -1 || errno != EINVAL) return 1;
1249    return 0;
1250    }
1251  ]])],[
1252    ac_cv_pread=yes
1253  ],[
1254    ac_cv_pread=no
1255  ],[
1256    ac_cv_pread=no
1257  ])
1258  rm -f conftest_in
1259])
1260
1261dnl
1262dnl PHP_PWRITE_TEST
1263dnl
1264AC_DEFUN([PHP_PWRITE_TEST],[
1265  AC_CACHE_CHECK(whether pwrite works,ac_cv_pwrite,[
1266    PHP_DOES_PWRITE_WORK
1267    if test "$ac_cv_pwrite" = "no"; then
1268      PHP_DOES_PWRITE_WORK([ssize_t pwrite(int, void *, size_t, off64_t);])
1269      if test "$ac_cv_pwrite" = "yes"; then
1270        ac_cv_pwrite=64
1271      fi
1272    fi
1273  ])
1274
1275  if test "$ac_cv_pwrite" != "no"; then
1276    AC_DEFINE(HAVE_PWRITE, 1, [ ])
1277    if test "$ac_cv_pwrite" = "64"; then
1278      AC_DEFINE(PHP_PWRITE_64, 1, [whether pwrite64 is default])
1279    fi
1280  fi
1281])
1282
1283dnl
1284dnl PHP_PREAD_TEST
1285dnl
1286AC_DEFUN([PHP_PREAD_TEST],[
1287  AC_CACHE_CHECK(whether pread works,ac_cv_pread,[
1288    PHP_DOES_PREAD_WORK
1289    if test "$ac_cv_pread" = "no"; then
1290      PHP_DOES_PREAD_WORK([ssize_t pread(int, void *, size_t, off64_t);])
1291      if test "$ac_cv_pread" = "yes"; then
1292        ac_cv_pread=64
1293      fi
1294    fi
1295  ])
1296
1297  if test "$ac_cv_pread" != "no"; then
1298    AC_DEFINE(HAVE_PREAD, 1, [ ])
1299    if test "$ac_cv_pread" = "64"; then
1300      AC_DEFINE(PHP_PREAD_64, 1, [whether pread64 is default])
1301    fi
1302  fi
1303])
1304
1305dnl
1306dnl PHP_MISSING_TIME_R_DECL
1307dnl
1308AC_DEFUN([PHP_MISSING_TIME_R_DECL],[
1309  AC_MSG_CHECKING([for missing declarations of reentrant functions])
1310  AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <time.h>]], [[struct tm *(*func)() = localtime_r]])],[
1311    :
1312  ],[
1313    AC_DEFINE(MISSING_LOCALTIME_R_DECL,1,[Whether localtime_r is declared])
1314  ])
1315  AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <time.h>]], [[struct tm *(*func)() = gmtime_r]])],[
1316    :
1317  ],[
1318    AC_DEFINE(MISSING_GMTIME_R_DECL,1,[Whether gmtime_r is declared])
1319  ])
1320  AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <time.h>]], [[char *(*func)() = asctime_r]])],[
1321    :
1322  ],[
1323    AC_DEFINE(MISSING_ASCTIME_R_DECL,1,[Whether asctime_r is declared])
1324  ])
1325  AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <time.h>]], [[char *(*func)() = ctime_r]])],[
1326    :
1327  ],[
1328    AC_DEFINE(MISSING_CTIME_R_DECL,1,[Whether ctime_r is declared])
1329  ])
1330  AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <string.h>]], [[char *(*func)() = strtok_r]])],[
1331    :
1332  ],[
1333    AC_DEFINE(MISSING_STRTOK_R_DECL,1,[Whether strtok_r is declared])
1334  ])
1335  AC_MSG_RESULT([done])
1336])
1337
1338dnl
1339dnl PHP_READDIR_R_TYPE
1340dnl
1341AC_DEFUN([PHP_READDIR_R_TYPE],[
1342  dnl HAVE_READDIR_R is also defined by libmysql
1343  AC_CHECK_FUNC(readdir_r,ac_cv_func_readdir_r=yes,ac_cv_func_readdir=no)
1344  if test "$ac_cv_func_readdir_r" = "yes"; then
1345  AC_CACHE_CHECK(for type of readdir_r, ac_cv_what_readdir_r,[
1346    AC_RUN_IFELSE([AC_LANG_SOURCE([[
1347#define _REENTRANT
1348#include <sys/types.h>
1349#include <dirent.h>
1350#include <unistd.h>
1351
1352#ifndef PATH_MAX
1353#define PATH_MAX 1024
1354#endif
1355
1356int main() {
1357  DIR *dir;
1358  char entry[sizeof(struct dirent)+PATH_MAX];
1359  struct dirent *pentry = (struct dirent *) &entry;
1360
1361  dir = opendir("/");
1362  if (!dir)
1363    return 1;
1364  if (readdir_r(dir, (struct dirent *) entry, &pentry) == 0) {
1365    close(dir);
1366    return 0;
1367  }
1368  close(dir);
1369  return 1;
1370}
1371    ]])],[
1372      ac_cv_what_readdir_r=POSIX
1373    ],[
1374      AC_PREPROC_IFELSE([
1375        AC_LANG_SOURCE([[
1376#define _REENTRANT
1377#include <sys/types.h>
1378#include <dirent.h>
1379int readdir_r(DIR *, struct dirent *);
1380        ]])],[
1381          ac_cv_what_readdir_r=old-style
1382        ],[
1383          ac_cv_what_readdir_r=none
1384      ])
1385    ],[
1386      ac_cv_what_readdir_r=none
1387   ])
1388  ])
1389    case $ac_cv_what_readdir_r in
1390    POSIX)
1391      AC_DEFINE(HAVE_POSIX_READDIR_R,1,[whether you have POSIX readdir_r]);;
1392    old-style)
1393      AC_DEFINE(HAVE_OLD_READDIR_R,1,[whether you have old-style readdir_r]);;
1394    esac
1395  fi
1396])
1397
1398dnl
1399dnl PHP_TM_GMTOFF
1400dnl
1401AC_DEFUN([PHP_TM_GMTOFF],[
1402AC_CACHE_CHECK([for tm_gmtoff in struct tm], ac_cv_struct_tm_gmtoff,
1403[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
1404#include <$ac_cv_struct_tm>]], [[struct tm tm; tm.tm_gmtoff;]])],
1405  [ac_cv_struct_tm_gmtoff=yes], [ac_cv_struct_tm_gmtoff=no])])
1406
1407if test "$ac_cv_struct_tm_gmtoff" = yes; then
1408  AC_DEFINE(HAVE_TM_GMTOFF,1,[whether you have tm_gmtoff in struct tm])
1409fi
1410])
1411
1412dnl
1413dnl PHP_STRUCT_FLOCK
1414dnl
1415AC_DEFUN([PHP_STRUCT_FLOCK],[
1416AC_CACHE_CHECK(for struct flock,ac_cv_struct_flock,
1417    AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1418#include <unistd.h>
1419#include <fcntl.h>
1420        ]], [[struct flock x;]])],[
1421          ac_cv_struct_flock=yes
1422        ],[
1423          ac_cv_struct_flock=no
1424        ])
1425)
1426if test "$ac_cv_struct_flock" = "yes" ; then
1427    AC_DEFINE(HAVE_STRUCT_FLOCK, 1,[whether you have struct flock])
1428fi
1429])
1430
1431dnl
1432dnl PHP_SOCKLEN_T
1433dnl
1434AC_DEFUN([PHP_SOCKLEN_T],[
1435AC_CACHE_CHECK(for socklen_t,ac_cv_socklen_t,
1436  AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1437#include <sys/types.h>
1438#include <sys/socket.h>
1439]],[[
1440socklen_t x;
1441]])],[
1442  ac_cv_socklen_t=yes
1443],[
1444  ac_cv_socklen_t=no
1445]))
1446if test "$ac_cv_socklen_t" = "yes"; then
1447  AC_DEFINE(HAVE_SOCKLEN_T, 1, [Whether you have socklen_t])
1448fi
1449])
1450
1451dnl
1452dnl PHP_MISSING_FCLOSE_DECL
1453dnl
1454dnl See if we have broken header files like SunOS has.
1455dnl
1456AC_DEFUN([PHP_MISSING_FCLOSE_DECL],[
1457  AC_MSG_CHECKING([for fclose declaration])
1458  AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <stdio.h>]], [[int (*func)() = fclose]])],[
1459    AC_DEFINE(MISSING_FCLOSE_DECL,0,[ ])
1460    AC_MSG_RESULT([ok])
1461  ],[
1462    AC_DEFINE(MISSING_FCLOSE_DECL,1,[ ])
1463    AC_MSG_RESULT([missing])
1464  ])
1465])
1466
1467dnl
1468dnl PHP_AC_BROKEN_SPRINTF
1469dnl
1470dnl Check for broken sprintf(), C99 conformance
1471dnl
1472AC_DEFUN([PHP_AC_BROKEN_SPRINTF],[
1473  AC_CACHE_CHECK(whether sprintf is broken, ac_cv_broken_sprintf,[
1474    AC_RUN_IFELSE([AC_LANG_SOURCE([[main() {char buf[20];exit(sprintf(buf,"testing 123")!=11); }]])],[
1475      ac_cv_broken_sprintf=no
1476    ],[
1477      ac_cv_broken_sprintf=yes
1478    ],[
1479      ac_cv_broken_sprintf=no
1480    ])
1481  ])
1482  if test "$ac_cv_broken_sprintf" = "yes"; then
1483    AC_DEFINE(PHP_BROKEN_SPRINTF, 1, [Whether sprintf is C99 conform])
1484  else
1485    AC_DEFINE(PHP_BROKEN_SPRINTF, 0, [Whether sprintf is C99 conform])
1486  fi
1487])
1488
1489dnl
1490dnl PHP_AC_BROKEN_SNPRINTF
1491dnl
1492dnl Check for broken snprintf(), C99 conformance
1493dnl
1494AC_DEFUN([PHP_AC_BROKEN_SNPRINTF],[
1495  AC_CACHE_CHECK(whether snprintf is broken, ac_cv_broken_snprintf,[
1496    AC_RUN_IFELSE([AC_LANG_SOURCE([[
1497#define NULL (0L)
1498main() {
1499  char buf[20];
1500  int res = 0;
1501  res = res || (snprintf(buf, 2, "marcus") != 6);
1502  res = res || (buf[1] != '\0');
1503  /* Implementations may consider this as an encoding error */
1504  snprintf(buf, 0, "boerger");
1505  /* However, they MUST ignore the pointer */
1506  res = res || (buf[0] != 'm');
1507  res = res || (snprintf(NULL, 0, "boerger") != 7);
1508  res = res || (snprintf(buf, sizeof(buf), "%f", 0.12345678) != 8);
1509  exit(res);
1510}
1511    ]])],[
1512      ac_cv_broken_snprintf=no
1513    ],[
1514      ac_cv_broken_snprintf=yes
1515    ],[
1516      ac_cv_broken_snprintf=no
1517    ])
1518  ])
1519  if test "$ac_cv_broken_snprintf" = "yes"; then
1520    AC_DEFINE(PHP_BROKEN_SNPRINTF, 1, [Whether snprintf is C99 conform])
1521  else
1522    AC_DEFINE(PHP_BROKEN_SNPRINTF, 0, [Whether snprintf is C99 conform])
1523  fi
1524])
1525
1526dnl
1527dnl PHP_SOLARIS_PIC_WEIRDNESS
1528dnl
1529dnl Solaris requires main code to be position independent in order
1530dnl to let shared objects find symbols.  Weird.  Ugly.
1531dnl
1532dnl Must be run after all --with-NN options that let the user
1533dnl choose dynamic extensions, and after the gcc test.
1534dnl
1535AC_DEFUN([PHP_SOLARIS_PIC_WEIRDNESS],[
1536  AC_MSG_CHECKING([whether -fPIC is required])
1537  if test -n "$EXT_SHARED"; then
1538    os=`uname -sr 2>/dev/null`
1539    case $os in
1540      "SunOS 5.6"|"SunOS 5.7"[)]
1541        case $CC in
1542          gcc*|egcs*)
1543            CFLAGS="$CFLAGS -fPIC";;
1544          *[)]
1545            CFLAGS="$CFLAGS -fpic";;
1546        esac
1547        AC_MSG_RESULT([yes]);;
1548      *[)]
1549        AC_MSG_RESULT([no]);;
1550    esac
1551  else
1552    AC_MSG_RESULT([no])
1553  fi
1554])
1555
1556dnl
1557dnl PHP_SYS_LFS
1558dnl
1559dnl The problem is that the default compilation flags in Solaris 2.6 won't
1560dnl let programs access large files;  you need to tell the compiler that
1561dnl you actually want your programs to work on large files.  For more
1562dnl details about this brain damage please see:
1563dnl http://www.sas.com/standards/large.file/x_open.20Mar96.html
1564dnl
1565dnl Written by Paul Eggert <eggert@twinsun.com>.
1566dnl
1567AC_DEFUN([PHP_SYS_LFS],
1568[dnl
1569  # If available, prefer support for large files unless the user specified
1570  # one of the CPPFLAGS, LDFLAGS, or LIBS variables.
1571  AC_MSG_CHECKING([whether large file support needs explicit enabling])
1572  ac_getconfs=''
1573  ac_result=yes
1574  ac_set=''
1575  ac_shellvars='CPPFLAGS LDFLAGS LIBS'
1576  for ac_shellvar in $ac_shellvars; do
1577    case $ac_shellvar in
1578      CPPFLAGS[)] ac_lfsvar=LFS_CFLAGS ;;
1579      *[)] ac_lfsvar=LFS_$ac_shellvar ;;
1580    esac
1581    eval test '"${'$ac_shellvar'+set}"' = set && ac_set=$ac_shellvar
1582    (getconf $ac_lfsvar) >/dev/null 2>&1 || { ac_result=no; break; }
1583    ac_getconf=`getconf $ac_lfsvar`
1584    ac_getconfs=$ac_getconfs$ac_getconf
1585    eval ac_test_$ac_shellvar=\$ac_getconf
1586  done
1587  case "$ac_result$ac_getconfs" in
1588    yes[)] ac_result=no ;;
1589  esac
1590  case "$ac_result$ac_set" in
1591    yes?*[)] ac_result="yes, but $ac_set is already set, so use its settings"
1592  esac
1593  AC_MSG_RESULT([$ac_result])
1594  case $ac_result in
1595    yes[)]
1596      for ac_shellvar in $ac_shellvars; do
1597        eval $ac_shellvar=\$ac_test_$ac_shellvar
1598      done ;;
1599  esac
1600])
1601
1602dnl
1603dnl PHP_SOCKADDR_CHECKS
1604dnl
1605AC_DEFUN([PHP_SOCKADDR_CHECKS], [
1606  dnl Check for struct sockaddr_storage exists
1607  AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_sockaddr_storage,
1608    [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
1609#include <sys/socket.h>]],
1610    [[struct sockaddr_storage s; s]])],
1611    [ac_cv_sockaddr_storage=yes], [ac_cv_sockaddr_storage=no])
1612  ])
1613  if test "$ac_cv_sockaddr_storage" = "yes"; then
1614    AC_DEFINE(HAVE_SOCKADDR_STORAGE, 1, [Whether you have struct sockaddr_storage])
1615  fi
1616  dnl Check if field sa_len exists in struct sockaddr
1617  AC_CACHE_CHECK([for field sa_len in struct sockaddr],ac_cv_sockaddr_sa_len,[
1618    AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
1619#include <sys/socket.h>]], [[static struct sockaddr sa; int n = (int) sa.sa_len; return n;]])],
1620    [ac_cv_sockaddr_sa_len=yes], [ac_cv_sockaddr_sa_len=no])
1621  ])
1622  if test "$ac_cv_sockaddr_sa_len" = "yes"; then
1623    AC_DEFINE(HAVE_SOCKADDR_SA_LEN, 1, [Whether struct sockaddr has field sa_len])
1624  fi
1625])
1626
1627dnl
1628dnl PHP_DECLARED_TIMEZONE
1629dnl
1630AC_DEFUN([PHP_DECLARED_TIMEZONE],[
1631  AC_CACHE_CHECK(for declared timezone, ac_cv_declared_timezone,[
1632    AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1633#include <sys/types.h>
1634#include <time.h>
1635#ifdef HAVE_SYS_TIME_H
1636#include <sys/time.h>
1637#endif
1638]],[[
1639    time_t foo = (time_t) timezone;
1640]])],[
1641  ac_cv_declared_timezone=yes
1642],[
1643  ac_cv_declared_timezone=no
1644])])
1645  if test "$ac_cv_declared_timezone" = "yes"; then
1646    AC_DEFINE(HAVE_DECLARED_TIMEZONE, 1, [Whether system headers declare timezone])
1647  fi
1648])
1649
1650dnl
1651dnl PHP_EBCDIC
1652dnl
1653AC_DEFUN([PHP_EBCDIC], [
1654  AC_CACHE_CHECK([whether system uses EBCDIC],ac_cv_ebcdic,[
1655  AC_RUN_IFELSE([AC_LANG_SOURCE([[
1656int main(void) {
1657  return (unsigned char)'A' != (unsigned char)0xC1;
1658}
1659]])],[
1660  ac_cv_ebcdic=yes
1661],[
1662  ac_cv_ebcdic=no
1663],[
1664  ac_cv_ebcdic=no
1665])])
1666  if test "$ac_cv_ebcdic" = "yes"; then
1667    AC_DEFINE(CHARSET_EBCDIC,1, [Define if system uses EBCDIC])
1668  fi
1669])
1670
1671dnl
1672dnl PHP_BROKEN_GETCWD
1673dnl
1674dnl Some systems, notably Solaris, cause getcwd() or realpath to fail if a
1675dnl component of the path has execute but not read permissions
1676dnl
1677AC_DEFUN([PHP_BROKEN_GETCWD],[
1678  AC_MSG_CHECKING([for broken getcwd])
1679  os=`uname -sr 2>/dev/null`
1680  case $os in
1681    SunOS*[)]
1682      AC_DEFINE(HAVE_BROKEN_GETCWD,1, [Define if system has broken getcwd])
1683      AC_MSG_RESULT([yes]);;
1684    *[)]
1685      AC_MSG_RESULT([no]);;
1686  esac
1687])
1688
1689dnl
1690dnl PHP_BROKEN_GLIBC_FOPEN_APPEND
1691dnl
1692AC_DEFUN([PHP_BROKEN_GLIBC_FOPEN_APPEND], [
1693  AC_MSG_CHECKING([for broken libc stdio])
1694  AC_CACHE_VAL(_cv_have_broken_glibc_fopen_append,[
1695  AC_RUN_IFELSE([AC_LANG_SOURCE([[
1696#include <stdio.h>
1697#include <unistd.h>
1698int main(int argc, char *argv[])
1699{
1700  FILE *fp;
1701  long position;
1702  char *filename = tmpnam(NULL);
1703
1704  fp = fopen(filename, "w");
1705  if (fp == NULL) {
1706    perror("fopen");
1707    return 2;
1708  }
1709  fputs("foobar", fp);
1710  fclose(fp);
1711
1712  fp = fopen(filename, "a+");
1713  position = ftell(fp);
1714  fclose(fp);
1715  unlink(filename);
1716  if (position == 0)
1717  return 1;
1718  return 0;
1719}
1720]])],
1721[_cv_have_broken_glibc_fopen_append=no],
1722[_cv_have_broken_glibc_fopen_append=yes],
1723[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1724#include <features.h>
1725]], [[
1726#if !__GLIBC_PREREQ(2,2)
1727choke me
1728#endif
1729]])],
1730[_cv_have_broken_glibc_fopen_append=yes],
1731[_cv_have_broken_glibc_fopen_append=no])
1732])])
1733
1734  if test "$_cv_have_broken_glibc_fopen_append" = "yes"; then
1735    AC_MSG_RESULT(yes)
1736    AC_DEFINE(HAVE_BROKEN_GLIBC_FOPEN_APPEND,1, [Define if your glibc borks on fopen with mode a+])
1737  else
1738    AC_MSG_RESULT(no)
1739  fi
1740])
1741
1742dnl
1743dnl PHP_BROKEN_GCC_STRLEN_OPT
1744dnl
1745dnl Early releases of GCC 8 shipped with a strlen() optimization bug, so they
1746dnl didn't properly handle the `char val[1]` struct hack. See bug #76510.
1747dnl
1748AC_DEFUN([PHP_BROKEN_GCC_STRLEN_OPT], [
1749  AC_CACHE_CHECK([for broken gcc optimize-strlen],ac_cv_have_broken_gcc_strlen_opt,[
1750  AC_RUN_IFELSE([AC_LANG_SOURCE([[
1751#include <stdlib.h>
1752#include <string.h>
1753#include <stdio.h>
1754struct s
1755{
1756  int i;
1757  char c[1];
1758};
1759int main()
1760{
1761  struct s *s = malloc(sizeof(struct s) + 3);
1762  s->i = 3;
1763  strcpy(s->c, "foo");
1764  return strlen(s->c+1) == 2;
1765}
1766]])],[
1767  ac_cv_have_broken_gcc_strlen_opt=yes
1768],[
1769  ac_cv_have_broken_gcc_strlen_opt=no
1770],[
1771  ac_cv_have_broken_gcc_strlen_opt=no
1772])])
1773  if test "$ac_cv_have_broken_gcc_strlen_opt" = "yes"; then
1774    CFLAGS="$CFLAGS -fno-optimize-strlen"
1775  fi
1776])
1777
1778dnl
1779dnl PHP_FOPENCOOKIE
1780dnl
1781AC_DEFUN([PHP_FOPENCOOKIE], [
1782  AC_CHECK_FUNC(fopencookie, [have_glibc_fopencookie=yes])
1783
1784  if test "$have_glibc_fopencookie" = "yes"; then
1785dnl this comes in two flavors:
1786dnl newer glibcs (since 2.1.2 ? )
1787dnl have a type called cookie_io_functions_t
1788AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1789#define _GNU_SOURCE
1790#include <stdio.h>
1791]], [[cookie_io_functions_t cookie;]])],[have_cookie_io_functions_t=yes],[])
1792
1793    if test "$have_cookie_io_functions_t" = "yes"; then
1794      cookie_io_functions_t=cookie_io_functions_t
1795      have_fopen_cookie=yes
1796
1797dnl even newer glibcs have a different seeker definition...
1798AC_RUN_IFELSE([AC_LANG_SOURCE([[
1799#define _GNU_SOURCE
1800#include <stdio.h>
1801
1802struct cookiedata {
1803  __off64_t pos;
1804};
1805
1806__ssize_t reader(void *cookie, char *buffer, size_t size)
1807{ return size; }
1808__ssize_t writer(void *cookie, const char *buffer, size_t size)
1809{ return size; }
1810int closer(void *cookie)
1811{ return 0; }
1812int seeker(void *cookie, __off64_t *position, int whence)
1813{ ((struct cookiedata*)cookie)->pos = *position; return 0; }
1814
1815cookie_io_functions_t funcs = {reader, writer, seeker, closer};
1816
1817int main() {
1818  struct cookiedata g = { 0 };
1819  FILE *fp = fopencookie(&g, "r", funcs);
1820
1821  if (fp && fseek(fp, 8192, SEEK_SET) == 0 && g.pos == 8192)
1822    return 0;
1823  return 1;
1824}
1825
1826]])], [
1827  cookie_io_functions_use_off64_t=yes
1828], [
1829  cookie_io_functions_use_off64_t=no
1830], [
1831  cookie_io_functions_use_off64_t=no
1832])
1833
1834    else
1835
1836dnl older glibc versions (up to 2.1.2 ?)
1837dnl call it _IO_cookie_io_functions_t
1838AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1839#define _GNU_SOURCE
1840#include <stdio.h>
1841]], [[_IO_cookie_io_functions_t cookie;]])], [have_IO_cookie_io_functions_t=yes], [])
1842      if test "$have_cookie_io_functions_t" = "yes" ; then
1843        cookie_io_functions_t=_IO_cookie_io_functions_t
1844        have_fopen_cookie=yes
1845      fi
1846    fi
1847
1848    if test "$have_fopen_cookie" = "yes" ; then
1849      AC_DEFINE(HAVE_FOPENCOOKIE, 1, [ ])
1850      AC_DEFINE_UNQUOTED(COOKIE_IO_FUNCTIONS_T, $cookie_io_functions_t, [ ])
1851      if test "$cookie_io_functions_use_off64_t" = "yes" ; then
1852        AC_DEFINE(COOKIE_SEEKER_USES_OFF64_T, 1, [ ])
1853      fi
1854    fi
1855  fi
1856])
1857
1858dnl -------------------------------------------------------------------------
1859dnl Library/function existence and build sanity checks
1860dnl -------------------------------------------------------------------------
1861
1862dnl
1863dnl PHP_CHECK_LIBRARY(library, function [, action-found [, action-not-found [, extra-libs]]])
1864dnl
1865dnl Wrapper for AC_CHECK_LIB
1866dnl
1867AC_DEFUN([PHP_CHECK_LIBRARY], [
1868  save_old_LDFLAGS=$LDFLAGS
1869  ac_stuff="$5"
1870
1871  save_ext_shared=$ext_shared
1872  ext_shared=yes
1873  PHP_EVAL_LIBLINE([$]ac_stuff, LDFLAGS)
1874  AC_CHECK_LIB([$1],[$2],[
1875    LDFLAGS=$save_old_LDFLAGS
1876    ext_shared=$save_ext_shared
1877    $3
1878  ],[
1879    LDFLAGS=$save_old_LDFLAGS
1880    ext_shared=$save_ext_shared
1881    unset ac_cv_lib_$1[]_$2
1882    $4
1883  ])dnl
1884])
1885
1886dnl
1887dnl PHP_CHECK_FRAMEWORK(framework, function [, action-found [, action-not-found ]])
1888dnl
1889dnl El cheapo wrapper for AC_CHECK_LIB
1890dnl
1891AC_DEFUN([PHP_CHECK_FRAMEWORK], [
1892  save_old_LDFLAGS=$LDFLAGS
1893  LDFLAGS="-framework $1 $LDFLAGS"
1894  dnl supplying "c" to AC_CHECK_LIB is technically cheating, but
1895  dnl rewriting AC_CHECK_LIB is overkill and this only affects
1896  dnl the "checking.." output anyway.
1897  AC_CHECK_LIB(c,[$2],[
1898    LDFLAGS=$save_old_LDFLAGS
1899    $3
1900  ],[
1901    LDFLAGS=$save_old_LDFLAGS
1902    $4
1903  ])
1904])
1905
1906dnl
1907dnl PHP_CHECK_FUNC_LIB(func, libs)
1908dnl
1909dnl This macro checks whether 'func' or '__func' exists
1910dnl in the specified library.
1911dnl Defines HAVE_func and HAVE_library if found and adds the library to LIBS.
1912dnl This should be called in the ACTION-IF-NOT-FOUND part of PHP_CHECK_FUNC
1913dnl
1914dnl
1915dnl autoconf undefines the builtin "shift" :-(
1916dnl If possible, we use the builtin shift anyway, otherwise we use
1917dnl the ubercool definition I have tested so far with FreeBSD/GNU m4
1918ifdef([builtin],[builtin(define, phpshift, [builtin(shift, $@)])],[
1919define([phpshift],[ifelse(index([$@],[,]),-1,,[substr([$@],incr(index([$@],[,])))])])
1920])
1921dnl
1922AC_DEFUN([PHP_CHECK_FUNC_LIB],[
1923  ifelse($2,,:,[
1924  unset ac_cv_lib_$2[]_$1
1925  unset ac_cv_lib_$2[]___$1
1926  unset found
1927  AC_CHECK_LIB($2, $1, [found=yes], [
1928    AC_CHECK_LIB($2, __$1, [found=yes], [found=no])
1929  ])
1930
1931  if test "$found" = "yes"; then
1932    ac_libs=$LIBS
1933    LIBS="$LIBS -l$2"
1934    AC_RUN_IFELSE([AC_LANG_SOURCE([[main() { return (0); }]])],[found=yes],[found=no],[found=no])
1935    LIBS=$ac_libs
1936  fi
1937
1938  if test "$found" = "yes"; then
1939    PHP_ADD_LIBRARY($2)
1940    PHP_DEF_HAVE($1)
1941    PHP_DEF_HAVE(lib$2)
1942    ac_cv_func_$1=yes
1943  else
1944    PHP_CHECK_FUNC_LIB($1,phpshift(phpshift($@)))
1945  fi
1946  ])
1947])
1948
1949dnl
1950dnl PHP_CHECK_FUNC(func, ...)
1951dnl
1952dnl This macro checks whether 'func' or '__func' exists
1953dnl in the default libraries and as a fall back in the specified library.
1954dnl Defines HAVE_func and HAVE_library if found and adds the library to LIBS.
1955dnl
1956AC_DEFUN([PHP_CHECK_FUNC],[
1957  unset ac_cv_func_$1
1958  unset ac_cv_func___$1
1959  unset found
1960
1961  AC_CHECK_FUNC($1, [found=yes],[ AC_CHECK_FUNC(__$1,[found=yes],[found=no]) ])
1962
1963  case $found in
1964  yes[)]
1965    PHP_DEF_HAVE($1)
1966    ac_cv_func_$1=yes
1967  ;;
1968  ifelse($#,1,,[
1969    *[)] PHP_CHECK_FUNC_LIB($@) ;;
1970  ])
1971  esac
1972])
1973
1974dnl
1975dnl PHP_TEST_BUILD(function, action-if-ok, action-if-not-ok [, extra-libs [, extra-source]])
1976dnl
1977dnl This macro checks whether build works and given function exists.
1978dnl
1979AC_DEFUN([PHP_TEST_BUILD], [
1980  old_LIBS=$LIBS
1981  LIBS="$4 $LIBS"
1982  AC_RUN_IFELSE([AC_LANG_SOURCE([[
1983    $5
1984    char $1();
1985    int main() {
1986      $1();
1987      return 0;
1988    }
1989  ]])],[
1990    LIBS=$old_LIBS
1991    $2
1992  ],[
1993    LIBS=$old_LIBS
1994    $3
1995  ],[
1996    LIBS=$old_LIBS
1997  ])
1998])
1999
2000dnl -------------------------------------------------------------------------
2001dnl Platform characteristics checks
2002dnl -------------------------------------------------------------------------
2003
2004dnl
2005dnl PHP_SHLIB_SUFFIX_NAMES
2006dnl
2007dnl Determines link library suffix SHLIB_SUFFIX_NAME
2008dnl which can be: .so, .sl or .dylib
2009dnl
2010dnl Determines shared library suffix SHLIB_DL_SUFFIX_NAME
2011dnl suffix can be: .so or .sl
2012dnl
2013AC_DEFUN([PHP_SHLIB_SUFFIX_NAMES],[
2014 AC_REQUIRE([PHP_CANONICAL_HOST_TARGET])dnl
2015 PHP_SUBST_OLD(SHLIB_SUFFIX_NAME)
2016 PHP_SUBST_OLD(SHLIB_DL_SUFFIX_NAME)
2017 SHLIB_SUFFIX_NAME=so
2018 SHLIB_DL_SUFFIX_NAME=$SHLIB_SUFFIX_NAME
2019 case $host_alias in
2020 *hpux*[)]
2021   SHLIB_SUFFIX_NAME=sl
2022   SHLIB_DL_SUFFIX_NAME=sl
2023   ;;
2024 *darwin*[)]
2025   SHLIB_SUFFIX_NAME=dylib
2026   SHLIB_DL_SUFFIX_NAME=so
2027   ;;
2028 esac
2029])
2030
2031dnl
2032dnl PHP_CHECK_64BIT([do if 32], [do if 64])
2033dnl
2034dnl This macro is used to detect if we're at 64-bit platform or not.
2035dnl It could be useful for those external libs, that have different precompiled
2036dnl versions in different directories.
2037dnl
2038AC_DEFUN([PHP_CHECK_64BIT],[
2039  AC_CHECK_SIZEOF(long int, 4)
2040  AC_MSG_CHECKING([checking if we're at 64-bit platform])
2041  if test "$ac_cv_sizeof_long_int" = "4" ; then
2042    AC_MSG_RESULT([no])
2043    $1
2044  else
2045    AC_MSG_RESULT([yes])
2046    $2
2047  fi
2048])
2049
2050dnl
2051dnl PHP_C_BIGENDIAN
2052dnl
2053dnl Replacement macro for AC_C_BIGENDIAN
2054dnl
2055AC_DEFUN([PHP_C_BIGENDIAN],
2056[AC_CACHE_CHECK([whether byte ordering is bigendian], ac_cv_c_bigendian_php,
2057 [
2058  ac_cv_c_bigendian_php=unknown
2059  AC_RUN_IFELSE([AC_LANG_SOURCE([[
2060int main(void)
2061{
2062  short one = 1;
2063  char *cp = (char *)&one;
2064
2065  if (*cp == 0) {
2066    return(0);
2067  } else {
2068    return(1);
2069  }
2070}
2071  ]])], [ac_cv_c_bigendian_php=yes], [ac_cv_c_bigendian_php=no], [ac_cv_c_bigendian_php=unknown])
2072 ])
2073 if test $ac_cv_c_bigendian_php = yes; then
2074   AC_DEFINE(WORDS_BIGENDIAN, [], [Define if processor uses big-endian word])
2075 fi
2076])
2077
2078dnl -------------------------------------------------------------------------
2079dnl Checks for programs: PHP_PROG_<program>
2080dnl -------------------------------------------------------------------------
2081
2082dnl
2083dnl PHP_PROG_SENDMAIL
2084dnl
2085dnl Search for the sendmail binary
2086dnl
2087AC_DEFUN([PHP_PROG_SENDMAIL], [
2088  PHP_ALT_PATH=/usr/bin:/usr/sbin:/usr/etc:/etc:/usr/ucblib:/usr/lib
2089  AC_PATH_PROG(PROG_SENDMAIL, sendmail, /usr/sbin/sendmail, $PATH:$PHP_ALT_PATH)
2090  PHP_SUBST(PROG_SENDMAIL)
2091])
2092
2093dnl
2094dnl PHP_PROG_AWK
2095dnl
2096dnl Some vendors force mawk before gawk; mawk is broken so we don't like that
2097dnl
2098AC_DEFUN([PHP_PROG_AWK], [
2099  AC_CHECK_PROGS(AWK, gawk nawk awk mawk, bork, /usr/xpg4/bin/:$PATH)
2100  case "$AWK" in
2101    *mawk)
2102      AC_MSG_WARN([mawk is known to have problems on some systems. You should install GNU awk])
2103      ;;
2104    *gawk)
2105      ;;
2106    bork)
2107      AC_MSG_ERROR([Could not find awk; Install GNU awk])
2108      ;;
2109    *)
2110      AC_MSG_CHECKING([if $AWK is broken])
2111      if ! $AWK 'function foo() {}' >/dev/null 2>&1 ; then
2112        AC_MSG_RESULT([yes])
2113        AC_MSG_ERROR([You should install GNU awk])
2114      else
2115        AC_MSG_RESULT([no])
2116      fi
2117      ;;
2118  esac
2119  PHP_SUBST(AWK)
2120])
2121
2122dnl
2123dnl PHP_PROG_BISON
2124dnl
2125dnl Search for bison and check it's version
2126dnl
2127AC_DEFUN([PHP_PROG_BISON], [
2128  AC_PROG_YACC
2129  LIBZEND_BISON_CHECK
2130  PHP_SUBST(YACC)
2131])
2132
2133dnl
2134dnl PHP_PROG_RE2C
2135dnl
2136dnl Search for the re2c binary and check the version
2137dnl
2138AC_DEFUN([PHP_PROG_RE2C],[
2139  AC_CHECK_PROG(RE2C, re2c, re2c)
2140  if test -n "$RE2C"; then
2141    AC_CACHE_CHECK([for re2c version], php_cv_re2c_version, [
2142      re2c_vernum=`$RE2C --vernum 2>/dev/null`
2143      if test -z "$re2c_vernum" || test "$re2c_vernum" -lt "1304"; then
2144        php_cv_re2c_version=invalid
2145      else
2146        php_cv_re2c_version="`$RE2C --version | cut -d ' ' -f 2  2>/dev/null` (ok)"
2147      fi
2148    ])
2149  fi
2150  case $php_cv_re2c_version in
2151    ""|invalid[)]
2152      AC_MSG_WARN([You will need re2c 0.13.4 or later if you want to regenerate PHP parsers.])
2153      RE2C="exit 0;"
2154      ;;
2155  esac
2156  PHP_SUBST(RE2C)
2157])
2158
2159dnl -------------------------------------------------------------------------
2160dnl Common setup macros: PHP_SETUP_<what>
2161dnl -------------------------------------------------------------------------
2162
2163dnl
2164dnl PHP_SETUP_ICU([shared-add])
2165dnl
2166dnl Common setup macro for ICU
2167dnl
2168AC_DEFUN([PHP_SETUP_ICU],[
2169  PHP_ARG_WITH(icu-dir,,
2170  [  --with-icu-dir=DIR      Specify where ICU libraries and headers can be found], DEFAULT, no)
2171
2172  if test "$PHP_ICU_DIR" = "no"; then
2173    PHP_ICU_DIR=DEFAULT
2174  fi
2175
2176  AC_MSG_CHECKING([for location of ICU headers and libraries])
2177  found_icu=no
2178
2179  dnl First try to find pkg-config
2180  if test -z "$PKG_CONFIG"; then
2181    AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
2182  fi
2183
2184  dnl If pkg-config is found try using it
2185  if test "$PHP_ICU_DIR" = "DEFAULT" && test -x "$PKG_CONFIG" && $PKG_CONFIG --exists icu-uc icu-io icu-i18n; then
2186    if $PKG_CONFIG --atleast-version=4.0 icu-uc; then
2187      found_icu=yes
2188      icu_version_full=`$PKG_CONFIG --modversion icu-uc`
2189      ac_IFS=$IFS
2190      IFS="."
2191      set $icu_version_full
2192      IFS=$ac_IFS
2193      icu_version=`expr [$]1 \* 1000 + [$]2`
2194      AC_MSG_RESULT([found $icu_version_full])
2195
2196      ICU_LIBS=`$PKG_CONFIG --libs icu-uc icu-io icu-i18n`
2197      ICU_INCS=`$PKG_CONFIG --cflags-only-I icu-uc icu-io icu-i18n`
2198      ICU_CXXFLAGS=`$PKG_CONFIG --variable=CXXFLAGS icu-uc`
2199      ICU_CXXFLAGS="$ICU_CXXFLAGS -DU_USING_ICU_NAMESPACE=1"
2200
2201      AC_MSG_RESULT([found $ICU_VERSION])
2202
2203      PHP_EVAL_LIBLINE($ICU_LIBS, $1)
2204      PHP_EVAL_INCLINE($ICU_INCS)
2205    else
2206      AC_MSG_ERROR([ICU version 4.0 or later required.])
2207    fi
2208  fi
2209
2210  dnl If pkg-config fails for some reason, revert to the old method
2211  if test "$found_icu" = "no"; then
2212    if test "$PHP_ICU_DIR" = "DEFAULT"; then
2213      dnl Try to find icu-config
2214      AC_PATH_PROG(ICU_CONFIG, icu-config, no, [$PATH:/usr/local/bin])
2215    else
2216      ICU_CONFIG="$PHP_ICU_DIR/bin/icu-config"
2217    fi
2218
2219    dnl Trust icu-config to know better what the install prefix is..
2220    icu_install_prefix=`$ICU_CONFIG --prefix 2> /dev/null`
2221    if test "$?" != "0" || test -z "$icu_install_prefix"; then
2222      AC_MSG_RESULT([not found])
2223      AC_MSG_ERROR([Unable to detect ICU prefix or $ICU_CONFIG failed. Please verify ICU install prefix and make sure icu-config works.])
2224    else
2225      AC_MSG_RESULT([$icu_install_prefix])
2226
2227      dnl Check ICU version
2228      AC_MSG_CHECKING([for ICU 4.0 or greater])
2229      icu_version_full=`$ICU_CONFIG --version`
2230      ac_IFS=$IFS
2231      IFS="."
2232      set $icu_version_full
2233      IFS=$ac_IFS
2234      icu_version=`expr [$]1 \* 1000 + [$]2`
2235      AC_MSG_RESULT([found $icu_version_full])
2236
2237      if test "$icu_version" -lt "4000"; then
2238        AC_MSG_ERROR([ICU version 4.0 or later is required])
2239      fi
2240
2241      ICU_VERSION=$icu_version
2242      ICU_INCS=`$ICU_CONFIG --cppflags-searchpath`
2243      ICU_LIBS=`$ICU_CONFIG --ldflags --ldflags-icuio`
2244      PHP_EVAL_INCLINE($ICU_INCS)
2245      PHP_EVAL_LIBLINE($ICU_LIBS, $1)
2246
2247      ICU_CXXFLAGS=`$ICU_CONFIG --cxxflags`
2248      if test "$icu_version" -ge "49000"; then
2249        ICU_CXXFLAGS="$ICU_CXXFLAGS -DUNISTR_FROM_CHAR_EXPLICIT=explicit -DUNISTR_FROM_STRING_EXPLICIT=explicit"
2250        ICU_CFLAGS="-DU_NO_DEFAULT_INCLUDE_UTF_HEADERS=1"
2251      fi
2252      if test "$icu_version" -ge "60000"; then
2253        ICU_CFLAGS="$ICU_CFLAGS -DU_HIDE_OBSOLETE_UTF_OLD_H=1"
2254      fi
2255    fi
2256  fi
2257
2258  ICU_CFLAGS="$ICU_CFLAGS -DU_DEFINE_FALSE_AND_TRUE=1"
2259])
2260
2261dnl
2262dnl PHP_SETUP_KERBEROS(shared-add [, action-found [, action-not-found]])
2263dnl
2264dnl Common setup macro for kerberos
2265dnl
2266AC_DEFUN([PHP_SETUP_KERBEROS],[
2267  found_kerberos=no
2268  unset KERBEROS_CFLAGS
2269  unset KERBEROS_LIBS
2270
2271  dnl First try to find krb5-config
2272  if test -z "$KRB5_CONFIG"; then
2273    AC_PATH_PROG(KRB5_CONFIG, krb5-config, no, [$PATH:/usr/kerberos/bin:/usr/local/bin])
2274  fi
2275
2276  dnl If krb5-config is found try using it
2277  if test "$PHP_KERBEROS" != "no" && test -x "$KRB5_CONFIG"; then
2278    KERBEROS_LIBS=`$KRB5_CONFIG --libs gssapi`
2279    KERBEROS_CFLAGS=`$KRB5_CONFIG --cflags gssapi`
2280
2281    if test -n "$KERBEROS_LIBS"; then
2282      found_kerberos=yes
2283      PHP_EVAL_LIBLINE($KERBEROS_LIBS, $1)
2284      PHP_EVAL_INCLINE($KERBEROS_CFLAGS)
2285    fi
2286  fi
2287
2288  dnl If still not found use old skool method
2289  if test "$found_kerberos" = "no"; then
2290
2291    if test "$PHP_KERBEROS" = "yes"; then
2292      PHP_KERBEROS="/usr/kerberos /usr/local /usr"
2293    fi
2294
2295    for i in $PHP_KERBEROS; do
2296      if test -f $i/$PHP_LIBDIR/libkrb5.a || test -f $i/$PHP_LIBDIR/libkrb5.$SHLIB_SUFFIX_NAME; then
2297        PHP_KERBEROS_DIR=$i
2298        break
2299      fi
2300    done
2301
2302    if test "$PHP_KERBEROS_DIR"; then
2303      found_kerberos=yes
2304      PHP_ADD_LIBPATH($PHP_KERBEROS_DIR/$PHP_LIBDIR, $1)
2305      PHP_ADD_LIBRARY(gssapi_krb5, 1, $1)
2306      PHP_ADD_LIBRARY(krb5, 1, $1)
2307      PHP_ADD_LIBRARY(k5crypto, 1, $1)
2308      PHP_ADD_LIBRARY(com_err,  1, $1)
2309      PHP_ADD_INCLUDE($PHP_KERBEROS_DIR/include)
2310    fi
2311  fi
2312
2313  if test "$found_kerberos" = "yes"; then
2314ifelse([$2],[],:,[$2])
2315ifelse([$3],[],,[else $3])
2316  fi
2317])
2318
2319dnl
2320dnl PHP_SETUP_OPENSSL(shared-add [, action-found [, action-not-found]])
2321dnl
2322dnl Common setup macro for openssl
2323dnl
2324AC_DEFUN([PHP_SETUP_OPENSSL],[
2325  found_openssl=no
2326  unset OPENSSL_INCDIR
2327  unset OPENSSL_LIBDIR
2328
2329  dnl Empty variable means 'no'
2330  test -z "$PHP_OPENSSL" && PHP_OPENSSL=no
2331  test -z "$PHP_IMAP_SSL" && PHP_IMAP_SSL=no
2332
2333  dnl Fallbacks for different configure options
2334  if test "$PHP_OPENSSL" != "no"; then
2335    PHP_OPENSSL_DIR=$PHP_OPENSSL
2336  elif test "$PHP_IMAP_SSL" != "no"; then
2337    PHP_OPENSSL_DIR=$PHP_IMAP_SSL
2338  fi
2339
2340  dnl First try to find pkg-config
2341  if test -z "$PKG_CONFIG"; then
2342    AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
2343  fi
2344
2345  dnl If pkg-config is found try using it
2346  if test "$PHP_OPENSSL_DIR" = "yes" && test -x "$PKG_CONFIG" && $PKG_CONFIG --exists openssl; then
2347    if $PKG_CONFIG --atleast-version=1.0.1 openssl; then
2348      found_openssl=yes
2349      OPENSSL_LIBS=`$PKG_CONFIG --libs openssl`
2350      OPENSSL_INCS=`$PKG_CONFIG --cflags-only-I openssl`
2351      OPENSSL_INCDIR=`$PKG_CONFIG --variable=includedir openssl`
2352    else
2353      AC_MSG_ERROR([OpenSSL version 1.0.1 or greater required.])
2354    fi
2355
2356    if test -n "$OPENSSL_LIBS"; then
2357      PHP_EVAL_LIBLINE($OPENSSL_LIBS, $1)
2358    fi
2359    if test -n "$OPENSSL_INCS"; then
2360      PHP_EVAL_INCLINE($OPENSSL_INCS)
2361    fi
2362  fi
2363
2364  dnl If pkg-config fails for some reason, revert to the old method
2365  if test "$found_openssl" = "no"; then
2366
2367    if test "$PHP_OPENSSL_DIR" = "yes"; then
2368      PHP_OPENSSL_DIR="/usr/local/ssl /usr/local /usr /usr/local/openssl"
2369    fi
2370
2371    for i in $PHP_OPENSSL_DIR; do
2372      if test -r $i/include/openssl/evp.h; then
2373        OPENSSL_INCDIR=$i/include
2374      fi
2375      if test -r $i/$PHP_LIBDIR/libssl.a -o -r $i/$PHP_LIBDIR/libssl.$SHLIB_SUFFIX_NAME; then
2376        OPENSSL_LIBDIR=$i/$PHP_LIBDIR
2377      fi
2378      test -n "$OPENSSL_INCDIR" && test -n "$OPENSSL_LIBDIR" && break
2379    done
2380
2381    if test -z "$OPENSSL_INCDIR"; then
2382      AC_MSG_ERROR([Cannot find OpenSSL's <evp.h>])
2383    fi
2384
2385    if test -z "$OPENSSL_LIBDIR"; then
2386      AC_MSG_ERROR([Cannot find OpenSSL's libraries])
2387    fi
2388
2389    old_CPPFLAGS=$CPPFLAGS
2390    CPPFLAGS=-I$OPENSSL_INCDIR
2391    AC_MSG_CHECKING([for OpenSSL version])
2392    AC_EGREP_CPP(yes,[
2393#include <openssl/opensslv.h>
2394#if OPENSSL_VERSION_NUMBER >= 0x10001001L
2395  yes
2396#endif
2397    ],[
2398      AC_MSG_RESULT([>= 1.0.1])
2399    ],[
2400      AC_MSG_ERROR([OpenSSL version 1.0.1 or greater required.])
2401    ])
2402    CPPFLAGS=$old_CPPFLAGS
2403
2404    PHP_ADD_INCLUDE($OPENSSL_INCDIR)
2405
2406    PHP_CHECK_LIBRARY(crypto, CRYPTO_free, [
2407      PHP_ADD_LIBRARY(crypto,,$1)
2408    ],[
2409      AC_MSG_ERROR([libcrypto not found!])
2410    ],[
2411      -L$OPENSSL_LIBDIR
2412    ])
2413
2414    old_LIBS=$LIBS
2415    LIBS="$LIBS -lcrypto"
2416    PHP_CHECK_LIBRARY(ssl, SSL_CTX_set_ssl_version, [
2417      found_openssl=yes
2418    ],[
2419      AC_MSG_ERROR([libssl not found!])
2420    ],[
2421      -L$OPENSSL_LIBDIR
2422    ])
2423    LIBS=$old_LIBS
2424    PHP_ADD_LIBRARY(ssl,,$1)
2425    PHP_ADD_LIBRARY(crypto,,$1)
2426
2427    PHP_ADD_LIBPATH($OPENSSL_LIBDIR, $1)
2428  fi
2429
2430  if test "$found_openssl" = "yes"; then
2431  dnl For apache 1.3.x static build
2432  OPENSSL_INCDIR_OPT=-I$OPENSSL_INCDIR
2433  AC_SUBST(OPENSSL_INCDIR_OPT)
2434
2435ifelse([$2],[],:,[$2])
2436ifelse([$3],[],,[else $3])
2437  fi
2438])
2439
2440dnl
2441dnl PHP_SETUP_ICONV(shared-add [, action-found [, action-not-found]])
2442dnl
2443dnl Common setup macro for iconv
2444dnl
2445AC_DEFUN([PHP_SETUP_ICONV], [
2446  found_iconv=no
2447  unset ICONV_DIR
2448
2449  # Create the directories for a VPATH build:
2450  $php_shtool mkdir -p ext/iconv
2451
2452  echo > ext/iconv/php_have_bsd_iconv.h
2453  echo > ext/iconv/php_have_ibm_iconv.h
2454  echo > ext/iconv/php_have_glibc_iconv.h
2455  echo > ext/iconv/php_have_libiconv.h
2456  echo > ext/iconv/php_have_iconv.h
2457  echo > ext/iconv/php_php_iconv_impl.h
2458  echo > ext/iconv/php_iconv_aliased_libiconv.h
2459  echo > ext/iconv/php_php_iconv_h_path.h
2460  echo > ext/iconv/php_iconv_supports_errno.h
2461
2462  dnl
2463  dnl Check libc first if no path is provided in --with-iconv
2464  dnl
2465
2466  if test "$PHP_ICONV" = "yes"; then
2467    dnl Reset LIBS temporarily as it may have already been included
2468    dnl -liconv in.
2469    LIBS_save="$LIBS"
2470    LIBS=
2471    AC_CHECK_FUNC(iconv, [
2472      found_iconv=yes
2473    ],[
2474      AC_CHECK_FUNC(libiconv,[
2475        PHP_DEFINE(HAVE_LIBICONV,1,[ext/iconv])
2476        AC_DEFINE(HAVE_LIBICONV, 1, [ ])
2477        found_iconv=yes
2478      ])
2479    ])
2480    LIBS="$LIBS_save"
2481  fi
2482
2483  dnl
2484  dnl Check external libs for iconv funcs
2485  dnl
2486  if test "$found_iconv" = "no"; then
2487
2488    for i in $PHP_ICONV /usr/local /usr; do
2489      if test -r $i/include/giconv.h; then
2490        AC_DEFINE(HAVE_GICONV_H, 1, [ ])
2491        ICONV_DIR=$i
2492        iconv_lib_name=giconv
2493        break
2494      elif test -r $i/include/iconv.h; then
2495        ICONV_DIR=$i
2496        iconv_lib_name=iconv
2497        break
2498      fi
2499    done
2500
2501    if test -z "$ICONV_DIR"; then
2502      AC_MSG_ERROR([Please specify the install prefix of iconv with --with-iconv=<DIR>])
2503    fi
2504
2505    if test -f $ICONV_DIR/$PHP_LIBDIR/lib$iconv_lib_name.a ||
2506       test -f $ICONV_DIR/$PHP_LIBDIR/lib$iconv_lib_name.$SHLIB_SUFFIX_NAME
2507    then
2508      PHP_CHECK_LIBRARY($iconv_lib_name, libiconv, [
2509        found_iconv=yes
2510        PHP_DEFINE(HAVE_LIBICONV,1,[ext/iconv])
2511        AC_DEFINE(HAVE_LIBICONV,1,[ ])
2512        PHP_DEFINE([ICONV_ALIASED_LIBICONV],1,[ext/iconv])
2513        AC_DEFINE([ICONV_ALIASED_LIBICONV],1,[iconv() is aliased to libiconv() in -liconv])
2514      ], [
2515        PHP_CHECK_LIBRARY($iconv_lib_name, iconv, [
2516          found_iconv=yes
2517        ], [], [
2518          -L$ICONV_DIR/$PHP_LIBDIR
2519        ])
2520      ], [
2521        -L$ICONV_DIR/$PHP_LIBDIR
2522      ])
2523    fi
2524  fi
2525
2526  if test "$found_iconv" = "yes"; then
2527    PHP_DEFINE(HAVE_ICONV,1,[ext/iconv])
2528    AC_DEFINE(HAVE_ICONV,1,[ ])
2529    if test -n "$ICONV_DIR"; then
2530      PHP_ADD_LIBRARY_WITH_PATH($iconv_lib_name, $ICONV_DIR/$PHP_LIBDIR, $1)
2531      PHP_ADD_INCLUDE($ICONV_DIR/include)
2532    fi
2533    $2
2534ifelse([$3],[],,[else $3])
2535  fi
2536])
2537
2538dnl
2539dnl PHP_SETUP_LIBXML(shared-add [, action-found [, action-not-found]])
2540dnl
2541dnl Common setup macro for libxml
2542dnl
2543AC_DEFUN([PHP_SETUP_LIBXML], [
2544  found_libxml=no
2545
2546  dnl First try to find xml2-config
2547  AC_CACHE_CHECK([for xml2-config path], ac_cv_php_xml2_config_path,
2548  [
2549    for i in $PHP_LIBXML_DIR /usr/local /usr; do
2550      if test -x "$i/bin/xml2-config"; then
2551        ac_cv_php_xml2_config_path="$i/bin/xml2-config"
2552        break
2553      fi
2554    done
2555  ])
2556
2557  if test -x "$ac_cv_php_xml2_config_path"; then
2558    XML2_CONFIG="$ac_cv_php_xml2_config_path"
2559    libxml_full_version=`$XML2_CONFIG --version`
2560    ac_IFS=$IFS
2561    IFS="."
2562    set $libxml_full_version
2563    IFS=$ac_IFS
2564    LIBXML_VERSION=`expr [$]1 \* 1000000 + [$]2 \* 1000 + [$]3`
2565    if test "$LIBXML_VERSION" -ge "2006011"; then
2566      found_libxml=yes
2567      LIBXML_LIBS=`$XML2_CONFIG --libs`
2568      LIBXML_INCS=`$XML2_CONFIG --cflags`
2569    else
2570      AC_MSG_ERROR([libxml2 version 2.6.11 or greater required.])
2571    fi
2572  fi
2573
2574  dnl If xml2-config fails, try pkg-config
2575  if test "$found_libxml" = "no"; then
2576    if test -z "$PKG_CONFIG"; then
2577      AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
2578    fi
2579
2580    dnl If pkg-config is found try using it
2581    if test -x "$PKG_CONFIG" && $PKG_CONFIG --exists libxml-2.0; then
2582      if $PKG_CONFIG --atleast-version=2.6.11 libxml-2.0; then
2583        found_libxml=yes
2584        LIBXML_LIBS=`$PKG_CONFIG --libs libxml-2.0`
2585        LIBXML_INCS=`$PKG_CONFIG --cflags-only-I libxml-2.0`
2586      else
2587        AC_MSG_ERROR([libxml2 version 2.6.11 or greater required.])
2588      fi
2589    fi
2590  fi
2591
2592  if test "$found_libxml" = "yes"; then
2593    PHP_EVAL_LIBLINE($LIBXML_LIBS, $1)
2594    PHP_EVAL_INCLINE($LIBXML_INCS)
2595
2596    dnl Check that build works with given libs
2597    AC_CACHE_CHECK(whether libxml build works, php_cv_libxml_build_works, [
2598      PHP_TEST_BUILD(xmlInitParser,
2599      [
2600        php_cv_libxml_build_works=yes
2601      ], [
2602        AC_MSG_RESULT(no)
2603        AC_MSG_ERROR([build test failed.  Please check the config.log for details.])
2604      ], [
2605        [$]$1
2606      ])
2607    ])
2608    if test "$php_cv_libxml_build_works" = "yes"; then
2609      AC_DEFINE(HAVE_LIBXML, 1, [ ])
2610    fi
2611    $2
2612ifelse([$3],[],,[else $3])
2613  fi
2614])
2615
2616dnl -------------------------------------------------------------------------
2617dnl Misc. macros
2618dnl -------------------------------------------------------------------------
2619
2620dnl
2621dnl PHP_INSTALL_HEADERS(path [, file ...])
2622dnl
2623dnl PHP header files to be installed
2624dnl
2625AC_DEFUN([PHP_INSTALL_HEADERS],[
2626  ifelse([$2],[],[
2627    for header_file in $1; do
2628      PHP_RUN_ONCE(INSTALLHEADERS, $header_file, [
2629        INSTALL_HEADERS="$INSTALL_HEADERS $header_file"
2630      ])
2631    done
2632  ], [
2633    header_path=$1
2634    for header_file in $2; do
2635      hp_hf="$header_path/$header_file"
2636      PHP_RUN_ONCE(INSTALLHEADERS, $hp_hf, [
2637        INSTALL_HEADERS="$INSTALL_HEADERS $hp_hf"
2638      ])
2639    done
2640  ])
2641])
2642
2643dnl
2644dnl PHP_AP_EXTRACT_VERSION(/path/httpd)
2645dnl
2646dnl This macro is used to get a comparable
2647dnl version for apache1/2.
2648dnl
2649AC_DEFUN([PHP_AP_EXTRACT_VERSION],[
2650  ac_output=`$1 -v 2>&1 | grep version | $SED -e 's/Oracle-HTTP-//'`
2651  ac_IFS=$IFS
2652IFS="- /.
2653"
2654  set $ac_output
2655  IFS=$ac_IFS
2656
2657  APACHE_VERSION=`expr [$]4 \* 1000000 + [$]5 \* 1000 + [$]6`
2658])
2659
2660dnl
2661dnl PHP_DEBUG_MACRO(filename)
2662dnl
2663AC_DEFUN([PHP_DEBUG_MACRO],[
2664  DEBUG_LOG=$1
2665  cat >$1 <<X
2666CONFIGURE:  $CONFIGURE_COMMAND
2667CC:         $CC
2668CFLAGS:     $CFLAGS
2669CPPFLAGS:   $CPPFLAGS
2670CXX:        $CXX
2671CXXFLAGS:   $CXXFLAGS
2672INCLUDES:   $INCLUDES
2673LDFLAGS:    $LDFLAGS
2674LIBS:       $LIBS
2675DLIBS:      $DLIBS
2676SAPI:       $PHP_SAPI
2677PHP_RPATHS: $PHP_RPATHS
2678uname -a:   `uname -a`
2679
2680X
2681    cat >conftest.$ac_ext <<X
2682main()
2683{
2684  exit(0);
2685}
2686X
2687    (eval echo \"$ac_link\"; eval $ac_link && ./conftest) >>$1 2>&1
2688    rm -fr conftest*
2689])
2690
2691dnl
2692dnl PHP_CONFIG_NICE(filename)
2693dnl
2694dnl Generates the config.nice file
2695dnl
2696AC_DEFUN([PHP_CONFIG_NICE],[
2697  AC_REQUIRE([AC_PROG_EGREP])
2698  AC_REQUIRE([LT_AC_PROG_SED])
2699  PHP_SUBST_OLD(EGREP)
2700  PHP_SUBST_OLD(SED)
2701  test -f $1 && mv $1 $1.old
2702  rm -f $1.old
2703  cat >$1<<EOF
2704#! /bin/sh
2705#
2706# Created by configure
2707
2708EOF
2709
2710  clean_configure_args=$ac_configure_args
2711  for var in CFLAGS CXXFLAGS CPPFLAGS LDFLAGS EXTRA_LDFLAGS_PROGRAM LIBS CC CXX; do
2712    eval val=\$$var
2713    if test -n "$val"; then
2714      echo "$var='$val' \\" >> $1
2715      if test `expr "X$ac_configure_args" : ".*${var}.*"` != 0; then
2716        clean_configure_args=$(echo $clean_configure_args | sed -e "s#'$var=$val'##")
2717      fi
2718    fi
2719  done
2720
2721  echo "'[$]0' \\" >> $1
2722  if test `expr " [$]0" : " '.*"` = 0; then
2723    CONFIGURE_COMMAND="$CONFIGURE_COMMAND '[$]0'"
2724  else
2725    CONFIGURE_COMMAND="$CONFIGURE_COMMAND [$]0"
2726  fi
2727  CONFIGURE_ARGS="$clean_configure_args"
2728  while test "X$CONFIGURE_ARGS" != "X";
2729  do
2730   if CURRENT_ARG=`expr "X$CONFIGURE_ARGS" : "X *\('[[^']]*'\)"`
2731   then
2732     CONFIGURE_ARGS=`expr "X$CONFIGURE_ARGS" : "X *'[[^']]*' \(.*\)"`
2733   elif CURRENT_ARG=`expr "X$CONFIGURE_ARGS" : "X *\([[^ ]]*\)"`
2734   then
2735     CONFIGURE_ARGS=`expr "X$CONFIGURE_ARGS" : "X *[[^ ]]* \(.*\)"`
2736     CURRENT_ARG="'$CURRENT_ARG'"
2737   else
2738    break
2739   fi
2740   $as_echo "$CURRENT_ARG \\" >>$1
2741   CONFIGURE_OPTIONS="$CONFIGURE_OPTIONS $CURRENT_ARG"
2742  done
2743  echo '"[$]@"' >> $1
2744  chmod +x $1
2745  CONFIGURE_COMMAND="$CONFIGURE_COMMAND $CONFIGURE_OPTIONS"
2746  PHP_SUBST_OLD(CONFIGURE_COMMAND)
2747  PHP_SUBST_OLD(CONFIGURE_OPTIONS)
2748])
2749
2750dnl
2751dnl PHP_CHECK_CONFIGURE_OPTIONS
2752dnl
2753AC_DEFUN([PHP_CHECK_CONFIGURE_OPTIONS],[
2754  for arg in $ac_configure_args; do
2755    case $arg in
2756      --with-*[)]
2757        arg_name="`echo [$]arg | $SED -e 's/--with-/with-/g' -e 's/=.*//g'`"
2758        ;;
2759      --without-*[)]
2760        arg_name="`echo [$]arg | $SED -e 's/--without-/with-/g' -e 's/=.*//g'`"
2761        ;;
2762      --enable-*[)]
2763        arg_name="`echo [$]arg | $SED -e 's/--enable-/enable-/g' -e 's/=.*//g'`"
2764        ;;
2765      --disable-*[)]
2766        arg_name="`echo [$]arg | $SED -e 's/--disable-/enable-/g' -e 's/=.*//g'`"
2767        ;;
2768      *[)]
2769        continue
2770        ;;
2771    esac
2772    case $arg_name in
2773      # Allow --disable-all / --enable-all
2774      enable-all[)];;
2775
2776      # Allow certain libtool options
2777      enable-libtool-lock | with-pic | with-tags | enable-shared | enable-static | enable-fast-install | with-gnu-ld[)];;
2778
2779      # Allow certain TSRM options
2780      with-tsrm-pth | with-tsrm-st | with-tsrm-pthreads [)];;
2781
2782      # Allow certain Zend options
2783      with-zend-vm | enable-maintainer-zts | enable-inline-optimization[)];;
2784
2785      # All the rest must be set using the PHP_ARG_* macros
2786      # PHP_ARG_* macros set php_enable_<arg_name> or php_with_<arg_name>
2787      *[)]
2788        # Options that exist before PHP 6
2789        if test "$PHP_MAJOR_VERSION" -lt "6"; then
2790          case $arg_name in
2791            enable-zend-multibyte[)] continue;;
2792          esac
2793        fi
2794
2795        is_arg_set=php_[]`echo [$]arg_name | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ-' 'abcdefghijklmnopqrstuvwxyz_'`
2796        if eval test "x\$$is_arg_set" = "x"; then
2797          PHP_UNKNOWN_CONFIGURE_OPTIONS="$PHP_UNKNOWN_CONFIGURE_OPTIONS
2798[$]arg"
2799        fi
2800        ;;
2801    esac
2802  done
2803])
2804
2805dnl
2806dnl PHP_CHECK_PDO_INCLUDES([found [, not-found]])
2807dnl
2808AC_DEFUN([PHP_CHECK_PDO_INCLUDES],[
2809  AC_CACHE_CHECK([for PDO includes], pdo_cv_inc_path, [
2810    AC_MSG_CHECKING([for PDO includes])
2811    if test -f $abs_srcdir/include/php/ext/pdo/php_pdo_driver.h; then
2812      pdo_cv_inc_path=$abs_srcdir/ext
2813    elif test -f $abs_srcdir/ext/pdo/php_pdo_driver.h; then
2814      pdo_cv_inc_path=$abs_srcdir/ext
2815    elif test -f $phpincludedir/ext/pdo/php_pdo_driver.h; then
2816      pdo_cv_inc_path=$phpincludedir/ext
2817    fi
2818  ])
2819  if test -n "$pdo_cv_inc_path"; then
2820ifelse([$1],[],:,[$1])
2821  else
2822ifelse([$2],[],[AC_MSG_ERROR([Cannot find php_pdo_driver.h.])],[$2])
2823  fi
2824])
2825
2826dnl
2827dnl PHP_DETECT_ICC
2828dnl Detect Intel C++ Compiler and unset $GCC if ICC found
2829AC_DEFUN([PHP_DETECT_ICC],
2830[
2831  ICC="no"
2832  AC_MSG_CHECKING([for icc])
2833  AC_EGREP_CPP([^__INTEL_COMPILER], [__INTEL_COMPILER],
2834    ICC="no"
2835    AC_MSG_RESULT([no]),
2836    ICC="yes"
2837    GCC="no"
2838    AC_MSG_RESULT([yes])
2839  )
2840])
2841
2842dnl PHP_DETECT_SUNCC
2843dnl Detect if the systems default compiler is suncc.
2844dnl We also set some useful CFLAGS if the user didn't set any
2845AC_DEFUN([PHP_DETECT_SUNCC],[
2846  SUNCC="no"
2847  AC_MSG_CHECKING([for suncc])
2848  AC_EGREP_CPP([^__SUNPRO_C], [__SUNPRO_C],
2849    SUNCC="no"
2850    AC_MSG_RESULT([no]),
2851    SUNCC="yes"
2852    GCC="no"
2853    test -n "$auto_cflags" && CFLAGS="-O -xs -xstrconst -zlazyload"
2854    GCC=""
2855    AC_MSG_RESULT([yes])
2856  )
2857])
2858
2859dnl
2860dnl PHP_CRYPT_R_STYLE
2861dnl detect the style of crypt_r() is any is available
2862dnl see APR_CHECK_CRYPT_R_STYLE() for original version
2863dnl
2864AC_DEFUN([PHP_CRYPT_R_STYLE],
2865[
2866  AC_CACHE_CHECK([which data struct is used by crypt_r], php_cv_crypt_r_style,[
2867    php_cv_crypt_r_style=none
2868    AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
2869#define _REENTRANT 1
2870#include <crypt.h>
2871]], [[
2872CRYPTD buffer;
2873crypt_r("passwd", "hash", &buffer);
2874]])],[php_cv_crypt_r_style=cryptd],[])
2875
2876    if test "$php_cv_crypt_r_style" = "none"; then
2877      AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
2878#define _REENTRANT 1
2879#include <crypt.h>
2880]],[[
2881struct crypt_data buffer;
2882crypt_r("passwd", "hash", &buffer);
2883]])],[php_cv_crypt_r_style=struct_crypt_data],[])
2884    fi
2885
2886    if test "$php_cv_crypt_r_style" = "none"; then
2887      AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
2888#define _REENTRANT 1
2889#define _GNU_SOURCE
2890#include <crypt.h>
2891]],[[
2892struct crypt_data buffer;
2893crypt_r("passwd", "hash", &buffer);
2894]])],[php_cv_crypt_r_style=struct_crypt_data_gnu_source],[])
2895    fi
2896    ])
2897
2898  if test "$php_cv_crypt_r_style" = "cryptd"; then
2899    AC_DEFINE(CRYPT_R_CRYPTD, 1, [Define if crypt_r has uses CRYPTD])
2900  fi
2901  if test "$php_cv_crypt_r_style" = "struct_crypt_data" -o "$php_cv_crypt_r_style" = "struct_crypt_data_gnu_source"; then
2902    AC_DEFINE(CRYPT_R_STRUCT_CRYPT_DATA, 1, [Define if crypt_r uses struct crypt_data])
2903  fi
2904  if test "$php_cv_crypt_r_style" = "struct_crypt_data_gnu_source"; then
2905    AC_DEFINE(CRYPT_R_GNU_SOURCE, 1, [Define if struct crypt_data requires _GNU_SOURCE])
2906  fi
2907  if test "$php_cv_crypt_r_style" = "none"; then
2908    AC_MSG_ERROR([Unable to detect data struct used by crypt_r])
2909  fi
2910])
2911
2912dnl
2913dnl PHP_TEST_WRITE_STDOUT
2914dnl
2915AC_DEFUN([PHP_TEST_WRITE_STDOUT],[
2916  AC_CACHE_CHECK(whether writing to stdout works,ac_cv_write_stdout,[
2917    AC_RUN_IFELSE([AC_LANG_SOURCE([[
2918#ifdef HAVE_UNISTD_H
2919#include <unistd.h>
2920#endif
2921
2922#define TEXT "This is the test message -- "
2923
2924main()
2925{
2926  int n;
2927
2928  n = write(1, TEXT, sizeof(TEXT)-1);
2929  return (!(n == sizeof(TEXT)-1));
2930}
2931    ]])],[
2932      ac_cv_write_stdout=yes
2933    ],[
2934      ac_cv_write_stdout=no
2935    ],[
2936      ac_cv_write_stdout=no
2937    ])
2938  ])
2939  if test "$ac_cv_write_stdout" = "yes"; then
2940    AC_DEFINE(PHP_WRITE_STDOUT, 1, [whether write(2) works])
2941  fi
2942])
2943
2944dnl
2945dnl PHP_INIT_DTRACE(providerdesc, header-file, sources [, module])
2946dnl
2947AC_DEFUN([PHP_INIT_DTRACE],[
2948dnl Set paths properly when called from extension
2949  case "$4" in
2950    ""[)] ac_srcdir="$abs_srcdir/"; unset ac_bdir;;
2951    /*[)] ac_srcdir=`echo "$4"|cut -c 2-`"/"; ac_bdir=$ac_srcdir;;
2952    *[)] ac_srcdir="$abs_srcdir/$1/"; ac_bdir="$4/";;
2953  esac
2954
2955dnl providerdesc
2956  ac_provsrc=$1
2957  old_IFS=[$]IFS
2958  IFS=.
2959  set $ac_provsrc
2960  ac_provobj=[$]1
2961  IFS=$old_IFS
2962
2963dnl header-file
2964  ac_hdrobj=$2
2965
2966dnl Add providerdesc.o or .lo into global objects when needed
2967  case $host_alias in
2968  *freebsd*)
2969    PHP_GLOBAL_OBJS="[$]PHP_GLOBAL_OBJS [$]ac_bdir[$]ac_provsrc.o"
2970    PHP_LDFLAGS="$PHP_LDFLAGS -lelf"
2971    ;;
2972  *solaris*)
2973    PHP_GLOBAL_OBJS="[$]PHP_GLOBAL_OBJS [$]ac_bdir[$]ac_provsrc.lo"
2974    ;;
2975  *linux*)
2976    PHP_GLOBAL_OBJS="[$]PHP_GLOBAL_OBJS [$]ac_bdir[$]ac_provsrc.lo"
2977    ;;
2978  esac
2979
2980dnl DTrace objects
2981  old_IFS=[$]IFS
2982  for ac_src in $3; do
2983    IFS=.
2984    set $ac_src
2985    ac_obj=[$]1
2986    IFS=$old_IFS
2987
2988    PHP_DTRACE_OBJS="[$]PHP_DTRACE_OBJS [$]ac_bdir[$]ac_obj.lo"
2989  done;
2990
2991  case [$]php_sapi_module in
2992  shared[)]
2993    for ac_lo in $PHP_DTRACE_OBJS; do
2994      dtrace_objs="[$]dtrace_objs `echo $ac_lo | $SED -e 's,\.lo$,.o,' -e 's#\(.*\)\/#\1\/.libs\/#'`"
2995    done;
2996    ;;
2997  *[)]
2998    dtrace_objs='$(PHP_DTRACE_OBJS:.lo=.o)'
2999    ;;
3000  esac
3001
3002dnl Generate Makefile.objects entries
3003dnl The empty $ac_provsrc command stops an implicit circular dependency
3004dnl in GNU Make which causes the .d file to be overwritten (Bug 61268)
3005  cat>>Makefile.objects<<EOF
3006
3007$abs_srcdir/$ac_provsrc:;
3008
3009$ac_bdir[$]ac_hdrobj: $abs_srcdir/$ac_provsrc
3010	CFLAGS="\$(CFLAGS_CLEAN)" dtrace -h -C -s $ac_srcdir[$]ac_provsrc -o \$[]@.bak && \$(SED) -e 's,PHP_,DTRACE_,g' \$[]@.bak > \$[]@
3011
3012\$(PHP_DTRACE_OBJS): $ac_bdir[$]ac_hdrobj
3013
3014EOF
3015
3016  case $host_alias in
3017  *solaris*|*linux*)
3018    dtrace_prov_name="`echo $ac_provsrc | $SED -e 's#\(.*\)\/##'`.o"
3019    dtrace_lib_dir="`echo $ac_bdir[$]ac_provsrc | $SED -e 's#\(.*\)/[^/]*#\1#'`/.libs"
3020    dtrace_d_obj="`echo $ac_bdir[$]ac_provsrc | $SED -e 's#\(.*\)/\([^/]*\)#\1/.libs/\2#'`.o"
3021    dtrace_nolib_objs='$(PHP_DTRACE_OBJS:.lo=.o)'
3022    for ac_lo in $PHP_DTRACE_OBJS; do
3023      dtrace_lib_objs="[$]dtrace_lib_objs `echo $ac_lo | $SED -e 's,\.lo$,.o,' -e 's#\(.*\)\/#\1\/.libs\/#'`"
3024    done;
3025dnl Always attempt to create both PIC and non-PIC DTrace objects (Bug 63692)
3026    cat>>Makefile.objects<<EOF
3027$ac_bdir[$]ac_provsrc.lo: \$(PHP_DTRACE_OBJS)
3028	echo "[#] Generated by Makefile for libtool" > \$[]@
3029	@test -d "$dtrace_lib_dir" || mkdir $dtrace_lib_dir
3030	if CFLAGS="\$(CFLAGS_CLEAN)" dtrace -G -o $dtrace_d_obj -s $abs_srcdir/$ac_provsrc $dtrace_lib_objs 2> /dev/null && test -f "$dtrace_d_obj"; then [\\]
3031	  echo "pic_object=['].libs/$dtrace_prov_name[']" >> \$[]@ [;\\]
3032	else [\\]
3033	  echo "pic_object='none'" >> \$[]@ [;\\]
3034	fi
3035	if CFLAGS="\$(CFLAGS_CLEAN)" dtrace -G -o $ac_bdir[$]ac_provsrc.o -s $abs_srcdir/$ac_provsrc $dtrace_nolib_objs 2> /dev/null && test -f "$ac_bdir[$]ac_provsrc.o"; then [\\]
3036	  echo "non_pic_object=[']$dtrace_prov_name[']" >> \$[]@ [;\\]
3037	else [\\]
3038	  echo "non_pic_object='none'" >> \$[]@ [;\\]
3039	fi
3040
3041EOF
3042
3043    ;;
3044  *)
3045cat>>Makefile.objects<<EOF
3046$ac_bdir[$]ac_provsrc.o: \$(PHP_DTRACE_OBJS)
3047	CFLAGS="\$(CFLAGS_CLEAN)" dtrace -G -o \$[]@ -s $abs_srcdir/$ac_provsrc $dtrace_objs
3048
3049EOF
3050    ;;
3051  esac
3052])
3053
3054dnl
3055dnl PHP_CHECK_STDINT_TYPES
3056dnl
3057AC_DEFUN([PHP_CHECK_STDINT_TYPES], [
3058  AC_CHECK_SIZEOF([short], 2)
3059  AC_CHECK_SIZEOF([int], 4)
3060  AC_CHECK_SIZEOF([long], 4)
3061  AC_CHECK_SIZEOF([long long], 8)
3062  AC_CHECK_TYPES([int8, int16, int32, int64, int8_t, int16_t, int32_t, int64_t, uint8, uint16, uint32, uint64, uint8_t, uint16_t, uint32_t, uint64_t, u_int8_t, u_int16_t, u_int32_t, u_int64_t], [], [], [
3063#if HAVE_STDINT_H
3064# include <stdint.h>
3065#endif
3066#if HAVE_SYS_TYPES_H
3067# include <sys/types.h>
3068#endif
3069  ])
3070  AC_DEFINE([PHP_HAVE_STDINT_TYPES], [1], [Checked for stdint types])
3071])
3072
3073dnl PHP_CHECK_BUILTIN_EXPECT
3074AC_DEFUN([PHP_CHECK_BUILTIN_EXPECT], [
3075  AC_MSG_CHECKING([for __builtin_expect])
3076
3077  AC_LINK_IFELSE([AC_LANG_PROGRAM([], [[
3078    return __builtin_expect(1,1) ? 1 : 0;
3079  ]])], [
3080    have_builtin_expect=1
3081    AC_MSG_RESULT([yes])
3082  ], [
3083    have_builtin_expect=0
3084    AC_MSG_RESULT([no])
3085  ])
3086
3087  AC_DEFINE_UNQUOTED([PHP_HAVE_BUILTIN_EXPECT], [$have_builtin_expect], [Whether the compiler supports __builtin_expect])
3088
3089])
3090
3091dnl PHP_CHECK_BUILTIN_CLZ
3092AC_DEFUN([PHP_CHECK_BUILTIN_CLZ], [
3093  AC_MSG_CHECKING([for __builtin_clz])
3094
3095  AC_LINK_IFELSE([AC_LANG_PROGRAM([], [[
3096    return __builtin_clz(1) ? 1 : 0;
3097  ]])], [
3098    have_builtin_clz=1
3099    AC_MSG_RESULT([yes])
3100  ], [
3101    have_builtin_clz=0
3102    AC_MSG_RESULT([no])
3103  ])
3104
3105  AC_DEFINE_UNQUOTED([PHP_HAVE_BUILTIN_CLZ], [$have_builtin_clz], [Whether the compiler supports __builtin_clz])
3106
3107])
3108
3109dnl PHP_CHECK_BUILTIN_CTZL
3110AC_DEFUN([PHP_CHECK_BUILTIN_CTZL], [
3111  AC_MSG_CHECKING([for __builtin_ctzl])
3112
3113  AC_LINK_IFELSE([AC_LANG_PROGRAM([], [[
3114    return __builtin_ctzl(2L) ? 1 : 0;
3115  ]])], [
3116    have_builtin_ctzl=1
3117    AC_MSG_RESULT([yes])
3118  ], [
3119    have_builtin_ctzl=0
3120    AC_MSG_RESULT([no])
3121  ])
3122
3123  AC_DEFINE_UNQUOTED([PHP_HAVE_BUILTIN_CTZL], [$have_builtin_ctzl], [Whether the compiler supports __builtin_ctzl])
3124
3125])
3126
3127dnl PHP_CHECK_BUILTIN_CTZLL
3128AC_DEFUN([PHP_CHECK_BUILTIN_CTZLL], [
3129  AC_MSG_CHECKING([for __builtin_ctzll])
3130
3131  AC_LINK_IFELSE([AC_LANG_PROGRAM([], [[
3132    return __builtin_ctzll(2LL) ? 1 : 0;
3133  ]])], [
3134    have_builtin_ctzll=1
3135    AC_MSG_RESULT([yes])
3136  ], [
3137    have_builtin_ctzll=0
3138    AC_MSG_RESULT([no])
3139  ])
3140
3141  AC_DEFINE_UNQUOTED([PHP_HAVE_BUILTIN_CTZLL], [$have_builtin_ctzll], [Whether the compiler supports __builtin_ctzll])
3142
3143])
3144
3145dnl PHP_CHECK_BUILTIN_SMULL_OVERFLOW
3146AC_DEFUN([PHP_CHECK_BUILTIN_SMULL_OVERFLOW], [
3147  AC_MSG_CHECKING([for __builtin_smull_overflow])
3148
3149  AC_LINK_IFELSE([AC_LANG_PROGRAM([], [[
3150    long tmpvar;
3151    return __builtin_smull_overflow(3, 7, &tmpvar);
3152  ]])], [
3153    have_builtin_smull_overflow=1
3154    AC_MSG_RESULT([yes])
3155  ], [
3156    have_builtin_smull_overflow=0
3157    AC_MSG_RESULT([no])
3158  ])
3159
3160  AC_DEFINE_UNQUOTED([PHP_HAVE_BUILTIN_SMULL_OVERFLOW],
3161   [$have_builtin_smull_overflow], [Whether the compiler supports __builtin_smull_overflow])
3162
3163])
3164
3165dnl PHP_CHECK_BUILTIN_SMULLL_OVERFLOW
3166AC_DEFUN([PHP_CHECK_BUILTIN_SMULLL_OVERFLOW], [
3167  AC_MSG_CHECKING([for __builtin_smulll_overflow])
3168
3169  AC_LINK_IFELSE([AC_LANG_PROGRAM([], [[
3170    long long tmpvar;
3171    return __builtin_smulll_overflow(3, 7, &tmpvar);
3172  ]])], [
3173    have_builtin_smulll_overflow=1
3174    AC_MSG_RESULT([yes])
3175  ], [
3176    have_builtin_smulll_overflow=0
3177    AC_MSG_RESULT([no])
3178  ])
3179
3180  AC_DEFINE_UNQUOTED([PHP_HAVE_BUILTIN_SMULLL_OVERFLOW],
3181   [$have_builtin_smulll_overflow], [Whether the compiler supports __builtin_smulll_overflow])
3182
3183])
3184
3185dnl PHP_CHECK_BUILTIN_SADDL_OVERFLOW
3186AC_DEFUN([PHP_CHECK_BUILTIN_SADDL_OVERFLOW], [
3187  AC_MSG_CHECKING([for __builtin_saddl_overflow])
3188
3189  AC_LINK_IFELSE([AC_LANG_PROGRAM([], [[
3190    long tmpvar;
3191    return __builtin_saddl_overflow(3, 7, &tmpvar);
3192  ]])], [
3193    have_builtin_saddl_overflow=1
3194    AC_MSG_RESULT([yes])
3195  ], [
3196    have_builtin_saddl_overflow=0
3197    AC_MSG_RESULT([no])
3198  ])
3199
3200  AC_DEFINE_UNQUOTED([PHP_HAVE_BUILTIN_SADDL_OVERFLOW],
3201   [$have_builtin_saddl_overflow], [Whether the compiler supports __builtin_saddl_overflow])
3202
3203])
3204
3205dnl PHP_CHECK_BUILTIN_SADDLL_OVERFLOW
3206AC_DEFUN([PHP_CHECK_BUILTIN_SADDLL_OVERFLOW], [
3207  AC_MSG_CHECKING([for __builtin_saddll_overflow])
3208
3209  AC_LINK_IFELSE([AC_LANG_PROGRAM([], [[
3210    long long tmpvar;
3211    return __builtin_saddll_overflow(3, 7, &tmpvar);
3212  ]])], [
3213    have_builtin_saddll_overflow=1
3214    AC_MSG_RESULT([yes])
3215  ], [
3216    have_builtin_saddll_overflow=0
3217    AC_MSG_RESULT([no])
3218  ])
3219
3220  AC_DEFINE_UNQUOTED([PHP_HAVE_BUILTIN_SADDLL_OVERFLOW],
3221   [$have_builtin_saddll_overflow], [Whether the compiler supports __builtin_saddll_overflow])
3222
3223])
3224
3225dnl PHP_CHECK_BUILTIN_SSUBL_OVERFLOW
3226AC_DEFUN([PHP_CHECK_BUILTIN_SSUBL_OVERFLOW], [
3227  AC_MSG_CHECKING([for __builtin_ssubl_overflow])
3228
3229  AC_LINK_IFELSE([AC_LANG_PROGRAM([], [[
3230    long tmpvar;
3231    return __builtin_ssubl_overflow(3, 7, &tmpvar);
3232  ]])], [
3233    have_builtin_ssubl_overflow=1
3234    AC_MSG_RESULT([yes])
3235  ], [
3236    have_builtin_ssubl_overflow=0
3237    AC_MSG_RESULT([no])
3238  ])
3239
3240  AC_DEFINE_UNQUOTED([PHP_HAVE_BUILTIN_SSUBL_OVERFLOW],
3241   [$have_builtin_ssubl_overflow], [Whether the compiler supports __builtin_ssubl_overflow])
3242
3243])
3244
3245dnl PHP_CHECK_BUILTIN_SSUBLL_OVERFLOW
3246AC_DEFUN([PHP_CHECK_BUILTIN_SSUBLL_OVERFLOW], [
3247  AC_MSG_CHECKING([for __builtin_ssubll_overflow])
3248
3249  AC_LINK_IFELSE([AC_LANG_PROGRAM([], [[
3250    long long tmpvar;
3251    return __builtin_ssubll_overflow(3, 7, &tmpvar);
3252  ]])], [
3253    have_builtin_ssubll_overflow=1
3254    AC_MSG_RESULT([yes])
3255  ], [
3256    have_builtin_ssubll_overflow=0
3257    AC_MSG_RESULT([no])
3258  ])
3259
3260  AC_DEFINE_UNQUOTED([PHP_HAVE_BUILTIN_SSUBLL_OVERFLOW],
3261   [$have_builtin_ssubll_overflow], [Whether the compiler supports __builtin_ssubll_overflow])
3262
3263])
3264
3265dnl PHP_CHECK_BUILTIN_CPU_INIT
3266AC_DEFUN([PHP_CHECK_BUILTIN_CPU_INIT], [
3267  AC_MSG_CHECKING([for __builtin_cpu_init])
3268
3269  AC_LINK_IFELSE([AC_LANG_PROGRAM([], [[
3270    return __builtin_cpu_init()? 1 : 0;
3271  ]])], [
3272    have_builtin_cpu_init=1
3273    AC_MSG_RESULT([yes])
3274  ], [
3275    have_builtin_cpu_init=0
3276    AC_MSG_RESULT([no])
3277  ])
3278
3279  AC_DEFINE_UNQUOTED([PHP_HAVE_BUILTIN_CPU_INIT],
3280   [$have_builtin_cpu_init], [Whether the compiler supports __builtin_cpu_init])
3281
3282])
3283
3284dnl PHP_CHECK_BUILTIN_CPU_SUPPORTS
3285AC_DEFUN([PHP_CHECK_BUILTIN_CPU_SUPPORTS], [
3286  AC_MSG_CHECKING([for __builtin_cpu_supports])
3287
3288  AC_LINK_IFELSE([AC_LANG_PROGRAM([], [[
3289    return __builtin_cpu_supports("sse")? 1 : 0;
3290  ]])], [
3291    have_builtin_cpu_supports=1
3292    AC_MSG_RESULT([yes])
3293  ], [
3294    have_builtin_cpu_supports=0
3295    AC_MSG_RESULT([no])
3296  ])
3297
3298  AC_DEFINE_UNQUOTED([PHP_HAVE_BUILTIN_CPU_SUPPORTS],
3299   [$have_builtin_cpu_supports], [Whether the compiler supports __builtin_cpu_supports])
3300])
3301
3302dnl PHP_CHECK_CPU_SUPPORTS
3303AC_DEFUN([PHP_CHECK_CPU_SUPPORTS], [
3304  AC_REQUIRE([PHP_CHECK_BUILTIN_CPU_INIT])
3305  AC_REQUIRE([PHP_CHECK_BUILTIN_CPU_SUPPORTS])
3306  have_ext_instructions=0
3307  if test $have_builtin_cpu_supports = 1; then
3308    AC_MSG_CHECKING([for $1 instructions supports])
3309    AC_RUN_IFELSE([AC_LANG_SOURCE([[
3310int main() {
3311	return __builtin_cpu_supports("$1")? 0 : 1;
3312}
3313    ]])], [
3314      have_ext_instructions=1
3315      AC_MSG_RESULT([yes])
3316    ], [
3317      AC_MSG_RESULT([no])
3318    ], [AC_MSG_RESULT([no])])
3319  fi
3320  AC_DEFINE_UNQUOTED(AS_TR_CPP([PHP_HAVE_$1_INSTRUCTIONS]),
3321   [$have_ext_instructions], [Whether the compiler supports $1 instructions])
3322])
3323
3324dnl Load the AX_CHECK_COMPILE_FLAG macro from the autoconf archive.
3325m4_include([build/ax_check_compile_flag.m4])
3326
3327m4_include([build/ax_gcc_func_attribute.m4])
3328# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
3329## Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, 2007,
3330## 2008  Free Software Foundation, Inc.
3331## Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
3332##
3333## This file is free software; the Free Software Foundation gives
3334## unlimited permission to copy and/or distribute it, with or without
3335## modifications, as long as this notice is preserved.
3336
3337# serial 52 AC_PROG_LIBTOOL
3338
3339ifdef([AC_ACVERSION],[
3340# autoconf 2.13 compatibility
3341# Set PATH_SEPARATOR variable
3342# ---------------------------------
3343# Find the correct PATH separator.  Usually this is :', but
3344# DJGPP uses ;' like DOS.
3345if test "X${PATH_SEPARATOR+set}" != Xset; then
3346  UNAME=${UNAME-`uname 2>/dev/null`}
3347  case X$UNAME in
3348    *-DOS) lt_cv_sys_path_separator=';' ;;
3349    *)     lt_cv_sys_path_separator=':' ;;
3350  esac
3351  PATH_SEPARATOR=$lt_cv_sys_path_separator
3352fi
3353])
3354
3355# AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED)
3356# -----------------------------------------------------------
3357# If this macro is not defined by Autoconf, define it here.
3358ifdef([AC_PROVIDE_IFELSE],
3359         [],
3360         [define([AC_PROVIDE_IFELSE],
3361	         [ifdef([AC_PROVIDE_$1],
3362		           [$2], [$3])])])
3363
3364# AC_PROG_LIBTOOL
3365# ---------------
3366AC_DEFUN([AC_PROG_LIBTOOL],
3367[AC_REQUIRE([_AC_PROG_LIBTOOL])dnl
3368dnl If AC_PROG_CXX has already been expanded, run AC_LIBTOOL_CXX
3369dnl immediately, otherwise, hook it in at the end of AC_PROG_CXX.
3370  AC_PROVIDE_IFELSE([AC_PROG_CXX],
3371    [AC_LIBTOOL_CXX],
3372    [define([AC_PROG_CXX], defn([AC_PROG_CXX])[AC_LIBTOOL_CXX
3373  ])])
3374])# AC_PROG_LIBTOOL
3375
3376
3377# _AC_PROG_LIBTOOL
3378# ----------------
3379AC_DEFUN([_AC_PROG_LIBTOOL],
3380[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
3381AC_BEFORE([$0],[AC_LIBTOOL_CXX])dnl
3382
3383# This can be used to rebuild libtool when needed
3384LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh"
3385
3386# Always use our own libtool.
3387LIBTOOL='$(SHELL) $(top_builddir)/libtool'
3388AC_SUBST(LIBTOOL)dnl
3389
3390# Prevent multiple expansion
3391define([AC_PROG_LIBTOOL], [])
3392])# _AC_PROG_LIBTOOL
3393
3394
3395# AC_LIBTOOL_SETUP
3396# ----------------
3397AC_DEFUN([AC_LIBTOOL_SETUP],
3398[AC_PREREQ(2.13)dnl
3399AC_REQUIRE([AC_ENABLE_SHARED])dnl
3400AC_REQUIRE([AC_ENABLE_STATIC])dnl
3401AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
3402AC_REQUIRE([AC_CANONICAL_HOST])dnl
3403AC_REQUIRE([AC_CANONICAL_BUILD])dnl
3404AC_REQUIRE([AC_PROG_CC])dnl
3405AC_REQUIRE([AC_PROG_LD])dnl
3406AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl
3407AC_REQUIRE([AC_PROG_NM])dnl
3408
3409AC_REQUIRE([AC_PROG_LN_S])dnl
3410AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl
3411# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers!
3412AC_REQUIRE([AC_OBJEXT])dnl
3413AC_REQUIRE([AC_EXEEXT])dnl
3414dnl
3415AC_LIBTOOL_SYS_MAX_CMD_LEN
3416AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
3417AC_LIBTOOL_OBJDIR
3418
3419AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
3420_LT_AC_PROG_ECHO_BACKSLASH
3421
3422case $host_os in
3423aix3*)
3424  # AIX sometimes has problems with the GCC collect2 program.  For some
3425  # reason, if we set the COLLECT_NAMES environment variable, the problems
3426  # vanish in a puff of smoke.
3427  if test "X${COLLECT_NAMES+set}" != Xset; then
3428    COLLECT_NAMES=
3429    export COLLECT_NAMES
3430  fi
3431  ;;
3432esac
3433
3434# Sed substitution that helps us do robust quoting.  It backslashifies
3435# metacharacters that are still active within double-quoted strings.
3436Xsed='sed -e 1s/^X//'
3437[sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g']
3438
3439# Same as above, but do not quote variable references.
3440[double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g']
3441
3442# Sed substitution to delay expansion of an escaped shell variable in a
3443# double_quote_subst'ed string.
3444delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
3445
3446# Sed substitution to avoid accidental globbing in evaled expressions
3447no_glob_subst='s/\*/\\\*/g'
3448
3449# Constants:
3450rm="rm -f"
3451
3452# Global variables:
3453default_ofile=libtool
3454can_build_shared=yes
3455
3456# All known linkers require a `.a' archive for static linking (except MSVC,
3457# which needs '.lib').
3458libext=a
3459ltmain="$ac_aux_dir/ltmain.sh"
3460ofile="$default_ofile"
3461with_gnu_ld="$lt_cv_prog_gnu_ld"
3462
3463AC_CHECK_TOOL(AR, ar, false)
3464AC_CHECK_TOOL(RANLIB, ranlib, :)
3465AC_CHECK_TOOL(STRIP, strip, :)
3466
3467old_CC="$CC"
3468old_CFLAGS="$CFLAGS"
3469
3470# Set sane defaults for various variables
3471test -z "$AR" && AR=ar
3472test -z "$AR_FLAGS" && AR_FLAGS=cru
3473test -z "$AS" && AS=as
3474test -z "$CC" && CC=cc
3475test -z "$LTCC" && LTCC=$CC
3476test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
3477test -z "$DLLTOOL" && DLLTOOL=dlltool
3478test -z "$LD" && LD=ld
3479test -z "$LN_S" && LN_S="ln -s"
3480test -z "$MAGIC_CMD" && MAGIC_CMD=file
3481test -z "$NM" && NM=nm
3482test -z "$SED" && SED=sed
3483test -z "$OBJDUMP" && OBJDUMP=objdump
3484test -z "$RANLIB" && RANLIB=:
3485test -z "$STRIP" && STRIP=:
3486test -z "$ac_objext" && ac_objext=o
3487
3488# Determine commands to create old-style static archives.
3489old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
3490old_postinstall_cmds='chmod 644 $oldlib'
3491old_postuninstall_cmds=
3492
3493if test -n "$RANLIB"; then
3494  case $host_os in
3495  openbsd*)
3496    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib"
3497    ;;
3498  *)
3499    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib"
3500    ;;
3501  esac
3502  old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
3503fi
3504
3505_LT_CC_BASENAME([$compiler])
3506
3507# Only perform the check for file, if the check method requires it
3508case $deplibs_check_method in
3509file_magic*)
3510  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
3511    AC_PATH_MAGIC
3512  fi
3513  ;;
3514esac
3515
3516_LT_REQUIRED_DARWIN_CHECKS
3517
3518AC_PROVIDE_IFELSE([AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no)
3519AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL],
3520enable_win32_dll=yes, enable_win32_dll=no)
3521
3522AC_ARG_ENABLE([libtool-lock],
3523[  --disable-libtool-lock  Avoid locking (might break parallel builds)])
3524test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
3525
3526AC_ARG_WITH([pic],
3527[  --with-pic              Try to use only PIC/non-PIC objects [default=use both]],
3528    [pic_mode="$withval"],
3529    [pic_mode=default])
3530test -z "$pic_mode" && pic_mode=default
3531
3532# Use C for the default configuration in the libtool script
3533tagname=
3534AC_LIBTOOL_LANG_C_CONFIG
3535_LT_AC_TAGCONFIG
3536])# AC_LIBTOOL_SETUP
3537
3538
3539# _LT_AC_SYS_COMPILER
3540# -------------------
3541AC_DEFUN([_LT_AC_SYS_COMPILER],
3542[AC_REQUIRE([AC_PROG_CC])dnl
3543
3544# If no C compiler was specified, use CC.
3545LTCC=${LTCC-"$CC"}
3546
3547# If no C compiler flags were specified, use CFLAGS.
3548LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
3549
3550# Allow CC to be a program name with arguments.
3551compiler=$CC
3552])# _LT_AC_SYS_COMPILER
3553
3554
3555# _LT_CC_BASENAME(CC)
3556# -------------------
3557# Calculate cc_basename.  Skip known compiler wrappers and cross-prefix.
3558AC_DEFUN([_LT_CC_BASENAME],
3559[for cc_temp in $1""; do
3560  case $cc_temp in
3561    compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
3562    distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
3563    \-*) ;;
3564    *) break;;
3565  esac
3566done
3567cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
3568])
3569
3570
3571# _LT_COMPILER_BOILERPLATE
3572# ------------------------
3573# Check for compiler boilerplate output or warnings with
3574# the simple compiler test code.
3575AC_DEFUN([_LT_COMPILER_BOILERPLATE],
3576[AC_REQUIRE([LT_AC_PROG_SED])dnl
3577ac_outfile=conftest.$ac_objext
3578echo "$lt_simple_compile_test_code" >conftest.$ac_ext
3579eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
3580_lt_compiler_boilerplate=`cat conftest.err`
3581$rm conftest*
3582])# _LT_COMPILER_BOILERPLATE
3583
3584
3585# _LT_LINKER_BOILERPLATE
3586# ----------------------
3587# Check for linker boilerplate output or warnings with
3588# the simple link test code.
3589AC_DEFUN([_LT_LINKER_BOILERPLATE],
3590[AC_REQUIRE([LT_AC_PROG_SED])dnl
3591ac_outfile=conftest.$ac_objext
3592echo "$lt_simple_link_test_code" >conftest.$ac_ext
3593eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
3594_lt_linker_boilerplate=`cat conftest.err`
3595$rm -r conftest*
3596])# _LT_LINKER_BOILERPLATE
3597
3598
3599dnl autoconf 2.13 compatibility
3600dnl _LT_AC_TRY_LINK()
3601AC_DEFUN(_LT_AC_TRY_LINK, [
3602cat > conftest.$ac_ext <<EOF
3603dnl This sometimes fails to find confdefs.h, for some reason.
3604dnl [#]line __oline__ "[$]0"
3605[#]line __oline__ "configure"
3606#include "confdefs.h"
3607int main() {
3608; return 0; }
3609EOF
3610if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
3611 ifelse([$1], , :, [$1
3612  rm -rf conftest*])
3613else
3614  echo "configure: failed program was:" >&5
3615  cat conftest.$ac_ext >&6
3616ifelse([$2], , , [$2
3617  rm -rf conftest*
3618])dnl
3619fi
3620rm -f conftest*])
3621
3622# _LT_REQUIRED_DARWIN_CHECKS
3623# --------------------------
3624# Check for some things on darwin
3625AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS],[
3626  case $host_os in
3627    rhapsody* | darwin*)
3628    AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:])
3629    AC_CHECK_TOOL([NMEDIT], [nmedit], [:])
3630
3631    AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod],
3632      [lt_cv_apple_cc_single_mod=no
3633      if test -z "${LT_MULTI_MODULE}"; then
3634   # By default we will add the -single_module flag. You can override
3635   # by either setting the environment variable LT_MULTI_MODULE
3636   # non-empty at configure time, or by adding -multi_module to the
3637   # link flags.
3638   echo "int foo(void){return 1;}" > conftest.c
3639   $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
3640     -dynamiclib ${wl}-single_module conftest.c
3641   if test -f libconftest.dylib; then
3642     lt_cv_apple_cc_single_mod=yes
3643     rm -rf libconftest.dylib*
3644   fi
3645   rm conftest.c
3646      fi])
3647    AC_CACHE_CHECK([for -exported_symbols_list linker flag],
3648      [lt_cv_ld_exported_symbols_list],
3649      [lt_cv_ld_exported_symbols_list=no
3650      save_LDFLAGS=$LDFLAGS
3651      echo "_main" > conftest.sym
3652      LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
3653      _LT_AC_TRY_LINK([lt_cv_ld_exported_symbols_list=yes],[lt_cv_ld_exported_symbols_list=no])
3654   LDFLAGS="$save_LDFLAGS"
3655    ])
3656    case $host_os in
3657    rhapsody* | darwin1.[[0123]])
3658      _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
3659    darwin1.*)
3660     _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
3661    darwin*)
3662      # if running on 10.5 or later, the deployment target defaults
3663      # to the OS version, if on x86, and 10.4, the deployment
3664      # target defaults to 10.4. Don't you love it?
3665      case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
3666   10.0,*86*-darwin8*|10.0,*-darwin[[91]]*)
3667     _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
3668   10.[[012]]*)
3669     _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
3670   10.*)
3671     _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
3672      esac
3673    ;;
3674  esac
3675    if test "$lt_cv_apple_cc_single_mod" = "yes"; then
3676      _lt_dar_single_mod='$single_module'
3677    fi
3678    if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
3679      _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
3680    else
3681      _lt_dar_export_syms="~$NMEDIT -s \$output_objdir/\${libname}-symbols.expsym \${lib}"
3682    fi
3683    if test "$DSYMUTIL" != ":"; then
3684      _lt_dsymutil="~$DSYMUTIL \$lib || :"
3685    else
3686      _lt_dsymutil=
3687    fi
3688    ;;
3689  esac
3690])
3691
3692# _LT_AC_SYS_LIBPATH_AIX
3693# ----------------------
3694# Links a minimal program and checks the executable
3695# for the system default hardcoded library path. In most cases,
3696# this is /usr/lib:/lib, but when the MPI compilers are used
3697# the location of the communication and MPI libs are included too.
3698# If we don't find anything, use the default library path according
3699# to the aix ld manual.
3700AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX],
3701[AC_REQUIRE([LT_AC_PROG_SED])dnl
3702_LT_AC_TRY_LINK([
3703lt_aix_libpath_sed='
3704    /Import File Strings/,/^$/ {
3705	/^0/ {
3706	    s/^0  *\(.*\)$/\1/
3707	    p
3708	}
3709    }'
3710aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
3711# Check for a 64-bit object if we didn't find anything.
3712if test -z "$aix_libpath"; then
3713  aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
3714fi],[])
3715if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
3716])# _LT_AC_SYS_LIBPATH_AIX
3717
3718
3719# _LT_AC_SHELL_INIT(ARG)
3720# ----------------------
3721AC_DEFUN([_LT_AC_SHELL_INIT],
3722[ifdef([AC_DIVERSION_NOTICE],
3723	     [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)],
3724	 [AC_DIVERT_PUSH(NOTICE)])
3725$1
3726AC_DIVERT_POP
3727])# _LT_AC_SHELL_INIT
3728
3729
3730# _LT_AC_PROG_ECHO_BACKSLASH
3731# --------------------------
3732# Add some code to the start of the generated configure script which
3733# will find an echo command which doesn't interpret backslashes.
3734AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH],
3735[_LT_AC_SHELL_INIT([
3736# Check that we are running under the correct shell.
3737SHELL=${CONFIG_SHELL-/bin/sh}
3738
3739case X$ECHO in
3740X*--fallback-echo)
3741  # Remove one level of quotation (which was required for Make).
3742  ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','`
3743  ;;
3744esac
3745
3746echo=${ECHO-echo}
3747if test "X[$]1" = X--no-reexec; then
3748  # Discard the --no-reexec flag, and continue.
3749  shift
3750elif test "X[$]1" = X--fallback-echo; then
3751  # Avoid inline document here, it may be left over
3752  :
3753elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then
3754  # Yippee, $echo works!
3755  :
3756else
3757  # Restart under the correct shell.
3758  exec $SHELL "[$]0" --no-reexec ${1+"[$]@"}
3759fi
3760
3761if test "X[$]1" = X--fallback-echo; then
3762  # used as fallback echo
3763  shift
3764  cat <<EOF
3765[$]*
3766EOF
3767  exit 0
3768fi
3769
3770# The HP-UX ksh and POSIX shell print the target directory to stdout
3771# if CDPATH is set.
3772(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
3773
3774if test -z "$ECHO"; then
3775if test "X${echo_test_string+set}" != Xset; then
3776# find a string as large as possible, as long as the shell can cope with it
3777  for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do
3778    # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
3779    if (echo_test_string=`eval $cmd`) 2>/dev/null &&
3780       echo_test_string=`eval $cmd` &&
3781       (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null
3782    then
3783      break
3784    fi
3785  done
3786fi
3787
3788if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
3789   echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
3790   test "X$echo_testing_string" = "X$echo_test_string"; then
3791  :
3792else
3793  # The Solaris, AIX, and Digital Unix default echo programs unquote
3794  # backslashes.  This makes it impossible to quote backslashes using
3795  #   echo "$something" | sed 's/\\/\\\\/g'
3796  #
3797  # So, first we look for a working echo in the user's PATH.
3798
3799  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
3800  for dir in $PATH /usr/ucb; do
3801    IFS="$lt_save_ifs"
3802    if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
3803       test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
3804       echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
3805       test "X$echo_testing_string" = "X$echo_test_string"; then
3806      echo="$dir/echo"
3807      break
3808    fi
3809  done
3810  IFS="$lt_save_ifs"
3811
3812  if test "X$echo" = Xecho; then
3813    # We didn't find a better echo, so look for alternatives.
3814    if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' &&
3815       echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` &&
3816       test "X$echo_testing_string" = "X$echo_test_string"; then
3817      # This shell has a builtin print -r that does the trick.
3818      echo='print -r'
3819    elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) &&
3820	 test "X$CONFIG_SHELL" != X/bin/ksh; then
3821      # If we have ksh, try running configure again with it.
3822      ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
3823      export ORIGINAL_CONFIG_SHELL
3824      CONFIG_SHELL=/bin/ksh
3825      export CONFIG_SHELL
3826      exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"}
3827    else
3828      # Try using printf.
3829      echo='printf %s\n'
3830      if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
3831	 echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
3832	 test "X$echo_testing_string" = "X$echo_test_string"; then
3833	# Cool, printf works
3834	:
3835      elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
3836	   test "X$echo_testing_string" = 'X\t' &&
3837	   echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
3838	   test "X$echo_testing_string" = "X$echo_test_string"; then
3839	CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
3840	export CONFIG_SHELL
3841	SHELL="$CONFIG_SHELL"
3842	export SHELL
3843	echo="$CONFIG_SHELL [$]0 --fallback-echo"
3844      elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
3845	   test "X$echo_testing_string" = 'X\t' &&
3846	   echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
3847	   test "X$echo_testing_string" = "X$echo_test_string"; then
3848	echo="$CONFIG_SHELL [$]0 --fallback-echo"
3849      else
3850	# maybe with a smaller string...
3851	prev=:
3852
3853	for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do
3854	  if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null
3855	  then
3856	    break
3857	  fi
3858	  prev="$cmd"
3859	done
3860
3861	if test "$prev" != 'sed 50q "[$]0"'; then
3862	  echo_test_string=`eval $prev`
3863	  export echo_test_string
3864	  exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"}
3865	else
3866	  # Oops.  We lost completely, so just stick with echo.
3867	  echo=echo
3868	fi
3869      fi
3870    fi
3871  fi
3872fi
3873fi
3874
3875# Copy echo and quote the copy suitably for passing to libtool from
3876# the Makefile, instead of quoting the original, which is used later.
3877ECHO=$echo
3878if test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then
3879   ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo"
3880fi
3881
3882AC_SUBST(ECHO)
3883])])# _LT_AC_PROG_ECHO_BACKSLASH
3884
3885
3886# _LT_AC_LOCK
3887# -----------
3888AC_DEFUN([_LT_AC_LOCK],
3889[dnl
3890#AC_ARG_ENABLE([libtool-lock],
3891#[  --disable-libtool-lock  avoid locking (might break parallel builds)])
3892#test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
3893
3894# Some flags need to be propagated to the compiler or linker for good
3895# libtool support.
3896case $host in
3897ia64-*-hpux*)
3898  # Find out which ABI we are using.
3899  echo 'int i;' > conftest.$ac_ext
3900  if AC_TRY_EVAL(ac_compile); then
3901    case `/usr/bin/file conftest.$ac_objext` in
3902    *ELF-32*)
3903      HPUX_IA64_MODE="32"
3904      ;;
3905    *ELF-64*)
3906      HPUX_IA64_MODE="64"
3907      ;;
3908    esac
3909  fi
3910  rm -rf conftest*
3911  ;;
3912*-*-irix6*)
3913  # Find out which ABI we are using.
3914  echo '[#]line __oline__ "configure"' > conftest.$ac_ext
3915  if AC_TRY_EVAL(ac_compile); then
3916   if test "$lt_cv_prog_gnu_ld" = yes; then
3917    case `/usr/bin/file conftest.$ac_objext` in
3918    *32-bit*)
3919      LD="${LD-ld} -melf32bsmip"
3920      ;;
3921    *N32*)
3922      LD="${LD-ld} -melf32bmipn32"
3923      ;;
3924    *64-bit*)
3925      LD="${LD-ld} -melf64bmip"
3926      ;;
3927    esac
3928   else
3929    case `/usr/bin/file conftest.$ac_objext` in
3930    *32-bit*)
3931      LD="${LD-ld} -32"
3932      ;;
3933    *N32*)
3934      LD="${LD-ld} -n32"
3935      ;;
3936    *64-bit*)
3937      LD="${LD-ld} -64"
3938      ;;
3939    esac
3940   fi
3941  fi
3942  rm -rf conftest*
3943  ;;
3944
3945x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \
3946s390*-*linux*|sparc*-*linux*)
3947  # Find out which ABI we are using.
3948  echo 'int i;' > conftest.$ac_ext
3949  if AC_TRY_EVAL(ac_compile); then
3950    case `/usr/bin/file conftest.o` in
3951    *32-bit*)
3952      case $host in
3953        x86_64-*kfreebsd*-gnu)
3954          LD="${LD-ld} -m elf_i386_fbsd"
3955          ;;
3956        x86_64-*linux*)
3957          LD="${LD-ld} -m elf_i386"
3958          ;;
3959        powerpc64le-*linux*)
3960          LD="${LD-ld} -m elf32lppclinux"
3961          ;;
3962        powerpc64-*linux*)
3963          LD="${LD-ld} -m elf32ppclinux"
3964          ;;
3965        s390x-*linux*)
3966          LD="${LD-ld} -m elf_s390"
3967          ;;
3968        sparc64-*linux*)
3969          LD="${LD-ld} -m elf32_sparc"
3970          ;;
3971      esac
3972      ;;
3973    *64-bit*)
3974      case $host in
3975        x86_64-*kfreebsd*-gnu)
3976          LD="${LD-ld} -m elf_x86_64_fbsd"
3977          ;;
3978        x86_64-*linux*)
3979          LD="${LD-ld} -m elf_x86_64"
3980          ;;
3981        powerpcle-*linux*)
3982          LD="${LD-ld} -m elf64lppc"
3983          ;;
3984        powerpc-*linux*)
3985          LD="${LD-ld} -m elf64ppc"
3986          ;;
3987        s390*-*linux*)
3988          LD="${LD-ld} -m elf64_s390"
3989          ;;
3990        sparc*-*linux*)
3991          LD="${LD-ld} -m elf64_sparc"
3992          ;;
3993      esac
3994      ;;
3995    esac
3996  fi
3997  rm -rf conftest*
3998  ;;
3999
4000*-*-sco3.2v5*)
4001  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
4002  SAVE_CFLAGS="$CFLAGS"
4003  CFLAGS="$CFLAGS -belf"
4004  AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
4005    [AC_LANG_SAVE
4006     AC_LANG_C
4007     AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
4008     AC_LANG_RESTORE])
4009  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
4010    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
4011    CFLAGS="$SAVE_CFLAGS"
4012  fi
4013  ;;
4014sparc*-*solaris*)
4015  # Find out which ABI we are using.
4016  echo 'int i;' > conftest.$ac_ext
4017  if AC_TRY_EVAL(ac_compile); then
4018    case `/usr/bin/file conftest.o` in
4019    *64-bit*)
4020      case $lt_cv_prog_gnu_ld in
4021      yes*) LD="${LD-ld} -m elf64_sparc" ;;
4022      *)
4023        if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
4024	  LD="${LD-ld} -64"
4025	fi
4026	;;
4027      esac
4028      ;;
4029    esac
4030  fi
4031  rm -rf conftest*
4032  ;;
4033
4034AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL],
4035[*-*-cygwin* | *-*-mingw* | *-*-pw32*)
4036  AC_CHECK_TOOL(DLLTOOL, dlltool, false)
4037  AC_CHECK_TOOL(AS, as, false)
4038  AC_CHECK_TOOL(OBJDUMP, objdump, false)
4039  ;;
4040  ])
4041esac
4042
4043need_locks="$enable_libtool_lock"
4044
4045])# _LT_AC_LOCK
4046
4047
4048# AC_LIBTOOL_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
4049#		[OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
4050# ----------------------------------------------------------------
4051# Check whether the given compiler option works
4052AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION],
4053[AC_REQUIRE([LT_AC_PROG_SED])
4054AC_CACHE_CHECK([$1], [$2],
4055  [$2=no
4056  ifelse([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
4057   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
4058   lt_compiler_flag="$3"
4059   # Insert the option either (1) after the last *FLAGS variable, or
4060   # (2) before a word containing "conftest.", or (3) at the end.
4061   # Note that $ac_compile itself does not contain backslashes and begins
4062   # with a dollar sign (not a hyphen), so the echo should work correctly.
4063   # The option is referenced via a variable to avoid confusing sed.
4064   lt_compile=`echo "$ac_compile" | $SED \
4065   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
4066   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
4067   -e 's:$: $lt_compiler_flag:'`
4068   (eval echo "\"configure:__oline__: $lt_compile\"" >&5)
4069   (eval "$lt_compile" 2>conftest.err)
4070   ac_status=$?
4071   cat conftest.err >&5
4072   echo "configure:__oline__: \$? = $ac_status" >&5
4073   if (exit $ac_status) && test -s "$ac_outfile"; then
4074     # The compiler can only warn and ignore the option if not recognized
4075     # So say no if there are warnings other than the usual output.
4076     $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
4077     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
4078     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
4079       $2=yes
4080     fi
4081   fi
4082   $rm conftest*
4083])
4084
4085if test x"[$]$2" = xyes; then
4086    ifelse([$5], , :, [$5])
4087else
4088    ifelse([$6], , :, [$6])
4089fi
4090])# AC_LIBTOOL_COMPILER_OPTION
4091
4092
4093# AC_LIBTOOL_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
4094#                          [ACTION-SUCCESS], [ACTION-FAILURE])
4095# ------------------------------------------------------------
4096# Check whether the given compiler option works
4097AC_DEFUN([AC_LIBTOOL_LINKER_OPTION],
4098[AC_REQUIRE([LT_AC_PROG_SED])dnl
4099AC_CACHE_CHECK([$1], [$2],
4100  [$2=no
4101   save_LDFLAGS="$LDFLAGS"
4102   LDFLAGS="$LDFLAGS $3"
4103   echo "$lt_simple_link_test_code" > conftest.$ac_ext
4104   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
4105     # The linker can only warn and ignore the option if not recognized
4106     # So say no if there are warnings
4107     if test -s conftest.err; then
4108       # Append any errors to the config.log.
4109       cat conftest.err 1>&5
4110       $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp
4111       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
4112       if diff conftest.exp conftest.er2 >/dev/null; then
4113         $2=yes
4114       fi
4115     else
4116       $2=yes
4117     fi
4118   fi
4119   $rm -r conftest*
4120   LDFLAGS="$save_LDFLAGS"
4121])
4122
4123if test x"[$]$2" = xyes; then
4124    ifelse([$4], , :, [$4])
4125else
4126    ifelse([$5], , :, [$5])
4127fi
4128])# AC_LIBTOOL_LINKER_OPTION
4129
4130
4131# AC_LIBTOOL_SYS_MAX_CMD_LEN
4132# --------------------------
4133AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN],
4134[# find the maximum length of command line arguments
4135AC_MSG_CHECKING([the maximum length of command line arguments])
4136AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
4137  i=0
4138  teststring="ABCD"
4139
4140  case $build_os in
4141  msdosdjgpp*)
4142    # On DJGPP, this test can blow up pretty badly due to problems in libc
4143    # (any single argument exceeding 2000 bytes causes a buffer overrun
4144    # during glob expansion).  Even if it were fixed, the result of this
4145    # check would be larger than it should be.
4146    lt_cv_sys_max_cmd_len=12288;    # 12K is about right
4147    ;;
4148
4149  gnu*)
4150    # Under GNU Hurd, this test is not required because there is
4151    # no limit to the length of command line arguments.
4152    # Libtool will interpret -1 as no limit whatsoever
4153    lt_cv_sys_max_cmd_len=-1;
4154    ;;
4155
4156  cygwin* | mingw*)
4157    # On Win9x/ME, this test blows up -- it succeeds, but takes
4158    # about 5 minutes as the teststring grows exponentially.
4159    # Worse, since 9x/ME are not pre-emptively multitasking,
4160    # you end up with a "frozen" computer, even though with patience
4161    # the test eventually succeeds (with a max line length of 256k).
4162    # Instead, let's just punt: use the minimum linelength reported by
4163    # all of the supported platforms: 8192 (on NT/2K/XP).
4164    lt_cv_sys_max_cmd_len=8192;
4165    ;;
4166
4167  amigaos*)
4168    # On AmigaOS with pdksh, this test takes hours, literally.
4169    # So we just punt and use a minimum line length of 8192.
4170    lt_cv_sys_max_cmd_len=8192;
4171    ;;
4172
4173  netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
4174    # This has been around since 386BSD, at least.  Likely further.
4175    if test -x /sbin/sysctl; then
4176      lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
4177    elif test -x /usr/sbin/sysctl; then
4178      lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
4179    else
4180      lt_cv_sys_max_cmd_len=65536	# usable default for all BSDs
4181    fi
4182    # And add a safety zone
4183    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
4184    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
4185    ;;
4186
4187  interix*)
4188    # We know the value 262144 and hardcode it with a safety zone (like BSD)
4189    lt_cv_sys_max_cmd_len=196608
4190    ;;
4191
4192  osf*)
4193    # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
4194    # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
4195    # nice to cause kernel panics so lets avoid the loop below.
4196    # First set a reasonable default.
4197    lt_cv_sys_max_cmd_len=16384
4198    #
4199    if test -x /sbin/sysconfig; then
4200      case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
4201        *1*) lt_cv_sys_max_cmd_len=-1 ;;
4202      esac
4203    fi
4204    ;;
4205  sco3.2v5*)
4206    lt_cv_sys_max_cmd_len=102400
4207    ;;
4208  sysv5* | sco5v6* | sysv4.2uw2*)
4209    kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
4210    if test -n "$kargmax"; then
4211      lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ 	]]//'`
4212    else
4213      lt_cv_sys_max_cmd_len=32768
4214    fi
4215    ;;
4216  *)
4217    lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
4218    if test -n "$lt_cv_sys_max_cmd_len"; then
4219      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
4220      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
4221    else
4222      SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
4223      while (test "X"`$SHELL [$]0 --fallback-echo "X$teststring" 2>/dev/null` \
4224	       = "XX$teststring") >/dev/null 2>&1 &&
4225	      new_result=`expr "X$teststring" : ".*" 2>&1` &&
4226	      lt_cv_sys_max_cmd_len=$new_result &&
4227	      test $i != 17 # 1/2 MB should be enough
4228      do
4229        i=`expr $i + 1`
4230        teststring=$teststring$teststring
4231      done
4232      teststring=
4233      # Add a significant safety factor because C++ compilers can tack on massive
4234      # amounts of additional arguments before passing them to the linker.
4235      # It appears as though 1/2 is a usable value.
4236      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
4237    fi
4238    ;;
4239  esac
4240])
4241if test -n $lt_cv_sys_max_cmd_len ; then
4242  AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
4243else
4244  AC_MSG_RESULT(none)
4245fi
4246])# AC_LIBTOOL_SYS_MAX_CMD_LEN
4247
4248
4249# _LT_AC_CHECK_DLFCN
4250# ------------------
4251AC_DEFUN([_LT_AC_CHECK_DLFCN],
4252[AC_CHECK_HEADERS(dlfcn.h)dnl
4253])# _LT_AC_CHECK_DLFCN
4254
4255
4256# _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
4257#                           ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
4258# ---------------------------------------------------------------------
4259AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF],
4260[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl
4261if test "$cross_compiling" = yes; then :
4262  [$4]
4263else
4264  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
4265  lt_status=$lt_dlunknown
4266  cat > conftest.$ac_ext <<EOF
4267[#line __oline__ "configure"
4268#include "confdefs.h"
4269
4270#if HAVE_DLFCN_H
4271#include <dlfcn.h>
4272#endif
4273
4274#include <stdio.h>
4275
4276#ifdef RTLD_GLOBAL
4277#  define LT_DLGLOBAL		RTLD_GLOBAL
4278#else
4279#  ifdef DL_GLOBAL
4280#    define LT_DLGLOBAL		DL_GLOBAL
4281#  else
4282#    define LT_DLGLOBAL		0
4283#  endif
4284#endif
4285
4286/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
4287   find out it does not work in some platform. */
4288#ifndef LT_DLLAZY_OR_NOW
4289#  ifdef RTLD_LAZY
4290#    define LT_DLLAZY_OR_NOW		RTLD_LAZY
4291#  else
4292#    ifdef DL_LAZY
4293#      define LT_DLLAZY_OR_NOW		DL_LAZY
4294#    else
4295#      ifdef RTLD_NOW
4296#        define LT_DLLAZY_OR_NOW	RTLD_NOW
4297#      else
4298#        ifdef DL_NOW
4299#          define LT_DLLAZY_OR_NOW	DL_NOW
4300#        else
4301#          define LT_DLLAZY_OR_NOW	0
4302#        endif
4303#      endif
4304#    endif
4305#  endif
4306#endif
4307
4308void fnord() { int i=42;}
4309int main ()
4310{
4311  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
4312  int status = $lt_dlunknown;
4313
4314  if (self)
4315    {
4316      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
4317      else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
4318      /* dlclose (self); */
4319    }
4320  else
4321    puts (dlerror ());
4322
4323    return (status);
4324}]
4325EOF
4326  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
4327    (./conftest; exit; ) >&5 2>/dev/null
4328    lt_status=$?
4329    case x$lt_status in
4330      x$lt_dlno_uscore) $1 ;;
4331      x$lt_dlneed_uscore) $2 ;;
4332      x$lt_dlunknown|x*) $3 ;;
4333    esac
4334  else :
4335    # compilation failed
4336    $3
4337  fi
4338fi
4339rm -fr conftest*
4340])# _LT_AC_TRY_DLOPEN_SELF
4341
4342
4343# AC_LIBTOOL_DLOPEN_SELF
4344# ----------------------
4345AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF],
4346[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl
4347if test "x$enable_dlopen" != xyes; then
4348  enable_dlopen=unknown
4349  enable_dlopen_self=unknown
4350  enable_dlopen_self_static=unknown
4351else
4352  lt_cv_dlopen=no
4353  lt_cv_dlopen_libs=
4354
4355  case $host_os in
4356  beos*)
4357    lt_cv_dlopen="load_add_on"
4358    lt_cv_dlopen_libs=
4359    lt_cv_dlopen_self=yes
4360    ;;
4361
4362  mingw* | pw32*)
4363    lt_cv_dlopen="LoadLibrary"
4364    lt_cv_dlopen_libs=
4365   ;;
4366
4367  cygwin*)
4368    lt_cv_dlopen="dlopen"
4369    lt_cv_dlopen_libs=
4370   ;;
4371
4372  darwin*)
4373  # if libdl is installed we need to link against it
4374    AC_CHECK_LIB([dl], [dlopen],
4375		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[
4376    lt_cv_dlopen="dyld"
4377    lt_cv_dlopen_libs=
4378    lt_cv_dlopen_self=yes
4379    ])
4380   ;;
4381
4382  *)
4383    AC_CHECK_FUNC([shl_load],
4384	  [lt_cv_dlopen="shl_load"],
4385      [AC_CHECK_LIB([dld], [shl_load],
4386	    [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"],
4387	[AC_CHECK_FUNC([dlopen],
4388	      [lt_cv_dlopen="dlopen"],
4389	  [AC_CHECK_LIB([dl], [dlopen],
4390		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
4391	    [AC_CHECK_LIB([svld], [dlopen],
4392		  [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
4393	      [AC_CHECK_LIB([dld], [dld_link],
4394		    [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"])
4395	      ])
4396	    ])
4397	  ])
4398	])
4399      ])
4400    ;;
4401  esac
4402
4403  if test "x$lt_cv_dlopen" != xno; then
4404    enable_dlopen=yes
4405  else
4406    enable_dlopen=no
4407  fi
4408
4409  case $lt_cv_dlopen in
4410  dlopen)
4411    save_CPPFLAGS="$CPPFLAGS"
4412    test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
4413
4414    save_LDFLAGS="$LDFLAGS"
4415    wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
4416
4417    save_LIBS="$LIBS"
4418    LIBS="$lt_cv_dlopen_libs $LIBS"
4419
4420    AC_CACHE_CHECK([whether a program can dlopen itself],
4421	  lt_cv_dlopen_self, [dnl
4422	  _LT_AC_TRY_DLOPEN_SELF(
4423	    lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
4424	    lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
4425    ])
4426
4427    if test "x$lt_cv_dlopen_self" = xyes; then
4428      wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
4429      AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
4430    	  lt_cv_dlopen_self_static, [dnl
4431	  _LT_AC_TRY_DLOPEN_SELF(
4432	    lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
4433	    lt_cv_dlopen_self_static=no,  lt_cv_dlopen_self_static=cross)
4434      ])
4435    fi
4436
4437    CPPFLAGS="$save_CPPFLAGS"
4438    LDFLAGS="$save_LDFLAGS"
4439    LIBS="$save_LIBS"
4440    ;;
4441  esac
4442
4443  case $lt_cv_dlopen_self in
4444  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
4445  *) enable_dlopen_self=unknown ;;
4446  esac
4447
4448  case $lt_cv_dlopen_self_static in
4449  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
4450  *) enable_dlopen_self_static=unknown ;;
4451  esac
4452fi
4453])# AC_LIBTOOL_DLOPEN_SELF
4454
4455
4456# AC_LIBTOOL_PROG_CC_C_O([TAGNAME])
4457# ---------------------------------
4458# Check to see if options -c and -o are simultaneously supported by compiler
4459AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O],
4460[AC_REQUIRE([LT_AC_PROG_SED])dnl
4461AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
4462AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
4463  [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
4464  [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
4465   $rm -r conftest 2>/dev/null
4466   mkdir conftest
4467   cd conftest
4468   mkdir out
4469   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
4470
4471   lt_compiler_flag="-o out/conftest2.$ac_objext"
4472   # Insert the option either (1) after the last *FLAGS variable, or
4473   # (2) before a word containing "conftest.", or (3) at the end.
4474   # Note that $ac_compile itself does not contain backslashes and begins
4475   # with a dollar sign (not a hyphen), so the echo should work correctly.
4476   lt_compile=`echo "$ac_compile" | $SED \
4477   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
4478   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
4479   -e 's:$: $lt_compiler_flag:'`
4480   (eval echo "\"configure:__oline__: $lt_compile\"" >&5)
4481   (eval "$lt_compile" 2>out/conftest.err)
4482   ac_status=$?
4483   cat out/conftest.err >&5
4484   echo "configure:__oline__: \$? = $ac_status" >&5
4485   if (exit $ac_status) && test -s out/conftest2.$ac_objext
4486   then
4487     # The compiler can only warn and ignore the option if not recognized
4488     # So say no if there are warnings
4489     $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
4490     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
4491     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
4492       _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
4493     fi
4494   fi
4495   chmod u+w . 2>&5
4496   $rm conftest*
4497   # SGI C++ compiler will create directory out/ii_files/ for
4498   # template instantiation
4499   test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files
4500   $rm out/* && rmdir out
4501   cd ..
4502   rmdir conftest
4503   $rm conftest*
4504])
4505])# AC_LIBTOOL_PROG_CC_C_O
4506
4507
4508# AC_LIBTOOL_SYS_HARD_LINK_LOCKS([TAGNAME])
4509# -----------------------------------------
4510# Check to see if we can do hard links to lock some files if needed
4511AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS],
4512[AC_REQUIRE([_LT_AC_LOCK])dnl
4513
4514hard_links="nottested"
4515if test "$_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then
4516  # do not overwrite the value of need_locks provided by the user
4517  AC_MSG_CHECKING([if we can lock with hard links])
4518  hard_links=yes
4519  $rm conftest*
4520  ln conftest.a conftest.b 2>/dev/null && hard_links=no
4521  touch conftest.a
4522  ln conftest.a conftest.b 2>&5 || hard_links=no
4523  ln conftest.a conftest.b 2>/dev/null && hard_links=no
4524  AC_MSG_RESULT([$hard_links])
4525  if test "$hard_links" = no; then
4526    AC_MSG_WARN([\`$CC' does not support \`-c -o', so \`make -j' may be unsafe])
4527    need_locks=warn
4528  fi
4529else
4530  need_locks=no
4531fi
4532])# AC_LIBTOOL_SYS_HARD_LINK_LOCKS
4533
4534
4535# AC_LIBTOOL_OBJDIR
4536# -----------------
4537AC_DEFUN([AC_LIBTOOL_OBJDIR],
4538[AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
4539[rm -f .libs 2>/dev/null
4540mkdir .libs 2>/dev/null
4541if test -d .libs; then
4542  lt_cv_objdir=.libs
4543else
4544  # MS-DOS does not allow filenames that begin with a dot.
4545  lt_cv_objdir=_libs
4546fi
4547rmdir .libs 2>/dev/null])
4548objdir=$lt_cv_objdir
4549])# AC_LIBTOOL_OBJDIR
4550
4551
4552# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH([TAGNAME])
4553# ----------------------------------------------
4554# Check hardcoding attributes.
4555AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH],
4556[AC_MSG_CHECKING([how to hardcode library paths into programs])
4557_LT_AC_TAGVAR(hardcode_action, $1)=
4558if test -n "$_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)" || \
4559   test -n "$_LT_AC_TAGVAR(runpath_var, $1)" || \
4560   test "X$_LT_AC_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then
4561
4562  # We can hardcode non-existent directories.
4563  if test "$_LT_AC_TAGVAR(hardcode_direct, $1)" != no &&
4564     # If the only mechanism to avoid hardcoding is shlibpath_var, we
4565     # have to relink, otherwise we might link with an installed library
4566     # when we should be linking with a yet-to-be-installed one
4567     ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
4568     test "$_LT_AC_TAGVAR(hardcode_minus_L, $1)" != no; then
4569    # Linking always hardcodes the temporary library directory.
4570    _LT_AC_TAGVAR(hardcode_action, $1)=relink
4571  else
4572    # We can link without hardcoding, and we can hardcode nonexisting dirs.
4573    _LT_AC_TAGVAR(hardcode_action, $1)=immediate
4574  fi
4575else
4576  # We cannot hardcode anything, or else we can only hardcode existing
4577  # directories.
4578  _LT_AC_TAGVAR(hardcode_action, $1)=unsupported
4579fi
4580AC_MSG_RESULT([$_LT_AC_TAGVAR(hardcode_action, $1)])
4581
4582if test "$_LT_AC_TAGVAR(hardcode_action, $1)" = relink; then
4583  # Fast installation is not supported
4584  enable_fast_install=no
4585elif test "$shlibpath_overrides_runpath" = yes ||
4586     test "$enable_shared" = no; then
4587  # Fast installation is not necessary
4588  enable_fast_install=needless
4589fi
4590])# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH
4591
4592
4593# AC_LIBTOOL_SYS_LIB_STRIP
4594# ------------------------
4595AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP],
4596[striplib=
4597old_striplib=
4598AC_MSG_CHECKING([whether stripping libraries is possible])
4599if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then
4600  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
4601  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
4602  AC_MSG_RESULT([yes])
4603else
4604# FIXME - insert some real tests, host_os isn't really good enough
4605  case $host_os in
4606   darwin*)
4607       if test -n "$STRIP" ; then
4608         striplib="$STRIP -x"
4609         old_striplib="$STRIP -S"
4610         AC_MSG_RESULT([yes])
4611       else
4612  AC_MSG_RESULT([no])
4613fi
4614       ;;
4615   *)
4616  AC_MSG_RESULT([no])
4617    ;;
4618  esac
4619fi
4620])# AC_LIBTOOL_SYS_LIB_STRIP
4621
4622
4623# AC_LIBTOOL_SYS_DYNAMIC_LINKER
4624# -----------------------------
4625# PORTME Fill in your ld.so characteristics
4626AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER],
4627[AC_REQUIRE([LT_AC_PROG_SED])dnl
4628AC_MSG_CHECKING([dynamic linker characteristics])
4629library_names_spec=
4630libname_spec='lib$name'
4631soname_spec=
4632shrext_cmds=".so"
4633postinstall_cmds=
4634postuninstall_cmds=
4635finish_cmds=
4636finish_eval=
4637shlibpath_var=
4638shlibpath_overrides_runpath=unknown
4639version_type=none
4640dynamic_linker="$host_os ld.so"
4641sys_lib_dlsearch_path_spec="/lib /usr/lib"
4642ifelse($1,[],[
4643if test "$GCC" = yes; then
4644  case $host_os in
4645    darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
4646    *) lt_awk_arg="/^libraries:/" ;;
4647  esac
4648  lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"`
4649  if echo "$lt_search_path_spec" | grep ';' >/dev/null ; then
4650    # if the path contains ";" then we assume it to be the separator
4651    # otherwise default to the standard path separator (i.e. ":") - it is
4652    # assumed that no part of a normal pathname contains ";" but that should
4653    # okay in the real world where ";" in dirpaths is itself problematic.
4654    lt_search_path_spec=`echo "$lt_search_path_spec" | $SED -e 's/;/ /g'`
4655  else
4656    lt_search_path_spec=`echo "$lt_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
4657  fi
4658  # Ok, now we have the path, separated by spaces, we can step through it
4659  # and add multilib dir if necessary.
4660  lt_tmp_lt_search_path_spec=
4661  lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
4662  for lt_sys_path in $lt_search_path_spec; do
4663    if test -d "$lt_sys_path/$lt_multi_os_dir"; then
4664      lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
4665    else
4666      test -d "$lt_sys_path" && \
4667	lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
4668    fi
4669  done
4670  lt_search_path_spec=`echo $lt_tmp_lt_search_path_spec | awk '
4671BEGIN {RS=" "; FS="/|\n";} {
4672  lt_foo="";
4673  lt_count=0;
4674  for (lt_i = NF; lt_i > 0; lt_i--) {
4675    if ($lt_i != "" && $lt_i != ".") {
4676      if ($lt_i == "..") {
4677        lt_count++;
4678      } else {
4679        if (lt_count == 0) {
4680          lt_foo="/" $lt_i lt_foo;
4681        } else {
4682          lt_count--;
4683        }
4684      }
4685    }
4686  }
4687  if (lt_foo != "") { lt_freq[[lt_foo]]++; }
4688  if (lt_freq[[lt_foo]] == 1) { print lt_foo; }
4689}'`
4690  sys_lib_search_path_spec=`echo $lt_search_path_spec`
4691else
4692  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
4693fi])
4694need_lib_prefix=unknown
4695hardcode_into_libs=no
4696
4697# when you set need_version to no, make sure it does not cause -set_version
4698# flags to be left without arguments
4699need_version=unknown
4700
4701case $host_os in
4702aix3*)
4703  version_type=linux
4704  library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
4705  shlibpath_var=LIBPATH
4706
4707  # AIX 3 has no versioning support, so we append a major version to the name.
4708  soname_spec='${libname}${release}${shared_ext}$major'
4709  ;;
4710
4711aix[[4-9]]*)
4712  version_type=linux
4713  need_lib_prefix=no
4714  need_version=no
4715  hardcode_into_libs=yes
4716  if test "$host_cpu" = ia64; then
4717    # AIX 5 supports IA64
4718    library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
4719    shlibpath_var=LD_LIBRARY_PATH
4720  else
4721    # With GCC up to 2.95.x, collect2 would create an import file
4722    # for dependence libraries.  The import file would start with
4723    # the line `#! .'.  This would cause the generated library to
4724    # depend on `.', always an invalid library.  This was fixed in
4725    # development snapshots of GCC prior to 3.0.
4726    case $host_os in
4727      aix4 | aix4.[[01]] | aix4.[[01]].*)
4728      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
4729	   echo ' yes '
4730	   echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
4731	:
4732      else
4733	can_build_shared=no
4734      fi
4735      ;;
4736    esac
4737    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
4738    # soname into executable. Probably we can add versioning support to
4739    # collect2, so additional links can be useful in future.
4740    if test "$aix_use_runtimelinking" = yes; then
4741      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
4742      # instead of lib<name>.a to let people know that these are not
4743      # typical AIX shared libraries.
4744      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
4745    else
4746      # We preserve .a as extension for shared libraries through AIX4.2
4747      # and later when we are not doing run time linking.
4748      library_names_spec='${libname}${release}.a $libname.a'
4749      soname_spec='${libname}${release}${shared_ext}$major'
4750    fi
4751    shlibpath_var=LIBPATH
4752  fi
4753  ;;
4754
4755amigaos*)
4756  library_names_spec='$libname.ixlibrary $libname.a'
4757  # Create ${libname}_ixlibrary.a entries in /sys/libs.
4758  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'
4759  ;;
4760
4761beos*)
4762  library_names_spec='${libname}${shared_ext}'
4763  dynamic_linker="$host_os ld.so"
4764  shlibpath_var=LIBRARY_PATH
4765  ;;
4766
4767bsdi[[45]]*)
4768  version_type=linux
4769  need_version=no
4770  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
4771  soname_spec='${libname}${release}${shared_ext}$major'
4772  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
4773  shlibpath_var=LD_LIBRARY_PATH
4774  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
4775  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
4776  # the default ld.so.conf also contains /usr/contrib/lib and
4777  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
4778  # libtool to hard-code these into programs
4779  ;;
4780
4781cygwin* | mingw* | pw32*)
4782  version_type=windows
4783  shrext_cmds=".dll"
4784  need_version=no
4785  need_lib_prefix=no
4786
4787  case $GCC,$host_os in
4788  yes,cygwin* | yes,mingw* | yes,pw32*)
4789    library_names_spec='$libname.dll.a'
4790    # DLL is installed to $(libdir)/../bin by postinstall_cmds
4791    postinstall_cmds='base_file=`basename \${file}`~
4792      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~
4793      dldir=$destdir/`dirname \$dlpath`~
4794      test -d \$dldir || mkdir -p \$dldir~
4795      $install_prog $dir/$dlname \$dldir/$dlname~
4796      chmod a+x \$dldir/$dlname'
4797    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
4798      dlpath=$dir/\$dldll~
4799       $rm \$dlpath'
4800    shlibpath_overrides_runpath=yes
4801
4802    case $host_os in
4803    cygwin*)
4804      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
4805      soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
4806      sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
4807      ;;
4808    mingw*)
4809      # MinGW DLLs use traditional 'lib' prefix
4810      soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
4811      sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
4812      if echo "$sys_lib_search_path_spec" | [grep ';[c-zC-Z]:/' >/dev/null]; then
4813        # It is most probably a Windows format PATH printed by
4814        # mingw gcc, but we are running on Cygwin. Gcc prints its search
4815        # path with ; separators, and with drive letters. We can handle the
4816        # drive letters (cygwin fileutils understands them), so leave them,
4817        # especially as we might pass files found there to a mingw objdump,
4818        # which wouldn't understand a cygwinified path. Ahh.
4819        sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
4820      else
4821        sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
4822      fi
4823      ;;
4824    pw32*)
4825      # pw32 DLLs use 'pw' prefix rather than 'lib'
4826      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
4827      ;;
4828    esac
4829    ;;
4830
4831  *)
4832    library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
4833    ;;
4834  esac
4835  dynamic_linker='Win32 ld.exe'
4836  # FIXME: first we should search . and the directory the executable is in
4837  shlibpath_var=PATH
4838  ;;
4839
4840darwin* | rhapsody*)
4841  dynamic_linker="$host_os dyld"
4842  version_type=darwin
4843  need_lib_prefix=no
4844  need_version=no
4845  library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext'
4846  soname_spec='${libname}${release}${major}$shared_ext'
4847  shlibpath_overrides_runpath=yes
4848  shlibpath_var=DYLD_LIBRARY_PATH
4849  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
4850  ifelse([$1], [],[
4851  sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"])
4852  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
4853  ;;
4854
4855dgux*)
4856  version_type=linux
4857  need_lib_prefix=no
4858  need_version=no
4859  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
4860  soname_spec='${libname}${release}${shared_ext}$major'
4861  shlibpath_var=LD_LIBRARY_PATH
4862  ;;
4863
4864freebsd* | dragonfly*)
4865  # DragonFly does not have aout.  When/if they implement a new
4866  # versioning mechanism, adjust this.
4867  if test -x /usr/bin/objformat; then
4868    objformat=`/usr/bin/objformat`
4869  else
4870    case $host_os in
4871    freebsd[[123]].*) objformat=aout ;;
4872    *) objformat=elf ;;
4873    esac
4874  fi
4875  version_type=freebsd-$objformat
4876  case $version_type in
4877    freebsd-elf*)
4878      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
4879      need_version=no
4880      need_lib_prefix=no
4881      ;;
4882    freebsd-*)
4883      library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
4884      need_version=yes
4885      ;;
4886  esac
4887  shlibpath_var=LD_LIBRARY_PATH
4888  case $host_os in
4889  freebsd2*)
4890    shlibpath_overrides_runpath=yes
4891    ;;
4892  freebsd3.[[01]]* | freebsdelf3.[[01]]*)
4893    shlibpath_overrides_runpath=yes
4894    hardcode_into_libs=yes
4895    ;;
4896  freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \
4897  freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1)
4898    shlibpath_overrides_runpath=no
4899    hardcode_into_libs=yes
4900    ;;
4901  *) # from 4.6 on, and DragonFly
4902    shlibpath_overrides_runpath=yes
4903    hardcode_into_libs=yes
4904    ;;
4905  esac
4906  ;;
4907
4908gnu*)
4909  version_type=linux
4910  need_lib_prefix=no
4911  need_version=no
4912  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
4913  soname_spec='${libname}${release}${shared_ext}$major'
4914  shlibpath_var=LD_LIBRARY_PATH
4915  hardcode_into_libs=yes
4916  ;;
4917
4918hpux9* | hpux10* | hpux11*)
4919  # Give a soname corresponding to the major version so that dld.sl refuses to
4920  # link against other versions.
4921  version_type=sunos
4922  need_lib_prefix=no
4923  need_version=no
4924  case $host_cpu in
4925  ia64*)
4926    shrext_cmds='.so'
4927    hardcode_into_libs=yes
4928    dynamic_linker="$host_os dld.so"
4929    shlibpath_var=LD_LIBRARY_PATH
4930    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
4931    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
4932    soname_spec='${libname}${release}${shared_ext}$major'
4933    if test "X$HPUX_IA64_MODE" = X32; then
4934      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
4935    else
4936      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
4937    fi
4938    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
4939    ;;
4940   hppa*64*)
4941     shrext_cmds='.sl'
4942     hardcode_into_libs=yes
4943     dynamic_linker="$host_os dld.sl"
4944     shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
4945     shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
4946     library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
4947     soname_spec='${libname}${release}${shared_ext}$major'
4948     sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
4949     sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
4950     ;;
4951   *)
4952    shrext_cmds='.sl'
4953    dynamic_linker="$host_os dld.sl"
4954    shlibpath_var=SHLIB_PATH
4955    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
4956    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
4957    soname_spec='${libname}${release}${shared_ext}$major'
4958    ;;
4959  esac
4960  # HP-UX runs *really* slowly unless shared libraries are mode 555.
4961  postinstall_cmds='chmod 555 $lib'
4962  ;;
4963
4964interix[[3-9]]*)
4965  version_type=linux
4966  need_lib_prefix=no
4967  need_version=no
4968  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
4969  soname_spec='${libname}${release}${shared_ext}$major'
4970  dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
4971  shlibpath_var=LD_LIBRARY_PATH
4972  shlibpath_overrides_runpath=no
4973  hardcode_into_libs=yes
4974  ;;
4975
4976irix5* | irix6* | nonstopux*)
4977  case $host_os in
4978    nonstopux*) version_type=nonstopux ;;
4979    *)
4980	if test "$lt_cv_prog_gnu_ld" = yes; then
4981		version_type=linux
4982	else
4983		version_type=irix
4984	fi ;;
4985  esac
4986  need_lib_prefix=no
4987  need_version=no
4988  soname_spec='${libname}${release}${shared_ext}$major'
4989  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
4990  case $host_os in
4991  irix5* | nonstopux*)
4992    libsuff= shlibsuff=
4993    ;;
4994  *)
4995    case $LD in # libtool.m4 will add one of these switches to LD
4996    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
4997      libsuff= shlibsuff= libmagic=32-bit;;
4998    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
4999      libsuff=32 shlibsuff=N32 libmagic=N32;;
5000    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
5001      libsuff=64 shlibsuff=64 libmagic=64-bit;;
5002    *) libsuff= shlibsuff= libmagic=never-match;;
5003    esac
5004    ;;
5005  esac
5006  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
5007  shlibpath_overrides_runpath=no
5008  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
5009  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
5010  hardcode_into_libs=yes
5011  ;;
5012
5013# No shared lib support for Linux oldld, aout, or coff.
5014linux*oldld* | linux*aout* | linux*coff*)
5015  dynamic_linker=no
5016  ;;
5017
5018# This must be Linux ELF.
5019linux* | k*bsd*-gnu)
5020  version_type=linux
5021  need_lib_prefix=no
5022  need_version=no
5023  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
5024  soname_spec='${libname}${release}${shared_ext}$major'
5025  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
5026  shlibpath_var=LD_LIBRARY_PATH
5027  shlibpath_overrides_runpath=no
5028  # This implies no fast_install, which is unacceptable.
5029  # Some rework will be needed to allow for fast_install
5030  # before this can be enabled.
5031  hardcode_into_libs=yes
5032
5033  # Append ld.so.conf contents to the search path
5034  if test -f /etc/ld.so.conf; then
5035    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ 	]*hwcap[ 	]/d;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
5036    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
5037  fi
5038
5039  # We used to test for /lib/ld.so.1 and disable shared libraries on
5040  # powerpc, because MkLinux only supported shared libraries with the
5041  # GNU dynamic linker.  Since this was broken with cross compilers,
5042  # most powerpc-linux boxes support dynamic linking these days and
5043  # people can always --disable-shared, the test was removed, and we
5044  # assume the GNU/Linux dynamic linker is in use.
5045  dynamic_linker='GNU/Linux ld.so'
5046  ;;
5047
5048netbsd*)
5049  version_type=sunos
5050  need_lib_prefix=no
5051  need_version=no
5052  if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
5053    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
5054    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
5055    dynamic_linker='NetBSD (a.out) ld.so'
5056  else
5057    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
5058    soname_spec='${libname}${release}${shared_ext}$major'
5059    dynamic_linker='NetBSD ld.elf_so'
5060  fi
5061  shlibpath_var=LD_LIBRARY_PATH
5062  shlibpath_overrides_runpath=yes
5063  hardcode_into_libs=yes
5064  ;;
5065
5066newsos6)
5067  version_type=linux
5068  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
5069  shlibpath_var=LD_LIBRARY_PATH
5070  shlibpath_overrides_runpath=yes
5071  ;;
5072
5073nto-qnx*)
5074  version_type=linux
5075  need_lib_prefix=no
5076  need_version=no
5077  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
5078  soname_spec='${libname}${release}${shared_ext}$major'
5079  shlibpath_var=LD_LIBRARY_PATH
5080  shlibpath_overrides_runpath=yes
5081  ;;
5082
5083openbsd*)
5084  version_type=sunos
5085  sys_lib_dlsearch_path_spec="/usr/lib"
5086  need_lib_prefix=no
5087  # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
5088  case $host_os in
5089    openbsd3.3 | openbsd3.3.*) need_version=yes ;;
5090    *)                         need_version=no  ;;
5091  esac
5092  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
5093  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
5094  shlibpath_var=LD_LIBRARY_PATH
5095  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
5096    case $host_os in
5097      openbsd2.[[89]] | openbsd2.[[89]].*)
5098	shlibpath_overrides_runpath=no
5099	;;
5100      *)
5101	shlibpath_overrides_runpath=yes
5102	;;
5103      esac
5104  else
5105    shlibpath_overrides_runpath=yes
5106  fi
5107  ;;
5108
5109os2*)
5110  libname_spec='$name'
5111  shrext_cmds=".dll"
5112  need_lib_prefix=no
5113  library_names_spec='$libname${shared_ext} $libname.a'
5114  dynamic_linker='OS/2 ld.exe'
5115  shlibpath_var=LIBPATH
5116  ;;
5117
5118osf3* | osf4* | osf5*)
5119  version_type=osf
5120  need_lib_prefix=no
5121  need_version=no
5122  soname_spec='${libname}${release}${shared_ext}$major'
5123  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
5124  shlibpath_var=LD_LIBRARY_PATH
5125  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
5126  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
5127  ;;
5128
5129rdos*)
5130  dynamic_linker=no
5131  ;;
5132
5133solaris*)
5134  version_type=linux
5135  need_lib_prefix=no
5136  need_version=no
5137  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
5138  soname_spec='${libname}${release}${shared_ext}$major'
5139  shlibpath_var=LD_LIBRARY_PATH
5140  shlibpath_overrides_runpath=yes
5141  hardcode_into_libs=yes
5142  # ldd complains unless libraries are executable
5143  postinstall_cmds='chmod +x $lib'
5144  ;;
5145
5146sunos4*)
5147  version_type=sunos
5148  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
5149  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
5150  shlibpath_var=LD_LIBRARY_PATH
5151  shlibpath_overrides_runpath=yes
5152  if test "$with_gnu_ld" = yes; then
5153    need_lib_prefix=no
5154  fi
5155  need_version=yes
5156  ;;
5157
5158sysv4 | sysv4.3*)
5159  version_type=linux
5160  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
5161  soname_spec='${libname}${release}${shared_ext}$major'
5162  shlibpath_var=LD_LIBRARY_PATH
5163  case $host_vendor in
5164    sni)
5165      shlibpath_overrides_runpath=no
5166      need_lib_prefix=no
5167      export_dynamic_flag_spec='${wl}-Blargedynsym'
5168      runpath_var=LD_RUN_PATH
5169      ;;
5170    siemens)
5171      need_lib_prefix=no
5172      ;;
5173    motorola)
5174      need_lib_prefix=no
5175      need_version=no
5176      shlibpath_overrides_runpath=no
5177      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
5178      ;;
5179  esac
5180  ;;
5181
5182sysv4*MP*)
5183  if test -d /usr/nec ;then
5184    version_type=linux
5185    library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
5186    soname_spec='$libname${shared_ext}.$major'
5187    shlibpath_var=LD_LIBRARY_PATH
5188  fi
5189  ;;
5190
5191sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
5192  version_type=freebsd-elf
5193  need_lib_prefix=no
5194  need_version=no
5195  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
5196  soname_spec='${libname}${release}${shared_ext}$major'
5197  shlibpath_var=LD_LIBRARY_PATH
5198  hardcode_into_libs=yes
5199  if test "$with_gnu_ld" = yes; then
5200    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
5201    shlibpath_overrides_runpath=no
5202  else
5203    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
5204    shlibpath_overrides_runpath=yes
5205    case $host_os in
5206      sco3.2v5*)
5207        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
5208	;;
5209    esac
5210  fi
5211  sys_lib_dlsearch_path_spec='/usr/lib'
5212  ;;
5213
5214uts4*)
5215  version_type=linux
5216  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
5217  soname_spec='${libname}${release}${shared_ext}$major'
5218  shlibpath_var=LD_LIBRARY_PATH
5219  ;;
5220
5221*)
5222  dynamic_linker=no
5223  ;;
5224esac
5225AC_MSG_RESULT([$dynamic_linker])
5226test "$dynamic_linker" = no && can_build_shared=no
5227
5228AC_CACHE_VAL([lt_cv_sys_lib_search_path_spec],
5229[lt_cv_sys_lib_search_path_spec="$sys_lib_search_path_spec"])
5230sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
5231AC_CACHE_VAL([lt_cv_sys_lib_dlsearch_path_spec],
5232[lt_cv_sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec"])
5233sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
5234
5235variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
5236if test "$GCC" = yes; then
5237  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
5238fi
5239])# AC_LIBTOOL_SYS_DYNAMIC_LINKER
5240
5241
5242# _LT_AC_TAGCONFIG
5243# ----------------
5244AC_DEFUN([_LT_AC_TAGCONFIG],
5245[AC_REQUIRE([LT_AC_PROG_SED])dnl
5246AC_ARG_WITH([tags],
5247[  --with-tags[=TAGS]        Include additional configurations [automatic]
5248],
5249[tagnames="$withval"])
5250
5251if test -f "$ltmain" && test -n "$tagnames"; then
5252  if test ! -f "${ofile}"; then
5253    AC_MSG_WARN([output file \`$ofile' does not exist])
5254  fi
5255
5256  if test -z "$LTCC"; then
5257    eval "`$SHELL ${ofile} --config | grep '^LTCC='`"
5258    if test -z "$LTCC"; then
5259      AC_MSG_WARN([output file \`$ofile' does not look like a libtool script])
5260    else
5261      AC_MSG_WARN([using \`LTCC=$LTCC', extracted from \`$ofile'])
5262    fi
5263  fi
5264  if test -z "$LTCFLAGS"; then
5265    eval "`$SHELL ${ofile} --config | grep '^LTCFLAGS='`"
5266  fi
5267
5268  # Extract list of available tagged configurations in $ofile.
5269  # Note that this assumes the entire list is on one line.
5270  available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'`
5271
5272  lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
5273  for tagname in $tagnames; do
5274    IFS="$lt_save_ifs"
5275    # Check whether tagname contains only valid characters
5276    case `$echo "X$tagname" | $Xsed -e 's:[[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]]::g'` in
5277    "") ;;
5278    *)  AC_MSG_ERROR([invalid tag name: $tagname])
5279	;;
5280    esac
5281
5282    if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null
5283    then
5284      AC_MSG_ERROR([tag name \"$tagname\" already exists])
5285    fi
5286
5287    # Update the list of available tags.
5288    if test -n "$tagname"; then
5289      echo appending configuration tag \"$tagname\" to $ofile
5290
5291      case $tagname in
5292      CXX)
5293	if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
5294	    ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
5295	    (test "X$CXX" != "Xg++"))) ; then
5296	  AC_LIBTOOL_LANG_CXX_CONFIG
5297	else
5298	  tagname=""
5299	fi
5300	;;
5301
5302      *)
5303	AC_MSG_ERROR([Unsupported tag name: $tagname])
5304	;;
5305      esac
5306
5307      # Append the new tag name to the list of available tags.
5308      if test -n "$tagname" ; then
5309      available_tags="$available_tags $tagname"
5310    fi
5311    fi
5312  done
5313  IFS="$lt_save_ifs"
5314
5315  # Now substitute the updated list of available tags.
5316  if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then
5317    mv "${ofile}T" "$ofile"
5318    chmod +x "$ofile"
5319  else
5320    rm -f "${ofile}T"
5321    AC_MSG_ERROR([unable to update list of available tagged configurations.])
5322  fi
5323fi
5324])# _LT_AC_TAGCONFIG
5325
5326
5327# AC_LIBTOOL_DLOPEN
5328# -----------------
5329# enable checks for dlopen support
5330AC_DEFUN([AC_LIBTOOL_DLOPEN],
5331 [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])
5332])# AC_LIBTOOL_DLOPEN
5333
5334
5335# AC_LIBTOOL_WIN32_DLL
5336# --------------------
5337# declare package support for building win32 DLLs
5338AC_DEFUN([AC_LIBTOOL_WIN32_DLL],
5339[AC_BEFORE([$0], [AC_LIBTOOL_SETUP])
5340])# AC_LIBTOOL_WIN32_DLL
5341
5342
5343# AC_ENABLE_SHARED([DEFAULT])
5344# ---------------------------
5345# implement the --enable-shared flag
5346# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
5347AC_DEFUN([AC_ENABLE_SHARED],
5348[define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
5349AC_ARG_ENABLE([shared],
5350changequote(<<, >>)dnl
5351<<  --enable-shared[=PKGS]    Build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT],
5352changequote([, ])dnl
5353    [p=${PACKAGE-default}
5354    case $enableval in
5355    yes) enable_shared=yes ;;
5356    no) enable_shared=no ;;
5357    *)
5358      enable_shared=no
5359      # Look at the argument we got.  We use all the common list separators.
5360      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
5361      for pkg in $enableval; do
5362	IFS="$lt_save_ifs"
5363	if test "X$pkg" = "X$p"; then
5364	  enable_shared=yes
5365	fi
5366      done
5367      IFS="$lt_save_ifs"
5368      ;;
5369    esac],
5370    [enable_shared=]AC_ENABLE_SHARED_DEFAULT)
5371])# AC_ENABLE_SHARED
5372
5373
5374# AC_DISABLE_SHARED
5375# -----------------
5376# set the default shared flag to --disable-shared
5377AC_DEFUN([AC_DISABLE_SHARED],
5378[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
5379AC_ENABLE_SHARED(no)
5380])# AC_DISABLE_SHARED
5381
5382
5383# AC_ENABLE_STATIC([DEFAULT])
5384# ---------------------------
5385# implement the --enable-static flag
5386# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
5387AC_DEFUN([AC_ENABLE_STATIC],
5388[define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
5389AC_ARG_ENABLE([static],
5390changequote(<<, >>)dnl
5391<<  --enable-static[=PKGS]    Build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT],
5392changequote([, ])dnl
5393    [p=${PACKAGE-default}
5394    case $enableval in
5395    yes) enable_static=yes ;;
5396    no) enable_static=no ;;
5397    *)
5398     enable_static=no
5399      # Look at the argument we got.  We use all the common list separators.
5400      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
5401      for pkg in $enableval; do
5402	IFS="$lt_save_ifs"
5403	if test "X$pkg" = "X$p"; then
5404	  enable_static=yes
5405	fi
5406      done
5407      IFS="$lt_save_ifs"
5408      ;;
5409    esac],
5410    [enable_static=]AC_ENABLE_STATIC_DEFAULT)
5411])# AC_ENABLE_STATIC
5412
5413
5414# AC_DISABLE_STATIC
5415# -----------------
5416# set the default static flag to --disable-static
5417AC_DEFUN([AC_DISABLE_STATIC],
5418[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
5419AC_ENABLE_STATIC(no)
5420])# AC_DISABLE_STATIC
5421
5422
5423# AC_ENABLE_FAST_INSTALL([DEFAULT])
5424# ---------------------------------
5425# implement the --enable-fast-install flag
5426# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
5427AC_DEFUN([AC_ENABLE_FAST_INSTALL],
5428[define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
5429AC_ARG_ENABLE([fast-install],
5430changequote(<<, >>)dnl
5431<<  --enable-fast-install[=PKGS]
5432                          Optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT],
5433changequote([, ])dnl
5434    [p=${PACKAGE-default}
5435    case $enableval in
5436    yes) enable_fast_install=yes ;;
5437    no) enable_fast_install=no ;;
5438    *)
5439      enable_fast_install=no
5440      # Look at the argument we got.  We use all the common list separators.
5441      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
5442      for pkg in $enableval; do
5443	IFS="$lt_save_ifs"
5444	if test "X$pkg" = "X$p"; then
5445	  enable_fast_install=yes
5446	fi
5447      done
5448      IFS="$lt_save_ifs"
5449      ;;
5450    esac],
5451    [enable_fast_install=]AC_ENABLE_FAST_INSTALL_DEFAULT)
5452])# AC_ENABLE_FAST_INSTALL
5453
5454
5455# AC_DISABLE_FAST_INSTALL
5456# -----------------------
5457# set the default to --disable-fast-install
5458AC_DEFUN([AC_DISABLE_FAST_INSTALL],
5459[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
5460AC_ENABLE_FAST_INSTALL(no)
5461])# AC_DISABLE_FAST_INSTALL
5462
5463
5464# AC_LIBTOOL_PICMODE([MODE])
5465# --------------------------
5466# implement the --with-pic flag
5467# MODE is either `yes' or `no'.  If omitted, it defaults to `both'.
5468AC_DEFUN([AC_LIBTOOL_PICMODE],
5469[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
5470pic_mode=ifelse($#,1,$1,default)
5471])# AC_LIBTOOL_PICMODE
5472
5473
5474# AC_PROG_EGREP
5475# -------------
5476ifdef([AC_PROG_EGREP], [], [AC_DEFUN([AC_PROG_EGREP],
5477[AC_CACHE_CHECK([for egrep], [ac_cv_prog_egrep],
5478   [if echo a | (grep -E '(a|b)') >/dev/null 2>&1
5479    then ac_cv_prog_egrep='grep -E'
5480    else ac_cv_prog_egrep='egrep'
5481    fi])
5482 EGREP=$ac_cv_prog_egrep
5483 AC_SUBST([EGREP])
5484])])
5485
5486
5487# AC_PATH_TOOL_PREFIX
5488# -------------------
5489# find a file program which can recognize shared library
5490AC_DEFUN([AC_PATH_TOOL_PREFIX],
5491[AC_REQUIRE([AC_PROG_EGREP])dnl
5492AC_MSG_CHECKING([for $1])
5493AC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
5494[case $MAGIC_CMD in
5495[[\\/*] |  ?:[\\/]*])
5496  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
5497  ;;
5498*)
5499  lt_save_MAGIC_CMD="$MAGIC_CMD"
5500  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
5501dnl $ac_dummy forces splitting on constant user-supplied paths.
5502dnl POSIX.2 word splitting is done only on the output of word expansions,
5503dnl not every word.  This closes a longstanding sh security hole.
5504  ac_dummy="ifelse([$2], , $PATH, [$2])"
5505  for ac_dir in $ac_dummy; do
5506    IFS="$lt_save_ifs"
5507    test -z "$ac_dir" && ac_dir=.
5508    if test -f $ac_dir/$1; then
5509      lt_cv_path_MAGIC_CMD="$ac_dir/$1"
5510      if test -n "$file_magic_test_file"; then
5511	case $deplibs_check_method in
5512	"file_magic "*)
5513	  file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
5514	  MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
5515	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
5516	    $EGREP "$file_magic_regex" > /dev/null; then
5517	    :
5518	  else
5519	    cat <<EOF 1>&2
5520
5521*** Warning: the command libtool uses to detect shared libraries,
5522*** $file_magic_cmd, produces output that libtool cannot recognize.
5523*** The result is that libtool may fail to recognize shared libraries
5524*** as such.  This will affect the creation of libtool libraries that
5525*** depend on shared libraries, but programs linked with such libtool
5526*** libraries will work regardless of this problem.  Nevertheless, you
5527*** may want to report the problem to your system manager and/or to
5528*** bug-libtool@gnu.org
5529
5530EOF
5531	  fi ;;
5532	esac
5533      fi
5534      break
5535    fi
5536  done
5537  IFS="$lt_save_ifs"
5538  MAGIC_CMD="$lt_save_MAGIC_CMD"
5539  ;;
5540esac])
5541MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
5542if test -n "$MAGIC_CMD"; then
5543  AC_MSG_RESULT($MAGIC_CMD)
5544else
5545  AC_MSG_RESULT(no)
5546fi
5547])# AC_PATH_TOOL_PREFIX
5548
5549
5550# AC_PATH_MAGIC
5551# -------------
5552# find a file program which can recognize a shared library
5553AC_DEFUN([AC_PATH_MAGIC],
5554[AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
5555if test -z "$lt_cv_path_MAGIC_CMD"; then
5556  if test -n "$ac_tool_prefix"; then
5557    AC_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
5558  else
5559    MAGIC_CMD=:
5560  fi
5561fi
5562])# AC_PATH_MAGIC
5563
5564
5565# AC_PROG_LD
5566# ----------
5567# find the pathname to the GNU or non-GNU linker
5568AC_DEFUN([AC_PROG_LD],
5569[AC_ARG_WITH([gnu-ld],
5570[  --with-gnu-ld           Assume the C compiler uses GNU ld [default=no]],
5571    [test "$withval" = no || with_gnu_ld=yes],
5572    [with_gnu_ld=no])
5573AC_REQUIRE([LT_AC_PROG_SED])dnl
5574AC_REQUIRE([AC_PROG_CC])dnl
5575AC_REQUIRE([AC_CANONICAL_HOST])dnl
5576AC_REQUIRE([AC_CANONICAL_BUILD])dnl
5577ac_prog=ld
5578if test "$GCC" = yes; then
5579  # Check if gcc -print-prog-name=ld gives a path.
5580  AC_MSG_CHECKING([for ld used by $CC])
5581  case $host in
5582  *-*-mingw*)
5583    # gcc leaves a trailing carriage return which upsets mingw
5584    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
5585  *)
5586    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
5587  esac
5588  case $ac_prog in
5589    # Accept absolute paths.
5590    [[\\/]]* | ?:[[\\/]]*)
5591      re_direlt='/[[^/]][[^/]]*/\.\./'
5592      # Canonicalize the pathname of ld
5593      ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'`
5594      while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
5595	ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"`
5596      done
5597      test -z "$LD" && LD="$ac_prog"
5598      ;;
5599  "")
5600    # If it fails, then pretend we aren't using GCC.
5601    ac_prog=ld
5602    ;;
5603  *)
5604    # If it is relative, then search for the first ld in PATH.
5605    with_gnu_ld=unknown
5606    ;;
5607  esac
5608elif test "$with_gnu_ld" = yes; then
5609  AC_MSG_CHECKING([for GNU ld])
5610else
5611  AC_MSG_CHECKING([for non-GNU ld])
5612fi
5613AC_CACHE_VAL(lt_cv_path_LD,
5614[if test -z "$LD"; then
5615  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
5616  for ac_dir in $PATH; do
5617    IFS="$lt_save_ifs"
5618    test -z "$ac_dir" && ac_dir=.
5619    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
5620      lt_cv_path_LD="$ac_dir/$ac_prog"
5621      # Check to see if the program is GNU ld.  I'd rather use --version,
5622      # but apparently some variants of GNU ld only accept -v.
5623      # Break only if it was the GNU/non-GNU ld that we prefer.
5624      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
5625      *GNU* | *'with BFD'*)
5626	test "$with_gnu_ld" != no && break
5627	;;
5628      *)
5629	test "$with_gnu_ld" != yes && break
5630	;;
5631      esac
5632    fi
5633  done
5634  IFS="$lt_save_ifs"
5635else
5636  lt_cv_path_LD="$LD" # Let the user override the test with a path.
5637fi])
5638LD="$lt_cv_path_LD"
5639if test -n "$LD"; then
5640  AC_MSG_RESULT($LD)
5641else
5642  AC_MSG_RESULT(no)
5643fi
5644test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
5645AC_PROG_LD_GNU
5646])# AC_PROG_LD
5647
5648
5649# AC_PROG_LD_GNU
5650# --------------
5651AC_DEFUN([AC_PROG_LD_GNU],
5652[AC_REQUIRE([AC_PROG_EGREP])dnl
5653AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
5654[# I'd rather use --version here, but apparently some GNU lds only accept -v.
5655case `$LD -v 2>&1 </dev/null` in
5656*GNU* | *'with BFD'*)
5657  lt_cv_prog_gnu_ld=yes
5658  ;;
5659*)
5660  lt_cv_prog_gnu_ld=no
5661  ;;
5662esac])
5663with_gnu_ld=$lt_cv_prog_gnu_ld
5664])# AC_PROG_LD_GNU
5665
5666
5667# AC_PROG_LD_RELOAD_FLAG
5668# ----------------------
5669# find reload flag for linker
5670#   -- PORTME Some linkers may need a different reload flag.
5671AC_DEFUN([AC_PROG_LD_RELOAD_FLAG],
5672[AC_CACHE_CHECK([for $LD option to reload object files],
5673  lt_cv_ld_reload_flag,
5674  [lt_cv_ld_reload_flag='-r'])
5675reload_flag=$lt_cv_ld_reload_flag
5676case $reload_flag in
5677"" | " "*) ;;
5678*) reload_flag=" $reload_flag" ;;
5679esac
5680reload_cmds='$LD$reload_flag -o $output$reload_objs'
5681case $host_os in
5682  darwin*)
5683    if test "$GCC" = yes; then
5684      reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
5685    else
5686      reload_cmds='$LD$reload_flag -o $output$reload_objs'
5687    fi
5688    ;;
5689esac
5690])# AC_PROG_LD_RELOAD_FLAG
5691
5692
5693# AC_DEPLIBS_CHECK_METHOD
5694# -----------------------
5695# how to check for library dependencies
5696#  -- PORTME fill in with the dynamic library characteristics
5697AC_DEFUN([AC_DEPLIBS_CHECK_METHOD],
5698[AC_CACHE_CHECK([how to recognize dependent libraries],
5699lt_cv_deplibs_check_method,
5700[lt_cv_file_magic_cmd='$MAGIC_CMD'
5701lt_cv_file_magic_test_file=
5702lt_cv_deplibs_check_method='unknown'
5703# Need to set the preceding variable on all platforms that support
5704# interlibrary dependencies.
5705# 'none' -- dependencies not supported.
5706# `unknown' -- same as none, but documents that we really don't know.
5707# 'pass_all' -- all dependencies passed with no checks.
5708# 'test_compile' -- check by making test program.
5709# 'file_magic [[regex]]' -- check by looking for files in library path
5710# which responds to the $file_magic_cmd with a given extended regex.
5711# If you have `file' or equivalent on your system and you're not sure
5712# whether `pass_all' will *always* work, you probably want this one.
5713
5714case $host_os in
5715aix[[4-9]]*)
5716  lt_cv_deplibs_check_method=pass_all
5717  ;;
5718
5719beos*)
5720  lt_cv_deplibs_check_method=pass_all
5721  ;;
5722
5723bsdi[[45]]*)
5724  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
5725  lt_cv_file_magic_cmd='/usr/bin/file -L'
5726  lt_cv_file_magic_test_file=/shlib/libc.so
5727  ;;
5728
5729cygwin*)
5730  # func_win32_libid is a shell function defined in ltmain.sh
5731  lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
5732  lt_cv_file_magic_cmd='func_win32_libid'
5733  ;;
5734
5735mingw* | pw32*)
5736  # Base MSYS/MinGW do not provide the 'file' command needed by
5737  # func_win32_libid shell function, so use a weaker test based on 'objdump',
5738  # unless we find 'file', for example because we are cross-compiling.
5739  if ( file / ) >/dev/null 2>&1; then
5740    lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
5741    lt_cv_file_magic_cmd='func_win32_libid'
5742  else
5743    lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
5744    lt_cv_file_magic_cmd='$OBJDUMP -f'
5745  fi
5746  ;;
5747
5748darwin* | rhapsody*)
5749  lt_cv_deplibs_check_method=pass_all
5750  ;;
5751
5752freebsd* | dragonfly*)
5753  if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
5754    case $host_cpu in
5755    i*86 )
5756      # Not sure whether the presence of OpenBSD here was a mistake.
5757      # Let's accept both of them until this is cleared up.
5758      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
5759      lt_cv_file_magic_cmd=/usr/bin/file
5760      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
5761      ;;
5762    esac
5763  else
5764    lt_cv_deplibs_check_method=pass_all
5765  fi
5766  ;;
5767
5768gnu*)
5769  lt_cv_deplibs_check_method=pass_all
5770  ;;
5771
5772hpux10.20* | hpux11*)
5773  lt_cv_file_magic_cmd=/usr/bin/file
5774  case $host_cpu in
5775  ia64*)
5776    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
5777    lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
5778    ;;
5779  hppa*64*)
5780    [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]']
5781    lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
5782    ;;
5783  *)
5784    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library'
5785    lt_cv_file_magic_test_file=/usr/lib/libc.sl
5786    ;;
5787  esac
5788  ;;
5789
5790interix[[3-9]]*)
5791  # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
5792  lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$'
5793  ;;
5794
5795irix5* | irix6* | nonstopux*)
5796  case $LD in
5797  *-32|*"-32 ") libmagic=32-bit;;
5798  *-n32|*"-n32 ") libmagic=N32;;
5799  *-64|*"-64 ") libmagic=64-bit;;
5800  *) libmagic=never-match;;
5801  esac
5802  lt_cv_deplibs_check_method=pass_all
5803  ;;
5804
5805# This must be Linux ELF.
5806linux* | k*bsd*-gnu)
5807  lt_cv_deplibs_check_method=pass_all
5808  ;;
5809
5810netbsd*)
5811  if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
5812    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
5813  else
5814    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
5815  fi
5816  ;;
5817
5818newos6*)
5819  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
5820  lt_cv_file_magic_cmd=/usr/bin/file
5821  lt_cv_file_magic_test_file=/usr/lib/libnls.so
5822  ;;
5823
5824nto-qnx*)
5825  lt_cv_deplibs_check_method=unknown
5826  ;;
5827
5828openbsd*)
5829  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
5830    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
5831  else
5832    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
5833  fi
5834  ;;
5835
5836osf3* | osf4* | osf5*)
5837  lt_cv_deplibs_check_method=pass_all
5838  ;;
5839
5840rdos*)
5841  lt_cv_deplibs_check_method=pass_all
5842  ;;
5843
5844solaris*)
5845  lt_cv_deplibs_check_method=pass_all
5846  ;;
5847
5848sysv4 | sysv4.3*)
5849  case $host_vendor in
5850  motorola)
5851    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]]'
5852    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
5853    ;;
5854  ncr)
5855    lt_cv_deplibs_check_method=pass_all
5856    ;;
5857  sequent)
5858    lt_cv_file_magic_cmd='/bin/file'
5859    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
5860    ;;
5861  sni)
5862    lt_cv_file_magic_cmd='/bin/file'
5863    lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
5864    lt_cv_file_magic_test_file=/lib/libc.so
5865    ;;
5866  siemens)
5867    lt_cv_deplibs_check_method=pass_all
5868    ;;
5869  pc)
5870    lt_cv_deplibs_check_method=pass_all
5871    ;;
5872  esac
5873  ;;
5874
5875sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
5876  lt_cv_deplibs_check_method=pass_all
5877  ;;
5878esac
5879])
5880file_magic_cmd=$lt_cv_file_magic_cmd
5881deplibs_check_method=$lt_cv_deplibs_check_method
5882test -z "$deplibs_check_method" && deplibs_check_method=unknown
5883])# AC_DEPLIBS_CHECK_METHOD
5884
5885
5886# AC_PROG_NM
5887# ----------
5888# find the pathname to a BSD-compatible name lister
5889AC_DEFUN([AC_PROG_NM],
5890[AC_CACHE_CHECK([for BSD-compatible nm], lt_cv_path_NM,
5891[if test -n "$NM"; then
5892  # Let the user override the test.
5893  lt_cv_path_NM="$NM"
5894else
5895  lt_nm_to_check="${ac_tool_prefix}nm"
5896  if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
5897    lt_nm_to_check="$lt_nm_to_check nm"
5898  fi
5899  for lt_tmp_nm in $lt_nm_to_check; do
5900    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
5901    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
5902      IFS="$lt_save_ifs"
5903      test -z "$ac_dir" && ac_dir=.
5904      tmp_nm="$ac_dir/$lt_tmp_nm"
5905      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
5906	# Check to see if the nm accepts a BSD-compat flag.
5907	# Adding the `sed 1q' prevents false positives on HP-UX, which says:
5908	#   nm: unknown option "B" ignored
5909	# Tru64's nm complains that /dev/null is an invalid object file
5910	case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
5911	*/dev/null* | *'Invalid file or object type'*)
5912	  lt_cv_path_NM="$tmp_nm -B"
5913	  break
5914	  ;;
5915	*)
5916	  case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
5917	  */dev/null*)
5918	    lt_cv_path_NM="$tmp_nm -p"
5919	    break
5920	    ;;
5921	  *)
5922	    lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
5923	    continue # so that we can try to find one that supports BSD flags
5924	    ;;
5925	  esac
5926	  ;;
5927	esac
5928      fi
5929    done
5930    IFS="$lt_save_ifs"
5931  done
5932  test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm
5933fi])
5934NM="$lt_cv_path_NM"
5935])# AC_PROG_NM
5936
5937
5938# AC_CHECK_LIBM
5939# -------------
5940# check for math library
5941AC_DEFUN([AC_CHECK_LIBM],
5942[AC_REQUIRE([AC_CANONICAL_HOST])dnl
5943LIBM=
5944case $host in
5945*-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*)
5946  # These system don't have libm, or don't need it
5947  ;;
5948*-ncr-sysv4.3*)
5949  AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
5950  AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
5951  ;;
5952*)
5953  AC_CHECK_LIB(m, cos, LIBM="-lm")
5954  ;;
5955esac
5956])# AC_CHECK_LIBM
5957
5958
5959# AC_LIBLTDL_CONVENIENCE([DIRECTORY])
5960# -----------------------------------
5961# sets LIBLTDL to the link flags for the libltdl convenience library and
5962# LTDLINCL to the include flags for the libltdl header and adds
5963# --enable-ltdl-convenience to the configure arguments.  Note that
5964# AC_CONFIG_SUBDIRS is not called here.  If DIRECTORY is not provided,
5965# it is assumed to be `libltdl'.  LIBLTDL will be prefixed with
5966# '${top_builddir}/' and LTDLINCL will be prefixed with '${top_srcdir}/'
5967# (note the single quotes!).  If your package is not flat and you're not
5968# using automake, define top_builddir and top_srcdir appropriately in
5969# the Makefiles.
5970AC_DEFUN([AC_LIBLTDL_CONVENIENCE],
5971[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
5972  case $enable_ltdl_convenience in
5973  no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
5974  "") enable_ltdl_convenience=yes
5975      ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
5976  esac
5977  LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la
5978  LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
5979  # For backwards non-gettext consistent compatibility...
5980  INCLTDL="$LTDLINCL"
5981])# AC_LIBLTDL_CONVENIENCE
5982
5983
5984# AC_LIBLTDL_INSTALLABLE([DIRECTORY])
5985# -----------------------------------
5986# sets LIBLTDL to the link flags for the libltdl installable library and
5987# LTDLINCL to the include flags for the libltdl header and adds
5988# --enable-ltdl-install to the configure arguments.  Note that
5989# AC_CONFIG_SUBDIRS is not called here.  If DIRECTORY is not provided,
5990# and an installed libltdl is not found, it is assumed to be `libltdl'.
5991# LIBLTDL will be prefixed with '${top_builddir}/'# and LTDLINCL with
5992# '${top_srcdir}/' (note the single quotes!).  If your package is not
5993# flat and you're not using automake, define top_builddir and top_srcdir
5994# appropriately in the Makefiles.
5995# In the future, this macro may have to be called after AC_PROG_LIBTOOL.
5996AC_DEFUN([AC_LIBLTDL_INSTALLABLE],
5997[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
5998  AC_CHECK_LIB(ltdl, lt_dlinit,
5999  [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
6000  [if test x"$enable_ltdl_install" = xno; then
6001     AC_MSG_WARN([libltdl not installed, but installation disabled])
6002   else
6003     enable_ltdl_install=yes
6004   fi
6005  ])
6006  if test x"$enable_ltdl_install" = x"yes"; then
6007    ac_configure_args="$ac_configure_args --enable-ltdl-install"
6008    LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la
6009    LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
6010  else
6011    ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
6012    LIBLTDL="-lltdl"
6013    LTDLINCL=
6014  fi
6015  # For backwards non-gettext consistent compatibility...
6016  INCLTDL="$LTDLINCL"
6017])# AC_LIBLTDL_INSTALLABLE
6018
6019
6020# AC_LIBTOOL_CXX
6021# --------------
6022# enable support for C++ libraries
6023AC_DEFUN([AC_LIBTOOL_CXX],
6024[AC_REQUIRE([_LT_AC_LANG_CXX])
6025])# AC_LIBTOOL_CXX
6026
6027
6028# _LT_AC_LANG_CXX
6029# ---------------
6030AC_DEFUN([_LT_AC_LANG_CXX],
6031[AC_REQUIRE([AC_PROG_CXX])
6032AC_REQUIRE([_LT_AC_PROG_CXXCPP])
6033_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}CXX])
6034])# _LT_AC_LANG_CXX
6035
6036# _LT_AC_PROG_CXXCPP
6037# ------------------
6038AC_DEFUN([_LT_AC_PROG_CXXCPP],
6039[
6040AC_REQUIRE([AC_PROG_CXX])
6041if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
6042    ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
6043    (test "X$CXX" != "Xg++"))) ; then
6044  AC_PROG_CXXCPP
6045fi
6046])# _LT_AC_PROG_CXXCPP
6047
6048# AC_LIBTOOL_LANG_C_CONFIG
6049# ------------------------
6050# Ensure that the configuration vars for the C compiler are
6051# suitably defined.  Those variables are subsequently used by
6052# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
6053AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG], [_LT_AC_LANG_C_CONFIG])
6054AC_DEFUN([_LT_AC_LANG_C_CONFIG],
6055[lt_save_CC="$CC"
6056AC_LANG_SAVE
6057AC_LANG_C
6058
6059# Source file extension for C test sources.
6060ac_ext=c
6061
6062# Object file extension for compiled C test sources.
6063objext=o
6064_LT_AC_TAGVAR(objext, $1)=$objext
6065
6066# Code to be used in simple compile tests
6067lt_simple_compile_test_code="int some_variable = 0;"
6068
6069# Code to be used in simple link tests
6070lt_simple_link_test_code='int main(){return(0);}'
6071
6072_LT_AC_SYS_COMPILER
6073
6074# save warnings/boilerplate of simple test code
6075_LT_COMPILER_BOILERPLATE
6076_LT_LINKER_BOILERPLATE
6077
6078## CAVEAT EMPTOR:
6079## There is no encapsulation within the following macros, do not change
6080## the running order or otherwise move them around unless you know exactly
6081## what you are doing...
6082AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1)
6083AC_LIBTOOL_PROG_COMPILER_PIC($1)
6084AC_LIBTOOL_PROG_CC_C_O($1)
6085AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
6086AC_LIBTOOL_PROG_LD_SHLIBS($1)
6087AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
6088AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
6089AC_LIBTOOL_SYS_LIB_STRIP
6090AC_LIBTOOL_DLOPEN_SELF
6091
6092# Report which library types will actually be built
6093AC_MSG_CHECKING([if libtool supports shared libraries])
6094AC_MSG_RESULT([$can_build_shared])
6095
6096AC_MSG_CHECKING([whether to build shared libraries])
6097test "$can_build_shared" = "no" && enable_shared=no
6098
6099# On AIX, shared libraries and static libraries use the same namespace, and
6100# are all built from PIC.
6101case $host_os in
6102aix3*)
6103  test "$enable_shared" = yes && enable_static=no
6104  if test -n "$RANLIB"; then
6105    archive_cmds="$archive_cmds~\$RANLIB \$lib"
6106    postinstall_cmds='$RANLIB $lib'
6107  fi
6108  ;;
6109
6110aix[[4-9]]*)
6111  if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
6112    test "$enable_shared" = yes && enable_static=no
6113  fi
6114    ;;
6115esac
6116AC_MSG_RESULT([$enable_shared])
6117
6118AC_MSG_CHECKING([whether to build static libraries])
6119# Make sure either enable_shared or enable_static is yes.
6120test "$enable_shared" = yes || enable_static=yes
6121AC_MSG_RESULT([$enable_static])
6122
6123AC_LIBTOOL_CONFIG($1)
6124
6125AC_LANG_RESTORE
6126CC="$lt_save_CC"
6127])# AC_LIBTOOL_LANG_C_CONFIG
6128
6129
6130# AC_LIBTOOL_LANG_CXX_CONFIG
6131# --------------------------
6132# Ensure that the configuration vars for the C compiler are
6133# suitably defined.  Those variables are subsequently used by
6134# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
6135AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG], [_LT_AC_LANG_CXX_CONFIG(CXX)])
6136AC_DEFUN([_LT_AC_LANG_CXX_CONFIG],
6137[AC_LANG_SAVE
6138AC_LANG_CPLUSPLUS
6139AC_REQUIRE([AC_PROG_CXX])
6140AC_REQUIRE([_LT_AC_PROG_CXXCPP])
6141
6142_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
6143_LT_AC_TAGVAR(allow_undefined_flag, $1)=
6144_LT_AC_TAGVAR(always_export_symbols, $1)=no
6145_LT_AC_TAGVAR(archive_expsym_cmds, $1)=
6146_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
6147_LT_AC_TAGVAR(hardcode_direct, $1)=no
6148_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
6149_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
6150_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
6151_LT_AC_TAGVAR(hardcode_minus_L, $1)=no
6152_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
6153_LT_AC_TAGVAR(hardcode_automatic, $1)=no
6154_LT_AC_TAGVAR(module_cmds, $1)=
6155_LT_AC_TAGVAR(module_expsym_cmds, $1)=
6156_LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
6157_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
6158_LT_AC_TAGVAR(no_undefined_flag, $1)=
6159_LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
6160_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no
6161
6162# Dependencies to place before and after the object being linked:
6163_LT_AC_TAGVAR(predep_objects, $1)=
6164_LT_AC_TAGVAR(postdep_objects, $1)=
6165_LT_AC_TAGVAR(predeps, $1)=
6166_LT_AC_TAGVAR(postdeps, $1)=
6167_LT_AC_TAGVAR(compiler_lib_search_path, $1)=
6168_LT_AC_TAGVAR(compiler_lib_search_dirs, $1)=
6169
6170# Source file extension for C++ test sources.
6171ac_ext=cpp
6172
6173# Object file extension for compiled C++ test sources.
6174objext=o
6175_LT_AC_TAGVAR(objext, $1)=$objext
6176
6177# Code to be used in simple compile tests
6178lt_simple_compile_test_code="int some_variable = 0;"
6179
6180# Code to be used in simple link tests
6181lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }'
6182
6183# ltmain only uses $CC for tagged configurations so make sure $CC is set.
6184_LT_AC_SYS_COMPILER
6185
6186# save warnings/boilerplate of simple test code
6187_LT_COMPILER_BOILERPLATE
6188_LT_LINKER_BOILERPLATE
6189
6190# Allow CC to be a program name with arguments.
6191lt_save_CC=$CC
6192lt_save_LD=$LD
6193lt_save_GCC=$GCC
6194GCC=$GXX
6195lt_save_with_gnu_ld=$with_gnu_ld
6196lt_save_path_LD=$lt_cv_path_LD
6197if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
6198  lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
6199else
6200  unset lt_cv_prog_gnu_ld
6201fi
6202if test -n "${lt_cv_path_LDCXX+set}"; then
6203  lt_cv_path_LD=$lt_cv_path_LDCXX
6204else
6205  unset lt_cv_path_LD
6206fi
6207test -z "${LDCXX+set}" || LD=$LDCXX
6208CC=${CXX-"c++"}
6209compiler=$CC
6210_LT_AC_TAGVAR(compiler, $1)=$CC
6211_LT_CC_BASENAME([$compiler])
6212
6213# We don't want -fno-exception wen compiling C++ code, so set the
6214# no_builtin_flag separately
6215if test "$GXX" = yes; then
6216  _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
6217else
6218  _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
6219fi
6220
6221if test "$GXX" = yes; then
6222  # Set up default GNU C++ configuration
6223
6224  AC_PROG_LD
6225
6226  # Check if GNU C++ uses GNU ld as the underlying linker, since the
6227  # archiving commands below assume that GNU ld is being used.
6228  if test "$with_gnu_ld" = yes; then
6229    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
6230    _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
6231
6232    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
6233    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
6234
6235    # If archive_cmds runs LD, not CC, wlarc should be empty
6236    # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
6237    #     investigate it a little bit more. (MM)
6238    wlarc='${wl}'
6239
6240    # ancient GNU ld didn't support --whole-archive et. al.
6241    if eval "`$CC -print-prog-name=ld` --help 2>&1" | \
6242	grep 'no-whole-archive' > /dev/null; then
6243      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
6244    else
6245      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
6246    fi
6247  else
6248    with_gnu_ld=no
6249    wlarc=
6250
6251    # A generic and very simple default shared library creation
6252    # command for GNU C++ for the case where it uses the native
6253    # linker, instead of GNU ld.  If possible, this setting should
6254    # overridden to take advantage of the native linker features on
6255    # the platform it is being used on.
6256    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
6257  fi
6258
6259  # Commands to make compiler produce verbose output that lists
6260  # what "hidden" libraries, object files and flags are used when
6261  # linking a shared library.
6262  output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
6263
6264else
6265  GXX=no
6266  with_gnu_ld=no
6267  wlarc=
6268fi
6269
6270# PORTME: fill in a description of your system's C++ link characteristics
6271AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
6272_LT_AC_TAGVAR(ld_shlibs, $1)=yes
6273case $host_os in
6274  aix3*)
6275    # FIXME: insert proper C++ library support
6276    _LT_AC_TAGVAR(ld_shlibs, $1)=no
6277    ;;
6278  aix[[4-9]]*)
6279    if test "$host_cpu" = ia64; then
6280      # On IA64, the linker does run time linking by default, so we don't
6281      # have to do anything special.
6282      aix_use_runtimelinking=no
6283      exp_sym_flag='-Bexport'
6284      no_entry_flag=""
6285    else
6286      aix_use_runtimelinking=no
6287
6288      # Test if we are trying to use run time linking or normal
6289      # AIX style linking. If -brtl is somewhere in LDFLAGS, we
6290      # need to do runtime linking.
6291      case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
6292	for ld_flag in $LDFLAGS; do
6293	  case $ld_flag in
6294	  *-brtl*)
6295	    aix_use_runtimelinking=yes
6296	    break
6297	    ;;
6298	  esac
6299	done
6300	;;
6301      esac
6302
6303      exp_sym_flag='-bexport'
6304      no_entry_flag='-bnoentry'
6305    fi
6306
6307    # When large executables or shared objects are built, AIX ld can
6308    # have problems creating the table of contents.  If linking a library
6309    # or program results in "error TOC overflow" add -mminimal-toc to
6310    # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
6311    # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
6312
6313    _LT_AC_TAGVAR(archive_cmds, $1)=''
6314    _LT_AC_TAGVAR(hardcode_direct, $1)=yes
6315    _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
6316    _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
6317
6318    if test "$GXX" = yes; then
6319      case $host_os in aix4.[[012]]|aix4.[[012]].*)
6320      # We only want to do this on AIX 4.2 and lower, the check
6321      # below for broken collect2 doesn't work under 4.3+
6322	collect2name=`${CC} -print-prog-name=collect2`
6323	if test -f "$collect2name" && \
6324	   strings "$collect2name" | grep resolve_lib_name >/dev/null
6325	then
6326	  # We have reworked collect2
6327	  :
6328	else
6329	  # We have old collect2
6330	  _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
6331	  # It fails to find uninstalled libraries when the uninstalled
6332	  # path is not listed in the libpath.  Setting hardcode_minus_L
6333	  # to unsupported forces relinking
6334	  _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
6335	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6336	  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
6337	fi
6338	;;
6339      esac
6340      shared_flag='-shared'
6341      if test "$aix_use_runtimelinking" = yes; then
6342	shared_flag="$shared_flag "'${wl}-G'
6343      fi
6344    else
6345      # not using gcc
6346      if test "$host_cpu" = ia64; then
6347	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
6348	# chokes on -Wl,-G. The following line is correct:
6349	shared_flag='-G'
6350      else
6351	if test "$aix_use_runtimelinking" = yes; then
6352	  shared_flag='${wl}-G'
6353	else
6354	  shared_flag='${wl}-bM:SRE'
6355	fi
6356      fi
6357    fi
6358
6359    # It seems that -bexpall does not export symbols beginning with
6360    # underscore (_), so it is better to generate a list of symbols to export.
6361    _LT_AC_TAGVAR(always_export_symbols, $1)=yes
6362    if test "$aix_use_runtimelinking" = yes; then
6363      # Warning - without using the other runtime loading flags (-brtl),
6364      # -berok will link without error, but may produce a broken library.
6365      _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok'
6366      # Determine the default libpath from the value encoded in an empty executable.
6367      _LT_AC_SYS_LIBPATH_AIX
6368      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
6369
6370      _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
6371     else
6372      if test "$host_cpu" = ia64; then
6373	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
6374	_LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
6375	_LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
6376      else
6377	# Determine the default libpath from the value encoded in an empty executable.
6378	_LT_AC_SYS_LIBPATH_AIX
6379	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
6380	# Warning - without using the other run time loading flags,
6381	# -berok will link without error, but may produce a broken library.
6382	_LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
6383	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
6384	# Exported symbols can be pulled into shared objects from archives
6385	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
6386	_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
6387	# This is similar to how AIX traditionally builds its shared libraries.
6388	_LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
6389      fi
6390    fi
6391    ;;
6392
6393  beos*)
6394    if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
6395      _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
6396      # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
6397      # support --undefined.  This deserves some investigation.  FIXME
6398      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
6399    else
6400      _LT_AC_TAGVAR(ld_shlibs, $1)=no
6401    fi
6402    ;;
6403
6404  chorus*)
6405    case $cc_basename in
6406      *)
6407	# FIXME: insert proper C++ library support
6408	_LT_AC_TAGVAR(ld_shlibs, $1)=no
6409	;;
6410    esac
6411    ;;
6412
6413  cygwin* | mingw* | pw32*)
6414    # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
6415    # as there is no search path for DLLs.
6416    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6417    _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
6418    _LT_AC_TAGVAR(always_export_symbols, $1)=no
6419    _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
6420
6421    if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
6422      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
6423      # If the export-symbols file already is a .def file (1st line
6424      # is EXPORTS), use it as is; otherwise, prepend...
6425      _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
6426	cp $export_symbols $output_objdir/$soname.def;
6427      else
6428	echo EXPORTS > $output_objdir/$soname.def;
6429	cat $export_symbols >> $output_objdir/$soname.def;
6430      fi~
6431      $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
6432    else
6433      _LT_AC_TAGVAR(ld_shlibs, $1)=no
6434    fi
6435  ;;
6436      darwin* | rhapsody*)
6437      _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
6438      _LT_AC_TAGVAR(hardcode_direct, $1)=no
6439      _LT_AC_TAGVAR(hardcode_automatic, $1)=yes
6440      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
6441      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=''
6442      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
6443      _LT_AC_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined"
6444      if test "$GXX" = yes ; then
6445      output_verbose_link_cmd='echo'
6446      _LT_AC_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
6447      _LT_AC_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
6448      _LT_AC_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
6449      _LT_AC_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
6450      if test "$lt_cv_apple_cc_single_mod" != "yes"; then
6451        _LT_AC_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}"
6452        _LT_AC_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}"
6453      fi
6454      else
6455      case $cc_basename in
6456        xlc*)
6457         output_verbose_link_cmd='echo'
6458          _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $xlcverstring'
6459          _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
6460          # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
6461          _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $xlcverstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
6462          _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
6463          ;;
6464       *)
6465         _LT_AC_TAGVAR(ld_shlibs, $1)=no
6466          ;;
6467      esac
6468      fi
6469        ;;
6470
6471  dgux*)
6472    case $cc_basename in
6473      ec++*)
6474	# FIXME: insert proper C++ library support
6475	_LT_AC_TAGVAR(ld_shlibs, $1)=no
6476	;;
6477      ghcx*)
6478	# Green Hills C++ Compiler
6479	# FIXME: insert proper C++ library support
6480	_LT_AC_TAGVAR(ld_shlibs, $1)=no
6481	;;
6482      *)
6483	# FIXME: insert proper C++ library support
6484	_LT_AC_TAGVAR(ld_shlibs, $1)=no
6485	;;
6486    esac
6487    ;;
6488  freebsd[[12]].*)
6489    # C++ shared libraries reported to be fairly broken before switch to ELF
6490    _LT_AC_TAGVAR(ld_shlibs, $1)=no
6491    ;;
6492  freebsd-elf*)
6493    _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
6494    ;;
6495  freebsd* | dragonfly*)
6496    # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
6497    # conventions
6498    _LT_AC_TAGVAR(ld_shlibs, $1)=yes
6499    ;;
6500  gnu*)
6501    ;;
6502  hpux9*)
6503    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
6504    _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
6505    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
6506    _LT_AC_TAGVAR(hardcode_direct, $1)=yes
6507    _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
6508				# but as the default
6509				# location of the library.
6510
6511    case $cc_basename in
6512    CC*)
6513      # FIXME: insert proper C++ library support
6514      _LT_AC_TAGVAR(ld_shlibs, $1)=no
6515      ;;
6516    aCC*)
6517      _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
6518      # Commands to make compiler produce verbose output that lists
6519      # what "hidden" libraries, object files and flags are used when
6520      # linking a shared library.
6521      #
6522      # There doesn't appear to be a way to prevent this compiler from
6523      # explicitly linking system object files so we need to strip them
6524      # from the output so that they don't get included in the library
6525      # dependencies.
6526      output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "[[-]]L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
6527      ;;
6528    *)
6529      if test "$GXX" = yes; then
6530        _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
6531      else
6532        # FIXME: insert proper C++ library support
6533        _LT_AC_TAGVAR(ld_shlibs, $1)=no
6534      fi
6535      ;;
6536    esac
6537    ;;
6538  hpux10*|hpux11*)
6539    if test $with_gnu_ld = no; then
6540      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
6541      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
6542
6543      case $host_cpu in
6544      hppa*64*|ia64*) ;;
6545      *)
6546	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
6547        ;;
6548      esac
6549    fi
6550    case $host_cpu in
6551    hppa*64*|ia64*)
6552      _LT_AC_TAGVAR(hardcode_direct, $1)=no
6553      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
6554      ;;
6555    *)
6556      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
6557      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
6558					      # but as the default
6559					      # location of the library.
6560      ;;
6561    esac
6562
6563    case $cc_basename in
6564      CC*)
6565	# FIXME: insert proper C++ library support
6566	_LT_AC_TAGVAR(ld_shlibs, $1)=no
6567	;;
6568      aCC*)
6569	case $host_cpu in
6570	hppa*64*)
6571	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
6572	  ;;
6573	ia64*)
6574	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
6575	  ;;
6576	*)
6577	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
6578	  ;;
6579	esac
6580	# Commands to make compiler produce verbose output that lists
6581	# what "hidden" libraries, object files and flags are used when
6582	# linking a shared library.
6583	#
6584	# There doesn't appear to be a way to prevent this compiler from
6585	# explicitly linking system object files so we need to strip them
6586	# from the output so that they don't get included in the library
6587	# dependencies.
6588	output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
6589	;;
6590      *)
6591	if test "$GXX" = yes; then
6592	  if test $with_gnu_ld = no; then
6593	    case $host_cpu in
6594	    hppa*64*)
6595	      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
6596	      ;;
6597	    ia64*)
6598	      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
6599	      ;;
6600	    *)
6601	      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
6602	      ;;
6603	    esac
6604	  fi
6605	else
6606	  # FIXME: insert proper C++ library support
6607	  _LT_AC_TAGVAR(ld_shlibs, $1)=no
6608	fi
6609	;;
6610    esac
6611    ;;
6612  interix[[3-9]]*)
6613    _LT_AC_TAGVAR(hardcode_direct, $1)=no
6614    _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
6615    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
6616    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
6617    # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
6618    # Instead, shared libraries are loaded at an image base (0x10000000 by
6619    # default) and relocated if they conflict, which is a slow very memory
6620    # consuming and fragmenting process.  To avoid this, we pick a random,
6621    # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
6622    # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
6623    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
6624    _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
6625    ;;
6626  irix5* | irix6*)
6627    case $cc_basename in
6628      CC*)
6629	# SGI C++
6630	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
6631
6632	# Archives containing C++ object files must be created using
6633	# "CC -ar", where "CC" is the IRIX C++ compiler.  This is
6634	# necessary to make sure instantiated templates are included
6635	# in the archive.
6636	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
6637	;;
6638      *)
6639	if test "$GXX" = yes; then
6640	  if test "$with_gnu_ld" = no; then
6641	    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $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'
6642	  else
6643	    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib'
6644	  fi
6645	fi
6646	_LT_AC_TAGVAR(link_all_deplibs, $1)=yes
6647	;;
6648    esac
6649    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
6650    _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
6651    ;;
6652  linux* | k*bsd*-gnu)
6653    case $cc_basename in
6654      KCC*)
6655	# Kuck and Associates, Inc. (KAI) C++ Compiler
6656
6657	# KCC will only create a shared library if the output file
6658	# ends with ".so" (or ".sl" for HP-UX), so rename the library
6659	# to its proper name (with version) after linking.
6660	_LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
6661	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib'
6662	# Commands to make compiler produce verbose output that lists
6663	# what "hidden" libraries, object files and flags are used when
6664	# linking a shared library.
6665	#
6666	# There doesn't appear to be a way to prevent this compiler from
6667	# explicitly linking system object files so we need to strip them
6668	# from the output so that they don't get included in the library
6669	# dependencies.
6670	output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | grep "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
6671
6672	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath,$libdir'
6673	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
6674
6675	# Archives containing C++ object files must be created using
6676	# "CC -Bstatic", where "CC" is the KAI C++ compiler.
6677	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
6678	;;
6679      icpc*)
6680	# Intel C++
6681	with_gnu_ld=yes
6682	# version 8.0 and above of icpc choke on multiply defined symbols
6683	# if we add $predep_objects and $postdep_objects, however 7.1 and
6684	# earlier do not add the objects themselves.
6685	case `$CC -V 2>&1` in
6686	*"Version 7."*)
6687  	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
6688  	  _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
6689	  ;;
6690	*)  # Version 8.0 or newer
6691	  tmp_idyn=
6692	  case $host_cpu in
6693	    ia64*) tmp_idyn=' -i_dynamic';;
6694	  esac
6695  	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
6696	  _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
6697	  ;;
6698	esac
6699	_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
6700	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
6701	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
6702	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
6703	;;
6704      pgCC* | pgcpp*)
6705        # Portland Group C++ compiler
6706	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
6707  	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
6708
6709	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
6710	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
6711	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
6712        ;;
6713      cxx*)
6714	# Compaq C++
6715	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
6716	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname  -o $lib ${wl}-retain-symbols-file $wl$export_symbols'
6717
6718	runpath_var=LD_RUN_PATH
6719	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
6720	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
6721
6722	# Commands to make compiler produce verbose output that lists
6723	# what "hidden" libraries, object files and flags are used when
6724	# linking a shared library.
6725	#
6726	# There doesn't appear to be a way to prevent this compiler from
6727	# explicitly linking system object files so we need to strip them
6728	# from the output so that they don't get included in the library
6729	# dependencies.
6730	output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
6731	;;
6732      *)
6733	case `$CC -V 2>&1 | sed 5q` in
6734	*Sun\ C*)
6735	  # Sun C++ 5.9
6736	  _LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs'
6737	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
6738	  _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols'
6739	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
6740	  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
6741
6742	  # Not sure whether something based on
6743	  # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
6744	  # would be better.
6745	  output_verbose_link_cmd='echo'
6746
6747	  # Archives containing C++ object files must be created using
6748	  # "CC -xar", where "CC" is the Sun C++ compiler.  This is
6749	  # necessary to make sure instantiated templates are included
6750	  # in the archive.
6751	  _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
6752	  ;;
6753	esac
6754	;;
6755    esac
6756    ;;
6757  lynxos*)
6758    # FIXME: insert proper C++ library support
6759    _LT_AC_TAGVAR(ld_shlibs, $1)=no
6760    ;;
6761  m88k*)
6762    # FIXME: insert proper C++ library support
6763    _LT_AC_TAGVAR(ld_shlibs, $1)=no
6764    ;;
6765  mvs*)
6766    case $cc_basename in
6767      cxx*)
6768	# FIXME: insert proper C++ library support
6769	_LT_AC_TAGVAR(ld_shlibs, $1)=no
6770	;;
6771      *)
6772	# FIXME: insert proper C++ library support
6773	_LT_AC_TAGVAR(ld_shlibs, $1)=no
6774	;;
6775    esac
6776    ;;
6777  netbsd*)
6778    if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
6779      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
6780      wlarc=
6781      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
6782      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
6783      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
6784    fi
6785    # Workaround some broken pre-1.5 toolchains
6786    output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
6787    ;;
6788  openbsd2*)
6789    # C++ shared libraries are fairly broken
6790    _LT_AC_TAGVAR(ld_shlibs, $1)=no
6791    ;;
6792  openbsd*)
6793    if test -f /usr/libexec/ld.so; then
6794      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
6795      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
6796      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
6797      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
6798      if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
6799	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib'
6800	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
6801	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
6802      fi
6803      output_verbose_link_cmd='echo'
6804    else
6805      _LT_AC_TAGVAR(ld_shlibs, $1)=no
6806    fi
6807    ;;
6808  osf3*)
6809    case $cc_basename in
6810      KCC*)
6811	# Kuck and Associates, Inc. (KAI) C++ Compiler
6812
6813	# KCC will only create a shared library if the output file
6814	# ends with ".so" (or ".sl" for HP-UX), so rename the library
6815	# to its proper name (with version) after linking.
6816	_LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
6817
6818	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
6819	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
6820
6821	# Archives containing C++ object files must be created using
6822	# "CC -Bstatic", where "CC" is the KAI C++ compiler.
6823	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
6824
6825	;;
6826      RCC*)
6827	# Rational C++ 2.4.1
6828	# FIXME: insert proper C++ library support
6829	_LT_AC_TAGVAR(ld_shlibs, $1)=no
6830	;;
6831      cxx*)
6832	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
6833	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
6834
6835	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
6836	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
6837
6838	# Commands to make compiler produce verbose output that lists
6839	# what "hidden" libraries, object files and flags are used when
6840	# linking a shared library.
6841	#
6842	# There doesn't appear to be a way to prevent this compiler from
6843	# explicitly linking system object files so we need to strip them
6844	# from the output so that they don't get included in the library
6845	# dependencies.
6846	output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
6847	;;
6848      *)
6849	if test "$GXX" = yes && test "$with_gnu_ld" = no; then
6850	  _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
6851	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $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'
6852
6853	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
6854	  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
6855
6856	  # Commands to make compiler produce verbose output that lists
6857	  # what "hidden" libraries, object files and flags are used when
6858	  # linking a shared library.
6859	  output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
6860
6861	else
6862	  # FIXME: insert proper C++ library support
6863	  _LT_AC_TAGVAR(ld_shlibs, $1)=no
6864	fi
6865	;;
6866    esac
6867    ;;
6868  osf4* | osf5*)
6869    case $cc_basename in
6870      KCC*)
6871	# Kuck and Associates, Inc. (KAI) C++ Compiler
6872
6873	# KCC will only create a shared library if the output file
6874	# ends with ".so" (or ".sl" for HP-UX), so rename the library
6875	# to its proper name (with version) after linking.
6876	_LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
6877
6878	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
6879	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
6880
6881	# Archives containing C++ object files must be created using
6882	# the KAI C++ compiler.
6883	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs'
6884	;;
6885      RCC*)
6886	# Rational C++ 2.4.1
6887	# FIXME: insert proper C++ library support
6888	_LT_AC_TAGVAR(ld_shlibs, $1)=no
6889	;;
6890      cxx*)
6891	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
6892	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
6893	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
6894	  echo "-hidden">> $lib.exp~
6895	  $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp  `test -n "$verstring" && echo -set_version	$verstring` -update_registry ${output_objdir}/so_locations -o $lib~
6896	  $rm $lib.exp'
6897
6898	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
6899	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
6900
6901	# Commands to make compiler produce verbose output that lists
6902	# what "hidden" libraries, object files and flags are used when
6903	# linking a shared library.
6904	#
6905	# There doesn't appear to be a way to prevent this compiler from
6906	# explicitly linking system object files so we need to strip them
6907	# from the output so that they don't get included in the library
6908	# dependencies.
6909	output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
6910	;;
6911      *)
6912	if test "$GXX" = yes && test "$with_gnu_ld" = no; then
6913	  _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
6914	 _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $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'
6915
6916	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
6917	  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
6918
6919	  # Commands to make compiler produce verbose output that lists
6920	  # what "hidden" libraries, object files and flags are used when
6921	  # linking a shared library.
6922	  output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
6923
6924	else
6925	  # FIXME: insert proper C++ library support
6926	  _LT_AC_TAGVAR(ld_shlibs, $1)=no
6927	fi
6928	;;
6929    esac
6930    ;;
6931  psos*)
6932    # FIXME: insert proper C++ library support
6933    _LT_AC_TAGVAR(ld_shlibs, $1)=no
6934    ;;
6935  sunos4*)
6936    case $cc_basename in
6937      CC*)
6938	# Sun C++ 4.x
6939	# FIXME: insert proper C++ library support
6940	_LT_AC_TAGVAR(ld_shlibs, $1)=no
6941	;;
6942      lcc*)
6943	# Lucid
6944	# FIXME: insert proper C++ library support
6945	_LT_AC_TAGVAR(ld_shlibs, $1)=no
6946	;;
6947      *)
6948	# FIXME: insert proper C++ library support
6949	_LT_AC_TAGVAR(ld_shlibs, $1)=no
6950	;;
6951    esac
6952    ;;
6953  solaris*)
6954    case $cc_basename in
6955      CC*)
6956	# Sun C++ 4.2, 5.x and Centerline C++
6957        _LT_AC_TAGVAR(archive_cmds_need_lc,$1)=yes
6958	_LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs'
6959	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag}  -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
6960	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
6961	$CC -G${allow_undefined_flag}  ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
6962
6963	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
6964	_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
6965	case $host_os in
6966	  solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
6967	  *)
6968	    # The compiler driver will combine and reorder linker options,
6969	    # but understands `-z linker_flag'.
6970	    # Supported since Solaris 2.6 (maybe 2.5.1?)
6971	    _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
6972	    ;;
6973	esac
6974	_LT_AC_TAGVAR(link_all_deplibs, $1)=yes
6975
6976	output_verbose_link_cmd='echo'
6977
6978	# Archives containing C++ object files must be created using
6979	# "CC -xar", where "CC" is the Sun C++ compiler.  This is
6980	# necessary to make sure instantiated templates are included
6981	# in the archive.
6982	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
6983	;;
6984      gcx*)
6985	# Green Hills C++ Compiler
6986	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
6987
6988	# The C++ compiler must be used to create the archive.
6989	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
6990	;;
6991      *)
6992	# GNU C++ compiler with Solaris linker
6993	if test "$GXX" = yes && test "$with_gnu_ld" = no; then
6994	  _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
6995	  if $CC --version | grep -v '^2\.7' > /dev/null; then
6996	    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
6997	    _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
6998		$CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
6999
7000	    # Commands to make compiler produce verbose output that lists
7001	    # what "hidden" libraries, object files and flags are used when
7002	    # linking a shared library.
7003	    output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\""
7004	  else
7005	    # g++ 2.7 appears to require `-G' NOT `-shared' on this
7006	    # platform.
7007	    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
7008	    _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
7009		$CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
7010
7011	    # Commands to make compiler produce verbose output that lists
7012	    # what "hidden" libraries, object files and flags are used when
7013	    # linking a shared library.
7014	    output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\""
7015	  fi
7016
7017	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
7018	  case $host_os in
7019	  solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
7020	  *)
7021	    _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
7022	    ;;
7023	  esac
7024	fi
7025	;;
7026    esac
7027    ;;
7028  sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
7029    _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
7030    _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
7031    _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
7032    runpath_var='LD_RUN_PATH'
7033
7034    case $cc_basename in
7035      CC*)
7036	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7037	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7038	;;
7039      *)
7040	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7041	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7042	;;
7043    esac
7044    ;;
7045  sysv5* | sco3.2v5* | sco5v6*)
7046    # Note: We can NOT use -z defs as we might desire, because we do not
7047    # link with -lc, and that would cause any symbols used from libc to
7048    # always be unresolved, which means just about no library would
7049    # ever link correctly.  If we're not using GNU ld we use -z text
7050    # though, which does catch some bad symbols but isn't as heavy-handed
7051    # as -z defs.
7052    # For security reasons, it is highly recommended that you always
7053    # use absolute paths for naming shared libraries, and exclude the
7054    # DT_RUNPATH tag from executables and libraries.  But doing so
7055    # requires that you compile everything twice, which is a pain.
7056    # So that behaviour is only enabled if SCOABSPATH is set to a
7057    # non-empty value in the environment.  Most likely only useful for
7058    # creating official distributions of packages.
7059    # This is a hack until libtool officially supports absolute path
7060    # names for shared libraries.
7061    _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
7062    _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
7063    _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
7064    _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
7065    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
7066    _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
7067    _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
7068    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
7069    runpath_var='LD_RUN_PATH'
7070
7071    case $cc_basename in
7072      CC*)
7073	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
7074	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
7075	;;
7076      *)
7077	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
7078	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
7079	;;
7080    esac
7081    ;;
7082  tandem*)
7083    case $cc_basename in
7084      NCC*)
7085	# NonStop-UX NCC 3.20
7086	# FIXME: insert proper C++ library support
7087	_LT_AC_TAGVAR(ld_shlibs, $1)=no
7088	;;
7089      *)
7090	# FIXME: insert proper C++ library support
7091	_LT_AC_TAGVAR(ld_shlibs, $1)=no
7092	;;
7093    esac
7094    ;;
7095  vxworks*)
7096    # FIXME: insert proper C++ library support
7097    _LT_AC_TAGVAR(ld_shlibs, $1)=no
7098    ;;
7099  *)
7100    # FIXME: insert proper C++ library support
7101    _LT_AC_TAGVAR(ld_shlibs, $1)=no
7102    ;;
7103esac
7104AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)])
7105test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
7106
7107_LT_AC_TAGVAR(GCC, $1)="$GXX"
7108_LT_AC_TAGVAR(LD, $1)="$LD"
7109
7110## CAVEAT EMPTOR:
7111## There is no encapsulation within the following macros, do not change
7112## the running order or otherwise move them around unless you know exactly
7113## what you are doing...
7114AC_LIBTOOL_POSTDEP_PREDEP($1)
7115AC_LIBTOOL_PROG_COMPILER_PIC($1)
7116AC_LIBTOOL_PROG_CC_C_O($1)
7117AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
7118AC_LIBTOOL_PROG_LD_SHLIBS($1)
7119AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
7120AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
7121
7122AC_LIBTOOL_CONFIG($1)
7123
7124AC_LANG_RESTORE
7125CC=$lt_save_CC
7126LDCXX=$LD
7127LD=$lt_save_LD
7128GCC=$lt_save_GCC
7129with_gnu_ldcxx=$with_gnu_ld
7130with_gnu_ld=$lt_save_with_gnu_ld
7131lt_cv_path_LDCXX=$lt_cv_path_LD
7132lt_cv_path_LD=$lt_save_path_LD
7133lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
7134lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
7135])# AC_LIBTOOL_LANG_CXX_CONFIG
7136
7137# AC_LIBTOOL_POSTDEP_PREDEP([TAGNAME])
7138# ------------------------------------
7139# Figure out "hidden" library dependencies from verbose
7140# compiler output when linking a shared library.
7141# Parse the compiler output and extract the necessary
7142# objects, libraries and library flags.
7143AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP],
7144[AC_REQUIRE([LT_AC_PROG_SED])dnl
7145dnl we can't use the lt_simple_compile_test_code here,
7146dnl because it contains code intended for an executable,
7147dnl not a library.  It's possible we should let each
7148dnl tag define a new lt_????_link_test_code variable,
7149dnl but it's only used here...
7150ifelse([$1],[],[cat > conftest.$ac_ext <<EOF
7151int a;
7152void foo (void) { a = 0; }
7153EOF
7154],[$1],[CXX],[cat > conftest.$ac_ext <<EOF
7155class Foo
7156{
7157public:
7158  Foo (void) { a = 0; }
7159private:
7160  int a;
7161};
7162EOF
7163],[$1],[F77],[cat > conftest.$ac_ext <<EOF
7164      subroutine foo
7165      implicit none
7166      integer*4 a
7167      a=0
7168      return
7169      end
7170EOF
7171],[$1],[GCJ],[cat > conftest.$ac_ext <<EOF
7172public class foo {
7173  private int a;
7174  public void bar (void) {
7175    a = 0;
7176  }
7177};
7178EOF
7179])
7180dnl Parse the compiler output and extract the necessary
7181dnl objects, libraries and library flags.
7182if AC_TRY_EVAL(ac_compile); then
7183  # Parse the compiler output and extract the necessary
7184  # objects, libraries and library flags.
7185
7186  # Sentinel used to keep track of whether or not we are before
7187  # the conftest object file.
7188  pre_test_object_deps_done=no
7189
7190  # The `*' in the case matches for architectures that use `case' in
7191  # $output_verbose_cmd can trigger glob expansion during the loop
7192  # eval without this substitution.
7193  output_verbose_link_cmd=`$echo "X$output_verbose_link_cmd" | $Xsed -e "$no_glob_subst"`
7194
7195  for p in `eval $output_verbose_link_cmd`; do
7196    case $p in
7197
7198    -L* | -R* | -l*)
7199       # Some compilers place space between "-{L,R}" and the path.
7200       # Remove the space.
7201       if test $p = "-L" \
7202	  || test $p = "-R"; then
7203	 prev=$p
7204	 continue
7205       else
7206	 prev=
7207       fi
7208
7209       if test "$pre_test_object_deps_done" = no; then
7210	 case $p in
7211	 -L* | -R*)
7212	   # Internal compiler library paths should come after those
7213	   # provided the user.  The postdeps already come after the
7214	   # user supplied libs so there is no need to process them.
7215	   if test -z "$_LT_AC_TAGVAR(compiler_lib_search_path, $1)"; then
7216	     _LT_AC_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"
7217	   else
7218	     _LT_AC_TAGVAR(compiler_lib_search_path, $1)="${_LT_AC_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}"
7219	   fi
7220	   ;;
7221	 # The "-l" case would never come before the object being
7222	 # linked, so don't bother handling this case.
7223	 esac
7224       else
7225	 if test -z "$_LT_AC_TAGVAR(postdeps, $1)"; then
7226	   _LT_AC_TAGVAR(postdeps, $1)="${prev}${p}"
7227	 else
7228	   _LT_AC_TAGVAR(postdeps, $1)="${_LT_AC_TAGVAR(postdeps, $1)} ${prev}${p}"
7229	 fi
7230       fi
7231       ;;
7232
7233    *.$objext)
7234       # This assumes that the test object file only shows up
7235       # once in the compiler output.
7236       if test "$p" = "conftest.$objext"; then
7237	 pre_test_object_deps_done=yes
7238	 continue
7239       fi
7240
7241       if test "$pre_test_object_deps_done" = no; then
7242	 if test -z "$_LT_AC_TAGVAR(predep_objects, $1)"; then
7243	   _LT_AC_TAGVAR(predep_objects, $1)="$p"
7244	 else
7245	   _LT_AC_TAGVAR(predep_objects, $1)="$_LT_AC_TAGVAR(predep_objects, $1) $p"
7246	 fi
7247       else
7248	 if test -z "$_LT_AC_TAGVAR(postdep_objects, $1)"; then
7249	   _LT_AC_TAGVAR(postdep_objects, $1)="$p"
7250	 else
7251	   _LT_AC_TAGVAR(postdep_objects, $1)="$_LT_AC_TAGVAR(postdep_objects, $1) $p"
7252	 fi
7253       fi
7254       ;;
7255
7256    *) ;; # Ignore the rest.
7257
7258    esac
7259  done
7260
7261  # Clean up.
7262  rm -f a.out a.exe
7263else
7264  echo "libtool.m4: error: problem compiling $1 test program"
7265fi
7266
7267$rm -f confest.$objext
7268
7269_LT_AC_TAGVAR(compiler_lib_search_dirs, $1)=
7270if test -n "$_LT_AC_TAGVAR(compiler_lib_search_path, $1)"; then
7271  _LT_AC_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_AC_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'`
7272fi
7273
7274# PORTME: override above test on systems where it is broken
7275ifelse([$1],[CXX],
7276[case $host_os in
7277interix[[3-9]]*)
7278  # Interix 3.5 installs completely hosed .la files for C++, so rather than
7279  # hack all around it, let's just trust "g++" to DTRT.
7280  _LT_AC_TAGVAR(predep_objects,$1)=
7281  _LT_AC_TAGVAR(postdep_objects,$1)=
7282  _LT_AC_TAGVAR(postdeps,$1)=
7283  ;;
7284
7285linux*)
7286  case `$CC -V 2>&1 | sed 5q` in
7287  *Sun\ C*)
7288    # Sun C++ 5.9
7289    #
7290    # The more standards-conforming stlport4 library is
7291    # incompatible with the Cstd library. Avoid specifying
7292    # it if it's in CXXFLAGS. Ignore libCrun as
7293    # -library=stlport4 depends on it.
7294    case " $CXX $CXXFLAGS " in
7295    *" -library=stlport4 "*)
7296      solaris_use_stlport4=yes
7297      ;;
7298    esac
7299    if test "$solaris_use_stlport4" != yes; then
7300      _LT_AC_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
7301    fi
7302    ;;
7303  esac
7304  ;;
7305
7306solaris*)
7307  case $cc_basename in
7308  CC*)
7309    # The more standards-conforming stlport4 library is
7310    # incompatible with the Cstd library. Avoid specifying
7311    # it if it's in CXXFLAGS. Ignore libCrun as
7312    # -library=stlport4 depends on it.
7313    case " $CXX $CXXFLAGS " in
7314    *" -library=stlport4 "*)
7315      solaris_use_stlport4=yes
7316      ;;
7317    esac
7318
7319    # Adding this requires a known-good setup of shared libraries for
7320    # Sun compiler versions before 5.6, else PIC objects from an old
7321    # archive will be linked into the output, leading to subtle bugs.
7322    if test "$solaris_use_stlport4" != yes; then
7323      _LT_AC_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
7324    fi
7325    ;;
7326  esac
7327  ;;
7328esac
7329])
7330case " $_LT_AC_TAGVAR(postdeps, $1) " in
7331*" -lc "*) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no ;;
7332esac
7333])# AC_LIBTOOL_POSTDEP_PREDEP
7334
7335# AC_LIBTOOL_CONFIG([TAGNAME])
7336# ----------------------------
7337# If TAGNAME is not passed, then create an initial libtool script
7338# with a default configuration from the untagged config vars.  Otherwise
7339# add code to config.status for appending the configuration named by
7340# TAGNAME from the matching tagged config vars.
7341AC_DEFUN([AC_LIBTOOL_CONFIG],
7342[# The else clause should only fire when bootstrapping the
7343# libtool distribution, otherwise you forgot to ship ltmain.sh
7344# with your package, and you will get complaints that there are
7345# no rules to generate ltmain.sh.
7346if test -f "$ltmain"; then
7347  # See if we are running on zsh, and set the options which allow our commands through
7348  # without removal of \ escapes.
7349  if test -n "${ZSH_VERSION+set}" ; then
7350    setopt NO_GLOB_SUBST
7351  fi
7352  # Now quote all the things that may contain metacharacters while being
7353  # careful not to overquote the AC_SUBSTed values.  We take copies of the
7354  # variables and quote the copies for generation of the libtool script.
7355  for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \
7356    SED SHELL STRIP \
7357    libname_spec library_names_spec soname_spec extract_expsyms_cmds \
7358    old_striplib striplib file_magic_cmd finish_cmds finish_eval \
7359    deplibs_check_method reload_flag reload_cmds need_locks \
7360    lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
7361    lt_cv_sys_global_symbol_to_c_name_address \
7362    sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
7363    old_postinstall_cmds old_postuninstall_cmds \
7364    _LT_AC_TAGVAR(compiler, $1) \
7365    _LT_AC_TAGVAR(CC, $1) \
7366    _LT_AC_TAGVAR(LD, $1) \
7367    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1) \
7368    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1) \
7369    _LT_AC_TAGVAR(lt_prog_compiler_static, $1) \
7370    _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) \
7371    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1) \
7372    _LT_AC_TAGVAR(thread_safe_flag_spec, $1) \
7373    _LT_AC_TAGVAR(whole_archive_flag_spec, $1) \
7374    _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1) \
7375    _LT_AC_TAGVAR(old_archive_cmds, $1) \
7376    _LT_AC_TAGVAR(old_archive_from_new_cmds, $1) \
7377    _LT_AC_TAGVAR(predep_objects, $1) \
7378    _LT_AC_TAGVAR(postdep_objects, $1) \
7379    _LT_AC_TAGVAR(predeps, $1) \
7380    _LT_AC_TAGVAR(postdeps, $1) \
7381    _LT_AC_TAGVAR(compiler_lib_search_path, $1) \
7382    _LT_AC_TAGVAR(compiler_lib_search_dirs, $1) \
7383    _LT_AC_TAGVAR(archive_cmds, $1) \
7384    _LT_AC_TAGVAR(archive_expsym_cmds, $1) \
7385    _LT_AC_TAGVAR(postinstall_cmds, $1) \
7386    _LT_AC_TAGVAR(postuninstall_cmds, $1) \
7387    _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) \
7388    _LT_AC_TAGVAR(allow_undefined_flag, $1) \
7389    _LT_AC_TAGVAR(no_undefined_flag, $1) \
7390    _LT_AC_TAGVAR(export_symbols_cmds, $1) \
7391    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) \
7392    _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1) \
7393    _LT_AC_TAGVAR(hardcode_libdir_separator, $1) \
7394    _LT_AC_TAGVAR(hardcode_automatic, $1) \
7395    _LT_AC_TAGVAR(module_cmds, $1) \
7396    _LT_AC_TAGVAR(module_expsym_cmds, $1) \
7397    _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1) \
7398    _LT_AC_TAGVAR(fix_srcfile_path, $1) \
7399    _LT_AC_TAGVAR(exclude_expsyms, $1) \
7400    _LT_AC_TAGVAR(include_expsyms, $1); do
7401
7402    case $var in
7403    _LT_AC_TAGVAR(old_archive_cmds, $1) | \
7404    _LT_AC_TAGVAR(old_archive_from_new_cmds, $1) | \
7405    _LT_AC_TAGVAR(archive_cmds, $1) | \
7406    _LT_AC_TAGVAR(archive_expsym_cmds, $1) | \
7407    _LT_AC_TAGVAR(module_cmds, $1) | \
7408    _LT_AC_TAGVAR(module_expsym_cmds, $1) | \
7409    _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) | \
7410    _LT_AC_TAGVAR(export_symbols_cmds, $1) | \
7411    extract_expsyms_cmds | reload_cmds | finish_cmds | \
7412    postinstall_cmds | postuninstall_cmds | \
7413    old_postinstall_cmds | old_postuninstall_cmds | \
7414    sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
7415      # Double-quote double-evaled strings.
7416      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
7417      ;;
7418    *)
7419      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
7420      ;;
7421    esac
7422  done
7423
7424  case $lt_echo in
7425  *'\[$]0 --fallback-echo"')
7426    lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\[$]0 --fallback-echo"[$]/[$]0 --fallback-echo"/'`
7427    ;;
7428  esac
7429
7430ifelse([$1], [],
7431  [cfgfile="${ofile}T"
7432  trap "$rm \"$cfgfile\"; exit 1" 1 2 15
7433  $rm -f "$cfgfile"
7434  AC_MSG_RESULT([
7435creating $ofile])],
7436  [cfgfile="$ofile"])
7437
7438  cat <<__EOF__ >> "$cfgfile"
7439ifelse([$1], [],
7440[#! $SHELL
7441
7442# `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
7443# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)
7444# NOTE: Changes made to this file will be lost: look at ltmain.sh.
7445#
7446# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
7447# Free Software Foundation, Inc.
7448#
7449# This file is part of GNU Libtool:
7450# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
7451#
7452# This program is free software; you can redistribute it and/or modify
7453# it under the terms of the GNU General Public License as published by
7454# the Free Software Foundation; either version 2 of the License, or
7455# (at your option) any later version.
7456#
7457# This program is distributed in the hope that it will be useful, but
7458# WITHOUT ANY WARRANTY; without even the implied warranty of
7459# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
7460# General Public License for more details.
7461#
7462# You should have received a copy of the GNU General Public License
7463# along with this program; if not, write to the Free Software
7464# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
7465#
7466# As a special exception to the GNU General Public License, if you
7467# distribute this file as part of a program that contains a
7468# configuration script generated by Autoconf, you may include it under
7469# the same distribution terms that you use for the rest of that program.
7470
7471# A sed program that does not truncate output.
7472SED=$lt_SED
7473
7474# Sed that helps us avoid accidentally triggering echo(1) options like -n.
7475Xsed="$SED -e 1s/^X//"
7476
7477# The HP-UX ksh and POSIX shell print the target directory to stdout
7478# if CDPATH is set.
7479(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
7480
7481# The names of the tagged configurations supported by this script.
7482available_tags=
7483
7484# ### BEGIN LIBTOOL CONFIG],
7485[# ### BEGIN LIBTOOL TAG CONFIG: $tagname])
7486
7487# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
7488
7489# Shell to use when invoking shell scripts.
7490SHELL=$lt_SHELL
7491
7492# Whether or not to build shared libraries.
7493build_libtool_libs=$enable_shared
7494
7495# Whether or not to build static libraries.
7496build_old_libs=$enable_static
7497
7498# Whether or not to add -lc for building shared libraries.
7499build_libtool_need_lc=$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)
7500
7501# Whether or not to disallow shared libs when runtime libs are static
7502allow_libtool_libs_with_static_runtimes=$_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)
7503
7504# Whether or not to optimize for fast installation.
7505fast_install=$enable_fast_install
7506
7507# The host system.
7508host_alias=$host_alias
7509host=$host
7510host_os=$host_os
7511
7512# The build system.
7513build_alias=$build_alias
7514build=$build
7515build_os=$build_os
7516
7517# An echo program that does not interpret backslashes.
7518echo=$lt_echo
7519
7520# The archiver.
7521AR=$lt_AR
7522AR_FLAGS=$lt_AR_FLAGS
7523
7524# A C compiler.
7525LTCC=$lt_LTCC
7526
7527# LTCC compiler flags.
7528LTCFLAGS=$lt_LTCFLAGS
7529
7530# A language-specific compiler.
7531CC=$lt_[]_LT_AC_TAGVAR(compiler, $1)
7532
7533# Is the compiler the GNU C compiler?
7534with_gcc=$_LT_AC_TAGVAR(GCC, $1)
7535
7536# An ERE matcher.
7537EGREP=$lt_EGREP
7538
7539# The linker used to build libraries.
7540LD=$lt_[]_LT_AC_TAGVAR(LD, $1)
7541
7542# Whether we need hard or soft links.
7543LN_S=$lt_LN_S
7544
7545# A BSD-compatible nm program.
7546NM=$lt_NM
7547
7548# A symbol stripping program
7549STRIP=$lt_STRIP
7550
7551# Used to examine libraries when file_magic_cmd begins "file"
7552MAGIC_CMD=$MAGIC_CMD
7553
7554# Used on cygwin: DLL creation program.
7555DLLTOOL="$DLLTOOL"
7556
7557# Used on cygwin: object dumper.
7558OBJDUMP="$OBJDUMP"
7559
7560# Used on cygwin: assembler.
7561AS="$AS"
7562
7563# The name of the directory that contains temporary libtool files.
7564objdir=$objdir
7565
7566# How to create reloadable object files.
7567reload_flag=$lt_reload_flag
7568reload_cmds=$lt_reload_cmds
7569
7570# How to pass a linker flag through the compiler.
7571wl=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)
7572
7573# Object file suffix (normally "o").
7574objext="$ac_objext"
7575
7576# Old archive suffix (normally "a").
7577libext="$libext"
7578
7579# Shared library suffix (normally ".so").
7580shrext_cmds='$shrext_cmds'
7581
7582# Executable file suffix (normally "").
7583exeext="$exeext"
7584
7585# Additional compiler flags for building library objects.
7586pic_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)
7587pic_mode=$pic_mode
7588
7589# What is the maximum length of a command?
7590max_cmd_len=$lt_cv_sys_max_cmd_len
7591
7592# Does compiler simultaneously support -c and -o options?
7593compiler_c_o=$lt_[]_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)
7594
7595# Must we lock files when doing compilation?
7596need_locks=$lt_need_locks
7597
7598# Do we need the lib prefix for modules?
7599need_lib_prefix=$need_lib_prefix
7600
7601# Do we need a version for libraries?
7602need_version=$need_version
7603
7604# Whether dlopen is supported.
7605dlopen_support=$enable_dlopen
7606
7607# Whether dlopen of programs is supported.
7608dlopen_self=$enable_dlopen_self
7609
7610# Whether dlopen of statically linked programs is supported.
7611dlopen_self_static=$enable_dlopen_self_static
7612
7613# Compiler flag to prevent dynamic linking.
7614link_static_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_static, $1)
7615
7616# Compiler flag to turn off builtin functions.
7617no_builtin_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)
7618
7619# Compiler flag to allow reflexive dlopens.
7620export_dynamic_flag_spec=$lt_[]_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)
7621
7622# Compiler flag to generate shared objects directly from archives.
7623whole_archive_flag_spec=$lt_[]_LT_AC_TAGVAR(whole_archive_flag_spec, $1)
7624
7625# Compiler flag to generate thread-safe objects.
7626thread_safe_flag_spec=$lt_[]_LT_AC_TAGVAR(thread_safe_flag_spec, $1)
7627
7628# Library versioning type.
7629version_type=$version_type
7630
7631# Format of library name prefix.
7632libname_spec=$lt_libname_spec
7633
7634# List of archive names.  First name is the real one, the rest are links.
7635# The last name is the one that the linker finds with -lNAME.
7636library_names_spec=$lt_library_names_spec
7637
7638# The coded name of the library, if different from the real name.
7639soname_spec=$lt_soname_spec
7640
7641# Commands used to build and install an old-style archive.
7642RANLIB=$lt_RANLIB
7643old_archive_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_cmds, $1)
7644old_postinstall_cmds=$lt_old_postinstall_cmds
7645old_postuninstall_cmds=$lt_old_postuninstall_cmds
7646
7647# Create an old-style archive from a shared archive.
7648old_archive_from_new_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_new_cmds, $1)
7649
7650# Create a temporary old-style archive to link instead of a shared archive.
7651old_archive_from_expsyms_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)
7652
7653# Commands used to build and install a shared archive.
7654archive_cmds=$lt_[]_LT_AC_TAGVAR(archive_cmds, $1)
7655archive_expsym_cmds=$lt_[]_LT_AC_TAGVAR(archive_expsym_cmds, $1)
7656postinstall_cmds=$lt_postinstall_cmds
7657postuninstall_cmds=$lt_postuninstall_cmds
7658
7659# Commands used to build a loadable module (assumed same as above if empty)
7660module_cmds=$lt_[]_LT_AC_TAGVAR(module_cmds, $1)
7661module_expsym_cmds=$lt_[]_LT_AC_TAGVAR(module_expsym_cmds, $1)
7662
7663# Commands to strip libraries.
7664old_striplib=$lt_old_striplib
7665striplib=$lt_striplib
7666
7667# Dependencies to place before the objects being linked to create a
7668# shared library.
7669predep_objects=$lt_[]_LT_AC_TAGVAR(predep_objects, $1)
7670
7671# Dependencies to place after the objects being linked to create a
7672# shared library.
7673postdep_objects=$lt_[]_LT_AC_TAGVAR(postdep_objects, $1)
7674
7675# Dependencies to place before the objects being linked to create a
7676# shared library.
7677predeps=$lt_[]_LT_AC_TAGVAR(predeps, $1)
7678
7679# Dependencies to place after the objects being linked to create a
7680# shared library.
7681postdeps=$lt_[]_LT_AC_TAGVAR(postdeps, $1)
7682
7683# The directories searched by this compiler when creating a shared
7684# library
7685compiler_lib_search_dirs=$lt_[]_LT_AC_TAGVAR(compiler_lib_search_dirs, $1)
7686
7687# The library search path used internally by the compiler when linking
7688# a shared library.
7689compiler_lib_search_path=$lt_[]_LT_AC_TAGVAR(compiler_lib_search_path, $1)
7690
7691# Method to check whether dependent libraries are shared objects.
7692deplibs_check_method=$lt_deplibs_check_method
7693
7694# Command to use when deplibs_check_method == file_magic.
7695file_magic_cmd=$lt_file_magic_cmd
7696
7697# Flag that allows shared libraries with undefined symbols to be built.
7698allow_undefined_flag=$lt_[]_LT_AC_TAGVAR(allow_undefined_flag, $1)
7699
7700# Flag that forces no undefined symbols.
7701no_undefined_flag=$lt_[]_LT_AC_TAGVAR(no_undefined_flag, $1)
7702
7703# Commands used to finish a libtool library installation in a directory.
7704finish_cmds=$lt_finish_cmds
7705
7706# Same as above, but a single script fragment to be evaled but not shown.
7707finish_eval=$lt_finish_eval
7708
7709# Take the output of nm and produce a listing of raw symbols and C names.
7710global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
7711
7712# Transform the output of nm in a proper C declaration
7713global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
7714
7715# Transform the output of nm in a C name address pair
7716global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
7717
7718# This is the shared library runtime path variable.
7719runpath_var=$runpath_var
7720
7721# This is the shared library path variable.
7722shlibpath_var=$shlibpath_var
7723
7724# Is shlibpath searched before the hard-coded library search path?
7725shlibpath_overrides_runpath=$shlibpath_overrides_runpath
7726
7727# How to hardcode a shared library path into an executable.
7728hardcode_action=$_LT_AC_TAGVAR(hardcode_action, $1)
7729
7730# Whether we should hardcode library paths into libraries.
7731hardcode_into_libs=$hardcode_into_libs
7732
7733# Flag to hardcode \$libdir into a binary during linking.
7734# This must work even if \$libdir does not exist.
7735hardcode_libdir_flag_spec=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)
7736
7737# If ld is used when linking, flag to hardcode \$libdir into
7738# a binary during linking. This must work even if \$libdir does
7739# not exist.
7740hardcode_libdir_flag_spec_ld=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)
7741
7742# Whether we need a single -rpath flag with a separated argument.
7743hardcode_libdir_separator=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_separator, $1)
7744
7745# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
7746# resulting binary.
7747hardcode_direct=$_LT_AC_TAGVAR(hardcode_direct, $1)
7748
7749# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
7750# resulting binary.
7751hardcode_minus_L=$_LT_AC_TAGVAR(hardcode_minus_L, $1)
7752
7753# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
7754# the resulting binary.
7755hardcode_shlibpath_var=$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)
7756
7757# Set to yes if building a shared library automatically hardcodes DIR into the library
7758# and all subsequent libraries and executables linked against it.
7759hardcode_automatic=$_LT_AC_TAGVAR(hardcode_automatic, $1)
7760
7761# Variables whose values should be saved in libtool wrapper scripts and
7762# restored at relink time.
7763variables_saved_for_relink="$variables_saved_for_relink"
7764
7765# Whether libtool must link a program against all its dependency libraries.
7766link_all_deplibs=$_LT_AC_TAGVAR(link_all_deplibs, $1)
7767
7768# Compile-time system search path for libraries
7769sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
7770
7771# Run-time system search path for libraries
7772sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
7773
7774# Fix the shell variable \$srcfile for the compiler.
7775fix_srcfile_path=$lt_fix_srcfile_path
7776
7777# Set to yes if exported symbols are required.
7778always_export_symbols=$_LT_AC_TAGVAR(always_export_symbols, $1)
7779
7780# The commands to list exported symbols.
7781export_symbols_cmds=$lt_[]_LT_AC_TAGVAR(export_symbols_cmds, $1)
7782
7783# The commands to extract the exported symbol list from a shared archive.
7784extract_expsyms_cmds=$lt_extract_expsyms_cmds
7785
7786# Symbols that should not be listed in the preloaded symbols.
7787exclude_expsyms=$lt_[]_LT_AC_TAGVAR(exclude_expsyms, $1)
7788
7789# Symbols that must always be exported.
7790include_expsyms=$lt_[]_LT_AC_TAGVAR(include_expsyms, $1)
7791
7792ifelse([$1],[],
7793[# ### END LIBTOOL CONFIG],
7794[# ### END LIBTOOL TAG CONFIG: $tagname])
7795
7796__EOF__
7797
7798ifelse([$1],[], [
7799  case $host_os in
7800  aix3*)
7801    cat <<\EOF >> "$cfgfile"
7802
7803# AIX sometimes has problems with the GCC collect2 program.  For some
7804# reason, if we set the COLLECT_NAMES environment variable, the problems
7805# vanish in a puff of smoke.
7806if test "X${COLLECT_NAMES+set}" != Xset; then
7807  COLLECT_NAMES=
7808  export COLLECT_NAMES
7809fi
7810EOF
7811    ;;
7812  esac
7813
7814  # We use sed instead of cat because bash on DJGPP gets confused if
7815  # if finds mixed CR/LF and LF-only lines.  Since sed operates in
7816  # text mode, it properly converts lines to CR/LF.  This bash problem
7817  # is reportedly fixed, but why not run on old versions too?
7818  sed '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1)
7819
7820  mv -f "$cfgfile" "$ofile" || \
7821    (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
7822  chmod +x "$ofile"
7823])
7824else
7825  # If there is no Makefile yet, we rely on a make rule to execute
7826  # `config.status --recheck' to rerun these tests and create the
7827  # libtool script then.
7828  ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
7829  if test -f "$ltmain_in"; then
7830    test -f Makefile && make "$ltmain"
7831  fi
7832fi
7833])# AC_LIBTOOL_CONFIG
7834
7835
7836# AC_LIBTOOL_PROG_COMPILER_NO_RTTI([TAGNAME])
7837# -------------------------------------------
7838AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI],
7839[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
7840
7841_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
7842
7843if test "$GCC" = yes; then
7844  _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
7845
7846  AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
7847    lt_cv_prog_compiler_rtti_exceptions,
7848    [-fno-rtti -fno-exceptions], [],
7849    [_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
7850fi
7851])# AC_LIBTOOL_PROG_COMPILER_NO_RTTI
7852
7853
7854# AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
7855# ---------------------------------
7856AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE],
7857[AC_REQUIRE([AC_CANONICAL_HOST])
7858AC_REQUIRE([LT_AC_PROG_SED])
7859AC_REQUIRE([AC_PROG_NM])
7860AC_REQUIRE([AC_OBJEXT])
7861# Check for command to grab the raw symbol name followed by C symbol from nm.
7862AC_MSG_CHECKING([command to parse $NM output from $compiler object])
7863AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
7864[
7865# These are sane defaults that work on at least a few old systems.
7866# [They come from Ultrix.  What could be older than Ultrix?!! ;)]
7867
7868# Character class describing NM global symbol codes.
7869symcode='[[BCDEGRST]]'
7870
7871# Regexp to match symbols that can be accessed directly from C.
7872sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
7873
7874# Transform an extracted symbol line into a proper C declaration
7875lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'"
7876
7877# Transform an extracted symbol line into symbol name and symbol address
7878lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/  {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (lt_ptr) \&\2},/p'"
7879
7880# Define system-specific variables.
7881case $host_os in
7882aix*)
7883  symcode='[[BCDT]]'
7884  ;;
7885cygwin* | mingw* | pw32*)
7886  symcode='[[ABCDGISTW]]'
7887  ;;
7888hpux*) # Its linker distinguishes data from code symbols
7889  if test "$host_cpu" = ia64; then
7890    symcode='[[ABCDEGRST]]'
7891  fi
7892  lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
7893  lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/  {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (lt_ptr) \&\2},/p'"
7894  ;;
7895linux* | k*bsd*-gnu)
7896  if test "$host_cpu" = ia64; then
7897    symcode='[[ABCDGIRSTW]]'
7898    lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
7899    lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/  {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (lt_ptr) \&\2},/p'"
7900  fi
7901  ;;
7902irix* | nonstopux*)
7903  symcode='[[BCDEGRST]]'
7904  ;;
7905osf*)
7906  symcode='[[BCDEGQRST]]'
7907  ;;
7908solaris*)
7909  symcode='[[BDRT]]'
7910  ;;
7911sco3.2v5*)
7912  symcode='[[DT]]'
7913  ;;
7914sysv4.2uw2*)
7915  symcode='[[DT]]'
7916  ;;
7917sysv5* | sco5v6* | unixware* | OpenUNIX*)
7918  symcode='[[ABDT]]'
7919  ;;
7920sysv4)
7921  symcode='[[DFNSTU]]'
7922  ;;
7923esac
7924
7925# Handle CRLF in mingw tool chain
7926opt_cr=
7927case $build_os in
7928mingw*)
7929  opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp
7930  ;;
7931esac
7932
7933# If we're using GNU nm, then use its standard symbol codes.
7934case `$NM -V 2>&1` in
7935*GNU* | *'with BFD'*)
7936  symcode='[[ABCDGIRSTW]]' ;;
7937esac
7938
7939# Try without a prefix undercore, then with it.
7940for ac_symprfx in "" "_"; do
7941
7942  # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
7943  symxfrm="\\1 $ac_symprfx\\2 \\2"
7944
7945  # Write the raw and C identifiers.
7946  lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ 	]]\($symcode$symcode*\)[[ 	]][[ 	]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
7947
7948  # Check to see that the pipe works correctly.
7949  pipe_works=no
7950
7951  rm -f conftest*
7952  cat > conftest.$ac_ext <<EOF
7953#ifdef __cplusplus
7954extern "C" {
7955#endif
7956char nm_test_var;
7957void nm_test_func(){}
7958#ifdef __cplusplus
7959}
7960#endif
7961int main(){nm_test_var='a';nm_test_func();return(0);}
7962EOF
7963
7964  if AC_TRY_EVAL(ac_compile); then
7965    # Now try to grab the symbols.
7966    nlist=conftest.nm
7967    if AC_TRY_EVAL(NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) && test -s "$nlist"; then
7968      # Try sorting and uniquifying the output.
7969      if sort "$nlist" | uniq > "$nlist"T; then
7970	mv -f "$nlist"T "$nlist"
7971      else
7972	rm -f "$nlist"T
7973      fi
7974
7975      # Make sure that we snagged all the symbols we need.
7976      if grep ' nm_test_var$' "$nlist" >/dev/null; then
7977	if grep ' nm_test_func$' "$nlist" >/dev/null; then
7978	  cat <<EOF > conftest.$ac_ext
7979#ifdef __cplusplus
7980extern "C" {
7981#endif
7982
7983EOF
7984	  # Now generate the symbol file.
7985	  eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext'
7986
7987	  cat <<EOF >> conftest.$ac_ext
7988#if defined (__STDC__) && __STDC__
7989# define lt_ptr_t void *
7990#else
7991# define lt_ptr_t char *
7992# define const
7993#endif
7994
7995/* The mapping between symbol names and symbols. */
7996const struct {
7997  const char *name;
7998  lt_ptr_t address;
7999}
8000lt_preloaded_symbols[[]] =
8001{
8002EOF
8003	  $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext
8004	  cat <<\EOF >> conftest.$ac_ext
8005  {0, (lt_ptr_t) 0}
8006};
8007
8008#ifdef __cplusplus
8009}
8010#endif
8011EOF
8012	  # Now try linking the two files.
8013	  mv conftest.$ac_objext conftstm.$ac_objext
8014	  lt_save_LIBS="$LIBS"
8015	  lt_save_CFLAGS="$CFLAGS"
8016	  LIBS="conftstm.$ac_objext"
8017	  CFLAGS="$CFLAGS$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
8018	  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
8019	    pipe_works=yes
8020	  fi
8021	  LIBS="$lt_save_LIBS"
8022	  CFLAGS="$lt_save_CFLAGS"
8023	else
8024	  echo "cannot find nm_test_func in $nlist" >&5
8025	fi
8026      else
8027	echo "cannot find nm_test_var in $nlist" >&5
8028      fi
8029    else
8030      echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5
8031    fi
8032  else
8033    echo "$progname: failed program was:" >&5
8034    cat conftest.$ac_ext >&5
8035  fi
8036  rm -rf conftest* conftst*
8037
8038  # Do not use the global_symbol_pipe unless it works.
8039  if test "$pipe_works" = yes; then
8040    break
8041  else
8042    lt_cv_sys_global_symbol_pipe=
8043  fi
8044done
8045])
8046if test -z "$lt_cv_sys_global_symbol_pipe"; then
8047  lt_cv_sys_global_symbol_to_cdecl=
8048fi
8049if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
8050  AC_MSG_RESULT(failed)
8051else
8052  AC_MSG_RESULT(ok)
8053fi
8054]) # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
8055
8056
8057# AC_LIBTOOL_PROG_COMPILER_PIC([TAGNAME])
8058# ---------------------------------------
8059AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC],
8060[_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)=
8061_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
8062_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=
8063
8064AC_MSG_CHECKING([for $compiler option to produce PIC])
8065 ifelse([$1],[CXX],[
8066  # C++ specific cases for pic, static, wl, etc.
8067  if test "$GXX" = yes; then
8068    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
8069    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
8070
8071    case $host_os in
8072    aix*)
8073      # All AIX code is PIC.
8074      if test "$host_cpu" = ia64; then
8075	# AIX 5 now supports IA64 processor
8076	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
8077      fi
8078      ;;
8079    amigaos*)
8080      # FIXME: we need at least 68020 code to build shared libraries, but
8081      # adding the `-m68020' flag to GCC prevents building anything better,
8082      # like `-m68040'.
8083      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
8084      ;;
8085    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
8086      # PIC is the default for these OSes.
8087      ;;
8088    mingw* | cygwin* | os2* | pw32*)
8089      # This hack is so that the source file can tell whether it is being
8090      # built for inclusion in a dll (and should export symbols for example).
8091      # Although the cygwin gcc ignores -fPIC, still need this for old-style
8092      # (--disable-auto-import) libraries
8093	  _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'
8094      ;;
8095    darwin* | rhapsody*)
8096      # PIC is the default on this platform
8097      # Common symbols not allowed in MH_DYLIB files
8098      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
8099      ;;
8100    *djgpp*)
8101      # DJGPP does not support shared libraries at all
8102      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
8103      ;;
8104    interix[[3-9]]*)
8105      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
8106      # Instead, we relocate shared libraries at runtime.
8107      ;;
8108    sysv4*MP*)
8109      if test -d /usr/nec; then
8110	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
8111      fi
8112      ;;
8113    hpux*)
8114      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
8115      # not for PA HP-UX.
8116      case $host_cpu in
8117      hppa*64*|ia64*)
8118	;;
8119      *)
8120	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
8121	;;
8122      esac
8123      ;;
8124    *)
8125      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
8126      ;;
8127    esac
8128  else
8129    case $host_os in
8130      aix[[4-9]]*)
8131	# All AIX code is PIC.
8132	if test "$host_cpu" = ia64; then
8133	  # AIX 5 now supports IA64 processor
8134	  _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
8135	else
8136	  _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
8137	fi
8138	;;
8139      chorus*)
8140	case $cc_basename in
8141	cxch68*)
8142	  # Green Hills C++ Compiler
8143	  # _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a"
8144	  ;;
8145	esac
8146	;;
8147       darwin*)
8148         # PIC is the default on this platform
8149         # Common symbols not allowed in MH_DYLIB files
8150         case $cc_basename in
8151           xlc*)
8152           _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon'
8153           _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
8154           ;;
8155         esac
8156       ;;
8157      dgux*)
8158	case $cc_basename in
8159	  ec++*)
8160	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
8161	    ;;
8162	  ghcx*)
8163	    # Green Hills C++ Compiler
8164	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
8165	    ;;
8166	  *)
8167	    ;;
8168	esac
8169	;;
8170      freebsd* | dragonfly*)
8171	# FreeBSD uses GNU C++
8172	;;
8173      hpux9* | hpux10* | hpux11*)
8174	case $cc_basename in
8175	  CC*)
8176	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
8177	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
8178	    if test "$host_cpu" != ia64; then
8179	      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
8180	    fi
8181	    ;;
8182	  aCC*)
8183	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
8184	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
8185	    case $host_cpu in
8186	    hppa*64*|ia64*)
8187	      # +Z the default
8188	      ;;
8189	    *)
8190	      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
8191	      ;;
8192	    esac
8193	    ;;
8194	  *)
8195	    ;;
8196	esac
8197	;;
8198      interix*)
8199	# This is c89, which is MS Visual C++ (no shared libs)
8200	# Anyone wants to do a port?
8201	;;
8202      irix5* | irix6* | nonstopux*)
8203	case $cc_basename in
8204	  CC*)
8205	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
8206	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
8207	    # CC pic flag -KPIC is the default.
8208	    ;;
8209	  *)
8210	    ;;
8211	esac
8212	;;
8213      linux* | k*bsd*-gnu)
8214	case $cc_basename in
8215	  KCC*)
8216	    # KAI C++ Compiler
8217	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
8218	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
8219	    ;;
8220      ecpc*)
8221        # old Intel C++ for x86_64 which still supported -KPIC.
8222        _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
8223        _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
8224        _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
8225        ;;
8226      icpc*)
8227        # Intel C++, used to be incompatible with GCC.
8228        _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
8229        _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
8230        _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
8231        ;;
8232	  pgCC* | pgcpp*)
8233	    # Portland Group C++ compiler.
8234	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
8235	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
8236	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
8237	    ;;
8238	  cxx*)
8239	    # Compaq C++
8240	    # Make sure the PIC flag is empty.  It appears that all Alpha
8241	    # Linux and Compaq Tru64 Unix objects are PIC.
8242	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
8243	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
8244	    ;;
8245	  *)
8246	    case `$CC -V 2>&1 | sed 5q` in
8247	    *Sun\ C*)
8248	      # Sun C++ 5.9
8249	      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
8250	      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
8251	      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
8252	      ;;
8253	    esac
8254	    ;;
8255	esac
8256	;;
8257      lynxos*)
8258	;;
8259      m88k*)
8260	;;
8261      mvs*)
8262	case $cc_basename in
8263	  cxx*)
8264	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
8265	    ;;
8266	  *)
8267	    ;;
8268	esac
8269	;;
8270      netbsd*)
8271	;;
8272      osf3* | osf4* | osf5*)
8273	case $cc_basename in
8274	  KCC*)
8275	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
8276	    ;;
8277	  RCC*)
8278	    # Rational C++ 2.4.1
8279	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
8280	    ;;
8281	  cxx*)
8282	    # Digital/Compaq C++
8283	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
8284	    # Make sure the PIC flag is empty.  It appears that all Alpha
8285	    # Linux and Compaq Tru64 Unix objects are PIC.
8286	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
8287	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
8288	    ;;
8289	  *)
8290	    ;;
8291	esac
8292	;;
8293      psos*)
8294	;;
8295      solaris*)
8296	case $cc_basename in
8297	  CC*)
8298	    # Sun C++ 4.2, 5.x and Centerline C++
8299	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
8300	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
8301	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
8302	    ;;
8303	  gcx*)
8304	    # Green Hills C++ Compiler
8305	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
8306	    ;;
8307	  *)
8308	    ;;
8309	esac
8310	;;
8311      sunos4*)
8312	case $cc_basename in
8313	  CC*)
8314	    # Sun C++ 4.x
8315	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
8316	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
8317	    ;;
8318	  lcc*)
8319	    # Lucid
8320	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
8321	    ;;
8322	  *)
8323	    ;;
8324	esac
8325	;;
8326      tandem*)
8327	case $cc_basename in
8328	  NCC*)
8329	    # NonStop-UX NCC 3.20
8330	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
8331	    ;;
8332	  *)
8333	    ;;
8334	esac
8335	;;
8336      sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
8337	case $cc_basename in
8338	  CC*)
8339	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
8340	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
8341	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
8342	    ;;
8343	esac
8344	;;
8345      vxworks*)
8346	;;
8347      *)
8348	_LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
8349	;;
8350    esac
8351  fi
8352],
8353[
8354  if test "$GCC" = yes; then
8355    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
8356    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
8357
8358    case $host_os in
8359      aix*)
8360      # All AIX code is PIC.
8361      if test "$host_cpu" = ia64; then
8362	# AIX 5 now supports IA64 processor
8363	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
8364      fi
8365      ;;
8366
8367    amigaos*)
8368      # FIXME: we need at least 68020 code to build shared libraries, but
8369      # adding the `-m68020' flag to GCC prevents building anything better,
8370      # like `-m68040'.
8371      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
8372      ;;
8373
8374    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
8375      # PIC is the default for these OSes.
8376      ;;
8377
8378    mingw* | cygwin* | pw32* | os2*)
8379      # This hack is so that the source file can tell whether it is being
8380      # built for inclusion in a dll (and should export symbols for example).
8381      # Although the cygwin gcc ignores -fPIC, still need this for old-style
8382      # (--disable-auto-import) libraries
8383	  _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'
8384      ;;
8385
8386    darwin* | rhapsody*)
8387      # PIC is the default on this platform
8388      # Common symbols not allowed in MH_DYLIB files
8389      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
8390      ;;
8391
8392    interix[[3-9]]*)
8393      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
8394      # Instead, we relocate shared libraries at runtime.
8395      ;;
8396
8397    msdosdjgpp*)
8398      # Just because we use GCC doesn't mean we suddenly get shared libraries
8399      # on systems that don't support them.
8400      _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
8401      enable_shared=no
8402      ;;
8403
8404    sysv4*MP*)
8405      if test -d /usr/nec; then
8406	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
8407      fi
8408      ;;
8409
8410    hpux*)
8411      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
8412      # not for PA HP-UX.
8413      case $host_cpu in
8414      hppa*64*|ia64*)
8415	# +Z the default
8416	;;
8417      *)
8418	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
8419	;;
8420      esac
8421      ;;
8422
8423    *)
8424      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
8425      ;;
8426    esac
8427  else
8428    # PORTME Check for flag to pass linker flags through the system compiler.
8429    case $host_os in
8430    aix*)
8431      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
8432      if test "$host_cpu" = ia64; then
8433	# AIX 5 now supports IA64 processor
8434	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
8435      else
8436	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
8437      fi
8438      ;;
8439      darwin*)
8440        # PIC is the default on this platform
8441        # Common symbols not allowed in MH_DYLIB files
8442       case $cc_basename in
8443         xlc*)
8444         _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon'
8445         _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
8446         ;;
8447       esac
8448       ;;
8449
8450    mingw* | cygwin* | pw32* | os2*)
8451      # This hack is so that the source file can tell whether it is being
8452      # built for inclusion in a dll (and should export symbols for example).
8453	  _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'
8454      ;;
8455
8456    hpux9* | hpux10* | hpux11*)
8457      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
8458      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
8459      # not for PA HP-UX.
8460      case $host_cpu in
8461      hppa*64*|ia64*)
8462	# +Z the default
8463	;;
8464      *)
8465	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
8466	;;
8467      esac
8468      # Is there a better lt_prog_compiler_static that works with the bundled CC?
8469      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
8470      ;;
8471
8472    irix5* | irix6* | nonstopux*)
8473      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
8474      # PIC (with -KPIC) is the default.
8475      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
8476      ;;
8477
8478    newsos6)
8479      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
8480      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
8481      ;;
8482
8483    linux* | k*bsd*-gnu)
8484      case $cc_basename in
8485      # old Intel for x86_64 which still supported -KPIC.
8486      ecc*)
8487        _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
8488        _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
8489        _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
8490        ;;
8491      # icc used to be incompatible with GCC.
8492      # ICC 10 doesn't accept -KPIC any more.
8493      icc*)
8494        _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
8495        _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
8496        _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
8497        ;;
8498      pgcc* | pgf77* | pgf90* | pgf95*)
8499        # Portland Group compilers (*not* the Pentium gcc compiler,
8500	# which looks to be a dead project)
8501	_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
8502	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
8503	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
8504        ;;
8505      ccc*)
8506        _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
8507        # All Alpha code is PIC.
8508        _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
8509        ;;
8510      *)
8511        case `$CC -V 2>&1 | sed 5q` in
8512	*Sun\ C*)
8513	  # Sun C 5.9
8514	  _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
8515	  _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
8516	  _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
8517	  ;;
8518	*Sun\ F*)
8519	  # Sun Fortran 8.3 passes all unrecognized flags to the linker
8520	  _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
8521	  _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
8522	  _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)=''
8523	  ;;
8524	esac
8525	;;
8526      esac
8527      ;;
8528
8529    osf3* | osf4* | osf5*)
8530      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
8531      # All OSF/1 code is PIC.
8532      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
8533      ;;
8534
8535    rdos*)
8536      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
8537      ;;
8538
8539    solaris*)
8540      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
8541      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
8542      case $cc_basename in
8543      f77* | f90* | f95*)
8544	_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
8545      *)
8546	_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
8547      esac
8548      ;;
8549
8550    sunos4*)
8551      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
8552      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
8553      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
8554      ;;
8555
8556    sysv4 | sysv4.2uw2* | sysv4.3*)
8557      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
8558      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
8559      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
8560      ;;
8561
8562    sysv4*MP*)
8563      if test -d /usr/nec ;then
8564	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
8565	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
8566      fi
8567      ;;
8568
8569    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
8570      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
8571      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
8572      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
8573      ;;
8574
8575    unicos*)
8576      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
8577      _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
8578      ;;
8579
8580    uts4*)
8581      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
8582      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
8583      ;;
8584
8585    *)
8586      _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
8587      ;;
8588    esac
8589  fi
8590])
8591AC_MSG_RESULT([$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)])
8592
8593#
8594# Check to make sure the PIC flag actually works.
8595#
8596if test -n "$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)"; then
8597  AC_LIBTOOL_COMPILER_OPTION([if $compiler PIC flag $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) works],
8598    _LT_AC_TAGVAR(lt_cv_prog_compiler_pic_works, $1),
8599    [$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])], [],
8600    [case $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) in
8601     "" | " "*) ;;
8602     *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)" ;;
8603     esac],
8604    [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
8605     _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
8606fi
8607case $host_os in
8608  # For platforms which do not support PIC, -DPIC is meaningless:
8609  *djgpp*)
8610    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
8611    ;;
8612  *)
8613    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])"
8614    ;;
8615esac
8616
8617#
8618# Check to make sure the static flag actually works.
8619#
8620wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_AC_TAGVAR(lt_prog_compiler_static, $1)\"
8621AC_LIBTOOL_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],
8622  _LT_AC_TAGVAR(lt_cv_prog_compiler_static_works, $1),
8623  $lt_tmp_static_flag,
8624  [],
8625  [_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=])
8626])
8627
8628
8629# AC_LIBTOOL_PROG_LD_SHLIBS([TAGNAME])
8630# ------------------------------------
8631# See if the linker supports building shared libraries.
8632AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS],
8633[AC_REQUIRE([LT_AC_PROG_SED])dnl
8634AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
8635ifelse([$1],[CXX],[
8636  _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
8637  case $host_os in
8638  aix[[4-9]]*)
8639    # If we're using GNU nm, then we don't want the "-C" option.
8640    # -C means demangle to AIX nm, but means don't demangle with GNU nm
8641    if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
8642      _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols'
8643    else
8644      _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols'
8645    fi
8646    ;;
8647  pw32*)
8648    _LT_AC_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
8649  ;;
8650  cygwin* | mingw*)
8651    _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;/^.*[[ ]]__nm__/s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols'
8652  ;;
8653  *)
8654    _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
8655  ;;
8656  esac
8657  _LT_AC_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
8658],[
8659  runpath_var=
8660  _LT_AC_TAGVAR(allow_undefined_flag, $1)=
8661  _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no
8662  _LT_AC_TAGVAR(archive_cmds, $1)=
8663  _LT_AC_TAGVAR(archive_expsym_cmds, $1)=
8664  _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)=
8665  _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)=
8666  _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
8667  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
8668  _LT_AC_TAGVAR(thread_safe_flag_spec, $1)=
8669  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
8670  _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
8671  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
8672  _LT_AC_TAGVAR(hardcode_direct, $1)=no
8673  _LT_AC_TAGVAR(hardcode_minus_L, $1)=no
8674  _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
8675  _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
8676  _LT_AC_TAGVAR(hardcode_automatic, $1)=no
8677  _LT_AC_TAGVAR(module_cmds, $1)=
8678  _LT_AC_TAGVAR(module_expsym_cmds, $1)=
8679  _LT_AC_TAGVAR(always_export_symbols, $1)=no
8680  _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
8681  # include_expsyms should be a list of space-separated symbols to be *always*
8682  # included in the symbol list
8683  _LT_AC_TAGVAR(include_expsyms, $1)=
8684  # exclude_expsyms can be an extended regexp of symbols to exclude
8685  # it will be wrapped by ` (' and `)$', so one must not match beginning or
8686  # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
8687  # as well as any symbol that contains `d'.
8688  _LT_AC_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
8689  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
8690  # platforms (ab)use it in PIC code, but their linkers get confused if
8691  # the symbol is explicitly referenced.  Since portable code cannot
8692  # rely on this symbol name, it's probably fine to never include it in
8693  # preloaded symbol tables.
8694  # Exclude shared library initialization/finalization symbols.
8695dnl Note also adjust exclude_expsyms for C++ above.
8696  extract_expsyms_cmds=
8697  # Just being paranoid about ensuring that cc_basename is set.
8698  _LT_CC_BASENAME([$compiler])
8699  case $host_os in
8700  cygwin* | mingw* | pw32*)
8701    # FIXME: the MSVC++ port hasn't been tested in a loooong time
8702    # When not using gcc, we currently assume that we are using
8703    # Microsoft Visual C++.
8704    if test "$GCC" != yes; then
8705      with_gnu_ld=no
8706    fi
8707    ;;
8708  interix*)
8709    # we just hope/assume this is gcc and not c89 (= MSVC++)
8710    with_gnu_ld=yes
8711    ;;
8712  openbsd*)
8713    with_gnu_ld=no
8714    ;;
8715  esac
8716
8717  _LT_AC_TAGVAR(ld_shlibs, $1)=yes
8718  if test "$with_gnu_ld" = yes; then
8719    # If archive_cmds runs LD, not CC, wlarc should be empty
8720    wlarc='${wl}'
8721
8722    # Set some defaults for GNU ld with shared library support. These
8723    # are reset later if shared libraries are not supported. Putting them
8724    # here allows them to be overridden if necessary.
8725    runpath_var=LD_RUN_PATH
8726    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
8727    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
8728    # ancient GNU ld didn't support --whole-archive et. al.
8729    if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then
8730	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
8731      else
8732  	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
8733    fi
8734    supports_anon_versioning=no
8735    case `$LD -v 2>/dev/null` in
8736      *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
8737      *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
8738      *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
8739      *\ 2.11.*) ;; # other 2.11 versions
8740      *) supports_anon_versioning=yes ;;
8741    esac
8742
8743    # See if GNU ld supports shared libraries.
8744    case $host_os in
8745    aix[[3-9]]*)
8746      # On AIX/PPC, the GNU linker is very broken
8747      if test "$host_cpu" != ia64; then
8748	_LT_AC_TAGVAR(ld_shlibs, $1)=no
8749	cat <<EOF 1>&2
8750
8751*** Warning: the GNU linker, at least up to release 2.9.1, is reported
8752*** to be unable to reliably create shared libraries on AIX.
8753*** Therefore, libtool is disabling shared libraries support.  If you
8754*** really care for shared libraries, you may want to modify your PATH
8755*** so that a non-GNU linker is found, and then restart.
8756
8757EOF
8758      fi
8759      ;;
8760
8761    amigaos*)
8762      _LT_AC_TAGVAR(archive_cmds, $1)='$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)'
8763      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
8764      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
8765
8766      # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
8767      # that the semantics of dynamic libraries on AmigaOS, at least up
8768      # to version 4, is to share data among multiple programs linked
8769      # with the same dynamic library.  Since this doesn't match the
8770      # behavior of shared libraries on other platforms, we can't use
8771      # them.
8772      _LT_AC_TAGVAR(ld_shlibs, $1)=no
8773      ;;
8774
8775    beos*)
8776      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
8777	_LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
8778	# Joseph Beckenbach <jrb3@best.com> says some releases of gcc
8779	# support --undefined.  This deserves some investigation.  FIXME
8780	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
8781      else
8782	_LT_AC_TAGVAR(ld_shlibs, $1)=no
8783      fi
8784      ;;
8785
8786    cygwin* | mingw* | pw32*)
8787      # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
8788      # as there is no search path for DLLs.
8789      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
8790      _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
8791      _LT_AC_TAGVAR(always_export_symbols, $1)=no
8792      _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
8793      _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/'\'' -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols'
8794
8795      if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
8796        _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
8797	# If the export-symbols file already is a .def file (1st line
8798	# is EXPORTS), use it as is; otherwise, prepend...
8799	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
8800	  cp $export_symbols $output_objdir/$soname.def;
8801	else
8802	  echo EXPORTS > $output_objdir/$soname.def;
8803	  cat $export_symbols >> $output_objdir/$soname.def;
8804	fi~
8805	$CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
8806      else
8807	_LT_AC_TAGVAR(ld_shlibs, $1)=no
8808      fi
8809      ;;
8810
8811    interix[[3-9]]*)
8812      _LT_AC_TAGVAR(hardcode_direct, $1)=no
8813      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
8814      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
8815      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
8816      # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
8817      # Instead, shared libraries are loaded at an image base (0x10000000 by
8818      # default) and relocated if they conflict, which is a slow very memory
8819      # consuming and fragmenting process.  To avoid this, we pick a random,
8820      # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
8821      # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
8822      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
8823      _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
8824      ;;
8825
8826    gnu* | linux* | k*bsd*-gnu)
8827      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
8828	tmp_addflag=
8829	case $cc_basename,$host_cpu in
8830	pgcc*)				# Portland Group C compiler
8831	  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
8832	  tmp_addflag=' $pic_flag'
8833	  ;;
8834	pgf77* | pgf90* | pgf95*)	# Portland Group f77 and f90 compilers
8835	  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
8836	  tmp_addflag=' $pic_flag -Mnomain' ;;
8837	ecc*,ia64* | icc*,ia64*)		# Intel C compiler on ia64
8838	  tmp_addflag=' -i_dynamic' ;;
8839	efc*,ia64* | ifort*,ia64*)	# Intel Fortran compiler on ia64
8840	  tmp_addflag=' -i_dynamic -nofor_main' ;;
8841	ifc* | ifort*)			# Intel Fortran compiler
8842	  tmp_addflag=' -nofor_main' ;;
8843	esac
8844	case `$CC -V 2>&1 | sed 5q` in
8845	*Sun\ C*)			# Sun C 5.9
8846	  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
8847	  tmp_sharedflag='-G' ;;
8848	*Sun\ F*)			# Sun Fortran 8.3
8849	  tmp_sharedflag='-G' ;;
8850	*)
8851	  tmp_sharedflag='-shared' ;;
8852	esac
8853	_LT_AC_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
8854
8855	if test $supports_anon_versioning = yes; then
8856	  _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $output_objdir/$libname.ver~
8857  cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
8858  $echo "local: *; };" >> $output_objdir/$libname.ver~
8859	  $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
8860	fi
8861      else
8862	_LT_AC_TAGVAR(ld_shlibs, $1)=no
8863      fi
8864      ;;
8865
8866    netbsd*)
8867      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
8868	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
8869	wlarc=
8870      else
8871	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
8872	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
8873      fi
8874      ;;
8875
8876    solaris*)
8877      if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
8878	_LT_AC_TAGVAR(ld_shlibs, $1)=no
8879	cat <<EOF 1>&2
8880
8881*** Warning: The releases 2.8.* of the GNU linker cannot reliably
8882*** create shared libraries on Solaris systems.  Therefore, libtool
8883*** is disabling shared libraries support.  We urge you to upgrade GNU
8884*** binutils to release 2.9.1 or newer.  Another option is to modify
8885*** your PATH or compiler configuration so that the native linker is
8886*** used, and then restart.
8887
8888EOF
8889      elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
8890	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
8891	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
8892      else
8893	_LT_AC_TAGVAR(ld_shlibs, $1)=no
8894      fi
8895      ;;
8896
8897    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
8898      case `$LD -v 2>&1` in
8899        *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*)
8900	_LT_AC_TAGVAR(ld_shlibs, $1)=no
8901	cat <<_LT_EOF 1>&2
8902
8903*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
8904*** reliably create shared libraries on SCO systems.  Therefore, libtool
8905*** is disabling shared libraries support.  We urge you to upgrade GNU
8906*** binutils to release 2.16.91.0.3 or newer.  Another option is to modify
8907*** your PATH or compiler configuration so that the native linker is
8908*** used, and then restart.
8909
8910_LT_EOF
8911	;;
8912	*)
8913	  if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
8914	    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`'
8915	    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib'
8916	    _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib'
8917	  else
8918	    _LT_AC_TAGVAR(ld_shlibs, $1)=no
8919	  fi
8920	;;
8921      esac
8922      ;;
8923
8924    sunos4*)
8925      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
8926      wlarc=
8927      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
8928      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
8929      ;;
8930
8931    *)
8932      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
8933	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
8934	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
8935      else
8936	_LT_AC_TAGVAR(ld_shlibs, $1)=no
8937      fi
8938      ;;
8939    esac
8940
8941    if test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no; then
8942      runpath_var=
8943      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
8944      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
8945      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
8946    fi
8947  else
8948    # PORTME fill in a description of your system's linker (not GNU ld)
8949    case $host_os in
8950    aix3*)
8951      _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
8952      _LT_AC_TAGVAR(always_export_symbols, $1)=yes
8953      _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
8954      # Note: this linker hardcodes the directories in LIBPATH if there
8955      # are no directories specified by -L.
8956      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
8957      if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
8958	# Neither direct hardcoding nor static linking is supported with a
8959	# broken collect2.
8960	_LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
8961      fi
8962      ;;
8963
8964    aix[[4-9]]*)
8965      if test "$host_cpu" = ia64; then
8966	# On IA64, the linker does run time linking by default, so we don't
8967	# have to do anything special.
8968	aix_use_runtimelinking=no
8969	exp_sym_flag='-Bexport'
8970	no_entry_flag=""
8971      else
8972	# If we're using GNU nm, then we don't want the "-C" option.
8973	# -C means demangle to AIX nm, but means don't demangle with GNU nm
8974	if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
8975	  _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols'
8976	else
8977	  _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols'
8978	fi
8979	aix_use_runtimelinking=no
8980
8981	# Test if we are trying to use run time linking or normal
8982	# AIX style linking. If -brtl is somewhere in LDFLAGS, we
8983	# need to do runtime linking.
8984	case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
8985	  for ld_flag in $LDFLAGS; do
8986  	  if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
8987  	    aix_use_runtimelinking=yes
8988  	    break
8989  	  fi
8990	  done
8991	  ;;
8992	esac
8993
8994	exp_sym_flag='-bexport'
8995	no_entry_flag='-bnoentry'
8996      fi
8997
8998      # When large executables or shared objects are built, AIX ld can
8999      # have problems creating the table of contents.  If linking a library
9000      # or program results in "error TOC overflow" add -mminimal-toc to
9001      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
9002      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
9003
9004      _LT_AC_TAGVAR(archive_cmds, $1)=''
9005      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
9006      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
9007      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
9008
9009      if test "$GCC" = yes; then
9010	case $host_os in aix4.[[012]]|aix4.[[012]].*)
9011	# We only want to do this on AIX 4.2 and lower, the check
9012	# below for broken collect2 doesn't work under 4.3+
9013	  collect2name=`${CC} -print-prog-name=collect2`
9014	  if test -f "$collect2name" && \
9015  	   strings "$collect2name" | grep resolve_lib_name >/dev/null
9016	  then
9017  	  # We have reworked collect2
9018  	  :
9019	  else
9020  	  # We have old collect2
9021  	  _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
9022  	  # It fails to find uninstalled libraries when the uninstalled
9023  	  # path is not listed in the libpath.  Setting hardcode_minus_L
9024  	  # to unsupported forces relinking
9025  	  _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
9026  	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
9027  	  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
9028	  fi
9029	  ;;
9030	esac
9031	shared_flag='-shared'
9032	if test "$aix_use_runtimelinking" = yes; then
9033	  shared_flag="$shared_flag "'${wl}-G'
9034	fi
9035      else
9036	# not using gcc
9037	if test "$host_cpu" = ia64; then
9038  	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
9039  	# chokes on -Wl,-G. The following line is correct:
9040	  shared_flag='-G'
9041	else
9042	  if test "$aix_use_runtimelinking" = yes; then
9043	    shared_flag='${wl}-G'
9044	  else
9045	    shared_flag='${wl}-bM:SRE'
9046	  fi
9047	fi
9048      fi
9049
9050      # It seems that -bexpall does not export symbols beginning with
9051      # underscore (_), so it is better to generate a list of symbols to export.
9052      _LT_AC_TAGVAR(always_export_symbols, $1)=yes
9053      if test "$aix_use_runtimelinking" = yes; then
9054	# Warning - without using the other runtime loading flags (-brtl),
9055	# -berok will link without error, but may produce a broken library.
9056	_LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok'
9057       # Determine the default libpath from the value encoded in an empty executable.
9058       _LT_AC_SYS_LIBPATH_AIX
9059       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
9060	_LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
9061       else
9062	if test "$host_cpu" = ia64; then
9063	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
9064	  _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
9065	  _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
9066	else
9067	 # Determine the default libpath from the value encoded in an empty executable.
9068	 _LT_AC_SYS_LIBPATH_AIX
9069	 _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
9070	  # Warning - without using the other run time loading flags,
9071	  # -berok will link without error, but may produce a broken library.
9072	  _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
9073	  _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
9074	  # Exported symbols can be pulled into shared objects from archives
9075	  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
9076	  _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
9077	  # This is similar to how AIX traditionally builds its shared libraries.
9078	  _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
9079	fi
9080      fi
9081      ;;
9082
9083    amigaos*)
9084      _LT_AC_TAGVAR(archive_cmds, $1)='$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)'
9085      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
9086      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
9087      # see comment about different semantics on the GNU ld section
9088      _LT_AC_TAGVAR(ld_shlibs, $1)=no
9089      ;;
9090
9091    bsdi[[45]]*)
9092      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
9093      ;;
9094
9095    cygwin* | mingw* | pw32*)
9096      # When not using gcc, we currently assume that we are using
9097      # Microsoft Visual C++.
9098      # hardcode_libdir_flag_spec is actually meaningless, as there is
9099      # no search path for DLLs.
9100      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
9101      _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
9102      # Tell ltmain to make .lib files, not .a files.
9103      libext=lib
9104      # Tell ltmain to make .dll files, not .so files.
9105      shrext_cmds=".dll"
9106      # FIXME: Setting linknames here is a bad hack.
9107      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames='
9108      # The linker will automatically build a .lib file if we build a DLL.
9109      _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='true'
9110      # FIXME: Should let the user specify the lib program.
9111      _LT_AC_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
9112      _LT_AC_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`'
9113      _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
9114      ;;
9115
9116    darwin* | rhapsody*)
9117      case $host_os in
9118        rhapsody* | darwin1.[[012]])
9119         _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress'
9120         ;;
9121       *) # Darwin 1.3 on
9122         if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
9123           _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
9124         else
9125           case ${MACOSX_DEPLOYMENT_TARGET} in
9126             10.[[012]])
9127               _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
9128               ;;
9129             10.*)
9130               _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup'
9131               ;;
9132           esac
9133         fi
9134         ;;
9135      esac
9136      _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
9137      _LT_AC_TAGVAR(hardcode_direct, $1)=no
9138      _LT_AC_TAGVAR(hardcode_automatic, $1)=yes
9139      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
9140      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=''
9141      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
9142    if test "$GCC" = yes ; then
9143    	output_verbose_link_cmd='echo'
9144        _LT_AC_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
9145        _LT_AC_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
9146        _LT_AC_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
9147        _LT_AC_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
9148    else
9149      case $cc_basename in
9150        xlc*)
9151         output_verbose_link_cmd='echo'
9152         _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $xlcverstring'
9153         _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
9154          # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
9155         _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $xlcverstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
9156          _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
9157          ;;
9158       *)
9159         _LT_AC_TAGVAR(ld_shlibs, $1)=no
9160          ;;
9161      esac
9162    fi
9163      ;;
9164
9165    dgux*)
9166      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
9167      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
9168      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
9169      ;;
9170
9171    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
9172    # support.  Future versions do this automatically, but an explicit c++rt0.o
9173    # does not break anything, and helps significantly (at the cost of a little
9174    # extra space).
9175    freebsd2.2*)
9176      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
9177      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
9178      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
9179      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
9180      ;;
9181
9182    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
9183    freebsd2*)
9184      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
9185      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
9186      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
9187      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
9188      ;;
9189
9190    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
9191    freebsd* | dragonfly*)
9192      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
9193      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
9194      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
9195      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
9196      ;;
9197
9198    hpux9*)
9199      if test "$GCC" = yes; then
9200	_LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
9201      else
9202	_LT_AC_TAGVAR(archive_cmds, $1)='$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'
9203      fi
9204      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
9205      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
9206      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
9207
9208      # hardcode_minus_L: Not really in the search PATH,
9209      # but as the default location of the library.
9210      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
9211      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
9212      ;;
9213
9214    hpux10*)
9215      if test "$GCC" = yes -a "$with_gnu_ld" = no; then
9216	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
9217      else
9218	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
9219      fi
9220      if test "$with_gnu_ld" = no; then
9221	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
9222	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
9223
9224	_LT_AC_TAGVAR(hardcode_direct, $1)=yes
9225	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
9226
9227	# hardcode_minus_L: Not really in the search PATH,
9228	# but as the default location of the library.
9229	_LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
9230      fi
9231      ;;
9232
9233    hpux11*)
9234      if test "$GCC" = yes -a "$with_gnu_ld" = no; then
9235	case $host_cpu in
9236	hppa*64*)
9237	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
9238	  ;;
9239	ia64*)
9240	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
9241	  ;;
9242	*)
9243	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
9244	  ;;
9245	esac
9246      else
9247	case $host_cpu in
9248	hppa*64*)
9249	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
9250	  ;;
9251	ia64*)
9252	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
9253	  ;;
9254	*)
9255	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
9256	  ;;
9257	esac
9258      fi
9259      if test "$with_gnu_ld" = no; then
9260	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
9261	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
9262
9263	case $host_cpu in
9264	hppa*64*|ia64*)
9265	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
9266	  _LT_AC_TAGVAR(hardcode_direct, $1)=no
9267	  _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
9268	  ;;
9269	*)
9270	  _LT_AC_TAGVAR(hardcode_direct, $1)=yes
9271	  _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
9272
9273	  # hardcode_minus_L: Not really in the search PATH,
9274	  # but as the default location of the library.
9275	  _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
9276	  ;;
9277	esac
9278      fi
9279      ;;
9280
9281    irix5* | irix6* | nonstopux*)
9282      if test "$GCC" = yes; then
9283	_LT_AC_TAGVAR(archive_cmds, $1)='$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'
9284      else
9285	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
9286	_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir'
9287      fi
9288      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
9289      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
9290      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
9291      ;;
9292
9293    netbsd*)
9294      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
9295	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
9296      else
9297	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
9298      fi
9299      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
9300      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
9301      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
9302      ;;
9303
9304    newsos6)
9305      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
9306      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
9307      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
9308      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
9309      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
9310      ;;
9311
9312    openbsd*)
9313      if test -f /usr/libexec/ld.so; then
9314	_LT_AC_TAGVAR(hardcode_direct, $1)=yes
9315	_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
9316	if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
9317	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
9318	  _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
9319	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
9320	  _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
9321	else
9322	  case $host_os in
9323	   openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
9324	     _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
9325	     _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
9326	     ;;
9327	   *)
9328	     _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
9329	     _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
9330	     ;;
9331	  esac
9332        fi
9333      else
9334	_LT_AC_TAGVAR(ld_shlibs, $1)=no
9335      fi
9336      ;;
9337
9338    os2*)
9339      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
9340      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
9341      _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
9342      _LT_AC_TAGVAR(archive_cmds, $1)='$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'
9343      _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
9344      ;;
9345
9346    osf3*)
9347      if test "$GCC" = yes; then
9348	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
9349	_LT_AC_TAGVAR(archive_cmds, $1)='$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'
9350      else
9351	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
9352	_LT_AC_TAGVAR(archive_cmds, $1)='$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'
9353      fi
9354      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
9355      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
9356      ;;
9357
9358    osf4* | osf5*)	# as osf3* with the addition of -msym flag
9359      if test "$GCC" = yes; then
9360	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
9361	_LT_AC_TAGVAR(archive_cmds, $1)='$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'
9362	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
9363      else
9364	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
9365	_LT_AC_TAGVAR(archive_cmds, $1)='$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'
9366	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
9367	$LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp'
9368
9369	# Both c and cxx compiler support -rpath directly
9370	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
9371      fi
9372      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
9373      ;;
9374
9375    solaris*)
9376      _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text'
9377      if test "$GCC" = yes; then
9378	wlarc='${wl}'
9379	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
9380	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
9381	  $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp'
9382      else
9383	wlarc=''
9384	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
9385	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
9386  	$LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
9387      fi
9388      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
9389      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
9390      case $host_os in
9391      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
9392      *)
9393	# The compiler driver will combine and reorder linker options,
9394	# but understands `-z linker_flag'.  GCC discards it without `$wl',
9395	# but is careful enough not to reorder.
9396 	# Supported since Solaris 2.6 (maybe 2.5.1?)
9397	if test "$GCC" = yes; then
9398	  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
9399	else
9400	  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
9401	fi
9402	;;
9403      esac
9404      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
9405      ;;
9406
9407    sunos4*)
9408      if test "x$host_vendor" = xsequent; then
9409	# Use $CC to link under sequent, because it throws in some extra .o
9410	# files that make .init and .fini sections work.
9411	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
9412      else
9413	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
9414      fi
9415      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
9416      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
9417      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
9418      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
9419      ;;
9420
9421    sysv4)
9422      case $host_vendor in
9423	sni)
9424	  _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
9425	  _LT_AC_TAGVAR(hardcode_direct, $1)=yes # is this really true???
9426	;;
9427	siemens)
9428	  ## LD is ld it makes a PLAMLIB
9429	  ## CC just makes a GrossModule.
9430	  _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
9431	  _LT_AC_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
9432	  _LT_AC_TAGVAR(hardcode_direct, $1)=no
9433        ;;
9434	motorola)
9435	  _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
9436	  _LT_AC_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
9437	;;
9438      esac
9439      runpath_var='LD_RUN_PATH'
9440      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
9441      ;;
9442
9443    sysv4.3*)
9444      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
9445      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
9446      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
9447      ;;
9448
9449    sysv4*MP*)
9450      if test -d /usr/nec; then
9451	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
9452	_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
9453	runpath_var=LD_RUN_PATH
9454	hardcode_runpath_var=yes
9455	_LT_AC_TAGVAR(ld_shlibs, $1)=yes
9456      fi
9457      ;;
9458
9459    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
9460      _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
9461      _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
9462      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
9463      runpath_var='LD_RUN_PATH'
9464
9465      if test "$GCC" = yes; then
9466	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
9467	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
9468      else
9469	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
9470	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
9471      fi
9472      ;;
9473
9474    sysv5* | sco3.2v5* | sco5v6*)
9475      # Note: We can NOT use -z defs as we might desire, because we do not
9476      # link with -lc, and that would cause any symbols used from libc to
9477      # always be unresolved, which means just about no library would
9478      # ever link correctly.  If we're not using GNU ld we use -z text
9479      # though, which does catch some bad symbols but isn't as heavy-handed
9480      # as -z defs.
9481      _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
9482      _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
9483      _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
9484      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
9485      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
9486      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
9487      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
9488      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
9489      runpath_var='LD_RUN_PATH'
9490
9491      if test "$GCC" = yes; then
9492	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
9493	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
9494      else
9495	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
9496	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
9497      fi
9498      ;;
9499
9500    uts4*)
9501      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
9502      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
9503      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
9504      ;;
9505
9506    *)
9507      _LT_AC_TAGVAR(ld_shlibs, $1)=no
9508      ;;
9509    esac
9510  fi
9511])
9512AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)])
9513test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
9514
9515#
9516# Do we need to explicitly link libc?
9517#
9518case "x$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)" in
9519x|xyes)
9520  # Assume -lc should be added
9521  _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
9522
9523  if test "$enable_shared" = yes && test "$GCC" = yes; then
9524    case $_LT_AC_TAGVAR(archive_cmds, $1) in
9525    *'~'*)
9526      # FIXME: we may have to deal with multi-command sequences.
9527      ;;
9528    '$CC '*)
9529      # Test whether the compiler implicitly links with -lc since on some
9530      # systems, -lgcc has to come before -lc. If gcc already passes -lc
9531      # to ld, don't add -lc before -lgcc.
9532      AC_MSG_CHECKING([whether -lc should be explicitly linked in])
9533      $rm conftest*
9534      echo "$lt_simple_compile_test_code" > conftest.$ac_ext
9535
9536      if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
9537        soname=conftest
9538        lib=conftest
9539        libobjs=conftest.$ac_objext
9540        deplibs=
9541        wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)
9542	pic_flag=$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)
9543        compiler_flags=-v
9544        linker_flags=-v
9545        verstring=
9546        output_objdir=.
9547        libname=conftest
9548        lt_save_allow_undefined_flag=$_LT_AC_TAGVAR(allow_undefined_flag, $1)
9549        _LT_AC_TAGVAR(allow_undefined_flag, $1)=
9550        if AC_TRY_EVAL(_LT_AC_TAGVAR(archive_cmds, $1) 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1)
9551        then
9552	  _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
9553        else
9554	  _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
9555        fi
9556        _LT_AC_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
9557      else
9558        cat conftest.err 1>&5
9559      fi
9560      $rm conftest*
9561      AC_MSG_RESULT([$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)])
9562      ;;
9563    esac
9564  fi
9565  ;;
9566esac
9567])# AC_LIBTOOL_PROG_LD_SHLIBS
9568
9569
9570# _LT_AC_FILE_LTDLL_C
9571# -------------------
9572# Be careful that the start marker always follows a newline.
9573AC_DEFUN([_LT_AC_FILE_LTDLL_C], [
9574# /* ltdll.c starts here */
9575# #define WIN32_LEAN_AND_MEAN
9576# #include <windows.h>
9577# #undef WIN32_LEAN_AND_MEAN
9578# #include <stdio.h>
9579#
9580# #ifndef __CYGWIN__
9581# #  ifdef __CYGWIN32__
9582# #    define __CYGWIN__ __CYGWIN32__
9583# #  endif
9584# #endif
9585#
9586# #ifdef __cplusplus
9587# extern "C" {
9588# #endif
9589# BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved);
9590# #ifdef __cplusplus
9591# }
9592# #endif
9593#
9594# #ifdef __CYGWIN__
9595# #include <cygwin/cygwin_dll.h>
9596# DECLARE_CYGWIN_DLL( DllMain );
9597# #endif
9598# HINSTANCE __hDllInstance_base;
9599#
9600# BOOL APIENTRY
9601# DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved)
9602# {
9603#   __hDllInstance_base = hInst;
9604#   return TRUE;
9605# }
9606# /* ltdll.c ends here */
9607])# _LT_AC_FILE_LTDLL_C
9608
9609
9610# _LT_AC_TAGVAR(VARNAME, [TAGNAME])
9611# ---------------------------------
9612AC_DEFUN([_LT_AC_TAGVAR], [ifelse([$2], [], [$1], [$1_$2])])
9613
9614
9615# old names
9616AC_DEFUN([AM_PROG_LIBTOOL],   [AC_PROG_LIBTOOL])
9617AC_DEFUN([AM_ENABLE_SHARED],  [AC_ENABLE_SHARED($@)])
9618AC_DEFUN([AM_ENABLE_STATIC],  [AC_ENABLE_STATIC($@)])
9619AC_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
9620AC_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
9621AC_DEFUN([AM_PROG_LD],        [AC_PROG_LD])
9622AC_DEFUN([AM_PROG_NM],        [AC_PROG_NM])
9623
9624# This is just to silence aclocal about the macro not being used
9625ifelse([AC_DISABLE_FAST_INSTALL])
9626
9627############################################################
9628# NOTE: This macro has been submitted for inclusion into   #
9629#  GNU Autoconf as AC_PROG_SED.  When it is available in   #
9630#  a released version of Autoconf we should remove this    #
9631#  macro and use it instead.                               #
9632############################################################
9633# LT_AC_PROG_SED
9634# --------------
9635# Check for a fully-functional sed program, that truncates
9636# as few characters as possible.  Prefer GNU sed if found.
9637AC_DEFUN([LT_AC_PROG_SED],
9638[AC_MSG_CHECKING([for a sed that does not truncate output])
9639AC_CACHE_VAL(lt_cv_path_SED,
9640[# Loop through the user's path and test for sed and gsed.
9641# Then use that list of sed's as ones to test for truncation.
9642as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
9643for as_dir in $PATH
9644do
9645  IFS=$as_save_IFS
9646  test -z "$as_dir" && as_dir=.
9647  for lt_ac_prog in sed gsed; do
9648    for ac_exec_ext in '' $ac_executable_extensions; do
9649      if test -f "$as_dir/$lt_ac_prog$ac_exec_ext"; then
9650        lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
9651      fi
9652    done
9653  done
9654done
9655lt_ac_max=0
9656lt_ac_count=0
9657# Add /usr/xpg4/bin/sed as it is typically found on Solaris
9658# along with /bin/sed that truncates output.
9659for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
9660  test ! -f $lt_ac_sed && continue
9661  cat /dev/null > conftest.in
9662  lt_ac_count=0
9663  echo $ECHO_N "0123456789$ECHO_C" >conftest.in
9664  # Check for GNU sed and select it if it is found.
9665  if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
9666    lt_cv_path_SED=$lt_ac_sed
9667    break
9668  fi
9669  while true; do
9670    cat conftest.in conftest.in >conftest.tmp
9671    mv conftest.tmp conftest.in
9672    cp conftest.in conftest.nl
9673    echo >>conftest.nl
9674    $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
9675    cmp -s conftest.out conftest.nl || break
9676    # 10000 chars as input seems more than enough
9677    test $lt_ac_count -gt 10 && break
9678    lt_ac_count=`expr $lt_ac_count + 1`
9679    if test $lt_ac_count -gt $lt_ac_max; then
9680      lt_ac_max=$lt_ac_count
9681      lt_cv_path_SED=$lt_ac_sed
9682    fi
9683  done
9684done
9685])
9686SED=$lt_cv_path_SED
9687AC_MSG_RESULT([$SED])
9688])
9689