configure.in
author Ryan C. Gordon <icculus@icculus.org>
Tue, 20 Aug 2013 19:57:11 -0400
changeset 7667 be1cc6f55840
parent 7659 ac4ce59c40e7
child 7669 d0dcdb5b143c
permissions -rw-r--r--
Added SDL_GetBasePath() and SDL_GetPrefPath() in new filesystem module.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
     1
dnl Process this file with autoconf to produce a configure script.
7222
2435b221d77d Renamed documentation files to .txt and converted them to DOS line endings so they would open properly on all systems.
Sam Lantinga <slouken@libsdl.org>
parents: 7204
diff changeset
     2
AC_INIT(README.txt)
6235
d169541f5049 Switched back to configure generating SDL_config.h
Sam Lantinga <slouken@libsdl.org>
parents: 6219
diff changeset
     3
AC_CONFIG_HEADER(include/SDL_config.h)
6086
45d22791e77c Fixed the aux directory to be the one recognized by automake.
Sam Lantinga <slouken@libsdl.org>
parents: 5989
diff changeset
     4
AC_CONFIG_AUX_DIR(build-scripts)
5548
8f0abb6ef37d Updated configure.in to be compatible with autoconf 2.67.
Ryan C. Gordon <icculus@icculus.org>
parents: 5512
diff changeset
     5
AC_CONFIG_MACRO_DIR([acinclude])
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
     6
3382
294fb5e6f301 A better solution to making the default build optimization -O3
Sam Lantinga <slouken@libsdl.org>
parents: 3372
diff changeset
     7
dnl Save the CFLAGS to see whether they were passed in or generated
294fb5e6f301 A better solution to making the default build optimization -O3
Sam Lantinga <slouken@libsdl.org>
parents: 3372
diff changeset
     8
orig_CFLAGS="$CFLAGS"
294fb5e6f301 A better solution to making the default build optimization -O3
Sam Lantinga <slouken@libsdl.org>
parents: 3372
diff changeset
     9
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    10
dnl Set various version strings - taken gratefully from the GTk sources
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    11
#
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    12
# Making releases:
6250
cce0ddcf6747 Updated to SDL 2.0, and SDL 2.0 can now be installed coexisting with SDL 1.2
Sam Lantinga <slouken@libsdl.org>
parents: 6235
diff changeset
    13
# Edit include/SDL_version.h and change the version, then:
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    14
#   SDL_MICRO_VERSION += 1;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    15
#   SDL_INTERFACE_AGE += 1;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    16
#   SDL_BINARY_AGE += 1;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    17
# if any functions have been added, set SDL_INTERFACE_AGE to 0.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    18
# if backwards compatibility has been broken,
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    19
# set SDL_BINARY_AGE and SDL_INTERFACE_AGE to 0.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    20
#
6250
cce0ddcf6747 Updated to SDL 2.0, and SDL 2.0 can now be installed coexisting with SDL 1.2
Sam Lantinga <slouken@libsdl.org>
parents: 6235
diff changeset
    21
SDL_MAJOR_VERSION=2
cce0ddcf6747 Updated to SDL 2.0, and SDL 2.0 can now be installed coexisting with SDL 1.2
Sam Lantinga <slouken@libsdl.org>
parents: 6235
diff changeset
    22
SDL_MINOR_VERSION=0
1895
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1891
diff changeset
    23
SDL_MICRO_VERSION=0
1886
44635227a939 Updated the version to 1.2.11
Sam Lantinga <slouken@libsdl.org>
parents: 1879
diff changeset
    24
SDL_INTERFACE_AGE=0
1895
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1891
diff changeset
    25
SDL_BINARY_AGE=0
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    26
SDL_VERSION=$SDL_MAJOR_VERSION.$SDL_MINOR_VERSION.$SDL_MICRO_VERSION
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    27
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    28
AC_SUBST(SDL_MAJOR_VERSION)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    29
AC_SUBST(SDL_MINOR_VERSION)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    30
AC_SUBST(SDL_MICRO_VERSION)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    31
AC_SUBST(SDL_INTERFACE_AGE)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    32
AC_SUBST(SDL_BINARY_AGE)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    33
AC_SUBST(SDL_VERSION)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    34
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    35
# libtool versioning
3085
4800979de337 Updated libtool from version 1.5.22 to 2.2.6a, so it works on current QNX
Sam Lantinga <slouken@libsdl.org>
parents: 3083
diff changeset
    36
LT_INIT([win32-dll])
4800979de337 Updated libtool from version 1.5.22 to 2.2.6a, so it works on current QNX
Sam Lantinga <slouken@libsdl.org>
parents: 3083
diff changeset
    37
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    38
LT_RELEASE=$SDL_MAJOR_VERSION.$SDL_MINOR_VERSION
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    39
LT_CURRENT=`expr $SDL_MICRO_VERSION - $SDL_INTERFACE_AGE`
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    40
LT_REVISION=$SDL_INTERFACE_AGE
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    41
LT_AGE=`expr $SDL_BINARY_AGE - $SDL_INTERFACE_AGE`
3368
ca6f355e44b2 Fixed bug #833
Sam Lantinga <slouken@libsdl.org>
parents: 3358
diff changeset
    42
m4_pattern_allow([^LT_])
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    43
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    44
AC_SUBST(LT_RELEASE)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    45
AC_SUBST(LT_CURRENT)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    46
AC_SUBST(LT_REVISION)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    47
AC_SUBST(LT_AGE)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    48
1550
31c2b8e4885e Fixed bug #166
Sam Lantinga <slouken@libsdl.org>
parents: 1548
diff changeset
    49
dnl Detect the canonical build and host environments
3368
ca6f355e44b2 Fixed bug #833
Sam Lantinga <slouken@libsdl.org>
parents: 3358
diff changeset
    50
dnl AC_CANONICAL_HOST
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    51
3332
da1cb54d74ef You should check for the C compiler before you set CFLAGS. :)
Sam Lantinga <slouken@libsdl.org>
parents: 3307
diff changeset
    52
dnl Check for tools
da1cb54d74ef You should check for the C compiler before you set CFLAGS. :)
Sam Lantinga <slouken@libsdl.org>
parents: 3307
diff changeset
    53
AC_PROG_LIBTOOL
da1cb54d74ef You should check for the C compiler before you set CFLAGS. :)
Sam Lantinga <slouken@libsdl.org>
parents: 3307
diff changeset
    54
AC_PROG_CC
da1cb54d74ef You should check for the C compiler before you set CFLAGS. :)
Sam Lantinga <slouken@libsdl.org>
parents: 3307
diff changeset
    55
AC_PROG_CXX
da1cb54d74ef You should check for the C compiler before you set CFLAGS. :)
Sam Lantinga <slouken@libsdl.org>
parents: 3307
diff changeset
    56
AC_PROG_INSTALL
da1cb54d74ef You should check for the C compiler before you set CFLAGS. :)
Sam Lantinga <slouken@libsdl.org>
parents: 3307
diff changeset
    57
AC_PROG_MAKE_SET
5888
cff0278fa1f8 Fixed Win64 builds with MingW.
Ryan C. Gordon <icculus@icculus.org>
parents: 5876
diff changeset
    58
AC_CHECK_TOOL(WINDRES, [windres], [:])
3332
da1cb54d74ef You should check for the C compiler before you set CFLAGS. :)
Sam Lantinga <slouken@libsdl.org>
parents: 3307
diff changeset
    59
7379
b27c778a2bdb Make sure that srcdir has a full pathname so source indexing works.
Sam Lantinga <slouken@libsdl.org>
parents: 7367
diff changeset
    60
dnl Make sure that srcdir is a full pathname
7573
b76d8bfe9a2f Fixed bug 1972 - Changeset 7379 (b27c778a2bdb) breaks make process with msys+mingw (make 3.82.90)
Sam Lantinga <slouken@libsdl.org>
parents: 7554
diff changeset
    61
case "$host" in
b76d8bfe9a2f Fixed bug 1972 - Changeset 7379 (b27c778a2bdb) breaks make process with msys+mingw (make 3.82.90)
Sam Lantinga <slouken@libsdl.org>
parents: 7554
diff changeset
    62
    *-*-mingw32*)
b76d8bfe9a2f Fixed bug 1972 - Changeset 7379 (b27c778a2bdb) breaks make process with msys+mingw (make 3.82.90)
Sam Lantinga <slouken@libsdl.org>
parents: 7554
diff changeset
    63
        # Except on msys, where make can't handle full pathnames (bug 1972)
b76d8bfe9a2f Fixed bug 1972 - Changeset 7379 (b27c778a2bdb) breaks make process with msys+mingw (make 3.82.90)
Sam Lantinga <slouken@libsdl.org>
parents: 7554
diff changeset
    64
        ;;
b76d8bfe9a2f Fixed bug 1972 - Changeset 7379 (b27c778a2bdb) breaks make process with msys+mingw (make 3.82.90)
Sam Lantinga <slouken@libsdl.org>
parents: 7554
diff changeset
    65
    *)
b76d8bfe9a2f Fixed bug 1972 - Changeset 7379 (b27c778a2bdb) breaks make process with msys+mingw (make 3.82.90)
Sam Lantinga <slouken@libsdl.org>
parents: 7554
diff changeset
    66
        srcdir=`cd $srcdir && pwd`
b76d8bfe9a2f Fixed bug 1972 - Changeset 7379 (b27c778a2bdb) breaks make process with msys+mingw (make 3.82.90)
Sam Lantinga <slouken@libsdl.org>
parents: 7554
diff changeset
    67
        ;;
b76d8bfe9a2f Fixed bug 1972 - Changeset 7379 (b27c778a2bdb) breaks make process with msys+mingw (make 3.82.90)
Sam Lantinga <slouken@libsdl.org>
parents: 7554
diff changeset
    68
esac
7379
b27c778a2bdb Make sure that srcdir has a full pathname so source indexing works.
Sam Lantinga <slouken@libsdl.org>
parents: 7367
diff changeset
    69
1389
ce65f014190a Fixed X11 library detection
Sam Lantinga <slouken@libsdl.org>
parents: 1384
diff changeset
    70
dnl Set up the compiler and linker flags
1571
0160eb7cccee Add /usr/local to the build paths by default
Sam Lantinga <slouken@libsdl.org>
parents: 1569
diff changeset
    71
INCLUDE="-I$srcdir/include"
1373
04499d3e1b6b *** empty log message ***
Sam Lantinga <slouken@libsdl.org>
parents: 1370
diff changeset
    72
if test x$srcdir != x.; then
1571
0160eb7cccee Add /usr/local to the build paths by default
Sam Lantinga <slouken@libsdl.org>
parents: 1569
diff changeset
    73
    INCLUDE="-Iinclude $INCLUDE"
6217
6952b11b7f46 Make sure that we use consistent configuration options on platforms like Windows so that command line builds and IDE builds have ABI compatibility.
Sam Lantinga <slouken@libsdl.org>
parents: 6188
diff changeset
    74
elif test -d .hg; then
6952b11b7f46 Make sure that we use consistent configuration options on platforms like Windows so that command line builds and IDE builds have ABI compatibility.
Sam Lantinga <slouken@libsdl.org>
parents: 6188
diff changeset
    75
    AC_MSG_ERROR([
6952b11b7f46 Make sure that we use consistent configuration options on platforms like Windows so that command line builds and IDE builds have ABI compatibility.
Sam Lantinga <slouken@libsdl.org>
parents: 6188
diff changeset
    76
*** When building from Mercurial you should configure and build in a
6235
d169541f5049 Switched back to configure generating SDL_config.h
Sam Lantinga <slouken@libsdl.org>
parents: 6219
diff changeset
    77
    separate directory so you don't clobber SDL_config.h, SDL_revision.h
6217
6952b11b7f46 Make sure that we use consistent configuration options on platforms like Windows so that command line builds and IDE builds have ABI compatibility.
Sam Lantinga <slouken@libsdl.org>
parents: 6188
diff changeset
    78
])
1373
04499d3e1b6b *** empty log message ***
Sam Lantinga <slouken@libsdl.org>
parents: 1370
diff changeset
    79
fi
7498
bda3639deecc Fixed building with cygwin
Sam Lantinga <slouken@libsdl.org>
parents: 7494
diff changeset
    80
BASE_CFLAGS=""
bda3639deecc Fixed building with cygwin
Sam Lantinga <slouken@libsdl.org>
parents: 7494
diff changeset
    81
BASE_LDFLAGS=""
1550
31c2b8e4885e Fixed bug #166
Sam Lantinga <slouken@libsdl.org>
parents: 1548
diff changeset
    82
case "$host" in
1389
ce65f014190a Fixed X11 library detection
Sam Lantinga <slouken@libsdl.org>
parents: 1384
diff changeset
    83
    *-*-cygwin*)
ce65f014190a Fixed X11 library detection
Sam Lantinga <slouken@libsdl.org>
parents: 1384
diff changeset
    84
        # We build SDL on cygwin without the UNIX emulation layer
7498
bda3639deecc Fixed building with cygwin
Sam Lantinga <slouken@libsdl.org>
parents: 7494
diff changeset
    85
        save_CFLAGS="$CFLAGS"
bda3639deecc Fixed building with cygwin
Sam Lantinga <slouken@libsdl.org>
parents: 7494
diff changeset
    86
        have_no_cygwin=no
bda3639deecc Fixed building with cygwin
Sam Lantinga <slouken@libsdl.org>
parents: 7494
diff changeset
    87
        AC_MSG_CHECKING(for GCC -mno-cygwin option)
bda3639deecc Fixed building with cygwin
Sam Lantinga <slouken@libsdl.org>
parents: 7494
diff changeset
    88
        CFLAGS="$save_CFLAGS -mno-cygwin"
bda3639deecc Fixed building with cygwin
Sam Lantinga <slouken@libsdl.org>
parents: 7494
diff changeset
    89
bda3639deecc Fixed building with cygwin
Sam Lantinga <slouken@libsdl.org>
parents: 7494
diff changeset
    90
        AC_TRY_COMPILE([
bda3639deecc Fixed building with cygwin
Sam Lantinga <slouken@libsdl.org>
parents: 7494
diff changeset
    91
        ],[
bda3639deecc Fixed building with cygwin
Sam Lantinga <slouken@libsdl.org>
parents: 7494
diff changeset
    92
        ],[
bda3639deecc Fixed building with cygwin
Sam Lantinga <slouken@libsdl.org>
parents: 7494
diff changeset
    93
        have_no_cygwin=yes
bda3639deecc Fixed building with cygwin
Sam Lantinga <slouken@libsdl.org>
parents: 7494
diff changeset
    94
        ])
bda3639deecc Fixed building with cygwin
Sam Lantinga <slouken@libsdl.org>
parents: 7494
diff changeset
    95
        AC_MSG_RESULT($have_no_cygwin)
bda3639deecc Fixed building with cygwin
Sam Lantinga <slouken@libsdl.org>
parents: 7494
diff changeset
    96
        CFLAGS="$save_CFLAGS"
bda3639deecc Fixed building with cygwin
Sam Lantinga <slouken@libsdl.org>
parents: 7494
diff changeset
    97
bda3639deecc Fixed building with cygwin
Sam Lantinga <slouken@libsdl.org>
parents: 7494
diff changeset
    98
        if test x$have_no_cygwin = xyes; then
bda3639deecc Fixed building with cygwin
Sam Lantinga <slouken@libsdl.org>
parents: 7494
diff changeset
    99
            BASE_CFLAGS="-mno-cygwin"
bda3639deecc Fixed building with cygwin
Sam Lantinga <slouken@libsdl.org>
parents: 7494
diff changeset
   100
            BASE_LDFLAGS="-mno-cygwin"
bda3639deecc Fixed building with cygwin
Sam Lantinga <slouken@libsdl.org>
parents: 7494
diff changeset
   101
        fi
bda3639deecc Fixed building with cygwin
Sam Lantinga <slouken@libsdl.org>
parents: 7494
diff changeset
   102
        BASE_CFLAGS="$BASE_CFLAGS -I/usr/include/mingw"
1389
ce65f014190a Fixed X11 library detection
Sam Lantinga <slouken@libsdl.org>
parents: 1384
diff changeset
   103
        ;;
ce65f014190a Fixed X11 library detection
Sam Lantinga <slouken@libsdl.org>
parents: 1384
diff changeset
   104
esac
5030
6a0803e47c7b Greg Jandl to SDL
Sam Lantinga <slouken@libsdl.org>
parents: 5029
diff changeset
   105
# Uncomment the following line if you want to force SDL and applications
6a0803e47c7b Greg Jandl to SDL
Sam Lantinga <slouken@libsdl.org>
parents: 5029
diff changeset
   106
# built with it to be compiled for a particular architecture.
6a0803e47c7b Greg Jandl to SDL
Sam Lantinga <slouken@libsdl.org>
parents: 5029
diff changeset
   107
#AX_GCC_ARCHFLAG([no], [BASE_CFLAGS="$BASE_CFLAGS $ax_cv_gcc_archflag]")
6235
d169541f5049 Switched back to configure generating SDL_config.h
Sam Lantinga <slouken@libsdl.org>
parents: 6219
diff changeset
   108
BUILD_CFLAGS="$CFLAGS $CPPFLAGS -DUSING_GENERATED_CONFIG_H"
6250
cce0ddcf6747 Updated to SDL 2.0, and SDL 2.0 can now be installed coexisting with SDL 1.2
Sam Lantinga <slouken@libsdl.org>
parents: 6235
diff changeset
   109
# The default optimization for SDL is -O3 (Bug #31)
6378
58c9e692aec5 Fixed bug 1547 - Fix test(1) utilization within the autoconf script
Sam Lantinga <slouken@libsdl.org>
parents: 6374
diff changeset
   110
if test "x$orig_CFLAGS" = x; then
3382
294fb5e6f301 A better solution to making the default build optimization -O3
Sam Lantinga <slouken@libsdl.org>
parents: 3372
diff changeset
   111
    BUILD_CFLAGS=`echo $BUILD_CFLAGS | sed 's/-O2/-O3/'`
294fb5e6f301 A better solution to making the default build optimization -O3
Sam Lantinga <slouken@libsdl.org>
parents: 3372
diff changeset
   112
fi
1521
9b9212e4810c CFLAGS are separate from EXTRA_CFLAGS
Sam Lantinga <slouken@libsdl.org>
parents: 1520
diff changeset
   113
EXTRA_CFLAGS="$INCLUDE $BASE_CFLAGS"
9b9212e4810c CFLAGS are separate from EXTRA_CFLAGS
Sam Lantinga <slouken@libsdl.org>
parents: 1520
diff changeset
   114
BUILD_LDFLAGS="$LDFLAGS"
9b9212e4810c CFLAGS are separate from EXTRA_CFLAGS
Sam Lantinga <slouken@libsdl.org>
parents: 1520
diff changeset
   115
EXTRA_LDFLAGS="$BASE_LDFLAGS"
2163
5f96cf74b782 NAS dynamic loading is going to be have to looked at... *sigh*
Sam Lantinga <slouken@libsdl.org>
parents: 2158
diff changeset
   116
## These are common directories to find software packages
5f96cf74b782 NAS dynamic loading is going to be have to looked at... *sigh*
Sam Lantinga <slouken@libsdl.org>
parents: 2158
diff changeset
   117
#for path in /usr/freeware /usr/pkg /usr/X11R6 /usr/local; do
1823
d2b0f8b18ab8 Whoops, need a space after dnl to make it meaningful. :)
Sam Lantinga <slouken@libsdl.org>
parents: 1822
diff changeset
   118
#    if test -d $path/include; then
d2b0f8b18ab8 Whoops, need a space after dnl to make it meaningful. :)
Sam Lantinga <slouken@libsdl.org>
parents: 1822
diff changeset
   119
#        EXTRA_CFLAGS="$EXTRA_CFLAGS -I$path/include"
d2b0f8b18ab8 Whoops, need a space after dnl to make it meaningful. :)
Sam Lantinga <slouken@libsdl.org>
parents: 1822
diff changeset
   120
#    fi
d2b0f8b18ab8 Whoops, need a space after dnl to make it meaningful. :)
Sam Lantinga <slouken@libsdl.org>
parents: 1822
diff changeset
   121
#    if test -d $path/lib; then
d2b0f8b18ab8 Whoops, need a space after dnl to make it meaningful. :)
Sam Lantinga <slouken@libsdl.org>
parents: 1822
diff changeset
   122
#        EXTRA_LDFLAGS="$EXTRA_LDFLAGS -L$path/lib"
d2b0f8b18ab8 Whoops, need a space after dnl to make it meaningful. :)
Sam Lantinga <slouken@libsdl.org>
parents: 1822
diff changeset
   123
#    fi
d2b0f8b18ab8 Whoops, need a space after dnl to make it meaningful. :)
Sam Lantinga <slouken@libsdl.org>
parents: 1822
diff changeset
   124
#done
1521
9b9212e4810c CFLAGS are separate from EXTRA_CFLAGS
Sam Lantinga <slouken@libsdl.org>
parents: 1520
diff changeset
   125
SDL_CFLAGS="$BASE_CFLAGS"
6250
cce0ddcf6747 Updated to SDL 2.0, and SDL 2.0 can now be installed coexisting with SDL 1.2
Sam Lantinga <slouken@libsdl.org>
parents: 6235
diff changeset
   126
SDL_LIBS="-lSDL2 $BASE_LDFLAGS"
1521
9b9212e4810c CFLAGS are separate from EXTRA_CFLAGS
Sam Lantinga <slouken@libsdl.org>
parents: 1520
diff changeset
   127
CPPFLAGS="$CPPFLAGS $EXTRA_CFLAGS"
9b9212e4810c CFLAGS are separate from EXTRA_CFLAGS
Sam Lantinga <slouken@libsdl.org>
parents: 1520
diff changeset
   128
CFLAGS="$CFLAGS $EXTRA_CFLAGS"
9b9212e4810c CFLAGS are separate from EXTRA_CFLAGS
Sam Lantinga <slouken@libsdl.org>
parents: 1520
diff changeset
   129
LDFLAGS="$LDFLAGS $EXTRA_LDFLAGS"
1373
04499d3e1b6b *** empty log message ***
Sam Lantinga <slouken@libsdl.org>
parents: 1370
diff changeset
   130
3391
188fc5ecc58c Simplify and improve dynamic library detection, taken from SDL_image
Sam Lantinga <slouken@libsdl.org>
parents: 3390
diff changeset
   131
dnl set this to use on systems that use lib64 instead of lib
188fc5ecc58c Simplify and improve dynamic library detection, taken from SDL_image
Sam Lantinga <slouken@libsdl.org>
parents: 3390
diff changeset
   132
base_libdir=`echo \${libdir} | sed 's/.*\/\(.*\)/\1/; q'`
188fc5ecc58c Simplify and improve dynamic library detection, taken from SDL_image
Sam Lantinga <slouken@libsdl.org>
parents: 3390
diff changeset
   133
188fc5ecc58c Simplify and improve dynamic library detection, taken from SDL_image
Sam Lantinga <slouken@libsdl.org>
parents: 3390
diff changeset
   134
dnl Function to find a library in the compiler search path
188fc5ecc58c Simplify and improve dynamic library detection, taken from SDL_image
Sam Lantinga <slouken@libsdl.org>
parents: 3390
diff changeset
   135
