acinclude.m4
author Patrice Mandin <patmandin@gmail.com>
Wed, 24 Sep 2003 21:45:27 +0000
changeset 723 1e8865a3e127
parent 1 cf2af46e9e2a
child 729 dac996d69abb
permissions -rw-r--r--
Files now copied to build directory instead of source directory while configuring
slouken@0
     1
# Local macros for the SDL configure.in script
slouken@0
     2
slouken@0
     3
dnl Function to link an architecture specific file
slouken@0
     4
dnl LINK_ARCH_SRC(source_dir, arch, source_file)
slouken@0
     5
AC_DEFUN(COPY_ARCH_SRC,
slouken@0
     6
[
slouken@0
     7
  old="$srcdir/$1/$2/$3"
patmandin@723
     8
  new="$1/$3"
patmandin@723
     9
  if test ! -d $1; then
patmandin@723
    10
    echo "Creating directory $1"
patmandin@723
    11
    mkdir -p $1
patmandin@723
    12
  fi
patmandin@723
    13
  echo "Copying $old -> $new"
slouken@0
    14
  cat >$new <<__EOF__
slouken@0
    15
/* WARNING:  This file was automatically generated!
slouken@0
    16
 * Original: $old
slouken@0
    17
 */
slouken@0
    18
__EOF__
slouken@0
    19
  cat >>$new <$old
slouken@0
    20
])
slouken@0
    21
slouken@0
    22
#
slouken@0
    23
# --- esd.m4 ---
slouken@0
    24
#
slouken@0
    25
# Configure paths for ESD
slouken@0
    26
# Manish Singh    98-9-30
slouken@0
    27
# stolen back from Frank Belew
slouken@0
    28
# stolen from Manish Singh
slouken@0
    29
# Shamelessly stolen from Owen Taylor
slouken@0
    30
slouken@0
    31
