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