aclocal.m4
author David Ludwig <dludwig@pobox.com>
Wed, 17 Oct 2012 21:43:20 -0400
changeset 8316 88f011703f39
parent 6492 0732954fa8ef
child 6593 f20b511e05a6
permissions -rw-r--r--
Got a bare-bones version of SDL compiling for Windows RT. Dummy drivers are used in some places. Very little Windows-specific code (from the Win32 version of SDL) is used.
slouken@6492
     1
AC_DEFUN([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@6442
   699
# Based on libtool-2.4.2
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@6442
   703
#                 2006, 2007, 2008, 2009, 2010, 2011 Free Software
slouken@6442
   704
#                 Foundation, Inc.
slouken@5310
   705
#   Written by Gordon Matzigkeit, 1996
slouken@5310
   706
#
slouken@5310
   707
# This file is free software; the Free Software Foundation gives
slouken@5310
   708
# unlimited permission to copy and/or distribute it, with or without
slouken@5310
   709
# modifications, as long as this notice is preserved.
slouken@5310
   710
slouken@5310
   711
m4_define([_LT_COPYING], [dnl
slouken@5310
   712
#   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
slouken@6442
   713
#                 2006, 2007, 2008, 2009, 2010, 2011 Free Software
slouken@6442
   714
#                 Foundation, Inc.
slouken@5310
   715
#   Written by Gordon Matzigkeit, 1996
slouken@5310
   716
#
slouken@5310
   717
#   This file is part of GNU Libtool.
slouken@5310
   718
#
slouken@5310
   719
# GNU Libtool is free software; you can redistribute it and/or
slouken@5310
   720
# modify it under the terms of the GNU General Public License as
slouken@5310
   721
# published by the Free Software Foundation; either version 2 of
slouken@5310
   722
# the License, or (at your option) any later version.
slouken@5310
   723
#
slouken@5310
   724
# As a special exception to the GNU General Public License,
slouken@5310
   725
# if you distribute this file as part of a program or library that
slouken@5310
   726
# is built using GNU Libtool, you may include this file under the
slouken@5310
   727
# same distribution terms that you use for the rest of that program.
slouken@5310
   728
#
slouken@5310
   729
# GNU Libtool is distributed in the hope that it will be useful,
slouken@5310
   730
# but WITHOUT ANY WARRANTY; without even the implied warranty of
slouken@5310
   731
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
slouken@5310
   732
# GNU General Public License for more details.
slouken@5310
   733
#
slouken@5310
   734
# You should have received a copy of the GNU General Public License
slouken@5310
   735
# along with GNU Libtool; see the file COPYING.  If not, a copy
slouken@5310
   736
# can be downloaded from http://www.gnu.org/licenses/gpl.html, or
slouken@5310
   737
# obtained by writing to the Free Software Foundation, Inc.,
slouken@5310
   738
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
slouken@5310
   739
])
slouken@5310
   740
slouken@6442
   741
# serial 57 LT_INIT
slouken@5310
   742
slouken@5310
   743
slouken@5310
   744
# LT_PREREQ(VERSION)
slouken@5310
   745
# ------------------
slouken@5310
   746
# Complain and exit if this libtool version is less that VERSION.
slouken@5310
   747
m4_defun([LT_PREREQ],
slouken@5310
   748
[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1,
slouken@5310
   749
       [m4_default([$3],
slouken@5310
   750
		   [m4_fatal([Libtool version $1 or higher is required],
slouken@5310
   751
		             63)])],
slouken@5310
   752
       [$2])])
slouken@5310
   753
slouken@5310
   754
slouken@5310
   755
# _LT_CHECK_BUILDDIR
slouken@5310
   756
# ------------------
slouken@5310
   757
# Complain if the absolute build directory name contains unusual characters
slouken@5310
   758
m4_defun([_LT_CHECK_BUILDDIR],
slouken@5310
   759
[case `pwd` in
slouken@5310
   760
  *\ * | *\	*)
slouken@5310
   761
    AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;;
slouken@5310
   762
esac
slouken@5310
   763
])
slouken@5310
   764
slouken@5310
   765
slouken@5310
   766
# LT_INIT([OPTIONS])
slouken@5310
   767
# ------------------
slouken@5310
   768
AC_DEFUN([LT_INIT],
slouken@5310
   769
[AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT
slouken@6442
   770
AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
slouken@5310
   771
AC_BEFORE([$0], [LT_LANG])dnl
slouken@5310
   772
AC_BEFORE([$0], [LT_OUTPUT])dnl
slouken@5310
   773
AC_BEFORE([$0], [LTDL_INIT])dnl
slouken@5310
   774
m4_require([_LT_CHECK_BUILDDIR])dnl
slouken@5310
   775
slouken@5310
   776
dnl Autoconf doesn't catch unexpanded LT_ macros by default:
slouken@5310
   777
m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl
slouken@5310
   778
m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl
slouken@5310
   779
dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4
slouken@5310
   780
dnl unless we require an AC_DEFUNed macro:
slouken@5310
   781
AC_REQUIRE([LTOPTIONS_VERSION])dnl
slouken@5310
   782
AC_REQUIRE([LTSUGAR_VERSION])dnl
slouken@5310
   783
AC_REQUIRE([LTVERSION_VERSION])dnl
slouken@5310
   784
AC_REQUIRE([LTOBSOLETE_VERSION])dnl
slouken@5310
   785
m4_require([_LT_PROG_LTMAIN])dnl
slouken@5310
   786
slouken@6442
   787
_LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}])
slouken@6442
   788
slouken@5310
   789
dnl Parse OPTIONS
slouken@5310
   790
_LT_SET_OPTIONS([$0], [$1])
slouken@5310
   791
slouken@5310
   792
# This can be used to rebuild libtool when needed
slouken@5310
   793
LIBTOOL_DEPS="$ltmain"
slouken@5310
   794
slouken@5310
   795
# Always use our own libtool.
slouken@5310
   796
LIBTOOL='$(SHELL) $(top_builddir)/libtool'
slouken@5310
   797
AC_SUBST(LIBTOOL)dnl
slouken@5310
   798
slouken@5310
   799
_LT_SETUP
slouken@5310
   800
slouken@5310
   801
# Only expand once:
slouken@5310
   802
m4_define([LT_INIT])
slouken@5310
   803
])# LT_INIT
slouken@5310
   804
slouken@5310
   805
# Old names:
slouken@5310
   806
AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT])
slouken@5310
   807
AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT])
slouken@5310
   808
dnl aclocal-1.4 backwards compatibility:
slouken@5310
   809
dnl AC_DEFUN([AC_PROG_LIBTOOL], [])
slouken@5310
   810
dnl AC_DEFUN([AM_PROG_LIBTOOL], [])
slouken@5310
   811
slouken@5310
   812
slouken@5310
   813
# _LT_CC_BASENAME(CC)
slouken@5310
   814
# -------------------
slouken@5310
   815
# Calculate cc_basename.  Skip known compiler wrappers and cross-prefix.
slouken@5310
   816
m4_defun([_LT_CC_BASENAME],
slouken@5310
   817
[for cc_temp in $1""; do
slouken@5310
   818
  case $cc_temp in
slouken@5310
   819
    compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
slouken@5310
   820
    distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
slouken@5310
   821
    \-*) ;;
slouken@5310
   822
    *) break;;
slouken@5310
   823
  esac
slouken@5310
   824
done
slouken@6442
   825
cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
slouken@5310
   826
])
slouken@5310
   827
slouken@5310
   828
slouken@5310
   829
# _LT_FILEUTILS_DEFAULTS
slouken@5310
   830
# ----------------------
slouken@5310
   831
# It is okay to use these file commands and assume they have been set
slouken@5310
   832
# sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'.
slouken@5310
   833
m4_defun([_LT_FILEUTILS_DEFAULTS],
slouken@5310
   834
[: ${CP="cp -f"}
slouken@5310
   835
: ${MV="mv -f"}
slouken@5310
   836
: ${RM="rm -f"}
slouken@5310
   837
])# _LT_FILEUTILS_DEFAULTS
slouken@5310
   838
slouken@5310
   839
slouken@5310
   840
# _LT_SETUP
slouken@5310
   841
# ---------
slouken@5310
   842
m4_defun([_LT_SETUP],
slouken@5310
   843
[AC_REQUIRE([AC_CANONICAL_HOST])dnl
slouken@5310
   844
AC_REQUIRE([AC_CANONICAL_BUILD])dnl
slouken@6442
   845
AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl
slouken@6442
   846
AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl
slouken@6442
   847
slouken@6442
   848
_LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl
slouken@6442
   849
dnl
slouken@5310
   850
_LT_DECL([], [host_alias], [0], [The host system])dnl
slouken@5310
   851
_LT_DECL([], [host], [0])dnl
slouken@5310
   852
_LT_DECL([], [host_os], [0])dnl
slouken@5310
   853
dnl
slouken@5310
   854
_LT_DECL([], [build_alias], [0], [The build system])dnl
slouken@5310
   855
_LT_DECL([], [build], [0])dnl
slouken@5310
   856
_LT_DECL([], [build_os], [0])dnl
slouken@5310
   857
dnl
slouken@5310
   858
AC_REQUIRE([AC_PROG_CC])dnl
slouken@5310
   859
AC_REQUIRE([LT_PATH_LD])dnl
slouken@5310
   860
AC_REQUIRE([LT_PATH_NM])dnl
slouken@5310
   861
dnl
slouken@5310
   862
AC_REQUIRE([AC_PROG_LN_S])dnl
slouken@5310
   863
test -z "$LN_S" && LN_S="ln -s"
slouken@5310
   864
_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl
slouken@5310
   865
dnl
slouken@5310
   866
AC_REQUIRE([LT_CMD_MAX_LEN])dnl
slouken@5310
   867
_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl
slouken@5310
   868
_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl
slouken@5310
   869
dnl
slouken@5310
   870
m4_require([_LT_FILEUTILS_DEFAULTS])dnl
slouken@5310
   871
m4_require([_LT_CHECK_SHELL_FEATURES])dnl
slouken@6442
   872
m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl
slouken@5310
   873
m4_require([_LT_CMD_RELOAD])dnl
slouken@5310
   874
m4_require([_LT_CHECK_MAGIC_METHOD])dnl
slouken@6442
   875
m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl
slouken@5310
   876
m4_require([_LT_CMD_OLD_ARCHIVE])dnl
slouken@5310
   877
m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
slouken@6442
   878
m4_require([_LT_WITH_SYSROOT])dnl
slouken@5310
   879
slouken@5310
   880
_LT_CONFIG_LIBTOOL_INIT([
slouken@5310
   881
# See if we are running on zsh, and set the options which allow our
slouken@5310
   882
# commands through without removal of \ escapes INIT.
slouken@5310
   883
if test -n "\${ZSH_VERSION+set}" ; then
slouken@5310
   884
   setopt NO_GLOB_SUBST
slouken@5310
   885
fi
slouken@5310
   886
])
slouken@5310
   887
if test -n "${ZSH_VERSION+set}" ; then
slouken@5310
   888
   setopt NO_GLOB_SUBST
slouken@5310
   889
fi
slouken@5310
   890
slouken@5310
   891
_LT_CHECK_OBJDIR
slouken@5310
   892
slouken@5310
   893
m4_require([_LT_TAG_COMPILER])dnl
slouken@5310
   894
slouken@5310
   895
case $host_os in
slouken@5310
   896
aix3*)
slouken@5310
   897
  # AIX sometimes has problems with the GCC collect2 program.  For some
slouken@5310
   898
  # reason, if we set the COLLECT_NAMES environment variable, the problems
slouken@5310
   899
  # vanish in a puff of smoke.
slouken@5310
   900
  if test "X${COLLECT_NAMES+set}" != Xset; then
slouken@5310
   901
    COLLECT_NAMES=
slouken@5310
   902
    export COLLECT_NAMES
slouken@5310
   903
  fi
slouken@5310
   904
  ;;
slouken@5310
   905
esac
slouken@5310
   906
slouken@5310
   907
# Global variables:
slouken@5310
   908
ofile=libtool
slouken@5310
   909
can_build_shared=yes
slouken@5310
   910
slouken@5310
   911
# All known linkers require a `.a' archive for static linking (except MSVC,
slouken@5310
   912
# which needs '.lib').
slouken@5310
   913
libext=a
slouken@5310
   914
slouken@5310
   915
with_gnu_ld="$lt_cv_prog_gnu_ld"
slouken@5310
   916
slouken@5310
   917
old_CC="$CC"
slouken@5310
   918
old_CFLAGS="$CFLAGS"
slouken@5310
   919
slouken@5310
   920
# Set sane defaults for various variables
slouken@5310
   921
test -z "$CC" && CC=cc
slouken@5310
   922
test -z "$LTCC" && LTCC=$CC
slouken@5310
   923
test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
slouken@5310
   924
test -z "$LD" && LD=ld
slouken@5310
   925
test -z "$ac_objext" && ac_objext=o
slouken@5310
   926
slouken@5310
   927
_LT_CC_BASENAME([$compiler])
slouken@5310
   928
slouken@5310
   929
# Only perform the check for file, if the check method requires it
slouken@5310
   930
test -z "$MAGIC_CMD" && MAGIC_CMD=file
slouken@5310
   931
case $deplibs_check_method in
slouken@5310
   932
file_magic*)
slouken@5310
   933
  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
