acinclude.m4
author Sam Lantinga <slouken@libsdl.org>
Sun, 04 Oct 2009 03:38:01 +0000
changeset 3334 61ea9005fddf
parent 3085 4800979de337
permissions -rw-r--r--
Use gcc's built-in dependency generation, thanks to Adam Strzelecki
slouken@3012
     1
define(AC_CHECK_DEFINE,[dnl
slouken@3012
     2
  AC_CACHE_CHECK(for $1 in $2, ac_cv_define_$1,
slouken@3012
     3
    AC_EGREP_CPP([YES_IS_DEFINED], [
slouken@3012
     4
#include <$2>
slouken@3012
     5
#ifdef $1
slouken@3012
     6
YES_IS_DEFINED
slouken@3012
     7
#endif
slouken@3012
     8
    ], ac_cv_define_$1=yes, ac_cv_define_$1=no)
slouken@3012
     9
  )
slouken@3012
    10
  if test "$ac_cv_define_$1" = "yes" ; then
slouken@3012
    11
    AC_DEFINE(HAVE_$1)
slouken@3012
    12
  fi
slouken@3012
    13
])dnl
slouken@3012
    14
AC_DEFINE(HAVE_$1)
slouken@3012
    15
slouken@948
    16
##############################################################################
slouken@939
    17
dnl Configure Paths for Alsa
slouken@939
    18
dnl Some modifications by Richard Boulton <richard-alsa@tartarus.org>
slouken@939
    19
dnl Christopher Lansdown <lansdoct@cs.alfred.edu>
slouken@939
    20
dnl Jaroslav Kysela <perex@suse.cz>
slouken@948
    21
dnl Last modification: alsa.m4,v 1.23 2004/01/16 18:14:22 tiwai Exp
slouken@939
    22
dnl AM_PATH_ALSA([MINIMUM-VERSION [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
slouken@939
    23
dnl Test for libasound, and define ALSA_CFLAGS and ALSA_LIBS as appropriate.
slouken@939
    24
dnl enables arguments --with-alsa-prefix=
slouken@939
    25
dnl                   --with-alsa-enc-prefix=
slouken@948
    26
dnl                   --disable-alsatest
slouken@939
    27
dnl
slouken@939
    28
dnl For backwards compatibility, if ACTION_IF_NOT_FOUND is not specified,
slouken@939
    29
dnl and the alsa libraries are not found, a fatal AC_MSG_ERROR() will result.
slouken@939
    30
dnl
slouken@948
    31
AC_DEFUN([AM_PATH_ALSA],
slouken@939
    32
[dnl Save the original CFLAGS, LDFLAGS, and LIBS
slouken@939
    33
alsa_save_CFLAGS="$CFLAGS"
slouken@939
    34
alsa_save_LDFLAGS="$LDFLAGS"
slouken@939
    35
alsa_save_LIBS="$LIBS"
slouken@939
    36
alsa_found=yes
slouken@939
    37
slouken@939
    38
dnl
slouken@939
    39
dnl Get the cflags and libraries for alsa
slouken@939
    40
dnl
slouken@939
    41
AC_ARG_WITH(alsa-prefix,
slouken@939
    42
[  --with-alsa-prefix=PFX  Prefix where Alsa library is installed(optional)],
slouken@939
    43
[alsa_prefix="$withval"], [alsa_prefix=""])
slouken@939
    44
slouken@939
    45
AC_ARG_WITH(alsa-inc-prefix,
slouken@939
    46
[  --with-alsa-inc-prefix=PFX  Prefix where include libraries are (optional)],
slouken@939
    47
[alsa_inc_prefix="$withval"], [alsa_inc_prefix=""])
slouken@939
    48
slouken@939
    49
dnl FIXME: this is not yet implemented
slouken@939
    50
AC_ARG_ENABLE(alsatest,
slouken@939
    51
[  --disable-alsatest      Do not try to compile and run a test Alsa program],
slouken@948
    52
[enable_alsatest="$enableval"],
slouken@939
    53
[enable_alsatest=yes])
slouken@939
    54
slouken@939
    55
dnl Add any special include directories
slouken@939
    56
AC_MSG_CHECKING(for ALSA CFLAGS)
slouken@939
    57
if test "$alsa_inc_prefix" != "" ; then
slouken@939
    58
	ALSA_CFLAGS="$ALSA_CFLAGS -I$alsa_inc_prefix"
slouken@939
    59
	CFLAGS="$CFLAGS -I$alsa_inc_prefix"
slouken@939
    60
fi
slouken@939
    61
AC_MSG_RESULT($ALSA_CFLAGS)
slouken@939
    62
slouken@939
    63
dnl add any special lib dirs
slouken@939
    64
AC_MSG_CHECKING(for ALSA LDFLAGS)
slouken@939
    65
if test "$alsa_prefix" != "" ; then
slouken@939
    66
	ALSA_LIBS="$ALSA_LIBS -L$alsa_prefix"
slouken@939
    67
	LDFLAGS="$LDFLAGS $ALSA_LIBS"
slouken@939
    68
fi
slouken@939
    69
slouken@939
    70
dnl add the alsa library
slouken@939
    71
ALSA_LIBS="$ALSA_LIBS -lasound -lm -ldl -lpthread"
slouken@939
    72
LIBS=`echo $LIBS | sed 's/-lm//'`
slouken@939
    73
LIBS=`echo $LIBS | sed 's/-ldl//'`
slouken@939
    74
LIBS=`echo $LIBS | sed 's/-lpthread//'`
slouken@939
    75
LIBS=`echo $LIBS | sed 's/  //'`
slouken@939
    76
LIBS="$ALSA_LIBS $LIBS"
slouken@939
    77
AC_MSG_RESULT($ALSA_LIBS)
slouken@939
    78
slouken@939
    79
dnl Check for a working version of libasound that is of the right version.
slouken@939
    80
min_alsa_version=ifelse([$1], ,0.1.1,$1)
slouken@939
    81
AC_MSG_CHECKING(for libasound headers version >= $min_alsa_version)
slouken@939
    82
no_alsa=""
slouken@939
    83
    alsa_min_major_version=`echo $min_alsa_version | \
slouken@939
    84
           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
slouken@939
    85
    alsa_min_minor_version=`echo $min_alsa_version | \
slouken@939
    86
           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
slouken@939
    87
    alsa_min_micro_version=`echo $min_alsa_version | \
slouken@939
    88
           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
slouken@939
    89
slouken@939
    90
AC_LANG_SAVE
slouken@939
    91
AC_LANG_C
slouken@939
    92
AC_TRY_COMPILE([
slouken@939
    93
#include <alsa/asoundlib.h>
slouken@939
    94
], [
slouken@939
    95
/* ensure backward compatibility */
slouken@939
    96
#if !defined(SND_LIB_MAJOR) && defined(SOUNDLIB_VERSION_MAJOR)
slouken@939
    97
#define SND_LIB_MAJOR SOUNDLIB_VERSION_MAJOR
slouken@939
    98
#endif
slouken@939
    99
#if !defined(SND_LIB_MINOR) && defined(SOUNDLIB_VERSION_MINOR)
slouken@939
   100
#define SND_LIB_MINOR SOUNDLIB_VERSION_MINOR
slouken@939
   101
#endif
slouken@939
   102
#if !defined(SND_LIB_SUBMINOR) && defined(SOUNDLIB_VERSION_SUBMINOR)
slouken@939
   103
#define SND_LIB_SUBMINOR SOUNDLIB_VERSION_SUBMINOR
slouken@939
   104
#endif
slouken@939
   105
slouken@939
   106
#  if(SND_LIB_MAJOR > $alsa_min_major_version)
slouken@939
   107
  exit(0);
slouken@939
   108
#  else
slouken@939
   109
#    if(SND_LIB_MAJOR < $alsa_min_major_version)
slouken@939
   110
#       error not present
slouken@939
   111
#    endif
slouken@939
   112
slouken@939
   113
#   if(SND_LIB_MINOR > $alsa_min_minor_version)
slouken@939
   114
  exit(0);
slouken@939
   115
#   else
slouken@939
   116
#     if(SND_LIB_MINOR < $alsa_min_minor_version)
slouken@939
   117
#          error not present
slouken@939
   118
#      endif
slouken@939
   119
slouken@939
   120
#      if(SND_LIB_SUBMINOR < $alsa_min_micro_version)
slouken@939
   121
#        error not present
slouken@939
   122
#      endif
slouken@939
   123
#    endif
slouken@939
   124
#  endif
slouken@939
   125
exit(0);
slouken@939
   126
],
slouken@939
   127
  [AC_MSG_RESULT(found.)],
slouken@939
   128
  [AC_MSG_RESULT(not present.)
slouken@939
   129
   ifelse([$3], , [AC_MSG_ERROR(Sufficiently new version of libasound not found.)])
slouken@939
   130
   alsa_found=no]
slouken@939
   131
)
slouken@939
   132
AC_LANG_RESTORE
slouken@939
   133
slouken@939
   134
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
   135
if test "x$enable_alsatest" = "xyes"; then
slouken@939
   136
AC_CHECK_LIB([asound], [snd_ctl_open],,
slouken@939
   137
	[ifelse([$3], , [AC_MSG_ERROR(No linkable libasound was found.)])
slouken@939
   138
	 alsa_found=no]
slouken@939
   139
)
slouken@948
   140
fi
slouken@948
   141
slouken@939
   142
if test "x$alsa_found" = "xyes" ; then
slouken@939
   143
   ifelse([$2], , :, [$2])
slouken@948
   144
   LIBS=`echo $LIBS | sed 's/-lasound//g'`
slouken@948
   145
   LIBS=`echo $LIBS | sed 's/  //'`
slouken@948
   146
   LIBS="-lasound $LIBS"
slouken@948
   147
fi
slouken@948
   148
if test "x$alsa_found" = "xno" ; then
slouken@939
   149
   ifelse([$3], , :, [$3])
slouken@939
   150
   CFLAGS="$alsa_save_CFLAGS"
slouken@939
   151
   LDFLAGS="$alsa_save_LDFLAGS"
slouken@939
   152
   LIBS="$alsa_save_LIBS"
slouken@939
   153
   ALSA_CFLAGS=""
slouken@939
   154
   ALSA_LIBS=""
slouken@939
   155
fi
slouken@939
   156
slouken@939
   157
dnl That should be it.  Now just export out symbols:
slouken@939
   158
AC_SUBST(ALSA_CFLAGS)
slouken@939
   159
AC_SUBST(ALSA_LIBS)
slouken@939
   160
])
slouken@939
   161
slouken@948
   162
##############################################################################
slouken@939
   163
#
slouken@0
   164
# --- esd.m4 ---
slouken@0
   165
#
slouken@0
   166
# Configure paths for ESD
slouken@0
   167
# Manish Singh    98-9-30
slouken@0
   168
# stolen back from Frank Belew
slouken@0
   169
# stolen from Manish Singh
slouken@0
   170
# Shamelessly stolen from Owen Taylor
slouken@0
   171
slouken@0
   172
dnl AM_PATH_ESD([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
slouken@0
   173
dnl Test for ESD, and define ESD_CFLAGS and ESD_LIBS
slouken@0
   174
dnl
slouken@794
   175
AC_DEFUN([AM_PATH_ESD],
slouken@0
   176
[dnl 
slouken@0
   177
dnl Get the cflags and libraries from the esd-config script
slouken@0
   178
dnl
slouken@0
   179
AC_ARG_WITH(esd-prefix,[  --with-esd-prefix=PFX   Prefix where ESD is installed (optional)],
slouken@0
   180
            esd_prefix="$withval", esd_prefix="")
slouken@0
   181
AC_ARG_WITH(esd-exec-prefix,[  --with-esd-exec-prefix=PFX Exec prefix where ESD is installed (optional)],
slouken@0
   182
            esd_exec_prefix="$withval", esd_exec_prefix="")
slouken@0
   183
AC_ARG_ENABLE(esdtest, [  --disable-esdtest       Do not try to compile and run a test ESD program],
slouken@0
   184
		    , enable_esdtest=yes)
slouken@0
   185
slouken@0
   186
  if test x$esd_exec_prefix != x ; then
slouken@0
   187
     esd_args="$esd_args --exec-prefix=$esd_exec_prefix"
slouken@0
   188
     if test x${ESD_CONFIG+set} != xset ; then
slouken@0
   189
        ESD_CONFIG=$esd_exec_prefix/bin/esd-config
slouken@0
   190
     fi
slouken@0
   191
  fi
slouken@0
   192
  if test x$esd_prefix != x ; then
slouken@0
   193
     esd_args="$esd_args --prefix=$esd_prefix"
slouken@0
   194
     if test x${ESD_CONFIG+set} != xset ; then
slouken@0
   195
        ESD_CONFIG=$esd_prefix/bin/esd-config
slouken@0
   196
     fi
slouken@0
   197
  fi
slouken@0
   198
slouken@0
   199
  AC_PATH_PROG(ESD_CONFIG, esd-config, no)
slouken@0
   200
  min_esd_version=ifelse([$1], ,0.2.7,$1)
slouken@0
   201
  AC_MSG_CHECKING(for ESD - version >= $min_esd_version)
slouken@0
   202
  no_esd=""
slouken@0
   203
  if test "$ESD_CONFIG" = "no" ; then
slouken@0
   204
    no_esd=yes
slouken@0
   205
  else
slouken@0
   206
    ESD_CFLAGS=`$ESD_CONFIG $esdconf_args --cflags`
slouken@0
   207
    ESD_LIBS=`$ESD_CONFIG $esdconf_args --libs`
slouken@0
   208
slouken@0
   209
    esd_major_version=`$ESD_CONFIG $esd_args --version | \
slouken@0
   210
           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
slouken@0
   211
    esd_minor_version=`$ESD_CONFIG $esd_args --version | \
slouken@0
   212
           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
slouken@0
   213
    esd_micro_version=`$ESD_CONFIG $esd_config_args --version | \
slouken@0
   214
           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
slouken@0
   215
    if test "x$enable_esdtest" = "xyes" ; then
slouken@0
   216
      ac_save_CFLAGS="$CFLAGS"
slouken@0
   217
      ac_save_LIBS="$LIBS"
slouken@0
   218
      CFLAGS="$CFLAGS $ESD_CFLAGS"
slouken@0
   219
      LIBS="$LIBS $ESD_LIBS"
slouken@0
   220
dnl
slouken@0
   221
dnl Now check if the installed ESD is sufficiently new. (Also sanity
slouken@0
   222
dnl checks the results of esd-config to some extent
slouken@0
   223
dnl
slouken@0
   224
      rm -f conf.esdtest
slouken@0
   225
      AC_TRY_RUN([
slouken@0
   226
#include <stdio.h>
slouken@0
   227
#include <stdlib.h>
slouken@0
   228
#include <string.h>
slouken@0
   229
#include <esd.h>
slouken@0
   230
slouken@0
   231
char*
slouken@0
   232
my_strdup (char *str)
slouken@0
   233
{
slouken@0
   234
  char *new_str;
slouken@0
   235
  
slouken@0
   236
  if (str)
slouken@0
   237
    {
slouken@0
   238
      new_str = malloc ((strlen (str) + 1) * sizeof(char));
slouken@0
   239
      strcpy (new_str, str);
slouken@0
   240
    }
slouken@0
   241
  else
slouken@0
   242
    new_str = NULL;
slouken@0
   243
  
slouken@0
   244
  return new_str;
slouken@0
   245
}
slouken@0
   246
slouken@0
   247
int main ()
slouken@0
   248
{
slouken@0
   249
  int major, minor, micro;
slouken@0
   250
  char *tmp_version;
slouken@0
   251
slouken@0
   252
  system ("touch conf.esdtest");
slouken@0
   253
slouken@0
   254
  /* HP/UX 9 (%@#!) writes to sscanf strings */
slouken@0
   255
  tmp_version = my_strdup("$min_esd_version");
slouken@0
   256
  if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
slouken@0
   257
     printf("%s, bad version string\n", "$min_esd_version");
slouken@0
   258
     exit(1);
slouken@0
   259
   }
slouken@0
   260
slouken@0
   261
   if (($esd_major_version > major) ||
slouken@0
   262
      (($esd_major_version == major) && ($esd_minor_version > minor)) ||
slouken@0
   263
      (($esd_major_version == major) && ($esd_minor_version == minor) && ($esd_micro_version >= micro)))
slouken@0
   264
    {
slouken@0
   265
      return 0;
slouken@0
   266
    }
slouken@0
   267
  else
slouken@0
   268
    {
slouken@0
   269
      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
   270
      printf("*** of ESD required is %d.%d.%d. If esd-config is correct, then it is\n", major, minor, micro);
slouken@0
   271
      printf("*** best to upgrade to the required version.\n");
slouken@0
   272
      printf("*** If esd-config was wrong, set the environment variable ESD_CONFIG\n");
slouken@0
   273
      printf("*** to point to the correct copy of esd-config, and remove the file\n");
slouken@0
   274
      printf("*** config.cache before re-running configure\n");
slouken@0
   275
      return 1;
slouken@0
   276
    }
slouken@0
   277
}
slouken@0
   278
slouken@0
   279
],, no_esd=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
slouken@0
   280
       CFLAGS="$ac_save_CFLAGS"
slouken@0
   281
       LIBS="$ac_save_LIBS"
slouken@0
   282
     fi
slouken@0
   283
  fi
slouken@0
   284
  if test "x$no_esd" = x ; then
slouken@0
   285
     AC_MSG_RESULT(yes)
slouken@0
   286
     ifelse([$2], , :, [$2])     
slouken@0
   287
  else
slouken@0
   288
     AC_MSG_RESULT(no)
slouken@0
   289
     if test "$ESD_CONFIG" = "no" ; then
slouken@0
   290
       echo "*** The esd-config script installed by ESD could not be found"
slouken@0
   291
       echo "*** If ESD was installed in PREFIX, make sure PREFIX/bin is in"
slouken@0
   292
       echo "*** your path, or set the ESD_CONFIG environment variable to the"
slouken@0
   293
       echo "*** full path to esd-config."
slouken@0
   294
     else
slouken@0
   295
       if test -f conf.esdtest ; then
slouken@0
   296
        :
slouken@0
   297
       else
slouken@0
   298
          echo "*** Could not run ESD test program, checking why..."
slouken@0
   299
          CFLAGS="$CFLAGS $ESD_CFLAGS"
slouken@0
   300
          LIBS="$LIBS $ESD_LIBS"
slouken@0
   301
          AC_TRY_LINK([
slouken@0
   302
#include <stdio.h>
slouken@0
   303
#include <esd.h>
slouken@0
   304
],      [ return 0; ],
slouken@0
   305
        [ echo "*** The test program compiled, but did not run. This usually means"
slouken@0
   306
          echo "*** that the run-time linker is not finding ESD or finding the wrong"
slouken@0
   307
          echo "*** version of ESD. If it is not finding ESD, you'll need to set your"
slouken@0
   308
          echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
slouken@0
   309
          echo "*** to the installed location  Also, make sure you have run ldconfig if that"
slouken@0
   310
          echo "*** is required on your system"
slouken@0
   311
	  echo "***"
slouken@0
   312
          echo "*** If you have an old version installed, it is best to remove it, although"
slouken@0
   313
          echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"],
slouken@0
   314
        [ echo "*** The test program failed to compile or link. See the file config.log for the"
slouken@0
   315
          echo "*** exact error that occured. This usually means ESD was incorrectly installed"
slouken@0
   316
          echo "*** or that you have moved ESD since it was installed. In the latter case, you"
slouken@0
   317
          echo "*** may want to edit the esd-config script: $ESD_CONFIG" ])
slouken@0
   318
          CFLAGS="$ac_save_CFLAGS"
slouken@0
   319
          LIBS="$ac_save_LIBS"
slouken@0
   320
       fi
slouken@0
   321
     fi
slouken@0
   322
     ESD_CFLAGS=""
slouken@0
   323
     ESD_LIBS=""
slouken@0
   324
     ifelse([$3], , :, [$3])
slouken@0
   325
  fi
slouken@0
   326
  AC_SUBST(ESD_CFLAGS)
slouken@0
   327
  AC_SUBST(ESD_LIBS)
slouken@0
   328
  rm -f conf.esdtest
slouken@0
   329
])
slouken@0
   330
slouken@948
   331
##############################################################################
slouken@3085
   332
# Based on libtool-2.2.6a
slouken@729
   333
# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
slouken@3085
   334
#
slouken@3085
   335
#   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
slouken@3085
   336
#                 2006, 2007, 2008 Free Software Foundation, Inc.
slouken@3085
   337
#   Written by Gordon Matzigkeit, 1996
slouken@3085
   338
#
slouken@3085
   339
# This file is free software; the Free Software Foundation gives
slouken@3085
   340
# unlimited permission to copy and/or distribute it, with or without
slouken@3085
   341
# modifications, as long as this notice is preserved.
slouken@3085
   342
slouken@3085
   343
m4_define([_LT_COPYING], [dnl
slouken@3085
   344
#   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
slouken@3085
   345
#                 2006, 2007, 2008 Free Software Foundation, Inc.
slouken@3085
   346
#   Written by Gordon Matzigkeit, 1996
slouken@3085
   347
#
slouken@3085
   348
#   This file is part of GNU Libtool.
slouken@3085
   349
#
slouken@3085
   350
# GNU Libtool is free software; you can redistribute it and/or
slouken@3085
   351
# modify it under the terms of the GNU General Public License as
slouken@3085
   352
# published by the Free Software Foundation; either version 2 of
slouken@3085
   353
# the License, or (at your option) any later version.
slouken@3085
   354
#
slouken@3085
   355
# As a special exception to the GNU General Public License,
slouken@3085
   356
# if you distribute this file as part of a program or library that
slouken@3085
   357
# is built using GNU Libtool, you may include this file under the
slouken@3085
   358
# same distribution terms that you use for the rest of that program.
slouken@3085
   359
#
slouken@3085
   360
# GNU Libtool is distributed in the hope that it will be useful,
slouken@3085
   361
# but WITHOUT ANY WARRANTY; without even the implied warranty of
slouken@3085
   362
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
slouken@3085
   363
# GNU General Public License for more details.
slouken@3085
   364
#
slouken@3085
   365
# You should have received a copy of the GNU General Public License
slouken@3085
   366
# along with GNU Libtool; see the file COPYING.  If not, a copy
slouken@3085
   367
# can be downloaded from http://www.gnu.org/licenses/gpl.html, or
slouken@3085
   368
# obtained by writing to the Free Software Foundation, Inc.,
slouken@3085
   369
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
slouken@3085
   370
])
slouken@3085
   371
slouken@3085
   372
# serial 56 LT_INIT
slouken@3085
   373
slouken@3085
   374
slouken@3085
   375
# LT_PREREQ(VERSION)
slouken@3085
   376
# ------------------
slouken@3085
   377
# Complain and exit if this libtool version is less that VERSION.
slouken@3085
   378
m4_defun([LT_PREREQ],
slouken@3085
   379
[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1,
slouken@3085
   380
       [m4_default([$3],
slouken@3085
   381
		   [m4_fatal([Libtool version $1 or higher is required],
slouken@3085
   382
		             63)])],
slouken@3085
   383
       [$2])])
slouken@3085
   384
slouken@3085
   385
slouken@3085
   386
# _LT_CHECK_BUILDDIR
slouken@3085
   387
# ------------------
slouken@3085
   388
# Complain if the absolute build directory name contains unusual characters
slouken@3085
   389
m4_defun([_LT_CHECK_BUILDDIR],
slouken@3085
   390
[case `pwd` in
slouken@3085
   391
  *\ * | *\	*)
slouken@3085
   392
    AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;;
slouken@3085
   393
esac
slouken@3085
   394
])
slouken@3085
   395
slouken@3085
   396
slouken@3085
   397
# LT_INIT([OPTIONS])
slouken@3085
   398
# ------------------
slouken@3085
   399
AC_DEFUN([LT_INIT],
slouken@3085
   400
[AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT
slouken@3085
   401
AC_BEFORE([$0], [LT_LANG])dnl
slouken@3085
   402
AC_BEFORE([$0], [LT_OUTPUT])dnl
slouken@3085
   403
AC_BEFORE([$0], [LTDL_INIT])dnl
slouken@3085
   404
m4_require([_LT_CHECK_BUILDDIR])dnl
slouken@3085
   405
slouken@3085
   406
dnl Autoconf doesn't catch unexpanded LT_ macros by default:
slouken@3085
   407
m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl
slouken@3085
   408
m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl
slouken@3085
   409
dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4
slouken@3085
   410
dnl unless we require an AC_DEFUNed macro:
slouken@3085
   411
AC_REQUIRE([LTOPTIONS_VERSION])dnl
slouken@3085
   412
AC_REQUIRE([LTSUGAR_VERSION])dnl
slouken@3085
   413
AC_REQUIRE([LTVERSION_VERSION])dnl
slouken@3085
   414
AC_REQUIRE([LTOBSOLETE_VERSION])dnl
slouken@3085
   415
m4_require([_LT_PROG_LTMAIN])dnl
slouken@3085
   416
slouken@3085
   417
dnl Parse OPTIONS
slouken@3085
   418
_LT_SET_OPTIONS([$0], [$1])
slouken@0
   419
slouken@0
   420
# This can be used to rebuild libtool when needed
slouken@3085
   421
LIBTOOL_DEPS="$ltmain"
slouken@0
   422
slouken@0
   423
# Always use our own libtool.
slouken@0
   424
LIBTOOL='$(SHELL) $(top_builddir)/libtool'
slouken@0
   425
AC_SUBST(LIBTOOL)dnl
slouken@0
   426
slouken@3085
   427
_LT_SETUP
slouken@3085
   428
slouken@3085
   429
# Only expand once:
slouken@3085
   430
m4_define([LT_INIT])
slouken@3085
   431
])# LT_INIT
slouken@3085
   432
slouken@3085
   433
# Old names:
slouken@3085
   434
AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT])
slouken@3085
   435
AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT])
slouken@3085
   436
