acinclude.m4
author Sam Lantinga <slouken@libsdl.org>
Thu, 12 Jul 2007 05:32:07 +0000
changeset 2177 4f896c20caf6
parent 1613 2095da6364c9
child 3012 7e30c2dc7783
permissions -rw-r--r--
Added note about SDL_config.h - merged from revision 3227 on SDL 1.2 branch
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
948
ac488ad4ef1d Don't fail if we don't have ALSA available
Sam Lantinga <slouken@libsdl.org>
parents: 947
diff changeset
     1
##############################################################################
939
c7c04f811994 Date: Tue, 01 Jun 2004 15:27:44 +0300
Sam Lantinga <slouken@libsdl.org>
parents: 886
diff changeset
     2
dnl Configure Paths for Alsa
c7c04f811994 Date: Tue, 01 Jun 2004 15:27:44 +0300
Sam Lantinga <slouken@libsdl.org>
parents: 886
diff changeset
     3
dnl Some modifications by Richard Boulton <richard-alsa@tartarus.org>
c7c04f811994 Date: Tue, 01 Jun 2004 15:27:44 +0300
Sam Lantinga <slouken@libsdl.org>
parents: 886
diff changeset
     4
dnl Christopher Lansdown <lansdoct@cs.alfred.edu>
c7c04f811994 Date: Tue, 01 Jun 2004 15:27:44 +0300
Sam Lantinga <slouken@libsdl.org>
parents: 886
diff changeset
     5
dnl Jaroslav Kysela <perex@suse.cz>
948
ac488ad4ef1d Don't fail if we don't have ALSA available
Sam Lantinga <slouken@libsdl.org>
parents: 947
diff changeset
     6
dnl Last modification: alsa.m4,v 1.23 2004/01/16 18:14:22 tiwai Exp
939
c7c04f811994 Date: Tue, 01 Jun 2004 15:27:44 +0300
Sam Lantinga <slouken@libsdl.org>
parents: 886
diff changeset
     7
