aclocal.m4
author Sam Lantinga <slouken@lokigames.com>
Thu, 21 Oct 1999 19:12:17 +0000
changeset 1 4ef9250a6471
parent 0 4ce2db4db959
child 6 cb0e8db1f996
permissions -rw-r--r--
Added caching wave loading (needed by CivCTP)
Only link in the mikmod and timidity libraries if they are configured.
'make dist' works now
slouken@0
     1
dnl aclocal.m4 generated automatically by aclocal 1.4a
slouken@0
     2
slouken@0
     3
dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
slouken@0
     4
dnl This file is free software; the Free Software Foundation
slouken@0
     5
dnl gives unlimited permission to copy and/or distribute it,
slouken@0
     6
dnl with or without modifications, as long as this notice is preserved.
slouken@0
     7
slouken@0
     8
dnl This program is distributed in the hope that it will be useful,
slouken@0
     9
dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
slouken@0
    10
dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
slouken@0
    11
dnl PARTICULAR PURPOSE.
slouken@0
    12
slouken@0
    13
# Configure paths for SDL
slouken@0
    14
# Sam Lantinga 9/21/99
slouken@0
    15
# stolen from Manish Singh
slouken@0
    16
# stolen back from Frank Belew
slouken@0
    17
# stolen from Manish Singh
slouken@0
    18
# Shamelessly stolen from Owen Taylor
slouken@0
    19
slouken@0
    20
