Browse code

merge mempool branch

git-svn: trunk@4320

aCaB authored on 2008/11/01 11:39:00
Showing 24 changed files
... ...
@@ -1,3 +1,18 @@
1
+Sat Nov  1 03:51:58 CET 2008 (acab)
2
+-----------------------------------
3
+ * mempool: New configure option --enable-mempool (requires mmap)
4
+	To overcome the memory fragmentation issue (bb#1063, bb#1028)
5
+	in clamd this option allows the databases to be loaded in
6
+	different memory "pools".
7
+	As soon as a database is no longer needed its pool is destroyed
8
+	and the memory is *really* returned to the system.
9
+	The performace is comparable to that of the glibc allocator,
10
+	when not better, however there is a small overhead (a few MB)
11
+	in the initial memory usage (but at least it no longer grows).
12
+	Thanks a lot sgran for the idea and nitrox for the extensive
13
+	testing. Please test and report any problem (expecially on
14
+	non-x86 and non-Linux setups).
15
+
1 16
 Thu Oct 30 17:18:28 CET 2008 (tk)
2 17
 ---------------------------------
3 18
  * V 0.94.1
... ...
@@ -130,6 +130,6658 @@ test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
130 130
 AC_LIB_PROG_LD_GNU
131 131
 ])
132 132
 
133
+# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
134
+
135
+# serial 52 Debian 1.5.26-4 AC_PROG_LIBTOOL
136
+
137
+
138
+# AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED)
139
+# -----------------------------------------------------------
140
+# If this macro is not defined by Autoconf, define it here.
141
+m4_ifdef([AC_PROVIDE_IFELSE],
142
+         [],
143
+         [m4_define([AC_PROVIDE_IFELSE],
144
+	         [m4_ifdef([AC_PROVIDE_$1],
145
+		           [$2], [$3])])])
146
+
147
+
148
+# AC_PROG_LIBTOOL
149
+# ---------------
150
+AC_DEFUN([AC_PROG_LIBTOOL],
151
+[AC_REQUIRE([_AC_PROG_LIBTOOL])dnl
152
+dnl If AC_PROG_CXX has already been expanded, run AC_LIBTOOL_CXX
153
+dnl immediately, otherwise, hook it in at the end of AC_PROG_CXX.
154
+  AC_PROVIDE_IFELSE([AC_PROG_CXX],
155
+    [AC_LIBTOOL_CXX],
156
+    [define([AC_PROG_CXX], defn([AC_PROG_CXX])[AC_LIBTOOL_CXX
157
+  ])])
158
+dnl And a similar setup for Fortran 77 support
159
+  AC_PROVIDE_IFELSE([AC_PROG_F77],
160
+    [AC_LIBTOOL_F77],
161
+    [define([AC_PROG_F77], defn([AC_PROG_F77])[AC_LIBTOOL_F77
162
+])])
163
+
164
+dnl Quote A][M_PROG_GCJ so that aclocal doesn't bring it in needlessly.
165
+dnl If either AC_PROG_GCJ or A][M_PROG_GCJ have already been expanded, run
166
+dnl AC_LIBTOOL_GCJ immediately, otherwise, hook it in at the end of both.
167
+  AC_PROVIDE_IFELSE([AC_PROG_GCJ],
168
+    [AC_LIBTOOL_GCJ],
169
+    [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
170
+      [AC_LIBTOOL_GCJ],
171
+      [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],
172
+	[AC_LIBTOOL_GCJ],
173
+      [ifdef([AC_PROG_GCJ],
174
+	     [define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])
175
+       ifdef([A][M_PROG_GCJ],
176
+	     [define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[AC_LIBTOOL_GCJ])])
177
+       ifdef([LT_AC_PROG_GCJ],
178
+	     [define([LT_AC_PROG_GCJ],
179
+		defn([LT_AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])])])
180
+])])# AC_PROG_LIBTOOL
181
+
182
+
183
+# _AC_PROG_LIBTOOL
184
+# ----------------
185
+AC_DEFUN([_AC_PROG_LIBTOOL],
186
+[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
187
+AC_BEFORE([$0],[AC_LIBTOOL_CXX])dnl
188
+AC_BEFORE([$0],[AC_LIBTOOL_F77])dnl
189
+AC_BEFORE([$0],[AC_LIBTOOL_GCJ])dnl
190
+
191
+# This can be used to rebuild libtool when needed
192
+LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh"
193
+
194
+# Always use our own libtool.
195
+LIBTOOL='$(SHELL) $(top_builddir)/libtool'
196
+AC_SUBST(LIBTOOL)dnl
197
+
198
+# Prevent multiple expansion
199
+define([AC_PROG_LIBTOOL], [])
200
+])# _AC_PROG_LIBTOOL
201
+
202
+
203
+# AC_LIBTOOL_SETUP
204
+# ----------------
205
+AC_DEFUN([AC_LIBTOOL_SETUP],
206
+[AC_PREREQ(2.50)dnl
207
+AC_REQUIRE([AC_ENABLE_SHARED])dnl
208
+AC_REQUIRE([AC_ENABLE_STATIC])dnl
209
+AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
210
+AC_REQUIRE([AC_CANONICAL_HOST])dnl
211
+AC_REQUIRE([AC_CANONICAL_BUILD])dnl
212
+AC_REQUIRE([AC_PROG_CC])dnl
213
+AC_REQUIRE([AC_PROG_LD])dnl
214
+AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl
215
+AC_REQUIRE([AC_PROG_NM])dnl
216
+
217
+AC_REQUIRE([AC_PROG_LN_S])dnl
218
+AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl
219
+# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers!
220
+AC_REQUIRE([AC_OBJEXT])dnl
221
+AC_REQUIRE([AC_EXEEXT])dnl
222
+dnl
223
+AC_LIBTOOL_SYS_MAX_CMD_LEN
224
+AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
225
+AC_LIBTOOL_OBJDIR
226
+
227
+AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
228
+_LT_AC_PROG_ECHO_BACKSLASH
229
+
230
+case $host_os in
231
+aix3*)
232
+  # AIX sometimes has problems with the GCC collect2 program.  For some
233
+  # reason, if we set the COLLECT_NAMES environment variable, the problems
234
+  # vanish in a puff of smoke.
235
+  if test "X${COLLECT_NAMES+set}" != Xset; then
236
+    COLLECT_NAMES=
237
+    export COLLECT_NAMES
238
+  fi
239
+  ;;
240
+esac
241
+
242
+# Sed substitution that helps us do robust quoting.  It backslashifies
243
+# metacharacters that are still active within double-quoted strings.
244
+Xsed='sed -e 1s/^X//'
245
+[sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g']
246
+
247
+# Same as above, but do not quote variable references.
248
+[double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g']
249
+
250
+# Sed substitution to delay expansion of an escaped shell variable in a
251
+# double_quote_subst'ed string.
252
+delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
253
+
254
+# Sed substitution to avoid accidental globbing in evaled expressions
255
+no_glob_subst='s/\*/\\\*/g'
256
+
257
+# Constants:
258
+rm="rm -f"
259
+
260
+# Global variables:
261
+default_ofile=libtool
262
+can_build_shared=yes
263
+
264
+# All known linkers require a `.a' archive for static linking (except MSVC,
265
+# which needs '.lib').
266
+libext=a
267
+ltmain="$ac_aux_dir/ltmain.sh"
268
+ofile="$default_ofile"
269
+with_gnu_ld="$lt_cv_prog_gnu_ld"
270
+
271
+AC_CHECK_TOOL(AR, ar, false)
272
+AC_CHECK_TOOL(RANLIB, ranlib, :)
273
+AC_CHECK_TOOL(STRIP, strip, :)
274
+
275
+old_CC="$CC"
276
+old_CFLAGS="$CFLAGS"
277
+
278
+# Set sane defaults for various variables
279
+test -z "$AR" && AR=ar
280
+test -z "$AR_FLAGS" && AR_FLAGS=cru
281
+test -z "$AS" && AS=as
282
+test -z "$CC" && CC=cc
283
+test -z "$LTCC" && LTCC=$CC
284
+test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
285
+test -z "$DLLTOOL" && DLLTOOL=dlltool
286
+test -z "$LD" && LD=ld
287
+test -z "$LN_S" && LN_S="ln -s"
288
+test -z "$MAGIC_CMD" && MAGIC_CMD=file
289
+test -z "$NM" && NM=nm
290
+test -z "$SED" && SED=sed
291
+test -z "$OBJDUMP" && OBJDUMP=objdump
292
+test -z "$RANLIB" && RANLIB=:
293
+test -z "$STRIP" && STRIP=:
294
+test -z "$ac_objext" && ac_objext=o
295
+
296
+# Determine commands to create old-style static archives.
297
+old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
298
+old_postinstall_cmds='chmod 644 $oldlib'
299
+old_postuninstall_cmds=
300
+
301
+if test -n "$RANLIB"; then
302
+  case $host_os in
303
+  openbsd*)
304
+    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib"
305
+    ;;
306
+  *)
307
+    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib"
308
+    ;;
309
+  esac
310
+  old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
311
+fi
312
+
313
+_LT_CC_BASENAME([$compiler])
314
+
315
+# Only perform the check for file, if the check method requires it
316
+case $deplibs_check_method in
317
+file_magic*)
318
+  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
319
+    AC_PATH_MAGIC
320
+  fi
321
+  ;;
322
+esac
323
+
324
+_LT_REQUIRED_DARWIN_CHECKS
325
+
326
+AC_PROVIDE_IFELSE([AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no)
327
+AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL],
328
+enable_win32_dll=yes, enable_win32_dll=no)
329
+
330
+AC_ARG_ENABLE([libtool-lock],
331
+    [AC_HELP_STRING([--disable-libtool-lock],
332
+	[avoid locking (might break parallel builds)])])
333
+test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
334
+
335
+AC_ARG_WITH([pic],
336
+    [AC_HELP_STRING([--with-pic],
337
+	[try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
338
+    [pic_mode="$withval"],
339
+    [pic_mode=default])
340
+test -z "$pic_mode" && pic_mode=default
341
+
342
+# Use C for the default configuration in the libtool script
343
+tagname=
344
+AC_LIBTOOL_LANG_C_CONFIG
345
+_LT_AC_TAGCONFIG
346
+])# AC_LIBTOOL_SETUP
347
+
348
+
349
+# _LT_AC_SYS_COMPILER
350
+# -------------------
351
+AC_DEFUN([_LT_AC_SYS_COMPILER],
352
+[AC_REQUIRE([AC_PROG_CC])dnl
353
+
354
+# If no C compiler was specified, use CC.
355
+LTCC=${LTCC-"$CC"}
356
+
357
+# If no C compiler flags were specified, use CFLAGS.
358
+LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
359
+
360
+# Allow CC to be a program name with arguments.
361
+compiler=$CC
362
+])# _LT_AC_SYS_COMPILER
363
+
364
+
365
+# _LT_CC_BASENAME(CC)
366
+# -------------------
367
+# Calculate cc_basename.  Skip known compiler wrappers and cross-prefix.
368
+AC_DEFUN([_LT_CC_BASENAME],
369
+[for cc_temp in $1""; do
370
+  case $cc_temp in
371
+    compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
372
+    distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
373
+    \-*) ;;
374
+    *) break;;
375
+  esac
376
+done
377
+cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
378
+])
379
+
380
+
381
+# _LT_COMPILER_BOILERPLATE
382
+# ------------------------
383
+# Check for compiler boilerplate output or warnings with
384
+# the simple compiler test code.
385
+AC_DEFUN([_LT_COMPILER_BOILERPLATE],
386
+[AC_REQUIRE([LT_AC_PROG_SED])dnl
387
+ac_outfile=conftest.$ac_objext
388
+echo "$lt_simple_compile_test_code" >conftest.$ac_ext
389
+eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
390
+_lt_compiler_boilerplate=`cat conftest.err`
391
+$rm conftest*
392
+])# _LT_COMPILER_BOILERPLATE
393
+
394
+
395
+# _LT_LINKER_BOILERPLATE
396
+# ----------------------
397
+# Check for linker boilerplate output or warnings with
398
+# the simple link test code.
399
+AC_DEFUN([_LT_LINKER_BOILERPLATE],
400
+[AC_REQUIRE([LT_AC_PROG_SED])dnl
401
+ac_outfile=conftest.$ac_objext
402
+echo "$lt_simple_link_test_code" >conftest.$ac_ext
403
+eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
404
+_lt_linker_boilerplate=`cat conftest.err`
405
+$rm -r conftest*
406
+])# _LT_LINKER_BOILERPLATE
407
+
408
+# _LT_REQUIRED_DARWIN_CHECKS
409
+# --------------------------
410
+# Check for some things on darwin
411
+AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS],[
412
+  case $host_os in
413
+    rhapsody* | darwin*)
414
+    AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:])
415
+    AC_CHECK_TOOL([NMEDIT], [nmedit], [:])
416
+
417
+    AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod],
418
+      [lt_cv_apple_cc_single_mod=no
419
+      if test -z "${LT_MULTI_MODULE}"; then
420
+   # By default we will add the -single_module flag. You can override
421
+   # by either setting the environment variable LT_MULTI_MODULE
422
+   # non-empty at configure time, or by adding -multi_module to the
423
+   # link flags.
424
+   echo "int foo(void){return 1;}" > conftest.c
425
+   $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
426
+     -dynamiclib ${wl}-single_module conftest.c
427
+   if test -f libconftest.dylib; then
428
+     lt_cv_apple_cc_single_mod=yes
429
+     rm -rf libconftest.dylib*
430
+   fi
431
+   rm conftest.c
432
+      fi])
433
+    AC_CACHE_CHECK([for -exported_symbols_list linker flag],
434
+      [lt_cv_ld_exported_symbols_list],
435
+      [lt_cv_ld_exported_symbols_list=no
436
+      save_LDFLAGS=$LDFLAGS
437
+      echo "_main" > conftest.sym
438
+      LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
439
+      AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
440
+   [lt_cv_ld_exported_symbols_list=yes],
441
+   [lt_cv_ld_exported_symbols_list=no])
442
+   LDFLAGS="$save_LDFLAGS"
443
+    ])
444
+    case $host_os in
445
+    rhapsody* | darwin1.[[0123]])
446
+      _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
447
+    darwin1.*)
448
+     _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
449
+    darwin*)
450
+      # if running on 10.5 or later, the deployment target defaults
451
+      # to the OS version, if on x86, and 10.4, the deployment
452
+      # target defaults to 10.4. Don't you love it?
453
+      case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
454
+   10.0,*86*-darwin8*|10.0,*-darwin[[91]]*)
455
+     _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
456
+   10.[[012]]*)
457
+     _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
458
+   10.*)
459
+     _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
460
+      esac
461
+    ;;
462
+  esac
463
+    if test "$lt_cv_apple_cc_single_mod" = "yes"; then
464
+      _lt_dar_single_mod='$single_module'
465
+    fi
466
+    if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
467
+      _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
468
+    else
469
+      _lt_dar_export_syms="~$NMEDIT -s \$output_objdir/\${libname}-symbols.expsym \${lib}"
470
+    fi
471
+    if test "$DSYMUTIL" != ":"; then
472
+      _lt_dsymutil="~$DSYMUTIL \$lib || :"
473
+    else
474
+      _lt_dsymutil=
475
+    fi
476
+    ;;
477
+  esac
478
+])
479
+
480
+# _LT_AC_SYS_LIBPATH_AIX
481
+# ----------------------
482
+# Links a minimal program and checks the executable
483
+# for the system default hardcoded library path. In most cases,
484
+# this is /usr/lib:/lib, but when the MPI compilers are used
485
+# the location of the communication and MPI libs are included too.
486
+# If we don't find anything, use the default library path according
487
+# to the aix ld manual.
488
+AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX],
489
+[AC_REQUIRE([LT_AC_PROG_SED])dnl
490
+AC_LINK_IFELSE(AC_LANG_PROGRAM,[
491
+lt_aix_libpath_sed='
492
+    /Import File Strings/,/^$/ {
493
+	/^0/ {
494
+	    s/^0  *\(.*\)$/\1/
495
+	    p
496
+	}
497
+    }'
498
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
499
+# Check for a 64-bit object if we didn't find anything.
500
+if test -z "$aix_libpath"; then
501
+  aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
502
+fi],[])
503
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
504
+])# _LT_AC_SYS_LIBPATH_AIX
505
+
506
+
507
+# _LT_AC_SHELL_INIT(ARG)
508
+# ----------------------
509
+AC_DEFUN([_LT_AC_SHELL_INIT],
510
+[ifdef([AC_DIVERSION_NOTICE],
511
+	     [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)],
512
+	 [AC_DIVERT_PUSH(NOTICE)])
513
+$1
514
+AC_DIVERT_POP
515
+])# _LT_AC_SHELL_INIT
516
+
517
+
518
+# _LT_AC_PROG_ECHO_BACKSLASH
519
+# --------------------------
520
+# Add some code to the start of the generated configure script which
521
+# will find an echo command which doesn't interpret backslashes.
522
+AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH],
523
+[_LT_AC_SHELL_INIT([
524
+# Check that we are running under the correct shell.
525
+SHELL=${CONFIG_SHELL-/bin/sh}
526
+
527
+case X$ECHO in
528
+X*--fallback-echo)
529
+  # Remove one level of quotation (which was required for Make).
530
+  ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','`
531
+  ;;
532
+esac
533
+
534
+echo=${ECHO-echo}
535
+if test "X[$]1" = X--no-reexec; then
536
+  # Discard the --no-reexec flag, and continue.
537
+  shift
538
+elif test "X[$]1" = X--fallback-echo; then
539
+  # Avoid inline document here, it may be left over
540
+  :
541
+elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then
542
+  # Yippee, $echo works!
543
+  :
544
+else
545
+  # Restart under the correct shell.
546
+  exec $SHELL "[$]0" --no-reexec ${1+"[$]@"}
547
+fi
548
+
549
+if test "X[$]1" = X--fallback-echo; then
550
+  # used as fallback echo
551
+  shift
552
+  cat <<EOF
553
+[$]*
554
+EOF
555
+  exit 0
556
+fi
557
+
558
+# The HP-UX ksh and POSIX shell print the target directory to stdout
559
+# if CDPATH is set.
560
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
561
+
562
+if test -z "$ECHO"; then
563
+if test "X${echo_test_string+set}" != Xset; then
564
+# find a string as large as possible, as long as the shell can cope with it
565
+  for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do
566
+    # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
567
+    if (echo_test_string=`eval $cmd`) 2>/dev/null &&
568
+       echo_test_string=`eval $cmd` &&
569
+       (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null
570
+    then
571
+      break
572
+    fi
573
+  done
574
+fi
575
+
576
+if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
577
+   echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
578
+   test "X$echo_testing_string" = "X$echo_test_string"; then
579
+  :
580
+else
581
+  # The Solaris, AIX, and Digital Unix default echo programs unquote
582
+  # backslashes.  This makes it impossible to quote backslashes using
583
+  #   echo "$something" | sed 's/\\/\\\\/g'
584
+  #
585
+  # So, first we look for a working echo in the user's PATH.
586
+
587
+  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
588
+  for dir in $PATH /usr/ucb; do
589
+    IFS="$lt_save_ifs"
590
+    if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
591
+       test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
592
+       echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
593
+       test "X$echo_testing_string" = "X$echo_test_string"; then
594
+      echo="$dir/echo"
595
+      break
596
+    fi
597
+  done
598
+  IFS="$lt_save_ifs"
599
+
600
+  if test "X$echo" = Xecho; then
601
+    # We didn't find a better echo, so look for alternatives.
602
+    if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' &&
603
+       echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` &&
604
+       test "X$echo_testing_string" = "X$echo_test_string"; then
605
+      # This shell has a builtin print -r that does the trick.
606
+      echo='print -r'
607
+    elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) &&
608
+	 test "X$CONFIG_SHELL" != X/bin/ksh; then
609
+      # If we have ksh, try running configure again with it.
610
+      ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
611
+      export ORIGINAL_CONFIG_SHELL
612
+      CONFIG_SHELL=/bin/ksh
613
+      export CONFIG_SHELL
614
+      exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"}
615
+    else
616
+      # Try using printf.
617
+      echo='printf %s\n'
618
+      if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
619
+	 echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
620
+	 test "X$echo_testing_string" = "X$echo_test_string"; then
621
+	# Cool, printf works
622
+	:
623
+      elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
624
+	   test "X$echo_testing_string" = 'X\t' &&
625
+	   echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
626
+	   test "X$echo_testing_string" = "X$echo_test_string"; then
627
+	CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
628
+	export CONFIG_SHELL
629
+	SHELL="$CONFIG_SHELL"
630
+	export SHELL
631
+	echo="$CONFIG_SHELL [$]0 --fallback-echo"
632
+      elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
633
+	   test "X$echo_testing_string" = 'X\t' &&
634
+	   echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
635
+	   test "X$echo_testing_string" = "X$echo_test_string"; then
636
+	echo="$CONFIG_SHELL [$]0 --fallback-echo"
637
+      else
638
+	# maybe with a smaller string...
639
+	prev=:
640
+
641
+	for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do
642
+	  if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null
643
+	  then
644
+	    break
645
+	  fi
646
+	  prev="$cmd"
647
+	done
648
+
649
+	if test "$prev" != 'sed 50q "[$]0"'; then
650
+	  echo_test_string=`eval $prev`
651
+	  export echo_test_string
652
+	  exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"}
653
+	else
654
+	  # Oops.  We lost completely, so just stick with echo.
655
+	  echo=echo
656
+	fi
657
+      fi
658
+    fi
659
+  fi
660
+fi
661
+fi
662
+
663
+# Copy echo and quote the copy suitably for passing to libtool from
664
+# the Makefile, instead of quoting the original, which is used later.
665
+ECHO=$echo
666
+if test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then
667
+   ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo"
668
+fi
669
+
670
+AC_SUBST(ECHO)
671
+])])# _LT_AC_PROG_ECHO_BACKSLASH
672
+
673
+
674
+# _LT_AC_LOCK
675
+# -----------
676
+AC_DEFUN([_LT_AC_LOCK],
677
+[AC_ARG_ENABLE([libtool-lock],
678
+    [AC_HELP_STRING([--disable-libtool-lock],
679
+	[avoid locking (might break parallel builds)])])
680
+test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
681
+
682
+# Some flags need to be propagated to the compiler or linker for good
683
+# libtool support.
684
+case $host in
685
+ia64-*-hpux*)
686
+  # Find out which ABI we are using.
687
+  echo 'int i;' > conftest.$ac_ext
688
+  if AC_TRY_EVAL(ac_compile); then
689
+    case `/usr/bin/file conftest.$ac_objext` in
690
+    *ELF-32*)
691
+      HPUX_IA64_MODE="32"
692
+      ;;
693
+    *ELF-64*)
694
+      HPUX_IA64_MODE="64"
695
+      ;;
696
+    esac
697
+  fi
698
+  rm -rf conftest*
699
+  ;;
700
+*-*-irix6*)
701
+  # Find out which ABI we are using.
702
+  echo '[#]line __oline__ "configure"' > conftest.$ac_ext
703
+  if AC_TRY_EVAL(ac_compile); then
704
+   if test "$lt_cv_prog_gnu_ld" = yes; then
705
+    case `/usr/bin/file conftest.$ac_objext` in
706
+    *32-bit*)
707
+      LD="${LD-ld} -melf32bsmip"
708
+      ;;
709
+    *N32*)
710
+      LD="${LD-ld} -melf32bmipn32"
711
+      ;;
712
+    *64-bit*)
713
+      LD="${LD-ld} -melf64bmip"
714
+      ;;
715
+    esac
716
+   else
717
+    case `/usr/bin/file conftest.$ac_objext` in
718
+    *32-bit*)
719
+      LD="${LD-ld} -32"
720
+      ;;
721
+    *N32*)
722
+      LD="${LD-ld} -n32"
723
+      ;;
724
+    *64-bit*)
725
+      LD="${LD-ld} -64"
726
+      ;;
727
+    esac
728
+   fi
729
+  fi
730
+  rm -rf conftest*
731
+  ;;
732
+
733
+x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
734
+s390*-*linux*|sparc*-*linux*)
735
+  # Find out which ABI we are using.
736
+  echo 'int i;' > conftest.$ac_ext
737
+  if AC_TRY_EVAL(ac_compile); then
738
+    case `/usr/bin/file conftest.o` in
739
+    *32-bit*)
740
+      case $host in
741
+        x86_64-*kfreebsd*-gnu)
742
+          LD="${LD-ld} -m elf_i386_fbsd"
743
+          ;;
744
+        x86_64-*linux*)
745
+          LD="${LD-ld} -m elf_i386"
746
+          ;;
747
+        ppc64-*linux*|powerpc64-*linux*)
748
+          LD="${LD-ld} -m elf32ppclinux"
749
+          ;;
750
+        s390x-*linux*)
751
+          LD="${LD-ld} -m elf_s390"
752
+          ;;
753
+        sparc64-*linux*)
754
+          LD="${LD-ld} -m elf32_sparc"
755
+          ;;
756
+      esac
757
+      ;;
758
+    *64-bit*)
759
+      case $host in
760
+        x86_64-*kfreebsd*-gnu)
761
+          LD="${LD-ld} -m elf_x86_64_fbsd"
762
+          ;;
763
+        x86_64-*linux*)
764
+          LD="${LD-ld} -m elf_x86_64"
765
+          ;;
766
+        ppc*-*linux*|powerpc*-*linux*)
767
+          LD="${LD-ld} -m elf64ppc"
768
+          ;;
769
+        s390*-*linux*)
770
+          LD="${LD-ld} -m elf64_s390"
771
+          ;;
772
+        sparc*-*linux*)
773
+          LD="${LD-ld} -m elf64_sparc"
774
+          ;;
775
+      esac
776
+      ;;
777
+    esac
778
+  fi
779
+  rm -rf conftest*
780
+  ;;
781
+
782
+*-*-sco3.2v5*)
783
+  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
784
+  SAVE_CFLAGS="$CFLAGS"
785
+  CFLAGS="$CFLAGS -belf"
786
+  AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
787
+    [AC_LANG_PUSH(C)
788
+     AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
789
+     AC_LANG_POP])
790
+  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
791
+    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
792
+    CFLAGS="$SAVE_CFLAGS"
793
+  fi
794
+  ;;
795
+sparc*-*solaris*)
796
+  # Find out which ABI we are using.
797
+  echo 'int i;' > conftest.$ac_ext
798
+  if AC_TRY_EVAL(ac_compile); then
799
+    case `/usr/bin/file conftest.o` in
800
+    *64-bit*)
801
+      case $lt_cv_prog_gnu_ld in
802
+      yes*) LD="${LD-ld} -m elf64_sparc" ;;
803
+      *)
804
+        if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
805
+	  LD="${LD-ld} -64"
806
+	fi
807
+	;;
808
+      esac
809
+      ;;
810
+    esac
811
+  fi
812
+  rm -rf conftest*
813
+  ;;
814
+
815
+AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL],
816
+[*-*-cygwin* | *-*-mingw* | *-*-pw32*)
817
+  AC_CHECK_TOOL(DLLTOOL, dlltool, false)
818
+  AC_CHECK_TOOL(AS, as, false)
819
+  AC_CHECK_TOOL(OBJDUMP, objdump, false)
820
+  ;;
821
+  ])
822
+esac
823
+
824
+need_locks="$enable_libtool_lock"
825
+
826
+])# _LT_AC_LOCK
827
+
828
+
829
+# AC_LIBTOOL_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
830
+#		[OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
831
+# ----------------------------------------------------------------
832
+# Check whether the given compiler option works
833
+AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION],
834
+[AC_REQUIRE([LT_AC_PROG_SED])
835
+AC_CACHE_CHECK([$1], [$2],
836
+  [$2=no
837
+  ifelse([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
838
+   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
839
+   lt_compiler_flag="$3"
840
+   # Insert the option either (1) after the last *FLAGS variable, or
841
+   # (2) before a word containing "conftest.", or (3) at the end.
842
+   # Note that $ac_compile itself does not contain backslashes and begins
843
+   # with a dollar sign (not a hyphen), so the echo should work correctly.
844
+   # The option is referenced via a variable to avoid confusing sed.
845
+   lt_compile=`echo "$ac_compile" | $SED \
846
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
847
+   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
848
+   -e 's:$: $lt_compiler_flag:'`
849
+   (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
850
+   (eval "$lt_compile" 2>conftest.err)
851
+   ac_status=$?
852
+   cat conftest.err >&AS_MESSAGE_LOG_FD
853
+   echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
854
+   if (exit $ac_status) && test -s "$ac_outfile"; then
855
+     # The compiler can only warn and ignore the option if not recognized
856
+     # So say no if there are warnings other than the usual output.
857
+     $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
858
+     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
859
+     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
860
+       $2=yes
861
+     fi
862
+   fi
863
+   $rm conftest*
864
+])
865
+
866
+if test x"[$]$2" = xyes; then
867
+    ifelse([$5], , :, [$5])
868
+else
869
+    ifelse([$6], , :, [$6])
870
+fi
871
+])# AC_LIBTOOL_COMPILER_OPTION
872
+
873
+
874
+# AC_LIBTOOL_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
875
+#                          [ACTION-SUCCESS], [ACTION-FAILURE])
876
+# ------------------------------------------------------------
877
+# Check whether the given compiler option works
878
+AC_DEFUN([AC_LIBTOOL_LINKER_OPTION],
879
+[AC_REQUIRE([LT_AC_PROG_SED])dnl
880
+AC_CACHE_CHECK([$1], [$2],
881
+  [$2=no
882
+   save_LDFLAGS="$LDFLAGS"
883
+   LDFLAGS="$LDFLAGS $3"
884
+   echo "$lt_simple_link_test_code" > conftest.$ac_ext
885
+   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
886
+     # The linker can only warn and ignore the option if not recognized
887
+     # So say no if there are warnings
888
+     if test -s conftest.err; then
889
+       # Append any errors to the config.log.
890
+       cat conftest.err 1>&AS_MESSAGE_LOG_FD
891
+       $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp
892
+       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
893
+       if diff conftest.exp conftest.er2 >/dev/null; then
894
+         $2=yes
895
+       fi
896
+     else
897
+       $2=yes
898
+     fi
899
+   fi
900
+   $rm -r conftest*
901
+   LDFLAGS="$save_LDFLAGS"
902
+])
903
+
904
+if test x"[$]$2" = xyes; then
905
+    ifelse([$4], , :, [$4])
906
+else
907
+    ifelse([$5], , :, [$5])
908
+fi
909
+])# AC_LIBTOOL_LINKER_OPTION
910
+
911
+
912
+# AC_LIBTOOL_SYS_MAX_CMD_LEN
913
+# --------------------------
914
+AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN],
915
+[# find the maximum length of command line arguments
916
+AC_MSG_CHECKING([the maximum length of command line arguments])
917
+AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
918
+  i=0
919
+  teststring="ABCD"
920
+
921
+  case $build_os in
922
+  msdosdjgpp*)
923
+    # On DJGPP, this test can blow up pretty badly due to problems in libc
924
+    # (any single argument exceeding 2000 bytes causes a buffer overrun
925
+    # during glob expansion).  Even if it were fixed, the result of this
926
+    # check would be larger than it should be.
927
+    lt_cv_sys_max_cmd_len=12288;    # 12K is about right
928
+    ;;
929
+
930
+  gnu*)
931
+    # Under GNU Hurd, this test is not required because there is
932
+    # no limit to the length of command line arguments.
933
+    # Libtool will interpret -1 as no limit whatsoever
934
+    lt_cv_sys_max_cmd_len=-1;
935
+    ;;
936
+
937
+  cygwin* | mingw*)
938
+    # On Win9x/ME, this test blows up -- it succeeds, but takes
939
+    # about 5 minutes as the teststring grows exponentially.
940
+    # Worse, since 9x/ME are not pre-emptively multitasking,
941
+    # you end up with a "frozen" computer, even though with patience
942
+    # the test eventually succeeds (with a max line length of 256k).
943
+    # Instead, let's just punt: use the minimum linelength reported by
944
+    # all of the supported platforms: 8192 (on NT/2K/XP).
945
+    lt_cv_sys_max_cmd_len=8192;
946
+    ;;
947
+
948
+  amigaos*)
949
+    # On AmigaOS with pdksh, this test takes hours, literally.
950
+    # So we just punt and use a minimum line length of 8192.
951
+    lt_cv_sys_max_cmd_len=8192;
952
+    ;;
953
+
954
+  netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
955
+    # This has been around since 386BSD, at least.  Likely further.
956
+    if test -x /sbin/sysctl; then
957
+      lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
958
+    elif test -x /usr/sbin/sysctl; then
959
+      lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
960
+    else
961
+      lt_cv_sys_max_cmd_len=65536	# usable default for all BSDs
962
+    fi
963
+    # And add a safety zone
964
+    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
965
+    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
966
+    ;;
967
+
968
+  interix*)
969
+    # We know the value 262144 and hardcode it with a safety zone (like BSD)
970
+    lt_cv_sys_max_cmd_len=196608
971
+    ;;
972
+
973
+  osf*)
974
+    # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
975
+    # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
976
+    # nice to cause kernel panics so lets avoid the loop below.
977
+    # First set a reasonable default.
978
+    lt_cv_sys_max_cmd_len=16384
979
+    #
980
+    if test -x /sbin/sysconfig; then
981
+      case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
982
+        *1*) lt_cv_sys_max_cmd_len=-1 ;;
983
+      esac
984
+    fi
985
+    ;;
986
+  sco3.2v5*)
987
+    lt_cv_sys_max_cmd_len=102400
988
+    ;;
989
+  sysv5* | sco5v6* | sysv4.2uw2*)
990
+    kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
991
+    if test -n "$kargmax"; then
992
+      lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ 	]]//'`
993
+    else
994
+      lt_cv_sys_max_cmd_len=32768
995
+    fi
996
+    ;;
997
+  *)
998
+    lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
999
+    if test -n "$lt_cv_sys_max_cmd_len"; then
1000
+      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
1001
+      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
1002
+    else
1003
+      SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
1004
+      while (test "X"`$SHELL [$]0 --fallback-echo "X$teststring" 2>/dev/null` \
1005
+	       = "XX$teststring") >/dev/null 2>&1 &&
1006
+	      new_result=`expr "X$teststring" : ".*" 2>&1` &&
1007
+	      lt_cv_sys_max_cmd_len=$new_result &&
1008
+	      test $i != 17 # 1/2 MB should be enough
1009
+      do
1010
+        i=`expr $i + 1`
1011
+        teststring=$teststring$teststring
1012
+      done
1013
+      teststring=
1014
+      # Add a significant safety factor because C++ compilers can tack on massive
1015
+      # amounts of additional arguments before passing them to the linker.
1016
+      # It appears as though 1/2 is a usable value.
1017
+      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
1018
+    fi
1019
+    ;;
1020
+  esac
1021
+])
1022
+if test -n $lt_cv_sys_max_cmd_len ; then
1023
+  AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
1024
+else
1025
+  AC_MSG_RESULT(none)
1026
+fi
1027
+])# AC_LIBTOOL_SYS_MAX_CMD_LEN
1028
+
1029
+
1030
+# _LT_AC_CHECK_DLFCN
1031
+# ------------------
1032
+AC_DEFUN([_LT_AC_CHECK_DLFCN],
1033
+[AC_CHECK_HEADERS(dlfcn.h)dnl
1034
+])# _LT_AC_CHECK_DLFCN
1035
+
1036
+
1037
+# _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
1038
+#                           ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
1039
+# ---------------------------------------------------------------------
1040
+AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF],
1041
+[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl
1042
+if test "$cross_compiling" = yes; then :
1043
+  [$4]
1044
+else
1045
+  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
1046
+  lt_status=$lt_dlunknown
1047
+  cat > conftest.$ac_ext <<EOF
1048
+[#line __oline__ "configure"
1049
+#include "confdefs.h"
1050
+
1051
+#if HAVE_DLFCN_H
1052
+#include <dlfcn.h>
1053
+#endif
1054
+
1055
+#include <stdio.h>
1056
+
1057
+#ifdef RTLD_GLOBAL
1058
+#  define LT_DLGLOBAL		RTLD_GLOBAL
1059
+#else
1060
+#  ifdef DL_GLOBAL
1061
+#    define LT_DLGLOBAL		DL_GLOBAL
1062
+#  else
1063
+#    define LT_DLGLOBAL		0
1064
+#  endif
1065
+#endif
1066
+
1067
+/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
1068
+   find out it does not work in some platform. */
1069
+#ifndef LT_DLLAZY_OR_NOW
1070
+#  ifdef RTLD_LAZY
1071
+#    define LT_DLLAZY_OR_NOW		RTLD_LAZY
1072
+#  else
1073
+#    ifdef DL_LAZY
1074
+#      define LT_DLLAZY_OR_NOW		DL_LAZY
1075
+#    else
1076
+#      ifdef RTLD_NOW
1077
+#        define LT_DLLAZY_OR_NOW	RTLD_NOW
1078
+#      else
1079
+#        ifdef DL_NOW
1080
+#          define LT_DLLAZY_OR_NOW	DL_NOW
1081
+#        else
1082
+#          define LT_DLLAZY_OR_NOW	0
1083
+#        endif
1084
+#      endif
1085
+#    endif
1086
+#  endif
1087
+#endif
1088
+
1089
+#ifdef __cplusplus
1090
+extern "C" void exit (int);
1091
+#endif
1092
+
1093
+void fnord() { int i=42;}
1094
+int main ()
1095
+{
1096
+  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
1097
+  int status = $lt_dlunknown;
1098
+
1099
+  if (self)
1100
+    {
1101
+      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
1102
+      else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
1103
+      /* dlclose (self); */
1104
+    }
1105
+  else
1106
+    puts (dlerror ());
1107
+
1108
+    exit (status);
1109
+}]
1110
+EOF
1111
+  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
1112
+    (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
1113
+    lt_status=$?
1114
+    case x$lt_status in
1115
+      x$lt_dlno_uscore) $1 ;;
1116
+      x$lt_dlneed_uscore) $2 ;;
1117
+      x$lt_dlunknown|x*) $3 ;;
1118
+    esac
1119
+  else :
1120
+    # compilation failed
1121
+    $3
1122
+  fi
1123
+fi
1124
+rm -fr conftest*
1125
+])# _LT_AC_TRY_DLOPEN_SELF
1126
+
1127
+
1128
+# AC_LIBTOOL_DLOPEN_SELF
1129
+# ----------------------
1130
+AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF],
1131
+[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl
1132
+if test "x$enable_dlopen" != xyes; then
1133
+  enable_dlopen=unknown
1134
+  enable_dlopen_self=unknown
1135
+  enable_dlopen_self_static=unknown
1136
+else
1137
+  lt_cv_dlopen=no
1138
+  lt_cv_dlopen_libs=
1139
+
1140
+  case $host_os in
1141
+  beos*)
1142
+    lt_cv_dlopen="load_add_on"
1143
+    lt_cv_dlopen_libs=
1144
+    lt_cv_dlopen_self=yes
1145
+    ;;
1146
+
1147
+  mingw* | pw32*)
1148
+    lt_cv_dlopen="LoadLibrary"
1149
+    lt_cv_dlopen_libs=
1150
+   ;;
1151
+
1152
+  cygwin*)
1153
+    lt_cv_dlopen="dlopen"
1154
+    lt_cv_dlopen_libs=
1155
+   ;;
1156
+
1157
+  darwin*)
1158
+  # if libdl is installed we need to link against it
1159
+    AC_CHECK_LIB([dl], [dlopen],
1160
+		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[
1161
+    lt_cv_dlopen="dyld"
1162
+    lt_cv_dlopen_libs=
1163
+    lt_cv_dlopen_self=yes
1164
+    ])
1165
+   ;;
1166
+
1167
+  *)
1168
+    AC_CHECK_FUNC([shl_load],
1169
+	  [lt_cv_dlopen="shl_load"],
1170
+      [AC_CHECK_LIB([dld], [shl_load],
1171
+	    [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"],
1172
+	[AC_CHECK_FUNC([dlopen],
1173
+	      [lt_cv_dlopen="dlopen"],
1174
+	  [AC_CHECK_LIB([dl], [dlopen],
1175
+		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
1176
+	    [AC_CHECK_LIB([svld], [dlopen],
1177
+		  [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
1178
+	      [AC_CHECK_LIB([dld], [dld_link],
1179
+		    [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"])
1180
+	      ])
1181
+	    ])
1182
+	  ])
1183
+	])
1184
+      ])
1185
+    ;;
1186
+  esac
1187
+
1188
+  if test "x$lt_cv_dlopen" != xno; then
1189
+    enable_dlopen=yes
1190
+  else
1191
+    enable_dlopen=no
1192
+  fi
1193
+
1194
+  case $lt_cv_dlopen in
1195
+  dlopen)
1196
+    save_CPPFLAGS="$CPPFLAGS"
1197
+    test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
1198
+
1199
+    save_LDFLAGS="$LDFLAGS"
1200
+    wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
1201
+
1202
+    save_LIBS="$LIBS"
1203
+    LIBS="$lt_cv_dlopen_libs $LIBS"
1204
+
1205
+    AC_CACHE_CHECK([whether a program can dlopen itself],
1206
+	  lt_cv_dlopen_self, [dnl
1207
+	  _LT_AC_TRY_DLOPEN_SELF(
1208
+	    lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
1209
+	    lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
1210
+    ])
1211
+
1212
+    if test "x$lt_cv_dlopen_self" = xyes; then
1213
+      wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
1214
+      AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
1215
+    	  lt_cv_dlopen_self_static, [dnl
1216
+	  _LT_AC_TRY_DLOPEN_SELF(
1217
+	    lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
1218
+	    lt_cv_dlopen_self_static=no,  lt_cv_dlopen_self_static=cross)
1219
+      ])
1220
+    fi
1221
+
1222
+    CPPFLAGS="$save_CPPFLAGS"
1223
+    LDFLAGS="$save_LDFLAGS"
1224
+    LIBS="$save_LIBS"
1225
+    ;;
1226
+  esac
1227
+
1228
+  case $lt_cv_dlopen_self in
1229
+  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
1230
+  *) enable_dlopen_self=unknown ;;
1231
+  esac
1232
+
1233
+  case $lt_cv_dlopen_self_static in
1234
+  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
1235
+  *) enable_dlopen_self_static=unknown ;;
1236
+  esac
1237
+fi
1238
+])# AC_LIBTOOL_DLOPEN_SELF
1239
+
1240
+
1241
+# AC_LIBTOOL_PROG_CC_C_O([TAGNAME])
1242
+# ---------------------------------
1243
+# Check to see if options -c and -o are simultaneously supported by compiler
1244
+AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O],
1245
+[AC_REQUIRE([LT_AC_PROG_SED])dnl
1246
+AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
1247
+AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
1248
+  [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
1249
+  [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
1250
+   $rm -r conftest 2>/dev/null
1251
+   mkdir conftest
1252
+   cd conftest
1253
+   mkdir out
1254
+   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
1255
+
1256
+   lt_compiler_flag="-o out/conftest2.$ac_objext"
1257
+   # Insert the option either (1) after the last *FLAGS variable, or
1258
+   # (2) before a word containing "conftest.", or (3) at the end.
1259
+   # Note that $ac_compile itself does not contain backslashes and begins
1260
+   # with a dollar sign (not a hyphen), so the echo should work correctly.
1261
+   lt_compile=`echo "$ac_compile" | $SED \
1262
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
1263
+   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
1264
+   -e 's:$: $lt_compiler_flag:'`
1265
+   (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
1266
+   (eval "$lt_compile" 2>out/conftest.err)
1267
+   ac_status=$?
1268
+   cat out/conftest.err >&AS_MESSAGE_LOG_FD
1269
+   echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
1270
+   if (exit $ac_status) && test -s out/conftest2.$ac_objext
1271
+   then
1272
+     # The compiler can only warn and ignore the option if not recognized
1273
+     # So say no if there are warnings
1274
+     $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
1275
+     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
1276
+     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
1277
+       _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
1278
+     fi
1279
+   fi
1280
+   chmod u+w . 2>&AS_MESSAGE_LOG_FD
1281
+   $rm conftest*
1282
+   # SGI C++ compiler will create directory out/ii_files/ for
1283
+   # template instantiation
1284
+   test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files
1285
+   $rm out/* && rmdir out
1286
+   cd ..
1287
+   rmdir conftest
1288
+   $rm conftest*
1289
+])
1290
+])# AC_LIBTOOL_PROG_CC_C_O
1291
+
1292
+
1293
+# AC_LIBTOOL_SYS_HARD_LINK_LOCKS([TAGNAME])
1294
+# -----------------------------------------
1295
+# Check to see if we can do hard links to lock some files if needed
1296
+AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS],
1297
+[AC_REQUIRE([_LT_AC_LOCK])dnl
1298
+
1299
+hard_links="nottested"
1300
+if test "$_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then
1301
+  # do not overwrite the value of need_locks provided by the user
1302
+  AC_MSG_CHECKING([if we can lock with hard links])
1303
+  hard_links=yes
1304
+  $rm conftest*
1305
+  ln conftest.a conftest.b 2>/dev/null && hard_links=no
1306
+  touch conftest.a
1307
+  ln conftest.a conftest.b 2>&5 || hard_links=no
1308
+  ln conftest.a conftest.b 2>/dev/null && hard_links=no
1309
+  AC_MSG_RESULT([$hard_links])
1310
+  if test "$hard_links" = no; then
1311
+    AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe])
1312
+    need_locks=warn
1313
+  fi
1314
+else
1315
+  need_locks=no
1316
+fi
1317
+])# AC_LIBTOOL_SYS_HARD_LINK_LOCKS
1318
+
1319
+
1320
+# AC_LIBTOOL_OBJDIR
1321
+# -----------------
1322
+AC_DEFUN([AC_LIBTOOL_OBJDIR],
1323
+[AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
1324
+[rm -f .libs 2>/dev/null
1325
+mkdir .libs 2>/dev/null
1326
+if test -d .libs; then
1327
+  lt_cv_objdir=.libs
1328
+else
1329
+  # MS-DOS does not allow filenames that begin with a dot.
1330
+  lt_cv_objdir=_libs
1331
+fi
1332
+rmdir .libs 2>/dev/null])
1333
+objdir=$lt_cv_objdir
1334
+])# AC_LIBTOOL_OBJDIR
1335
+
1336
+
1337
+# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH([TAGNAME])
1338
+# ----------------------------------------------
1339
+# Check hardcoding attributes.
1340
+AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH],
1341
+[AC_MSG_CHECKING([how to hardcode library paths into programs])
1342
+_LT_AC_TAGVAR(hardcode_action, $1)=
1343
+if test -n "$_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)" || \
1344
+   test -n "$_LT_AC_TAGVAR(runpath_var, $1)" || \
1345
+   test "X$_LT_AC_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then
1346
+
1347
+  # We can hardcode non-existant directories.
1348
+  if test "$_LT_AC_TAGVAR(hardcode_direct, $1)" != no &&
1349
+     # If the only mechanism to avoid hardcoding is shlibpath_var, we
1350
+     # have to relink, otherwise we might link with an installed library
1351
+     # when we should be linking with a yet-to-be-installed one
1352
+     ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
1353
+     test "$_LT_AC_TAGVAR(hardcode_minus_L, $1)" != no; then
1354
+    # Linking always hardcodes the temporary library directory.
1355
+    _LT_AC_TAGVAR(hardcode_action, $1)=relink
1356
+  else
1357
+    # We can link without hardcoding, and we can hardcode nonexisting dirs.
1358
+    _LT_AC_TAGVAR(hardcode_action, $1)=immediate
1359
+  fi
1360
+else
1361
+  # We cannot hardcode anything, or else we can only hardcode existing
1362
+  # directories.
1363
+  _LT_AC_TAGVAR(hardcode_action, $1)=unsupported
1364
+fi
1365
+AC_MSG_RESULT([$_LT_AC_TAGVAR(hardcode_action, $1)])
1366
+
1367
+if test "$_LT_AC_TAGVAR(hardcode_action, $1)" = relink; then
1368
+  # Fast installation is not supported
1369
+  enable_fast_install=no
1370
+elif test "$shlibpath_overrides_runpath" = yes ||
1371
+     test "$enable_shared" = no; then
1372
+  # Fast installation is not necessary
1373
+  enable_fast_install=needless
1374
+fi
1375
+])# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH
1376
+
1377
+
1378
+# AC_LIBTOOL_SYS_LIB_STRIP
1379
+# ------------------------
1380
+AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP],
1381
+[striplib=
1382
+old_striplib=
1383
+AC_MSG_CHECKING([whether stripping libraries is possible])
1384
+if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then
1385
+  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
1386
+  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
1387
+  AC_MSG_RESULT([yes])
1388
+else
1389
+# FIXME - insert some real tests, host_os isn't really good enough
1390
+  case $host_os in
1391
+   darwin*)
1392
+       if test -n "$STRIP" ; then
1393
+         striplib="$STRIP -x"
1394
+         old_striplib="$STRIP -S"
1395
+         AC_MSG_RESULT([yes])
1396
+       else
1397
+  AC_MSG_RESULT([no])
1398
+fi
1399
+       ;;
1400
+   *)
1401
+  AC_MSG_RESULT([no])
1402
+    ;;
1403
+  esac
1404
+fi
1405
+])# AC_LIBTOOL_SYS_LIB_STRIP
1406
+
1407
+
1408
+# AC_LIBTOOL_SYS_DYNAMIC_LINKER
1409
+# -----------------------------
1410
+# PORTME Fill in your ld.so characteristics
1411
+AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER],
1412
+[AC_REQUIRE([LT_AC_PROG_SED])dnl
1413
+AC_MSG_CHECKING([dynamic linker characteristics])
1414
+library_names_spec=
1415
+libname_spec='lib$name'
1416
+soname_spec=
1417
+shrext_cmds=".so"
1418
+postinstall_cmds=
1419
+postuninstall_cmds=
1420
+finish_cmds=
1421
+finish_eval=
1422
+shlibpath_var=
1423
+shlibpath_overrides_runpath=unknown
1424
+version_type=none
1425
+dynamic_linker="$host_os ld.so"
1426
+sys_lib_dlsearch_path_spec="/lib /usr/lib"
1427
+m4_if($1,[],[
1428
+if test "$GCC" = yes; then
1429
+  case $host_os in
1430
+    darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
1431
+    *) lt_awk_arg="/^libraries:/" ;;
1432
+  esac
1433
+  lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"`
1434
+  if echo "$lt_search_path_spec" | grep ';' >/dev/null ; then
1435
+    # if the path contains ";" then we assume it to be the separator
1436
+    # otherwise default to the standard path separator (i.e. ":") - it is
1437
+    # assumed that no part of a normal pathname contains ";" but that should
1438
+    # okay in the real world where ";" in dirpaths is itself problematic.
1439
+    lt_search_path_spec=`echo "$lt_search_path_spec" | $SED -e 's/;/ /g'`
1440
+  else
1441
+    lt_search_path_spec=`echo "$lt_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
1442
+  fi
1443
+  # Ok, now we have the path, separated by spaces, we can step through it
1444
+  # and add multilib dir if necessary.
1445
+  lt_tmp_lt_search_path_spec=
1446
+  lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
1447
+  for lt_sys_path in $lt_search_path_spec; do
1448
+    if test -d "$lt_sys_path/$lt_multi_os_dir"; then
1449
+      lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
1450
+    else
1451
+      test -d "$lt_sys_path" && \
1452
+	lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
1453
+    fi
1454
+  done
1455
+  lt_search_path_spec=`echo $lt_tmp_lt_search_path_spec | awk '
1456
+BEGIN {RS=" "; FS="/|\n";} {
1457
+  lt_foo="";
1458
+  lt_count=0;
1459
+  for (lt_i = NF; lt_i > 0; lt_i--) {
1460
+    if ($lt_i != "" && $lt_i != ".") {
1461
+      if ($lt_i == "..") {
1462
+        lt_count++;
1463
+      } else {
1464
+        if (lt_count == 0) {
1465
+          lt_foo="/" $lt_i lt_foo;
1466
+        } else {
1467
+          lt_count--;
1468
+        }
1469
+      }
1470
+    }
1471
+  }
1472
+  if (lt_foo != "") { lt_freq[[lt_foo]]++; }
1473
+  if (lt_freq[[lt_foo]] == 1) { print lt_foo; }
1474
+}'`
1475
+  sys_lib_search_path_spec=`echo $lt_search_path_spec`
1476
+else
1477
+  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
1478
+fi])
1479
+need_lib_prefix=unknown
1480
+hardcode_into_libs=no
1481
+
1482
+# when you set need_version to no, make sure it does not cause -set_version
1483
+# flags to be left without arguments
1484
+need_version=unknown
1485
+
1486
+case $host_os in
1487
+aix3*)
1488
+  version_type=linux
1489
+  library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
1490
+  shlibpath_var=LIBPATH
1491
+
1492
+  # AIX 3 has no versioning support, so we append a major version to the name.
1493
+  soname_spec='${libname}${release}${shared_ext}$major'
1494
+  ;;
1495
+
1496
+aix[[4-9]]*)
1497
+  version_type=linux
1498
+  need_lib_prefix=no
1499
+  need_version=no
1500
+  hardcode_into_libs=yes
1501
+  if test "$host_cpu" = ia64; then
1502
+    # AIX 5 supports IA64
1503
+    library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
1504
+    shlibpath_var=LD_LIBRARY_PATH
1505
+  else
1506
+    # With GCC up to 2.95.x, collect2 would create an import file
1507
+    # for dependence libraries.  The import file would start with
1508
+    # the line `#! .'.  This would cause the generated library to
1509
+    # depend on `.', always an invalid library.  This was fixed in
1510
+    # development snapshots of GCC prior to 3.0.
1511
+    case $host_os in
1512
+      aix4 | aix4.[[01]] | aix4.[[01]].*)
1513
+      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
1514
+	   echo ' yes '
1515
+	   echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
1516
+	:
1517
+      else
1518
+	can_build_shared=no
1519
+      fi
1520
+      ;;
1521
+    esac
1522
+    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
1523
+    # soname into executable. Probably we can add versioning support to
1524
+    # collect2, so additional links can be useful in future.
1525
+    if test "$aix_use_runtimelinking" = yes; then
1526
+      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
1527
+      # instead of lib<name>.a to let people know that these are not
1528
+      # typical AIX shared libraries.
1529
+      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
1530
+    else
1531
+      # We preserve .a as extension for shared libraries through AIX4.2
1532
+      # and later when we are not doing run time linking.
1533
+      library_names_spec='${libname}${release}.a $libname.a'
1534
+      soname_spec='${libname}${release}${shared_ext}$major'
1535
+    fi
1536
+    shlibpath_var=LIBPATH
1537
+  fi
1538
+  ;;
1539
+
1540
+amigaos*)
1541
+  library_names_spec='$libname.ixlibrary $libname.a'
1542
+  # Create ${libname}_ixlibrary.a entries in /sys/libs.
1543
+  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'
1544
+  ;;
1545
+
1546
+beos*)
1547
+  library_names_spec='${libname}${shared_ext}'
1548
+  dynamic_linker="$host_os ld.so"
1549
+  shlibpath_var=LIBRARY_PATH
1550
+  ;;
1551
+
1552
+bsdi[[45]]*)
1553
+  version_type=linux
1554
+  need_version=no
1555
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
1556
+  soname_spec='${libname}${release}${shared_ext}$major'
1557
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
1558
+  shlibpath_var=LD_LIBRARY_PATH
1559
+  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
1560
+  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
1561
+  # the default ld.so.conf also contains /usr/contrib/lib and
1562
+  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
1563
+  # libtool to hard-code these into programs
1564
+  ;;
1565
+
1566
+cygwin* | mingw* | pw32*)
1567
+  version_type=windows
1568
+  shrext_cmds=".dll"
1569
+  need_version=no
1570
+  need_lib_prefix=no
1571
+
1572
+  case $GCC,$host_os in
1573
+  yes,cygwin* | yes,mingw* | yes,pw32*)
1574
+    library_names_spec='$libname.dll.a'
1575
+    # DLL is installed to $(libdir)/../bin by postinstall_cmds
1576
+    postinstall_cmds='base_file=`basename \${file}`~
1577
+      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~
1578
+      dldir=$destdir/`dirname \$dlpath`~
1579
+      test -d \$dldir || mkdir -p \$dldir~
1580
+      $install_prog $dir/$dlname \$dldir/$dlname~
1581
+      chmod a+x \$dldir/$dlname'
1582
+    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
1583
+      dlpath=$dir/\$dldll~
1584
+       $rm \$dlpath'
1585
+    shlibpath_overrides_runpath=yes
1586
+
1587
+    case $host_os in
1588
+    cygwin*)
1589
+      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
1590
+      soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
1591
+      sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
1592
+      ;;
1593
+    mingw*)
1594
+      # MinGW DLLs use traditional 'lib' prefix
1595
+      soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
1596
+      sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
1597
+      if echo "$sys_lib_search_path_spec" | [grep ';[c-zC-Z]:/' >/dev/null]; then
1598
+        # It is most probably a Windows format PATH printed by
1599
+        # mingw gcc, but we are running on Cygwin. Gcc prints its search
1600
+        # path with ; separators, and with drive letters. We can handle the
1601
+        # drive letters (cygwin fileutils understands them), so leave them,
1602
+        # especially as we might pass files found there to a mingw objdump,
1603
+        # which wouldn't understand a cygwinified path. Ahh.
1604
+        sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
1605
+      else
1606
+        sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
1607
+      fi
1608
+      ;;
1609
+    pw32*)
1610
+      # pw32 DLLs use 'pw' prefix rather than 'lib'
1611
+      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
1612
+      ;;
1613
+    esac
1614
+    ;;
1615
+
1616
+  *)
1617
+    library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
1618
+    ;;
1619
+  esac
1620
+  dynamic_linker='Win32 ld.exe'
1621
+  # FIXME: first we should search . and the directory the executable is in
1622
+  shlibpath_var=PATH
1623
+  ;;
1624
+
1625
+darwin* | rhapsody*)
1626
+  dynamic_linker="$host_os dyld"
1627
+  version_type=darwin
1628
+  need_lib_prefix=no
1629
+  need_version=no
1630
+  library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext'
1631
+  soname_spec='${libname}${release}${major}$shared_ext'
1632
+  shlibpath_overrides_runpath=yes
1633
+  shlibpath_var=DYLD_LIBRARY_PATH
1634
+  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
1635
+  m4_if([$1], [],[
1636
+  sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"]) 
1637
+  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
1638
+  ;;
1639
+
1640
+dgux*)
1641
+  version_type=linux
1642
+  need_lib_prefix=no
1643
+  need_version=no
1644
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
1645
+  soname_spec='${libname}${release}${shared_ext}$major'
1646
+  shlibpath_var=LD_LIBRARY_PATH
1647
+  ;;
1648
+
1649
+freebsd1*)
1650
+  dynamic_linker=no
1651
+  ;;
1652
+
1653
+freebsd* | dragonfly*)
1654
+  # DragonFly does not have aout.  When/if they implement a new
1655
+  # versioning mechanism, adjust this.
1656
+  if test -x /usr/bin/objformat; then
1657
+    objformat=`/usr/bin/objformat`
1658
+  else
1659
+    case $host_os in
1660
+    freebsd[[123]]*) objformat=aout ;;
1661
+    *) objformat=elf ;;
1662
+    esac
1663
+  fi
1664
+  version_type=freebsd-$objformat
1665
+  case $version_type in
1666
+    freebsd-elf*)
1667
+      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
1668
+      need_version=no
1669
+      need_lib_prefix=no
1670
+      ;;
1671
+    freebsd-*)
1672
+      library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
1673
+      need_version=yes
1674
+      ;;
1675
+  esac
1676
+  shlibpath_var=LD_LIBRARY_PATH
1677
+  case $host_os in
1678
+  freebsd2*)
1679
+    shlibpath_overrides_runpath=yes
1680
+    ;;
1681
+  freebsd3.[[01]]* | freebsdelf3.[[01]]*)
1682
+    shlibpath_overrides_runpath=yes
1683
+    hardcode_into_libs=yes
1684
+    ;;
1685
+  freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \
1686
+  freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1)
1687
+    shlibpath_overrides_runpath=no
1688
+    hardcode_into_libs=yes
1689
+    ;;
1690
+  *) # from 4.6 on, and DragonFly
1691
+    shlibpath_overrides_runpath=yes
1692
+    hardcode_into_libs=yes
1693
+    ;;
1694
+  esac
1695
+  ;;
1696
+
1697
+gnu*)
1698
+  version_type=linux
1699
+  need_lib_prefix=no
1700
+  need_version=no
1701
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
1702
+  soname_spec='${libname}${release}${shared_ext}$major'
1703
+  shlibpath_var=LD_LIBRARY_PATH
1704
+  hardcode_into_libs=yes
1705
+  ;;
1706
+
1707
+hpux9* | hpux10* | hpux11*)
1708
+  # Give a soname corresponding to the major version so that dld.sl refuses to
1709
+  # link against other versions.
1710
+  version_type=sunos
1711
+  need_lib_prefix=no
1712
+  need_version=no
1713
+  case $host_cpu in
1714
+  ia64*)
1715
+    shrext_cmds='.so'
1716
+    hardcode_into_libs=yes
1717
+    dynamic_linker="$host_os dld.so"
1718
+    shlibpath_var=LD_LIBRARY_PATH
1719
+    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
1720
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
1721
+    soname_spec='${libname}${release}${shared_ext}$major'
1722
+    if test "X$HPUX_IA64_MODE" = X32; then
1723
+      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
1724
+    else
1725
+      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
1726
+    fi
1727
+    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
1728
+    ;;
1729
+   hppa*64*)
1730
+     shrext_cmds='.sl'
1731
+     hardcode_into_libs=yes
1732
+     dynamic_linker="$host_os dld.sl"
1733
+     shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
1734
+     shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
1735
+     library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
1736
+     soname_spec='${libname}${release}${shared_ext}$major'
1737
+     sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
1738
+     sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
1739
+     ;;
1740
+   *)
1741
+    shrext_cmds='.sl'
1742
+    dynamic_linker="$host_os dld.sl"
1743
+    shlibpath_var=SHLIB_PATH
1744
+    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
1745
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
1746
+    soname_spec='${libname}${release}${shared_ext}$major'
1747
+    ;;
1748
+  esac
1749
+  # HP-UX runs *really* slowly unless shared libraries are mode 555.
1750
+  postinstall_cmds='chmod 555 $lib'
1751
+  ;;
1752
+
1753
+interix[[3-9]]*)
1754
+  version_type=linux
1755
+  need_lib_prefix=no
1756
+  need_version=no
1757
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
1758
+  soname_spec='${libname}${release}${shared_ext}$major'
1759
+  dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
1760
+  shlibpath_var=LD_LIBRARY_PATH
1761
+  shlibpath_overrides_runpath=no
1762
+  hardcode_into_libs=yes
1763
+  ;;
1764
+
1765
+irix5* | irix6* | nonstopux*)
1766
+  case $host_os in
1767
+    nonstopux*) version_type=nonstopux ;;
1768
+    *)
1769
+	if test "$lt_cv_prog_gnu_ld" = yes; then
1770
+		version_type=linux
1771
+	else
1772
+		version_type=irix
1773
+	fi ;;
1774
+  esac
1775
+  need_lib_prefix=no
1776
+  need_version=no
1777
+  soname_spec='${libname}${release}${shared_ext}$major'
1778
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
1779
+  case $host_os in
1780
+  irix5* | nonstopux*)
1781
+    libsuff= shlibsuff=
1782
+    ;;
1783
+  *)
1784
+    case $LD in # libtool.m4 will add one of these switches to LD
1785
+    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
1786
+      libsuff= shlibsuff= libmagic=32-bit;;
1787
+    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
1788
+      libsuff=32 shlibsuff=N32 libmagic=N32;;
1789
+    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
1790
+      libsuff=64 shlibsuff=64 libmagic=64-bit;;
1791
+    *) libsuff= shlibsuff= libmagic=never-match;;
1792
+    esac
1793
+    ;;
1794
+  esac
1795
+  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
1796
+  shlibpath_overrides_runpath=no
1797
+  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
1798
+  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
1799
+  hardcode_into_libs=yes
1800
+  ;;
1801
+
1802
+# No shared lib support for Linux oldld, aout, or coff.
1803
+linux*oldld* | linux*aout* | linux*coff*)
1804
+  dynamic_linker=no
1805
+  ;;
1806
+
1807
+# This must be Linux ELF.
1808
+linux* | k*bsd*-gnu)
1809
+  version_type=linux
1810
+  need_lib_prefix=no
1811
+  need_version=no
1812
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
1813
+  soname_spec='${libname}${release}${shared_ext}$major'
1814
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
1815
+  shlibpath_var=LD_LIBRARY_PATH
1816
+  shlibpath_overrides_runpath=no
1817
+  # This implies no fast_install, which is unacceptable.
1818
+  # Some rework will be needed to allow for fast_install
1819
+  # before this can be enabled.
1820
+  hardcode_into_libs=yes
1821
+
1822
+  # Append ld.so.conf contents to the search path
1823
+  if test -f /etc/ld.so.conf; then
1824
+    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' ' '`
1825
+    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
1826
+  fi
1827
+
1828
+  # We used to test for /lib/ld.so.1 and disable shared libraries on
1829
+  # powerpc, because MkLinux only supported shared libraries with the
1830
+  # GNU dynamic linker.  Since this was broken with cross compilers,
1831
+  # most powerpc-linux boxes support dynamic linking these days and
1832
+  # people can always --disable-shared, the test was removed, and we
1833
+  # assume the GNU/Linux dynamic linker is in use.
1834
+  dynamic_linker='GNU/Linux ld.so'
1835
+  ;;
1836
+
1837
+netbsdelf*-gnu)
1838
+  version_type=linux
1839
+  need_lib_prefix=no
1840
+  need_version=no
1841
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
1842
+  soname_spec='${libname}${release}${shared_ext}$major'
1843
+  shlibpath_var=LD_LIBRARY_PATH
1844
+  shlibpath_overrides_runpath=no
1845
+  hardcode_into_libs=yes
1846
+  dynamic_linker='NetBSD ld.elf_so'
1847
+  ;;
1848
+
1849
+netbsd*)
1850
+  version_type=sunos
1851
+  need_lib_prefix=no
1852
+  need_version=no
1853
+  if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
1854
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
1855
+    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
1856
+    dynamic_linker='NetBSD (a.out) ld.so'
1857
+  else
1858
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
1859
+    soname_spec='${libname}${release}${shared_ext}$major'
1860
+    dynamic_linker='NetBSD ld.elf_so'
1861
+  fi
1862
+  shlibpath_var=LD_LIBRARY_PATH
1863
+  shlibpath_overrides_runpath=yes
1864
+  hardcode_into_libs=yes
1865
+  ;;
1866
+
1867
+newsos6)
1868
+  version_type=linux
1869
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
1870
+  shlibpath_var=LD_LIBRARY_PATH
1871
+  shlibpath_overrides_runpath=yes
1872
+  ;;
1873
+
1874
+nto-qnx*)
1875
+  version_type=linux
1876
+  need_lib_prefix=no
1877
+  need_version=no
1878
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
1879
+  soname_spec='${libname}${release}${shared_ext}$major'
1880
+  shlibpath_var=LD_LIBRARY_PATH
1881
+  shlibpath_overrides_runpath=yes
1882
+  ;;
1883
+
1884
+openbsd*)
1885
+  version_type=sunos
1886
+  sys_lib_dlsearch_path_spec="/usr/lib"
1887
+  need_lib_prefix=no
1888
+  # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
1889
+  case $host_os in
1890
+    openbsd3.3 | openbsd3.3.*) need_version=yes ;;
1891
+    *)                         need_version=no  ;;
1892
+  esac
1893
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
1894
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
1895
+  shlibpath_var=LD_LIBRARY_PATH
1896
+  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
1897
+    case $host_os in
1898
+      openbsd2.[[89]] | openbsd2.[[89]].*)
1899
+	shlibpath_overrides_runpath=no
1900
+	;;
1901
+      *)
1902
+	shlibpath_overrides_runpath=yes
1903
+	;;
1904
+      esac
1905
+  else
1906
+    shlibpath_overrides_runpath=yes
1907
+  fi
1908
+  ;;
1909
+
1910
+os2*)
1911
+  libname_spec='$name'
1912
+  shrext_cmds=".dll"
1913
+  need_lib_prefix=no
1914
+  library_names_spec='$libname${shared_ext} $libname.a'
1915
+  dynamic_linker='OS/2 ld.exe'
1916
+  shlibpath_var=LIBPATH
1917
+  ;;
1918
+
1919
+osf3* | osf4* | osf5*)
1920
+  version_type=osf
1921
+  need_lib_prefix=no
1922
+  need_version=no
1923
+  soname_spec='${libname}${release}${shared_ext}$major'
1924
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
1925
+  shlibpath_var=LD_LIBRARY_PATH
1926
+  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
1927
+  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
1928
+  ;;
1929
+
1930
+rdos*)
1931
+  dynamic_linker=no
1932
+  ;;
1933
+
1934
+solaris*)
1935
+  version_type=linux
1936
+  need_lib_prefix=no
1937
+  need_version=no
1938
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
1939
+  soname_spec='${libname}${release}${shared_ext}$major'
1940
+  shlibpath_var=LD_LIBRARY_PATH
1941
+  shlibpath_overrides_runpath=yes
1942
+  hardcode_into_libs=yes
1943
+  # ldd complains unless libraries are executable
1944
+  postinstall_cmds='chmod +x $lib'
1945
+  ;;
1946
+
1947
+sunos4*)
1948
+  version_type=sunos
1949
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
1950
+  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
1951
+  shlibpath_var=LD_LIBRARY_PATH
1952
+  shlibpath_overrides_runpath=yes
1953
+  if test "$with_gnu_ld" = yes; then
1954
+    need_lib_prefix=no
1955
+  fi
1956
+  need_version=yes
1957
+  ;;
1958
+
1959
+sysv4 | sysv4.3*)
1960
+  version_type=linux
1961
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
1962
+  soname_spec='${libname}${release}${shared_ext}$major'
1963
+  shlibpath_var=LD_LIBRARY_PATH
1964
+  case $host_vendor in
1965
+    sni)
1966
+      shlibpath_overrides_runpath=no
1967
+      need_lib_prefix=no
1968
+      export_dynamic_flag_spec='${wl}-Blargedynsym'
1969
+      runpath_var=LD_RUN_PATH
1970
+      ;;
1971
+    siemens)
1972
+      need_lib_prefix=no
1973
+      ;;
1974
+    motorola)
1975
+      need_lib_prefix=no
1976
+      need_version=no
1977
+      shlibpath_overrides_runpath=no
1978
+      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
1979
+      ;;
1980
+  esac
1981
+  ;;
1982
+
1983
+sysv4*MP*)
1984
+  if test -d /usr/nec ;then
1985
+    version_type=linux
1986
+    library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
1987
+    soname_spec='$libname${shared_ext}.$major'
1988
+    shlibpath_var=LD_LIBRARY_PATH
1989
+  fi
1990
+  ;;
1991
+
1992
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
1993
+  version_type=freebsd-elf
1994
+  need_lib_prefix=no
1995
+  need_version=no
1996
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
1997
+  soname_spec='${libname}${release}${shared_ext}$major'
1998
+  shlibpath_var=LD_LIBRARY_PATH
1999
+  hardcode_into_libs=yes
2000
+  if test "$with_gnu_ld" = yes; then
2001
+    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
2002
+    shlibpath_overrides_runpath=no
2003
+  else
2004
+    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
2005
+    shlibpath_overrides_runpath=yes
2006
+    case $host_os in
2007
+      sco3.2v5*)
2008
+        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
2009
+	;;
2010
+    esac
2011
+  fi
2012
+  sys_lib_dlsearch_path_spec='/usr/lib'
2013
+  ;;
2014
+
2015
+uts4*)
2016
+  version_type=linux
2017
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2018
+  soname_spec='${libname}${release}${shared_ext}$major'
2019
+  shlibpath_var=LD_LIBRARY_PATH
2020
+  ;;
2021
+
2022
+*)
2023
+  dynamic_linker=no
2024
+  ;;
2025
+esac
2026
+AC_MSG_RESULT([$dynamic_linker])
2027
+test "$dynamic_linker" = no && can_build_shared=no
2028
+
2029
+AC_CACHE_VAL([lt_cv_sys_lib_search_path_spec],
2030
+[lt_cv_sys_lib_search_path_spec="$sys_lib_search_path_spec"])
2031
+sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
2032
+AC_CACHE_VAL([lt_cv_sys_lib_dlsearch_path_spec],
2033
+[lt_cv_sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec"])
2034
+sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
2035
+
2036
+variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
2037
+if test "$GCC" = yes; then
2038
+  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
2039
+fi
2040
+])# AC_LIBTOOL_SYS_DYNAMIC_LINKER
2041
+
2042
+
2043
+# _LT_AC_TAGCONFIG
2044
+# ----------------
2045
+AC_DEFUN([_LT_AC_TAGCONFIG],
2046
+[AC_REQUIRE([LT_AC_PROG_SED])dnl
2047
+AC_ARG_WITH([tags],
2048
+    [AC_HELP_STRING([--with-tags@<:@=TAGS@:>@],
2049
+        [include additional configurations @<:@automatic@:>@])],
2050
+    [tagnames="$withval"])
2051
+
2052
+if test -f "$ltmain" && test -n "$tagnames"; then
2053
+  if test ! -f "${ofile}"; then
2054
+    AC_MSG_WARN([output file `$ofile' does not exist])
2055
+  fi
2056
+
2057
+  if test -z "$LTCC"; then
2058
+    eval "`$SHELL ${ofile} --config | grep '^LTCC='`"
2059
+    if test -z "$LTCC"; then
2060
+      AC_MSG_WARN([output file `$ofile' does not look like a libtool script])
2061
+    else
2062
+      AC_MSG_WARN([using `LTCC=$LTCC', extracted from `$ofile'])
2063
+    fi
2064
+  fi
2065
+  if test -z "$LTCFLAGS"; then
2066
+    eval "`$SHELL ${ofile} --config | grep '^LTCFLAGS='`"
2067
+  fi
2068
+
2069
+  # Extract list of available tagged configurations in $ofile.
2070
+  # Note that this assumes the entire list is on one line.
2071
+  available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'`
2072
+
2073
+  lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
2074
+  for tagname in $tagnames; do
2075
+    IFS="$lt_save_ifs"
2076
+    # Check whether tagname contains only valid characters
2077
+    case `$echo "X$tagname" | $Xsed -e 's:[[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]]::g'` in
2078
+    "") ;;
2079
+    *)  AC_MSG_ERROR([invalid tag name: $tagname])
2080
+	;;
2081
+    esac
2082
+
2083
+    if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null
2084
+    then
2085
+      AC_MSG_ERROR([tag name \"$tagname\" already exists])
2086
+    fi
2087
+
2088
+    # Update the list of available tags.
2089
+    if test -n "$tagname"; then
2090
+      echo appending configuration tag \"$tagname\" to $ofile
2091
+
2092
+      case $tagname in
2093
+      CXX)
2094
+	if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
2095
+	    ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
2096
+	    (test "X$CXX" != "Xg++"))) ; then
2097
+	  AC_LIBTOOL_LANG_CXX_CONFIG
2098
+	else
2099
+	  tagname=""
2100
+	fi
2101
+	;;
2102
+
2103
+      F77)
2104
+	if test -n "$F77" && test "X$F77" != "Xno"; then
2105
+	  AC_LIBTOOL_LANG_F77_CONFIG
2106
+	else
2107
+	  tagname=""
2108
+	fi
2109
+	;;
2110
+
2111
+      GCJ)
2112
+	if test -n "$GCJ" && test "X$GCJ" != "Xno"; then
2113
+	  AC_LIBTOOL_LANG_GCJ_CONFIG
2114
+	else
2115
+	  tagname=""
2116
+	fi
2117
+	;;
2118
+
2119
+      RC)
2120
+	AC_LIBTOOL_LANG_RC_CONFIG
2121
+	;;
2122
+
2123
+      *)
2124
+	AC_MSG_ERROR([Unsupported tag name: $tagname])
2125
+	;;
2126
+      esac
2127
+
2128
+      # Append the new tag name to the list of available tags.
2129
+      if test -n "$tagname" ; then
2130
+      available_tags="$available_tags $tagname"
2131
+    fi
2132
+    fi
2133
+  done
2134
+  IFS="$lt_save_ifs"
2135
+
2136
+  # Now substitute the updated list of available tags.
2137
+  if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then
2138
+    mv "${ofile}T" "$ofile"
2139
+    chmod +x "$ofile"
2140
+  else
2141
+    rm -f "${ofile}T"
2142
+    AC_MSG_ERROR([unable to update list of available tagged configurations.])
2143
+  fi
2144
+fi
2145
+])# _LT_AC_TAGCONFIG
2146
+
2147
+
2148
+# AC_LIBTOOL_DLOPEN
2149
+# -----------------
2150
+# enable checks for dlopen support
2151
+AC_DEFUN([AC_LIBTOOL_DLOPEN],
2152
+ [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])
2153
+])# AC_LIBTOOL_DLOPEN
2154
+
2155
+
2156
+# AC_LIBTOOL_WIN32_DLL
2157
+# --------------------
2158
+# declare package support for building win32 DLLs
2159
+AC_DEFUN([AC_LIBTOOL_WIN32_DLL],
2160
+[AC_BEFORE([$0], [AC_LIBTOOL_SETUP])
2161
+])# AC_LIBTOOL_WIN32_DLL
2162
+
2163
+
2164
+# AC_ENABLE_SHARED([DEFAULT])
2165
+# ---------------------------
2166
+# implement the --enable-shared flag
2167
+# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
2168
+AC_DEFUN([AC_ENABLE_SHARED],
2169
+[define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
2170
+AC_ARG_ENABLE([shared],
2171
+    [AC_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
2172
+	[build shared libraries @<:@default=]AC_ENABLE_SHARED_DEFAULT[@:>@])],
2173
+    [p=${PACKAGE-default}
2174
+    case $enableval in
2175
+    yes) enable_shared=yes ;;
2176
+    no) enable_shared=no ;;
2177
+    *)
2178
+      enable_shared=no
2179
+      # Look at the argument we got.  We use all the common list separators.
2180
+      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
2181
+      for pkg in $enableval; do
2182
+	IFS="$lt_save_ifs"
2183
+	if test "X$pkg" = "X$p"; then
2184
+	  enable_shared=yes
2185
+	fi
2186
+      done
2187
+      IFS="$lt_save_ifs"
2188
+      ;;
2189
+    esac],
2190
+    [enable_shared=]AC_ENABLE_SHARED_DEFAULT)
2191
+])# AC_ENABLE_SHARED
2192
+
2193
+
2194
+# AC_DISABLE_SHARED
2195
+# -----------------
2196
+# set the default shared flag to --disable-shared
2197
+AC_DEFUN([AC_DISABLE_SHARED],
2198
+[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
2199
+AC_ENABLE_SHARED(no)
2200
+])# AC_DISABLE_SHARED
2201
+
2202
+
2203
+# AC_ENABLE_STATIC([DEFAULT])
2204
+# ---------------------------
2205
+# implement the --enable-static flag
2206
+# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
2207
+AC_DEFUN([AC_ENABLE_STATIC],
2208
+[define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
2209
+AC_ARG_ENABLE([static],
2210
+    [AC_HELP_STRING([--enable-static@<:@=PKGS@:>@],
2211
+	[build static libraries @<:@default=]AC_ENABLE_STATIC_DEFAULT[@:>@])],
2212
+    [p=${PACKAGE-default}
2213
+    case $enableval in
2214
+    yes) enable_static=yes ;;
2215
+    no) enable_static=no ;;
2216
+    *)
2217
+     enable_static=no
2218
+      # Look at the argument we got.  We use all the common list separators.
2219
+      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
2220
+      for pkg in $enableval; do
2221
+	IFS="$lt_save_ifs"
2222
+	if test "X$pkg" = "X$p"; then
2223
+	  enable_static=yes
2224
+	fi
2225
+      done
2226
+      IFS="$lt_save_ifs"
2227
+      ;;
2228
+    esac],
2229
+    [enable_static=]AC_ENABLE_STATIC_DEFAULT)
2230
+])# AC_ENABLE_STATIC
2231
+
2232
+
2233
+# AC_DISABLE_STATIC
2234
+# -----------------
2235
+# set the default static flag to --disable-static
2236
+AC_DEFUN([AC_DISABLE_STATIC],
2237
+[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
2238
+AC_ENABLE_STATIC(no)
2239
+])# AC_DISABLE_STATIC
2240
+
2241
+
2242
+# AC_ENABLE_FAST_INSTALL([DEFAULT])
2243
+# ---------------------------------
2244
+# implement the --enable-fast-install flag
2245
+# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
2246
+AC_DEFUN([AC_ENABLE_FAST_INSTALL],
2247
+[define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
2248
+AC_ARG_ENABLE([fast-install],
2249
+    [AC_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
2250
+    [optimize for fast installation @<:@default=]AC_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
2251
+    [p=${PACKAGE-default}
2252
+    case $enableval in
2253
+    yes) enable_fast_install=yes ;;
2254
+    no) enable_fast_install=no ;;
2255
+    *)
2256
+      enable_fast_install=no
2257
+      # Look at the argument we got.  We use all the common list separators.
2258
+      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
2259
+      for pkg in $enableval; do
2260
+	IFS="$lt_save_ifs"
2261
+	if test "X$pkg" = "X$p"; then
2262
+	  enable_fast_install=yes
2263
+	fi
2264
+      done
2265
+      IFS="$lt_save_ifs"
2266
+      ;;
2267
+    esac],
2268
+    [enable_fast_install=]AC_ENABLE_FAST_INSTALL_DEFAULT)
2269
+])# AC_ENABLE_FAST_INSTALL
2270
+
2271
+
2272
+# AC_DISABLE_FAST_INSTALL
2273
+# -----------------------
2274
+# set the default to --disable-fast-install
2275
+AC_DEFUN([AC_DISABLE_FAST_INSTALL],
2276
+[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
2277
+AC_ENABLE_FAST_INSTALL(no)
2278
+])# AC_DISABLE_FAST_INSTALL
2279
+
2280
+
2281
+# AC_LIBTOOL_PICMODE([MODE])
2282
+# --------------------------
2283
+# implement the --with-pic flag
2284
+# MODE is either `yes' or `no'.  If omitted, it defaults to `both'.
2285
+AC_DEFUN([AC_LIBTOOL_PICMODE],
2286
+[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
2287
+pic_mode=ifelse($#,1,$1,default)
2288
+])# AC_LIBTOOL_PICMODE
2289
+
2290
+
2291
+# AC_PROG_EGREP
2292
+# -------------
2293
+# This is predefined starting with Autoconf 2.54, so this conditional
2294
+# definition can be removed once we require Autoconf 2.54 or later.
2295
+m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP],
2296
+[AC_CACHE_CHECK([for egrep], [ac_cv_prog_egrep],
2297
+   [if echo a | (grep -E '(a|b)') >/dev/null 2>&1
2298
+    then ac_cv_prog_egrep='grep -E'
2299
+    else ac_cv_prog_egrep='egrep'
2300
+    fi])
2301
+ EGREP=$ac_cv_prog_egrep
2302
+ AC_SUBST([EGREP])
2303
+])])
2304
+
2305
+
2306
+# AC_PATH_TOOL_PREFIX
2307
+# -------------------
2308
+# find a file program which can recognize shared library
2309
+AC_DEFUN([AC_PATH_TOOL_PREFIX],
2310
+[AC_REQUIRE([AC_PROG_EGREP])dnl
2311
+AC_MSG_CHECKING([for $1])
2312
+AC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
2313
+[case $MAGIC_CMD in
2314
+[[\\/*] |  ?:[\\/]*])
2315
+  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
2316
+  ;;
2317
+*)
2318
+  lt_save_MAGIC_CMD="$MAGIC_CMD"
2319
+  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
2320
+dnl $ac_dummy forces splitting on constant user-supplied paths.
2321
+dnl POSIX.2 word splitting is done only on the output of word expansions,
2322
+dnl not every word.  This closes a longstanding sh security hole.
2323
+  ac_dummy="ifelse([$2], , $PATH, [$2])"
2324
+  for ac_dir in $ac_dummy; do
2325
+    IFS="$lt_save_ifs"
2326
+    test -z "$ac_dir" && ac_dir=.
2327
+    if test -f $ac_dir/$1; then
2328
+      lt_cv_path_MAGIC_CMD="$ac_dir/$1"
2329
+      if test -n "$file_magic_test_file"; then
2330
+	case $deplibs_check_method in
2331
+	"file_magic "*)
2332
+	  file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
2333
+	  MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
2334
+	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
2335
+	    $EGREP "$file_magic_regex" > /dev/null; then
2336
+	    :
2337
+	  else
2338
+	    cat <<EOF 1>&2
2339
+
2340
+*** Warning: the command libtool uses to detect shared libraries,
2341
+*** $file_magic_cmd, produces output that libtool cannot recognize.
2342
+*** The result is that libtool may fail to recognize shared libraries
2343
+*** as such.  This will affect the creation of libtool libraries that
2344
+*** depend on shared libraries, but programs linked with such libtool
2345
+*** libraries will work regardless of this problem.  Nevertheless, you
2346
+*** may want to report the problem to your system manager and/or to
2347
+*** bug-libtool@gnu.org
2348
+
2349
+EOF
2350
+	  fi ;;
2351
+	esac
2352
+      fi
2353
+      break
2354
+    fi
2355
+  done
2356
+  IFS="$lt_save_ifs"
2357
+  MAGIC_CMD="$lt_save_MAGIC_CMD"
2358
+  ;;
2359
+esac])
2360
+MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
2361
+if test -n "$MAGIC_CMD"; then
2362
+  AC_MSG_RESULT($MAGIC_CMD)
2363
+else
2364
+  AC_MSG_RESULT(no)
2365
+fi
2366
+])# AC_PATH_TOOL_PREFIX
2367
+
2368
+
2369
+# AC_PATH_MAGIC
2370
+# -------------
2371
+# find a file program which can recognize a shared library
2372
+AC_DEFUN([AC_PATH_MAGIC],
2373
+[AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
2374
+if test -z "$lt_cv_path_MAGIC_CMD"; then
2375
+  if test -n "$ac_tool_prefix"; then
2376
+    AC_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
2377
+  else
2378
+    MAGIC_CMD=:
2379
+  fi
2380
+fi
2381
+])# AC_PATH_MAGIC
2382
+
2383
+
2384
+# AC_PROG_LD
2385
+# ----------
2386
+# find the pathname to the GNU or non-GNU linker
2387
+AC_DEFUN([AC_PROG_LD],
2388
+[AC_ARG_WITH([gnu-ld],
2389
+    [AC_HELP_STRING([--with-gnu-ld],
2390
+	[assume the C compiler uses GNU ld @<:@default=no@:>@])],
2391
+    [test "$withval" = no || with_gnu_ld=yes],
2392
+    [with_gnu_ld=no])
2393
+AC_REQUIRE([LT_AC_PROG_SED])dnl
2394
+AC_REQUIRE([AC_PROG_CC])dnl
2395
+AC_REQUIRE([AC_CANONICAL_HOST])dnl
2396
+AC_REQUIRE([AC_CANONICAL_BUILD])dnl
2397
+ac_prog=ld
2398
+if test "$GCC" = yes; then
2399
+  # Check if gcc -print-prog-name=ld gives a path.
2400
+  AC_MSG_CHECKING([for ld used by $CC])
2401
+  case $host in
2402
+  *-*-mingw*)
2403
+    # gcc leaves a trailing carriage return which upsets mingw
2404
+    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
2405
+  *)
2406
+    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
2407
+  esac
2408
+  case $ac_prog in
2409
+    # Accept absolute paths.
2410
+    [[\\/]]* | ?:[[\\/]]*)
2411
+      re_direlt='/[[^/]][[^/]]*/\.\./'
2412
+      # Canonicalize the pathname of ld
2413
+      ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'`
2414
+      while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
2415
+	ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"`
2416
+      done
2417
+      test -z "$LD" && LD="$ac_prog"
2418
+      ;;
2419
+  "")
2420
+    # If it fails, then pretend we aren't using GCC.
2421
+    ac_prog=ld
2422
+    ;;
2423
+  *)
2424
+    # If it is relative, then search for the first ld in PATH.
2425
+    with_gnu_ld=unknown
2426
+    ;;
2427
+  esac
2428
+elif test "$with_gnu_ld" = yes; then
2429
+  AC_MSG_CHECKING([for GNU ld])
2430
+else
2431
+  AC_MSG_CHECKING([for non-GNU ld])
2432
+fi
2433
+AC_CACHE_VAL(lt_cv_path_LD,
2434
+[if test -z "$LD"; then
2435
+  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
2436
+  for ac_dir in $PATH; do
2437
+    IFS="$lt_save_ifs"
2438
+    test -z "$ac_dir" && ac_dir=.
2439
+    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
2440
+      lt_cv_path_LD="$ac_dir/$ac_prog"
2441
+      # Check to see if the program is GNU ld.  I'd rather use --version,
2442
+      # but apparently some variants of GNU ld only accept -v.
2443
+      # Break only if it was the GNU/non-GNU ld that we prefer.
2444
+      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
2445
+      *GNU* | *'with BFD'*)
2446
+	test "$with_gnu_ld" != no && break
2447
+	;;
2448
+      *)
2449
+	test "$with_gnu_ld" != yes && break
2450
+	;;
2451
+      esac
2452
+    fi
2453
+  done
2454
+  IFS="$lt_save_ifs"
2455
+else
2456
+  lt_cv_path_LD="$LD" # Let the user override the test with a path.
2457
+fi])
2458
+LD="$lt_cv_path_LD"
2459
+if test -n "$LD"; then
2460
+  AC_MSG_RESULT($LD)
2461
+else
2462
+  AC_MSG_RESULT(no)
2463
+fi
2464
+test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
2465
+AC_PROG_LD_GNU
2466
+])# AC_PROG_LD
2467
+
2468
+
2469
+# AC_PROG_LD_GNU
2470
+# --------------
2471
+AC_DEFUN([AC_PROG_LD_GNU],
2472
+[AC_REQUIRE([AC_PROG_EGREP])dnl
2473
+AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
2474
+[# I'd rather use --version here, but apparently some GNU lds only accept -v.
2475
+case `$LD -v 2>&1 </dev/null` in
2476
+*GNU* | *'with BFD'*)
2477
+  lt_cv_prog_gnu_ld=yes
2478
+  ;;
2479
+*)
2480
+  lt_cv_prog_gnu_ld=no
2481
+  ;;
2482
+esac])
2483
+with_gnu_ld=$lt_cv_prog_gnu_ld
2484
+])# AC_PROG_LD_GNU
2485
+
2486
+
2487
+# AC_PROG_LD_RELOAD_FLAG
2488
+# ----------------------
2489
+# find reload flag for linker
2490
+#   -- PORTME Some linkers may need a different reload flag.
2491
+AC_DEFUN([AC_PROG_LD_RELOAD_FLAG],
2492
+[AC_CACHE_CHECK([for $LD option to reload object files],
2493
+  lt_cv_ld_reload_flag,
2494
+  [lt_cv_ld_reload_flag='-r'])
2495
+reload_flag=$lt_cv_ld_reload_flag
2496
+case $reload_flag in
2497
+"" | " "*) ;;
2498
+*) reload_flag=" $reload_flag" ;;
2499
+esac
2500
+reload_cmds='$LD$reload_flag -o $output$reload_objs'
2501
+case $host_os in
2502
+  darwin*)
2503
+    if test "$GCC" = yes; then
2504
+      reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
2505
+    else
2506
+      reload_cmds='$LD$reload_flag -o $output$reload_objs'
2507
+    fi
2508
+    ;;
2509
+esac
2510
+])# AC_PROG_LD_RELOAD_FLAG
2511
+
2512
+
2513
+# AC_DEPLIBS_CHECK_METHOD
2514
+# -----------------------
2515
+# how to check for library dependencies
2516
+#  -- PORTME fill in with the dynamic library characteristics
2517
+AC_DEFUN([AC_DEPLIBS_CHECK_METHOD],
2518
+[AC_CACHE_CHECK([how to recognize dependent libraries],
2519
+lt_cv_deplibs_check_method,
2520
+[lt_cv_file_magic_cmd='$MAGIC_CMD'
2521
+lt_cv_file_magic_test_file=
2522
+lt_cv_deplibs_check_method='unknown'
2523
+# Need to set the preceding variable on all platforms that support
2524
+# interlibrary dependencies.
2525
+# 'none' -- dependencies not supported.
2526
+# `unknown' -- same as none, but documents that we really don't know.
2527
+# 'pass_all' -- all dependencies passed with no checks.
2528
+# 'test_compile' -- check by making test program.
2529
+# 'file_magic [[regex]]' -- check by looking for files in library path
2530
+# which responds to the $file_magic_cmd with a given extended regex.
2531
+# If you have `file' or equivalent on your system and you're not sure
2532
+# whether `pass_all' will *always* work, you probably want this one.
2533
+
2534
+case $host_os in
2535
+aix[[4-9]]*)
2536
+  lt_cv_deplibs_check_method=pass_all
2537
+  ;;
2538
+
2539
+beos*)
2540
+  lt_cv_deplibs_check_method=pass_all
2541
+  ;;
2542
+
2543
+bsdi[[45]]*)
2544
+  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
2545
+  lt_cv_file_magic_cmd='/usr/bin/file -L'
2546
+  lt_cv_file_magic_test_file=/shlib/libc.so
2547
+  ;;
2548
+
2549
+cygwin*)
2550
+  # func_win32_libid is a shell function defined in ltmain.sh
2551
+  lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
2552
+  lt_cv_file_magic_cmd='func_win32_libid'
2553
+  ;;
2554
+
2555
+mingw* | pw32*)
2556
+  # Base MSYS/MinGW do not provide the 'file' command needed by
2557
+  # func_win32_libid shell function, so use a weaker test based on 'objdump',
2558
+  # unless we find 'file', for example because we are cross-compiling.
2559
+  if ( file / ) >/dev/null 2>&1; then
2560
+    lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
2561
+    lt_cv_file_magic_cmd='func_win32_libid'
2562
+  else
2563
+    lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
2564
+    lt_cv_file_magic_cmd='$OBJDUMP -f'
2565
+  fi
2566
+  ;;
2567
+
2568
+darwin* | rhapsody*)
2569
+  lt_cv_deplibs_check_method=pass_all
2570
+  ;;
2571
+
2572
+freebsd* | dragonfly*)
2573
+  if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
2574
+    case $host_cpu in
2575
+    i*86 )
2576
+      # Not sure whether the presence of OpenBSD here was a mistake.
2577
+      # Let's accept both of them until this is cleared up.
2578
+      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
2579
+      lt_cv_file_magic_cmd=/usr/bin/file
2580
+      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
2581
+      ;;
2582
+    esac
2583
+  else
2584
+    lt_cv_deplibs_check_method=pass_all
2585
+  fi
2586
+  ;;
2587
+
2588
+gnu*)
2589
+  lt_cv_deplibs_check_method=pass_all
2590
+  ;;
2591
+
2592
+hpux10.20* | hpux11*)
2593
+  lt_cv_file_magic_cmd=/usr/bin/file
2594
+  case $host_cpu in
2595
+  ia64*)
2596
+    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
2597
+    lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
2598
+    ;;
2599
+  hppa*64*)
2600
+    [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]']
2601
+    lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
2602
+    ;;
2603
+  *)
2604
+    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library'
2605
+    lt_cv_file_magic_test_file=/usr/lib/libc.sl
2606
+    ;;
2607
+  esac
2608
+  ;;
2609
+
2610
+interix[[3-9]]*)
2611
+  # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
2612
+  lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$'
2613
+  ;;
2614
+
2615
+irix5* | irix6* | nonstopux*)
2616
+  case $LD in
2617
+  *-32|*"-32 ") libmagic=32-bit;;
2618
+  *-n32|*"-n32 ") libmagic=N32;;
2619
+  *-64|*"-64 ") libmagic=64-bit;;
2620
+  *) libmagic=never-match;;
2621
+  esac
2622
+  lt_cv_deplibs_check_method=pass_all
2623
+  ;;
2624
+
2625
+# This must be Linux ELF.
2626
+linux* | k*bsd*-gnu)
2627
+  lt_cv_deplibs_check_method=pass_all
2628
+  ;;
2629
+
2630
+netbsd* | netbsdelf*-gnu)
2631
+  if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
2632
+    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
2633
+  else
2634
+    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
2635
+  fi
2636
+  ;;
2637
+
2638
+newos6*)
2639
+  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
2640
+  lt_cv_file_magic_cmd=/usr/bin/file
2641
+  lt_cv_file_magic_test_file=/usr/lib/libnls.so
2642
+  ;;
2643
+
2644
+nto-qnx*)
2645
+  lt_cv_deplibs_check_method=unknown
2646
+  ;;
2647
+
2648
+openbsd*)
2649
+  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
2650
+    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
2651
+  else
2652
+    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
2653
+  fi
2654
+  ;;
2655
+
2656
+osf3* | osf4* | osf5*)
2657
+  lt_cv_deplibs_check_method=pass_all
2658
+  ;;
2659
+
2660
+rdos*)
2661
+  lt_cv_deplibs_check_method=pass_all
2662
+  ;;
2663
+
2664
+solaris*)
2665
+  lt_cv_deplibs_check_method=pass_all
2666
+  ;;
2667
+
2668
+sysv4 | sysv4.3*)
2669
+  case $host_vendor in
2670
+  motorola)
2671
+    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]]'
2672
+    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
2673
+    ;;
2674
+  ncr)
2675
+    lt_cv_deplibs_check_method=pass_all
2676
+    ;;
2677
+  sequent)
2678
+    lt_cv_file_magic_cmd='/bin/file'
2679
+    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
2680
+    ;;
2681
+  sni)
2682
+    lt_cv_file_magic_cmd='/bin/file'
2683
+    lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
2684
+    lt_cv_file_magic_test_file=/lib/libc.so
2685
+    ;;
2686
+  siemens)
2687
+    lt_cv_deplibs_check_method=pass_all
2688
+    ;;
2689
+  pc)
2690
+    lt_cv_deplibs_check_method=pass_all
2691
+    ;;
2692
+  esac
2693
+  ;;
2694
+
2695
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
2696
+  lt_cv_deplibs_check_method=pass_all
2697
+  ;;
2698
+esac
2699
+])
2700
+file_magic_cmd=$lt_cv_file_magic_cmd
2701
+deplibs_check_method=$lt_cv_deplibs_check_method
2702
+test -z "$deplibs_check_method" && deplibs_check_method=unknown
2703
+])# AC_DEPLIBS_CHECK_METHOD
2704
+
2705
+
2706
+# AC_PROG_NM
2707
+# ----------
2708
+# find the pathname to a BSD-compatible name lister
2709
+AC_DEFUN([AC_PROG_NM],
2710
+[AC_CACHE_CHECK([for BSD-compatible nm], lt_cv_path_NM,
2711
+[if test -n "$NM"; then
2712
+  # Let the user override the test.
2713
+  lt_cv_path_NM="$NM"
2714
+else
2715
+  lt_nm_to_check="${ac_tool_prefix}nm"
2716
+  if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
2717
+    lt_nm_to_check="$lt_nm_to_check nm"
2718
+  fi
2719
+  for lt_tmp_nm in $lt_nm_to_check; do
2720
+    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
2721
+    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
2722
+      IFS="$lt_save_ifs"
2723
+      test -z "$ac_dir" && ac_dir=.
2724
+      tmp_nm="$ac_dir/$lt_tmp_nm"
2725
+      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
2726
+	# Check to see if the nm accepts a BSD-compat flag.
2727
+	# Adding the `sed 1q' prevents false positives on HP-UX, which says:
2728
+	#   nm: unknown option "B" ignored
2729
+	# Tru64's nm complains that /dev/null is an invalid object file
2730
+	case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
2731
+	*/dev/null* | *'Invalid file or object type'*)
2732
+	  lt_cv_path_NM="$tmp_nm -B"
2733
+	  break
2734
+	  ;;
2735
+	*)
2736
+	  case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
2737
+	  */dev/null*)
2738
+	    lt_cv_path_NM="$tmp_nm -p"
2739
+	    break
2740
+	    ;;
2741
+	  *)
2742
+	    lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
2743
+	    continue # so that we can try to find one that supports BSD flags
2744
+	    ;;
2745
+	  esac
2746
+	  ;;
2747
+	esac
2748
+      fi
2749
+    done
2750
+    IFS="$lt_save_ifs"
2751
+  done
2752
+  test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm
2753
+fi])
2754
+NM="$lt_cv_path_NM"
2755
+])# AC_PROG_NM
2756
+
2757
+
2758
+# AC_CHECK_LIBM
2759
+# -------------
2760
+# check for math library
2761
+AC_DEFUN([AC_CHECK_LIBM],
2762
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
2763
+LIBM=
2764
+case $host in
2765
+*-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*)
2766
+  # These system don't have libm, or don't need it
2767
+  ;;
2768
+*-ncr-sysv4.3*)
2769
+  AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
2770
+  AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
2771
+  ;;
2772
+*)
2773
+  AC_CHECK_LIB(m, cos, LIBM="-lm")
2774
+  ;;
2775
+esac
2776
+])# AC_CHECK_LIBM
2777
+
2778
+
2779
+# AC_LIBLTDL_CONVENIENCE([DIRECTORY])
2780
+# -----------------------------------
2781
+# sets LIBLTDL to the link flags for the libltdl convenience library and
2782
+# LTDLINCL to the include flags for the libltdl header and adds
2783
+# --enable-ltdl-convenience to the configure arguments.  Note that
2784
+# AC_CONFIG_SUBDIRS is not called here.  If DIRECTORY is not provided,
2785
+# it is assumed to be `libltdl'.  LIBLTDL will be prefixed with
2786
+# '${top_builddir}/' and LTDLINCL will be prefixed with '${top_srcdir}/'
2787
+# (note the single quotes!).  If your package is not flat and you're not
2788
+# using automake, define top_builddir and top_srcdir appropriately in
2789
+# the Makefiles.
2790
+AC_DEFUN([AC_LIBLTDL_CONVENIENCE],
2791
+[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
2792
+  case $enable_ltdl_convenience in
2793
+  no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
2794
+  "") enable_ltdl_convenience=yes
2795
+      ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
2796
+  esac
2797
+  LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la
2798
+  LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
2799
+  # For backwards non-gettext consistent compatibility...
2800
+  INCLTDL="$LTDLINCL"
2801
+])# AC_LIBLTDL_CONVENIENCE
2802
+
2803
+
2804
+# AC_LIBLTDL_INSTALLABLE([DIRECTORY])
2805
+# -----------------------------------
2806
+# sets LIBLTDL to the link flags for the libltdl installable library and
2807
+# LTDLINCL to the include flags for the libltdl header and adds
2808
+# --enable-ltdl-install to the configure arguments.  Note that
2809
+# AC_CONFIG_SUBDIRS is not called here.  If DIRECTORY is not provided,
2810
+# and an installed libltdl is not found, it is assumed to be `libltdl'.
2811
+# LIBLTDL will be prefixed with '${top_builddir}/'# and LTDLINCL with
2812
+# '${top_srcdir}/' (note the single quotes!).  If your package is not
2813
+# flat and you're not using automake, define top_builddir and top_srcdir
2814
+# appropriately in the Makefiles.
2815
+# In the future, this macro may have to be called after AC_PROG_LIBTOOL.
2816
+AC_DEFUN([AC_LIBLTDL_INSTALLABLE],
2817
+[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
2818
+  AC_CHECK_LIB(ltdl, lt_dlinit,
2819
+  [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
2820
+  [if test x"$enable_ltdl_install" = xno; then
2821
+     AC_MSG_WARN([libltdl not installed, but installation disabled])
2822
+   else
2823
+     enable_ltdl_install=yes
2824
+   fi
2825
+  ])
2826
+  if test x"$enable_ltdl_install" = x"yes"; then
2827
+    ac_configure_args="$ac_configure_args --enable-ltdl-install"
2828
+    LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la
2829
+    LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
2830
+  else
2831
+    ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
2832
+    LIBLTDL="-lltdl"
2833
+    LTDLINCL=
2834
+  fi
2835
+  # For backwards non-gettext consistent compatibility...
2836
+  INCLTDL="$LTDLINCL"
2837
+])# AC_LIBLTDL_INSTALLABLE
2838
+
2839
+
2840
+# AC_LIBTOOL_CXX
2841
+# --------------
2842
+# enable support for C++ libraries
2843
+AC_DEFUN([AC_LIBTOOL_CXX],
2844
+[AC_REQUIRE([_LT_AC_LANG_CXX])
2845
+])# AC_LIBTOOL_CXX
2846
+
2847
+
2848
+# _LT_AC_LANG_CXX
2849
+# ---------------
2850
+AC_DEFUN([_LT_AC_LANG_CXX],
2851
+[AC_REQUIRE([AC_PROG_CXX])
2852
+AC_REQUIRE([_LT_AC_PROG_CXXCPP])
2853
+_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}CXX])
2854
+])# _LT_AC_LANG_CXX
2855
+
2856
+# _LT_AC_PROG_CXXCPP
2857
+# ------------------
2858
+AC_DEFUN([_LT_AC_PROG_CXXCPP],
2859
+[
2860
+AC_REQUIRE([AC_PROG_CXX])
2861
+if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
2862
+    ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
2863
+    (test "X$CXX" != "Xg++"))) ; then
2864
+  AC_PROG_CXXCPP
2865
+fi
2866
+])# _LT_AC_PROG_CXXCPP
2867
+
2868
+# AC_LIBTOOL_F77
2869
+# --------------
2870
+# enable support for Fortran 77 libraries
2871
+AC_DEFUN([AC_LIBTOOL_F77],
2872
+[AC_REQUIRE([_LT_AC_LANG_F77])
2873
+])# AC_LIBTOOL_F77
2874
+
2875
+
2876
+# _LT_AC_LANG_F77
2877
+# ---------------
2878
+AC_DEFUN([_LT_AC_LANG_F77],
2879
+[AC_REQUIRE([AC_PROG_F77])
2880
+_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}F77])
2881
+])# _LT_AC_LANG_F77
2882
+
2883
+
2884
+# AC_LIBTOOL_GCJ
2885
+# --------------
2886
+# enable support for GCJ libraries
2887
+AC_DEFUN([AC_LIBTOOL_GCJ],
2888
+[AC_REQUIRE([_LT_AC_LANG_GCJ])
2889
+])# AC_LIBTOOL_GCJ
2890
+
2891
+
2892
+# _LT_AC_LANG_GCJ
2893
+# ---------------
2894
+AC_DEFUN([_LT_AC_LANG_GCJ],
2895
+[AC_PROVIDE_IFELSE([AC_PROG_GCJ],[],
2896
+  [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],[],
2897
+    [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],[],
2898
+      [ifdef([AC_PROG_GCJ],[AC_REQUIRE([AC_PROG_GCJ])],
2899
+	 [ifdef([A][M_PROG_GCJ],[AC_REQUIRE([A][M_PROG_GCJ])],
2900
+	   [AC_REQUIRE([A][C_PROG_GCJ_OR_A][M_PROG_GCJ])])])])])])
2901
+_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}GCJ])
2902
+])# _LT_AC_LANG_GCJ
2903
+
2904
+
2905
+# AC_LIBTOOL_RC
2906
+# -------------
2907
+# enable support for Windows resource files
2908
+AC_DEFUN([AC_LIBTOOL_RC],
2909
+[AC_REQUIRE([LT_AC_PROG_RC])
2910
+_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}RC])
2911
+])# AC_LIBTOOL_RC
2912
+
2913
+
2914
+# AC_LIBTOOL_LANG_C_CONFIG
2915
+# ------------------------
2916
+# Ensure that the configuration vars for the C compiler are
2917
+# suitably defined.  Those variables are subsequently used by
2918
+# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
2919
+AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG], [_LT_AC_LANG_C_CONFIG])
2920
+AC_DEFUN([_LT_AC_LANG_C_CONFIG],
2921
+[lt_save_CC="$CC"
2922
+AC_LANG_PUSH(C)
2923
+
2924
+# Source file extension for C test sources.
2925
+ac_ext=c
2926
+
2927
+# Object file extension for compiled C test sources.
2928
+objext=o
2929
+_LT_AC_TAGVAR(objext, $1)=$objext
2930
+
2931
+# Code to be used in simple compile tests
2932
+lt_simple_compile_test_code="int some_variable = 0;"
2933
+
2934
+# Code to be used in simple link tests
2935
+lt_simple_link_test_code='int main(){return(0);}'
2936
+
2937
+_LT_AC_SYS_COMPILER
2938
+
2939
+# save warnings/boilerplate of simple test code
2940
+_LT_COMPILER_BOILERPLATE
2941
+_LT_LINKER_BOILERPLATE
2942
+
2943
+AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1)
2944
+AC_LIBTOOL_PROG_COMPILER_PIC($1)
2945
+AC_LIBTOOL_PROG_CC_C_O($1)
2946
+AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
2947
+AC_LIBTOOL_PROG_LD_SHLIBS($1)
2948
+AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
2949
+AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
2950
+AC_LIBTOOL_SYS_LIB_STRIP
2951
+AC_LIBTOOL_DLOPEN_SELF
2952
+
2953
+# Report which library types will actually be built
2954
+AC_MSG_CHECKING([if libtool supports shared libraries])
2955
+AC_MSG_RESULT([$can_build_shared])
2956
+
2957
+AC_MSG_CHECKING([whether to build shared libraries])
2958
+test "$can_build_shared" = "no" && enable_shared=no
2959
+
2960
+# On AIX, shared libraries and static libraries use the same namespace, and
2961
+# are all built from PIC.
2962
+case $host_os in
2963
+aix3*)
2964
+  test "$enable_shared" = yes && enable_static=no
2965
+  if test -n "$RANLIB"; then
2966
+    archive_cmds="$archive_cmds~\$RANLIB \$lib"
2967
+    postinstall_cmds='$RANLIB $lib'
2968
+  fi
2969
+  ;;
2970
+
2971
+aix[[4-9]]*)
2972
+  if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
2973
+    test "$enable_shared" = yes && enable_static=no
2974
+  fi
2975
+    ;;
2976
+esac
2977
+AC_MSG_RESULT([$enable_shared])
2978
+
2979
+AC_MSG_CHECKING([whether to build static libraries])
2980
+# Make sure either enable_shared or enable_static is yes.
2981
+test "$enable_shared" = yes || enable_static=yes
2982
+AC_MSG_RESULT([$enable_static])
2983
+
2984
+AC_LIBTOOL_CONFIG($1)
2985
+
2986
+AC_LANG_POP
2987
+CC="$lt_save_CC"
2988
+])# AC_LIBTOOL_LANG_C_CONFIG
2989
+
2990
+
2991
+# AC_LIBTOOL_LANG_CXX_CONFIG
2992
+# --------------------------
2993
+# Ensure that the configuration vars for the C compiler are
2994
+# suitably defined.  Those variables are subsequently used by
2995
+# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
2996
+AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG], [_LT_AC_LANG_CXX_CONFIG(CXX)])
2997
+AC_DEFUN([_LT_AC_LANG_CXX_CONFIG],
2998
+[AC_LANG_PUSH(C++)
2999
+AC_REQUIRE([AC_PROG_CXX])
3000
+AC_REQUIRE([_LT_AC_PROG_CXXCPP])
3001
+
3002
+_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
3003
+_LT_AC_TAGVAR(allow_undefined_flag, $1)=
3004
+_LT_AC_TAGVAR(always_export_symbols, $1)=no
3005
+_LT_AC_TAGVAR(archive_expsym_cmds, $1)=
3006
+_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
3007
+_LT_AC_TAGVAR(hardcode_direct, $1)=no
3008
+_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
3009
+_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
3010
+_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
3011
+_LT_AC_TAGVAR(hardcode_minus_L, $1)=no
3012
+_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
3013
+_LT_AC_TAGVAR(hardcode_automatic, $1)=no
3014
+_LT_AC_TAGVAR(module_cmds, $1)=
3015
+_LT_AC_TAGVAR(module_expsym_cmds, $1)=
3016
+_LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
3017
+_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
3018
+_LT_AC_TAGVAR(no_undefined_flag, $1)=
3019
+_LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
3020
+_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no
3021
+
3022
+# Dependencies to place before and after the object being linked:
3023
+_LT_AC_TAGVAR(predep_objects, $1)=
3024
+_LT_AC_TAGVAR(postdep_objects, $1)=
3025
+_LT_AC_TAGVAR(predeps, $1)=
3026
+_LT_AC_TAGVAR(postdeps, $1)=
3027
+_LT_AC_TAGVAR(compiler_lib_search_path, $1)=
3028
+_LT_AC_TAGVAR(compiler_lib_search_dirs, $1)=
3029
+
3030
+# Source file extension for C++ test sources.
3031
+ac_ext=cpp
3032
+
3033
+# Object file extension for compiled C++ test sources.
3034
+objext=o
3035
+_LT_AC_TAGVAR(objext, $1)=$objext
3036
+
3037
+# Code to be used in simple compile tests
3038
+lt_simple_compile_test_code="int some_variable = 0;"
3039
+
3040
+# Code to be used in simple link tests
3041
+lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }'
3042
+
3043
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
3044
+_LT_AC_SYS_COMPILER
3045
+
3046
+# save warnings/boilerplate of simple test code
3047
+_LT_COMPILER_BOILERPLATE
3048
+_LT_LINKER_BOILERPLATE
3049
+
3050
+# Allow CC to be a program name with arguments.
3051
+lt_save_CC=$CC
3052
+lt_save_LD=$LD
3053
+lt_save_GCC=$GCC
3054
+GCC=$GXX
3055
+lt_save_with_gnu_ld=$with_gnu_ld
3056
+lt_save_path_LD=$lt_cv_path_LD
3057
+if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
3058
+  lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
3059
+else
3060
+  $as_unset lt_cv_prog_gnu_ld
3061
+fi
3062
+if test -n "${lt_cv_path_LDCXX+set}"; then
3063
+  lt_cv_path_LD=$lt_cv_path_LDCXX
3064
+else
3065
+  $as_unset lt_cv_path_LD
3066
+fi
3067
+test -z "${LDCXX+set}" || LD=$LDCXX
3068
+CC=${CXX-"c++"}
3069
+compiler=$CC
3070
+_LT_AC_TAGVAR(compiler, $1)=$CC
3071
+_LT_CC_BASENAME([$compiler])
3072
+
3073
+# We don't want -fno-exception wen compiling C++ code, so set the
3074
+# no_builtin_flag separately
3075
+if test "$GXX" = yes; then
3076
+  _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
3077
+else
3078
+  _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
3079
+fi
3080
+
3081
+if test "$GXX" = yes; then
3082
+  # Set up default GNU C++ configuration
3083
+
3084
+  AC_PROG_LD
3085
+
3086
+  # Check if GNU C++ uses GNU ld as the underlying linker, since the
3087
+  # archiving commands below assume that GNU ld is being used.
3088
+  if test "$with_gnu_ld" = yes; then
3089
+    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
3090
+    _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'
3091
+
3092
+    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
3093
+    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
3094
+
3095
+    # If archive_cmds runs LD, not CC, wlarc should be empty
3096
+    # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
3097
+    #     investigate it a little bit more. (MM)
3098
+    wlarc='${wl}'
3099
+
3100
+    # ancient GNU ld didn't support --whole-archive et. al.
3101
+    if eval "`$CC -print-prog-name=ld` --help 2>&1" | \
3102
+	grep 'no-whole-archive' > /dev/null; then
3103
+      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
3104
+    else
3105
+      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
3106
+    fi
3107
+  else
3108
+    with_gnu_ld=no
3109
+    wlarc=
3110
+
3111
+    # A generic and very simple default shared library creation
3112
+    # command for GNU C++ for the case where it uses the native
3113
+    # linker, instead of GNU ld.  If possible, this setting should
3114
+    # overridden to take advantage of the native linker features on
3115
+    # the platform it is being used on.
3116
+    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
3117
+  fi
3118
+
3119
+  # Commands to make compiler produce verbose output that lists
3120
+  # what "hidden" libraries, object files and flags are used when
3121
+  # linking a shared library.
3122
+  output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
3123
+
3124
+else
3125
+  GXX=no
3126
+  with_gnu_ld=no
3127
+  wlarc=
3128
+fi
3129
+
3130
+# PORTME: fill in a description of your system's C++ link characteristics
3131
+AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
3132
+_LT_AC_TAGVAR(ld_shlibs, $1)=yes
3133
+case $host_os in
3134
+  aix3*)
3135
+    # FIXME: insert proper C++ library support
3136
+    _LT_AC_TAGVAR(ld_shlibs, $1)=no
3137
+    ;;
3138
+  aix[[4-9]]*)
3139
+    if test "$host_cpu" = ia64; then
3140
+      # On IA64, the linker does run time linking by default, so we don't
3141
+      # have to do anything special.
3142
+      aix_use_runtimelinking=no
3143
+      exp_sym_flag='-Bexport'
3144
+      no_entry_flag=""
3145
+    else
3146
+      aix_use_runtimelinking=no
3147
+
3148
+      # Test if we are trying to use run time linking or normal
3149
+      # AIX style linking. If -brtl is somewhere in LDFLAGS, we
3150
+      # need to do runtime linking.
3151
+      case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
3152
+	for ld_flag in $LDFLAGS; do
3153
+	  case $ld_flag in
3154
+	  *-brtl*)
3155
+	    aix_use_runtimelinking=yes
3156
+	    break
3157
+	    ;;
3158
+	  esac
3159
+	done
3160
+	;;
3161
+      esac
3162
+
3163
+      exp_sym_flag='-bexport'
3164
+      no_entry_flag='-bnoentry'
3165
+    fi
3166
+
3167
+    # When large executables or shared objects are built, AIX ld can
3168
+    # have problems creating the table of contents.  If linking a library
3169
+    # or program results in "error TOC overflow" add -mminimal-toc to
3170
+    # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
3171
+    # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
3172
+
3173
+    _LT_AC_TAGVAR(archive_cmds, $1)=''
3174
+    _LT_AC_TAGVAR(hardcode_direct, $1)=yes
3175
+    _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
3176
+    _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
3177
+
3178
+    if test "$GXX" = yes; then
3179
+      case $host_os in aix4.[[012]]|aix4.[[012]].*)
3180
+      # We only want to do this on AIX 4.2 and lower, the check
3181
+      # below for broken collect2 doesn't work under 4.3+
3182
+	collect2name=`${CC} -print-prog-name=collect2`
3183
+	if test -f "$collect2name" && \
3184
+	   strings "$collect2name" | grep resolve_lib_name >/dev/null
3185
+	then
3186
+	  # We have reworked collect2
3187
+	  :
3188
+	else
3189
+	  # We have old collect2
3190
+	  _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
3191
+	  # It fails to find uninstalled libraries when the uninstalled
3192
+	  # path is not listed in the libpath.  Setting hardcode_minus_L
3193
+	  # to unsupported forces relinking
3194
+	  _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
3195
+	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
3196
+	  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
3197
+	fi
3198
+	;;
3199
+      esac
3200
+      shared_flag='-shared'
3201
+      if test "$aix_use_runtimelinking" = yes; then
3202
+	shared_flag="$shared_flag "'${wl}-G'
3203
+      fi
3204
+    else
3205
+      # not using gcc
3206
+      if test "$host_cpu" = ia64; then
3207
+	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
3208
+	# chokes on -Wl,-G. The following line is correct:
3209
+	shared_flag='-G'
3210
+      else
3211
+	if test "$aix_use_runtimelinking" = yes; then
3212
+	  shared_flag='${wl}-G'
3213
+	else
3214
+	  shared_flag='${wl}-bM:SRE'
3215
+	fi
3216
+      fi
3217
+    fi
3218
+
3219
+    # It seems that -bexpall does not export symbols beginning with
3220
+    # underscore (_), so it is better to generate a list of symbols to export.
3221
+    _LT_AC_TAGVAR(always_export_symbols, $1)=yes
3222
+    if test "$aix_use_runtimelinking" = yes; then
3223
+      # Warning - without using the other runtime loading flags (-brtl),
3224
+      # -berok will link without error, but may produce a broken library.
3225
+      _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok'
3226
+      # Determine the default libpath from the value encoded in an empty executable.
3227
+      _LT_AC_SYS_LIBPATH_AIX
3228
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
3229
+
3230
+      _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"
3231
+     else
3232
+      if test "$host_cpu" = ia64; then
3233
+	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
3234
+	_LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
3235
+	_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"
3236
+      else
3237
+	# Determine the default libpath from the value encoded in an empty executable.
3238
+	_LT_AC_SYS_LIBPATH_AIX
3239
+	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
3240
+	# Warning - without using the other run time loading flags,
3241
+	# -berok will link without error, but may produce a broken library.
3242
+	_LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
3243
+	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
3244
+	# Exported symbols can be pulled into shared objects from archives
3245
+	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
3246
+	_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
3247
+	# This is similar to how AIX traditionally builds its shared libraries.
3248
+	_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'
3249
+      fi
3250
+    fi
3251
+    ;;
3252
+
3253
+  beos*)
3254
+    if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
3255
+      _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
3256
+      # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
3257
+      # support --undefined.  This deserves some investigation.  FIXME
3258
+      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
3259
+    else
3260
+      _LT_AC_TAGVAR(ld_shlibs, $1)=no
3261
+    fi
3262
+    ;;
3263
+
3264
+  chorus*)
3265
+    case $cc_basename in
3266
+      *)
3267
+	# FIXME: insert proper C++ library support
3268
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
3269
+	;;
3270
+    esac
3271
+    ;;
3272
+
3273
+  cygwin* | mingw* | pw32*)
3274
+    # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
3275
+    # as there is no search path for DLLs.
3276
+    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
3277
+    _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
3278
+    _LT_AC_TAGVAR(always_export_symbols, $1)=no
3279
+    _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
3280
+
3281
+    if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
3282
+      _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'
3283
+      # If the export-symbols file already is a .def file (1st line
3284
+      # is EXPORTS), use it as is; otherwise, prepend...
3285
+      _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
3286
+	cp $export_symbols $output_objdir/$soname.def;
3287
+      else
3288
+	echo EXPORTS > $output_objdir/$soname.def;
3289
+	cat $export_symbols >> $output_objdir/$soname.def;
3290
+      fi~
3291
+      $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'
3292
+    else
3293
+      _LT_AC_TAGVAR(ld_shlibs, $1)=no
3294
+    fi
3295
+  ;;
3296
+      darwin* | rhapsody*)
3297
+      _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
3298
+      _LT_AC_TAGVAR(hardcode_direct, $1)=no
3299
+      _LT_AC_TAGVAR(hardcode_automatic, $1)=yes
3300
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
3301
+      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=''
3302
+      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
3303
+      _LT_AC_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined"
3304
+      if test "$GXX" = yes ; then
3305
+      output_verbose_link_cmd='echo'
3306
+      _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}"
3307
+      _LT_AC_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
3308
+      _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}"
3309
+      _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}"
3310
+      if test "$lt_cv_apple_cc_single_mod" != "yes"; then
3311
+        _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}"
3312
+        _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}"
3313
+      fi
3314
+      else
3315
+      case $cc_basename in
3316
+        xlc*)
3317
+         output_verbose_link_cmd='echo'
3318
+          _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'
3319
+          _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
3320
+          # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
3321
+          _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}'
3322
+          _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}'
3323
+          ;;
3324
+       *)
3325
+         _LT_AC_TAGVAR(ld_shlibs, $1)=no
3326
+          ;;
3327
+      esac
3328
+      fi
3329
+        ;;
3330
+
3331
+  dgux*)
3332
+    case $cc_basename in
3333
+      ec++*)
3334
+	# FIXME: insert proper C++ library support
3335
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
3336
+	;;
3337
+      ghcx*)
3338
+	# Green Hills C++ Compiler
3339
+	# FIXME: insert proper C++ library support
3340
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
3341
+	;;
3342
+      *)
3343
+	# FIXME: insert proper C++ library support
3344
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
3345
+	;;
3346
+    esac
3347
+    ;;
3348
+  freebsd[[12]]*)
3349
+    # C++ shared libraries reported to be fairly broken before switch to ELF
3350
+    _LT_AC_TAGVAR(ld_shlibs, $1)=no
3351
+    ;;
3352
+  freebsd-elf*)
3353
+    _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
3354
+    ;;
3355
+  freebsd* | dragonfly*)
3356
+    # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
3357
+    # conventions
3358
+    _LT_AC_TAGVAR(ld_shlibs, $1)=yes
3359
+    ;;
3360
+  gnu*)
3361
+    ;;
3362
+  hpux9*)
3363
+    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
3364
+    _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
3365
+    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
3366
+    _LT_AC_TAGVAR(hardcode_direct, $1)=yes
3367
+    _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
3368
+				# but as the default
3369
+				# location of the library.
3370
+
3371
+    case $cc_basename in
3372
+    CC*)
3373
+      # FIXME: insert proper C++ library support
3374
+      _LT_AC_TAGVAR(ld_shlibs, $1)=no
3375
+      ;;
3376
+    aCC*)
3377
+      _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'
3378
+      # Commands to make compiler produce verbose output that lists
3379
+      # what "hidden" libraries, object files and flags are used when
3380
+      # linking a shared library.
3381
+      #
3382
+      # There doesn't appear to be a way to prevent this compiler from
3383
+      # explicitly linking system object files so we need to strip them
3384
+      # from the output so that they don't get included in the library
3385
+      # dependencies.
3386
+      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'
3387
+      ;;
3388
+    *)
3389
+      if test "$GXX" = yes; then
3390
+        _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'
3391
+      else
3392
+        # FIXME: insert proper C++ library support
3393
+        _LT_AC_TAGVAR(ld_shlibs, $1)=no
3394
+      fi
3395
+      ;;
3396
+    esac
3397
+    ;;
3398
+  hpux10*|hpux11*)
3399
+    if test $with_gnu_ld = no; then
3400
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
3401
+      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
3402
+
3403
+      case $host_cpu in
3404
+      hppa*64*|ia64*) ;;
3405
+      *)
3406
+	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
3407
+        ;;
3408
+      esac
3409
+    fi
3410
+    case $host_cpu in
3411
+    hppa*64*|ia64*)
3412
+      _LT_AC_TAGVAR(hardcode_direct, $1)=no
3413
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
3414
+      ;;
3415
+    *)
3416
+      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
3417
+      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
3418
+					      # but as the default
3419
+					      # location of the library.
3420
+      ;;
3421
+    esac
3422
+
3423
+    case $cc_basename in
3424
+      CC*)
3425
+	# FIXME: insert proper C++ library support
3426
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
3427
+	;;
3428
+      aCC*)
3429
+	case $host_cpu in
3430
+	hppa*64*)
3431
+	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
3432
+	  ;;
3433
+	ia64*)
3434
+	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
3435
+	  ;;
3436
+	*)
3437
+	  _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'
3438
+	  ;;
3439
+	esac
3440
+	# Commands to make compiler produce verbose output that lists
3441
+	# what "hidden" libraries, object files and flags are used when
3442
+	# linking a shared library.
3443
+	#
3444
+	# There doesn't appear to be a way to prevent this compiler from
3445
+	# explicitly linking system object files so we need to strip them
3446
+	# from the output so that they don't get included in the library
3447
+	# dependencies.
3448
+	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'
3449
+	;;
3450
+      *)
3451
+	if test "$GXX" = yes; then
3452
+	  if test $with_gnu_ld = no; then
3453
+	    case $host_cpu in
3454
+	    hppa*64*)
3455
+	      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
3456
+	      ;;
3457
+	    ia64*)
3458
+	      _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'
3459
+	      ;;
3460
+	    *)
3461
+	      _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'
3462
+	      ;;
3463
+	    esac
3464
+	  fi
3465
+	else
3466
+	  # FIXME: insert proper C++ library support
3467
+	  _LT_AC_TAGVAR(ld_shlibs, $1)=no
3468
+	fi
3469
+	;;
3470
+    esac
3471
+    ;;
3472
+  interix[[3-9]]*)
3473
+    _LT_AC_TAGVAR(hardcode_direct, $1)=no
3474
+    _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
3475
+    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
3476
+    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
3477
+    # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
3478
+    # Instead, shared libraries are loaded at an image base (0x10000000 by
3479
+    # default) and relocated if they conflict, which is a slow very memory
3480
+    # consuming and fragmenting process.  To avoid this, we pick a random,
3481
+    # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
3482
+    # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
3483
+    _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'
3484
+    _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'
3485
+    ;;
3486
+  irix5* | irix6*)
3487
+    case $cc_basename in
3488
+      CC*)
3489
+	# SGI C++
3490
+	_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'
3491
+
3492
+	# Archives containing C++ object files must be created using
3493
+	# "CC -ar", where "CC" is the IRIX C++ compiler.  This is
3494
+	# necessary to make sure instantiated templates are included
3495
+	# in the archive.
3496
+	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
3497
+	;;
3498
+      *)
3499
+	if test "$GXX" = yes; then
3500
+	  if test "$with_gnu_ld" = no; then
3501
+	    _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'
3502
+	  else
3503
+	    _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'
3504
+	  fi
3505
+	fi
3506
+	_LT_AC_TAGVAR(link_all_deplibs, $1)=yes
3507
+	;;
3508
+    esac
3509
+    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
3510
+    _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
3511
+    ;;
3512
+  linux* | k*bsd*-gnu)
3513
+    case $cc_basename in
3514
+      KCC*)
3515
+	# Kuck and Associates, Inc. (KAI) C++ Compiler
3516
+
3517
+	# KCC will only create a shared library if the output file
3518
+	# ends with ".so" (or ".sl" for HP-UX), so rename the library
3519
+	# to its proper name (with version) after linking.
3520
+	_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'
3521
+	_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'
3522
+	# Commands to make compiler produce verbose output that lists
3523
+	# what "hidden" libraries, object files and flags are used when
3524
+	# linking a shared library.
3525
+	#
3526
+	# There doesn't appear to be a way to prevent this compiler from
3527
+	# explicitly linking system object files so we need to strip them
3528
+	# from the output so that they don't get included in the library
3529
+	# dependencies.
3530
+	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'
3531
+
3532
+	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath,$libdir'
3533
+	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
3534
+
3535
+	# Archives containing C++ object files must be created using
3536
+	# "CC -Bstatic", where "CC" is the KAI C++ compiler.
3537
+	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
3538
+	;;
3539
+      icpc*)
3540
+	# Intel C++
3541
+	with_gnu_ld=yes
3542
+	# version 8.0 and above of icpc choke on multiply defined symbols
3543
+	# if we add $predep_objects and $postdep_objects, however 7.1 and
3544
+	# earlier do not add the objects themselves.
3545
+	case `$CC -V 2>&1` in
3546
+	*"Version 7."*)
3547
+  	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
3548
+  	  _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'
3549
+	  ;;
3550
+	*)  # Version 8.0 or newer
3551
+	  tmp_idyn=
3552
+	  case $host_cpu in
3553
+	    ia64*) tmp_idyn=' -i_dynamic';;
3554
+	  esac
3555
+  	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
3556
+	  _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'
3557
+	  ;;
3558
+	esac
3559
+	_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
3560
+	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
3561
+	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
3562
+	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
3563
+	;;
3564
+      pgCC* | pgcpp*)
3565
+        # Portland Group C++ compiler
3566
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
3567
+  	_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'
3568
+
3569
+	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
3570
+	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
3571
+	_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'
3572
+        ;;
3573
+      cxx*)
3574
+	# Compaq C++
3575
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
3576
+	_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'
3577
+
3578
+	runpath_var=LD_RUN_PATH
3579
+	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
3580
+	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
3581
+
3582
+	# Commands to make compiler produce verbose output that lists
3583
+	# what "hidden" libraries, object files and flags are used when
3584
+	# linking a shared library.
3585
+	#
3586
+	# There doesn't appear to be a way to prevent this compiler from
3587
+	# explicitly linking system object files so we need to strip them
3588
+	# from the output so that they don't get included in the library
3589
+	# dependencies.
3590
+	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'
3591
+	;;
3592
+      *)
3593
+	case `$CC -V 2>&1 | sed 5q` in
3594
+	*Sun\ C*)
3595
+	  # Sun C++ 5.9
3596
+	  _LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs'
3597
+	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
3598
+	  _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'
3599
+	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
3600
+	  _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'
3601
+
3602
+	  # Not sure whether something based on
3603
+	  # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
3604
+	  # would be better.
3605
+	  output_verbose_link_cmd='echo'
3606
+
3607
+	  # Archives containing C++ object files must be created using
3608
+	  # "CC -xar", where "CC" is the Sun C++ compiler.  This is
3609
+	  # necessary to make sure instantiated templates are included
3610
+	  # in the archive.
3611
+	  _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
3612
+	  ;;
3613
+	esac
3614
+	;;
3615
+    esac
3616
+    ;;
3617
+  lynxos*)
3618
+    # FIXME: insert proper C++ library support
3619
+    _LT_AC_TAGVAR(ld_shlibs, $1)=no
3620
+    ;;
3621
+  m88k*)
3622
+    # FIXME: insert proper C++ library support
3623
+    _LT_AC_TAGVAR(ld_shlibs, $1)=no
3624
+    ;;
3625
+  mvs*)
3626
+    case $cc_basename in
3627
+      cxx*)
3628
+	# FIXME: insert proper C++ library support
3629
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
3630
+	;;
3631
+      *)
3632
+	# FIXME: insert proper C++ library support
3633
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
3634
+	;;
3635
+    esac
3636
+    ;;
3637
+  netbsd* | netbsdelf*-gnu)
3638
+    if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
3639
+      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
3640
+      wlarc=
3641
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
3642
+      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
3643
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
3644
+    fi
3645
+    # Workaround some broken pre-1.5 toolchains
3646
+    output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
3647
+    ;;
3648
+  openbsd2*)
3649
+    # C++ shared libraries are fairly broken
3650
+    _LT_AC_TAGVAR(ld_shlibs, $1)=no
3651
+    ;;
3652
+  openbsd*)
3653
+    if test -f /usr/libexec/ld.so; then
3654
+      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
3655
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
3656
+      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
3657
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
3658
+      if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
3659
+	_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'
3660
+	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
3661
+	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
3662
+      fi
3663
+      output_verbose_link_cmd='echo'
3664
+    else
3665
+      _LT_AC_TAGVAR(ld_shlibs, $1)=no
3666
+    fi
3667
+    ;;
3668
+  osf3*)
3669
+    case $cc_basename in
3670
+      KCC*)
3671
+	# Kuck and Associates, Inc. (KAI) C++ Compiler
3672
+
3673
+	# KCC will only create a shared library if the output file
3674
+	# ends with ".so" (or ".sl" for HP-UX), so rename the library
3675
+	# to its proper name (with version) after linking.
3676
+	_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'
3677
+
3678
+	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
3679
+	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
3680
+
3681
+	# Archives containing C++ object files must be created using
3682
+	# "CC -Bstatic", where "CC" is the KAI C++ compiler.
3683
+	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
3684
+
3685
+	;;
3686
+      RCC*)
3687
+	# Rational C++ 2.4.1
3688
+	# FIXME: insert proper C++ library support
3689
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
3690
+	;;
3691
+      cxx*)
3692
+	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
3693
+	_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'
3694
+
3695
+	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
3696
+	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
3697
+
3698
+	# Commands to make compiler produce verbose output that lists
3699
+	# what "hidden" libraries, object files and flags are used when
3700
+	# linking a shared library.
3701
+	#
3702
+	# There doesn't appear to be a way to prevent this compiler from
3703
+	# explicitly linking system object files so we need to strip them
3704
+	# from the output so that they don't get included in the library
3705
+	# dependencies.
3706
+	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'
3707
+	;;
3708
+      *)
3709
+	if test "$GXX" = yes && test "$with_gnu_ld" = no; then
3710
+	  _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
3711
+	  _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'
3712
+
3713
+	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
3714
+	  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
3715
+
3716
+	  # Commands to make compiler produce verbose output that lists
3717
+	  # what "hidden" libraries, object files and flags are used when
3718
+	  # linking a shared library.
3719
+	  output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
3720
+
3721
+	else
3722
+	  # FIXME: insert proper C++ library support
3723
+	  _LT_AC_TAGVAR(ld_shlibs, $1)=no
3724
+	fi
3725
+	;;
3726
+    esac
3727
+    ;;
3728
+  osf4* | osf5*)
3729
+    case $cc_basename in
3730
+      KCC*)
3731
+	# Kuck and Associates, Inc. (KAI) C++ Compiler
3732
+
3733
+	# KCC will only create a shared library if the output file
3734
+	# ends with ".so" (or ".sl" for HP-UX), so rename the library
3735
+	# to its proper name (with version) after linking.
3736
+	_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'
3737
+
3738
+	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
3739
+	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
3740
+
3741
+	# Archives containing C++ object files must be created using
3742
+	# the KAI C++ compiler.
3743
+	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs'
3744
+	;;
3745
+      RCC*)
3746
+	# Rational C++ 2.4.1
3747
+	# FIXME: insert proper C++ library support
3748
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
3749
+	;;
3750
+      cxx*)
3751
+	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
3752
+	_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'
3753
+	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
3754
+	  echo "-hidden">> $lib.exp~
3755
+	  $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~
3756
+	  $rm $lib.exp'
3757
+
3758
+	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
3759
+	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
3760
+
3761
+	# Commands to make compiler produce verbose output that lists
3762
+	# what "hidden" libraries, object files and flags are used when
3763
+	# linking a shared library.
3764
+	#
3765
+	# There doesn't appear to be a way to prevent this compiler from
3766
+	# explicitly linking system object files so we need to strip them
3767
+	# from the output so that they don't get included in the library
3768
+	# dependencies.
3769
+	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'
3770
+	;;
3771
+      *)
3772
+	if test "$GXX" = yes && test "$with_gnu_ld" = no; then
3773
+	  _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
3774
+	 _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'
3775
+
3776
+	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
3777
+	  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
3778
+
3779
+	  # Commands to make compiler produce verbose output that lists
3780
+	  # what "hidden" libraries, object files and flags are used when
3781
+	  # linking a shared library.
3782
+	  output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
3783
+
3784
+	else
3785
+	  # FIXME: insert proper C++ library support
3786
+	  _LT_AC_TAGVAR(ld_shlibs, $1)=no
3787
+	fi
3788
+	;;
3789
+    esac
3790
+    ;;
3791
+  psos*)
3792
+    # FIXME: insert proper C++ library support
3793
+    _LT_AC_TAGVAR(ld_shlibs, $1)=no
3794
+    ;;
3795
+  sunos4*)
3796
+    case $cc_basename in
3797
+      CC*)
3798
+	# Sun C++ 4.x
3799
+	# FIXME: insert proper C++ library support
3800
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
3801
+	;;
3802
+      lcc*)
3803
+	# Lucid
3804
+	# FIXME: insert proper C++ library support
3805
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
3806
+	;;
3807
+      *)
3808
+	# FIXME: insert proper C++ library support
3809
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
3810
+	;;
3811
+    esac
3812
+    ;;
3813
+  solaris*)
3814
+    case $cc_basename in
3815
+      CC*)
3816
+	# Sun C++ 4.2, 5.x and Centerline C++
3817
+        _LT_AC_TAGVAR(archive_cmds_need_lc,$1)=yes
3818
+	_LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs'
3819
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag}  -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
3820
+	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
3821
+	$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'
3822
+
3823
+	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
3824
+	_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
3825
+	case $host_os in
3826
+	  solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
3827
+	  *)
3828
+	    # The compiler driver will combine and reorder linker options,
3829
+	    # but understands `-z linker_flag'.
3830
+	    # Supported since Solaris 2.6 (maybe 2.5.1?)
3831
+	    _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
3832
+	    ;;
3833
+	esac
3834
+	_LT_AC_TAGVAR(link_all_deplibs, $1)=yes
3835
+
3836
+	output_verbose_link_cmd='echo'
3837
+
3838
+	# Archives containing C++ object files must be created using
3839
+	# "CC -xar", where "CC" is the Sun C++ compiler.  This is
3840
+	# necessary to make sure instantiated templates are included
3841
+	# in the archive.
3842
+	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
3843
+	;;
3844
+      gcx*)
3845
+	# Green Hills C++ Compiler
3846
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
3847
+
3848
+	# The C++ compiler must be used to create the archive.
3849
+	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
3850
+	;;
3851
+      *)
3852
+	# GNU C++ compiler with Solaris linker
3853
+	if test "$GXX" = yes && test "$with_gnu_ld" = no; then
3854
+	  _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
3855
+	  if $CC --version | grep -v '^2\.7' > /dev/null; then
3856
+	    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
3857
+	    _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
3858
+		$CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
3859
+
3860
+	    # Commands to make compiler produce verbose output that lists
3861
+	    # what "hidden" libraries, object files and flags are used when
3862
+	    # linking a shared library.
3863
+	    output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\""
3864
+	  else
3865
+	    # g++ 2.7 appears to require `-G' NOT `-shared' on this
3866
+	    # platform.
3867
+	    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
3868
+	    _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
3869
+		$CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
3870
+
3871
+	    # Commands to make compiler produce verbose output that lists
3872
+	    # what "hidden" libraries, object files and flags are used when
3873
+	    # linking a shared library.
3874
+	    output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\""
3875
+	  fi
3876
+
3877
+	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
3878
+	  case $host_os in
3879
+	  solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
3880
+	  *)
3881
+	    _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
3882
+	    ;;
3883
+	  esac
3884
+	fi
3885
+	;;
3886
+    esac
3887
+    ;;
3888
+  sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
3889
+    _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
3890
+    _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
3891
+    _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
3892
+    runpath_var='LD_RUN_PATH'
3893
+
3894
+    case $cc_basename in
3895
+      CC*)
3896
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
3897
+	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
3898
+	;;
3899
+      *)
3900
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
3901
+	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
3902
+	;;
3903
+    esac
3904
+    ;;
3905
+  sysv5* | sco3.2v5* | sco5v6*)
3906
+    # Note: We can NOT use -z defs as we might desire, because we do not
3907
+    # link with -lc, and that would cause any symbols used from libc to
3908
+    # always be unresolved, which means just about no library would
3909
+    # ever link correctly.  If we're not using GNU ld we use -z text
3910
+    # though, which does catch some bad symbols but isn't as heavy-handed
3911
+    # as -z defs.
3912
+    # For security reasons, it is highly recommended that you always
3913
+    # use absolute paths for naming shared libraries, and exclude the
3914
+    # DT_RUNPATH tag from executables and libraries.  But doing so
3915
+    # requires that you compile everything twice, which is a pain.
3916
+    # So that behaviour is only enabled if SCOABSPATH is set to a
3917
+    # non-empty value in the environment.  Most likely only useful for
3918
+    # creating official distributions of packages.
3919
+    # This is a hack until libtool officially supports absolute path
3920
+    # names for shared libraries.
3921
+    _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
3922
+    _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
3923
+    _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
3924
+    _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
3925
+    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
3926
+    _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
3927
+    _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
3928
+    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
3929
+    runpath_var='LD_RUN_PATH'
3930
+
3931
+    case $cc_basename in
3932
+      CC*)
3933
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
3934
+	_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'
3935
+	;;
3936
+      *)
3937
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
3938
+	_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'
3939
+	;;
3940
+    esac
3941
+    ;;
3942
+  tandem*)
3943
+    case $cc_basename in
3944
+      NCC*)
3945
+	# NonStop-UX NCC 3.20
3946
+	# FIXME: insert proper C++ library support
3947
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
3948
+	;;
3949
+      *)
3950
+	# FIXME: insert proper C++ library support
3951
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
3952
+	;;
3953
+    esac
3954
+    ;;
3955
+  vxworks*)
3956
+    # FIXME: insert proper C++ library support
3957
+    _LT_AC_TAGVAR(ld_shlibs, $1)=no
3958
+    ;;
3959
+  *)
3960
+    # FIXME: insert proper C++ library support
3961
+    _LT_AC_TAGVAR(ld_shlibs, $1)=no
3962
+    ;;
3963
+esac
3964
+AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)])
3965
+test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
3966
+
3967
+_LT_AC_TAGVAR(GCC, $1)="$GXX"
3968
+_LT_AC_TAGVAR(LD, $1)="$LD"
3969
+
3970
+AC_LIBTOOL_POSTDEP_PREDEP($1)
3971
+AC_LIBTOOL_PROG_COMPILER_PIC($1)
3972
+AC_LIBTOOL_PROG_CC_C_O($1)
3973
+AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
3974
+AC_LIBTOOL_PROG_LD_SHLIBS($1)
3975
+AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
3976
+AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
3977
+
3978
+AC_LIBTOOL_CONFIG($1)
3979
+
3980
+AC_LANG_POP
3981
+CC=$lt_save_CC
3982
+LDCXX=$LD
3983
+LD=$lt_save_LD
3984
+GCC=$lt_save_GCC
3985
+with_gnu_ldcxx=$with_gnu_ld
3986
+with_gnu_ld=$lt_save_with_gnu_ld
3987
+lt_cv_path_LDCXX=$lt_cv_path_LD
3988
+lt_cv_path_LD=$lt_save_path_LD
3989
+lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
3990
+lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
3991
+])# AC_LIBTOOL_LANG_CXX_CONFIG
3992
+
3993
+# AC_LIBTOOL_POSTDEP_PREDEP([TAGNAME])
3994
+# ------------------------------------
3995
+# Figure out "hidden" library dependencies from verbose
3996
+# compiler output when linking a shared library.
3997
+# Parse the compiler output and extract the necessary
3998
+# objects, libraries and library flags.
3999
+AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP],
4000
+[AC_REQUIRE([LT_AC_PROG_SED])dnl
4001
+dnl we can't use the lt_simple_compile_test_code here,
4002
+dnl because it contains code intended for an executable,
4003
+dnl not a library.  It's possible we should let each
4004
+dnl tag define a new lt_????_link_test_code variable,
4005
+dnl but it's only used here...
4006
+ifelse([$1],[],[cat > conftest.$ac_ext <<EOF
4007
+int a;
4008
+void foo (void) { a = 0; }
4009
+EOF
4010
+],[$1],[CXX],[cat > conftest.$ac_ext <<EOF
4011
+class Foo
4012
+{
4013
+public:
4014
+  Foo (void) { a = 0; }
4015
+private:
4016
+  int a;
4017
+};
4018
+EOF
4019
+],[$1],[F77],[cat > conftest.$ac_ext <<EOF
4020
+      subroutine foo
4021
+      implicit none
4022
+      integer*4 a
4023
+      a=0
4024
+      return
4025
+      end
4026
+EOF
4027
+],[$1],[GCJ],[cat > conftest.$ac_ext <<EOF
4028
+public class foo {
4029
+  private int a;
4030
+  public void bar (void) {
4031
+    a = 0;
4032
+  }
4033
+};
4034
+EOF
4035
+])
4036
+dnl Parse the compiler output and extract the necessary
4037
+dnl objects, libraries and library flags.
4038
+if AC_TRY_EVAL(ac_compile); then
4039
+  # Parse the compiler output and extract the necessary
4040
+  # objects, libraries and library flags.
4041
+
4042
+  # Sentinel used to keep track of whether or not we are before
4043
+  # the conftest object file.
4044
+  pre_test_object_deps_done=no
4045
+
4046
+  # The `*' in the case matches for architectures that use `case' in
4047
+  # $output_verbose_cmd can trigger glob expansion during the loop
4048
+  # eval without this substitution.
4049
+  output_verbose_link_cmd=`$echo "X$output_verbose_link_cmd" | $Xsed -e "$no_glob_subst"`
4050
+
4051
+  for p in `eval $output_verbose_link_cmd`; do
4052
+    case $p in
4053
+
4054
+    -L* | -R* | -l*)
4055
+       # Some compilers place space between "-{L,R}" and the path.
4056
+       # Remove the space.
4057
+       if test $p = "-L" \
4058
+	  || test $p = "-R"; then
4059
+	 prev=$p
4060
+	 continue
4061
+       else
4062
+	 prev=
4063
+       fi
4064
+
4065
+       if test "$pre_test_object_deps_done" = no; then
4066
+	 case $p in
4067
+	 -L* | -R*)
4068
+	   # Internal compiler library paths should come after those
4069
+	   # provided the user.  The postdeps already come after the
4070
+	   # user supplied libs so there is no need to process them.
4071
+	   if test -z "$_LT_AC_TAGVAR(compiler_lib_search_path, $1)"; then
4072
+	     _LT_AC_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"
4073
+	   else
4074
+	     _LT_AC_TAGVAR(compiler_lib_search_path, $1)="${_LT_AC_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}"
4075
+	   fi
4076
+	   ;;
4077
+	 # The "-l" case would never come before the object being
4078
+	 # linked, so don't bother handling this case.
4079
+	 esac
4080
+       else
4081
+	 if test -z "$_LT_AC_TAGVAR(postdeps, $1)"; then
4082
+	   _LT_AC_TAGVAR(postdeps, $1)="${prev}${p}"
4083
+	 else
4084
+	   _LT_AC_TAGVAR(postdeps, $1)="${_LT_AC_TAGVAR(postdeps, $1)} ${prev}${p}"
4085
+	 fi
4086
+       fi
4087
+       ;;
4088
+
4089
+    *.$objext)
4090
+       # This assumes that the test object file only shows up
4091
+       # once in the compiler output.
4092
+       if test "$p" = "conftest.$objext"; then
4093
+	 pre_test_object_deps_done=yes
4094
+	 continue
4095
+       fi
4096
+
4097
+       if test "$pre_test_object_deps_done" = no; then
4098
+	 if test -z "$_LT_AC_TAGVAR(predep_objects, $1)"; then
4099
+	   _LT_AC_TAGVAR(predep_objects, $1)="$p"
4100
+	 else
4101
+	   _LT_AC_TAGVAR(predep_objects, $1)="$_LT_AC_TAGVAR(predep_objects, $1) $p"
4102
+	 fi
4103
+       else
4104
+	 if test -z "$_LT_AC_TAGVAR(postdep_objects, $1)"; then
4105
+	   _LT_AC_TAGVAR(postdep_objects, $1)="$p"
4106
+	 else
4107
+	   _LT_AC_TAGVAR(postdep_objects, $1)="$_LT_AC_TAGVAR(postdep_objects, $1) $p"
4108
+	 fi
4109
+       fi
4110
+       ;;
4111
+
4112
+    *) ;; # Ignore the rest.
4113
+
4114
+    esac
4115
+  done
4116
+
4117
+  # Clean up.
4118
+  rm -f a.out a.exe
4119
+else
4120
+  echo "libtool.m4: error: problem compiling $1 test program"
4121
+fi
4122
+
4123
+$rm -f confest.$objext
4124
+
4125
+_LT_AC_TAGVAR(compiler_lib_search_dirs, $1)=
4126
+if test -n "$_LT_AC_TAGVAR(compiler_lib_search_path, $1)"; then
4127
+  _LT_AC_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_AC_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'`
4128
+fi
4129
+
4130
+# PORTME: override above test on systems where it is broken
4131
+ifelse([$1],[CXX],
4132
+[case $host_os in
4133
+interix[[3-9]]*)
4134
+  # Interix 3.5 installs completely hosed .la files for C++, so rather than
4135
+  # hack all around it, let's just trust "g++" to DTRT.
4136
+  _LT_AC_TAGVAR(predep_objects,$1)=
4137
+  _LT_AC_TAGVAR(postdep_objects,$1)=
4138
+  _LT_AC_TAGVAR(postdeps,$1)=
4139
+  ;;
4140
+
4141
+linux*)
4142
+  case `$CC -V 2>&1 | sed 5q` in
4143
+  *Sun\ C*)
4144
+    # Sun C++ 5.9
4145
+    #
4146
+    # The more standards-conforming stlport4 library is
4147
+    # incompatible with the Cstd library. Avoid specifying
4148
+    # it if it's in CXXFLAGS. Ignore libCrun as
4149
+    # -library=stlport4 depends on it.
4150
+    case " $CXX $CXXFLAGS " in
4151
+    *" -library=stlport4 "*)
4152
+      solaris_use_stlport4=yes
4153
+      ;;
4154
+    esac
4155
+    if test "$solaris_use_stlport4" != yes; then
4156
+      _LT_AC_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
4157
+    fi
4158
+    ;;
4159
+  esac
4160
+  ;;
4161
+
4162
+solaris*)
4163
+  case $cc_basename in
4164
+  CC*)
4165
+    # The more standards-conforming stlport4 library is
4166
+    # incompatible with the Cstd library. Avoid specifying
4167
+    # it if it's in CXXFLAGS. Ignore libCrun as
4168
+    # -library=stlport4 depends on it.
4169
+    case " $CXX $CXXFLAGS " in
4170
+    *" -library=stlport4 "*)
4171
+      solaris_use_stlport4=yes
4172
+      ;;
4173
+    esac
4174
+
4175
+    # Adding this requires a known-good setup of shared libraries for
4176
+    # Sun compiler versions before 5.6, else PIC objects from an old
4177
+    # archive will be linked into the output, leading to subtle bugs.
4178
+    if test "$solaris_use_stlport4" != yes; then
4179
+      _LT_AC_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
4180
+    fi
4181
+    ;;
4182
+  esac
4183
+  ;;
4184
+esac
4185
+])
4186
+case " $_LT_AC_TAGVAR(postdeps, $1) " in
4187
+*" -lc "*) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no ;;
4188
+esac
4189
+])# AC_LIBTOOL_POSTDEP_PREDEP
4190
+
4191
+# AC_LIBTOOL_LANG_F77_CONFIG
4192
+# --------------------------
4193
+# Ensure that the configuration vars for the C compiler are
4194
+# suitably defined.  Those variables are subsequently used by
4195
+# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
4196
+AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG], [_LT_AC_LANG_F77_CONFIG(F77)])
4197
+AC_DEFUN([_LT_AC_LANG_F77_CONFIG],
4198
+[AC_REQUIRE([AC_PROG_F77])
4199
+AC_LANG_PUSH(Fortran 77)
4200
+
4201
+_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
4202
+_LT_AC_TAGVAR(allow_undefined_flag, $1)=
4203
+_LT_AC_TAGVAR(always_export_symbols, $1)=no
4204
+_LT_AC_TAGVAR(archive_expsym_cmds, $1)=
4205
+_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
4206
+_LT_AC_TAGVAR(hardcode_direct, $1)=no
4207
+_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
4208
+_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
4209
+_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
4210
+_LT_AC_TAGVAR(hardcode_minus_L, $1)=no
4211
+_LT_AC_TAGVAR(hardcode_automatic, $1)=no
4212
+_LT_AC_TAGVAR(module_cmds, $1)=
4213
+_LT_AC_TAGVAR(module_expsym_cmds, $1)=
4214
+_LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
4215
+_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
4216
+_LT_AC_TAGVAR(no_undefined_flag, $1)=
4217
+_LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
4218
+_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no
4219
+
4220
+# Source file extension for f77 test sources.
4221
+ac_ext=f
4222
+
4223
+# Object file extension for compiled f77 test sources.
4224
+objext=o
4225
+_LT_AC_TAGVAR(objext, $1)=$objext
4226
+
4227
+# Code to be used in simple compile tests
4228
+lt_simple_compile_test_code="\
4229
+      subroutine t
4230
+      return
4231
+      end
4232
+"
4233
+
4234
+# Code to be used in simple link tests
4235
+lt_simple_link_test_code="\
4236
+      program t
4237
+      end
4238
+"
4239
+
4240
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
4241
+_LT_AC_SYS_COMPILER
4242
+
4243
+# save warnings/boilerplate of simple test code
4244
+_LT_COMPILER_BOILERPLATE
4245
+_LT_LINKER_BOILERPLATE
4246
+
4247
+# Allow CC to be a program name with arguments.
4248
+lt_save_CC="$CC"
4249
+CC=${F77-"f77"}
4250
+compiler=$CC
4251
+_LT_AC_TAGVAR(compiler, $1)=$CC
4252
+_LT_CC_BASENAME([$compiler])
4253
+
4254
+AC_MSG_CHECKING([if libtool supports shared libraries])
4255
+AC_MSG_RESULT([$can_build_shared])
4256
+
4257
+AC_MSG_CHECKING([whether to build shared libraries])
4258
+test "$can_build_shared" = "no" && enable_shared=no
4259
+
4260
+# On AIX, shared libraries and static libraries use the same namespace, and
4261
+# are all built from PIC.
4262
+case $host_os in
4263
+aix3*)
4264
+  test "$enable_shared" = yes && enable_static=no
4265
+  if test -n "$RANLIB"; then
4266
+    archive_cmds="$archive_cmds~\$RANLIB \$lib"
4267
+    postinstall_cmds='$RANLIB $lib'
4268
+  fi
4269
+  ;;
4270
+aix[[4-9]]*)
4271
+  if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
4272
+    test "$enable_shared" = yes && enable_static=no
4273
+  fi
4274
+  ;;
4275
+esac
4276
+AC_MSG_RESULT([$enable_shared])
4277
+
4278
+AC_MSG_CHECKING([whether to build static libraries])
4279
+# Make sure either enable_shared or enable_static is yes.
4280
+test "$enable_shared" = yes || enable_static=yes
4281
+AC_MSG_RESULT([$enable_static])
4282
+
4283
+_LT_AC_TAGVAR(GCC, $1)="$G77"
4284
+_LT_AC_TAGVAR(LD, $1)="$LD"
4285
+
4286
+AC_LIBTOOL_PROG_COMPILER_PIC($1)
4287
+AC_LIBTOOL_PROG_CC_C_O($1)
4288
+AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
4289
+AC_LIBTOOL_PROG_LD_SHLIBS($1)
4290
+AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
4291
+AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
4292
+
4293
+AC_LIBTOOL_CONFIG($1)
4294
+
4295
+AC_LANG_POP
4296
+CC="$lt_save_CC"
4297
+])# AC_LIBTOOL_LANG_F77_CONFIG
4298
+
4299
+
4300
+# AC_LIBTOOL_LANG_GCJ_CONFIG
4301
+# --------------------------
4302
+# Ensure that the configuration vars for the C compiler are
4303
+# suitably defined.  Those variables are subsequently used by
4304
+# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
4305
+AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG], [_LT_AC_LANG_GCJ_CONFIG(GCJ)])
4306
+AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG],
4307
+[AC_LANG_SAVE
4308
+
4309
+# Source file extension for Java test sources.
4310
+ac_ext=java
4311
+
4312
+# Object file extension for compiled Java test sources.
4313
+objext=o
4314
+_LT_AC_TAGVAR(objext, $1)=$objext
4315
+
4316
+# Code to be used in simple compile tests
4317
+lt_simple_compile_test_code="class foo {}"
4318
+
4319
+# Code to be used in simple link tests
4320
+lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }'
4321
+
4322
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
4323
+_LT_AC_SYS_COMPILER
4324
+
4325
+# save warnings/boilerplate of simple test code
4326
+_LT_COMPILER_BOILERPLATE
4327
+_LT_LINKER_BOILERPLATE
4328
+
4329
+# Allow CC to be a program name with arguments.
4330
+lt_save_CC="$CC"
4331
+CC=${GCJ-"gcj"}
4332
+compiler=$CC
4333
+_LT_AC_TAGVAR(compiler, $1)=$CC
4334
+_LT_CC_BASENAME([$compiler])
4335
+
4336
+# GCJ did not exist at the time GCC didn't implicitly link libc in.
4337
+_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
4338
+
4339
+_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
4340
+
4341
+AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1)
4342
+AC_LIBTOOL_PROG_COMPILER_PIC($1)
4343
+AC_LIBTOOL_PROG_CC_C_O($1)
4344
+AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
4345
+AC_LIBTOOL_PROG_LD_SHLIBS($1)
4346
+AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
4347
+AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
4348
+
4349
+AC_LIBTOOL_CONFIG($1)
4350
+
4351
+AC_LANG_RESTORE
4352
+CC="$lt_save_CC"
4353
+])# AC_LIBTOOL_LANG_GCJ_CONFIG
4354
+
4355
+
4356
+# AC_LIBTOOL_LANG_RC_CONFIG
4357
+# -------------------------
4358
+# Ensure that the configuration vars for the Windows resource compiler are
4359
+# suitably defined.  Those variables are subsequently used by
4360
+# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
4361
+AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG], [_LT_AC_LANG_RC_CONFIG(RC)])
4362
+AC_DEFUN([_LT_AC_LANG_RC_CONFIG],
4363
+[AC_LANG_SAVE
4364
+
4365
+# Source file extension for RC test sources.
4366
+ac_ext=rc
4367
+
4368
+# Object file extension for compiled RC test sources.
4369
+objext=o
4370
+_LT_AC_TAGVAR(objext, $1)=$objext
4371
+
4372
+# Code to be used in simple compile tests
4373
+lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
4374
+
4375
+# Code to be used in simple link tests
4376
+lt_simple_link_test_code="$lt_simple_compile_test_code"
4377
+
4378
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
4379
+_LT_AC_SYS_COMPILER
4380
+
4381
+# save warnings/boilerplate of simple test code
4382
+_LT_COMPILER_BOILERPLATE
4383
+_LT_LINKER_BOILERPLATE
4384
+
4385
+# Allow CC to be a program name with arguments.
4386
+lt_save_CC="$CC"
4387
+CC=${RC-"windres"}
4388
+compiler=$CC
4389
+_LT_AC_TAGVAR(compiler, $1)=$CC
4390
+_LT_CC_BASENAME([$compiler])
4391
+_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
4392
+
4393
+AC_LIBTOOL_CONFIG($1)
4394
+
4395
+AC_LANG_RESTORE
4396
+CC="$lt_save_CC"
4397
+])# AC_LIBTOOL_LANG_RC_CONFIG
4398
+
4399
+
4400
+# AC_LIBTOOL_CONFIG([TAGNAME])
4401
+# ----------------------------
4402
+# If TAGNAME is not passed, then create an initial libtool script
4403
+# with a default configuration from the untagged config vars.  Otherwise
4404
+# add code to config.status for appending the configuration named by
4405
+# TAGNAME from the matching tagged config vars.
4406
+AC_DEFUN([AC_LIBTOOL_CONFIG],
4407
+[# The else clause should only fire when bootstrapping the
4408
+# libtool distribution, otherwise you forgot to ship ltmain.sh
4409
+# with your package, and you will get complaints that there are
4410
+# no rules to generate ltmain.sh.
4411
+if test -f "$ltmain"; then
4412
+  # See if we are running on zsh, and set the options which allow our commands through
4413
+  # without removal of \ escapes.
4414
+  if test -n "${ZSH_VERSION+set}" ; then
4415
+    setopt NO_GLOB_SUBST
4416
+  fi
4417
+  # Now quote all the things that may contain metacharacters while being
4418
+  # careful not to overquote the AC_SUBSTed values.  We take copies of the
4419
+  # variables and quote the copies for generation of the libtool script.
4420
+  for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \
4421
+    SED SHELL STRIP \
4422
+    libname_spec library_names_spec soname_spec extract_expsyms_cmds \
4423
+    old_striplib striplib file_magic_cmd finish_cmds finish_eval \
4424
+    deplibs_check_method reload_flag reload_cmds need_locks \
4425
+    lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
4426
+    lt_cv_sys_global_symbol_to_c_name_address \
4427
+    sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
4428
+    old_postinstall_cmds old_postuninstall_cmds \
4429
+    _LT_AC_TAGVAR(compiler, $1) \
4430
+    _LT_AC_TAGVAR(CC, $1) \
4431
+    _LT_AC_TAGVAR(LD, $1) \
4432
+    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1) \
4433
+    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1) \
4434
+    _LT_AC_TAGVAR(lt_prog_compiler_static, $1) \
4435
+    _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) \
4436
+    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1) \
4437
+    _LT_AC_TAGVAR(thread_safe_flag_spec, $1) \
4438
+    _LT_AC_TAGVAR(whole_archive_flag_spec, $1) \
4439
+    _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1) \
4440
+    _LT_AC_TAGVAR(old_archive_cmds, $1) \
4441
+    _LT_AC_TAGVAR(old_archive_from_new_cmds, $1) \
4442
+    _LT_AC_TAGVAR(predep_objects, $1) \
4443
+    _LT_AC_TAGVAR(postdep_objects, $1) \
4444
+    _LT_AC_TAGVAR(predeps, $1) \
4445
+    _LT_AC_TAGVAR(postdeps, $1) \
4446
+    _LT_AC_TAGVAR(compiler_lib_search_path, $1) \
4447
+    _LT_AC_TAGVAR(compiler_lib_search_dirs, $1) \
4448
+    _LT_AC_TAGVAR(archive_cmds, $1) \
4449
+    _LT_AC_TAGVAR(archive_expsym_cmds, $1) \
4450
+    _LT_AC_TAGVAR(postinstall_cmds, $1) \
4451
+    _LT_AC_TAGVAR(postuninstall_cmds, $1) \
4452
+    _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) \
4453
+    _LT_AC_TAGVAR(allow_undefined_flag, $1) \
4454
+    _LT_AC_TAGVAR(no_undefined_flag, $1) \
4455
+    _LT_AC_TAGVAR(export_symbols_cmds, $1) \
4456
+    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) \
4457
+    _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1) \
4458
+    _LT_AC_TAGVAR(hardcode_libdir_separator, $1) \
4459
+    _LT_AC_TAGVAR(hardcode_automatic, $1) \
4460
+    _LT_AC_TAGVAR(module_cmds, $1) \
4461
+    _LT_AC_TAGVAR(module_expsym_cmds, $1) \
4462
+    _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1) \
4463
+    _LT_AC_TAGVAR(fix_srcfile_path, $1) \
4464
+    _LT_AC_TAGVAR(exclude_expsyms, $1) \
4465
+    _LT_AC_TAGVAR(include_expsyms, $1); do
4466
+
4467
+    case $var in
4468
+    _LT_AC_TAGVAR(old_archive_cmds, $1) | \
4469
+    _LT_AC_TAGVAR(old_archive_from_new_cmds, $1) | \
4470
+    _LT_AC_TAGVAR(archive_cmds, $1) | \
4471
+    _LT_AC_TAGVAR(archive_expsym_cmds, $1) | \
4472
+    _LT_AC_TAGVAR(module_cmds, $1) | \
4473
+    _LT_AC_TAGVAR(module_expsym_cmds, $1) | \
4474
+    _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) | \
4475
+    _LT_AC_TAGVAR(export_symbols_cmds, $1) | \
4476
+    extract_expsyms_cmds | reload_cmds | finish_cmds | \
4477
+    postinstall_cmds | postuninstall_cmds | \
4478
+    old_postinstall_cmds | old_postuninstall_cmds | \
4479
+    sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
4480
+      # Double-quote double-evaled strings.
4481
+      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
4482
+      ;;
4483
+    *)
4484
+      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
4485
+      ;;
4486
+    esac
4487
+  done
4488
+
4489
+  case $lt_echo in
4490
+  *'\[$]0 --fallback-echo"')
4491
+    lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\[$]0 --fallback-echo"[$]/[$]0 --fallback-echo"/'`
4492
+    ;;
4493
+  esac
4494
+
4495
+ifelse([$1], [],
4496
+  [cfgfile="${ofile}T"
4497
+  trap "$rm \"$cfgfile\"; exit 1" 1 2 15
4498
+  $rm -f "$cfgfile"
4499
+  AC_MSG_NOTICE([creating $ofile])],
4500
+  [cfgfile="$ofile"])
4501
+
4502
+  cat <<__EOF__ >> "$cfgfile"
4503
+ifelse([$1], [],
4504
+[#! $SHELL
4505
+
4506
+# `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
4507
+# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)
4508
+# NOTE: Changes made to this file will be lost: look at ltmain.sh.
4509
+#
4510
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
4511
+# Free Software Foundation, Inc.
4512
+#
4513
+# This file is part of GNU Libtool:
4514
+# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
4515
+#
4516
+# This program is free software; you can redistribute it and/or modify
4517
+# it under the terms of the GNU General Public License as published by
4518
+# the Free Software Foundation; either version 2 of the License, or
4519
+# (at your option) any later version.
4520
+#
4521
+# This program is distributed in the hope that it will be useful, but
4522
+# WITHOUT ANY WARRANTY; without even the implied warranty of
4523
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
4524
+# General Public License for more details.
4525
+#
4526
+# You should have received a copy of the GNU General Public License
4527
+# along with this program; if not, write to the Free Software
4528
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
4529
+#
4530
+# As a special exception to the GNU General Public License, if you
4531
+# distribute this file as part of a program that contains a
4532
+# configuration script generated by Autoconf, you may include it under
4533
+# the same distribution terms that you use for the rest of that program.
4534
+
4535
+# A sed program that does not truncate output.
4536
+SED=$lt_SED
4537
+
4538
+# Sed that helps us avoid accidentally triggering echo(1) options like -n.
4539
+Xsed="$SED -e 1s/^X//"
4540
+
4541
+# The HP-UX ksh and POSIX shell print the target directory to stdout
4542
+# if CDPATH is set.
4543
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
4544
+
4545
+# The names of the tagged configurations supported by this script.
4546
+available_tags=
4547
+
4548
+# ### BEGIN LIBTOOL CONFIG],
4549
+[# ### BEGIN LIBTOOL TAG CONFIG: $tagname])
4550
+
4551
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
4552
+
4553
+# Shell to use when invoking shell scripts.
4554
+SHELL=$lt_SHELL
4555
+
4556
+# Whether or not to build shared libraries.
4557
+build_libtool_libs=$enable_shared
4558
+
4559
+# Whether or not to build static libraries.
4560
+build_old_libs=$enable_static
4561
+
4562
+# Whether or not to add -lc for building shared libraries.
4563
+build_libtool_need_lc=$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)
4564
+
4565
+# Whether or not to disallow shared libs when runtime libs are static
4566
+allow_libtool_libs_with_static_runtimes=$_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)
4567
+
4568
+# Whether or not to optimize for fast installation.
4569
+fast_install=$enable_fast_install
4570
+
4571
+# The host system.
4572
+host_alias=$host_alias
4573
+host=$host
4574
+host_os=$host_os
4575
+
4576
+# The build system.
4577
+build_alias=$build_alias
4578
+build=$build
4579
+build_os=$build_os
4580
+
4581
+# An echo program that does not interpret backslashes.
4582
+echo=$lt_echo
4583
+
4584
+# The archiver.
4585
+AR=$lt_AR
4586
+AR_FLAGS=$lt_AR_FLAGS
4587
+
4588
+# A C compiler.
4589
+LTCC=$lt_LTCC
4590
+
4591
+# LTCC compiler flags.
4592
+LTCFLAGS=$lt_LTCFLAGS
4593
+
4594
+# A language-specific compiler.
4595
+CC=$lt_[]_LT_AC_TAGVAR(compiler, $1)
4596
+
4597
+# Is the compiler the GNU C compiler?
4598
+with_gcc=$_LT_AC_TAGVAR(GCC, $1)
4599
+
4600
+# An ERE matcher.
4601
+EGREP=$lt_EGREP
4602
+
4603
+# The linker used to build libraries.
4604
+LD=$lt_[]_LT_AC_TAGVAR(LD, $1)
4605
+
4606
+# Whether we need hard or soft links.
4607
+LN_S=$lt_LN_S
4608
+
4609
+# A BSD-compatible nm program.
4610
+NM=$lt_NM
4611
+
4612
+# A symbol stripping program
4613
+STRIP=$lt_STRIP
4614
+
4615
+# Used to examine libraries when file_magic_cmd begins "file"
4616
+MAGIC_CMD=$MAGIC_CMD
4617
+
4618
+# Used on cygwin: DLL creation program.
4619
+DLLTOOL="$DLLTOOL"
4620
+
4621
+# Used on cygwin: object dumper.
4622
+OBJDUMP="$OBJDUMP"
4623
+
4624
+# Used on cygwin: assembler.
4625
+AS="$AS"
4626
+
4627
+# The name of the directory that contains temporary libtool files.
4628
+objdir=$objdir
4629
+
4630
+# How to create reloadable object files.
4631
+reload_flag=$lt_reload_flag
4632
+reload_cmds=$lt_reload_cmds
4633
+
4634
+# How to pass a linker flag through the compiler.
4635
+wl=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)
4636
+
4637
+# Object file suffix (normally "o").
4638
+objext="$ac_objext"
4639
+
4640
+# Old archive suffix (normally "a").
4641
+libext="$libext"
4642
+
4643
+# Shared library suffix (normally ".so").
4644
+shrext_cmds='$shrext_cmds'
4645
+
4646
+# Executable file suffix (normally "").
4647
+exeext="$exeext"
4648
+
4649
+# Additional compiler flags for building library objects.
4650
+pic_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)
4651
+pic_mode=$pic_mode
4652
+
4653
+# What is the maximum length of a command?
4654
+max_cmd_len=$lt_cv_sys_max_cmd_len
4655
+
4656
+# Does compiler simultaneously support -c and -o options?
4657
+compiler_c_o=$lt_[]_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)
4658
+
4659
+# Must we lock files when doing compilation?
4660
+need_locks=$lt_need_locks
4661
+
4662
+# Do we need the lib prefix for modules?
4663
+need_lib_prefix=$need_lib_prefix
4664
+
4665
+# Do we need a version for libraries?
4666
+need_version=$need_version
4667
+
4668
+# Whether dlopen is supported.
4669
+dlopen_support=$enable_dlopen
4670
+
4671
+# Whether dlopen of programs is supported.
4672
+dlopen_self=$enable_dlopen_self
4673
+
4674
+# Whether dlopen of statically linked programs is supported.
4675
+dlopen_self_static=$enable_dlopen_self_static
4676
+
4677
+# Compiler flag to prevent dynamic linking.
4678
+link_static_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_static, $1)
4679
+
4680
+# Compiler flag to turn off builtin functions.
4681
+no_builtin_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)
4682
+
4683
+# Compiler flag to allow reflexive dlopens.
4684
+export_dynamic_flag_spec=$lt_[]_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)
4685
+
4686
+# Compiler flag to generate shared objects directly from archives.
4687
+whole_archive_flag_spec=$lt_[]_LT_AC_TAGVAR(whole_archive_flag_spec, $1)
4688
+
4689
+# Compiler flag to generate thread-safe objects.
4690
+thread_safe_flag_spec=$lt_[]_LT_AC_TAGVAR(thread_safe_flag_spec, $1)
4691
+
4692
+# Library versioning type.
4693
+version_type=$version_type
4694
+
4695
+# Format of library name prefix.
4696
+libname_spec=$lt_libname_spec
4697
+
4698
+# List of archive names.  First name is the real one, the rest are links.
4699
+# The last name is the one that the linker finds with -lNAME.
4700
+library_names_spec=$lt_library_names_spec
4701
+
4702
+# The coded name of the library, if different from the real name.
4703
+soname_spec=$lt_soname_spec
4704
+
4705
+# Commands used to build and install an old-style archive.
4706
+RANLIB=$lt_RANLIB
4707
+old_archive_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_cmds, $1)
4708
+old_postinstall_cmds=$lt_old_postinstall_cmds
4709
+old_postuninstall_cmds=$lt_old_postuninstall_cmds
4710
+
4711
+# Create an old-style archive from a shared archive.
4712
+old_archive_from_new_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_new_cmds, $1)
4713
+
4714
+# Create a temporary old-style archive to link instead of a shared archive.
4715
+old_archive_from_expsyms_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)
4716
+
4717
+# Commands used to build and install a shared archive.
4718
+archive_cmds=$lt_[]_LT_AC_TAGVAR(archive_cmds, $1)
4719
+archive_expsym_cmds=$lt_[]_LT_AC_TAGVAR(archive_expsym_cmds, $1)
4720
+postinstall_cmds=$lt_postinstall_cmds
4721
+postuninstall_cmds=$lt_postuninstall_cmds
4722
+
4723
+# Commands used to build a loadable module (assumed same as above if empty)
4724
+module_cmds=$lt_[]_LT_AC_TAGVAR(module_cmds, $1)
4725
+module_expsym_cmds=$lt_[]_LT_AC_TAGVAR(module_expsym_cmds, $1)
4726
+
4727
+# Commands to strip libraries.
4728
+old_striplib=$lt_old_striplib
4729
+striplib=$lt_striplib
4730
+
4731
+# Dependencies to place before the objects being linked to create a
4732
+# shared library.
4733
+predep_objects=$lt_[]_LT_AC_TAGVAR(predep_objects, $1)
4734
+
4735
+# Dependencies to place after the objects being linked to create a
4736
+# shared library.
4737
+postdep_objects=$lt_[]_LT_AC_TAGVAR(postdep_objects, $1)
4738
+
4739
+# Dependencies to place before the objects being linked to create a
4740
+# shared library.
4741
+predeps=$lt_[]_LT_AC_TAGVAR(predeps, $1)
4742
+
4743
+# Dependencies to place after the objects being linked to create a
4744
+# shared library.
4745
+postdeps=$lt_[]_LT_AC_TAGVAR(postdeps, $1)
4746
+
4747
+# The directories searched by this compiler when creating a shared
4748
+# library
4749
+compiler_lib_search_dirs=$lt_[]_LT_AC_TAGVAR(compiler_lib_search_dirs, $1)
4750
+
4751
+# The library search path used internally by the compiler when linking
4752
+# a shared library.
4753
+compiler_lib_search_path=$lt_[]_LT_AC_TAGVAR(compiler_lib_search_path, $1)
4754
+
4755
+# Method to check whether dependent libraries are shared objects.
4756
+deplibs_check_method=$lt_deplibs_check_method
4757
+
4758
+# Command to use when deplibs_check_method == file_magic.
4759
+file_magic_cmd=$lt_file_magic_cmd
4760
+
4761
+# Flag that allows shared libraries with undefined symbols to be built.
4762
+allow_undefined_flag=$lt_[]_LT_AC_TAGVAR(allow_undefined_flag, $1)
4763
+
4764
+# Flag that forces no undefined symbols.
4765
+no_undefined_flag=$lt_[]_LT_AC_TAGVAR(no_undefined_flag, $1)
4766
+
4767
+# Commands used to finish a libtool library installation in a directory.
4768
+finish_cmds=$lt_finish_cmds
4769
+
4770
+# Same as above, but a single script fragment to be evaled but not shown.
4771
+finish_eval=$lt_finish_eval
4772
+
4773
+# Take the output of nm and produce a listing of raw symbols and C names.
4774
+global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
4775
+
4776
+# Transform the output of nm in a proper C declaration
4777
+global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
4778
+
4779
+# Transform the output of nm in a C name address pair
4780
+global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
4781
+
4782
+# This is the shared library runtime path variable.
4783
+runpath_var=$runpath_var
4784
+
4785
+# This is the shared library path variable.
4786
+shlibpath_var=$shlibpath_var
4787
+
4788
+# Is shlibpath searched before the hard-coded library search path?
4789
+shlibpath_overrides_runpath=$shlibpath_overrides_runpath
4790
+
4791
+# How to hardcode a shared library path into an executable.
4792
+hardcode_action=$_LT_AC_TAGVAR(hardcode_action, $1)
4793
+
4794
+# Whether we should hardcode library paths into libraries.
4795
+hardcode_into_libs=$hardcode_into_libs
4796
+
4797
+# Flag to hardcode \$libdir into a binary during linking.
4798
+# This must work even if \$libdir does not exist.
4799
+hardcode_libdir_flag_spec=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)
4800
+
4801
+# If ld is used when linking, flag to hardcode \$libdir into
4802
+# a binary during linking. This must work even if \$libdir does
4803
+# not exist.
4804
+hardcode_libdir_flag_spec_ld=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)
4805
+
4806
+# Whether we need a single -rpath flag with a separated argument.
4807
+hardcode_libdir_separator=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_separator, $1)
4808
+
4809
+# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
4810
+# resulting binary.
4811
+hardcode_direct=$_LT_AC_TAGVAR(hardcode_direct, $1)
4812
+
4813
+# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
4814
+# resulting binary.
4815
+hardcode_minus_L=$_LT_AC_TAGVAR(hardcode_minus_L, $1)
4816
+
4817
+# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
4818
+# the resulting binary.
4819
+hardcode_shlibpath_var=$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)
4820
+
4821
+# Set to yes if building a shared library automatically hardcodes DIR into the library
4822
+# and all subsequent libraries and executables linked against it.
4823
+hardcode_automatic=$_LT_AC_TAGVAR(hardcode_automatic, $1)
4824
+
4825
+# Variables whose values should be saved in libtool wrapper scripts and
4826
+# restored at relink time.
4827
+variables_saved_for_relink="$variables_saved_for_relink"
4828
+
4829
+# Whether libtool must link a program against all its dependency libraries.
4830
+link_all_deplibs=$_LT_AC_TAGVAR(link_all_deplibs, $1)
4831
+
4832
+# Compile-time system search path for libraries
4833
+sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
4834
+
4835
+# Run-time system search path for libraries
4836
+sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
4837
+
4838
+# Fix the shell variable \$srcfile for the compiler.
4839
+fix_srcfile_path=$lt_fix_srcfile_path
4840
+
4841
+# Set to yes if exported symbols are required.
4842
+always_export_symbols=$_LT_AC_TAGVAR(always_export_symbols, $1)
4843
+
4844
+# The commands to list exported symbols.
4845
+export_symbols_cmds=$lt_[]_LT_AC_TAGVAR(export_symbols_cmds, $1)
4846
+
4847
+# The commands to extract the exported symbol list from a shared archive.
4848
+extract_expsyms_cmds=$lt_extract_expsyms_cmds
4849
+
4850
+# Symbols that should not be listed in the preloaded symbols.
4851
+exclude_expsyms=$lt_[]_LT_AC_TAGVAR(exclude_expsyms, $1)
4852
+
4853
+# Symbols that must always be exported.
4854
+include_expsyms=$lt_[]_LT_AC_TAGVAR(include_expsyms, $1)
4855
+
4856
+ifelse([$1],[],
4857
+[# ### END LIBTOOL CONFIG],
4858
+[# ### END LIBTOOL TAG CONFIG: $tagname])
4859
+
4860
+__EOF__
4861
+
4862
+ifelse([$1],[], [
4863
+  case $host_os in
4864
+  aix3*)
4865
+    cat <<\EOF >> "$cfgfile"
4866
+
4867
+# AIX sometimes has problems with the GCC collect2 program.  For some
4868
+# reason, if we set the COLLECT_NAMES environment variable, the problems
4869
+# vanish in a puff of smoke.
4870
+if test "X${COLLECT_NAMES+set}" != Xset; then
4871
+  COLLECT_NAMES=
4872
+  export COLLECT_NAMES
4873
+fi
4874
+EOF
4875
+    ;;
4876
+  esac
4877
+
4878
+  # We use sed instead of cat because bash on DJGPP gets confused if
4879
+  # if finds mixed CR/LF and LF-only lines.  Since sed operates in
4880
+  # text mode, it properly converts lines to CR/LF.  This bash problem
4881
+  # is reportedly fixed, but why not run on old versions too?
4882
+  sed '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1)
4883
+
4884
+  mv -f "$cfgfile" "$ofile" || \
4885
+    (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
4886
+  chmod +x "$ofile"
4887
+])
4888
+else
4889
+  # If there is no Makefile yet, we rely on a make rule to execute
4890
+  # `config.status --recheck' to rerun these tests and create the
4891
+  # libtool script then.
4892
+  ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
4893
+  if test -f "$ltmain_in"; then
4894
+    test -f Makefile && make "$ltmain"
4895
+  fi
4896
+fi
4897
+])# AC_LIBTOOL_CONFIG
4898
+
4899
+
4900
+# AC_LIBTOOL_PROG_COMPILER_NO_RTTI([TAGNAME])
4901
+# -------------------------------------------
4902
+AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI],
4903
+[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
4904
+
4905
+_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
4906
+
4907
+if test "$GCC" = yes; then
4908
+  _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
4909
+
4910
+  AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
4911
+    lt_cv_prog_compiler_rtti_exceptions,
4912
+    [-fno-rtti -fno-exceptions], [],
4913
+    [_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
4914
+fi
4915
+])# AC_LIBTOOL_PROG_COMPILER_NO_RTTI
4916
+
4917
+
4918
+# AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
4919
+# ---------------------------------
4920
+AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE],
4921
+[AC_REQUIRE([AC_CANONICAL_HOST])
4922
+AC_REQUIRE([LT_AC_PROG_SED])
4923
+AC_REQUIRE([AC_PROG_NM])
4924
+AC_REQUIRE([AC_OBJEXT])
4925
+# Check for command to grab the raw symbol name followed by C symbol from nm.
4926
+AC_MSG_CHECKING([command to parse $NM output from $compiler object])
4927
+AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
4928
+[
4929
+# These are sane defaults that work on at least a few old systems.
4930
+# [They come from Ultrix.  What could be older than Ultrix?!! ;)]
4931
+
4932
+# Character class describing NM global symbol codes.
4933
+symcode='[[BCDEGRST]]'
4934
+
4935
+# Regexp to match symbols that can be accessed directly from C.
4936
+sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
4937
+
4938
+# Transform an extracted symbol line into a proper C declaration
4939
+lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'"
4940
+
4941
+# Transform an extracted symbol line into symbol name and symbol address
4942
+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'"
4943
+
4944
+# Define system-specific variables.
4945
+case $host_os in
4946
+aix*)
4947
+  symcode='[[BCDT]]'
4948
+  ;;
4949
+cygwin* | mingw* | pw32*)
4950
+  symcode='[[ABCDGISTW]]'
4951
+  ;;
4952
+hpux*) # Its linker distinguishes data from code symbols
4953
+  if test "$host_cpu" = ia64; then
4954
+    symcode='[[ABCDEGRST]]'
4955
+  fi
4956
+  lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
4957
+  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'"
4958
+  ;;
4959
+linux* | k*bsd*-gnu)
4960
+  if test "$host_cpu" = ia64; then
4961
+    symcode='[[ABCDGIRSTW]]'
4962
+    lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
4963
+    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'"
4964
+  fi
4965
+  ;;
4966
+irix* | nonstopux*)
4967
+  symcode='[[BCDEGRST]]'
4968
+  ;;
4969
+osf*)
4970
+  symcode='[[BCDEGQRST]]'
4971
+  ;;
4972
+solaris*)
4973
+  symcode='[[BDRT]]'
4974
+  ;;
4975
+sco3.2v5*)
4976
+  symcode='[[DT]]'
4977
+  ;;
4978
+sysv4.2uw2*)
4979
+  symcode='[[DT]]'
4980
+  ;;
4981
+sysv5* | sco5v6* | unixware* | OpenUNIX*)
4982
+  symcode='[[ABDT]]'
4983
+  ;;
4984
+sysv4)
4985
+  symcode='[[DFNSTU]]'
4986
+  ;;
4987
+esac
4988
+
4989
+# Handle CRLF in mingw tool chain
4990
+opt_cr=
4991
+case $build_os in
4992
+mingw*)
4993
+  opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp
4994
+  ;;
4995
+esac
4996
+
4997
+# If we're using GNU nm, then use its standard symbol codes.
4998
+case `$NM -V 2>&1` in
4999
+*GNU* | *'with BFD'*)
5000
+  symcode='[[ABCDGIRSTW]]' ;;
5001
+esac
5002
+
5003
+# Try without a prefix undercore, then with it.
5004
+for ac_symprfx in "" "_"; do
5005
+
5006
+  # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
5007
+  symxfrm="\\1 $ac_symprfx\\2 \\2"
5008
+
5009
+  # Write the raw and C identifiers.
5010
+  lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ 	]]\($symcode$symcode*\)[[ 	]][[ 	]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
5011
+
5012
+  # Check to see that the pipe works correctly.
5013
+  pipe_works=no
5014
+
5015
+  rm -f conftest*
5016
+  cat > conftest.$ac_ext <<EOF
5017
+#ifdef __cplusplus
5018
+extern "C" {
5019
+#endif
5020
+char nm_test_var;
5021
+void nm_test_func(){}
5022
+#ifdef __cplusplus
5023
+}
5024
+#endif
5025
+int main(){nm_test_var='a';nm_test_func();return(0);}
5026
+EOF
5027
+
5028
+  if AC_TRY_EVAL(ac_compile); then
5029
+    # Now try to grab the symbols.
5030
+    nlist=conftest.nm
5031
+    if AC_TRY_EVAL(NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) && test -s "$nlist"; then
5032
+      # Try sorting and uniquifying the output.
5033
+      if sort "$nlist" | uniq > "$nlist"T; then
5034
+	mv -f "$nlist"T "$nlist"
5035
+      else
5036
+	rm -f "$nlist"T
5037
+      fi
5038
+
5039
+      # Make sure that we snagged all the symbols we need.
5040
+      if grep ' nm_test_var$' "$nlist" >/dev/null; then
5041
+	if grep ' nm_test_func$' "$nlist" >/dev/null; then
5042
+	  cat <<EOF > conftest.$ac_ext
5043
+#ifdef __cplusplus
5044
+extern "C" {
5045
+#endif
5046
+
5047
+EOF
5048
+	  # Now generate the symbol file.
5049
+	  eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext'
5050
+
5051
+	  cat <<EOF >> conftest.$ac_ext
5052
+#if defined (__STDC__) && __STDC__
5053
+# define lt_ptr_t void *
5054
+#else
5055
+# define lt_ptr_t char *
5056
+# define const
5057
+#endif
5058
+
5059
+/* The mapping between symbol names and symbols. */
5060
+const struct {
5061
+  const char *name;
5062
+  lt_ptr_t address;
5063
+}
5064
+lt_preloaded_symbols[[]] =
5065
+{
5066
+EOF
5067
+	  $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext
5068
+	  cat <<\EOF >> conftest.$ac_ext
5069
+  {0, (lt_ptr_t) 0}
5070
+};
5071
+
5072
+#ifdef __cplusplus
5073
+}
5074
+#endif
5075
+EOF
5076
+	  # Now try linking the two files.
5077
+	  mv conftest.$ac_objext conftstm.$ac_objext
5078
+	  lt_save_LIBS="$LIBS"
5079
+	  lt_save_CFLAGS="$CFLAGS"
5080
+	  LIBS="conftstm.$ac_objext"
5081
+	  CFLAGS="$CFLAGS$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
5082
+	  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
5083
+	    pipe_works=yes
5084
+	  fi
5085
+	  LIBS="$lt_save_LIBS"
5086
+	  CFLAGS="$lt_save_CFLAGS"
5087
+	else
5088
+	  echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
5089
+	fi
5090
+      else
5091
+	echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
5092
+      fi
5093
+    else
5094
+      echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
5095
+    fi
5096
+  else
5097
+    echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
5098
+    cat conftest.$ac_ext >&5
5099
+  fi
5100
+  rm -rf conftest* conftst*
5101
+
5102
+  # Do not use the global_symbol_pipe unless it works.
5103
+  if test "$pipe_works" = yes; then
5104
+    break
5105
+  else
5106
+    lt_cv_sys_global_symbol_pipe=
5107
+  fi
5108
+done
5109
+])
5110
+if test -z "$lt_cv_sys_global_symbol_pipe"; then
5111
+  lt_cv_sys_global_symbol_to_cdecl=
5112
+fi
5113
+if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
5114
+  AC_MSG_RESULT(failed)
5115
+else
5116
+  AC_MSG_RESULT(ok)
5117
+fi
5118
+]) # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
5119
+
5120
+
5121
+# AC_LIBTOOL_PROG_COMPILER_PIC([TAGNAME])
5122
+# ---------------------------------------
5123
+AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC],
5124
+[_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)=
5125
+_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
5126
+_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=
5127
+
5128
+AC_MSG_CHECKING([for $compiler option to produce PIC])
5129
+ ifelse([$1],[CXX],[
5130
+  # C++ specific cases for pic, static, wl, etc.
5131
+  if test "$GXX" = yes; then
5132
+    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5133
+    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
5134
+
5135
+    case $host_os in
5136
+    aix*)
5137
+      # All AIX code is PIC.
5138
+      if test "$host_cpu" = ia64; then
5139
+	# AIX 5 now supports IA64 processor
5140
+	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5141
+      fi
5142
+      ;;
5143
+    amigaos*)
5144
+      # FIXME: we need at least 68020 code to build shared libraries, but
5145
+      # adding the `-m68020' flag to GCC prevents building anything better,
5146
+      # like `-m68040'.
5147
+      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
5148
+      ;;
5149
+    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
5150
+      # PIC is the default for these OSes.
5151
+      ;;
5152
+    mingw* | cygwin* | os2* | pw32*)
5153
+      # This hack is so that the source file can tell whether it is being
5154
+      # built for inclusion in a dll (and should export symbols for example).
5155
+      # Although the cygwin gcc ignores -fPIC, still need this for old-style
5156
+      # (--disable-auto-import) libraries
5157
+      m4_if([$1], [GCJ], [],
5158
+	[_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
5159
+      ;;
5160
+    darwin* | rhapsody*)
5161
+      # PIC is the default on this platform
5162
+      # Common symbols not allowed in MH_DYLIB files
5163
+      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
5164
+      ;;
5165
+    *djgpp*)
5166
+      # DJGPP does not support shared libraries at all
5167
+      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
5168
+      ;;
5169
+    interix[[3-9]]*)
5170
+      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
5171
+      # Instead, we relocate shared libraries at runtime.
5172
+      ;;
5173
+    sysv4*MP*)
5174
+      if test -d /usr/nec; then
5175
+	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
5176
+      fi
5177
+      ;;
5178
+    hpux*)
5179
+      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
5180
+      # not for PA HP-UX.
5181
+      case $host_cpu in
5182
+      hppa*64*|ia64*)
5183
+	;;
5184
+      *)
5185
+	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
5186
+	;;
5187
+      esac
5188
+      ;;
5189
+    *)
5190
+      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
5191
+      ;;
5192
+    esac
5193
+  else
5194
+    case $host_os in
5195
+      aix[[4-9]]*)
5196
+	# All AIX code is PIC.
5197
+	if test "$host_cpu" = ia64; then
5198
+	  # AIX 5 now supports IA64 processor
5199
+	  _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5200
+	else
5201
+	  _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
5202
+	fi
5203
+	;;
5204
+      chorus*)
5205
+	case $cc_basename in
5206
+	cxch68*)
5207
+	  # Green Hills C++ Compiler
5208
+	  # _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"
5209
+	  ;;
5210
+	esac
5211
+	;;
5212
+       darwin*)
5213
+         # PIC is the default on this platform
5214
+         # Common symbols not allowed in MH_DYLIB files
5215
+         case $cc_basename in
5216
+           xlc*)
5217
+           _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon'
5218
+           _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5219
+           ;;
5220
+         esac
5221
+       ;;
5222
+      dgux*)
5223
+	case $cc_basename in
5224
+	  ec++*)
5225
+	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5226
+	    ;;
5227
+	  ghcx*)
5228
+	    # Green Hills C++ Compiler
5229
+	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
5230
+	    ;;
5231
+	  *)
5232
+	    ;;
5233
+	esac
5234
+	;;
5235
+      freebsd* | dragonfly*)
5236
+	# FreeBSD uses GNU C++
5237
+	;;
5238
+      hpux9* | hpux10* | hpux11*)
5239
+	case $cc_basename in
5240
+	  CC*)
5241
+	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5242
+	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
5243
+	    if test "$host_cpu" != ia64; then
5244
+	      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
5245
+	    fi
5246
+	    ;;
5247
+	  aCC*)
5248
+	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5249
+	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
5250
+	    case $host_cpu in
5251
+	    hppa*64*|ia64*)
5252
+	      # +Z the default
5253
+	      ;;
5254
+	    *)
5255
+	      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
5256
+	      ;;
5257
+	    esac
5258
+	    ;;
5259
+	  *)
5260
+	    ;;
5261
+	esac
5262
+	;;
5263
+      interix*)
5264
+	# This is c89, which is MS Visual C++ (no shared libs)
5265
+	# Anyone wants to do a port?
5266
+	;;
5267
+      irix5* | irix6* | nonstopux*)
5268
+	case $cc_basename in
5269
+	  CC*)
5270
+	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5271
+	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
5272
+	    # CC pic flag -KPIC is the default.
5273
+	    ;;
5274
+	  *)
5275
+	    ;;
5276
+	esac
5277
+	;;
5278
+      linux* | k*bsd*-gnu)
5279
+	case $cc_basename in
5280
+	  KCC*)
5281
+	    # KAI C++ Compiler
5282
+	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
5283
+	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
5284
+	    ;;
5285
+	  icpc* | ecpc*)
5286
+	    # Intel C++
5287
+	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5288
+	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5289
+	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
5290
+	    ;;
5291
+	  pgCC* | pgcpp*)
5292
+	    # Portland Group C++ compiler.
5293
+	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5294
+	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
5295
+	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5296
+	    ;;
5297
+	  cxx*)
5298
+	    # Compaq C++
5299
+	    # Make sure the PIC flag is empty.  It appears that all Alpha
5300
+	    # Linux and Compaq Tru64 Unix objects are PIC.
5301
+	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
5302
+	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
5303
+	    ;;
5304
+	  *)
5305
+	    case `$CC -V 2>&1 | sed 5q` in
5306
+	    *Sun\ C*)
5307
+	      # Sun C++ 5.9
5308
+	      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5309
+	      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5310
+	      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
5311
+	      ;;
5312
+	    esac
5313
+	    ;;
5314
+	esac
5315
+	;;
5316
+      lynxos*)
5317
+	;;
5318
+      m88k*)
5319
+	;;
5320
+      mvs*)
5321
+	case $cc_basename in
5322
+	  cxx*)
5323
+	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
5324
+	    ;;
5325
+	  *)
5326
+	    ;;
5327
+	esac
5328
+	;;
5329
+      netbsd* | netbsdelf*-gnu)
5330
+	;;
5331
+      osf3* | osf4* | osf5*)
5332
+	case $cc_basename in
5333
+	  KCC*)
5334
+	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
5335
+	    ;;
5336
+	  RCC*)
5337
+	    # Rational C++ 2.4.1
5338
+	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
5339
+	    ;;
5340
+	  cxx*)
5341
+	    # Digital/Compaq C++
5342
+	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5343
+	    # Make sure the PIC flag is empty.  It appears that all Alpha
5344
+	    # Linux and Compaq Tru64 Unix objects are PIC.
5345
+	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
5346
+	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
5347
+	    ;;
5348
+	  *)
5349
+	    ;;
5350
+	esac
5351
+	;;
5352
+      psos*)
5353
+	;;
5354
+      solaris*)
5355
+	case $cc_basename in
5356
+	  CC*)
5357
+	    # Sun C++ 4.2, 5.x and Centerline C++
5358
+	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5359
+	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5360
+	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
5361
+	    ;;
5362
+	  gcx*)
5363
+	    # Green Hills C++ Compiler
5364
+	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
5365
+	    ;;
5366
+	  *)
5367
+	    ;;
5368
+	esac
5369
+	;;
5370
+      sunos4*)
5371
+	case $cc_basename in
5372
+	  CC*)
5373
+	    # Sun C++ 4.x
5374
+	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
5375
+	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5376
+	    ;;
5377
+	  lcc*)
5378
+	    # Lucid
5379
+	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
5380
+	    ;;
5381
+	  *)
5382
+	    ;;
5383
+	esac
5384
+	;;
5385
+      tandem*)
5386
+	case $cc_basename in
5387
+	  NCC*)
5388
+	    # NonStop-UX NCC 3.20
5389
+	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5390
+	    ;;
5391
+	  *)
5392
+	    ;;
5393
+	esac
5394
+	;;
5395
+      sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
5396
+	case $cc_basename in
5397
+	  CC*)
5398
+	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5399
+	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5400
+	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5401
+	    ;;
5402
+	esac
5403
+	;;
5404
+      vxworks*)
5405
+	;;
5406
+      *)
5407
+	_LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
5408
+	;;
5409
+    esac
5410
+  fi
5411
+],
5412
+[
5413
+  if test "$GCC" = yes; then
5414
+    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5415
+    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
5416
+
5417
+    case $host_os in
5418
+      aix*)
5419
+      # All AIX code is PIC.
5420
+      if test "$host_cpu" = ia64; then
5421
+	# AIX 5 now supports IA64 processor
5422
+	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5423
+      fi
5424
+      ;;
5425
+
5426
+    amigaos*)
5427
+      # FIXME: we need at least 68020 code to build shared libraries, but
5428
+      # adding the `-m68020' flag to GCC prevents building anything better,
5429
+      # like `-m68040'.
5430
+      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
5431
+      ;;
5432
+
5433
+    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
5434
+      # PIC is the default for these OSes.
5435
+      ;;
5436
+
5437
+    mingw* | cygwin* | pw32* | os2*)
5438
+      # This hack is so that the source file can tell whether it is being
5439
+      # built for inclusion in a dll (and should export symbols for example).
5440
+      # Although the cygwin gcc ignores -fPIC, still need this for old-style
5441
+      # (--disable-auto-import) libraries
5442
+      m4_if([$1], [GCJ], [],
5443
+	[_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
5444
+      ;;
5445
+
5446
+    darwin* | rhapsody*)
5447
+      # PIC is the default on this platform
5448
+      # Common symbols not allowed in MH_DYLIB files
5449
+      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
5450
+      ;;
5451
+
5452
+    interix[[3-9]]*)
5453
+      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
5454
+      # Instead, we relocate shared libraries at runtime.
5455
+      ;;
5456
+
5457
+    msdosdjgpp*)
5458
+      # Just because we use GCC doesn't mean we suddenly get shared libraries
5459
+      # on systems that don't support them.
5460
+      _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
5461
+      enable_shared=no
5462
+      ;;
5463
+
5464
+    sysv4*MP*)
5465
+      if test -d /usr/nec; then
5466
+	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
5467
+      fi
5468
+      ;;
5469
+
5470
+    hpux*)
5471
+      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
5472
+      # not for PA HP-UX.
5473
+      case $host_cpu in
5474
+      hppa*64*|ia64*)
5475
+	# +Z the default
5476
+	;;
5477
+      *)
5478
+	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
5479
+	;;
5480
+      esac
5481
+      ;;
5482
+
5483
+    *)
5484
+      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
5485
+      ;;
5486
+    esac
5487
+  else
5488
+    # PORTME Check for flag to pass linker flags through the system compiler.
5489
+    case $host_os in
5490
+    aix*)
5491
+      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5492
+      if test "$host_cpu" = ia64; then
5493
+	# AIX 5 now supports IA64 processor
5494
+	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5495
+      else
5496
+	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
5497
+      fi
5498
+      ;;
5499
+      darwin*)
5500
+        # PIC is the default on this platform
5501
+        # Common symbols not allowed in MH_DYLIB files
5502
+       case $cc_basename in
5503
+         xlc*)
5504
+         _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon'
5505
+         _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5506
+         ;;
5507
+       esac
5508
+       ;;
5509
+
5510
+    mingw* | cygwin* | pw32* | os2*)
5511
+      # This hack is so that the source file can tell whether it is being
5512
+      # built for inclusion in a dll (and should export symbols for example).
5513
+      m4_if([$1], [GCJ], [],
5514
+	[_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
5515
+      ;;
5516
+
5517
+    hpux9* | hpux10* | hpux11*)
5518
+      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5519
+      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
5520
+      # not for PA HP-UX.
5521
+      case $host_cpu in
5522
+      hppa*64*|ia64*)
5523
+	# +Z the default
5524
+	;;
5525
+      *)
5526
+	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
5527
+	;;
5528
+      esac
5529
+      # Is there a better lt_prog_compiler_static that works with the bundled CC?
5530
+      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
5531
+      ;;
5532
+
5533
+    irix5* | irix6* | nonstopux*)
5534
+      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5535
+      # PIC (with -KPIC) is the default.
5536
+      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
5537
+      ;;
5538
+
5539
+    newsos6)
5540
+      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5541
+      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5542
+      ;;
5543
+
5544
+    linux* | k*bsd*-gnu)
5545
+      case $cc_basename in
5546
+      icc* | ecc*)
5547
+	_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5548
+	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5549
+	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
5550
+        ;;
5551
+      pgcc* | pgf77* | pgf90* | pgf95*)
5552
+        # Portland Group compilers (*not* the Pentium gcc compiler,
5553
+	# which looks to be a dead project)
5554
+	_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5555
+	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
5556
+	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5557
+        ;;
5558
+      ccc*)
5559
+        _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5560
+        # All Alpha code is PIC.
5561
+        _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
5562
+        ;;
5563
+      *)
5564
+        case `$CC -V 2>&1 | sed 5q` in
5565
+	*Sun\ C*)
5566
+	  # Sun C 5.9
5567
+	  _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5568
+	  _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5569
+	  _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5570
+	  ;;
5571
+	*Sun\ F*)
5572
+	  # Sun Fortran 8.3 passes all unrecognized flags to the linker
5573
+	  _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5574
+	  _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5575
+	  _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)=''
5576
+	  ;;
5577
+	esac
5578
+	;;
5579
+      esac
5580
+      ;;
5581
+
5582
+    osf3* | osf4* | osf5*)
5583
+      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5584
+      # All OSF/1 code is PIC.
5585
+      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
5586
+      ;;
5587
+
5588
+    rdos*)
5589
+      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
5590
+      ;;
5591
+
5592
+    solaris*)
5593
+      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5594
+      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5595
+      case $cc_basename in
5596
+      f77* | f90* | f95*)
5597
+	_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
5598
+      *)
5599
+	_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
5600
+      esac
5601
+      ;;
5602
+
5603
+    sunos4*)
5604
+      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
5605
+      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
5606
+      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5607
+      ;;
5608
+
5609
+    sysv4 | sysv4.2uw2* | sysv4.3*)
5610
+      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5611
+      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5612
+      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5613
+      ;;
5614
+
5615
+    sysv4*MP*)
5616
+      if test -d /usr/nec ;then
5617
+	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
5618
+	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5619
+      fi
5620
+      ;;
5621
+
5622
+    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
5623
+      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5624
+      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5625
+      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5626
+      ;;
5627
+
5628
+    unicos*)
5629
+      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5630
+      _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
5631
+      ;;
5632
+
5633
+    uts4*)
5634
+      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
5635
+      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5636
+      ;;
5637
+
5638
+    *)
5639
+      _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
5640
+      ;;
5641
+    esac
5642
+  fi
5643
+])
5644
+AC_MSG_RESULT([$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)])
5645
+
5646
+#
5647
+# Check to make sure the PIC flag actually works.
5648
+#
5649
+if test -n "$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)"; then
5650
+  AC_LIBTOOL_COMPILER_OPTION([if $compiler PIC flag $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) works],
5651
+    _LT_AC_TAGVAR(lt_cv_prog_compiler_pic_works, $1),
5652
+    [$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])], [],
5653
+    [case $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) in
5654
+     "" | " "*) ;;
5655
+     *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)" ;;
5656
+     esac],
5657
+    [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
5658
+     _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
5659
+fi
5660
+case $host_os in
5661
+  # For platforms which do not support PIC, -DPIC is meaningless:
5662
+  *djgpp*)
5663
+    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
5664
+    ;;
5665
+  *)
5666
+    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])"
5667
+    ;;
5668
+esac
5669
+
5670
+#
5671
+# Check to make sure the static flag actually works.
5672
+#
5673
+wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_AC_TAGVAR(lt_prog_compiler_static, $1)\"
5674
+AC_LIBTOOL_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],
5675
+  _LT_AC_TAGVAR(lt_cv_prog_compiler_static_works, $1),
5676
+  $lt_tmp_static_flag,
5677
+  [],
5678
+  [_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=])
5679
+])
5680
+
5681
+
5682
+# AC_LIBTOOL_PROG_LD_SHLIBS([TAGNAME])
5683
+# ------------------------------------
5684
+# See if the linker supports building shared libraries.
5685
+AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS],
5686
+[AC_REQUIRE([LT_AC_PROG_SED])dnl
5687
+AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
5688
+ifelse([$1],[CXX],[
5689
+  _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
5690
+  case $host_os in
5691
+  aix[[4-9]]*)
5692
+    # If we're using GNU nm, then we don't want the "-C" option.
5693
+    # -C means demangle to AIX nm, but means don't demangle with GNU nm
5694
+    if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
5695
+      _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'
5696
+    else
5697
+      _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'
5698
+    fi
5699
+    ;;
5700
+  pw32*)
5701
+    _LT_AC_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
5702
+  ;;
5703
+  cygwin* | mingw*)
5704
+    _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'
5705
+  ;;
5706
+  linux* | k*bsd*-gnu)
5707
+    _LT_AC_TAGVAR(link_all_deplibs, $1)=no
5708
+  ;;
5709
+  *)
5710
+    _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
5711
+  ;;
5712
+  esac
5713
+  _LT_AC_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
5714
+],[
5715
+  runpath_var=
5716
+  _LT_AC_TAGVAR(allow_undefined_flag, $1)=
5717
+  _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no
5718
+  _LT_AC_TAGVAR(archive_cmds, $1)=
5719
+  _LT_AC_TAGVAR(archive_expsym_cmds, $1)=
5720
+  _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)=
5721
+  _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)=
5722
+  _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
5723
+  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
5724
+  _LT_AC_TAGVAR(thread_safe_flag_spec, $1)=
5725
+  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
5726
+  _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
5727
+  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
5728
+  _LT_AC_TAGVAR(hardcode_direct, $1)=no
5729
+  _LT_AC_TAGVAR(hardcode_minus_L, $1)=no
5730
+  _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
5731
+  _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
5732
+  _LT_AC_TAGVAR(hardcode_automatic, $1)=no
5733
+  _LT_AC_TAGVAR(module_cmds, $1)=
5734
+  _LT_AC_TAGVAR(module_expsym_cmds, $1)=
5735
+  _LT_AC_TAGVAR(always_export_symbols, $1)=no
5736
+  _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
5737
+  # include_expsyms should be a list of space-separated symbols to be *always*
5738
+  # included in the symbol list
5739
+  _LT_AC_TAGVAR(include_expsyms, $1)=
5740
+  # exclude_expsyms can be an extended regexp of symbols to exclude
5741
+  # it will be wrapped by ` (' and `)$', so one must not match beginning or
5742
+  # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
5743
+  # as well as any symbol that contains `d'.
5744
+  _LT_AC_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
5745
+  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
5746
+  # platforms (ab)use it in PIC code, but their linkers get confused if
5747
+  # the symbol is explicitly referenced.  Since portable code cannot
5748
+  # rely on this symbol name, it's probably fine to never include it in
5749
+  # preloaded symbol tables.
5750
+  # Exclude shared library initialization/finalization symbols.
5751
+dnl Note also adjust exclude_expsyms for C++ above.
5752
+  extract_expsyms_cmds=
5753
+  # Just being paranoid about ensuring that cc_basename is set.
5754
+  _LT_CC_BASENAME([$compiler])
5755
+  case $host_os in
5756
+  cygwin* | mingw* | pw32*)
5757
+    # FIXME: the MSVC++ port hasn't been tested in a loooong time
5758
+    # When not using gcc, we currently assume that we are using
5759
+    # Microsoft Visual C++.
5760
+    if test "$GCC" != yes; then
5761
+      with_gnu_ld=no
5762
+    fi
5763
+    ;;
5764
+  interix*)
5765
+    # we just hope/assume this is gcc and not c89 (= MSVC++)
5766
+    with_gnu_ld=yes
5767
+    ;;
5768
+  openbsd*)
5769
+    with_gnu_ld=no
5770
+    ;;
5771
+  esac
5772
+
5773
+  _LT_AC_TAGVAR(ld_shlibs, $1)=yes
5774
+  if test "$with_gnu_ld" = yes; then
5775
+    # If archive_cmds runs LD, not CC, wlarc should be empty
5776
+    wlarc='${wl}'
5777
+
5778
+    # Set some defaults for GNU ld with shared library support. These
5779
+    # are reset later if shared libraries are not supported. Putting them
5780
+    # here allows them to be overridden if necessary.
5781
+    runpath_var=LD_RUN_PATH
5782
+    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
5783
+    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
5784
+    # ancient GNU ld didn't support --whole-archive et. al.
5785
+    if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then
5786
+	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
5787
+      else
5788
+  	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
5789
+    fi
5790
+    supports_anon_versioning=no
5791
+    case `$LD -v 2>/dev/null` in
5792
+      *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
5793
+      *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
5794
+      *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
5795
+      *\ 2.11.*) ;; # other 2.11 versions
5796
+      *) supports_anon_versioning=yes ;;
5797
+    esac
5798
+
5799
+    # See if GNU ld supports shared libraries.
5800
+    case $host_os in
5801
+    aix[[3-9]]*)
5802
+      # On AIX/PPC, the GNU linker is very broken
5803
+      if test "$host_cpu" != ia64; then
5804
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
5805
+	cat <<EOF 1>&2
5806
+
5807
+*** Warning: the GNU linker, at least up to release 2.9.1, is reported
5808
+*** to be unable to reliably create shared libraries on AIX.
5809
+*** Therefore, libtool is disabling shared libraries support.  If you
5810
+*** really care for shared libraries, you may want to modify your PATH
5811
+*** so that a non-GNU linker is found, and then restart.
5812
+
5813
+EOF
5814
+      fi
5815
+      ;;
5816
+
5817
+    amigaos*)
5818
+      _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)'
5819
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5820
+      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
5821
+
5822
+      # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
5823
+      # that the semantics of dynamic libraries on AmigaOS, at least up
5824
+      # to version 4, is to share data among multiple programs linked
5825
+      # with the same dynamic library.  Since this doesn't match the
5826
+      # behavior of shared libraries on other platforms, we can't use
5827
+      # them.
5828
+      _LT_AC_TAGVAR(ld_shlibs, $1)=no
5829
+      ;;
5830
+
5831
+    beos*)
5832
+      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
5833
+	_LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
5834
+	# Joseph Beckenbach <jrb3@best.com> says some releases of gcc
5835
+	# support --undefined.  This deserves some investigation.  FIXME
5836
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5837
+      else
5838
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
5839
+      fi
5840
+      ;;
5841
+
5842
+    cygwin* | mingw* | pw32*)
5843
+      # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
5844
+      # as there is no search path for DLLs.
5845
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5846
+      _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
5847
+      _LT_AC_TAGVAR(always_export_symbols, $1)=no
5848
+      _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
5849
+      _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'
5850
+
5851
+      if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
5852
+        _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'
5853
+	# If the export-symbols file already is a .def file (1st line
5854
+	# is EXPORTS), use it as is; otherwise, prepend...
5855
+	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
5856
+	  cp $export_symbols $output_objdir/$soname.def;
5857
+	else
5858
+	  echo EXPORTS > $output_objdir/$soname.def;
5859
+	  cat $export_symbols >> $output_objdir/$soname.def;
5860
+	fi~
5861
+	$CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
5862
+      else
5863
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
5864
+      fi
5865
+      ;;
5866
+
5867
+    interix[[3-9]]*)
5868
+      _LT_AC_TAGVAR(hardcode_direct, $1)=no
5869
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
5870
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
5871
+      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
5872
+      # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
5873
+      # Instead, shared libraries are loaded at an image base (0x10000000 by
5874
+      # default) and relocated if they conflict, which is a slow very memory
5875
+      # consuming and fragmenting process.  To avoid this, we pick a random,
5876
+      # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
5877
+      # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
5878
+      _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'
5879
+      _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'
5880
+      ;;
5881
+
5882
+    gnu* | linux* | k*bsd*-gnu)
5883
+      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
5884
+	tmp_addflag=
5885
+	case $cc_basename,$host_cpu in
5886
+	pgcc*)				# Portland Group C compiler
5887
+	  _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'
5888
+	  tmp_addflag=' $pic_flag'
5889
+	  ;;
5890
+	pgf77* | pgf90* | pgf95*)	# Portland Group f77 and f90 compilers
5891
+	  _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'
5892
+	  tmp_addflag=' $pic_flag -Mnomain' ;;
5893
+	ecc*,ia64* | icc*,ia64*)		# Intel C compiler on ia64
5894
+	  tmp_addflag=' -i_dynamic' ;;
5895
+	efc*,ia64* | ifort*,ia64*)	# Intel Fortran compiler on ia64
5896
+	  tmp_addflag=' -i_dynamic -nofor_main' ;;
5897
+	ifc* | ifort*)			# Intel Fortran compiler
5898
+	  tmp_addflag=' -nofor_main' ;;
5899
+	esac
5900
+	case `$CC -V 2>&1 | sed 5q` in
5901
+	*Sun\ C*)			# Sun C 5.9
5902
+	  _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'
5903
+	  tmp_sharedflag='-G' ;;
5904
+	*Sun\ F*)			# Sun Fortran 8.3
5905
+	  tmp_sharedflag='-G' ;;
5906
+	*)
5907
+	  tmp_sharedflag='-shared' ;;
5908
+	esac
5909
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5910
+
5911
+	if test $supports_anon_versioning = yes; then
5912
+	  _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $output_objdir/$libname.ver~
5913
+  cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
5914
+  $echo "local: *; };" >> $output_objdir/$libname.ver~
5915
+	  $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
5916
+	fi
5917
+	_LT_AC_TAGVAR(link_all_deplibs, $1)=no
5918
+      else
5919
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
5920
+      fi
5921
+      ;;
5922
+
5923
+    netbsd* | netbsdelf*-gnu)
5924
+      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
5925
+	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
5926
+	wlarc=
5927
+      else
5928
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5929
+	_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'
5930
+      fi
5931
+      ;;
5932
+
5933
+    solaris*)
5934
+      if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
5935
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
5936
+	cat <<EOF 1>&2
5937
+
5938
+*** Warning: The releases 2.8.* of the GNU linker cannot reliably
5939
+*** create shared libraries on Solaris systems.  Therefore, libtool
5940
+*** is disabling shared libraries support.  We urge you to upgrade GNU
5941
+*** binutils to release 2.9.1 or newer.  Another option is to modify
5942
+*** your PATH or compiler configuration so that the native linker is
5943
+*** used, and then restart.
5944
+
5945
+EOF
5946
+      elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
5947
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5948
+	_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'
5949
+      else
5950
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
5951
+      fi
5952
+      ;;
5953
+
5954
+    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
5955
+      case `$LD -v 2>&1` in
5956
+        *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*)
5957
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
5958
+	cat <<_LT_EOF 1>&2
5959
+
5960
+*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
5961
+*** reliably create shared libraries on SCO systems.  Therefore, libtool
5962
+*** is disabling shared libraries support.  We urge you to upgrade GNU
5963
+*** binutils to release 2.16.91.0.3 or newer.  Another option is to modify
5964
+*** your PATH or compiler configuration so that the native linker is
5965
+*** used, and then restart.
5966
+
5967
+_LT_EOF
5968
+	;;
5969
+	*)
5970
+	  if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
5971
+	    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`'
5972
+	    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib'
5973
+	    _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'
5974
+	  else
5975
+	    _LT_AC_TAGVAR(ld_shlibs, $1)=no
5976
+	  fi
5977
+	;;
5978
+      esac
5979
+      ;;
5980
+
5981
+    sunos4*)
5982
+      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
5983
+      wlarc=
5984
+      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
5985
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
5986
+      ;;
5987
+
5988
+    *)
5989
+      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
5990
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5991
+	_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'
5992
+      else
5993
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
5994
+      fi
5995
+      ;;
5996
+    esac
5997
+
5998
+    if test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no; then
5999
+      runpath_var=
6000
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
6001
+      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
6002
+      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
6003
+    fi
6004
+  else
6005
+    # PORTME fill in a description of your system's linker (not GNU ld)
6006
+    case $host_os in
6007
+    aix3*)
6008
+      _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
6009
+      _LT_AC_TAGVAR(always_export_symbols, $1)=yes
6010
+      _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'
6011
+      # Note: this linker hardcodes the directories in LIBPATH if there
6012
+      # are no directories specified by -L.
6013
+      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
6014
+      if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
6015
+	# Neither direct hardcoding nor static linking is supported with a
6016
+	# broken collect2.
6017
+	_LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
6018
+      fi
6019
+      ;;
6020
+
6021
+    aix[[4-9]]*)
6022
+      if test "$host_cpu" = ia64; then
6023
+	# On IA64, the linker does run time linking by default, so we don't
6024
+	# have to do anything special.
6025
+	aix_use_runtimelinking=no
6026
+	exp_sym_flag='-Bexport'
6027
+	no_entry_flag=""
6028
+      else
6029
+	# If we're using GNU nm, then we don't want the "-C" option.
6030
+	# -C means demangle to AIX nm, but means don't demangle with GNU nm
6031
+	if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
6032
+	  _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'
6033
+	else
6034
+	  _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'
6035
+	fi
6036
+	aix_use_runtimelinking=no
6037
+
6038
+	# Test if we are trying to use run time linking or normal
6039
+	# AIX style linking. If -brtl is somewhere in LDFLAGS, we
6040
+	# need to do runtime linking.
6041
+	case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
6042
+	  for ld_flag in $LDFLAGS; do
6043
+  	  if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
6044
+  	    aix_use_runtimelinking=yes
6045
+  	    break
6046
+  	  fi
6047
+	  done
6048
+	  ;;
6049
+	esac
6050
+
6051
+	exp_sym_flag='-bexport'
6052
+	no_entry_flag='-bnoentry'
6053
+      fi
6054
+
6055
+      # When large executables or shared objects are built, AIX ld can
6056
+      # have problems creating the table of contents.  If linking a library
6057
+      # or program results in "error TOC overflow" add -mminimal-toc to
6058
+      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
6059
+      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
6060
+
6061
+      _LT_AC_TAGVAR(archive_cmds, $1)=''
6062
+      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
6063
+      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
6064
+      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
6065
+
6066
+      if test "$GCC" = yes; then
6067
+	case $host_os in aix4.[[012]]|aix4.[[012]].*)
6068
+	# We only want to do this on AIX 4.2 and lower, the check
6069
+	# below for broken collect2 doesn't work under 4.3+
6070
+	  collect2name=`${CC} -print-prog-name=collect2`
6071
+	  if test -f "$collect2name" && \
6072
+  	   strings "$collect2name" | grep resolve_lib_name >/dev/null
6073
+	  then
6074
+  	  # We have reworked collect2
6075
+  	  :
6076
+	  else
6077
+  	  # We have old collect2
6078
+  	  _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
6079
+  	  # It fails to find uninstalled libraries when the uninstalled
6080
+  	  # path is not listed in the libpath.  Setting hardcode_minus_L
6081
+  	  # to unsupported forces relinking
6082
+  	  _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
6083
+  	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6084
+  	  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
6085
+	  fi
6086
+	  ;;
6087
+	esac
6088
+	shared_flag='-shared'
6089
+	if test "$aix_use_runtimelinking" = yes; then
6090
+	  shared_flag="$shared_flag "'${wl}-G'
6091
+	fi
6092
+      else
6093
+	# not using gcc
6094
+	if test "$host_cpu" = ia64; then
6095
+  	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
6096
+  	# chokes on -Wl,-G. The following line is correct:
6097
+	  shared_flag='-G'
6098
+	else
6099
+	  if test "$aix_use_runtimelinking" = yes; then
6100
+	    shared_flag='${wl}-G'
6101
+	  else
6102
+	    shared_flag='${wl}-bM:SRE'
6103
+	  fi
6104
+	fi
6105
+      fi
6106
+
6107
+      # It seems that -bexpall does not export symbols beginning with
6108
+      # underscore (_), so it is better to generate a list of symbols to export.
6109
+      _LT_AC_TAGVAR(always_export_symbols, $1)=yes
6110
+      if test "$aix_use_runtimelinking" = yes; then
6111
+	# Warning - without using the other runtime loading flags (-brtl),
6112
+	# -berok will link without error, but may produce a broken library.
6113
+	_LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok'
6114
+       # Determine the default libpath from the value encoded in an empty executable.
6115
+       _LT_AC_SYS_LIBPATH_AIX
6116
+       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
6117
+	_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"
6118
+       else
6119
+	if test "$host_cpu" = ia64; then
6120
+	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
6121
+	  _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
6122
+	  _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"
6123
+	else
6124
+	 # Determine the default libpath from the value encoded in an empty executable.
6125
+	 _LT_AC_SYS_LIBPATH_AIX
6126
+	 _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
6127
+	  # Warning - without using the other run time loading flags,
6128
+	  # -berok will link without error, but may produce a broken library.
6129
+	  _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
6130
+	  _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
6131
+	  # Exported symbols can be pulled into shared objects from archives
6132
+	  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
6133
+	  _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
6134
+	  # This is similar to how AIX traditionally builds its shared libraries.
6135
+	  _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'
6136
+	fi
6137
+      fi
6138
+      ;;
6139
+
6140
+    amigaos*)
6141
+      _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)'
6142
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6143
+      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
6144
+      # see comment about different semantics on the GNU ld section
6145
+      _LT_AC_TAGVAR(ld_shlibs, $1)=no
6146
+      ;;
6147
+
6148
+    bsdi[[45]]*)
6149
+      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
6150
+      ;;
6151
+
6152
+    cygwin* | mingw* | pw32*)
6153
+      # When not using gcc, we currently assume that we are using
6154
+      # Microsoft Visual C++.
6155
+      # hardcode_libdir_flag_spec is actually meaningless, as there is
6156
+      # no search path for DLLs.
6157
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
6158
+      _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
6159
+      # Tell ltmain to make .lib files, not .a files.
6160
+      libext=lib
6161
+      # Tell ltmain to make .dll files, not .so files.
6162
+      shrext_cmds=".dll"
6163
+      # FIXME: Setting linknames here is a bad hack.
6164
+      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames='
6165
+      # The linker will automatically build a .lib file if we build a DLL.
6166
+      _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='true'
6167
+      # FIXME: Should let the user specify the lib program.
6168
+      _LT_AC_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
6169
+      _LT_AC_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`'
6170
+      _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
6171
+      ;;
6172
+
6173
+    darwin* | rhapsody*)
6174
+      case $host_os in
6175
+        rhapsody* | darwin1.[[012]])
6176
+         _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress'
6177
+         ;;
6178
+       *) # Darwin 1.3 on
6179
+         if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
6180
+           _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
6181
+         else
6182
+           case ${MACOSX_DEPLOYMENT_TARGET} in
6183
+             10.[[012]])
6184
+               _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
6185
+               ;;
6186
+             10.*)
6187
+               _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup'
6188
+               ;;
6189
+           esac
6190
+         fi
6191
+         ;;
6192
+      esac
6193
+      _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
6194
+      _LT_AC_TAGVAR(hardcode_direct, $1)=no
6195
+      _LT_AC_TAGVAR(hardcode_automatic, $1)=yes
6196
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
6197
+      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=''
6198
+      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
6199
+    if test "$GCC" = yes ; then
6200
+    	output_verbose_link_cmd='echo'
6201
+        _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}"
6202
+        _LT_AC_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
6203
+        _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}"
6204
+        _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}"
6205
+    else
6206
+      case $cc_basename in
6207
+        xlc*)
6208
+         output_verbose_link_cmd='echo'
6209
+         _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'
6210
+         _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
6211
+          # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
6212
+         _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}'
6213
+          _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}'
6214
+          ;;
6215
+       *)
6216
+         _LT_AC_TAGVAR(ld_shlibs, $1)=no
6217
+          ;;
6218
+      esac
6219
+    fi
6220
+      ;;
6221
+
6222
+    dgux*)
6223
+      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6224
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6225
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
6226
+      ;;
6227
+
6228
+    freebsd1*)
6229
+      _LT_AC_TAGVAR(ld_shlibs, $1)=no
6230
+      ;;
6231
+
6232
+    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
6233
+    # support.  Future versions do this automatically, but an explicit c++rt0.o
6234
+    # does not break anything, and helps significantly (at the cost of a little
6235
+    # extra space).
6236
+    freebsd2.2*)
6237
+      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
6238
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
6239
+      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
6240
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
6241
+      ;;
6242
+
6243
+    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
6244
+    freebsd2*)
6245
+      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
6246
+      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
6247
+      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
6248
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
6249
+      ;;
6250
+
6251
+    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
6252
+    freebsd* | dragonfly*)
6253
+      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
6254
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
6255
+      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
6256
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
6257
+      ;;
6258
+
6259
+    hpux9*)
6260
+      if test "$GCC" = yes; then
6261
+	_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'
6262
+      else
6263
+	_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'
6264
+      fi
6265
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
6266
+      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
6267
+      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
6268
+
6269
+      # hardcode_minus_L: Not really in the search PATH,
6270
+      # but as the default location of the library.
6271
+      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
6272
+      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
6273
+      ;;
6274
+
6275
+    hpux10*)
6276
+      if test "$GCC" = yes -a "$with_gnu_ld" = no; then
6277
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
6278
+      else
6279
+	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
6280
+      fi
6281
+      if test "$with_gnu_ld" = no; then
6282
+	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
6283
+	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
6284
+
6285
+	_LT_AC_TAGVAR(hardcode_direct, $1)=yes
6286
+	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
6287
+
6288
+	# hardcode_minus_L: Not really in the search PATH,
6289
+	# but as the default location of the library.
6290
+	_LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
6291
+      fi
6292
+      ;;
6293
+
6294
+    hpux11*)
6295
+      if test "$GCC" = yes -a "$with_gnu_ld" = no; then
6296
+	case $host_cpu in
6297
+	hppa*64*)
6298
+	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
6299
+	  ;;
6300
+	ia64*)
6301
+	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
6302
+	  ;;
6303
+	*)
6304
+	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
6305
+	  ;;
6306
+	esac
6307
+      else
6308
+	case $host_cpu in
6309
+	hppa*64*)
6310
+	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
6311
+	  ;;
6312
+	ia64*)
6313
+	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
6314
+	  ;;
6315
+	*)
6316
+	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
6317
+	  ;;
6318
+	esac
6319
+      fi
6320
+      if test "$with_gnu_ld" = no; then
6321
+	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
6322
+	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
6323
+
6324
+	case $host_cpu in
6325
+	hppa*64*|ia64*)
6326
+	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
6327
+	  _LT_AC_TAGVAR(hardcode_direct, $1)=no
6328
+	  _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
6329
+	  ;;
6330
+	*)
6331
+	  _LT_AC_TAGVAR(hardcode_direct, $1)=yes
6332
+	  _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
6333
+
6334
+	  # hardcode_minus_L: Not really in the search PATH,
6335
+	  # but as the default location of the library.
6336
+	  _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
6337
+	  ;;
6338
+	esac
6339
+      fi
6340
+      ;;
6341
+
6342
+    irix5* | irix6* | nonstopux*)
6343
+      if test "$GCC" = yes; then
6344
+	_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'
6345
+      else
6346
+	_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'
6347
+	_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir'
6348
+      fi
6349
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
6350
+      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
6351
+      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
6352
+      ;;
6353
+
6354
+    netbsd* | netbsdelf*-gnu)
6355
+      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
6356
+	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
6357
+      else
6358
+	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
6359
+      fi
6360
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
6361
+      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
6362
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
6363
+      ;;
6364
+
6365
+    newsos6)
6366
+      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6367
+      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
6368
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
6369
+      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
6370
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
6371
+      ;;
6372
+
6373
+    openbsd*)
6374
+      if test -f /usr/libexec/ld.so; then
6375
+	_LT_AC_TAGVAR(hardcode_direct, $1)=yes
6376
+	_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
6377
+	if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
6378
+	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
6379
+	  _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
6380
+	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
6381
+	  _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
6382
+	else
6383
+	  case $host_os in
6384
+	   openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
6385
+	     _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
6386
+	     _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
6387
+	     ;;
6388
+	   *)
6389
+	     _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
6390
+	     _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
6391
+	     ;;
6392
+	  esac
6393
+        fi
6394
+      else
6395
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
6396
+      fi
6397
+      ;;
6398
+
6399
+    os2*)
6400
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6401
+      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
6402
+      _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
6403
+      _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'
6404
+      _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
6405
+      ;;
6406
+
6407
+    osf3*)
6408
+      if test "$GCC" = yes; then
6409
+	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
6410
+	_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'
6411
+      else
6412
+	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
6413
+	_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'
6414
+      fi
6415
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
6416
+      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
6417
+      ;;
6418
+
6419
+    osf4* | osf5*)	# as osf3* with the addition of -msym flag
6420
+      if test "$GCC" = yes; then
6421
+	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
6422
+	_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'
6423
+	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
6424
+      else
6425
+	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
6426
+	_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'
6427
+	_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~
6428
+	$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'
6429
+
6430
+	# Both c and cxx compiler support -rpath directly
6431
+	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
6432
+      fi
6433
+      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
6434
+      ;;
6435
+
6436
+    solaris*)
6437
+      _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text'
6438
+      if test "$GCC" = yes; then
6439
+	wlarc='${wl}'
6440
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
6441
+	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
6442
+	  $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp'
6443
+      else
6444
+	wlarc=''
6445
+	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
6446
+	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
6447
+  	$LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
6448
+      fi
6449
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
6450
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
6451
+      case $host_os in
6452
+      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
6453
+      *)
6454
+	# The compiler driver will combine and reorder linker options,
6455
+	# but understands `-z linker_flag'.  GCC discards it without `$wl',
6456
+	# but is careful enough not to reorder.
6457
+ 	# Supported since Solaris 2.6 (maybe 2.5.1?)
6458
+	if test "$GCC" = yes; then
6459
+	  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
6460
+	else
6461
+	  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
6462
+	fi
6463
+	;;
6464
+      esac
6465
+      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
6466
+      ;;
6467
+
6468
+    sunos4*)
6469
+      if test "x$host_vendor" = xsequent; then
6470
+	# Use $CC to link under sequent, because it throws in some extra .o
6471
+	# files that make .init and .fini sections work.
6472
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
6473
+      else
6474
+	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
6475
+      fi
6476
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6477
+      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
6478
+      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
6479
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
6480
+      ;;
6481
+
6482
+    sysv4)
6483
+      case $host_vendor in
6484
+	sni)
6485
+	  _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6486
+	  _LT_AC_TAGVAR(hardcode_direct, $1)=yes # is this really true???
6487
+	;;
6488
+	siemens)
6489
+	  ## LD is ld it makes a PLAMLIB
6490
+	  ## CC just makes a GrossModule.
6491
+	  _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
6492
+	  _LT_AC_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
6493
+	  _LT_AC_TAGVAR(hardcode_direct, $1)=no
6494
+        ;;
6495
+	motorola)
6496
+	  _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6497
+	  _LT_AC_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
6498
+	;;
6499
+      esac
6500
+      runpath_var='LD_RUN_PATH'
6501
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
6502
+      ;;
6503
+
6504
+    sysv4.3*)
6505
+      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6506
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
6507
+      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
6508
+      ;;
6509
+
6510
+    sysv4*MP*)
6511
+      if test -d /usr/nec; then
6512
+	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6513
+	_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
6514
+	runpath_var=LD_RUN_PATH
6515
+	hardcode_runpath_var=yes
6516
+	_LT_AC_TAGVAR(ld_shlibs, $1)=yes
6517
+      fi
6518
+      ;;
6519
+
6520
+    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
6521
+      _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
6522
+      _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
6523
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
6524
+      runpath_var='LD_RUN_PATH'
6525
+
6526
+      if test "$GCC" = yes; then
6527
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6528
+	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6529
+      else
6530
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6531
+	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6532
+      fi
6533
+      ;;
6534
+
6535
+    sysv5* | sco3.2v5* | sco5v6*)
6536
+      # Note: We can NOT use -z defs as we might desire, because we do not
6537
+      # link with -lc, and that would cause any symbols used from libc to
6538
+      # always be unresolved, which means just about no library would
6539
+      # ever link correctly.  If we're not using GNU ld we use -z text
6540
+      # though, which does catch some bad symbols but isn't as heavy-handed
6541
+      # as -z defs.
6542
+      _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
6543
+      _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
6544
+      _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
6545
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
6546
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
6547
+      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
6548
+      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
6549
+      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
6550
+      runpath_var='LD_RUN_PATH'
6551
+
6552
+      if test "$GCC" = yes; then
6553
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
6554
+	_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'
6555
+      else
6556
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
6557
+	_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'
6558
+      fi
6559
+      ;;
6560
+
6561
+    uts4*)
6562
+      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6563
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6564
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
6565
+      ;;
6566
+
6567
+    *)
6568
+      _LT_AC_TAGVAR(ld_shlibs, $1)=no
6569
+      ;;
6570
+    esac
6571
+  fi
6572
+])
6573
+AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)])
6574
+test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
6575
+
6576
+#
6577
+# Do we need to explicitly link libc?
6578
+#
6579
+case "x$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)" in
6580
+x|xyes)
6581
+  # Assume -lc should be added
6582
+  _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
6583
+
6584
+  if test "$enable_shared" = yes && test "$GCC" = yes; then
6585
+    case $_LT_AC_TAGVAR(archive_cmds, $1) in
6586
+    *'~'*)
6587
+      # FIXME: we may have to deal with multi-command sequences.
6588
+      ;;
6589
+    '$CC '*)
6590
+      # Test whether the compiler implicitly links with -lc since on some
6591
+      # systems, -lgcc has to come before -lc. If gcc already passes -lc
6592
+      # to ld, don't add -lc before -lgcc.
6593
+      AC_MSG_CHECKING([whether -lc should be explicitly linked in])
6594
+      $rm conftest*
6595
+      echo "$lt_simple_compile_test_code" > conftest.$ac_ext
6596
+
6597
+      if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
6598
+        soname=conftest
6599
+        lib=conftest
6600
+        libobjs=conftest.$ac_objext
6601
+        deplibs=
6602
+        wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)
6603
+	pic_flag=$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)
6604
+        compiler_flags=-v
6605
+        linker_flags=-v
6606
+        verstring=
6607
+        output_objdir=.
6608
+        libname=conftest
6609
+        lt_save_allow_undefined_flag=$_LT_AC_TAGVAR(allow_undefined_flag, $1)
6610
+        _LT_AC_TAGVAR(allow_undefined_flag, $1)=
6611
+        if AC_TRY_EVAL(_LT_AC_TAGVAR(archive_cmds, $1) 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1)
6612
+        then
6613
+	  _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
6614
+        else
6615
+	  _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
6616
+        fi
6617
+        _LT_AC_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
6618
+      else
6619
+        cat conftest.err 1>&5
6620
+      fi
6621
+      $rm conftest*
6622
+      AC_MSG_RESULT([$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)])
6623
+      ;;
6624
+    esac
6625
+  fi
6626
+  ;;
6627
+esac
6628
+])# AC_LIBTOOL_PROG_LD_SHLIBS
6629
+
6630
+
6631
+# _LT_AC_FILE_LTDLL_C
6632
+# -------------------
6633
+# Be careful that the start marker always follows a newline.
6634
+AC_DEFUN([_LT_AC_FILE_LTDLL_C], [
6635
+# /* ltdll.c starts here */
6636
+# #define WIN32_LEAN_AND_MEAN
6637
+# #include <windows.h>
6638
+# #undef WIN32_LEAN_AND_MEAN
6639
+# #include <stdio.h>
6640
+#
6641
+# #ifndef __CYGWIN__
6642
+# #  ifdef __CYGWIN32__
6643
+# #    define __CYGWIN__ __CYGWIN32__
6644
+# #  endif
6645
+# #endif
6646
+#
6647
+# #ifdef __cplusplus
6648
+# extern "C" {
6649
+# #endif
6650
+# BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved);
6651
+# #ifdef __cplusplus
6652
+# }
6653
+# #endif
6654
+#
6655
+# #ifdef __CYGWIN__
6656
+# #include <cygwin/cygwin_dll.h>
6657
+# DECLARE_CYGWIN_DLL( DllMain );
6658
+# #endif
6659
+# HINSTANCE __hDllInstance_base;
6660
+#
6661
+# BOOL APIENTRY
6662
+# DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved)
6663
+# {
6664
+#   __hDllInstance_base = hInst;
6665
+#   return TRUE;
6666
+# }
6667
+# /* ltdll.c ends here */
6668
+])# _LT_AC_FILE_LTDLL_C
6669
+
6670
+
6671
+# _LT_AC_TAGVAR(VARNAME, [TAGNAME])
6672
+# ---------------------------------
6673
+AC_DEFUN([_LT_AC_TAGVAR], [ifelse([$2], [], [$1], [$1_$2])])
6674
+
6675
+
6676
+# old names
6677
+AC_DEFUN([AM_PROG_LIBTOOL],   [AC_PROG_LIBTOOL])
6678
+AC_DEFUN([AM_ENABLE_SHARED],  [AC_ENABLE_SHARED($@)])
6679
+AC_DEFUN([AM_ENABLE_STATIC],  [AC_ENABLE_STATIC($@)])
6680
+AC_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
6681
+AC_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
6682
+AC_DEFUN([AM_PROG_LD],        [AC_PROG_LD])
6683
+AC_DEFUN([AM_PROG_NM],        [AC_PROG_NM])
6684
+
6685
+# This is just to silence aclocal about the macro not being used
6686
+ifelse([AC_DISABLE_FAST_INSTALL])
6687
+
6688
+AC_DEFUN([LT_AC_PROG_GCJ],
6689
+[AC_CHECK_TOOL(GCJ, gcj, no)
6690
+  test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
6691
+  AC_SUBST(GCJFLAGS)
6692
+])
6693
+
6694
+AC_DEFUN([LT_AC_PROG_RC],
6695
+[AC_CHECK_TOOL(RC, windres, no)
6696
+])
6697
+
6698
+
6699
+# Cheap backport of AS_EXECUTABLE_P and required macros
6700
+# from Autoconf 2.59; we should not use $as_executable_p directly.
6701
+
6702
+# _AS_TEST_PREPARE
6703
+# ----------------
6704
+m4_ifndef([_AS_TEST_PREPARE],
6705
+[m4_defun([_AS_TEST_PREPARE],
6706
+[if test -x / >/dev/null 2>&1; then
6707
+  as_executable_p='test -x'
6708
+else
6709
+  as_executable_p='test -f'
6710
+fi
6711
+])])# _AS_TEST_PREPARE
6712
+
6713
+# AS_EXECUTABLE_P
6714
+# ---------------
6715
+# Check whether a file is executable.
6716
+m4_ifndef([AS_EXECUTABLE_P],
6717
+[m4_defun([AS_EXECUTABLE_P],
6718
+[AS_REQUIRE([_AS_TEST_PREPARE])dnl
6719
+$as_executable_p $1[]dnl
6720
+])])# AS_EXECUTABLE_P
6721
+
6722
+# NOTE: This macro has been submitted for inclusion into   #
6723
+#  GNU Autoconf as AC_PROG_SED.  When it is available in   #
6724
+#  a released version of Autoconf we should remove this    #
6725
+#  macro and use it instead.                               #
6726
+# LT_AC_PROG_SED
6727
+# --------------
6728
+# Check for a fully-functional sed program, that truncates
6729
+# as few characters as possible.  Prefer GNU sed if found.
6730
+AC_DEFUN([LT_AC_PROG_SED],
6731
+[AC_MSG_CHECKING([for a sed that does not truncate output])
6732
+AC_CACHE_VAL(lt_cv_path_SED,
6733
+[# Loop through the user's path and test for sed and gsed.
6734
+# Then use that list of sed's as ones to test for truncation.
6735
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6736
+for as_dir in $PATH
6737
+do
6738
+  IFS=$as_save_IFS
6739
+  test -z "$as_dir" && as_dir=.
6740
+  for lt_ac_prog in sed gsed; do
6741
+    for ac_exec_ext in '' $ac_executable_extensions; do
6742
+      if AS_EXECUTABLE_P(["$as_dir/$lt_ac_prog$ac_exec_ext"]); then
6743
+        lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
6744
+      fi
6745
+    done
6746
+  done
6747
+done
6748
+IFS=$as_save_IFS
6749
+lt_ac_max=0
6750
+lt_ac_count=0
6751
+# Add /usr/xpg4/bin/sed as it is typically found on Solaris
6752
+# along with /bin/sed that truncates output.
6753
+for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
6754
+  test ! -f $lt_ac_sed && continue
6755
+  cat /dev/null > conftest.in
6756
+  lt_ac_count=0
6757
+  echo $ECHO_N "0123456789$ECHO_C" >conftest.in
6758
+  # Check for GNU sed and select it if it is found.
6759
+  if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
6760
+    lt_cv_path_SED=$lt_ac_sed
6761
+    break
6762
+  fi
6763
+  while true; do
6764
+    cat conftest.in conftest.in >conftest.tmp
6765
+    mv conftest.tmp conftest.in
6766
+    cp conftest.in conftest.nl
6767
+    echo >>conftest.nl
6768
+    $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
6769
+    cmp -s conftest.out conftest.nl || break
6770
+    # 10000 chars as input seems more than enough
6771
+    test $lt_ac_count -gt 10 && break
6772
+    lt_ac_count=`expr $lt_ac_count + 1`
6773
+    if test $lt_ac_count -gt $lt_ac_max; then
6774
+      lt_ac_max=$lt_ac_count
6775
+      lt_cv_path_SED=$lt_ac_sed
6776
+    fi
6777
+  done
6778
+done
6779
+])
6780
+SED=$lt_cv_path_SED
6781
+AC_SUBST([SED])
6782
+AC_MSG_RESULT([$SED])
6783
+])
6784
+
133 6785
 # Copyright (C) 2002, 2003, 2005, 2006, 2007  Free Software Foundation, Inc.
134 6786
 #
135 6787
 # This file is free software; the Free Software Foundation
... ...
@@ -1,5 +1,8 @@
1 1
 /* clamav-config.h.in.  Generated from configure.in by autoheader.  */
2 2
 
3
+/* mmap flag for anonymous maps */
4
+#undef ANONYMOUS_MAP
5
+
3 6
 /* enable bind8 compatibility */
4 7
 #undef BIND_8_COMPAT
5 8
 
... ...
@@ -371,12 +374,18 @@
371 371
 /* The number of bytes in type short */
372 372
 #undef SIZEOF_SHORT
373 373
 
374
+/* The number of bytes in type void * */
375
+#undef SIZEOF_VOID_P
376
+
374 377
 /* Define to 1 if you have the ANSI C header files. */
375 378
 #undef STDC_HEADERS
376 379
 
377 380
 /* Support for IPv6 */
378 381
 #undef SUPPORT_IPv6
379 382
 
383
+/* enable memory pools */
384
+#undef USE_MPOOL
385
+
380 386
 /* use syslog */
381 387
 #undef USE_SYSLOG
382 388
 
... ...
@@ -1517,6 +1517,7 @@ Optional Features:
1517 1517
   --disable-libtool-lock  avoid locking (might break parallel builds)
1518 1518
   --disable-gcc-vcheck	  do not check for buggy gcc version
1519 1519
   --enable-experimental	enable experimental code
1520
+  --enable-mempool	enable memory pools
1520 1521
   --enable-check           Enable 'check' unit tests (default=auto)
1521 1522
   --disable-rpath         do not hardcode runtime library paths
1522 1523
   --enable-coverage       turn on test coverage [default=no]
... ...
@@ -4755,13 +4756,13 @@ if test "${lt_cv_nm_interface+set}" = set; then
4755 4755
 else
4756 4756
   lt_cv_nm_interface="BSD nm"
4757 4757
   echo "int some_variable = 0;" > conftest.$ac_ext
4758
-  (eval echo "\"\$as_me:4758: $ac_compile\"" >&5)
4758
+  (eval echo "\"\$as_me:4759: $ac_compile\"" >&5)
4759 4759
   (eval "$ac_compile" 2>conftest.err)
4760 4760
   cat conftest.err >&5
4761
-  (eval echo "\"\$as_me:4761: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
4761
+  (eval echo "\"\$as_me:4762: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
4762 4762
   (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
4763 4763
   cat conftest.err >&5
4764
-  (eval echo "\"\$as_me:4764: output\"" >&5)
4764
+  (eval echo "\"\$as_me:4765: output\"" >&5)
4765 4765
   cat conftest.out >&5
4766 4766
   if $GREP 'External.*some_variable' conftest.out > /dev/null; then
4767 4767
     lt_cv_nm_interface="MS dumpbin"
... ...
@@ -5972,7 +5973,7 @@ ia64-*-hpux*)
5972 5972
   ;;
5973 5973
 *-*-irix6*)
5974 5974
   # Find out which ABI we are using.
5975
-  echo '#line 5975 "configure"' > conftest.$ac_ext
5975
+  echo '#line 5976 "configure"' > conftest.$ac_ext
5976 5976
   if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
5977 5977
   (eval $ac_compile) 2>&5
5978 5978
   ac_status=$?
... ...
@@ -7823,11 +7824,11 @@ else
7823 7823
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
7824 7824
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
7825 7825
    -e 's:$: $lt_compiler_flag:'`
7826
-   (eval echo "\"\$as_me:7826: $lt_compile\"" >&5)
7826
+   (eval echo "\"\$as_me:7827: $lt_compile\"" >&5)
7827 7827
    (eval "$lt_compile" 2>conftest.err)
7828 7828
    ac_status=$?
7829 7829
    cat conftest.err >&5
7830
-   echo "$as_me:7830: \$? = $ac_status" >&5
7830
+   echo "$as_me:7831: \$? = $ac_status" >&5
7831 7831
    if (exit $ac_status) && test -s "$ac_outfile"; then
7832 7832
      # The compiler can only warn and ignore the option if not recognized
7833 7833
      # So say no if there are warnings other than the usual output.
... ...
@@ -8162,11 +8163,11 @@ else
8162 8162
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
8163 8163
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
8164 8164
    -e 's:$: $lt_compiler_flag:'`
8165
-   (eval echo "\"\$as_me:8165: $lt_compile\"" >&5)
8165
+   (eval echo "\"\$as_me:8166: $lt_compile\"" >&5)
8166 8166
    (eval "$lt_compile" 2>conftest.err)
8167 8167
    ac_status=$?
8168 8168
    cat conftest.err >&5
8169
-   echo "$as_me:8169: \$? = $ac_status" >&5
8169
+   echo "$as_me:8170: \$? = $ac_status" >&5
8170 8170
    if (exit $ac_status) && test -s "$ac_outfile"; then
8171 8171
      # The compiler can only warn and ignore the option if not recognized
8172 8172
      # So say no if there are warnings other than the usual output.
... ...
@@ -8267,11 +8268,11 @@ else
8267 8267
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
8268 8268
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
8269 8269
    -e 's:$: $lt_compiler_flag:'`
8270
-   (eval echo "\"\$as_me:8270: $lt_compile\"" >&5)
8270
+   (eval echo "\"\$as_me:8271: $lt_compile\"" >&5)
8271 8271
    (eval "$lt_compile" 2>out/conftest.err)
8272 8272
    ac_status=$?
8273 8273
    cat out/conftest.err >&5
8274
-   echo "$as_me:8274: \$? = $ac_status" >&5
8274
+   echo "$as_me:8275: \$? = $ac_status" >&5
8275 8275
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
8276 8276
    then
8277 8277
      # The compiler can only warn and ignore the option if not recognized
... ...
@@ -8322,11 +8323,11 @@ else
8322 8322
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
8323 8323
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
8324 8324
    -e 's:$: $lt_compiler_flag:'`
8325
-   (eval echo "\"\$as_me:8325: $lt_compile\"" >&5)
8325
+   (eval echo "\"\$as_me:8326: $lt_compile\"" >&5)
8326 8326
    (eval "$lt_compile" 2>out/conftest.err)
8327 8327
    ac_status=$?
8328 8328
    cat out/conftest.err >&5
8329
-   echo "$as_me:8329: \$? = $ac_status" >&5
8329
+   echo "$as_me:8330: \$? = $ac_status" >&5
8330 8330
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
8331 8331
    then
8332 8332
      # The compiler can only warn and ignore the option if not recognized
... ...
@@ -11078,7 +11079,7 @@ else
11078 11078
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
11079 11079
   lt_status=$lt_dlunknown
11080 11080
   cat > conftest.$ac_ext <<_LT_EOF
11081
-#line 11081 "configure"
11081
+#line 11082 "configure"
11082 11082
 #include "confdefs.h"
11083 11083
 
11084 11084
 #if HAVE_DLFCN_H
... ...
@@ -11174,7 +11175,7 @@ else
11174 11174
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
11175 11175
   lt_status=$lt_dlunknown
11176 11176
   cat > conftest.$ac_ext <<_LT_EOF
11177
-#line 11177 "configure"
11177
+#line 11178 "configure"
11178 11178
 #include "confdefs.h"
11179 11179
 
11180 11180
 #if HAVE_DLFCN_H
... ...
@@ -13422,6 +13423,74 @@ cat >>confdefs.h <<_ACEOF
13422 13422
 _ACEOF
13423 13423
 
13424 13424
 
13425
+{ echo "$as_me:$LINENO: checking size of void *" >&5
13426
+echo $ECHO_N "checking size of void *... $ECHO_C" >&6; }
13427
+if test "${ac_cv_sizeof_void_p+set}" = set; then
13428
+  echo $ECHO_N "(cached) $ECHO_C" >&6
13429
+else
13430
+  for ac_size in 4 8 1 2 16  ; do # List sizes in rough order of prevalence.
13431
+  cat >conftest.$ac_ext <<_ACEOF
13432
+/* confdefs.h.  */
13433
+_ACEOF
13434
+cat confdefs.h >>conftest.$ac_ext
13435
+cat >>conftest.$ac_ext <<_ACEOF
13436
+/* end confdefs.h.  */
13437
+#include "confdefs.h"
13438
+#include <sys/types.h>
13439
+
13440
+
13441
+int
13442
+main ()
13443
+{
13444
+switch (0) case 0: case (sizeof (void *) == $ac_size):;
13445
+  ;
13446
+  return 0;
13447
+}
13448
+_ACEOF
13449
+rm -f conftest.$ac_objext
13450
+if { (ac_try="$ac_compile"
13451
+case "(($ac_try" in
13452
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
13453
+  *) ac_try_echo=$ac_try;;
13454
+esac
13455
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
13456
+  (eval "$ac_compile") 2>conftest.er1
13457
+  ac_status=$?
13458
+  grep -v '^ *+' conftest.er1 >conftest.err
13459
+  rm -f conftest.er1
13460
+  cat conftest.err >&5
13461
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
13462
+  (exit $ac_status); } && {
13463
+	 test -z "$ac_c_werror_flag" ||
13464
+	 test ! -s conftest.err
13465
+       } && test -s conftest.$ac_objext; then
13466
+  ac_cv_sizeof_void_p=$ac_size
13467
+else
13468
+  echo "$as_me: failed program was:" >&5
13469
+sed 's/^/| /' conftest.$ac_ext >&5
13470
+
13471
+
13472
+fi
13473
+
13474
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
13475
+  if test x$ac_cv_sizeof_void_p != x ; then break; fi
13476
+done
13477
+
13478
+fi
13479
+
13480
+if test x$ac_cv_sizeof_void_p = x ; then
13481
+  { { echo "$as_me:$LINENO: error: cannot determine a size for void *" >&5
13482
+echo "$as_me: error: cannot determine a size for void *" >&2;}
13483
+   { (exit 1); exit 1; }; }
13484
+fi
13485
+{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_void_p" >&5
13486
+echo "${ECHO_T}$ac_cv_sizeof_void_p" >&6; }
13487
+
13488
+cat >>confdefs.h <<_ACEOF
13489
+#define SIZEOF_VOID_P $ac_cv_sizeof_void_p
13490
+_ACEOF
13491
+
13492
+
13425 13493
 
13426 13494
 # Check whether --enable-experimental was given.
13427 13495
 if test "${enable_experimental+set}" = set; then
... ...
@@ -13942,6 +14011,227 @@ _ACEOF
13942 13942
 fi
13943 13943
 
13944 13944
 
13945
+# Check whether --enable-mempool was given.
13946
+if test "${enable_mempool+set}" = set; then
13947
+  enableval=$enable_mempool; enable_mempool=$enableval
13948
+else
13949
+  enable_mempool="no"
13950
+fi
13951
+
13952
+if test "$enable_mempool" = "yes"; then
13953
+	if test "$ac_cv_c_mmap_private" != "yes"; then
13954
+		{ echo "$as_me:$LINENO: WARNING: ****** mempool support disabled (mmap not available or not usable)" >&5
13955
+echo "$as_me: WARNING: ****** mempool support disabled (mmap not available or not usable)" >&2;}
13956
+	else
13957
+		{ echo "$as_me:$LINENO: checking for getpagesize" >&5
13958
+echo $ECHO_N "checking for getpagesize... $ECHO_C" >&6; }
13959
+if test "${ac_cv_func_getpagesize+set}" = set; then
13960
+  echo $ECHO_N "(cached) $ECHO_C" >&6
13961
+else
13962
+  cat >conftest.$ac_ext <<_ACEOF
13963
+/* confdefs.h.  */
13964
+_ACEOF
13965
+cat confdefs.h >>conftest.$ac_ext
13966
+cat >>conftest.$ac_ext <<_ACEOF
13967
+/* end confdefs.h.  */
13968
+/* Define getpagesize to an innocuous variant, in case <limits.h> declares getpagesize.
13969
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
13970
+#define getpagesize innocuous_getpagesize
13971
+
13972
+/* System header to define __stub macros and hopefully few prototypes,
13973
+    which can conflict with char getpagesize (); below.
13974
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
13975
+    <limits.h> exists even on freestanding compilers.  */
13976
+
13977
+#ifdef __STDC__
13978
+# include <limits.h>
13979
+#else
13980
+# include <assert.h>
13981
+#endif
13982
+
13983
+#undef getpagesize
13984
+
13985
+/* Override any GCC internal prototype to avoid an error.
13986
+   Use char because int might match the return type of a GCC
13987
+   builtin and then its argument prototype would still apply.  */
13988
+#ifdef __cplusplus
13989
+extern "C"
13990
+#endif
13991
+char getpagesize ();
13992
+/* The GNU C library defines this for functions which it implements
13993
+    to always fail with ENOSYS.  Some functions are actually named
13994
+    something starting with __ and the normal name is an alias.  */
13995
+#if defined __stub_getpagesize || defined __stub___getpagesize
13996
+choke me
13997
+#endif
13998
+
13999
+int
14000
+main ()
14001
+{
14002
+return getpagesize ();
14003
+  ;
14004
+  return 0;
14005
+}
14006
+_ACEOF
14007
+rm -f conftest.$ac_objext conftest$ac_exeext
14008
+if { (ac_try="$ac_link"
14009
+case "(($ac_try" in
14010
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
14011
+  *) ac_try_echo=$ac_try;;
14012
+esac
14013
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
14014
+  (eval "$ac_link") 2>conftest.er1
14015
+  ac_status=$?
14016
+  grep -v '^ *+' conftest.er1 >conftest.err
14017
+  rm -f conftest.er1
14018
+  cat conftest.err >&5
14019
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
14020
+  (exit $ac_status); } && {
14021
+	 test -z "$ac_c_werror_flag" ||
14022
+	 test ! -s conftest.err
14023
+       } && test -s conftest$ac_exeext &&
14024
+       $as_test_x conftest$ac_exeext; then
14025
+  ac_cv_func_getpagesize=yes
14026
+else
14027
+  echo "$as_me: failed program was:" >&5
14028
+sed 's/^/| /' conftest.$ac_ext >&5
14029
+
14030
+	ac_cv_func_getpagesize=no
14031
+fi
14032
+
14033
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
14034
+      conftest$ac_exeext conftest.$ac_ext
14035
+fi
14036
+{ echo "$as_me:$LINENO: result: $ac_cv_func_getpagesize" >&5
14037
+echo "${ECHO_T}$ac_cv_func_getpagesize" >&6; }
14038
+if test $ac_cv_func_getpagesize = yes; then
14039
+
14040
+
14041
+	{ echo "$as_me:$LINENO: checking for MAP_ANON(YMOUS)" >&5
14042
+echo $ECHO_N "checking for MAP_ANON(YMOUS)... $ECHO_C" >&6; }
14043
+if test "${ac_cv_c_mmap_anonymous+set}" = set; then
14044
+  echo $ECHO_N "(cached) $ECHO_C" >&6
14045
+else
14046
+
14047
+		ac_cv_c_mmap_anonymous='no'
14048
+		cat >conftest.$ac_ext <<_ACEOF
14049
+/* confdefs.h.  */
14050
+_ACEOF
14051
+cat confdefs.h >>conftest.$ac_ext
14052
+cat >>conftest.$ac_ext <<_ACEOF
14053
+/* end confdefs.h.  */
14054
+#include <sys/mman.h>
14055
+int
14056
+main ()
14057
+{
14058
+mmap((void *)0, 0, PROT_READ | PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0);
14059
+  ;
14060
+  return 0;
14061
+}
14062
+_ACEOF
14063
+rm -f conftest.$ac_objext
14064
+if { (ac_try="$ac_compile"
14065
+case "(($ac_try" in
14066
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
14067
+  *) ac_try_echo=$ac_try;;
14068
+esac
14069
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
14070
+  (eval "$ac_compile") 2>conftest.er1
14071
+  ac_status=$?
14072
+  grep -v '^ *+' conftest.er1 >conftest.err
14073
+  rm -f conftest.er1
14074
+  cat conftest.err >&5
14075
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
14076
+  (exit $ac_status); } && {
14077
+	 test -z "$ac_c_werror_flag" ||
14078
+	 test ! -s conftest.err
14079
+       } && test -s conftest.$ac_objext; then
14080
+  ac_cv_c_mmap_anonymous='MAP_ANONYMOUS'
14081
+else
14082
+  echo "$as_me: failed program was:" >&5
14083
+sed 's/^/| /' conftest.$ac_ext >&5
14084
+
14085
+
14086
+				cat >conftest.$ac_ext <<_ACEOF
14087
+/* confdefs.h.  */
14088
+_ACEOF
14089
+cat confdefs.h >>conftest.$ac_ext
14090
+cat >>conftest.$ac_ext <<_ACEOF
14091
+/* end confdefs.h.  */
14092
+#include <sys/mman.h>
14093
+int
14094
+main ()
14095
+{
14096
+mmap((void *)0, 0, PROT_READ | PROT_WRITE, MAP_PRIVATE|MAP_ANON, -1, 0);
14097
+  ;
14098
+  return 0;
14099
+}
14100
+_ACEOF
14101
+rm -f conftest.$ac_objext conftest$ac_exeext
14102
+if { (ac_try="$ac_link"
14103
+case "(($ac_try" in
14104
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
14105
+  *) ac_try_echo=$ac_try;;
14106
+esac
14107
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
14108
+  (eval "$ac_link") 2>conftest.er1
14109
+  ac_status=$?
14110
+  grep -v '^ *+' conftest.er1 >conftest.err
14111
+  rm -f conftest.er1
14112
+  cat conftest.err >&5
14113
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
14114
+  (exit $ac_status); } && {
14115
+	 test -z "$ac_c_werror_flag" ||
14116
+	 test ! -s conftest.err
14117
+       } && test -s conftest$ac_exeext &&
14118
+       $as_test_x conftest$ac_exeext; then
14119
+  ac_cv_c_mmap_anonymous='MAP_ANONYMOUS'
14120
+
14121
+else
14122
+  echo "$as_me: failed program was:" >&5
14123
+sed 's/^/| /' conftest.$ac_ext >&5
14124
+
14125
+
14126
+fi
14127
+
14128
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
14129
+      conftest$ac_exeext conftest.$ac_ext
14130
+
14131
+
14132
+fi
14133
+
14134
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
14135
+
14136
+fi
14137
+{ echo "$as_me:$LINENO: result: $ac_cv_c_mmap_anonymous" >&5
14138
+echo "${ECHO_T}$ac_cv_c_mmap_anonymous" >&6; }
14139
+	if test "$ac_cv_c_mmap_anonymous" != "no"; then
14140
+
14141
+cat >>confdefs.h <<_ACEOF
14142
+#define ANONYMOUS_MAP $ac_cv_c_mmap_anonymous
14143
+_ACEOF
14144
+
14145
+	fi
14146
+
14147
+			if test "$ac_cv_c_mmap_anonymous" = "no"; then
14148
+				{ echo "$as_me:$LINENO: WARNING: ****** mempool support disabled (anonymous mmap not available)" >&5
14149
+echo "$as_me: WARNING: ****** mempool support disabled (anonymous mmap not available)" >&2;}
14150
+			else
14151
+
14152
+cat >>confdefs.h <<\_ACEOF
14153
+#define USE_MPOOL 1
14154
+_ACEOF
14155
+
14156
+			fi
14157
+
14158
+else
14159
+  { echo "$as_me:$LINENO: WARNING: ****** mempool support disabled (getpagesize not available)" >&5
14160
+echo "$as_me: WARNING: ****** mempool support disabled (getpagesize not available)" >&2;}
14161
+fi
14162
+
14163
+	fi
14164
+fi
14165
+
13945 14166
 enable_check_ut=auto
13946 14167
 enable_ut_install=no
13947 14168
 # Check whether --enable-check was given.
... ...
@@ -400,6 +400,7 @@ AC_COMPILE_CHECK_SIZEOF([short])
400 400
 AC_COMPILE_CHECK_SIZEOF([int])
401 401
 AC_COMPILE_CHECK_SIZEOF([long])
402 402
 AC_COMPILE_CHECK_SIZEOF([long long])
403
+AC_COMPILE_CHECK_SIZEOF([void *])
403 404
 
404 405
 AC_ARG_ENABLE([experimental],
405 406
 [  --enable-experimental	enable experimental code],
... ...
@@ -417,6 +418,22 @@ AC_CHECK_FUNCS([poll setsid memcpy snprintf vsnprintf strerror_r strlcpy strlcat
417 417
 AC_C_FUNC_MMAP_PRIVATE
418 418
 AC_FUNC_FSEEKO
419 419
 
420
+AC_ARG_ENABLE([mempool],[  --enable-mempool	enable memory pools], enable_mempool=$enableval, enable_mempool="no")
421
+if test "$enable_mempool" = "yes"; then
422
+	if test "$ac_cv_c_mmap_private" != "yes"; then
423
+		AC_MSG_WARN([****** mempool support disabled (mmap not available or not usable)])
424
+	else
425
+		AC_CHECK_FUNC([getpagesize], [
426
+			AC_C_FUNC_MMAP_ANONYMOUS
427
+			if test "$ac_cv_c_mmap_anonymous" = "no"; then
428
+				AC_MSG_WARN([****** mempool support disabled (anonymous mmap not available)])
429
+			else
430
+				AC_DEFINE([USE_MPOOL],1,[enable memory pools])
431
+			fi
432
+		], [AC_MSG_WARN([****** mempool support disabled (getpagesize not available)])])
433
+	fi
434
+fi
435
+
420 436
 enable_check_ut=auto
421 437
 enable_ut_install=no
422 438
 AC_ARG_ENABLE(check,
... ...
@@ -18,7 +18,7 @@
18 18
 
19 19
 SUBDIRS = lzma .
20 20
 
21
-AM_CPPFLAGS = -I$(top_srcdir) -I@srcdir@/nsis -I@srcdir@/lzma
21
+AM_CPPFLAGS = -I$(top_srcdir) -I@srcdir@/nsis -I@srcdir@/lzma 
22 22
 
23 23
 libclamav_la_LIBADD = lzma/liblzma.la @CLAMAV_UNRAR_LIBS@ @LIBCLAMAV_LIBS@ @THREAD_LIBS@
24 24
 
... ...
@@ -198,7 +198,9 @@ libclamav_la_SOURCES = \
198 198
 	uniq.c \
199 199
 	uniq.h \
200 200
 	version.c\
201
-	version.h
201
+	version.h\
202
+	mpool.c\
203
+	mpool.h
202 204
 
203 205
 .PHONY: version.h.tmp
204 206
 version.lo: version.h
... ...
@@ -92,7 +92,7 @@ am_libclamav_la_OBJECTS = matcher-ac.lo matcher-bm.lo matcher.lo \
92 92
 	uuencode.lo phishcheck.lo phish_domaincheck_db.lo \
93 93
 	phish_whitelist.lo regex_list.lo regex_suffix.lo mspack.lo \
94 94
 	cab.lo entconv.lo hashtab.lo dconf.lo lzma_iface.lo explode.lo \
95
-	textnorm.lo dlp.lo js-norm.lo uniq.lo version.lo
95
+	textnorm.lo dlp.lo js-norm.lo uniq.lo version.lo mpool.lo
96 96
 libclamav_la_OBJECTS = $(am_libclamav_la_OBJECTS)
97 97
 libclamav_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
98 98
 	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
... ...
@@ -281,7 +281,7 @@ target_vendor = @target_vendor@
281 281
 top_builddir = @top_builddir@
282 282
 top_srcdir = @top_srcdir@
283 283
 SUBDIRS = lzma .
284
-AM_CPPFLAGS = -I$(top_srcdir) -I@srcdir@/nsis -I@srcdir@/lzma
284
+AM_CPPFLAGS = -I$(top_srcdir) -I@srcdir@/nsis -I@srcdir@/lzma 
285 285
 libclamav_la_LIBADD = lzma/liblzma.la @CLAMAV_UNRAR_LIBS@ @LIBCLAMAV_LIBS@ @THREAD_LIBS@
286 286
 libclamav_la_LDFLAGS = @TH_SAFE@ -version-info @LIBCLAMAV_VERSION@ \
287 287
 	-no-undefined $(am__append_1)
... ...
@@ -454,7 +454,9 @@ libclamav_la_SOURCES = \
454 454
 	uniq.c \
455 455
 	uniq.h \
456 456
 	version.c\
457
-	version.h
457
+	version.h\
458
+	mpool.c\
459
+	mpool.h
458 460
 
459 461
 libclamav_internal_utils_la_SOURCES = str.c \
460 462
 				    str.h \
... ...
@@ -589,6 +591,7 @@ distclean-compile:
589 589
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/md5.Plo@am__quote@
590 590
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/message.Plo@am__quote@
591 591
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mew.Plo@am__quote@
592
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mpool.Plo@am__quote@
592 593
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/msexpand.Plo@am__quote@
593 594
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mspack.Plo@am__quote@
594 595
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nulsft.Plo@am__quote@
... ...
@@ -23,7 +23,7 @@
23 23
 
24 24
 #include <sys/types.h>
25 25
 #include <sys/stat.h>
26
- 
26
+
27 27
 #ifdef __cplusplus
28 28
 extern "C"
29 29
 {
... ...
@@ -152,6 +152,9 @@ struct cl_engine {
152 152
 
153 153
     /* PUA categories (to be included or excluded) */
154 154
     char *pua_cats;
155
+
156
+    /* Used for memory pools */
157
+    void *mempool;
155 158
 };
156 159
 
157 160
 struct cl_limits {
... ...
@@ -35,6 +35,8 @@
35 35
 #include "str.h"
36 36
 #include "others.h"
37 37
 
38
+#include "mpool.h"
39
+
38 40
 struct dconf_module {
39 41
     const char	*mname;	    /* module name */
40 42
     const char	*sname;	    /* submodule name */
... ...
@@ -109,13 +111,16 @@ static struct dconf_module modules[] = {
109 109
     { NULL,	    NULL,	    0,			    0 }
110 110
 };
111 111
 
112
+#ifdef USE_MPOOL 
113
+struct cli_dconf *cli_dconf_init(mp_t *mempool)
114
+#else
112 115
 struct cli_dconf *cli_dconf_init(void)
116
+#endif
113 117
 {
114 118
 	unsigned int i;
115 119
 	struct cli_dconf *dconf;
116 120
 
117
-
118
-    dconf = (struct cli_dconf *) cli_calloc(sizeof(struct cli_dconf), 1);
121
+    dconf = (struct cli_dconf *) mp_calloc(mempool, sizeof(struct cli_dconf), 1);
119 122
     if(!dconf)
120 123
 	return NULL;
121 124
 
... ...
@@ -21,7 +21,6 @@
21 21
 #ifndef __DCONF_H
22 22
 #define __DCONF_H
23 23
 
24
-
25 24
 #include <stdio.h>
26 25
 #include <zlib.h>
27 26
 
... ...
@@ -29,6 +28,8 @@
29 29
 #include "cltypes.h"
30 30
 #include "cvd.h"
31 31
 
32
+#include "mpool.h"
33
+
32 34
 struct cli_dconf {
33 35
     uint32_t pe;
34 36
     uint32_t elf;
... ...
@@ -98,7 +99,13 @@ struct cli_dconf {
98 98
 #define PHISHING_CONF_ENGINE   0x1
99 99
 #define PHISHING_CONF_ENTCONV  0x2
100 100
 
101
+#ifdef USE_MPOOL
102
+struct cli_dconf *cli_dconf_init(mp_t *);
103
+#define cli_mp_dconf_init(a) cli_dconf_init(a)
104
+#else
101 105
 struct cli_dconf *cli_dconf_init(void);
106
+#define cli_mp_dconf_init(a) cli_dconf_init()
107
+#endif
102 108
 void cli_dconf_print(struct cli_dconf *dconf);
103 109
 int cli_dconf_load(FILE *fs, struct cl_engine **engine, unsigned int options, struct cli_dbio *dbio);
104 110
 #endif
... ...
@@ -40,6 +40,7 @@
40 40
 
41 41
 #include "htmlnorm.h"
42 42
 #include "entconv.h"
43
+#include "mpool.h"
43 44
 
44 45
 static const struct ftmap_s {
45 46
     const char *name;
... ...
@@ -100,16 +101,16 @@ cli_file_t cli_ftcode(const char *name)
100 100
     return CL_TYPE_ERROR;
101 101
 }
102 102
 
103
-void cli_ftfree(struct cli_ftype *ftypes)
103
+void cli_ftfree(const struct cl_engine *engine)
104 104
 {
105
-	struct cli_ftype *pt;
105
+	struct cli_ftype *ftypes=engine->ftypes, *pt;
106 106
 
107 107
     while(ftypes) {
108 108
 	pt = ftypes;
109 109
 	ftypes = ftypes->next;
110
-	free(pt->magic);
111
-	free(pt->tname);
112
-	free(pt);
110
+	mp_free(engine->mempool, pt->magic);
111
+	mp_free(engine->mempool, pt->tname);
112
+	mp_free(engine->mempool, pt);
113 113
     }
114 114
 }
115 115
 
... ...
@@ -95,7 +95,7 @@ struct cli_matched_type {
95 95
 };
96 96
 
97 97
 cli_file_t cli_ftcode(const char *name);
98
-void cli_ftfree(struct cli_ftype *ftypes);
98
+void cli_ftfree(const struct cl_engine *engine);
99 99
 cli_file_t cli_filetype(const unsigned char *buf, size_t buflen, const struct cl_engine *engine);
100 100
 cli_file_t cli_filetype2(int desc, const struct cl_engine *engine);
101 101
 int cli_addtypesigs(struct cl_engine *engine);
... ...
@@ -39,6 +39,8 @@
39 39
 #include "str.h"
40 40
 #include "readdb.h"
41 41
 
42
+#include "mpool.h"
43
+
42 44
 uint8_t cli_ac_mindepth = AC_DEFAULT_MIN_DEPTH;
43 45
 uint8_t cli_ac_maxdepth = AC_DEFAULT_MAX_DEPTH;
44 46
 
... ...
@@ -66,7 +68,7 @@ int cli_ac_addpatt(struct cli_matcher *root, struct cli_ac_patt *pattern)
66 66
 
67 67
     for(i = 0; i < len; i++) {
68 68
 	if(!pt->trans) {
69
-	    pt->trans = (struct cli_ac_node **) cli_calloc(256, sizeof(struct cli_ac_node *));
69
+	    pt->trans = (struct cli_ac_node **) mp_calloc(root->mempool, 256, sizeof(struct cli_ac_node *));
70 70
 	    if(!pt->trans) {
71 71
 		cli_errmsg("cli_ac_addpatt: Can't allocate memory for pt->trans\n");
72 72
 		return CL_EMEM;
... ...
@@ -76,17 +78,17 @@ int cli_ac_addpatt(struct cli_matcher *root, struct cli_ac_patt *pattern)
76 76
 	next = pt->trans[(unsigned char) (pattern->pattern[i] & 0xff)]; 
77 77
 
78 78
 	if(!next) {
79
-	    next = (struct cli_ac_node *) cli_calloc(1, sizeof(struct cli_ac_node));
79
+	    next = (struct cli_ac_node *) mp_calloc(root->mempool, 1, sizeof(struct cli_ac_node));
80 80
 	    if(!next) {
81 81
 		cli_errmsg("cli_ac_addpatt: Can't allocate memory for AC node\n");
82 82
 		return CL_EMEM;
83 83
 	    }
84 84
 
85 85
 	    if(i != len - 1) {
86
-		next->trans = (struct cli_ac_node **) cli_calloc(256, sizeof(struct cli_ac_node *));
86
+		next->trans = (struct cli_ac_node **) mp_calloc(root->mempool, 256, sizeof(struct cli_ac_node *));
87 87
 		if(!next->trans) {
88 88
 		    cli_errmsg("cli_ac_addpatt: Can't allocate memory for next->trans\n");
89
-		    free(next);
89
+		    mp_free(root->mempool, next);
90 90
 		    return CL_EMEM;
91 91
 		}
92 92
 	    } else {
... ...
@@ -94,13 +96,13 @@ int cli_ac_addpatt(struct cli_matcher *root, struct cli_ac_patt *pattern)
94 94
 	    }
95 95
 
96 96
 	    root->ac_nodes++;
97
-	    newtable = cli_realloc(root->ac_nodetable, root->ac_nodes * sizeof(struct cli_ac_node *));
97
+	    newtable = mp_realloc(root->mempool, root->ac_nodetable, root->ac_nodes * sizeof(struct cli_ac_node *));
98 98
 	    if(!newtable) {
99 99
 		root->ac_nodes--;
100 100
 		cli_errmsg("cli_ac_addpatt: Can't realloc ac_nodetable\n");
101 101
 		if(next->trans)
102
-		    free(next->trans);
103
-		free(next);
102
+		    mp_free(root->mempool, next->trans);
103
+		mp_free(root->mempool, next);
104 104
 		return CL_EMEM;
105 105
 	    }
106 106
 	    root->ac_nodetable = (struct cli_ac_node **) newtable;
... ...
@@ -114,7 +116,7 @@ int cli_ac_addpatt(struct cli_matcher *root, struct cli_ac_patt *pattern)
114 114
     }
115 115
 
116 116
     root->ac_patterns++;
117
-    newtable = cli_realloc(root->ac_pattable, root->ac_patterns * sizeof(struct cli_ac_patt *));
117
+    newtable = mp_realloc(root->mempool, root->ac_pattable, root->ac_patterns * sizeof(struct cli_ac_patt *));
118 118
     if(!newtable) {
119 119
 	root->ac_patterns--;
120 120
 	cli_errmsg("cli_ac_addpatt: Can't realloc ac_pattable\n");
... ...
@@ -299,16 +301,16 @@ int cli_ac_buildtrie(struct cli_matcher *root)
299 299
 int cli_ac_init(struct cli_matcher *root, uint8_t mindepth, uint8_t maxdepth)
300 300
 {
301 301
 
302
-    root->ac_root = (struct cli_ac_node *) cli_calloc(1, sizeof(struct cli_ac_node));
302
+    root->ac_root = (struct cli_ac_node *) mp_calloc(root->mempool, 1, sizeof(struct cli_ac_node));
303 303
     if(!root->ac_root) {
304 304
 	cli_errmsg("cli_ac_init: Can't allocate memory for ac_root\n");
305 305
 	return CL_EMEM;
306 306
     }
307 307
 
308
-    root->ac_root->trans = (struct cli_ac_node **) cli_calloc(256, sizeof(struct cli_ac_node *));
308
+    root->ac_root->trans = (struct cli_ac_node **) mp_calloc(root->mempool, 256, sizeof(struct cli_ac_node *));
309 309
     if(!root->ac_root->trans) {
310 310
 	cli_errmsg("cli_ac_init: Can't allocate memory for ac_root->trans\n");
311
-	free(root->ac_root);
311
+	mp_free(root->mempool, root->ac_root);
312 312
 	return CL_EMEM;
313 313
     }
314 314
 
... ...
@@ -318,7 +320,13 @@ int cli_ac_init(struct cli_matcher *root, uint8_t mindepth, uint8_t maxdepth)
318 318
     return CL_SUCCESS;
319 319
 }
320 320
 
321
+#ifdef USE_MPOOL
322
+#define mp_ac_free_alt(a, b) ac_free_alt(a, b)
323
+static void ac_free_alt(mp_t *mempool, struct cli_ac_patt *p)
324
+#else
325
+#define mp_ac_free_alt(a, b) ac_free_alt(b)
321 326
 static void ac_free_alt(struct cli_ac_patt *p)
327
+#endif
322 328
 {
323 329
 	uint16_t i;
324 330
 	struct cli_ac_alt *a1, *a2;
... ...
@@ -333,11 +341,11 @@ static void ac_free_alt(struct cli_ac_patt *p)
333 333
 	    a2 = a1;
334 334
 	    a1 = a1->next;
335 335
 	    if(a2->str)
336
-		free(a2->str);
337
-	    free(a2);
336
+		mp_free(mempool, a2->str);
337
+	    mp_free(mempool, a2);
338 338
 	}
339 339
     }
340
-    free(p->alttable);
340
+    mp_free(mempool, p->alttable);
341 341
 }
342 342
 
343 343
 void cli_ac_free(struct cli_matcher *root)
... ...
@@ -348,29 +356,28 @@ void cli_ac_free(struct cli_matcher *root)
348 348
 
349 349
     for(i = 0; i < root->ac_patterns; i++) {
350 350
 	patt = root->ac_pattable[i];
351
-	patt->prefix ? free(patt->prefix) : free(patt->pattern);
352
-	free(patt->virname);
351
+	mp_free(root->mempool, patt->prefix ? patt->prefix : patt->pattern);
352
+	mp_free(root->mempool, patt->virname);
353 353
 	if(patt->offset)
354
-	    free(patt->offset);
354
+	    mp_free(root->mempool, patt->offset);
355 355
 	if(patt->alt)
356
-	    ac_free_alt(patt);
357
-	free(patt);
356
+	    mp_ac_free_alt(root->mempool, patt);
357
+	mp_free(root->mempool, patt);
358 358
     }
359 359
     if(root->ac_pattable)
360
-	free(root->ac_pattable);
360
+	mp_free(root->mempool, root->ac_pattable);
361 361
 
362 362
     for(i = 0; i < root->ac_nodes; i++) {
363 363
 	if(!root->ac_nodetable[i]->leaf)
364
-	    free(root->ac_nodetable[i]->trans);
365
-	free(root->ac_nodetable[i]);
364
+	    mp_free(root->mempool, root->ac_nodetable[i]->trans);
365
+	mp_free(root->mempool, root->ac_nodetable[i]);
366 366
     }
367 367
 
368 368
     if(root->ac_nodetable)
369
-	free(root->ac_nodetable);
370
-
369
+	mp_free(root->mempool, root->ac_nodetable);
371 370
     if(root->ac_root) {
372
-	free(root->ac_root->trans);
373
-	free(root->ac_root);
371
+	mp_free(root->mempool, root->ac_root->trans);
372
+	mp_free(root->mempool, root->ac_root);
374 373
     }
375 374
 }
376 375
 
... ...
@@ -1093,8 +1100,7 @@ int cli_ac_addsig(struct cli_matcher *root, const char *virname, const char *hex
1093 1093
 
1094 1094
     if(strlen(hexsig) / 2 < root->ac_mindepth)
1095 1095
 	return CL_EPATSHORT;
1096
-
1097
-    if((new = (struct cli_ac_patt *) cli_calloc(1, sizeof(struct cli_ac_patt))) == NULL)
1096
+    if((new = (struct cli_ac_patt *) mp_calloc(root->mempool, 1, sizeof(struct cli_ac_patt))) == NULL)
1098 1097
 	return CL_EMEM;
1099 1098
 
1100 1099
     new->rtype = rtype;
... ...
@@ -1114,7 +1120,7 @@ int cli_ac_addsig(struct cli_matcher *root, const char *virname, const char *hex
1114 1114
 
1115 1115
     if(strchr(hexsig, '[')) {
1116 1116
 	if(!(hexcpy = cli_strdup(hexsig))) {
1117
-	    free(new);
1117
+	    mp_free(root->mempool, new);
1118 1118
 	    return CL_EMEM;
1119 1119
 	}
1120 1120
 
... ...
@@ -1179,14 +1185,14 @@ int cli_ac_addsig(struct cli_matcher *root, const char *virname, const char *hex
1179 1179
 
1180 1180
 	if(error) {
1181 1181
 	    free(hexcpy);
1182
-	    free(new);
1182
+	    mp_free(root->mempool, new);
1183 1183
 	    return error;
1184 1184
 	}
1185 1185
 
1186 1186
 	hex = cli_strdup(hex);
1187 1187
 	free(hexcpy);
1188 1188
 	if(!hex) {
1189
-	    free(new);
1189
+	    mp_free(root->mempool, new);
1190 1190
 	    return CL_EMEM;
1191 1191
 	}
1192 1192
     }
... ...
@@ -1197,13 +1203,13 @@ int cli_ac_addsig(struct cli_matcher *root, const char *virname, const char *hex
1197 1197
 	if(hex) {
1198 1198
 	    hexcpy = hex;
1199 1199
 	} else if(!(hexcpy = cli_strdup(hexsig))) {
1200
-	    free(new);
1200
+	    mp_free(root->mempool, new);
1201 1201
 	    return CL_EMEM;
1202 1202
 	}
1203 1203
 
1204 1204
 	if(!(hexnew = (char *) cli_calloc(strlen(hexsig) + 1, 1))) {
1205
-	    free(hexcpy);
1206 1205
 	    free(new);
1206
+	    free(hexcpy);
1207 1207
 	    return CL_EMEM;
1208 1208
 	}
1209 1209
 
... ...
@@ -1225,7 +1231,7 @@ int cli_ac_addsig(struct cli_matcher *root, const char *virname, const char *hex
1225 1225
 	    }
1226 1226
 	    *start++ = 0;
1227 1227
 
1228
-	    newalt = (struct cli_ac_alt *) cli_calloc(1, sizeof(struct cli_ac_alt));
1228
+	    newalt = (struct cli_ac_alt *) mp_calloc(root->mempool, 1, sizeof(struct cli_ac_alt));
1229 1229
 	    if(!newalt) {
1230 1230
 		cli_errmsg("cli_ac_addsig: Can't allocate newalt\n");
1231 1231
 		error = CL_EMEM;
... ...
@@ -1233,10 +1239,11 @@ int cli_ac_addsig(struct cli_matcher *root, const char *virname, const char *hex
1233 1233
 	    }
1234 1234
 
1235 1235
 	    new->alt++;
1236
-	    newtable = (struct cli_ac_alt **) cli_realloc(new->alttable, new->alt * sizeof(struct cli_ac_alt *));
1236
+
1237
+	    newtable = (struct cli_ac_alt **) mp_realloc(root->mempool, new->alttable, new->alt * sizeof(struct cli_ac_alt *));
1237 1238
 	    if(!newtable) {
1238 1239
 		new->alt--;
1239
-		free(newalt);
1240
+		mp_free(root->mempool, newalt);
1240 1241
 		cli_errmsg("cli_ac_addsig: Can't realloc new->alttable\n");
1241 1242
 		error = CL_EMEM;
1242 1243
 		break;
... ...
@@ -1256,7 +1263,7 @@ int cli_ac_addsig(struct cli_matcher *root, const char *virname, const char *hex
1256 1256
 
1257 1257
 	    if(3 * newalt->num - 1 == (uint16_t) strlen(pt)) {
1258 1258
 		newalt->chmode = 1;
1259
-		newalt->str = (unsigned char *) cli_malloc(newalt->num);
1259
+		newalt->str = (unsigned char *) mp_malloc(root->mempool, newalt->num);
1260 1260
 		if(!newalt->str) {
1261 1261
 		    cli_errmsg("cli_ac_addsig: Can't allocate newalt->str\n");
1262 1262
 		    error = CL_EMEM;
... ...
@@ -1285,7 +1292,7 @@ int cli_ac_addsig(struct cli_matcher *root, const char *virname, const char *hex
1285 1285
 			while(altpt->next)
1286 1286
 			    altpt = altpt->next;
1287 1287
 
1288
-			altpt->next = (struct cli_ac_alt *) cli_calloc(1, sizeof(struct cli_ac_alt));
1288
+			altpt->next = (struct cli_ac_alt *) mp_calloc(root->mempool, 1, sizeof(struct cli_ac_alt));
1289 1289
 			if(!altpt->next) {
1290 1290
 			    cli_errmsg("cli_ac_addsig: Can't allocate altpt->next\n");
1291 1291
 			    error = CL_EMEM;
... ...
@@ -1318,20 +1325,35 @@ int cli_ac_addsig(struct cli_matcher *root, const char *virname, const char *hex
1318 1318
 	if(error) {
1319 1319
 	    if(new->alt) {
1320 1320
 		free(hex);
1321
-		ac_free_alt(new);
1321
+		mp_ac_free_alt(root->mempool, new);
1322 1322
 	    }
1323
-	    free(new);
1323
+	    mp_free(root->mempool, new);
1324 1324
 	    return error;
1325 1325
 	}
1326 1326
     }
1327 1327
 
1328
-    if((new->pattern = cli_hex2ui(hex ? hex : hexsig)) == NULL) {
1328
+#ifdef USE_MPOOL
1329
+{
1330
+    unsigned int mpoolpattsz = (strlen(hex ? hex : hexsig) / 2 + 1) * sizeof(uint16_t);
1331
+    uint16_t *mpoolpatt = cli_hex2ui(hex ? hex : hexsig);
1332
+    if(mpoolpatt) {
1333
+        if((new->pattern = mp_malloc(root->mempool, mpoolpattsz)) != NULL)
1334
+	    memcpy(new->pattern, mpoolpatt, mpoolpattsz);
1335
+	free(mpoolpatt);
1336
+    } else new->pattern = NULL;
1337
+}
1338
+#else
1339
+    new->pattern = cli_hex2ui(hex ? hex : hexsig);
1340
+#endif
1341
+
1342
+    if(new->pattern == NULL) {
1329 1343
 	if(new->alt)
1330
-	    ac_free_alt(new);
1344
+	    mp_ac_free_alt(root->mempool, new);
1345
+	mp_free(root->mempool, new);
1331 1346
 	free(hex);
1332
-	free(new);
1333 1347
 	return CL_EMALFDB;
1334 1348
     }
1349
+
1335 1350
     new->length = strlen(hex ? hex : hexsig) / 2;
1336 1351
     free(hex);
1337 1352
 
... ...
@@ -1375,9 +1397,9 @@ int cli_ac_addsig(struct cli_matcher *root, const char *virname, const char *hex
1375 1375
 
1376 1376
 	if(plen < root->ac_mindepth) {
1377 1377
 	    cli_errmsg("cli_ac_addsig: Can't find a static subpattern of length %u\n", root->ac_mindepth);
1378
-	    ac_free_alt(new);
1379
-	    free(new->pattern);
1380
-	    free(new);
1378
+	    mp_ac_free_alt(root->mempool, new);
1379
+	    mp_free(root->mempool, new->pattern);
1380
+	    mp_free(root->mempool, new);
1381 1381
 	    return CL_EMALFDB;
1382 1382
 	}
1383 1383
 
... ...
@@ -1394,11 +1416,22 @@ int cli_ac_addsig(struct cli_matcher *root, const char *virname, const char *hex
1394 1394
     if(new->length > root->maxpatlen)
1395 1395
 	root->maxpatlen = new->length;
1396 1396
 
1397
+#ifdef USE_MPOOL
1398
+{
1399
+    char *mpoolvirname = cli_virname((char *) virname, options & CL_DB_OFFICIAL, 0);
1400
+    if(mpoolvirname) {
1401
+        if((new->virname = mp_malloc(root->mempool, strlen(mpoolvirname) + 1)) != NULL)
1402
+	    strcpy(new->virname, mpoolvirname);
1403
+	free(mpoolvirname);
1404
+    } else new->virname = NULL;
1405
+}
1406
+#else
1397 1407
     new->virname = cli_virname((char *) virname, options & CL_DB_OFFICIAL, 0);
1408
+#endif
1398 1409
     if(!new->virname) {
1399
-	new->prefix ? free(new->prefix) : free(new->pattern);
1400
-	ac_free_alt(new);
1401
-	free(new);
1410
+	mp_free(root->mempool, new->prefix ? new->prefix : new->pattern);
1411
+	mp_ac_free_alt(root->mempool, new);
1412
+	mp_free(root->mempool, new);
1402 1413
 	return CL_EMEM;
1403 1414
     }
1404 1415
 
... ...
@@ -1406,23 +1439,28 @@ int cli_ac_addsig(struct cli_matcher *root, const char *virname, const char *hex
1406 1406
 	root->ac_lsigtable[new->lsigid[1]]->virname = new->virname;
1407 1407
 
1408 1408
     if(offset) {
1409
+#ifdef USE_MPOOL
1410
+        if((new->offset = mp_malloc(root->mempool, strlen(offset) + 1)))
1411
+	    strcpy(new->offset, offset);
1412
+#else
1409 1413
 	new->offset = cli_strdup(offset);
1414
+#endif
1410 1415
 	if(!new->offset) {
1411
-	    new->prefix ? free(new->prefix) : free(new->pattern);
1412
-	    ac_free_alt(new);
1413
-	    free(new->virname);
1414
-	    free(new);
1416
+	    mp_free(root->mempool, new->prefix ? new->prefix : new->pattern);
1417
+	    mp_ac_free_alt(root->mempool, new);
1418
+	    mp_free(root->mempool, new->virname);
1419
+	    mp_free(root->mempool, new);
1415 1420
 	    return CL_EMEM;
1416 1421
 	}
1417 1422
     }
1418 1423
 
1419 1424
     if((ret = cli_ac_addpatt(root, new))) {
1420
-	new->prefix ? free(new->prefix) : free(new->pattern);
1421
-	free(new->virname);
1422
-	ac_free_alt(new);
1425
+	mp_free(root->mempool, new->prefix ? new->prefix : new->pattern);
1426
+	mp_free(root->mempool, new->virname);
1427
+	mp_ac_free_alt(root->mempool, new);
1423 1428
 	if(new->offset)
1424
-	    free(new->offset);
1425
-	free(new);
1429
+	    mp_free(root->mempool, new->offset);
1430
+	mp_free(root->mempool, new);
1426 1431
 	return ret;
1427 1432
     }
1428 1433
 
... ...
@@ -32,6 +32,8 @@
32 32
 #include "matcher-bm.h"
33 33
 #include "filetypes.h"
34 34
 
35
+#include "mpool.h"
36
+
35 37
 #define BM_MIN_LENGTH	3
36 38
 #define BM_BLOCK_SIZE	3
37 39
 #define HASH(a,b,c) (211 * a + 37 * b + c)
... ...
@@ -97,12 +99,11 @@ int cli_bm_init(struct cli_matcher *root)
97 97
 {
98 98
 	uint16_t i, size = HASH(255, 255, 255) + 1;
99 99
 
100
-
101
-    if(!(root->bm_shift = (uint8_t *) cli_calloc(size, sizeof(uint8_t))))
100
+    if(!(root->bm_shift = (uint8_t *) mp_calloc(root->mempool, size, sizeof(uint8_t))))
102 101
 	return CL_EMEM;
103 102
 
104
-    if(!(root->bm_suffix = (struct cli_bm_patt **) cli_calloc(size, sizeof(struct cli_bm_patt *)))) {
105
-	free(root->bm_shift);
103
+    if(!(root->bm_suffix = (struct cli_bm_patt **) mp_calloc(root->mempool, size, sizeof(struct cli_bm_patt *)))) {
104
+	mp_free(root->mempool, root->bm_shift);
106 105
 	return CL_EMEM;
107 106
     }
108 107
 
... ...
@@ -119,7 +120,7 @@ void cli_bm_free(struct cli_matcher *root)
119 119
 
120 120
 
121 121
     if(root->bm_shift)
122
-	free(root->bm_shift);
122
+	mp_free(root->mempool, root->bm_shift);
123 123
 
124 124
     if(root->bm_suffix) {
125 125
 	for(i = 0; i < size; i++) {
... ...
@@ -128,17 +129,17 @@ void cli_bm_free(struct cli_matcher *root)
128 128
 		prev = patt;
129 129
 		patt = patt->next;
130 130
 		if(prev->prefix)
131
-		    free(prev->prefix);
131
+		    mp_free(root->mempool, prev->prefix);
132 132
 		else
133
-		    free(prev->pattern);
133
+		    mp_free(root->mempool, prev->pattern);
134 134
 		if(prev->virname)
135
-		    free(prev->virname);
135
+		    mp_free(root->mempool, prev->virname);
136 136
 		if(prev->offset)
137
-		    free(prev->offset);
138
-		free(prev);
137
+		    mp_free(root->mempool, prev->offset);
138
+		mp_free(root->mempool, prev);
139 139
 	    }
140 140
 	}
141
-	free(root->bm_suffix);
141
+	mp_free(root->mempool, root->bm_suffix);
142 142
     }
143 143
 }
144 144
 
... ...
@@ -34,6 +34,8 @@
34 34
 #include "matcher-bm.h"
35 35
 #include "hashtab.h"
36 36
 
37
+#include "mpool.h"
38
+
37 39
 #define CLI_MATCH_WILDCARD	0xff00
38 40
 #define CLI_MATCH_CHAR		0x0000
39 41
 #define CLI_MATCH_IGNORE	0x0100
... ...
@@ -54,6 +56,9 @@ struct cli_lsig_tdb {
54 54
     const uint32_t *engine, *nos, *ep;
55 55
     const uint32_t *sectoff, *sectrva, *sectvsz, *sectraw, *sectrsz,
56 56
 		   *secturva, *sectuvsz, *secturaw, *sectursz;
57
+#ifdef USE_MPOOL
58
+    mp_t *mempool;
59
+#endif
57 60
 };
58 61
 
59 62
 struct cli_ac_lsig {
... ...
@@ -80,6 +85,9 @@ struct cli_matcher {
80 80
 
81 81
     uint16_t maxpatlen;
82 82
     uint8_t ac_only;
83
+#ifdef USE_MPOOL
84
+    mp_t *mempool;
85
+#endif
83 86
 };
84 87
 
85 88
 struct cli_meta_node {
86 89
new file mode 100644
... ...
@@ -0,0 +1,525 @@
0
+/*
1
+ *  Copyright (C) 2008 Sourcefire, Inc.
2
+ *
3
+ *  Authors: aCaB <acab@clamav.net>
4
+ *
5
+ *  This program is free software; you can redistribute it and/or modify
6
+ *  it under the terms of the GNU General Public License version 2 as
7
+ *  published by the Free Software Foundation.
8
+ *
9
+ *  This program is distributed in the hope that it will be useful,
10
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
+ *  GNU General Public License for more details.
13
+ *
14
+ *  You should have received a copy of the GNU General Public License
15
+ *  along with this program; if not, write to the Free Software
16
+ *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
17
+ *  MA 02110-1301, USA.
18
+ */
19
+
20
+/* a naive pool allocator */
21
+
22
+#if HAVE_CONFIG_H
23
+#include "clamav-config.h"
24
+#endif
25
+
26
+#ifdef USE_MPOOL
27
+
28
+#include <sys/types.h>
29
+#include <sys/stat.h>
30
+#include <fcntl.h>
31
+#ifdef HAVE_UNISTD_H
32
+#include <unistd.h>
33
+#endif
34
+#if HAVE_STRING_H
35
+#include <string.h>
36
+#endif
37
+#include <sys/mman.h>
38
+#include <stddef.h>
39
+
40
+#include "others.h"
41
+
42
+/* #define DEBUGMPOOL /\* DO NOT define *\/ */
43
+#ifdef DEBUGMPOOL
44
+FILE *lfd = NULL;
45
+#define spam(...) cli_warnmsg(lfd, __VA_ARGS__)
46
+#else
47
+#define spam
48
+#endif
49
+
50
+#include "mpool.h"
51
+
52
+/* #define MIN_FRAGSIZE 4096	/\* 1m2.282s *\/ */
53
+/* #define MIN_FRAGSIZE 8192	/\* 0m46.652s *\/ */
54
+/* #define MIN_FRAGSIZE 16384	/\* 0m8.365s *\/ */
55
+/* #define MIN_FRAGSIZE 32768	/\* 0m3.788s *\/ */
56
+/* #define MIN_FRAGSIZE 65536	/\* 0m2.759s *\/ */
57
+/* #define MIN_FRAGSIZE 131072	/\* 0m2.445s *\/ */
58
+#define MIN_FRAGSIZE 262144	/* 0m2.343s */
59
+/* #define MIN_FRAGSIZE 524288	/\* 0m2.387s *\/ */
60
+/* #define MIN_FRAGSIZE 1048576	/\* 0m2.392s *\/ */
61
+/* #define MIN_FRAGSIZE 2097152	/\* 0m2.402s *\/ */
62
+
63
+#if SIZEOF_VOID_P==8
64
+static const unsigned int fragsz[] = {
65
+24, /* (33067) */
66
+32, /* (93970) */
67
+40, /* (731473) */
68
+48, /* (35342) */
69
+56, /* (6967) */
70
+64, /* (442053) */
71
+72, /* (2706) */
72
+80, /* (2281) */
73
+88, /* (3658) */
74
+96, /* (2620) */
75
+104, /* (3705) */
76
+112, /* (3722) */
77
+120, /* (4012) */
78
+128, /* (5161) */
79
+136, /* (22458) */
80
+144, /* (4339) */
81
+152, /* (4315) */
82
+160, /* (12195) */
83
+168, /* (18042) */
84
+/* 176, /\* (341) *\/ */
85
+/* 184, /\* (329) *\/ */
86
+192, /* (202) */
87
+/* 200, /\* (238) *\/ */
88
+/* 208, /\* (166) *\/ */
89
+/* 216, /\* (179) *\/ */
90
+224, /* (216) */
91
+/* 232, /\* (189) *\/ */
92
+/* 240, /\* (157) *\/ */
93
+/* 248, /\* (178) *\/ */
94
+256, /* (133) */
95
+/* 264, /\* (157) *\/ */
96
+/* 272, /\* (140) *\/ */
97
+/* 280, /\* (161) *\/ */
98
+/* 288, /\* (125) *\/ */
99
+/* 296, /\* (141) *\/ */
100
+304, /* (100) */
101
+/* 312, /\* (114) *\/ */
102
+/* 320, /\* (70) *\/ */
103
+/* 328, /\* (13) *\/ */
104
+/* 336, /\* (21) *\/ */
105
+/* 344, /\* (21) *\/ */
106
+352, /* (13) */
107
+/* 360, /\* (26) *\/ */
108
+/* 368, /\* (8) *\/ */
109
+/* 376, /\* (14) *\/ */
110
+/* 384, /\* (5) *\/ */
111
+/* 392, /\* (6) *\/ */
112
+/* 400, /\* (4) *\/ */
113
+/* 408, /\* (2) *\/ */
114
+/* 416, /\* (6) *\/ */
115
+424, /* (20) */
116
+/* 432, /\* (4) *\/ */
117
+/* 440, /\* (4) *\/ */
118
+/* 448, /\* (4) *\/ */
119
+/* 464, /\* (2) *\/ */
120
+/* 472, /\* (2) *\/ */
121
+/* 480, /\* (1) *\/ */
122
+/* 496, /\* (1) *\/ */
123
+/* 512, /\* (2) *\/ */
124
+528, /* (15) */
125
+/* 536, /\* (1) *\/ */
126
+/* 544, /\* (2) *\/ */
127
+/* 552, /\* (1) *\/ */
128
+/* 584, /\* (3) *\/ */
129
+/* 600, /\* (1) *\/ */
130
+/* 624, /\* (1) *\/ */
131
+/* 656, /\* (1) *\/ */
132
+/* 784, /\* (2) *\/ */
133
+1040, /* (15) */
134
+/* 2064, /\* (7456) *\/ */
135
+2072, /* (14) */
136
+4112, /* (14) */
137
+8208, /* (9) */
138
+16400, /* (6) */
139
+32784, /* (4) */
140
+63512, /* (7) */
141
+134408, /* (2) */
142
+507984, /* (7) */
143
+1051040, /* (1) */
144
+2097152
145
+/* ^^ This shouldn't be reached but it's a good fall back
146
+ * MAX_ALLOCATION is 184549376 but that's really not need here */
147
+};
148
+
149
+#else
150
+
151
+static const unsigned int fragsz[] = {
152
+12, /* (2297) */
153
+16, /* (30785) */
154
+20, /* (41460) */
155
+24, /* (69214) */
156
+28, /* (639488) */
157
+32, /* (107920) */
158
+36, /* (454213) */
159
+40, /* (11497) */
160
+44, /* (1688) */
161
+48, /* (5294) */
162
+52, /* (1496) */
163
+56, /* (3738) */
164
+60, /* (1719) */
165
+64, /* (918) */
166
+68, /* (956) */
167
+72, /* (1324) */
168
+76, /* (1905) */
169
+80, /* (1745) */
170
+84, /* (1053) */
171
+88, /* (1566) */
172
+92, /* (2081) */
173
+96, /* (20851) */
174
+100, /* (1882) */
175
+104, /* (1848) */
176
+108, /* (1931) */
177
+112, /* (2079) */
178
+116, /* (1736) */
179
+120, /* (3425) */
180
+124, /* (2115) */
181
+128, /* (1298) */
182
+132, /* (2307) */
183
+136, /* (2033) */
184
+140, /* (2837) */
185
+144, /* (1479) */
186
+148, /* (1607) */
187
+152, /* (10587) */
188
+156, /* (2719) */
189
+160, /* (15311) */
190
+164, /* (196) */
191
+168, /* (145) */
192
+172, /* (211) */
193
+176, /* (140) */
194
+180, /* (116) */
195
+/* 184, /\* (86) *\/ */
196
+188, /* (119) */
197
+192, /* (104) */
198
+/* 196, /\* (99) *\/ */
199
+/* 200, /\* (84) *\/ */
200
+/* 204, /\* (94) *\/ */
201
+/* 208, /\* (86) *\/ */
202
+212, /* (136) */
203
+/* 216, /\* (80) *\/ */
204
+/* 220, /\* (75) *\/ */
205
+/* 224, /\* (97) *\/ */
206
+/* 228, /\* (99) *\/ */
207
+/* 232, /\* (74) *\/ */
208
+236, /* (114) */
209
+/* 240, /\* (64) *\/ */
210
+/* 244, /\* (73) *\/ */
211
+/* 248, /\* (62) *\/ */
212
+/* 252, /\* (71) *\/ */
213
+/* 256, /\* (69) *\/ */
214
+/* 260, /\* (85) *\/ */
215
+/* 264, /\* (71) *\/ */
216
+268, /* (92) */
217
+/* 272, /\* (69) *\/ */
218
+/* 276, /\* (56) *\/ */
219
+/* 280, /\* (69) *\/ */
220
+/* 284, /\* (71) *\/ */
221
+/* 288, /\* (70) *\/ */
222
+/* 292, /\* (62) *\/ */
223
+/* 296, /\* (39) *\/ */
224
+/* 300, /\* (54) *\/ */
225
+/* 304, /\* (43) *\/ */
226
+/* 308, /\* (54) *\/ */
227
+312, /* (30) */
228
+/* 316, /\* (8) *\/ */
229
+/* 320, /\* (5) *\/ */
230
+/* 324, /\* (7) *\/ */
231
+/* 328, /\* (14) *\/ */
232
+/* 332, /\* (13) *\/ */
233
+/* 336, /\* (8) *\/ */
234
+/* 340, /\* (7) *\/ */
235
+/* 344, /\* (6) *\/ */
236
+/* 348, /\* (2) *\/ */
237
+/* 352, /\* (7) *\/ */
238
+/* 356, /\* (18) *\/ */
239
+/* 360, /\* (5) *\/ */
240
+364, /* (12) */
241
+/* 368, /\* (2) *\/ */
242
+/* 372, /\* (4) *\/ */
243
+/* 376, /\* (2) *\/ */
244
+/* 380, /\* (5) *\/ */
245
+/* 384, /\* (1) *\/ */
246
+/* 392, /\* (4) *\/ */
247
+/* 396, /\* (3) *\/ */
248
+/* 404, /\* (4) *\/ */
249
+/* 408, /\* (2) *\/ */
250
+/* 412, /\* (3) *\/ */
251
+/* 416, /\* (2) *\/ */
252
+/* 420, /\* (3) *\/ */
253
+/* 424, /\* (2) *\/ */
254
+428, /* (16) */
255
+/* 432, /\* (4) *\/ */
256
+/* 436, /\* (1) *\/ */
257
+/* 440, /\* (3) *\/ */
258
+/* 452, /\* (1) *\/ */
259
+/* 456, /\* (2) *\/ */
260
+/* 460, /\* (8) *\/ */
261
+/* 468, /\* (1) *\/ */
262
+/* 472, /\* (2) *\/ */
263
+/* 484, /\* (1) *\/ */
264
+/* 492, /\* (4) *\/ */
265
+/* 500, /\* (1) *\/ */
266
+/* 504, /\* (2) *\/ */
267
+/* 508, /\* (1) *\/ */
268
+/* 516, /\* (2) *\/ */
269
+/* 524, /\* (5) *\/ */
270
+532, /* (15) */
271
+/* 536, /\* (3) *\/ */
272
+/* 540, /\* (1) *\/ */
273
+/* 556, /\* (4) *\/ */
274
+/* 576, /\* (3) *\/ */
275
+/* 588, /\* (8) *\/ */
276
+/* 612, /\* (1) *\/ */
277
+/* 616, /\* (1) *\/ */
278
+/* 620, /\* (5) *\/ */
279
+/* 648, /\* (1) *\/ */
280
+/* 652, /\* (1) *\/ */
281
+/* 680, /\* (1) *\/ */
282
+/* 704, /\* (1) *\/ */
283
+/* 716, /\* (1) *\/ */
284
+/* 772, /\* (1) *\/ */
285
+/* 776, /\* (1) *\/ */
286
+1032, /* (7549) */
287
+/* 1044, /\* (14) *\/ */
288
+2076, /* (14) */
289
+4116, /* (9) */
290
+8212, /* (6) */
291
+16404, /* (4) */
292
+63504, /* (7) */
293
+135636, /* (2) */
294
+253992, /* (7) */
295
+1050864, /* (1) */
296
+2097152
297
+};
298
+#endif
299
+#define FRAGSBITS (sizeof(fragsz)/sizeof(fragsz[0]))
300
+
301
+struct MPMAP {
302
+  struct MPMAP *next;
303
+  unsigned int size;
304
+  unsigned int usize;
305
+};
306
+
307
+struct MP {
308
+  unsigned int psize;
309
+  struct FRAG *avail[FRAGSBITS];
310
+  struct MPMAP mpm;
311
+};
312
+
313
+struct FRAG {
314
+  struct FRAG *next;
315
+  unsigned int sbits;
316
+  void *fake;
317
+};
318
+#define FRAG_OVERHEAD (offsetof(struct FRAG, fake))
319
+
320
+#define align_to_voidptr(size) (((size) / sizeof(void *) + ((size) % sizeof(void *) != 0)) * sizeof(void *))
321
+#define roundup(size) (FRAG_OVERHEAD + align_to_voidptr(size))
322
+
323
+static unsigned int align_to_pagesize(struct MP *mp, unsigned int size) {
324
+  return (size / mp->psize + (size % mp->psize != 0)) * mp->psize;
325
+}
326
+
327
+static unsigned int to_bits(unsigned int size) {
328
+  unsigned int i;
329
+  for(i=0; i<FRAGSBITS; i++)
330
+    if(fragsz[i] >= size) return i;
331
+  return FRAGSBITS;
332
+}
333
+static unsigned int from_bits(unsigned int bits) {
334
+  if (bits >= FRAGSBITS) return 0;
335
+  return fragsz[bits];
336
+}
337
+
338
+struct MP *mp_create() {
339
+  struct MP mp, *mp_p;
340
+  unsigned int sz;
341
+  memset(&mp, 0, sizeof(mp));
342
+  mp.psize = getpagesize();
343
+#ifdef DEBUGMPOOL
344
+  lfd = fopen("mmpool_log", "w");
345
+#endif
346
+  sz = align_to_pagesize(&mp, MIN_FRAGSIZE);
347
+  mp.mpm.usize = align_to_voidptr(sizeof(struct MPMAP));
348
+  mp.mpm.size = sz - align_to_voidptr(sizeof(mp));
349
+  if ((mp_p = (struct MP *)mmap(NULL, sz, PROT_READ | PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0)) == MAP_FAILED)
350
+    return NULL;
351
+  memcpy(mp_p, &mp, sizeof(mp));
352
+  spam("Map created @ %p->%p - size %u out of %u\n", mp_p, (void*)mp_p + mp.mpm.size, mp.mpm.usize, mp.mpm.size);
353
+  return mp_p;
354
+}
355
+
356
+void mp_destroy(struct MP *mp) {
357
+  struct MPMAP *mpm_next = mp->mpm.next, *mpm;
358
+  while((mpm = mpm_next)) {
359
+    mpm_next = mpm->next;
360
+    munmap((void *)mpm, mpm->size);
361
+  }
362
+  munmap((void *)mp, mp->mpm.size + align_to_voidptr(sizeof(mp)));
363
+  spam("Map destroyed @ %p\n", mp);
364
+}
365
+
366
+void mp_flush(struct MP *mp) {
367
+  struct MPMAP *mpm_next = mp->mpm.next, *mpm;
368
+  while((mpm = mpm_next)) {
369
+    mpm_next = mpm->next;
370
+    munmap((void *)mpm + align_to_pagesize(mp, mpm->usize), mpm->size - align_to_pagesize(mp, mpm->usize));
371
+    mpm->size = mpm->usize = align_to_pagesize(mp, mpm->usize);
372
+  }
373
+  munmap(&mp->mpm + align_to_pagesize(mp, mp->mpm.usize + align_to_voidptr(sizeof(mp))), mp->mpm.size - align_to_pagesize(mp, mp->mpm.usize + align_to_voidptr(sizeof(mp))));
374
+  mp->mpm.size = mp->mpm.usize;
375
+  spam("Map flushed @ %p\n", mp);
376
+}
377
+
378
+void *mp_malloc(struct MP *mp, size_t size) {
379
+  unsigned int i, j, needed = align_to_voidptr(size + FRAG_OVERHEAD);
380
+  const unsigned int sbits = to_bits(needed);
381
+  struct FRAG *f = NULL;
382
+  struct MPMAP *mpm = &mp->mpm;
383
+
384
+  /*  check_all(mp); */
385
+  if (!size || sbits == FRAGSBITS) {
386
+    cli_errmsg("mp_malloc(): Attempt to allocate %lu bytes. Please report to http://bugs.clamav.net\n", (unsigned long int) size);
387
+    return NULL;
388
+  }
389
+
390
+  /* Case 1: We have a free'd frag */
391
+  if((f = mp->avail[sbits])) {
392
+    spam("malloc %p size %u (freed)\n", f, roundup(size));
393
+    mp->avail[sbits] = f->next;
394
+    return &f->fake;
395
+  }
396
+
397
+  if (!(needed = from_bits(sbits))) {
398
+    cli_errmsg("mp_malloc(): Attempt to allocate %lu bytes. Please report to http://bugs.clamav.net\n", (unsigned long int) size);
399
+    return NULL;
400
+  }
401
+
402
+  /* Case 2: We have nuff room available for this frag already */
403
+  while(mpm) {
404
+    if(mpm->size - mpm->usize >= needed) {
405
+      f = (struct FRAG *)((void *)mpm + mpm->usize);
406
+      spam("malloc %p size %u (hole)\n", f, roundup(size));
407
+      mpm->usize += needed;
408
+      f->sbits = sbits;
409
+      return &f->fake;
410
+    }
411
+    mpm = mpm->next;
412
+  }
413
+
414
+  /* Case 3: We allocate more */
415
+  if (needed + align_to_voidptr(sizeof(*mpm)) > MIN_FRAGSIZE)
416
+  i = align_to_pagesize(mp, needed + align_to_voidptr(sizeof(*mpm)));
417
+  else
418
+  i = align_to_pagesize(mp, MIN_FRAGSIZE);
419
+  
420
+  if ((mpm = (struct MPMAP *)mmap(NULL, i, PROT_READ | PROT_WRITE, MAP_PRIVATE|ANONYMOUS_MAP, -1, 0)) == MAP_FAILED) {
421
+    cli_errmsg("mp_malloc(): Can't allocate memory (%lu bytes).\n", (unsigned long int)i);
422
+    spam("failed to alloc %u bytes (%u requested)\n", i, size);
423
+    return NULL;
424
+  }
425
+  mpm->size = i;
426
+  mpm->usize = needed + align_to_voidptr(sizeof(*mpm));
427
+  mpm->next = mp->mpm.next;
428
+  mp->mpm.next = mpm;
429
+  f = (struct FRAG *)((void *)mpm + align_to_voidptr(sizeof(*mpm)));
430
+  spam("malloc %p size %u (new map)\n", f, roundup(size));
431
+  f->sbits = sbits;
432
+  return &f->fake;
433
+}
434
+
435
+void mp_free(struct MP *mp, void *ptr) {
436
+  struct FRAG *f = (struct FRAG *)(ptr - FRAG_OVERHEAD);
437
+  if (!ptr) return;
438
+
439
+  f->next = mp->avail[f->sbits];
440
+  mp->avail[f->sbits] = f;
441
+  spam("free @ %p\n", f);
442
+}
443
+
444
+void *mp_calloc(struct MP *mp, size_t nmemb, size_t size) {
445
+  unsigned int needed = nmemb*size;
446
+  void *ptr;
447
+
448
+  if(!needed) return NULL;
449
+  if((ptr = mp_malloc(mp, needed)))
450
+    memset(ptr, 0, needed);
451
+  return ptr;
452
+}
453
+
454
+void *mp_realloc(struct MP *mp, void *ptr, size_t size) {
455
+  struct FRAG *f = (struct FRAG *)(ptr - FRAG_OVERHEAD);
456
+  unsigned int csize;
457
+  void *new_ptr;
458
+  if (!ptr) return mp_malloc(mp, size);
459
+
460
+  spam("realloc @ %p (size %u -> %u))\n", f, from_bits(f->sbits), size);
461
+  if(!size || !(csize = from_bits(f->sbits))) {
462
+    cli_errmsg("mp_realloc(): Attempt to allocate %lu bytes. Please report to http://bugs.clamav.net\n", (unsigned long int) size);
463
+    return NULL;
464
+  }
465
+  csize -= FRAG_OVERHEAD;
466
+  if (csize >= size) return ptr;
467
+  if (!(new_ptr = mp_malloc(mp, size)))
468
+    return NULL;
469
+  memcpy(new_ptr, ptr, csize);
470
+  mp_free(mp, ptr);
471
+  return new_ptr;
472
+}
473
+
474
+void *mp_realloc2(struct MP *mp, void *ptr, size_t size) {
475
+  struct FRAG *f = (struct FRAG *)(ptr - FRAG_OVERHEAD);
476
+  unsigned int csize;
477
+  void *new_ptr;
478
+  if (!ptr) return mp_malloc(mp, size);
479
+
480
+  spam("realloc @ %p (size %u -> %u))\n", f, from_bits(f->sbits), size);
481
+  if(!size || !(csize = from_bits(f->sbits))) {
482
+    cli_errmsg("mp_realloc2(): Attempt to allocate %lu bytes. Please report to http://bugs.clamav.net\n", (unsigned long int) size);
483
+    mp_free(mp, ptr);
484
+    return NULL;
485
+  }
486
+  csize -= FRAG_OVERHEAD;
487
+  if (csize >= size) return ptr;
488
+  if ((new_ptr = mp_malloc(mp, size)))
489
+    memcpy(new_ptr, ptr, csize);
490
+  mp_free(mp, ptr);
491
+  return new_ptr;
492
+}
493
+
494
+#ifdef DEBUGMPOOL
495
+void mp_stats(struct MP *mp) {
496
+  unsigned int i=0, ta=0, tu=0;
497
+  struct MPMAP *mpm = &mp->mpm;
498
+
499
+  cli_warnmsg("MEMORY POOL STATISTICS\n map  \tsize\tused\t%\n");
500
+  while(mpm) {
501
+    cli_warnmsg("- %u\t%u\t%u\t%f%%\n", i, mpm->size, mpm->usize, (float)mpm->usize/(float)mpm->size*100);
502
+    ta+=mpm->size;
503
+    tu+=mpm->usize;
504
+    i++;
505
+    mpm = mpm->next;
506
+  }
507
+  cli_warnmsg("MEMORY POOL SUMMARY\nMaps: %u\nTotal: %u\nUsed: %u (%f%%)\n", i, ta, tu, (float)tu/(float)ta*100);
508
+}
509
+
510
+void check_all(struct MP *mp) {
511
+  struct MPMAP *mpm = &mp->mpm;
512
+  while(mpm) {
513
+    volatile unsigned char *c = (unsigned char *)mpm;
514
+    unsigned int len = mpm->size;
515
+    spam("checking object %p - size %u\n", mpm, len);
516
+    while (len--) {
517
+      c[len];
518
+    }
519
+    mpm=mpm->next;
520
+  }
521
+}
522
+#endif /* DEBUGMPOOL */
523
+
524
+#endif /* USE_MPOOL */
0 525
new file mode 100644
... ...
@@ -0,0 +1,46 @@
0
+/*
1
+ *  Copyright (C) 2008 Sourcefire, Inc.
2
+ *
3
+ *  Authors: aCaB <acab@clamav.net>
4
+ *
5
+ *  This program is free software; you can redistribute it and/or modify
6
+ *  it under the terms of the GNU General Public License version 2 as
7
+ *  published by the Free Software Foundation.
8
+ *
9
+ *  This program is distributed in the hope that it will be useful,
10
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
+ *  GNU General Public License for more details.
13
+ *
14
+ *  You should have received a copy of the GNU General Public License
15
+ *  along with this program; if not, write to the Free Software
16
+ *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
17
+ *  MA 02110-1301, USA.
18
+ */
19
+
20
+#ifndef MPOOL_H
21
+#define MPOOL_H
22
+
23
+#ifdef USE_MPOOL
24
+
25
+typedef struct MP mp_t;
26
+
27
+mp_t *mp_create(void);
28
+void mp_destroy(mp_t *mp);
29
+void *mp_malloc(mp_t *mp, size_t size);
30
+void mp_free(mp_t *mp, void *ptr);
31
+void *mp_calloc(mp_t *mp, size_t nmemb, size_t size);
32
+void *mp_realloc(mp_t *mp, void *ptr, size_t size);
33
+void *mp_realloc2(mp_t *mp, void *ptr, size_t size);
34
+
35
+#else /* USE_MPOOL */
36
+
37
+#define mp_malloc(a, b) cli_malloc(b)
38
+#define mp_free(a, b) free(b)
39
+#define mp_calloc(a, b, c) cli_calloc(b, c)
40
+#define mp_realloc(a, b, c) cli_realloc(b, c)
41
+#define mp_realloc2(a, b, c) cli_realloc2(b, c)
42
+
43
+#endif /* USE_MPOOL */
44
+
45
+#endif
... ...
@@ -58,6 +58,9 @@ int init_domainlist(struct cl_engine* engine)
58 58
 		engine->domainlist_matcher = (struct regex_matcher *) cli_malloc(sizeof(struct regex_matcher));
59 59
 		if(!engine->domainlist_matcher)
60 60
 			return CL_EMEM;
61
+#ifdef USE_MPOOL
62
+		((struct regex_matcher*)engine->domainlist_matcher)->mempool = engine->mempool;
63
+#endif
61 64
 		return init_regex_list(engine->domainlist_matcher);
62 65
 	}
63 66
 	else
... ...
@@ -45,6 +45,8 @@
45 45
 #include "phish_whitelist.h"
46 46
 #include "regex_list.h"
47 47
 
48
+#include "mpool.h"
49
+
48 50
 int whitelist_match(const struct cl_engine* engine,char* real_url,const char* display_url,int hostOnly)
49 51
 {
50 52
 	const char* info;/*unused*/
... ...
@@ -55,7 +57,10 @@ int whitelist_match(const struct cl_engine* engine,char* real_url,const char* di
55 55
 int init_whitelist(struct cl_engine* engine)
56 56
 {
57 57
 	if(engine) {
58
-		engine->whitelist_matcher = (struct regex_matcher *) cli_malloc(sizeof(struct regex_matcher));
58
+		engine->whitelist_matcher = (struct regex_matcher *) mp_malloc(engine->mempool, sizeof(struct regex_matcher));
59
+#ifdef USE_MPOOL
60
+		((struct regex_matcher *)(engine->whitelist_matcher))->mempool = engine->mempool;
61
+#endif
59 62
 		if(!engine->whitelist_matcher)
60 63
 			return CL_EMEM;
61 64
 		return	init_regex_list(engine->whitelist_matcher);
... ...
@@ -72,8 +77,8 @@ int is_whitelist_ok(const struct cl_engine* engine)
72 72
 void whitelist_done(struct cl_engine* engine)
73 73
 {
74 74
 	if(engine && engine->whitelist_matcher) {
75
-		regex_list_done(engine->whitelist_matcher);	
76
-		free(engine->whitelist_matcher);
75
+		regex_list_done(engine->whitelist_matcher);
76
+		mp_free(engine->mempool, engine->whitelist_matcher);
77 77
 		engine->whitelist_matcher = NULL;
78 78
 	}
79 79
 }
... ...
@@ -52,6 +52,8 @@
52 52
 #include "md5.h"
53 53
 #include <assert.h>
54 54
 
55
+#include "mpool.h"
56
+
55 57
 #define DOMAIN_REAL 1
56 58
 #define DOMAIN_DISPLAY 0
57 59
 
... ...
@@ -857,7 +859,7 @@ int phishing_init(struct cl_engine* engine)
857 857
 {
858 858
 	struct phishcheck* pchk;
859 859
 	if(!engine->phishcheck) {
860
-		pchk = engine->phishcheck = cli_malloc(sizeof(struct phishcheck));
860
+		pchk = engine->phishcheck = mp_malloc(engine->mempool, sizeof(struct phishcheck));
861 861
 		if(!pchk)
862 862
 			return CL_EMEM;
863 863
 		pchk->is_disabled=1;
... ...
@@ -875,7 +877,7 @@ int phishing_init(struct cl_engine* engine)
875 875
 	cli_dbgmsg("Initializing phishcheck module\n");
876 876
 
877 877
 	if(build_regex(&pchk->preg_numeric,numeric_url_regex,1)) {
878
-		free(pchk);
878
+		mp_free(engine->mempool, pchk);
879 879
 		engine->phishcheck = NULL;
880 880
 		return CL_EFORMAT;
881 881
 	}
... ...
@@ -895,7 +897,7 @@ void phishing_done(struct cl_engine* engine)
895 895
 	domainlist_done(engine);
896 896
 	if(pchk) {
897 897
 		cli_dbgmsg("Freeing phishcheck struct\n");
898
-		free(pchk);
898
+		mp_free(engine->mempool, pchk);
899 899
 	}
900 900
 	cli_dbgmsg("Phishcheck cleaned up\n");
901 901
 }
... ...
@@ -67,6 +67,8 @@
67 67
 #include <stddef.h>
68 68
 #endif
69 69
 
70
+#include "mpool.h"
71
+
70 72
 #ifdef CL_THREAD_SAFE
71 73
 #  include <pthread.h>
72 74
 static pthread_mutex_t cli_ref_mutex = PTHREAD_MUTEX_INITIALIZER;
... ...
@@ -279,29 +281,58 @@ int cli_parse_add(struct cli_matcher *root, const char *virname, const char *hex
279 279
 	}
280 280
 
281 281
     } else {
282
-	bm_new = (struct cli_bm_patt *) cli_calloc(1, sizeof(struct cli_bm_patt));
282
+	bm_new = (struct cli_bm_patt *) mp_calloc(root->mempool, 1, sizeof(struct cli_bm_patt));
283 283
 	if(!bm_new)
284 284
 	    return CL_EMEM;
285 285
 
286
-	if(!(bm_new->pattern = (unsigned char *) cli_hex2str(hexsig))) {
287
-	    free(bm_new);
286
+#ifdef USE_MPOOL
287
+{
288
+    unsigned char *mpoolhexsig = (unsigned char *) cli_hex2str(hexsig);
289
+    if(mpoolhexsig) {
290
+        unsigned int mpoolhexsigsz = strlen(hexsig) / 2 + 1;
291
+	if((bm_new->pattern = mp_malloc(root->mempool, mpoolhexsigsz)))
292
+	    memcpy(bm_new->pattern, mpoolhexsig, mpoolhexsigsz);
293
+	free(mpoolhexsig);
294
+    } else bm_new->pattern = NULL;
295
+}
296
+#else
297
+        bm_new->pattern = (unsigned char *) cli_hex2str(hexsig);
298
+#endif
299
+	if(!bm_new->pattern) {
300
+	    mp_free(root->mempool, bm_new);
288 301
 	    return CL_EMALFDB;
289 302
 	}
290 303
 	bm_new->length = strlen(hexsig) / 2;
291 304
 
305
+#ifdef USE_MPOOL
306
+{
307
+    char *mpoolvirname = cli_virname((char *) virname, options & CL_DB_OFFICIAL, 0);
308
+    if(mpoolvirname) {
309
+	if((bm_new->virname = mp_malloc(root->mempool, strlen(mpoolvirname) + 1)))
310
+	    strcpy(bm_new->virname, mpoolvirname);
311
+	free(mpoolvirname);
312
+    } else bm_new->virname = NULL;
313
+}
314
+#else
292 315
 	bm_new->virname = cli_virname((char *) virname, options & CL_DB_OFFICIAL, 0);
316
+#endif
293 317
 	if(!bm_new->virname) {
294
-	    free(bm_new->pattern);
295
-	    free(bm_new);
318
+	    mp_free(root->mempool, bm_new->pattern);
319
+	    mp_free(root->mempool, bm_new);
296 320
 	    return CL_EMEM;
297 321
 	}
298 322
 
299 323
 	if(offset) {
324
+#ifdef USE_MPOOL
325
+	    if((bm_new->offset = mp_malloc(root->mempool, strlen(offset) + 1)))
326
+	        strcpy(bm_new->offset, offset);
327
+#else
300 328
 	    bm_new->offset = cli_strdup(offset);
329
+#endif
301 330
 	    if(!bm_new->offset) {
302
-		free(bm_new->pattern);
303
-		free(bm_new->virname);
304
-		free(bm_new);
331
+	        mp_free(root->mempool, bm_new->pattern);
332
+		mp_free(root->mempool, bm_new->virname);
333
+		mp_free(root->mempool, bm_new);
305 334
 		return CL_EMEM;
306 335
 	    }
307 336
 	}
... ...
@@ -313,9 +344,9 @@ int cli_parse_add(struct cli_matcher *root, const char *virname, const char *hex
313 313
 
314 314
 	if((ret = cli_bm_addpatt(root, bm_new))) {
315 315
 	    cli_errmsg("cli_parse_add(): Problem adding signature (4).\n");
316
-	    free(bm_new->pattern);
317
-	    free(bm_new->virname);
318
-	    free(bm_new);
316
+	    mp_free(root->mempool, bm_new->pattern);
317
+	    mp_free(root->mempool, bm_new->virname);
318
+	    mp_free(root->mempool, bm_new);
319 319
 	    return ret;
320 320
 	}
321 321
     }
... ...
@@ -339,14 +370,20 @@ int cli_initengine(struct cl_engine **engine, unsigned int options)
339 339
 
340 340
 	(*engine)->refcount = 1;
341 341
 
342
-	(*engine)->root = cli_calloc(CLI_MTARGETS, sizeof(struct cli_matcher *));
342
+#ifdef USE_MPOOL
343
+	if(!((*engine)->mempool = mp_create())) {
344
+	    cli_errmsg("Can't allocate memory for memory pool!\n");
345
+	    return CL_EMEM;
346
+	}
347
+#endif
348
+	(*engine)->root = mp_calloc((*engine)->mempool, CLI_MTARGETS, sizeof(struct cli_matcher *));
343 349
 	if(!(*engine)->root) {
344 350
 	    /* no need to free previously allocated memory here */
345 351
 	    cli_errmsg("Can't allocate memory for roots!\n");
346 352
 	    return CL_EMEM;
347 353
 	}
348 354
 
349
-	(*engine)->dconf = cli_dconf_init();
355
+	(*engine)->dconf = cli_mp_dconf_init((*engine)->mempool);
350 356
 	if(!(*engine)->dconf) {
351 357
 	    cli_errmsg("Can't initialize dynamic configuration\n");
352 358
 	    return CL_EMEM;
... ...
@@ -369,7 +406,10 @@ static int cli_initroots(struct cl_engine *engine, unsigned int options)
369 369
     for(i = 0; i < CLI_MTARGETS; i++) {
370 370
 	if(!engine->root[i]) {
371 371
 	    cli_dbgmsg("Initializing engine->root[%d]\n", i);
372
-	    root = engine->root[i] = (struct cli_matcher *) cli_calloc(1, sizeof(struct cli_matcher));
372
+	    root = engine->root[i] = (struct cli_matcher *) mp_calloc(engine->mempool, 1, sizeof(struct cli_matcher));
373
+#ifdef USE_MPOOL
374
+	    root->mempool = engine->mempool;
375
+#endif
373 376
 	    if(!root) {
374 377
 		cli_errmsg("cli_initroots: Can't allocate memory for cli_matcher\n");
375 378
 		return CL_EMEM;
... ...
@@ -791,7 +831,7 @@ static int lsigattribs(char *attribs, struct cli_lsig_tdb *tdb)
791 791
 	switch(apt->type) {
792 792
 	    case CLI_TDB_UINT:
793 793
 		off[i] = cnt = tdb->cnt[CLI_TDB_UINT]++;
794
-		tdb->val = (uint32_t *) cli_realloc2(tdb->val, tdb->cnt[CLI_TDB_UINT] * sizeof(uint32_t));
794
+		tdb->val = (uint32_t *) mp_realloc2(tdb->mempool, tdb->val, tdb->cnt[CLI_TDB_UINT] * sizeof(uint32_t));
795 795
 		if(!tdb->val) {
796 796
 		    tdb->cnt[CLI_TDB_UINT] = 0;
797 797
 		    return -1;
... ...
@@ -807,7 +847,7 @@ static int lsigattribs(char *attribs, struct cli_lsig_tdb *tdb)
807 807
 		*pt2++ = 0;
808 808
 		off[i] = cnt = tdb->cnt[CLI_TDB_RANGE];
809 809
 		tdb->cnt[CLI_TDB_RANGE] += 2;
810
-		tdb->range = (uint32_t *) cli_realloc2(tdb->range, tdb->cnt[CLI_TDB_RANGE] * sizeof(uint32_t));
810
+		tdb->range = (uint32_t *) mp_realloc2(tdb->mempool, tdb->range, tdb->cnt[CLI_TDB_RANGE] * sizeof(uint32_t));
811 811
 		if(!tdb->range) {
812 812
 		    tdb->cnt[CLI_TDB_RANGE] = 0;
813 813
 		    return -1;
... ...
@@ -823,7 +863,7 @@ static int lsigattribs(char *attribs, struct cli_lsig_tdb *tdb)
823 823
 		}
824 824
 		off[i] = cnt = tdb->cnt[CLI_TDB_RANGE];
825 825
 		tdb->cnt[CLI_TDB_RANGE] += 3;
826
-		tdb->range = (uint32_t *) cli_realloc2(tdb->range, tdb->cnt[CLI_TDB_RANGE] * sizeof(uint32_t));
826
+		tdb->range = (uint32_t *) mp_realloc2(tdb->mempool, tdb->range, tdb->cnt[CLI_TDB_RANGE] * sizeof(uint32_t));
827 827
 		if(!tdb->range) {
828 828
 		    tdb->cnt[CLI_TDB_RANGE] = 0;
829 829
 		    return -1;
... ...
@@ -840,7 +880,7 @@ static int lsigattribs(char *attribs, struct cli_lsig_tdb *tdb)
840 840
 	    case CLI_TDB_STR:
841 841
 		off[i] = cnt = tdb->cnt[CLI_TDB_STR];
842 842
 		tdb->cnt[CLI_TDB_STR] += strlen(pt) + 1;
843
-		tdb->str = (char *) cli_realloc2(tdb->str, tdb->cnt[CLI_TDB_STR] * sizeof(char));
843
+		tdb->str = (char *) mp_realloc2(tdb->mempool, tdb->str, tdb->cnt[CLI_TDB_STR] * sizeof(char));
844 844
 		if(!tdb->str) {
845 845
 		    cli_errmsg("lsigattribs: Can't allocate memory for tdb->str\n");
846 846
 		    return -1;
... ...
@@ -882,13 +922,14 @@ static int lsigattribs(char *attribs, struct cli_lsig_tdb *tdb)
882 882
     return 0;
883 883
 }
884 884
 
885
-#define FREE_TDB(x)		\
886
-    if(x.cnt[CLI_TDB_UINT])	\
887
-	free(x.val);		\
888
-    if(x.cnt[CLI_TDB_RANGE])    \
889
-	free(x.range);		\
890
-    if(x.cnt[CLI_TDB_STR])	\
891
-	free(x.str);
885
+#define FREE_TDB(x) do {		\
886
+  if(x.cnt[CLI_TDB_UINT])		\
887
+    mp_free(x.mempool, x.val);		\
888
+  if(x.cnt[CLI_TDB_RANGE])		\
889
+    mp_free(x.mempool, x.range);	\
890
+  if(x.cnt[CLI_TDB_STR])		\
891
+    mp_free(x.mempool, x.str);		\
892
+  } while(0);
892 893
 
893 894
 #define LDB_TOKENS 67
894 895
 static int cli_loadldb(FILE *fs, struct cl_engine **engine, unsigned int *signo, unsigned int options, struct cli_dbio *dbio, const char *dbname)
... ...
@@ -954,6 +995,9 @@ static int cli_loadldb(FILE *fs, struct cl_engine **engine, unsigned int *signo,
954 954
 
955 955
 	/* TDB */
956 956
 	memset(&tdb, 0, sizeof(tdb));
957
+#ifdef USE_MPOOL
958
+	tdb.mempool = (*engine)->mempool;
959
+#endif
957 960
 
958 961
 	if(lsigattribs(tokens[1], &tdb) == -1) {
959 962
 	    FREE_TDB(tdb);
... ...
@@ -988,19 +1032,24 @@ static int cli_loadldb(FILE *fs, struct cl_engine **engine, unsigned int *signo,
988 988
 
989 989
 	root = (*engine)->root[tdb.target[0]];
990 990
 
991
-	lsig = (struct cli_ac_lsig *) cli_calloc(1, sizeof(struct cli_ac_lsig));
991
+	lsig = (struct cli_ac_lsig *) mp_calloc((*engine)->mempool, 1, sizeof(struct cli_ac_lsig));
992 992
 	if(!lsig) {
993 993
 	    cli_errmsg("cli_loadldb: Can't allocate memory for lsig\n");
994 994
 	    FREE_TDB(tdb);
995 995
 	    ret = CL_EMEM;
996 996
 	    break;
997 997
 	}
998
+#ifdef USE_MPOOL
999
+	if((lsig->logic = mp_malloc((*engine)->mempool, strlen(logic)+1)))
1000
+	    strcpy(lsig->logic, logic);
1001
+#else
998 1002
 	lsig->logic = cli_strdup(logic);
1003
+#endif
999 1004
 	if(!lsig->logic) {
1000 1005
 	    cli_errmsg("cli_loadldb: Can't allocate memory for lsig->logic\n");
1001 1006
 	    FREE_TDB(tdb);
1002 1007
 	    ret = CL_EMEM;
1003
-	    free(lsig);
1008
+	    mp_free((*engine)->mempool, lsig);
1004 1009
 	    break;
1005 1010
 	}
1006 1011
 
... ...
@@ -1008,12 +1057,12 @@ static int cli_loadldb(FILE *fs, struct cl_engine **engine, unsigned int *signo,
1008 1008
 	memcpy(&lsig->tdb, &tdb, sizeof(tdb));
1009 1009
 
1010 1010
 	root->ac_lsigs++;
1011
-	newtable = (struct cli_ac_lsig **) cli_realloc(root->ac_lsigtable, root->ac_lsigs * sizeof(struct cli_ac_lsig *));
1011
+	newtable = (struct cli_ac_lsig **) mp_realloc((*engine)->mempool, root->ac_lsigtable, root->ac_lsigs * sizeof(struct cli_ac_lsig *));
1012 1012
 	if(!newtable) {
1013 1013
 	    root->ac_lsigs--;
1014 1014
 	    cli_errmsg("cli_loadldb: Can't realloc root->ac_lsigtable\n");
1015 1015
 	    FREE_TDB(tdb);
1016
-	    free(lsig);
1016
+	    mp_free((*engine)->mempool, lsig);
1017 1017
 	    ret = CL_EMEM;
1018 1018
 	    break;
1019 1019
 	}
... ...
@@ -1138,25 +1187,42 @@ static int cli_loadftm(FILE *fs, struct cl_engine **engine, unsigned int options
1138 1138
 		break;
1139 1139
 
1140 1140
 	} else if(atoi(tokens[0]) == 0) { /* memcmp() */
1141
-	    new = (struct cli_ftype *) cli_malloc(sizeof(struct cli_ftype));
1141
+	    new = (struct cli_ftype *) mp_malloc((*engine)->mempool, sizeof(struct cli_ftype));
1142 1142
 	    if(!new) {
1143 1143
 		ret = CL_EMEM;
1144 1144
 		break;
1145 1145
 	    }
1146 1146
 	    new->type = type;
1147 1147
 	    new->offset = atoi(tokens[1]);
1148
+#ifdef USE_MPOOL
1149
+{
1150
+    unsigned char *mpoolmagic = cli_hex2str(tokens[2]);
1151
+    if(mpoolmagic) {
1152
+	unsigned int mpoolmagicsz = strlen(tokens[2]) / 2 + 1;
1153
+        if((new->magic = mp_malloc((*engine)->mempool, mpoolmagicsz)))
1154
+	    memcpy(new->magic, mpoolmagic, mpoolmagicsz);
1155
+	free(mpoolmagic);
1156
+    } else new->magic = NULL;
1157
+}
1158
+#else
1148 1159
 	    new->magic = (unsigned char *) cli_hex2str(tokens[2]);
1160
+#endif
1149 1161
 	    if(!new->magic) {
1150 1162
 		cli_errmsg("cli_loadftm: Can't decode the hex string\n");
1151 1163
 		ret = CL_EMALFDB;
1152
-		free(new);
1164
+		mp_free((*engine)->mempool, new);
1153 1165
 		break;
1154 1166
 	    }
1155 1167
 	    new->length = strlen(tokens[2]) / 2;
1168
+#ifdef USE_MPOOL
1169
+	   if((new->tname = mp_malloc((*engine)->mempool, strlen(tokens[3])+1)))
1170
+		strcpy(new->tname, tokens[3]);
1171
+#else
1156 1172
 	    new->tname = cli_strdup(tokens[3]);
1173
+#endif
1157 1174
 	    if(!new->tname) {
1158
-		free(new->magic);
1159
-		free(new);
1175
+		mp_free((*engine)->mempool, new->magic);
1176
+		mp_free((*engine)->mempool, new);
1160 1177
 		ret = CL_EMEM;
1161 1178
 		break;
1162 1179
 	    }
... ...
@@ -1211,22 +1277,33 @@ static int cli_loadign(FILE *fs, struct cl_engine **engine, unsigned int options
1211 1211
     while(cli_dbgets(buffer, FILEBUFF, fs, dbio)) {
1212 1212
 	line++;
1213 1213
 	cli_chomp(buffer);
1214
-
1215
-	new = (struct cli_ignsig *) cli_calloc(1, sizeof(struct cli_ignsig));
1214
+	new = (struct cli_ignsig *) mp_calloc((*engine)->mempool, 1, sizeof(struct cli_ignsig));
1216 1215
 	if(!new) {
1217 1216
 	    ret = CL_EMEM;
1218 1217
 	    break;
1219 1218
 	}
1220 1219
 
1221
-	if(!(new->dbname = cli_strtok(buffer, 0, ":"))) {
1222
-	    free(new);
1220
+#ifdef USE_MPOOL
1221
+{
1222
+    unsigned char *mpooldbname = cli_strtok(buffer, 0, ":");
1223
+    if(mpooldbname) {
1224
+        if((new->dbname = mp_malloc((*engine)->mempool, strlen(mpooldbname) + 1)))
1225
+	    strcpy(new->dbname, mpooldbname);
1226
+	free(mpooldbname);
1227
+    } else new->dbname = NULL;
1228
+}
1229
+#else
1230
+	new->dbname = cli_strtok(buffer, 0, ":");
1231
+#endif
1232
+	if(!new->dbname) {
1233
+	    mp_free((*engine)->mempool, new);
1223 1234
 	    ret = CL_EMALFDB;
1224 1235
 	    break;
1225 1236
 	}
1226 1237
 
1227 1238
 	if(!(pt = cli_strtok(buffer, 1, ":"))) {
1228
-	    free(new->dbname);
1229
-	    free(new);
1239
+	    mp_free((*engine)->mempool, new->dbname);
1240
+	    mp_free((*engine)->mempool, new);
1230 1241
 	    ret = CL_EMALFDB;
1231 1242
 	    break;
1232 1243
 	} else {
... ...
@@ -1237,9 +1314,21 @@ static int cli_loadign(FILE *fs, struct cl_engine **engine, unsigned int options
1237 1237
 	if((ret = hashset_addkey(&ignored->hs, new->line)))
1238 1238
 	    break;
1239 1239
 
1240
-	if(!(new->signame = cli_strtok(buffer, 2, ":"))) {
1241
-	    free(new->dbname);
1242
-	    free(new);
1240
+#ifdef USE_MPOOL
1241
+{
1242
+    unsigned char *mpoolsigname = cli_strtok(buffer, 2, ":");
1243
+    if(mpoolsigname) {
1244
+        if((new->signame = mp_malloc((*engine)->mempool, strlen(mpoolsigname) + 1)))
1245
+	    strcpy(new->signame, mpoolsigname);
1246
+	free(mpoolsigname);
1247
+    } else new->signame = NULL;
1248
+}
1249
+#else
1250
+	new->signame = cli_strtok(buffer, 2, ":");
1251
+#endif
1252
+	if(!new->signame) {
1253
+	    mp_free((*engine)->mempool, new->dbname);
1254
+	    mp_free((*engine)->mempool, new);
1243 1255
 	    ret = CL_EMALFDB;
1244 1256
 	    break;
1245 1257
 	}
... ...
@@ -1266,9 +1355,9 @@ static void cli_freeign(struct cl_engine *engine)
1266 1266
 	while(ignored->list) {
1267 1267
 	    pt = ignored->list;
1268 1268
 	    ignored->list = ignored->list->next;
1269
-	    free(pt->dbname);
1270
-	    free(pt->signame);
1271
-	    free(pt);
1269
+	    mp_free(engine->mempool, pt->dbname);
1270
+	    mp_free(engine->mempool, pt->signame);
1271
+	    mp_free(engine->mempool,pt);
1272 1272
 	}
1273 1273
 	hashset_destroy(&ignored->hs);
1274 1274
 	free(engine->ignored);
... ...
@@ -1292,16 +1381,18 @@ static int cli_md5db_init(struct cl_engine **engine, unsigned int mode)
1292 1292
 
1293 1293
 
1294 1294
     if(mode == MD5_HDB) {
1295
-	bm = (*engine)->md5_hdb = (struct cli_matcher *) cli_calloc(sizeof(struct cli_matcher), 1);
1295
+	bm = (*engine)->md5_hdb = (struct cli_matcher *) mp_calloc((*engine)->mempool, sizeof(struct cli_matcher), 1);
1296 1296
     } else if(mode == MD5_MDB) {
1297
-	bm = (*engine)->md5_mdb = (struct cli_matcher *) cli_calloc(sizeof(struct cli_matcher), 1);
1297
+	bm = (*engine)->md5_mdb = (struct cli_matcher *) mp_calloc((*engine)->mempool, sizeof(struct cli_matcher), 1);
1298 1298
     } else {
1299
-	bm = (*engine)->md5_fp = (struct cli_matcher *) cli_calloc(sizeof(struct cli_matcher), 1);
1299
+	bm = (*engine)->md5_fp = (struct cli_matcher *) mp_calloc((*engine)->mempool, sizeof(struct cli_matcher), 1);
1300 1300
     }
1301 1301
 
1302 1302
     if(!bm)
1303 1303
 	return CL_EMEM;
1304
-
1304
+#ifdef USE_MPOOL
1305
+    bm->mempool = (*engine)->mempool;
1306
+#endif
1305 1307
     if((ret = cli_bm_init(bm))) {
1306 1308
 	cli_errmsg("cli_md5db_init: Failed to initialize B-M\n");
1307 1309
 	return ret;
... ...
@@ -1357,47 +1448,75 @@ static int cli_loadmd5(FILE *fs, struct cl_engine **engine, unsigned int *signo,
1357 1357
 	if((*engine)->ignored && cli_chkign((*engine)->ignored, dbname, line, pt))
1358 1358
 	    continue;
1359 1359
 
1360
-
1361
-	new = (struct cli_bm_patt *) cli_calloc(1, sizeof(struct cli_bm_patt));
1360
+	new = (struct cli_bm_patt *) mp_calloc((*engine)->mempool, 1, sizeof(struct cli_bm_patt));
1362 1361
 	if(!new) {
1363 1362
 	    ret = CL_EMEM;
1364 1363
 	    break;
1365 1364
 	}
1366 1365
 
1367 1366
 	if(!(pt = tokens[md5_field])) {
1368
-	    free(new);
1367
+	    mp_free((*engine)->mempool, new);
1369 1368
 	    ret = CL_EMALFDB;
1370 1369
 	    break;
1371 1370
 	}
1372 1371
 
1372
+#ifdef USE_MPOOL
1373
+	if(strlen(pt) == 32) {
1374
+	    unsigned char *mpoolhex = (unsigned char *) cli_hex2str(pt);
1375
+	    if(mpoolhex) {
1376
+	        if((new->pattern = mp_malloc((*engine)->mempool, 17)))
1377
+		    memcpy(new->pattern, mpoolhex, 17);
1378
+		free(mpoolhex);
1379
+	    } else new->pattern = NULL;
1380
+	} else new->pattern = NULL;
1381
+	if(new->pattern == NULL) {
1382
+	    cli_errmsg("cli_loadmd5: Malformed MD5 string at line %u\n", line);
1383
+	    mp_free((*engine)->mempool, new);
1384
+	    ret = CL_EMALFDB;
1385
+	    break;
1386
+	}
1387
+#else
1373 1388
 	if(strlen(pt) != 32 || !(new->pattern = (unsigned char *) cli_hex2str(pt))) {
1374 1389
 	    cli_errmsg("cli_loadmd5: Malformed MD5 string at line %u\n", line);
1375 1390
 	    free(new);
1376 1391
 	    ret = CL_EMALFDB;
1377 1392
 	    break;
1378 1393
 	}
1394
+#endif
1379 1395
 	new->length = 16;
1380 1396
 
1381 1397
 	if(!(pt = tokens[size_field])) {
1382
-	    free(new->pattern);
1383
-	    free(new);
1398
+	    mp_free((*engine)->mempool, new->pattern);
1399
+	    mp_free((*engine)->mempool, new);
1384 1400
 	    ret = CL_EMALFDB;
1385 1401
 	    break;
1386 1402
 	}
1387 1403
 	size = atoi(pt);
1388 1404
 
1389
-	if(!(new->virname = cli_virname((char *) tokens[2], options & CL_DB_OFFICIAL, 0))) {
1390
-	    free(new->pattern);
1391
-	    free(new);
1405
+#ifdef USE_MPOOL
1406
+	{
1407
+	  char *mpoolvname = cli_virname((char *) tokens[2], options & CL_DB_OFFICIAL, 0);
1408
+	  if(mpoolvname) {
1409
+	    if((new->virname = mp_malloc((*engine)->mempool, strlen(mpoolvname) + 1)))
1410
+	      strcpy(new->virname, mpoolvname);
1411
+	    free(mpoolvname);
1412
+	  } else new->virname = NULL;
1413
+	}
1414
+#else
1415
+	new->virname = cli_virname((char *) tokens[2], options & CL_DB_OFFICIAL, 0);
1416
+#endif
1417
+	if(!new->virname) {
1418
+	    mp_free((*engine)->mempool, new->pattern);
1419
+	    mp_free((*engine)->mempool, new);
1392 1420
 	    ret = CL_EMALFDB;
1393 1421
 	    break;
1394 1422
 	}
1395 1423
 
1396 1424
 	MD5_DB;
1397 1425
 	if(!db && (ret = cli_md5db_init(engine, mode))) {
1398
-	    free(new->pattern);
1399
-	    free(new->virname);
1400
-	    free(new);
1426
+	    mp_free((*engine)->mempool, new->pattern);
1427
+	    mp_free((*engine)->mempool, new->virname);
1428
+	    mp_free((*engine)->mempool, new);
1401 1429
 	    break;
1402 1430
 	} else {
1403 1431
 	    MD5_DB;
... ...
@@ -1405,9 +1524,9 @@ static int cli_loadmd5(FILE *fs, struct cl_engine **engine, unsigned int *signo,
1405 1405
 
1406 1406
 	if((ret = cli_bm_addpatt(db, new))) {
1407 1407
 	    cli_errmsg("cli_loadmd5: Error adding BM pattern\n");
1408
-	    free(new->pattern);
1409
-	    free(new->virname);
1410
-	    free(new);
1408
+	    mp_free((*engine)->mempool, new->pattern);
1409
+	    mp_free((*engine)->mempool, new->virname);
1410
+	    mp_free((*engine)->mempool, new);
1411 1411
 	    break;
1412 1412
 	}
1413 1413
 
... ...
@@ -1459,27 +1578,39 @@ static int cli_loadmd(FILE *fs, struct cl_engine **engine, unsigned int *signo,
1459 1459
 
1460 1460
 	cli_chomp(buffer);
1461 1461
 
1462
-	new = (struct cli_meta_node *) cli_calloc(1, sizeof(struct cli_meta_node));
1462
+	new = (struct cli_meta_node *) mp_calloc((*engine)->mempool, 1, sizeof(struct cli_meta_node));
1463 1463
 	if(!new) {
1464 1464
 	    ret = CL_EMEM;
1465 1465
 	    break;
1466 1466
 	}
1467 1467
 
1468
-	if(!(new->virname = cli_virname(cli_strtok(buffer, 0, ":"), options & CL_DB_OFFICIAL, 1))) {
1469
-	    free(new);
1468
+#ifdef USE_MPOOL
1469
+	{
1470
+	  char *mpoolvname = cli_virname(cli_strtok(buffer, 0, ":"), options & CL_DB_OFFICIAL, 1);
1471
+	  if(mpoolvname) {
1472
+	      if((new->virname = mp_malloc((*engine)->mempool, strlen(mpoolvname) + 1)))
1473
+		  strcpy(new->virname, mpoolvname);
1474
+	      free(mpoolvname);
1475
+	  } else new->virname = NULL;
1476
+	}
1477
+#else
1478
+	new->virname = cli_virname(cli_strtok(buffer, 0, ":"), options & CL_DB_OFFICIAL, 1);
1479
+#endif
1480
+	if(!new->virname) {
1481
+	  mp_free((*engine)->mempool, new);
1470 1482
 	    ret = CL_EMEM;
1471 1483
 	    break;
1472 1484
 	}
1473 1485
 
1474 1486
 	if((*engine)->ignored && cli_chkign((*engine)->ignored, dbname, line, new->virname)) {
1475
-	    free(new->virname);
1476
-	    free(new);
1487
+	    mp_free((*engine)->mempool, new->virname);
1488
+	    mp_free((*engine)->mempool, new);
1477 1489
 	    continue;
1478 1490
 	}
1479 1491
 
1480 1492
 	if(!(pt = cli_strtok(buffer, 1, ":"))) {
1481
-	    free(new->virname);
1482
-	    free(new);
1493
+	    mp_free((*engine)->mempool, new->virname);
1494
+	    mp_free((*engine)->mempool, new);
1483 1495
 	    ret = CL_EMALFDB;
1484 1496
 	    break;
1485 1497
 	} else {
... ...
@@ -1487,22 +1618,34 @@ static int cli_loadmd(FILE *fs, struct cl_engine **engine, unsigned int *signo,
1487 1487
 	    free(pt);
1488 1488
 	}
1489 1489
 
1490
-	if(!(new->filename = cli_strtok(buffer, 2, ":"))) {
1491
-	    free(new->virname);
1492
-	    free(new);
1490
+#ifdef USE_MPOOL
1491
+	{
1492
+	  char *mpoolfname = cli_strtok(buffer, 2, ":");
1493
+	  if(mpoolfname) {
1494
+	      if((new->filename = mp_malloc((*engine)->mempool, strlen(mpoolfname) + 1)))
1495
+		  strcpy(new->filename, mpoolfname);
1496
+	      free(mpoolfname);
1497
+	  } else new->filename = NULL;
1498
+	}
1499
+#else
1500
+	new->filename = cli_strtok(buffer, 2, ":");
1501
+#endif
1502
+	if(!new->filename) {
1503
+	    mp_free((*engine)->mempool, new->virname);
1504
+	    mp_free((*engine)->mempool, new);
1493 1505
 	    ret = CL_EMALFDB;
1494 1506
 	    break;
1495 1507
 	} else {
1496 1508
 	    if(!strcmp(new->filename, "*")) {
1497
-		free(new->filename);
1509
+	        mp_free((*engine)->mempool, new->filename);
1498 1510
 		new->filename = NULL;
1499 1511
 	    }
1500 1512
 	}
1501 1513
 
1502 1514
 	if(!(pt = cli_strtok(buffer, 3, ":"))) {
1503
-	    free(new->filename);
1504
-	    free(new->virname);
1505
-	    free(new);
1515
+	    if(new->filename) mp_free((*engine)->mempool, new->filename);
1516
+	    mp_free((*engine)->mempool, new->virname);
1517
+	    mp_free((*engine)->mempool, new);
1506 1518
 	    ret = CL_EMALFDB;
1507 1519
 	    break;
1508 1520
 	} else {
... ...
@@ -1514,9 +1657,9 @@ static int cli_loadmd(FILE *fs, struct cl_engine **engine, unsigned int *signo,
1514 1514
 	}
1515 1515
 
1516 1516
 	if(!(pt = cli_strtok(buffer, 4, ":"))) {
1517
-	    free(new->filename);
1518
-	    free(new->virname);
1519
-	    free(new);
1517
+	    if(new->filename) mp_free((*engine)->mempool, new->filename);
1518
+	    mp_free((*engine)->mempool, new->virname);
1519
+	    mp_free((*engine)->mempool, new);
1520 1520
 	    ret = CL_EMALFDB;
1521 1521
 	    break;
1522 1522
 	} else {
... ...
@@ -1528,9 +1671,9 @@ static int cli_loadmd(FILE *fs, struct cl_engine **engine, unsigned int *signo,
1528 1528
 	}
1529 1529
 
1530 1530
 	if(!(pt = cli_strtok(buffer, 5, ":"))) {
1531
-	    free(new->filename);
1532
-	    free(new->virname);
1533
-	    free(new);
1531
+	    if(new->filename) mp_free((*engine)->mempool, new->filename);
1532
+	    mp_free((*engine)->mempool, new->virname);
1533
+	    mp_free((*engine)->mempool, new);
1534 1534
 	    ret = CL_EMALFDB;
1535 1535
 	    break;
1536 1536
 	} else {
... ...
@@ -1548,9 +1691,9 @@ static int cli_loadmd(FILE *fs, struct cl_engine **engine, unsigned int *signo,
1548 1548
 	}
1549 1549
 
1550 1550
 	if(!(pt = cli_strtok(buffer, 6, ":"))) {
1551
-	    free(new->filename);
1552
-	    free(new->virname);
1553
-	    free(new);
1551
+	    if(new->filename) mp_free((*engine)->mempool, new->filename);
1552
+	    mp_free((*engine)->mempool, new->virname);
1553
+	    mp_free((*engine)->mempool, new);
1554 1554
 	    ret = CL_EMALFDB;
1555 1555
 	    break;
1556 1556
 	} else {
... ...
@@ -1562,9 +1705,9 @@ static int cli_loadmd(FILE *fs, struct cl_engine **engine, unsigned int *signo,
1562 1562
 	}
1563 1563
 
1564 1564
 	if(!(pt = cli_strtok(buffer, 7, ":"))) {
1565
-	    free(new->filename);
1566
-	    free(new->virname);
1567
-	    free(new);
1565
+	    if(new->filename) mp_free((*engine)->mempool, new->filename);
1566
+	    mp_free((*engine)->mempool, new->virname);
1567
+	    mp_free((*engine)->mempool, new);
1568 1568
 	    ret = CL_EMALFDB;
1569 1569
 	    break;
1570 1570
 	} else {
... ...
@@ -1576,9 +1719,9 @@ static int cli_loadmd(FILE *fs, struct cl_engine **engine, unsigned int *signo,
1576 1576
 	}
1577 1577
 
1578 1578
 	if(!(pt = cli_strtok(buffer, 8, ":"))) {
1579
-	    free(new->filename);
1580
-	    free(new->virname);
1581
-	    free(new);
1579
+	    if(new->filename) mp_free((*engine)->mempool, new->filename);
1580
+	    mp_free((*engine)->mempool, new->virname);
1581
+	    mp_free((*engine)->mempool, new);
1582 1582
 	    ret = CL_EMALFDB;
1583 1583
 	    break;
1584 1584
 	} else {
... ...
@@ -1883,7 +2026,6 @@ int cl_load(const char *path, struct cl_engine **engine, unsigned int *signo, un
1883 1883
 	    cli_errmsg("cl_load(%s): Not supported database file type\n", path);
1884 1884
 	    return CL_EOPEN;
1885 1885
     }
1886
-
1887 1886
     return ret;
1888 1887
 }
1889 1888
 
... ...
@@ -2120,7 +2262,6 @@ void cl_free(struct cl_engine *engine)
2120 2120
 #ifdef CL_THREAD_SAFE
2121 2121
     pthread_mutex_unlock(&cli_ref_mutex);
2122 2122
 #endif
2123
-
2124 2123
     if(engine->root) {
2125 2124
 	for(i = 0; i < CLI_MTARGETS; i++) {
2126 2125
 	    if((root = engine->root[i])) {
... ...
@@ -2129,68 +2270,70 @@ void cl_free(struct cl_engine *engine)
2129 2129
 		cli_ac_free(root);
2130 2130
 		if(root->ac_lsigtable) {
2131 2131
 		    for(j = 0; j < root->ac_lsigs; j++) {
2132
-			free(root->ac_lsigtable[j]->logic);
2132
+			mp_free(engine->mempool, root->ac_lsigtable[j]->logic);
2133 2133
 			FREE_TDB(root->ac_lsigtable[j]->tdb);
2134
-			free(root->ac_lsigtable[j]);
2134
+			mp_free(engine->mempool, root->ac_lsigtable[j]);
2135 2135
 		    }
2136
-		    free(root->ac_lsigtable);
2136
+		    mp_free(engine->mempool, root->ac_lsigtable);
2137 2137
 		}
2138
-		free(root);
2138
+		mp_free(engine->mempool, root);
2139 2139
 	    }
2140 2140
 	}
2141
-	free(engine->root);
2141
+	mp_free(engine->mempool, engine->root);
2142 2142
     }
2143 2143
 
2144 2144
     if((root = engine->md5_hdb)) {
2145 2145
 	cli_bm_free(root);
2146
-	free(root);
2146
+	mp_free(engine->mempool, root);
2147 2147
     }
2148 2148
 
2149 2149
     if((root = engine->md5_mdb)) {
2150 2150
 	cli_bm_free(root);
2151
-	free(root->soff);
2151
+	mp_free(engine->mempool, root->soff);
2152 2152
 	if(root->md5_sizes_hs.capacity) {
2153 2153
 		hashset_destroy(&root->md5_sizes_hs);
2154 2154
 	}
2155
-	free(root);
2155
+	mp_free(engine->mempool, root);
2156 2156
     }
2157 2157
 
2158 2158
     if((root = engine->md5_fp)) {
2159 2159
 	cli_bm_free(root);
2160
-	free(root);
2160
+	mp_free(engine->mempool, root);
2161 2161
     }
2162 2162
 
2163 2163
     metapt = engine->zip_mlist;
2164 2164
     while(metapt) {
2165 2165
 	metah = metapt;
2166 2166
 	metapt = metapt->next;
2167
-	free(metah->virname);
2167
+	mp_free(engine->mempool, metah->virname);
2168 2168
 	if(metah->filename)
2169
-	    free(metah->filename);
2170
-	free(metah);
2169
+	    mp_free(engine->mempool, metah->filename);
2170
+	mp_free(engine->mempool, metah);
2171 2171
     }
2172 2172
 
2173 2173
     metapt = engine->rar_mlist;
2174 2174
     while(metapt) {
2175 2175
 	metah = metapt;
2176 2176
 	metapt = metapt->next;
2177
-	free(metah->virname);
2177
+	mp_free(engine->mempool, metah->virname);
2178 2178
 	if(metah->filename)
2179
-	    free(metah->filename);
2180
-	free(metah);
2179
+	    mp_free(engine->mempool, metah->filename);
2180
+	mp_free(engine->mempool, metah);
2181 2181
     }
2182 2182
 
2183 2183
     if(((struct cli_dconf *) engine->dconf)->phishing & PHISHING_CONF_ENGINE)
2184 2184
 	phishing_done(engine);
2185
-
2186 2185
     if(engine->dconf)
2187
-	free(engine->dconf);
2186
+	mp_free(engine->mempool, engine->dconf);
2188 2187
 
2189 2188
     if(engine->pua_cats)
2190
-	free(engine->pua_cats);
2189
+	mp_free(engine->mempool, engine->pua_cats);
2191 2190
 
2192
-    cli_ftfree(engine->ftypes);
2191
+    cli_ftfree(engine);
2193 2192
     cli_freeign(engine);
2193
+#ifdef USE_MPOOL
2194
+    if(engine->mempool) mp_destroy(engine->mempool);
2195
+#endif
2194 2196
     free(engine);
2195 2197
 }
2196 2198
 
... ...
@@ -2199,7 +2342,19 @@ static void cli_md5db_build(struct cli_matcher* root)
2199 2199
 	if(root && root->md5_sizes_hs.capacity) {
2200 2200
 		/* TODO: use hashset directly, instead of the array when matching*/
2201 2201
 		cli_dbgmsg("Converting hashset to array: %lu entries\n", root->md5_sizes_hs.count);
2202
+
2203
+#ifdef USE_MPOOL
2204
+		{
2205
+		uint32_t *mpoolht;
2206
+		unsigned int mpoolhtsz = root->md5_sizes_hs.count * sizeof(*mpoolht);
2207
+		root->soff = mp_malloc(root->mempool, mpoolhtsz);
2208
+		root->soff_len = hashset_toarray(&root->md5_sizes_hs, &mpoolht);
2209
+		memcpy(root->soff, mpoolht, mpoolhtsz);
2210
+		free(mpoolht);
2211
+		}
2212
+#else
2202 2213
 		root->soff_len = hashset_toarray(&root->md5_sizes_hs, &root->soff);
2214
+#endif
2203 2215
 		hashset_destroy(&root->md5_sizes_hs);
2204 2216
 		qsort(root->soff, root->soff_len, sizeof(uint32_t), scomp);
2205 2217
 	}
... ...
@@ -57,6 +57,9 @@
57 57
 #include "readdb.h"
58 58
 #include "jsparse/textbuf.h"
59 59
 #include "regex_suffix.h"
60
+
61
+#include "mpool.h"
62
+
60 63
 /* Prototypes */
61 64
 static regex_t *new_preg(struct regex_matcher *matcher);
62 65
 static size_t reverse_string(char *pattern);
... ...
@@ -342,6 +345,9 @@ int regex_list_match(struct regex_matcher* matcher,char* real_url,const char* di
342 342
 /* Initializes @matcher, allocating necesarry substructures */
343 343
 int init_regex_list(struct regex_matcher* matcher)
344 344
 {
345
+#ifdef USE_MPOOL
346
+	mp_t *mp = matcher->mempool;
347
+#endif
345 348
 	int rc;
346 349
 
347 350
 	assert(matcher);
... ...
@@ -350,11 +356,17 @@ int init_regex_list(struct regex_matcher* matcher)
350 350
 	matcher->list_inited=1;
351 351
 	matcher->list_built=0;
352 352
 	matcher->list_loaded=0;
353
-
354 353
 	hashtab_init(&matcher->suffix_hash, 10);
354
+#ifdef USE_MPOOL
355
+	matcher->mempool = mp;
356
+	matcher->suffixes.mempool = mp;
357
+#endif
355 358
 	if((rc = cli_ac_init(&matcher->suffixes, 2, 32))) {
356 359
 		return rc;
357 360
 	}
361
+#ifdef USE_MPOOL
362
+	matcher->md5_hashes.mempool = mp;
363
+#endif
358 364
 	if((rc = cli_bm_init(&matcher->md5_hashes))) {
359 365
 		return rc;
360 366
 	}
... ...
@@ -581,9 +593,9 @@ void regex_list_done(struct regex_matcher* matcher)
581 581
 			for(i=0;i<matcher->regex_cnt;i++) {
582 582
 				regex_t *r = matcher->all_pregs[i];
583 583
 				cli_regfree(r);
584
-				free(r);
584
+				mp_free(matcher->mempool, r);
585 585
 			}
586
-			free(matcher->all_pregs);
586
+			mp_free(matcher->mempool, matcher->all_pregs);
587 587
 		}
588 588
 		hashtab_free(&matcher->suffix_hash);
589 589
 		cli_bm_free(&matcher->md5_hashes);
... ...
@@ -599,7 +611,7 @@ int is_regex_ok(struct regex_matcher* matcher)
599 599
 static int add_newsuffix(struct regex_matcher *matcher, struct regex_list *info, const char *suffix, size_t len)
600 600
 {
601 601
 	struct cli_matcher *root = &matcher->suffixes;
602
-	struct cli_ac_patt *new = cli_calloc(1,sizeof(*new));
602
+	struct cli_ac_patt *new = mp_calloc(matcher->mempool,1,sizeof(*new));
603 603
 	size_t i;
604 604
 	int ret;
605 605
 
... ...
@@ -621,9 +633,9 @@ static int add_newsuffix(struct regex_matcher *matcher, struct regex_list *info,
621 621
 	if(new->length > root->maxpatlen)
622 622
 		root->maxpatlen = new->length;
623 623
 
624
-	new->pattern = cli_malloc(sizeof(new->pattern[0])*len);
624
+	new->pattern = mp_malloc(matcher->mempool, sizeof(new->pattern[0])*len);
625 625
 	if(!new->pattern) {
626
-		free(new);
626
+		mp_free(matcher->mempool, new);
627 627
 		return CL_EMEM;
628 628
 	}
629 629
 	for(i=0;i<len;i++)
... ...
@@ -632,8 +644,8 @@ static int add_newsuffix(struct regex_matcher *matcher, struct regex_list *info,
632 632
 	new->customdata = info;
633 633
 	new->virname = NULL;
634 634
 	if((ret = cli_ac_addpatt(root,new))) {
635
-		free(new->pattern);
636
-		free(new);
635
+		mp_free(matcher->mempool, new->pattern);
636
+		mp_free(matcher->mempool, new);
637 637
 		return ret;
638 638
 	}
639 639
 	SO_preprocess_add(&matcher->filter, (const unsigned char*)suffix, len);
... ...
@@ -704,10 +716,10 @@ static size_t reverse_string(char *pattern)
704 704
 static regex_t *new_preg(struct regex_matcher *matcher)
705 705
 {
706 706
 	regex_t *r;
707
-	matcher->all_pregs = cli_realloc(matcher->all_pregs, ++matcher->regex_cnt * sizeof(*matcher->all_pregs));
707
+	matcher->all_pregs = mp_realloc(matcher->mempool, matcher->all_pregs, ++matcher->regex_cnt * sizeof(*matcher->all_pregs));
708 708
 	if(!matcher->all_pregs)
709 709
 		return NULL;
710
-	r = cli_malloc(sizeof(*r));
710
+	r = mp_malloc(matcher->mempool, sizeof(*r));
711 711
 	if(!r)
712 712
 		return NULL;
713 713
 	matcher->all_pregs[matcher->regex_cnt-1] = r;
... ...
@@ -29,6 +29,8 @@
29 29
 #include "matcher.h"
30 30
 #include <zlib.h> /* for gzFile */
31 31
 
32
+#include "mpool.h"
33
+
32 34
 struct filter {
33 35
 	uint32_t B[65536];
34 36
 	uint32_t end_fast[256];
... ...
@@ -51,6 +53,9 @@ struct regex_matcher {
51 51
 	struct cli_matcher md5_hashes;
52 52
 	struct filter md5_filter;
53 53
 	struct filter filter;
54
+#ifdef USE_MPOOL
55
+	mp_t *mempool;
56
+#endif
54 57
 	int list_inited:2;
55 58
 	int list_loaded:2;
56 59
 	int list_built:2;
... ...
@@ -76,4 +76,22 @@ rm -f conftest.mmap
76 76
 ])
77 77
 
78 78
 
79
-
79
+AC_DEFUN([AC_C_FUNC_MMAP_ANONYMOUS],
80
+[
81
+	AC_CACHE_CHECK([for MAP_ANON(YMOUS)], [ac_cv_c_mmap_anonymous],[
82
+		ac_cv_c_mmap_anonymous='no'
83
+		AC_COMPILE_IFELSE(
84
+			[AC_LANG_PROGRAM([[#include <sys/mman.h>]], [[mmap((void *)0, 0, PROT_READ | PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0);]])],
85
+			[ac_cv_c_mmap_anonymous='MAP_ANONYMOUS'],
86
+			[
87
+				AC_LINK_IFELSE(
88
+					[AC_LANG_PROGRAM([[#include <sys/mman.h>]], [[mmap((void *)0, 0, PROT_READ | PROT_WRITE, MAP_PRIVATE|MAP_ANON, -1, 0);]])],
89
+					[ac_cv_c_mmap_anonymous='MAP_ANONYMOUS']
90
+				)
91
+			]
92
+		)
93
+	])
94
+	if test "$ac_cv_c_mmap_anonymous" != "no"; then
95
+		AC_DEFINE_UNQUOTED([ANONYMOUS_MAP],[$ac_cv_c_mmap_anonymous],[mmap flag for anonymous maps])
96
+	fi
97
+])
80 98
\ No newline at end of file