dnl AM_PATH_ALSA([MINIMUM-VERSION [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
c7c04f811994 Date: Tue, 01 Jun 2004 15:27:44 +0300
Sam Lantinga <slouken@libsdl.org>
parents: 886
diff changeset
     8
dnl Test for libasound, and define ALSA_CFLAGS and ALSA_LIBS as appropriate.
c7c04f811994 Date: Tue, 01 Jun 2004 15:27:44 +0300
Sam Lantinga <slouken@libsdl.org>
parents: 886
diff changeset
     9
dnl enables arguments --with-alsa-prefix=
c7c04f811994 Date: Tue, 01 Jun 2004 15:27:44 +0300
Sam Lantinga <slouken@libsdl.org>
parents: 886
diff changeset
    10
dnl                   --with-alsa-enc-prefix=
948
ac488ad4ef1d Don't fail if we don't have ALSA available
Sam Lantinga <slouken@libsdl.org>
parents: 947
diff changeset
    11
dnl                   --disable-alsatest
939
c7c04f811994 Date: Tue, 01 Jun 2004 15:27:44 +0300
Sam Lantinga <slouken@libsdl.org>
parents: 886
diff changeset
    12
dnl
c7c04f811994 Date: Tue, 01 Jun 2004 15:27:44 +0300
Sam Lantinga <slouken@libsdl.org>
parents: 886
diff changeset
    13
dnl For backwards compatibility, if ACTION_IF_NOT_FOUND is not specified,
c7c04f811994 Date: Tue, 01 Jun 2004 15:27:44 +0300
Sam Lantinga <slouken@libsdl.org>
parents: 886
diff changeset
    14
dnl and the alsa libraries are not found, a fatal AC_MSG_ERROR() will result.
c7c04f811994 Date: Tue, 01 Jun 2004 15:27:44 +0300
Sam Lantinga <slouken@libsdl.org>
parents: 886
diff changeset
    15
dnl
948
ac488ad4ef1d Don't fail if we don't have ALSA available
Sam Lantinga <slouken@libsdl.org>
parents: 947
diff changeset
    16
AC_DEFUN([AM_PATH_ALSA],
939
c7c04f811994 Date: Tue, 01 Jun 2004 15:27:44 +0300
Sam Lantinga <slouken@libsdl.org>
parents: 886
diff changeset
    17
[dnl Save the original CFLAGS, LDFLAGS, and LIBS
c7c04f811994 Date: Tue, 01 Jun 2004 15:27:44 +0300
Sam Lantinga <slouken@libsdl.org>
parents: 886
diff changeset
    18
alsa_save_CFLAGS="$CFLAGS"
c7c04f811994 Date: Tue, 01 Jun 2004 15:27:44 +0300
Sam Lantinga <slouken@libsdl.org>
parents: 886
diff changeset
    19
alsa_save_LDFLAGS="$LDFLAGS"
c7c04f811994 Date: Tue, 01 Jun 2004 15:27:44 +0300
Sam Lantinga <slouken@libsdl.org>
parents: 886
diff changeset
    20
alsa_save_LIBS="$LIBS"
c7c04f811994 Date: Tue, 01 Jun 2004 15:27:44 +0300
Sam Lantinga <slouken@libsdl.org>
parents: 886
diff changeset
    21
alsa_found=yes
c7c04f811994 Date: Tue, 01 Jun 2004 15:27:44 +0300
Sam Lantinga <slouken@libsdl.org>
parents: 886
diff changeset
    22
c7c04f811994 Date: Tue, 01 Jun 2004 15:27:44 +0300
Sam Lantinga <slouken@libsdl.org>
parents: 886
diff changeset
    23
dnl
c7c04f811994 Date: Tue, 01 Jun 2004 15:27:44 +0300
Sam Lantinga <slouken@libsdl.org>
parents: 886
diff changeset
    24
dnl Get the cflags and libraries for alsa
c7c04f811994 Date: Tue, 01 Jun 2004 15:27:44 +0300
Sam Lantinga <slouken@libsdl.org>
parents: 886
diff changeset
    25
dnl
c7c04f811994 Date: Tue, 01 Jun 2004 15:27:44 +0300
Sam Lantinga <slouken@libsdl.org>
parents: 886
diff changeset
    26
AC_ARG_WITH(alsa-prefix,
c7c04f811994 Date: Tue, 01 Jun 2004 15:27:44 +0300
Sam Lantinga <slouken@libsdl.org>
parents: 886
diff changeset
    27
[  --with-alsa-prefix=PFX  Prefix where Alsa library is installed(optional)],
c7c04f811994 Date: Tue, 01 Jun 2004 15:27:44 +0300
Sam Lantinga <slouken@libsdl.org>
parents: 886
diff changeset
    28
[alsa_prefix="$withval"], [alsa_prefix=""])
c7c04f811994 Date: Tue, 01 Jun 2004 15:27:44 +0300
Sam Lantinga <slouken@libsdl.org>
parents: 886
diff changeset
    29
c7c04f811994 Date: Tue, 01 Jun 2004 15:27:44 +0300
Sam Lantinga <slouken@libsdl.org>
parents: 886
diff changeset
    30
AC_ARG_WITH(alsa-inc-prefix,
c7c04f811994 Date: Tue, 01 Jun 2004 15:27:44 +0300
Sam Lantinga <slouken@libsdl.org>
parents: 886
diff changeset
    31
[  --with-alsa-inc-prefix=PFX  Prefix where include libraries are (optional)],
c7c04f811994 Date: Tue, 01 Jun 2004 15:27:44 +0300
Sam Lantinga <slouken@libsdl.org>
parents: 886
diff changeset
    32
[alsa_inc_prefix="$withval"], [alsa_inc_prefix=""])
c7c04f811994 Date: Tue, 01 Jun 2004 15:27:44 +0300
Sam Lantinga <slouken@libsdl.org>
parents: 886
diff changeset
    33
c7c04f811994 Date: Tue, 01 Jun 2004 15:27:44 +0300
Sam Lantinga <slouken@libsdl.org>
parents: 886
diff changeset
    34
dnl FIXME: this is not yet implemented
c7c04f811994 Date: Tue, 01 Jun 2004 15:27:44 +0300
Sam Lantinga <slouken@libsdl.org>
parents: 886
diff changeset
    35
AC_ARG_ENABLE(alsatest,
c7c04f811994 Date: Tue, 01 Jun 2004 15:27:44 +0300
Sam Lantinga <slouken@libsdl.org>
parents: 886
diff changeset
    36
[  --disable-alsatest      Do not try to compile and run a test Alsa program],
948
ac488ad4ef1d Don't fail if we don't have ALSA available
Sam Lantinga <slouken@libsdl.org>
parents: 947
diff changeset
    37
[enable_alsatest="$enableval"],
939
c7c04f811994 Date: Tue, 01 Jun 2004 15:27:44 +0300
Sam Lantinga <slouken@libsdl.org>
parents: 886
diff changeset
    38
[enable_alsatest=yes])
c7c04f811994 Date: Tue, 01 Jun 2004 15:27:44 +0300
Sam Lantinga <slouken@libsdl.org>
parents: 886
diff changeset
    39
c7c04f811994 Date: Tue, 01 Jun 2004 15:27:44 +0300
Sam Lantinga <slouken@libsdl.org>
parents: 886
diff changeset
    40
dnl Add any special include directories
c7c04f811994 Date: Tue, 01 Jun 2004 15:27:44 +0300
Sam Lantinga <slouken@libsdl.org>
parents: 886
diff changeset
    41
AC_MSG_CHECKING(for ALSA CFLAGS)
c7c04f811994 Date: Tue, 01 Jun 2004 15:27:44 +0300
Sam Lantinga <slouken@libsdl.org>
parents: 886
diff changeset
    42
if test "$alsa_inc_prefix" != "" ; then
c7c04f811994 Date: Tue, 01 Jun 2004 15:27:44 +0300
Sam Lantinga <slouken@libsdl.org>
parents: 886
diff changeset
    43
	ALSA_CFLAGS="$ALSA_CFLAGS -I$alsa_inc_prefix"
c7c04f811994 Date: Tue, 01 Jun 2004 15:27:44 +0300
Sam Lantinga <slouken@libsdl.org>
parents: 886
diff changeset
    44
	CFLAGS="$CFLAGS -I$alsa_inc_prefix"
c7c04f811994 Date: Tue, 01 Jun 2004 15:27:44 +0300
Sam Lantinga <slouken@libsdl.org>
parents: 886
diff changeset
    45
fi
c7c04f811994 Date: Tue, 01 Jun 2004 15:27:44 +0300
Sam Lantinga <slouken@libsdl.org>
parents: 886
diff changeset
    46
AC_MSG_RESULT($ALSA_CFLAGS)
c7c04f811994 Date: Tue, 01 Jun 2004 15:27:44 +0300
Sam Lantinga <slouken@libsdl.org>
parents: 886
diff changeset
    47
c7c04f811994 Date: Tue, 01 Jun 2004 15:27:44 +0300
Sam Lantinga <slouken@libsdl.org>
parents: 886
diff changeset
    48
dnl add any special lib dirs
c7c04f811994 Date: Tue, 01 Jun 2004 15:27:44 +0300
Sam Lantinga <slouken@libsdl.org>
parents: 886
diff changeset
    49
AC_MSG_CHECKING(for ALSA LDFLAGS)
c7c04f811994 Date: Tue, 01 Jun 2004 15:27:44 +0300
Sam Lantinga <slouken@libsdl.org>
parents: 886
diff changeset
    50
if test "$alsa_prefix" != "" ; then
c7c04f811994 Date: Tue, 01 Jun 2004 15:27:44 +0300
Sam Lantinga <slouken@libsdl.org>
parents: 886
diff changeset
    51
	ALSA_LIBS="$ALSA_LIBS -L$alsa_prefix"
c7c04f811994 Date: Tue, 01 Jun 2004 15:27:44 +0300
Sam Lantinga <slouken@libsdl.org>
parents: 886
diff changeset
    52
	LDFLAGS="$LDFLAGS $ALSA_LIBS"
c7c04f811994 Date: Tue, 01 Jun 2004 15:27:44 +0300
Sam Lantinga <slouken@libsdl.org>
parents: 886
diff changeset
    53
fi
c7c04f811994 Date: Tue, 01 Jun 2004 15:27:44 +0300
Sam Lantinga <slouken@libsdl.org>
parents: 886
diff changeset
    54
c7c04f811994 Date: Tue, 01 Jun 2004 15:27:44 +0300
Sam Lantinga <slouken@libsdl.org>
parents: 886
diff changeset
    55
dnl add the alsa library
c7c04f811994 Date: Tue, 01 Jun 2004 15:27:44 +0300
Sam Lantinga <slouken@libsdl.org>
parents: 886
diff changeset
    56
ALSA_LIBS="$ALSA_LIBS -lasound -lm -ldl -lpthread"
c7c04f811994 Date: Tue, 01 Jun 2004 15:27:44 +0300
Sam Lantinga <slouken@libsdl.org>
parents: 886
diff changeset
    57
LIBS=`echo $LIBS | sed 's/-lm//'`
c7c04f811994 Date: Tue, 01 Jun 2004 15:27:44 +0300
Sam Lantinga <slouken@libsdl.org>
parents: 886
diff changeset
    58
LIBS=`echo $LIBS | sed 's/-ldl//'`
c7c04f811994 Date: Tue, 01 Jun 2004 15:27:44 +0300
Sam Lantinga <slouken@libsdl.org>
parents: 886
diff changeset
    59
LIBS=`echo $LIBS | sed 's/-lpthread//'`
c7c04f811994 Date: Tue, 01 Jun 2004 15:27:44 +0300
Sam Lantinga <slouken@libsdl.org>
parents: 886
diff changeset
    60
LIBS=`echo $LIBS | sed 's/  //'`
c7c04f811994 Date: Tue, 01 Jun 2004 15:27:44 +0300
Sam Lantinga <slouken@libsdl.org>
parents: 886
diff changeset
    61
LIBS="$ALSA_LIBS $LIBS"
c7c04f811994 Date: Tue, 01 Jun 2004 15:27:44 +0300
Sam Lantinga <slouken@libsdl.org>
parents: 886
diff changeset
    62
AC_MSG_RESULT($ALSA_LIBS)
c7c04f811994 Date: Tue, 01 Jun 2004 15:27:44 +0300
Sam Lantinga <slouken@libsdl.org>
parents: 886
diff changeset
    63
c7c04f811994 Date: Tue, 01 Jun 2004 15:27:44 +0300
Sam Lantinga <slouken@libsdl.org>
parents: 886
diff changeset
    64
dnl Check for a working version of libasound that is of the right version.
c7c04f811994 Date: Tue, 01 Jun 2004 15:27:44 +0300
Sam Lantinga <slouken@libsdl.org>
parents: 886
diff changeset
    65
min_alsa_version=ifelse([$1], ,0.1.1,$1)
c7c04f811994 Date: Tue, 01 Jun 2004 15:27:44 +0300
Sam Lantinga <slouken@libsdl.org>
parents: 886
diff changeset
    66
AC_MSG_CHECKING(for libasound headers version >= $min_alsa_version)
c7c04f811994 Date: Tue, 01 Jun 2004 15:27:44 +0300
Sam Lantinga <slouken@libsdl.org>
parents: 886
diff changeset
    67
no_alsa=""
c7c04f811994 Date: Tue, 01 Jun 2004 15:27:44 +0300
Sam Lantinga <slouken@libsdl.org>
parents: 886
diff changeset
    68
    alsa_min_major_version=`echo $min_alsa_version | \
c7c04f811994 Date: Tue, 01 Jun 2004 15:27:44 +0300
Sam Lantinga <slouken@libsdl.org>
parents: 886
diff changeset
    69
           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
c7c04f811994 Date: Tue, 01 Jun 2004 15:27:44 +0300
Sam Lantinga <slouken@libsdl.org>
parents: 886
diff changeset
    70
    alsa_min_minor_version=`echo $min_alsa_version | \
c7c04f811994 Date: Tue, 01 Jun 2004 15:27:44 +0300
Sam Lantinga <slouken@libsdl.org>
parents: 886
diff changeset
    71
           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
c7c04f811994 Date: Tue, 01 Jun 2004 15:27:44 +0300
Sam Lantinga <slouken@libsdl.org>
parents: 886
diff changeset
    72
    alsa_min_micro_version=`echo $min_alsa_version | \
c7c04f811994 Date: Tue, 01 Jun 2004 15:27:44 +0300
Sam Lantinga <slouken@libsdl.org>
parents: 886
diff changeset
    73
           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
c7c04f811994 Date: Tue, 01 Jun 2004 15:27:44 +0300
Sam Lantinga <slouken@libsdl.org>
parents: 886
diff changeset
    74
c7c04f811994 Date: Tue, 01 Jun 2004 15:27:44 +0300
Sam Lantinga <slouken@libsdl.org>
parents: 886
diff changeset
    75
AC_LANG_SAVE
c7c04f811994 Date: Tue, 01 Jun 2004 15:27:44 +0300
Sam Lantinga <slouken@libsdl.org>
parents: 886
diff changeset
    76
AC_LANG_C
c7c04f811994 Date: Tue, 01 Jun 2004 15:27:44 +0300
Sam Lantinga <slouken@libsdl.org>
parents: 886
diff changeset
    77
AC_TRY_COMPILE([
c7c04f811994 Date: Tue, 01 Jun 2004 15:27:44 +0300
Sam Lantinga <slouken@libsdl.org>
parents: 886
diff changeset
    78
#include <alsa/asoundlib.h>
c7c04f811994 Date: Tue, 01 Jun 2004 15:27:44 +0300
Sam Lantinga <slouken@libsdl.org>
parents: 886
diff changeset
    79
], [
c7c04f811994 Date: Tue, 01 Jun 2004 15:27:44 +0300
Sam Lantinga <slouken@libsdl.org>
parents: 886
diff changeset
    80
/* ensure backward compatibility */
c7c04f811994 Date: Tue, 01 Jun 2004 15:27:44 +0300
Sam Lantinga <slouken@libsdl.org>
parents: 886
diff changeset
    81
#if !defined(SND_LIB_MAJOR) && defined(SOUNDLIB_VERSION_MAJOR)
c7c04f811994 Date: Tue, 01 Jun 2004 15:27:44 +0300
Sam Lantinga <slouken@libsdl.org>
parents: 886
diff changeset
    82
#define SND_LIB_MAJOR SOUNDLIB_VERSION_MAJOR
c7c04f811994 Date: Tue, 01 Jun 2004 15:27:44 +0300
Sam Lantinga <slouken@libsdl.org>
parents: 886
diff changeset
    83
#endif
c7c04f811994 Date: Tue, 01 Jun 2004 15:27:44 +0300
Sam Lantinga <slouken@libsdl.org>
parents: 886
diff changeset
    84
#if !defined(SND_LIB_MINOR) && defined(SOUNDLIB_VERSION_MINOR)
c7c04f811994 Date: Tue, 01 Jun 2004 15:27:44 +0300
Sam Lantinga <slouken@libsdl.org>
parents: 886
diff changeset
    85
#define SND_LIB_MINOR SOUNDLIB_VERSION_MINOR
c7c04f811994 Date: Tue, 01 Jun 2004 15:27:44 +0300
Sam Lantinga <slouken@libsdl.org>
parents: 886
diff changeset
    86
#endif
c7c04f811994 Date: Tue, 01 Jun 2004 15:27:44 +0300
Sam Lantinga <slouken@libsdl.org>
parents: 886
diff changeset
    87
#if !defined(SND_LIB_SUBMINOR) && defined(SOUNDLIB_VERSION_SUBMINOR)
c7c04f811994 Date: Tue, 01 Jun 2004 15:27:44 +0300
Sam Lantinga <slouken@libsdl.org>
parents: 886
diff changeset
    88
#define SND_LIB_SUBMINOR SOUNDLIB_VERSION_SUBMINOR
c7c04f811994 Date: Tue, 01 Jun 2004 15:27:44 +0300
Sam Lantinga <slouken@libsdl.org>
parents: 886
diff changeset
    89
#endif
c7c04f811994 Date: Tue, 01 Jun 2004 15:27:44 +0300
Sam Lantinga <slouken@libsdl.org>
parents: 886
diff changeset
    90
c7c04f811994 Date: Tue, 01 Jun 2004 15:27:44 +0300
Sam Lantinga <slouken@libsdl.org>
parents: 886
diff changeset
    91
#  if(SND_LIB_MAJOR > $alsa_min_major_version)
c7c04f811994 Date: Tue, 01 Jun 2004 15:27:44 +0300
Sam Lantinga <slouken@libsdl.org>
parents: 886
diff changeset
    92
  exit(0);
c7c04f811994 Date: Tue, 01 Jun 2004 15:27:44 +0300
Sam Lantinga <slouken@libsdl.org>
parents: 886
diff changeset
    93
#  else
c7c04f811994 Date: Tue, 01 Jun 2004 15:27:44 +0300
Sam Lantinga <slouken@libsdl.org>
parents: 886
diff changeset
    94
#    if(SND_LIB_MAJOR < $alsa_min_major_version)
c7c04f811994 Date: Tue, 01 Jun 2004 15:27:44 +0300
Sam Lantinga <slouken@libsdl.org>
parents: 886
diff changeset
    95
#       error not present
c7c04f811994 Date: Tue, 01 Jun 2004 15:27:44 +0300
Sam Lantinga <slouken@libsdl.org>
parents: 886
diff changeset
    96
#    endif
c7c04f811994 Date: Tue, 01 Jun 2004 15:27:44 +0300
Sam Lantinga <slouken@libsdl.org>
parents: 886
diff changeset
    97
c7c04f811994 Date: Tue, 01 Jun 2004 15:27:44 +0300
Sam Lantinga <slouken@libsdl.org>
parents: 886
diff changeset
    98
#   if(SND_LIB_MINOR > $alsa_min_minor_version)
c7c04f811994 Date: Tue, 01 Jun 2004 15:27:44 +0300
Sam Lantinga <slouken@libsdl.org>
parents: 886
diff changeset
    99
  exit(0);
c7c04f811994 Date: Tue, 01 Jun 2004 15:27:44 +0300
Sam Lantinga <slouken@libsdl.org>
parents: 886
diff changeset
   100
#   else
c7c04f811994 Date: Tue, 01 Jun 2004 15:27:44 +0300
Sam Lantinga <slouken@libsdl.org>
parents: 886
diff changeset
   101
#     if(SND_LIB_MINOR < $alsa_min_minor_version)
c7c04f811994 Date: Tue, 01 Jun 2004 15:27:44 +0300
Sam Lantinga <slouken@libsdl.org>
parents: 886
diff changeset
   102
#          error not present
c7c04f811994 Date: Tue, 01 Jun 2004 15:27:44 +0300
Sam Lantinga <slouken@libsdl.org>
parents: 886
diff changeset
   103
#      endif
c7c04f811994 Date: Tue, 01 Jun 2004 15:27:44 +0300
Sam Lantinga <slouken@libsdl.org>
parents: 886
diff changeset
   104
c7c04f811994 Date: Tue, 01 Jun 2004 15:27:44 +0300
Sam Lantinga <slouken@libsdl.org>
parents: 886
diff changeset
   105
#      if(SND_LIB_SUBMINOR < $alsa_min_micro_version)
c7c04f811994 Date: Tue, 01 Jun 2004 15:27:44 +0300
Sam Lantinga <slouken@libsdl.org>
parents: 886
diff changeset
   106
#        error not present
c7c04f811994 Date: Tue, 01 Jun 2004 15:27:44 +0300
Sam Lantinga <slouken@libsdl.org>
parents: 886
diff changeset
   107
#      endif
c7c04f811994 Date: Tue, 01 Jun 2004 15:27:44 +0300
Sam Lantinga <slouken@libsdl.org>
parents: 886
diff changeset
   108
#    endif
c7c04f811994 Date: Tue, 01 Jun 2004 15:27:44 +0300
Sam Lantinga <slouken@libsdl.org>
parents: 886
diff changeset
   109
#  endif
c7c04f811994 Date: Tue, 01 Jun 2004 15:27:44 +0300
Sam Lantinga <slouken@libsdl.org>
parents: 886
diff changeset
   110
exit(0);
c7c04f811994 Date: Tue, 01 Jun 2004 15:27:44 +0300
Sam Lantinga <slouken@libsdl.org>
parents: 886
diff changeset
   111
],
c7c04f811994 Date: Tue, 01 Jun 2004 15:27:44 +0300
Sam Lantinga <slouken@libsdl.org>
parents: 886
diff changeset
   112
  [AC_MSG_RESULT(found.)],
c7c04f811994 Date: Tue, 01 Jun 2004 15:27:44 +0300
Sam Lantinga <slouken@libsdl.org>
parents: 886
diff changeset
   113
  [AC_MSG_RESULT(not present.)
c7c04f811994 Date: Tue, 01 Jun 2004 15:27:44 +0300
Sam Lantinga <slouken@libsdl.org>
parents: 886
diff changeset
   114
   ifelse([$3], , [AC_MSG_ERROR(Sufficiently new version of libasound not found.)])
c7c04f811994 Date: Tue, 01 Jun 2004 15:27:44 +0300
Sam Lantinga <slouken@libsdl.org>
parents: 886
diff changeset
   115
   alsa_found=no]
c7c04f811994 Date: Tue, 01 Jun 2004 15:27:44 +0300
Sam Lantinga <slouken@libsdl.org>
parents: 886
diff changeset
   116
)
c7c04f811994 Date: Tue, 01 Jun 2004 15:27:44 +0300
Sam Lantinga <slouken@libsdl.org>
parents: 886
diff changeset
   117
AC_LANG_RESTORE
c7c04f811994 Date: Tue, 01 Jun 2004 15:27:44 +0300
Sam Lantinga <slouken@libsdl.org>
parents: 886
diff changeset
   118
c7c04f811994 Date: Tue, 01 Jun 2004 15:27:44 +0300
Sam Lantinga <slouken@libsdl.org>
parents: 886
diff changeset
   119
dnl Now that we know that we have the right version, let's see if we have the library and not just the headers.
948
ac488ad4ef1d Don't fail if we don't have ALSA available
Sam Lantinga <slouken@libsdl.org>
parents: 947
diff changeset
   120
if test "x$enable_alsatest" = "xyes"; then
939
c7c04f811994 Date: Tue, 01 Jun 2004 15:27:44 +0300
Sam Lantinga <slouken@libsdl.org>
parents: 886
diff changeset
   121
AC_CHECK_LIB([asound], [snd_ctl_open],,
c7c04f811994 Date: Tue, 01 Jun 2004 15:27:44 +0300
Sam Lantinga <slouken@libsdl.org>
parents: 886
diff changeset
   122
	[ifelse([$3], , [AC_MSG_ERROR(No linkable libasound was found.)])
c7c04f811994 Date: Tue, 01 Jun 2004 15:27:44 +0300
Sam Lantinga <slouken@libsdl.org>
parents: 886
diff changeset
   123
	 alsa_found=no]
c7c04f811994 Date: Tue, 01 Jun 2004 15:27:44 +0300
Sam Lantinga <slouken@libsdl.org>
parents: 886
diff changeset
   124
)
948
ac488ad4ef1d Don't fail if we don't have ALSA available
Sam Lantinga <slouken@libsdl.org>
parents: 947
diff changeset
   125
fi
ac488ad4ef1d Don't fail if we don't have ALSA available
Sam Lantinga <slouken@libsdl.org>
parents: 947
diff changeset
   126
939
c7c04f811994 Date: Tue, 01 Jun 2004 15:27:44 +0300
Sam Lantinga <slouken@libsdl.org>
parents: 886
diff changeset
   127
if test "x$alsa_found" = "xyes" ; then
c7c04f811994 Date: Tue, 01 Jun 2004 15:27:44 +0300
Sam Lantinga <slouken@libsdl.org>
parents: 886
diff changeset
   128
   ifelse([$2], , :, [$2])
948
ac488ad4ef1d Don't fail if we don't have ALSA available
Sam Lantinga <slouken@libsdl.org>
parents: 947
diff changeset
   129
   LIBS=`echo $LIBS | sed 's/-lasound//g'`
ac488ad4ef1d Don't fail if we don't have ALSA available
Sam Lantinga <slouken@libsdl.org>
parents: 947
diff changeset
   130
   LIBS=`echo $LIBS | sed 's/  //'`
ac488ad4ef1d Don't fail if we don't have ALSA available
Sam Lantinga <slouken@libsdl.org>
parents: 947
diff changeset
   131
   LIBS="-lasound $LIBS"
ac488ad4ef1d Don't fail if we don't have ALSA available
Sam Lantinga <slouken@libsdl.org>
parents: 947
diff changeset
   132
fi
ac488ad4ef1d Don't fail if we don't have ALSA available
Sam Lantinga <slouken@libsdl.org>
parents: 947
diff changeset
   133
if test "x$alsa_found" = "xno" ; then
939
c7c04f811994 Date: Tue, 01 Jun 2004 15:27:44 +0300
Sam Lantinga <slouken@libsdl.org>
parents: 886
diff changeset
   134
   ifelse([$3], , :, [$3])
c7c04f811994 Date: Tue, 01 Jun 2004 15:27:44 +0300
Sam Lantinga <slouken@libsdl.org>
parents: 886
diff changeset
   135
   CFLAGS="$alsa_save_CFLAGS"
c7c04f811994 Date: Tue, 01 Jun 2004 15:27:44 +0300
Sam Lantinga <slouken@libsdl.org>
parents: 886
diff changeset
   136
   LDFLAGS="$alsa_save_LDFLAGS"
c7c04f811994 Date: Tue, 01 Jun 2004 15:27:44 +0300
Sam Lantinga <slouken@libsdl.org>
parents: 886
diff changeset
   137
   LIBS="$alsa_save_LIBS"
c7c04f811994 Date: Tue, 01 Jun 2004 15:27:44 +0300
Sam Lantinga <slouken@libsdl.org>
parents: 886
diff changeset
   138
   ALSA_CFLAGS=""
c7c04f811994 Date: Tue, 01 Jun 2004 15:27:44 +0300
Sam Lantinga <slouken@libsdl.org>
parents: 886
diff changeset
   139
   ALSA_LIBS=""
c7c04f811994 Date: Tue, 01 Jun 2004 15:27:44 +0300
Sam Lantinga <slouken@libsdl.org>
parents: 886
diff changeset
   140
fi
c7c04f811994 Date: Tue, 01 Jun 2004 15:27:44 +0300
Sam Lantinga <slouken@libsdl.org>
parents: 886
diff changeset
   141
c7c04f811994 Date: Tue, 01 Jun 2004 15:27:44 +0300
Sam Lantinga <slouken@libsdl.org>
parents: 886
diff changeset
   142
dnl That should be it.  Now just export out symbols:
c7c04f811994 Date: Tue, 01 Jun 2004 15:27:44 +0300
Sam Lantinga <slouken@libsdl.org>
parents: 886
diff changeset
   143
AC_SUBST(ALSA_CFLAGS)
c7c04f811994 Date: Tue, 01 Jun 2004 15:27:44 +0300
Sam Lantinga <slouken@libsdl.org>
parents: 886
diff changeset
   144
AC_SUBST(ALSA_LIBS)
c7c04f811994 Date: Tue, 01 Jun 2004 15:27:44 +0300
Sam Lantinga <slouken@libsdl.org>
parents: 886
diff changeset
   145
])
c7c04f811994 Date: Tue, 01 Jun 2004 15:27:44 +0300
Sam Lantinga <slouken@libsdl.org>
parents: 886
diff changeset
   146
948
ac488ad4ef1d Don't fail if we don't have ALSA available
Sam Lantinga <slouken@libsdl.org>
parents: 947
diff changeset
   147
##############################################################################
939
c7c04f811994 Date: Tue, 01 Jun 2004 15:27:44 +0300
Sam Lantinga <slouken@libsdl.org>
parents: 886
diff changeset
   148
#
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   149
# --- esd.m4 ---
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   150
#
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   151
# Configure paths for ESD
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   152
# Manish Singh    98-9-30
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   153
# stolen back from Frank Belew
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   154
# stolen from Manish Singh
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   155
# Shamelessly stolen from Owen Taylor
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   156
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   157
dnl AM_PATH_ESD([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   158
dnl Test for ESD, and define ESD_CFLAGS and ESD_LIBS
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   159
dnl
794
a5defa3b93e1 Updated for the latest version of automake
Sam Lantinga <slouken@libsdl.org>
parents: 730
diff changeset
   160
AC_DEFUN([AM_PATH_ESD],
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   161
[dnl 
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   162
dnl Get the cflags and libraries from the esd-config script
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   163
dnl
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   164
AC_ARG_WITH(esd-prefix,[  --with-esd-prefix=PFX   Prefix where ESD is installed (optional)],
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   165
            esd_prefix="$withval", esd_prefix="")
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   166
AC_ARG_WITH(esd-exec-prefix,[  --with-esd-exec-prefix=PFX Exec prefix where ESD is installed (optional)],
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   167
            esd_exec_prefix="$withval", esd_exec_prefix="")
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   168
AC_ARG_ENABLE(esdtest, [  --disable-esdtest       Do not try to compile and run a test ESD program],
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   169
		    , enable_esdtest=yes)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   170
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   171
  if test x$esd_exec_prefix != x ; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   172
     esd_args="$esd_args --exec-prefix=$esd_exec_prefix"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   173
     if test x${ESD_CONFIG+set} != xset ; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   174
        ESD_CONFIG=$esd_exec_prefix/bin/esd-config
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   175
     fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   176
  fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   177
  if test x$esd_prefix != x ; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   178
     esd_args="$esd_args --prefix=$esd_prefix"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   179
     if test x${ESD_CONFIG+set} != xset ; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   180
        ESD_CONFIG=$esd_prefix/bin/esd-config
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   181
     fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   182
  fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   183
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   184
  AC_PATH_PROG(ESD_CONFIG, esd-config, no)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   185
  min_esd_version=ifelse([$1], ,0.2.7,$1)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   186
  AC_MSG_CHECKING(for ESD - version >= $min_esd_version)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   187
  no_esd=""
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   188
  if test "$ESD_CONFIG" = "no" ; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   189
    no_esd=yes
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   190
  else
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   191
    ESD_CFLAGS=`$ESD_CONFIG $esdconf_args --cflags`
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   192
    ESD_LIBS=`$ESD_CONFIG $esdconf_args --libs`
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   193
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   194
    esd_major_version=`$ESD_CONFIG $esd_args --version | \
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   195
           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   196
    esd_minor_version=`$ESD_CONFIG $esd_args --version | \
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   197
           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   198
    esd_micro_version=`$ESD_CONFIG $esd_config_args --version | \
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   199
           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   200
    if test "x$enable_esdtest" = "xyes" ; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   201
      ac_save_CFLAGS="$CFLAGS"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   202
      ac_save_LIBS="$LIBS"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   203
      CFLAGS="$CFLAGS $ESD_CFLAGS"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   204
      LIBS="$LIBS $ESD_LIBS"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   205
dnl
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   206
dnl Now check if the installed ESD is sufficiently new. (Also sanity
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   207
dnl checks the results of esd-config to some extent
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   208
dnl
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   209
      rm -f conf.esdtest
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   210
      AC_TRY_RUN([
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   211
#include <stdio.h>
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   212
#include <stdlib.h>
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   213
#include <string.h>
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   214
#include <esd.h>
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   215
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   216
char*
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   217
my_strdup (char *str)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   218
{
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   219
  char *new_str;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   220
  
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   221
  if (str)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   222
    {
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   223
      new_str = malloc ((strlen (str) + 1) * sizeof(char));
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   224
      strcpy (new_str, str);
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   225
    }
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   226
  else
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   227
    new_str = NULL;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   228
  
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   229
  return new_str;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   230
}
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   231
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   232
int main ()
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   233
{
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   234
  int major, minor, micro;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   235
  char *tmp_version;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   236
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   237
  system ("touch conf.esdtest");
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   238
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   239
  /* HP/UX 9 (%@#!) writes to sscanf strings */
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   240
  tmp_version = my_strdup("$min_esd_version");
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   241
  if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   242
     printf("%s, bad version string\n", "$min_esd_version");
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   243
     exit(1);
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   244
   }
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   245
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   246
   if (($esd_major_version > major) ||
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   247
      (($esd_major_version == major) && ($esd_minor_version > minor)) ||
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   248
      (($esd_major_version == major) && ($esd_minor_version == minor) && ($esd_micro_version >= micro)))
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   249
    {
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   250
      return 0;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   251
    }
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   252
  else
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   253
    {
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   254
      printf("\n*** 'esd-config --version' returned %d.%d.%d, but the minimum version\n", $esd_major_version, $esd_minor_version, $esd_micro_version);
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   255
      printf("*** of ESD required is %d.%d.%d. If esd-config is correct, then it is\n", major, minor, micro);
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   256
      printf("*** best to upgrade to the required version.\n");
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   257
      printf("*** If esd-config was wrong, set the environment variable ESD_CONFIG\n");
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   258
      printf("*** to point to the correct copy of esd-config, and remove the file\n");
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   259
      printf("*** config.cache before re-running configure\n");
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   260
      return 1;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   261
    }
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   262
}
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   263
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   264
],, no_esd=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   265
       CFLAGS="$ac_save_CFLAGS"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   266
       LIBS="$ac_save_LIBS"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   267
     fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   268
  fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   269
  if test "x$no_esd" = x ; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   270
     AC_MSG_RESULT(yes)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   271
     ifelse([$2], , :, [$2])     
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   272
  else
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   273
     AC_MSG_RESULT(no)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   274
     if test "$ESD_CONFIG" = "no" ; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   275
       echo "*** The esd-config script installed by ESD could not be found"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   276
       echo "*** If ESD was installed in PREFIX, make sure PREFIX/bin is in"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   277
       echo "*** your path, or set the ESD_CONFIG environment variable to the"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   278
       echo "*** full path to esd-config."
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   279
     else
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   280
       if test -f conf.esdtest ; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   281
        :
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   282
       else
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   283
          echo "*** Could not run ESD test program, checking why..."
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   284
          CFLAGS="$CFLAGS $ESD_CFLAGS"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   285
          LIBS="$LIBS $ESD_LIBS"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   286
          AC_TRY_LINK([
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   287
#include <stdio.h>
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   288
#include <esd.h>
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   289
],      [ return 0; ],
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   290
        [ echo "*** The test program compiled, but did not run. This usually means"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   291
          echo "*** that the run-time linker is not finding ESD or finding the wrong"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   292
          echo "*** version of ESD. If it is not finding ESD, you'll need to set your"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   293
          echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   294
          echo "*** to the installed location  Also, make sure you have run ldconfig if that"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   295
          echo "*** is required on your system"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   296
	  echo "***"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   297
          echo "*** If you have an old version installed, it is best to remove it, although"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   298
          echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"],
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   299
        [ echo "*** The test program failed to compile or link. See the file config.log for the"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   300
          echo "*** exact error that occured. This usually means ESD was incorrectly installed"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   301
          echo "*** or that you have moved ESD since it was installed. In the latter case, you"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   302
          echo "*** may want to edit the esd-config script: $ESD_CONFIG" ])
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   303
          CFLAGS="$ac_save_CFLAGS"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   304
          LIBS="$ac_save_LIBS"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   305
       fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   306
     fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   307
     ESD_CFLAGS=""
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   308
     ESD_LIBS=""
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   309
     ifelse([$3], , :, [$3])
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   310
  fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   311
  AC_SUBST(ESD_CFLAGS)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   312
  AC_SUBST(ESD_LIBS)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   313
  rm -f conf.esdtest
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   314
])
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   315
948
ac488ad4ef1d Don't fail if we don't have ALSA available
Sam Lantinga <slouken@libsdl.org>
parents: 947
diff changeset
   316
##############################################################################
1570
a740bca2a1b1 Updated to libtool-1.5.22
Sam Lantinga <slouken@libsdl.org>
parents: 1361
diff changeset
   317
# Based on libtool-1.5.22
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   318
# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
1570
a740bca2a1b1 Updated to libtool-1.5.22
Sam Lantinga <slouken@libsdl.org>
parents: 1361
diff changeset
   319
## Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   320
## Free Software Foundation, Inc.
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   321
## Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   322
##
1570
a740bca2a1b1 Updated to libtool-1.5.22
Sam Lantinga <slouken@libsdl.org>
parents: 1361
diff changeset
   323
## This file is free software; the Free Software Foundation gives
a740bca2a1b1 Updated to libtool-1.5.22
Sam Lantinga <slouken@libsdl.org>
parents: 1361
diff changeset
   324
## unlimited permission to copy and/or distribute it, with or without
a740bca2a1b1 Updated to libtool-1.5.22
Sam Lantinga <slouken@libsdl.org>
parents: 1361
diff changeset
   325
## modifications, as long as this notice is preserved.
a740bca2a1b1 Updated to libtool-1.5.22
Sam Lantinga <slouken@libsdl.org>
parents: 1361
diff changeset
   326
a740bca2a1b1 Updated to libtool-1.5.22
Sam Lantinga <slouken@libsdl.org>
parents: 1361
diff changeset
   327
# serial 48 AC_PROG_LIBTOOL
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   328
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   329
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   330
# AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   331
# -----------------------------------------------------------
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   332
# If this macro is not defined by Autoconf, define it here.
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   333
m4_ifdef([AC_PROVIDE_IFELSE],
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   334
         [],
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   335
         [m4_define([AC_PROVIDE_IFELSE],
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   336
	         [m4_ifdef([AC_PROVIDE_$1],
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   337
		           [$2], [$3])])])
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   338
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   339
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   340
# AC_PROG_LIBTOOL
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   341
# ---------------
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   342
AC_DEFUN([AC_PROG_LIBTOOL],
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   343
[AC_REQUIRE([_AC_PROG_LIBTOOL])dnl
1309
0f00cbbe5792 Bah, I don't know what I'm doing.
Sam Lantinga <slouken@libsdl.org>
parents: 1308
diff changeset
   344
dnl If AC_PROG_CXX has already been expanded, run AC_LIBTOOL_CXX
0f00cbbe5792 Bah, I don't know what I'm doing.
Sam Lantinga <slouken@libsdl.org>
parents: 1308
diff changeset
   345
dnl immediately, otherwise, hook it in at the end of AC_PROG_CXX.
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   346
  AC_PROVIDE_IFELSE([AC_PROG_CXX],
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   347
    [AC_LIBTOOL_CXX],
1309
0f00cbbe5792 Bah, I don't know what I'm doing.
Sam Lantinga <slouken@libsdl.org>
parents: 1308
diff changeset
   348
    [define([AC_PROG_CXX], defn([AC_PROG_CXX])[AC_LIBTOOL_CXX
0f00cbbe5792 Bah, I don't know what I'm doing.
Sam Lantinga <slouken@libsdl.org>
parents: 1308
diff changeset
   349
  ])])
0f00cbbe5792 Bah, I don't know what I'm doing.
Sam Lantinga <slouken@libsdl.org>
parents: 1308
diff changeset
   350
dnl And a similar setup for Fortran 77 support
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   351
  AC_PROVIDE_IFELSE([AC_PROG_F77],
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   352
    [AC_LIBTOOL_F77],
1309
0f00cbbe5792 Bah, I don't know what I'm doing.
Sam Lantinga <slouken@libsdl.org>
parents: 1308
diff changeset
   353
    [define([AC_PROG_F77], defn([AC_PROG_F77])[AC_LIBTOOL_F77
0f00cbbe5792 Bah, I don't know what I'm doing.
Sam Lantinga <slouken@libsdl.org>
parents: 1308
diff changeset
   354
])])
0f00cbbe5792 Bah, I don't know what I'm doing.
Sam Lantinga <slouken@libsdl.org>
parents: 1308
diff changeset
   355
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   356
dnl Quote A][M_PROG_GCJ so that aclocal doesn't bring it in needlessly.
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   357
dnl If either AC_PROG_GCJ or A][M_PROG_GCJ have already been expanded, run
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   358
dnl AC_LIBTOOL_GCJ immediately, otherwise, hook it in at the end of both.
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   359
  AC_PROVIDE_IFELSE([AC_PROG_GCJ],
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   360
    [AC_LIBTOOL_GCJ],
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   361
    [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   362
      [AC_LIBTOOL_GCJ],
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   363
      [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   364
	[AC_LIBTOOL_GCJ],
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   365
      [ifdef([AC_PROG_GCJ],
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   366
	     [define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   367
       ifdef([A][M_PROG_GCJ],
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   368
	     [define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[AC_LIBTOOL_GCJ])])
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   369
       ifdef([LT_AC_PROG_GCJ],
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   370
	     [define([LT_AC_PROG_GCJ],
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   371
		defn([LT_AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])])])
1309
0f00cbbe5792 Bah, I don't know what I'm doing.
Sam Lantinga <slouken@libsdl.org>
parents: 1308
diff changeset
   372
])])# AC_PROG_LIBTOOL
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   373
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   374
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   375
# _AC_PROG_LIBTOOL
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   376
# ----------------
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   377
AC_DEFUN([_AC_PROG_LIBTOOL],
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   378
[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   379
AC_BEFORE([$0],[AC_LIBTOOL_CXX])dnl
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   380
AC_BEFORE([$0],[AC_LIBTOOL_F77])dnl
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   381
AC_BEFORE([$0],[AC_LIBTOOL_GCJ])dnl
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   382
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   383
# This can be used to rebuild libtool when needed
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   384
LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh"
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   385
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   386
# Always use our own libtool.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   387
LIBTOOL='$(SHELL) $(top_builddir)/libtool'
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   388
AC_SUBST(LIBTOOL)dnl
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   389
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   390
# Prevent multiple expansion
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   391
define([AC_PROG_LIBTOOL], [])
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   392
])# _AC_PROG_LIBTOOL
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   393
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   394
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   395
# AC_LIBTOOL_SETUP
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   396
# ----------------
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   397
AC_DEFUN([AC_LIBTOOL_SETUP],
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   398
[AC_PREREQ(2.50)dnl
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   399
AC_REQUIRE([AC_ENABLE_SHARED])dnl
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   400
AC_REQUIRE([AC_ENABLE_STATIC])dnl
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   401
AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   402
AC_REQUIRE([AC_CANONICAL_HOST])dnl
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   403
AC_REQUIRE([AC_CANONICAL_BUILD])dnl
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   404
AC_REQUIRE([AC_PROG_CC])dnl
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   405
AC_REQUIRE([AC_PROG_LD])dnl
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   406
AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   407
AC_REQUIRE([AC_PROG_NM])dnl
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   408
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   409
AC_REQUIRE([AC_PROG_LN_S])dnl
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   410
AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   411
# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers!
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   412
AC_REQUIRE([AC_OBJEXT])dnl
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   413
AC_REQUIRE([AC_EXEEXT])dnl
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   414
dnl
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   415
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   416
AC_LIBTOOL_SYS_MAX_CMD_LEN
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   417
AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   418
AC_LIBTOOL_OBJDIR
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   419
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   420
AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   421
_LT_AC_PROG_ECHO_BACKSLASH
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   422
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   423
case $host_os in
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   424
aix3*)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   425
  # AIX sometimes has problems with the GCC collect2 program.  For some
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   426
  # reason, if we set the COLLECT_NAMES environment variable, the problems
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   427
  # vanish in a puff of smoke.
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   428
  if test "X${COLLECT_NAMES+set}" != Xset; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   429
    COLLECT_NAMES=
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   430
    export COLLECT_NAMES
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   431
  fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   432
  ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   433
esac
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   434
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   435
# Sed substitution that helps us do robust quoting.  It backslashifies
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   436
# metacharacters that are still active within double-quoted strings.
1570
a740bca2a1b1 Updated to libtool-1.5.22
Sam Lantinga <slouken@libsdl.org>
parents: 1361
diff changeset
   437
Xsed='sed -e 1s/^X//'
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   438
[sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g']
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   439
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   440
# Same as above, but do not quote variable references.
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   441
[double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g']
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   442
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   443
# Sed substitution to delay expansion of an escaped shell variable in a
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   444
# double_quote_subst'ed string.
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   445
delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   446
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   447
# Sed substitution to avoid accidental globbing in evaled expressions
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   448
no_glob_subst='s/\*/\\\*/g'
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   449
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   450
# Constants:
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   451
rm="rm -f"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   452
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   453
# Global variables:
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   454
default_ofile=libtool
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   455
can_build_shared=yes
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   456
1570
a740bca2a1b1 Updated to libtool-1.5.22
Sam Lantinga <slouken@libsdl.org>
parents: 1361
diff changeset
   457
# All known linkers require a `.a' archive for static linking (except MSVC,
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   458
# which needs '.lib').
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   459
libext=a
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   460
ltmain="$ac_aux_dir/ltmain.sh"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   461
ofile="$default_ofile"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   462
with_gnu_ld="$lt_cv_prog_gnu_ld"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   463
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   464
AC_CHECK_TOOL(AR, ar, false)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   465
AC_CHECK_TOOL(RANLIB, ranlib, :)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   466
AC_CHECK_TOOL(STRIP, strip, :)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   467
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   468
old_CC="$CC"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   469
old_CFLAGS="$CFLAGS"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   470
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   471
# Set sane defaults for various variables
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   472
test -z "$AR" && AR=ar
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   473
test -z "$AR_FLAGS" && AR_FLAGS=cru
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   474
test -z "$AS" && AS=as
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   475
test -z "$CC" && CC=cc
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   476
test -z "$LTCC" && LTCC=$CC
1570
a740bca2a1b1 Updated to libtool-1.5.22
Sam Lantinga <slouken@libsdl.org>
parents: 1361
diff changeset
   477
test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   478
test -z "$DLLTOOL" && DLLTOOL=dlltool
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   479
test -z "$LD" && LD=ld
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   480
test -z "$LN_S" && LN_S="ln -s"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   481
test -z "$MAGIC_CMD" && MAGIC_CMD=file
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   482
test -z "$NM" && NM=nm
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   483
test -z "$SED" && SED=sed
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   484
test -z "$OBJDUMP" && OBJDUMP=objdump
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   485
test -z "$RANLIB" && RANLIB=:
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   486
test -z "$STRIP" && STRIP=:
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   487
test -z "$ac_objext" && ac_objext=o
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   488
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   489
# Determine commands to create old-style static archives.
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   490
old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs'
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   491
old_postinstall_cmds='chmod 644 $oldlib'
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   492
old_postuninstall_cmds=
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   493
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   494
if test -n "$RANLIB"; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   495
  case $host_os in
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   496
  openbsd*)
1570
a740bca2a1b1 Updated to libtool-1.5.22
Sam Lantinga <slouken@libsdl.org>
parents: 1361
diff changeset
   497
    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib"
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   498
    ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   499
  *)
1570
a740bca2a1b1 Updated to libtool-1.5.22
Sam Lantinga <slouken@libsdl.org>
parents: 1361
diff changeset
   500
    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib"
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   501
    ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   502
  esac
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   503
  old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   504
fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   505
1570
a740bca2a1b1 Updated to libtool-1.5.22
Sam Lantinga <slouken@libsdl.org>
parents: 1361
diff changeset
   506
_LT_CC_BASENAME([$compiler])
947
3bb035750537 Updated libtool support for libtool 1.5.8
Sam Lantinga <slouken@libsdl.org>
parents: 939
diff changeset
   507
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   508
# Only perform the check for file, if the check method requires it
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   509
case $deplibs_check_method in
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   510
file_magic*)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   511
  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   512
    AC_PATH_MAGIC
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   513
  fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   514
  ;;
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   515
esac
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   516
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   517
AC_PROVIDE_IFELSE([AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   518
AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL],
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   519
enable_win32_dll=yes, enable_win32_dll=no)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   520
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   521
AC_ARG_ENABLE([libtool-lock],
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   522
    [AC_HELP_STRING([--disable-libtool-lock],
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   523
	[avoid locking (might break parallel builds)])])
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   524
test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   525
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   526
AC_ARG_WITH([pic],
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   527
    [AC_HELP_STRING([--with-pic],
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   528
	[try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   529
    [pic_mode="$withval"],
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   530
    [pic_mode=default])
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   531
test -z "$pic_mode" && pic_mode=default
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   532
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   533
# Use C for the default configuration in the libtool script
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   534
tagname=
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   535
AC_LIBTOOL_LANG_C_CONFIG
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   536
_LT_AC_TAGCONFIG
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   537
])# AC_LIBTOOL_SETUP
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   538
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   539
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   540
# _LT_AC_SYS_COMPILER
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   541
# -------------------
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   542
AC_DEFUN([_LT_AC_SYS_COMPILER],
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   543
[AC_REQUIRE([AC_PROG_CC])dnl
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   544
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   545
# If no C compiler was specified, use CC.
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   546
LTCC=${LTCC-"$CC"}
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   547
1570
a740bca2a1b1 Updated to libtool-1.5.22
Sam Lantinga <slouken@libsdl.org>
parents: 1361
diff changeset
   548
# If no C compiler flags were specified, use CFLAGS.
a740bca2a1b1 Updated to libtool-1.5.22
Sam Lantinga <slouken@libsdl.org>
parents: 1361
diff changeset
   549
LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
a740bca2a1b1 Updated to libtool-1.5.22
Sam Lantinga <slouken@libsdl.org>
parents: 1361
diff changeset
   550
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   551
# Allow CC to be a program name with arguments.
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   552
compiler=$CC
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   553
])# _LT_AC_SYS_COMPILER
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   554
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   555
1570
a740bca2a1b1 Updated to libtool-1.5.22
Sam Lantinga <slouken@libsdl.org>
parents: 1361
diff changeset
   556
# _LT_CC_BASENAME(CC)
a740bca2a1b1 Updated to libtool-1.5.22
Sam Lantinga <slouken@libsdl.org>
parents: 1361
diff changeset
   557
# -------------------
a740bca2a1b1 Updated to libtool-1.5.22
Sam Lantinga <slouken@libsdl.org>
parents: 1361
diff changeset
   558
# Calculate cc_basename.  Skip known compiler wrappers and cross-prefix.
a740bca2a1b1 Updated to libtool-1.5.22
Sam Lantinga <slouken@libsdl.org>
parents: 1361
diff changeset
   559
AC_DEFUN([_LT_CC_BASENAME],
a740bca2a1b1 Updated to libtool-1.5.22
Sam Lantinga <slouken@libsdl.org>
parents: 1361
diff changeset
   560
[for cc_temp in $1""; do
a740bca2a1b1 Updated to libtool-1.5.22
Sam Lantinga <slouken@libsdl.org>
parents: 1361
diff changeset
   561
  case $cc_temp in
a740bca2a1b1 Updated to libtool-1.5.22
Sam Lantinga <slouken@libsdl.org>
parents: 1361
diff changeset
   562
    compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
a740bca2a1b1 Updated to libtool-1.5.22
Sam Lantinga <slouken@libsdl.org>
parents: 1361
diff changeset
   563
    distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
a740bca2a1b1 Updated to libtool-1.5.22
Sam Lantinga <slouken@libsdl.org>
parents: 1361
diff changeset
   564
    \-*) ;;
a740bca2a1b1 Updated to libtool-1.5.22
Sam Lantinga <slouken@libsdl.org>
parents: 1361
diff changeset
   565
    *) break;;
a740bca2a1b1 Updated to libtool-1.5.22
Sam Lantinga <slouken@libsdl.org>
parents: 1361
diff changeset
   566
  esac
a740bca2a1b1 Updated to libtool-1.5.22
Sam Lantinga <slouken@libsdl.org>
parents: 1361
diff changeset
   567
done
a740bca2a1b1 Updated to libtool-1.5.22
Sam Lantinga <slouken@libsdl.org>
parents: 1361
diff changeset
   568
cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
a740bca2a1b1 Updated to libtool-1.5.22
Sam Lantinga <slouken@libsdl.org>
parents: 1361
diff changeset
   569
])
a740bca2a1b1 Updated to libtool-1.5.22
Sam Lantinga <slouken@libsdl.org>
parents: 1361
diff changeset
   570
a740bca2a1b1 Updated to libtool-1.5.22
Sam Lantinga <slouken@libsdl.org>
parents: 1361
diff changeset
   571
a740bca2a1b1 Updated to libtool-1.5.22
Sam Lantinga <slouken@libsdl.org>
parents: 1361
diff changeset
   572
# _LT_COMPILER_BOILERPLATE
a740bca2a1b1 Updated to libtool-1.5.22
Sam Lantinga <slouken@libsdl.org>
parents: 1361
diff changeset
   573
# ------------------------
a740bca2a1b1 Updated to libtool-1.5.22
Sam Lantinga <slouken@libsdl.org>
parents: 1361
diff changeset
   574
# Check for compiler boilerplate output or warnings with
a740bca2a1b1 Updated to libtool-1.5.22
Sam Lantinga <slouken@libsdl.org>
parents: 1361
diff changeset
   575
# the simple compiler test code.
a740bca2a1b1 Updated to libtool-1.5.22
Sam Lantinga <slouken@libsdl.org>
parents: 1361
diff changeset
   576
AC_DEFUN([_LT_COMPILER_BOILERPLATE],
a740bca2a1b1 Updated to libtool-1.5.22
Sam Lantinga <slouken@libsdl.org>
parents: 1361
diff changeset
   577
[ac_outfile=conftest.$ac_objext
a740bca2a1b1 Updated to libtool-1.5.22
Sam Lantinga <slouken@libsdl.org>
parents: 1361
diff changeset
   578
printf "$lt_simple_compile_test_code" >conftest.$ac_ext
a740bca2a1b1 Updated to libtool-1.5.22
Sam Lantinga <slouken@libsdl.org>
parents: 1361
diff changeset
   579
eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
a740bca2a1b1 Updated to libtool-1.5.22
Sam Lantinga <slouken@libsdl.org>
parents: 1361
diff changeset
   580
_lt_compiler_boilerplate=`cat conftest.err`
a740bca2a1b1 Updated to libtool-1.5.22
Sam Lantinga <slouken@libsdl.org>
parents: 1361
diff changeset
   581
$rm conftest*
a740bca2a1b1 Updated to libtool-1.5.22
Sam Lantinga <slouken@libsdl.org>
parents: 1361
diff changeset
   582
])# _LT_COMPILER_BOILERPLATE
a740bca2a1b1 Updated to libtool-1.5.22
Sam Lantinga <slouken@libsdl.org>
parents: 1361
diff changeset
   583
a740bca2a1b1 Updated to libtool-1.5.22
Sam Lantinga <slouken@libsdl.org>
parents: 1361
diff changeset
   584
a740bca2a1b1 Updated to libtool-1.5.22
Sam Lantinga <slouken@libsdl.org>
parents: 1361
diff changeset
   585
# _LT_LINKER_BOILERPLATE
a740bca2a1b1 Updated to libtool-1.5.22
Sam Lantinga <slouken@libsdl.org>
parents: 1361
diff changeset
   586
# ----------------------
a740bca2a1b1 Updated to libtool-1.5.22
Sam Lantinga <slouken@libsdl.org>
parents: 1361
diff changeset
   587
# Check for linker boilerplate output or warnings with
a740bca2a1b1 Updated to libtool-1.5.22
Sam Lantinga <slouken@libsdl.org>
parents: 1361
diff changeset
   588
# the simple link test code.
a740bca2a1b1 Updated to libtool-1.5.22
Sam Lantinga <slouken@libsdl.org>
parents: 1361
diff changeset
   589
AC_DEFUN([_LT_LINKER_BOILERPLATE],
a740bca2a1b1 Updated to libtool-1.5.22
Sam Lantinga <slouken@libsdl.org>
parents: 1361
diff changeset
   590
[ac_outfile=conftest.$ac_objext
a740bca2a1b1 Updated to libtool-1.5.22
Sam Lantinga <slouken@libsdl.org>
parents: 1361
diff changeset
   591
printf "$lt_simple_link_test_code" >conftest.$ac_ext
a740bca2a1b1 Updated to libtool-1.5.22
Sam Lantinga <slouken@libsdl.org>
parents: 1361
diff changeset
   592
eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
a740bca2a1b1 Updated to libtool-1.5.22
Sam Lantinga <slouken@libsdl.org>
parents: 1361
diff changeset
   593
_lt_linker_boilerplate=`cat conftest.err`
a740bca2a1b1 Updated to libtool-1.5.22
Sam Lantinga <slouken@libsdl.org>
parents: 1361
diff changeset
   594
$rm conftest*
a740bca2a1b1 Updated to libtool-1.5.22
Sam Lantinga <slouken@libsdl.org>
parents: 1361
diff changeset
   595
])# _LT_LINKER_BOILERPLATE
a740bca2a1b1 Updated to libtool-1.5.22
Sam Lantinga <slouken@libsdl.org>
parents: 1361
diff changeset
   596
a740bca2a1b1 Updated to libtool-1.5.22
Sam Lantinga <slouken@libsdl.org>
parents: 1361
diff changeset
   597
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   598
# _LT_AC_SYS_LIBPATH_AIX
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   599
# ----------------------
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   600
# Links a minimal program and checks the executable
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   601
# for the system default hardcoded library path. In most cases,
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   602
# this is /usr/lib:/lib, but when the MPI compilers are used
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   603
# the location of the communication and MPI libs are included too.
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   604
# If we don't find anything, use the default library path according
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   605
# to the aix ld manual.
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   606
AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX],
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   607
[AC_LINK_IFELSE(AC_LANG_PROGRAM,[
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   608
aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   609
}'`
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   610
# Check for a 64-bit object if we didn't find anything.
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   611
if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   612
}'`; fi],[])
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   613
if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   614
])# _LT_AC_SYS_LIBPATH_AIX
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   615
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   616
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   617
# _LT_AC_SHELL_INIT(ARG)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   618
# ----------------------
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   619
AC_DEFUN([_LT_AC_SHELL_INIT],
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   620
[ifdef([AC_DIVERSION_NOTICE],
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   621
	     [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)],
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   622
	 [AC_DIVERT_PUSH(NOTICE)])
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   623
$1
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   624
AC_DIVERT_POP
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   625
])# _LT_AC_SHELL_INIT
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   626
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   627
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   628
# _LT_AC_PROG_ECHO_BACKSLASH
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   629
# --------------------------
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   630
# Add some code to the start of the generated configure script which
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   631
# will find an echo command which doesn't interpret backslashes.
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   632
AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH],
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   633
[_LT_AC_SHELL_INIT([
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   634
# Check that we are running under the correct shell.
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   635
SHELL=${CONFIG_SHELL-/bin/sh}
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   636
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   637
case X$ECHO in
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   638
X*--fallback-echo)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   639
  # Remove one level of quotation (which was required for Make).
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   640
  ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','`
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   641
  ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   642
esac
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   643
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   644
echo=${ECHO-echo}
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   645
if test "X[$]1" = X--no-reexec; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   646
  # Discard the --no-reexec flag, and continue.
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   647
  shift
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   648
elif test "X[$]1" = X--fallback-echo; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   649
  # Avoid inline document here, it may be left over
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   650
  :
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   651
elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   652
  # Yippee, $echo works!
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   653
  :
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   654
else
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   655
  # Restart under the correct shell.
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   656
  exec $SHELL "[$]0" --no-reexec ${1+"[$]@"}
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   657
fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   658
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   659
if test "X[$]1" = X--fallback-echo; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   660
  # used as fallback echo
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   661
  shift
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   662
  cat <<EOF
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   663
[$]*
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   664
EOF
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   665
  exit 0
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   666
fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   667
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   668
# The HP-UX ksh and POSIX shell print the target directory to stdout
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   669
# if CDPATH is set.
947
3bb035750537 Updated libtool support for libtool 1.5.8
Sam Lantinga <slouken@libsdl.org>
parents: 939
diff changeset
   670
(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   671
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   672
if test -z "$ECHO"; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   673
if test "X${echo_test_string+set}" != Xset; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   674
# find a string as large as possible, as long as the shell can cope with it
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   675
  for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   676
    # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
1570
a740bca2a1b1 Updated to libtool-1.5.22
Sam Lantinga <slouken@libsdl.org>
parents: 1361
diff changeset
   677
    if (echo_test_string=`eval $cmd`) 2>/dev/null &&
a740bca2a1b1 Updated to libtool-1.5.22
Sam Lantinga <slouken@libsdl.org>
parents: 1361
diff changeset
   678
       echo_test_string=`eval $cmd` &&
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   679
       (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   680
    then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   681
      break
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   682
    fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   683
  done
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   684
fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   685
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   686
if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   687
   echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   688
   test "X$echo_testing_string" = "X$echo_test_string"; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   689
  :
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   690
else
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   691
  # The Solaris, AIX, and Digital Unix default echo programs unquote
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   692
  # backslashes.  This makes it impossible to quote backslashes using
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   693
  #   echo "$something" | sed 's/\\/\\\\/g'
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   694
  #
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   695
  # So, first we look for a working echo in the user's PATH.
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   696
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   697
  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   698
  for dir in $PATH /usr/ucb; do
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   699
    IFS="$lt_save_ifs"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   700
    if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   701
       test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   702
       echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   703
       test "X$echo_testing_string" = "X$echo_test_string"; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   704
      echo="$dir/echo"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   705
      break
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   706
    fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   707
  done
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   708
  IFS="$lt_save_ifs"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   709
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   710
  if test "X$echo" = Xecho; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   711
    # We didn't find a better echo, so look for alternatives.
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   712
    if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' &&
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   713
       echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` &&
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   714
       test "X$echo_testing_string" = "X$echo_test_string"; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   715
      # This shell has a builtin print -r that does the trick.
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   716
      echo='print -r'
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   717
    elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) &&
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   718
	 test "X$CONFIG_SHELL" != X/bin/ksh; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   719
      # If we have ksh, try running configure again with it.
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   720
      ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   721
      export ORIGINAL_CONFIG_SHELL
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   722
      CONFIG_SHELL=/bin/ksh
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   723
      export CONFIG_SHELL
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   724
      exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"}
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   725
    else
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   726
      # Try using printf.
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   727
      echo='printf %s\n'
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   728
      if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   729
	 echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   730
	 test "X$echo_testing_string" = "X$echo_test_string"; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   731
	# Cool, printf works
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   732
	:
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   733
      elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   734
	   test "X$echo_testing_string" = 'X\t' &&
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   735
	   echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   736
	   test "X$echo_testing_string" = "X$echo_test_string"; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   737
	CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   738
	export CONFIG_SHELL
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   739
	SHELL="$CONFIG_SHELL"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   740
	export SHELL
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   741
	echo="$CONFIG_SHELL [$]0 --fallback-echo"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   742
      elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   743
	   test "X$echo_testing_string" = 'X\t' &&
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   744
	   echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   745
	   test "X$echo_testing_string" = "X$echo_test_string"; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   746
	echo="$CONFIG_SHELL [$]0 --fallback-echo"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   747
      else
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   748
	# maybe with a smaller string...
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   749
	prev=:
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   750
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   751
	for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   752
	  if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   753
	  then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   754
	    break
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   755
	  fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   756
	  prev="$cmd"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   757
	done
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   758
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   759
	if test "$prev" != 'sed 50q "[$]0"'; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   760
	  echo_test_string=`eval $prev`
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   761
	  export echo_test_string
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   762
	  exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"}
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   763
	else
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   764
	  # Oops.  We lost completely, so just stick with echo.
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   765
	  echo=echo
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   766
	fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   767
      fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   768
    fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   769
  fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   770
fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   771
fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   772
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   773
# Copy echo and quote the copy suitably for passing to libtool from
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   774
# the Makefile, instead of quoting the original, which is used later.
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   775
ECHO=$echo
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   776
if test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   777
   ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   778
fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   779
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   780
AC_SUBST(ECHO)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   781
])])# _LT_AC_PROG_ECHO_BACKSLASH
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   782
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   783
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   784
# _LT_AC_LOCK
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   785
# -----------
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   786
AC_DEFUN([_LT_AC_LOCK],
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   787
[AC_ARG_ENABLE([libtool-lock],
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   788
    [AC_HELP_STRING([--disable-libtool-lock],
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   789
	[avoid locking (might break parallel builds)])])
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   790
test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   791
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   792
# Some flags need to be propagated to the compiler or linker for good
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   793
# libtool support.
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   794
case $host in
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   795
ia64-*-hpux*)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   796
  # Find out which ABI we are using.
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   797
  echo 'int i;' > conftest.$ac_ext
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   798
  if AC_TRY_EVAL(ac_compile); then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   799
    case `/usr/bin/file conftest.$ac_objext` in
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   800
    *ELF-32*)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   801
      HPUX_IA64_MODE="32"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   802
      ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   803
    *ELF-64*)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   804
      HPUX_IA64_MODE="64"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   805
      ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   806
    esac
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   807
  fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   808
  rm -rf conftest*
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   809
  ;;
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   810
*-*-irix6*)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   811
  # Find out which ABI we are using.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   812
  echo '[#]line __oline__ "configure"' > conftest.$ac_ext
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   813
  if AC_TRY_EVAL(ac_compile); then
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   814
   if test "$lt_cv_prog_gnu_ld" = yes; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   815
    case `/usr/bin/file conftest.$ac_objext` in
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   816
    *32-bit*)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   817
      LD="${LD-ld} -melf32bsmip"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   818
      ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   819
    *N32*)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   820
      LD="${LD-ld} -melf32bmipn32"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   821
      ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   822
    *64-bit*)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   823
      LD="${LD-ld} -melf64bmip"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   824
      ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   825
    esac
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   826
   else
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   827
    case `/usr/bin/file conftest.$ac_objext` in
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   828
    *32-bit*)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   829
      LD="${LD-ld} -32"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   830
      ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   831
    *N32*)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   832
      LD="${LD-ld} -n32"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   833
      ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   834
    *64-bit*)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   835
      LD="${LD-ld} -64"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   836
      ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   837
    esac
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   838
   fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   839
  fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   840
  rm -rf conftest*
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   841
  ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   842
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   843
x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   844
  # Find out which ABI we are using.
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   845
  echo 'int i;' > conftest.$ac_ext
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   846
  if AC_TRY_EVAL(ac_compile); then