dnl AM_PATH_ESD([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
slouken@0
    32
dnl Test for ESD, and define ESD_CFLAGS and ESD_LIBS
slouken@0
    33
dnl
slouken@0
    34
AC_DEFUN(AM_PATH_ESD,
slouken@0
    35
[dnl 
slouken@0
    36
dnl Get the cflags and libraries from the esd-config script
slouken@0
    37
dnl
slouken@0
    38
AC_ARG_WITH(esd-prefix,[  --with-esd-prefix=PFX   Prefix where ESD is installed (optional)],
slouken@0
    39
            esd_prefix="$withval", esd_prefix="")
slouken@0
    40
AC_ARG_WITH(esd-exec-prefix,[  --with-esd-exec-prefix=PFX Exec prefix where ESD is installed (optional)],
slouken@0
    41
            esd_exec_prefix="$withval", esd_exec_prefix="")
slouken@0
    42
AC_ARG_ENABLE(esdtest, [  --disable-esdtest       Do not try to compile and run a test ESD program],
slouken@0
    43
		    , enable_esdtest=yes)
slouken@0
    44
slouken@0
    45
  if test x$esd_exec_prefix != x ; then
slouken@0
    46
     esd_args="$esd_args --exec-prefix=$esd_exec_prefix"
slouken@0
    47
     if test x${ESD_CONFIG+set} != xset ; then
slouken@0
    48
        ESD_CONFIG=$esd_exec_prefix/bin/esd-config
slouken@0
    49
     fi
slouken@0
    50
  fi
slouken@0
    51
  if test x$esd_prefix != x ; then
slouken@0
    52
     esd_args="$esd_args --prefix=$esd_prefix"
slouken@0
    53
     if test x${ESD_CONFIG+set} != xset ; then
slouken@0
    54
        ESD_CONFIG=$esd_prefix/bin/esd-config
slouken@0
    55
     fi
slouken@0
    56
  fi
slouken@0
    57
slouken@0
    58
  AC_PATH_PROG(ESD_CONFIG, esd-config, no)
slouken@0
    59
  min_esd_version=ifelse([$1], ,0.2.7,$1)
slouken@0
    60
  AC_MSG_CHECKING(for ESD - version >= $min_esd_version)
slouken@0
    61
  no_esd=""
slouken@0
    62
  if test "$ESD_CONFIG" = "no" ; then
slouken@0
    63
    no_esd=yes
slouken@0
    64
  else
slouken@0
    65
    ESD_CFLAGS=`$ESD_CONFIG $esdconf_args --cflags`
slouken@0
    66
    ESD_LIBS=`$ESD_CONFIG $esdconf_args --libs`
slouken@0
    67
slouken@0
    68
    esd_major_version=`$ESD_CONFIG $esd_args --version | \
slouken@0
    69
           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
slouken@0
    70
    esd_minor_version=`$ESD_CONFIG $esd_args --version | \
slouken@0
    71
           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
slouken@0
    72
    esd_micro_version=`$ESD_CONFIG $esd_config_args --version | \
slouken@0
    73
           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
slouken@0
    74
    if test "x$enable_esdtest" = "xyes" ; then
slouken@0
    75
      ac_save_CFLAGS="$CFLAGS"
slouken@0
    76
      ac_save_LIBS="$LIBS"
slouken@0
    77
      CFLAGS="$CFLAGS $ESD_CFLAGS"
slouken@0
    78
      LIBS="$LIBS $ESD_LIBS"
slouken@0
    79
dnl
slouken@0
    80
dnl Now check if the installed ESD is sufficiently new. (Also sanity
slouken@0
    81
dnl checks the results of esd-config to some extent
slouken@0
    82
dnl
slouken@0
    83
      rm -f conf.esdtest
slouken@0
    84
      AC_TRY_RUN([
slouken@0
    85
#include <stdio.h>
slouken@0
    86
#include <stdlib.h>
slouken@0
    87
#include <string.h>
slouken@0
    88
#include <esd.h>
slouken@0
    89
slouken@0
    90
char*
slouken@0
    91
my_strdup (char *str)
slouken@0
    92
{
slouken@0
    93
  char *new_str;
slouken@0
    94
  
slouken@0
    95
  if (str)
slouken@0
    96
    {
slouken@0
    97
      new_str = malloc ((strlen (str) + 1) * sizeof(char));
slouken@0
    98
      strcpy (new_str, str);
slouken@0
    99
    }
slouken@0
   100
  else
slouken@0
   101
    new_str = NULL;
slouken@0
   102
  
slouken@0
   103
  return new_str;
slouken@0
   104
}
slouken@0
   105
slouken@0
   106
int main ()
slouken@0
   107
{
slouken@0
   108
  int major, minor, micro;
slouken@0
   109
  char *tmp_version;
slouken@0
   110
slouken@0
   111
  system ("touch conf.esdtest");
slouken@0
   112
slouken@0
   113
  /* HP/UX 9 (%@#!) writes to sscanf strings */
slouken@0
   114
  tmp_version = my_strdup("$min_esd_version");
slouken@0
   115
  if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
slouken@0
   116
     printf("%s, bad version string\n", "$min_esd_version");
slouken@0
   117
     exit(1);
slouken@0
   118
   }
slouken@0
   119
slouken@0
   120
   if (($esd_major_version > major) ||
slouken@0
   121
      (($esd_major_version == major) && ($esd_minor_version > minor)) ||
slouken@0
   122
      (($esd_major_version == major) && ($esd_minor_version == minor) && ($esd_micro_version >= micro)))
slouken@0
   123
    {
slouken@0
   124
      return 0;
slouken@0
   125
    }
slouken@0
   126
  else
slouken@0
   127
    {
slouken@0
   128
      printf("\n*** 'esd-config --version' returned %d.%d.%d, but the minimum version\n", $esd_major_version, $esd_minor_version, $esd_micro_version);
slouken@0
   129
      printf("*** of ESD required is %d.%d.%d. If esd-config is correct, then it is\n", major, minor, micro);
slouken@0
   130
      printf("*** best to upgrade to the required version.\n");
slouken@0
   131
      printf("*** If esd-config was wrong, set the environment variable ESD_CONFIG\n");
slouken@0
   132
      printf("*** to point to the correct copy of esd-config, and remove the file\n");
slouken@0
   133
      printf("*** config.cache before re-running configure\n");
slouken@0
   134
      return 1;
slouken@0
   135
    }
slouken@0
   136
}
slouken@0
   137
slouken@0
   138
],, no_esd=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
slouken@0
   139
       CFLAGS="$ac_save_CFLAGS"
slouken@0
   140
       LIBS="$ac_save_LIBS"
slouken@0
   141
     fi
slouken@0
   142
  fi
slouken@0
   143
  if test "x$no_esd" = x ; then
slouken@0
   144
     AC_MSG_RESULT(yes)
slouken@0
   145
     ifelse([$2], , :, [$2])     
slouken@0
   146
  else
slouken@0
   147
     AC_MSG_RESULT(no)
slouken@0
   148
     if test "$ESD_CONFIG" = "no" ; then
slouken@0
   149
       echo "*** The esd-config script installed by ESD could not be found"
slouken@0
   150
       echo "*** If ESD was installed in PREFIX, make sure PREFIX/bin is in"
slouken@0
   151
       echo "*** your path, or set the ESD_CONFIG environment variable to the"
slouken@0
   152
       echo "*** full path to esd-config."
slouken@0
   153
     else
slouken@0
   154
       if test -f conf.esdtest ; then
slouken@0
   155
        :
slouken@0
   156
       else
slouken@0
   157
          echo "*** Could not run ESD test program, checking why..."
slouken@0
   158
          CFLAGS="$CFLAGS $ESD_CFLAGS"
slouken@0
   159
          LIBS="$LIBS $ESD_LIBS"
slouken@0
   160
          AC_TRY_LINK([
slouken@0
   161
#include <stdio.h>
slouken@0
   162
#include <esd.h>
slouken@0
   163
],      [ return 0; ],
slouken@0
   164
        [ echo "*** The test program compiled, but did not run. This usually means"
slouken@0
   165
          echo "*** that the run-time linker is not finding ESD or finding the wrong"
slouken@0
   166
          echo "*** version of ESD. If it is not finding ESD, you'll need to set your"
slouken@0
   167
          echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
slouken@0
   168
          echo "*** to the installed location  Also, make sure you have run ldconfig if that"
slouken@0
   169
          echo "*** is required on your system"
slouken@0
   170
	  echo "***"
slouken@0
   171
          echo "*** If you have an old version installed, it is best to remove it, although"
slouken@0
   172
          echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"],
slouken@0
   173
        [ echo "*** The test program failed to compile or link. See the file config.log for the"
slouken@0
   174
          echo "*** exact error that occured. This usually means ESD was incorrectly installed"
slouken@0
   175
          echo "*** or that you have moved ESD since it was installed. In the latter case, you"
slouken@0
   176
          echo "*** may want to edit the esd-config script: $ESD_CONFIG" ])
slouken@0
   177
          CFLAGS="$ac_save_CFLAGS"
slouken@0
   178
          LIBS="$ac_save_LIBS"
slouken@0
   179
       fi
slouken@0
   180
     fi
slouken@0
   181
     ESD_CFLAGS=""
slouken@0
   182
     ESD_LIBS=""
slouken@0
   183
     ifelse([$3], , :, [$3])
slouken@0
   184
  fi
slouken@0
   185
  AC_SUBST(ESD_CFLAGS)
slouken@0
   186
  AC_SUBST(ESD_LIBS)
slouken@0
   187
  rm -f conf.esdtest
slouken@0
   188
])
slouken@0
   189
slouken@0
   190
## libtool.m4 - Configure libtool for the target system. -*-Shell-script-*-
slouken@0
   191
## Copyright (C) 1996-1999, 2000 Free Software Foundation, Inc.
slouken@0
   192
## Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
slouken@0
   193
##
slouken@0
   194
## This program is free software; you can redistribute it and/or modify
slouken@0
   195
## it under the terms of the GNU General Public License as published by
slouken@0
   196
## the Free Software Foundation; either version 2 of the License, or
slouken@0
   197
## (at your option) any later version.
slouken@0
   198
##
slouken@0
   199
## This program is distributed in the hope that it will be useful, but
slouken@0
   200
## WITHOUT ANY WARRANTY; without even the implied warranty of
slouken@0
   201
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
slouken@0
   202
## General Public License for more details.
slouken@0
   203
##
slouken@0
   204
## You should have received a copy of the GNU General Public License
slouken@0
   205
## along with this program; if not, write to the Free Software
slouken@0
   206
## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
slouken@0
   207
##
slouken@0
   208
## As a special exception to the GNU General Public License, if you
slouken@0
   209
## distribute this file as part of a program that contains a
slouken@0
   210
## configuration script generated by Autoconf, you may include it under
slouken@0
   211
## the same distribution terms that you use for the rest of that program.
slouken@0
   212
slouken@0
   213
# serial 40 AC_PROG_LIBTOOL
slouken@0
   214
AC_DEFUN(AC_PROG_LIBTOOL,
slouken@0
   215
[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
slouken@0
   216
slouken@0
   217
# Save cache, so that ltconfig can load it
slouken@0
   218
AC_CACHE_SAVE
slouken@0
   219
slouken@0
   220
# Actually configure libtool.  ac_aux_dir is where install-sh is found.
slouken@0
   221
CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
slouken@0
   222
LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
slouken@0
   223
LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" \
slouken@0
   224
DLLTOOL="$DLLTOOL" AS="$AS" OBJDUMP="$OBJDUMP" \
slouken@0
   225
${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
slouken@0
   226
$libtool_flags --no-verify $ac_aux_dir/ltmain.sh $lt_target \
slouken@0
   227
|| AC_MSG_ERROR([libtool configure failed])
slouken@0
   228
slouken@0
   229
# Reload cache, that may have been modified by ltconfig
slouken@0
   230
AC_CACHE_LOAD
slouken@0
   231
slouken@0
   232
# This can be used to rebuild libtool when needed
slouken@0
   233
LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh"
slouken@0
   234
slouken@0
   235
# Always use our own libtool.
slouken@0
   236
LIBTOOL='$(SHELL) $(top_builddir)/libtool'
slouken@0
   237
AC_SUBST(LIBTOOL)dnl
slouken@0
   238
slouken@0
   239
# Redirect the config.log output again, so that the ltconfig log is not
slouken@0
   240
# clobbered by the next message.
slouken@0
   241
exec 5>>./config.log
slouken@0
   242
])
slouken@0
   243
slouken@0
   244
AC_DEFUN(AC_LIBTOOL_SETUP,
slouken@0
   245
[AC_PREREQ(2.13)dnl
slouken@0
   246
AC_REQUIRE([AC_ENABLE_SHARED])dnl
slouken@0
   247
AC_REQUIRE([AC_ENABLE_STATIC])dnl
slouken@0
   248
AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
slouken@0
   249
AC_REQUIRE([AC_CANONICAL_HOST])dnl
slouken@0
   250
AC_REQUIRE([AC_CANONICAL_BUILD])dnl
slouken@0
   251
AC_REQUIRE([AC_PROG_RANLIB])dnl
slouken@0
   252
AC_REQUIRE([AC_PROG_CC])dnl
slouken@0
   253
AC_REQUIRE([AC_PROG_LD])dnl
slouken@0
   254
AC_REQUIRE([AC_PROG_NM])dnl
slouken@0
   255
AC_REQUIRE([AC_PROG_LN_S])dnl
slouken@0
   256
dnl
slouken@0
   257
slouken@0
   258
case "$target" in
slouken@0
   259
NONE) lt_target="$host" ;;
slouken@0
   260
*) lt_target="$target" ;;
slouken@0
   261
esac
slouken@0
   262
slouken@0
   263
# Check for any special flags to pass to ltconfig.
slouken@0
   264
libtool_flags="--cache-file=$cache_file"
slouken@0
   265
test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
slouken@0
   266
test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
slouken@0
   267
test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install"
slouken@0
   268
test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
slouken@0
   269
test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
slouken@0
   270
ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN],
slouken@0
   271
[libtool_flags="$libtool_flags --enable-dlopen"])
slouken@0
   272
ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
slouken@0
   273
[libtool_flags="$libtool_flags --enable-win32-dll"])
slouken@0
   274
AC_ARG_ENABLE(libtool-lock,
slouken@0
   275
  [  --disable-libtool-lock  avoid locking (might break parallel builds)])
slouken@0
   276
test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock"
slouken@0
   277
test x"$silent" = xyes && libtool_flags="$libtool_flags --silent"
slouken@0
   278
slouken@0
   279
# Some flags need to be propagated to the compiler or linker for good
slouken@0
   280
# libtool support.
slouken@0
   281
case "$lt_target" in
slouken@0
   282
*-*-irix6*)
slouken@0
   283
  # Find out which ABI we are using.
slouken@0
   284
  echo '[#]line __oline__ "configure"' > conftest.$ac_ext
slouken@0
   285
  if AC_TRY_EVAL(ac_compile); then
slouken@0
   286
    case "`/usr/bin/file conftest.o`" in
slouken@0
   287
    *32-bit*)
slouken@0
   288
      LD="${LD-ld} -32"
slouken@0
   289
      ;;
slouken@0
   290
    *N32*)
slouken@0
   291
      LD="${LD-ld} -n32"
slouken@0
   292
      ;;
slouken@0
   293
    *64-bit*)
slouken@0
   294
      LD="${LD-ld} -64"
slouken@0
   295
      ;;
slouken@0
   296
    esac
slouken@0
   297
  fi
slouken@0
   298
  rm -rf conftest*
slouken@0
   299
  ;;
slouken@0
   300
slouken@0
   301
*-*-sco3.2v5*)
slouken@0
   302
  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
slouken@0
   303
  SAVE_CFLAGS="$CFLAGS"
slouken@0
   304
  CFLAGS="$CFLAGS -belf"
slouken@0
   305
  AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
slouken@0
   306
    [AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])])
slouken@0
   307
  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
slouken@0
   308
    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
slouken@0
   309
    CFLAGS="$SAVE_CFLAGS"
slouken@0
   310
  fi
slouken@0
   311
  ;;
slouken@0
   312
slouken@0
   313
ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
slouken@0
   314
[*-*-cygwin* | *-*-mingw*)
slouken@0
   315
  AC_CHECK_TOOL(DLLTOOL, dlltool, false)
slouken@0
   316
  AC_CHECK_TOOL(AS, as, false)
slouken@0
   317
  AC_CHECK_TOOL(OBJDUMP, objdump, false)
slouken@0
   318
  ;;
slouken@0
   319
])
slouken@0
   320
esac
slouken@0
   321
])
slouken@0
   322
slouken@0
   323
# AC_LIBTOOL_DLOPEN - enable checks for dlopen support
slouken@0
   324
AC_DEFUN(AC_LIBTOOL_DLOPEN, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])])
slouken@0
   325
slouken@0
   326
# AC_LIBTOOL_WIN32_DLL - declare package support for building win32 dll's
slouken@0
   327
AC_DEFUN(AC_LIBTOOL_WIN32_DLL, [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])])
slouken@0
   328
slouken@0
   329
# AC_ENABLE_SHARED - implement the --enable-shared flag
slouken@0
   330
# Usage: AC_ENABLE_SHARED[(DEFAULT)]
slouken@0
   331
#   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
slouken@0
   332
#   `yes'.
slouken@0
   333
AC_DEFUN(AC_ENABLE_SHARED, [dnl
slouken@0
   334
define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
slouken@0
   335
AC_ARG_ENABLE(shared,
slouken@0
   336
changequote(<<, >>)dnl
slouken@0
   337
<<  --enable-shared[=PKGS]  build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT],
slouken@0
   338
changequote([, ])dnl
slouken@0
   339
[p=${PACKAGE-default}
slouken@0
   340
case "$enableval" in
slouken@0
   341
yes) enable_shared=yes ;;
slouken@0
   342
no) enable_shared=no ;;
slouken@0
   343
*)
slouken@0
   344
  enable_shared=no
slouken@0
   345
  # Look at the argument we got.  We use all the common list separators.
slouken@0
   346
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
slouken@0
   347
  for pkg in $enableval; do
slouken@0
   348
    if test "X$pkg" = "X$p"; then
slouken@0
   349
      enable_shared=yes
slouken@0
   350
    fi
slouken@0
   351
  done
slouken@0
   352
  IFS="$ac_save_ifs"
slouken@0
   353
  ;;
slouken@0
   354
esac],
slouken@0
   355
enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl
slouken@0
   356
])
slouken@0
   357
slouken@0
   358
# AC_DISABLE_SHARED - set the default shared flag to --disable-shared
slouken@0
   359
AC_DEFUN(AC_DISABLE_SHARED, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
slouken@0
   360
AC_ENABLE_SHARED(no)])
slouken@0
   361