slouken@5310
   934
    _LT_PATH_MAGIC
slouken@5310
   935
  fi
slouken@5310
   936
  ;;
slouken@5310
   937
esac
slouken@5310
   938
slouken@5310
   939
# Use C for the default configuration in the libtool script
slouken@5310
   940
LT_SUPPORTED_TAG([CC])
slouken@5310
   941
_LT_LANG_C_CONFIG
slouken@5310
   942
_LT_LANG_DEFAULT_CONFIG
slouken@5310
   943
_LT_CONFIG_COMMANDS
slouken@5310
   944
])# _LT_SETUP
slouken@5310
   945
slouken@5310
   946
slouken@6442
   947
# _LT_PREPARE_SED_QUOTE_VARS
slouken@6442
   948
# --------------------------
slouken@6442
   949
# Define a few sed substitution that help us do robust quoting.
slouken@6442
   950
m4_defun([_LT_PREPARE_SED_QUOTE_VARS],
slouken@6442
   951
[# Backslashify metacharacters that are still active within
slouken@6442
   952
# double-quoted strings.
slouken@6442
   953
sed_quote_subst='s/\([["`$\\]]\)/\\\1/g'
slouken@6442
   954
slouken@6442
   955
# Same as above, but do not quote variable references.
slouken@6442
   956
double_quote_subst='s/\([["`\\]]\)/\\\1/g'
slouken@6442
   957
slouken@6442
   958
# Sed substitution to delay expansion of an escaped shell variable in a
slouken@6442
   959
# double_quote_subst'ed string.
slouken@6442
   960
delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
slouken@6442
   961
slouken@6442
   962
# Sed substitution to delay expansion of an escaped single quote.
slouken@6442
   963
delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
slouken@6442
   964
slouken@6442
   965
# Sed substitution to avoid accidental globbing in evaled expressions
slouken@6442
   966
no_glob_subst='s/\*/\\\*/g'
slouken@6442
   967
])
slouken@6442
   968
slouken@5310
   969
# _LT_PROG_LTMAIN
slouken@5310
   970
# ---------------
slouken@5310
   971
# Note that this code is called both from `configure', and `config.status'
slouken@5310
   972
# now that we use AC_CONFIG_COMMANDS to generate libtool.  Notably,
slouken@5310
   973
# `config.status' has no value for ac_aux_dir unless we are using Automake,
slouken@5310
   974
# so we pass a copy along to make sure it has a sensible value anyway.
slouken@5310
   975
m4_defun([_LT_PROG_LTMAIN],
slouken@5310
   976
[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl
slouken@5310
   977
_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir'])
slouken@5310
   978
ltmain="$ac_aux_dir/ltmain.sh"
slouken@5310
   979
])# _LT_PROG_LTMAIN
slouken@5310
   980
slouken@5310
   981
slouken@5310
   982
## ------------------------------------- ##
slouken@5310
   983
## Accumulate code for creating libtool. ##
slouken@5310
   984
## ------------------------------------- ##
slouken@5310
   985
slouken@5310
   986
# So that we can recreate a full libtool script including additional
slouken@5310
   987
# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS
slouken@5310
   988
# in macros and then make a single call at the end using the `libtool'
slouken@5310
   989
# label.
slouken@5310
   990
slouken@5310
   991
slouken@5310
   992
# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS])
slouken@5310
   993
# ----------------------------------------
slouken@5310
   994
# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later.
slouken@5310
   995
m4_define([_LT_CONFIG_LIBTOOL_INIT],
slouken@5310
   996
[m4_ifval([$1],
slouken@5310
   997
          [m4_append([_LT_OUTPUT_LIBTOOL_INIT],
slouken@5310
   998
                     [$1
slouken@5310
   999
])])])
slouken@5310
  1000
slouken@5310
  1001
# Initialize.
slouken@5310
  1002
m4_define([_LT_OUTPUT_LIBTOOL_INIT])
slouken@5310
  1003
slouken@5310
  1004
slouken@5310
  1005
# _LT_CONFIG_LIBTOOL([COMMANDS])
slouken@5310
  1006
# ------------------------------
slouken@5310
  1007
# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later.
slouken@5310
  1008
m4_define([_LT_CONFIG_LIBTOOL],
slouken@5310
  1009
[m4_ifval([$1],
slouken@5310
  1010
          [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS],
slouken@5310
  1011
                     [$1
slouken@5310
  1012
])])])
slouken@5310
  1013
slouken@5310
  1014
# Initialize.
slouken@5310
  1015
m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS])
slouken@5310
  1016
slouken@5310
  1017
slouken@5310
  1018
# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS])
slouken@5310
  1019
# -----------------------------------------------------
slouken@5310
  1020
m4_defun([_LT_CONFIG_SAVE_COMMANDS],
slouken@5310
  1021
[_LT_CONFIG_LIBTOOL([$1])
slouken@5310
  1022
_LT_CONFIG_LIBTOOL_INIT([$2])
slouken@5310
  1023
])
slouken@5310
  1024
slouken@5310
  1025
slouken@5310
  1026
# _LT_FORMAT_COMMENT([COMMENT])
slouken@5310
  1027
# -----------------------------
slouken@5310
  1028
# Add leading comment marks to the start of each line, and a trailing
slouken@5310
  1029
# full-stop to the whole comment if one is not present already.
slouken@5310
  1030
m4_define([_LT_FORMAT_COMMENT],
slouken@5310
  1031
[m4_ifval([$1], [
slouken@5310
  1032
m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])],
slouken@5310
  1033
              [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.])
slouken@5310
  1034
)])
slouken@5310
  1035
slouken@5310
  1036
slouken@5310
  1037
slouken@5310
  1038
## ------------------------ ##
slouken@5310
  1039
## FIXME: Eliminate VARNAME ##
slouken@5310
  1040
## ------------------------ ##
slouken@5310
  1041
slouken@5310
  1042
slouken@5310
  1043
# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?])
slouken@5310
  1044
# -------------------------------------------------------------------
slouken@5310
  1045
# CONFIGNAME is the name given to the value in the libtool script.
slouken@5310
  1046
# VARNAME is the (base) name used in the configure script.
slouken@5310
  1047
# VALUE may be 0, 1 or 2 for a computed quote escaped value based on
slouken@5310
  1048
# VARNAME.  Any other value will be used directly.
slouken@5310
  1049
m4_define([_LT_DECL],
slouken@5310
  1050
[lt_if_append_uniq([lt_decl_varnames], [$2], [, ],
slouken@5310
  1051
    [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name],
slouken@5310
  1052
	[m4_ifval([$1], [$1], [$2])])
slouken@5310
  1053
    lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3])
slouken@5310
  1054
    m4_ifval([$4],
slouken@5310
  1055
	[lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])])
slouken@5310
  1056
    lt_dict_add_subkey([lt_decl_dict], [$2],
slouken@5310
  1057
	[tagged?], [m4_ifval([$5], [yes], [no])])])
slouken@5310
  1058
])
slouken@5310
  1059
slouken@5310
  1060
slouken@5310
  1061
# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION])
slouken@5310
  1062
# --------------------------------------------------------
slouken@5310
  1063
m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])])
slouken@5310
  1064
slouken@5310
  1065
slouken@5310
  1066
# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...])
slouken@5310
  1067
# ------------------------------------------------
slouken@5310
  1068
m4_define([lt_decl_tag_varnames],
slouken@5310
  1069
[_lt_decl_filter([tagged?], [yes], $@)])
slouken@5310
  1070
slouken@5310
  1071
slouken@5310
  1072
# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..])
slouken@5310
  1073
# ---------------------------------------------------------
slouken@5310
  1074
m4_define([_lt_decl_filter],
slouken@5310
  1075
[m4_case([$#],
slouken@5310
  1076
  [0], [m4_fatal([$0: too few arguments: $#])],
slouken@5310
  1077
  [1], [m4_fatal([$0: too few arguments: $#: $1])],
slouken@5310
  1078
  [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)],
slouken@5310
  1079
  [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)],
slouken@5310
  1080
  [lt_dict_filter([lt_decl_dict], $@)])[]dnl
slouken@5310
  1081
])
slouken@5310
  1082
slouken@5310
  1083
slouken@5310
  1084
# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...])
slouken@5310
  1085
# --------------------------------------------------
slouken@5310
  1086
m4_define([lt_decl_quote_varnames],
slouken@5310
  1087
[_lt_decl_filter([value], [1], $@)])
slouken@5310
  1088
slouken@5310
  1089
slouken@5310
  1090
# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...])
slouken@5310
  1091
# ---------------------------------------------------
slouken@5310
  1092
m4_define([lt_decl_dquote_varnames],
slouken@5310
  1093
[_lt_decl_filter([value], [2], $@)])
slouken@5310
  1094
slouken@5310
  1095
slouken@5310
  1096
# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...])
slouken@5310
  1097
# ---------------------------------------------------
slouken@5310
  1098
m4_define([lt_decl_varnames_tagged],
slouken@5310
  1099
[m4_assert([$# <= 2])dnl
slouken@5310
  1100
_$0(m4_quote(m4_default([$1], [[, ]])),
slouken@5310
  1101
    m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]),
slouken@5310
  1102
    m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))])
slouken@5310
  1103
m4_define([_lt_decl_varnames_tagged],
slouken@5310
  1104
[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])])
slouken@5310
  1105
slouken@5310
  1106
slouken@5310
  1107
# lt_decl_all_varnames([SEPARATOR], [VARNAME1...])
slouken@5310
  1108
# ------------------------------------------------
slouken@5310
  1109
m4_define([lt_decl_all_varnames],
slouken@5310
  1110
[_$0(m4_quote(m4_default([$1], [[, ]])),
slouken@5310
  1111
     m4_if([$2], [],
slouken@5310
  1112
	   m4_quote(lt_decl_varnames),
slouken@5310
  1113
	m4_quote(m4_shift($@))))[]dnl
slouken@5310
  1114
])
slouken@5310
  1115
m4_define([_lt_decl_all_varnames],
slouken@5310
  1116
[lt_join($@, lt_decl_varnames_tagged([$1],
slouken@5310
  1117
			lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl
slouken@5310
  1118
])
slouken@5310
  1119
slouken@5310
  1120
slouken@5310
  1121
# _LT_CONFIG_STATUS_DECLARE([VARNAME])
slouken@5310
  1122
# ------------------------------------
slouken@5310
  1123
# Quote a variable value, and forward it to `config.status' so that its
slouken@5310
  1124
# declaration there will have the same value as in `configure'.  VARNAME
slouken@5310
  1125
# must have a single quote delimited value for this to work.
slouken@5310
  1126
m4_define([_LT_CONFIG_STATUS_DECLARE],
slouken@6442
  1127
[$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`'])
slouken@5310
  1128
slouken@5310
  1129
slouken@5310
  1130
# _LT_CONFIG_STATUS_DECLARATIONS
slouken@5310
  1131
# ------------------------------
slouken@5310
  1132
# We delimit libtool config variables with single quotes, so when
slouken@5310
  1133
# we write them to config.status, we have to be sure to quote all
slouken@5310
  1134
# embedded single quotes properly.  In configure, this macro expands
slouken@5310
  1135
# each variable declared with _LT_DECL (and _LT_TAGDECL) into:
slouken@5310
  1136
#
slouken@6442
  1137
#    <var>='`$ECHO "$<var>" | $SED "$delay_single_quote_subst"`'
slouken@5310
  1138
m4_defun([_LT_CONFIG_STATUS_DECLARATIONS],
slouken@5310
  1139
[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames),
slouken@5310
  1140
    [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])])
slouken@5310
  1141
slouken@5310
  1142
slouken@5310
  1143
# _LT_LIBTOOL_TAGS
slouken@5310
  1144
# ----------------
slouken@5310
  1145
# Output comment and list of tags supported by the script
slouken@5310
  1146
m4_defun([_LT_LIBTOOL_TAGS],
slouken@5310
  1147
[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl
slouken@5310
  1148
available_tags="_LT_TAGS"dnl
slouken@5310
  1149
])
slouken@5310
  1150
slouken@5310
  1151
slouken@5310
  1152
# _LT_LIBTOOL_DECLARE(VARNAME, [TAG])
slouken@5310
  1153
# -----------------------------------
slouken@5310
  1154
# Extract the dictionary values for VARNAME (optionally with TAG) and
slouken@5310
  1155
# expand to a commented shell variable setting:
slouken@5310
  1156
#
slouken@5310
  1157
#    # Some comment about what VAR is for.
slouken@5310
  1158
#    visible_name=$lt_internal_name
slouken@5310
  1159
m4_define([_LT_LIBTOOL_DECLARE],
slouken@5310
  1160
[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1],
slouken@5310
  1161
					   [description])))[]dnl
slouken@5310
  1162
m4_pushdef([_libtool_name],
slouken@5310
  1163
    m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl
slouken@5310
  1164
m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])),
slouken@5310
  1165
    [0], [_libtool_name=[$]$1],
slouken@5310
  1166
    [1], [_libtool_name=$lt_[]$1],
slouken@5310
  1167
    [2], [_libtool_name=$lt_[]$1],
slouken@5310
  1168
    [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl
slouken@5310
  1169
m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl
slouken@5310
  1170
])
slouken@5310
  1171
slouken@5310
  1172
slouken@5310
  1173
# _LT_LIBTOOL_CONFIG_VARS
slouken@5310
  1174
# -----------------------
slouken@5310
  1175
# Produce commented declarations of non-tagged libtool config variables
slouken@5310
  1176
# suitable for insertion in the LIBTOOL CONFIG section of the `libtool'
slouken@5310
  1177
# script.  Tagged libtool config variables (even for the LIBTOOL CONFIG
slouken@5310
  1178
# section) are produced by _LT_LIBTOOL_TAG_VARS.
slouken@5310
  1179
m4_defun([_LT_LIBTOOL_CONFIG_VARS],
slouken@5310
  1180
[m4_foreach([_lt_var],
slouken@5310
  1181
    m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)),
slouken@5310
  1182
    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])])
slouken@5310
  1183
slouken@5310
  1184
slouken@5310
  1185
# _LT_LIBTOOL_TAG_VARS(TAG)
slouken@5310
  1186
# -------------------------
slouken@5310
  1187
m4_define([_LT_LIBTOOL_TAG_VARS],
slouken@5310
  1188
[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames),
slouken@5310
  1189
    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])])
