acinclude.m4
author Holmes Futrell <hfutrell@umail.ucsb.edu>
Fri, 18 Jul 2008 17:53:54 +0000
branchgsoc2008_iphone
changeset 2364 e321b52dee8f
parent 1613 2095da6364c9
child 3012 7e30c2dc7783
permissions -rw-r--r--
These files contain the audio support for iPhone. They are based on the CoreAudio audio driver for Mac OS X. The principle difference is that the iPhone doesn't seem to have a concept of audio devices ... it just has special units for audio in and audio out. Also had to change some functions to versions which seem to only exist on iPhone and will apparently exist in Mac OS X 10.6(!)

There is currently no audio recording support -- my iPod Touch doesn't have a microphone to test this with.
slouken@948
     1
##############################################################################
slouken@939
     2
dnl Configure Paths for Alsa
slouken@939
     3
dnl Some modifications by Richard Boulton <richard-alsa@tartarus.org>
slouken@939
     4
dnl Christopher Lansdown <lansdoct@cs.alfred.edu>
slouken@939
     5
dnl Jaroslav Kysela <perex@suse.cz>
slouken@948
     6
dnl Last modification: alsa.m4,v 1.23 2004/01/16 18:14:22 tiwai Exp
slouken@939
     7
dnl AM_PATH_ALSA([MINIMUM-VERSION [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
slouken@939
     8
dnl Test for libasound, and define ALSA_CFLAGS and ALSA_LIBS as appropriate.
slouken@939
     9
dnl enables arguments --with-alsa-prefix=
slouken@939
    10
dnl                   --with-alsa-enc-prefix=
slouken@948
    11
dnl                   --disable-alsatest
slouken@939
    12
dnl
slouken@939
    13
dnl For backwards compatibility, if ACTION_IF_NOT_FOUND is not specified,
slouken@939
    14
dnl and the alsa libraries are not found, a fatal AC_MSG_ERROR() will result.
slouken@939
    15
dnl
slouken@948
    16
AC_DEFUN([AM_PATH_ALSA],
slouken@939
    17
[dnl Save the original CFLAGS, LDFLAGS, and LIBS
slouken@939
    18
alsa_save_CFLAGS="$CFLAGS"
slouken@939
    19
alsa_save_LDFLAGS="$LDFLAGS"
slouken@939
    20
alsa_save_LIBS="$LIBS"
slouken@939
    21
alsa_found=yes
slouken@939
    22
slouken@939
    23
dnl
slouken@939
    24
dnl Get the cflags and libraries for alsa
slouken@939
    25
dnl
slouken@939
    26
AC_ARG_WITH(alsa-prefix,
slouken@939
    27
[  --with-alsa-prefix=PFX  Prefix where Alsa library is installed(optional)],
slouken@939
    28
[alsa_prefix="$withval"], [alsa_prefix=""])
slouken@939
    29
slouken@939
    30
AC_ARG_WITH(alsa-inc-prefix,
slouken@939
    31
[  --with-alsa-inc-prefix=PFX  Prefix where include libraries are (optional)],
slouken@939
    32
[alsa_inc_prefix="$withval"], [alsa_inc_prefix=""])
slouken@939
    33
slouken@939
    34
dnl FIXME: this is not yet implemented
slouken@939
    35
AC_ARG_ENABLE(alsatest,
slouken@939
    36
[  --disable-alsatest      Do not try to compile and run a test Alsa program],
slouken@948
    37
[enable_alsatest="$enableval"],
slouken@939
    38
[enable_alsatest=yes])
slouken@939
    39
slouken@939
    40
dnl Add any special include directories
slouken@939
    41
AC_MSG_CHECKING(for ALSA CFLAGS)
slouken@939
    42
if test "$alsa_inc_prefix" != "" ; then
slouken@939
    43
	ALSA_CFLAGS="$ALSA_CFLAGS -I$alsa_inc_prefix"
slouken@939
    44
	CFLAGS="$CFLAGS -I$alsa_inc_prefix"
slouken@939
    45
fi
slouken@939
    46
AC_MSG_RESULT($ALSA_CFLAGS)
slouken@939
    47
slouken@939
    48
dnl add any special lib dirs
slouken@939
    49
AC_MSG_CHECKING(for ALSA LDFLAGS)
slouken@939
    50
if test "$alsa_prefix" != "" ; then
slouken@939
    51
	ALSA_LIBS="$ALSA_LIBS -L$alsa_prefix"
slouken@939
    52
	LDFLAGS="$LDFLAGS $ALSA_LIBS"
slouken@939
    53
fi
slouken@939
    54
slouken@939
    55
dnl add the alsa library
slouken@939
    56
ALSA_LIBS="$ALSA_LIBS -lasound -lm -ldl -lpthread"
slouken@939
    57
LIBS=`echo $LIBS | sed 's/-lm//'`
slouken@939
    58
LIBS=`echo $LIBS | sed 's/-ldl//'`
slouken@939
    59
LIBS=`echo $LIBS | sed 's/-lpthread//'`
slouken@939
    60
LIBS=`echo $LIBS | sed 's/  //'`
slouken@939
    61
LIBS="$ALSA_LIBS $LIBS"
slouken@939
    62
AC_MSG_RESULT($ALSA_LIBS)
slouken@939
    63
slouken@939
    64
dnl Check for a working version of libasound that is of the right version.
slouken@939
    65
min_alsa_version=ifelse([$1], ,0.1.1,$1)
slouken@939
    66
AC_MSG_CHECKING(for libasound headers version >= $min_alsa_version)
slouken@939
    67
no_alsa=""
slouken@939
    68
    alsa_min_major_version=`echo $min_alsa_version | \
slouken@939
    69
           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
slouken@939
    70
    alsa_min_minor_version=`echo $min_alsa_version | \
slouken@939
    71
           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
slouken@939
    72
    alsa_min_micro_version=`echo $min_alsa_version | \
slouken@939
    73
           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
slouken@939
    74
slouken@939
    75
AC_LANG_SAVE
slouken@939
    76
AC_LANG_C
slouken@939
    77
AC_TRY_COMPILE([
slouken@939
    78
#include <alsa/asoundlib.h>
slouken@939
    79
], [
slouken@939
    80
/* ensure backward compatibility */
slouken@939
    81
#if !defined(SND_LIB_MAJOR) && defined(SOUNDLIB_VERSION_MAJOR)
slouken@939
    82
#define SND_LIB_MAJOR SOUNDLIB_VERSION_MAJOR
slouken@939
    83
#endif
slouken@939
    84
#if !defined(SND_LIB_MINOR) && defined(SOUNDLIB_VERSION_MINOR)
slouken@939
    85
#define SND_LIB_MINOR SOUNDLIB_VERSION_MINOR
slouken@939
    86
#endif
slouken@939
    87
#if !defined(SND_LIB_SUBMINOR) && defined(SOUNDLIB_VERSION_SUBMINOR)
slouken@939
    88
#define SND_LIB_SUBMINOR SOUNDLIB_VERSION_SUBMINOR
slouken@939
    89
#endif
slouken@939
    90
slouken@939
    91
#  if(SND_LIB_MAJOR > $alsa_min_major_version)
slouken@939
    92
  exit(0);
slouken@939
    93
#  else
slouken@939
    94
#    if(SND_LIB_MAJOR < $alsa_min_major_version)
slouken@939
    95
#       error not present
slouken@939
    96
#    endif
slouken@939
    97
slouken@939
    98
#   if(SND_LIB_MINOR > $alsa_min_minor_version)
slouken@939
    99
  exit(0);
slouken@939
   100
#   else
slouken@939
   101
#     if(SND_LIB_MINOR < $alsa_min_minor_version)
slouken@939
   102
#          error not present
slouken@939
   103
#      endif
slouken@939
   104
slouken@939
   105
#      if(SND_LIB_SUBMINOR < $alsa_min_micro_version)
slouken@939
   106
#        error not present
slouken@939
   107
#      endif
slouken@939
   108
#    endif
slouken@939
   109
#  endif
slouken@939
   110
exit(0);
slouken@939
   111
],
slouken@939
   112
  [AC_MSG_RESULT(found.)],
slouken@939
   113
  [AC_MSG_RESULT(not present.)
slouken@939
   114
   ifelse([$3], , [AC_MSG_ERROR(Sufficiently new version of libasound not found.)])
slouken@939
   115
   alsa_found=no]
slouken@939
   116
)
slouken@939
   117
AC_LANG_RESTORE
slouken@939
   118
slouken@939
   119
dnl Now that we know that we have the right version, let's see if we have the library and not just the headers.
slouken@948
   120
if test "x$enable_alsatest" = "xyes"; then
slouken@939
   121
AC_CHECK_LIB([asound], [snd_ctl_open],,
slouken@939
   122
	[ifelse([$3], , [AC_MSG_ERROR(No linkable libasound was found.)])
slouken@939
   123
	 alsa_found=no]
slouken@939
   124
)
slouken@948
   125
fi
slouken@948
   126
slouken@939
   127
if test "x$alsa_found" = "xyes" ; then
slouken@939
   128
   ifelse([$2], , :, [$2])
slouken@948
   129
   LIBS=`echo $LIBS | sed 's/-lasound//g'`
slouken@948
   130
   LIBS=`echo $LIBS | sed 's/  //'`
slouken@948
   131
   LIBS="-lasound $LIBS"
slouken@948
   132
fi
slouken@948
   133
if test "x$alsa_found" = "xno" ; then
slouken@939
   134
   ifelse([$3], , :, [$3])
slouken@939
   135
   CFLAGS="$alsa_save_CFLAGS"
slouken@939
   136
   LDFLAGS="$alsa_save_LDFLAGS"
slouken@939
   137
   LIBS="$alsa_save_LIBS"
slouken@939
   138
   ALSA_CFLAGS=""
slouken@939
   139
   ALSA_LIBS=""
slouken@939
   140
fi
slouken@939
   141
slouken@939
   142
dnl That should be it.  Now just export out symbols:
slouken@939
   143
AC_SUBST(ALSA_CFLAGS)
slouken@939
   144
AC_SUBST(ALSA_LIBS)
slouken@939
   145
])
slouken@939
   146
slouken@948
   147
##############################################################################
slouken@939
   148
#
slouken@0
   149
# --- esd.m4 ---
slouken@0
   150
#
slouken@0
   151
# Configure paths for ESD
slouken@0
   152
# Manish Singh    98-9-30
slouken@0
   153
# stolen back from Frank Belew
slouken@0
   154
# stolen from Manish Singh
slouken@0
   155
# Shamelessly stolen from Owen Taylor
slouken@0
   156
slouken@0
   157
dnl AM_PATH_ESD([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
slouken@0
   158
dnl Test for ESD, and define ESD_CFLAGS and ESD_LIBS
slouken@0
   159
dnl
slouken@794
   160
AC_DEFUN([AM_PATH_ESD],
slouken@0
   161
[dnl 
slouken@0
   162
dnl Get the cflags and libraries from the esd-config script
slouken@0
   163
dnl
slouken@0
   164
AC_ARG_WITH(esd-prefix,[  --with-esd-prefix=PFX   Prefix where ESD is installed (optional)],
slouken@0
   165
            esd_prefix="$withval", esd_prefix="")
slouken@0
   166
AC_ARG_WITH(esd-exec-prefix,[  --with-esd-exec-prefix=PFX Exec prefix where ESD is installed (optional)],
slouken@0
   167
            esd_exec_prefix="$withval", esd_exec_prefix="")
slouken@0
   168
AC_ARG_ENABLE(esdtest, [  --disable-esdtest       Do not try to compile and run a test ESD program],
slouken@0
   169
		    , enable_esdtest=yes)
slouken@0
   170
slouken@0
   171
  if test x$esd_exec_prefix != x ; then
slouken@0
   172
     esd_args="$esd_args --exec-prefix=$esd_exec_prefix"
slouken@0
   173
     if test x${ESD_CONFIG+set} != xset ; then
slouken@0
   174
        ESD_CONFIG=$esd_exec_prefix/bin/esd-config
slouken@0
   175
     fi
slouken@0
   176
  fi
slouken@0
   177
  if test x$esd_prefix != x ; then
slouken@0
   178
     esd_args="$esd_args --prefix=$esd_prefix"
slouken@0
   179
     if test x${ESD_CONFIG+set} != xset ; then
slouken@0
   180
        ESD_CONFIG=$esd_prefix/bin/esd-config
slouken@0
   181
     fi
slouken@0
   182
  fi
slouken@0
   183
slouken@0
   184
  AC_PATH_PROG(ESD_CONFIG, esd-config, no)
slouken@0
   185
  min_esd_version=ifelse([$1], ,0.2.7,$1)
slouken@0
   186
  AC_MSG_CHECKING(for ESD - version >= $min_esd_version)
slouken@0
   187
  no_esd=""
slouken@0
   188
  if test "$ESD_CONFIG" = "no" ; then
slouken@0
   189
    no_esd=yes
slouken@0
   190
  else
slouken@0
   191
    ESD_CFLAGS=`$ESD_CONFIG $esdconf_args --cflags`
slouken@0
   192
    ESD_LIBS=`$ESD_CONFIG $esdconf_args --libs`
slouken@0
   193
slouken@0
   194
    esd_major_version=`$ESD_CONFIG $esd_args --version | \
slouken@0
   195
           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
slouken@0
   196
    esd_minor_version=`$ESD_CONFIG $esd_args --version | \
slouken@0
   197
           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
slouken@0
   198
    esd_micro_version=`$ESD_CONFIG $esd_config_args --version | \
slouken@0
   199
           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
slouken@0
   200
    if test "x$enable_esdtest" = "xyes" ; then
slouken@0
   201
      ac_save_CFLAGS="$CFLAGS"
slouken@0
   202
      ac_save_LIBS="$LIBS"
slouken@0
   203
      CFLAGS="$CFLAGS $ESD_CFLAGS"
slouken@0
   204
      LIBS="$LIBS $ESD_LIBS"
slouken@0
   205
dnl
slouken@0
   206
dnl Now check if the installed ESD is sufficiently new. (Also sanity
slouken@0
   207
dnl checks the results of esd-config to some extent
slouken@0
   208
dnl
slouken@0
   209
      rm -f conf.esdtest
slouken@0
   210
      AC_TRY_RUN([
slouken@0
   211
#include <stdio.h>
slouken@0
   212
#include <stdlib.h>
slouken@0
   213
#include <string.h>
slouken@0
   214
#include <esd.h>
slouken@0
   215
slouken@0
   216
char*
slouken@0
   217
my_strdup (char *str)
slouken@0
   218
{
slouken@0
   219
  char *new_str;
slouken@0
   220
  
slouken@0
   221
  if (str)
slouken@0
   222
    {
slouken@0
   223
      new_str = malloc ((strlen (str) + 1) * sizeof(char));
slouken@0
   224
      strcpy (new_str, str);
slouken@0
   225
    }
slouken@0
   226
  else
slouken@0
   227
    new_str = NULL;
slouken@0
   228
  
slouken@0
   229
  return new_str;
slouken@0
   230
}
slouken@0
   231
slouken@0
   232
int main ()
slouken@0
   233
{
slouken@0
   234
  int major, minor, micro;
slouken@0
   235
  char *tmp_version;
slouken@0
   236
slouken@0
   237
  system ("touch conf.esdtest");
slouken@0
   238
slouken@0
   239
  /* HP/UX 9 (%@#!) writes to sscanf strings */
slouken@0
   240
  tmp_version = my_strdup("$min_esd_version");
slouken@0
   241
  if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
slouken@0
   242
     printf("%s, bad version string\n", "$min_esd_version");
slouken@0
   243
     exit(1);
slouken@0
   244
   }
slouken@0
   245
slouken@0
   246
   if (($esd_major_version > major) ||
slouken@0
   247
      (($esd_major_version == major) && ($esd_minor_version > minor)) ||
slouken@0
   248
      (($esd_major_version == major) && ($esd_minor_version == minor) && ($esd_micro_version >= micro)))
slouken@0
   249
    {
slouken@0
   250
      return 0;
slouken@0
   251
    }
slouken@0
   252
  else
slouken@0
   253
    {
slouken@0
   254
      printf("\n*** 'esd-config --version' returned %d.%d.%d, but the minimum version\n", $esd_major_version, $esd_minor_version, $esd_micro_version);
slouken@0
   255
      printf("*** of ESD required is %d.%d.%d. If esd-config is correct, then it is\n", major, minor, micro);
slouken@0
   256
      printf("*** best to upgrade to the required version.\n");
slouken@0
   257
      printf("*** If esd-config was wrong, set the environment variable ESD_CONFIG\n");
slouken@0
   258
      printf("*** to point to the correct copy of esd-config, and remove the file\n");
slouken@0
   259
      printf("*** config.cache before re-running configure\n");
slouken@0
   260
      return 1;
slouken@0
   261
    }
slouken@0
   262
}
slouken@0
   263
slouken@0
   264
],, no_esd=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
slouken@0
   265
       CFLAGS="$ac_save_CFLAGS"
slouken@0
   266
       LIBS="$ac_save_LIBS"
slouken@0
   267
     fi
slouken@0
   268
  fi
slouken@0
   269
  if test "x$no_esd" = x ; then
slouken@0
   270
     AC_MSG_RESULT(yes)
slouken@0
   271
     ifelse([$2], , :, [$2])     
slouken@0
   272
  else
slouken@0
   273
     AC_MSG_RESULT(no)
slouken@0
   274
     if test "$ESD_CONFIG" = "no" ; then
slouken@0
   275
       echo "*** The esd-config script installed by ESD could not be found"
slouken@0
   276
       echo "*** If ESD was installed in PREFIX, make sure PREFIX/bin is in"
slouken@0
   277
       echo "*** your path, or set the ESD_CONFIG environment variable to the"
slouken@0
   278
       echo "*** full path to esd-config."
slouken@0
   279
     else
slouken@0
   280
       if test -f conf.esdtest ; then
slouken@0
   281
        :
slouken@0
   282
       else
slouken@0
   283
          echo "*** Could not run ESD test program, checking why..."
slouken@0
   284
          CFLAGS="$CFLAGS $ESD_CFLAGS"
slouken@0
   285
          LIBS="$LIBS $ESD_LIBS"
slouken@0
   286
          AC_TRY_LINK([
slouken@0
   287
#include <stdio.h>
slouken@0
   288
#include <esd.h>
slouken@0
   289
],      [ return 0; ],
slouken@0
   290
        [ echo "*** The test program compiled, but did not run. This usually means"
slouken@0
   291
          echo "*** that the run-time linker is not finding ESD or finding the wrong"
slouken@0
   292
          echo "*** version of ESD. If it is not finding ESD, you'll need to set your"
slouken@0
   293
          echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
slouken@0
   294
          echo "*** to the installed location  Also, make sure you have run ldconfig if that"
slouken@0
   295
          echo "*** is required on your system"
slouken@0
   296
	  echo "***"
slouken@0
   297
          echo "*** If you have an old version installed, it is best to remove it, although"
slouken@0
   298
          echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"],
slouken@0
   299
        [ echo "*** The test program failed to compile or link. See the file config.log for the"
slouken@0
   300
          echo "*** exact error that occured. This usually means ESD was incorrectly installed"
slouken@0
   301
          echo "*** or that you have moved ESD since it was installed. In the latter case, you"
slouken@0
   302
          echo "*** may want to edit the esd-config script: $ESD_CONFIG" ])
slouken@0
   303
          CFLAGS="$ac_save_CFLAGS"
slouken@0
   304
          LIBS="$ac_save_LIBS"
slouken@0
   305
       fi
slouken@0
   306
     fi
slouken@0
   307
     ESD_CFLAGS=""
slouken@0
   308
     ESD_LIBS=""
slouken@0
   309
     ifelse([$3], , :, [$3])
slouken@0
   310
  fi
slouken@0
   311
  AC_SUBST(ESD_CFLAGS)
slouken@0
   312
  AC_SUBST(ESD_LIBS)
slouken@0
   313
  rm -f conf.esdtest
slouken@0
   314
])
slouken@0
   315
slouken@948
   316
##############################################################################
slouken@1570
   317
# Based on libtool-1.5.22
slouken@729
   318
# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
slouken@1570
   319
## Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005
slouken@729
   320
## Free Software Foundation, Inc.
slouken@0
   321
## Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
slouken@0
   322
##
slouken@1570
   323
## This file is free software; the Free Software Foundation gives
slouken@1570
   324
## unlimited permission to copy and/or distribute it, with or without
slouken@1570
   325
## modifications, as long as this notice is preserved.
slouken@1570
   326
slouken@1570
   327
# serial 48 AC_PROG_LIBTOOL
slouken@729
   328
slouken@729
   329
slouken@729
   330
# AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED)
slouken@729
   331
# -----------------------------------------------------------
slouken@729
   332
# If this macro is not defined by Autoconf, define it here.
slouken@729
   333
m4_ifdef([AC_PROVIDE_IFELSE],
slouken@729
   334
         [],
slouken@729
   335
         [m4_define([AC_PROVIDE_IFELSE],
slouken@729
   336
	         [m4_ifdef([AC_PROVIDE_$1],
slouken@729
   337
		           [$2], [$3])])])
slouken@729
   338
slouken@729
   339
slouken@729
   340
# AC_PROG_LIBTOOL
slouken@729
   341
# ---------------
slouken@729
   342
AC_DEFUN([AC_PROG_LIBTOOL],
slouken@729
   343
[AC_REQUIRE([_AC_PROG_LIBTOOL])dnl
slouken@1309
   344
dnl If AC_PROG_CXX has already been expanded, run AC_LIBTOOL_CXX
slouken@1309
   345
dnl immediately, otherwise, hook it in at the end of AC_PROG_CXX.
slouken@729
   346
  AC_PROVIDE_IFELSE([AC_PROG_CXX],
slouken@729
   347
    [AC_LIBTOOL_CXX],
slouken@1309
   348
    [define([AC_PROG_CXX], defn([AC_PROG_CXX])[AC_LIBTOOL_CXX
slouken@1309
   349
  ])])
slouken@1309
   350
dnl And a similar setup for Fortran 77 support
slouken@729
   351
  AC_PROVIDE_IFELSE([AC_PROG_F77],
slouken@729
   352
    [AC_LIBTOOL_F77],
slouken@1309
   353
    [define([AC_PROG_F77], defn([AC_PROG_F77])[AC_LIBTOOL_F77
slouken@1309
   354
])])
slouken@1309
   355
slouken@729
   356
dnl Quote A][M_PROG_GCJ so that aclocal doesn't bring it in needlessly.
slouken@729
   357
dnl If either AC_PROG_GCJ or A][M_PROG_GCJ have already been expanded, run
slouken@729
   358
dnl AC_LIBTOOL_GCJ immediately, otherwise, hook it in at the end of both.
slouken@729
   359
  AC_PROVIDE_IFELSE([AC_PROG_GCJ],
slouken@729
   360
    [AC_LIBTOOL_GCJ],
slouken@729
   361
    [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
slouken@729
   362
      [AC_LIBTOOL_GCJ],
slouken@729
   363
      [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],
slouken@729
   364
	[AC_LIBTOOL_GCJ],
slouken@729
   365
      [ifdef([AC_PROG_GCJ],
slouken@729
   366
	     [define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])
slouken@729
   367
       ifdef([A][M_PROG_GCJ],
slouken@729
   368
	     [define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[AC_LIBTOOL_GCJ])])
slouken@729
   369
       ifdef([LT_AC_PROG_GCJ],
slouken@729
   370
	     [define([LT_AC_PROG_GCJ],
slouken@729
   371
		defn([LT_AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])])])
slouken@1309
   372
])])# AC_PROG_LIBTOOL
slouken@729
   373
slouken@729
   374
slouken@729
   375
# _AC_PROG_LIBTOOL
slouken@729
   376
# ----------------
slouken@729
   377
AC_DEFUN([_AC_PROG_LIBTOOL],
slouken@0
   378
[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
slouken@729
   379
AC_BEFORE([$0],[AC_LIBTOOL_CXX])dnl
slouken@729
   380
AC_BEFORE([$0],[AC_LIBTOOL_F77])dnl
slouken@729
   381
AC_BEFORE([$0],[AC_LIBTOOL_GCJ])dnl
slouken@0
   382
slouken@0
   383
# This can be used to rebuild libtool when needed
slouken@729
   384
LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh"
slouken@0
   385
slouken@0
   386
# Always use our own libtool.
slouken@0
   387
LIBTOOL='$(SHELL) $(top_builddir)/libtool'
slouken@0
   388
AC_SUBST(LIBTOOL)dnl
slouken@0
   389
slouken@729
   390
# Prevent multiple expansion
slouken@729
   391
define([AC_PROG_LIBTOOL], [])
slouken@729
   392
])# _AC_PROG_LIBTOOL
slouken@729
   393
slouken@729
   394
slouken@729
   395
# AC_LIBTOOL_SETUP
slouken@729
   396
# ----------------
slouken@729
   397
AC_DEFUN([AC_LIBTOOL_SETUP],
slouken@729
   398
[AC_PREREQ(2.50)dnl
slouken@0
   399
AC_REQUIRE([AC_ENABLE_SHARED])dnl
slouken@0
   400
AC_REQUIRE([AC_ENABLE_STATIC])dnl
slouken@0
   401
AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
slouken@0
   402
AC_REQUIRE([AC_CANONICAL_HOST])dnl
slouken@0
   403
AC_REQUIRE([AC_CANONICAL_BUILD])dnl
slouken@0
   404
AC_REQUIRE([AC_PROG_CC])dnl
slouken@0
   405
AC_REQUIRE([AC_PROG_LD])dnl
slouken@729
   406
AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl
slouken@0
   407
AC_REQUIRE([AC_PROG_NM])dnl
slouken@729
   408
slouken@0
   409
AC_REQUIRE([AC_PROG_LN_S])dnl
slouken@729
   410
AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl
slouken@729
   411
# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers!
slouken@729
   412
AC_REQUIRE([AC_OBJEXT])dnl
slouken@729
   413
AC_REQUIRE([AC_EXEEXT])dnl
slouken@0
   414
dnl
slouken@0
   415
slouken@729
   416
AC_LIBTOOL_SYS_MAX_CMD_LEN
slouken@729
   417
AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
slouken@729
   418
AC_LIBTOOL_OBJDIR
slouken@729
   419
slouken@729
   420
AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
slouken@729
   421
_LT_AC_PROG_ECHO_BACKSLASH
slouken@729
   422
slouken@729
   423
case $host_os in
slouken@729
   424
aix3*)
slouken@729
   425
  # AIX sometimes has problems with the GCC collect2 program.  For some
slouken@729
   426
  # reason, if we set the COLLECT_NAMES environment variable, the problems
slouken@729
   427
  # vanish in a puff of smoke.
slouken@729
   428
  if test "X${COLLECT_NAMES+set}" != Xset; then
slouken@729
   429
    COLLECT_NAMES=
slouken@729
   430
    export COLLECT_NAMES
slouken@729
   431
  fi
slouken@729
   432
  ;;
slouken@0
   433
esac
slouken@0
   434
slouken@729
   435
# Sed substitution that helps us do robust quoting.  It backslashifies
slouken@729
   436
# metacharacters that are still active within double-quoted strings.
slouken@1570
   437
Xsed='sed -e 1s/^X//'
slouken@729
   438
[sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g']
slouken@729
   439
slouken@729
   440
# Same as above, but do not quote variable references.
slouken@729
   441
[double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g']
slouken@729
   442
slouken@729
   443
# Sed substitution to delay expansion of an escaped shell variable in a
slouken@729
   444
# double_quote_subst'ed string.
slouken@729
   445
delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
slouken@729
   446
slouken@729
   447
# Sed substitution to avoid accidental globbing in evaled expressions
slouken@729
   448
no_glob_subst='s/\*/\\\*/g'
slouken@729
   449
slouken@729
   450
# Constants:
slouken@729
   451
rm="rm -f"
slouken@729
   452
slouken@729
   453
# Global variables:
slouken@729
   454
default_ofile=libtool
slouken@729
   455
can_build_shared=yes
slouken@729
   456
slouken@1570
   457
# All known linkers require a `.a' archive for static linking (except MSVC,
slouken@729
   458
# which needs '.lib').
slouken@729
   459
libext=a
slouken@729
   460
ltmain="$ac_aux_dir/ltmain.sh"
slouken@729
   461
ofile="$default_ofile"
slouken@729
   462
with_gnu_ld="$lt_cv_prog_gnu_ld"
slouken@729
   463
slouken@729
   464
AC_CHECK_TOOL(AR, ar, false)
slouken@729
   465
AC_CHECK_TOOL(RANLIB, ranlib, :)
slouken@729
   466
AC_CHECK_TOOL(STRIP, strip, :)
slouken@729
   467
slouken@729
   468
old_CC="$CC"
slouken@729
   469
old_CFLAGS="$CFLAGS"
slouken@729
   470
slouken@729
   471
# Set sane defaults for various variables
slouken@729
   472
test -z "$AR" && AR=ar
slouken@729
   473
test -z "$AR_FLAGS" && AR_FLAGS=cru
slouken@729
   474
test -z "$AS" && AS=as
slouken@729
   475
test -z "$CC" && CC=cc
slouken@729
   476
test -z "$LTCC" && LTCC=$CC
slouken@1570
   477
test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
slouken@729
   478
test -z "$DLLTOOL" && DLLTOOL=dlltool
slouken@729
   479
test -z "$LD" && LD=ld
slouken@729
   480
test -z "$LN_S" && LN_S="ln -s"
slouken@729
   481
test -z "$MAGIC_CMD" && MAGIC_CMD=file
slouken@729
   482
test -z "$NM" && NM=nm
slouken@729
   483
test -z "$SED" && SED=sed
slouken@729
   484
test -z "$OBJDUMP" && OBJDUMP=objdump
slouken@729
   485
test -z "$RANLIB" && RANLIB=:
slouken@729
   486
test -z "$STRIP" && STRIP=:
slouken@729
   487
test -z "$ac_objext" && ac_objext=o
slouken@729
   488
slouken@729
   489
# Determine commands to create old-style static archives.
slouken@729
   490
old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs'
slouken@729
   491
old_postinstall_cmds='chmod 644 $oldlib'
slouken@729
   492
old_postuninstall_cmds=
slouken@729
   493
slouken@729
   494
if test -n "$RANLIB"; then
slouken@729
   495
  case $host_os in
slouken@729
   496
  openbsd*)
slouken@1570
   497
    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib"
slouken@729
   498
    ;;
slouken@729
   499
  *)
slouken@1570
   500
    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib"
slouken@729
   501
    ;;
slouken@729
   502
  esac
slouken@729
   503
  old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
slouken@729
   504
fi
slouken@729
   505
slouken@1570
   506
_LT_CC_BASENAME([$compiler])
slouken@947
   507
slouken@729
   508
# Only perform the check for file, if the check method requires it
slouken@729
   509
case $deplibs_check_method in
slouken@729
   510
file_magic*)
slouken@729
   511
  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
slouken@729
   512
    AC_PATH_MAGIC
slouken@729
   513
  fi
slouken@729
   514
  ;;
slouken@729
   515
esac
slouken@729
   516
slouken@729
   517
AC_PROVIDE_IFELSE([AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no)
slouken@729
   518
AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL],
slouken@729
   519
enable_win32_dll=yes, enable_win32_dll=no)
slouken@729
   520
slouken@729
   521
AC_ARG_ENABLE([libtool-lock],
slouken@729
   522
    [AC_HELP_STRING([--disable-libtool-lock],
slouken@729
   523
	[avoid locking (might break parallel builds)])])
slouken@729
   524
test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
slouken@729
   525
slouken@729
   526
AC_ARG_WITH([pic],
slouken@729
   527
    [AC_HELP_STRING([--with-pic],
slouken@729
   528
	[try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
slouken@729
   529
    [pic_mode="$withval"],
slouken@729
   530
    [pic_mode=default])
slouken@729
   531
test -z "$pic_mode" && pic_mode=default
slouken@729
   532
slouken@729
   533
# Use C for the default configuration in the libtool script
slouken@729
   534
tagname=
slouken@729
   535
AC_LIBTOOL_LANG_C_CONFIG
slouken@729
   536
_LT_AC_TAGCONFIG
slouken@729
   537
])# AC_LIBTOOL_SETUP
slouken@729
   538
slouken@729
   539
slouken@729
   540
# _LT_AC_SYS_COMPILER
slouken@729
   541
# -------------------
slouken@729
   542
AC_DEFUN([_LT_AC_SYS_COMPILER],
slouken@729
   543
[AC_REQUIRE([AC_PROG_CC])dnl
slouken@729
   544
slouken@729
   545
# If no C compiler was specified, use CC.
slouken@729
   546
LTCC=${LTCC-"$CC"}
slouken@729
   547
slouken@1570
   548
# If no C compiler flags were specified, use CFLAGS.
slouken@1570
   549
LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
slouken@1570
   550
slouken@729
   551
# Allow CC to be a program name with arguments.
slouken@729
   552
compiler=$CC
slouken@729
   553
])# _LT_AC_SYS_COMPILER
slouken@729
   554
slouken@729
   555
slouken@1570
   556
# _LT_CC_BASENAME(CC)
slouken@1570
   557
# -------------------
slouken@1570
   558
# Calculate cc_basename.  Skip known compiler wrappers and cross-prefix.
slouken@1570
   559
AC_DEFUN([_LT_CC_BASENAME],
slouken@1570
   560
[for cc_temp in $1""; do
slouken@1570
   561
  case $cc_temp in
slouken@1570
   562
    compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
slouken@1570
   563
    distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
slouken@1570
   564
    \-*) ;;
slouken@1570
   565
    *) break;;
slouken@1570
   566
  esac
slouken@1570
   567
done
slouken@1570
   568
cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
slouken@1570
   569
])
slouken@1570
   570
slouken@1570
   571
slouken@1570
   572
# _LT_COMPILER_BOILERPLATE
slouken@1570
   573
# ------------------------
slouken@1570
   574
# Check for compiler boilerplate output or warnings with
slouken@1570
   575
# the simple compiler test code.
slouken@1570
   576
AC_DEFUN([_LT_COMPILER_BOILERPLATE],
slouken@1570
   577
[ac_outfile=conftest.$ac_objext
slouken@1570
   578
printf "$lt_simple_compile_test_code" >conftest.$ac_ext
slouken@1570
   579
eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
slouken@1570
   580
_lt_compiler_boilerplate=`cat conftest.err`
slouken@1570
   581
$rm conftest*
slouken@1570
   582
])# _LT_COMPILER_BOILERPLATE
slouken@1570
   583
slouken@1570
   584
slouken@1570
   585
# _LT_LINKER_BOILERPLATE
slouken@1570
   586
# ----------------------
slouken@1570
   587
# Check for linker boilerplate output or warnings with
slouken@1570
   588
# the simple link test code.
slouken@1570
   589
AC_DEFUN([_LT_LINKER_BOILERPLATE],
slouken@1570
   590
[ac_outfile=conftest.$ac_objext
slouken@1570
   591
printf "$lt_simple_link_test_code" >conftest.$ac_ext
slouken@1570
   592
eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
slouken@1570
   593
_lt_linker_boilerplate=`cat conftest.err`
slouken@1570
   594
$rm conftest*
slouken@1570
   595
])# _LT_LINKER_BOILERPLATE
slouken@1570
   596
slouken@1570
   597
slouken@729
   598
# _LT_AC_SYS_LIBPATH_AIX
slouken@729
   599
# ----------------------
slouken@729
   600
# Links a minimal program and checks the executable
slouken@729
   601
# for the system default hardcoded library path. In most cases,
slouken@729
   602
# this is /usr/lib:/lib, but when the MPI compilers are used
slouken@729
   603
# the location of the communication and MPI libs are included too.
slouken@729
   604
# If we don't find anything, use the default library path according
slouken@729
   605
# to the aix ld manual.
slouken@729
   606
AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX],
slouken@729
   607
[AC_LINK_IFELSE(AC_LANG_PROGRAM,[
slouken@729
   608
aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
slouken@729
   609
}'`
slouken@729
   610
# Check for a 64-bit object if we didn't find anything.
slouken@729
   611
if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
slouken@729
   612
}'`; fi],[])
slouken@729
   613
if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
slouken@729
   614
])# _LT_AC_SYS_LIBPATH_AIX
slouken@729
   615
