Switch to unified view

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