1570
a740bca2a1b1 Updated to libtool-1.5.22
Sam Lantinga <slouken@libsdl.org>
parents: 1361
diff changeset
   847
    case `/usr/bin/file conftest.o` in
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   848
    *32-bit*)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   849
      case $host in
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   850
        x86_64-*linux*)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   851
          LD="${LD-ld} -m elf_i386"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   852
          ;;
947
3bb035750537 Updated libtool support for libtool 1.5.8
Sam Lantinga <slouken@libsdl.org>
parents: 939
diff changeset
   853
        ppc64-*linux*|powerpc64-*linux*)
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   854
          LD="${LD-ld} -m elf32ppclinux"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   855
          ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   856
        s390x-*linux*)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   857
          LD="${LD-ld} -m elf_s390"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   858
          ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   859
        sparc64-*linux*)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   860
          LD="${LD-ld} -m elf32_sparc"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   861
          ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   862
      esac
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   863
      ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   864
    *64-bit*)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   865
      case $host in
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   866
        x86_64-*linux*)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   867
          LD="${LD-ld} -m elf_x86_64"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   868
          ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   869
        ppc*-*linux*|powerpc*-*linux*)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   870
          LD="${LD-ld} -m elf64ppc"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   871
          ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   872
        s390*-*linux*)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   873
          LD="${LD-ld} -m elf64_s390"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   874
          ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   875
        sparc*-*linux*)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   876
          LD="${LD-ld} -m elf64_sparc"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   877
          ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   878
      esac
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   879
      ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   880
    esac
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   881
  fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   882
  rm -rf conftest*
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   883
  ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   884
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   885
*-*-sco3.2v5*)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   886
  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   887
  SAVE_CFLAGS="$CFLAGS"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   888
  CFLAGS="$CFLAGS -belf"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   889
  AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   890
    [AC_LANG_PUSH(C)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   891
     AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   892
     AC_LANG_POP])
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   893
  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   894
    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   895
    CFLAGS="$SAVE_CFLAGS"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   896
  fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   897
  ;;