slouken@729
   616
slouken@729
   617
# _LT_AC_SHELL_INIT(ARG)
slouken@729
   618
# ----------------------
slouken@729
   619
AC_DEFUN([_LT_AC_SHELL_INIT],
slouken@729
   620
[ifdef([AC_DIVERSION_NOTICE],
slouken@729
   621
	     [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)],
slouken@729
   622
	 [AC_DIVERT_PUSH(NOTICE)])
slouken@729
   623
$1
slouken@729
   624
AC_DIVERT_POP
slouken@729
   625
])# _LT_AC_SHELL_INIT
slouken@729
   626
slouken@729
   627
slouken@729
   628
# _LT_AC_PROG_ECHO_BACKSLASH
slouken@729
   629
# --------------------------
slouken@729
   630
# Add some code to the start of the generated configure script which
slouken@729
   631
# will find an echo command which doesn't interpret backslashes.
slouken@729
   632
AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH],
slouken@729
   633
[_LT_AC_SHELL_INIT([
slouken@729
   634
# Check that we are running under the correct shell.
slouken@729
   635
SHELL=${CONFIG_SHELL-/bin/sh}
slouken@729
   636
slouken@729
   637
case X$ECHO in
slouken@729
   638
X*--fallback-echo)
slouken@729
   639
  # Remove one level of quotation (which was required for Make).
slouken@729
   640
  ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','`
slouken@729
   641
  ;;
slouken@729
   642
esac
slouken@729
   643
slouken@729
   644
echo=${ECHO-echo}
slouken@729
   645
if test "X[$]1" = X--no-reexec; then
slouken@729
   646
  # Discard the --no-reexec flag, and continue.
slouken@729
   647
  shift
slouken@729
   648
elif test "X[$]1" = X--fallback-echo; then
slouken@729
   649
  # Avoid inline document here, it may be left over
slouken@729
   650
  :
slouken@729
   651
elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then
slouken@729
   652
  # Yippee, $echo works!
slouken@729
   653
  :
slouken@729
   654
else
slouken@729
   655
  # Restart under the correct shell.
slouken@729
   656
  exec $SHELL "[$]0" --no-reexec ${1+"[$]@"}
slouken@729
   657
fi
slouken@729
   658
slouken@729
   659
if test "X[$]1" = X--fallback-echo; then
slouken@729
   660
  # used as fallback echo
slouken@729
   661
  shift
slouken@729
   662
  cat <<EOF
slouken@729
   663
[$]*
slouken@729
   664
EOF
slouken@729
   665
  exit 0
slouken@729
   666
fi
slouken@729
   667
slouken@729
   668
# The HP-UX ksh and POSIX shell print the target directory to stdout
slouken@729
   669
# if CDPATH is set.
slouken@947
   670
(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
slouken@729
   671
slouken@729
   672
if test -z "$ECHO"; then
slouken@729
   673
if test "X${echo_test_string+set}" != Xset; then
slouken@729
   674
# find a string as large as possible, as long as the shell can cope with it
slouken@729
   675
  for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do
slouken@729
   676
    # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
slouken@1570
   677
    if (echo_test_string=`eval $cmd`) 2>/dev/null &&
slouken@1570
   678
       echo_test_string=`eval $cmd` &&
slouken@729
   679
       (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null
slouken@729
   680
    then
slouken@729
   681
      break
slouken@729
   682
    fi
slouken@729
   683
  done
slouken@729
   684
fi
slouken@729
   685
slouken@729
   686
if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
slouken@729
   687
   echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
slouken@729
   688
   test "X$echo_testing_string" = "X$echo_test_string"; then
slouken@729
   689
  :
slouken@729
   690
else
slouken@729
   691
  # The Solaris, AIX, and Digital Unix default echo programs unquote
slouken@729
   692
  # backslashes.  This makes it impossible to quote backslashes using
slouken@729
   693
  #   echo "$something" | sed 's/\\/\\\\/g'
slouken@729
   694
  #
slouken@729
   695
  # So, first we look for a working echo in the user's PATH.
slouken@729
   696
slouken@729
   697
  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
slouken@729
   698
  for dir in $PATH /usr/ucb; do
slouken@729
   699
    IFS="$lt_save_ifs"
slouken@729
   700
    if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
slouken@729
   701
       test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
slouken@729
   702
       echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
slouken@729
   703
       test "X$echo_testing_string" = "X$echo_test_string"; then
slouken@729
   704
      echo="$dir/echo"
slouken@729
   705
      break
slouken@729
   706
    fi
slouken@729
   707
  done
slouken@729
   708
  IFS="$lt_save_ifs"
slouken@729
   709
slouken@729
   710
  if test "X$echo" = Xecho; then
slouken@729
   711
    # We didn't find a better echo, so look for alternatives.
slouken@729
   712
    if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' &&
slouken@729
   713
       echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` &&
slouken@729
   714
       test "X$echo_testing_string" = "X$echo_test_string"; then
slouken@729
   715
      # This shell has a builtin print -r that does the trick.
slouken@729
   716
      echo='print -r'
slouken@729
   717
    elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) &&
slouken@729
   718
	 test "X$CONFIG_SHELL" != X/bin/ksh; then
slouken@729
   719
      # If we have ksh, try running configure again with it.
slouken@729
   720
      ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
slouken@729
   721
      export ORIGINAL_CONFIG_SHELL
slouken@729
   722
      CONFIG_SHELL=/bin/ksh
slouken@729
   723
      export CONFIG_SHELL
slouken@729
   724
      exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"}
slouken@729
   725
    else
slouken@729
   726
      # Try using printf.
slouken@729
   727
      echo='printf %s\n'
slouken@729
   728
      if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
slouken@729
   729
	 echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
slouken@729
   730
	 test "X$echo_testing_string" = "X$echo_test_string"; then
slouken@729
   731
	# Cool, printf works
slouken@729
   732
	:
slouken@729
   733
      elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
slouken@729
   734
	   test "X$echo_testing_string" = 'X\t' &&
slouken@729
   735
	   echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
slouken@729
   736
	   test "X$echo_testing_string" = "X$echo_test_string"; then
slouken@729
   737
	CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
slouken@729
   738
	export CONFIG_SHELL
slouken@729
   739
	SHELL="$CONFIG_SHELL"
slouken@729
   740
	export SHELL
slouken@729
   741
	echo="$CONFIG_SHELL [$]0 --fallback-echo"
slouken@729
   742
      elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
slouken@729
   743
	   test "X$echo_testing_string" = 'X\t' &&
slouken@729
   744
	   echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
slouken@729
   745
	   test "X$echo_testing_string" = "X$echo_test_string"; then
slouken@729
   746
	echo="$CONFIG_SHELL [$]0 --fallback-echo"
slouken@729
   747
      else
slouken@729
   748
	# maybe with a smaller string...
slouken@729
   749
	prev=:
slouken@729
   750
slouken@729
   751
	for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do
slouken@729
   752
	  if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null
slouken@729
   753
	  then
slouken@729
   754
	    break
slouken@729
   755
	  fi
slouken@729
   756
	  prev="$cmd"
slouken@729
   757
	done
slouken@729
   758
slouken@729
   759
	if test "$prev" != 'sed 50q "[$]0"'; then
slouken@729
   760
	  echo_test_string=`eval $prev`
slouken@729
   761
	  export echo_test_string
slouken@729
   762
	  exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"}
slouken@729
   763
	else
slouken@729
   764
	  # Oops.  We lost completely, so just stick with echo.
slouken@729
   765
	  echo=echo
slouken@729
   766
	fi
slouken@729
   767
      fi
slouken@729
   768
    fi
slouken@729
   769
  fi
slouken@729
   770
fi
slouken@729
   771
fi
slouken@729
   772
slouken@729
   773
# Copy echo and quote the copy suitably for passing to libtool from
slouken@729
   774
# the Makefile, instead of quoting the original, which is used later.
slouken@729
   775
ECHO=$echo
slouken@729
   776
if test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then
slouken@729
   777
   ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo"
slouken@729
   778
fi
slouken@729
   779
slouken@729
   780
AC_SUBST(ECHO)
slouken@729
   781
])])# _LT_AC_PROG_ECHO_BACKSLASH
slouken@729
   782