find_lib()
188fc5ecc58c Simplify and improve dynamic library detection, taken from SDL_image
Sam Lantinga <slouken@libsdl.org>
parents: 3390
diff changeset
   136
{
188fc5ecc58c Simplify and improve dynamic library detection, taken from SDL_image
Sam Lantinga <slouken@libsdl.org>
parents: 3390
diff changeset
   137
    gcc_bin_path=[`$CC -print-search-dirs 2>/dev/null | fgrep programs: | sed 's/[^=]*=\(.*\)/\1/' | sed 's/:/ /g'`]
188fc5ecc58c Simplify and improve dynamic library detection, taken from SDL_image
Sam Lantinga <slouken@libsdl.org>
parents: 3390
diff changeset
   138
    gcc_lib_path=[`$CC -print-search-dirs 2>/dev/null | fgrep libraries: | sed 's/[^=]*=\(.*\)/\1/' | sed 's/:/ /g'`]
188fc5ecc58c Simplify and improve dynamic library detection, taken from SDL_image
Sam Lantinga <slouken@libsdl.org>
parents: 3390
diff changeset
   139
    env_lib_path=[`echo $LIBS $LDFLAGS $* | sed 's/-L[ ]*//g'`]
188fc5ecc58c Simplify and improve dynamic library detection, taken from SDL_image
Sam Lantinga <slouken@libsdl.org>
parents: 3390
diff changeset
   140
    if test "$cross_compiling" = yes; then
188fc5ecc58c Simplify and improve dynamic library detection, taken from SDL_image
Sam Lantinga <slouken@libsdl.org>
parents: 3390
diff changeset
   141
        host_lib_path=""
188fc5ecc58c Simplify and improve dynamic library detection, taken from SDL_image
Sam Lantinga <slouken@libsdl.org>
parents: 3390
diff changeset
   142
    else
188fc5ecc58c Simplify and improve dynamic library detection, taken from SDL_image
Sam Lantinga <slouken@libsdl.org>
parents: 3390
diff changeset
   143
        host_lib_path="/usr/$base_libdir /usr/local/$base_libdir"
188fc5ecc58c Simplify and improve dynamic library detection, taken from SDL_image
Sam Lantinga <slouken@libsdl.org>
parents: 3390
diff changeset
   144
    fi
188fc5ecc58c Simplify and improve dynamic library detection, taken from SDL_image
Sam Lantinga <slouken@libsdl.org>
parents: 3390
diff changeset
   145
    for path in $gcc_bin_path $gcc_lib_path $env_lib_path $host_lib_path; do
7300
ee9c13257398 Improved find_lib, gets the latest version of libpng, etc.
Sam Lantinga <slouken@libsdl.org>
parents: 7272
diff changeset
   146
        lib=[`ls -- $path/$1 2>/dev/null | sed -e '/\.so\..*\./d' -e 's,.*/,,' | sort | tail -1`]
3391
188fc5ecc58c Simplify and improve dynamic library detection, taken from SDL_image
Sam Lantinga <slouken@libsdl.org>
parents: 3390
diff changeset
   147
        if test x$lib != x; then
188fc5ecc58c Simplify and improve dynamic library detection, taken from SDL_image
Sam Lantinga <slouken@libsdl.org>
parents: 3390
diff changeset
   148
            echo $lib
188fc5ecc58c Simplify and improve dynamic library detection, taken from SDL_image
Sam Lantinga <slouken@libsdl.org>
parents: 3390
diff changeset
   149
            return
188fc5ecc58c Simplify and improve dynamic library detection, taken from SDL_image
Sam Lantinga <slouken@libsdl.org>
parents: 3390
diff changeset
   150
        fi
188fc5ecc58c Simplify and improve dynamic library detection, taken from SDL_image
Sam Lantinga <slouken@libsdl.org>
parents: 3390
diff changeset
   151
    done
188fc5ecc58c Simplify and improve dynamic library detection, taken from SDL_image
Sam Lantinga <slouken@libsdl.org>
parents: 3390
diff changeset
   152
}
188fc5ecc58c Simplify and improve dynamic library detection, taken from SDL_image
Sam Lantinga <slouken@libsdl.org>
parents: 3390
diff changeset
   153
1353
7ba544e2888d Started the process of improving configure support, and merging C types
Sam Lantinga <slouken@libsdl.org>
parents: 1352
diff changeset
   154
dnl Check for compiler characteristics
1341
d02b552e5304 Configure dynamically generates SDL_config.h
Sam Lantinga <slouken@libsdl.org>
parents: 1330
diff changeset
   155
AC_C_CONST
d02b552e5304 Configure dynamically generates SDL_config.h
Sam Lantinga <slouken@libsdl.org>
parents: 1330
diff changeset
   156
AC_C_INLINE
1353
7ba544e2888d Started the process of improving configure support, and merging C types
Sam Lantinga <slouken@libsdl.org>
parents: 1352
diff changeset
   157
AC_C_VOLATILE
7ba544e2888d Started the process of improving configure support, and merging C types
Sam Lantinga <slouken@libsdl.org>
parents: 1352
diff changeset
   158
3647
c5925cd41955 First pass at Ryan's assertion code, minor tweaks to come.
Sam Lantinga <slouken@libsdl.org>
parents: 3639
diff changeset
   159
dnl See whether we want assertions for debugging/sanity checking SDL itself.
c5925cd41955 First pass at Ryan's assertion code, minor tweaks to come.
Sam Lantinga <slouken@libsdl.org>
parents: 3639
diff changeset
   160
AC_ARG_ENABLE(assertions,
c5925cd41955 First pass at Ryan's assertion code, minor tweaks to come.
Sam Lantinga <slouken@libsdl.org>
parents: 3639
diff changeset
   161
AC_HELP_STRING([--enable-assertions],
3654
336f3df1578d Allow configure to override assertion settings, but by default this comes from the build optimization level.
Sam Lantinga <slouken@libsdl.org>
parents: 3649
diff changeset
   162
               [Enable internal sanity checks (auto/disabled/release/enabled/paranoid) [[default=auto]]]),
336f3df1578d Allow configure to override assertion settings, but by default this comes from the build optimization level.
Sam Lantinga <slouken@libsdl.org>
parents: 3649
diff changeset
   163
              , enable_assertions=auto)
336f3df1578d Allow configure to override assertion settings, but by default this comes from the build optimization level.
Sam Lantinga <slouken@libsdl.org>
parents: 3649
diff changeset
   164
case "$enable_assertions" in
336f3df1578d Allow configure to override assertion settings, but by default this comes from the build optimization level.
Sam Lantinga <slouken@libsdl.org>
parents: 3649
diff changeset
   165
    auto) # Use optimization settings to determine assertion level
336f3df1578d Allow configure to override assertion settings, but by default this comes from the build optimization level.
Sam Lantinga <slouken@libsdl.org>
parents: 3649
diff changeset
   166
        ;;
336f3df1578d Allow configure to override assertion settings, but by default this comes from the build optimization level.
Sam Lantinga <slouken@libsdl.org>
parents: 3649
diff changeset
   167
    disabled)
5548
8f0abb6ef37d Updated configure.in to be compatible with autoconf 2.67.
Ryan C. Gordon <icculus@icculus.org>
parents: 5512
diff changeset
   168
        AC_DEFINE(SDL_DEFAULT_ASSERT_LEVEL, 0, [ ])
3654
336f3df1578d Allow configure to override assertion settings, but by default this comes from the build optimization level.
Sam Lantinga <slouken@libsdl.org>
parents: 3649
diff changeset
   169
        ;;
336f3df1578d Allow configure to override assertion settings, but by default this comes from the build optimization level.
Sam Lantinga <slouken@libsdl.org>
parents: 3649
diff changeset
   170
    release)
5548
8f0abb6ef37d Updated configure.in to be compatible with autoconf 2.67.
Ryan C. Gordon <icculus@icculus.org>
parents: 5512
diff changeset
   171
        AC_DEFINE(SDL_DEFAULT_ASSERT_LEVEL, 1, [ ])
3654
336f3df1578d Allow configure to override assertion settings, but by default this comes from the build optimization level.
Sam Lantinga <slouken@libsdl.org>
parents: 3649
diff changeset
   172
        ;;
336f3df1578d Allow configure to override assertion settings, but by default this comes from the build optimization level.
Sam Lantinga <slouken@libsdl.org>
parents: 3649
diff changeset
   173
    enabled)
5548
8f0abb6ef37d Updated configure.in to be compatible with autoconf 2.67.
Ryan C. Gordon <icculus@icculus.org>
parents: 5512
diff changeset
   174
        AC_DEFINE(SDL_DEFAULT_ASSERT_LEVEL, 2, [ ])
3654
336f3df1578d Allow configure to override assertion settings, but by default this comes from the build optimization level.
Sam Lantinga <slouken@libsdl.org>
parents: 3649
diff changeset
   175
        ;;
336f3df1578d Allow configure to override assertion settings, but by default this comes from the build optimization level.
Sam Lantinga <slouken@libsdl.org>
parents: 3649
diff changeset
   176
    paranoid)
5548
8f0abb6ef37d Updated configure.in to be compatible with autoconf 2.67.
Ryan C. Gordon <icculus@icculus.org>
parents: 5512
diff changeset
   177
        AC_DEFINE(SDL_DEFAULT_ASSERT_LEVEL, 3, [ ])
3654
336f3df1578d Allow configure to override assertion settings, but by default this comes from the build optimization level.
Sam Lantinga <slouken@libsdl.org>
parents: 3649
diff changeset
   178
        ;;
336f3df1578d Allow configure to override assertion settings, but by default this comes from the build optimization level.
Sam Lantinga <slouken@libsdl.org>
parents: 3649
diff changeset
   179
    *)
336f3df1578d Allow configure to override assertion settings, but by default this comes from the build optimization level.
Sam Lantinga <slouken@libsdl.org>
parents: 3649
diff changeset
   180
        AC_MSG_ERROR([*** unknown assertion level. stop.])
336f3df1578d Allow configure to override assertion settings, but by default this comes from the build optimization level.
Sam Lantinga <slouken@libsdl.org>
parents: 3649
diff changeset
   181
        ;;
336f3df1578d Allow configure to override assertion settings, but by default this comes from the build optimization level.
Sam Lantinga <slouken@libsdl.org>
parents: 3649
diff changeset
   182
esac
3647
c5925cd41955 First pass at Ryan's assertion code, minor tweaks to come.
Sam Lantinga <slouken@libsdl.org>
parents: 3639
diff changeset
   183
3354
98c5b421426e Fixed bug #828
Sam Lantinga <slouken@libsdl.org>
parents: 3351
diff changeset
   184
dnl See whether we can use gcc style dependency tracking
98c5b421426e Fixed bug #828
Sam Lantinga <slouken@libsdl.org>
parents: 3351
diff changeset
   185
AC_ARG_ENABLE(dependency-tracking,
98c5b421426e Fixed bug #828
Sam Lantinga <slouken@libsdl.org>
parents: 3351
diff changeset
   186
AC_HELP_STRING([--enable-dependency-tracking],
98c5b421426e Fixed bug #828
Sam Lantinga <slouken@libsdl.org>
parents: 3351
diff changeset
   187
               [Use gcc -MMD -MT dependency tracking [[default=yes]]]),
98c5b421426e Fixed bug #828
Sam Lantinga <slouken@libsdl.org>
parents: 3351
diff changeset
   188
              , enable_dependency_tracking=yes)
98c5b421426e Fixed bug #828
Sam Lantinga <slouken@libsdl.org>
parents: 3351
diff changeset
   189
if test x$enable_dependency_tracking = xyes; then
98c5b421426e Fixed bug #828
Sam Lantinga <slouken@libsdl.org>
parents: 3351
diff changeset
   190
    have_gcc_mmd_mt=no
98c5b421426e Fixed bug #828
Sam Lantinga <slouken@libsdl.org>
parents: 3351
diff changeset
   191
    AC_MSG_CHECKING(for GCC -MMD -MT option)
98c5b421426e Fixed bug #828
Sam Lantinga <slouken@libsdl.org>
parents: 3351
diff changeset
   192
    AC_TRY_COMPILE([
98c5b421426e Fixed bug #828
Sam Lantinga <slouken@libsdl.org>
parents: 3351
diff changeset
   193
    #if !defined(__GNUC__) || __GNUC__ < 3
98c5b421426e Fixed bug #828
Sam Lantinga <slouken@libsdl.org>
parents: 3351
diff changeset
   194
    #error Dependency tracking requires GCC 3.0 or newer
98c5b421426e Fixed bug #828
Sam Lantinga <slouken@libsdl.org>
parents: 3351
diff changeset
   195
    #endif
98c5b421426e Fixed bug #828
Sam Lantinga <slouken@libsdl.org>
parents: 3351
diff changeset
   196
    ],[
98c5b421426e Fixed bug #828
Sam Lantinga <slouken@libsdl.org>
parents: 3351
diff changeset
   197
    ],[
98c5b421426e Fixed bug #828
Sam Lantinga <slouken@libsdl.org>
parents: 3351
diff changeset
   198
    have_gcc_mmd_mt=yes
98c5b421426e Fixed bug #828
Sam Lantinga <slouken@libsdl.org>
parents: 3351
diff changeset
   199
    ])
98c5b421426e Fixed bug #828
Sam Lantinga <slouken@libsdl.org>
parents: 3351
diff changeset
   200
    AC_MSG_RESULT($have_gcc_mmd_mt)
98c5b421426e Fixed bug #828
Sam Lantinga <slouken@libsdl.org>
parents: 3351
diff changeset
   201
98c5b421426e Fixed bug #828
Sam Lantinga <slouken@libsdl.org>
parents: 3351
diff changeset
   202
    if test x$have_gcc_mmd_mt = xyes; then
98c5b421426e Fixed bug #828
Sam Lantinga <slouken@libsdl.org>
parents: 3351
diff changeset
   203
        DEPENDENCY_TRACKING_OPTIONS="-MMD -MT \$@"
98c5b421426e Fixed bug #828
Sam Lantinga <slouken@libsdl.org>
parents: 3351
diff changeset
   204
    fi
98c5b421426e Fixed bug #828
Sam Lantinga <slouken@libsdl.org>
parents: 3351
diff changeset
   205
fi
5004
0c72ae7b7cb2 Added native atomic operations for Windows, Mac OS X, and gcc compiler intrinsics.
Sam Lantinga <slouken@libsdl.org>
parents: 5003
diff changeset
   206
6580
a7d6106f1715 Don't use the --no-undefined linker option yet, it doesn't build on OpenBSD and BeOS.
Sam Lantinga <slouken@libsdl.org>
parents: 6577
diff changeset
   207
# Actually this doesn't work on OpenBSD and BeOS
a7d6106f1715 Don't use the --no-undefined linker option yet, it doesn't build on OpenBSD and BeOS.
Sam Lantinga <slouken@libsdl.org>
parents: 6577
diff changeset
   208
#AC_MSG_CHECKING(for linker option --no-undefined)
a7d6106f1715 Don't use the --no-undefined linker option yet, it doesn't build on OpenBSD and BeOS.
Sam Lantinga <slouken@libsdl.org>
parents: 6577
diff changeset
   209
#have_no_undefined=no
a7d6106f1715 Don't use the --no-undefined linker option yet, it doesn't build on OpenBSD and BeOS.
Sam Lantinga <slouken@libsdl.org>
parents: 6577
diff changeset
   210
#save_LDFLAGS="$LDFLAGS"
a7d6106f1715 Don't use the --no-undefined linker option yet, it doesn't build on OpenBSD and BeOS.
Sam Lantinga <slouken@libsdl.org>
parents: 6577
diff changeset
   211
#LDFLAGS="$LDFLAGS -Wl,--no-undefined"
a7d6106f1715 Don't use the --no-undefined linker option yet, it doesn't build on OpenBSD and BeOS.
Sam Lantinga <slouken@libsdl.org>
parents: 6577
diff changeset
   212
#AC_TRY_LINK([
a7d6106f1715 Don't use the --no-undefined linker option yet, it doesn't build on OpenBSD and BeOS.
Sam Lantinga <slouken@libsdl.org>
parents: 6577
diff changeset
   213
#],[
a7d6106f1715 Don't use the --no-undefined linker option yet, it doesn't build on OpenBSD and BeOS.
Sam Lantinga <slouken@libsdl.org>
parents: 6577
diff changeset
   214
#],[
a7d6106f1715 Don't use the --no-undefined linker option yet, it doesn't build on OpenBSD and BeOS.
Sam Lantinga <slouken@libsdl.org>
parents: 6577
diff changeset
   215
#have_no_undefined=yes
a7d6106f1715 Don't use the --no-undefined linker option yet, it doesn't build on OpenBSD and BeOS.
Sam Lantinga <slouken@libsdl.org>
parents: 6577
diff changeset
   216
#EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,--no-undefined"
a7d6106f1715 Don't use the --no-undefined linker option yet, it doesn't build on OpenBSD and BeOS.
Sam Lantinga <slouken@libsdl.org>
parents: 6577
diff changeset
   217
#])
a7d6106f1715 Don't use the --no-undefined linker option yet, it doesn't build on OpenBSD and BeOS.
Sam Lantinga <slouken@libsdl.org>
parents: 6577
diff changeset
   218
#LDFLAGS="$save_LDFLAGS"
a7d6106f1715 Don't use the --no-undefined linker option yet, it doesn't build on OpenBSD and BeOS.
Sam Lantinga <slouken@libsdl.org>
parents: 6577
diff changeset
   219
#AC_MSG_RESULT($have_no_undefined)
6577
d38491853506 Use the --no-undefined linker option if it's available, which will catch references to undefined functions which could fail at runtime.
Sam Lantinga <slouken@libsdl.org>
parents: 6445
diff changeset
   220
1361
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents: 1354
diff changeset
   221
dnl See whether we are allowed to use the system C library
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents: 1354
diff changeset
   222
AC_ARG_ENABLE(libc,
1637
9ba366b919c7 Date: Fri, 31 Mar 2006 18:28:55 -0500
Sam Lantinga <slouken@libsdl.org>
parents: 1632
diff changeset
   223
AC_HELP_STRING([--enable-libc], [Use the system C library [[default=yes]]]),
1361
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents: 1354
diff changeset
   224
              , enable_libc=yes)
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents: 1354
diff changeset
   225
if test x$enable_libc = xyes; then
5548
8f0abb6ef37d Updated configure.in to be compatible with autoconf 2.67.
Ryan C. Gordon <icculus@icculus.org>
parents: 5512
diff changeset
   226
    AC_DEFINE(HAVE_LIBC, 1, [ ])
1361
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents: 1354
diff changeset
   227
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents: 1354
diff changeset
   228
    dnl Check for C library headers
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents: 1354
diff changeset
   229
    AC_HEADER_STDC
1501
73dc5d39bbf8 Added UTF-8 <-> UTF-16 <-> UTF-32 <-> UCS-2 <-> UCS-4 conversion capability
Sam Lantinga <slouken@libsdl.org>
parents: 1477
diff changeset
   230
    AC_CHECK_HEADERS(sys/types.h stdio.h stdlib.h stddef.h stdarg.h malloc.h memory.h string.h strings.h inttypes.h stdint.h ctype.h math.h iconv.h signal.h)
1353
7ba544e2888d Started the process of improving configure support, and merging C types
Sam Lantinga <slouken@libsdl.org>
parents: 1352
diff changeset
   231
1361
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents: 1354
diff changeset
   232
    dnl Check for typedefs, structures, etc.
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents: 1354
diff changeset
   233
    AC_TYPE_SIZE_T
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents: 1354
diff changeset
   234
3012
7e30c2dc7783 Fixed Visual C++ release build for Visual C++ 2005
Sam Lantinga <slouken@libsdl.org>
parents: 3007
diff changeset
   235
    dnl Check for defines
7e30c2dc7783 Fixed Visual C++ release build for Visual C++ 2005
Sam Lantinga <slouken@libsdl.org>
parents: 3007
diff changeset
   236
    AC_CHECK_DEFINE(M_PI, math.h)
7e30c2dc7783 Fixed Visual C++ release build for Visual C++ 2005
Sam Lantinga <slouken@libsdl.org>
parents: 3007
diff changeset
   237
1361
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents: 1354
diff changeset
   238
    dnl Checks for library functions.
2079
1ed2155b7ee4 From: Torsten Giebl
Ryan C. Gordon <icculus@icculus.org>
parents: 2070
diff changeset
   239
    case "$host" in
1ed2155b7ee4 From: Torsten Giebl
Ryan C. Gordon <icculus@icculus.org>
parents: 2070
diff changeset
   240
    *-*-cygwin* | *-*-mingw32*)
1ed2155b7ee4 From: Torsten Giebl
Ryan C. Gordon <icculus@icculus.org>
parents: 2070
diff changeset
   241
        ;;
1ed2155b7ee4 From: Torsten Giebl
Ryan C. Gordon <icculus@icculus.org>
parents: 2070
diff changeset
   242
    *)
1ed2155b7ee4 From: Torsten Giebl
Ryan C. Gordon <icculus@icculus.org>
parents: 2070
diff changeset
   243
        AC_FUNC_ALLOCA
1ed2155b7ee4 From: Torsten Giebl
Ryan C. Gordon <icculus@icculus.org>
parents: 2070
diff changeset
   244
        ;;
1ed2155b7ee4 From: Torsten Giebl
Ryan C. Gordon <icculus@icculus.org>
parents: 2070
diff changeset
   245
    esac
1ed2155b7ee4 From: Torsten Giebl
Ryan C. Gordon <icculus@icculus.org>
parents: 2070
diff changeset
   246
1361
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents: 1354
diff changeset
   247
    AC_FUNC_MEMCMP
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents: 1354
diff changeset
   248
    if test x$ac_cv_func_memcmp_working = xyes; then
5548
8f0abb6ef37d Updated configure.in to be compatible with autoconf 2.67.
Ryan C. Gordon <icculus@icculus.org>
parents: 5512
diff changeset
   249
        AC_DEFINE(HAVE_MEMCMP, 1, [ ])
1361
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents: 1354
diff changeset
   250
    fi
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents: 1354
diff changeset
   251
    AC_FUNC_STRTOD
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents: 1354
diff changeset
   252
    if test x$ac_cv_func_strtod = xyes; then
5548
8f0abb6ef37d Updated configure.in to be compatible with autoconf 2.67.
Ryan C. Gordon <icculus@icculus.org>
parents: 5512
diff changeset
   253
        AC_DEFINE(HAVE_STRTOD, 1, [ ])
1361
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents: 1354
diff changeset
   254
    fi
3405
d5f2dd33f4eb Merged improvements to SDL_SoftStretch() from SDL 1.2
Sam Lantinga <slouken@libsdl.org>
parents: 3394
diff changeset
   255
    AC_CHECK_FUNC(mprotect,
d5f2dd33f4eb Merged improvements to SDL_SoftStretch() from SDL 1.2
Sam Lantinga <slouken@libsdl.org>
parents: 3394
diff changeset
   256
        AC_TRY_COMPILE([
d5f2dd33f4eb Merged improvements to SDL_SoftStretch() from SDL 1.2
Sam Lantinga <slouken@libsdl.org>
parents: 3394
diff changeset
   257
          #include <sys/types.h>
d5f2dd33f4eb Merged improvements to SDL_SoftStretch() from SDL 1.2
Sam Lantinga <slouken@libsdl.org>
parents: 3394
diff changeset
   258
          #include <sys/mman.h>
d5f2dd33f4eb Merged improvements to SDL_SoftStretch() from SDL 1.2
Sam Lantinga <slouken@libsdl.org>
parents: 3394
diff changeset
   259
        ],[
d5f2dd33f4eb Merged improvements to SDL_SoftStretch() from SDL 1.2
Sam Lantinga <slouken@libsdl.org>
parents: 3394
diff changeset
   260
        ],[
5548
8f0abb6ef37d Updated configure.in to be compatible with autoconf 2.67.
Ryan C. Gordon <icculus@icculus.org>
parents: 5512
diff changeset
   261
        AC_DEFINE(HAVE_MPROTECT, 1, [ ])
3405
d5f2dd33f4eb Merged improvements to SDL_SoftStretch() from SDL 1.2
Sam Lantinga <slouken@libsdl.org>
parents: 3394
diff changeset
   262
        ]),
d5f2dd33f4eb Merged improvements to SDL_SoftStretch() from SDL 1.2
Sam Lantinga <slouken@libsdl.org>
parents: 3394
diff changeset
   263
    )