dnl aclocal-1.4 backwards compatibility:
slouken@3085
   437
dnl AC_DEFUN([AC_PROG_LIBTOOL], [])
slouken@3085
   438
dnl AC_DEFUN([AM_PROG_LIBTOOL], [])
slouken@3085
   439
slouken@3085
   440
slouken@3085
   441
# _LT_CC_BASENAME(CC)
slouken@3085
   442
# -------------------
slouken@3085
   443
# Calculate cc_basename.  Skip known compiler wrappers and cross-prefix.
slouken@3085
   444
m4_defun([_LT_CC_BASENAME],
slouken@3085
   445
[for cc_temp in $1""; do
slouken@3085
   446
  case $cc_temp in
slouken@3085
   447
    compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
slouken@3085
   448
    distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
slouken@3085
   449
    \-*) ;;
slouken@3085
   450
    *) break;;
slouken@3085
   451
  esac
slouken@3085
   452
done
slouken@3085
   453
cc_basename=`$ECHO "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
slouken@3085
   454
])
slouken@3085
   455
slouken@3085
   456
slouken@3085
   457
# _LT_FILEUTILS_DEFAULTS
slouken@3085
   458
# ----------------------
slouken@3085
   459
# It is okay to use these file commands and assume they have been set
slouken@3085
   460
# sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'.
slouken@3085
   461
m4_defun([_LT_FILEUTILS_DEFAULTS],
slouken@3085
   462
[: ${CP="cp -f"}
slouken@3085
   463
: ${MV="mv -f"}
slouken@3085
   464
: ${RM="rm -f"}
slouken@3085
   465
])# _LT_FILEUTILS_DEFAULTS
slouken@3085
   466
slouken@3085
   467
slouken@3085
   468
# _LT_SETUP
slouken@3085
   469
# ---------
slouken@3085
   470
m4_defun([_LT_SETUP],
slouken@3085
   471
[AC_REQUIRE([AC_CANONICAL_HOST])dnl
slouken@0
   472
AC_REQUIRE([AC_CANONICAL_BUILD])dnl
slouken@3085
   473
_LT_DECL([], [host_alias], [0], [The host system])dnl
slouken@3085
   474
_LT_DECL([], [host], [0])dnl
slouken@3085
   475
_LT_DECL([], [host_os], [0])dnl
slouken@3085
   476
dnl
slouken@3085
   477
_LT_DECL([], [build_alias], [0], [The build system])dnl
slouken@3085
   478
_LT_DECL([], [build], [0])dnl
slouken@3085
   479
_LT_DECL([], [build_os], [0])dnl
slouken@3085
   480
dnl
slouken@0
   481
AC_REQUIRE([AC_PROG_CC])dnl
slouken@3085
   482
AC_REQUIRE([LT_PATH_LD])dnl
slouken@3085
   483
AC_REQUIRE([LT_PATH_NM])dnl
slouken@3085
   484
dnl
slouken@0
   485
AC_REQUIRE([AC_PROG_LN_S])dnl
slouken@3085
   486
test -z "$LN_S" && LN_S="ln -s"
slouken@3085
   487
_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl
slouken@0
   488
dnl
slouken@3085
   489
AC_REQUIRE([LT_CMD_MAX_LEN])dnl
slouken@3085
   490
_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl
slouken@3085
   491
_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl
slouken@3085
   492
dnl
slouken@3085
   493
m4_require([_LT_FILEUTILS_DEFAULTS])dnl
slouken@3085
   494
m4_require([_LT_CHECK_SHELL_FEATURES])dnl
slouken@3085
   495
m4_require([_LT_CMD_RELOAD])dnl
slouken@3085
   496
m4_require([_LT_CHECK_MAGIC_METHOD])dnl
slouken@3085
   497
m4_require([_LT_CMD_OLD_ARCHIVE])dnl
slouken@3085
   498
m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
slouken@3085
   499
slouken@3085
   500
_LT_CONFIG_LIBTOOL_INIT([
slouken@3085
   501
# See if we are running on zsh, and set the options which allow our
slouken@3085
   502
# commands through without removal of \ escapes INIT.
slouken@3085
   503
if test -n "\${ZSH_VERSION+set}" ; then
slouken@3085
   504
   setopt NO_GLOB_SUBST
slouken@3085
   505
fi
slouken@3085
   506
])
slouken@3085
   507
if test -n "${ZSH_VERSION+set}" ; then
slouken@3085
   508
   setopt NO_GLOB_SUBST
slouken@3085
   509
fi
slouken@3085
   510
slouken@3085
   511
_LT_CHECK_OBJDIR
slouken@3085
   512
slouken@3085
   513
m4_require([_LT_TAG_COMPILER])dnl
slouken@3085
   514
_LT_PROG_ECHO_BACKSLASH
slouken@729
   515
slouken@729
   516
case $host_os in
slouken@729
   517
aix3*)
slouken@729
   518
  # AIX sometimes has problems with the GCC collect2 program.  For some
slouken@729
   519
  # reason, if we set the COLLECT_NAMES environment variable, the problems
slouken@729
   520
  # vanish in a puff of smoke.
slouken@729
   521
  if test "X${COLLECT_NAMES+set}" != Xset; then
slouken@729
   522
    COLLECT_NAMES=
slouken@729
   523
    export COLLECT_NAMES
slouken@729
   524
  fi
slouken@729
   525
  ;;
slouken@0
   526
esac
slouken@0
   527
slouken@729
   528
# Sed substitution that helps us do robust quoting.  It backslashifies
slouken@729
   529
# metacharacters that are still active within double-quoted strings.
slouken@3085
   530
sed_quote_subst='s/\([["`$\\]]\)/\\\1/g'
slouken@729
   531
slouken@729
   532
# Same as above, but do not quote variable references.
slouken@3085
   533
double_quote_subst='s/\([["`\\]]\)/\\\1/g'
slouken@729
   534
slouken@729
   535
# Sed substitution to delay expansion of an escaped shell variable in a
slouken@729
   536
# double_quote_subst'ed string.
slouken@729
   537
delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
slouken@729
   538
slouken@3085
   539
# Sed substitution to delay expansion of an escaped single quote.
slouken@3085
   540
delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
slouken@3085
   541
slouken@729
   542
# Sed substitution to avoid accidental globbing in evaled expressions
slouken@729
   543
no_glob_subst='s/\*/\\\*/g'
slouken@729
   544
slouken@729
   545
# Global variables:
slouken@3085
   546
ofile=libtool
slouken@729
   547
can_build_shared=yes
slouken@729
   548
slouken@1570
   549
# All known linkers require a `.a' archive for static linking (except MSVC,
slouken@729
   550
# which needs '.lib').
slouken@729
   551
libext=a
slouken@3085
   552
slouken@729
   553
with_gnu_ld="$lt_cv_prog_gnu_ld"
slouken@729
   554
slouken@729
   555
old_CC="$CC"
slouken@729
   556
old_CFLAGS="$CFLAGS"
slouken@729
   557
slouken@729
   558
# Set sane defaults for various variables
slouken@729
   559
test -z "$CC" && CC=cc
slouken@729
   560
test -z "$LTCC" && LTCC=$CC
slouken@1570
   561
test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
slouken@729
   562
test -z "$LD" && LD=ld
slouken@3085
   563
test -z "$ac_objext" && ac_objext=o
slouken@3085
   564
slouken@3085
   565
_LT_CC_BASENAME([$compiler])
slouken@3085
   566
slouken@3085
   567
# Only perform the check for file, if the check method requires it
slouken@729
   568
test -z "$MAGIC_CMD" && MAGIC_CMD=file
slouken@729
   569
case $deplibs_check_method in
slouken@729
   570
file_magic*)
slouken@729
   571
  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
slouken@3085
   572
    _LT_PATH_MAGIC
slouken@729
   573
  fi
slouken@729
   574
  ;;
slouken@729
   575
esac
slouken@729
   576
slouken@729
   577
# Use C for the default configuration in the libtool script
slouken@3085
   578
LT_SUPPORTED_TAG([CC])
slouken@3085
   579
_LT_LANG_C_CONFIG
slouken@3085
   580
_LT_LANG_DEFAULT_CONFIG
slouken@3085
   581
_LT_CONFIG_COMMANDS
slouken@3085
   582
])# _LT_SETUP
slouken@3085
   583
slouken@3085
   584
slouken@3085
   585
# _LT_PROG_LTMAIN
slouken@3085
   586
# ---------------
slouken@3085
   587
# Note that this code is called both from `configure', and `config.status'
slouken@3085
   588
# now that we use AC_CONFIG_COMMANDS to generate libtool.  Notably,
slouken@3085
   589
# `config.status' has no value for ac_aux_dir unless we are using Automake,
slouken@3085
   590
# so we pass a copy along to make sure it has a sensible value anyway.
slouken@3085
   591
m4_defun([_LT_PROG_LTMAIN],
slouken@3085
   592
[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl
slouken@3085
   593
_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir'])
slouken@3085
   594
ltmain="$ac_aux_dir/ltmain.sh"
slouken@3085
   595
])# _LT_PROG_LTMAIN
slouken@3085
   596
slouken@3085
   597
slouken@3085
   598
## ------------------------------------- ##
slouken@3085
   599
## Accumulate code for creating libtool. ##
slouken@3085
   600
## ------------------------------------- ##
slouken@3085
   601
slouken@3085
   602
# So that we can recreate a full libtool script including additional
slouken@3085
   603
# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS
slouken@3085
   604
# in macros and then make a single call at the end using the `libtool'
slouken@3085
   605
# label.
slouken@3085
   606
slouken@3085
   607
slouken@3085
   608
# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS])
slouken@3085
   609
# ----------------------------------------
slouken@3085
   610
# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later.
slouken@3085
   611
m4_define([_LT_CONFIG_LIBTOOL_INIT],
slouken@3085
   612
[m4_ifval([$1],
slouken@3085
   613
          [m4_append([_LT_OUTPUT_LIBTOOL_INIT],
slouken@3085
   614
                     [$1
slouken@3085
   615
])])])
slouken@3085
   616
slouken@3085
   617
# Initialize.
slouken@3085
   618
m4_define([_LT_OUTPUT_LIBTOOL_INIT])
slouken@3085
   619
slouken@3085
   620
slouken@3085
   621
# _LT_CONFIG_LIBTOOL([COMMANDS])
slouken@3085
   622
# ------------------------------
slouken@3085
   623
# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later.
slouken@3085
   624
m4_define([_LT_CONFIG_LIBTOOL],
slouken@3085
   625
[m4_ifval([$1],
slouken@3085
   626
          [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS],
slouken@3085
   627
                     [$1
slouken@3085
   628
])])])
slouken@3085
   629
slouken@3085
   630
# Initialize.
slouken@3085
   631
m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS])
slouken@3085
   632
slouken@3085
   633
slouken@3085
   634
# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS])
slouken@3085
   635
# -----------------------------------------------------
slouken@3085
   636
m4_defun([_LT_CONFIG_SAVE_COMMANDS],
slouken@3085
   637
[_LT_CONFIG_LIBTOOL([$1])
slouken@3085
   638
_LT_CONFIG_LIBTOOL_INIT([$2])
slouken@3085
   639
])
slouken@3085
   640
slouken@3085
   641
slouken@3085
   642
# _LT_FORMAT_COMMENT([COMMENT])
slouken@3085
   643
# -----------------------------
slouken@3085
   644
# Add leading comment marks to the start of each line, and a trailing
slouken@3085
   645
# full-stop to the whole comment if one is not present already.
slouken@3085
   646
m4_define([_LT_FORMAT_COMMENT],
slouken@3085
   647
[m4_ifval([$1], [
slouken@3085
   648
m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])],
slouken@3085
   649
              [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.])
slouken@3085
   650
)])
slouken@3085
   651
slouken@3085
   652