slouken@729
   783
slouken@729
   784
# _LT_AC_LOCK
slouken@729
   785
# -----------
slouken@729
   786
AC_DEFUN([_LT_AC_LOCK],
slouken@729
   787
[AC_ARG_ENABLE([libtool-lock],
slouken@729
   788
    [AC_HELP_STRING([--disable-libtool-lock],
slouken@729
   789
	[avoid locking (might break parallel builds)])])
slouken@729
   790
test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
slouken@0
   791
slouken@0
   792
# Some flags need to be propagated to the compiler or linker for good
slouken@0
   793
# libtool support.
slouken@729
   794
case $host in
slouken@729
   795
ia64-*-hpux*)
slouken@729
   796
  # Find out which ABI we are using.
slouken@729
   797
  echo 'int i;' > conftest.$ac_ext
slouken@729
   798
  if AC_TRY_EVAL(ac_compile); then
slouken@729
   799
    case `/usr/bin/file conftest.$ac_objext` in
slouken@729
   800
    *ELF-32*)
slouken@729
   801
      HPUX_IA64_MODE="32"
slouken@729
   802
      ;;
slouken@729
   803
    *ELF-64*)
slouken@729
   804
      HPUX_IA64_MODE="64"
slouken@729
   805
      ;;
slouken@729
   806
    esac
slouken@729
   807
  fi
slouken@729
   808
  rm -rf conftest*
slouken@729
   809
  ;;
slouken@0
   810
*-*-irix6*)
slouken@0
   811
  # Find out which ABI we are using.
slouken@0
   812
  echo '[#]line __oline__ "configure"' > conftest.$ac_ext
slouken@0
   813
  if AC_TRY_EVAL(ac_compile); then
slouken@729
   814
   if test "$lt_cv_prog_gnu_ld" = yes; then
slouken@729
   815
    case `/usr/bin/file conftest.$ac_objext` in
slouken@729
   816
    *32-bit*)
slouken@729
   817
      LD="${LD-ld} -melf32bsmip"
slouken@729
   818
      ;;
slouken@729
   819
    *N32*)
slouken@729
   820
      LD="${LD-ld} -melf32bmipn32"
slouken@729
   821
      ;;
slouken@729
   822
    *64-bit*)
slouken@729
   823
      LD="${LD-ld} -melf64bmip"
slouken@729
   824
      ;;
slouken@729
   825
    esac
slouken@729
   826
   else
slouken@729
   827
    case `/usr/bin/file conftest.$ac_objext` in
slouken@0
   828
    *32-bit*)
slouken@0
   829
      LD="${LD-ld} -32"
slouken@0
   830
      ;;
slouken@0
   831
    *N32*)
slouken@0
   832
      LD="${LD-ld} -n32"
slouken@0
   833
      ;;
slouken@0
   834
    *64-bit*)
slouken@0
   835
      LD="${LD-ld} -64"
slouken@0
   836
      ;;
slouken@0
   837
    esac
slouken@729
   838
   fi
slouken@729
   839
  fi
slouken@729
   840
  rm -rf conftest*
slouken@729
   841
  ;;
slouken@729
   842
slouken@729
   843
x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*)
slouken@729
   844
  # Find out which ABI we are using.
slouken@729
   845
  echo 'int i;' > conftest.$ac_ext
slouken@729
   846
  if AC_TRY_EVAL(ac_compile); then
slouken@1570
   847
    case `/usr/bin/file conftest.o` in
slouken@729
   848
    *32-bit*)
slouken@729
   849
      case $host in
slouken@729
   850
        x86_64-*linux*)
slouken@729
   851
          LD="${LD-ld} -m elf_i386"
slouken@729
   852
          ;;
slouken@947
   853
        ppc64-*linux*|powerpc64-*linux*)
slouken@729
   854
          LD="${LD-ld} -m elf32ppclinux"
slouken@729
   855
          ;;
slouken@729
   856
        s390x-*linux*)
slouken@729
   857
          LD="${LD-ld} -m elf_s390"
slouken@729
   858
          ;;
slouken@729
   859
        sparc64-*linux*)
slouken@729
   860
          LD="${LD-ld} -m elf32_sparc"
slouken@729
   861
          ;;
slouken@729
   862
      esac
slouken@729
   863
      ;;
slouken@729
   864
    *64-bit*)
slouken@729
   865
      case $host in
slouken@729
   866
        x86_64-*linux*)
slouken@729
   867
          LD="${LD-ld} -m elf_x86_64"
slouken@729
   868
          ;;
slouken@729
   869
        ppc*-*linux*|powerpc*-*linux*)
slouken@729
   870
          LD="${LD-ld} -m elf64ppc"
slouken@729
   871
          ;;
slouken@729
   872
        s390*-*linux*)
slouken@729
   873
          LD="${LD-ld} -m elf64_s390"
slouken@729
   874
          ;;
slouken@729
   875
        sparc*-*linux*)
slouken@729
   876
          LD="${LD-ld} -m elf64_sparc"
slouken@729
   877
          ;;
slouken@729
   878
      esac
slouken@729
   879
      ;;
slouken@729
   880
    esac
slouken@0
   881
  fi
slouken@0
   882
  rm -rf conftest*
slouken@0
   883
  ;;
slouken@0
   884
slouken@0
   885
*-*-sco3.2v5*)
slouken@0
   886
  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
slouken@0
   887
  SAVE_CFLAGS="$CFLAGS"
slouken@0
   888
  CFLAGS="$CFLAGS -belf"
slouken@0
   889
  AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
slouken@729
   890
    [AC_LANG_PUSH(C)
slouken@729
   891
     AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
slouken@729
   892
     AC_LANG_POP])
slouken@0
   893
  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
slouken@0
   894
    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
slouken@0
   895
    CFLAGS="$SAVE_CFLAGS"
slouken@0
   896
  fi
slouken@0
   897
  ;;
slouken@1570
   898
sparc*-*solaris*)
slouken@1570
   899
  # Find out which ABI we are using.
slouken@1570
   900
  echo 'int i;' > conftest.$ac_ext
slouken@1570
   901
  if AC_TRY_EVAL(ac_compile); then
slouken@1570
   902
    case `/usr/bin/file conftest.o` in
slouken@1570
   903
    *64-bit*)
slouken@1570
   904
      case $lt_cv_prog_gnu_ld in
slouken@1570
   905
      yes*) LD="${LD-ld} -m elf64_sparc" ;;
slouken@1570
   906
      *)    LD="${LD-ld} -64" ;;
slouken@1570
   907
      esac
slouken@1570
   908
      ;;
slouken@1570
   909
    esac
slouken@1570
   910
  fi
slouken@1570
   911
  rm -rf conftest*
slouken@1570
   912
  ;;
slouken@1570
   913
slouken@729
   914
AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL],
slouken@729
   915
[*-*-cygwin* | *-*-mingw* | *-*-pw32*)
slouken@0
   916
  AC_CHECK_TOOL(DLLTOOL, dlltool, false)
slouken@0
   917
  AC_CHECK_TOOL(AS, as, false)
slouken@0
   918
  AC_CHECK_TOOL(OBJDUMP, objdump, false)
slouken@0
   919
  ;;
slouken@729
   920
  ])
slouken@729
   921
esac
slouken@729
   922
slouken@729
   923
need_locks="$enable_libtool_lock"
slouken@729
   924
slouken@729
   925
])# _LT_AC_LOCK
slouken@729
   926
slouken@729
   927
slouken@729
   928
# AC_LIBTOOL_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
slouken@729
   929
#		[OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
slouken@729
   930
# ----------------------------------------------------------------
slouken@729
   931
# Check whether the given compiler option works
slouken@729
   932
AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION],
slouken@947
   933
[AC_REQUIRE([LT_AC_PROG_SED])
slouken@947
   934
AC_CACHE_CHECK([$1], [$2],
slouken@729
   935
  [$2=no
slouken@729
   936
  ifelse([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
slouken@729
   937
   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
slouken@729
   938
   lt_compiler_flag="$3"
slouken@729
   939
   # Insert the option either (1) after the last *FLAGS variable, or
slouken@729
   940
   # (2) before a word containing "conftest.", or (3) at the end.
slouken@729
   941
   # Note that $ac_compile itself does not contain backslashes and begins
slouken@729
   942
   # with a dollar sign (not a hyphen), so the echo should work correctly.
slouken@729
   943
   # The option is referenced via a variable to avoid confusing sed.
slouken@729
   944
   lt_compile=`echo "$ac_compile" | $SED \
slouken@1570
   945
   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
slouken@729
   946
   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
slouken@729
   947
   -e 's:$: $lt_compiler_flag:'`
slouken@729
   948
   (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
slouken@729
   949
   (eval "$lt_compile" 2>conftest.err)
slouken@729
   950
   ac_status=$?
slouken@729
   951
   cat conftest.err >&AS_MESSAGE_LOG_FD
slouken@729
   952
   echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
slouken@729
   953
   if (exit $ac_status) && test -s "$ac_outfile"; then
slouken@729
   954
     # The compiler can only warn and ignore the option if not recognized
slouken@1570
   955
     # So say no if there are warnings other than the usual output.
slouken@1570
   956
     $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
slouken@1570
   957
     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
slouken@1570
   958
     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
slouken@729
   959
       $2=yes
slouken@729
   960
     fi
slouken@729
   961
   fi
slouken@729
   962
   $rm conftest*
slouken@0
   963
])
slouken@729
   964
slouken@729
   965
if test x"[$]$2" = xyes; then
slouken@729
   966
    ifelse([$5], , :, [$5])
slouken@729
   967
else
slouken@729
   968
    ifelse([$6], , :, [$6])
slouken@729
   969
fi
slouken@729
   970
])# AC_LIBTOOL_COMPILER_OPTION
slouken@729
   971
slouken@729
   972
slouken@729
   973
# AC_LIBTOOL_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
slouken@729
   974
#                          [ACTION-SUCCESS], [ACTION-FAILURE])
slouken@729
   975
# ------------------------------------------------------------
slouken@729
   976
# Check whether the given compiler option works
slouken@729
   977
AC_DEFUN([AC_LIBTOOL_LINKER_OPTION],
slouken@729
   978
[AC_CACHE_CHECK([$1], [$2],
slouken@729
   979
  [$2=no
slouken@729
   980
   save_LDFLAGS="$LDFLAGS"
slouken@729
   981
   LDFLAGS="$LDFLAGS $3"
slouken@729
   982
   printf "$lt_simple_link_test_code" > conftest.$ac_ext
slouken@729
   983
   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
slouken@1570
   984
     # The linker can only warn and ignore the option if not recognized
slouken@729
   985
     # So say no if there are warnings
slouken@729
   986
     if test -s conftest.err; then
slouken@729
   987
       # Append any errors to the config.log.
slouken@729
   988
       cat conftest.err 1>&AS_MESSAGE_LOG_FD
slouken@1570
   989
       $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp
slouken@1570
   990
       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
slouken@1570
   991
       if diff conftest.exp conftest.er2 >/dev/null; then
slouken@1570
   992
         $2=yes
slouken@1570
   993
       fi
slouken@729
   994
     else
slouken@729
   995
       $2=yes
slouken@729
   996
     fi
slouken@729
   997
   fi
slouken@729
   998
   $rm conftest*
slouken@729
   999
   LDFLAGS="$save_LDFLAGS"
slouken@729
  1000
])
slouken@729
  1001
slouken@729
  1002
if test x"[$]$2" = xyes; then
slouken@729
  1003
    ifelse([$4], , :, [$4])
slouken@729
  1004
else
slouken@729
  1005
    ifelse([$5], , :, [$5])
slouken@729
  1006
fi
slouken@729
  1007
])# AC_LIBTOOL_LINKER_OPTION
slouken@729
  1008
slouken@729
  1009
slouken@729
  1010
# AC_LIBTOOL_SYS_MAX_CMD_LEN
slouken@729
  1011
# --------------------------
slouken@729
  1012
AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN],
slouken@729
  1013
[# find the maximum length of command line arguments
slouken@729
  1014
AC_MSG_CHECKING([the maximum length of command line arguments])
slouken@729
  1015
AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
slouken@729
  1016
  i=0
slouken@947
  1017
  teststring="ABCD"
slouken@729
  1018
slouken@729
  1019
  case $build_os in
slouken@729
  1020
  msdosdjgpp*)
slouken@729
  1021
    # On DJGPP, this test can blow up pretty badly due to problems in libc
slouken@729
  1022
    # (any single argument exceeding 2000 bytes causes a buffer overrun
slouken@729
  1023
    # during glob expansion).  Even if it were fixed, the result of this
slouken@729
  1024
    # check would be larger than it should be.
slouken@729
  1025
    lt_cv_sys_max_cmd_len=12288;    # 12K is about right
slouken@729
  1026
    ;;
slouken@729
  1027
slouken@729
  1028
  gnu*)