6642
b716011e53ce Added an API to get the size of a file - WARNING! ABI CHANGE!
Sam Lantinga <slouken@libsdl.org>
parents: 6594
diff changeset
   264
    AC_CHECK_FUNCS(malloc calloc realloc free getenv setenv putenv unsetenv qsort abs bcopy memset memcpy memmove strlen strlcpy strlcat strdup _strrev _strupr _strlwr strchr strrchr strstr itoa _ltoa _uitoa _ultoa strtol strtoul _i64toa _ui64toa strtoll strtoull atoi atof strcmp strncmp _stricmp strcasecmp _strnicmp strncasecmp sscanf snprintf vsnprintf fseeko fseeko64 sigaction setjmp nanosleep sysconf sysctlbyname)
1373
04499d3e1b6b *** empty log message ***
Sam Lantinga <slouken@libsdl.org>
parents: 1370
diff changeset
   265
3014
cacb282192a1 Check for functions after including the libraries that they might be in.
Sam Lantinga <slouken@libsdl.org>
parents: 3012
diff changeset
   266
    AC_CHECK_LIB(m, pow, [LIBS="$LIBS -lm"; EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lm"])
4873
67ad1c88dda0 Added atan implementation from uClibc
Sam Lantinga <slouken@libsdl.org>
parents: 4870
diff changeset
   267
    AC_CHECK_FUNCS(atan atan2 ceil copysign cos cosf fabs floor log pow scalbn sin sinf sqrt)
3014
cacb282192a1 Check for functions after including the libraries that they might be in.
Sam Lantinga <slouken@libsdl.org>
parents: 3012
diff changeset
   268
5040
ff8873816c30 Fixed test for libiconv
Sam Lantinga <slouken@libsdl.org>
parents: 5030
diff changeset
   269
    AC_CHECK_LIB(iconv, iconv_open, [LIBS="$LIBS -liconv"; EXTRA_LDFLAGS="$EXTRA_LDFLAGS -liconv"])
3014
cacb282192a1 Check for functions after including the libraries that they might be in.
Sam Lantinga <slouken@libsdl.org>
parents: 3012
diff changeset
   270
    AC_CHECK_FUNCS(iconv)
5577
ced8a6788629 Work on systems without sa_sigaction.
Ryan C. Gordon <icculus@icculus.org>
parents: 5557
diff changeset
   271
ced8a6788629 Work on systems without sa_sigaction.
Ryan C. Gordon <icculus@icculus.org>
parents: 5557
diff changeset
   272
    AC_CHECK_MEMBER(struct sigaction.sa_sigaction,[AC_DEFINE(HAVE_SA_SIGACTION)], ,[#include <signal.h>])
1361
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents: 1354
diff changeset
   273
fi
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents: 1354
diff changeset
   274
7554
4b653ef6050d Further fix SIZEOF_VOIDP in SDL_config.h.in
Edward Rudd <urkle@outoforder.cc>
parents: 7507
diff changeset
   275
dnl AC_CHECK_SIZEOF(void*)
1341
d02b552e5304 Configure dynamically generates SDL_config.h
Sam Lantinga <slouken@libsdl.org>
parents: 1330
diff changeset
   276
5004
0c72ae7b7cb2 Added native atomic operations for Windows, Mac OS X, and gcc compiler intrinsics.
Sam Lantinga <slouken@libsdl.org>
parents: 5003
diff changeset
   277
dnl See whether we can use gcc atomic operations on this architecture
0c72ae7b7cb2 Added native atomic operations for Windows, Mac OS X, and gcc compiler intrinsics.
Sam Lantinga <slouken@libsdl.org>
parents: 5003
diff changeset
   278
AC_ARG_ENABLE(gcc-atomics,
0c72ae7b7cb2 Added native atomic operations for Windows, Mac OS X, and gcc compiler intrinsics.
Sam Lantinga <slouken@libsdl.org>
parents: 5003
diff changeset
   279
AC_HELP_STRING([--enable-gcc-atomics],
0c72ae7b7cb2 Added native atomic operations for Windows, Mac OS X, and gcc compiler intrinsics.
Sam Lantinga <slouken@libsdl.org>
parents: 5003
diff changeset
   280
               [Use gcc builtin atomics [[default=yes]]]),
0c72ae7b7cb2 Added native atomic operations for Windows, Mac OS X, and gcc compiler intrinsics.
Sam Lantinga <slouken@libsdl.org>
parents: 5003
diff changeset
   281
              , enable_gcc_atomics=yes)
0c72ae7b7cb2 Added native atomic operations for Windows, Mac OS X, and gcc compiler intrinsics.
Sam Lantinga <slouken@libsdl.org>
parents: 5003
diff changeset
   282
if test x$enable_gcc_atomics = xyes; then
0c72ae7b7cb2 Added native atomic operations for Windows, Mac OS X, and gcc compiler intrinsics.
Sam Lantinga <slouken@libsdl.org>
parents: 5003
diff changeset
   283
    have_gcc_atomics=no
0c72ae7b7cb2 Added native atomic operations for Windows, Mac OS X, and gcc compiler intrinsics.
Sam Lantinga <slouken@libsdl.org>
parents: 5003
diff changeset
   284
    AC_MSG_CHECKING(for GCC builtin atomic operations)
0c72ae7b7cb2 Added native atomic operations for Windows, Mac OS X, and gcc compiler intrinsics.
Sam Lantinga <slouken@libsdl.org>
parents: 5003
diff changeset
   285
    AC_TRY_LINK([
0c72ae7b7cb2 Added native atomic operations for Windows, Mac OS X, and gcc compiler intrinsics.
Sam Lantinga <slouken@libsdl.org>
parents: 5003
diff changeset
   286
    ],[
0c72ae7b7cb2 Added native atomic operations for Windows, Mac OS X, and gcc compiler intrinsics.
Sam Lantinga <slouken@libsdl.org>
parents: 5003
diff changeset
   287
    int a;
0c72ae7b7cb2 Added native atomic operations for Windows, Mac OS X, and gcc compiler intrinsics.
Sam Lantinga <slouken@libsdl.org>
parents: 5003
diff changeset
   288
    void *x, *y, *z;
0c72ae7b7cb2 Added native atomic operations for Windows, Mac OS X, and gcc compiler intrinsics.
Sam Lantinga <slouken@libsdl.org>
parents: 5003
diff changeset
   289
    __sync_lock_test_and_set(&a, 4);
5095
dceec93471e7 Improvements based on feedback from Anthony Williams
Sam Lantinga <slouken@libsdl.org>
parents: 5093
diff changeset
   290
    __sync_lock_test_and_set(&x, y);
5004
0c72ae7b7cb2 Added native atomic operations for Windows, Mac OS X, and gcc compiler intrinsics.
Sam Lantinga <slouken@libsdl.org>
parents: 5003
diff changeset
   291
    __sync_fetch_and_add(&a, 1);
0c72ae7b7cb2 Added native atomic operations for Windows, Mac OS X, and gcc compiler intrinsics.
Sam Lantinga <slouken@libsdl.org>
parents: 5003
diff changeset
   292
    __sync_bool_compare_and_swap(&a, 5, 10);
0c72ae7b7cb2 Added native atomic operations for Windows, Mac OS X, and gcc compiler intrinsics.
Sam Lantinga <slouken@libsdl.org>
parents: 5003
diff changeset
   293
    __sync_bool_compare_and_swap(&x, y, z);
0c72ae7b7cb2 Added native atomic operations for Windows, Mac OS X, and gcc compiler intrinsics.
Sam Lantinga <slouken@libsdl.org>
parents: 5003
diff changeset
   294
    ],[
0c72ae7b7cb2 Added native atomic operations for Windows, Mac OS X, and gcc compiler intrinsics.
Sam Lantinga <slouken@libsdl.org>
parents: 5003
diff changeset
   295
    have_gcc_atomics=yes
0c72ae7b7cb2 Added native atomic operations for Windows, Mac OS X, and gcc compiler intrinsics.
Sam Lantinga <slouken@libsdl.org>
parents: 5003
diff changeset
   296
    ])
0c72ae7b7cb2 Added native atomic operations for Windows, Mac OS X, and gcc compiler intrinsics.
Sam Lantinga <slouken@libsdl.org>
parents: 5003
diff changeset
   297
    AC_MSG_RESULT($have_gcc_atomics)
0c72ae7b7cb2 Added native atomic operations for Windows, Mac OS X, and gcc compiler intrinsics.
Sam Lantinga <slouken@libsdl.org>
parents: 5003
diff changeset
   298
5068
231dbbc3e31c Fixed atomic intrinsic test
Sam Lantinga <slouken@libsdl.org>
parents: 5066
diff changeset
   299
    if test x$have_gcc_atomics = xyes; then
5548
8f0abb6ef37d Updated configure.in to be compatible with autoconf 2.67.
Ryan C. Gordon <icculus@icculus.org>
parents: 5512
diff changeset
   300
        AC_DEFINE(HAVE_GCC_ATOMICS, 1, [ ])
5071
55ff76cdbbb8 HAVE_GCC_ATOMICS covers the test and set
Sam Lantinga <slouken@libsdl.org>
parents: 5069
diff changeset
   301
    else
55ff76cdbbb8 HAVE_GCC_ATOMICS covers the test and set
Sam Lantinga <slouken@libsdl.org>
parents: 5069
diff changeset
   302
        # See if we have the minimum operation needed for GCC atomics
55ff76cdbbb8 HAVE_GCC_ATOMICS covers the test and set
Sam Lantinga <slouken@libsdl.org>
parents: 5069
diff changeset
   303
        AC_TRY_LINK([
55ff76cdbbb8 HAVE_GCC_ATOMICS covers the test and set
Sam Lantinga <slouken@libsdl.org>
parents: 5069
diff changeset
   304
        ],[
55ff76cdbbb8 HAVE_GCC_ATOMICS covers the test and set
Sam Lantinga <slouken@libsdl.org>
parents: 5069
diff changeset
   305
        int a;
55ff76cdbbb8 HAVE_GCC_ATOMICS covers the test and set
Sam Lantinga <slouken@libsdl.org>
parents: 5069
diff changeset
   306
        __sync_lock_test_and_set(&a, 1);
5095
dceec93471e7 Improvements based on feedback from Anthony Williams
Sam Lantinga <slouken@libsdl.org>
parents: 5093
diff changeset
   307
        __sync_lock_release(&a);
5071
55ff76cdbbb8 HAVE_GCC_ATOMICS covers the test and set
Sam Lantinga <slouken@libsdl.org>
parents: 5069
diff changeset
   308
        ],[
55ff76cdbbb8 HAVE_GCC_ATOMICS covers the test and set
Sam Lantinga <slouken@libsdl.org>
parents: 5069
diff changeset
   309
        have_gcc_sync_lock_test_and_set=yes
55ff76cdbbb8 HAVE_GCC_ATOMICS covers the test and set
Sam Lantinga <slouken@libsdl.org>
parents: 5069
diff changeset
   310
        ])
55ff76cdbbb8 HAVE_GCC_ATOMICS covers the test and set
Sam Lantinga <slouken@libsdl.org>
parents: 5069
diff changeset
   311
        if test x$have_gcc_sync_lock_test_and_set = xyes; then
5548
8f0abb6ef37d Updated configure.in to be compatible with autoconf 2.67.
Ryan C. Gordon <icculus@icculus.org>
parents: 5512
diff changeset
   312
            AC_DEFINE(HAVE_GCC_SYNC_LOCK_TEST_AND_SET, 1, [ ])
5071
55ff76cdbbb8 HAVE_GCC_ATOMICS covers the test and set
Sam Lantinga <slouken@libsdl.org>
parents: 5069
diff changeset
   313
        fi
5069
fd125217f00c Separated out the minimum functionality that we need from gcc for our spinlock fallback.
Sam Lantinga <slouken@libsdl.org>
parents: 5068
diff changeset
   314
    fi
5004
0c72ae7b7cb2 Added native atomic operations for Windows, Mac OS X, and gcc compiler intrinsics.
Sam Lantinga <slouken@libsdl.org>
parents: 5003
diff changeset
   315
fi
0c72ae7b7cb2 Added native atomic operations for Windows, Mac OS X, and gcc compiler intrinsics.
Sam Lantinga <slouken@libsdl.org>
parents: 5003
diff changeset
   316
1361
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents: 1354
diff changeset
   317
# Standard C sources
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents: 1354
diff changeset
   318
SOURCES="$SOURCES $srcdir/src/*.c"
5154
fb424691cfc7 Moved the rendering code out to a separate directory in the hope that it can someday be completely decoupled from the rest of the library and be expanded to an awesome 2D on 3D library.
Sam Lantinga <slouken@libsdl.org>
parents: 5150
diff changeset
   319
SOURCES="$SOURCES $srcdir/src/atomic/*.c"
1361
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents: 1354
diff changeset
   320
SOURCES="$SOURCES $srcdir/src/audio/*.c"
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents: 1354
diff changeset
   321
SOURCES="$SOURCES $srcdir/src/cpuinfo/*.c"
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents: 1354
diff changeset
   322
SOURCES="$SOURCES $srcdir/src/events/*.c"
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents: 1354
diff changeset
   323
SOURCES="$SOURCES $srcdir/src/file/*.c"
7307
5d6b7b9432d3 Fixed SDL building with the minimal configuration
Sam Lantinga <slouken@libsdl.org>
parents: 7300
diff changeset
   324
SOURCES="$SOURCES $srcdir/src/haptic/*.c"
5d6b7b9432d3 Fixed SDL building with the minimal configuration
Sam Lantinga <slouken@libsdl.org>
parents: 7300
diff changeset
   325
SOURCES="$SOURCES $srcdir/src/joystick/*.c"
6594
dccafb0699dc Make it possible to build a DLL with mingw that's ABI compatible with Visual C++ built applications
Sam Lantinga <slouken@libsdl.org>
parents: 6580
diff changeset
   326
SOURCES="$SOURCES $srcdir/src/libm/*.c"
7307
5d6b7b9432d3 Fixed SDL building with the minimal configuration
Sam Lantinga <slouken@libsdl.org>
parents: 7300
diff changeset
   327
SOURCES="$SOURCES $srcdir/src/power/*.c"
7667
be1cc6f55840 Added SDL_GetBasePath() and SDL_GetPrefPath() in new filesystem module.
Ryan C. Gordon <icculus@icculus.org>
parents: 7659
diff changeset
   328
#SOURCES="$SOURCES $srcdir/src/filesystem/*.c"
5154
fb424691cfc7 Moved the rendering code out to a separate directory in the hope that it can someday be completely decoupled from the rest of the library and be expanded to an awesome 2D on 3D library.
Sam Lantinga <slouken@libsdl.org>
parents: 5150
diff changeset
   329
SOURCES="$SOURCES $srcdir/src/render/*.c"
fb424691cfc7 Moved the rendering code out to a separate directory in the hope that it can someday be completely decoupled from the rest of the library and be expanded to an awesome 2D on 3D library.
Sam Lantinga <slouken@libsdl.org>
parents: 5150
diff changeset
   330
SOURCES="$SOURCES $srcdir/src/render/*/*.c"
1361
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents: 1354
diff changeset
   331
SOURCES="$SOURCES $srcdir/src/stdlib/*.c"
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents: 1354
diff changeset
   332
SOURCES="$SOURCES $srcdir/src/thread/*.c"
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents: 1354
diff changeset
   333
SOURCES="$SOURCES $srcdir/src/timer/*.c"
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents: 1354
diff changeset
   334
SOURCES="$SOURCES $srcdir/src/video/*.c"
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents: 1354
diff changeset
   335
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   336
dnl Enable/disable various subsystems of the SDL library
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   337
3199
3e1bf2b8bd81 This check in updates SDL_atomic.h to reflect the new set of atomic operations in 32 and 64 bit form.
Bob Pendleton <bob@pendleton.com>
parents: 3180
diff changeset
   338
AC_ARG_ENABLE(atomic,
3e1bf2b8bd81 This check in updates SDL_atomic.h to reflect the new set of atomic operations in 32 and 64 bit form.
Bob Pendleton <bob@pendleton.com>
parents: 3180
diff changeset
   339
AC_HELP_STRING([--enable-atomic], [Enable the atomic operations subsystem [[default=yes]]]),
3e1bf2b8bd81 This check in updates SDL_atomic.h to reflect the new set of atomic operations in 32 and 64 bit form.
Bob Pendleton <bob@pendleton.com>
parents: 3180
diff changeset
   340
              , enable_atomic=yes)
3e1bf2b8bd81 This check in updates SDL_atomic.h to reflect the new set of atomic operations in 32 and 64 bit form.
Bob Pendleton <bob@pendleton.com>
parents: 3180
diff changeset
   341
if test x$enable_atomic != xyes; then
5548
8f0abb6ef37d Updated configure.in to be compatible with autoconf 2.67.
Ryan C. Gordon <icculus@icculus.org>
parents: 5512
diff changeset
   342
    AC_DEFINE(SDL_ATOMIC_DISABLED, 1, [ ])
3199
3e1bf2b8bd81 This check in updates SDL_atomic.h to reflect the new set of atomic operations in 32 and 64 bit form.
Bob Pendleton <bob@pendleton.com>
parents: 3180
diff changeset
   343
fi
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   344
AC_ARG_ENABLE(audio,
1637
9ba366b919c7 Date: Fri, 31 Mar 2006 18:28:55 -0500
Sam Lantinga <slouken@libsdl.org>
parents: 1632
diff changeset
   345
AC_HELP_STRING([--enable-audio], [Enable the audio subsystem [[default=yes]]]),
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   346
              , enable_audio=yes)
1361
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents: 1354
diff changeset
   347
if test x$enable_audio != xyes; then
5548
8f0abb6ef37d Updated configure.in to be compatible with autoconf 2.67.
Ryan C. Gordon <icculus@icculus.org>
parents: 5512
diff changeset
   348
    AC_DEFINE(SDL_AUDIO_DISABLED, 1, [ ])
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   349
fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   350
AC_ARG_ENABLE(video,
1637
9ba366b919c7 Date: Fri, 31 Mar 2006 18:28:55 -0500
Sam Lantinga <slouken@libsdl.org>
parents: 1632
diff changeset
   351
AC_HELP_STRING([--enable-video], [Enable the video subsystem [[default=yes]]]),
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   352
              , enable_video=yes)
1361
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents: 1354
diff changeset
   353
if test x$enable_video != xyes; then
5548
8f0abb6ef37d Updated configure.in to be compatible with autoconf 2.67.
Ryan C. Gordon <icculus@icculus.org>
parents: 5512
diff changeset
   354
    AC_DEFINE(SDL_VIDEO_DISABLED, 1, [ ])
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   355
fi
5226
710d00cb3a6a Made it possible to disable the rendering subsystem with configure --disable-render
Sam Lantinga <slouken@libsdl.org>
parents: 5225
diff changeset
   356
AC_ARG_ENABLE(render,
710d00cb3a6a Made it possible to disable the rendering subsystem with configure --disable-render
Sam Lantinga <slouken@libsdl.org>
parents: 5225
diff changeset
   357
AC_HELP_STRING([--enable-render], [Enable the render subsystem [[default=yes]]]),
710d00cb3a6a Made it possible to disable the rendering subsystem with configure --disable-render
Sam Lantinga <slouken@libsdl.org>
parents: 5225
diff changeset
   358
              , enable_render=yes)
710d00cb3a6a Made it possible to disable the rendering subsystem with configure --disable-render
Sam Lantinga <slouken@libsdl.org>
parents: 5225
diff changeset
   359
if test x$enable_render != xyes; then
5548
8f0abb6ef37d Updated configure.in to be compatible with autoconf 2.67.
Ryan C. Gordon <icculus@icculus.org>
parents: 5512
diff changeset
   360
    AC_DEFINE(SDL_RENDER_DISABLED, 1, [ ])
5226
710d00cb3a6a Made it possible to disable the rendering subsystem with configure --disable-render
Sam Lantinga <slouken@libsdl.org>
parents: 5225
diff changeset
   361
fi
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   362
AC_ARG_ENABLE(events,
1637
9ba366b919c7 Date: Fri, 31 Mar 2006 18:28:55 -0500
Sam Lantinga <slouken@libsdl.org>
parents: 1632
diff changeset
   363
AC_HELP_STRING([--enable-events], [Enable the events subsystem [[default=yes]]]),
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   364
              , enable_events=yes)
1361
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents: 1354
diff changeset
   365
if test x$enable_events != xyes; then
5548
8f0abb6ef37d Updated configure.in to be compatible with autoconf 2.67.
Ryan C. Gordon <icculus@icculus.org>
parents: 5512
diff changeset
   366
    AC_DEFINE(SDL_EVENTS_DISABLED, 1, [ ])
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   367
fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   368
AC_ARG_ENABLE(joystick,
1637
9ba366b919c7 Date: Fri, 31 Mar 2006 18:28:55 -0500
Sam Lantinga <slouken@libsdl.org>
parents: 1632
diff changeset
   369
AC_HELP_STRING([--enable-joystick], [Enable the joystick subsystem [[default=yes]]]),
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   370
              , enable_joystick=yes)
1361
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents: 1354
diff changeset
   371
if test x$enable_joystick != xyes; then
5548
8f0abb6ef37d Updated configure.in to be compatible with autoconf 2.67.
Ryan C. Gordon <icculus@icculus.org>
parents: 5512
diff changeset
   372
    AC_DEFINE(SDL_JOYSTICK_DISABLED, 1, [ ])
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   373
fi
2713
0906692aa6a4 Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents: 2710
diff changeset
   374
AC_ARG_ENABLE(haptic,
0906692aa6a4 Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents: 2710
diff changeset
   375
AC_HELP_STRING([--enable-haptic], [Enable the haptic (force feedback) subsystem [[default=yes]]]),
0906692aa6a4 Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents: 2710
diff changeset
   376
              , enable_haptic=yes)
0906692aa6a4 Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents: 2710
diff changeset
   377
if test x$enable_haptic != xyes; then
5548
8f0abb6ef37d Updated configure.in to be compatible with autoconf 2.67.
Ryan C. Gordon <icculus@icculus.org>
parents: 5512
diff changeset
   378
    AC_DEFINE(SDL_HAPTIC_DISABLED, 1, [ ])
2713
0906692aa6a4 Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents: 2710
diff changeset
   379
fi
3170
b7a48f533966 Initial work on power subsystem for SDL 1.3.
Ryan C. Gordon <icculus@icculus.org>
parents: 3168
diff changeset
   380
AC_ARG_ENABLE(power,
b7a48f533966 Initial work on power subsystem for SDL 1.3.
Ryan C. Gordon <icculus@icculus.org>
parents: 3168
diff changeset
   381
AC_HELP_STRING([--enable-power], [Enable the power subsystem [[default=yes]]]),
b7a48f533966 Initial work on power subsystem for SDL 1.3.
Ryan C. Gordon <icculus@icculus.org>
parents: 3168
diff changeset
   382
              , enable_power=yes)
b7a48f533966 Initial work on power subsystem for SDL 1.3.
Ryan C. Gordon <icculus@icculus.org>
parents: 3168
diff changeset
   383
if test x$enable_power != xyes; then
5548
8f0abb6ef37d Updated configure.in to be compatible with autoconf 2.67.
Ryan C. Gordon <icculus@icculus.org>
parents: 5512
diff changeset
   384
    AC_DEFINE(SDL_POWER_DISABLED, 1, [ ])
3170
b7a48f533966 Initial work on power subsystem for SDL 1.3.
Ryan C. Gordon <icculus@icculus.org>
parents: 3168
diff changeset
   385
fi
7667
be1cc6f55840 Added SDL_GetBasePath() and SDL_GetPrefPath() in new filesystem module.
Ryan C. Gordon <icculus@icculus.org>
parents: 7659
diff changeset
   386
AC_ARG_ENABLE(filesystem,
be1cc6f55840 Added SDL_GetBasePath() and SDL_GetPrefPath() in new filesystem module.
Ryan C. Gordon <icculus@icculus.org>
parents: 7659
diff changeset
   387
AC_HELP_STRING([--enable-filesystem], [Enable the filesystem subsystem [[default=yes]]]),
be1cc6f55840 Added SDL_GetBasePath() and SDL_GetPrefPath() in new filesystem module.
Ryan C. Gordon <icculus@icculus.org>
parents: 7659
diff changeset
   388
              , enable_filesystem=yes)
be1cc6f55840 Added SDL_GetBasePath() and SDL_GetPrefPath() in new filesystem module.
Ryan C. Gordon <icculus@icculus.org>
parents: 7659
diff changeset
   389
if test x$enable_filesystem != xyes; then
be1cc6f55840 Added SDL_GetBasePath() and SDL_GetPrefPath() in new filesystem module.
Ryan C. Gordon <icculus@icculus.org>
parents: 7659
diff changeset
   390
    AC_DEFINE(SDL_FILESYSTEM_DISABLED, 1, [ ])
be1cc6f55840 Added SDL_GetBasePath() and SDL_GetPrefPath() in new filesystem module.
Ryan C. Gordon <icculus@icculus.org>
parents: 7659
diff changeset
   391
fi
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   392
AC_ARG_ENABLE(threads,
1637
9ba366b919c7 Date: Fri, 31 Mar 2006 18:28:55 -0500
Sam Lantinga <slouken@libsdl.org>
parents: 1632
diff changeset
   393
AC_HELP_STRING([--enable-threads], [Enable the threading subsystem [[default=yes]]]),
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   394
              , enable_threads=yes)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   395
if test x$enable_threads != xyes; then
5548
8f0abb6ef37d Updated configure.in to be compatible with autoconf 2.67.
Ryan C. Gordon <icculus@icculus.org>
parents: 5512
diff changeset
   396
    AC_DEFINE(SDL_THREADS_DISABLED, 1, [ ])
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   397
fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   398
AC_ARG_ENABLE(timers,
1637
9ba366b919c7 Date: Fri, 31 Mar 2006 18:28:55 -0500
Sam Lantinga <slouken@libsdl.org>
parents: 1632
diff changeset
   399
AC_HELP_STRING([--enable-timers], [Enable the timer subsystem [[default=yes]]]),
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   400
              , enable_timers=yes)
1361
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents: 1354
diff changeset
   401
if test x$enable_timers != xyes; then
5548
8f0abb6ef37d Updated configure.in to be compatible with autoconf 2.67.
Ryan C. Gordon <icculus@icculus.org>
parents: 5512
diff changeset
   402
    AC_DEFINE(SDL_TIMERS_DISABLED, 1, [ ])
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   403
fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   404
AC_ARG_ENABLE(file,
1637
9ba366b919c7 Date: Fri, 31 Mar 2006 18:28:55 -0500
Sam Lantinga <slouken@libsdl.org>
parents: 1632
diff changeset
   405
AC_HELP_STRING([--enable-file], [Enable the file subsystem [[default=yes]]]),
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   406
              , enable_file=yes)
1361
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents: 1354
diff changeset
   407
if test x$enable_file != xyes; then
5548
8f0abb6ef37d Updated configure.in to be compatible with autoconf 2.67.
Ryan C. Gordon <icculus@icculus.org>
parents: 5512
diff changeset
   408
    AC_DEFINE(SDL_FILE_DISABLED, 1, [ ])
1361
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents: 1354
diff changeset
   409
fi
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents: 1354
diff changeset
   410
AC_ARG_ENABLE(loadso,
1637
9ba366b919c7 Date: Fri, 31 Mar 2006 18:28:55 -0500
Sam Lantinga <slouken@libsdl.org>
parents: 1632
diff changeset
   411
AC_HELP_STRING([--enable-loadso], [Enable the shared object loading subsystem [[default=yes]]]),
1361
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents: 1354
diff changeset
   412
              , enable_loadso=yes)
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents: 1354
diff changeset
   413
if test x$enable_loadso != xyes; then
5548
8f0abb6ef37d Updated configure.in to be compatible with autoconf 2.67.
Ryan C. Gordon <icculus@icculus.org>
parents: 5512
diff changeset
   414
    AC_DEFINE(SDL_LOADSO_DISABLED, 1, [ ])
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   415
fi
740
e70f80e98f60 Actually hook the cpuinfo module into the library. :)
Sam Lantinga <slouken@libsdl.org>
parents: 739
diff changeset
   416
AC_ARG_ENABLE(cpuinfo,
1637
9ba366b919c7 Date: Fri, 31 Mar 2006 18:28:55 -0500
Sam Lantinga <slouken@libsdl.org>
parents: 1632
diff changeset
   417
AC_HELP_STRING([--enable-cpuinfo], [Enable the cpuinfo subsystem [[default=yes]]]),
740
e70f80e98f60 Actually hook the cpuinfo module into the library. :)
Sam Lantinga <slouken@libsdl.org>
parents: 739
diff changeset
   418
              , enable_cpuinfo=yes)
1361
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents: 1354
diff changeset
   419
if test x$enable_cpuinfo != xyes; then
5548
8f0abb6ef37d Updated configure.in to be compatible with autoconf 2.67.
Ryan C. Gordon <icculus@icculus.org>
parents: 5512
diff changeset
   420
    AC_DEFINE(SDL_CPUINFO_DISABLED, 1, [ ])
1361
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents: 1354
diff changeset
   421
fi
5225
5d01d426f2ea It's now possible to disable the fast atomic operations, at a huge performance penalty.
Sam Lantinga <slouken@libsdl.org>
parents: 5199
diff changeset
   422
AC_ARG_ENABLE(atomic,
5d01d426f2ea It's now possible to disable the fast atomic operations, at a huge performance penalty.
Sam Lantinga <slouken@libsdl.org>
parents: 5199
diff changeset
   423
AC_HELP_STRING([--enable-atomic], [Enable the atomic operations [[default=yes]]]),
5d01d426f2ea It's now possible to disable the fast atomic operations, at a huge performance penalty.
Sam Lantinga <slouken@libsdl.org>
parents: 5199
diff changeset
   424
              , enable_atomic=yes)
5d01d426f2ea It's now possible to disable the fast atomic operations, at a huge performance penalty.
Sam Lantinga <slouken@libsdl.org>
parents: 5199
diff changeset
   425
if test x$enable_atomic != xyes; then
5548
8f0abb6ef37d Updated configure.in to be compatible with autoconf 2.67.
Ryan C. Gordon <icculus@icculus.org>
parents: 5512
diff changeset
   426
    AC_DEFINE(SDL_ATOMIC_DISABLED, 1, [ ])
5225
5d01d426f2ea It's now possible to disable the fast atomic operations, at a huge performance penalty.
Sam Lantinga <slouken@libsdl.org>
parents: 5199
diff changeset
   427
fi
1402
d910939febfa Use consistent identifiers for the various platforms we support.
Sam Lantinga <slouken@libsdl.org>
parents: 1399
diff changeset
   428
AC_ARG_ENABLE(assembly,
1637
9ba366b919c7 Date: Fri, 31 Mar 2006 18:28:55 -0500
Sam Lantinga <slouken@libsdl.org>
parents: 1632
diff changeset
   429
AC_HELP_STRING([--enable-assembly], [Enable assembly routines [[default=yes]]]),
1402
d910939febfa Use consistent identifiers for the various platforms we support.
Sam Lantinga <slouken@libsdl.org>
parents: 1399
diff changeset
   430
              , enable_assembly=yes)
d910939febfa Use consistent identifiers for the various platforms we support.
Sam Lantinga <slouken@libsdl.org>
parents: 1399
diff changeset
   431
if test x$enable_assembly = xyes; then
5548
8f0abb6ef37d Updated configure.in to be compatible with autoconf 2.67.
Ryan C. Gordon <icculus@icculus.org>
parents: 5512
diff changeset
   432
    AC_DEFINE(SDL_ASSEMBLY_ROUTINES, 1, [ ])
2247
93994f65c74c Removed hermes since it's LGPL and not compatible with a commercial license.
Sam Lantinga <slouken@libsdl.org>
parents: 2238
diff changeset
   433
2856
c765f5fa4a2c Default SSE2 off on iX86, since gcc will use it for floating point operations
Sam Lantinga <slouken@libsdl.org>
parents: 2820
diff changeset
   434
    # Make sure that we don't generate floating point code that would
c765f5fa4a2c Default SSE2 off on iX86, since gcc will use it for floating point operations
Sam Lantinga <slouken@libsdl.org>
parents: 2820
diff changeset
   435
    # cause illegal instruction exceptions on older processors
c765f5fa4a2c Default SSE2 off on iX86, since gcc will use it for floating point operations
Sam Lantinga <slouken@libsdl.org>
parents: 2820
diff changeset
   436
    case "$host" in
c765f5fa4a2c Default SSE2 off on iX86, since gcc will use it for floating point operations
Sam Lantinga <slouken@libsdl.org>
parents: 2820
diff changeset
   437
        *-*-darwin*)
c765f5fa4a2c Default SSE2 off on iX86, since gcc will use it for floating point operations
Sam Lantinga <slouken@libsdl.org>
parents: 2820
diff changeset
   438
            # Don't need to worry about Apple hardware, it's all SSE capable
c765f5fa4a2c Default SSE2 off on iX86, since gcc will use it for floating point operations
Sam Lantinga <slouken@libsdl.org>
parents: 2820
diff changeset
   439
            default_ssemath=yes
c765f5fa4a2c Default SSE2 off on iX86, since gcc will use it for floating point operations
Sam Lantinga <slouken@libsdl.org>
parents: 2820
diff changeset
   440
            ;;
c765f5fa4a2c Default SSE2 off on iX86, since gcc will use it for floating point operations
Sam Lantinga <slouken@libsdl.org>
parents: 2820
diff changeset
   441
        *64-*-*)