slouken@3085
   653
slouken@3085
   654
## ------------------------ ##
slouken@3085
   655
## FIXME: Eliminate VARNAME ##
slouken@3085
   656
## ------------------------ ##
slouken@3085
   657
slouken@3085
   658
slouken@3085
   659
# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?])
slouken@3085
   660
# -------------------------------------------------------------------
slouken@3085
   661
# CONFIGNAME is the name given to the value in the libtool script.
slouken@3085
   662
# VARNAME is the (base) name used in the configure script.
slouken@3085
   663
# VALUE may be 0, 1 or 2 for a computed quote escaped value based on
slouken@3085
   664
# VARNAME.  Any other value will be used directly.
slouken@3085
   665
m4_define([_LT_DECL],
slouken@3085
   666
[lt_if_append_uniq([lt_decl_varnames], [$2], [, ],
slouken@3085
   667
    [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name],
slouken@3085
   668
	[m4_ifval([$1], [$1], [$2])])
slouken@3085
   669
    lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3])
slouken@3085
   670
    m4_ifval([$4],
slouken@3085
   671
	[lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])])
slouken@3085
   672
    lt_dict_add_subkey([lt_decl_dict], [$2],
slouken@3085
   673
	[tagged?], [m4_ifval([$5], [yes], [no])])])
slouken@3085
   674
])
slouken@3085
   675
slouken@3085
   676
slouken@3085
   677
# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION])
slouken@3085
   678
# --------------------------------------------------------
slouken@3085
   679
m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])])
slouken@3085
   680
slouken@3085
   681
slouken@3085
   682
# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...])
slouken@3085
   683
# ------------------------------------------------
slouken@3085
   684
m4_define([lt_decl_tag_varnames],
slouken@3085
   685
[_lt_decl_filter([tagged?], [yes], $@)])
slouken@3085
   686
slouken@3085
   687
slouken@3085
   688
# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..])
slouken@3085
   689
# ---------------------------------------------------------
slouken@3085
   690
m4_define([_lt_decl_filter],
slouken@3085
   691
[m4_case([$#],
slouken@3085
   692
  [0], [m4_fatal([$0: too few arguments: $#])],
slouken@3085
   693
  [1], [m4_fatal([$0: too few arguments: $#: $1])],
slouken@3085
   694
  [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)],
slouken@3085
   695
  [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)],
slouken@3085
   696
  [lt_dict_filter([lt_decl_dict], $@)])[]dnl
slouken@3085
   697
])
slouken@3085
   698
slouken@3085
   699
slouken@3085
   700
# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...])
slouken@3085
   701
# --------------------------------------------------
slouken@3085
   702
m4_define([lt_decl_quote_varnames],
slouken@3085
   703
[_lt_decl_filter([value], [1], $@)])
slouken@3085
   704
slouken@3085
   705
slouken@3085
   706
# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...])
slouken@3085
   707
# ---------------------------------------------------
slouken@3085
   708
m4_define([lt_decl_dquote_varnames],
slouken@3085
   709
[_lt_decl_filter([value], [2], $@)])
slouken@3085
   710
slouken@3085
   711
slouken@3085
   712
# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...])
slouken@3085
   713
# ---------------------------------------------------
slouken@3085
   714
m4_define([lt_decl_varnames_tagged],
slouken@3085
   715
[m4_assert([$# <= 2])dnl
slouken@3085
   716
_$0(m4_quote(m4_default([$1], [[, ]])),
slouken@3085
   717
    m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]),
slouken@3085
   718
    m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))])
slouken@3085
   719
m4_define([_lt_decl_varnames_tagged],
slouken@3085
   720
[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])])
slouken@3085
   721
slouken@3085
   722
slouken@3085
   723
# lt_decl_all_varnames([SEPARATOR], [VARNAME1...])
slouken@3085
   724
# ------------------------------------------------
slouken@3085
   725
m4_define([lt_decl_all_varnames],
slouken@3085
   726
[_$0(m4_quote(m4_default([$1], [[, ]])),
slouken@3085
   727
     m4_if([$2], [],
slouken@3085
   728
	   m4_quote(lt_decl_varnames),
slouken@3085
   729
	m4_quote(m4_shift($@))))[]dnl
slouken@3085
   730
])
slouken@3085
   731
m4_define([_lt_decl_all_varnames],
slouken@3085
   732
[lt_join($@, lt_decl_varnames_tagged([$1],
slouken@3085
   733
			lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl
slouken@3085
   734
])
slouken@3085
   735
slouken@3085
   736
slouken@3085
   737
# _LT_CONFIG_STATUS_DECLARE([VARNAME])
slouken@3085
   738
# ------------------------------------
slouken@3085
   739
# Quote a variable value, and forward it to `config.status' so that its
slouken@3085
   740
# declaration there will have the same value as in `configure'.  VARNAME
slouken@3085
   741
# must have a single quote delimited value for this to work.
slouken@3085
   742
m4_define([_LT_CONFIG_STATUS_DECLARE],
slouken@3085
   743
[$1='`$ECHO "X$][$1" | $Xsed -e "$delay_single_quote_subst"`'])
slouken@3085
   744
slouken@3085
   745
slouken@3085
   746
# _LT_CONFIG_STATUS_DECLARATIONS
slouken@3085
   747
# ------------------------------
slouken@3085
   748
# We delimit libtool config variables with single quotes, so when
slouken@3085
   749
# we write them to config.status, we have to be sure to quote all
slouken@3085
   750
# embedded single quotes properly.  In configure, this macro expands
slouken@3085
   751
# each variable declared with _LT_DECL (and _LT_TAGDECL) into:
slouken@3085
   752
#
slouken@3085
   753
#    <var>='`$ECHO "X$<var>" | $Xsed -e "$delay_single_quote_subst"`'
slouken@3085
   754
m4_defun([_LT_CONFIG_STATUS_DECLARATIONS],
slouken@3085
   755
[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames),
slouken@3085
   756
    [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])])
slouken@3085
   757
slouken@3085
   758
slouken@3085
   759
# _LT_LIBTOOL_TAGS
slouken@3085
   760
# ----------------
slouken@3085
   761
# Output comment and list of tags supported by the script
slouken@3085
   762
m4_defun([_LT_LIBTOOL_TAGS],
slouken@3085
   763
[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl
slouken@3085
   764
available_tags="_LT_TAGS"dnl
slouken@3085
   765
])
slouken@3085
   766
slouken@3085
   767
slouken@3085
   768
# _LT_LIBTOOL_DECLARE(VARNAME, [TAG])
slouken@3085
   769
# -----------------------------------
slouken@3085
   770
# Extract the dictionary values for VARNAME (optionally with TAG) and
slouken@3085
   771
# expand to a commented shell variable setting:
slouken@3085
   772
#
slouken@3085
   773
#    # Some comment about what VAR is for.
slouken@3085
   774
#    visible_name=$lt_internal_name
slouken@3085
   775
m4_define([_LT_LIBTOOL_DECLARE],
slouken@3085
   776
[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1],
slouken@3085
   777
					   [description])))[]dnl
slouken@3085
   778
m4_pushdef([_libtool_name],
slouken@3085
   779
    m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl
slouken@3085
   780
m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])),
slouken@3085
   781
    [0], [_libtool_name=[$]$1],
slouken@3085
   782
    [1], [_libtool_name=$lt_[]$1],
slouken@3085
   783
    [2], [_libtool_name=$lt_[]$1],
slouken@3085
   784
    [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl
slouken@3085
   785
m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl
slouken@3085
   786
])
slouken@3085
   787
slouken@3085
   788
slouken@3085
   789
# _LT_LIBTOOL_CONFIG_VARS
slouken@3085
   790
# -----------------------
slouken@3085
   791
# Produce commented declarations of non-tagged libtool config variables
slouken@3085
   792
# suitable for insertion in the LIBTOOL CONFIG section of the `libtool'
slouken@3085
   793
# script.  Tagged libtool config variables (even for the LIBTOOL CONFIG
slouken@3085
   794
# section) are produced by _LT_LIBTOOL_TAG_VARS.
slouken@3085
   795
m4_defun([_LT_LIBTOOL_CONFIG_VARS],
slouken@3085
   796
[m4_foreach([_lt_var],
slouken@3085
   797
    m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)),
slouken@3085
   798
    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])])
slouken@3085
   799
slouken@3085
   800
slouken@3085
   801
# _LT_LIBTOOL_TAG_VARS(TAG)
slouken@3085
   802
# -------------------------
slouken@3085
   803
m4_define([_LT_LIBTOOL_TAG_VARS],
slouken@3085
   804
[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames),
slouken@3085
   805
    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])])
slouken@3085
   806
slouken@3085
   807
slouken@3085
   808
# _LT_TAGVAR(VARNAME, [TAGNAME])
slouken@3085
   809
# ------------------------------
slouken@3085
   810
m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])])
slouken@3085
   811
slouken@3085
   812
slouken@3085
   813
# _LT_CONFIG_COMMANDS
slouken@729
   814
# -------------------
slouken@3085
   815
# Send accumulated output to $CONFIG_STATUS.  Thanks to the lists of
slouken@3085
   816
# variables for single and double quote escaping we saved from calls
slouken@3085
   817
# to _LT_DECL, we can put quote escaped variables declarations
slouken@3085
   818
# into `config.status', and then the shell code to quote escape them in
slouken@3085
   819
# for loops in `config.status'.  Finally, any additional code accumulated
slouken@3085
   820
# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded.
slouken@3085
   821
m4_defun([_LT_CONFIG_COMMANDS],
slouken@3085
   822
[AC_PROVIDE_IFELSE([LT_OUTPUT],
slouken@3085
   823
	dnl If the libtool generation code has been placed in $CONFIG_LT,
slouken@3085
   824
	dnl instead of duplicating it all over again into config.status,
slouken@3085
   825
	dnl then we will have config.status run $CONFIG_LT later, so it
slouken@3085
   826
	dnl needs to know what name is stored there:
slouken@3085
   827
        [AC_CONFIG_COMMANDS([libtool],
slouken@3085
   828
            [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])],
slouken@3085
   829
    dnl If the libtool generation code is destined for config.status,
slouken@3085
   830
    dnl expand the accumulated commands and init code now:
slouken@3085
   831
    [AC_CONFIG_COMMANDS([libtool],
slouken@3085
   832
        [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])])
slouken@3085
   833
])#_LT_CONFIG_COMMANDS
slouken@3085
   834
slouken@3085
   835
slouken@3085
   836
# Initialize.
slouken@3085
   837
m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT],
slouken@3085
   838