1570
a740bca2a1b1 Updated to libtool-1.5.22
Sam Lantinga <slouken@libsdl.org>
parents: 1361
diff changeset
   898
sparc*-*solaris*)
a740bca2a1b1 Updated to libtool-1.5.22
Sam Lantinga <slouken@libsdl.org>
parents: 1361
diff changeset
   899
  # Find out which ABI we are using.
a740bca2a1b1 Updated to libtool-1.5.22
Sam Lantinga <slouken@libsdl.org>
parents: 1361
diff changeset
   900
  echo 'int i;' > conftest.$ac_ext
a740bca2a1b1 Updated to libtool-1.5.22
Sam Lantinga <slouken@libsdl.org>
parents: 1361
diff changeset
   901
  if AC_TRY_EVAL(ac_compile); then
a740bca2a1b1 Updated to libtool-1.5.22
Sam Lantinga <slouken@libsdl.org>
parents: 1361
diff changeset
   902
    case `/usr/bin/file conftest.o` in
a740bca2a1b1 Updated to libtool-1.5.22
Sam Lantinga <slouken@libsdl.org>
parents: 1361
diff changeset
   903
    *64-bit*)
a740bca2a1b1 Updated to libtool-1.5.22
Sam Lantinga <slouken@libsdl.org>
parents: 1361
diff changeset
   904
      case $lt_cv_prog_gnu_ld in