c765f5fa4a2c Default SSE2 off on iX86, since gcc will use it for floating point operations
Sam Lantinga <slouken@libsdl.org>
parents: 2820
diff changeset
   442
            # x86 64-bit architectures all have SSE instructions
c765f5fa4a2c Default SSE2 off on iX86, since gcc will use it for floating point operations
Sam Lantinga <slouken@libsdl.org>
parents: 2820
diff changeset
   443
            default_ssemath=yes
c765f5fa4a2c Default SSE2 off on iX86, since gcc will use it for floating point operations
Sam Lantinga <slouken@libsdl.org>
parents: 2820
diff changeset
   444
            ;;
3392
efc22582afc5 Only show the dynamic audio libraries if we'll be dynamically loading them
Sam Lantinga <slouken@libsdl.org>
parents: 3391
diff changeset
   445
        *)
2856
c765f5fa4a2c Default SSE2 off on iX86, since gcc will use it for floating point operations
Sam Lantinga <slouken@libsdl.org>
parents: 2820
diff changeset
   446
            default_ssemath=no
c765f5fa4a2c Default SSE2 off on iX86, since gcc will use it for floating point operations
Sam Lantinga <slouken@libsdl.org>
parents: 2820
diff changeset
   447
            ;;
c765f5fa4a2c Default SSE2 off on iX86, since gcc will use it for floating point operations
Sam Lantinga <slouken@libsdl.org>
parents: 2820
diff changeset
   448
    esac
c765f5fa4a2c Default SSE2 off on iX86, since gcc will use it for floating point operations
Sam Lantinga <slouken@libsdl.org>
parents: 2820
diff changeset
   449
    AC_ARG_ENABLE(ssemath,
c765f5fa4a2c Default SSE2 off on iX86, since gcc will use it for floating point operations
Sam Lantinga <slouken@libsdl.org>
parents: 2820
diff changeset
   450
AC_HELP_STRING([--enable-ssemath], [Allow GCC to use SSE floating point math [[default=no]]]),
c765f5fa4a2c Default SSE2 off on iX86, since gcc will use it for floating point operations
Sam Lantinga <slouken@libsdl.org>
parents: 2820
diff changeset
   451
                  , enable_ssemath=$default_ssemath)
c765f5fa4a2c Default SSE2 off on iX86, since gcc will use it for floating point operations
Sam Lantinga <slouken@libsdl.org>
parents: 2820
diff changeset
   452
    if test x$enable_ssemath = xno; then
c765f5fa4a2c Default SSE2 off on iX86, since gcc will use it for floating point operations
Sam Lantinga <slouken@libsdl.org>
parents: 2820
diff changeset
   453
        if test x$have_gcc_sse = xyes -o x$have_gcc_sse2 = xyes; then
c765f5fa4a2c Default SSE2 off on iX86, since gcc will use it for floating point operations
Sam Lantinga <slouken@libsdl.org>
parents: 2820
diff changeset
   454
            EXTRA_CFLAGS="$EXTRA_CFLAGS -mfpmath=387"
c765f5fa4a2c Default SSE2 off on iX86, since gcc will use it for floating point operations
Sam Lantinga <slouken@libsdl.org>
parents: 2820
diff changeset
   455
        fi
c765f5fa4a2c Default SSE2 off on iX86, since gcc will use it for floating point operations
Sam Lantinga <slouken@libsdl.org>
parents: 2820
diff changeset
   456
    fi
c765f5fa4a2c Default SSE2 off on iX86, since gcc will use it for floating point operations
Sam Lantinga <slouken@libsdl.org>
parents: 2820
diff changeset
   457
2247
93994f65c74c Removed hermes since it's LGPL and not compatible with a commercial license.
Sam Lantinga <slouken@libsdl.org>
parents: 2238
diff changeset
   458
    dnl Check for various instruction support
93994f65c74c Removed hermes since it's LGPL and not compatible with a commercial license.
Sam Lantinga <slouken@libsdl.org>
parents: 2238
diff changeset
   459
    AC_ARG_ENABLE(mmx,
93994f65c74c Removed hermes since it's LGPL and not compatible with a commercial license.
Sam Lantinga <slouken@libsdl.org>
parents: 2238
diff changeset
   460
AC_HELP_STRING([--enable-mmx], [use MMX assembly routines [[default=yes]]]),
93994f65c74c Removed hermes since it's LGPL and not compatible with a commercial license.
Sam Lantinga <slouken@libsdl.org>
parents: 2238
diff changeset
   461
                  , enable_mmx=yes)
93994f65c74c Removed hermes since it's LGPL and not compatible with a commercial license.
Sam Lantinga <slouken@libsdl.org>
parents: 2238
diff changeset
   462
    if test x$enable_mmx = xyes; then
93994f65c74c Removed hermes since it's LGPL and not compatible with a commercial license.
Sam Lantinga <slouken@libsdl.org>
parents: 2238
diff changeset
   463
        save_CFLAGS="$CFLAGS"
93994f65c74c Removed hermes since it's LGPL and not compatible with a commercial license.
Sam Lantinga <slouken@libsdl.org>
parents: 2238
diff changeset
   464
        have_gcc_mmx=no
93994f65c74c Removed hermes since it's LGPL and not compatible with a commercial license.
Sam Lantinga <slouken@libsdl.org>
parents: 2238
diff changeset
   465
        AC_MSG_CHECKING(for GCC -mmmx option)
93994f65c74c Removed hermes since it's LGPL and not compatible with a commercial license.
Sam Lantinga <slouken@libsdl.org>
parents: 2238
diff changeset
   466
        mmx_CFLAGS="-mmmx"
93994f65c74c Removed hermes since it's LGPL and not compatible with a commercial license.
Sam Lantinga <slouken@libsdl.org>
parents: 2238
diff changeset
   467
        CFLAGS="$save_CFLAGS $mmx_CFLAGS"
93994f65c74c Removed hermes since it's LGPL and not compatible with a commercial license.
Sam Lantinga <slouken@libsdl.org>
parents: 2238
diff changeset
   468
93994f65c74c Removed hermes since it's LGPL and not compatible with a commercial license.
Sam Lantinga <slouken@libsdl.org>
parents: 2238
diff changeset
   469
        AC_TRY_COMPILE([
4426
1bceff8f008f Fixed bug #943
Sam Lantinga <slouken@libsdl.org>
parents: 3696
diff changeset
   470
        #ifdef __MINGW32__
1bceff8f008f Fixed bug #943
Sam Lantinga <slouken@libsdl.org>
parents: 3696
diff changeset
   471
        #include <_mingw.h>
1bceff8f008f Fixed bug #943
Sam Lantinga <slouken@libsdl.org>
parents: 3696
diff changeset
   472
        #ifdef __MINGW64_VERSION_MAJOR
1bceff8f008f Fixed bug #943
Sam Lantinga <slouken@libsdl.org>
parents: 3696
diff changeset
   473
        #include <intrin.h>
1bceff8f008f Fixed bug #943
Sam Lantinga <slouken@libsdl.org>
parents: 3696
diff changeset
   474
        #else
2247
93994f65c74c Removed hermes since it's LGPL and not compatible with a commercial license.
Sam Lantinga <slouken@libsdl.org>
parents: 2238
diff changeset
   475
        #include <mmintrin.h>
4426
1bceff8f008f Fixed bug #943
Sam Lantinga <slouken@libsdl.org>
parents: 3696
diff changeset
   476
        #endif
1bceff8f008f Fixed bug #943
Sam Lantinga <slouken@libsdl.org>
parents: 3696
diff changeset
   477
        #else
1bceff8f008f Fixed bug #943
Sam Lantinga <slouken@libsdl.org>
parents: 3696
diff changeset
   478
        #include <mmintrin.h>
1bceff8f008f Fixed bug #943
Sam Lantinga <slouken@libsdl.org>
parents: 3696
diff changeset
   479
        #endif
2261
c20476d7d7b3 Enabled 3DNow! intrinsic support
Sam Lantinga <slouken@libsdl.org>
parents: 2247
diff changeset
   480
        #ifndef __MMX__
c20476d7d7b3 Enabled 3DNow! intrinsic support
Sam Lantinga <slouken@libsdl.org>
parents: 2247
diff changeset
   481
        #error Assembler CPP flag not enabled
c20476d7d7b3 Enabled 3DNow! intrinsic support
Sam Lantinga <slouken@libsdl.org>
parents: 2247
diff changeset
   482
        #endif
2247
93994f65c74c Removed hermes since it's LGPL and not compatible with a commercial license.
Sam Lantinga <slouken@libsdl.org>
parents: 2238
diff changeset
   483
        ],[
93994f65c74c Removed hermes since it's LGPL and not compatible with a commercial license.
Sam Lantinga <slouken@libsdl.org>
parents: 2238
diff changeset
   484
        ],[
93994f65c74c Removed hermes since it's LGPL and not compatible with a commercial license.
Sam Lantinga <slouken@libsdl.org>
parents: 2238
diff changeset
   485
        have_gcc_mmx=yes
93994f65c74c Removed hermes since it's LGPL and not compatible with a commercial license.
Sam Lantinga <slouken@libsdl.org>
parents: 2238
diff changeset
   486
        ])
93994f65c74c Removed hermes since it's LGPL and not compatible with a commercial license.
Sam Lantinga <slouken@libsdl.org>
parents: 2238
diff changeset
   487
        AC_MSG_RESULT($have_gcc_mmx)
2290
323a5af2924b Christian Walther fixed bug #530
Sam Lantinga <slouken@libsdl.org>
parents: 2271
diff changeset
   488
        CFLAGS="$save_CFLAGS"
2247
93994f65c74c Removed hermes since it's LGPL and not compatible with a commercial license.
Sam Lantinga <slouken@libsdl.org>
parents: 2238
diff changeset
   489
93994f65c74c Removed hermes since it's LGPL and not compatible with a commercial license.
Sam Lantinga <slouken@libsdl.org>
parents: 2238
diff changeset
   490
        if test x$have_gcc_mmx = xyes; then
93994f65c74c Removed hermes since it's LGPL and not compatible with a commercial license.
Sam Lantinga <slouken@libsdl.org>
parents: 2238
diff changeset
   491
            EXTRA_CFLAGS="$EXTRA_CFLAGS $mmx_CFLAGS"
93994f65c74c Removed hermes since it's LGPL and not compatible with a commercial license.
Sam Lantinga <slouken@libsdl.org>
parents: 2238
diff changeset
   492
        fi
93994f65c74c Removed hermes since it's LGPL and not compatible with a commercial license.
Sam Lantinga <slouken@libsdl.org>
parents: 2238
diff changeset
   493
    fi
93994f65c74c Removed hermes since it's LGPL and not compatible with a commercial license.
Sam Lantinga <slouken@libsdl.org>
parents: 2238
diff changeset
   494
5389
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   495
    AC_ARG_ENABLE(3dnow,
6444
9a2b329dbd0e Changed the comment so it actually talks about the right instruction set.
Sam Lantinga <slouken@libsdl.org>
parents: 6443
diff changeset
   496
AC_HELP_STRING([--enable-3dnow], [use 3DNow! assembly routines [[default=yes]]]),
5389
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   497
                  , enable_3dnow=yes)
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   498
    if test x$enable_3dnow = xyes; then
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   499
        save_CFLAGS="$CFLAGS"
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   500
        have_gcc_3dnow=no
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   501
        AC_MSG_CHECKING(for GCC -m3dnow option)
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   502
        amd3dnow_CFLAGS="-m3dnow"
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   503
        CFLAGS="$save_CFLAGS $amd3dnow_CFLAGS"
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   504
6443
21827b6a7cfd Fixed 3DNow! detection for clang llvm
Sam Lantinga <slouken@libsdl.org>
parents: 6431
diff changeset
   505
        AC_TRY_LINK([
5389
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   506
        #include <mm3dnow.h>
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   507
        #ifndef __3dNOW__
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   508
        #error Assembler CPP flag not enabled
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   509
        #endif
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   510
        ],[
6443
21827b6a7cfd Fixed 3DNow! detection for clang llvm
Sam Lantinga <slouken@libsdl.org>
parents: 6431
diff changeset
   511
        void *p = 0;
21827b6a7cfd Fixed 3DNow! detection for clang llvm
Sam Lantinga <slouken@libsdl.org>
parents: 6431
diff changeset
   512
        _m_prefetch(p);
5389
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   513
        ],[
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   514
        have_gcc_3dnow=yes
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   515
        ])
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   516
        AC_MSG_RESULT($have_gcc_3dnow)
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   517
        CFLAGS="$save_CFLAGS"
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   518
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   519
        if test x$have_gcc_3dnow = xyes; then
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   520
            EXTRA_CFLAGS="$EXTRA_CFLAGS $amd3dnow_CFLAGS"
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   521
        fi
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   522
    fi
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   523
2247
93994f65c74c Removed hermes since it's LGPL and not compatible with a commercial license.
Sam Lantinga <slouken@libsdl.org>
parents: 2238
diff changeset
   524
    AC_ARG_ENABLE(sse,
93994f65c74c Removed hermes since it's LGPL and not compatible with a commercial license.
Sam Lantinga <slouken@libsdl.org>
parents: 2238
diff changeset
   525
AC_HELP_STRING([--enable-sse], [use SSE assembly routines [[default=yes]]]),
93994f65c74c Removed hermes since it's LGPL and not compatible with a commercial license.
Sam Lantinga <slouken@libsdl.org>
parents: 2238
diff changeset
   526
                  , enable_sse=yes)
