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