[
slouken@3085
   839
slouken@3085
   840
# The HP-UX ksh and POSIX shell print the target directory to stdout
slouken@3085
   841
# if CDPATH is set.
slouken@3085
   842
(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
slouken@3085
   843
slouken@3085
   844
sed_quote_subst='$sed_quote_subst'
slouken@3085
   845
double_quote_subst='$double_quote_subst'
slouken@3085
   846
delay_variable_subst='$delay_variable_subst'
slouken@3085
   847
_LT_CONFIG_STATUS_DECLARATIONS
slouken@3085
   848
LTCC='$LTCC'
slouken@3085
   849
LTCFLAGS='$LTCFLAGS'
slouken@3085
   850
compiler='$compiler_DEFAULT'
slouken@3085
   851
slouken@3085
   852
# Quote evaled strings.
slouken@3085
   853
for var in lt_decl_all_varnames([[ \
slouken@3085
   854
]], lt_decl_quote_varnames); do
slouken@3085
   855
    case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in
slouken@3085
   856
    *[[\\\\\\\`\\"\\\$]]*)
slouken@3085
   857
      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
slouken@3085
   858
      ;;
slouken@3085
   859
    *)
slouken@3085
   860
      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
slouken@3085
   861
      ;;
slouken@3085
   862
    esac
slouken@3085
   863
done
slouken@3085
   864
slouken@3085
   865
# Double-quote double-evaled strings.
slouken@3085
   866
for var in lt_decl_all_varnames([[ \
slouken@3085
   867
]], lt_decl_dquote_varnames); do
slouken@3085
   868
    case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in
slouken@3085
   869
    *[[\\\\\\\`\\"\\\$]]*)
slouken@3085
   870
      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
slouken@3085
   871
      ;;
slouken@3085
   872
    *)
slouken@3085
   873
      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
slouken@3085
   874
      ;;
slouken@3085
   875
    esac
slouken@3085
   876
done
slouken@3085
   877
slouken@3085
   878
# Fix-up fallback echo if it was mangled by the above quoting rules.
slouken@3085
   879
case \$lt_ECHO in
slouken@3085
   880
*'\\\[$]0 --fallback-echo"')dnl "
slouken@3085
   881
  lt_ECHO=\`\$ECHO "X\$lt_ECHO" | \$Xsed -e 's/\\\\\\\\\\\\\\\[$]0 --fallback-echo"\[$]/\[$]0 --fallback-echo"/'\`
slouken@3085
   882
  ;;
slouken@3085
   883
esac
slouken@3085
   884
slouken@3085
   885
_LT_OUTPUT_LIBTOOL_INIT
slouken@3085
   886
])
slouken@3085
   887
slouken@3085
   888
slouken@3085
   889
# LT_OUTPUT
slouken@3085
   890
# ---------
slouken@3085
   891
# This macro allows early generation of the libtool script (before
slouken@3085
   892
# AC_OUTPUT is called), incase it is used in configure for compilation
slouken@3085
   893
# tests.
slouken@3085
   894
AC_DEFUN([LT_OUTPUT],
slouken@3085
   895
[: ${CONFIG_LT=./config.lt}
slouken@3085
   896
AC_MSG_NOTICE([creating $CONFIG_LT])
slouken@3085
   897
cat >"$CONFIG_LT" <<_LTEOF
slouken@3085
   898
#! $SHELL
slouken@3085
   899
# Generated by $as_me.
slouken@3085
   900
# Run this file to recreate a libtool stub with the current configuration.
slouken@3085
   901
slouken@3085
   902
lt_cl_silent=false
slouken@3085
   903
SHELL=\${CONFIG_SHELL-$SHELL}
slouken@3085
   904
_LTEOF
slouken@3085
   905
slouken@3085
   906
cat >>"$CONFIG_LT" <<\_LTEOF
slouken@3085
   907
AS_SHELL_SANITIZE
slouken@3085
   908
_AS_PREPARE
slouken@3085
   909
slouken@3085
   910
exec AS_MESSAGE_FD>&1
slouken@3085
   911
exec AS_MESSAGE_LOG_FD>>config.log
slouken@3085
   912
{
slouken@3085
   913
  echo
slouken@3085
   914
  AS_BOX([Running $as_me.])
slouken@3085
   915
} >&AS_MESSAGE_LOG_FD
slouken@3085
   916
slouken@3085
   917
lt_cl_help="\
slouken@3085
   918
\`$as_me' creates a local libtool stub from the current configuration,
slouken@3085
   919
for use in further configure time tests before the real libtool is
slouken@3085
   920
generated.
slouken@3085
   921
slouken@3085
   922
Usage: $[0] [[OPTIONS]]
slouken@3085
   923
slouken@3085
   924
  -h, --help      print this help, then exit
slouken@3085
   925
  -V, --version   print version number, then exit
slouken@3085
   926
  -q, --quiet     do not print progress messages
slouken@3085
   927
  -d, --debug     don't remove temporary files
slouken@3085
   928
slouken@3085
   929
Report bugs to <bug-libtool@gnu.org>."
slouken@3085
   930
slouken@3085
   931
lt_cl_version="\
slouken@3085
   932
m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl
slouken@3085
   933
m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])
slouken@3085
   934
configured by $[0], generated by m4_PACKAGE_STRING.
slouken@3085
   935
slouken@3085
   936
Copyright (C) 2008 Free Software Foundation, Inc.
slouken@3085
   937
This config.lt script is free software; the Free Software Foundation
slouken@3085
   938
gives unlimited permision to copy, distribute and modify it."
slouken@3085
   939
slouken@3085
   940
while test $[#] != 0
slouken@3085
   941
do
slouken@3085
   942
  case $[1] in
slouken@3085
   943
    --version | --v* | -V )
slouken@3085
   944
      echo "$lt_cl_version"; exit 0 ;;
slouken@3085
   945
    --help | --h* | -h )
slouken@3085
   946
      echo "$lt_cl_help"; exit 0 ;;
slouken@3085
   947
    --debug | --d* | -d )
slouken@3085
   948
      debug=: ;;
slouken@3085
   949
    --quiet | --q* | --silent | --s* | -q )
slouken@3085
   950
      lt_cl_silent=: ;;
slouken@3085
   951
slouken@3085
   952
    -*) AC_MSG_ERROR([unrecognized option: $[1]
slouken@3085
   953
Try \`$[0] --help' for more information.]) ;;
slouken@3085
   954
slouken@3085
   955
    *) AC_MSG_ERROR([unrecognized argument: $[1]
slouken@3085
   956
Try \`$[0] --help' for more information.]) ;;
slouken@3085
   957
  esac
slouken@3085
   958
  shift
slouken@3085
   959
done
slouken@3085
   960
slouken@3085
   961
if $lt_cl_silent; then
slouken@3085
   962
  exec AS_MESSAGE_FD>/dev/null
slouken@3085
   963
fi
slouken@3085
   964
_LTEOF
slouken@3085
   965
slouken@3085
   966
cat >>"$CONFIG_LT" <<_LTEOF
slouken@3085
   967
_LT_OUTPUT_LIBTOOL_COMMANDS_INIT
slouken@3085
   968
_LTEOF
slouken@3085
   969
slouken@3085
   970
cat >>"$CONFIG_LT" <<\_LTEOF
slouken@3085
   971
AC_MSG_NOTICE([creating $ofile])
slouken@3085
   972
_LT_OUTPUT_LIBTOOL_COMMANDS
slouken@3085
   973
AS_EXIT(0)
slouken@3085
   974
_LTEOF
slouken@3085
   975
chmod +x "$CONFIG_LT"
slouken@3085
   976
slouken@3085
   977
# configure is writing to config.log, but config.lt does its own redirection,
slouken@3085
   978
# appending to config.log, which fails on DOS, as config.log is still kept
slouken@3085
   979
# open by configure.  Here we exec the FD to /dev/null, effectively closing
slouken@3085
   980
# config.log, so it can be properly (re)opened and appended to by config.lt.
slouken@3085
   981
if test "$no_create" != yes; then
slouken@3085
   982
  lt_cl_success=:
slouken@3085
   983
  test "$silent" = yes &&
slouken@3085
   984
    lt_config_lt_args="$lt_config_lt_args --quiet"
slouken@3085
   985
  exec AS_MESSAGE_LOG_FD>/dev/null
slouken@3085
   986
  $SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false
slouken@3085
   987
  exec AS_MESSAGE_LOG_FD>>config.log
slouken@3085
   988
  $lt_cl_success || AS_EXIT(1)
slouken@3085
   989
fi
slouken@3085
   990
])# LT_OUTPUT
slouken@3085
   991
slouken@3085
   992
slouken@3085
   993
# _LT_CONFIG(TAG)
slouken@3085
   994
# ---------------
slouken@3085
   995
# If TAG is the built-in tag, create an initial libtool script with a
slouken@3085
   996
# default configuration from the untagged config vars.  Otherwise add code
slouken@3085
   997
# to config.status for appending the configuration named by TAG from the
slouken@3085
   998
# matching tagged config vars.
slouken@3085
   999
m4_defun([_LT_CONFIG],
slouken@3085
  1000
[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
slouken@3085
  1001
_LT_CONFIG_SAVE_COMMANDS([
slouken@3085
  1002
  m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl
slouken@3085
  1003
  m4_if(_LT_TAG, [C], [
slouken@3085
  1004
    # See if we are running on zsh, and set the options which allow our
slouken@3085
  1005
    # commands through without removal of \ escapes.
slouken@3085
  1006
    if test -n "${ZSH_VERSION+set}" ; then
slouken@3085
  1007
      setopt NO_GLOB_SUBST
slouken@3085
  1008
    fi
slouken@3085
  1009
slouken@3085
  1010
    cfgfile="${ofile}T"
slouken@3085
  1011
    trap "$RM \"$cfgfile\"; exit 1" 1 2 15
slouken@3085
  1012
    $RM "$cfgfile"
slouken@3085
  1013
slouken@3085
  1014
    cat <<_LT_EOF >> "$cfgfile"
slouken@3085
  1015
#! $SHELL
slouken@3085
  1016
slouken@3085
  1017
# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
slouken@3085
  1018
# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION
slouken@3085
  1019
# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
slouken@3085
  1020
# NOTE: Changes made to this file will be lost: look at ltmain.sh.
slouken@3085
  1021
#
slouken@3085
  1022
_LT_COPYING
slouken@3085
  1023
_LT_LIBTOOL_TAGS
slouken@3085
  1024
slouken@3085
  1025
# ### BEGIN LIBTOOL CONFIG
slouken@3085
  1026
_LT_LIBTOOL_CONFIG_VARS
slouken@3085
  1027
_LT_LIBTOOL_TAG_VARS
slouken@3085
  1028
# ### END LIBTOOL CONFIG
slouken@3085
  1029
slouken@3085
  1030
_LT_EOF
slouken@3085
  1031
slouken@3085
  1032
  case $host_os in
slouken@3085
  1033
  aix3*)
slouken@3085
  1034
    cat <<\_LT_EOF >> "$cfgfile"
slouken@3085
  1035
# AIX sometimes has problems with the GCC collect2 program.  For some
slouken@3085
  1036
# reason, if we set the COLLECT_NAMES environment variable, the problems
slouken@3085
  1037
# vanish in a puff of smoke.
slouken@3085
  1038
if test "X${COLLECT_NAMES+set}" != Xset; then
slouken@3085
  1039
  COLLECT_NAMES=
slouken@3085
  1040
  export COLLECT_NAMES
slouken@3085
  1041
fi
slouken@3085
  1042
_LT_EOF
slouken@3085
  1043
    ;;
slouken@3085
  1044
  esac
slouken@3085
  1045
slouken@3085
  1046
  _LT_PROG_LTMAIN
slouken@3085
  1047
slouken@3085
  1048
  # We use sed instead of cat because bash on DJGPP gets confused if
slouken@3085
  1049
  # if finds mixed CR/LF and LF-only lines.  Since sed operates in
slouken@3085
  1050
  # text mode, it properly converts lines to CR/LF.  This bash problem
slouken@3085
  1051
  # is reportedly fixed, but why not run on old versions too?
slouken@3085
  1052
  sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \
slouken@3085
  1053
    || (rm -f "$cfgfile"; exit 1)
slouken@3085
  1054
slouken@3085
  1055
  _LT_PROG_XSI_SHELLFNS
slouken@3085
  1056
slouken@3085
  1057
  sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \
slouken@3085
  1058
    || (rm -f "$cfgfile"; exit 1)
slouken@3085
  1059
slouken@3085
  1060
  mv -f "$cfgfile" "$ofile" ||
slouken@3085
  1061
    (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
slouken@3085
  1062
  chmod +x "$ofile"
slouken@3085
  1063
],
slouken@3085
  1064
[cat <<_LT_EOF >> "$ofile"
slouken@3085
  1065
slouken@3085
  1066
dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded
slouken@3085
  1067
dnl in a comment (ie after a #).
slouken@3085
  1068
# ### BEGIN LIBTOOL TAG CONFIG: $1
slouken@3085
  1069
_LT_LIBTOOL_TAG_VARS(_LT_TAG)
slouken@3085
  1070
# ### END LIBTOOL TAG CONFIG: $1
slouken@3085
  1071
_LT_EOF
slouken@3085
  1072
])dnl /m4_if
slouken@3085
  1073
],
slouken@3085
  1074
[m4_if([$1], [], [
slouken@3085
  1075
    PACKAGE='$PACKAGE'
slouken@3085
  1076
    VERSION='$VERSION'
slouken@3085
  1077
    TIMESTAMP='$TIMESTAMP'
slouken@3085
  1078
    RM='$RM'
slouken@3085
  1079
    ofile='$ofile'], [])
slouken@3085
  1080
])dnl /_LT_CONFIG_SAVE_COMMANDS
slouken@3085
  1081
])# _LT_CONFIG
slouken@3085
  1082
slouken@3085
  1083
slouken@3085
  1084
# LT_SUPPORTED_TAG(TAG)
slouken@3085
  1085
# ---------------------
slouken@3085
  1086
# Trace this macro to discover what tags are supported by the libtool
slouken@3085
  1087
# --tag option, using:
slouken@3085
  1088
#    autoconf --trace 'LT_SUPPORTED_TAG:$1'
slouken@3085
  1089
AC_DEFUN([LT_SUPPORTED_TAG], [])
slouken@3085
  1090
slouken@3085
  1091
slouken@3085
  1092
# C support is built-in for now
slouken@3085
  1093
m4_define([_LT_LANG_C_enabled], [])
slouken@3085
  1094
m4_define([_LT_TAGS], [])
slouken@3085
  1095
slouken@3085
  1096
slouken@3085
  1097
# LT_LANG(LANG)
slouken@3085
  1098
# -------------
slouken@3085
  1099
# Enable libtool support for the given language if not already enabled.
slouken@3085
  1100
AC_DEFUN([LT_LANG],
slouken@3085
  1101
[AC_BEFORE([$0], [LT_OUTPUT])dnl
slouken@3085
  1102
m4_case([$1],
slouken@3085
  1103
  [C],			[_LT_LANG(C)],
slouken@3085
  1104
  [C++],		[_LT_LANG(CXX)],
slouken@3085
  1105
  [Java],		[_LT_LANG(GCJ)],
slouken@3085
  1106
  [Fortran 77],		[_LT_LANG(F77)],
slouken@3085
  1107
  [Fortran],		[_LT_LANG(FC)],
slouken@3085
  1108
  [Windows Resource],	[_LT_LANG(RC)],
slouken@3085
  1109
  [m4_ifdef([_LT_LANG_]$1[_CONFIG],
slouken@3085
  1110
    [_LT_LANG($1)],
slouken@3085
  1111
    [m4_fatal([$0: unsupported language: "$1"])])])dnl
slouken@3085
  1112
])# LT_LANG
slouken@3085
  1113
slouken@3085
  1114
slouken@3085
  1115
# _LT_LANG(LANGNAME)
slouken@3085
  1116
# ------------------
slouken@3085
  1117
m4_defun([_LT_LANG],
slouken@3085
  1118
[m4_ifdef([_LT_LANG_]$1[_enabled], [],
slouken@3085
  1119
  [LT_SUPPORTED_TAG([$1])dnl
slouken@3085
  1120
  m4_append([_LT_TAGS], [$1 ])dnl
slouken@3085
  1121
  m4_define([_LT_LANG_]$1[_enabled], [])dnl
slouken@3085
  1122
  _LT_LANG_$1_CONFIG($1)])dnl
slouken@3085
  1123
])# _LT_LANG
slouken@3085
  1124
slouken@3085
  1125
slouken@3085
  1126
# _LT_LANG_DEFAULT_CONFIG
slouken@3085
  1127
# -----------------------
slouken@3085
  1128
m4_defun([_LT_LANG_DEFAULT_CONFIG],
slouken@3085
  1129
[AC_PROVIDE_IFELSE([AC_PROG_CXX],
slouken@3085
  1130
  [LT_LANG(CXX)],
slouken@3085
  1131
  [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])])
slouken@3085
  1132
slouken@3085
  1133
AC_PROVIDE_IFELSE([AC_PROG_F77],
slouken@3085
  1134
  [LT_LANG(F77)],
slouken@3085
  1135
  [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])])
slouken@3085
  1136
slouken@3085
  1137
AC_PROVIDE_IFELSE([AC_PROG_FC],
slouken@3085
  1138
  [LT_LANG(FC)],
slouken@3085
  1139
  [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])])
slouken@3085
  1140
slouken@3085
  1141
dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal
slouken@3085
  1142
dnl pulling things in needlessly.
slouken@3085
  1143
AC_PROVIDE_IFELSE([AC_PROG_GCJ],
slouken@3085
  1144
  [LT_LANG(GCJ)],
slouken@3085
  1145
  [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
slouken@3085
  1146
    [LT_LANG(GCJ)],
slouken@3085
  1147
    [AC_PROVIDE_IFELSE([LT_PROG_GCJ],
slouken@3085
  1148
      [LT_LANG(GCJ)],
slouken@3085
  1149
      [m4_ifdef([AC_PROG_GCJ],
slouken@3085
  1150
	[m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])])
slouken@3085
  1151
       m4_ifdef([A][M_PROG_GCJ],
slouken@3085
  1152
	[m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])])
slouken@3085
  1153
       m4_ifdef([LT_PROG_GCJ],
slouken@3085
  1154
	[m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])])
slouken@3085
  1155
slouken@3085
  1156
AC_PROVIDE_IFELSE([LT_PROG_RC],
slouken@3085
  1157
  [LT_LANG(RC)],
slouken@3085
  1158
  [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])])
slouken@3085
  1159
])# _LT_LANG_DEFAULT_CONFIG
slouken@3085
  1160
slouken@3085
  1161
# Obsolete macros:
slouken@3085
  1162
AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)])
slouken@3085
  1163
AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)])
slouken@3085
  1164
AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)])
slouken@3085
  1165
AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)])
slouken@3085
  1166
dnl aclocal-1.4 backwards compatibility:
slouken@3085
  1167
dnl AC_DEFUN([AC_LIBTOOL_CXX], [])
slouken@3085
  1168
dnl AC_DEFUN([AC_LIBTOOL_F77], [])
slouken@3085
  1169
dnl AC_DEFUN([AC_LIBTOOL_FC], [])
slouken@3085
  1170
dnl AC_DEFUN([AC_LIBTOOL_GCJ], [])
slouken@3085
  1171
slouken@3085
  1172
slouken@3085
  1173
# _LT_TAG_COMPILER
slouken@3085
  1174
# ----------------
slouken@3085
  1175
m4_defun([_LT_TAG_COMPILER],
slouken@729
  1176
[AC_REQUIRE([AC_PROG_CC])dnl
slouken@729
  1177
slouken@3085
  1178
_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl
slouken@3085
  1179
_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl
slouken@3085
  1180
_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl
slouken@3085
  1181
_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl
slouken@3085
  1182
slouken@729
  1183
# If no C compiler was specified, use CC.
slouken@729
  1184
LTCC=${LTCC-"$CC"}
slouken@729
  1185
slouken@1570
  1186
# If no C compiler flags were specified, use CFLAGS.
slouken@1570
  1187
LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
slouken@1570
  1188
slouken@729
  1189
# Allow CC to be a program name with arguments.
slouken@729
  1190
compiler=$CC
slouken@3085
  1191
])# _LT_TAG_COMPILER
slouken@1570
  1192
slouken@1570
  1193
slouken@1570
  1194
# _LT_COMPILER_BOILERPLATE
slouken@1570
  1195
# ------------------------
slouken@1570
  1196
# Check for compiler boilerplate output or warnings with
slouken@1570
  1197
# the simple compiler test code.
slouken@3085
  1198
m4_defun([_LT_COMPILER_BOILERPLATE],
slouken@3085
  1199
[m4_require([_LT_DECL_SED])dnl
slouken@3085
  1200
ac_outfile=conftest.$ac_objext
slouken@3085
  1201
echo "$lt_simple_compile_test_code" >conftest.$ac_ext
slouken@1570
  1202
eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
slouken@1570
  1203
_lt_compiler_boilerplate=`cat conftest.err`
slouken@3085
  1204
$RM conftest*
slouken@1570
  1205
])# _LT_COMPILER_BOILERPLATE
slouken@1570
  1206
slouken@1570
  1207
slouken@1570
  1208
# _LT_LINKER_BOILERPLATE
slouken@1570
  1209
# ----------------------
slouken@1570
  1210
# Check for linker boilerplate output or warnings with
slouken@1570
  1211
# the simple link test code.
slouken@3085
  1212
m4_defun([_LT_LINKER_BOILERPLATE],
slouken@3085
  1213
[m4_require([_LT_DECL_SED])dnl
slouken@3085
  1214
ac_outfile=conftest.$ac_objext
slouken@3085
  1215
echo "$lt_simple_link_test_code" >conftest.$ac_ext
slouken@1570
  1216
eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
slouken@1570
  1217
_lt_linker_boilerplate=`cat conftest.err`
slouken@3085
  1218
$RM -r conftest*
slouken@1570
  1219
])# _LT_LINKER_BOILERPLATE
slouken@1570
  1220
slouken@3085
  1221
# _LT_REQUIRED_DARWIN_CHECKS
slouken@3085
  1222
# -------------------------
slouken@3085
  1223
m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
slouken@3085
  1224
  case $host_os in
slouken@3085
  1225
    rhapsody* | darwin*)
slouken@3085
  1226
    AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:])
slouken@3085
  1227
    AC_CHECK_TOOL([NMEDIT], [nmedit], [:])
slouken@3085
  1228
    AC_CHECK_TOOL([LIPO], [lipo], [:])
slouken@3085
  1229
    AC_CHECK_TOOL([OTOOL], [otool], [:])
slouken@3085
  1230
    AC_CHECK_TOOL([OTOOL64], [otool64], [:])
slouken@3085
  1231
    _LT_DECL([], [DSYMUTIL], [1],
slouken@3085
  1232
      [Tool to manipulate archived DWARF debug symbol files on Mac OS X])
slouken@3085
  1233
    _LT_DECL([], [NMEDIT], [1],
slouken@3085
  1234
      [Tool to change global to local symbols on Mac OS X])
slouken@3085
  1235
    _LT_DECL([], [LIPO], [1],
slouken@3085
  1236
      [Tool to manipulate fat objects and archives on Mac OS X])
slouken@3085
  1237
    _LT_DECL([], [OTOOL], [1],
slouken@3085
  1238
      [ldd/readelf like tool for Mach-O binaries on Mac OS X])
slouken@3085
  1239
    _LT_DECL([], [OTOOL64], [1],
slouken@3085
  1240
      [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4])
slouken@3085
  1241
slouken@3085
  1242
    AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod],
slouken@3085
  1243
      [lt_cv_apple_cc_single_mod=no
slouken@3085
  1244
      if test -z "${LT_MULTI_MODULE}"; then
slouken@3085
  1245
	# By default we will add the -single_module flag. You can override
slouken@3085
  1246
	# by either setting the environment variable LT_MULTI_MODULE
slouken@3085
  1247
	# non-empty at configure time, or by adding -multi_module to the
slouken@3085
  1248
	# link flags.
slouken@3085
  1249
	rm -rf libconftest.dylib*
slouken@3085
  1250
	echo "int foo(void){return 1;}" > conftest.c
slouken@3085
  1251
	echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
slouken@3085
  1252
-dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD
slouken@3085
  1253
	$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
slouken@3085
  1254
	  -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
slouken@3085
  1255
        _lt_result=$?
slouken@3085
  1256
	if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then
slouken@3085
  1257
	  lt_cv_apple_cc_single_mod=yes
slouken@3085
  1258
	else
slouken@3085
  1259
	  cat conftest.err >&AS_MESSAGE_LOG_FD
slouken@3085
  1260
	fi
slouken@3085
  1261
	rm -rf libconftest.dylib*
slouken@3085
  1262
	rm -f conftest.*
slouken@3085
  1263
      fi])
slouken@3085
  1264
    AC_CACHE_CHECK([for -exported_symbols_list linker flag],
slouken@3085
  1265
      [lt_cv_ld_exported_symbols_list],
slouken@3085
  1266
      [lt_cv_ld_exported_symbols_list=no
slouken@3085
  1267
      save_LDFLAGS=$LDFLAGS
slouken@3085
  1268
      echo "_main" > conftest.sym
slouken@3085
  1269
      LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
slouken@3085
  1270
      AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
slouken@3085
  1271
	[lt_cv_ld_exported_symbols_list=yes],
slouken@3085
  1272
	[lt_cv_ld_exported_symbols_list=no])
slouken@3085
  1273
	LDFLAGS="$save_LDFLAGS"
slouken@3085
  1274
    ])
slouken@3085
  1275
    case $host_os in
slouken@3085
  1276
    rhapsody* | darwin1.[[012]])
slouken@3085
  1277
      _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
slouken@3085
  1278
    darwin1.*)
slouken@3085
  1279
      _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
slouken@3085
  1280
    darwin*) # darwin 5.x on
slouken@3085
  1281
      # if running on 10.5 or later, the deployment target defaults
slouken@3085
  1282
      # to the OS version, if on x86, and 10.4, the deployment
slouken@3085
  1283
      # target defaults to 10.4. Don't you love it?
slouken@3085
  1284
      case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
slouken@3085
  1285
	10.0,*86*-darwin8*|10.0,*-darwin[[91]]*)
slouken@3085
  1286
	  _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
slouken@3085
  1287
	10.[[012]]*)
slouken@3085
  1288
	  _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
slouken@3085
  1289
	10.*)
slouken@3085
  1290
	  _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
slouken@3085
  1291
      esac
slouken@3085
  1292
    ;;
slouken@3085
  1293
  esac
slouken@3085
  1294
    if test "$lt_cv_apple_cc_single_mod" = "yes"; then
slouken@3085
  1295
      _lt_dar_single_mod='$single_module'
slouken@3085
  1296
    fi
slouken@3085
  1297
    if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
slouken@3085
  1298
      _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
slouken@3085
  1299
    else
slouken@3085
  1300
      _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
slouken@3085
  1301
    fi
slouken@3085
  1302
    if test "$DSYMUTIL" != ":"; then
slouken@3085
  1303
      _lt_dsymutil='~$DSYMUTIL $lib || :'
slouken@3085
  1304
    else
slouken@3085
  1305
      _lt_dsymutil=
slouken@3085
  1306
    fi
slouken@3085
  1307
    ;;
slouken@3085
  1308
  esac
slouken@3085
  1309
])
slouken@3085
  1310
slouken@3085
  1311
slouken@3085
  1312
# _LT_DARWIN_LINKER_FEATURES
slouken@3085
  1313
# --------------------------
slouken@3085
  1314
# Checks for linker and compiler features on darwin
slouken@3085
  1315
m4_defun([_LT_DARWIN_LINKER_FEATURES],
slouken@3085
  1316
[
slouken@3085
  1317
  m4_require([_LT_REQUIRED_DARWIN_CHECKS])
slouken@3085
  1318
  _LT_TAGVAR(archive_cmds_need_lc, $1)=no
slouken@3085
  1319
  _LT_TAGVAR(hardcode_direct, $1)=no
slouken@3085
  1320
  _LT_TAGVAR(hardcode_automatic, $1)=yes
slouken@3085
  1321
  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
slouken@3085
  1322
  _LT_TAGVAR(whole_archive_flag_spec, $1)=''
slouken@3085
  1323
  _LT_TAGVAR(link_all_deplibs, $1)=yes
slouken@3085
  1324
  _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined"
slouken@3085
  1325
  case $cc_basename in
slouken@3085
  1326
     ifort*) _lt_dar_can_shared=yes ;;
slouken@3085
  1327
     *) _lt_dar_can_shared=$GCC ;;
slouken@3085
  1328
  esac
slouken@3085
  1329
  if test "$_lt_dar_can_shared" = "yes"; then
slouken@3085
  1330
    output_verbose_link_cmd=echo
slouken@3085
  1331
    _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
slouken@3085
  1332
    _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
slouken@3085
  1333
    _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
slouken@3085
  1334
    _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
slouken@3085
  1335
    m4_if([$1], [CXX],
slouken@3085
  1336
[   if test "$lt_cv_apple_cc_single_mod" != "yes"; then
slouken@3085
  1337
      _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}"
slouken@3085
  1338
      _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}"
slouken@3085
  1339
    fi
slouken@3085
  1340
],[])
slouken@3085
  1341
  else
slouken@3085
  1342
  _LT_TAGVAR(ld_shlibs, $1)=no
slouken@3085
  1343
  fi
slouken@3085
  1344
])
slouken@3085
  1345
slouken@3085
  1346
# _LT_SYS_MODULE_PATH_AIX
slouken@3085
  1347
# -----------------------
slouken@729
  1348
# Links a minimal program and checks the executable
slouken@729
  1349
# for the system default hardcoded library path. In most cases,
slouken@729
  1350
# this is /usr/lib:/lib, but when the MPI compilers are used
slouken@729
  1351
# the location of the communication and MPI libs are included too.
slouken@729
  1352
# If we don't find anything, use the default library path according
slouken@729
  1353
# to the aix ld manual.
slouken@3085
  1354
m4_defun([_LT_SYS_MODULE_PATH_AIX],
slouken@3085
  1355
[m4_require([_LT_DECL_SED])dnl
slouken@3085
  1356
AC_LINK_IFELSE(AC_LANG_PROGRAM,[
slouken@3085
  1357
lt_aix_libpath_sed='
slouken@3085
  1358
    /Import File Strings/,/^$/ {
slouken@3085
  1359
	/^0/ {
slouken@3085
  1360
	    s/^0  *\(.*\)$/\1/
slouken@3085
  1361
	    p
slouken@3085
  1362
	}
slouken@3085
  1363
    }'
slouken@3085
  1364
aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
slouken@729
  1365
# Check for a 64-bit object if we didn't find anything.
slouken@3085
  1366
if test -z "$aix_libpath"; then
slouken@3085
  1367
  aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
slouken@3085
  1368
fi],[])
slouken@729
  1369
if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
slouken@3085
  1370
])# _LT_SYS_MODULE_PATH_AIX
slouken@3085
  1371
slouken@3085
  1372
slouken@3085
  1373
# _LT_SHELL_INIT(ARG)
slouken@3085
  1374
# -------------------
slouken@3085
  1375
m4_define([_LT_SHELL_INIT],
slouken@729
  1376
[ifdef([AC_DIVERSION_NOTICE],
slouken@729
  1377
	     [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)],
slouken@729
  1378
	 [AC_DIVERT_PUSH(NOTICE)])
slouken@729
  1379
$1
slouken@729
  1380
AC_DIVERT_POP
slouken@3085
  1381
])# _LT_SHELL_INIT
slouken@3085
  1382
slouken@3085
  1383
slouken@3085
  1384
# _LT_PROG_ECHO_BACKSLASH
slouken@3085
  1385
# -----------------------
slouken@729
  1386
# Add some code to the start of the generated configure script which
slouken@729
  1387
# will find an echo command which doesn't interpret backslashes.
slouken@3085
  1388
m4_defun([_LT_PROG_ECHO_BACKSLASH],
slouken@3085
  1389
[_LT_SHELL_INIT([
slouken@729
  1390
# Check that we are running under the correct shell.
slouken@729
  1391
SHELL=${CONFIG_SHELL-/bin/sh}
slouken@729
  1392
slouken@3085
  1393
case X$lt_ECHO in
slouken@729
  1394
X*--fallback-echo)
slouken@729
  1395
  # Remove one level of quotation (which was required for Make).
slouken@3085
  1396
  ECHO=`echo "$lt_ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','`
slouken@729
  1397
  ;;
slouken@729
  1398
esac
slouken@729
  1399
slouken@3085
  1400
ECHO=${lt_ECHO-echo}
slouken@729
  1401
if test "X[$]1" = X--no-reexec; then
slouken@729
  1402
  # Discard the --no-reexec flag, and continue.
slouken@729
  1403
  shift
slouken@729
  1404
elif test "X[$]1" = X--fallback-echo; then
slouken@729
  1405
  # Avoid inline document here, it may be left over
slouken@729
  1406
  :
slouken@3085
  1407
elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' ; then
slouken@3085
  1408
  # Yippee, $ECHO works!
slouken@729
  1409
  :
slouken@729
  1410
else
slouken@729
  1411
  # Restart under the correct shell.
slouken@729
  1412
  exec $SHELL "[$]0" --no-reexec ${1+"[$]@"}
slouken@729
  1413
fi
slouken@729
  1414
slouken@729
  1415
if test "X[$]1" = X--fallback-echo; then
slouken@729
  1416
  # used as fallback echo
slouken@729
  1417
  shift
slouken@3085
  1418
  cat <<_LT_EOF
slouken@729
  1419
[$]*
slouken@3085
  1420
_LT_EOF
slouken@729
  1421
  exit 0
slouken@729
  1422
fi
slouken@729
  1423
slouken@729
  1424
# The HP-UX ksh and POSIX shell print the target directory to stdout
slouken@729
  1425
# if CDPATH is set.
slouken@947
  1426
(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
slouken@729
  1427
slouken@3085
  1428
if test -z "$lt_ECHO"; then
slouken@3085
  1429
  if test "X${echo_test_string+set}" != Xset; then
slouken@3085
  1430
    # find a string as large as possible, as long as the shell can cope with it
slouken@3085
  1431
    for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do
slouken@3085
  1432
      # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
slouken@3085
  1433
      if { echo_test_string=`eval $cmd`; } 2>/dev/null &&
slouken@3085
  1434
	 { test "X$echo_test_string" = "X$echo_test_string"; } 2>/dev/null
slouken@3085
  1435
      then
slouken@3085
  1436
        break
slouken@3085
  1437
      fi
slouken@3085
  1438
    done
slouken@3085
  1439
  fi
slouken@3085
  1440
slouken@3085
  1441
  if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' &&
slouken@3085
  1442
     echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` &&
slouken@3085
  1443
     test "X$echo_testing_string" = "X$echo_test_string"; then
slouken@3085
  1444
    :
slouken@3085
  1445
  else
slouken@3085
  1446
    # The Solaris, AIX, and Digital Unix default echo programs unquote
slouken@3085
  1447
    # backslashes.  This makes it impossible to quote backslashes using
slouken@3085
  1448
    #   echo "$something" | sed 's/\\/\\\\/g'
slouken@3085
  1449
    #
slouken@3085
  1450
    # So, first we look for a working echo in the user's PATH.
slouken@3085
  1451
slouken@3085
  1452
    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
slouken@3085
  1453
    for dir in $PATH /usr/ucb; do
slouken@3085
  1454
      IFS="$lt_save_ifs"
slouken@3085
  1455
      if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
slouken@3085
  1456
         test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
slouken@3085
  1457
         echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
slouken@3085
  1458
         test "X$echo_testing_string" = "X$echo_test_string"; then
slouken@3085
  1459
        ECHO="$dir/echo"
slouken@3085
  1460
        break
slouken@3085
  1461
      fi
slouken@3085
  1462
    done
slouken@729
  1463
    IFS="$lt_save_ifs"
slouken@3085
  1464
slouken@3085
  1465
    if test "X$ECHO" = Xecho; then
slouken@3085
  1466
      # We didn't find a better echo, so look for alternatives.
slouken@3085
  1467
      if test "X`{ print -r '\t'; } 2>/dev/null`" = 'X\t' &&
slouken@3085
  1468
         echo_testing_string=`{ print -r "$echo_test_string"; } 2>/dev/null` &&
slouken@3085
  1469
         test "X$echo_testing_string" = "X$echo_test_string"; then
slouken@3085
  1470
        # This shell has a builtin print -r that does the trick.
slouken@3085
  1471
        ECHO='print -r'
slouken@3085
  1472
      elif { test -f /bin/ksh || test -f /bin/ksh$ac_exeext; } &&
slouken@3085
  1473
	   test "X$CONFIG_SHELL" != X/bin/ksh; then
slouken@3085
  1474
        # If we have ksh, try running configure again with it.
slouken@3085
  1475
        ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
slouken@3085
  1476
        export ORIGINAL_CONFIG_SHELL
slouken@3085
  1477
        CONFIG_SHELL=/bin/ksh
slouken@3085
  1478
        export CONFIG_SHELL
slouken@3085
  1479
        exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"}
slouken@3085
  1480
      else
slouken@3085
  1481
        # Try using printf.
slouken@3085
  1482
        ECHO='printf %s\n'
slouken@3085
  1483
        if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' &&
slouken@3085
  1484
	   echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` &&
slouken@729
  1485
	   test "X$echo_testing_string" = "X$echo_test_string"; then
slouken@3085
  1486
	  # Cool, printf works
slouken@3085
  1487
	  :
slouken@3085
  1488
        elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
slouken@3085
  1489
	     test "X$echo_testing_string" = 'X\t' &&
slouken@3085
  1490
	     echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
slouken@3085
  1491
	     test "X$echo_testing_string" = "X$echo_test_string"; then
slouken@3085
  1492
	  CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
slouken@3085
  1493
	  export CONFIG_SHELL
slouken@3085
  1494
	  SHELL="$CONFIG_SHELL"
slouken@3085
  1495
	  export SHELL
slouken@3085
  1496
	  ECHO="$CONFIG_SHELL [$]0 --fallback-echo"
slouken@3085
  1497
        elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
slouken@3085
  1498
	     test "X$echo_testing_string" = 'X\t' &&
slouken@3085
  1499
	     echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
slouken@3085
  1500
	     test "X$echo_testing_string" = "X$echo_test_string"; then
slouken@3085
  1501
	  ECHO="$CONFIG_SHELL [$]0 --fallback-echo"
slouken@3085
  1502
        else
slouken@3085
  1503
	  # maybe with a smaller string...
slouken@3085
  1504
	  prev=:
slouken@3085
  1505
slouken@3085
  1506
	  for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do
slouken@3085
  1507
	    if { test "X$echo_test_string" = "X`eval $cmd`"; } 2>/dev/null
slouken@3085
  1508
	    then
slouken@3085
  1509
	      break
slouken@3085
  1510
	    fi
slouken@3085
  1511
	    prev="$cmd"
slouken@3085
  1512
	  done
slouken@3085
  1513
slouken@3085
  1514
	  if test "$prev" != 'sed 50q "[$]0"'; then
slouken@3085
  1515
	    echo_test_string=`eval $prev`
slouken@3085
  1516
	    export echo_test_string
slouken@3085
  1517
	    exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"}
slouken@3085
  1518
	  else
slouken@3085
  1519
	    # Oops.  We lost completely, so just stick with echo.
slouken@3085
  1520
	    ECHO=echo
slouken@729
  1521
	  fi
slouken@3085
  1522
        fi
slouken@729
  1523
      fi
slouken@729
  1524
    fi
slouken@729
  1525
  fi
slouken@729
  1526
fi
slouken@729
  1527
slouken@729
  1528
# Copy echo and quote the copy suitably for passing to libtool from
slouken@729
  1529
# the Makefile, instead of quoting the original, which is used later.
slouken@3085
  1530
lt_ECHO=$ECHO
slouken@3085
  1531
if test "X$lt_ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then
slouken@3085
  1532
   lt_ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo"
slouken@729
  1533
fi
slouken@729
  1534
slouken@3085
  1535
AC_SUBST(lt_ECHO)
slouken@3085
  1536
])
slouken@3085
  1537
_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts])
slouken@3085
  1538
_LT_DECL([], [ECHO], [1],
slouken@3085
  1539
    [An echo program that does not interpret backslashes])
slouken@3085
  1540
])# _LT_PROG_ECHO_BACKSLASH
slouken@3085
  1541