93994f65c74c Removed hermes since it's LGPL and not compatible with a commercial license.
Sam Lantinga <slouken@libsdl.org>
parents: 2238
diff changeset
   527
    if test x$enable_sse = xyes; then
93994f65c74c Removed hermes since it's LGPL and not compatible with a commercial license.
Sam Lantinga <slouken@libsdl.org>
parents: 2238
diff changeset
   528
        save_CFLAGS="$CFLAGS"
93994f65c74c Removed hermes since it's LGPL and not compatible with a commercial license.
Sam Lantinga <slouken@libsdl.org>
parents: 2238
diff changeset
   529
        have_gcc_sse=no
93994f65c74c Removed hermes since it's LGPL and not compatible with a commercial license.
Sam Lantinga <slouken@libsdl.org>
parents: 2238
diff changeset
   530
        AC_MSG_CHECKING(for GCC -msse option)
93994f65c74c Removed hermes since it's LGPL and not compatible with a commercial license.
Sam Lantinga <slouken@libsdl.org>
parents: 2238
diff changeset
   531
        sse_CFLAGS="-msse"
93994f65c74c Removed hermes since it's LGPL and not compatible with a commercial license.
Sam Lantinga <slouken@libsdl.org>
parents: 2238
diff changeset
   532
        CFLAGS="$save_CFLAGS $sse_CFLAGS"
93994f65c74c Removed hermes since it's LGPL and not compatible with a commercial license.
Sam Lantinga <slouken@libsdl.org>
parents: 2238
diff changeset
   533
93994f65c74c Removed hermes since it's LGPL and not compatible with a commercial license.
Sam Lantinga <slouken@libsdl.org>
parents: 2238
diff changeset
   534
        AC_TRY_COMPILE([
4426
1bceff8f008f Fixed bug #943
Sam Lantinga <slouken@libsdl.org>
parents: 3696
diff changeset
   535
        #ifdef __MINGW32__
1bceff8f008f Fixed bug #943
Sam Lantinga <slouken@libsdl.org>
parents: 3696
diff changeset
   536
        #include <_mingw.h>
1bceff8f008f Fixed bug #943
Sam Lantinga <slouken@libsdl.org>
parents: 3696
diff changeset
   537
        #ifdef __MINGW64_VERSION_MAJOR
1bceff8f008f Fixed bug #943
Sam Lantinga <slouken@libsdl.org>
parents: 3696
diff changeset
   538
        #include <intrin.h>
1bceff8f008f Fixed bug #943
Sam Lantinga <slouken@libsdl.org>
parents: 3696
diff changeset
   539
        #else
2247
93994f65c74c Removed hermes since it's LGPL and not compatible with a commercial license.
Sam Lantinga <slouken@libsdl.org>
parents: 2238
diff changeset
   540
        #include <xmmintrin.h>
4426
1bceff8f008f Fixed bug #943
Sam Lantinga <slouken@libsdl.org>
parents: 3696
diff changeset
   541
        #endif
1bceff8f008f Fixed bug #943
Sam Lantinga <slouken@libsdl.org>
parents: 3696
diff changeset
   542
        #else
1bceff8f008f Fixed bug #943
Sam Lantinga <slouken@libsdl.org>
parents: 3696
diff changeset
   543
        #include <xmmintrin.h>
1bceff8f008f Fixed bug #943
Sam Lantinga <slouken@libsdl.org>
parents: 3696
diff changeset
   544
        #endif
2261
c20476d7d7b3 Enabled 3DNow! intrinsic support
Sam Lantinga <slouken@libsdl.org>
parents: 2247
diff changeset
   545
        #ifndef __SSE__
c20476d7d7b3 Enabled 3DNow! intrinsic support
Sam Lantinga <slouken@libsdl.org>
parents: 2247
diff changeset
   546
        #error Assembler CPP flag not enabled
c20476d7d7b3 Enabled 3DNow! intrinsic support
Sam Lantinga <slouken@libsdl.org>
parents: 2247
diff changeset
   547
        #endif
2247
93994f65c74c Removed hermes since it's LGPL and not compatible with a commercial license.
Sam Lantinga <slouken@libsdl.org>
parents: 2238
diff changeset
   548
        ],[
93994f65c74c Removed hermes since it's LGPL and not compatible with a commercial license.
Sam Lantinga <slouken@libsdl.org>
parents: 2238
diff changeset
   549
        ],[
93994f65c74c Removed hermes since it's LGPL and not compatible with a commercial license.
Sam Lantinga <slouken@libsdl.org>
parents: 2238
diff changeset
   550
        have_gcc_sse=yes
93994f65c74c Removed hermes since it's LGPL and not compatible with a commercial license.
Sam Lantinga <slouken@libsdl.org>
parents: 2238
diff changeset
   551
        ])
93994f65c74c Removed hermes since it's LGPL and not compatible with a commercial license.
Sam Lantinga <slouken@libsdl.org>
parents: 2238
diff changeset
   552
        AC_MSG_RESULT($have_gcc_sse)
2290
323a5af2924b Christian Walther fixed bug #530
Sam Lantinga <slouken@libsdl.org>
parents: 2271
diff changeset
   553
        CFLAGS="$save_CFLAGS"
2247
93994f65c74c Removed hermes since it's LGPL and not compatible with a commercial license.
Sam Lantinga <slouken@libsdl.org>
parents: 2238
diff changeset
   554
93994f65c74c Removed hermes since it's LGPL and not compatible with a commercial license.
Sam Lantinga <slouken@libsdl.org>
parents: 2238
diff changeset
   555
        if test x$have_gcc_sse = xyes; then
93994f65c74c Removed hermes since it's LGPL and not compatible with a commercial license.
Sam Lantinga <slouken@libsdl.org>
parents: 2238
diff changeset
   556
            EXTRA_CFLAGS="$EXTRA_CFLAGS $sse_CFLAGS"
93994f65c74c Removed hermes since it's LGPL and not compatible with a commercial license.
Sam Lantinga <slouken@libsdl.org>
parents: 2238
diff changeset
   557
        fi
93994f65c74c Removed hermes since it's LGPL and not compatible with a commercial license.
Sam Lantinga <slouken@libsdl.org>
parents: 2238
diff changeset
   558
    fi
93994f65c74c Removed hermes since it's LGPL and not compatible with a commercial license.
Sam Lantinga <slouken@libsdl.org>
parents: 2238
diff changeset
   559
2264
f7f80b822c1f Enabled SSE2 intrinsics
Sam Lantinga <slouken@libsdl.org>
parents: 2261
diff changeset
   560
    AC_ARG_ENABLE(sse2,
2856
c765f5fa4a2c Default SSE2 off on iX86, since gcc will use it for floating point operations
Sam Lantinga <slouken@libsdl.org>
parents: 2820
diff changeset
   561
AC_HELP_STRING([--enable-sse2], [use SSE2 assembly routines [[default=no]]]),
c765f5fa4a2c Default SSE2 off on iX86, since gcc will use it for floating point operations
Sam Lantinga <slouken@libsdl.org>
parents: 2820
diff changeset
   562
                  , enable_sse2=$default_ssemath)
2264
f7f80b822c1f Enabled SSE2 intrinsics
Sam Lantinga <slouken@libsdl.org>
parents: 2261
diff changeset
   563
    if test x$enable_sse2 = xyes; then
f7f80b822c1f Enabled SSE2 intrinsics
Sam Lantinga <slouken@libsdl.org>
parents: 2261
diff changeset
   564
        save_CFLAGS="$CFLAGS"
f7f80b822c1f Enabled SSE2 intrinsics
Sam Lantinga <slouken@libsdl.org>
parents: 2261
diff changeset
   565
        have_gcc_sse2=no
f7f80b822c1f Enabled SSE2 intrinsics
Sam Lantinga <slouken@libsdl.org>
parents: 2261
diff changeset
   566
        AC_MSG_CHECKING(for GCC -msse2 option)
f7f80b822c1f Enabled SSE2 intrinsics
Sam Lantinga <slouken@libsdl.org>
parents: 2261
diff changeset
   567
        sse2_CFLAGS="-msse2"
f7f80b822c1f Enabled SSE2 intrinsics
Sam Lantinga <slouken@libsdl.org>
parents: 2261
diff changeset
   568
        CFLAGS="$save_CFLAGS $sse2_CFLAGS"
f7f80b822c1f Enabled SSE2 intrinsics
Sam Lantinga <slouken@libsdl.org>
parents: 2261
diff changeset
   569
f7f80b822c1f Enabled SSE2 intrinsics
Sam Lantinga <slouken@libsdl.org>
parents: 2261
diff changeset
   570
        AC_TRY_COMPILE([
4426
1bceff8f008f Fixed bug #943
Sam Lantinga <slouken@libsdl.org>
parents: 3696
diff changeset
   571
        #ifdef __MINGW32__
1bceff8f008f Fixed bug #943
Sam Lantinga <slouken@libsdl.org>
parents: 3696
diff changeset
   572
        #include <_mingw.h>
1bceff8f008f Fixed bug #943
Sam Lantinga <slouken@libsdl.org>
parents: 3696
diff changeset
   573
        #ifdef __MINGW64_VERSION_MAJOR
1bceff8f008f Fixed bug #943
Sam Lantinga <slouken@libsdl.org>
parents: 3696
diff changeset
   574
        #include <intrin.h>
1bceff8f008f Fixed bug #943
Sam Lantinga <slouken@libsdl.org>
parents: 3696
diff changeset
   575
        #else
2264
f7f80b822c1f Enabled SSE2 intrinsics
Sam Lantinga <slouken@libsdl.org>
parents: 2261
diff changeset
   576
        #include <emmintrin.h>
4426
1bceff8f008f Fixed bug #943
Sam Lantinga <slouken@libsdl.org>
parents: 3696
diff changeset
   577
        #endif
1bceff8f008f Fixed bug #943
Sam Lantinga <slouken@libsdl.org>
parents: 3696
diff changeset
   578
        #else
1bceff8f008f Fixed bug #943
Sam Lantinga <slouken@libsdl.org>
parents: 3696
diff changeset
   579
        #include <emmintrin.h>
1bceff8f008f Fixed bug #943
Sam Lantinga <slouken@libsdl.org>
parents: 3696
diff changeset
   580
        #endif
2264
f7f80b822c1f Enabled SSE2 intrinsics
Sam Lantinga <slouken@libsdl.org>
parents: 2261
diff changeset
   581
        #ifndef __SSE2__
f7f80b822c1f Enabled SSE2 intrinsics
Sam Lantinga <slouken@libsdl.org>
parents: 2261
diff changeset
   582
        #error Assembler CPP flag not enabled
f7f80b822c1f Enabled SSE2 intrinsics
Sam Lantinga <slouken@libsdl.org>
parents: 2261
diff changeset
   583
        #endif
f7f80b822c1f Enabled SSE2 intrinsics
Sam Lantinga <slouken@libsdl.org>
parents: 2261
diff changeset
   584
        ],[
f7f80b822c1f Enabled SSE2 intrinsics
Sam Lantinga <slouken@libsdl.org>
parents: 2261
diff changeset
   585
        ],[
f7f80b822c1f Enabled SSE2 intrinsics
Sam Lantinga <slouken@libsdl.org>
parents: 2261
diff changeset
   586
        have_gcc_sse2=yes
f7f80b822c1f Enabled SSE2 intrinsics
Sam Lantinga <slouken@libsdl.org>
parents: 2261
diff changeset
   587
        ])
f7f80b822c1f Enabled SSE2 intrinsics
Sam Lantinga <slouken@libsdl.org>
parents: 2261
diff changeset
   588
        AC_MSG_RESULT($have_gcc_sse2)
2290
323a5af2924b Christian Walther fixed bug #530
Sam Lantinga <slouken@libsdl.org>
parents: 2271
diff changeset
   589
        CFLAGS="$save_CFLAGS"
2264
f7f80b822c1f Enabled SSE2 intrinsics
Sam Lantinga <slouken@libsdl.org>
parents: 2261
diff changeset
   590
f7f80b822c1f Enabled SSE2 intrinsics
Sam Lantinga <slouken@libsdl.org>
parents: 2261
diff changeset
   591
        if test x$have_gcc_sse2 = xyes; then
f7f80b822c1f Enabled SSE2 intrinsics
Sam Lantinga <slouken@libsdl.org>
parents: 2261
diff changeset
   592
            EXTRA_CFLAGS="$EXTRA_CFLAGS $sse2_CFLAGS"
f7f80b822c1f Enabled SSE2 intrinsics
Sam Lantinga <slouken@libsdl.org>
parents: 2261
diff changeset
   593
        fi
f7f80b822c1f Enabled SSE2 intrinsics
Sam Lantinga <slouken@libsdl.org>
parents: 2261
diff changeset
   594
    fi
5389
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   595
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   596
    AC_ARG_ENABLE(altivec,
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   597
AC_HELP_STRING([--enable-altivec], [use Altivec assembly routines [[default=yes]]]),
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   598
                  , enable_altivec=yes)
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   599
    if test x$enable_altivec = xyes; then
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   600
        save_CFLAGS="$CFLAGS"
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   601
        have_gcc_altivec=no
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   602
        have_altivec_h_hdr=no
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   603
        altivec_CFLAGS="-maltivec"
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   604
        CFLAGS="$save_CFLAGS $altivec_CFLAGS"
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   605
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   606
        AC_MSG_CHECKING(for Altivec with GCC altivec.h and -maltivec option)
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   607
        AC_TRY_COMPILE([
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   608
        #include <altivec.h>
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   609
        vector unsigned int vzero() {
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   610
            return vec_splat_u32(0);
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   611
        }
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   612
        ],[
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   613
        ],[
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   614
        have_gcc_altivec=yes
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   615
        have_altivec_h_hdr=yes
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   616
        ])
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   617
        AC_MSG_RESULT($have_gcc_altivec)
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   618
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   619
        if test x$have_gcc_altivec = xno; then
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   620
            AC_MSG_CHECKING(for Altivec with GCC -maltivec option)
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   621
            AC_TRY_COMPILE([
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   622
            vector unsigned int vzero() {
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   623
                return vec_splat_u32(0);
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   624
            }
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   625
            ],[
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   626
            ],[
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   627
            have_gcc_altivec=yes
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   628
            ])
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   629
            AC_MSG_RESULT($have_gcc_altivec)
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   630
        fi
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   631
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   632
        if test x$have_gcc_altivec = xno; then
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   633
            AC_MSG_CHECKING(for Altivec with GCC altivec.h and -faltivec option)
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   634
            altivec_CFLAGS="-faltivec"
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   635
            CFLAGS="$save_CFLAGS $altivec_CFLAGS"
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   636
            AC_TRY_COMPILE([
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   637
            #include <altivec.h>
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   638
            vector unsigned int vzero() {
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   639
                return vec_splat_u32(0);
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   640
            }
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   641
            ],[
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   642
            ],[
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   643
            have_gcc_altivec=yes
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   644
            have_altivec_h_hdr=yes
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   645
            ])
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   646
            AC_MSG_RESULT($have_gcc_altivec)
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   647
        fi
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   648
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   649
        if test x$have_gcc_altivec = xno; then
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   650
            AC_MSG_CHECKING(for Altivec with GCC -faltivec option)
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   651
            AC_TRY_COMPILE([
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   652
            vector unsigned int vzero() {
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   653
                return vec_splat_u32(0);
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   654
            }
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   655
            ],[
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   656
            ],[
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   657
            have_gcc_altivec=yes
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   658
            ])
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   659
            AC_MSG_RESULT($have_gcc_altivec)
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   660
        fi
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   661
        CFLAGS="$save_CFLAGS"
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   662
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   663
        if test x$have_gcc_altivec = xyes; then
5548
8f0abb6ef37d Updated configure.in to be compatible with autoconf 2.67.
Ryan C. Gordon <icculus@icculus.org>
parents: 5512
diff changeset
   664
            AC_DEFINE(SDL_ALTIVEC_BLITTERS, 1, [ ])
5389
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   665
            if test x$have_altivec_h_hdr = xyes; then
5548
8f0abb6ef37d Updated configure.in to be compatible with autoconf 2.67.
Ryan C. Gordon <icculus@icculus.org>
parents: 5512
diff changeset
   666
              AC_DEFINE(HAVE_ALTIVEC_H, 1, [ ])
5389
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   667
            fi
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   668
            EXTRA_CFLAGS="$EXTRA_CFLAGS $altivec_CFLAGS"
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   669
        fi
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   670
    fi
740
e70f80e98f60 Actually hook the cpuinfo module into the library. :)
Sam Lantinga <slouken@libsdl.org>
parents: 739
diff changeset
   671
fi
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   672
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   673
dnl See if the OSS audio interface is supported
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   674
CheckOSS()
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   675
{
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   676
    AC_ARG_ENABLE(oss,
7380
e5830832d3f0 Disable OSS and BSD audio targets on OpenBSD.
Ryan C. Gordon <icculus@icculus.org>
parents: 7379
diff changeset
   677
AC_HELP_STRING([--enable-oss], [support the OSS audio API [[default=maybe]]]),
e5830832d3f0 Disable OSS and BSD audio targets on OpenBSD.
Ryan C. Gordon <icculus@icculus.org>
parents: 7379
diff changeset
   678
                  , enable_oss=maybe)
e5830832d3f0 Disable OSS and BSD audio targets on OpenBSD.
Ryan C. Gordon <icculus@icculus.org>
parents: 7379
diff changeset
   679
e5830832d3f0 Disable OSS and BSD audio targets on OpenBSD.
Ryan C. Gordon <icculus@icculus.org>
parents: 7379
diff changeset
   680
    # OpenBSD "has" OSS, but it's not really for app use. They want you to
e5830832d3f0 Disable OSS and BSD audio targets on OpenBSD.
Ryan C. Gordon <icculus@icculus.org>
parents: 7379
diff changeset
   681
    #  use sndio instead. So on there, we default to disabled. You can force
e5830832d3f0 Disable OSS and BSD audio targets on OpenBSD.
Ryan C. Gordon <icculus@icculus.org>
parents: 7379
diff changeset
   682
    #  it on if you really want, though.
e5830832d3f0 Disable OSS and BSD audio targets on OpenBSD.
Ryan C. Gordon <icculus@icculus.org>
parents: 7379
diff changeset
   683
    if test x$enable_oss = xmaybe; then
e5830832d3f0 Disable OSS and BSD audio targets on OpenBSD.
Ryan C. Gordon <icculus@icculus.org>
parents: 7379
diff changeset
   684
        enable_oss=yes
e5830832d3f0 Disable OSS and BSD audio targets on OpenBSD.
Ryan C. Gordon <icculus@icculus.org>
parents: 7379
diff changeset
   685
        case "$host" in
e5830832d3f0 Disable OSS and BSD audio targets on OpenBSD.
Ryan C. Gordon <icculus@icculus.org>
parents: 7379
diff changeset
   686
            *-*-openbsd*)
e5830832d3f0 Disable OSS and BSD audio targets on OpenBSD.
Ryan C. Gordon <icculus@icculus.org>
parents: 7379
diff changeset
   687
                enable_oss=no;;
7391
a29895dc5e9a Implemented an API for thread-local storage: SDL_TLSCreate(), SDL_TLSSet(), SDL_TLSGet()
Sam Lantinga <slouken@libsdl.org>
parents: 7388
diff changeset
   688
        esac
7380
e5830832d3f0 Disable OSS and BSD audio targets on OpenBSD.
Ryan C. Gordon <icculus@icculus.org>
parents: 7379
diff changeset
   689
    fi
e5830832d3f0 Disable OSS and BSD audio targets on OpenBSD.
Ryan C. Gordon <icculus@icculus.org>
parents: 7379
diff changeset
   690
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   691
    if test x$enable_audio = xyes -a x$enable_oss = xyes; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   692
        AC_MSG_CHECKING(for OSS audio support)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   693
        have_oss=no
94
ae6e6b73333f Cleaned up the OpenBSD port, thanks to Peter Valchev
Sam Lantinga <slouken@lokigames.com>
parents: 86
diff changeset
   694
        if test x$have_oss != xyes; then
ae6e6b73333f Cleaned up the OpenBSD port, thanks to Peter Valchev
Sam Lantinga <slouken@lokigames.com>
parents: 86
diff changeset
   695
            AC_TRY_COMPILE([
ae6e6b73333f Cleaned up the OpenBSD port, thanks to Peter Valchev
Sam Lantinga <slouken@lokigames.com>
parents: 86
diff changeset
   696
              #include <sys/soundcard.h>
ae6e6b73333f Cleaned up the OpenBSD port, thanks to Peter Valchev
Sam Lantinga <slouken@lokigames.com>
parents: 86
diff changeset
   697
            ],[
ae6e6b73333f Cleaned up the OpenBSD port, thanks to Peter Valchev
Sam Lantinga <slouken@lokigames.com>
parents: 86
diff changeset
   698
              int arg = SNDCTL_DSP_SETFRAGMENT;
ae6e6b73333f Cleaned up the OpenBSD port, thanks to Peter Valchev
Sam Lantinga <slouken@lokigames.com>
parents: 86
diff changeset
   699
            ],[
ae6e6b73333f Cleaned up the OpenBSD port, thanks to Peter Valchev
Sam Lantinga <slouken@lokigames.com>
parents: 86
diff changeset
   700
            have_oss=yes
ae6e6b73333f Cleaned up the OpenBSD port, thanks to Peter Valchev
Sam Lantinga <slouken@lokigames.com>
parents: 86
diff changeset
   701
            ])
ae6e6b73333f Cleaned up the OpenBSD port, thanks to Peter Valchev
Sam Lantinga <slouken@lokigames.com>
parents: 86
diff changeset
   702
        fi
ae6e6b73333f Cleaned up the OpenBSD port, thanks to Peter Valchev
Sam Lantinga <slouken@lokigames.com>
parents: 86
diff changeset
   703
        if test x$have_oss != xyes; then
