~ubuntu-branches/ubuntu/jaunty/mlview/jaunty

« back to all changes in this revision

Viewing changes to aclocal.m4

  • Committer: Bazaar Package Importer
  • Author(s): Sebastien Bacher
  • Date: 2004-05-11 23:55:05 UTC
  • Revision ID: james.westby@ubuntu.com-20040511235505-ktq97vaz6sl5amy7
Tags: upstream-0.6.3
ImportĀ upstreamĀ versionĀ 0.6.3

Show diffs side-by-side

added added

removed removed

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