slouken@729
  1029
    # Under GNU Hurd, this test is not required because there is
slouken@729
  1030
    # no limit to the length of command line arguments.
slouken@729
  1031
    # Libtool will interpret -1 as no limit whatsoever
slouken@729
  1032
    lt_cv_sys_max_cmd_len=-1;
slouken@729
  1033
    ;;
slouken@729
  1034
slouken@729
  1035
  cygwin* | mingw*)
slouken@729
  1036
    # On Win9x/ME, this test blows up -- it succeeds, but takes
slouken@729
  1037
    # about 5 minutes as the teststring grows exponentially.
slouken@729
  1038
    # Worse, since 9x/ME are not pre-emptively multitasking,
slouken@729
  1039
    # you end up with a "frozen" computer, even though with patience
slouken@729
  1040
    # the test eventually succeeds (with a max line length of 256k).
slouken@729
  1041
    # Instead, let's just punt: use the minimum linelength reported by
slouken@729
  1042
    # all of the supported platforms: 8192 (on NT/2K/XP).
slouken@729
  1043
    lt_cv_sys_max_cmd_len=8192;
slouken@729
  1044
    ;;
slouken@729
  1045
slouken@1361
  1046
  beos*)
slouken@1361
  1047
    # On BeOS, this test takes a really really long time.
slouken@1361
  1048
    # So we just punt and use a minimum line length of 8192.
slouken@1361
  1049
    lt_cv_sys_max_cmd_len=8192;
slouken@1361
  1050
    ;;
slouken@1361
  1051
slouken@947
  1052
  amigaos*)
slouken@947
  1053
    # On AmigaOS with pdksh, this test takes hours, literally.
slouken@947
  1054
    # So we just punt and use a minimum line length of 8192.
slouken@947
  1055
    lt_cv_sys_max_cmd_len=8192;
slouken@947
  1056
    ;;
slouken@947
  1057
slouken@1570
  1058
  netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
slouken@947
  1059
    # This has been around since 386BSD, at least.  Likely further.
slouken@947
  1060
    if test -x /sbin/sysctl; then
slouken@947
  1061
      lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
slouken@947
  1062
    elif test -x /usr/sbin/sysctl; then
slouken@947
  1063
      lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
slouken@947
  1064
    else
slouken@1570
  1065
      lt_cv_sys_max_cmd_len=65536	# usable default for all BSDs
slouken@947
  1066
    fi
slouken@947
  1067
    # And add a safety zone
slouken@947
  1068
    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
slouken@1570
  1069
    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
slouken@947
  1070
    ;;
slouken@947
  1071
slouken@1570
  1072
  interix*)
slouken@1570
  1073
    # We know the value 262144 and hardcode it with a safety zone (like BSD)
slouken@1570
  1074
    lt_cv_sys_max_cmd_len=196608
slouken@1570
  1075
    ;;
slouken@1570
  1076
slouken@1570
  1077
  osf*)
slouken@1570
  1078
    # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
slouken@1570
  1079
    # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
slouken@1570
  1080
    # nice to cause kernel panics so lets avoid the loop below.
slouken@1570
  1081
    # First set a reasonable default.
slouken@1570
  1082
    lt_cv_sys_max_cmd_len=16384
slouken@1570
  1083
    #
slouken@1570
  1084
    if test -x /sbin/sysconfig; then
slouken@1570
  1085
      case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
slouken@1570
  1086
        *1*) lt_cv_sys_max_cmd_len=-1 ;;
slouken@1570
  1087
      esac
slouken@1570
  1088
    fi
slouken@1570
  1089
    ;;
slouken@1570
  1090
  sco3.2v5*)
slouken@1570
  1091
    lt_cv_sys_max_cmd_len=102400
slouken@1570
  1092
    ;;
slouken@1570
  1093
  sysv5* | sco5v6* | sysv4.2uw2*)
slouken@1570
  1094
    kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
slouken@1570
  1095
    if test -n "$kargmax"; then
slouken@1570
  1096
      lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ 	]]//'`
slouken@1570
  1097
    else
slouken@1570
  1098
      lt_cv_sys_max_cmd_len=32768
slouken@1570
  1099
    fi
slouken@1570
  1100
    ;;
slouken@1570
  1101
  *)
slouken@729
  1102
    # If test is not a shell built-in, we'll probably end up computing a
slouken@729
  1103
    # maximum length that is only half of the actual maximum length, but
slouken@729
  1104
    # we can't tell.
slouken@947
  1105
    SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
slouken@947
  1106
    while (test "X"`$SHELL [$]0 --fallback-echo "X$teststring" 2>/dev/null` \
slouken@947
  1107
	       = "XX$teststring") >/dev/null 2>&1 &&
slouken@947
  1108
	    new_result=`expr "X$teststring" : ".*" 2>&1` &&
slouken@729
  1109
	    lt_cv_sys_max_cmd_len=$new_result &&
slouken@729
  1110
	    test $i != 17 # 1/2 MB should be enough
slouken@729
  1111
    do
slouken@729
  1112
      i=`expr $i + 1`
slouken@947
  1113
      teststring=$teststring$teststring
slouken@729
  1114
    done
slouken@947
  1115
    teststring=
slouken@729
  1116
    # Add a significant safety factor because C++ compilers can tack on massive
slouken@729
  1117
    # amounts of additional arguments before passing them to the linker.
slouken@729
  1118
    # It appears as though 1/2 is a usable value.
slouken@729
  1119
    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
slouken@729
  1120
    ;;
slouken@729
  1121
  esac
slouken@729
  1122
])
slouken@729
  1123
if test -n $lt_cv_sys_max_cmd_len ; then
slouken@729
  1124
  AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
slouken@729
  1125
else
slouken@729
  1126
  AC_MSG_RESULT(none)
slouken@729
  1127
fi
slouken@729
  1128
])# AC_LIBTOOL_SYS_MAX_CMD_LEN
slouken@729
  1129
slouken@729
  1130
slouken@729
  1131
# _LT_AC_CHECK_DLFCN
slouken@1570
  1132
# ------------------
slouken@729
  1133
AC_DEFUN([_LT_AC_CHECK_DLFCN],
slouken@729
  1134
[AC_CHECK_HEADERS(dlfcn.h)dnl
slouken@729
  1135
])# _LT_AC_CHECK_DLFCN
slouken@729
  1136
slouken@729
  1137
slouken@729
  1138
# _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
slouken@729
  1139
#                           ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
slouken@1570
  1140
# ---------------------------------------------------------------------
slouken@729
  1141
AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF],
slouken@729
  1142
[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl
slouken@729
  1143
if test "$cross_compiling" = yes; then :
slouken@729
  1144
  [$4]
slouken@729
  1145
else
slouken@729
  1146
  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
slouken@729
  1147
  lt_status=$lt_dlunknown
slouken@729
  1148
  cat > conftest.$ac_ext <<EOF
slouken@729
  1149
[#line __oline__ "configure"
slouken@729
  1150
#include "confdefs.h"
slouken@729
  1151
slouken@729
  1152
#if HAVE_DLFCN_H
slouken@729
  1153
#include <dlfcn.h>
slouken@729
  1154
#endif
slouken@729
  1155
slouken@729
  1156
#include <stdio.h>
slouken@729
  1157
slouken@729
  1158
#ifdef RTLD_GLOBAL
slouken@729
  1159
#  define LT_DLGLOBAL		RTLD_GLOBAL
slouken@729
  1160
#else
slouken@729
  1161
#  ifdef DL_GLOBAL
slouken@729
  1162
#    define LT_DLGLOBAL		DL_GLOBAL
slouken@729
  1163
#  else
slouken@729
  1164
#    define LT_DLGLOBAL		0
slouken@729
  1165
#  endif
slouken@729
  1166
#endif
slouken@729
  1167
slouken@729
  1168
/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
slouken@729
  1169
   find out it does not work in some platform. */
slouken@729
  1170
#ifndef LT_DLLAZY_OR_NOW
slouken@729
  1171
#  ifdef RTLD_LAZY
slouken@729
  1172
#    define LT_DLLAZY_OR_NOW		RTLD_LAZY
slouken@729
  1173
#  else
slouken@729
  1174
#    ifdef DL_LAZY
slouken@729
  1175
#      define LT_DLLAZY_OR_NOW		DL_LAZY
slouken@729
  1176
#    else
slouken@729
  1177
#      ifdef RTLD_NOW
slouken@729
  1178
#        define LT_DLLAZY_OR_NOW	RTLD_NOW
slouken@729
  1179
#      else
slouken@729
  1180
#        ifdef DL_NOW
slouken@729
  1181
#          define LT_DLLAZY_OR_NOW	DL_NOW
slouken@729
  1182
#        else
slouken@729
  1183
#          define LT_DLLAZY_OR_NOW	0
slouken@729
  1184
#        endif
slouken@729
  1185
#      endif
slouken@729
  1186
#    endif
slouken@729
  1187
#  endif
slouken@729
  1188
#endif
slouken@729
  1189
slouken@729
  1190
#ifdef __cplusplus
slouken@729
  1191
extern "C" void exit (int);
slouken@729
  1192
#endif
slouken@729
  1193
slouken@729
  1194
void fnord() { int i=42;}
slouken@729
  1195
int main ()
slouken@729
  1196
{
slouken@729
  1197
  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
slouken@729
  1198
  int status = $lt_dlunknown;
slouken@729
  1199
slouken@729
  1200
  if (self)
slouken@729
  1201
    {
slouken@729
  1202
      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
slouken@729
  1203
      else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
slouken@729
  1204
      /* dlclose (self); */
slouken@729
  1205
    }
slouken@1570
  1206
  else
slouken@1570
  1207
    puts (dlerror ());
slouken@729
  1208
slouken@729
  1209
    exit (status);
slouken@729
  1210
}]
slouken@729
  1211
EOF
slouken@729
  1212
  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
slouken@1570
  1213
    (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
slouken@729
  1214
    lt_status=$?
slouken@729
  1215
    case x$lt_status in
slouken@729
  1216
      x$lt_dlno_uscore) $1 ;;
slouken@729
  1217
      x$lt_dlneed_uscore) $2 ;;
slouken@1570
  1218
      x$lt_dlunknown|x*) $3 ;;
slouken@729
  1219
    esac
slouken@729
  1220
  else :
slouken@729
  1221
    # compilation failed
slouken@729
  1222
    $3
slouken@729
  1223
  fi
slouken@729
  1224
fi
slouken@729
  1225
rm -fr conftest*
slouken@729
  1226
])# _LT_AC_TRY_DLOPEN_SELF
slouken@729
  1227
slouken@729
  1228
slouken@729
  1229
# AC_LIBTOOL_DLOPEN_SELF
slouken@1570
  1230
# ----------------------
slouken@729
  1231
AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF],
slouken@729
  1232
[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl
slouken@729
  1233
if test "x$enable_dlopen" != xyes; then
slouken@729
  1234
  enable_dlopen=unknown
slouken@729
  1235
  enable_dlopen_self=unknown
slouken@729
  1236
  enable_dlopen_self_static=unknown
slouken@729
  1237
else
slouken@729
  1238
  lt_cv_dlopen=no
slouken@729
  1239
  lt_cv_dlopen_libs=
slouken@729
  1240
slouken@729
  1241
  case $host_os in
slouken@729
  1242
  beos*)
slouken@729
  1243
    lt_cv_dlopen="load_add_on"
slouken@729
  1244
    lt_cv_dlopen_libs=
slouken@729
  1245
    lt_cv_dlopen_self=yes
slouken@729
  1246
    ;;
slouken@729
  1247
slouken@729
  1248
  mingw* | pw32*)
slouken@729
  1249
    lt_cv_dlopen="LoadLibrary"
slouken@729
  1250
    lt_cv_dlopen_libs=
slouken@729
  1251
   ;;
slouken@729
  1252
slouken@729
  1253
  cygwin*)
slouken@729
  1254
    lt_cv_dlopen="dlopen"
slouken@729
  1255
    lt_cv_dlopen_libs=
slouken@729
  1256
   ;;
slouken@729
  1257
slouken@729
  1258
  darwin*)
slouken@729
  1259
  # if libdl is installed we need to link against it
slouken@729
  1260
    AC_CHECK_LIB([dl], [dlopen],
slouken@729
  1261
		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[
slouken@729
  1262
    lt_cv_dlopen="dyld"
slouken@729
  1263
    lt_cv_dlopen_libs=
slouken@729
  1264
    lt_cv_dlopen_self=yes
slouken@729
  1265
    ])
slouken@729
  1266
   ;;
slouken@947
  1267
slouken@729
  1268
  *)
slouken@729
  1269
    AC_CHECK_FUNC([shl_load],
slouken@729
  1270
	  [lt_cv_dlopen="shl_load"],
slouken@729
  1271
      [AC_CHECK_LIB([dld], [shl_load],
slouken@729
  1272
	    [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"],
slouken@729
  1273
	[AC_CHECK_FUNC([dlopen],
slouken@729
  1274
	      [lt_cv_dlopen="dlopen"],
slouken@729
  1275
	  [AC_CHECK_LIB([dl], [dlopen],
slouken@729
  1276
		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
slouken@729
  1277
	    [AC_CHECK_LIB([svld], [dlopen],
slouken@729
  1278
		  [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
slouken@729
  1279
	      [AC_CHECK_LIB([dld], [dld_link],
slouken@729
  1280
		    [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"])
slouken@729
  1281
	      ])
slouken@729
  1282
	    ])
slouken@729
  1283
	  ])
slouken@729
  1284
	])
slouken@729
  1285
      ])
slouken@729
  1286
    ;;
slouken@729
  1287
  esac
slouken@729
  1288
slouken@729
  1289
  if test "x$lt_cv_dlopen" != xno; then
slouken@729
  1290
    enable_dlopen=yes
slouken@729
  1291
  else
slouken@729
  1292
    enable_dlopen=no
slouken@729
  1293
  fi
slouken@729
  1294
slouken@729
  1295
  case $lt_cv_dlopen in
slouken@729
  1296
  dlopen)
slouken@729
  1297
    save_CPPFLAGS="$CPPFLAGS"
slouken@729
  1298
    test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
slouken@729
  1299
slouken@729
  1300
    save_LDFLAGS="$LDFLAGS"
slouken@1570
  1301
    wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
slouken@729
  1302
slouken@729
  1303
    save_LIBS="$LIBS"
slouken@729
  1304
    LIBS="$lt_cv_dlopen_libs $LIBS"
slouken@729
  1305
slouken@729
  1306
    AC_CACHE_CHECK([whether a program can dlopen itself],
slouken@729
  1307
	  lt_cv_dlopen_self, [dnl
slouken@729
  1308
	  _LT_AC_TRY_DLOPEN_SELF(
slouken@729
  1309
	    lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
slouken@729
  1310
	    lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
slouken@729
  1311
    ])
slouken@729
  1312
slouken@729
  1313
    if test "x$lt_cv_dlopen_self" = xyes; then
slouken@1570
  1314
      wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
slouken@729
  1315
      AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
slouken@729
  1316
    	  lt_cv_dlopen_self_static, [dnl
slouken@729
  1317
	  _LT_AC_TRY_DLOPEN_SELF(
slouken@729
  1318
	    lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
slouken@729
  1319
	    lt_cv_dlopen_self_static=no,  lt_cv_dlopen_self_static=cross)
slouken@729
  1320
      ])
slouken@729
  1321
    fi
slouken@729
  1322
slouken@729
  1323
    CPPFLAGS="$save_CPPFLAGS"
slouken@729
  1324
    LDFLAGS="$save_LDFLAGS"
slouken@729
  1325
    LIBS="$save_LIBS"
slouken@729
  1326
    ;;
slouken@729
  1327
  esac
slouken@729
  1328
slouken@729
  1329
  case $lt_cv_dlopen_self in
slouken@729
  1330
  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
slouken@729
  1331
  *) enable_dlopen_self=unknown ;;
slouken@729
  1332
  esac
slouken@729
  1333
slouken@729
  1334
  case $lt_cv_dlopen_self_static in
slouken@729
  1335
  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
slouken@729
  1336
  *) enable_dlopen_self_static=unknown ;;
slouken@729
  1337
  esac
slouken@729
  1338
fi
slouken@729
  1339
])# AC_LIBTOOL_DLOPEN_SELF
slouken@729
  1340
slouken@729
  1341
slouken@729
  1342
# AC_LIBTOOL_PROG_CC_C_O([TAGNAME])
slouken@729
  1343
# ---------------------------------
slouken@729
  1344
# Check to see if options -c and -o are simultaneously supported by compiler
slouken@729
  1345
AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O],
slouken@729
  1346