ae6e6b73333f Cleaned up the OpenBSD port, thanks to Peter Valchev
Sam Lantinga <slouken@lokigames.com>
parents: 86
diff changeset
   704
            AC_TRY_COMPILE([
ae6e6b73333f Cleaned up the OpenBSD port, thanks to Peter Valchev
Sam Lantinga <slouken@lokigames.com>
parents: 86
diff changeset
   705
              #include <soundcard.h>
ae6e6b73333f Cleaned up the OpenBSD port, thanks to Peter Valchev
Sam Lantinga <slouken@lokigames.com>
parents: 86
diff changeset
   706
            ],[
ae6e6b73333f Cleaned up the OpenBSD port, thanks to Peter Valchev
Sam Lantinga <slouken@lokigames.com>
parents: 86
diff changeset
   707
              int arg = SNDCTL_DSP_SETFRAGMENT;
ae6e6b73333f Cleaned up the OpenBSD port, thanks to Peter Valchev
Sam Lantinga <slouken@lokigames.com>
parents: 86
diff changeset
   708
            ],[
ae6e6b73333f Cleaned up the OpenBSD port, thanks to Peter Valchev
Sam Lantinga <slouken@lokigames.com>
parents: 86
diff changeset
   709
            have_oss=yes
5548
8f0abb6ef37d Updated configure.in to be compatible with autoconf 2.67.
Ryan C. Gordon <icculus@icculus.org>
parents: 5512
diff changeset
   710
            AC_DEFINE(SDL_AUDIO_DRIVER_OSS_SOUNDCARD_H, 1, [ ])
94
ae6e6b73333f Cleaned up the OpenBSD port, thanks to Peter Valchev
Sam Lantinga <slouken@lokigames.com>
parents: 86
diff changeset
   711
            ])
ae6e6b73333f Cleaned up the OpenBSD port, thanks to Peter Valchev
Sam Lantinga <slouken@lokigames.com>
parents: 86
diff changeset
   712
        fi
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   713
        AC_MSG_RESULT($have_oss)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   714
        if test x$have_oss = xyes; then
5548
8f0abb6ef37d Updated configure.in to be compatible with autoconf 2.67.
Ryan C. Gordon <icculus@icculus.org>
parents: 5512
diff changeset
   715
            AC_DEFINE(SDL_AUDIO_DRIVER_OSS, 1, [ ])
1361
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents: 1354
diff changeset
   716
            SOURCES="$SOURCES $srcdir/src/audio/dsp/*.c"
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents: 1354
diff changeset
   717
            have_audio=yes
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents: 1354
diff changeset
   718
1565
57431b199aed Fixed bug #52
Sam Lantinga <slouken@libsdl.org>
parents: 1556
diff changeset
   719
            # We may need to link with ossaudio emulation library
1550
31c2b8e4885e Fixed bug #166
Sam Lantinga <slouken@libsdl.org>
parents: 1548
diff changeset
   720
            case "$host" in
1383
1736c5e2173f NetBSD support
Sam Lantinga <slouken@libsdl.org>
parents: 1380
diff changeset
   721
                *-*-openbsd*|*-*-netbsd*)
1521
9b9212e4810c CFLAGS are separate from EXTRA_CFLAGS
Sam Lantinga <slouken@libsdl.org>
parents: 1520
diff changeset
   722
                    EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lossaudio";;
1361
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents: 1354
diff changeset
   723
            esac
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   724
        fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   725
    fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   726
}
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   727
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   728
dnl See if the ALSA audio interface is supported
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   729
CheckALSA()
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   730
{
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   731
    AC_ARG_ENABLE(alsa,
1637
9ba366b919c7 Date: Fri, 31 Mar 2006 18:28:55 -0500
Sam Lantinga <slouken@libsdl.org>
parents: 1632
diff changeset
   732
AC_HELP_STRING([--enable-alsa], [support the ALSA audio API [[default=yes]]]),
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   733
                  , enable_alsa=yes)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   734
    if test x$enable_audio = xyes -a x$enable_alsa = xyes; then
948
ac488ad4ef1d Don't fail if we don't have ALSA available
Sam Lantinga <slouken@libsdl.org>
parents: 939
diff changeset
   735
        AM_PATH_ALSA(0.9.0, have_alsa=yes, have_alsa=no)
1009
027688378762 No really, don't link with the ALSA library!
Sam Lantinga <slouken@libsdl.org>
parents: 991
diff changeset
   736
        # Restore all flags from before the ALSA detection runs
027688378762 No really, don't link with the ALSA library!
Sam Lantinga <slouken@libsdl.org>
parents: 991
diff changeset
   737
        CFLAGS="$alsa_save_CFLAGS"
027688378762 No really, don't link with the ALSA library!
Sam Lantinga <slouken@libsdl.org>
parents: 991
diff changeset
   738
        LDFLAGS="$alsa_save_LDFLAGS"
027688378762 No really, don't link with the ALSA library!
Sam Lantinga <slouken@libsdl.org>
parents: 991
diff changeset
   739
        LIBS="$alsa_save_LIBS"
354
30935e76acb5 Updated ALSA audio support for ALSA 0.9
Sam Lantinga <slouken@libsdl.org>
parents: 350
diff changeset
   740
        if test x$have_alsa = xyes; then
865
92615154bb68 Date: Sun, 29 Feb 2004 15:14:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents: 856
diff changeset
   741
            AC_ARG_ENABLE(alsa-shared,
1637
9ba366b919c7 Date: Fri, 31 Mar 2006 18:28:55 -0500
Sam Lantinga <slouken@libsdl.org>
parents: 1632
diff changeset
   742
AC_HELP_STRING([--enable-alsa-shared], [dynamically load ALSA audio support [[default=yes]]]),
1361
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents: 1354
diff changeset
   743
                          , enable_alsa_shared=yes)
3391
188fc5ecc58c Simplify and improve dynamic library detection, taken from SDL_image
Sam Lantinga <slouken@libsdl.org>
parents: 3390
diff changeset
   744
            alsa_lib=[`find_lib "libasound.so.*" "$ALSA_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`]
1361
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents: 1354
diff changeset
   745
5548
8f0abb6ef37d Updated configure.in to be compatible with autoconf 2.67.
Ryan C. Gordon <icculus@icculus.org>
parents: 5512
diff changeset
   746
            AC_DEFINE(SDL_AUDIO_DRIVER_ALSA, 1, [ ])
1361
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents: 1354
diff changeset
   747
            SOURCES="$SOURCES $srcdir/src/audio/alsa/*.c"
1521
9b9212e4810c CFLAGS are separate from EXTRA_CFLAGS
Sam Lantinga <slouken@libsdl.org>
parents: 1520
diff changeset
   748
            EXTRA_CFLAGS="$EXTRA_CFLAGS $ALSA_CFLAGS"
1361
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents: 1354
diff changeset
   749
            if test x$have_loadso != xyes && \
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents: 1354
diff changeset
   750
               test x$enable_alsa_shared = xyes; then
1467
b69f2b0309a0 Removed accidentally copied/pasted script for ALSA detection
Sam Lantinga <slouken@libsdl.org>
parents: 1459
diff changeset
   751
                AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic ALSA loading])
1361
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents: 1354
diff changeset
   752
            fi
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents: 1354
diff changeset
   753
            if test x$have_loadso = xyes && \
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents: 1354
diff changeset
   754
               test x$enable_alsa_shared = xyes && test x$alsa_lib != x; then
3392
efc22582afc5 Only show the dynamic audio libraries if we'll be dynamically loading them
Sam Lantinga <slouken@libsdl.org>
parents: 3391
diff changeset
   755
                echo "-- dynamic libasound -> $alsa_lib"
5548
8f0abb6ef37d Updated configure.in to be compatible with autoconf 2.67.
Ryan C. Gordon <icculus@icculus.org>
parents: 5512
diff changeset
   756
                AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_ALSA_DYNAMIC, "$alsa_lib", [ ])
1361
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents: 1354
diff changeset
   757
            else
1521
9b9212e4810c CFLAGS are separate from EXTRA_CFLAGS
Sam Lantinga <slouken@libsdl.org>
parents: 1520
diff changeset
   758
                EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ALSA_LIBS"
1361
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents: 1354
diff changeset
   759
            fi
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents: 1354
diff changeset
   760
            have_audio=yes
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents: 1354
diff changeset
   761
        fi
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents: 1354
diff changeset
   762
    fi
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   763
}
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   764
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   765
dnl Find the ESD includes and libraries
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   766
CheckESD()
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   767
{
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   768
    AC_ARG_ENABLE(esd,
1637
9ba366b919c7 Date: Fri, 31 Mar 2006 18:28:55 -0500
Sam Lantinga <slouken@libsdl.org>
parents: 1632
diff changeset
   769
AC_HELP_STRING([--enable-esd], [support the Enlightened Sound Daemon [[default=yes]]]),
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   770
                  , enable_esd=yes)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   771
    if test x$enable_audio = xyes -a x$enable_esd = xyes; then
948
ac488ad4ef1d Don't fail if we don't have ALSA available
Sam Lantinga <slouken@libsdl.org>
parents: 939
diff changeset
   772
        AM_PATH_ESD(0.2.8, have_esd=yes, have_esd=no)
ac488ad4ef1d Don't fail if we don't have ALSA available
Sam Lantinga <slouken@libsdl.org>
parents: 939
diff changeset
   773
        if test x$have_esd = xyes; then
294
d2d48e10f370 Added a new header file: SDL_loadso.h
Sam Lantinga <slouken@libsdl.org>
parents: 292
diff changeset
   774
            AC_ARG_ENABLE(esd-shared,
1637
9ba366b919c7 Date: Fri, 31 Mar 2006 18:28:55 -0500
Sam Lantinga <slouken@libsdl.org>
parents: 1632
diff changeset
   775
AC_HELP_STRING([--enable-esd-shared], [dynamically load ESD audio support [[default=yes]]]),
678
7f691fa4c1c7 Turn dynamic loading of esd and arts on by default
Sam Lantinga <slouken@libsdl.org>
parents: 675
diff changeset
   776
                          , enable_esd_shared=yes)
3391
188fc5ecc58c Simplify and improve dynamic library detection, taken from SDL_image
Sam Lantinga <slouken@libsdl.org>
parents: 3390
diff changeset
   777
            esd_lib=[`find_lib "libesd.so.*" "$ESD_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`]
1467
b69f2b0309a0 Removed accidentally copied/pasted script for ALSA detection
Sam Lantinga <slouken@libsdl.org>
parents: 1459
diff changeset
   778
5548
8f0abb6ef37d Updated configure.in to be compatible with autoconf 2.67.
Ryan C. Gordon <icculus@icculus.org>
parents: 5512
diff changeset
   779
            AC_DEFINE(SDL_AUDIO_DRIVER_ESD, 1, [ ])
1467
b69f2b0309a0 Removed accidentally copied/pasted script for ALSA detection
Sam Lantinga <slouken@libsdl.org>
parents: 1459
diff changeset
   780
            SOURCES="$SOURCES $srcdir/src/audio/esd/*.c"
1521
9b9212e4810c CFLAGS are separate from EXTRA_CFLAGS
Sam Lantinga <slouken@libsdl.org>
parents: 1520
diff changeset
   781
            EXTRA_CFLAGS="$EXTRA_CFLAGS $ESD_CFLAGS"
1173
e9cf8c1b4590 Split up src/SDL_loadso.c into platform directories.
Ryan C. Gordon <icculus@icculus.org>
parents: 1170
diff changeset
   782
            if test x$have_loadso != xyes && \
296
fab1ddc4d7bf Removed the API changes to preserve SDL 1.2 stability
Sam Lantinga <slouken@libsdl.org>
parents: 295
diff changeset
   783
               test x$enable_esd_shared = xyes; then
1467
b69f2b0309a0 Removed accidentally copied/pasted script for ALSA detection
Sam Lantinga <slouken@libsdl.org>
parents: 1459
diff changeset
   784
                AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic ESD loading])
296
fab1ddc4d7bf Removed the API changes to preserve SDL 1.2 stability
Sam Lantinga <slouken@libsdl.org>
parents: 295
diff changeset
   785
            fi
1173
e9cf8c1b4590 Split up src/SDL_loadso.c into platform directories.
Ryan C. Gordon <icculus@icculus.org>
parents: 1170
diff changeset
   786
            if test x$have_loadso = xyes && \
294
d2d48e10f370 Added a new header file: SDL_loadso.h
Sam Lantinga <slouken@libsdl.org>
parents: 292
diff changeset
   787
               test x$enable_esd_shared = xyes && test x$esd_lib != x; then
3392
efc22582afc5 Only show the dynamic audio libraries if we'll be dynamically loading them
Sam Lantinga <slouken@libsdl.org>
parents: 3391
diff changeset
   788
                echo "-- dynamic libesd -> $esd_lib"
5548
8f0abb6ef37d Updated configure.in to be compatible with autoconf 2.67.
Ryan C. Gordon <icculus@icculus.org>
parents: 5512
diff changeset
   789
                AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_ESD_DYNAMIC, "$esd_lib", [ ])
1467
b69f2b0309a0 Removed accidentally copied/pasted script for ALSA detection
Sam Lantinga <slouken@libsdl.org>
parents: 1459
diff changeset
   790
            else
1521
9b9212e4810c CFLAGS are separate from EXTRA_CFLAGS
Sam Lantinga <slouken@libsdl.org>
parents: 1520
diff changeset
   791
                EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ESD_LIBS"
294
d2d48e10f370 Added a new header file: SDL_loadso.h
Sam Lantinga <slouken@libsdl.org>
parents: 292
diff changeset
   792
            fi
1361
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents: 1354
diff changeset
   793
            have_audio=yes
294
d2d48e10f370 Added a new header file: SDL_loadso.h
Sam Lantinga <slouken@libsdl.org>
parents: 292
diff changeset
   794
        fi
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   795
    fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   796
}
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   797
2271
60b4c52a7906 Ported PulseAudio target from 1.2 to 1.3 interfaces, and added it to the trunk.
Ryan C. Gordon <icculus@icculus.org>
parents: 2264
diff changeset
   798
dnl Find PulseAudio
60b4c52a7906 Ported PulseAudio target from 1.2 to 1.3 interfaces, and added it to the trunk.
Ryan C. Gordon <icculus@icculus.org>
parents: 2264
diff changeset
   799
CheckPulseAudio()
60b4c52a7906 Ported PulseAudio target from 1.2 to 1.3 interfaces, and added it to the trunk.
Ryan C. Gordon <icculus@icculus.org>
parents: 2264
diff changeset
   800
{
60b4c52a7906 Ported PulseAudio target from 1.2 to 1.3 interfaces, and added it to the trunk.
Ryan C. Gordon <icculus@icculus.org>
parents: 2264
diff changeset
   801
    AC_ARG_ENABLE(pulseaudio,
60b4c52a7906 Ported PulseAudio target from 1.2 to 1.3 interfaces, and added it to the trunk.
Ryan C. Gordon <icculus@icculus.org>
parents: 2264
diff changeset
   802
AC_HELP_STRING([--enable-pulseaudio], [use PulseAudio [[default=yes]]]),
60b4c52a7906 Ported PulseAudio target from 1.2 to 1.3 interfaces, and added it to the trunk.
Ryan C. Gordon <icculus@icculus.org>
parents: 2264
diff changeset
   803
                  , enable_pulseaudio=yes)
60b4c52a7906 Ported PulseAudio target from 1.2 to 1.3 interfaces, and added it to the trunk.
Ryan C. Gordon <icculus@icculus.org>
parents: 2264
diff changeset
   804
    if test x$enable_audio = xyes -a x$enable_pulseaudio = xyes; then
60b4c52a7906 Ported PulseAudio target from 1.2 to 1.3 interfaces, and added it to the trunk.
Ryan C. Gordon <icculus@icculus.org>
parents: 2264
diff changeset
   805
        audio_pulseaudio=no
60b4c52a7906 Ported PulseAudio target from 1.2 to 1.3 interfaces, and added it to the trunk.
Ryan C. Gordon <icculus@icculus.org>
parents: 2264
diff changeset
   806
60b4c52a7906 Ported PulseAudio target from 1.2 to 1.3 interfaces, and added it to the trunk.
Ryan C. Gordon <icculus@icculus.org>
parents: 2264
diff changeset
   807
        PULSEAUDIO_REQUIRED_VERSION=0.9
60b4c52a7906 Ported PulseAudio target from 1.2 to 1.3 interfaces, and added it to the trunk.
Ryan C. Gordon <icculus@icculus.org>
parents: 2264
diff changeset
   808
60b4c52a7906 Ported PulseAudio target from 1.2 to 1.3 interfaces, and added it to the trunk.
Ryan C. Gordon <icculus@icculus.org>
parents: 2264
diff changeset
   809
        AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
60b4c52a7906 Ported PulseAudio target from 1.2 to 1.3 interfaces, and added it to the trunk.
Ryan C. Gordon <icculus@icculus.org>
parents: 2264
diff changeset
   810
        AC_MSG_CHECKING(for PulseAudio $PULSEAUDIO_REQUIRED_VERSION support)
60b4c52a7906 Ported PulseAudio target from 1.2 to 1.3 interfaces, and added it to the trunk.
Ryan C. Gordon <icculus@icculus.org>
parents: 2264
diff changeset
   811
        if test x$PKG_CONFIG != xno; then
60b4c52a7906 Ported PulseAudio target from 1.2 to 1.3 interfaces, and added it to the trunk.
Ryan C. Gordon <icculus@icculus.org>
parents: 2264
diff changeset
   812
        if $PKG_CONFIG --atleast-pkgconfig-version 0.7 && $PKG_CONFIG --atleast-version $PULSEAUDIO_REQUIRED_VERSION libpulse-simple; then
60b4c52a7906 Ported PulseAudio target from 1.2 to 1.3 interfaces, and added it to the trunk.
Ryan C. Gordon <icculus@icculus.org>
parents: 2264
diff changeset
   813
                PULSEAUDIO_CFLAGS=`$PKG_CONFIG --cflags libpulse-simple`
60b4c52a7906 Ported PulseAudio target from 1.2 to 1.3 interfaces, and added it to the trunk.
Ryan C. Gordon <icculus@icculus.org>
parents: 2264
diff changeset
   814
                PULSEAUDIO_LIBS=`$PKG_CONFIG --libs libpulse-simple`
60b4c52a7906 Ported PulseAudio target from 1.2 to 1.3 interfaces, and added it to the trunk.
Ryan C. Gordon <icculus@icculus.org>
parents: 2264
diff changeset
   815
                audio_pulseaudio=yes
3391
188fc5ecc58c Simplify and improve dynamic library detection, taken from SDL_image
Sam Lantinga <slouken@libsdl.org>
parents: 3390
diff changeset
   816
            fi
2271
60b4c52a7906 Ported PulseAudio target from 1.2 to 1.3 interfaces, and added it to the trunk.
Ryan C. Gordon <icculus@icculus.org>
parents: 2264
diff changeset
   817
        fi
60b4c52a7906 Ported PulseAudio target from 1.2 to 1.3 interfaces, and added it to the trunk.
Ryan C. Gordon <icculus@icculus.org>
parents: 2264
diff changeset
   818
        AC_MSG_RESULT($audio_pulseaudio)
60b4c52a7906 Ported PulseAudio target from 1.2 to 1.3 interfaces, and added it to the trunk.
Ryan C. Gordon <icculus@icculus.org>
parents: 2264
diff changeset
   819
60b4c52a7906 Ported PulseAudio target from 1.2 to 1.3 interfaces, and added it to the trunk.
Ryan C. Gordon <icculus@icculus.org>
parents: 2264
diff changeset
   820
        if test x$audio_pulseaudio = xyes; then
60b4c52a7906 Ported PulseAudio target from 1.2 to 1.3 interfaces, and added it to the trunk.
Ryan C. Gordon <icculus@icculus.org>
parents: 2264
diff changeset
   821
            AC_ARG_ENABLE(pulseaudio-shared,
60b4c52a7906 Ported PulseAudio target from 1.2 to 1.3 interfaces, and added it to the trunk.
Ryan C. Gordon <icculus@icculus.org>
parents: 2264
diff changeset
   822
AC_HELP_STRING([--enable-pulseaudio-shared], [dynamically load PulseAudio support [[default=yes]]]),
60b4c52a7906 Ported PulseAudio target from 1.2 to 1.3 interfaces, and added it to the trunk.
Ryan C. Gordon <icculus@icculus.org>
parents: 2264
diff changeset
   823
                          , enable_pulseaudio_shared=yes)
3391
188fc5ecc58c Simplify and improve dynamic library detection, taken from SDL_image
Sam Lantinga <slouken@libsdl.org>
parents: 3390
diff changeset
   824
            pulseaudio_lib=[`find_lib "libpulse-simple.so.*" "$PULSEAUDIO_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`]
2271
60b4c52a7906 Ported PulseAudio target from 1.2 to 1.3 interfaces, and added it to the trunk.
Ryan C. Gordon <icculus@icculus.org>
parents: 2264
diff changeset
   825
5548
8f0abb6ef37d Updated configure.in to be compatible with autoconf 2.67.
Ryan C. Gordon <icculus@icculus.org>
parents: 5512
diff changeset
   826
            AC_DEFINE(SDL_AUDIO_DRIVER_PULSEAUDIO, 1, [ ])
2271
60b4c52a7906 Ported PulseAudio target from 1.2 to 1.3 interfaces, and added it to the trunk.
Ryan C. Gordon <icculus@icculus.org>
parents: 2264
diff changeset
   827
            SOURCES="$SOURCES $srcdir/src/audio/pulseaudio/*.c"
60b4c52a7906 Ported PulseAudio target from 1.2 to 1.3 interfaces, and added it to the trunk.
Ryan C. Gordon <icculus@icculus.org>
parents: 2264
diff changeset
   828
            EXTRA_CFLAGS="$EXTRA_CFLAGS $PULSEAUDIO_CFLAGS"
60b4c52a7906 Ported PulseAudio target from 1.2 to 1.3 interfaces, and added it to the trunk.
Ryan C. Gordon <icculus@icculus.org>
parents: 2264
diff changeset
   829
            if test x$have_loadso != xyes && \
60b4c52a7906 Ported PulseAudio target from 1.2 to 1.3 interfaces, and added it to the trunk.
Ryan C. Gordon <icculus@icculus.org>
parents: 2264
diff changeset
   830
               test x$enable_pulseaudio_shared = xyes; then
60b4c52a7906 Ported PulseAudio target from 1.2 to 1.3 interfaces, and added it to the trunk.
Ryan C. Gordon <icculus@icculus.org>
parents: 2264
diff changeset
   831
                AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic PulseAudio loading])
60b4c52a7906 Ported PulseAudio target from 1.2 to 1.3 interfaces, and added it to the trunk.
Ryan C. Gordon <icculus@icculus.org>
parents: 2264
diff changeset
   832
            fi
60b4c52a7906 Ported PulseAudio target from 1.2 to 1.3 interfaces, and added it to the trunk.
Ryan C. Gordon <icculus@icculus.org>
parents: 2264
diff changeset
   833
            if test x$have_loadso = xyes && \
60b4c52a7906 Ported PulseAudio target from 1.2 to 1.3 interfaces, and added it to the trunk.
Ryan C. Gordon <icculus@icculus.org>
parents: 2264
diff changeset
   834
               test x$enable_pulseaudio_shared = xyes && test x$pulseaudio_lib != x; then
3392
efc22582afc5 Only show the dynamic audio libraries if we'll be dynamically loading them
Sam Lantinga <slouken@libsdl.org>
parents: 3391
diff changeset
   835
                echo "-- dynamic libpulse-simple -> $pulseaudio_lib"
5548
8f0abb6ef37d Updated configure.in to be compatible with autoconf 2.67.
Ryan C. Gordon <icculus@icculus.org>
parents: 5512
diff changeset
   836
                AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_PULSEAUDIO_DYNAMIC, "$pulseaudio_lib", [ ])
6967
adc80d085ddf Fix pulseaudio dynamic linking for Solaris builds.
Shawn Walker <eviltypeguy@icculus.org>
parents: 6960
diff changeset
   837