a740bca2a1b1 Updated to libtool-1.5.22
Sam Lantinga <slouken@libsdl.org>
parents: 1361
diff changeset
   905
      yes*) LD="${LD-ld} -m elf64_sparc" ;;
a740bca2a1b1 Updated to libtool-1.5.22
Sam Lantinga <slouken@libsdl.org>
parents: 1361
diff changeset
   906
      *)    LD="${LD-ld} -64" ;;
a740bca2a1b1 Updated to libtool-1.5.22
Sam Lantinga <slouken@libsdl.org>
parents: 1361
diff changeset
   907
      esac
a740bca2a1b1 Updated to libtool-1.5.22
Sam Lantinga <slouken@libsdl.org>
parents: 1361
diff changeset
   908
      ;;
a740bca2a1b1 Updated to libtool-1.5.22
Sam Lantinga <slouken@libsdl.org>
parents: 1361
diff changeset
   909
    esac
a740bca2a1b1 Updated to libtool-1.5.22
Sam Lantinga <slouken@libsdl.org>
parents: 1361
diff changeset
   910
  fi
a740bca2a1b1 Updated to libtool-1.5.22
Sam Lantinga <slouken@libsdl.org>
parents: 1361
diff changeset
   911
  rm -rf conftest*
a740bca2a1b1 Updated to libtool-1.5.22
Sam Lantinga <slouken@libsdl.org>
parents: 1361
diff changeset
   912
  ;;
