acinclude.m4
author Sam Lantinga <slouken@libsdl.org>
Thu, 06 May 2004 15:55:06 +0000
changeset 886 05c551e5bc64
parent 794 a5defa3b93e1
child 939 c7c04f811994
permissions -rw-r--r--
Date: Sat, 24 Apr 2004 15:13:32 +0300 From: "Mike Gorchak" Subject: SDL updates for the QNX6 1. Updated the README.QNX 2. Updated libtool scripts, which are shipped with SDL for QNX6 support. 3. Added some code to support the new QNX 6.3.0, which is in beta now. 4. Added code to detect the hw features, which driver supports. 5. Added hw alpha blits code. 6. Fixed bug when application switches to fullscreen more the 2 times. (afte\ r that window becames always stay on top). 7. Updated a bit README for the tests. 8. Added information about acceleration show in the testalpha.c test. 9. Added small fixes to the testoverlay2.c test. 10. Added alpha and cc+alpha blits benchmarks to the testvidinfo.c test.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
     1
# Local macros for the SDL configure.in script
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
     2
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
     3
dnl Function to link an architecture specific file
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
     4
dnl LINK_ARCH_SRC(source_dir, arch, source_file)
794
a5defa3b93e1 Updated for the latest version of automake
Sam Lantinga <slouken@libsdl.org>
parents: 730
diff changeset
     5