adc80d085ddf Fix pulseaudio dynamic linking for Solaris builds.
Shawn Walker <eviltypeguy@icculus.org>
parents: 6960
diff changeset
   838
                case "$host" in
adc80d085ddf Fix pulseaudio dynamic linking for Solaris builds.
Shawn Walker <eviltypeguy@icculus.org>
parents: 6960
diff changeset
   839
                    # On Solaris, pulseaudio must be linked deferred explicitly
adc80d085ddf Fix pulseaudio dynamic linking for Solaris builds.
Shawn Walker <eviltypeguy@icculus.org>
parents: 6960
diff changeset
   840
                    # to prevent undefined symbol failures.
adc80d085ddf Fix pulseaudio dynamic linking for Solaris builds.
Shawn Walker <eviltypeguy@icculus.org>
parents: 6960
diff changeset
   841
                    *-*-solaris*)
adc80d085ddf Fix pulseaudio dynamic linking for Solaris builds.
Shawn Walker <eviltypeguy@icculus.org>
parents: 6960
diff changeset
   842
                        PULSEAUDIO_LIBS=`echo $PULSEAUDIO_LIBS | sed 's/\-l/-Wl,-l/g'`
adc80d085ddf Fix pulseaudio dynamic linking for Solaris builds.
Shawn Walker <eviltypeguy@icculus.org>
parents: 6960
diff changeset
   843
                        EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-zdeferred $PULSEAUDIO_LIBS -Wl,-znodeferred"
adc80d085ddf Fix pulseaudio dynamic linking for Solaris builds.
Shawn Walker <eviltypeguy@icculus.org>
parents: 6960
diff changeset
   844
                esac
2271
60b4c52a7906 Ported PulseAudio target from 1.2 to 1.3 interfaces, and added it to the trunk.
Ryan C. Gordon <icculus@icculus.org>
parents: 2264
diff changeset
   845
            else
60b4c52a7906 Ported PulseAudio target from 1.2 to 1.3 interfaces, and added it to the trunk.
Ryan C. Gordon <icculus@icculus.org>
parents: 2264
diff changeset
   846
                EXTRA_LDFLAGS="$EXTRA_LDFLAGS $PULSEAUDIO_LIBS"
60b4c52a7906 Ported PulseAudio target from 1.2 to 1.3 interfaces, and added it to the trunk.
Ryan C. Gordon <icculus@icculus.org>
parents: 2264
diff changeset
   847
            fi
60b4c52a7906 Ported PulseAudio target from 1.2 to 1.3 interfaces, and added it to the trunk.
Ryan C. Gordon <icculus@icculus.org>
parents: 2264
diff changeset
   848
            have_audio=yes
60b4c52a7906 Ported PulseAudio target from 1.2 to 1.3 interfaces, and added it to the trunk.
Ryan C. Gordon <icculus@icculus.org>
parents: 2264
diff changeset
   849
        fi
60b4c52a7906 Ported PulseAudio target from 1.2 to 1.3 interfaces, and added it to the trunk.
Ryan C. Gordon <icculus@icculus.org>
parents: 2264
diff changeset
   850
    fi
60b4c52a7906 Ported PulseAudio target from 1.2 to 1.3 interfaces, and added it to the trunk.
Ryan C. Gordon <icculus@icculus.org>
parents: 2264
diff changeset
   851
}
60b4c52a7906 Ported PulseAudio target from 1.2 to 1.3 interfaces, and added it to the trunk.
Ryan C. Gordon <icculus@icculus.org>
parents: 2264
diff changeset
   852
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   853
CheckARTSC()
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   854
{
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   855
    AC_ARG_ENABLE(arts,
1637
9ba366b919c7 Date: Fri, 31 Mar 2006 18:28:55 -0500
Sam Lantinga <slouken@libsdl.org>
parents: 1632
diff changeset
   856
AC_HELP_STRING([--enable-arts], [support the Analog Real Time Synthesizer [[default=yes]]]),
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   857
                  , enable_arts=yes)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   858
    if test x$enable_audio = xyes -a x$enable_arts = xyes; then
1361
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents: 1354
diff changeset
   859
        AC_PATH_PROG(ARTSCONFIG, artsc-config)
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents: 1354
diff changeset
   860
        if test x$ARTSCONFIG = x -o x$ARTSCONFIG = x'"$ARTSCONFIG"'; then
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   861
            : # arts isn't installed
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   862
        else
1361
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents: 1354
diff changeset
   863
            ARTS_CFLAGS=`$ARTSCONFIG --cflags`
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents: 1354
diff changeset
   864
            ARTS_LIBS=`$ARTSCONFIG --libs`
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   865
            AC_MSG_CHECKING(for aRts development environment)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   866
            audio_arts=no
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   867
            save_CFLAGS="$CFLAGS"
1361
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents: 1354
diff changeset
   868
            CFLAGS="$CFLAGS $ARTS_CFLAGS"
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   869
            AC_TRY_COMPILE([
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   870
             #include <artsc.h>
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   871
            ],[
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   872
             arts_stream_t stream;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   873
            ],[
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   874
            audio_arts=yes
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   875
            ])
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   876
            CFLAGS="$save_CFLAGS"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   877
            AC_MSG_RESULT($audio_arts)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   878
            if test x$audio_arts = xyes; then
294
d2d48e10f370 Added a new header file: SDL_loadso.h
Sam Lantinga <slouken@libsdl.org>
parents: 292
diff changeset
   879
                AC_ARG_ENABLE(arts-shared,
1637
9ba366b919c7 Date: Fri, 31 Mar 2006 18:28:55 -0500
Sam Lantinga <slouken@libsdl.org>
parents: 1632
diff changeset
   880
AC_HELP_STRING([--enable-arts-shared], [dynamically load aRts audio support [[default=yes]]]),
678
7f691fa4c1c7 Turn dynamic loading of esd and arts on by default
Sam Lantinga <slouken@libsdl.org>
parents: 675
diff changeset
   881
                              , enable_arts_shared=yes)
3391
188fc5ecc58c Simplify and improve dynamic library detection, taken from SDL_image
Sam Lantinga <slouken@libsdl.org>
parents: 3390
diff changeset
   882
                arts_lib=[`find_lib "libartsc.so.*" "$ARTS_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`]
1467
b69f2b0309a0 Removed accidentally copied/pasted script for ALSA detection
Sam Lantinga <slouken@libsdl.org>
parents: 1459
diff changeset
   883
5548
8f0abb6ef37d Updated configure.in to be compatible with autoconf 2.67.
Ryan C. Gordon <icculus@icculus.org>
parents: 5512
diff changeset
   884
                AC_DEFINE(SDL_AUDIO_DRIVER_ARTS, 1, [ ])
1467
b69f2b0309a0 Removed accidentally copied/pasted script for ALSA detection
Sam Lantinga <slouken@libsdl.org>
parents: 1459
diff changeset
   885
                SOURCES="$SOURCES $srcdir/src/audio/arts/*.c"
1521
9b9212e4810c CFLAGS are separate from EXTRA_CFLAGS
Sam Lantinga <slouken@libsdl.org>
parents: 1520
diff changeset
   886
                EXTRA_CFLAGS="$EXTRA_CFLAGS $ARTS_CFLAGS"
1173
e9cf8c1b4590 Split up src/SDL_loadso.c into platform directories.
Ryan C. Gordon <icculus@icculus.org>
parents: 1170
diff changeset
   887
                if test x$have_loadso != xyes && \
296
fab1ddc4d7bf Removed the API changes to preserve SDL 1.2 stability
Sam Lantinga <slouken@libsdl.org>
parents: 295
diff changeset
   888
                   test x$enable_arts_shared = xyes; then
1467
b69f2b0309a0 Removed accidentally copied/pasted script for ALSA detection
Sam Lantinga <slouken@libsdl.org>
parents: 1459
diff changeset
   889
                    AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic ARTS loading])
296
fab1ddc4d7bf Removed the API changes to preserve SDL 1.2 stability
Sam Lantinga <slouken@libsdl.org>
parents: 295
diff changeset
   890
                fi
1173
e9cf8c1b4590 Split up src/SDL_loadso.c into platform directories.
Ryan C. Gordon <icculus@icculus.org>
parents: 1170
diff changeset
   891
                if test x$have_loadso = xyes && \
294
d2d48e10f370 Added a new header file: SDL_loadso.h
Sam Lantinga <slouken@libsdl.org>
parents: 292
diff changeset
   892
                   test x$enable_arts_shared = xyes && test x$arts_lib != x; then
3392
efc22582afc5 Only show the dynamic audio libraries if we'll be dynamically loading them
Sam Lantinga <slouken@libsdl.org>
parents: 3391
diff changeset
   893
                    echo "-- dynamic libartsc -> $arts_lib"
5548
8f0abb6ef37d Updated configure.in to be compatible with autoconf 2.67.
Ryan C. Gordon <icculus@icculus.org>
parents: 5512
diff changeset
   894
                    AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_ARTS_DYNAMIC, "$arts_lib", [ ])
1467
b69f2b0309a0 Removed accidentally copied/pasted script for ALSA detection
Sam Lantinga <slouken@libsdl.org>
parents: 1459
diff changeset
   895
                else
1521
9b9212e4810c CFLAGS are separate from EXTRA_CFLAGS
Sam Lantinga <slouken@libsdl.org>
parents: 1520
diff changeset
   896
                    EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ARTS_LIBS"
294
d2d48e10f370 Added a new header file: SDL_loadso.h
Sam Lantinga <slouken@libsdl.org>
parents: 292
diff changeset
   897
                fi
1361
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents: 1354
diff changeset
   898
                have_audio=yes
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   899
            fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   900
        fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   901
    fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   902
}
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   903
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   904
dnl See if the NAS audio interface is supported
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   905
CheckNAS()
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   906
{
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   907
    AC_ARG_ENABLE(nas,
1637
9ba366b919c7 Date: Fri, 31 Mar 2006 18:28:55 -0500
Sam Lantinga <slouken@libsdl.org>
parents: 1632
diff changeset
   908
AC_HELP_STRING([--enable-nas], [support the NAS audio API [[default=yes]]]),
41
8de9e8baaecc *** empty log message ***
Sam Lantinga <slouken@lokigames.com>
parents: 39
diff changeset
   909
                  , enable_nas=yes)
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   910
    if test x$enable_audio = xyes -a x$enable_nas = xyes; then
2049
5f6550e5184f Merged SDL-ryan-multiple-audio-device branch r2803:2871 into the trunk.
Ryan C. Gordon <icculus@icculus.org>
parents: 2040
diff changeset
   911
        AC_CHECK_HEADER(audio/audiolib.h, have_nas_hdr=yes)
5f6550e5184f Merged SDL-ryan-multiple-audio-device branch r2803:2871 into the trunk.
Ryan C. Gordon <icculus@icculus.org>
parents: 2040
diff changeset
   912
        AC_CHECK_LIB(audio, AuOpenServer, have_nas_lib=yes)
5f6550e5184f Merged SDL-ryan-multiple-audio-device branch r2803:2871 into the trunk.
Ryan C. Gordon <icculus@icculus.org>
parents: 2040
diff changeset
   913
41
8de9e8baaecc *** empty log message ***
Sam Lantinga <slouken@lokigames.com>
parents: 39
diff changeset
   914
        AC_MSG_CHECKING(for NAS audio support)
8de9e8baaecc *** empty log message ***
Sam Lantinga <slouken@lokigames.com>
parents: 39
diff changeset
   915
        have_nas=no
2049
5f6550e5184f Merged SDL-ryan-multiple-audio-device branch r2803:2871 into the trunk.
Ryan C. Gordon <icculus@icculus.org>
parents: 2040
diff changeset
   916
5f6550e5184f Merged SDL-ryan-multiple-audio-device branch r2803:2871 into the trunk.
Ryan C. Gordon <icculus@icculus.org>
parents: 2040
diff changeset
   917
        if test x$have_nas_hdr = xyes -a x$have_nas_lib = xyes; then
5f6550e5184f Merged SDL-ryan-multiple-audio-device branch r2803:2871 into the trunk.
Ryan C. Gordon <icculus@icculus.org>
parents: 2040
diff changeset
   918
            have_nas=yes
5f6550e5184f Merged SDL-ryan-multiple-audio-device branch r2803:2871 into the trunk.
Ryan C. Gordon <icculus@icculus.org>
parents: 2040
diff changeset
   919
            NAS_LIBS="-laudio"
5f6550e5184f Merged SDL-ryan-multiple-audio-device branch r2803:2871 into the trunk.
Ryan C. Gordon <icculus@icculus.org>
parents: 2040
diff changeset
   920
5f6550e5184f Merged SDL-ryan-multiple-audio-device branch r2803:2871 into the trunk.
Ryan C. Gordon <icculus@icculus.org>
parents: 2040
diff changeset
   921
        elif test -r /usr/X11R6/include/audio/audiolib.h; then
41
8de9e8baaecc *** empty log message ***
Sam Lantinga <slouken@lokigames.com>
parents: 39
diff changeset
   922
            have_nas=yes
1361
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents: 1354
diff changeset
   923
            NAS_CFLAGS="-I/usr/X11R6/include/"
1520
5d264facfd03 Add the NAS library directory, since X11 is dynamically loaded now...
Sam Lantinga <slouken@libsdl.org>
parents: 1512
diff changeset
   924
            NAS_LIBS="-L/usr/X11R6/lib -laudio -lXt"
605
6399f4e90211 IRIX patches from Andrea Suatoni
Sam Lantinga <slouken@libsdl.org>
parents: 599
diff changeset
   925
41
8de9e8baaecc *** empty log message ***
Sam Lantinga <slouken@lokigames.com>
parents: 39
diff changeset
   926
        fi
2049
5f6550e5184f Merged SDL-ryan-multiple-audio-device branch r2803:2871 into the trunk.
Ryan C. Gordon <icculus@icculus.org>
parents: 2040
diff changeset
   927
605
6399f4e90211 IRIX patches from Andrea Suatoni
Sam Lantinga <slouken@libsdl.org>
parents: 599
diff changeset
   928
        AC_MSG_RESULT($have_nas)
2049
5f6550e5184f Merged SDL-ryan-multiple-audio-device branch r2803:2871 into the trunk.
Ryan C. Gordon <icculus@icculus.org>
parents: 2040
diff changeset
   929
1361
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents: 1354
diff changeset
   930
        if test x$have_nas = xyes; then
2049
5f6550e5184f Merged SDL-ryan-multiple-audio-device branch r2803:2871 into the trunk.
Ryan C. Gordon <icculus@icculus.org>
parents: 2040
diff changeset
   931
            AC_ARG_ENABLE(nas-shared,
5f6550e5184f Merged SDL-ryan-multiple-audio-device branch r2803:2871 into the trunk.
Ryan C. Gordon <icculus@icculus.org>
parents: 2040
diff changeset
   932
AC_HELP_STRING([--enable-nas-shared], [dynamically load NAS audio support [[default=yes]]]),
5f6550e5184f Merged SDL-ryan-multiple-audio-device branch r2803:2871 into the trunk.
Ryan C. Gordon <icculus@icculus.org>
parents: 2040
diff changeset
   933
                          , enable_nas_shared=yes)
3391
188fc5ecc58c Simplify and improve dynamic library detection, taken from SDL_image
Sam Lantinga <slouken@libsdl.org>
parents: 3390
diff changeset
   934
            nas_lib=[`find_lib "libaudio.so.*" "$NAS_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`]
2049
5f6550e5184f Merged SDL-ryan-multiple-audio-device branch r2803:2871 into the trunk.
Ryan C. Gordon <icculus@icculus.org>
parents: 2040
diff changeset
   935
5f6550e5184f Merged SDL-ryan-multiple-audio-device branch r2803:2871 into the trunk.
Ryan C. Gordon <icculus@icculus.org>
parents: 2040
diff changeset
   936
            if test x$have_loadso != xyes && \
5f6550e5184f Merged SDL-ryan-multiple-audio-device branch r2803:2871 into the trunk.
Ryan C. Gordon <icculus@icculus.org>
parents: 2040
diff changeset
   937
               test x$enable_nas_shared = xyes; then
5f6550e5184f Merged SDL-ryan-multiple-audio-device branch r2803:2871 into the trunk.
Ryan C. Gordon <icculus@icculus.org>
parents: 2040
diff changeset
   938
                AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic NAS loading])
5f6550e5184f Merged SDL-ryan-multiple-audio-device branch r2803:2871 into the trunk.
Ryan C. Gordon <icculus@icculus.org>
parents: 2040
diff changeset
   939
            fi
5f6550e5184f Merged SDL-ryan-multiple-audio-device branch r2803:2871 into the trunk.
Ryan C. Gordon <icculus@icculus.org>
parents: 2040
diff changeset
   940
            if test x$have_loadso = xyes && \
2163
5f96cf74b782 NAS dynamic loading is going to be have to looked at... *sigh*
Sam Lantinga <slouken@libsdl.org>
parents: 2158
diff changeset
   941
               test x$enable_nas_shared = xyes && test x$nas_lib != x; then
3392
efc22582afc5 Only show the dynamic audio libraries if we'll be dynamically loading them
Sam Lantinga <slouken@libsdl.org>
parents: 3391
diff changeset
   942
                echo "-- dynamic libaudio -> $nas_lib"
5548
8f0abb6ef37d Updated configure.in to be compatible with autoconf 2.67.
Ryan C. Gordon <icculus@icculus.org>
parents: 5512
diff changeset
   943
                AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_NAS_DYNAMIC, "$nas_lib", [ ])
2049
5f6550e5184f Merged SDL-ryan-multiple-audio-device branch r2803:2871 into the trunk.
Ryan C. Gordon <icculus@icculus.org>
parents: 2040
diff changeset
   944
            else
5f6550e5184f Merged SDL-ryan-multiple-audio-device branch r2803:2871 into the trunk.
Ryan C. Gordon <icculus@icculus.org>
parents: 2040
diff changeset
   945
                EXTRA_LDFLAGS="$EXTRA_LDFLAGS $NAS_LIBS"
5f6550e5184f Merged SDL-ryan-multiple-audio-device branch r2803:2871 into the trunk.
Ryan C. Gordon <icculus@icculus.org>
parents: 2040
diff changeset
   946
            fi
5f6550e5184f Merged SDL-ryan-multiple-audio-device branch r2803:2871 into the trunk.
Ryan C. Gordon <icculus@icculus.org>
parents: 2040
diff changeset
   947
5548
8f0abb6ef37d Updated configure.in to be compatible with autoconf 2.67.
Ryan C. Gordon <icculus@icculus.org>
parents: 5512
diff changeset
   948
            AC_DEFINE(SDL_AUDIO_DRIVER_NAS, 1, [ ])
1361
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents: 1354
diff changeset
   949
            SOURCES="$SOURCES $srcdir/src/audio/nas/*.c"
1521
9b9212e4810c CFLAGS are separate from EXTRA_CFLAGS
Sam Lantinga <slouken@libsdl.org>
parents: 1520
diff changeset
   950
            EXTRA_CFLAGS="$EXTRA_CFLAGS $NAS_CFLAGS"
1361
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents: 1354
diff changeset
   951
            have_audio=yes
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents: 1354
diff changeset
   952
        fi
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   953
    fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   954
}
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   955
7367
d6eabafa8776 Added an SDL2 OpenBSD sndio(7) audio target.
Ryan C. Gordon <icculus@icculus.org>
parents: 7307
diff changeset
   956
dnl See if the sndio audio interface is supported
d6eabafa8776 Added an SDL2 OpenBSD sndio(7) audio target.
Ryan C. Gordon <icculus@icculus.org>
parents: 7307
diff changeset
   957
CheckSNDIO()
d6eabafa8776 Added an SDL2 OpenBSD sndio(7) audio target.
Ryan C. Gordon <icculus@icculus.org>
parents: 7307
diff changeset
   958
{
d6eabafa8776 Added an SDL2 OpenBSD sndio(7) audio target.
Ryan C. Gordon <icculus@icculus.org>
parents: 7307
diff changeset
   959
    AC_ARG_ENABLE(sndio,
d6eabafa8776 Added an SDL2 OpenBSD sndio(7) audio target.
Ryan C. Gordon <icculus@icculus.org>
parents: 7307
diff changeset
   960
AC_HELP_STRING([--enable-sndio], [support the sndio audio API [[default=yes]]]),
d6eabafa8776 Added an SDL2 OpenBSD sndio(7) audio target.
Ryan C. Gordon <icculus@icculus.org>
parents: 7307
diff changeset
   961
                  , enable_sndio=yes)
d6eabafa8776 Added an SDL2 OpenBSD sndio(7) audio target.
Ryan C. Gordon <icculus@icculus.org>
parents: 7307
diff changeset
   962
    if test x$enable_audio = xyes -a x$enable_sndio = xyes; then
d6eabafa8776 Added an SDL2 OpenBSD sndio(7) audio target.
Ryan C. Gordon <icculus@icculus.org>
parents: 7307
diff changeset
   963
        AC_CHECK_HEADER(sndio.h, have_sndio_hdr=yes)
d6eabafa8776 Added an SDL2 OpenBSD sndio(7) audio target.
Ryan C. Gordon <icculus@icculus.org>
parents: 7307
diff changeset
   964
        AC_CHECK_LIB(sndio, sio_open, have_sndio_lib=yes)
d6eabafa8776 Added an SDL2 OpenBSD sndio(7) audio target.
Ryan C. Gordon <icculus@icculus.org>
parents: 7307
diff changeset
   965
d6eabafa8776 Added an SDL2 OpenBSD sndio(7) audio target.
Ryan C. Gordon <icculus@icculus.org>
parents: 7307
diff changeset
   966
        AC_MSG_CHECKING(for sndio audio support)
d6eabafa8776 Added an SDL2 OpenBSD sndio(7) audio target.
Ryan C. Gordon <icculus@icculus.org>
parents: 7307
diff changeset
   967
        have_sndio=no
d6eabafa8776 Added an SDL2 OpenBSD sndio(7) audio target.
Ryan C. Gordon <icculus@icculus.org>
parents: 7307
diff changeset
   968
d6eabafa8776 Added an SDL2 OpenBSD sndio(7) audio target.
Ryan C. Gordon <icculus@icculus.org>
parents: 7307
diff changeset
   969
        if test x$have_sndio_hdr = xyes -a x$have_sndio_lib = xyes; then
d6eabafa8776 Added an SDL2 OpenBSD sndio(7) audio target.
Ryan C. Gordon <icculus@icculus.org>
parents: 7307
diff changeset
   970
            have_sndio=yes
d6eabafa8776 Added an SDL2 OpenBSD sndio(7) audio target.
Ryan C. Gordon <icculus@icculus.org>
parents: 7307
diff changeset
   971
            SNDIO_LIBS="-lsndio"
d6eabafa8776 Added an SDL2 OpenBSD sndio(7) audio target.
Ryan C. Gordon <icculus@icculus.org>
parents: 7307
diff changeset
   972
        fi
d6eabafa8776 Added an SDL2 OpenBSD sndio(7) audio target.
Ryan C. Gordon <icculus@icculus.org>
parents: 7307
diff changeset
   973
d6eabafa8776 Added an SDL2 OpenBSD sndio(7) audio target.
Ryan C. Gordon <icculus@icculus.org>
parents: 7307
diff changeset
   974
        AC_MSG_RESULT($have_sndio)
d6eabafa8776 Added an SDL2 OpenBSD sndio(7) audio target.
Ryan C. Gordon <icculus@icculus.org>
parents: 7307
diff changeset
   975
d6eabafa8776 Added an SDL2 OpenBSD sndio(7) audio target.
Ryan C. Gordon <icculus@icculus.org>
parents: 7307
diff changeset
   976
        if test x$have_sndio = xyes; then
d6eabafa8776 Added an SDL2 OpenBSD sndio(7) audio target.
Ryan C. Gordon <icculus@icculus.org>
parents: 7307
diff changeset
   977
            AC_ARG_ENABLE(sndio-shared,
d6eabafa8776 Added an SDL2 OpenBSD sndio(7) audio target.
Ryan C. Gordon <icculus@icculus.org>
parents: 7307
diff changeset
   978
AC_HELP_STRING([--enable-sndio-shared], [dynamically load sndio audio support [[default=yes]]]),
d6eabafa8776 Added an SDL2 OpenBSD sndio(7) audio target.
Ryan C. Gordon <icculus@icculus.org>
parents: 7307
diff changeset
   979
                          , enable_sndio_shared=yes)
d6eabafa8776 Added an SDL2 OpenBSD sndio(7) audio target.
Ryan C. Gordon <icculus@icculus.org>
parents: 7307
diff changeset
   980
            sndio_lib=[`find_lib "libsndio.so.*" "$SNDIO_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`]
d6eabafa8776 Added an SDL2 OpenBSD sndio(7) audio target.
Ryan C. Gordon <icculus@icculus.org>
parents: 7307
diff changeset
   981
d6eabafa8776 Added an SDL2 OpenBSD sndio(7) audio target.
Ryan C. Gordon <icculus@icculus.org>
parents: 7307
diff changeset
   982
            if test x$have_loadso != xyes && \
d6eabafa8776 Added an SDL2 OpenBSD sndio(7) audio target.
Ryan C. Gordon <icculus@icculus.org>
parents: 7307
diff changeset
   983
               test x$enable_sndio_shared = xyes; then
d6eabafa8776 Added an SDL2 OpenBSD sndio(7) audio target.
Ryan C. Gordon <icculus@icculus.org>
parents: 7307
diff changeset
   984
                AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic sndio loading])