a740bca2a1b1 Updated to libtool-1.5.22
Sam Lantinga <slouken@libsdl.org>
parents: 1361
diff changeset
   913
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   914
AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL],
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   915
[*-*-cygwin* | *-*-mingw* | *-*-pw32*)
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   916
  AC_CHECK_TOOL(DLLTOOL, dlltool, false)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   917
  AC_CHECK_TOOL(AS, as, false)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   918
  AC_CHECK_TOOL(OBJDUMP, objdump, false)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   919
  ;;
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   920
  ])
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   921
esac
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   922
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   923
need_locks="$enable_libtool_lock"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   924
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   925
])# _LT_AC_LOCK
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   926
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   927
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   928
# AC_LIBTOOL_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   929
#		[OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   930
# ----------------------------------------------------------------
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   931
# Check whether the given compiler option works
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   932
AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION],
947
3bb035750537 Updated libtool support for libtool 1.5.8
Sam Lantinga <slouken@libsdl.org>
parents: 939
diff changeset
   933
[AC_REQUIRE([LT_AC_PROG_SED])
3bb035750537 Updated libtool support for libtool 1.5.8
Sam Lantinga <slouken@libsdl.org>
parents: 939
diff changeset
   934
AC_CACHE_CHECK([$1], [$2],
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   935
  [$2=no
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   936
  ifelse([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   937
   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   938
   lt_compiler_flag="$3"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   939
   # Insert the option either (1) after the last *FLAGS variable, or
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   940
   # (2) before a word containing "conftest.", or (3) at the end.
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   941
   # Note that $ac_compile itself does not contain backslashes and begins
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   942
   # with a dollar sign (not a hyphen), so the echo should work correctly.
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   943
   # The option is referenced via a variable to avoid confusing sed.
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   944
   lt_compile=`echo "$ac_compile" | $SED \
1570
a740bca2a1b1 Updated to libtool-1.5.22
Sam Lantinga <slouken@libsdl.org>
parents: 1361
diff changeset
   945
   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   946
   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   947
   -e 's:$: $lt_compiler_flag:'`
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   948
   (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   949
   (eval "$lt_compile" 2>conftest.err)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   950
   ac_status=$?
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   951
   cat conftest.err >&AS_MESSAGE_LOG_FD
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   952
   echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   953
   if (exit $ac_status) && test -s "$ac_outfile"; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   954
     # The compiler can only warn and ignore the option if not recognized
1570
a740bca2a1b1 Updated to libtool-1.5.22
Sam Lantinga <slouken@libsdl.org>
parents: 1361
diff changeset
   955
     # So say no if there are warnings other than the usual output.
a740bca2a1b1 Updated to libtool-1.5.22
Sam Lantinga <slouken@libsdl.org>
parents: 1361
diff changeset
   956
     $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
a740bca2a1b1 Updated to libtool-1.5.22
Sam Lantinga <slouken@libsdl.org>
parents: 1361
diff changeset
   957
     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
a740bca2a1b1 Updated to libtool-1.5.22
Sam Lantinga <slouken@libsdl.org>
parents: 1361
diff changeset
   958
     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   959
       $2=yes
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   960
     fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   961
   fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   962
   $rm conftest*
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   963
])
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   964
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   965
if test x"[$]$2" = xyes; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   966
    ifelse([$5], , :, [$5])
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   967
else
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   968
    ifelse([$6], , :, [$6])
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   969
fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   970
])# AC_LIBTOOL_COMPILER_OPTION
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   971
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   972
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   973
# AC_LIBTOOL_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   974
#                          [ACTION-SUCCESS], [ACTION-FAILURE])
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   975
# ------------------------------------------------------------
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   976
# Check whether the given compiler option works
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   977
AC_DEFUN([AC_LIBTOOL_LINKER_OPTION],
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   978
[AC_CACHE_CHECK([$1], [$2],
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   979
  [$2=no
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   980
   save_LDFLAGS="$LDFLAGS"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   981
   LDFLAGS="$LDFLAGS $3"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   982
   printf "$lt_simple_link_test_code" > conftest.$ac_ext
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   983
   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
1570
a740bca2a1b1 Updated to libtool-1.5.22
Sam Lantinga <slouken@libsdl.org>
parents: 1361
diff changeset
   984
     # The linker can only warn and ignore the option if not recognized
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   985
     # So say no if there are warnings
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   986
     if test -s conftest.err; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   987
       # Append any errors to the config.log.
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   988
       cat conftest.err 1>&AS_MESSAGE_LOG_FD
1570
a740bca2a1b1 Updated to libtool-1.5.22
Sam Lantinga <slouken@libsdl.org>
parents: 1361
diff changeset
   989
       $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp
a740bca2a1b1 Updated to libtool-1.5.22
Sam Lantinga <slouken@libsdl.org>
parents: 1361
diff changeset
   990
       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
a740bca2a1b1 Updated to libtool-1.5.22
Sam Lantinga <slouken@libsdl.org>
parents: 1361
diff changeset
   991
       if diff conftest.exp conftest.er2 >/dev/null; then
a740bca2a1b1 Updated to libtool-1.5.22
Sam Lantinga <slouken@libsdl.org>
parents: 1361
diff changeset
   992
         $2=yes
a740bca2a1b1 Updated to libtool-1.5.22
Sam Lantinga <slouken@libsdl.org>
parents: 1361
diff changeset
   993
       fi
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   994
     else
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   995
       $2=yes
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   996
     fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   997
   fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   998
   $rm conftest*
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   999
   LDFLAGS="$save_LDFLAGS"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1000
])
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1001
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1002
if test x"[$]$2" = xyes; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1003
    ifelse([$4], , :, [$4])
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1004
else
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1005
    ifelse([$5], , :, [$5])
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1006
fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1007
])# AC_LIBTOOL_LINKER_OPTION
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1008
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1009
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1010
# AC_LIBTOOL_SYS_MAX_CMD_LEN
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1011
# --------------------------
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1012
AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN],
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1013
[# find the maximum length of command line arguments
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1014
AC_MSG_CHECKING([the maximum length of command line arguments])
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1015
AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1016
  i=0
947
3bb035750537 Updated libtool support for libtool 1.5.8
Sam Lantinga <slouken@libsdl.org>
parents: 939
diff changeset
  1017
  teststring="ABCD"
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1018
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1019
  case $build_os in
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1020
  msdosdjgpp*)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1021
    # On DJGPP, this test can blow up pretty badly due to problems in libc
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1022
    # (any single argument exceeding 2000 bytes causes a buffer overrun
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1023
    # during glob expansion).  Even if it were fixed, the result of this
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1024
    # check would be larger than it should be.
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1025
    lt_cv_sys_max_cmd_len=12288;    # 12K is about right
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1026
    ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1027
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1028
  gnu*)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1029
    # Under GNU Hurd, this test is not required because there is
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1030
    # no limit to the length of command line arguments.
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1031
    # Libtool will interpret -1 as no limit whatsoever
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1032
    lt_cv_sys_max_cmd_len=-1;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1033
    ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1034
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1035
  cygwin* | mingw*)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1036
    # On Win9x/ME, this test blows up -- it succeeds, but takes
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1037
    # about 5 minutes as the teststring grows exponentially.
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1038
    # Worse, since 9x/ME are not pre-emptively multitasking,
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1039
    # you end up with a "frozen" computer, even though with patience
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1040
    # the test eventually succeeds (with a max line length of 256k).
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1041
    # Instead, let's just punt: use the minimum linelength reported by
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1042
    # all of the supported platforms: 8192 (on NT/2K/XP).
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1043
    lt_cv_sys_max_cmd_len=8192;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1044
    ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1045