AC_DEFUN([COPY_ARCH_SRC],
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
     6
[
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
     7
  old="$srcdir/$1/$2/$3"
723
1e8865a3e127 Files now copied to build directory instead of source directory while configuring
Patrice Mandin <patmandin@gmail.com>
parents: 1
diff changeset
     8
  new="$1/$3"
1e8865a3e127 Files now copied to build directory instead of source directory while configuring
Patrice Mandin <patmandin@gmail.com>
parents: 1
diff changeset
     9
  if test ! -d $1; then
1e8865a3e127 Files now copied to build directory instead of source directory while configuring
Patrice Mandin <patmandin@gmail.com>
parents: 1
diff changeset
    10
    echo "Creating directory $1"
1e8865a3e127 Files now copied to build directory instead of source directory while configuring
Patrice Mandin <patmandin@gmail.com>
parents: 1
diff changeset
    11
    mkdir -p $1
1e8865a3e127 Files now copied to build directory instead of source directory while configuring
Patrice Mandin <patmandin@gmail.com>
parents: 1
diff changeset
    12
  fi
1e8865a3e127 Files now copied to build directory instead of source directory while configuring
Patrice Mandin <patmandin@gmail.com>
parents: 1
diff changeset
    13
  echo "Copying $old -> $new"
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    14
  cat >$new <<__EOF__
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    15
/* WARNING:  This file was automatically generated!
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    16
 * Original: $old
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    17
 */
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    18
__EOF__
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    19
  cat >>$new <$old
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    20
])
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    21
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    22
#
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    23
# --- esd.m4 ---
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    24
#
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    25
# Configure paths for ESD
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    26
# Manish Singh    98-9-30
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    27
# stolen back from Frank Belew
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    28
# stolen from Manish Singh
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    29
# Shamelessly stolen from Owen Taylor
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    30
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    31
dnl AM_PATH_ESD([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    32
dnl Test for ESD, and define ESD_CFLAGS and ESD_LIBS
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    33
dnl
794
a5defa3b93e1 Updated for the latest version of automake
Sam Lantinga <slouken@libsdl.org>
parents: 730
diff changeset
    34
AC_DEFUN([AM_PATH_ESD],
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    35
[dnl 
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    36
dnl Get the cflags and libraries from the esd-config script
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    37
dnl
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    38
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
    39
            esd_prefix="$withval", esd_prefix="")
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    40
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
    41
            esd_exec_prefix="$withval", esd_exec_prefix="")
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    42
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
    43
		    , enable_esdtest=yes)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    44
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    45
  if test x$esd_exec_prefix != x ; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    46
     esd_args="$esd_args --exec-prefix=$esd_exec_prefix"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    47
     if test x${ESD_CONFIG+set} != xset ; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    48
        ESD_CONFIG=$esd_exec_prefix/bin/esd-config
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    49
     fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    50
  fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    51
  if test x$esd_prefix != x ; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    52
     esd_args="$esd_args --prefix=$esd_prefix"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    53
     if test x${ESD_CONFIG+set} != xset ; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    54
        ESD_CONFIG=$esd_prefix/bin/esd-config
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    55
     fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    56
  fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    57
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    58
  AC_PATH_PROG(ESD_CONFIG, esd-config, no)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    59
  min_esd_version=ifelse([$1], ,0.2.7,$1)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    60
  AC_MSG_CHECKING(for ESD - version >= $min_esd_version)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    61
  no_esd=""
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    62
  if test "$ESD_CONFIG" = "no" ; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    63
    no_esd=yes
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    64
  else
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    65
    ESD_CFLAGS=`$ESD_CONFIG $esdconf_args --cflags`
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    66
    ESD_LIBS=`$ESD_CONFIG $esdconf_args --libs`
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    67
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    68
    esd_major_version=`$ESD_CONFIG $esd_args --version | \
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    69
           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    70
    esd_minor_version=`$ESD_CONFIG $esd_args --version | \
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    71
           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    72
    esd_micro_version=`$ESD_CONFIG $esd_config_args --version | \
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    73
           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    74
    if test "x$enable_esdtest" = "xyes" ; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    75
      ac_save_CFLAGS="$CFLAGS"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    76
      ac_save_LIBS="$LIBS"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    77
      CFLAGS="$CFLAGS $ESD_CFLAGS"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    78
      LIBS="$LIBS $ESD_LIBS"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    79
dnl
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    80
dnl Now check if the installed ESD is sufficiently new. (Also sanity
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    81
dnl checks the results of esd-config to some extent
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    82
dnl
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    83
      rm -f conf.esdtest
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    84
      AC_TRY_RUN([
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    85
#include <stdio.h>
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    86
#include <stdlib.h>
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    87
#include <string.h>
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    88
#include <esd.h>
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    89
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    90
char*
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    91
my_strdup (char *str)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    92
{
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    93
  char *new_str;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    94
  
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    95
  if (str)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    96
    {
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    97
      new_str = malloc ((strlen (str) + 1) * sizeof(char));
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    98
      strcpy (new_str, str);
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    99
    }
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   100
  else
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   101
    new_str = NULL;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   102
  
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   103
  return new_str;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   104
}
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   105
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   106
int main ()
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   107
{
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   108
  int major, minor, micro;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   109
  char *tmp_version;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   110
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   111
  system ("touch conf.esdtest");
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   112
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   113
  /* HP/UX 9 (%@#!) writes to sscanf strings */
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   114
  tmp_version = my_strdup("$min_esd_version");
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   115
  if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   116
     printf("%s, bad version string\n", "$min_esd_version");
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   117
     exit(1);
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   118
   }
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   119
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   120
   if (($esd_major_version > major) ||
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   121
      (($esd_major_version == major) && ($esd_minor_version > minor)) ||
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   122
      (($esd_major_version == major) && ($esd_minor_version == minor) && ($esd_micro_version >= micro)))
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   123
    {
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   124
      return 0;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   125
    }
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   126
  else
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   127
    {
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   128
      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
   129
      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
   130
      printf("*** best to upgrade to the required version.\n");
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   131
      printf("*** If esd-config was wrong, set the environment variable ESD_CONFIG\n");
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   132
      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
   133
      printf("*** config.cache before re-running configure\n");
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   134
      return 1;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   135
    }
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   136
}
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   137
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   138
],, no_esd=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   139
       CFLAGS="$ac_save_CFLAGS"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   140
       LIBS="$ac_save_LIBS"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   141
     fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   142
  fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   143
  if test "x$no_esd" = x ; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   144
     AC_MSG_RESULT(yes)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   145
     ifelse([$2], , :, [$2])     
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   146
  else
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   147
     AC_MSG_RESULT(no)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   148
     if test "$ESD_CONFIG" = "no" ; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   149
       echo "*** The esd-config script installed by ESD could not be found"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   150
       echo "*** If ESD was installed in PREFIX, make sure PREFIX/bin is in"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   151
       echo "*** your path, or set the ESD_CONFIG environment variable to the"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   152
       echo "*** full path to esd-config."
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   153
     else
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   154
       if test -f conf.esdtest ; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   155
        :
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   156
       else
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   157
          echo "*** Could not run ESD test program, checking why..."
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   158
          CFLAGS="$CFLAGS $ESD_CFLAGS"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   159
          LIBS="$LIBS $ESD_LIBS"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   160
          AC_TRY_LINK([
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   161
#include <stdio.h>
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   162
#include <esd.h>
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   163
],      [ return 0; ],
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   164
        [ echo "*** The test program compiled, but did not run. This usually means"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   165
          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
   166
          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
   167
          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
   168
          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
   169
          echo "*** is required on your system"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   170
	  echo "***"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   171
          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
   172
          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
   173
        [ 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
   174
          echo "*** exact error that occured. This usually means ESD was incorrectly installed"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   175
          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
   176
          echo "*** may want to edit the esd-config script: $ESD_CONFIG" ])
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   177
          CFLAGS="$ac_save_CFLAGS"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   178
          LIBS="$ac_save_LIBS"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   179
       fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   180
     fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   181
     ESD_CFLAGS=""
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   182
     ESD_LIBS=""
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   183
     ifelse([$3], , :, [$3])
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   184
  fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   185
  AC_SUBST(ESD_CFLAGS)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   186
  AC_SUBST(ESD_LIBS)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   187
  rm -f conf.esdtest
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   188
])
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   189
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   190
# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   191
## Copyright 1996, 1997, 1998, 1999, 2000, 2001
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   192
## Free Software Foundation, Inc.
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   193
## Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   194
##
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   195
## This program is free software; you can redistribute it and/or modify
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   196
## it under the terms of the GNU General Public License as published by
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   197
## the Free Software Foundation; either version 2 of the License, or
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   198
## (at your option) any later version.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   199
##
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   200
## This program is distributed in the hope that it will be useful, but
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   201
## WITHOUT ANY WARRANTY; without even the implied warranty of
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   202
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   203
## General Public License for more details.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   204
##
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   205
## You should have received a copy of the GNU General Public License
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   206
## along with this program; if not, write to the Free Software
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   207
## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   208
##
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   209
## As a special exception to the GNU General Public License, if you
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   210
## distribute this file as part of a program that contains a
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   211
## configuration script generated by Autoconf, you may include it under
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   212
## the same distribution terms that you use for the rest of that program.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   213
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   214
# serial 47 AC_PROG_LIBTOOL
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   215
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   216
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   217
# 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
   218
# -----------------------------------------------------------
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   219
# 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
   220
m4_ifdef([AC_PROVIDE_IFELSE],
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   221
         [],
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   222
         [m4_define([AC_PROVIDE_IFELSE],
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   223
	         [m4_ifdef([AC_PROVIDE_$1],
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   224
		           [$2], [$3])])])
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   225
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   226
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   227
# AC_PROG_LIBTOOL
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   228
# ---------------
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   229
AC_DEFUN([AC_PROG_LIBTOOL],
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   230
[AC_REQUIRE([_AC_PROG_LIBTOOL])dnl
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   231
dnl If AC_PROG_CXX has already been expanded, run AC_LIBTOOL_CXX
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   232
dnl immediately, otherwise, hook it in at the end of AC_PROG_CXX.
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   233
  AC_PROVIDE_IFELSE([AC_PROG_CXX],
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   234
    [AC_LIBTOOL_CXX],
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   235
    [define([AC_PROG_CXX], defn([AC_PROG_CXX])[AC_LIBTOOL_CXX
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   236
  ])])
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   237
dnl And a similar setup for Fortran 77 support
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   238
  AC_PROVIDE_IFELSE([AC_PROG_F77],
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   239
    [AC_LIBTOOL_F77],
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   240
    [define([AC_PROG_F77], defn([AC_PROG_F77])[AC_LIBTOOL_F77
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   241
])])
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   242
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   243
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
   244
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
   245
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
   246
  AC_PROVIDE_IFELSE([AC_PROG_GCJ],
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   247
    [AC_LIBTOOL_GCJ],
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   248
    [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   249
      [AC_LIBTOOL_GCJ],
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   250
      [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   251
	[AC_LIBTOOL_GCJ],
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   252
      [ifdef([AC_PROG_GCJ],
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   253
	     [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
   254
       ifdef([A][M_PROG_GCJ],
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   255
	     [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
   256
       ifdef([LT_AC_PROG_GCJ],
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   257
	     [define([LT_AC_PROG_GCJ],
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   258
		defn([LT_AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])])])
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   259
])])# AC_PROG_LIBTOOL
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   260
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   261
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   262
# _AC_PROG_LIBTOOL
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   263
# ----------------
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   264
AC_DEFUN([_AC_PROG_LIBTOOL],
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   265
[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   266
AC_BEFORE([$0],[AC_LIBTOOL_CXX])dnl
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   267
AC_BEFORE([$0],[AC_LIBTOOL_F77])dnl
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   268
AC_BEFORE([$0],[AC_LIBTOOL_GCJ])dnl
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   269
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   270
# 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
   271
LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh"
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   272
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   273
# Always use our own libtool.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   274
LIBTOOL='$(SHELL) $(top_builddir)/libtool'
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   275
AC_SUBST(LIBTOOL)dnl
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   276
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   277
# Prevent multiple expansion
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   278
define([AC_PROG_LIBTOOL], [])
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   279
])# _AC_PROG_LIBTOOL
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   280
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   281
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   282
# AC_LIBTOOL_SETUP
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   283
# ----------------
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   284
AC_DEFUN([AC_LIBTOOL_SETUP],
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   285
[AC_PREREQ(2.50)dnl
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   286
AC_REQUIRE([AC_ENABLE_SHARED])dnl
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   287
AC_REQUIRE([AC_ENABLE_STATIC])dnl
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   288
AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   289
AC_REQUIRE([AC_CANONICAL_HOST])dnl
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   290
AC_REQUIRE([AC_CANONICAL_BUILD])dnl
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   291
AC_REQUIRE([AC_PROG_CC])dnl
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   292
AC_REQUIRE([AC_PROG_LD])dnl
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   293
AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   294
AC_REQUIRE([AC_PROG_NM])dnl
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   295
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   296
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
   297
AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   298
# 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
   299
AC_REQUIRE([AC_OBJEXT])dnl
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   300
AC_REQUIRE([AC_EXEEXT])dnl
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   301
dnl
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   302
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   303
AC_LIBTOOL_SYS_MAX_CMD_LEN
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   304
AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   305
AC_LIBTOOL_OBJDIR
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   306
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   307
AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   308
_LT_AC_PROG_ECHO_BACKSLASH
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   309
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   310
case $host_os in
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   311
aix3*)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   312
  # 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
   313
  # 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
   314
  # vanish in a puff of smoke.
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   315
  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
   316
    COLLECT_NAMES=
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   317
    export COLLECT_NAMES
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   318
  fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   319
  ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   320
esac
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   321
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   322
# 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
   323
# metacharacters that are still active within double-quoted strings.
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   324
Xsed='sed -e s/^X//'
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   325
[sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g']
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   326
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   327
# 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
   328
[double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g']
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
# 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
   331
# double_quote_subst'ed string.
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   332
delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   333
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   334
# 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
   335
no_glob_subst='s/\*/\\\*/g'
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   336
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   337
# Constants:
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   338
rm="rm -f"
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
# Global variables:
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   341
default_ofile=libtool
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   342
can_build_shared=yes
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   343
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   344
# All known linkers require a `.a' archive for static linking (except M$VC,
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   345
# which needs '.lib').
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   346
libext=a
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   347
ltmain="$ac_aux_dir/ltmain.sh"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   348
ofile="$default_ofile"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   349
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
   350
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   351
AC_CHECK_TOOL(AR, ar, false)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   352
AC_CHECK_TOOL(RANLIB, ranlib, :)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   353
AC_CHECK_TOOL(STRIP, strip, :)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   354
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   355
old_CC="$CC"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   356
old_CFLAGS="$CFLAGS"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   357
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   358
# Set sane defaults for various variables
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   359
test -z "$AR" && AR=ar
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   360
test -z "$AR_FLAGS" && AR_FLAGS=cru
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   361
test -z "$AS" && AS=as
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   362
test -z "$CC" && CC=cc
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   363
test -z "$LTCC" && LTCC=$CC
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   364
test -z "$DLLTOOL" && DLLTOOL=dlltool
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   365
test -z "$LD" && LD=ld
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   366
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
   367
test -z "$MAGIC_CMD" && MAGIC_CMD=file
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   368
test -z "$NM" && NM=nm
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   369
test -z "$SED" && SED=sed
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   370
test -z "$OBJDUMP" && OBJDUMP=objdump
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   371
test -z "$RANLIB" && RANLIB=:
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   372
test -z "$STRIP" && STRIP=:
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   373
test -z "$ac_objext" && ac_objext=o
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
# 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
   376
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
   377
old_postinstall_cmds='chmod 644 $oldlib'
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   378
old_postuninstall_cmds=
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   379
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   380
if test -n "$RANLIB"; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   381
  case $host_os in
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   382
  openbsd*)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   383
    old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   384
    ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   385
  *)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   386
    old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   387
    ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   388
  esac
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   389
  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
   390
fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   391
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   392
# 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
   393
case $deplibs_check_method in
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   394
file_magic*)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   395
  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
   396
    AC_PATH_MAGIC
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   397
  fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   398
  ;;
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   399
esac
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   400
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   401
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
   402
AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL],
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   403
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
   404
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   405
AC_ARG_ENABLE([libtool-lock],
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   406
    [AC_HELP_STRING([--disable-libtool-lock],
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   407
	[avoid locking (might break parallel builds)])])
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   408
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
   409
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   410
AC_ARG_WITH([pic],
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   411
    [AC_HELP_STRING([--with-pic],
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   412
	[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
   413
    [pic_mode="$withval"],
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   414
    [pic_mode=default])
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   415
test -z "$pic_mode" && pic_mode=default
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   416
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   417
# 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
   418
tagname=
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   419
AC_LIBTOOL_LANG_C_CONFIG
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   420
_LT_AC_TAGCONFIG
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   421
])# AC_LIBTOOL_SETUP
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
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   424
# _LT_AC_SYS_COMPILER
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   425
# -------------------
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   426
AC_DEFUN([_LT_AC_SYS_COMPILER],
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   427
[AC_REQUIRE([AC_PROG_CC])dnl
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   428
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   429
# 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
   430
LTCC=${LTCC-"$CC"}
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   431
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   432
# 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
   433
compiler=$CC
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   434
])# _LT_AC_SYS_COMPILER
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   435
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   436
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   437
# _LT_AC_SYS_LIBPATH_AIX
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   438
# ----------------------
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   439
# 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
   440
# 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
   441
# 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
   442
# 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
   443
# 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
   444
# to the aix ld manual.
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   445
AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX],
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   446
[AC_LINK_IFELSE(AC_LANG_PROGRAM,[
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   447
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
   448
}'`
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   449
# 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
   450
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
   451
}'`; fi],[])
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   452
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
   453
])# _LT_AC_SYS_LIBPATH_AIX
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   454
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   455
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   456
# _LT_AC_SHELL_INIT(ARG)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   457
# ----------------------
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   458
AC_DEFUN([_LT_AC_SHELL_INIT],
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   459
[ifdef([AC_DIVERSION_NOTICE],
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   460
	     [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)],
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   461
	 [AC_DIVERT_PUSH(NOTICE)])
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   462
$1
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   463
AC_DIVERT_POP
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   464
])# _LT_AC_SHELL_INIT
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   465
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   466
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   467
# _LT_AC_PROG_ECHO_BACKSLASH
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   468
# --------------------------
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   469
# 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
   470