[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
slouken@729
  1347
AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
slouken@729
  1348
  [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
slouken@729
  1349
  [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
slouken@729
  1350
   $rm -r conftest 2>/dev/null
slouken@729
  1351
   mkdir conftest
slouken@729
  1352
   cd conftest
slouken@729
  1353
   mkdir out
slouken@729
  1354
   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
slouken@729
  1355
slouken@729
  1356
   lt_compiler_flag="-o out/conftest2.$ac_objext"
slouken@729
  1357
   # Insert the option either (1) after the last *FLAGS variable, or
slouken@729
  1358
   # (2) before a word containing "conftest.", or (3) at the end.
slouken@729
  1359
   # Note that $ac_compile itself does not contain backslashes and begins
slouken@729
  1360
   # with a dollar sign (not a hyphen), so the echo should work correctly.
slouken@729
  1361
   lt_compile=`echo "$ac_compile" | $SED \
slouken@1570
  1362
   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
slouken@729
  1363
   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
slouken@729
  1364
   -e 's:$: $lt_compiler_flag:'`
slouken@729
  1365
   (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
slouken@729
  1366
   (eval "$lt_compile" 2>out/conftest.err)
slouken@729
  1367
   ac_status=$?
slouken@729
  1368
   cat out/conftest.err >&AS_MESSAGE_LOG_FD
slouken@729
  1369
   echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
slouken@729
  1370
   if (exit $ac_status) && test -s out/conftest2.$ac_objext
slouken@729
  1371
   then
slouken@729
  1372
     # The compiler can only warn and ignore the option if not recognized
slouken@729
  1373
     # So say no if there are warnings
slouken@1570
  1374
     $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
slouken@1570
  1375
     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
slouken@1570
  1376
     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
slouken@729
  1377
       _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
slouken@729
  1378
     fi
slouken@729
  1379
   fi
slouken@1570
  1380
   chmod u+w . 2>&AS_MESSAGE_LOG_FD
slouken@947
  1381
   $rm conftest*
slouken@947
  1382
   # SGI C++ compiler will create directory out/ii_files/ for
slouken@947
  1383
   # template instantiation
slouken@947
  1384
   test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files
slouken@947
  1385
   $rm out/* && rmdir out
slouken@729
  1386
   cd ..
slouken@729
  1387
   rmdir conftest
slouken@729
  1388
   $rm conftest*
slouken@729
  1389
])
slouken@729
  1390
])# AC_LIBTOOL_PROG_CC_C_O
slouken@729
  1391
slouken@729
  1392
slouken@729
  1393
# AC_LIBTOOL_SYS_HARD_LINK_LOCKS([TAGNAME])
slouken@729
  1394
# -----------------------------------------
slouken@729
  1395
# Check to see if we can do hard links to lock some files if needed
slouken@729
  1396
AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS],
slouken@729
  1397
[AC_REQUIRE([_LT_AC_LOCK])dnl
slouken@729
  1398
slouken@729
  1399
hard_links="nottested"
slouken@729
  1400
if test "$_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then
slouken@729
  1401
  # do not overwrite the value of need_locks provided by the user
slouken@729
  1402
  AC_MSG_CHECKING([if we can lock with hard links])
slouken@729
  1403
  hard_links=yes
slouken@729
  1404
  $rm conftest*
slouken@729
  1405
  ln conftest.a conftest.b 2>/dev/null && hard_links=no
slouken@729
  1406
  touch conftest.a
slouken@729
  1407
  ln conftest.a conftest.b 2>&5 || hard_links=no
slouken@729
  1408
  ln conftest.a conftest.b 2>/dev/null && hard_links=no
slouken@729
  1409
  AC_MSG_RESULT([$hard_links])
slouken@729
  1410
  if test "$hard_links" = no; then
slouken@729
  1411
    AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe])
slouken@729
  1412
    need_locks=warn
slouken@729
  1413
  fi
slouken@729
  1414
else
slouken@729
  1415
  need_locks=no
slouken@729
  1416
fi
slouken@729
  1417
])# AC_LIBTOOL_SYS_HARD_LINK_LOCKS
slouken@729
  1418
slouken@729
  1419
slouken@729
  1420
# AC_LIBTOOL_OBJDIR
slouken@729
  1421
# -----------------
slouken@729
  1422
AC_DEFUN([AC_LIBTOOL_OBJDIR],
slouken@729
  1423
[AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
slouken@729
  1424
[rm -f .libs 2>/dev/null
slouken@729
  1425
mkdir .libs 2>/dev/null
slouken@729
  1426
if test -d .libs; then
slouken@729
  1427
  lt_cv_objdir=.libs
slouken@729
  1428
else
slouken@729
  1429
  # MS-DOS does not allow filenames that begin with a dot.
slouken@729
  1430
  lt_cv_objdir=_libs
slouken@729
  1431
fi
slouken@729
  1432
rmdir .libs 2>/dev/null])
slouken@729
  1433
objdir=$lt_cv_objdir
slouken@729
  1434
])# AC_LIBTOOL_OBJDIR
slouken@729
  1435
slouken@729
  1436
slouken@729
  1437
# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH([TAGNAME])
slouken@729
  1438
# ----------------------------------------------
slouken@729
  1439
# Check hardcoding attributes.
slouken@729
  1440
AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH],
slouken@729
  1441
[AC_MSG_CHECKING([how to hardcode library paths into programs])
slouken@729
  1442
_LT_AC_TAGVAR(hardcode_action, $1)=
slouken@729
  1443
if test -n "$_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)" || \
slouken@947
  1444
   test -n "$_LT_AC_TAGVAR(runpath_var, $1)" || \
slouken@947
  1445
   test "X$_LT_AC_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then
slouken@729
  1446
slouken@729
  1447
  # We can hardcode non-existant directories.
slouken@729
  1448
  if test "$_LT_AC_TAGVAR(hardcode_direct, $1)" != no &&
slouken@729
  1449
     # If the only mechanism to avoid hardcoding is shlibpath_var, we
slouken@729
  1450
     # have to relink, otherwise we might link with an installed library
slouken@729
  1451
     # when we should be linking with a yet-to-be-installed one
slouken@729
  1452
     ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
slouken@729
  1453
     test "$_LT_AC_TAGVAR(hardcode_minus_L, $1)" != no; then
slouken@729
  1454
    # Linking always hardcodes the temporary library directory.
slouken@729
  1455
    _LT_AC_TAGVAR(hardcode_action, $1)=relink
slouken@729
  1456
  else
slouken@729
  1457
    # We can link without hardcoding, and we can hardcode nonexisting dirs.
slouken@729
  1458
    _LT_AC_TAGVAR(hardcode_action, $1)=immediate
slouken@729
  1459
  fi
slouken@729
  1460
else
slouken@729
  1461
  # We cannot hardcode anything, or else we can only hardcode existing
slouken@729
  1462
  # directories.
slouken@729
  1463
  _LT_AC_TAGVAR(hardcode_action, $1)=unsupported
slouken@729
  1464
fi
slouken@729
  1465
AC_MSG_RESULT([$_LT_AC_TAGVAR(hardcode_action, $1)])
slouken@729
  1466
slouken@729
  1467
if test "$_LT_AC_TAGVAR(hardcode_action, $1)" = relink; then
slouken@729
  1468
  # Fast installation is not supported
slouken@729
  1469
  enable_fast_install=no
slouken@729
  1470
elif test "$shlibpath_overrides_runpath" = yes ||
slouken@729
  1471
     test "$enable_shared" = no; then
slouken@729
  1472
  # Fast installation is not necessary
slouken@729
  1473
  enable_fast_install=needless
slouken@729
  1474
fi
slouken@729
  1475
])# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH
slouken@729
  1476
slouken@729
  1477
slouken@729
  1478
# AC_LIBTOOL_SYS_LIB_STRIP
slouken@729
  1479
# ------------------------
slouken@729
  1480
AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP],
slouken@729
  1481
[striplib=
slouken@729
  1482
old_striplib=
slouken@729
  1483
AC_MSG_CHECKING([whether stripping libraries is possible])
slouken@729
  1484
if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then
slouken@729
  1485
  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
slouken@729
  1486
  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
slouken@729
  1487
  AC_MSG_RESULT([yes])
slouken@729
  1488
else
slouken@729
  1489
# FIXME - insert some real tests, host_os isn't really good enough
slouken@729
  1490
  case $host_os in
slouken@729
  1491
   darwin*)
slouken@729
  1492
       if test -n "$STRIP" ; then
slouken@729
  1493
         striplib="$STRIP -x"
slouken@729
  1494
         AC_MSG_RESULT([yes])
slouken@729
  1495
       else
slouken@729
  1496
  AC_MSG_RESULT([no])
slouken@729
  1497
fi
slouken@729
  1498
       ;;
slouken@729
  1499
   *)
slouken@729
  1500
  AC_MSG_RESULT([no])
slouken@729
  1501
    ;;
slouken@947
  1502
  esac
slouken@729
  1503
fi
slouken@729
  1504
])# AC_LIBTOOL_SYS_LIB_STRIP
slouken@729
  1505
slouken@729
  1506
slouken@729
  1507
# AC_LIBTOOL_SYS_DYNAMIC_LINKER
slouken@729
  1508
# -----------------------------
slouken@729
  1509
# PORTME Fill in your ld.so characteristics
slouken@729
  1510
AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER],
slouken@729
  1511
[AC_MSG_CHECKING([dynamic linker characteristics])
slouken@729
  1512
library_names_spec=
slouken@729
  1513
libname_spec='lib$name'
slouken@729
  1514
soname_spec=
slouken@947
  1515
shrext_cmds=".so"
slouken@729
  1516
postinstall_cmds=
slouken@729
  1517
postuninstall_cmds=
slouken@729
  1518
finish_cmds=
slouken@729
  1519
finish_eval=
slouken@729
  1520
shlibpath_var=
slouken@729
  1521
shlibpath_overrides_runpath=unknown
slouken@729
  1522
version_type=none
slouken@729
  1523
dynamic_linker="$host_os ld.so"
slouken@729
  1524
sys_lib_dlsearch_path_spec="/lib /usr/lib"
slouken@729
  1525
if test "$GCC" = yes; then
slouken@729
  1526
  sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
slouken@729
  1527
  if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then
slouken@729
  1528
    # if the path contains ";" then we assume it to be the separator
slouken@729
  1529
    # otherwise default to the standard path separator (i.e. ":") - it is
slouken@729
  1530
    # assumed that no part of a normal pathname contains ";" but that should
slouken@729
  1531
    # okay in the real world where ";" in dirpaths is itself problematic.
slouken@729
  1532
    sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
slouken@729
  1533
  else
slouken@729
  1534
    sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
slouken@729
  1535
  fi
slouken@729
  1536
else
slouken@729
  1537
  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
slouken@729
  1538
fi
slouken@729
  1539
need_lib_prefix=unknown
slouken@729
  1540
hardcode_into_libs=no
slouken@729
  1541
slouken@729
  1542
# when you set need_version to no, make sure it does not cause -set_version
slouken@729
  1543
# flags to be left without arguments
slouken@729
  1544
need_version=unknown
slouken@729
  1545
slouken@729
  1546
case $host_os in
slouken@729
  1547
aix3*)
slouken@729
  1548
  version_type=linux
slouken@729
  1549
  library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
slouken@729
  1550
  shlibpath_var=LIBPATH
slouken@729
  1551
slouken@729
  1552
  # AIX 3 has no versioning support, so we append a major version to the name.
slouken@729
  1553
  soname_spec='${libname}${release}${shared_ext}$major'
slouken@729
  1554
  ;;
slouken@729
  1555
slouken@729
  1556
aix4* | aix5*)
slouken@729
  1557
  version_type=linux
slouken@729
  1558
  need_lib_prefix=no
slouken@729
  1559
  need_version=no
slouken@729
  1560
  hardcode_into_libs=yes
slouken@729
  1561
  if test "$host_cpu" = ia64; then
slouken@729
  1562
    # AIX 5 supports IA64
slouken@729
  1563
    library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
slouken@729
  1564
    shlibpath_var=LD_LIBRARY_PATH
slouken@729
  1565
  else
slouken@729
  1566
    # With GCC up to 2.95.x, collect2 would create an import file
slouken@729
  1567
    # for dependence libraries.  The import file would start with
slouken@729
  1568
    # the line `#! .'.  This would cause the generated library to
slouken@729
  1569
    # depend on `.', always an invalid library.  This was fixed in
slouken@729
  1570
    # development snapshots of GCC prior to 3.0.
slouken@729
  1571
    case $host_os in
slouken@729
  1572
      aix4 | aix4.[[01]] | aix4.[[01]].*)
slouken@729
  1573
      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
slouken@729
  1574
	   echo ' yes '
slouken@729
  1575
	   echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
slouken@729
  1576
	:
slouken@729
  1577
      else
slouken@729
  1578
	can_build_shared=no
slouken@729
  1579
      fi
slouken@729
  1580
      ;;
slouken@729
  1581
    esac
slouken@729
  1582
    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
slouken@729
  1583
    # soname into executable. Probably we can add versioning support to
slouken@729
  1584
    # collect2, so additional links can be useful in future.
slouken@729
  1585
    if test "$aix_use_runtimelinking" = yes; then
slouken@729
  1586
      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
slouken@729
  1587
      # instead of lib<name>.a to let people know that these are not
slouken@729
  1588
      # typical AIX shared libraries.
slouken@729
  1589
      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
slouken@729
  1590
    else
slouken@729
  1591
      # We preserve .a as extension for shared libraries through AIX4.2
slouken@729
  1592
      # and later when we are not doing run time linking.
slouken@729
  1593
      library_names_spec='${libname}${release}.a $libname.a'
slouken@729
  1594
      soname_spec='${libname}${release}${shared_ext}$major'
slouken@729
  1595
    fi
slouken@729
  1596
    shlibpath_var=LIBPATH
slouken@729
  1597
  fi
slouken@729
  1598
  ;;
slouken@729
  1599
slouken@729
  1600
amigaos*)
slouken@729
  1601
  library_names_spec='$libname.ixlibrary $libname.a'
slouken@729
  1602
  # Create ${libname}_ixlibrary.a entries in /sys/libs.
slouken@947
  1603
  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'
slouken@729
  1604
  ;;
slouken@729
  1605
slouken@729
  1606
beos*)
slouken@729
  1607
  library_names_spec='${libname}${shared_ext}'
slouken@729
  1608
  dynamic_linker="$host_os ld.so"
slouken@729
  1609
  shlibpath_var=LIBRARY_PATH
slouken@729
  1610
  ;;
slouken@729
  1611
slouken@947
  1612
bsdi[[45]]*)
slouken@729
  1613
  version_type=linux
slouken@729
  1614
  need_version=no
slouken@729
  1615
  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
slouken@729
  1616
  soname_spec='${libname}${release}${shared_ext}$major'
slouken@729
  1617
  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
slouken@729
  1618
  shlibpath_var=LD_LIBRARY_PATH
slouken@729
  1619
  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
slouken@729
  1620
  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
slouken@729
  1621
  # the default ld.so.conf also contains /usr/contrib/lib and
slouken@729
  1622
  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
slouken@729
  1623
  # libtool to hard-code these into programs
slouken@729
  1624
  ;;
slouken@729
  1625
slouken@729
  1626
cygwin* | mingw* | pw32*)
slouken@729
  1627
  version_type=windows
slouken@947
  1628
  shrext_cmds=".dll"
slouken@729
  1629
  need_version=no
slouken@729
  1630
  need_lib_prefix=no
slouken@729
  1631
slouken@729
  1632
  case $GCC,$host_os in
slouken@729
  1633
  yes,cygwin* | yes,mingw* | yes,pw32*)
slouken@729
  1634
    library_names_spec='$libname.dll.a'
slouken@729
  1635
    # DLL is installed to $(libdir)/../bin by postinstall_cmds
slouken@729
  1636
    postinstall_cmds='base_file=`basename \${file}`~
slouken@729
  1637
      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~
slouken@729
  1638
      dldir=$destdir/`dirname \$dlpath`~
slouken@729
  1639
      test -d \$dldir || mkdir -p \$dldir~
slouken@1570
  1640
      $install_prog $dir/$dlname \$dldir/$dlname~
slouken@1570
  1641
      chmod a+x \$dldir/$dlname'
slouken@729
  1642
    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
slouken@729
  1643
      dlpath=$dir/\$dldll~
slouken@729
  1644
       $rm \$dlpath'
slouken@729
  1645
    shlibpath_overrides_runpath=yes
slouken@729
  1646
slouken@729
  1647
    case $host_os in
slouken@729
  1648
    cygwin*)
slouken@729
  1649
      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
slouken@729
  1650
      #soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
slouken@729
  1651
      soname_spec='`echo ${libname} | sed -e 's/^lib//'`${shared_ext}'
slouken@729
  1652
      sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
slouken@729
  1653
      ;;
slouken@729
  1654
    mingw*)
slouken@729
  1655
      # MinGW DLLs use traditional 'lib' prefix
slouken@729
  1656
      #soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
slouken@729
  1657
      soname_spec='`echo ${libname} | sed -e 's/^lib//'`${shared_ext}'
slouken@729
  1658
      sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
slouken@729
  1659
      if echo "$sys_lib_search_path_spec" | [grep ';[c-zC-Z]:/' >/dev/null]; then
slouken@729
  1660
        # It is most probably a Windows format PATH printed by
slouken@729
  1661
        # mingw gcc, but we are running on Cygwin. Gcc prints its search
slouken@729
  1662
        # path with ; separators, and with drive letters. We can handle the
slouken@729
  1663
        # drive letters (cygwin fileutils understands them), so leave them,
slouken@729
  1664
        # especially as we might pass files found there to a mingw objdump,
slouken@729
  1665
        # which wouldn't understand a cygwinified path. Ahh.
slouken@729
  1666
        sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
slouken@729
  1667
      else
slouken@729
  1668
        sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
slouken@729
  1669
      fi
slouken@729
  1670
      ;;
slouken@729
  1671
    pw32*)
slouken@729
  1672
      # pw32 DLLs use 'pw' prefix rather than 'lib'
slouken@1570
  1673
      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
slouken@729
  1674
      ;;
slouken@729
  1675
    esac
slouken@729
  1676
    ;;
slouken@729
  1677
slouken@729
  1678
  *)
slouken@729
  1679
    library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
slouken@729
  1680
    ;;
slouken@729
  1681
  esac
slouken@729
  1682
  dynamic_linker='Win32 ld.exe'
slouken@729
  1683
  # FIXME: first we should search . and the directory the executable is in
slouken@729
  1684
  shlibpath_var=PATH
slouken@729
  1685
  ;;
slouken@729
  1686
slouken@729
  1687
darwin* | rhapsody*)
slouken@729
  1688
  dynamic_linker="$host_os dyld"
slouken@729
  1689
  version_type=darwin
slouken@729
  1690
  need_lib_prefix=no
slouken@729
  1691
  need_version=no
slouken@729
  1692
  library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext'
slouken@729
  1693
  soname_spec='${libname}${release}${major}$shared_ext'
slouken@729
  1694
  shlibpath_overrides_runpath=yes
slouken@729
  1695
  shlibpath_var=DYLD_LIBRARY_PATH
slouken@1570
  1696
  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
slouken@729
  1697
  # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
slouken@947
  1698
  if test "$GCC" = yes; then
slouken@947
  1699
    sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
slouken@947
  1700
  else
slouken@947
  1701
    sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib'
slouken@729
  1702
  fi
slouken@729
  1703
  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
slouken@729
  1704
  ;;
slouken@729
  1705
slouken@729
  1706
dgux*)
slouken@729
  1707
  version_type=linux
slouken@729
  1708
  need_lib_prefix=no
slouken@729
  1709
  need_version=no
slouken@729
  1710
  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
slouken@729
  1711
  soname_spec='${libname}${release}${shared_ext}$major'
slouken@729
  1712
  shlibpath_var=LD_LIBRARY_PATH
slouken@729
  1713
  ;;
slouken@729
  1714
slouken@729
  1715
freebsd1*)
slouken@729
  1716
  dynamic_linker=no
slouken@729
  1717
  ;;
slouken@729
  1718
slouken@947
  1719
kfreebsd*-gnu)
slouken@947
  1720
  version_type=linux
slouken@947
  1721
  need_lib_prefix=no
slouken@947
  1722
  need_version=no
slouken@947
  1723
  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
slouken@947
  1724
  soname_spec='${libname}${release}${shared_ext}$major'
slouken@947
  1725
  shlibpath_var=LD_LIBRARY_PATH
slouken@947
  1726
  shlibpath_overrides_runpath=no
slouken@947
  1727
  hardcode_into_libs=yes
slouken@947
  1728
  dynamic_linker='GNU ld.so'
slouken@947
  1729
  ;;
slouken@947
  1730
slouken@1570
  1731
freebsd* | dragonfly*)
slouken@1570
  1732
  # DragonFly does not have aout.  When/if they implement a new
slouken@1570
  1733
  # versioning mechanism, adjust this.
slouken@1570
  1734
  if test -x /usr/bin/objformat; then
slouken@1570
  1735
    objformat=`/usr/bin/objformat`
slouken@1570
  1736
  else
slouken@1570
  1737
    case $host_os in
slouken@1570
  1738
    freebsd[[123]]*) objformat=aout ;;
slouken@1570
  1739
    *) objformat=elf ;;
slouken@1570
  1740
    esac
slouken@1570
  1741
  fi
slouken@729
  1742
  version_type=freebsd-$objformat
slouken@729
  1743
  case $version_type in
slouken@729
  1744
    freebsd-elf*)
slouken@729
  1745
      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
slouken@729
  1746
      need_version=no
slouken@729
  1747
      need_lib_prefix=no
slouken@729
  1748
      ;;
slouken@729
  1749
    freebsd-*)
slouken@729
  1750
      library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
slouken@729
  1751
      need_version=yes
slouken@729
  1752
      ;;
slouken@729
  1753
  esac
slouken@729
  1754
  shlibpath_var=LD_LIBRARY_PATH
slouken@729
  1755
  case $host_os in
slouken@729
  1756
  freebsd2*)
slouken@729
  1757
    shlibpath_overrides_runpath=yes
slouken@729
  1758
    ;;
slouken@1570
  1759
  freebsd3.[[01]]* | freebsdelf3.[[01]]*)
slouken@729
  1760
    shlibpath_overrides_runpath=yes
slouken@729
  1761
    hardcode_into_libs=yes
slouken@729
  1762
    ;;
slouken@1570
  1763
  freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \
slouken@1570
  1764
  freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1)
slouken@729
  1765
    shlibpath_overrides_runpath=no
slouken@729
  1766
    hardcode_into_libs=yes
slouken@729
  1767
    ;;
slouken@1570
  1768
  freebsd*) # from 4.6 on
slouken@1570
  1769
    shlibpath_overrides_runpath=yes
slouken@1570
  1770
    hardcode_into_libs=yes
slouken@1570
  1771
    ;;
slouken@729
  1772
  esac
slouken@729
  1773
  ;;
slouken@729
  1774
slouken@729
  1775
gnu*)
slouken@729
  1776
  version_type=linux
slouken@729
  1777
  need_lib_prefix=no
slouken@729
  1778
  need_version=no
slouken@729
  1779
  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
slouken@729
  1780
  soname_spec='${libname}${release}${shared_ext}$major'
slouken@729
  1781
  shlibpath_var=LD_LIBRARY_PATH
slouken@729
  1782
  hardcode_into_libs=yes
slouken@729
  1783
  ;;
slouken@729
  1784
slouken@729
  1785
hpux9* | hpux10* | hpux11*)
slouken@729
  1786
  # Give a soname corresponding to the major version so that dld.sl refuses to
slouken@729
  1787
  # link against other versions.
slouken@729
  1788
  version_type=sunos
slouken@729
  1789
  need_lib_prefix=no
slouken@729
  1790
  need_version=no
slouken@1570
  1791
  case $host_cpu in
slouken@729
  1792
  ia64*)
slouken@947
  1793
    shrext_cmds='.so'
slouken@729
  1794
    hardcode_into_libs=yes
slouken@729
  1795
    dynamic_linker="$host_os dld.so"
slouken@729
  1796
    shlibpath_var=LD_LIBRARY_PATH
slouken@729
  1797
    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
slouken@729
  1798
    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
slouken@729
  1799
    soname_spec='${libname}${release}${shared_ext}$major'
slouken@729
  1800
    if test "X$HPUX_IA64_MODE" = X32; then
slouken@729
  1801
      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
slouken@729
  1802
    else
slouken@729
  1803
      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
slouken@729
  1804
    fi
slouken@729
  1805
    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
slouken@729
  1806
    ;;
slouken@729
  1807
   hppa*64*)
slouken@947
  1808
     shrext_cmds='.sl'
slouken@729
  1809
     hardcode_into_libs=yes
slouken@729
  1810
     dynamic_linker="$host_os dld.sl"
slouken@729
  1811
     shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
slouken@729
  1812
     shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
slouken@729
  1813
     library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
slouken@729
  1814
     soname_spec='${libname}${release}${shared_ext}$major'
slouken@729
  1815
     sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
slouken@729
  1816
     sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
slouken@729
  1817
     ;;
slouken@729
  1818
   *)
slouken@947
  1819
    shrext_cmds='.sl'
slouken@729
  1820
    dynamic_linker="$host_os dld.sl"
slouken@729
  1821
    shlibpath_var=SHLIB_PATH
slouken@729
  1822
    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
slouken@729
  1823
    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
slouken@729
  1824
    soname_spec='${libname}${release}${shared_ext}$major'
slouken@729
  1825
    ;;
slouken@729
  1826
  esac
slouken@729
  1827
  # HP-UX runs *really* slowly unless shared libraries are mode 555.
slouken@729
  1828
  postinstall_cmds='chmod 555 $lib'
slouken@729
  1829
  ;;
slouken@729
  1830
slouken@1570
  1831
interix3*)
slouken@1570
  1832
  version_type=linux
slouken@1570
  1833
  need_lib_prefix=no
slouken@1570
  1834
  need_version=no
slouken@1570
  1835
  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
slouken@1570
  1836
  soname_spec='${libname}${release}${shared_ext}$major'
slouken@1570
  1837
  dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
slouken@1570
  1838
  shlibpath_var=LD_LIBRARY_PATH
slouken@1570
  1839
  shlibpath_overrides_runpath=no
slouken@1570
  1840
  hardcode_into_libs=yes
slouken@1570
  1841
  ;;
slouken@1570
  1842
slouken@729
  1843
irix5* | irix6* | nonstopux*)
slouken@729
  1844
  case $host_os in
slouken@729
  1845
    nonstopux*) version_type=nonstopux ;;
slouken@729
  1846
    *)
slouken@729
  1847
	if test "$lt_cv_prog_gnu_ld" = yes; then
slouken@729
  1848
		version_type=linux
slouken@729
  1849
	else
slouken@729
  1850
		version_type=irix
slouken@729
  1851
	fi ;;
slouken@729
  1852
  esac
slouken@729
  1853
  need_lib_prefix=no
slouken@729
  1854
  need_version=no
slouken@729
  1855
  soname_spec='${libname}${release}${shared_ext}$major'
slouken@729
  1856
  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
slouken@729
  1857
  case $host_os in
slouken@729
  1858
  irix5* | nonstopux*)
slouken@729
  1859
    libsuff= shlibsuff=
slouken@729
  1860
    ;;
slouken@729
  1861
  *)
slouken@729
  1862
    case $LD in # libtool.m4 will add one of these switches to LD
slouken@729
  1863
    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
slouken@729
  1864
      libsuff= shlibsuff= libmagic=32-bit;;
slouken@729
  1865
    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
slouken@729
  1866
      libsuff=32 shlibsuff=N32 libmagic=N32;;
slouken@729
  1867
    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
slouken@729
  1868
      libsuff=64 shlibsuff=64 libmagic=64-bit;;
slouken@729
  1869
    *) libsuff= shlibsuff= libmagic=never-match;;
slouken@729
  1870
    esac
slouken@729
  1871
    ;;
slouken@729
  1872
  esac
slouken@729
  1873
  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
slouken@729
  1874
  shlibpath_overrides_runpath=no
slouken@729
  1875
  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
slouken@729
  1876
  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
slouken@729
  1877
  hardcode_into_libs=yes
slouken@729
  1878
  ;;
slouken@729
  1879
slouken@729
  1880
# No shared lib support for Linux oldld, aout, or coff.
slouken@729
  1881
linux*oldld* | linux*aout* | linux*coff*)
slouken@729
  1882
  dynamic_linker=no
slouken@729
  1883
  ;;
slouken@729
  1884
slouken@729
  1885
# This must be Linux ELF.
slouken@729
  1886
linux*)
slouken@729
  1887
  version_type=linux
slouken@729
  1888
  need_lib_prefix=no
slouken@729
  1889
  need_version=no
slouken@729
  1890
  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
slouken@729
  1891
  soname_spec='${libname}${release}${shared_ext}$major'
slouken@729
  1892
  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
slouken@729
  1893
  shlibpath_var=LD_LIBRARY_PATH
slouken@729
  1894
  shlibpath_overrides_runpath=no
slouken@729
  1895
  # This implies no fast_install, which is unacceptable.
slouken@729
  1896
  # Some rework will be needed to allow for fast_install
slouken@729
  1897
  # before this can be enabled.
slouken@729
  1898
  hardcode_into_libs=yes
slouken@729
  1899
slouken@947
  1900
  # Append ld.so.conf contents to the search path
slouken@947
  1901
  if test -f /etc/ld.so.conf; then
slouken@1570
  1902
    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
slouken@947
  1903
    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
slouken@947
  1904
  fi
slouken@947
  1905
slouken@729
  1906
  # We used to test for /lib/ld.so.1 and disable shared libraries on
slouken@729
  1907
  # powerpc, because MkLinux only supported shared libraries with the
slouken@729
  1908
  # GNU dynamic linker.  Since this was broken with cross compilers,
slouken@729
  1909
  # most powerpc-linux boxes support dynamic linking these days and
slouken@729
  1910
  # people can always --disable-shared, the test was removed, and we
slouken@729
  1911
  # assume the GNU/Linux dynamic linker is in use.
slouken@729
  1912
  dynamic_linker='GNU/Linux ld.so'
slouken@729
  1913
  ;;
slouken@729
  1914
slouken@947
  1915
knetbsd*-gnu)
slouken@947
  1916
  version_type=linux
slouken@947
  1917
  need_lib_prefix=no
slouken@947
  1918
  need_version=no
slouken@947
  1919
  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
slouken@947
  1920
  soname_spec='${libname}${release}${shared_ext}$major'
slouken@947
  1921
  shlibpath_var=LD_LIBRARY_PATH
slouken@947
  1922
  shlibpath_overrides_runpath=no
slouken@947
  1923
  hardcode_into_libs=yes
slouken@947
  1924
  dynamic_linker='GNU ld.so'
slouken@947
  1925
  ;;
slouken@947
  1926
slouken@729
  1927
netbsd*)
slouken@729
  1928
  version_type=sunos
slouken@729
  1929
  need_lib_prefix=no
slouken@729
  1930
  need_version=no
slouken@729
  1931
  if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
slouken@729
  1932
    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
slouken@729
  1933
    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
slouken@729
  1934
    dynamic_linker='NetBSD (a.out) ld.so'
slouken@729
  1935
  else
slouken@947
  1936
    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
slouken@729
  1937
    soname_spec='${libname}${release}${shared_ext}$major'
slouken@729
  1938
    dynamic_linker='NetBSD ld.elf_so'
slouken@729
  1939
  fi
slouken@729
  1940
  shlibpath_var=LD_LIBRARY_PATH
slouken@729
  1941
  shlibpath_overrides_runpath=yes
slouken@729
  1942
  hardcode_into_libs=yes
slouken@729
  1943
  ;;
slouken@729
  1944
slouken@729
  1945
newsos6)
slouken@729
  1946
  version_type=linux
slouken@729
  1947
  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
slouken@729
  1948
  shlibpath_var=LD_LIBRARY_PATH
slouken@729
  1949
  shlibpath_overrides_runpath=yes
slouken@729
  1950
  ;;
slouken@729
  1951
slouken@947
  1952
nto-qnx*)
slouken@947
  1953
  version_type=linux
slouken@729
  1954
  need_lib_prefix=no
slouken@729
  1955
  need_version=no
slouken@947
  1956
  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
slouken@947
  1957
  soname_spec='${libname}${release}${shared_ext}$major'
slouken@729
  1958
  shlibpath_var=LD_LIBRARY_PATH
slouken@947
  1959
  shlibpath_overrides_runpath=yes
slouken@729
  1960
  ;;
slouken@729
  1961
slouken@729
  1962
openbsd*)
slouken@729
  1963
  version_type=sunos
slouken@1570
  1964
  sys_lib_dlsearch_path_spec="/usr/lib"
slouken@729
  1965
  need_lib_prefix=no
slouken@1570
  1966
  # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
slouken@1570
  1967
  case $host_os in
slouken@1570
  1968
    openbsd3.3 | openbsd3.3.*) need_version=yes ;;
slouken@1570
  1969
    *)                         need_version=no  ;;
slouken@1570
  1970
  esac
slouken@729
  1971
  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
slouken@729
  1972
  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
slouken@729
  1973
  shlibpath_var=LD_LIBRARY_PATH
slouken@729
  1974
  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
slouken@729
  1975
    case $host_os in
slouken@729
  1976
      openbsd2.[[89]] | openbsd2.[[89]].*)
slouken@729
  1977
	shlibpath_overrides_runpath=no
slouken@729
  1978
	;;
slouken@729
  1979
      *)
slouken@729
  1980
	shlibpath_overrides_runpath=yes
slouken@729
  1981
	;;
slouken@729
  1982
      esac
slouken@729
  1983
  else
slouken@729
  1984
    shlibpath_overrides_runpath=yes
slouken@729
  1985
  fi
slouken@729
  1986
  ;;
slouken@729
  1987
slouken@729
  1988
os2*)
slouken@729
  1989
  libname_spec='$name'
slouken@947
  1990
  shrext_cmds=".dll"
slouken@729
  1991
  need_lib_prefix=no
slouken@729
  1992
  library_names_spec='$libname${shared_ext} $libname.a'
slouken@729
  1993
  dynamic_linker='OS/2 ld.exe'
slouken@729
  1994
  shlibpath_var=LIBPATH
slouken@729
  1995
  ;;
slouken@729
  1996
slouken@729
  1997
osf3* | osf4* | osf5*)
slouken@729
  1998
  version_type=osf
slouken@729
  1999
  need_lib_prefix=no
slouken@729
  2000
  need_version=no
slouken@729
  2001
  soname_spec='${libname}${release}${shared_ext}$major'
slouken@729
  2002
  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
slouken@729
  2003
  shlibpath_var=LD_LIBRARY_PATH
slouken@729
  2004
  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
slouken@729
  2005
  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
slouken@729
  2006
  ;;
slouken@729
  2007
slouken@729
  2008
solaris*)
slouken@729
  2009
  version_type=linux
slouken@729
  2010
  need_lib_prefix=no
slouken@729
  2011
  need_version=no
slouken@729
  2012
  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
slouken@729
  2013
  soname_spec='${libname}${release}${shared_ext}$major'
slouken@729
  2014
  shlibpath_var=LD_LIBRARY_PATH
slouken@729
  2015
  shlibpath_overrides_runpath=yes
slouken@729
  2016
  hardcode_into_libs=yes
slouken@729
  2017
  # ldd complains unless libraries are executable
slouken@729
  2018
  postinstall_cmds='chmod +x $lib'
slouken@729
  2019
  ;;
slouken@729
  2020
slouken@729
  2021
sunos4*)
slouken@729
  2022
  version_type=sunos
slouken@729
  2023
  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
slouken@729
  2024
  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
slouken@729
  2025
  shlibpath_var=LD_LIBRARY_PATH
slouken@729
  2026
  shlibpath_overrides_runpath=yes
slouken@729
  2027
  if test "$with_gnu_ld" = yes; then
slouken@729
  2028
    need_lib_prefix=no
slouken@729
  2029
  fi
slouken@729
  2030
  need_version=yes
slouken@729
  2031
  ;;
slouken@729
  2032
slouken@1570
  2033
sysv4 | sysv4.3*)
slouken@729
  2034
  version_type=linux
slouken@729
  2035
  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
slouken@729
  2036
  soname_spec='${libname}${release}${shared_ext}$major'
slouken@729
  2037
  shlibpath_var=LD_LIBRARY_PATH
slouken@729
  2038
  case $host_vendor in
slouken@729
  2039
    sni)
slouken@729
  2040
      shlibpath_overrides_runpath=no
slouken@729
  2041
      need_lib_prefix=no
slouken@729
  2042
      export_dynamic_flag_spec='${wl}-Blargedynsym'
slouken@729
  2043
      runpath_var=LD_RUN_PATH
slouken@729
  2044
      ;;
slouken@729
  2045
    siemens)
slouken@729
  2046
      need_lib_prefix=no
slouken@729
  2047
      ;;
slouken@729
  2048
    motorola)
slouken@729
  2049
      need_lib_prefix=no
slouken@729
  2050
      need_version=no
slouken@729
  2051
      shlibpath_overrides_runpath=no
slouken@729
  2052
      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
slouken@729
  2053
      ;;
slouken@729
  2054
  esac
slouken@729
  2055
  ;;
slouken@729
  2056
slouken@729
  2057
sysv4*MP*)
slouken@729
  2058
  if test -d /usr/nec ;then
slouken@729
  2059
    version_type=linux
slouken@729
  2060
    library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
slouken@729
  2061
    soname_spec='$libname${shared_ext}.$major'
slouken@729
  2062
    shlibpath_var=LD_LIBRARY_PATH
slouken@729
  2063
  fi
slouken@729
  2064
  ;;
slouken@729
  2065
slouken@1570
  2066
sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
slouken@1570
  2067
  version_type=freebsd-elf
slouken@1570
  2068
  need_lib_prefix=no
slouken@1570
  2069
  need_version=no
slouken@1570
  2070
  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
slouken@1570
  2071
  soname_spec='${libname}${release}${shared_ext}$major'
slouken@1570
  2072
  shlibpath_var=LD_LIBRARY_PATH
slouken@1570
  2073
  hardcode_into_libs=yes
slouken@1570
  2074
  if test "$with_gnu_ld" = yes; then
slouken@1570
  2075
    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
slouken@1570
  2076
    shlibpath_overrides_runpath=no
slouken@1570
  2077
  else
slouken@1570
  2078
    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
slouken@1570
  2079
    shlibpath_overrides_runpath=yes
slouken@1570
  2080
    case $host_os in
slouken@1570
  2081
      sco3.2v5*)
slouken@1570
  2082
        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
slouken@1570
  2083
	;;
slouken@1570
  2084
    esac
slouken@1570
  2085
  fi
slouken@1570
  2086
  sys_lib_dlsearch_path_spec='/usr/lib'
slouken@1570
  2087
  ;;
slouken@1570
  2088
slouken@729
  2089
uts4*)
slouken@729
  2090
  version_type=linux
slouken@729
  2091
  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
slouken@729
  2092
  soname_spec='${libname}${release}${shared_ext}$major'
slouken@729
  2093
  shlibpath_var=LD_LIBRARY_PATH
slouken@729
  2094
  ;;
slouken@729
  2095
slouken@729
  2096
*)
slouken@729
  2097
  dynamic_linker=no
slouken@729
  2098
  ;;
slouken@0
  2099
esac
slouken@729
  2100
AC_MSG_RESULT([$dynamic_linker])
slouken@729
  2101
test "$dynamic_linker" = no && can_build_shared=no
slouken@1570
  2102
slouken@1570
  2103
variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
slouken@1570
  2104
if test "$GCC" = yes; then
slouken@1570
  2105
  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
slouken@1570
  2106
fi
slouken@729
  2107
])# AC_LIBTOOL_SYS_DYNAMIC_LINKER
slouken@729
  2108
slouken@729
  2109
slouken@729
  2110
# _LT_AC_TAGCONFIG
slouken@729
  2111
# ----------------
slouken@729
  2112
AC_DEFUN([_LT_AC_TAGCONFIG],
slouken@729
  2113
[AC_ARG_WITH([tags],
slouken@729
  2114
    [AC_HELP_STRING([--with-tags@<:@=TAGS@:>@],
slouken@729
  2115
        [include additional configurations @<:@automatic@:>@])],
slouken@729
  2116
    [tagnames="$withval"])
slouken@729
  2117
slouken@729
  2118
if test -f "$ltmain" && test -n "$tagnames"; then
slouken@729
  2119
  if test ! -f "${ofile}"; then
slouken@729
  2120
    AC_MSG_WARN([output file `$ofile' does not exist])
slouken@729
  2121
  fi
slouken@729
  2122
slouken@729
  2123
  if test -z "$LTCC"; then
slouken@729
  2124
    eval "`$SHELL ${ofile} --config | grep '^LTCC='`"
slouken@729
  2125
    if test -z "$LTCC"; then
slouken@729
  2126
      AC_MSG_WARN([output file `$ofile' does not look like a libtool script])
slouken@729
  2127
    else
slouken@729
  2128
      AC_MSG_WARN([using `LTCC=$LTCC', extracted from `$ofile'])
slouken@729
  2129
    fi
slouken@729
  2130
  fi
slouken@1570
  2131
  if test -z "$LTCFLAGS"; then
slouken@1570
  2132
    eval "`$SHELL ${ofile} --config | grep '^LTCFLAGS='`"
slouken@1570
  2133
  fi
slouken@729
  2134
slouken@729
  2135
  # Extract list of available tagged configurations in $ofile.
slouken@729
  2136
  # Note that this assumes the entire list is on one line.
slouken@729
  2137
  available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'`
slouken@729
  2138
slouken@729
  2139
  lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
slouken@729
  2140
  for tagname in $tagnames; do
slouken@729
  2141
    IFS="$lt_save_ifs"
slouken@729
  2142
    # Check whether tagname contains only valid characters
slouken@729
  2143
    case `$echo "X$tagname" | $Xsed -e 's:[[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]]::g'` in
slouken@729
  2144
    "") ;;
slouken@729
  2145
    *)  AC_MSG_ERROR([invalid tag name: $tagname])
slouken@729
  2146
	;;
slouken@729
  2147
    esac
slouken@729
  2148
slouken@729
  2149
    if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null
slouken@729
  2150
    then
slouken@729
  2151
      AC_MSG_ERROR([tag name \"$tagname\" already exists])
slouken@729
  2152
    fi
slouken@729
  2153
slouken@729
  2154
    # Update the list of available tags.
slouken@729
  2155
    if test -n "$tagname"; then
slouken@729
  2156
      echo appending configuration tag \"$tagname\" to $ofile
slouken@729
  2157
slouken@729
  2158
      case $tagname in
slouken@729
  2159
      CXX)
slouken@1570
  2160
	if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
slouken@1570
  2161
	    ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
slouken@1570
  2162
	    (test "X$CXX" != "Xg++"))) ; then
slouken@729
  2163
	  AC_LIBTOOL_LANG_CXX_CONFIG
slouken@729
  2164
	else
slouken@729
  2165
	  tagname=""
slouken@729
  2166
	fi
slouken@729
  2167
	;;
slouken@729
  2168
slouken@729
  2169
      F77)
slouken@729
  2170
	if test -n "$F77" && test "X$F77" != "Xno"; then
slouken@729
  2171
	  AC_LIBTOOL_LANG_F77_CONFIG
slouken@729
  2172
	else
slouken@729
  2173
	  tagname=""
slouken@729
  2174
	fi
slouken@729
  2175
	;;
slouken@729
  2176
slouken@729
  2177
      GCJ)
slouken@729
  2178
	if test -n "$GCJ" && test "X$GCJ" != "Xno"; then
slouken@729
  2179
	  AC_LIBTOOL_LANG_GCJ_CONFIG
slouken@729
  2180
	else
slouken@729
  2181
	  tagname=""
slouken@729
  2182
	fi
slouken@729
  2183
	;;
slouken@729
  2184
slouken@729
  2185
      RC)
slouken@729
  2186
	AC_LIBTOOL_LANG_RC_CONFIG
slouken@729
  2187
	;;
slouken@729
  2188
slouken@729
  2189
      *)
slouken@729
  2190
	AC_MSG_ERROR([Unsupported tag name: $tagname])
slouken@729
  2191
	;;
slouken@729
  2192
      esac
slouken@729
  2193
slouken@729
  2194
      # Append the new tag name to the list of available tags.
slouken@729
  2195
      if test -n "$tagname" ; then
slouken@729
  2196
      available_tags="$available_tags $tagname"
slouken@729
  2197
    fi
slouken@0
  2198
    fi
slouken@0
  2199
  done
slouken@729
  2200
  IFS="$lt_save_ifs"
slouken@729
  2201
slouken@729
  2202
  # Now substitute the updated list of available tags.
slouken@729
  2203
  if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then
slouken@729
  2204
    mv "${ofile}T" "$ofile"
slouken@729
  2205
    chmod +x "$ofile"
slouken@729
  2206
  else
slouken@729
  2207
    rm -f "${ofile}T"
slouken@729
  2208
    AC_MSG_ERROR([unable to update list of available tagged configurations.])
slouken@729
  2209
  fi
slouken@729
  2210
fi
slouken@729
  2211
])# _LT_AC_TAGCONFIG
slouken@729
  2212
slouken@729
  2213
slouken@729
  2214
# AC_LIBTOOL_DLOPEN
slouken@729
  2215
# -----------------
slouken@729
  2216
# enable checks for dlopen support
slouken@729
  2217
AC_DEFUN([AC_LIBTOOL_DLOPEN],
slouken@729
  2218
 [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])
slouken@729
  2219
])# AC_LIBTOOL_DLOPEN
slouken@729
  2220
slouken@729
  2221
slouken@729
  2222
# AC_LIBTOOL_WIN32_DLL
slouken@729
  2223
# --------------------
slouken@1570
  2224
# declare package support for building win32 DLLs
slouken@729
  2225
AC_DEFUN([AC_LIBTOOL_WIN32_DLL],
slouken@729
  2226
[AC_BEFORE([$0], [AC_LIBTOOL_SETUP])
slouken@729
  2227
])# AC_LIBTOOL_WIN32_DLL
slouken@729
  2228
slouken@729
  2229
slouken@729
  2230
# AC_ENABLE_SHARED([DEFAULT])
slouken@729
  2231
# ---------------------------
slouken@729
  2232
# implement the --enable-shared flag
slouken@729
  2233
# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
slouken@729
  2234
AC_DEFUN([AC_ENABLE_SHARED],
slouken@729
  2235
[define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
slouken@729
  2236
AC_ARG_ENABLE([shared],
slouken@729
  2237
    [AC_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
slouken@729
  2238
	[build shared libraries @<:@default=]AC_ENABLE_SHARED_DEFAULT[@:>@])],
slouken@729
  2239
    [p=${PACKAGE-default}
slouken@729
  2240
    case $enableval in
slouken@729
  2241
    yes) enable_shared=yes ;;
slouken@729
  2242
    no) enable_shared=no ;;
slouken@729
  2243
    *)
slouken@729
  2244
      enable_shared=no
slouken@729
  2245
      # Look at the argument we got.  We use all the common list separators.
slouken@729
  2246
      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
slouken@729
  2247
      for pkg in $enableval; do
slouken@729
  2248
	IFS="$lt_save_ifs"
slouken@729
  2249
	if test "X$pkg" = "X$p"; then
slouken@729
  2250
	  enable_shared=yes
slouken@729
  2251
	fi
slouken@729
  2252
      done
slouken@729
  2253
      IFS="$lt_save_ifs"
slouken@729
  2254
      ;;
slouken@729
  2255
    esac],
slouken@729
  2256
    [enable_shared=]AC_ENABLE_SHARED_DEFAULT)
slouken@729
  2257
])# AC_ENABLE_SHARED
slouken@729
  2258
slouken@729
  2259
slouken@729
  2260
# AC_DISABLE_SHARED
slouken@729
  2261
# -----------------
slouken@1570
  2262
# set the default shared flag to --disable-shared
slouken@729
  2263
AC_DEFUN([AC_DISABLE_SHARED],
slouken@729
  2264
[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
slouken@729
  2265
AC_ENABLE_SHARED(no)
slouken@729
  2266
])# AC_DISABLE_SHARED
slouken@729
  2267
slouken@729
  2268
slouken@729
  2269
# AC_ENABLE_STATIC([DEFAULT])
slouken@729
  2270
# ---------------------------
slouken@729
  2271
# implement the --enable-static flag
slouken@729
  2272
# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
slouken@729
  2273
AC_DEFUN([AC_ENABLE_STATIC],
slouken@729
  2274
[define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
slouken@729
  2275
AC_ARG_ENABLE([static],
slouken@729
  2276
    [AC_HELP_STRING([--enable-static@<:@=PKGS@:>@],
slouken@729
  2277
	[build static libraries @<:@default=]AC_ENABLE_STATIC_DEFAULT[@:>@])],
slouken@729
  2278
    [p=${PACKAGE-default}
slouken@729
  2279
    case $enableval in
slouken@729
  2280
    yes) enable_static=yes ;;
slouken@729
  2281
    no) enable_static=no ;;
slouken@729
  2282
    *)
slouken@729
  2283
     enable_static=no
slouken@729
  2284
      # Look at the argument we got.  We use all the common list separators.
slouken@729
  2285
      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
slouken@729
  2286
      for pkg in $enableval; do
slouken@729
  2287
	IFS="$lt_save_ifs"
slouken@729
  2288
	if test "X$pkg" = "X$p"; then
slouken@729
  2289
	  enable_static=yes
slouken@729
  2290
	fi
slouken@729
  2291
      done
slouken@729
  2292
      IFS="$lt_save_ifs"
slouken@729
  2293
      ;;
slouken@729
  2294
    esac],
slouken@729
  2295
    [enable_static=]AC_ENABLE_STATIC_DEFAULT)
slouken@729
  2296
])# AC_ENABLE_STATIC
slouken@729
  2297
slouken@729
  2298
slouken@729
  2299
# AC_DISABLE_STATIC
slouken@729
  2300
# -----------------
slouken@729
  2301
# set the default static flag to --disable-static
slouken@729
  2302
AC_DEFUN([AC_DISABLE_STATIC],
slouken@729
  2303
[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
slouken@729
  2304
AC_ENABLE_STATIC(no)
slouken@729
  2305
])# AC_DISABLE_STATIC
slouken@729
  2306
slouken@729
  2307
slouken@729
  2308
# AC_ENABLE_FAST_INSTALL([DEFAULT])
slouken@729
  2309
# ---------------------------------
slouken@729
  2310
# implement the --enable-fast-install flag
slouken@729
  2311
# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
slouken@729
  2312
AC_DEFUN([AC_ENABLE_FAST_INSTALL],
slouken@729
  2313
[define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
slouken@729
  2314
AC_ARG_ENABLE([fast-install],
slouken@729
  2315
    [AC_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
slouken@729
  2316
    [optimize for fast installation @<:@default=]AC_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
slouken@729
  2317
    [p=${PACKAGE-default}
slouken@729
  2318
    case $enableval in
slouken@729
  2319
    yes) enable_fast_install=yes ;;
slouken@729
  2320
    no) enable_fast_install=no ;;
slouken@729
  2321
    *)
slouken@729
  2322
      enable_fast_install=no
slouken@729
  2323
      # Look at the argument we got.  We use all the common list separators.
slouken@729
  2324
      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
slouken@729
  2325
      for pkg in $enableval; do
slouken@729
  2326
	IFS="$lt_save_ifs"
slouken@729
  2327
	if test "X$pkg" = "X$p"; then
slouken@729
  2328
	  enable_fast_install=yes
slouken@729
  2329
	fi
slouken@729
  2330
      done
slouken@729
  2331
      IFS="$lt_save_ifs"
slouken@729
  2332
      ;;
slouken@729
  2333
    esac],
slouken@729
  2334
    [enable_fast_install=]AC_ENABLE_FAST_INSTALL_DEFAULT)
slouken@729
  2335
])# AC_ENABLE_FAST_INSTALL
slouken@729
  2336
slouken@729
  2337
slouken@729
  2338
# AC_DISABLE_FAST_INSTALL
slouken@729
  2339
# -----------------------
slouken@729
  2340
# set the default to --disable-fast-install
slouken@729
  2341
AC_DEFUN([AC_DISABLE_FAST_INSTALL],
slouken@729
  2342
[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
slouken@729
  2343
AC_ENABLE_FAST_INSTALL(no)
slouken@729
  2344
])# AC_DISABLE_FAST_INSTALL
slouken@729
  2345
slouken@729
  2346
slouken@729
  2347
# AC_LIBTOOL_PICMODE([MODE])
slouken@729
  2348
# --------------------------
slouken@729
  2349
# implement the --with-pic flag
slouken@729
  2350
# MODE is either `yes' or `no'.  If omitted, it defaults to `both'.
slouken@729
  2351
AC_DEFUN([AC_LIBTOOL_PICMODE],
slouken@729
  2352
[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
slouken@729
  2353
pic_mode=ifelse($#,1,$1,default)
slouken@729
  2354
])# AC_LIBTOOL_PICMODE
slouken@729
  2355
slouken@729
  2356
slouken@729
  2357
# AC_PROG_EGREP
slouken@729
  2358
# -------------
slouken@729
  2359
# This is predefined starting with Autoconf 2.54, so this conditional
slouken@729
  2360
# definition can be removed once we require Autoconf 2.54 or later.
slouken@729
  2361
m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP],
slouken@729
  2362
[AC_CACHE_CHECK([for egrep], [ac_cv_prog_egrep],
slouken@729
  2363
   [if echo a | (grep -E '(a|b)') >/dev/null 2>&1
slouken@729
  2364
    then ac_cv_prog_egrep='grep -E'
slouken@729
  2365
    else ac_cv_prog_egrep='egrep'
slouken@729
  2366
    fi])
slouken@729
  2367
 EGREP=$ac_cv_prog_egrep
slouken@729
  2368
 AC_SUBST([EGREP])
slouken@729
  2369
])])
slouken@729
  2370
slouken@729
  2371
slouken@729
  2372
# AC_PATH_TOOL_PREFIX
slouken@729
  2373
# -------------------
slouken@729
  2374
# find a file program which can recognise shared library
slouken@729
  2375
AC_DEFUN([AC_PATH_TOOL_PREFIX],
slouken@729
  2376
[AC_REQUIRE([AC_PROG_EGREP])dnl
slouken@729
  2377
AC_MSG_CHECKING([for $1])
slouken@729
  2378
AC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
slouken@729
  2379
[case $MAGIC_CMD in
slouken@729
  2380
[[\\/*] |  ?:[\\/]*])
slouken@729
  2381
  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
slouken@0
  2382
  ;;
slouken@0
  2383
*)
slouken@729
  2384
  lt_save_MAGIC_CMD="$MAGIC_CMD"
slouken@729
  2385
  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
slouken@729
  2386
dnl $ac_dummy forces splitting on constant user-supplied paths.
slouken@729
  2387
dnl POSIX.2 word splitting is done only on the output of word expansions,
slouken@729
  2388
dnl not every word.  This closes a longstanding sh security hole.
slouken@729
  2389
  ac_dummy="ifelse([$2], , $PATH, [$2])"
slouken@729
  2390
  for ac_dir in $ac_dummy; do
slouken@729
  2391
    IFS="$lt_save_ifs"
slouken@729
  2392
    test -z "$ac_dir" && ac_dir=.
slouken@729
  2393
    if test -f $ac_dir/$1; then
slouken@729
  2394
      lt_cv_path_MAGIC_CMD="$ac_dir/$1"
slouken@729
  2395
      if test -n "$file_magic_test_file"; then
slouken@729
  2396
	case $deplibs_check_method in
slouken@729
  2397
	"file_magic "*)
slouken@1570
  2398
	  file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
slouken@729
  2399
	  MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
slouken@729
  2400
	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
slouken@729
  2401
	    $EGREP "$file_magic_regex" > /dev/null; then
slouken@729
  2402
	    :
slouken@729
  2403
	  else
slouken@729
  2404
	    cat <<EOF 1>&2
slouken@729
  2405
slouken@729
  2406
*** Warning: the command libtool uses to detect shared libraries,
slouken@729
  2407
*** $file_magic_cmd, produces output that libtool cannot recognize.
slouken@729
  2408
*** The result is that libtool may fail to recognize shared libraries
slouken@729
  2409
*** as such.  This will affect the creation of libtool libraries that
slouken@729
  2410
*** depend on shared libraries, but programs linked with such libtool
slouken@729
  2411
*** libraries will work regardless of this problem.  Nevertheless, you
slouken@729
  2412
*** may want to report the problem to your system manager and/or to
slouken@729
  2413
*** bug-libtool@gnu.org
slouken@729
  2414
slouken@729
  2415
EOF
slouken@729
  2416
	  fi ;;
slouken@729
  2417
	esac
slouken@729
  2418
      fi
slouken@729
  2419
      break
slouken@0
  2420
    fi
slouken@0
  2421
  done
slouken@729
  2422
  IFS="$lt_save_ifs"
slouken@729
  2423
  MAGIC_CMD="$lt_save_MAGIC_CMD"
slouken@0
  2424
  ;;
slouken@729
  2425
esac])
slouken@729
  2426
MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
slouken@729
  2427
if test -n "$MAGIC_CMD"; then
slouken@729
  2428
  AC_MSG_RESULT($MAGIC_CMD)
slouken@729
  2429
else
slouken@729
  2430
  AC_MSG_RESULT(no)
slouken@729
  2431
fi
slouken@729
  2432
])# AC_PATH_TOOL_PREFIX
slouken@729
  2433
slouken@729
  2434
slouken@729
  2435
# AC_PATH_MAGIC
slouken@729
  2436
# -------------
slouken@729
  2437
# find a file program which can recognise a shared library
slouken@729
  2438
AC_DEFUN([AC_PATH_MAGIC],
slouken@729
  2439
[AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
slouken@729
  2440
if test -z "$lt_cv_path_MAGIC_CMD"; then
slouken@729
  2441
  if test -n "$ac_tool_prefix"; then
slouken@729
  2442
    AC_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
slouken@729
  2443
  else
slouken@729
  2444
    MAGIC_CMD=:
slouken@729
  2445
  fi
slouken@729
  2446
fi
slouken@729
  2447
])# AC_PATH_MAGIC
slouken@729
  2448
slouken@729
  2449
slouken@729
  2450
# AC_PROG_LD
slouken@729
  2451
# ----------
slouken@947
  2452
# find the pathname to the GNU or non-GNU linker
slouken@729
  2453
AC_DEFUN([AC_PROG_LD],
slouken@729
  2454
[AC_ARG_WITH([gnu-ld],
slouken@729
  2455
    [AC_HELP_STRING([--with-gnu-ld],
slouken@729
  2456
	[assume the C compiler uses GNU ld @<:@default=no@:>@])],
slouken@729
  2457
    [test "$withval" = no || with_gnu_ld=yes],
slouken@729
  2458
    [with_gnu_ld=no])
slouken@729
  2459
AC_REQUIRE([LT_AC_PROG_SED])dnl
slouken@0
  2460
AC_REQUIRE([AC_PROG_CC])dnl
slouken@0
  2461
AC_REQUIRE([AC_CANONICAL_HOST])dnl
slouken@0
  2462
AC_REQUIRE([AC_CANONICAL_BUILD])dnl
slouken@0
  2463
ac_prog=ld
slouken@729
  2464
if test "$GCC" = yes; then
slouken@0
  2465
  # Check if gcc -print-prog-name=ld gives a path.
slouken@729
  2466
  AC_MSG_CHECKING([for ld used by $CC])
slouken@729
  2467
  case $host in
slouken@729
  2468
  *-*-mingw*)
slouken@729
  2469
    # gcc leaves a trailing carriage return which upsets mingw
slouken@729
  2470
    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
slouken@729
  2471
  *)
slouken@729
  2472
    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
slouken@729
  2473
  esac
slouken@729
  2474
  case $ac_prog in
slouken@0
  2475
    # Accept absolute paths.
slouken@729
  2476
    [[\\/]]* | ?:[[\\/]]*)
slouken@729
  2477
      re_direlt='/[[^/]][[^/]]*/\.\./'
slouken@947
  2478
      # Canonicalize the pathname of ld
slouken@729
  2479
      ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'`
slouken@0
  2480
      while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
slouken@729
  2481
	ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"`
slouken@0
  2482
      done
slouken@0
  2483
      test -z "$LD" && LD="$ac_prog"
slouken@0
  2484
      ;;
slouken@0
  2485
  "")
slouken@0
  2486
    # If it fails, then pretend we aren't using GCC.
slouken@0
  2487
    ac_prog=ld
slouken@0
  2488
    ;;
slouken@0
  2489
  *)
slouken@0
  2490
    # If it is relative, then search for the first ld in PATH.
slouken@0
  2491
    with_gnu_ld=unknown
slouken@0
  2492
    ;;
slouken@0
  2493
  esac
slouken@0
  2494
elif test "$with_gnu_ld" = yes; then
slouken@0
  2495
  AC_MSG_CHECKING([for GNU ld])
slouken@0
  2496
else
slouken@0
  2497
  AC_MSG_CHECKING([for non-GNU ld])
slouken@0
  2498
fi
slouken@729
  2499
AC_CACHE_VAL(lt_cv_path_LD,
slouken@0
  2500
[if test -z "$LD"; then
slouken@729
  2501
  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
slouken@0
  2502
  for ac_dir in $PATH; do
slouken@729
  2503
    IFS="$lt_save_ifs"
slouken@0
  2504
    test -z "$ac_dir" && ac_dir=.
slouken@0
  2505
    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
slouken@729
  2506
      lt_cv_path_LD="$ac_dir/$ac_prog"
slouken@0
  2507
      # Check to see if the program is GNU ld.  I'd rather use --version,
slouken@1570
  2508
      # but apparently some variants of GNU ld only accept -v.
slouken@0
  2509
      # Break only if it was the GNU/non-GNU ld that we prefer.
slouken@729
  2510
      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
slouken@729
  2511
      *GNU* | *'with BFD'*)
slouken@0
  2512
	test "$with_gnu_ld" != no && break
slouken@729
  2513
	;;
slouken@729
  2514
      *)
slouken@0
  2515
	test "$with_gnu_ld" != yes && break
slouken@729
  2516
	;;
slouken@729
  2517
      esac
slouken@0
  2518
    fi
slouken@0
  2519
  done
slouken@729
  2520
  IFS="$lt_save_ifs"
slouken@0
  2521
else
slouken@729
  2522
  lt_cv_path_LD="$LD" # Let the user override the test with a path.
slouken@0
  2523
fi])
slouken@729
  2524