slouken@0
   362
# AC_ENABLE_STATIC - implement the --enable-static flag
slouken@0
   363
# Usage: AC_ENABLE_STATIC[(DEFAULT)]
slouken@0
   364
#   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
slouken@0
   365
#   `yes'.
slouken@0
   366
AC_DEFUN(AC_ENABLE_STATIC, [dnl
slouken@0
   367
define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
slouken@0
   368
AC_ARG_ENABLE(static,
slouken@0
   369
changequote(<<, >>)dnl
slouken@0
   370
<<  --enable-static[=PKGS]  build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT],
slouken@0
   371
changequote([, ])dnl
slouken@0
   372
[p=${PACKAGE-default}
slouken@0
   373
case "$enableval" in
slouken@0
   374
yes) enable_static=yes ;;
slouken@0
   375
no) enable_static=no ;;
slouken@0
   376
*)
slouken@0
   377
  enable_static=no
slouken@0
   378
  # Look at the argument we got.  We use all the common list separators.
slouken@0
   379
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
slouken@0
   380
  for pkg in $enableval; do
slouken@0
   381
    if test "X$pkg" = "X$p"; then
slouken@0
   382
      enable_static=yes
slouken@0
   383
    fi
slouken@0
   384
  done
slouken@0
   385
  IFS="$ac_save_ifs"