# 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
   471
AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH],
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   472
[_LT_AC_SHELL_INIT([
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   473
# 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
   474
SHELL=${CONFIG_SHELL-/bin/sh}
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   475
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   476
case X$ECHO in
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   477
X*--fallback-echo)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   478
  # 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
   479
  ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','`
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   480
  ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   481
esac
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   482
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   483
echo=${ECHO-echo}
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   484
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
   485
  # Discard the --no-reexec flag, and continue.
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   486
  shift
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   487
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
   488
  # 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
   489
  :
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   490
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
   491
  # Yippee, $echo works!
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   492
  :
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   493
else
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   494
  # Restart under the correct shell.
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   495
  exec $SHELL "[$]0" --no-reexec ${1+"[$]@"}
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   496
fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   497
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   498
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
   499
  # used as fallback echo
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   500
  shift
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   501
  cat <<EOF
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   502
[$]*
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   503
EOF
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   504
  exit 0
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   505
fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   506
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   507
# 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
   508
# if CDPATH is set.
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   509
if test "X${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   510
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   511
if test -z "$ECHO"; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   512
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
   513
# 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
   514
  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
   515
    # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   516
    if (echo_test_string="`eval $cmd`") 2>/dev/null &&
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   517
       echo_test_string="`eval $cmd`" &&
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   518
       (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
   519
    then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   520
      break
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   521
    fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   522
  done
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   523
fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   524
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   525
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
   526
   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
   527
   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
   528
  :
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   529
else
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   530
  # 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
   531
  # 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
   532
  #   echo "$something" | sed 's/\\/\\\\/g'
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   533
  #
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   534
  # 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
   535
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   536
  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   537
  for dir in $PATH /usr/ucb; do
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   538
    IFS="$lt_save_ifs"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   539
    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
   540
       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
   541
       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
   542
       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
   543
      echo="$dir/echo"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   544
      break
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   545
    fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   546
  done
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   547
  IFS="$lt_save_ifs"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   548
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   549
  if test "X$echo" = Xecho; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   550
    # 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
   551
    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
   552
       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
   553
       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
   554
      # 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
   555
      echo='print -r'
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   556
    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
   557
	 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
   558
      # 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
   559
      ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   560
      export ORIGINAL_CONFIG_SHELL
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   561
      CONFIG_SHELL=/bin/ksh
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   562
      export CONFIG_SHELL
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   563
      exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"}
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   564
    else
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   565
      # Try using printf.
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   566
      echo='printf %s\n'
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   567
      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
   568
	 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
   569
	 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
   570
	# Cool, printf works
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   571
	:
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   572
      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
   573
	   test "X$echo_testing_string" = 'X\t' &&
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   574
	   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
   575
	   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
   576
	CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   577
	export CONFIG_SHELL
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   578
	SHELL="$CONFIG_SHELL"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   579
	export SHELL
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   580
	echo="$CONFIG_SHELL [$]0 --fallback-echo"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   581
      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
   582
	   test "X$echo_testing_string" = 'X\t' &&
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   583
	   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
   584
	   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
   585
	echo="$CONFIG_SHELL [$]0 --fallback-echo"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   586
      else
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   587
	# maybe with a smaller string...
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   588
	prev=:
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   589
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   590
	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
   591
	  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
   592
	  then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   593
	    break
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   594
	  fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   595
	  prev="$cmd"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   596
	done
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   597
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   598
	if test "$prev" != 'sed 50q "[$]0"'; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   599
	  echo_test_string=`eval $prev`
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   600
	  export echo_test_string
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   601
	  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
   602
	else
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   603
	  # 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
   604
	  echo=echo
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   605
	fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   606
      fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   607
    fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   608
  fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   609
fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   610
fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   611
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   612
# 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
   613
# 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
   614
ECHO=$echo
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   615
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
   616
   ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   617
fi
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_SUBST(ECHO)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   620
])])# _LT_AC_PROG_ECHO_BACKSLASH
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   621
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   622
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   623
# _LT_AC_LOCK
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   624
# -----------
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   625
AC_DEFUN([_LT_AC_LOCK],
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   626
[AC_ARG_ENABLE([libtool-lock],
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   627
    [AC_HELP_STRING([--disable-libtool-lock],
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   628
	[avoid locking (might break parallel builds)])])
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   629
test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   630
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   631
# Some flags need to be propagated to the compiler or linker for good
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   632
# libtool support.
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   633
case $host in
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   634
ia64-*-hpux*)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   635
  # Find out which ABI we are using.
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   636
  echo 'int i;' > conftest.$ac_ext
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   637
  if AC_TRY_EVAL(ac_compile); then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   638
    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
   639
    *ELF-32*)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   640
      HPUX_IA64_MODE="32"
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
    *ELF-64*)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   643
      HPUX_IA64_MODE="64"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   644
      ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   645
    esac
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   646
  fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   647
  rm -rf conftest*
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   648
  ;;
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   649
*-*-irix6*)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   650
  # Find out which ABI we are using.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   651
  echo '[#]line __oline__ "configure"' > conftest.$ac_ext
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   652
  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
   653
   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
   654
    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
   655
    *32-bit*)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   656
      LD="${LD-ld} -melf32bsmip"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   657
      ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   658
    *N32*)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   659
      LD="${LD-ld} -melf32bmipn32"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   660
      ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   661
    *64-bit*)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   662
      LD="${LD-ld} -melf64bmip"
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
    esac
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   665
   else
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   666
    case `/usr/bin/file conftest.$ac_objext` in
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   667
    *32-bit*)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   668
      LD="${LD-ld} -32"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   669
      ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   670
    *N32*)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   671
      LD="${LD-ld} -n32"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   672
      ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   673
    *64-bit*)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   674
      LD="${LD-ld} -64"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   675
      ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   676
    esac
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   677
   fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   678
  fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   679
  rm -rf conftest*
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   680
  ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   681
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   682
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
   683
  # Find out which ABI we are using.
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   684
  echo 'int i;' > conftest.$ac_ext
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   685
  if AC_TRY_EVAL(ac_compile); then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   686
    case "`/usr/bin/file conftest.o`" in
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   687
    *32-bit*)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   688
      case $host in
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   689
        x86_64-*linux*)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   690
          LD="${LD-ld} -m elf_i386"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   691
          ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   692
        ppc64-*linux*)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   693
          LD="${LD-ld} -m elf32ppclinux"
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
        s390x-*linux*)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   696
          LD="${LD-ld} -m elf_s390"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   697
          ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   698
        sparc64-*linux*)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   699
          LD="${LD-ld} -m elf32_sparc"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   700
          ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   701
      esac
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   702
      ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   703
    *64-bit*)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   704
      case $host in
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   705
        x86_64-*linux*)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   706
          LD="${LD-ld} -m elf_x86_64"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   707
          ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   708
        ppc*-*linux*|powerpc*-*linux*)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   709
          LD="${LD-ld} -m elf64ppc"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   710
          ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   711
        s390*-*linux*)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   712
          LD="${LD-ld} -m elf64_s390"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   713
          ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   714
        sparc*-*linux*)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   715
          LD="${LD-ld} -m elf64_sparc"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   716
          ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   717
      esac
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   718
      ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   719
    esac
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   720
  fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   721
  rm -rf conftest*
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   722
  ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   723
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   724
*-*-sco3.2v5*)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   725
  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   726
  SAVE_CFLAGS="$CFLAGS"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   727
  CFLAGS="$CFLAGS -belf"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   728
  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
   729
    [AC_LANG_PUSH(C)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   730
     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
   731
     AC_LANG_POP])
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   732
  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   733
    # 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
   734
    CFLAGS="$SAVE_CFLAGS"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   735
  fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   736
  ;;
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   737
AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL],
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   738
[*-*-cygwin* | *-*-mingw* | *-*-pw32*)
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   739
  AC_CHECK_TOOL(DLLTOOL, dlltool, false)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   740
  AC_CHECK_TOOL(AS, as, false)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   741
  AC_CHECK_TOOL(OBJDUMP, objdump, false)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   742
  ;;
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   743
  ])
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   744
esac
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   745
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   746
need_locks="$enable_libtool_lock"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   747
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   748
])# _LT_AC_LOCK
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   749
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
# 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
   752
#		[OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   753
# ----------------------------------------------------------------
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   754
# Check whether the given compiler option works
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   755
AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION],
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   756
[AC_CACHE_CHECK([$1], [$2],
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   757
  [$2=no
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   758
  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
   759
   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
   760
   lt_compiler_flag="$3"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   761
   # 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
   762
   # (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
   763
   # 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
   764
   # 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
   765
   # 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
   766
   lt_compile=`echo "$ac_compile" | $SED \
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   767
   -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   768
   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   769
   -e 's:$: $lt_compiler_flag:'`
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   770
   (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
   771
   (eval "$lt_compile" 2>conftest.err)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   772
   ac_status=$?
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   773
   cat conftest.err >&AS_MESSAGE_LOG_FD
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   774
   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
   775
   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
   776
     # The compiler can only warn and ignore the option if not recognized
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   777
     # So say no if there are warnings
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   778
     if test ! -s conftest.err; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   779
       $2=yes
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   780
     fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   781
   fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   782
   $rm conftest*
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   783
])
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   784
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   785
if test x"[$]$2" = xyes; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   786
    ifelse([$5], , :, [$5])
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   787
else
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   788
    ifelse([$6], , :, [$6])
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   789
fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   790
])# AC_LIBTOOL_COMPILER_OPTION
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   791
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   792
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   793
# 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
   794
#                          [ACTION-SUCCESS], [ACTION-FAILURE])
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   795
# ------------------------------------------------------------
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   796
# Check whether the given compiler option works
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   797
AC_DEFUN([AC_LIBTOOL_LINKER_OPTION],
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   798
[AC_CACHE_CHECK([$1], [$2],
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   799
  [$2=no
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   800
   save_LDFLAGS="$LDFLAGS"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   801
   LDFLAGS="$LDFLAGS $3"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   802
   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
   803
   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   804
     # The compiler can only warn and ignore the option if not recognized
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   805
     # So say no if there are warnings
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   806
     if test -s conftest.err; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   807
       # Append any errors to the config.log.
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   808
       cat conftest.err 1>&AS_MESSAGE_LOG_FD
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   809
     else
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   810
       $2=yes
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   811
     fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   812
   fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   813
   $rm conftest*
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   814
   LDFLAGS="$save_LDFLAGS"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   815
])
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   816
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   817
if test x"[$]$2" = xyes; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   818
    ifelse([$4], , :, [$4])
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   819
else
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   820
    ifelse([$5], , :, [$5])
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   821
fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   822
])# AC_LIBTOOL_LINKER_OPTION
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   823
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
# AC_LIBTOOL_SYS_MAX_CMD_LEN
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   826
# --------------------------
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   827
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
   828
[# 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
   829
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
   830
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
   831
  i=0
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   832
  testring="ABCD"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   833
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   834
  case $build_os in
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   835
  msdosdjgpp*)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   836
    # 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
   837
    # (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
   838
    # 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
   839
    # 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
   840
    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
   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
  gnu*)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   844
    # 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
   845
    # 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
   846
    # 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
   847
    lt_cv_sys_max_cmd_len=-1;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   848
    ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   849
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   850
  cygwin* | mingw*)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   851
    # 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
   852
    # 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
   853
    # 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
   854
    # 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
   855
    # 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
   856
    # 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
   857
    # 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
   858
    lt_cv_sys_max_cmd_len=8192;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   859
    ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   860
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
    # 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
   863
    # 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
   864
    # we can't tell.
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   865
    while (test "X"`$CONFIG_SHELL [$]0 --fallback-echo "X$testring" 2>/dev/null` \
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   866
	       = "XX$testring") >/dev/null 2>&1 &&
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   867
	    new_result=`expr "X$testring" : ".*" 2>&1` &&
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   868
	    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
   869
	    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
   870
    do
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   871
      i=`expr $i + 1`
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   872
      testring=$testring$testring
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   873
    done
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   874
    testring=
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   875
    # 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
   876
    # 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
   877
    # 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
   878
    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
   879
    ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   880
  esac
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   881
])
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   882
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
   883
  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
   884
else
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   885
  AC_MSG_RESULT(none)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   886
fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   887
])# AC_LIBTOOL_SYS_MAX_CMD_LEN
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   888
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   889
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   890
# _LT_AC_CHECK_DLFCN
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   891
# --------------------
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   892
AC_DEFUN([_LT_AC_CHECK_DLFCN],
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   893
[AC_CHECK_HEADERS(dlfcn.h)dnl
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   894
])# _LT_AC_CHECK_DLFCN
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   895
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   896
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   897
# _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   898
#                           ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   899
# ------------------------------------------------------------------
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   900
AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF],
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   901
[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   902
if test "$cross_compiling" = yes; then :
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   903
  [$4]
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   904
else
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   905
  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   906
  lt_status=$lt_dlunknown
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   907
  cat > conftest.$ac_ext <<EOF
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   908
[#line __oline__ "configure"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   909
#include "confdefs.h"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   910
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   911
#if HAVE_DLFCN_H
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   912
#include <dlfcn.h>
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   913
#endif
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   914
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   915
#include <stdio.h>
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   916
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   917
#ifdef RTLD_GLOBAL
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   918
#  define LT_DLGLOBAL		RTLD_GLOBAL
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   919
#else
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   920
#  ifdef DL_GLOBAL
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   921
#    define LT_DLGLOBAL		DL_GLOBAL
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   922
#  else
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   923
#    define LT_DLGLOBAL		0
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   924
#  endif
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   925
#endif
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
/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   928
   find out it does not work in some platform. */
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   929
#ifndef LT_DLLAZY_OR_NOW
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   930
#  ifdef RTLD_LAZY
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   931
#    define LT_DLLAZY_OR_NOW		RTLD_LAZY
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   932
#  else
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   933
#    ifdef DL_LAZY
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   934
#      define LT_DLLAZY_OR_NOW		DL_LAZY
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   935
#    else
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   936
#      ifdef RTLD_NOW
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   937
#        define LT_DLLAZY_OR_NOW	RTLD_NOW
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   938
#      else
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   939
#        ifdef DL_NOW
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   940
#          define LT_DLLAZY_OR_NOW	DL_NOW
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   941
#        else
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   942
#          define LT_DLLAZY_OR_NOW	0
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   943
#        endif
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   944
#      endif
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   945
#    endif
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   946
#  endif
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   947
#endif
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   948
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   949
#ifdef __cplusplus
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   950
extern "C" void exit (int);
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   951
#endif
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   952
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   953
void fnord() { int i=42;}
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   954
int main ()
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   955
{
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   956
  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   957
  int status = $lt_dlunknown;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   958
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   959
  if (self)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   960
    {
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   961
      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   962
      else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   963
      /* dlclose (self); */
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
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   966
    exit (status);
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   967
}]
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   968
EOF
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   969
  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   970
    (./conftest; exit; ) 2>/dev/null
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   971
    lt_status=$?
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   972
    case x$lt_status in
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   973
      x$lt_dlno_uscore) $1 ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   974
      x$lt_dlneed_uscore) $2 ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   975
      x$lt_unknown|x*) $3 ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   976
    esac
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   977
  else :
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   978
    # compilation failed
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   979
    $3
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   980
  fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   981
fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   982
rm -fr conftest*
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   983
])# _LT_AC_TRY_DLOPEN_SELF
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   984
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   985
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   986
# AC_LIBTOOL_DLOPEN_SELF
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   987
# -------------------
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   988
AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF],
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   989
[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   990
if test "x$enable_dlopen" != xyes; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   991
  enable_dlopen=unknown
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   992
  enable_dlopen_self=unknown
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   993
  enable_dlopen_self_static=unknown
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
  lt_cv_dlopen=no
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   996
  lt_cv_dlopen_libs=
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   997
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   998
  case $host_os in
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
   999
  beos*)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1000
    lt_cv_dlopen="load_add_on"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1001
    lt_cv_dlopen_libs=
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1002
    lt_cv_dlopen_self=yes
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1003
    ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1004
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1005
  mingw* | pw32*)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1006
    lt_cv_dlopen="LoadLibrary"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1007
    lt_cv_dlopen_libs=
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
  cygwin*)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1011
    lt_cv_dlopen="dlopen"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1012
    lt_cv_dlopen_libs=
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1013
   ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1014
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1015
  darwin*)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1016
  # if libdl is installed we need to link against it
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1017
    AC_CHECK_LIB([dl], [dlopen],
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1018
		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1019
    lt_cv_dlopen="dyld"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1020
    lt_cv_dlopen_libs=
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1021
    lt_cv_dlopen_self=yes
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1022
    ])
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1023
   ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1024
    
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1025
  *)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1026
    AC_CHECK_FUNC([shl_load],
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1027
	  [lt_cv_dlopen="shl_load"],
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1028
      [AC_CHECK_LIB([dld], [shl_load],
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1029
	    [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"],
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1030
	[AC_CHECK_FUNC([dlopen],
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1031
	      [lt_cv_dlopen="dlopen"],
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1032
	  [AC_CHECK_LIB([dl], [dlopen],
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1033
		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1034
	    [AC_CHECK_LIB([svld], [dlopen],
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1035
		  [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1036
	      [AC_CHECK_LIB([dld], [dld_link],
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1037
		    [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"])
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1038
	      ])
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1039
	    ])
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1040
	  ])
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1041
	])
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1042
      ])
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1043
    ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1044
  esac
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1045
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1046
  if test "x$lt_cv_dlopen" != xno; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1047
    enable_dlopen=yes
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1048
  else
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1049
    enable_dlopen=no
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1050
  fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1051
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1052
  case $lt_cv_dlopen in
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1053
  dlopen)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1054
    save_CPPFLAGS="$CPPFLAGS"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1055
    test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1056
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1057
    save_LDFLAGS="$LDFLAGS"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1058
    eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1059
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1060
    save_LIBS="$LIBS"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1061
    LIBS="$lt_cv_dlopen_libs $LIBS"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1062
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1063
    AC_CACHE_CHECK([whether a program can dlopen itself],
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1064
	  lt_cv_dlopen_self, [dnl
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1065
	  _LT_AC_TRY_DLOPEN_SELF(
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1066
	    lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1067
	    lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1068
    ])
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1069
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1070
    if test "x$lt_cv_dlopen_self" = xyes; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1071
      LDFLAGS="$LDFLAGS $link_static_flag"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1072
      AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1073
    	  lt_cv_dlopen_self_static, [dnl
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1074
	  _LT_AC_TRY_DLOPEN_SELF(
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1075
	    lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1076
	    lt_cv_dlopen_self_static=no,  lt_cv_dlopen_self_static=cross)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1077
      ])
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1078
    fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1079
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1080
    CPPFLAGS="$save_CPPFLAGS"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1081
    LDFLAGS="$save_LDFLAGS"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1082
    LIBS="$save_LIBS"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1083
    ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1084
  esac
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1085
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1086
  case $lt_cv_dlopen_self in
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1087
  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1088
  *) enable_dlopen_self=unknown ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1089
  esac
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1090
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1091
  case $lt_cv_dlopen_self_static in
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1092
  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1093
  *) enable_dlopen_self_static=unknown ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1094
  esac
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1095
fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1096
])# AC_LIBTOOL_DLOPEN_SELF
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1097
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1098
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1099
# AC_LIBTOOL_PROG_CC_C_O([TAGNAME])
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1100
# ---------------------------------
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1101
# Check to see if options -c and -o are simultaneously supported by compiler
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1102
AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O],
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1103
[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1104
AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1105
  [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1106
  [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1107
   $rm -r conftest 2>/dev/null
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1108
   mkdir conftest
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1109
   cd conftest
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1110
   mkdir out
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1111
   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
  1112
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1113
   # According to Tom Tromey, Ian Lance Taylor reported there are C compilers
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1114
   # that will create temporary files in the current directory regardless of
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1115
   # the output directory.  Thus, making CWD read-only will cause this test
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1116
   # to fail, enabling locking or at least warning the user not to do parallel
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1117
   # builds.
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1118
   chmod -w .
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1119
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1120
   lt_compiler_flag="-o out/conftest2.$ac_objext"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1121
   # 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
  1122
   # (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
  1123
   # 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
  1124
   # 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
  1125
   lt_compile=`echo "$ac_compile" | $SED \
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1126
   -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1127
   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1128
   -e 's:$: $lt_compiler_flag:'`
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1129
   (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
  1130
   (eval "$lt_compile" 2>out/conftest.err)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1131
   ac_status=$?
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1132
   cat out/conftest.err >&AS_MESSAGE_LOG_FD
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1133
   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
  1134
   if (exit $ac_status) && test -s out/conftest2.$ac_objext
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1135
   then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1136
     # The compiler can only warn and ignore the option if not recognized
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1137
     # So say no if there are warnings
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1138
     if test ! -s out/conftest.err; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1139
       _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1140
     fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1141
   fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1142
   chmod u+w .
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1143
   $rm conftest* out/*
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1144
   rmdir out
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 723
diff changeset
  1145
   cd .