slouken@3085
  1542
slouken@3085
  1543
# _LT_ENABLE_LOCK
slouken@3085
  1544
# ---------------
slouken@3085
  1545
m4_defun([_LT_ENABLE_LOCK],
slouken@729
  1546
[AC_ARG_ENABLE([libtool-lock],
slouken@3085
  1547
  [AS_HELP_STRING([--disable-libtool-lock],
slouken@3085
  1548
    [avoid locking (might break parallel builds)])])
slouken@729
  1549
test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
slouken@0
  1550
slouken@0
  1551
# Some flags need to be propagated to the compiler or linker for good
slouken@0
  1552
# libtool support.
slouken@729
  1553
case $host in
slouken@729
  1554
ia64-*-hpux*)
slouken@729
  1555
  # Find out which ABI we are using.
slouken@729
  1556
  echo 'int i;' > conftest.$ac_ext
slouken@729
  1557
  if AC_TRY_EVAL(ac_compile); then
slouken@729
  1558
    case `/usr/bin/file conftest.$ac_objext` in
slouken@3085
  1559
      *ELF-32*)
slouken@3085
  1560
	HPUX_IA64_MODE="32"
slouken@3085
  1561
	;;
slouken@3085
  1562
      *ELF-64*)
slouken@3085
  1563
	HPUX_IA64_MODE="64"
slouken@3085
  1564
	;;
slouken@729
  1565
    esac
slouken@729
  1566
  fi
slouken@729
  1567
  rm -rf conftest*
slouken@729
  1568
  ;;
slouken@0
  1569
*-*-irix6*)
slouken@0
  1570
  # Find out which ABI we are using.
slouken@0
  1571
  echo '[#]line __oline__ "configure"' > conftest.$ac_ext
slouken@0
  1572
  if AC_TRY_EVAL(ac_compile); then
slouken@3085
  1573
    if test "$lt_cv_prog_gnu_ld" = yes; then
slouken@3085
  1574
      case `/usr/bin/file conftest.$ac_objext` in
slouken@3085
  1575
	*32-bit*)
slouken@3085
  1576
	  LD="${LD-ld} -melf32bsmip"
slouken@3085
  1577
	  ;;
slouken@3085
  1578
	*N32*)
slouken@3085
  1579
	  LD="${LD-ld} -melf32bmipn32"
slouken@3085
  1580
	  ;;
slouken@3085
  1581
	*64-bit*)
slouken@3085
  1582
	  LD="${LD-ld} -melf64bmip"
slouken@3085
  1583
	;;
slouken@3085
  1584
      esac
slouken@3085
  1585
    else
slouken@3085
  1586
      case `/usr/bin/file conftest.$ac_objext` in
slouken@3085
  1587
	*32-bit*)
slouken@3085
  1588
	  LD="${LD-ld} -32"
slouken@3085
  1589
	  ;;
slouken@3085
  1590
	*N32*)
slouken@3085
  1591
	  LD="${LD-ld} -n32"
slouken@3085
  1592
	  ;;
slouken@3085
  1593
	*64-bit*)
slouken@3085
  1594
	  LD="${LD-ld} -64"
slouken@3085
  1595
	  ;;
slouken@3085
  1596
      esac
slouken@3085
  1597
    fi
slouken@729
  1598
  fi
slouken@729
  1599
  rm -rf conftest*
slouken@729
  1600
  ;;
slouken@729
  1601
slouken@3085
  1602
x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
slouken@3085
  1603
s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
slouken@729
  1604
  # Find out which ABI we are using.
slouken@729
  1605
  echo 'int i;' > conftest.$ac_ext
slouken@729
  1606
  if AC_TRY_EVAL(ac_compile); then
slouken@1570
  1607
    case `/usr/bin/file conftest.o` in
slouken@3085
  1608
      *32-bit*)
slouken@3085
  1609
	case $host in
slouken@3085
  1610
	  x86_64-*kfreebsd*-gnu)
slouken@3085
  1611
	    LD="${LD-ld} -m elf_i386_fbsd"
slouken@3085
  1612
	    ;;
slouken@3085
  1613
	  x86_64-*linux*)
slouken@3085
  1614
	    LD="${LD-ld} -m elf_i386"
slouken@3085
  1615
	    ;;
slouken@3085
  1616
	  ppc64-*linux*|powerpc64-*linux*)
slouken@3085
  1617
	    LD="${LD-ld} -m elf32ppclinux"
slouken@3085
  1618
	    ;;
slouken@3085
  1619
	  s390x-*linux*)
slouken@3085
  1620
	    LD="${LD-ld} -m elf_s390"
slouken@3085
  1621
	    ;;
slouken@3085
  1622
	  sparc64-*linux*)
slouken@3085
  1623
	    LD="${LD-ld} -m elf32_sparc"
slouken@3085
  1624
	    ;;
slouken@3085
  1625
	esac
slouken@3085
  1626
	;;
slouken@3085
  1627
      *64-bit*)
slouken@3085
  1628
	case $host in
slouken@3085
  1629
	  x86_64-*kfreebsd*-gnu)
slouken@3085
  1630
	    LD="${LD-ld} -m elf_x86_64_fbsd"
slouken@3085
  1631
	    ;;
slouken@3085
  1632
	  x86_64-*linux*)
slouken@3085
  1633
	    LD="${LD-ld} -m elf_x86_64"
slouken@3085
  1634
	    ;;
slouken@3085
  1635
	  ppc*-*linux*|powerpc*-*linux*)
slouken@3085
  1636
	    LD="${LD-ld} -m elf64ppc"
