~ubuntu-branches/ubuntu/trusty/libesmtp/trusty-proposed

« back to all changes in this revision

Viewing changes to aclocal.m4

  • Committer: Bazaar Package Importer
  • Author(s): Jeremy T. Bouse
  • Date: 2002-03-06 08:37:48 UTC
  • Revision ID: james.westby@ubuntu.com-20020306083748-ihmt32mddsslvg5i
Tags: upstream-0.8.11
ImportĀ upstreamĀ versionĀ 0.8.11

Show diffs side-by-side

added added

removed removed

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