LD="$lt_cv_path_LD"
slouken@0
  2525
if test -n "$LD"; then
slouken@0
  2526
  AC_MSG_RESULT($LD)
slouken@0
  2527
else
slouken@0
  2528
  AC_MSG_RESULT(no)
slouken@0
  2529
fi
slouken@0
  2530
test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
slouken@0
  2531
AC_PROG_LD_GNU
slouken@729
  2532
])# AC_PROG_LD
slouken@729
  2533
slouken@729
  2534
slouken@729
  2535
# AC_PROG_LD_GNU
slouken@729
  2536
# --------------
slouken@729
  2537
AC_DEFUN([AC_PROG_LD_GNU],
slouken@729
  2538
[AC_REQUIRE([AC_PROG_EGREP])dnl
slouken@729
  2539
AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
slouken@1570
  2540
[# I'd rather use --version here, but apparently some GNU lds only accept -v.
slouken@947
  2541
case `$LD -v 2>&1 </dev/null` in
slouken@729
  2542
*GNU* | *'with BFD'*)
slouken@729
  2543
  lt_cv_prog_gnu_ld=yes
slouken@729
  2544
  ;;
slouken@729
  2545
*)
slouken@729
  2546
  lt_cv_prog_gnu_ld=no
slouken@729
  2547
  ;;
slouken@729
  2548
esac])
slouken@729
  2549