slouken@3085
  1637
	    ;;
slouken@3085
  1638
	  s390*-*linux*|s390*-*tpf*)
slouken@3085
  1639
	    LD="${LD-ld} -m elf64_s390"
slouken@3085
  1640
	    ;;
slouken@3085
  1641
	  sparc*-*linux*)
slouken@3085
  1642
	    LD="${LD-ld} -m elf64_sparc"
slouken@3085
  1643
	    ;;
slouken@3085
  1644
	esac
slouken@3085
  1645
	;;
slouken@729
  1646
    esac
slouken@0
  1647
  fi
slouken@0
  1648
  rm -rf conftest*
slouken@0
  1649
  ;;
slouken@0
  1650
slouken@0
  1651
*-*-sco3.2v5*)
slouken@0
  1652
  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
slouken@0
  1653
  SAVE_CFLAGS="$CFLAGS"
slouken@0
  1654
  CFLAGS="$CFLAGS -belf"
slouken@0
  1655
  AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
slouken@729
  1656
    [AC_LANG_PUSH(C)
slouken@3085
  1657
     AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
slouken@729
  1658
     AC_LANG_POP])
slouken@0
  1659
  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
slouken@0
  1660
    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
slouken@0
  1661
    CFLAGS="$SAVE_CFLAGS"
slouken@0
  1662
  fi
slouken@0
  1663
  ;;
slouken@1570
  1664
sparc*-*solaris*)
slouken@1570
  1665
  # Find out which ABI we are using.
slouken@1570
  1666
  echo 'int i;' > conftest.$ac_ext
slouken@1570
  1667
  if AC_TRY_EVAL(ac_compile); then
slouken@1570
  1668
    case `/usr/bin/file conftest.o` in
slouken@1570
  1669
    *64-bit*)
slouken@1570
  1670
      case $lt_cv_prog_gnu_ld in
slouken@1570
  1671
      yes*) LD="${LD-ld} -m elf64_sparc" ;;
slouken@3085
  1672
      *)
slouken@3085
  1673
	if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
slouken@3085
  1674
	  LD="${LD-ld} -64"
slouken@3085
  1675
	fi
slouken@3085
  1676
	;;
slouken@1570
  1677
      esac
slouken@1570
  1678
      ;;
slouken@1570
  1679
    esac
slouken@1570
  1680
  fi
slouken@1570
  1681
  rm -rf conftest*
slouken@1570
  1682
  ;;
slouken@729
  1683
esac
slouken@729
  1684
slouken@729
  1685
need_locks="$enable_libtool_lock"
slouken@3085
  1686
])# _LT_ENABLE_LOCK
slouken@3085
  1687
slouken@3085
  1688
slouken@3085
  1689
# _LT_CMD_OLD_ARCHIVE
slouken@3085
  1690
# -------------------
slouken@3085
  1691
m4_defun([_LT_CMD_OLD_ARCHIVE],
slouken@3085
  1692
[AC_CHECK_TOOL(AR, ar, false)
slouken@3085
  1693
test -z "$AR" && AR=ar
slouken@3085
  1694
test -z "$AR_FLAGS" && AR_FLAGS=cru
slouken@3085
  1695
_LT_DECL([], [AR], [1], [The archiver])
slouken@3085
  1696
_LT_DECL([], [AR_FLAGS], [1])
slouken@3085
  1697
slouken@3085
  1698
AC_CHECK_TOOL(STRIP, strip, :)
slouken@3085
  1699
test -z "$STRIP" && STRIP=:
slouken@3085
  1700
_LT_DECL([], [STRIP], [1], [A symbol stripping program])
slouken@3085
  1701
slouken@3085
  1702
AC_CHECK_TOOL(RANLIB, ranlib, :)
slouken@3085
  1703
test -z "$RANLIB" && RANLIB=:
slouken@3085
  1704
_LT_DECL([], [RANLIB], [1],
slouken@3085
  1705
    [Commands used to install an old-style archive])
slouken@3085
  1706
slouken@3085
  1707
# Determine commands to create old-style static archives.
slouken@3085
  1708
old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
slouken@3085
  1709
old_postinstall_cmds='chmod 644 $oldlib'
slouken@3085
  1710
old_postuninstall_cmds=
slouken@3085
  1711
slouken@3085
  1712
if test -n "$RANLIB"; then
slouken@3085
  1713
  case $host_os in
slouken@3085
  1714
  openbsd*)
slouken@3085
  1715
    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib"
slouken@3085
  1716
    ;;
slouken@3085
  1717
  *)
slouken@3085
  1718
    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib"
slouken@3085
  1719
    ;;
slouken@3085
  1720
  esac
slouken@3085
  1721
  old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
slouken@3085
  1722
fi
slouken@3085
  1723
_LT_DECL([], [old_postinstall_cmds], [2])
slouken@3085
  1724
_LT_DECL([], [old_postuninstall_cmds], [2])
slouken@3085
  1725
_LT_TAGDECL([], [old_archive_cmds], [2],
slouken@3085
  1726
    [Commands used to build an old-style archive])
slouken@3085
  1727
])# _LT_CMD_OLD_ARCHIVE
slouken@3085
  1728
slouken@3085
  1729
slouken@3085
  1730
# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
slouken@729
  1731
#		[OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
slouken@729
  1732
# ----------------------------------------------------------------
slouken@729
  1733
# Check whether the given compiler option works
slouken@3085
  1734
AC_DEFUN([_LT_COMPILER_OPTION],
slouken@3085
  1735
[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
slouken@3085
  1736
m4_require([_LT_DECL_SED])dnl
slouken@947
  1737
AC_CACHE_CHECK([$1], [$2],
slouken@729
  1738
  [$2=no
slouken@3085
  1739
   m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
slouken@3085
  1740
   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
slouken@729
  1741
   lt_compiler_flag="$3"
slouken@729
  1742
   # Insert the option either (1) after the last *FLAGS variable, or
slouken@729
  1743
   # (2) before a word containing "conftest.", or (3) at the end.
slouken@729
  1744
   # Note that $ac_compile itself does not contain backslashes and begins
slouken@729
  1745
   # with a dollar sign (not a hyphen), so the echo should work correctly.
slouken@729
  1746
   # The option is referenced via a variable to avoid confusing sed.
slouken@729
  1747
   lt_compile=`echo "$ac_compile" | $SED \
slouken@1570
  1748
   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
slouken@729
  1749
   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
slouken@729
  1750
   -e 's:$: $lt_compiler_flag:'`
slouken@729
  1751
   (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
slouken@729
  1752
   (eval "$lt_compile" 2>conftest.err)
slouken@729
  1753
   ac_status=$?
slouken@729
  1754
   cat conftest.err >&AS_MESSAGE_LOG_FD
slouken@729
  1755
   echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
slouken@729
  1756
   if (exit $ac_status) && test -s "$ac_outfile"; then
slouken@729
  1757
     # The compiler can only warn and ignore the option if not recognized
slouken@1570
  1758
     # So say no if there are warnings other than the usual output.
slouken@3085
  1759
     $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
slouken@1570
  1760
     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
slouken@1570
  1761
     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
slouken@729
  1762
       $2=yes
slouken@729
  1763
     fi
slouken@729
  1764
   fi
slouken@3085
  1765
   $RM conftest*
slouken@0
  1766
])
slouken@729
  1767
slouken@729
  1768
if test x"[$]$2" = xyes; then
slouken@3085
  1769
    m4_if([$5], , :, [$5])
slouken@729
  1770
else
slouken@3085
  1771
    m4_if([$6], , :, [$6])
slouken@729
  1772
fi
slouken@3085
  1773
])# _LT_COMPILER_OPTION
slouken@3085
  1774
slouken@3085
  1775
# Old name:
slouken@3085
  1776
AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION])
slouken@3085
  1777
dnl aclocal-1.4 backwards compatibility:
slouken@3085
  1778
dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [])
slouken@3085
  1779
slouken@3085
  1780
slouken@3085
  1781
# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
slouken@3085
  1782
#                  [ACTION-SUCCESS], [ACTION-FAILURE])
slouken@3085
  1783
# ----------------------------------------------------
slouken@3085
  1784
# Check whether the given linker option works
slouken@3085
  1785
AC_DEFUN([_LT_LINKER_OPTION],
slouken@3085
  1786
[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
slouken@3085
  1787
m4_require([_LT_DECL_SED])dnl
slouken@3085
  1788
AC_CACHE_CHECK([$1], [$2],
slouken@729
  1789
  [$2=no
slouken@729
  1790
   save_LDFLAGS="$LDFLAGS"
slouken@729
  1791
   LDFLAGS="$LDFLAGS $3"
slouken@3085
  1792
   echo "$lt_simple_link_test_code" > conftest.$ac_ext
slouken@729
  1793
   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
slouken@1570
  1794
     # The linker can only warn and ignore the option if not recognized
slouken@729
  1795
     # So say no if there are warnings
slouken@729
  1796
     if test -s conftest.err; then
slouken@729
  1797
       # Append any errors to the config.log.
slouken@729
  1798
       cat conftest.err 1>&AS_MESSAGE_LOG_FD
slouken@3085
  1799
       $ECHO "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp
slouken@1570
  1800
       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
slouken@1570
  1801
       if diff conftest.exp conftest.er2 >/dev/null; then
slouken@1570
  1802
         $2=yes
slouken@1570
  1803
       fi
slouken@729
  1804
     else
slouken@729
  1805
       $2=yes
slouken@729
  1806
     fi
slouken@729
  1807
   fi
slouken@3085
  1808
   $RM -r conftest*
slouken@729
  1809
   LDFLAGS="$save_LDFLAGS"
slouken@729
  1810
])
slouken@729
  1811
slouken@729
  1812
if test x"[$]$2" = xyes; then
slouken@3085
  1813
    m4_if([$4], , :, [$4])
slouken@729
  1814
else
slouken@3085
  1815
    m4_if([$5], , :, [$5])
slouken@729
  1816
fi
slouken@3085
  1817
])# _LT_LINKER_OPTION
slouken@3085
  1818
slouken@3085
  1819
# Old name:
slouken@3085
  1820
AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION])
slouken@3085
  1821
dnl aclocal-1.4 backwards compatibility:
slouken@3085
  1822
dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [])
slouken@3085
  1823
slouken@3085
  1824
slouken@3085
  1825
# LT_CMD_MAX_LEN
slouken@3085
  1826
#---------------
slouken@3085
  1827
AC_DEFUN([LT_CMD_MAX_LEN],
slouken@3085
  1828
[AC_REQUIRE([AC_CANONICAL_HOST])dnl
slouken@3085
  1829
# find the maximum length of command line arguments
slouken@729
  1830
AC_MSG_CHECKING([the maximum length of command line arguments])
slouken@729
  1831
AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
slouken@729
  1832
  i=0
slouken@947
  1833
  teststring="ABCD"
slouken@729
  1834
slouken@729
  1835
  case $build_os in
slouken@729
  1836
  msdosdjgpp*)
slouken@729
  1837
    # On DJGPP, this test can blow up pretty badly due to problems in libc
slouken@729
  1838
    # (any single argument exceeding 2000 bytes causes a buffer overrun
slouken@729
  1839
    # during glob expansion).  Even if it were fixed, the result of this
slouken@729
  1840
    # check would be larger than it should be.
slouken@729
  1841
    lt_cv_sys_max_cmd_len=12288;    # 12K is about right
slouken@729
  1842
    ;;
slouken@729
  1843
slouken@729
  1844
  gnu*)
slouken@729
  1845
    # Under GNU Hurd, this test is not required because there is
slouken@729
  1846
    # no limit to the length of command line arguments.
slouken@729
  1847
    # Libtool will interpret -1 as no limit whatsoever
slouken@729
  1848
    lt_cv_sys_max_cmd_len=-1;
slouken@729
  1849
    ;;
slouken@729
  1850
slouken@3085
  1851
  cygwin* | mingw* | cegcc*)
slouken@729
  1852
    # On Win9x/ME, this test blows up -- it succeeds, but takes
slouken@729
  1853
    # about 5 minutes as the teststring grows exponentially.
slouken@729
  1854
    # Worse, since 9x/ME are not pre-emptively multitasking,
slouken@729
  1855
    # you end up with a "frozen" computer, even though with patience
slouken@729
  1856
    # the test eventually succeeds (with a max line length of 256k).
slouken@729
  1857
    # Instead, let's just punt: use the minimum linelength reported by
slouken@729
  1858
    # all of the supported platforms: 8192 (on NT/2K/XP).
slouken@729
  1859
    lt_cv_sys_max_cmd_len=8192;
slouken@729
  1860
    ;;
slouken@729
  1861
slouken@1361
  1862
  beos*)
slouken@1361
  1863
    # On BeOS, this test takes a really really long time.
slouken@1361
  1864
    # So we just punt and use a minimum line length of 8192.
slouken@1361
  1865
    lt_cv_sys_max_cmd_len=8192;
slouken@1361
  1866
    ;;
slouken@1361
  1867
slouken@947
  1868
  amigaos*)
slouken@947
  1869
    # On AmigaOS with pdksh, this test takes hours, literally.
slouken@947
  1870
    # So we just punt and use a minimum line length of 8192.
slouken@947
  1871
    lt_cv_sys_max_cmd_len=8192;
slouken@947
  1872
    ;;
slouken@947
  1873
slouken@1570
  1874
  netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
slouken@947
  1875
    # This has been around since 386BSD, at least.  Likely further.
slouken@947
  1876
    if test -x /sbin/sysctl; then
slouken@947
  1877
      lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
slouken@947
  1878
    elif test -x /usr/sbin/sysctl; then
slouken@947
  1879
      lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
slouken@947
  1880
    else
slouken@1570
  1881
      lt_cv_sys_max_cmd_len=65536	# usable default for all BSDs
slouken@947
  1882
    fi
slouken@947
  1883
    # And add a safety zone
slouken@947
  1884
    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
slouken@1570
  1885
    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
slouken@947
  1886
    ;;
slouken@947
  1887
slouken@1570
  1888
  interix*)
slouken@1570
  1889
    # We know the value 262144 and hardcode it with a safety zone (like BSD)
slouken@1570
  1890
    lt_cv_sys_max_cmd_len=196608
slouken@1570
  1891
    ;;
slouken@1570
  1892
slouken@1570
  1893
  osf*)
slouken@1570
  1894
    # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
slouken@1570
  1895
    # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
slouken@1570
  1896
    # nice to cause kernel panics so lets avoid the loop below.
slouken@1570
  1897
    # First set a reasonable default.
slouken@1570
  1898
    lt_cv_sys_max_cmd_len=16384
slouken@1570
  1899
    #
slouken@1570
  1900
    if test -x /sbin/sysconfig; then
slouken@1570
  1901
      case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
slouken@1570
  1902
        *1*) lt_cv_sys_max_cmd_len=-1 ;;
slouken@1570
  1903
      esac
slouken@1570
  1904
    fi
slouken@1570
  1905
    ;;
slouken@1570
  1906
  sco3.2v5*)
slouken@1570
  1907
    lt_cv_sys_max_cmd_len=102400
slouken@1570
  1908
    ;;
slouken@1570
  1909
  sysv5* | sco5v6* | sysv4.2uw2*)
slouken@1570
  1910
    kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
slouken@1570
  1911
    if test -n "$kargmax"; then
slouken@3085
  1912
      lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[	 ]]//'`
slouken@1570
  1913
    else
slouken@1570
  1914
      lt_cv_sys_max_cmd_len=32768
slouken@1570
  1915
    fi
slouken@1570
  1916
    ;;
slouken@1570
  1917
  *)
slouken@3085
  1918
    lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
slouken@3085
  1919
    if test -n "$lt_cv_sys_max_cmd_len"; then
slouken@3085
  1920
      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
slouken@3085
  1921
      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
slouken@3085
  1922
    else
slouken@3085
  1923
      # Make teststring a little bigger before we do anything with it.
slouken@3085
  1924
      # a 1K string should be a reasonable start.
slouken@3085
  1925
      for i in 1 2 3 4 5 6 7 8 ; do
slouken@3085
  1926
        teststring=$teststring$teststring
slouken@3085
  1927
      done
slouken@3085
  1928
      SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
slouken@3085
  1929
      # If test is not a shell built-in, we'll probably end up computing a
slouken@3085
  1930
      # maximum length that is only half of the actual maximum length, but
slouken@3085
  1931
      # we can't tell.
slouken@3085
  1932
      while { test "X"`$SHELL [$]0 --fallback-echo "X$teststring$teststring" 2>/dev/null` \
slouken@3085
  1933
	         = "XX$teststring$teststring"; } >/dev/null 2>&1 &&
slouken@3085
  1934
	      test $i != 17 # 1/2 MB should be enough
slouken@3085
  1935
      do
slouken@3085
  1936
        i=`expr $i + 1`
slouken@3085
  1937
        teststring=$teststring$teststring
slouken@3085
  1938
      done
slouken@3085
  1939
      # Only check the string length outside the loop.
slouken@3085
  1940
      lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
slouken@3085
  1941
      teststring=
slouken@3085
  1942
      # Add a significant safety factor because C++ compilers can tack on
slouken@3085
  1943
      # massive amounts of additional arguments before passing them to the
slouken@3085
  1944
      # linker.  It appears as though 1/2 is a usable value.
slouken@3085
  1945
      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
slouken@3085
  1946
    fi
slouken@729
  1947
    ;;
slouken@729
  1948
  esac
slouken@729
  1949
])
slouken@729
  1950
if test -n $lt_cv_sys_max_cmd_len ; then
slouken@729
  1951
  AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
slouken@729
  1952
else
slouken@729
  1953
  AC_MSG_RESULT(none)
slouken@729
  1954
fi
slouken@3085
  1955
max_cmd_len=$lt_cv_sys_max_cmd_len
slouken@3085
  1956
_LT_DECL([], [max_cmd_len], [0],
slouken@3085
  1957
    [What is the maximum length of a command?])
slouken@3085
  1958
])# LT_CMD_MAX_LEN
slouken@3085
  1959
slouken@3085
  1960
# Old name:
slouken@3085
  1961
AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN])
slouken@3085
  1962
dnl aclocal-1.4 backwards compatibility:
slouken@3085
  1963
dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [])
slouken@3085
  1964
slouken@3085
  1965
slouken@3085
  1966
# _LT_HEADER_DLFCN
slouken@3085
  1967
# ----------------
slouken@3085
  1968
m4_defun([_LT_HEADER_DLFCN],
slouken@3085
  1969
[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl
slouken@3085
  1970
])# _LT_HEADER_DLFCN
slouken@3085
  1971
slouken@3085
  1972
slouken@3085
  1973
# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
slouken@3085
  1974
#                      ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
slouken@3085
  1975
# ----------------------------------------------------------------
slouken@3085
  1976