dnl AM_PATH_SDL([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
slouken@0
    21
dnl Test for SDL, and define SDL_CFLAGS and SDL_LIBS
slouken@0
    22
dnl
slouken@0
    23
AC_DEFUN(AM_PATH_SDL,
slouken@0
    24
[dnl 
slouken@0
    25
dnl Get the cflags and libraries from the sdl-config script
slouken@0
    26
dnl
slouken@0
    27
AC_ARG_WITH(sdl-prefix,[  --with-sdl-prefix=PFX   Prefix where SDL is installed (optional)],
slouken@0
    28
            sdl_prefix="$withval", sdl_prefix="")
slouken@0
    29
AC_ARG_WITH(sdl-exec-prefix,[  --with-sdl-exec-prefix=PFX Exec prefix where SDL is installed (optional)],
slouken@0
    30
            sdl_exec_prefix="$withval", sdl_exec_prefix="")
slouken@0
    31
AC_ARG_ENABLE(sdltest, [  --disable-sdltest       Do not try to compile and run a test SDL program],
slouken@0
    32
		    , enable_sdltest=yes)
slouken@0
    33
slouken@0
    34
  if test x$sdl_exec_prefix != x ; then
slouken@0
    35
     sdl_args="$sdl_args --exec-prefix=$sdl_exec_prefix"
slouken@0
    36
     if test x${SDL_CONFIG+set} != xset ; then
slouken@0
    37
        SDL_CONFIG=$sdl_exec_prefix/bin/sdl-config
slouken@0
    38
     fi
slouken@0
    39
  fi
slouken@0
    40
  if test x$sdl_prefix != x ; then
slouken@0
    41
     sdl_args="$sdl_args --prefix=$sdl_prefix"
slouken@0
    42
     if test x${SDL_CONFIG+set} != xset ; then
slouken@0
    43
        SDL_CONFIG=$sdl_prefix/bin/sdl-config
slouken@0
    44
     fi
slouken@0
    45
  fi
slouken@0
    46
slouken@0
    47
  AC_PATH_PROG(SDL_CONFIG, sdl-config, no)
slouken@0
    48
  min_sdl_version=ifelse([$1], ,0.11.0,$1)
slouken@0
    49
  AC_MSG_CHECKING(for SDL - version >= $min_sdl_version)
slouken@0
    50
  no_sdl=""
slouken@0
    51
  if test "$SDL_CONFIG" = "no" ; then
slouken@0
    52
    no_sdl=yes
slouken@0
    53
  else
slouken@0
    54
    SDL_CFLAGS=`$SDL_CONFIG $sdlconf_args --cflags`
slouken@0
    55
    SDL_LIBS=`$SDL_CONFIG $sdlconf_args --libs`
slouken@0
    56
slouken@0
    57
    sdl_major_version=`$SDL_CONFIG $sdl_args --version | \
slouken@0
    58
           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
slouken@0
    59
    sdl_minor_version=`$SDL_CONFIG $sdl_args --version | \
slouken@0
    60
           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
slouken@0
    61
    sdl_micro_version=`$SDL_CONFIG $sdl_config_args --version | \
slouken@0
    62
           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
slouken@0
    63
    if test "x$enable_sdltest" = "xyes" ; then
slouken@0
    64
      ac_save_CFLAGS="$CFLAGS"
slouken@0
    65
      ac_save_LIBS="$LIBS"
slouken@0
    66
      CFLAGS="$CFLAGS $SDL_CFLAGS"
slouken@0
    67
      LIBS="$LIBS $SDL_LIBS"
slouken@0
    68
dnl
slouken@0
    69
dnl Now check if the installed SDL is sufficiently new. (Also sanity
slouken@0
    70
dnl checks the results of sdl-config to some extent
slouken@0
    71
dnl
slouken@0
    72
      rm -f conf.sdltest
slouken@0
    73
      AC_TRY_RUN([
slouken@0
    74
#include <stdio.h>
slouken@0
    75
#include <stdlib.h>
slouken@0
    76
#include <string.h>
slouken@0
    77
#include <SDL/SDL.h>
slouken@0
    78
slouken@0
    79
char*
slouken@0
    80
my_strdup (char *str)
slouken@0
    81
{
slouken@0
    82
  char *new_str;
slouken@0
    83
  
slouken@0
    84
  if (str)
slouken@0
    85
    {
slouken@0
    86
      new_str = malloc ((strlen (str) + 1) * sizeof(char));
slouken@0
    87
      strcpy (new_str, str);
slouken@0
    88
    }
slouken@0
    89
  else
slouken@0
    90
    new_str = NULL;
slouken@0
    91
  
slouken@0
    92
  return new_str;
slouken@0
    93
}
slouken@0
    94
slouken@0
    95
int main ()
slouken@0
    96
{
slouken@0
    97
  int major, minor, micro;
slouken@0
    98
  char *tmp_version;
slouken@0
    99
slouken@0
   100
  system ("touch conf.sdltest");
slouken@0
   101
slouken@0
   102
  /* HP/UX 9 (%@#!) writes to sscanf strings */
slouken@0
   103
  tmp_version = my_strdup("$min_sdl_version");
slouken@0
   104
  if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
slouken@0
   105
     printf("%s, bad version string\n", "$min_sdl_version");
slouken@0
   106
     exit(1);
slouken@0
   107
   }
slouken@0
   108
slouken@0
   109
   if (($sdl_major_version > major) ||
slouken@0
   110
      (($sdl_major_version == major) && ($sdl_minor_version > minor)) ||
slouken@0
   111
      (($sdl_major_version == major) && ($sdl_minor_version == minor) && ($sdl_micro_version >= micro)))
slouken@0
   112
    {
slouken@0
   113
      return 0;
slouken@0
   114
    }
slouken@0
   115
  else
slouken@0
   116
    {
slouken@0
   117
      printf("\n*** 'sdl-config --version' returned %d.%d.%d, but the minimum version\n", $sdl_major_version, $sdl_minor_version, $sdl_micro_version);
slouken@0
   118
      printf("*** of SDL required is %d.%d.%d. If sdl-config is correct, then it is\n", major, minor, micro);
slouken@0
   119
      printf("*** best to upgrade to the required version.\n");
slouken@0
   120
      printf("*** If sdl-config was wrong, set the environment variable SDL_CONFIG\n");
slouken@0
   121
      printf("*** to point to the correct copy of sdl-config, and remove the file\n");
slouken@0
   122
      printf("*** config.cache before re-running configure\n");
slouken@0
   123
      return 1;
slouken@0
   124
    }
slouken@0
   125
}
slouken@0
   126
slouken@0
   127
],, no_sdl=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
slouken@0
   128
       CFLAGS="$ac_save_CFLAGS"
slouken@0
   129
       LIBS="$ac_save_LIBS"
slouken@0
   130
     fi
slouken@0
   131
  fi
slouken@0
   132
  if test "x$no_sdl" = x ; then
slouken@0
   133
     AC_MSG_RESULT(yes)
slouken@0
   134
     ifelse([$2], , :, [$2])     
slouken@0
   135
  else
slouken@0
   136
     AC_MSG_RESULT(no)
slouken@0
   137
     if test "$SDL_CONFIG" = "no" ; then
slouken@0
   138
       echo "*** The sdl-config script installed by SDL could not be found"
slouken@0
   139
       echo "*** If SDL was installed in PREFIX, make sure PREFIX/bin is in"
slouken@0
   140
       echo "*** your path, or set the SDL_CONFIG environment variable to the"
slouken@0
   141
       echo "*** full path to sdl-config."
slouken@0
   142
     else
slouken@0
   143
       if test -f conf.sdltest ; then
slouken@0
   144
        :
slouken@0
   145
       else
slouken@0
   146
          echo "*** Could not run SDL test program, checking why..."
slouken@0
   147
          CFLAGS="$CFLAGS $SDL_CFLAGS"
slouken@0
   148
          LIBS="$LIBS $SDL_LIBS"
slouken@0
   149
          AC_TRY_LINK([
slouken@0
   150
#include <stdio.h>
slouken@0
   151
#include <SDL/SDL.h>
slouken@0
   152
],      [ return 0; ],
slouken@0
   153
        [ echo "*** The test program compiled, but did not run. This usually means"
slouken@0
   154
          echo "*** that the run-time linker is not finding SDL or finding the wrong"
slouken@0
   155
          echo "*** version of SDL. If it is not finding SDL, you'll need to set your"
slouken@0
   156
          echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
slouken@0
   157
          echo "*** to the installed location  Also, make sure you have run ldconfig if that"
slouken@0
   158
          echo "*** is required on your system"
slouken@0
   159
	  echo "***"
slouken@0
   160
          echo "*** If you have an old version installed, it is best to remove it, although"
slouken@0
   161
          echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"],
slouken@0
   162
        [ echo "*** The test program failed to compile or link. See the file config.log for the"
slouken@0
   163
          echo "*** exact error that occured. This usually means SDL was incorrectly installed"
slouken@0
   164
          echo "*** or that you have moved SDL since it was installed. In the latter case, you"
slouken@0
   165
          echo "*** may want to edit the sdl-config script: $SDL_CONFIG" ])
slouken@0
   166
          CFLAGS="$ac_save_CFLAGS"
slouken@0
   167
          LIBS="$ac_save_LIBS"
slouken@0
   168
       fi
slouken@0
   169
     fi
slouken@0
   170
     SDL_CFLAGS=""
slouken@0
   171
     SDL_LIBS=""
slouken@0
   172
     ifelse([$3], , :, [$3])
slouken@0
   173
  fi
slouken@0
   174
  AC_SUBST(SDL_CFLAGS)
slouken@0
   175
  AC_SUBST(SDL_LIBS)
slouken@0
   176
  rm -f conf.sdltest
slouken@0
   177
])
slouken@0
   178
slouken@0
   179
# Do all the work for Automake.  This macro actually does too much --
slouken@0
   180
# some checks are only needed if your package does certain things.
slouken@0
   181
# But this isn't really a big deal.
slouken@0
   182
slouken@0
   183
# serial 1
slouken@0
   184
slouken@0
   185
dnl Usage:
slouken@0
   186
dnl AM_INIT_AUTOMAKE(package,version, [no-define])
slouken@0
   187
slouken@0
   188
AC_DEFUN(AM_INIT_AUTOMAKE,
slouken@0
   189
[AC_REQUIRE([AC_PROG_INSTALL])
slouken@0
   190
dnl We require 2.13 because we rely on SHELL being computed by configure.
slouken@0
   191
AC_PREREQ([2.13])
slouken@0
   192
PACKAGE=[$1]
slouken@0
   193
AC_SUBST(PACKAGE)
slouken@0
   194
VERSION=[$2]
slouken@0
   195
AC_SUBST(VERSION)
slouken@0
   196
dnl test to see if srcdir already configured
slouken@0
   197
if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
slouken@0
   198
  AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
slouken@0
   199
fi
slouken@0
   200
ifelse([$3],,
slouken@0
   201
AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
slouken@0
   202
AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
slouken@0
   203
AC_REQUIRE([AM_SANITY_CHECK])
slouken@0
   204
AC_REQUIRE([AC_ARG_PROGRAM])
slouken@0
   205
dnl FIXME This is truly gross.
slouken@0
   206
missing_dir=`cd $ac_aux_dir && pwd`
slouken@0
   207
AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
slouken@0
   208
AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
slouken@0
   209
AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
slouken@0
   210
AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
slouken@0
   211
AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
slouken@0
   212
AC_REQUIRE([AC_PROG_MAKE_SET])])
slouken@0
   213
slouken@0
   214
#
slouken@0
   215
# Check to make sure that the build environment is sane.
slouken@0
   216
#
slouken@0
   217
slouken@0
   218
AC_DEFUN(AM_SANITY_CHECK,
slouken@0
   219
[AC_MSG_CHECKING([whether build environment is sane])
slouken@0
   220
# Just in case
slouken@0
   221
sleep 1
slouken@0
   222
echo timestamp > conftestfile
slouken@0
   223
# Do `set' in a subshell so we don't clobber the current shell's
slouken@0
   224
# arguments.  Must try -L first in case configure is actually a
slouken@0
   225
# symlink; some systems play weird games with the mod time of symlinks
slouken@0
   226
# (eg FreeBSD returns the mod time of the symlink's containing
slouken@0
   227
# directory).
slouken@0
   228
if (
slouken@0
   229
   set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
slouken@0
   230
   if test "[$]*" = "X"; then
slouken@0
   231
      # -L didn't work.
slouken@0
   232
      set X `ls -t $srcdir/configure conftestfile`
slouken@0
   233
   fi
slouken@0
   234
   if test "[$]*" != "X $srcdir/configure conftestfile" \
slouken@0
   235
      && test "[$]*" != "X conftestfile $srcdir/configure"; then
slouken@0
   236
slouken@0
   237
      # If neither matched, then we have a broken ls.  This can happen
slouken@0
   238
      # if, for instance, CONFIG_SHELL is bash and it inherits a
slouken@0
   239
      # broken ls alias from the environment.  This has actually
slouken@0
   240
      # happened.  Such a system could not be considered "sane".
slouken@0
   241
      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
slouken@0
   242
alias in your environment])
slouken@0
   243
   fi
slouken@0
   244
slouken@0
   245
   test "[$]2" = conftestfile
slouken@0
   246
   )
slouken@0
   247
then
slouken@0
   248
   # Ok.
slouken@0
   249
   :
slouken@0
   250
else
slouken@0
   251
   AC_MSG_ERROR([newly created file is older than distributed files!
slouken@0
   252
Check your system clock])
slouken@0
   253
fi
slouken@0
   254
rm -f conftest*
slouken@0
   255
AC_MSG_RESULT(yes)])
slouken@0
   256