with_gnu_ld=$lt_cv_prog_gnu_ld
slouken@729
  2550
])# AC_PROG_LD_GNU
slouken@729
  2551
slouken@729
  2552
slouken@729
  2553
# AC_PROG_LD_RELOAD_FLAG
slouken@729
  2554
# ----------------------
slouken@729
  2555
# find reload flag for linker
slouken@729
  2556
#   -- PORTME Some linkers may need a different reload flag.
slouken@729
  2557
AC_DEFUN([AC_PROG_LD_RELOAD_FLAG],
slouken@729
  2558
[AC_CACHE_CHECK([for $LD option to reload object files],
slouken@729
  2559
  lt_cv_ld_reload_flag,
slouken@729
  2560
  [lt_cv_ld_reload_flag='-r'])
slouken@729
  2561
reload_flag=$lt_cv_ld_reload_flag
slouken@729
  2562
case $reload_flag in
slouken@729
  2563
"" | " "*) ;;
slouken@729
  2564
*) reload_flag=" $reload_flag" ;;
slouken@729
  2565
esac
slouken@729
  2566
reload_cmds='$LD$reload_flag -o $output$reload_objs'
slouken@947
  2567
case $host_os in
slouken@947
  2568
  darwin*)
slouken@947
  2569
    if test "$GCC" = yes; then