slouken@0
   386
  ;;
slouken@0
   387
esac],
slouken@0
   388
enable_static=AC_ENABLE_STATIC_DEFAULT)dnl
slouken@0
   389
])
slouken@0
   390
slouken@0
   391
# AC_DISABLE_STATIC - set the default static flag to --disable-static
slouken@0
   392
AC_DEFUN(AC_DISABLE_STATIC, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
slouken@0
   393
AC_ENABLE_STATIC(no)])
slouken@0
   394
slouken@0
   395
slouken@0
   396
# AC_ENABLE_FAST_INSTALL - implement the --enable-fast-install flag
slouken@0
   397
# Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)]
slouken@0
   398
#   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
slouken@0
   399
#   `yes'.
slouken@0
   400
AC_DEFUN(AC_ENABLE_FAST_INSTALL, [dnl
slouken@0
   401
define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
slouken@0
   402
AC_ARG_ENABLE(fast-install,
slouken@0
   403
changequote(<<, >>)dnl
slouken@0
   404
<<  --enable-fast-install[=PKGS]  optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT],
slouken@0
   405
changequote([, ])dnl
slouken@0
   406
[p=${PACKAGE-default}
slouken@0
   407
case "$enableval" in
slouken@0
   408
yes) enable_fast_install=yes ;;
slouken@0
   409
no) enable_fast_install=no ;;
slouken@0
   410
*)
slouken@0
   411
  enable_fast_install=no