slouken@5310
  1190
slouken@5310
  1191
slouken@5310
  1192
# _LT_TAGVAR(VARNAME, [TAGNAME])
slouken@5310
  1193
# ------------------------------
slouken@5310
  1194
m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])])
slouken@5310
  1195
slouken@5310
  1196
slouken@5310
  1197
# _LT_CONFIG_COMMANDS
slouken@5310
  1198
# -------------------
slouken@5310
  1199
# Send accumulated output to $CONFIG_STATUS.  Thanks to the lists of
slouken@5310
  1200
# variables for single and double quote escaping we saved from calls
slouken@5310
  1201
# to _LT_DECL, we can put quote escaped variables declarations
slouken@5310
  1202
# into `config.status', and then the shell code to quote escape them in
slouken@5310
  1203
# for loops in `config.status'.  Finally, any additional code accumulated
slouken@5310
  1204
# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded.
slouken@5310
  1205
m4_defun([_LT_CONFIG_COMMANDS],
slouken@5310
  1206
[AC_PROVIDE_IFELSE([LT_OUTPUT],
slouken@5310
  1207
	dnl If the libtool generation code has been placed in $CONFIG_LT,
slouken@5310
  1208
	dnl instead of duplicating it all over again into config.status,
slouken@5310
  1209
	dnl then we will have config.status run $CONFIG_LT later, so it
slouken@5310
  1210
	dnl needs to know what name is stored there:
slouken@5310
  1211
        [AC_CONFIG_COMMANDS([libtool],
slouken@5310
  1212
            [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])],
slouken@5310
  1213
    dnl If the libtool generation code is destined for config.status,
slouken@5310
  1214
    dnl expand the accumulated commands and init code now:
slouken@5310
  1215
    [AC_CONFIG_COMMANDS([libtool],
slouken@5310
  1216
        [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])])
slouken@5310
  1217
])#_LT_CONFIG_COMMANDS
slouken@5310
  1218
slouken@5310
  1219
slouken@5310
  1220
# Initialize.
slouken@5310
  1221
m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT],
slouken@5310
  1222