slouken@0
   257
dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
slouken@0
   258
dnl The program must properly implement --version.
slouken@0
   259
AC_DEFUN(AM_MISSING_PROG,
slouken@0
   260
[AC_MSG_CHECKING(for working $2)
slouken@0
   261
# Run test in a subshell; some versions of sh will print an error if
slouken@0
   262
# an executable is not found, even if stderr is redirected.
slouken@0
   263
# Redirect stdin to placate older versions of autoconf.  Sigh.
slouken@0
   264
if ($2 --version) < /dev/null > /dev/null 2>&1; then
slouken@0
   265
   $1=$2
slouken@0
   266
   AC_MSG_RESULT(found)
slouken@0
   267
else
slouken@0
   268
   $1="$3/missing $2"
slouken@0
   269
   AC_MSG_RESULT(missing)
slouken@0
   270
fi
slouken@0
   271
AC_SUBST($1)])
slouken@0
   272
slouken@0
   273
slouken@0
   274
# serial 41 AC_PROG_LIBTOOL
slouken@0
   275
AC_DEFUN(AC_PROG_LIBTOOL,
slouken@0
   276
[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
slouken@0
   277
slouken@0
   278
# Save cache, so that ltconfig can load it
slouken@0
   279
AC_CACHE_SAVE
slouken@0
   280
slouken@0
   281
# Actually configure libtool.  ac_aux_dir is where install-sh is found.
slouken@0
   282
CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
slouken@0
   283
LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
slouken@0
   284
LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" \
slouken@0
   285
DLLTOOL="$DLLTOOL" AS="$AS" OBJDUMP="$OBJDUMP" \
slouken@0
   286
${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
slouken@0
   287
$libtool_flags --no-verify --build="$build" $ac_aux_dir/ltmain.sh $host \
slouken@0
   288
|| AC_MSG_ERROR([libtool configure failed])
slouken@0
   289
slouken@0
   290
# Reload cache, that may have been modified by ltconfig
slouken@0
   291
AC_CACHE_LOAD
slouken@0
   292
slouken@0
   293
# This can be used to rebuild libtool when needed
slouken@0
   294
LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh"
slouken@0
   295
slouken@0
   296
# Always use our own libtool.
slouken@0
   297
LIBTOOL='$(SHELL) $(top_builddir)/libtool'
slouken@0
   298
AC_SUBST(LIBTOOL)dnl
slouken@0
   299
slouken@0
   300
# Redirect the config.log output again, so that the ltconfig log is not
slouken@0
   301
# clobbered by the next message.
slouken@0
   302
exec 5>>./config.log
slouken@0
   303
])
slouken@0
   304
slouken@0
   305
AC_DEFUN(AC_LIBTOOL_SETUP,
slouken@0
   306
[AC_PREREQ(2.13)dnl
slouken@0
   307
AC_REQUIRE([AC_ENABLE_SHARED])dnl
slouken@0
   308
AC_REQUIRE([AC_ENABLE_STATIC])dnl
slouken@0
   309
AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
slouken@0
   310
AC_REQUIRE([AC_CANONICAL_HOST])dnl
slouken@0
   311
AC_REQUIRE([AC_CANONICAL_BUILD])dnl
slouken@0
   312
AC_REQUIRE([AC_PROG_CC])dnl
slouken@0
   313
AC_REQUIRE([AC_PROG_LD])dnl
slouken@0
   314
AC_REQUIRE([AC_PROG_NM])dnl
slouken@0
   315
AC_REQUIRE([AC_PROG_LN_S])dnl
slouken@0
   316
dnl
slouken@0
   317
slouken@0
   318
AC_CHECK_TOOL(RANLIB, ranlib, :)
slouken@0
   319
slouken@0
   320
# Check for any special flags to pass to ltconfig.
slouken@0
   321
libtool_flags="--cache-file=$cache_file"
slouken@0
   322
test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
slouken@0
   323
test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
slouken@0
   324
test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install"
slouken@0
   325
test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
slouken@0
   326
test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
slouken@0
   327
ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN],
slouken@0
   328
[libtool_flags="$libtool_flags --enable-dlopen"])
slouken@0
   329
ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
slouken@0
   330
[libtool_flags="$libtool_flags --enable-win32-dll"])
slouken@0
   331