slouken@0
   412
  # Look at the argument we got.  We use all the common list separators.
slouken@0
   413
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
slouken@0
   414
  for pkg in $enableval; do
slouken@0
   415
    if test "X$pkg" = "X$p"; then
slouken@0
   416
      enable_fast_install=yes
slouken@0
   417
    fi
slouken@0
   418
  done
slouken@0
   419
  IFS="$ac_save_ifs"
slouken@0
   420
  ;;
slouken@0
   421
esac],
slouken@0
   422
enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl
slouken@0
   423
])
slouken@0
   424
slouken@0
   425
# AC_ENABLE_FAST_INSTALL - set the default to --disable-fast-install
slouken@0
   426
AC_DEFUN(AC_DISABLE_FAST_INSTALL, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
slouken@0
   427
AC_ENABLE_FAST_INSTALL(no)])
slouken@0
   428
slouken@0
   429
# AC_PROG_LD - find the path to the GNU or non-GNU linker
slouken@0
   430
AC_DEFUN(AC_PROG_LD,
slouken@0
   431
[AC_ARG_WITH(gnu-ld,
slouken@0
   432
[  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]],
slouken@0
   433
test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
slouken@0
   434
AC_REQUIRE([AC_PROG_CC])dnl
slouken@0
   435
AC_REQUIRE([AC_CANONICAL_HOST])dnl
slouken@0
   436
AC_REQUIRE([AC_CANONICAL_BUILD])dnl
slouken@0
   437
ac_prog=ld
slouken@0
   438
if test "$ac_cv_prog_gcc" = yes; then
slouken@0
   439
  # Check if gcc -print-prog-name=ld gives a path.
slouken@0
   440
  AC_MSG_CHECKING([for ld used by GCC])
slouken@1
   441
  DELCR='tr -d \015'
slouken@1
   442
  ac_prog=`($CC -print-prog-name=ld | $DELCR) 2>&5`
slouken@0
   443
  case "$ac_prog" in
slouken@0
   444
    # Accept absolute paths.
slouken@0
   445
changequote(,)dnl
slouken@0
   446
    [\\/]* | [A-Za-z]:[\\/]*)
slouken@0
   447
      re_direlt='/[^/][^/]*/\.\./'
slouken@0
   448
changequote([,])dnl
slouken@0
   449
      # Canonicalize the path of ld
slouken@0
   450
      ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
slouken@0
   451
      while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
slouken@0
   452
	ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
slouken@0
   453
      done
slouken@0
   454
      test -z "$LD" && LD="$ac_prog"
slouken@0
   455
      ;;
slouken@0
   456
  "")