1361
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents: 1309
diff changeset
  1046
  beos*)
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents: 1309
diff changeset
  1047
    # On BeOS, this test takes a really really long time.
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents: 1309
diff changeset
  1048
    # So we just punt and use a minimum line length of 8192.
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents: 1309
diff changeset
  1049
    lt_cv_sys_max_cmd_len=8192;
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents: 1309
diff changeset
  1050
    ;;
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents: 1309
diff changeset
  1051
947
3bb035750537 Updated libtool support for libtool 1.5.8
Sam Lantinga <slouken@libsdl.org>
parents: 939
diff changeset
  1052
  amigaos*)
3bb035750537 Updated libtool support for libtool 1.5.8
Sam Lantinga <slouken@libsdl.org>
parents: 939
diff changeset
  1053
    # On AmigaOS with pdksh, this test takes hours, literally.
3bb035750537 Updated libtool support for libtool 1.5.8
Sam Lantinga <slouken@libsdl.org>
parents: 939
diff changeset
  1054
    # So we just punt and use a minimum line length of 8192.
3bb035750537 Updated libtool support for libtool 1.5.8
Sam Lantinga <slouken@libsdl.org>
parents: 939
diff changeset
  1055
    lt_cv_sys_max_cmd_len=8192;
3bb035750537 Updated libtool support for libtool 1.5.8
Sam Lantinga <slouken@libsdl.org>
parents: 939
diff changeset
  1056
    ;;