[
slouken@5310
  1223
slouken@5310
  1224
# The HP-UX ksh and POSIX shell print the target directory to stdout
slouken@5310
  1225
# if CDPATH is set.
slouken@5310
  1226
(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
slouken@5310
  1227
slouken@5310
  1228
sed_quote_subst='$sed_quote_subst'
slouken@5310
  1229
double_quote_subst='$double_quote_subst'
slouken@5310
  1230
delay_variable_subst='$delay_variable_subst'
slouken@5310
  1231
_LT_CONFIG_STATUS_DECLARATIONS
slouken@5310
  1232
LTCC='$LTCC'
slouken@5310
  1233
LTCFLAGS='$LTCFLAGS'
slouken@5310
  1234
compiler='$compiler_DEFAULT'
slouken@5310
  1235
slouken@6442
  1236
# A function that is used when there is no print builtin or printf.
slouken@6442
  1237
func_fallback_echo ()
slouken@6442
  1238
{
slouken@6442
  1239
  eval 'cat <<_LTECHO_EOF
slouken@6442
  1240
\$[]1
slouken@6442
  1241
_LTECHO_EOF'
slouken@6442
  1242
}
slouken@6442
  1243
slouken@5310
  1244
# Quote evaled strings.
slouken@5310
  1245
for var in lt_decl_all_varnames([[ \
slouken@5310
  1246
]], lt_decl_quote_varnames); do
slouken@6442
  1247
    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
slouken@5310
  1248
    *[[\\\\\\\`\\"\\\$]]*)
slouken@6442
  1249
      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
slouken@5310
  1250
      ;;
slouken@5310
  1251
    *)
slouken@5310
  1252
      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
slouken@5310
  1253
      ;;
slouken@5310
  1254
    esac
slouken@5310
  1255
done
slouken@5310
  1256
slouken@5310
  1257
# Double-quote double-evaled strings.
slouken@5310
  1258
for var in lt_decl_all_varnames([[ \
slouken@5310
  1259
]], lt_decl_dquote_varnames); do
slouken@6442
  1260
    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
slouken@5310
  1261
    *[[\\\\\\\`\\"\\\$]]*)
slouken@6442
  1262
      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
slouken@5310
  1263
      ;;
slouken@5310
  1264
    *)
slouken@5310
  1265
      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
slouken@5310
  1266
      ;;
slouken@5310
  1267
    esac
slouken@5310
  1268
done
slouken@5310
  1269
slouken@5310
  1270
_LT_OUTPUT_LIBTOOL_INIT
slouken@5310
  1271
])
slouken@5310
  1272
slouken@6442
  1273
# _LT_GENERATED_FILE_INIT(FILE, [COMMENT])
slouken@6442
  1274
# ------------------------------------
slouken@6442
  1275
# Generate a child script FILE with all initialization necessary to
slouken@6442
  1276
# reuse the environment learned by the parent script, and make the
slouken@6442
  1277
# file executable.  If COMMENT is supplied, it is inserted after the
slouken@6442
  1278
# `#!' sequence but before initialization text begins.  After this
slouken@6442
  1279
# macro, additional text can be appended to FILE to form the body of
slouken@6442
  1280
# the child script.  The macro ends with non-zero status if the
slouken@6442
  1281
# file could not be fully written (such as if the disk is full).
slouken@6442
  1282
m4_ifdef([AS_INIT_GENERATED],
slouken@6442
  1283
[m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])],
slouken@6442
  1284
[m4_defun([_LT_GENERATED_FILE_INIT],
slouken@6442
  1285
[m4_require([AS_PREPARE])]dnl
slouken@6442
  1286
[m4_pushdef([AS_MESSAGE_LOG_FD])]dnl
slouken@6442
  1287
[lt_write_fail=0
slouken@6442
  1288
cat >$1 <<_ASEOF || lt_write_fail=1
slouken@6442
  1289
#! $SHELL
slouken@6442
  1290
# Generated by $as_me.
slouken@6442
  1291
$2
slouken@6442
  1292
SHELL=\${CONFIG_SHELL-$SHELL}
slouken@6442
  1293
export SHELL
slouken@6442
  1294
_ASEOF
slouken@6442
  1295
cat >>$1 <<\_ASEOF || lt_write_fail=1
slouken@6442
  1296
AS_SHELL_SANITIZE
slouken@6442
  1297
_AS_PREPARE
slouken@6442
  1298
exec AS_MESSAGE_FD>&1
slouken@6442
  1299
_ASEOF
slouken@6442
  1300
test $lt_write_fail = 0 && chmod +x $1[]dnl
slouken@6442
  1301
m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT
slouken@5310
  1302
slouken@5310
  1303
# LT_OUTPUT
slouken@5310
  1304
# ---------
slouken@5310
  1305
# This macro allows early generation of the libtool script (before
slouken@5310
  1306
# AC_OUTPUT is called), incase it is used in configure for compilation
slouken@5310
  1307
# tests.
slouken@5310
  1308
AC_DEFUN([LT_OUTPUT],
slouken@5310
  1309
[: ${CONFIG_LT=./config.lt}
slouken@5310
  1310
AC_MSG_NOTICE([creating $CONFIG_LT])
slouken@6442
  1311
_LT_GENERATED_FILE_INIT(["$CONFIG_LT"],
slouken@6442
  1312
[# Run this file to recreate a libtool stub with the current configuration.])
slouken@6442
  1313
slouken@6442
  1314
cat >>"$CONFIG_LT" <<\_LTEOF
slouken@5310
  1315
lt_cl_silent=false
slouken@5310
  1316
exec AS_MESSAGE_LOG_FD>>config.log
slouken@5310
  1317
{
slouken@5310
  1318
  echo
slouken@5310
  1319
  AS_BOX([Running $as_me.])
slouken@5310
  1320
} >&AS_MESSAGE_LOG_FD
slouken@5310
  1321
slouken@5310
  1322
lt_cl_help="\
slouken@5310
  1323
\`$as_me' creates a local libtool stub from the current configuration,
slouken@5310
  1324
for use in further configure time tests before the real libtool is
slouken@5310
  1325
generated.
slouken@5310
  1326
slouken@5310
  1327
Usage: $[0] [[OPTIONS]]
slouken@5310
  1328
slouken@5310
  1329
  -h, --help      print this help, then exit
slouken@5310
  1330
  -V, --version   print version number, then exit
slouken@5310
  1331
  -q, --quiet     do not print progress messages
slouken@5310
  1332
  -d, --debug     don't remove temporary files
slouken@5310
  1333
slouken@5310
  1334
Report bugs to <bug-libtool@gnu.org>."
slouken@5310
  1335
slouken@5310
  1336
lt_cl_version="\
slouken@5310
  1337
m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl
slouken@5310
  1338
m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])
slouken@5310
  1339
configured by $[0], generated by m4_PACKAGE_STRING.
slouken@5310
  1340
slouken@6442
  1341
Copyright (C) 2011 Free Software Foundation, Inc.
slouken@5310
  1342
This config.lt script is free software; the Free Software Foundation
slouken@5310
  1343
gives unlimited permision to copy, distribute and modify it."
slouken@5310
  1344
slouken@5310
  1345
while test $[#] != 0
slouken@5310
  1346
do
slouken@5310
  1347
  case $[1] in
slouken@5310
  1348
    --version | --v* | -V )
slouken@5310
  1349
      echo "$lt_cl_version"; exit 0 ;;
slouken@5310
  1350
    --help | --h* | -h )
slouken@5310
  1351
      echo "$lt_cl_help"; exit 0 ;;
slouken@5310
  1352
    --debug | --d* | -d )
slouken@5310
  1353
      debug=: ;;
slouken@5310
  1354
    --quiet | --q* | --silent | --s* | -q )
slouken@5310
  1355
      lt_cl_silent=: ;;
slouken@5310
  1356
slouken@5310
  1357
    -*) AC_MSG_ERROR([unrecognized option: $[1]
slouken@5310
  1358
Try \`$[0] --help' for more information.]) ;;
slouken@5310
  1359
slouken@5310
  1360
    *) AC_MSG_ERROR([unrecognized argument: $[1]
slouken@5310
  1361
Try \`$[0] --help' for more information.]) ;;
slouken@5310
  1362
  esac
slouken@5310
  1363
  shift
slouken@5310
  1364
done
slouken@5310
  1365
slouken@5310
  1366
if $lt_cl_silent; then
slouken@5310
  1367
  exec AS_MESSAGE_FD>/dev/null
slouken@5310
  1368
fi
slouken@5310
  1369
_LTEOF
slouken@5310
  1370
slouken@5310
  1371
cat >>"$CONFIG_LT" <<_LTEOF
slouken@5310
  1372
_LT_OUTPUT_LIBTOOL_COMMANDS_INIT
slouken@5310
  1373
_LTEOF
slouken@5310
  1374
slouken@5310
  1375
cat >>"$CONFIG_LT" <<\_LTEOF
slouken@5310
  1376
AC_MSG_NOTICE([creating $ofile])
slouken@5310
  1377
_LT_OUTPUT_LIBTOOL_COMMANDS
slouken@5310
  1378
AS_EXIT(0)
slouken@5310
  1379
_LTEOF
slouken@5310
  1380
chmod +x "$CONFIG_LT"
slouken@5310
  1381
slouken@5310
  1382
# configure is writing to config.log, but config.lt does its own redirection,
slouken@5310
  1383
# appending to config.log, which fails on DOS, as config.log is still kept
slouken@5310
  1384
# open by configure.  Here we exec the FD to /dev/null, effectively closing
slouken@5310
  1385
# config.log, so it can be properly (re)opened and appended to by config.lt.
slouken@6442
  1386
lt_cl_success=:
slouken@6442
  1387
test "$silent" = yes &&
slouken@6442
  1388
  lt_config_lt_args="$lt_config_lt_args --quiet"
slouken@6442
  1389
exec AS_MESSAGE_LOG_FD>/dev/null
slouken@6442
  1390
$SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false
slouken@6442
  1391
exec AS_MESSAGE_LOG_FD>>config.log
slouken@6442
  1392
$lt_cl_success || AS_EXIT(1)
slouken@5310
  1393
])# LT_OUTPUT
slouken@5310
  1394
slouken@5310
  1395
slouken@5310
  1396
# _LT_CONFIG(TAG)
slouken@5310
  1397
# ---------------
slouken@5310
  1398
# If TAG is the built-in tag, create an initial libtool script with a
slouken@5310
  1399
# default configuration from the untagged config vars.  Otherwise add code
slouken@5310
  1400
# to config.status for appending the configuration named by TAG from the
slouken@5310
  1401
# matching tagged config vars.
slouken@5310
  1402
m4_defun([_LT_CONFIG],
slouken@5310
  1403
[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
slouken@5310
  1404
_LT_CONFIG_SAVE_COMMANDS([
slouken@5310
  1405
  m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl
slouken@5310
  1406
  m4_if(_LT_TAG, [C], [
slouken@5310
  1407
    # See if we are running on zsh, and set the options which allow our
slouken@5310
  1408
    # commands through without removal of \ escapes.
slouken@5310
  1409
    if test -n "${ZSH_VERSION+set}" ; then
slouken@5310
  1410
      setopt NO_GLOB_SUBST
slouken@5310
  1411
    fi
slouken@5310
  1412
slouken@5310
  1413
    cfgfile="${ofile}T"
slouken@5310
  1414
    trap "$RM \"$cfgfile\"; exit 1" 1 2 15
slouken@5310
  1415
    $RM "$cfgfile"
slouken@5310
  1416
slouken@5310
  1417
    cat <<_LT_EOF >> "$cfgfile"
slouken@5310
  1418
#! $SHELL
slouken@5310
  1419
slouken@5310
  1420
# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
slouken@5310
  1421
# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION
slouken@5310
  1422
# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
slouken@5310
  1423
# NOTE: Changes made to this file will be lost: look at ltmain.sh.
slouken@5310
  1424
#
slouken@5310
  1425
_LT_COPYING
slouken@5310
  1426
_LT_LIBTOOL_TAGS
slouken@5310
  1427
slouken@5310
  1428
# ### BEGIN LIBTOOL CONFIG
slouken@5310
  1429
_LT_LIBTOOL_CONFIG_VARS
slouken@5310
  1430
_LT_LIBTOOL_TAG_VARS
slouken@5310
  1431
# ### END LIBTOOL CONFIG
slouken@5310
  1432
slouken@5310
  1433
_LT_EOF
slouken@5310
  1434
slouken@5310
  1435
  case $host_os in
slouken@5310
  1436
  aix3*)
slouken@5310
  1437
    cat <<\_LT_EOF >> "$cfgfile"
slouken@5310
  1438
# AIX sometimes has problems with the GCC collect2 program.  For some
slouken@5310
  1439
# reason, if we set the COLLECT_NAMES environment variable, the problems
slouken@5310
  1440
# vanish in a puff of smoke.
slouken@5310
  1441
if test "X${COLLECT_NAMES+set}" != Xset; then
slouken@5310
  1442
  COLLECT_NAMES=
slouken@5310
  1443
  export COLLECT_NAMES
slouken@5310
  1444
fi
slouken@5310
  1445
_LT_EOF
slouken@5310
  1446
    ;;
slouken@5310
  1447
  esac
slouken@5310
  1448
slouken@5310
  1449
  _LT_PROG_LTMAIN
slouken@5310
  1450
slouken@5310
  1451
  # We use sed instead of cat because bash on DJGPP gets confused if
slouken@5310
  1452
  # if finds mixed CR/LF and LF-only lines.  Since sed operates in
slouken@5310
  1453
  # text mode, it properly converts lines to CR/LF.  This bash problem
slouken@5310
  1454
  # is reportedly fixed, but why not run on old versions too?
slouken@6442
  1455
  sed '$q' "$ltmain" >> "$cfgfile" \
slouken@6442
  1456
     || (rm -f "$cfgfile"; exit 1)
slouken@6442
  1457
slouken@6442
  1458
  _LT_PROG_REPLACE_SHELLFNS
slouken@6442
  1459
slouken@6442
  1460
   mv -f "$cfgfile" "$ofile" ||
slouken@5310
  1461
    (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
slouken@5310
  1462
  chmod +x "$ofile"
slouken@5310
  1463
],
slouken@5310
  1464
[cat <<_LT_EOF >> "$ofile"
slouken@5310
  1465
slouken@5310
  1466
dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded
slouken@5310
  1467
dnl in a comment (ie after a #).
slouken@5310
  1468
# ### BEGIN LIBTOOL TAG CONFIG: $1
slouken@5310
  1469
_LT_LIBTOOL_TAG_VARS(_LT_TAG)
slouken@5310
  1470
# ### END LIBTOOL TAG CONFIG: $1
slouken@5310
  1471
_LT_EOF
slouken@5310
  1472
])dnl /m4_if
slouken@5310
  1473
],
slouken@5310
  1474
[m4_if([$1], [], [
slouken@5310
  1475
    PACKAGE='$PACKAGE'
slouken@5310
  1476
    VERSION='$VERSION'
slouken@5310
  1477
    TIMESTAMP='$TIMESTAMP'
slouken@5310
  1478
    RM='$RM'
slouken@5310
  1479
    ofile='$ofile'], [])
slouken@5310
  1480
])dnl /_LT_CONFIG_SAVE_COMMANDS
slouken@5310
  1481
])# _LT_CONFIG
slouken@5310
  1482
slouken@5310
  1483
slouken@5310
  1484
# LT_SUPPORTED_TAG(TAG)
slouken@5310
  1485
# ---------------------
slouken@5310
  1486
# Trace this macro to discover what tags are supported by the libtool
slouken@5310
  1487
# --tag option, using:
slouken@5310
  1488
#    autoconf --trace 'LT_SUPPORTED_TAG:$1'
slouken@5310
  1489
AC_DEFUN([LT_SUPPORTED_TAG], [])
slouken@5310
  1490
slouken@5310
  1491
slouken@5310
  1492
# C support is built-in for now
slouken@5310
  1493
m4_define([_LT_LANG_C_enabled], [])
slouken@5310
  1494
m4_define([_LT_TAGS], [])
slouken@5310
  1495
slouken@5310
  1496
slouken@5310
  1497
# LT_LANG(LANG)
slouken@5310
  1498
# -------------
slouken@5310
  1499
# Enable libtool support for the given language if not already enabled.
slouken@5310
  1500
AC_DEFUN([LT_LANG],
slouken@5310
  1501
[AC_BEFORE([$0], [LT_OUTPUT])dnl
slouken@5310
  1502
m4_case([$1],
slouken@5310
  1503
  [C],			[_LT_LANG(C)],
slouken@5310
  1504
  [C++],		[_LT_LANG(CXX)],
slouken@6442
  1505
  [Go],			[_LT_LANG(GO)],
slouken@5310
  1506
  [Java],		[_LT_LANG(GCJ)],
slouken@5310
  1507
  [Fortran 77],		[_LT_LANG(F77)],
slouken@5310
  1508
  [Fortran],		[_LT_LANG(FC)],
slouken@5310
  1509
  [Windows Resource],	[_LT_LANG(RC)],
slouken@5310
  1510
  [m4_ifdef([_LT_LANG_]$1[_CONFIG],
slouken@5310
  1511
    [_LT_LANG($1)],
slouken@5310
  1512
    [m4_fatal([$0: unsupported language: "$1"])])])dnl
slouken@5310
  1513
])# LT_LANG
slouken@5310
  1514
slouken@5310
  1515
slouken@5310
  1516
# _LT_LANG(LANGNAME)
slouken@5310
  1517
# ------------------
slouken@5310
  1518
m4_defun([_LT_LANG],
slouken@5310
  1519
[m4_ifdef([_LT_LANG_]$1[_enabled], [],
slouken@5310
  1520
  [LT_SUPPORTED_TAG([$1])dnl
slouken@5310
  1521
  m4_append([_LT_TAGS], [$1 ])dnl
slouken@5310
  1522
  m4_define([_LT_LANG_]$1[_enabled], [])dnl
slouken@5310
  1523
  _LT_LANG_$1_CONFIG($1)])dnl
slouken@5310
  1524
])# _LT_LANG
slouken@5310
  1525
slouken@5310
  1526
slouken@6442
  1527
m4_ifndef([AC_PROG_GO], [
slouken@6442
  1528
############################################################
slouken@6442
  1529
# NOTE: This macro has been submitted for inclusion into   #
slouken@6442
  1530
#  GNU Autoconf as AC_PROG_GO.  When it is available in    #
slouken@6442
  1531
#  a released version of Autoconf we should remove this    #
slouken@6442
  1532
#  macro and use it instead.                               #
slouken@6442
  1533
############################################################
slouken@6442
  1534
m4_defun([AC_PROG_GO],
slouken@6442
  1535
[AC_LANG_PUSH(Go)dnl
slouken@6442
  1536
AC_ARG_VAR([GOC],     [Go compiler command])dnl
slouken@6442
  1537
AC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl
slouken@6442
  1538
_AC_ARG_VAR_LDFLAGS()dnl
slouken@6442
  1539
AC_CHECK_TOOL(GOC, gccgo)
slouken@6442
  1540
if test -z "$GOC"; then
slouken@6442
  1541
  if test -n "$ac_tool_prefix"; then
slouken@6442
  1542
    AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo])
slouken@6442
  1543
  fi
slouken@6442
  1544
fi
slouken@6442
  1545
if test -z "$GOC"; then
slouken@6442
  1546
  AC_CHECK_PROG(GOC, gccgo, gccgo, false)
slouken@6442
  1547
fi
slouken@6442
  1548
])#m4_defun
slouken@6442
  1549
])#m4_ifndef
slouken@6442
  1550
slouken@6442
  1551
slouken@5310
  1552
# _LT_LANG_DEFAULT_CONFIG
slouken@5310
  1553
# -----------------------
slouken@5310
  1554
m4_defun([_LT_LANG_DEFAULT_CONFIG],
slouken@5310
  1555
[AC_PROVIDE_IFELSE([AC_PROG_CXX],
slouken@5310
  1556
  [LT_LANG(CXX)],
slouken@5310
  1557
  [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])])
slouken@5310
  1558
slouken@5310
  1559
AC_PROVIDE_IFELSE([AC_PROG_F77],
slouken@5310
  1560
  [LT_LANG(F77)],
slouken@5310
  1561
  [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])])
slouken@5310
  1562
slouken@5310
  1563
AC_PROVIDE_IFELSE([AC_PROG_FC],
slouken@5310
  1564
  [LT_LANG(FC)],
slouken@5310
  1565
  [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])])
slouken@5310
  1566
slouken@5310
  1567
dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal
slouken@5310
  1568
dnl pulling things in needlessly.
slouken@5310
  1569
AC_PROVIDE_IFELSE([AC_PROG_GCJ],
slouken@5310
  1570
  [LT_LANG(GCJ)],
slouken@5310
  1571
  [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
slouken@5310
  1572
    [LT_LANG(GCJ)],
slouken@5310
  1573
    [AC_PROVIDE_IFELSE([LT_PROG_GCJ],
slouken@5310
  1574
      [LT_LANG(GCJ)],
slouken@5310
  1575
      [m4_ifdef([AC_PROG_GCJ],
slouken@5310
  1576
	[m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])])
slouken@5310
  1577
       m4_ifdef([A][M_PROG_GCJ],
slouken@5310
  1578
	[m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])])
slouken@5310
  1579
       m4_ifdef([LT_PROG_GCJ],
slouken@5310
  1580
	[m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])])
slouken@5310
  1581
slouken@6442
  1582
AC_PROVIDE_IFELSE([AC_PROG_GO],
slouken@6442
  1583
  [LT_LANG(GO)],
slouken@6442
  1584
  [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])])
slouken@6442
  1585
slouken@5310
  1586
AC_PROVIDE_IFELSE([LT_PROG_RC],
slouken@5310
  1587
  [LT_LANG(RC)],
slouken@5310
  1588
  [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])])
slouken@5310
  1589
])# _LT_LANG_DEFAULT_CONFIG
slouken@5310
  1590
slouken@5310
  1591
# Obsolete macros:
slouken@5310
  1592
AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)])
slouken@5310
  1593
AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)])
slouken@5310
  1594
AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)])
slouken@5310
  1595
AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)])
slouken@6442
  1596
AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)])
slouken@5310
  1597
dnl aclocal-1.4 backwards compatibility:
slouken@5310
  1598
dnl AC_DEFUN([AC_LIBTOOL_CXX], [])
slouken@5310
  1599
dnl AC_DEFUN([AC_LIBTOOL_F77], [])
slouken@5310
  1600
dnl AC_DEFUN([AC_LIBTOOL_FC], [])
slouken@5310
  1601
dnl AC_DEFUN([AC_LIBTOOL_GCJ], [])
slouken@6442
  1602
dnl AC_DEFUN([AC_LIBTOOL_RC], [])
slouken@5310
  1603
slouken@5310
  1604
slouken@5310
  1605
# _LT_TAG_COMPILER
slouken@5310
  1606
# ----------------
slouken@5310
  1607
m4_defun([_LT_TAG_COMPILER],
slouken@5310
  1608
[AC_REQUIRE([AC_PROG_CC])dnl
slouken@5310
  1609
slouken@5310
  1610
_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl
slouken@5310
  1611
_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl
slouken@5310
  1612
_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl
slouken@5310
  1613
_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl
slouken@5310
  1614
slouken@5310
  1615
# If no C compiler was specified, use CC.
slouken@5310
  1616
LTCC=${LTCC-"$CC"}
slouken@5310
  1617
slouken@5310
  1618
# If no C compiler flags were specified, use CFLAGS.
slouken@5310
  1619
LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
slouken@5310
  1620
slouken@5310
  1621
# Allow CC to be a program name with arguments.
slouken@5310
  1622
compiler=$CC
slouken@5310
  1623
])# _LT_TAG_COMPILER
slouken@5310
  1624
slouken@5310
  1625
slouken@5310
  1626
# _LT_COMPILER_BOILERPLATE
slouken@5310
  1627
# ------------------------
slouken@5310
  1628
# Check for compiler boilerplate output or warnings with
slouken@5310
  1629
# the simple compiler test code.
slouken@5310
  1630
m4_defun([_LT_COMPILER_BOILERPLATE],
slouken@5310
  1631
[m4_require([_LT_DECL_SED])dnl
slouken@5310
  1632
ac_outfile=conftest.$ac_objext
slouken@5310
  1633
echo "$lt_simple_compile_test_code" >conftest.$ac_ext
slouken@5310
  1634
eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
slouken@5310
  1635
_lt_compiler_boilerplate=`cat conftest.err`
slouken@5310
  1636
$RM conftest*
slouken@5310
  1637
])# _LT_COMPILER_BOILERPLATE
slouken@5310
  1638
slouken@5310
  1639
slouken@5310
  1640
# _LT_LINKER_BOILERPLATE
slouken@5310
  1641
# ----------------------
slouken@5310
  1642
# Check for linker boilerplate output or warnings with
slouken@5310
  1643
# the simple link test code.
slouken@5310
  1644
m4_defun([_LT_LINKER_BOILERPLATE],
slouken@5310
  1645
[m4_require([_LT_DECL_SED])dnl
slouken@5310
  1646
ac_outfile=conftest.$ac_objext
slouken@5310
  1647
echo "$lt_simple_link_test_code" >conftest.$ac_ext
slouken@5310
  1648
eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
slouken@5310
  1649
_lt_linker_boilerplate=`cat conftest.err`
slouken@5310
  1650
$RM -r conftest*
slouken@5310
  1651
])# _LT_LINKER_BOILERPLATE
slouken@5310
  1652
slouken@5310
  1653
# _LT_REQUIRED_DARWIN_CHECKS
slouken@5310
  1654
# -------------------------
slouken@5310
  1655
m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
slouken@5310
  1656
  case $host_os in
slouken@5310
  1657
    rhapsody* | darwin*)
slouken@5310
  1658
    AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:])
slouken@5310
  1659
    AC_CHECK_TOOL([NMEDIT], [nmedit], [:])
slouken@5310
  1660
    AC_CHECK_TOOL([LIPO], [lipo], [:])
slouken@5310
  1661
    AC_CHECK_TOOL([OTOOL], [otool], [:])
slouken@5310
  1662
    AC_CHECK_TOOL([OTOOL64], [otool64], [:])
slouken@5310
  1663
    _LT_DECL([], [DSYMUTIL], [1],
slouken@5310
  1664
      [Tool to manipulate archived DWARF debug symbol files on Mac OS X])
slouken@5310
  1665
    _LT_DECL([], [NMEDIT], [1],
slouken@5310
  1666
      [Tool to change global to local symbols on Mac OS X])
slouken@5310
  1667
    _LT_DECL([], [LIPO], [1],
slouken@5310
  1668
      [Tool to manipulate fat objects and archives on Mac OS X])
slouken@5310
  1669
    _LT_DECL([], [OTOOL], [1],
slouken@5310
  1670
      [ldd/readelf like tool for Mach-O binaries on Mac OS X])
slouken@5310
  1671
    _LT_DECL([], [OTOOL64], [1],
slouken@5310
  1672
      [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4])
slouken@5310
  1673
slouken@5310
  1674
    AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod],
slouken@5310
  1675
      [lt_cv_apple_cc_single_mod=no
slouken@5310
  1676
      if test -z "${LT_MULTI_MODULE}"; then
slouken@5310
  1677
	# By default we will add the -single_module flag. You can override
slouken@5310
  1678
	# by either setting the environment variable LT_MULTI_MODULE
slouken@5310
  1679
	# non-empty at configure time, or by adding -multi_module to the
slouken@5310
  1680
	# link flags.
slouken@5310
  1681
	rm -rf libconftest.dylib*
slouken@5310
  1682
	echo "int foo(void){return 1;}" > conftest.c
slouken@5310
  1683
	echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
slouken@5310
  1684
-dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD
slouken@5310
  1685
	$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
slouken@5310
  1686
	  -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
slouken@5310
  1687
        _lt_result=$?
slouken@6442
  1688
	# If there is a non-empty error log, and "single_module"
slouken@6442
  1689
	# appears in it, assume the flag caused a linker warning
slouken@6442
  1690
        if test -s conftest.err && $GREP single_module conftest.err; then
slouken@6442
  1691
	  cat conftest.err >&AS_MESSAGE_LOG_FD
slouken@6442
  1692
	# Otherwise, if the output was created with a 0 exit code from
slouken@6442
  1693
	# the compiler, it worked.
slouken@6442
  1694
	elif test -f libconftest.dylib && test $_lt_result -eq 0; then
slouken@5310
  1695
	  lt_cv_apple_cc_single_mod=yes
slouken@5310
  1696
	else
slouken@5310
  1697
	  cat conftest.err >&AS_MESSAGE_LOG_FD
slouken@5310
  1698
	fi
slouken@5310
  1699
	rm -rf libconftest.dylib*
slouken@5310
  1700
	rm -f conftest.*
slouken@5310
  1701
      fi])
slouken@6442
  1702
slouken@5310
  1703
    AC_CACHE_CHECK([for -exported_symbols_list linker flag],
slouken@5310
  1704
      [lt_cv_ld_exported_symbols_list],
slouken@5310
  1705
      [lt_cv_ld_exported_symbols_list=no
slouken@5310
  1706
      save_LDFLAGS=$LDFLAGS
slouken@5310
  1707
      echo "_main" > conftest.sym
slouken@5310
  1708
      LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
slouken@5310
  1709
      AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
slouken@5310
  1710
	[lt_cv_ld_exported_symbols_list=yes],
slouken@5310
  1711
	[lt_cv_ld_exported_symbols_list=no])
slouken@5310
  1712
	LDFLAGS="$save_LDFLAGS"
slouken@5310
  1713
    ])
slouken@6442
  1714
slouken@6442
  1715
    AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load],
slouken@6442
  1716
      [lt_cv_ld_force_load=no
slouken@6442
  1717
      cat > conftest.c << _LT_EOF
slouken@6442
  1718
int forced_loaded() { return 2;}
slouken@6442
  1719
_LT_EOF
slouken@6442
  1720
      echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD
slouken@6442
  1721
      $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD
slouken@6442
  1722
      echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD
slouken@6442
  1723
      $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD
slouken@6442
  1724
      echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD
slouken@6442
  1725
      $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD
slouken@6442
  1726
      cat > conftest.c << _LT_EOF
slouken@6442
  1727
int main() { return 0;}
slouken@6442
  1728
_LT_EOF
slouken@6442
  1729
      echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD
slouken@6442
  1730
      $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
slouken@6442
  1731
      _lt_result=$?
slouken@6442
  1732
      if test -s conftest.err && $GREP force_load conftest.err; then
slouken@6442
  1733
	cat conftest.err >&AS_MESSAGE_LOG_FD
slouken@6442
  1734
      elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then
slouken@6442
  1735
	lt_cv_ld_force_load=yes
slouken@6442
  1736
      else
slouken@6442
  1737
	cat conftest.err >&AS_MESSAGE_LOG_FD
slouken@6442
  1738
      fi
slouken@6442
  1739
        rm -f conftest.err libconftest.a conftest conftest.c
slouken@6442
  1740
        rm -rf conftest.dSYM
slouken@6442
  1741
    ])
slouken@5310
  1742
    case $host_os in
slouken@5310
  1743
    rhapsody* | darwin1.[[012]])
slouken@5310
  1744
      _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
slouken@5310
  1745
    darwin1.*)
slouken@5310
  1746
      _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
slouken@5310
  1747
    darwin*) # darwin 5.x on
slouken@5310
  1748
      # if running on 10.5 or later, the deployment target defaults
slouken@5310
  1749
      # to the OS version, if on x86, and 10.4, the deployment
slouken@5310
  1750
      # target defaults to 10.4. Don't you love it?
slouken@5310
  1751
      case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
slouken@5310
  1752
	10.0,*86*-darwin8*|10.0,*-darwin[[91]]*)
slouken@5310
  1753
	  _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
slouken@5310
  1754
	10.[[012]]*)
slouken@5310
  1755
	  _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
slouken@5310
  1756
	10.*)
slouken@5310
  1757
	  _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
slouken@5310
  1758
      esac
slouken@5310
  1759
    ;;
slouken@5310
  1760
  esac
slouken@5310
  1761
    if test "$lt_cv_apple_cc_single_mod" = "yes"; then
slouken@5310
  1762
      _lt_dar_single_mod='$single_module'
slouken@5310
  1763
    fi
slouken@5310
  1764
    if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
slouken@5310
  1765
      _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
slouken@5310
  1766
    else
slouken@5310
  1767
      _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
slouken@5310
  1768
    fi
slouken@6442
  1769
    if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then
slouken@5310
  1770
      _lt_dsymutil='~$DSYMUTIL $lib || :'
slouken@5310
  1771
    else
slouken@5310
  1772
      _lt_dsymutil=
slouken@5310
  1773
    fi
slouken@5310
  1774
    ;;
slouken@5310
  1775
  esac
slouken@5310
  1776
])
slouken@5310
  1777
slouken@5310
  1778
slouken@6442
  1779
# _LT_DARWIN_LINKER_FEATURES([TAG])
slouken@6442
  1780
# ---------------------------------
slouken@5310
  1781
# Checks for linker and compiler features on darwin
slouken@5310
  1782
m4_defun([_LT_DARWIN_LINKER_FEATURES],
slouken@5310
  1783
[
slouken@5310
  1784
  m4_require([_LT_REQUIRED_DARWIN_CHECKS])
slouken@5310
  1785
  _LT_TAGVAR(archive_cmds_need_lc, $1)=no
slouken@5310
  1786
  _LT_TAGVAR(hardcode_direct, $1)=no
slouken@5310
  1787
  _LT_TAGVAR(hardcode_automatic, $1)=yes
slouken@5310
  1788
  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
slouken@6442
  1789
  if test "$lt_cv_ld_force_load" = "yes"; then
slouken@6442
  1790
    _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
slouken@6442
  1791
    m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes],
slouken@6442
  1792
                  [FC],  [_LT_TAGVAR(compiler_needs_object, $1)=yes])
slouken@6442
  1793
  else
slouken@6442
  1794
    _LT_TAGVAR(whole_archive_flag_spec, $1)=''
slouken@6442
  1795
  fi
slouken@5310
  1796
  _LT_TAGVAR(link_all_deplibs, $1)=yes
slouken@5310
  1797
  _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined"
slouken@5310
  1798
  case $cc_basename in
slouken@5310
  1799
     ifort*) _lt_dar_can_shared=yes ;;
slouken@5310
  1800
     *) _lt_dar_can_shared=$GCC ;;
slouken@5310
  1801
  esac
slouken@5310
  1802
  if test "$_lt_dar_can_shared" = "yes"; then
slouken@6442
  1803
    output_verbose_link_cmd=func_echo_all
slouken@5310
  1804
    _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
  1805
    _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
slouken@5310
  1806
    _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
  1807
    _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
  1808
    m4_if([$1], [CXX],
slouken@5310
  1809
[   if test "$lt_cv_apple_cc_single_mod" != "yes"; then
slouken@5310
  1810
      _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
  1811
      _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
  1812
    fi
slouken@5310
  1813
],[])
slouken@5310
  1814
  else
slouken@5310
  1815
  _LT_TAGVAR(ld_shlibs, $1)=no
slouken@5310
  1816
  fi
slouken@5310
  1817
])
slouken@5310
  1818
slouken@6442
  1819
# _LT_SYS_MODULE_PATH_AIX([TAGNAME])
slouken@6442
  1820
# ----------------------------------
slouken@5310
  1821
# Links a minimal program and checks the executable
slouken@5310
  1822
# for the system default hardcoded library path. In most cases,
slouken@5310
  1823
# this is /usr/lib:/lib, but when the MPI compilers are used
slouken@5310
  1824
# the location of the communication and MPI libs are included too.
slouken@5310
  1825
# If we don't find anything, use the default library path according
slouken@5310
  1826
# to the aix ld manual.
slouken@6442
  1827
# Store the results from the different compilers for each TAGNAME.
slouken@6442
  1828
# Allow to override them for all tags through lt_cv_aix_libpath.
slouken@5310
  1829
m4_defun([_LT_SYS_MODULE_PATH_AIX],
slouken@5310
  1830
[m4_require([_LT_DECL_SED])dnl
slouken@6442
  1831
if test "${lt_cv_aix_libpath+set}" = set; then
slouken@6442
  1832
  aix_libpath=$lt_cv_aix_libpath
slouken@6442
  1833
else
slouken@6442
  1834
  AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])],
slouken@6442
  1835
  [AC_LINK_IFELSE([AC_LANG_PROGRAM],[
slouken@6442
  1836
  lt_aix_libpath_sed='[
slouken@6442
  1837
      /Import File Strings/,/^$/ {
slouken@6442
  1838
	  /^0/ {
slouken@6442
  1839
	      s/^0  *\([^ ]*\) *$/\1/
slouken@6442
  1840
	      p
slouken@6442
  1841
	  }
slouken@6442
  1842
      }]'
slouken@6442
  1843
  _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
slouken@6442
  1844
  # Check for a 64-bit object if we didn't find anything.
slouken@6442
  1845
  if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
slouken@6442
  1846
    _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
slouken@6442
  1847
  fi],[])
slouken@6442
  1848
  if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
slouken@6442
  1849
    _LT_TAGVAR([lt_cv_aix_libpath_], [$1])="/usr/lib:/lib"
slouken@6442
  1850
  fi
slouken@6442
  1851
  ])
slouken@6442
  1852
  aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])
slouken@6442
  1853
fi
slouken@5310
  1854
])# _LT_SYS_MODULE_PATH_AIX
slouken@5310
  1855
slouken@5310
  1856
slouken@5310
  1857
# _LT_SHELL_INIT(ARG)
slouken@5310
  1858
# -------------------
slouken@5310
  1859
m4_define([_LT_SHELL_INIT],
slouken@6442
  1860
[m4_divert_text([M4SH-INIT], [$1
slouken@6442
  1861
])])# _LT_SHELL_INIT
slouken@6442
  1862
slouken@5310
  1863
slouken@5310
  1864
slouken@5310
  1865
# _LT_PROG_ECHO_BACKSLASH
slouken@5310
  1866
# -----------------------
slouken@6442
  1867
# Find how we can fake an echo command that does not interpret backslash.
slouken@6442
  1868
# In particular, with Autoconf 2.60 or later we add some code to the start
slouken@6442
  1869
# of the generated configure script which will find a shell with a builtin
slouken@6442
  1870
# printf (which we can use as an echo command).
slouken@5310
  1871
m4_defun([_LT_PROG_ECHO_BACKSLASH],
slouken@6442
  1872
[ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
slouken@6442
  1873
ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
slouken@6442
  1874
ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
slouken@6442
  1875
slouken@6442
  1876
AC_MSG_CHECKING([how to print strings])
slouken@6442
  1877
# Test print first, because it will be a builtin if present.
slouken@6442
  1878
if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
slouken@6442
  1879
   test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
slouken@6442
  1880
  ECHO='print -r --'
slouken@6442
  1881
elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
slouken@6442
  1882
  ECHO='printf %s\n'
slouken@6442
  1883
else
slouken@6442
  1884
  # Use this function as a fallback that always works.
slouken@6442
  1885
  func_fallback_echo ()
slouken@6442
  1886
  {
slouken@6442
  1887
    eval 'cat <<_LTECHO_EOF
slouken@6442
  1888
$[]1
slouken@6442
  1889
_LTECHO_EOF'
slouken@6442
  1890
  }
slouken@6442
  1891
  ECHO='func_fallback_echo'
slouken@6442
  1892
fi
slouken@6442
  1893
slouken@6442
  1894
# func_echo_all arg...
slouken@6442
  1895
# Invoke $ECHO with all args, space-separated.
slouken@6442
  1896
func_echo_all ()
slouken@6442
  1897
{
slouken@6442
  1898
    $ECHO "$*" 
slouken@6442
  1899
}
slouken@6442
  1900
slouken@6442
  1901
case "$ECHO" in
slouken@6442
  1902
  printf*) AC_MSG_RESULT([printf]) ;;
slouken@6442
  1903
  print*) AC_MSG_RESULT([print -r]) ;;
slouken@6442
  1904
  *) AC_MSG_RESULT([cat]) ;;
slouken@5310
  1905
esac
slouken@5310
  1906
slouken@6442
  1907
m4_ifdef([_AS_DETECT_SUGGESTED],
slouken@6442
  1908
[_AS_DETECT_SUGGESTED([
slouken@6442
  1909
  test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || (
slouken@6442
  1910
    ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
slouken@6442
  1911
    ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
slouken@6442
  1912
    ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
slouken@6442
  1913
    PATH=/empty FPATH=/empty; export PATH FPATH
slouken@6442
  1914
    test "X`printf %s $ECHO`" = "X$ECHO" \
slouken@6442
  1915
      || test "X`print -r -- $ECHO`" = "X$ECHO" )])])
slouken@6442
  1916
slouken@5310
  1917
_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts])
slouken@6442
  1918
_LT_DECL([], [ECHO], [1], [An echo program that protects backslashes])
slouken@5310
  1919
])# _LT_PROG_ECHO_BACKSLASH
slouken@5310
  1920
slouken@5310
  1921
slouken@6442
  1922
# _LT_WITH_SYSROOT
slouken@6442
  1923
# ----------------
slouken@6442
  1924
AC_DEFUN([_LT_WITH_SYSROOT],
slouken@6442
  1925
[AC_MSG_CHECKING([for sysroot])
slouken@6442
  1926
AC_ARG_WITH([sysroot],
slouken@6442
  1927
[  --with-sysroot[=DIR] Search for dependent libraries within DIR
slouken@6442
  1928
                        (or the compiler's sysroot if not specified).],
slouken@6442
  1929
[], [with_sysroot=no])
slouken@6442
  1930
slouken@6442
  1931
dnl lt_sysroot will always be passed unquoted.  We quote it here
slouken@6442
  1932
dnl in case the user passed a directory name.
slouken@6442
  1933
lt_sysroot=
slouken@6442
  1934
case ${with_sysroot} in #(
slouken@6442
  1935
 yes)
slouken@6442
  1936
   if test "$GCC" = yes; then
slouken@6442
  1937
     lt_sysroot=`$CC --print-sysroot 2>/dev/null`
slouken@6442
  1938
   fi
slouken@6442
  1939
   ;; #(
slouken@6442
  1940
 /*)
slouken@6442
  1941
   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
slouken@6442
  1942
   ;; #(
slouken@6442
  1943
 no|'')
slouken@6442
  1944
   ;; #(
slouken@6442
  1945
 *)
slouken@6442
  1946
   AC_MSG_RESULT([${with_sysroot}])
slouken@6442
  1947
   AC_MSG_ERROR([The sysroot must be an absolute path.])
slouken@6442
  1948
   ;;
slouken@6442
  1949
esac
slouken@6442
  1950
slouken@6442
  1951
 AC_MSG_RESULT([${lt_sysroot:-no}])
slouken@6442
  1952
_LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl
slouken@6442
  1953
[dependent libraries, and in which our libraries should be installed.])])
slouken@6442
  1954
slouken@5310
  1955
# _LT_ENABLE_LOCK
slouken@5310
  1956
# ---------------
slouken@5310
  1957
m4_defun([_LT_ENABLE_LOCK],
slouken@5310
  1958
[AC_ARG_ENABLE([libtool-lock],
slouken@5310
  1959
  [AS_HELP_STRING([--disable-libtool-lock],
slouken@5310
  1960
    [avoid locking (might break parallel builds)])])
slouken@5310
  1961
test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
slouken@5310
  1962
slouken@5310
  1963
# Some flags need to be propagated to the compiler or linker for good
slouken@5310
  1964
# libtool support.
slouken@5310
  1965
case $host in
slouken@5310
  1966
ia64-*-hpux*)
slouken@5310
  1967
  # Find out which ABI we are using.
slouken@5310
  1968
  echo 'int i;' > conftest.$ac_ext
slouken@5310
  1969
  if AC_TRY_EVAL(ac_compile); then
slouken@5310
  1970
    case `/usr/bin/file conftest.$ac_objext` in
slouken@5310
  1971
      *ELF-32*)
slouken@5310
  1972
	HPUX_IA64_MODE="32"
slouken@5310
  1973
	;;
slouken@5310
  1974
      *ELF-64*)
slouken@5310
  1975
	HPUX_IA64_MODE="64"
slouken@5310
  1976
	;;
slouken@5310
  1977
    esac
slouken@5310
  1978
  fi
slouken@5310
  1979
  rm -rf conftest*
slouken@5310
  1980
  ;;
slouken@5310
  1981
*-*-irix6*)
slouken@5310
  1982
  # Find out which ABI we are using.
slouken@6442
  1983
  echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
slouken@5310
  1984
  if AC_TRY_EVAL(ac_compile); then
slouken@5310
  1985
    if test "$lt_cv_prog_gnu_ld" = yes; then
slouken@5310
  1986
      case `/usr/bin/file conftest.$ac_objext` in
slouken@5310
  1987
	*32-bit*)
slouken@5310
  1988
	  LD="${LD-ld} -melf32bsmip"
slouken@5310
  1989
	  ;;
slouken@5310
  1990
	*N32*)
slouken@5310
  1991
	  LD="${LD-ld} -melf32bmipn32"
slouken@5310
  1992
	  ;;
slouken@5310
  1993
	*64-bit*)
slouken@5310
  1994
	  LD="${LD-ld} -melf64bmip"
slouken@5310
  1995
	;;
slouken@5310
  1996
      esac
slouken@5310
  1997
    else
slouken@5310
  1998
      case `/usr/bin/file conftest.$ac_objext` in
slouken@5310
  1999
	*32-bit*)
slouken@5310
  2000
	  LD="${LD-ld} -32"
slouken@5310
  2001
	  ;;
slouken@5310
  2002
	*N32*)
slouken@5310
  2003
	  LD="${LD-ld} -n32"
slouken@5310
  2004
	  ;;
slouken@5310
  2005
	*64-bit*)
slouken@5310
  2006
	  LD="${LD-ld} -64"
slouken@5310
  2007
	  ;;
slouken@5310
  2008
      esac
slouken@5310
  2009
    fi
slouken@5310
  2010
  fi
slouken@5310
  2011
  rm -rf conftest*
slouken@5310
  2012
  ;;
slouken@5310
  2013
slouken@5310
  2014
x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
slouken@5310
  2015
s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
slouken@5310
  2016
  # Find out which ABI we are using.
slouken@5310
  2017
  echo 'int i;' > conftest.$ac_ext
slouken@5310
  2018
  if AC_TRY_EVAL(ac_compile); then
slouken@5310
  2019
    case `/usr/bin/file conftest.o` in
slouken@5310
  2020
      *32-bit*)
slouken@5310
  2021
	case $host in
slouken@5310
  2022
	  x86_64-*kfreebsd*-gnu)
slouken@5310
  2023
	    LD="${LD-ld} -m elf_i386_fbsd"
slouken@5310
  2024
	    ;;
slouken@5310
  2025
	  x86_64-*linux*)
slouken@5310
  2026
	    LD="${LD-ld} -m elf_i386"
slouken@5310
  2027
	    ;;
slouken@5310
  2028
	  ppc64-*linux*|powerpc64-*linux*)
slouken@5310
  2029
	    LD="${LD-ld} -m elf32ppclinux"
slouken@5310
  2030
	    ;;
slouken@5310
  2031
	  s390x-*linux*)
slouken@5310
  2032
	    LD="${LD-ld} -m elf_s390"
slouken@5310
  2033
	    ;;
slouken@5310
  2034
	  sparc64-*linux*)
slouken@5310
  2035
	    LD="${LD-ld} -m elf32_sparc"
slouken@5310
  2036
	    ;;
slouken@5310
  2037
	esac
slouken@5310
  2038
	;;
slouken@5310
  2039
      *64-bit*)
slouken@5310
  2040
	case $host in
slouken@5310
  2041
	  x86_64-*kfreebsd*-gnu)
slouken@5310
  2042
	    LD="${LD-ld} -m elf_x86_64_fbsd"
slouken@5310
  2043
	    ;;
slouken@5310
  2044
	  x86_64-*linux*)
slouken@5310
  2045
	    LD="${LD-ld} -m elf_x86_64"
slouken@5310
  2046
	    ;;
slouken@5310
  2047
	  ppc*-*linux*|powerpc*-*linux*)
slouken@5310
  2048
	    LD="${LD-ld} -m elf64ppc"
slouken@5310
  2049
	    ;;
slouken@5310
  2050
	  s390*-*linux*|s390*-*tpf*)
slouken@5310
  2051
	    LD="${LD-ld} -m elf64_s390"
slouken@5310
  2052
	    ;;
slouken@5310
  2053
	  sparc*-*linux*)
slouken@5310
  2054
	    LD="${LD-ld} -m elf64_sparc"
slouken@5310
  2055
	    ;;
slouken@5310
  2056
	esac
slouken@5310
  2057
	;;
slouken@5310
  2058
    esac
slouken@5310
  2059
  fi
slouken@5310
  2060
  rm -rf conftest*
slouken@5310
  2061
  ;;
slouken@5310
  2062
slouken@5310
  2063
*-*-sco3.2v5*)
slouken@5310
  2064
  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
slouken@5310
  2065
  SAVE_CFLAGS="$CFLAGS"
slouken@5310
  2066
  CFLAGS="$CFLAGS -belf"
slouken@5310
  2067
  AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
slouken@5310
  2068
    [AC_LANG_PUSH(C)
slouken@5310
  2069
     AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
slouken@5310
  2070
     AC_LANG_POP])
slouken@5310
  2071
  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
slouken@5310
  2072
    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
slouken@5310
  2073
    CFLAGS="$SAVE_CFLAGS"
slouken@5310
  2074
  fi
slouken@5310
  2075
  ;;
slouken@6442
  2076
*-*solaris*)
slouken@5310
  2077
  # Find out which ABI we are using.
slouken@5310
  2078
  echo 'int i;' > conftest.$ac_ext
slouken@5310
  2079
  if AC_TRY_EVAL(ac_compile); then
slouken@5310
  2080
    case `/usr/bin/file conftest.o` in
slouken@5310
  2081
    *64-bit*)
slouken@5310
  2082
      case $lt_cv_prog_gnu_ld in
slouken@6442
  2083
      yes*)
slouken@6442
  2084
        case $host in
slouken@6442
  2085
        i?86-*-solaris*)
slouken@6442
  2086
          LD="${LD-ld} -m elf_x86_64"
slouken@6442
  2087
          ;;
slouken@6442
  2088
        sparc*-*-solaris*)
slouken@6442
  2089
          LD="${LD-ld} -m elf64_sparc"
slouken@6442
  2090
          ;;
slouken@6442
  2091
        esac
slouken@6442
  2092
        # GNU ld 2.21 introduced _sol2 emulations.  Use them if available.
slouken@6442
  2093
        if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then
slouken@6442
  2094
          LD="${LD-ld}_sol2"
slouken@6442
  2095
        fi
slouken@6442
  2096
        ;;
slouken@5310
  2097
      *)
slouken@5310
  2098
	if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
slouken@5310
  2099
	  LD="${LD-ld} -64"
slouken@5310
  2100
	fi
slouken@5310
  2101
	;;
slouken@5310
  2102
      esac
slouken@5310
  2103
      ;;
slouken@5310
  2104
    esac
slouken@5310
  2105
  fi
slouken@5310
  2106
  rm -rf conftest*
slouken@5310
  2107
  ;;
slouken@5310
  2108
esac
slouken@5310
  2109
slouken@5310
  2110
need_locks="$enable_libtool_lock"
slouken@5310
  2111
])# _LT_ENABLE_LOCK
slouken@5310
  2112
slouken@5310
  2113
slouken@6442
  2114
# _LT_PROG_AR
slouken@6442
  2115
# -----------
slouken@6442
  2116
m4_defun([_LT_PROG_AR],
slouken@6442
  2117
[AC_CHECK_TOOLS(AR, [ar], false)
slouken@6442
  2118
: ${AR=ar}
slouken@6442
  2119
: ${AR_FLAGS=cru}
slouken@6442
  2120
_LT_DECL([], [AR], [1], [The archiver])
slouken@6442
  2121
_LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive])
slouken@6442
  2122
slouken@6442
  2123
AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file],
slouken@6442
  2124
  [lt_cv_ar_at_file=no
slouken@6442
  2125
   AC_COMPILE_IFELSE([AC_LANG_PROGRAM],
slouken@6442
  2126
     [echo conftest.$ac_objext > conftest.lst
slouken@6442
  2127
      lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD'
slouken@6442
  2128
      AC_TRY_EVAL([lt_ar_try])
slouken@6442
  2129
      if test "$ac_status" -eq 0; then
slouken@6442
  2130
	# Ensure the archiver fails upon bogus file names.
slouken@6442
  2131
	rm -f conftest.$ac_objext libconftest.a
slouken@6442
  2132
	AC_TRY_EVAL([lt_ar_try])
slouken@6442
  2133
	if test "$ac_status" -ne 0; then
slouken@6442
  2134
          lt_cv_ar_at_file=@
slouken@6442
  2135
        fi
slouken@6442
  2136
      fi
slouken@6442
  2137
      rm -f conftest.* libconftest.a
slouken@6442
  2138
     ])
slouken@6442
  2139
  ])
slouken@6442
  2140
slouken@6442
  2141
if test "x$lt_cv_ar_at_file" = xno; then
slouken@6442
  2142
  archiver_list_spec=
slouken@6442
  2143
else
slouken@6442
  2144
  archiver_list_spec=$lt_cv_ar_at_file
slouken@6442
  2145
fi
slouken@6442
  2146
_LT_DECL([], [archiver_list_spec], [1],
slouken@6442
  2147
  [How to feed a file listing to the archiver])
slouken@6442
  2148
])# _LT_PROG_AR
slouken@6442
  2149
slouken@6442
  2150
slouken@5310
  2151
# _LT_CMD_OLD_ARCHIVE
slouken@5310
  2152
# -------------------
slouken@5310
  2153
m4_defun([_LT_CMD_OLD_ARCHIVE],
slouken@6442
  2154
[_LT_PROG_AR
slouken@5310
  2155
slouken@5310
  2156
AC_CHECK_TOOL(STRIP, strip, :)
slouken@5310
  2157
test -z "$STRIP" && STRIP=:
slouken@5310
  2158
_LT_DECL([], [STRIP], [1], [A symbol stripping program])
slouken@5310
  2159
slouken@5310
  2160
AC_CHECK_TOOL(RANLIB, ranlib, :)
slouken@5310
  2161
test -z "$RANLIB" && RANLIB=:
slouken@5310
  2162
_LT_DECL([], [RANLIB], [1],
slouken@5310
  2163
    [Commands used to install an old-style archive])
slouken@5310
  2164
slouken@5310
  2165
# Determine commands to create old-style static archives.
slouken@5310
  2166
old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
slouken@5310
  2167
old_postinstall_cmds='chmod 644 $oldlib'
slouken@5310
  2168
old_postuninstall_cmds=
slouken@5310
  2169
slouken@5310
  2170
if test -n "$RANLIB"; then
slouken@5310
  2171
  case $host_os in
slouken@5310
  2172
  openbsd*)
slouken@6442
  2173
    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib"
slouken@5310
  2174
    ;;
slouken@5310
  2175
  *)
slouken@6442
  2176
    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib"
slouken@5310
  2177
    ;;
slouken@5310
  2178
  esac
slouken@6442
  2179
  old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib"
slouken@5310
  2180
fi
slouken@6442
  2181
slouken@6442
  2182
case $host_os in
slouken@6442
  2183
  darwin*)
slouken@6442
  2184
    lock_old_archive_extraction=yes ;;
slouken@6442
  2185
  *)
slouken@6442
  2186
    lock_old_archive_extraction=no ;;
slouken@6442
  2187
esac
slouken@5310
  2188
_LT_DECL([], [old_postinstall_cmds], [2])
slouken@5310
  2189
_LT_DECL([], [old_postuninstall_cmds], [2])
slouken@5310
  2190
_LT_TAGDECL([], [old_archive_cmds], [2],
slouken@5310
  2191
    [Commands used to build an old-style archive])
slouken@6442
  2192
_LT_DECL([], [lock_old_archive_extraction], [0],
slouken@6442
  2193
    [Whether to use a lock for old archive extraction])
slouken@5310
  2194
])# _LT_CMD_OLD_ARCHIVE
slouken@5310
  2195
slouken@5310
  2196
slouken@5310
  2197
# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
slouken@5310
  2198
#		[OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
slouken@5310
  2199
# ----------------------------------------------------------------
slouken@5310
  2200
# Check whether the given compiler option works
slouken@5310
  2201
AC_DEFUN([_LT_COMPILER_OPTION],
slouken@5310
  2202
[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
slouken@5310
  2203
m4_require([_LT_DECL_SED])dnl
slouken@5310
  2204
AC_CACHE_CHECK([$1], [$2],
slouken@5310
  2205
  [$2=no
slouken@5310
  2206
   m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
slouken@5310
  2207
   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
slouken@5310
  2208
   lt_compiler_flag="$3"
slouken@5310
  2209
   # Insert the option either (1) after the last *FLAGS variable, or
slouken@5310
  2210
   # (2) before a word containing "conftest.", or (3) at the end.
slouken@5310
  2211
   # Note that $ac_compile itself does not contain backslashes and begins
slouken@5310
  2212
   # with a dollar sign (not a hyphen), so the echo should work correctly.
slouken@5310
  2213
   # The option is referenced via a variable to avoid confusing sed.
slouken@5310
  2214
   lt_compile=`echo "$ac_compile" | $SED \
slouken@5310
  2215
   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
slouken@5310
  2216
   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
slouken@5310
  2217
   -e 's:$: $lt_compiler_flag:'`
slouken@6442
  2218
   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
slouken@5310
  2219
   (eval "$lt_compile" 2>conftest.err)
slouken@5310
  2220
   ac_status=$?
slouken@5310
  2221
   cat conftest.err >&AS_MESSAGE_LOG_FD
slouken@6442
  2222
   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
slouken@5310
  2223
   if (exit $ac_status) && test -s "$ac_outfile"; then
slouken@5310
  2224
     # The compiler can only warn and ignore the option if not recognized
slouken@5310
  2225
     # So say no if there are warnings other than the usual output.
slouken@6442
  2226
     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
slouken@5310
  2227
     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
slouken@5310
  2228
     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
slouken@5310
  2229
       $2=yes
slouken@5310
  2230
     fi
slouken@5310
  2231
   fi
slouken@5310
  2232
   $RM conftest*
slouken@5310
  2233
])
slouken@5310
  2234
slouken@5310
  2235
if test x"[$]$2" = xyes; then
slouken@5310
  2236
    m4_if([$5], , :, [$5])
slouken@5310
  2237
else
slouken@5310
  2238
    m4_if([$6], , :, [$6])
slouken@5310
  2239
fi
slouken@5310
  2240
])# _LT_COMPILER_OPTION
slouken@5310
  2241
slouken@5310
  2242
# Old name:
slouken@5310
  2243
AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION])
slouken@5310
  2244
dnl aclocal-1.4 backwards compatibility:
slouken@5310
  2245
dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [])
slouken@5310
  2246
slouken@5310
  2247
slouken@5310
  2248
# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
slouken@5310
  2249
#                  [ACTION-SUCCESS], [ACTION-FAILURE])
slouken@5310
  2250
# ----------------------------------------------------
slouken@5310
  2251
# Check whether the given linker option works
slouken@5310
  2252
AC_DEFUN([_LT_LINKER_OPTION],
slouken@5310
  2253
[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
slouken@5310
  2254
m4_require([_LT_DECL_SED])dnl
slouken@5310
  2255
AC_CACHE_CHECK([$1], [$2],
slouken@5310
  2256
  [$2=no
slouken@5310
  2257
   save_LDFLAGS="$LDFLAGS"
slouken@5310
  2258
   LDFLAGS="$LDFLAGS $3"
slouken@5310
  2259
   echo "$lt_simple_link_test_code" > conftest.$ac_ext
slouken@5310
  2260
   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
slouken@5310
  2261
     # The linker can only warn and ignore the option if not recognized
slouken@5310
  2262
     # So say no if there are warnings
slouken@5310
  2263
     if test -s conftest.err; then
slouken@5310
  2264
       # Append any errors to the config.log.
slouken@5310
  2265
       cat conftest.err 1>&AS_MESSAGE_LOG_FD
slouken@6442
  2266
       $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
slouken@5310
  2267
       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
slouken@5310
  2268
       if diff conftest.exp conftest.er2 >/dev/null; then
slouken@5310
  2269
         $2=yes
slouken@5310
  2270
       fi
slouken@5310
  2271
     else
slouken@5310
  2272
       $2=yes
slouken@5310
  2273
     fi
slouken@5310
  2274
   fi
slouken@5310
  2275
   $RM -r conftest*
slouken@5310
  2276
   LDFLAGS="$save_LDFLAGS"
slouken@5310
  2277
])
slouken@5310
  2278
slouken@5310
  2279
if test x"[$]$2" = xyes; then
slouken@5310
  2280
    m4_if([$4], , :, [$4])
slouken@5310
  2281
else
slouken@5310
  2282
    m4_if([$5], , :, [$5])
slouken@5310
  2283
fi
slouken@5310
  2284
])# _LT_LINKER_OPTION
slouken@5310
  2285
slouken@5310
  2286
# Old name:
slouken@5310
  2287
AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION])
slouken@5310
  2288
dnl aclocal-1.4 backwards compatibility:
slouken@5310
  2289
dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [])
slouken@5310
  2290
slouken@5310
  2291
slouken@5310
  2292
# LT_CMD_MAX_LEN
slouken@5310
  2293
#---------------
slouken@5310
  2294
AC_DEFUN([LT_CMD_MAX_LEN],
slouken@5310
  2295
[AC_REQUIRE([AC_CANONICAL_HOST])dnl
slouken@5310
  2296
# find the maximum length of command line arguments
slouken@5310
  2297
AC_MSG_CHECKING([the maximum length of command line arguments])
slouken@5310
  2298
AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
slouken@5310
  2299
  i=0
slouken@5310
  2300
  teststring="ABCD"
slouken@5310
  2301
slouken@5310
  2302
  case $build_os in
slouken@5310
  2303
  msdosdjgpp*)
slouken@5310
  2304
    # On DJGPP, this test can blow up pretty badly due to problems in libc
slouken@5310
  2305
    # (any single argument exceeding 2000 bytes causes a buffer overrun
slouken@5310
  2306
    # during glob expansion).  Even if it were fixed, the result of this
slouken@5310
  2307
    # check would be larger than it should be.
slouken@5310
  2308
    lt_cv_sys_max_cmd_len=12288;    # 12K is about right
slouken@5310
  2309
    ;;
slouken@5310
  2310
slouken@5310
  2311
  gnu*)
slouken@5310
  2312
    # Under GNU Hurd, this test is not required because there is
slouken@5310
  2313
    # no limit to the length of command line arguments.
slouken@5310
  2314
    # Libtool will interpret -1 as no limit whatsoever
slouken@5310
  2315
    lt_cv_sys_max_cmd_len=-1;
slouken@5310
  2316
    ;;
slouken@5310
  2317
slouken@5310
  2318
  cygwin* | mingw* | cegcc*)
slouken@5310
  2319
    # On Win9x/ME, this test blows up -- it succeeds, but takes
slouken@5310
  2320
    # about 5 minutes as the teststring grows exponentially.
slouken@5310
  2321
    # Worse, since 9x/ME are not pre-emptively multitasking,
slouken@5310
  2322
    # you end up with a "frozen" computer, even though with patience
slouken@5310
  2323
    # the test eventually succeeds (with a max line length of 256k).
slouken@5310
  2324
    # Instead, let's just punt: use the minimum linelength reported by
slouken@5310
  2325
    # all of the supported platforms: 8192 (on NT/2K/XP).
slouken@5310
  2326
    lt_cv_sys_max_cmd_len=8192;
slouken@5310
  2327
    ;;
slouken@5310
  2328
slouken@6442
  2329
  mint*)
slouken@6442
  2330
    # On MiNT this can take a long time and run out of memory.
slouken@5310
  2331
    lt_cv_sys_max_cmd_len=8192;
slouken@5310
  2332
    ;;
slouken@5310
  2333
slouken@5310
  2334
  amigaos*)
slouken@5310
  2335
    # On AmigaOS with pdksh, this test takes hours, literally.
slouken@5310
  2336
    # So we just punt and use a minimum line length of 8192.
slouken@5310
  2337
    lt_cv_sys_max_cmd_len=8192;
slouken@5310
  2338
    ;;
slouken@5310
  2339
slouken@5310
  2340
  netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
slouken@5310
  2341
    # This has been around since 386BSD, at least.  Likely further.
slouken@5310
  2342
    if test -x /sbin/sysctl; then
slouken@5310
  2343
      lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
slouken@5310
  2344
    elif test -x /usr/sbin/sysctl; then
slouken@5310
  2345
      lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
slouken@5310
  2346
    else
slouken@5310
  2347
      lt_cv_sys_max_cmd_len=65536	# usable default for all BSDs
slouken@5310
  2348
    fi
slouken@5310
  2349
    # And add a safety zone
slouken@5310
  2350
    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
slouken@5310
  2351
    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
slouken@5310
  2352
    ;;
slouken@5310
  2353
slouken@5310
  2354
  interix*)
slouken@5310
  2355
    # We know the value 262144 and hardcode it with a safety zone (like BSD)
slouken@5310
  2356
    lt_cv_sys_max_cmd_len=196608
slouken@5310
  2357
    ;;
slouken@5310
  2358
slouken@6442
  2359
  os2*)
slouken@6442
  2360
    # The test takes a long time on OS/2.
slouken@6442
  2361
    lt_cv_sys_max_cmd_len=8192
slouken@6442
  2362
    ;;
slouken@6442
  2363
slouken@5310
  2364
  osf*)
slouken@5310
  2365
    # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
slouken@5310
  2366
    # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
slouken@5310
  2367
    # nice to cause kernel panics so lets avoid the loop below.
slouken@5310
  2368
    # First set a reasonable default.
slouken@5310
  2369
    lt_cv_sys_max_cmd_len=16384
slouken@5310
  2370
    #
slouken@5310
  2371
    if test -x /sbin/sysconfig; then
slouken@5310
  2372
      case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
slouken@5310
  2373
        *1*) lt_cv_sys_max_cmd_len=-1 ;;
slouken@5310
  2374
      esac
slouken@5310
  2375
    fi
slouken@5310
  2376
    ;;
slouken@5310
  2377
  sco3.2v5*)
slouken@5310
  2378
    lt_cv_sys_max_cmd_len=102400
slouken@5310
  2379
    ;;
slouken@5310
  2380
  sysv5* | sco5v6* | sysv4.2uw2*)
slouken@5310
  2381
    kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
slouken@5310
  2382
    if test -n "$kargmax"; then
slouken@5310
  2383
      lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[	 ]]//'`
slouken@5310
  2384
    else
slouken@5310
  2385
      lt_cv_sys_max_cmd_len=32768
slouken@5310
  2386
    fi
slouken@5310
  2387
    ;;
slouken@5310
  2388
  *)
slouken@5310
  2389
    lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
slouken@5310
  2390
    if test -n "$lt_cv_sys_max_cmd_len"; then
slouken@5310
  2391
      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
slouken@5310
  2392
      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
slouken@5310
  2393
    else
slouken@5310
  2394
      # Make teststring a little bigger before we do anything with it.
slouken@5310
  2395
      # a 1K string should be a reasonable start.
slouken@5310
  2396
      for i in 1 2 3 4 5 6 7 8 ; do
slouken@5310
  2397
        teststring=$teststring$teststring
slouken@5310
  2398
      done
slouken@5310
  2399
      SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
slouken@5310
  2400
      # If test is not a shell built-in, we'll probably end up computing a
slouken@5310
  2401
      # maximum length that is only half of the actual maximum length, but
slouken@5310
  2402
      # we can't tell.
slouken@6442
  2403
      while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \
slouken@6442
  2404
	         = "X$teststring$teststring"; } >/dev/null 2>&1 &&
slouken@5310
  2405
	      test $i != 17 # 1/2 MB should be enough
slouken@5310
  2406
      do
slouken@5310
  2407
        i=`expr $i + 1`
slouken@5310
  2408
        teststring=$teststring$teststring
slouken@5310
  2409
      done
slouken@5310
  2410
      # Only check the string length outside the loop.
slouken@5310
  2411
      lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
slouken@5310
  2412
      teststring=
slouken@5310
  2413
      # Add a significant safety factor because C++ compilers can tack on
slouken@5310
  2414
      # massive amounts of additional arguments before passing them to the
slouken@5310
  2415
      # linker.  It appears as though 1/2 is a usable value.
slouken@5310
  2416
      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
slouken@5310
  2417
    fi
slouken@5310
  2418
    ;;
slouken@5310
  2419
  esac
slouken@5310
  2420
])
slouken@5310
  2421
if test -n $lt_cv_sys_max_cmd_len ; then
slouken@5310
  2422
  AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
slouken@5310
  2423
else
slouken@5310
  2424
  AC_MSG_RESULT(none)
slouken@5310
  2425
fi
slouken@5310
  2426
max_cmd_len=$lt_cv_sys_max_cmd_len
slouken@5310
  2427
_LT_DECL([], [max_cmd_len], [0],
slouken@5310
  2428
    [What is the maximum length of a command?])
slouken@5310
  2429
])# LT_CMD_MAX_LEN
slouken@5310
  2430
slouken@5310
  2431
# Old name:
slouken@5310
  2432
AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN])
slouken@5310
  2433
dnl aclocal-1.4 backwards compatibility:
slouken@5310
  2434
dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [])
slouken@5310
  2435
slouken@5310
  2436
slouken@5310
  2437
# _LT_HEADER_DLFCN
slouken@5310
  2438
# ----------------
slouken@5310
  2439
m4_defun([_LT_HEADER_DLFCN],
slouken@5310
  2440
[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl
slouken@5310
  2441
])# _LT_HEADER_DLFCN
slouken@5310
  2442
slouken@5310
  2443
slouken@5310
  2444
# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
slouken@5310
  2445
#                      ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
slouken@5310
  2446
# ----------------------------------------------------------------
slouken@5310
  2447
m4_defun([_LT_TRY_DLOPEN_SELF],
slouken@5310
  2448
[m4_require([_LT_HEADER_DLFCN])dnl
slouken@5310
  2449
if test "$cross_compiling" = yes; then :
slouken@5310
  2450
  [$4]
slouken@5310
  2451
else
slouken@5310
  2452
  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
slouken@5310
  2453
  lt_status=$lt_dlunknown
slouken@5310
  2454
  cat > conftest.$ac_ext <<_LT_EOF
slouken@6442
  2455
[#line $LINENO "configure"
slouken@5310
  2456
#include "confdefs.h"
slouken@5310
  2457
slouken@5310
  2458
#if HAVE_DLFCN_H
slouken@5310
  2459
#include <dlfcn.h>
slouken@5310
  2460
#endif
slouken@5310
  2461
slouken@5310
  2462
#include <stdio.h>
slouken@5310
  2463
slouken@5310
  2464
#ifdef RTLD_GLOBAL
slouken@5310
  2465
#  define LT_DLGLOBAL		RTLD_GLOBAL
slouken@5310
  2466
#else
slouken@5310
  2467
#  ifdef DL_GLOBAL
slouken@5310
  2468
#    define LT_DLGLOBAL		DL_GLOBAL
slouken@5310
  2469
#  else
slouken@5310
  2470
#    define LT_DLGLOBAL		0
slouken@5310
  2471
#  endif
slouken@5310
  2472
#endif
slouken@5310
  2473
slouken@5310
  2474
/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
slouken@5310
  2475
   find out it does not work in some platform. */
slouken@5310
  2476
#ifndef LT_DLLAZY_OR_NOW
slouken@5310
  2477
#  ifdef RTLD_LAZY
slouken@5310
  2478
#    define LT_DLLAZY_OR_NOW		RTLD_LAZY
slouken@5310
  2479
#  else
slouken@5310
  2480
#    ifdef DL_LAZY
slouken@5310
  2481
#      define LT_DLLAZY_OR_NOW		DL_LAZY
slouken@5310
  2482
#    else
slouken@5310
  2483
#      ifdef RTLD_NOW
slouken@5310
  2484
#        define LT_DLLAZY_OR_NOW	RTLD_NOW
slouken@5310
  2485
#      else
slouken@5310
  2486
#        ifdef DL_NOW
slouken@5310
  2487
#          define LT_DLLAZY_OR_NOW	DL_NOW
slouken@5310
  2488
#        else
slouken@5310
  2489
#          define LT_DLLAZY_OR_NOW	0
slouken@5310
  2490
#        endif
slouken@5310
  2491
#      endif
slouken@5310
  2492
#    endif
slouken@5310
  2493
#  endif
slouken@5310
  2494
#endif
slouken@5310
  2495
slouken@6442
  2496
/* When -fvisbility=hidden is used, assume the code has been annotated
slouken@6442
  2497
   correspondingly for the symbols needed.  */
slouken@6442
  2498
#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
slouken@6442
  2499
int fnord () __attribute__((visibility("default")));
slouken@6442
  2500
#endif
slouken@6442
  2501
slouken@6442
  2502
int fnord () { return 42; }
slouken@5310
  2503
int main ()
slouken@5310
  2504
{
slouken@5310
  2505
  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
slouken@5310
  2506
  int status = $lt_dlunknown;
slouken@5310
  2507
slouken@5310
  2508
  if (self)
slouken@5310
  2509
    {
slouken@5310
  2510
      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
slouken@6442
  2511
      else
slouken@6442
  2512
        {
slouken@6442
  2513
	  if (dlsym( self,"_fnord"))  status = $lt_dlneed_uscore;
slouken@6442
  2514
          else puts (dlerror ());
slouken@6442
  2515
	}
slouken@5310
  2516
      /* dlclose (self); */
slouken@5310
  2517
    }
slouken@5310
  2518
  else
slouken@5310
  2519
    puts (dlerror ());
slouken@5310
  2520
slouken@5310
  2521
  return status;
slouken@5310
  2522
}]
slouken@5310
  2523
_LT_EOF
slouken@5310
  2524
  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
slouken@5310
  2525
    (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
slouken@5310
  2526
    lt_status=$?
slouken@5310
  2527
    case x$lt_status in
slouken@5310
  2528
      x$lt_dlno_uscore) $1 ;;
slouken@5310
  2529
      x$lt_dlneed_uscore) $2 ;;
slouken@5310
  2530
      x$lt_dlunknown|x*) $3 ;;
slouken@5310
  2531
    esac
slouken@5310
  2532
  else :
slouken@5310
  2533
    # compilation failed
slouken@5310