AC_ARG_ENABLE(libtool-lock,
slouken@0
   332
  [  --disable-libtool-lock  avoid locking (might break parallel builds)])
slouken@0
   333
test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock"
slouken@0
   334
test x"$silent" = xyes && libtool_flags="$libtool_flags --silent"
slouken@0
   335
slouken@0
   336
AC_ARG_WITH(pic,
slouken@0
   337
  [  --with-pic              try to use only PIC/non-PIC objects [default=use both]],
slouken@0
   338
     pic_mode="$withval", pic_mode=default)
slouken@0
   339
test x"$pic_mode" = xyes && libtool_flags="$libtool_flags --prefer-pic"
slouken@0
   340
test x"$pic_mode" = xno && libtool_flags="$libtool_flags --prefer-non-pic"
slouken@0
   341
slouken@0
   342
# Some flags need to be propagated to the compiler or linker for good
slouken@0
   343
# libtool support.
slouken@0
   344
case "$host" in
slouken@0
   345
*-*-irix6*)
slouken@0
   346
  # Find out which ABI we are using.
slouken@0
   347
  echo '[#]line __oline__ "configure"' > conftest.$ac_ext
slouken@0
   348
  if AC_TRY_EVAL(ac_compile); then
slouken@0
   349
    case "`/usr/bin/file conftest.o`" in
slouken@0
   350
    *32-bit*)
slouken@0
   351
      LD="${LD-ld} -32"
slouken@0
   352
      ;;
slouken@0
   353
    *N32*)
slouken@0
   354
      LD="${LD-ld} -n32"
slouken@0
   355
      ;;
slouken@0
   356
    *64-bit*)