d6eabafa8776 Added an SDL2 OpenBSD sndio(7) audio target.
Ryan C. Gordon <icculus@icculus.org>
parents: 7307
diff changeset
   985
            fi
d6eabafa8776 Added an SDL2 OpenBSD sndio(7) audio target.
Ryan C. Gordon <icculus@icculus.org>
parents: 7307
diff changeset
   986
            if test x$have_loadso = xyes && \
d6eabafa8776 Added an SDL2 OpenBSD sndio(7) audio target.
Ryan C. Gordon <icculus@icculus.org>
parents: 7307
diff changeset
   987
               test x$enable_sndio_shared = xyes && test x$sndio_lib != x; then
d6eabafa8776 Added an SDL2 OpenBSD sndio(7) audio target.
Ryan C. Gordon <icculus@icculus.org>
parents: 7307
diff changeset
   988
                echo "-- dynamic libsndio -> $sndio_lib"
d6eabafa8776 Added an SDL2 OpenBSD sndio(7) audio target.
Ryan C. Gordon <icculus@icculus.org>
parents: 7307
diff changeset
   989
                AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_SNDIO_DYNAMIC, "$sndio_lib", [ ])
d6eabafa8776 Added an SDL2 OpenBSD sndio(7) audio target.
Ryan C. Gordon <icculus@icculus.org>
parents: 7307
diff changeset
   990
            else
d6eabafa8776 Added an SDL2 OpenBSD sndio(7) audio target.
Ryan C. Gordon <icculus@icculus.org>
parents: 7307
diff changeset
   991
                EXTRA_LDFLAGS="$EXTRA_LDFLAGS $SNDIO_LIBS"
d6eabafa8776 Added an SDL2 OpenBSD sndio(7) audio target.
Ryan C. Gordon <icculus@icculus.org>
parents: 7307
diff changeset
   992
            fi
d6eabafa8776 Added an SDL2 OpenBSD sndio(7) audio target.
Ryan C. Gordon <icculus@icculus.org>
parents: 7307
diff changeset
   993
d6eabafa8776 Added an SDL2 OpenBSD sndio(7) audio target.
Ryan C. Gordon <icculus@icculus.org>
parents: 7307
diff changeset
   994
            AC_DEFINE(SDL_AUDIO_DRIVER_SNDIO, 1, [ ])
d6eabafa8776 Added an SDL2 OpenBSD sndio(7) audio target.
Ryan C. Gordon <icculus@icculus.org>
parents: 7307
diff changeset
   995
            SOURCES="$SOURCES $srcdir/src/audio/sndio/*.c"
d6eabafa8776 Added an SDL2 OpenBSD sndio(7) audio target.
Ryan C. Gordon <icculus@icculus.org>
parents: 7307
diff changeset
   996
            EXTRA_CFLAGS="$EXTRA_CFLAGS $SNDIO_CFLAGS"
d6eabafa8776 Added an SDL2 OpenBSD sndio(7) audio target.
Ryan C. Gordon <icculus@icculus.org>
parents: 7307
diff changeset
   997
            have_audio=yes
d6eabafa8776 Added an SDL2 OpenBSD sndio(7) audio target.
Ryan C. Gordon <icculus@icculus.org>
parents: 7307
diff changeset
   998
        fi
d6eabafa8776 Added an SDL2 OpenBSD sndio(7) audio target.
Ryan C. Gordon <icculus@icculus.org>
parents: 7307
diff changeset
   999
    fi
d6eabafa8776 Added an SDL2 OpenBSD sndio(7) audio target.
Ryan C. Gordon <icculus@icculus.org>
parents: 7307
diff changeset
  1000
}
d6eabafa8776 Added an SDL2 OpenBSD sndio(7) audio target.
Ryan C. Gordon <icculus@icculus.org>
parents: 7307
diff changeset
  1001
68
ac6645260d31 Added an audio driver that writes to disk (thanks Ryan!)
Sam Lantinga <slouken@lokigames.com>
parents: 53
diff changeset
  1002
dnl rcg07142001 See if the user wants the disk writer audio driver...
ac6645260d31 Added an audio driver that writes to disk (thanks Ryan!)
Sam Lantinga <slouken@lokigames.com>
parents: 53
diff changeset
  1003
CheckDiskAudio()
ac6645260d31 Added an audio driver that writes to disk (thanks Ryan!)
Sam Lantinga <slouken@lokigames.com>
parents: 53
diff changeset
  1004
{
ac6645260d31 Added an audio driver that writes to disk (thanks Ryan!)
Sam Lantinga <slouken@lokigames.com>
parents: 53
diff changeset
  1005
    AC_ARG_ENABLE(diskaudio,
1637
9ba366b919c7 Date: Fri, 31 Mar 2006 18:28:55 -0500
Sam Lantinga <slouken@libsdl.org>
parents: 1632
diff changeset
  1006
AC_HELP_STRING([--enable-diskaudio], [support the disk writer audio driver [[default=yes]]]),
86
13e4c612098d Dummy audio and video drivers are enabled (thanks Ryan!)
Sam Lantinga <slouken@lokigames.com>
parents: 76
diff changeset
  1007
                  , enable_diskaudio=yes)
68
ac6645260d31 Added an audio driver that writes to disk (thanks Ryan!)
Sam Lantinga <slouken@lokigames.com>
parents: 53
diff changeset
  1008
    if test x$enable_audio = xyes -a x$enable_diskaudio = xyes; then
5548
8f0abb6ef37d Updated configure.in to be compatible with autoconf 2.67.
Ryan C. Gordon <icculus@icculus.org>
parents: 5512
diff changeset
  1009
        AC_DEFINE(SDL_AUDIO_DRIVER_DISK, 1, [ ])
1361
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents: 1354
diff changeset
  1010
        SOURCES="$SOURCES $srcdir/src/audio/disk/*.c"
68
ac6645260d31 Added an audio driver that writes to disk (thanks Ryan!)
Sam Lantinga <slouken@lokigames.com>
parents: 53
diff changeset
  1011
    fi
ac6645260d31 Added an audio driver that writes to disk (thanks Ryan!)
Sam Lantinga <slouken@lokigames.com>
parents: 53
diff changeset
  1012
}
ac6645260d31 Added an audio driver that writes to disk (thanks Ryan!)
Sam Lantinga <slouken@lokigames.com>
parents: 53
diff changeset
  1013
1532
30f189cdd82b Implemented dummy audio driver.
Ryan C. Gordon <icculus@icculus.org>
parents: 1521
diff changeset
  1014
dnl rcg03142006 See if the user wants the dummy audio driver...
30f189cdd82b Implemented dummy audio driver.
Ryan C. Gordon <icculus@icculus.org>
parents: 1521
diff changeset
  1015
CheckDummyAudio()
30f189cdd82b Implemented dummy audio driver.
Ryan C. Gordon <icculus@icculus.org>
parents: 1521
diff changeset
  1016
{
30f189cdd82b Implemented dummy audio driver.
Ryan C. Gordon <icculus@icculus.org>
parents: 1521
diff changeset
  1017
    AC_ARG_ENABLE(dummyaudio,
1637
9ba366b919c7 Date: Fri, 31 Mar 2006 18:28:55 -0500
Sam Lantinga <slouken@libsdl.org>
parents: 1632
diff changeset
  1018
AC_HELP_STRING([--enable-dummyaudio], [support the dummy audio driver [[default=yes]]]),
1532
30f189cdd82b Implemented dummy audio driver.
Ryan C. Gordon <icculus@icculus.org>
parents: 1521
diff changeset
  1019
                  , enable_dummyaudio=yes)
30f189cdd82b Implemented dummy audio driver.
Ryan C. Gordon <icculus@icculus.org>
parents: 1521
diff changeset
  1020
    if test x$enable_audio = xyes -a x$enable_dummyaudio = xyes; then
5548
8f0abb6ef37d Updated configure.in to be compatible with autoconf 2.67.
Ryan C. Gordon <icculus@icculus.org>
parents: 5512
diff changeset
  1021
        AC_DEFINE(SDL_AUDIO_DRIVER_DUMMY, 1, [ ])
1532
30f189cdd82b Implemented dummy audio driver.
Ryan C. Gordon <icculus@icculus.org>
parents: 1521
diff changeset
  1022
        SOURCES="$SOURCES $srcdir/src/audio/dummy/*.c"
30f189cdd82b Implemented dummy audio driver.
Ryan C. Gordon <icculus@icculus.org>
parents: 1521
diff changeset
  1023
    fi
30f189cdd82b Implemented dummy audio driver.
Ryan C. Gordon <icculus@icculus.org>
parents: 1521
diff changeset
  1024
}
30f189cdd82b Implemented dummy audio driver.
Ryan C. Gordon <icculus@icculus.org>
parents: 1521
diff changeset
  1025
1573
2422ca15ba42 Added support for gcc4's -fvisibility=hidden option.
Ryan C. Gordon <icculus@icculus.org>
parents: 1571
diff changeset
  1026
dnl See if GCC's -fvisibility=hidden is supported (gcc4 and later, usually).
2422ca15ba42 Added support for gcc4's -fvisibility=hidden option.
Ryan C. Gordon <icculus@icculus.org>
parents: 1571
diff changeset
  1027
dnl  Details of this flag are here: http://gcc.gnu.org/wiki/Visibility
2422ca15ba42 Added support for gcc4's -fvisibility=hidden option.
Ryan C. Gordon <icculus@icculus.org>
parents: 1571
diff changeset
  1028
CheckVisibilityHidden()
2422ca15ba42 Added support for gcc4's -fvisibility=hidden option.
Ryan C. Gordon <icculus@icculus.org>
parents: 1571
diff changeset
  1029
{
2422ca15ba42 Added support for gcc4's -fvisibility=hidden option.
Ryan C. Gordon <icculus@icculus.org>
parents: 1571
diff changeset
  1030
    AC_MSG_CHECKING(for GCC -fvisibility=hidden option)
2422ca15ba42 Added support for gcc4's -fvisibility=hidden option.
Ryan C. Gordon <icculus@icculus.org>
parents: 1571
diff changeset
  1031
    have_gcc_fvisibility=no
2422ca15ba42 Added support for gcc4's -fvisibility=hidden option.
Ryan C. Gordon <icculus@icculus.org>
parents: 1571
diff changeset
  1032
2422ca15ba42 Added support for gcc4's -fvisibility=hidden option.
Ryan C. Gordon <icculus@icculus.org>
parents: 1571
diff changeset
  1033
    visibility_CFLAGS="-fvisibility=hidden"
2422ca15ba42 Added support for gcc4's -fvisibility=hidden option.
Ryan C. Gordon <icculus@icculus.org>
parents: 1571
diff changeset
  1034
    save_CFLAGS="$CFLAGS"
2292
4845eb8d4221 Merged -fvisibility detection fix from SDL 1.2 revision 3500
Sam Lantinga <slouken@libsdl.org>
parents: 2290
diff changeset
  1035
    CFLAGS="$save_CFLAGS $visibility_CFLAGS -Werror"
1573
2422ca15ba42 Added support for gcc4's -fvisibility=hidden option.
Ryan C. Gordon <icculus@icculus.org>
parents: 1571
diff changeset
  1036
    AC_TRY_COMPILE([
1745
741dc4e89f3a Only use -fvisibility=hidden if SDL will define some symbols as available. :)
Sam Lantinga <slouken@libsdl.org>
parents: 1742
diff changeset
  1037
    #if !defined(__GNUC__) || __GNUC__ < 4
741dc4e89f3a Only use -fvisibility=hidden if SDL will define some symbols as available. :)
Sam Lantinga <slouken@libsdl.org>
parents: 1742
diff changeset
  1038
    #error SDL only uses visibility attributes in GCC 4 or newer
741dc4e89f3a Only use -fvisibility=hidden if SDL will define some symbols as available. :)
Sam Lantinga <slouken@libsdl.org>
parents: 1742
diff changeset
  1039
    #endif
1573
2422ca15ba42 Added support for gcc4's -fvisibility=hidden option.
Ryan C. Gordon <icculus@icculus.org>
parents: 1571
diff changeset
  1040
    ],[
2422ca15ba42 Added support for gcc4's -fvisibility=hidden option.
Ryan C. Gordon <icculus@icculus.org>
parents: 1571
diff changeset
  1041
    ],[
2422ca15ba42 Added support for gcc4's -fvisibility=hidden option.
Ryan C. Gordon <icculus@icculus.org>
parents: 1571
diff changeset
  1042
    have_gcc_fvisibility=yes
2422ca15ba42 Added support for gcc4's -fvisibility=hidden option.
Ryan C. Gordon <icculus@icculus.org>
parents: 1571
diff changeset
  1043
    ])
2422ca15ba42 Added support for gcc4's -fvisibility=hidden option.
Ryan C. Gordon <icculus@icculus.org>
parents: 1571
diff changeset
  1044
    AC_MSG_RESULT($have_gcc_fvisibility)
2422ca15ba42 Added support for gcc4's -fvisibility=hidden option.
Ryan C. Gordon <icculus@icculus.org>
parents: 1571
diff changeset
  1045
    CFLAGS="$save_CFLAGS"
2422ca15ba42 Added support for gcc4's -fvisibility=hidden option.
Ryan C. Gordon <icculus@icculus.org>
parents: 1571
diff changeset
  1046
2422ca15ba42 Added support for gcc4's -fvisibility=hidden option.
Ryan C. Gordon <icculus@icculus.org>
parents: 1571
diff changeset
  1047
    if test x$have_gcc_fvisibility = xyes; then
1574
0fd72308659e Default to use the visibility attribute, on gcc (is this okay?)
Sam Lantinga <slouken@libsdl.org>
parents: 1573
diff changeset
  1048
        EXTRA_CFLAGS="$EXTRA_CFLAGS $visibility_CFLAGS"
1573
2422ca15ba42 Added support for gcc4's -fvisibility=hidden option.
Ryan C. Gordon <icculus@icculus.org>
parents: 1571
diff changeset
  1049
    fi
2422ca15ba42 Added support for gcc4's -fvisibility=hidden option.
Ryan C. Gordon <icculus@icculus.org>
parents: 1571
diff changeset
  1050
}
2422ca15ba42 Added support for gcc4's -fvisibility=hidden option.
Ryan C. Gordon <icculus@icculus.org>
parents: 1571
diff changeset
  1051
6116
66f48d6bf735 Fixes bug 1296 - SDL_SetVideoMode crashes because of unaligned MOVAPS instruction
Sam Lantinga <slouken@libsdl.org>
parents: 6086
diff changeset
  1052
dnl See if GCC's -mpreferred-stack-boundary is supported.
66f48d6bf735 Fixes bug 1296 - SDL_SetVideoMode crashes because of unaligned MOVAPS instruction
Sam Lantinga <slouken@libsdl.org>
parents: 6086
diff changeset
  1053
dnl  Reference: http://bugzilla.libsdl.org/show_bug.cgi?id=1296
66f48d6bf735 Fixes bug 1296 - SDL_SetVideoMode crashes because of unaligned MOVAPS instruction
Sam Lantinga <slouken@libsdl.org>
parents: 6086
diff changeset
  1054
CheckStackBoundary()
66f48d6bf735 Fixes bug 1296 - SDL_SetVideoMode crashes because of unaligned MOVAPS instruction
Sam Lantinga <slouken@libsdl.org>
parents: 6086
diff changeset
  1055
{
66f48d6bf735 Fixes bug 1296 - SDL_SetVideoMode crashes because of unaligned MOVAPS instruction
Sam Lantinga <slouken@libsdl.org>
parents: 6086
diff changeset
  1056
    AC_MSG_CHECKING(for GCC -mpreferred-stack-boundary option)
66f48d6bf735 Fixes bug 1296 - SDL_SetVideoMode crashes because of unaligned MOVAPS instruction
Sam Lantinga <slouken@libsdl.org>
parents: 6086
diff changeset
  1057
    have_gcc_preferred_stack_boundary=no
66f48d6bf735 Fixes bug 1296 - SDL_SetVideoMode crashes because of unaligned MOVAPS instruction
Sam Lantinga <slouken@libsdl.org>
parents: 6086
diff changeset
  1058
66f48d6bf735 Fixes bug 1296 - SDL_SetVideoMode crashes because of unaligned MOVAPS instruction
Sam Lantinga <slouken@libsdl.org>
parents: 6086
diff changeset
  1059
    save_CFLAGS="$CFLAGS"
66f48d6bf735 Fixes bug 1296 - SDL_SetVideoMode crashes because of unaligned MOVAPS instruction
Sam Lantinga <slouken@libsdl.org>
parents: 6086
diff changeset
  1060
    CFLAGS="$save_CFLAGS -mpreferred-stack-boundary=2"
66f48d6bf735 Fixes bug 1296 - SDL_SetVideoMode crashes because of unaligned MOVAPS instruction
Sam Lantinga <slouken@libsdl.org>
parents: 6086
diff changeset
  1061
    AC_TRY_COMPILE([
66f48d6bf735 Fixes bug 1296 - SDL_SetVideoMode crashes because of unaligned MOVAPS instruction
Sam Lantinga <slouken@libsdl.org>
parents: 6086
diff changeset
  1062
    int x = 0;
66f48d6bf735 Fixes bug 1296 - SDL_SetVideoMode crashes because of unaligned MOVAPS instruction
Sam Lantinga <slouken@libsdl.org>
parents: 6086
diff changeset
  1063
    ],[
66f48d6bf735 Fixes bug 1296 - SDL_SetVideoMode crashes because of unaligned MOVAPS instruction
Sam Lantinga <slouken@libsdl.org>
parents: 6086
diff changeset
  1064
    ],[
66f48d6bf735 Fixes bug 1296 - SDL_SetVideoMode crashes because of unaligned MOVAPS instruction
Sam Lantinga <slouken@libsdl.org>
parents: 6086
diff changeset
  1065
    have_gcc_preferred_stack_boundary=yes
66f48d6bf735 Fixes bug 1296 - SDL_SetVideoMode crashes because of unaligned MOVAPS instruction
Sam Lantinga <slouken@libsdl.org>
parents: 6086
diff changeset
  1066
    ])
66f48d6bf735 Fixes bug 1296 - SDL_SetVideoMode crashes because of unaligned MOVAPS instruction
Sam Lantinga <slouken@libsdl.org>
parents: 6086
diff changeset
  1067
    AC_MSG_RESULT($have_gcc_preferred_stack_boundary)
66f48d6bf735 Fixes bug 1296 - SDL_SetVideoMode crashes because of unaligned MOVAPS instruction
Sam Lantinga <slouken@libsdl.org>
parents: 6086
diff changeset
  1068
    CFLAGS="$save_CFLAGS"
66f48d6bf735 Fixes bug 1296 - SDL_SetVideoMode crashes because of unaligned MOVAPS instruction
Sam Lantinga <slouken@libsdl.org>
parents: 6086
diff changeset
  1069
66f48d6bf735 Fixes bug 1296 - SDL_SetVideoMode crashes because of unaligned MOVAPS instruction
Sam Lantinga <slouken@libsdl.org>
parents: 6086
diff changeset
  1070
    if test x$have_gcc_preferred_stack_boundary = xyes; then
66f48d6bf735 Fixes bug 1296 - SDL_SetVideoMode crashes because of unaligned MOVAPS instruction
Sam Lantinga <slouken@libsdl.org>
parents: 6086
diff changeset
  1071
        EXTRA_CFLAGS="$EXTRA_CFLAGS -mpreferred-stack-boundary=2"
66f48d6bf735 Fixes bug 1296 - SDL_SetVideoMode crashes because of unaligned MOVAPS instruction
Sam Lantinga <slouken@libsdl.org>
parents: 6086
diff changeset
  1072
    fi
66f48d6bf735 Fixes bug 1296 - SDL_SetVideoMode crashes because of unaligned MOVAPS instruction
Sam Lantinga <slouken@libsdl.org>
parents: 6086
diff changeset
  1073
}
66f48d6bf735 Fixes bug 1296 - SDL_SetVideoMode crashes because of unaligned MOVAPS instruction
Sam Lantinga <slouken@libsdl.org>
parents: 6086
diff changeset
  1074
66f48d6bf735 Fixes bug 1296 - SDL_SetVideoMode crashes because of unaligned MOVAPS instruction
Sam Lantinga <slouken@libsdl.org>
parents: 6086
diff changeset
  1075
5975
516c5c4e7bea Enable -Wall by default.
Ryan C. Gordon <icculus@icculus.org>
parents: 5969
diff changeset
  1076
dnl See if GCC's -Wall is supported.
516c5c4e7bea Enable -Wall by default.
Ryan C. Gordon <icculus@icculus.org>
parents: 5969
diff changeset
  1077
CheckWarnAll()
516c5c4e7bea Enable -Wall by default.
Ryan C. Gordon <icculus@icculus.org>
parents: 5969
diff changeset
  1078
{
516c5c4e7bea Enable -Wall by default.
Ryan C. Gordon <icculus@icculus.org>
parents: 5969
diff changeset
  1079
    AC_MSG_CHECKING(for GCC -Wall option)
516c5c4e7bea Enable -Wall by default.
Ryan C. Gordon <icculus@icculus.org>
parents: 5969
diff changeset
  1080
    have_gcc_Wall=no
516c5c4e7bea Enable -Wall by default.
Ryan C. Gordon <icculus@icculus.org>
parents: 5969
diff changeset
  1081