m4_defun([_LT_TRY_DLOPEN_SELF],
slouken@3085
  1977
[m4_require([_LT_HEADER_DLFCN])dnl
slouken@729
  1978
if test "$cross_compiling" = yes; then :
slouken@729
  1979
  [$4]
slouken@729
  1980
else
slouken@729
  1981
  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
slouken@729
  1982
  lt_status=$lt_dlunknown
slouken@3085
  1983
  cat > conftest.$ac_ext <<_LT_EOF
slouken@729
  1984
[#line __oline__ "configure"
slouken@729
  1985
#include "confdefs.h"
slouken@729
  1986
slouken@729
  1987
#if HAVE_DLFCN_H
slouken@729
  1988
#include <dlfcn.h>
slouken@729
  1989
#endif
slouken@729
  1990
slouken@729
  1991
#include <stdio.h>
slouken@729
  1992
slouken@729
  1993
#ifdef RTLD_GLOBAL
slouken@729
  1994
#  define LT_DLGLOBAL		RTLD_GLOBAL
slouken@729
  1995
#else
slouken@729
  1996
#  ifdef DL_GLOBAL
slouken@729
  1997
#    define LT_DLGLOBAL		DL_GLOBAL
slouken@729
  1998
#  else
slouken@729
  1999
#    define LT_DLGLOBAL		0
slouken@729
  2000
#  endif
slouken@729
  2001
#endif
slouken@729
  2002
slouken@729
  2003
/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
slouken@729
  2004
   find out it does not work in some platform. */
slouken@729
  2005
#ifndef LT_DLLAZY_OR_NOW
slouken@729
  2006
#  ifdef RTLD_LAZY
slouken@729
  2007
#    define LT_DLLAZY_OR_NOW		RTLD_LAZY
slouken@729
  2008
#  else
slouken@729
  2009
#    ifdef DL_LAZY
slouken@729
  2010
#      define LT_DLLAZY_OR_NOW		DL_LAZY
slouken@729
  2011
#    else
slouken@729
  2012
#      ifdef RTLD_NOW
slouken@729
  2013
#        define LT_DLLAZY_OR_NOW	RTLD_NOW
slouken@729
  2014
#      else
slouken@729
  2015
#        ifdef DL_NOW
slouken@729
  2016
#          define LT_DLLAZY_OR_NOW	DL_NOW
slouken@729
  2017
#        else
slouken@729
  2018
#          define LT_DLLAZY_OR_NOW	0
slouken@729
  2019
#        endif
slouken@729
  2020
#      endif
slouken@729
  2021
#    endif
slouken@729
  2022
#  endif
slouken@729
  2023
#endif
slouken@729
  2024
slouken@729
  2025
void fnord() { int i=42;}
slouken@729
  2026
int main ()
slouken@729
  2027
{
slouken@729
  2028
  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
slouken@729
  2029
  int status = $lt_dlunknown;
slouken@729
  2030
slouken@729
  2031
  if (self)
slouken@729
  2032
    {
slouken@729
  2033
      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
slouken@729
  2034
      else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
slouken@729
  2035
      /* dlclose (self); */
slouken@729
  2036
    }
slouken@1570
  2037
  else
slouken@1570
  2038
    puts (dlerror ());
slouken@729
  2039
slouken@3085
  2040
  return status;
slouken@729
  2041
}]
slouken@3085
  2042
_LT_EOF
slouken@729
  2043
  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
slouken@1570
  2044
    (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
slouken@729
  2045
    lt_status=$?
slouken@729
  2046
    case x$lt_status in
slouken@729
  2047
      x$lt_dlno_uscore) $1 ;;
slouken@729
  2048
      x$lt_dlneed_uscore) $2 ;;
slouken@1570
  2049
      x$lt_dlunknown|x*) $3 ;;
slouken@729
  2050
    esac
slouken@729
  2051
  else :
slouken@729
  2052
    # compilation failed
slouken@729
  2053
    $3
slouken@729
  2054
  fi
slouken@729
  2055
fi
slouken@729
  2056
rm -fr conftest*
slouken@3085
  2057
])# _LT_TRY_DLOPEN_SELF
slouken@3085
  2058
slouken@3085
  2059
slouken@3085
  2060
# LT_SYS_DLOPEN_SELF
slouken@3085
  2061
# ------------------
slouken@3085
  2062
AC_DEFUN([LT_SYS_DLOPEN_SELF],
slouken@3085
  2063
[m4_require([_LT_HEADER_DLFCN])dnl
slouken@729
  2064
if test "x$enable_dlopen" != xyes; then
slouken@729
  2065
  enable_dlopen=unknown
slouken@729
  2066
  enable_dlopen_self=unknown
slouken@729
  2067
  enable_dlopen_self_static=unknown
slouken@729
  2068
else
slouken@729
  2069
  lt_cv_dlopen=no
slouken@729
  2070
  lt_cv_dlopen_libs=
slouken@729
  2071
slouken@729
  2072
  case $host_os in
slouken@729
  2073
  beos*)
slouken@729
  2074
    lt_cv_dlopen="load_add_on"
slouken@729
  2075
    lt_cv_dlopen_libs=
slouken@729
  2076
    lt_cv_dlopen_self=yes
slouken@729
  2077
    ;;
slouken@729
  2078
slouken@3085
  2079
  mingw* | pw32* | cegcc*)
slouken@729
  2080
    lt_cv_dlopen="LoadLibrary"
slouken@729
  2081
    lt_cv_dlopen_libs=
slouken@3085
  2082
    ;;
slouken@729
  2083
slouken@729
  2084
  cygwin*)
slouken@729
  2085
    lt_cv_dlopen="dlopen"
slouken@729
  2086
    lt_cv_dlopen_libs=
slouken@3085
  2087
    ;;
slouken@729
  2088
slouken@729
  2089
  darwin*)
slouken@729
  2090
  # if libdl is installed we need to link against it
slouken@729
  2091
    AC_CHECK_LIB([dl], [dlopen],
slouken@729
  2092
		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[
slouken@729
  2093
    lt_cv_dlopen="dyld"
slouken@729
  2094
    lt_cv_dlopen_libs=
slouken@729
  2095
    lt_cv_dlopen_self=yes
slouken@729
  2096
    ])
slouken@3085
  2097
    ;;
slouken@947
  2098
slouken@729
  2099
  *)
slouken@729
  2100
    AC_CHECK_FUNC([shl_load],
slouken@729
  2101
	  [lt_cv_dlopen="shl_load"],
slouken@729
  2102
      [AC_CHECK_LIB([dld], [shl_load],
slouken@3085
  2103
	    [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"],
slouken@729
  2104
	[AC_CHECK_FUNC([dlopen],
slouken@729
  2105
	      [lt_cv_dlopen="dlopen"],
slouken@729
  2106
	  [AC_CHECK_LIB([dl], [dlopen],
slouken@729
  2107
		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
slouken@729
  2108
	    [AC_CHECK_LIB([svld], [dlopen],
slouken@729
  2109
		  [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
slouken@729
  2110
	      [AC_CHECK_LIB([dld], [dld_link],
slouken@3085
  2111
		    [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"])
slouken@729
  2112
	      ])
slouken@729
  2113
	    ])
slouken@729
  2114
	  ])
slouken@729
  2115
	])
slouken@729
  2116
      ])
slouken@729
  2117
    ;;
slouken@729
  2118
  esac
slouken@729
  2119
slouken@729
  2120
  if test "x$lt_cv_dlopen" != xno; then
slouken@729
  2121
    enable_dlopen=yes
slouken@729
  2122
  else
slouken@729
  2123
    enable_dlopen=no
slouken@729
  2124
  fi
slouken@729
  2125
slouken@729
  2126
  case $lt_cv_dlopen in
slouken@729
  2127
  dlopen)
slouken@729
  2128
    save_CPPFLAGS="$CPPFLAGS"
slouken@729
  2129
    test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
slouken@729
  2130
slouken@729
  2131
    save_LDFLAGS="$LDFLAGS"
slouken@1570
  2132
    wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
slouken@729
  2133
slouken@729
  2134
    save_LIBS="$LIBS"
slouken@729
  2135
    LIBS="$lt_cv_dlopen_libs $LIBS"
slouken@729
  2136
slouken@729
  2137
    AC_CACHE_CHECK([whether a program can dlopen itself],
slouken@729
  2138
	  lt_cv_dlopen_self, [dnl
slouken@3085
  2139
	  _LT_TRY_DLOPEN_SELF(
slouken@729
  2140
	    lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
slouken@729
  2141
	    lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
slouken@729
  2142
    ])
slouken@729
  2143
slouken@729
  2144
    if test "x$lt_cv_dlopen_self" = xyes; then
slouken@1570
  2145
      wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
slouken@729
  2146
      AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
slouken@3085
  2147
	  lt_cv_dlopen_self_static, [dnl
slouken@3085
  2148
	  _LT_TRY_DLOPEN_SELF(
slouken@729
  2149
	    lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
slouken@729
  2150
	    lt_cv_dlopen_self_static=no,  lt_cv_dlopen_self_static=cross)
slouken@729
  2151
      ])
slouken@729
  2152
    fi
slouken@729
  2153
slouken@729
  2154
    CPPFLAGS="$save_CPPFLAGS"
slouken@729
  2155
    LDFLAGS="$save_LDFLAGS"
slouken@729
  2156
    LIBS="$save_LIBS"
slouken@729
  2157
    ;;
slouken@729
  2158
  esac
slouken@729
  2159
slouken@729
  2160
  case $lt_cv_dlopen_self in
slouken@729
  2161
  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
slouken@729
  2162
  *) enable_dlopen_self=unknown ;;
slouken@729
  2163
  esac
slouken@729
  2164
slouken@729
  2165
  case $lt_cv_dlopen_self_static in
slouken@729
  2166
  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
slouken@729
  2167
  *) enable_dlopen_self_static=unknown ;;
slouken@729
  2168
  esac
slouken@729
  2169
fi
slouken@3085
  2170
_LT_DECL([dlopen_support], [enable_dlopen], [0],
slouken@3085
  2171
	 [Whether dlopen is supported])
slouken@3085
  2172
_LT_DECL([dlopen_self], [enable_dlopen_self], [0],
slouken@3085
  2173
	 [Whether dlopen of programs is supported])
slouken@3085
  2174
_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0],
slouken@3085
  2175
	 [Whether dlopen of statically linked programs is supported])
slouken@3085
  2176
])# LT_SYS_DLOPEN_SELF
slouken@3085
  2177
slouken@3085
  2178
# Old name:
slouken@3085
  2179
AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF])
slouken@3085
  2180
dnl aclocal-1.4 backwards compatibility:
slouken@3085
  2181
dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [])
slouken@3085
  2182
slouken@3085
  2183
slouken@3085
  2184
# _LT_COMPILER_C_O([TAGNAME])
slouken@3085
  2185
# ---------------------------
slouken@3085
  2186
# Check to see if options -c and -o are simultaneously supported by compiler.
slouken@3085
  2187
# This macro does not hard code the compiler like AC_PROG_CC_C_O.
slouken@3085
  2188