slouken@0
   457
    # If it fails, then pretend we aren't using GCC.
slouken@0
   458
    ac_prog=ld
slouken@0
   459
    ;;
slouken@0
   460
  *)
slouken@0
   461
    # If it is relative, then search for the first ld in PATH.
slouken@0
   462
    with_gnu_ld=unknown
slouken@0
   463
    ;;
slouken@0
   464
  esac
slouken@0
   465
elif test "$with_gnu_ld" = yes; then
slouken@0
   466
  AC_MSG_CHECKING([for GNU ld])
slouken@0
   467
else
slouken@0
   468
  AC_MSG_CHECKING([for non-GNU ld])
slouken@0
   469
fi
slouken@0
   470
AC_CACHE_VAL(ac_cv_path_LD,
slouken@0
   471
[if test -z "$LD"; then
slouken@0
   472
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
slouken@0
   473
  for ac_dir in $PATH; do
slouken@0
   474
    test -z "$ac_dir" && ac_dir=.
slouken@0
   475
    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
slouken@0
   476
      ac_cv_path_LD="$ac_dir/$ac_prog"
slouken@0
   477
      # Check to see if the program is GNU ld.  I'd rather use --version,
slouken@0
   478
      # but apparently some GNU ld's only accept -v.
slouken@0
   479
      # Break only if it was the GNU/non-GNU ld that we prefer.
slouken@0
   480
      if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
slouken@0
   481
	test "$with_gnu_ld" != no && break
slouken@0
   482
      else
slouken@0
   483
	test "$with_gnu_ld" != yes && break
slouken@0
   484
      fi
slouken@0
   485
    fi
slouken@0
   486
  done
slouken@0
   487
  IFS="$ac_save_ifs"
slouken@0
   488
else
slouken@0
   489
  ac_cv_path_LD="$LD" # Let the user override the test with a path.
slouken@0
   490
fi])
slouken@0
   491