3bb035750537 Updated libtool support for libtool 1.5.8
Sam Lantinga <slouken@libsdl.org>
parents: 939
diff changeset
  1057
1570
a740bca2a1b1 Updated to libtool-1.5.22
Sam Lantinga <slouken@libsdl.org>
parents: 1361
diff changeset
  1058
  netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
947
3bb035750537 Updated libtool support for libtool 1.5.8
Sam Lantinga <slouken@libsdl.org>
parents: 939
diff changeset
  1059
    # This has been around since 386BSD, at least.  Likely further.
3bb035750537 Updated libtool support for libtool 1.5.8
Sam Lantinga <slouken@libsdl.org>
parents: 939
diff changeset
  1060
    if test -x /sbin/sysctl; then
3bb035750537 Updated libtool support for libtool 1.5.8
Sam Lantinga <slouken@libsdl.org>
parents: 939
diff changeset
  1061
      lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
3bb035750537 Updated libtool support for libtool 1.5.8
Sam Lantinga <slouken@libsdl.org>
parents: 939
diff changeset
  1062
    elif test -x /usr/sbin/sysctl; then
3bb035750537 Updated libtool support for libtool 1.5.8
Sam Lantinga <slouken@libsdl.org>
parents: 939
diff changeset
  1063
      lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
3bb035750537 Updated libtool support for libtool 1.5.8
Sam Lantinga <slouken@libsdl.org>
parents: 939
diff changeset
  1064
    else
1570
a740bca2a1b1 Updated to libtool-1.5.22
Sam Lantinga <slouken@libsdl.org>
parents: 1361
diff changeset
  1065
      lt_cv_sys_max_cmd_len=65536	# usable default for all BSDs
947
3bb035750537 Updated libtool support for libtool 1.5.8
Sam Lantinga <slouken@libsdl.org>
parents: 939
diff changeset
  1066
    fi
3bb035750537 Updated libtool support for libtool 1.5.8
Sam Lantinga <slouken@libsdl.org>
parents: 939
diff changeset
  1067
    # And add a safety zone
3bb035750537 Updated libtool support for libtool 1.5.8
Sam Lantinga <slouken@libsdl.org>
parents: 939
diff changeset
  1068
    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
1570
a740bca2a1b1 Updated to libtool-1.5.22
Sam Lantinga <slouken@libsdl.org>
parents: 1361
diff changeset
  1069
    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
947
3bb035750537 Updated libtool support for libtool 1.5.8
Sam Lantinga <slouken@libsdl.org>
parents: 939
diff changeset
  1070
    ;;
3bb035750537 Updated libtool support for libtool 1.5.8
Sam Lantinga <slouken@libsdl.org>
parents: 939
diff changeset
  1071
1570
a740bca2a1b1 Updated to libtool-1.5.22
Sam Lantinga <slouken@libsdl.org>
parents: 1361
diff changeset
  1072
  interix*)
a740bca2a1b1 Updated to libtool-1.5.22
Sam Lantinga <slouken@libsdl.org>
parents: 1361
diff changeset
  1073
    # We know the value 262144 and hardcode it with a safety zone (like BSD)
a740bca2a1b1 Updated to libtool-1.5.22
Sam Lantinga <slouken@libsdl.org>
parents: 1361
diff changeset
  1074
    lt_cv_sys_max_cmd_len=196608
a740bca2a1b1 Updated to libtool-1.5.22
Sam Lantinga <slouken@libsdl.org>
parents: 1361
diff changeset
  1075
    ;;
a740bca2a1b1 Updated to libtool-1.5.22
Sam Lantinga <slouken@libsdl.org>
parents: 1361
diff changeset
  1076
a740bca2a1b1 Updated to libtool-1.5.22
Sam Lantinga <slouken@libsdl.org>
parents: 1361
diff changeset
  1077
  osf*)
a740bca2a1b1 Updated to libtool-1.5.22
Sam Lantinga <slouken@libsdl.org>
parents: 1361
diff changeset
  1078
    # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
a740bca2a1b1 Updated to libtool-1.5.22
Sam Lantinga <slouken@libsdl.org>
parents: 1361
diff changeset
  1079
    # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
a740bca2a1b1 Updated to libtool-1.5.22
Sam Lantinga <slouken@libsdl.org>
parents: 1361
diff changeset
  1080
    # nice to cause kernel panics so lets avoid the loop below.
a740bca2a1b1 Updated to libtool-1.5.22
Sam Lantinga <slouken@libsdl.org>
parents: 1361
diff changeset
  1081
    # First set a reasonable default.
a740bca2a1b1 Updated to libtool-1.5.22
Sam Lantinga <slouken@libsdl.org>
parents: 1361
diff changeset
  1082
    lt_cv_sys_max_cmd_len=16384
a740bca2a1b1 Updated to libtool-1.5.22
Sam Lantinga <slouken@libsdl.org>
parents: 1361
diff changeset
  1083
    #
a740bca2a1b1 Updated to libtool-1.5.22
Sam Lantinga <slouken@libsdl.org>
parents: 1361
diff changeset
  1084
    if test -x /sbin/sysconfig; then
a740bca2a1b1 Updated to libtool-1.5.22
Sam Lantinga <slouken@libsdl.org>
parents: 1361
diff changeset
  1085
      case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
a740bca2a1b1 Updated to libtool-1.5.22
Sam Lantinga <slouken@libsdl.org>
parents: 1361
diff changeset
  1086
        *1*) lt_cv_sys_max_cmd_len=-1 ;;
a740bca2a1b1 Updated to libtool-1.5.22
Sam Lantinga <slouken@libsdl.org>
parents: 1361
diff changeset
  1087
      esac
a740bca2a1b1 Updated to libtool-1.5.22
Sam Lantinga <slouken@libsdl.org>
parents: 1361
diff changeset
  1088
    fi
a740bca2a1b1 Updated to libtool-1.5.22
Sam Lantinga <slouken@libsdl.org>
parents: 1361
diff changeset
  1089
    ;;
a740bca2a1b1 Updated to libtool-1.5.22
Sam Lantinga <slouken@libsdl.org>
parents: 1361
diff changeset
  1090
  sco3.2v5*)
a740bca2a1b1 Updated to libtool-1.5.22
Sam Lantinga <slouken@libsdl.org>
parents: 1361
diff changeset
  1091
    lt_cv_sys_max_cmd_len=102400
a740bca2a1b1 Updated to libtool-1.5.22
Sam Lantinga <slouken@libsdl.org>
parents: 1361
diff changeset
  1092
    ;;
a740bca2a1b1 Updated to libtool-1.5.22
Sam Lantinga <slouken@libsdl.org>
parents: 1361
diff changeset
  1093
  sysv5* | sco5v6* | sysv4.2uw2*)
a740bca2a1b1 Updated to libtool-1.5.22
Sam Lantinga <slouken@libsdl.org>
parents: 1361
diff changeset
  1094
    kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
a740bca2a1b1 Updated to libtool-1.5.22
Sam Lantinga <slouken@libsdl.org>
parents: 1361
diff changeset
  1095
    if test -n "$kargmax"; then
a740bca2a1b1 Updated to libtool-1.5.22
Sam Lantinga <slouken@libsdl.org>
parents: 1361
diff changeset
  1096
      lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ 	]]//'`
a740bca2a1b1 Updated to libtool-1.5.22
Sam Lantinga <slouken@libsdl.org>
parents: 1361
diff changeset
  1097
    else
a740bca2a1b1 Updated to libtool-1.5.22
Sam Lantinga <slouken@libsdl.org>
parents: 1361
diff changeset
  1098
      lt_cv_sys_max_cmd_len=32768
a740bca2a1b1 Updated to libtool-1.5.22
Sam Lantinga <slouken@libsdl.org>
parents: 1361
diff changeset
  1099
    fi
a740bca2a1b1 Updated to libtool-1.5.22
Sam Lantinga <slouken@libsdl.org>
parents: 1361
diff changeset
  1100
    ;;
a740bca2a1b1 Updated to libtool-1.5.22
Sam Lantinga <slouken@libsdl.org>
parents: 1361
diff changeset
  1101
  *)
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1102
    # If test is not a shell built-in, we'll probably end up computing a
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1103
    # maximum length that is only half of the actual maximum length, but
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1104
    # we can't tell.
947
3bb035750537 Updated libtool support for libtool 1.5.8
Sam Lantinga <slouken@libsdl.org>
parents: 939
diff changeset
  1105
    SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
3bb035750537 Updated libtool support for libtool 1.5.8
Sam Lantinga <slouken@libsdl.org>
parents: 939
diff changeset
  1106
    while (test "X"`$SHELL [$]0 --fallback-echo "X$teststring" 2>/dev/null` \
3bb035750537 Updated libtool support for libtool 1.5.8
Sam Lantinga <slouken@libsdl.org>
parents: 939
diff changeset
  1107
	       = "XX$teststring") >/dev/null 2>&1 &&
3bb035750537 Updated libtool support for libtool 1.5.8
Sam Lantinga <slouken@libsdl.org>
parents: 939
diff changeset
  1108
	    new_result=`expr "X$teststring" : ".*" 2>&1` &&
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1109
	    lt_cv_sys_max_cmd_len=$new_result &&
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1110
	    test $i != 17 # 1/2 MB should be enough
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1111
    do
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1112
      i=`expr $i + 1`
947
3bb035750537 Updated libtool support for libtool 1.5.8
Sam Lantinga <slouken@libsdl.org>
parents: 939
diff changeset
  1113
      teststring=$teststring$teststring
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1114
    done
947
3bb035750537 Updated libtool support for libtool 1.5.8
Sam Lantinga <slouken@libsdl.org>
parents: 939
diff changeset
  1115
    teststring=
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1116
    # Add a significant safety factor because C++ compilers can tack on massive
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1117
    # amounts of additional arguments before passing them to the linker.
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1118
    # It appears as though 1/2 is a usable value.
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1119
    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1120
    ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1121
  esac
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1122
])
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1123
if test -n $lt_cv_sys_max_cmd_len ; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1124
  AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1125
else
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1126
  AC_MSG_RESULT(none)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1127
fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1128
])# AC_LIBTOOL_SYS_MAX_CMD_LEN
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1129
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1130
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1131
# _LT_AC_CHECK_DLFCN
1570
a740bca2a1b1 Updated to libtool-1.5.22
Sam Lantinga <slouken@libsdl.org>
parents: 1361
diff changeset
  1132
# ------------------
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1133
AC_DEFUN([_LT_AC_CHECK_DLFCN],
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1134
[AC_CHECK_HEADERS(dlfcn.h)dnl
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1135
])# _LT_AC_CHECK_DLFCN
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1136
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1137
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1138
# _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,