slouken@0
   357
      LD="${LD-ld} -64"
slouken@0
   358
      ;;
slouken@0
   359
    esac
slouken@0
   360
  fi
slouken@0
   361
  rm -rf conftest*
slouken@0
   362
  ;;
slouken@0
   363
slouken@0
   364
*-*-sco3.2v5*)
slouken@0
   365
  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
slouken@0
   366
  SAVE_CFLAGS="$CFLAGS"
slouken@0
   367
  CFLAGS="$CFLAGS -belf"
slouken@0
   368
  AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
slouken@0
   369
    [AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])])
slouken@0
   370
  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
slouken@0
   371
    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
slouken@0
   372
    CFLAGS="$SAVE_CFLAGS"
slouken@0
   373
  fi
slouken@0
   374
  ;;
slouken@0
   375
slouken@0
   376
ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
slouken@0
   377
[*-*-cygwin* | *-*-mingw*)
slouken@0
   378
  AC_CHECK_TOOL(DLLTOOL, dlltool, false)
slouken@0
   379
  AC_CHECK_TOOL(AS, as, false)
slouken@0
   380
  AC_CHECK_TOOL(OBJDUMP, objdump, false)
slouken@0
   381
slouken@0
   382
  # recent cygwin and mingw systems supply a stub DllMain which the user
slouken@0
   383
  # can override, but on older systems we have to supply one
slouken@0
   384
  AC_CACHE_CHECK([if libtool should supply DllMain function], lt_cv_need_dllmain,
slouken@0
   385
    [AC_TRY_LINK([DllMain (0, 0, 0);],
slouken@0
   386
      [extern int __attribute__((__stdcall__)) DllMain(void*, int, void*);],
slouken@0
   387
      [lt_cv_need_dllmain=yes],[lt_cv_need_dllmain=no])])
slouken@0
   388
slouken@0
   389
  case $host in
slouken@0
   390
  *-*-cygwin*)
slouken@0
   391
    # cygwin systems need to pass --dll to the linker, and not link
slouken@0
   392
    # crt.o which will require a WinMain@16 definition.
slouken@0
   393
    lt_cv_cc_dll_switch="-Wl,--dll -nostartfiles" ;;
slouken@0
   394
  *-*-mingw*)
slouken@0
   395
    # old mingw systems require "-dll" to link a DLL, while more recent ones
slouken@0
   396
    # require "-mdll"
slouken@0
   397
    SAVE_CFLAGS="$CFLAGS"
slouken@0
   398
    CFLAGS="$CFLAGS -mdll"
slouken@0
   399
    AC_CACHE_CHECK([how to link DLLs], lt_cv_cc_dll_switch,
slouken@0
   400
      [AC_TRY_LINK([], [], [lt_cv_cc_dll_switch=-mdll],[lt_cv_cc_dll_switch=-dll])])
slouken@0
   401
    CFLAGS="$SAVE_CFLAGS" ;;
slouken@0
   402
  esac
slouken@0
   403
  ;;
slouken@0
   404
  ])
slouken@0
   405
esac
slouken@0
   406
])
slouken@0
   407
slouken@0
   408
# AC_LIBTOOL_DLOPEN - enable checks for dlopen support
slouken@0
   409
AC_DEFUN(AC_LIBTOOL_DLOPEN, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])])
slouken@0
   410
slouken@0
   411
# AC_LIBTOOL_WIN32_DLL - declare package support for building win32 dll's
slouken@0
   412
AC_DEFUN(AC_LIBTOOL_WIN32_DLL, [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])])
slouken@0
   413
slouken@0
   414
# AC_ENABLE_SHARED - implement the --enable-shared flag
slouken@0
   415
# Usage: AC_ENABLE_SHARED[(DEFAULT)]
slouken@0
   416
#   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
slouken@0
   417
#   `yes'.
slouken@0
   418
AC_DEFUN(AC_ENABLE_SHARED, [dnl
slouken@0
   419
define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
slouken@0
   420
AC_ARG_ENABLE(shared,
slouken@0
   421
changequote(<<, >>)dnl
slouken@0
   422
<<  --enable-shared[=PKGS]  build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT],
slouken@0
   423
changequote([, ])dnl
slouken@0
   424
[p=${PACKAGE-default}
slouken@0
   425
case "$enableval" in
slouken@0
   426
yes) enable_shared=yes ;;
slouken@0
   427
no) enable_shared=no ;;
slouken@0
   428
*)
slouken@0
   429
  enable_shared=no
slouken@0
   430
  # Look at the argument we got.  We use all the common list separators.
slouken@0
   431
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
slouken@0
   432
  for pkg in $enableval; do
slouken@0
   433
    if test "X$pkg" = "X$p"; then
slouken@0
   434
      enable_shared=yes
slouken@0
   435
    fi
slouken@0
   436
  done
slouken@0
   437
  IFS="$ac_save_ifs"
slouken@0
   438
  ;;
slouken@0
   439
esac],
slouken@0
   440
enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl
slouken@0
   441
])
slouken@0
   442
slouken@0
   443
# AC_DISABLE_SHARED - set the default shared flag to --disable-shared
slouken@0
   444
AC_DEFUN(AC_DISABLE_SHARED, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
slouken@0
   445
AC_ENABLE_SHARED(no)])
slouken@0
   446
slouken@0
   447