LD="$ac_cv_path_LD"
slouken@0
   492
if test -n "$LD"; then
slouken@0
   493
  AC_MSG_RESULT($LD)
slouken@0
   494
else
slouken@0
   495
  AC_MSG_RESULT(no)
slouken@0
   496
fi
slouken@0
   497
test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
slouken@0
   498
AC_PROG_LD_GNU
slouken@0
   499
])
slouken@0
   500
slouken@0
   501
AC_DEFUN(AC_PROG_LD_GNU,
slouken@0
   502
[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld,
slouken@0
   503
[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
slouken@0
   504
if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
slouken@0
   505
  ac_cv_prog_gnu_ld=yes
slouken@0
   506
else
slouken@0
   507
  ac_cv_prog_gnu_ld=no
slouken@0
   508
fi])
slouken@0
   509
])
slouken@0
   510
slouken@0
   511
# AC_PROG_NM - find the path to a BSD-compatible name lister
slouken@0
   512
AC_DEFUN(AC_PROG_NM,
slouken@0
   513
[AC_MSG_CHECKING([for BSD-compatible nm])
slouken@0
   514
AC_CACHE_VAL(ac_cv_path_NM,
slouken@0
   515
[if test -n "$NM"; then
slouken@0
   516
  # Let the user override the test.
slouken@0
   517
  ac_cv_path_NM="$NM"
slouken@0
   518
else
slouken@0
   519
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
slouken@0
   520
  for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
slouken@0
   521
    test -z "$ac_dir" && ac_dir=.
slouken@0
   522
    if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext ; then
slouken@0
   523
      # Check to see if the nm accepts a BSD-compat flag.
slouken@0
   524
      # Adding the `sed 1q' prevents false positives on HP-UX, which says:
slouken@0
   525
      #   nm: unknown option "B" ignored
slouken@0
   526
      if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
slouken@0
   527
	ac_cv_path_NM="$ac_dir/nm -B"
slouken@0
   528
	break
slouken@0
   529
      elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
slouken@0
   530
	ac_cv_path_NM="$ac_dir/nm -p"
slouken@0
   531
	break
slouken@0
   532
      else
slouken@0
   533
	ac_cv_path_NM=${ac_cv_path_NM="$ac_dir/nm"} # keep the first match, but
slouken@0
   534
	continue # so that we can try to find one that supports BSD flags
slouken@0
   535
      fi
slouken@0
   536
    fi
slouken@0
   537
  done
slouken@0
   538
  IFS="$ac_save_ifs"
slouken@0
   539
  test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
slouken@0
   540
fi])
slouken@0
   541
NM="$ac_cv_path_NM"
slouken@0
   542
AC_MSG_RESULT([$NM])
slouken@0
   543
])
slouken@0
   544
slouken@0
   545
# AC_CHECK_LIBM - check for math library
slouken@0
   546
AC_DEFUN(AC_CHECK_LIBM,
slouken@0
   547
[AC_REQUIRE([AC_CANONICAL_HOST])dnl
slouken@0
   548
LIBM=
slouken@0
   549
case "$lt_target" in
slouken@0
   550
*-*-beos* | *-*-cygwin*)
slouken@0
   551
  # These system don't have libm
slouken@0
   552
  ;;
slouken@0
   553
*-ncr-sysv4.3*)
slouken@0
   554
  AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
slouken@0
   555
  AC_CHECK_LIB(m, main, LIBM="$LIBM -lm")
slouken@0
   556
  ;;
slouken@0
   557
*)
slouken@0
   558
  AC_CHECK_LIB(m, main, LIBM="-lm")
