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