# AC_ENABLE_STATIC - implement the --enable-static flag
slouken@0
   448
# Usage: AC_ENABLE_STATIC[(DEFAULT)]
slouken@0
   449
#   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
slouken@0
   450
#   `yes'.
slouken@0
   451
AC_DEFUN(AC_ENABLE_STATIC, [dnl
slouken@0
   452
define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
slouken@0
   453
AC_ARG_ENABLE(static,
slouken@0
   454
changequote(<<, >>)dnl
slouken@0
   455
<<  --enable-static[=PKGS]  build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT],
slouken@0
   456
changequote([, ])dnl
slouken@0
   457
[p=${PACKAGE-default}
slouken@0
   458
case "$enableval" in
slouken@0
   459
yes) enable_static=yes ;;
slouken@0
   460
no) enable_static=no ;;
slouken@0
   461
*)
slouken@0
   462
  enable_static=no
slouken@0
   463
  # Look at the argument we got.  We use all the common list separators.
slouken@0
   464
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
slouken@0
   465
  for pkg in $enableval; do
slouken@0
   466
    if test "X$pkg" = "X$p"; then
slouken@0
   467
      enable_static=yes
slouken@0
   468
    fi
slouken@0
   469
  done
slouken@0
   470
  IFS="$ac_save_ifs"
slouken@0
   471
  ;;
slouken@0
   472
esac],
slouken@0
   473
enable_static=AC_ENABLE_STATIC_DEFAULT)dnl
slouken@0
   474
])
slouken@0
   475
slouken@0
   476
# AC_DISABLE_STATIC - set the default static flag to --disable-static
slouken@0
   477
AC_DEFUN(AC_DISABLE_STATIC, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
slouken@0
   478
AC_ENABLE_STATIC(no)])
slouken@0
   479
slouken@0
   480
slouken@0
   481
# AC_ENABLE_FAST_INSTALL - implement the --enable-fast-install flag
slouken@0
   482
# Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)]
slouken@0
   483
#   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
slouken@0
   484
#   `yes'.
slouken@0
   485
AC_DEFUN(AC_ENABLE_FAST_INSTALL, [dnl
slouken@0
   486
define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
slouken@0
   487
AC_ARG_ENABLE(fast-install,
slouken@0
   488
changequote(<<, >>)dnl
slouken@0
   489
<<  --enable-fast-install[=PKGS]  optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT],
slouken@0
   490
changequote([, ])dnl
slouken@0
   491
[p=${PACKAGE-default}
slouken@0
   492
case "$enableval" in
slouken@0
   493
yes) enable_fast_install=yes ;;
slouken@0
   494
no) enable_fast_install=no ;;
slouken@0
   495
*)
slouken@0
   496
  enable_fast_install=no
slouken@0
   497
  # Look at the argument we got.  We use all the common list separators.
slouken@0
   498
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
slouken@0
   499
  for pkg in $enableval; do
slouken@0
   500
    if test "X$pkg" = "X$p"; then
slouken@0
   501
      enable_fast_install=yes
slouken@0
   502
    fi
slouken@0
   503
  done
slouken@0
   504
  IFS="$ac_save_ifs"
slouken@0
   505
  ;;
slouken@0
   506
esac],
slouken@0
   507
enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl
slouken@0
   508
])
slouken@0
   509
slouken@0
   510
# AC_ENABLE_FAST_INSTALL - set the default to --disable-fast-install
slouken@0
   511
AC_DEFUN(AC_DISABLE_FAST_INSTALL, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
slouken@0
   512
AC_ENABLE_FAST_INSTALL(no)])
slouken@0
   513
slouken@0
   514
# AC_PROG_LD - find the path to the GNU or non-GNU linker
slouken@0
   515
AC_DEFUN(AC_PROG_LD,
slouken@0
   516
[AC_ARG_WITH(gnu-ld,
slouken@0
   517
[  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]],
slouken@0
   518
test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
slouken@0
   519
AC_REQUIRE([AC_PROG_CC])dnl
slouken@0
   520
AC_REQUIRE([AC_CANONICAL_HOST])dnl
slouken@0
   521
AC_REQUIRE([AC_CANONICAL_BUILD])dnl
slouken@0
   522
ac_prog=ld
slouken@0
   523
if test "$ac_cv_prog_gcc" = yes; then
slouken@0
   524
  # Check if gcc -print-prog-name=ld gives a path.
slouken@0
   525
  AC_MSG_CHECKING([for ld used by GCC])
slouken@0
   526
  case $host in
slouken@0
   527
  *-*-mingw*)
slouken@0
   528
    # gcc leaves a trailing carriage return which upsets mingw
slouken@0
   529
    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
slouken@0
   530
  *)
slouken@0
   531
    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
slouken@0
   532
  esac
slouken@0
   533
  case "$ac_prog" in
slouken@0
   534
    # Accept absolute paths.
slouken@0
   535
changequote(,)dnl
slouken@0
   536
    [\\/]* | [A-Za-z]:[\\/]*)
slouken@0
   537
      re_direlt='/[^/][^/]*/\.\./'
slouken@0
   538
changequote([,])dnl
slouken@0
   539
      # Canonicalize the path of ld
slouken@0
   540
      ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
slouken@0
   541
      while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
slouken@0
   542
	ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
slouken@0
   543
      done
slouken@0
   544
      test -z "$LD" && LD="$ac_prog"