slouken@0
   559
  ;;
slouken@0
   560
esac
slouken@0
   561
])
slouken@0
   562
slouken@0
   563
# AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for
slouken@0
   564
# the libltdl convenience library and INCLTDL to the include flags for
slouken@0
   565
# the libltdl header and adds --enable-ltdl-convenience to the
slouken@0
   566
# configure arguments.  Note that LIBLTDL and INCLTDL are not
slouken@0
   567
# AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called.  If DIR is not
slouken@0
   568
# provided, it is assumed to be `libltdl'.  LIBLTDL will be prefixed
slouken@0
   569
# with '${top_builddir}/' and INCLTDL will be prefixed with
slouken@0
   570
# '${top_srcdir}/' (note the single quotes!).  If your package is not
slouken@0
   571
# flat and you're not using automake, define top_builddir and
slouken@0
   572
# top_srcdir appropriately in the Makefiles.
slouken@0
   573
AC_DEFUN(AC_LIBLTDL_CONVENIENCE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
slouken@0
   574
  case "$enable_ltdl_convenience" in
slouken@0
   575
  no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
slouken@0
   576
  "") enable_ltdl_convenience=yes
slouken@0
   577
      ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
slouken@0
   578
  esac
slouken@0
   579
  LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la
slouken@0
   580
  INCLTDL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
slouken@0
   581
])
slouken@0
   582
slouken@0
   583
# AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for
slouken@0
   584
# the libltdl installable library and INCLTDL to the include flags for
slouken@0
   585
# the libltdl header and adds --enable-ltdl-install to the configure
slouken@0
   586
# arguments.  Note that LIBLTDL and INCLTDL are not AC_SUBSTed, nor is
slouken@0
   587
# AC_CONFIG_SUBDIRS called.  If DIR is not provided and an installed
slouken@0
   588
# libltdl is not found, it is assumed to be `libltdl'.  LIBLTDL will
slouken@0
   589
# be prefixed with '${top_builddir}/' and INCLTDL will be prefixed
slouken@0
   590
# with '${top_srcdir}/' (note the single quotes!).  If your package is
slouken@0
   591
# not flat and you're not using automake, define top_builddir and
slouken@0
   592
# top_srcdir appropriately in the Makefiles.
slouken@0
   593
# In the future, this macro may have to be called after AC_PROG_LIBTOOL.
slouken@0
   594
AC_DEFUN(AC_LIBLTDL_INSTALLABLE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
slouken@0
   595
  AC_CHECK_LIB(ltdl, main,
slouken@0
   596
  [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
slouken@0
   597
  [if test x"$enable_ltdl_install" = xno; then
slouken@0
   598
     AC_MSG_WARN([libltdl not installed, but installation disabled])
slouken@0
   599
   else
slouken@0
   600
     enable_ltdl_install=yes
slouken@0
   601
   fi
slouken@0
   602
  ])
slouken@0
   603
  if test x"$enable_ltdl_install" = x"yes"; then
slouken@0
   604
    ac_configure_args="$ac_configure_args --enable-ltdl-install"
slouken@0
   605
    LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la
slouken@0
   606
    INCLTDL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
slouken@0
   607
  else
slouken@0
   608
    ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
slouken@0
   609
    LIBLTDL="-lltdl"
slouken@0
   610
    INCLTDL=
slouken@0
   611
  fi
slouken@0
   612
])
slouken@0
   613
slouken@0
   614
dnl old names
slouken@0
   615
AC_DEFUN(AM_PROG_LIBTOOL, [indir([AC_PROG_LIBTOOL])])dnl
slouken@0
   616
AC_DEFUN(AM_ENABLE_SHARED, [indir([AC_ENABLE_SHARED], $@)])dnl
slouken@0
   617
AC_DEFUN(AM_ENABLE_STATIC, [indir([AC_ENABLE_STATIC], $@)])dnl
slouken@0
   618
AC_DEFUN(AM_DISABLE_SHARED, [indir([AC_DISABLE_SHARED], $@)])dnl
slouken@0
   619
AC_DEFUN(AM_DISABLE_STATIC, [indir([AC_DISABLE_STATIC], $@)])dnl
slouken@0
   620
AC_DEFUN(AM_PROG_LD, [indir([AC_PROG_LD])])dnl
slouken@0
   621
AC_DEFUN(AM_PROG_NM, [indir([AC_PROG_NM])])dnl
slouken@0
   622
slouken@0
   623
dnl This is just to silence aclocal about the macro not being used
slouken@0
   624
ifelse([AC_DISABLE_FAST_INSTALL])dnl