slouken@1570
  2570
      reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
slouken@947
  2571
    else
slouken@947
  2572
      reload_cmds='$LD$reload_flag -o $output$reload_objs'
slouken@947
  2573
    fi
slouken@947
  2574
    ;;
slouken@947
  2575
esac
slouken@729
  2576
])# AC_PROG_LD_RELOAD_FLAG
slouken@729
  2577
slouken@729
  2578
slouken@729
  2579
# AC_DEPLIBS_CHECK_METHOD
slouken@729
  2580
# -----------------------
slouken@729
  2581
# how to check for library dependencies
slouken@729
  2582
#  -- PORTME fill in with the dynamic library characteristics
slouken@729
  2583
AC_DEFUN([AC_DEPLIBS_CHECK_METHOD],
slouken@729
  2584
[AC_CACHE_CHECK([how to recognise dependent libraries],
slouken@729
  2585
lt_cv_deplibs_check_method,
slouken@729
  2586
[lt_cv_file_magic_cmd='$MAGIC_CMD'
slouken@729
  2587
lt_cv_file_magic_test_file=
slouken@729
  2588
lt_cv_deplibs_check_method='unknown'
slouken@729
  2589
# Need to set the preceding variable on all platforms that support
slouken@729
  2590
# interlibrary dependencies.
slouken@729
  2591
# 'none' -- dependencies not supported.
slouken@729
  2592
# `unknown' -- same as none, but documents that we really don't know.
slouken@729
  2593
# 'pass_all' -- all dependencies passed with no checks.
slouken@729
  2594
# 'test_compile' -- check by making test program.
slouken@729
  2595
# 'file_magic [[regex]]' -- check by looking for files in library path
slouken@729
  2596
# which responds to the $file_magic_cmd with a given extended regex.
slouken@729
  2597
# If you have `file' or equivalent on your system and you're not sure
slouken@729
  2598
# whether `pass_all' will *always* work, you probably want this one.
slouken@729
  2599
slouken@729
  2600
case $host_os in
slouken@729
  2601
aix4* | aix5*)
slouken@729
  2602
  lt_cv_deplibs_check_method=pass_all
slouken@729
  2603
  ;;
slouken@729
  2604
slouken@729
  2605
beos*)
slouken@729
  2606
  lt_cv_deplibs_check_method=pass_all
slouken@729
  2607
  ;;
slouken@729
  2608
slouken@947
  2609
bsdi[[45]]*)
slouken@729
  2610
  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
slouken@729
  2611
  lt_cv_file_magic_cmd='/usr/bin/file -L'
slouken@729
  2612
  lt_cv_file_magic_test_file=/shlib/libc.so
slouken@729
  2613
  ;;
slouken@729
  2614
slouken@947
  2615
cygwin*)
slouken@947
  2616
  # func_win32_libid is a shell function defined in ltmain.sh
slouken@1613
  2617
  #lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
slouken@1613
  2618
  lt_cv_deplibs_check_method=pass_all
slouken@947
  2619
  lt_cv_file_magic_cmd='func_win32_libid'
slouken@729
  2620
  ;;
slouken@729
  2621
slouken@947
  2622
mingw* | pw32*)
slouken@947
  2623
  # Base MSYS/MinGW do not provide the 'file' command needed by
slouken@947
  2624
  # func_win32_libid shell function, so use a weaker test based on 'objdump'.
slouken@1613
  2625
  #lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
slouken@1613
  2626
  lt_cv_deplibs_check_method=pass_all
slouken@947
  2627
  lt_cv_file_magic_cmd='$OBJDUMP -f'
slouken@947
  2628
  ;;
slouken@947
  2629
slouken@729
  2630
darwin* | rhapsody*)
slouken@729
  2631
  lt_cv_deplibs_check_method=pass_all
slouken@729
  2632
  ;;
slouken@729
  2633
slouken@1570
  2634
freebsd* | kfreebsd*-gnu | dragonfly*)
slouken@729
  2635
  if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
slouken@729
  2636
    case $host_cpu in
slouken@729
  2637
    i*86 )
slouken@729
  2638
      # Not sure whether the presence of OpenBSD here was a mistake.
slouken@729
  2639
      # Let's accept both of them until this is cleared up.
slouken@1570
  2640
      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
slouken@729
  2641
      lt_cv_file_magic_cmd=/usr/bin/file
slouken@729
  2642
      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
slouken@729
  2643
      ;;
slouken@729
  2644
    esac
slouken@729
  2645
  else
slouken@729
  2646
    lt_cv_deplibs_check_method=pass_all
slouken@729
  2647
  fi
slouken@729
  2648
  ;;
slouken@729
  2649
slouken@729
  2650
gnu*)
slouken@729
  2651
  lt_cv_deplibs_check_method=pass_all
slouken@729
  2652
  ;;
slouken@729
  2653
slouken@729
  2654
hpux10.20* | hpux11*)
slouken@729
  2655
  lt_cv_file_magic_cmd=/usr/bin/file
slouken@1570
  2656
  case $host_cpu in
slouken@729
  2657
  ia64*)
slouken@729
  2658
    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
slouken@729
  2659
    lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
slouken@729
  2660
    ;;
slouken@729
  2661
  hppa*64*)
slouken@729
  2662
    [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]']
slouken@729
  2663
    lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
slouken@729
  2664
    ;;
slouken@729
  2665
  *)
slouken@729
  2666
    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library'
slouken@729
  2667
    lt_cv_file_magic_test_file=/usr/lib/libc.sl
slouken@729
  2668
    ;;
slouken@729
  2669
  esac
slouken@729
  2670
  ;;
slouken@729
  2671
slouken@1570
  2672
interix3*)
slouken@1570
  2673
  # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
slouken@1570
  2674
  lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$'
slouken@1570
  2675
  ;;
slouken@1570
  2676
slouken@729
  2677
irix5* | irix6* | nonstopux*)
slouken@947
  2678
  case $LD in
slouken@947
  2679
  *-32|*"-32 ") libmagic=32-bit;;
slouken@947
  2680
  *-n32|*"-n32 ") libmagic=N32;;
slouken@947
  2681
  *-64|*"-64 ") libmagic=64-bit;;
slouken@947
  2682
  *) libmagic=never-match;;
slouken@729
  2683
  esac
slouken@886
  2684
  lt_cv_deplibs_check_method=pass_all
slouken@886
  2685
  ;;
slouken@886
  2686
slouken@729
  2687
# This must be Linux ELF.
slouken@729
  2688
linux*)
slouken@947
  2689
  lt_cv_deplibs_check_method=pass_all
slouken@729
  2690
  ;;
slouken@729
  2691
slouken@729
  2692
netbsd*)
slouken@729
  2693
  if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
slouken@729
  2694
    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
slouken@729
  2695
  else
slouken@729
  2696
    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
slouken@729
  2697
  fi
slouken@729
  2698
  ;;
slouken@729
  2699
slouken@729
  2700
newos6*)
slouken@729
  2701
  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
slouken@729
  2702
  lt_cv_file_magic_cmd=/usr/bin/file
slouken@729
  2703
  lt_cv_file_magic_test_file=/usr/lib/libnls.so
slouken@729
  2704
  ;;
slouken@729
  2705
slouken@947
  2706
nto-qnx*)
slouken@947
  2707
  lt_cv_deplibs_check_method=unknown
slouken@947
  2708
  ;;
slouken@947
  2709
slouken@729
  2710
openbsd*)
slouken@729
  2711
  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
slouken@947
  2712
    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
slouken@729
  2713
  else
slouken@947
  2714
    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
slouken@729
  2715
  fi
slouken@729
  2716
  ;;
slouken@729
  2717
slouken@729
  2718
osf3* | osf4* | osf5*)
slouken@729
  2719
  lt_cv_deplibs_check_method=pass_all
slouken@729
  2720
  ;;
slouken@729
  2721
slouken@729
  2722
solaris*)
slouken@729
  2723
  lt_cv_deplibs_check_method=pass_all
slouken@729
  2724
  ;;
slouken@729
  2725
slouken@1570
  2726
sysv4 | sysv4.3*)
slouken@729
  2727
  case $host_vendor in
slouken@729
  2728
  motorola)
slouken@729
  2729
    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]]'
slouken@729
  2730
    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
slouken@729
  2731
    ;;
slouken@729
  2732
  ncr)
slouken@729
  2733
    lt_cv_deplibs_check_method=pass_all
slouken@729
  2734
    ;;
slouken@729
  2735
  sequent)
slouken@729
  2736
    lt_cv_file_magic_cmd='/bin/file'
slouken@729
  2737
    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
slouken@729
  2738
    ;;
slouken@729
  2739
  sni)
slouken@729
  2740
    lt_cv_file_magic_cmd='/bin/file'
slouken@729
  2741
    lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
slouken@729
  2742
    lt_cv_file_magic_test_file=/lib/libc.so
slouken@729
  2743
    ;;
slouken@729
  2744
  siemens)
slouken@729
  2745
    lt_cv_deplibs_check_method=pass_all
slouken@729
  2746
    ;;
slouken@1570
  2747
  pc)
slouken@1570
  2748
    lt_cv_deplibs_check_method=pass_all
slouken@1570
  2749
    ;;
slouken@729
  2750
  esac
slouken@729
  2751
  ;;
slouken@729
  2752
slouken@1570
  2753
sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
slouken@729
  2754
  lt_cv_deplibs_check_method=pass_all
slouken@729
  2755
  ;;
slouken@729
  2756
esac
slouken@0
  2757
])
slouken@729
  2758
file_magic_cmd=$lt_cv_file_magic_cmd
slouken@729
  2759
deplibs_check_method=$lt_cv_deplibs_check_method
slouken@729
  2760
test -z "$deplibs_check_method" && deplibs_check_method=unknown
slouken@729
  2761
])# AC_DEPLIBS_CHECK_METHOD
slouken@729
  2762
slouken@729
  2763
slouken@729
  2764
# AC_PROG_NM
slouken@729
  2765
# ----------
slouken@947
  2766
# find the pathname to a BSD-compatible name lister
slouken@729
  2767
AC_DEFUN([AC_PROG_NM],
slouken@729
  2768
[AC_CACHE_CHECK([for BSD-compatible nm], lt_cv_path_NM,
slouken@0
  2769
[if test -n "$NM"; then
slouken@0
  2770
  # Let the user override the test.
slouken@729
  2771
  lt_cv_path_NM="$NM"
slouken@0
  2772
else
slouken@1570
  2773
  lt_nm_to_check="${ac_tool_prefix}nm"
slouken@1570
  2774
  if test -n "$ac_tool_prefix" && test "$build" = "$host"; then 
slouken@1570
  2775
    lt_nm_to_check="$lt_nm_to_check nm"
slouken@1570
  2776
  fi
slouken@1570
  2777
  for lt_tmp_nm in $lt_nm_to_check; do
slouken@1570
  2778
    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
slouken@1570
  2779
    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
slouken@1570
  2780
      IFS="$lt_save_ifs"
slouken@1570
  2781
      test -z "$ac_dir" && ac_dir=.
slouken@1570
  2782
      tmp_nm="$ac_dir/$lt_tmp_nm"
slouken@1570
  2783
      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
slouken@1570
  2784
	# Check to see if the nm accepts a BSD-compat flag.
slouken@1570
  2785
	# Adding the `sed 1q' prevents false positives on HP-UX, which says:
slouken@1570
  2786
	#   nm: unknown option "B" ignored
slouken@1570
  2787
	# Tru64's nm complains that /dev/null is an invalid object file
slouken@1570
  2788
	case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
slouken@1570
  2789
	*/dev/null* | *'Invalid file or object type'*)
slouken@1570
  2790
	  lt_cv_path_NM="$tmp_nm -B"
slouken@729
  2791
	  break
slouken@729
  2792
	  ;;
slouken@729
  2793
	*)
slouken@1570
  2794
	  case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
slouken@1570
  2795
	  */dev/null*)
slouken@1570
  2796
	    lt_cv_path_NM="$tmp_nm -p"
slouken@1570
  2797