slouken@0
   545
      ;;
slouken@0
   546
  "")
slouken@0
   547
    # If it fails, then pretend we aren't using GCC.
slouken@0
   548
    ac_prog=ld
slouken@0
   549
    ;;
slouken@0
   550
  *)
slouken@0
   551
    # If it is relative, then search for the first ld in PATH.
slouken@0
   552
    with_gnu_ld=unknown
slouken@0
   553
    ;;
slouken@0
   554
  esac
slouken@0
   555
elif test "$with_gnu_ld" = yes; then
slouken@0
   556
  AC_MSG_CHECKING([for GNU ld])
slouken@0
   557
else
slouken@0
   558
  AC_MSG_CHECKING([for non-GNU ld])
slouken@0
   559
fi
slouken@0
   560
AC_CACHE_VAL(ac_cv_path_LD,
slouken@0
   561
[if test -z "$LD"; then
slouken@0
   562
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
slouken@0
   563
  for ac_dir in $PATH; do
slouken@0
   564
    test -z "$ac_dir" && ac_dir=.
slouken@0
   565
    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
slouken@0
   566
      ac_cv_path_LD="$ac_dir/$ac_prog"
slouken@0
   567
      # Check to see if the program is GNU ld.  I'd rather use --version,
slouken@0
   568
      # but apparently some GNU ld's only accept -v.
slouken@0
   569
      # Break only if it was the GNU/non-GNU ld that we prefer.
slouken@0
   570
      if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
slouken@0
   571
	test "$with_gnu_ld" != no && break
slouken@0
   572
      else
slouken@0
   573
	test "$with_gnu_ld" != yes && break
slouken@0
   574
      fi
slouken@0
   575
    fi
slouken@0
   576
  done
slouken@0
   577
  IFS="$ac_save_ifs"
slouken@0
   578
else
slouken@0
   579
  ac_cv_path_LD="$LD" # Let the user override the test with a path.
slouken@0
   580
fi])
slouken@0
   581
LD="$ac_cv_path_LD"
slouken@0
   582
if test -n "$LD"; then
slouken@0
   583
  AC_MSG_RESULT($LD)
slouken@0
   584
else
slouken@0
   585
  AC_MSG_RESULT(no)
slouken@0
   586
fi
slouken@0
   587
test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
slouken@0
   588
AC_SUBST(LD)
slouken@0
   589
AC_PROG_LD_GNU
slouken@0
   590
])
slouken@0
   591
slouken@0
   592
AC_DEFUN(AC_PROG_LD_GNU,
slouken@0
   593
[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld,
slouken@0
   594
[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
slouken@0
   595
if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
slouken@0
   596
  ac_cv_prog_gnu_ld=yes
slouken@0
   597
else
slouken@0
   598
  ac_cv_prog_gnu_ld=no
slouken@0
   599
fi])
slouken@0
   600
])
slouken@0
   601
slouken@0
   602
# AC_PROG_NM - find the path to a BSD-compatible name lister
slouken@0
   603
AC_DEFUN(AC_PROG_NM,
slouken@0
   604
[AC_MSG_CHECKING([for BSD-compatible nm])
slouken@0
   605
AC_CACHE_VAL(ac_cv_path_NM,
slouken@0
   606
[if test -n "$NM"; then
slouken@0
   607
  # Let the user override the test.
slouken@0
   608
  ac_cv_path_NM="$NM"
slouken@0
   609
else
slouken@0
   610
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
slouken@0
   611
  for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
slouken@0
   612
    test -z "$ac_dir" && ac_dir=.
slouken@0
   613
    if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext ; then
slouken@0
   614
      # Check to see if the nm accepts a BSD-compat flag.
slouken@0
   615
      # Adding the `sed 1q' prevents false positives on HP-UX, which says:
slouken@0
   616
      #   nm: unknown option "B" ignored
slouken@0
   617
      if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
slouken@0
   618
	ac_cv_path_NM="$ac_dir/nm -B"
slouken@0
   619
	break
slouken@0
   620
      elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
slouken@0
   621
	ac_cv_path_NM="$ac_dir/nm -p"
slouken@0
   622
	break
slouken@0
   623
      else
slouken@0
   624
	ac_cv_path_NM=${ac_cv_path_NM="$ac_dir/nm"} # keep the first match, but
slouken@0
   625
	continue # so that we can try to find one that supports BSD flags
slouken@0
   626
      fi
slouken@0
   627
    fi
slouken@0
   628
  done
slouken@0
   629
  IFS="$ac_save_ifs"
slouken@0
   630
  test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
slouken@0
   631
fi])
slouken@0
   632
NM="$ac_cv_path_NM"
slouken@0
   633
AC_MSG_RESULT([$NM])
slouken@0
   634
AC_SUBST(NM)
slouken@0
   635
])
slouken@0
   636
slouken@0
   637
# AC_CHECK_LIBM - check for math library
slouken@0
   638
AC_DEFUN(AC_CHECK_LIBM,
slouken@0
   639
[AC_REQUIRE([AC_CANONICAL_HOST])dnl
slouken@0
   640
LIBM=
slouken@0
   641
case "$host" in
slouken@0
   642
*-*-beos* | *-*-cygwin*)
slouken@0
   643
  # These system don't have libm
slouken@0
   644
  ;;
slouken@0
   645
*-ncr-sysv4.3*)
slouken@0
   646
  AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