m4_defun([_LT_COMPILER_C_O],
slouken@3085
  2189
[m4_require([_LT_DECL_SED])dnl
slouken@3085
  2190
m4_require([_LT_FILEUTILS_DEFAULTS])dnl
slouken@3085
  2191
m4_require([_LT_TAG_COMPILER])dnl
slouken@729
  2192
AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
slouken@3085
  2193
  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
slouken@3085
  2194
  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
slouken@3085
  2195
   $RM -r conftest 2>/dev/null
slouken@729
  2196
   mkdir conftest
slouken@729
  2197
   cd conftest
slouken@729
  2198
   mkdir out
slouken@3085
  2199
   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
slouken@729
  2200
slouken@729
  2201
   lt_compiler_flag="-o out/conftest2.$ac_objext"
slouken@729
  2202
   # Insert the option either (1) after the last *FLAGS variable, or
slouken@729
  2203
   # (2) before a word containing "conftest.", or (3) at the end.
slouken@729
  2204
   # Note that $ac_compile itself does not contain backslashes and begins
slouken@729
  2205
   # with a dollar sign (not a hyphen), so the echo should work correctly.
slouken@729
  2206
   lt_compile=`echo "$ac_compile" | $SED \
slouken@1570
  2207
   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
slouken@729
  2208
   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
slouken@729
  2209
   -e 's:$: $lt_compiler_flag:'`
slouken@729
  2210
   (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
slouken@729
  2211
   (eval "$lt_compile" 2>out/conftest.err)
slouken@729
  2212
   ac_status=$?
slouken@729
  2213
   cat out/conftest.err >&AS_MESSAGE_LOG_FD
slouken@729
  2214
   echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
slouken@729
  2215
   if (exit $ac_status) && test -s out/conftest2.$ac_objext
slouken@729
  2216
   then
slouken@729
  2217
     # The compiler can only warn and ignore the option if not recognized
slouken@729
  2218
     # So say no if there are warnings
slouken@3085
  2219
     $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
slouken@1570
  2220
     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
slouken@1570
  2221
     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
slouken@3085
  2222
       _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
slouken@729
  2223
     fi
slouken@729
  2224
   fi
slouken@1570
  2225
   chmod u+w . 2>&AS_MESSAGE_LOG_FD
slouken@3085
  2226
   $RM conftest*
slouken@947
  2227
   # SGI C++ compiler will create directory out/ii_files/ for
slouken@947
  2228
   # template instantiation
slouken@3085
  2229
   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
slouken@3085
  2230
   $RM out/* && rmdir out
slouken@729
  2231
   cd ..
slouken@3085
  2232
   $RM -r conftest
slouken@3085
  2233
   $RM conftest*
slouken@729
  2234
])
slouken@3085
  2235
_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1],
slouken@3085
  2236
	[Does compiler simultaneously support -c and -o options?])
slouken@3085
  2237
])# _LT_COMPILER_C_O
slouken@3085
  2238
slouken@3085
  2239
slouken@3085
  2240
# _LT_COMPILER_FILE_LOCKS([TAGNAME])
slouken@3085
  2241
# ----------------------------------
slouken@729
  2242
# Check to see if we can do hard links to lock some files if needed
slouken@3085
  2243
m4_defun([_LT_COMPILER_FILE_LOCKS],
slouken@3085
  2244
[m4_require([_LT_ENABLE_LOCK])dnl
slouken@3085
  2245
m4_require([_LT_FILEUTILS_DEFAULTS])dnl
slouken@3085
  2246
_LT_COMPILER_C_O([$1])
slouken@729
  2247
slouken@729
  2248
hard_links="nottested"
slouken@3085
  2249
if test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then
slouken@729
  2250
  # do not overwrite the value of need_locks provided by the user
slouken@729
  2251
  AC_MSG_CHECKING([if we can lock with hard links])
slouken@729
  2252
  hard_links=yes
slouken@3085
  2253
  $RM conftest*
slouken@729
  2254
  ln conftest.a conftest.b 2>/dev/null && hard_links=no
slouken@729
  2255
  touch conftest.a
slouken@729
  2256
  ln conftest.a conftest.b 2>&5 || hard_links=no
slouken@729
  2257
  ln conftest.a conftest.b 2>/dev/null && hard_links=no
slouken@729
  2258
  AC_MSG_RESULT([$hard_links])
slouken@729
  2259
  if test "$hard_links" = no; then
slouken@729
  2260
    AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe])
slouken@729
  2261
    need_locks=warn
slouken@729
  2262
  fi
slouken@729
  2263
else
slouken@729
  2264
  need_locks=no
slouken@729
  2265
fi
slouken@3085
  2266
_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?])
slouken@3085
  2267
])# _LT_COMPILER_FILE_LOCKS
slouken@3085
  2268
slouken@3085
  2269
slouken@3085
  2270
# _LT_CHECK_OBJDIR
slouken@3085
  2271
# ----------------
slouken@3085
  2272
m4_defun([_LT_CHECK_OBJDIR],
slouken@729
  2273
[AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
slouken@729
  2274
[rm -f .libs 2>/dev/null
slouken@729
  2275
mkdir .libs 2>/dev/null
slouken@729
  2276
if test -d .libs; then
slouken@729
  2277
  lt_cv_objdir=.libs
slouken@729
  2278
else
slouken@729
  2279
  # MS-DOS does not allow filenames that begin with a dot.
slouken@729
  2280
  lt_cv_objdir=_libs
slouken@729
  2281
fi
slouken@729
  2282
rmdir .libs 2>/dev/null])
slouken@729
  2283
objdir=$lt_cv_objdir
slouken@3085
  2284
_LT_DECL([], [objdir], [0],
slouken@3085
  2285
         [The name of the directory that contains temporary libtool files])dnl
slouken@3085
  2286
m4_pattern_allow([LT_OBJDIR])dnl
slouken@3085
  2287
AC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/",
slouken@3085
  2288
  [Define to the sub-directory in which libtool stores uninstalled libraries.])
slouken@3085
  2289
])# _LT_CHECK_OBJDIR
slouken@3085
  2290
slouken@3085
  2291
slouken@3085
  2292
# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME])
slouken@3085
  2293
# --------------------------------------
slouken@729
  2294
# Check hardcoding attributes.
slouken@3085
  2295
m4_defun([_LT_LINKER_HARDCODE_LIBPATH],
slouken@729
  2296
[AC_MSG_CHECKING([how to hardcode library paths into programs])
slouken@3085
  2297
_LT_TAGVAR(hardcode_action, $1)=
slouken@3085
  2298
if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" ||
slouken@3085
  2299
   test -n "$_LT_TAGVAR(runpath_var, $1)" ||
slouken@3085
  2300
   test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then
slouken@3085
  2301
slouken@3085
  2302
  # We can hardcode non-existent directories.
slouken@3085
  2303
  if test "$_LT_TAGVAR(hardcode_direct, $1)" != no &&
slouken@729
  2304
     # If the only mechanism to avoid hardcoding is shlibpath_var, we
slouken@729
  2305
     # have to relink, otherwise we might link with an installed library
slouken@729
  2306
     # when we should be linking with a yet-to-be-installed one
slouken@3085
  2307
     ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
slouken@3085
  2308
     test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then
slouken@729
  2309
    # Linking always hardcodes the temporary library directory.
slouken@3085
  2310
    _LT_TAGVAR(hardcode_action, $1)=relink
slouken@729
  2311
  else
slouken@729
  2312
    # We can link without hardcoding, and we can hardcode nonexisting dirs.
slouken@3085
  2313
    _LT_TAGVAR(hardcode_action, $1)=immediate
slouken@729
  2314
  fi
slouken@729
  2315
else
slouken@729
  2316
  # We cannot hardcode anything, or else we can only hardcode existing
slouken@729
  2317
  # directories.
slouken@3085
  2318
  _LT_TAGVAR(hardcode_action, $1)=unsupported
slouken@729
  2319
fi
slouken@3085
  2320
AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)])
slouken@3085
  2321
slouken@3085
  2322
if test "$_LT_TAGVAR(hardcode_action, $1)" = relink ||
slouken@3085
  2323
   test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then
slouken@729
  2324
  # Fast installation is not supported
slouken@729
  2325
  enable_fast_install=no
slouken@729
  2326
elif test "$shlibpath_overrides_runpath" = yes ||
slouken@729
  2327
     test "$enable_shared" = no; then
slouken@729
  2328
  # Fast installation is not necessary
slouken@729
  2329
  enable_fast_install=needless
slouken@729
  2330
fi
slouken@3085
  2331
_LT_TAGDECL([], [hardcode_action], [0],
slouken@3085
  2332
    [How to hardcode a shared library path into an executable])
slouken@3085
  2333
])# _LT_LINKER_HARDCODE_LIBPATH
slouken@3085
  2334
slouken@3085
  2335
slouken@3085
  2336
# _LT_CMD_STRIPLIB
slouken@3085
  2337
# ----------------
slouken@3085
  2338
m4_defun([_LT_CMD_STRIPLIB],
slouken@3085
  2339
[m4_require([_LT_DECL_EGREP])
slouken@3085
  2340
striplib=
slouken@729
  2341
old_striplib=
slouken@729
  2342
AC_MSG_CHECKING([whether stripping libraries is possible])
slouken@3085
  2343
if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
slouken@729
  2344
  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
slouken@729
  2345
  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
slouken@729
  2346
  AC_MSG_RESULT([yes])
slouken@729
  2347
else
slouken@729
  2348
# FIXME - insert some real tests, host_os isn't really good enough
slouken@729
  2349
  case $host_os in
slouken@3085
  2350
  darwin*)
slouken@3085
  2351
    if test -n "$STRIP" ; then
slouken@3085
  2352
      striplib="$STRIP -x"
slouken@3085
  2353
      old_striplib="$STRIP -S"
slouken@3085
  2354
      AC_MSG_RESULT([yes])
slouken@3085
  2355
    else
slouken@3085
  2356
      AC_MSG_RESULT([no])
slouken@3085
  2357
    fi
slouken@3085
  2358
    ;;
slouken@3085
  2359
  *)
slouken@3085
  2360
    AC_MSG_RESULT([no])
slouken@729
  2361
    ;;
slouken@947
  2362
  esac
slouken@729
  2363
fi
slouken@3085
  2364
_LT_DECL([], [old_striplib], [1], [Commands to strip libraries])
slouken@3085
  2365
_LT_DECL([], [striplib], [1])
slouken@3085
  2366
])# _LT_CMD_STRIPLIB
slouken@3085
  2367
slouken@3085
  2368
slouken@3085
  2369
# _LT_SYS_DYNAMIC_LINKER([TAG])
slouken@729
  2370
# -----------------------------
slouken@729
  2371
# PORTME Fill in your ld.so characteristics
slouken@3085
  2372
m4_defun([_LT_SYS_DYNAMIC_LINKER],
slouken@3085
  2373
[AC_REQUIRE([AC_CANONICAL_HOST])dnl
slouken@3085
  2374
m4_require([_LT_DECL_EGREP])dnl
slouken@3085
  2375
m4_require([_LT_FILEUTILS_DEFAULTS])dnl
slouken@3085
  2376
m4_require([_LT_DECL_OBJDUMP])dnl
slouken@3085
  2377
m4_require([_LT_DECL_SED])dnl
slouken@3085
  2378
AC_MSG_CHECKING([dynamic linker characteristics])
slouken@3085
  2379
m4_if([$1],
slouken@3085
  2380
	[], [
slouken@3085
  2381
if test "$GCC" = yes; then
slouken@3085
  2382
  case $host_os in
slouken@3085
  2383
    darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
slouken@3085
  2384
    *) lt_awk_arg="/^libraries:/" ;;
slouken@3085
  2385
  esac
slouken@3085
  2386
  lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"`
slouken@3085
  2387
  if $ECHO "$lt_search_path_spec" | $GREP ';' >/dev/null ; then
slouken@3085
  2388
    # if the path contains ";" then we assume it to be the separator
slouken@3085
  2389
    # otherwise default to the standard path separator (i.e. ":") - it is
slouken@3085
  2390
    # assumed that no part of a normal pathname contains ";" but that should
slouken@3085
  2391
    # okay in the real world where ";" in dirpaths is itself problematic.
slouken@3085
  2392
    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e 's/;/ /g'`
slouken@3085
  2393
  else
slouken@3085
  2394
    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
slouken@3085
  2395
  fi
slouken@3085
  2396
  # Ok, now we have the path, separated by spaces, we can step through it
slouken@3085
  2397
  # and add multilib dir if necessary.
slouken@3085
  2398
  lt_tmp_lt_search_path_spec=
slouken@3085
  2399
  lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
slouken@3085
  2400
  for lt_sys_path in $lt_search_path_spec; do
slouken@3085
  2401
    if test -d "$lt_sys_path/$lt_multi_os_dir"; then
slouken@3085
  2402
      lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
slouken@3085
  2403
    else
slouken@3085
  2404
      test -d "$lt_sys_path" && \
slouken@3085
  2405
	lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
slouken@3085
  2406
    fi
slouken@3085
  2407
  done
slouken@3085
  2408
  lt_search_path_spec=`$ECHO $lt_tmp_lt_search_path_spec | awk '
slouken@3085
  2409
BEGIN {RS=" "; FS="/|\n";} {
slouken@3085
  2410
  lt_foo="";
slouken@3085
  2411
  lt_count=0;
slouken@3085
  2412
  for (lt_i = NF; lt_i > 0; lt_i--) {
slouken@3085
  2413
    if ($lt_i != "" && $lt_i != ".") {
slouken@3085
  2414
      if ($lt_i == "..") {
slouken@3085
  2415
        lt_count++;
slouken@3085
  2416
      } else {
slouken@3085
  2417
        if (lt_count == 0) {
slouken@3085
  2418
          lt_foo="/" $lt_i lt_foo;
slouken@3085
  2419
        } else {
slouken@3085
  2420
          lt_count--;
slouken@3085
  2421
        }
slouken@3085
  2422
      }
slouken@3085
  2423
    }
slouken@3085
  2424
  }
slouken@3085
  2425
  if (lt_foo != "") { lt_freq[[lt_foo]]++; }
slouken@3085
  2426
  if (lt_freq[[lt_foo]] == 1) { print lt_foo; }
slouken@3085
  2427
}'`
slouken@3085
  2428
  sys_lib_search_path_spec=`$ECHO $lt_search_path_spec`
slouken@3085
  2429
else
slouken@3085
  2430
  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
slouken@3085
  2431
fi])
slouken@729
  2432
library_names_spec=
slouken@729
  2433
libname_spec='lib$name'
slouken@729
  2434
soname_spec=
slouken@947
  2435
shrext_cmds=".so"
slouken@729
  2436
postinstall_cmds=
slouken@729
  2437
postuninstall_cmds=
slouken@729
  2438
finish_cmds=
slouken@729
  2439
finish_eval=
slouken@729
  2440
shlibpath_var=
slouken@729
  2441
shlibpath_overrides_runpath=unknown
slouken@729
  2442
version_type=none
slouken@729
  2443
dynamic_linker="$host_os ld.so"
slouken@729
  2444
sys_lib_dlsearch_path_spec="/lib /usr/lib"
slouken@729
  2445
need_lib_prefix=unknown
slouken@729
  2446
hardcode_into_libs=no
slouken@729
  2447
slouken@729
  2448
# when you set need_version to no, make sure it does not cause -set_version
slouken@729
  2449
# flags to be left without arguments
slouken@729
  2450
need_version=unknown
slouken@729
  2451
slouken@729
  2452
case $host_os in
slouken@729
  2453
aix3*)
slouken@729
  2454
  version_type=linux
slouken@729
  2455
  library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
slouken@729
  2456
  shlibpath_var=LIBPATH
slouken@729
  2457
slouken@729
  2458
  # AIX 3 has no versioning support, so we append a major version to the name.
slouken@729
  2459
  soname_spec='${libname}${release}${shared_ext}$major'
slouken@729
  2460
  ;;
slouken@729
  2461
slouken@3085
  2462
aix[[4-9]]*)
slouken@729
  2463
  version_type=linux
slouken@729
  2464
  need_lib_prefix=no
slouken@729
  2465
  need_version=no
slouken@729
  2466
  hardcode_into_libs=yes
slouken@729
  2467
  if test "$host_cpu" = ia64; then
slouken@729
  2468
    # AIX 5 supports IA64
slouken@729
  2469
    library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
slouken@729
  2470
    shlibpath_var=LD_LIBRARY_PATH
slouken@729
  2471
  else
slouken@729
  2472
    # With GCC up to 2.95.x, collect2 would create an import file
slouken@729
  2473
    # for dependence libraries.  The import file would start with
slouken@729
  2474
    # the line `#! .'.  This would cause the generated library to
slouken@729
  2475
    # depend on `.', always an invalid library.  This was fixed in
slouken@729
  2476
    # development snapshots of GCC prior to 3.0.
slouken@729
  2477
    case $host_os in
slouken@729
  2478
      aix4 | aix4.[[01]] | aix4.[[01]].*)
slouken@729
  2479
      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
slouken@729
  2480
	   echo ' yes '
slouken@3085
  2481
	   echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
slouken@729
  2482
	:
slouken@729
  2483
      else
slouken@729
  2484
	can_build_shared=no
slouken@729
  2485
      fi
slouken@729
  2486
      ;;
slouken@729
  2487
    esac
slouken@729
  2488
    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
slouken@729
  2489
    # soname into executable. Probably we can add versioning support to
slouken@729
  2490
    # collect2, so additional links can be useful in future.
slouken@729
  2491
    if test "$aix_use_runtimelinking" = yes; then
slouken@729
  2492
      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
slouken@729
  2493
      # instead of lib<name>.a to let people know that these are not
slouken@729
  2494
      # typical AIX shared libraries.
slouken@729
  2495
      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
slouken@729
  2496
    else
slouken@729
  2497
      # We preserve .a as extension for shared libraries through AIX4.2
slouken@729
  2498
      # and later when we are not doing run time linking.
slouken@729
  2499
      library_names_spec='${libname}${release}.a $libname.a'
slouken@729
  2500
      soname_spec='${libname}${release}${shared_ext}$major'
slouken@729
  2501
    fi
slouken@729
  2502
    shlibpath_var=LIBPATH
slouken@729
  2503
  fi
slouken@729
  2504
  ;;
slouken@729
  2505
slouken@729
  2506
amigaos*)
slouken@3085
  2507
  case $host_cpu in
slouken@3085
  2508
  powerpc)
slouken@3085
  2509
    # Since July 2007 AmigaOS4 officially supports .so libraries.
slouken@3085
  2510
    # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
slouken@3085
  2511
    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
slouken@3085
  2512
    ;;
slouken@3085
  2513
  m68k)
slouken@3085
  2514
    library_names_spec='$libname.ixlibrary $libname.a'
slouken@3085
  2515
    # Create ${libname}_ixlibrary.a entries in /sys/libs.
slouken@3085
  2516
    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@3085
  2517
    ;;
slouken@3085
  2518
  esac
slouken@729
  2519
  ;;
slouken@729
  2520
slouken@729
  2521
beos*)
slouken@729
  2522
  library_names_spec='${libname}${shared_ext}'
slouken@729
  2523
  dynamic_linker="$host_os ld.so"
slouken@729
  2524
  shlibpath_var=LIBRARY_PATH
slouken@729
  2525
  ;;
slouken@729
  2526
slouken@947
  2527
bsdi[[45]]*)
slouken@729
  2528
  version_type=linux
slouken@729
  2529
  need_version=no
slouken@729
  2530
  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
slouken@729
  2531
  soname_spec='${libname}${release}${shared_ext}$major'
slouken@729
  2532
  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
slouken@729
  2533
  shlibpath_var=LD_LIBRARY_PATH
slouken@729
  2534
  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
slouken@729
  2535
  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
slouken@729
  2536
  # the default ld.so.conf also contains /usr/contrib/lib and
slouken@729
  2537
  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
slouken@729
  2538
  # libtool to hard-code these into programs
slouken@729
  2539
  ;;
slouken@729
  2540
slouken@3085
  2541
cygwin* | mingw* | pw32* | cegcc*)
slouken@729
  2542
  version_type=windows
slouken@947
  2543
  shrext_cmds=".dll"
slouken@729
  2544
  need_version=no
slouken@729
  2545
  need_lib_prefix=no
slouken@729
  2546
slouken@729
  2547
  case $GCC,$host_os in
slouken@3085
  2548
  yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*)
slouken@729
  2549
    library_names_spec='$libname.dll.a'
slouken@729
  2550
    # DLL is installed to $(libdir)/../bin by postinstall_cmds
slouken@729
  2551
    postinstall_cmds='base_file=`basename \${file}`~
slouken@3085
  2552
      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
slouken@729
  2553
      dldir=$destdir/`dirname \$dlpath`~
slouken@729
  2554
      test -d \$dldir || mkdir -p \$dldir~
slouken@1570
  2555
      $install_prog $dir/$dlname \$dldir/$dlname~
slouken@3085
  2556
      chmod a+x \$dldir/$dlname~
slouken@3085
  2557
      if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
slouken@3085
  2558
        eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
slouken@3085
  2559
      fi'
slouken@729
  2560
    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
slouken@729
  2561
      dlpath=$dir/\$dldll~
slouken@3085
  2562
       $RM \$dlpath'
slouken@729
  2563
    shlibpath_overrides_runpath=yes
slouken@729
  2564
slouken@729
  2565
    case $host_os in
slouken@729
  2566
    cygwin*)
slouken@729
  2567
      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
slouken@729
  2568
      #soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
slouken@729
  2569
      soname_spec='`echo ${libname} | sed -e 's/^lib//'`${shared_ext}'
slouken@729
  2570
      sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
slouken@729
  2571
      ;;
slouken@3085
  2572
    mingw* | cegcc*)
slouken@729
  2573
      # MinGW DLLs use traditional 'lib' prefix
slouken@729
  2574
      #soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
slouken@3085
  2575
      soname_spec='`echo ${libname} | $SED -e 's/^lib//'`${shared_ext}'
slouken@3085
  2576
      sys_lib_search_path_spec=`$CC -print-search-dirs | $GREP "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
slouken@3085
  2577
      if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then
slouken@729
  2578
        # It is most probably a Windows format PATH printed by
slouken@729
  2579
        # mingw gcc, but we are running on Cygwin. Gcc prints its search
slouken@729
  2580
        # path with ; separators, and with drive letters. We can handle the
slouken@729
  2581
        # drive letters (cygwin fileutils understands them), so leave them,
slouken@729
  2582
        # especially as we might pass files found there to a mingw objdump,
slouken@729
  2583
        # which wouldn't understand a cygwinified path. Ahh.
slouken@3085
  2584
        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
slouken@729
  2585
      else
slouken@3085
  2586
        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
slouken@729
  2587
      fi
slouken@729
  2588
      ;;
slouken@729
  2589
    pw32*)
slouken@729
  2590
      # pw32 DLLs use 'pw' prefix rather than 'lib'
slouken@1570
  2591
      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
slouken@729
  2592
      ;;
slouken@729
  2593
    esac
slouken@729
  2594
    ;;
slouken@729
  2595
slouken@729
  2596
  *)
slouken@729
  2597
    library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
slouken@729
  2598
    ;;
slouken@729
  2599
  esac
slouken@729
  2600
  dynamic_linker='Win32 ld.exe'
slouken@729
  2601
  # FIXME: first we should search . and the directory the executable is in
slouken@729
  2602
  shlibpath_var=PATH
slouken@729
  2603
  ;;
slouken@729
  2604
slouken@729
  2605
darwin* | rhapsody*)
slouken@729
  2606
  dynamic_linker="$host_os dyld"
slouken@729
  2607
  version_type=darwin
slouken@729
  2608
  need_lib_prefix=no
slouken@729
  2609
  need_version=no
slouken@3085
  2610
  library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
slouken@729
  2611
  soname_spec='${libname}${release}${major}$shared_ext'
slouken@729
  2612
  shlibpath_overrides_runpath=yes
slouken@729
  2613
  shlibpath_var=DYLD_LIBRARY_PATH
slouken@1570
  2614
  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
slouken@3085
  2615
m4_if([$1], [],[
slouken@3085
  2616
  sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"])
slouken@729
  2617
  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
slouken@729
  2618
  ;;
slouken@729
  2619
slouken@729
  2620
dgux*)
slouken@729
  2621
  version_type=linux
slouken@729
  2622
  need_lib_prefix=no
slouken@729
  2623
  need_version=no
slouken@729
  2624
  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
slouken@729
  2625
  soname_spec='${libname}${release}${shared_ext}$major'
slouken@729
  2626
  shlibpath_var=LD_LIBRARY_PATH
slouken@729
  2627
  ;;
slouken@729
  2628
slouken@729
  2629
freebsd1*)
slouken@729
  2630
  dynamic_linker=no
slouken@729
  2631
  ;;
slouken@729
  2632
slouken@1570
  2633
freebsd* | dragonfly*)
slouken@1570
  2634
  # DragonFly does not have aout.  When/if they implement a new
slouken@1570
  2635
  # versioning mechanism, adjust this.
slouken@1570
  2636
  if test -x /usr/bin/objformat; then
slouken@1570
  2637
    objformat=`/usr/bin/objformat`
slouken@1570
  2638
  else
slouken@1570
  2639
    case $host_os in
slouken@1570
  2640
    freebsd[[123]]*) objformat=aout ;;
slouken@1570
  2641
    *) objformat=elf ;;
slouken@1570
  2642
    esac
slouken@1570
  2643
  fi
slouken@729
  2644
  version_type=freebsd-$objformat
slouken@729
  2645
  case $version_type in
slouken@729
  2646
    freebsd-elf*)
slouken@729
  2647
      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
slouken@729
  2648
      need_version=no
slouken@729
  2649
      need_lib_prefix=no
slouken@729
  2650
      ;;
slouken@729
  2651
    freebsd-*)
slouken@729
  2652
      library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
slouken@729
  2653
      need_version=yes
slouken@729
  2654
      ;;
slouken@729
  2655
  esac
slouken@729
  2656
  shlibpath_var=LD_LIBRARY_PATH
slouken@729
  2657
  case $host_os in
slouken@729
  2658
  freebsd2*)
slouken@729
  2659
    shlibpath_overrides_runpath=yes
slouken@729
  2660
    ;;
slouken@1570
  2661
  freebsd3.[[01]]* | freebsdelf3.[[01]]*)
slouken@729
  2662
    shlibpath_overrides_runpath=yes
slouken@729
  2663
    hardcode_into_libs=yes
slouken@729
  2664
    ;;
slouken@1570
  2665
  freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \
slouken@1570
  2666
  freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1)
slouken@729
  2667
    shlibpath_overrides_runpath=no
slouken@729
  2668
    hardcode_into_libs=yes
slouken@729
  2669
    ;;
slouken@3085
  2670