slouken@0
   647
  AC_CHECK_LIB(m, main, LIBM="$LIBM -lm")
slouken@0
   648
  ;;
slouken@0
   649
*)
slouken@0
   650
  AC_CHECK_LIB(m, main, LIBM="-lm")
slouken@0
   651
  ;;
slouken@0
   652
esac
slouken@0
   653
])
slouken@0
   654
slouken@0
   655
# AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for
slouken@0
   656
# the libltdl convenience library, adds --enable-ltdl-convenience to
slouken@0
   657
# the configure arguments.  Note that LIBLTDL is not AC_SUBSTed, nor
slouken@0
   658
# is AC_CONFIG_SUBDIRS called.  If DIR is not provided, it is assumed
slouken@0
   659
# to be `${top_builddir}/libltdl'.  Make sure you start DIR with
slouken@0
   660
# '${top_builddir}/' (note the single quotes!) if your package is not
slouken@0
   661
# flat, and, if you're not using automake, define top_builddir as
slouken@0
   662
# appropriate in the Makefiles.
slouken@0
   663
AC_DEFUN(AC_LIBLTDL_CONVENIENCE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
slouken@0
   664
  case "$enable_ltdl_convenience" in
slouken@0
   665
  no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
slouken@0
   666
  "") enable_ltdl_convenience=yes
slouken@0
   667
      ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
slouken@0
   668
  esac
slouken@0
   669
  LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdlc.la
slouken@0
   670
  INCLTDL=ifelse($#,1,-I$1,['-I${top_builddir}/libltdl'])
slouken@0
   671
])
slouken@0
   672
slouken@0
   673
# AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for
slouken@0
   674
# the libltdl installable library, and adds --enable-ltdl-install to
slouken@0
   675
# the configure arguments.  Note that LIBLTDL is not AC_SUBSTed, nor
slouken@0
   676
# is AC_CONFIG_SUBDIRS called.  If DIR is not provided, it is assumed
slouken@0
   677
# to be `${top_builddir}/libltdl'.  Make sure you start DIR with
slouken@0
   678
# '${top_builddir}/' (note the single quotes!) if your package is not
slouken@0
   679
# flat, and, if you're not using automake, define top_builddir as
slouken@0
   680
# appropriate in the Makefiles.
slouken@0
   681
# In the future, this macro may have to be called after AC_PROG_LIBTOOL.
slouken@0
   682
AC_DEFUN(AC_LIBLTDL_INSTALLABLE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
slouken@0
   683
  AC_CHECK_LIB(ltdl, main,
slouken@0
   684
  [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
slouken@0
   685
  [if test x"$enable_ltdl_install" = xno; then
slouken@0
   686
     AC_MSG_WARN([libltdl not installed, but installation disabled])
slouken@0
   687
   else
slouken@0
   688
     enable_ltdl_install=yes
slouken@0
   689
   fi
slouken@0
   690
  ])
slouken@0
   691
  if test x"$enable_ltdl_install" = x"yes"; then
slouken@0
   692
    ac_configure_args="$ac_configure_args --enable-ltdl-install"
slouken@0
   693
    LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdl.la
slouken@0
   694
    INCLTDL=ifelse($#,1,-I$1,['-I${top_builddir}/libltdl'])
slouken@0
   695
  else
slouken@0
   696
    ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
slouken@0
   697
    LIBLTDL="-lltdl"
slouken@0
   698
    INCLTDL=
slouken@0
   699
  fi
slouken@0
   700
])
slouken@0
   701
slouken@0
   702
dnl old names
slouken@0
   703
AC_DEFUN(AM_PROG_LIBTOOL, [indir([AC_PROG_LIBTOOL])])dnl
slouken@0
   704
AC_DEFUN(AM_ENABLE_SHARED, [indir([AC_ENABLE_SHARED], $@)])dnl
slouken@0
   705
AC_DEFUN(AM_ENABLE_STATIC, [indir([AC_ENABLE_STATIC], $@)])dnl
slouken@0
   706
AC_DEFUN(AM_DISABLE_SHARED, [indir([AC_DISABLE_SHARED], $@)])dnl
slouken@0
   707
AC_DEFUN(AM_DISABLE_STATIC, [indir([AC_DISABLE_STATIC], $@)])dnl
slouken@0
   708
AC_DEFUN(AM_PROG_LD, [indir([AC_PROG_LD])])dnl
slouken@0
   709
AC_DEFUN(AM_PROG_NM, [indir([AC_PROG_NM])])dnl
slouken@0
   710
slouken@0
   711
dnl This is just to silence aclocal about the macro not being used
slouken@0
   712
ifelse([AC_DISABLE_FAST_INSTALL])dnl
slouken@0
   713
slouken@1
   714
# Define a conditional.
slouken@1
   715
slouken@1
   716
AC_DEFUN(AM_CONDITIONAL,
slouken@1
   717
[AC_SUBST($1_TRUE)
slouken@1
   718
AC_SUBST($1_FALSE)
slouken@1
   719
if $2; then
slouken@1
   720
  $1_TRUE=
slouken@1
   721
  $1_FALSE='#'
slouken@1
   722
else
slouken@1
   723
  $1_TRUE='#'
slouken@1
   724
  $1_FALSE=
slouken@1
   725
fi])
slouken@1
   726