configure.in
author Ryan C. Gordon <icculus@icculus.org>
Sun, 28 Aug 2016 13:36:13 -0400
changeset 10286 3b884985835c
parent 10089 25fda20d0173
permissions -rw-r--r--
Merge audio capture work back into the mainline.
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
9121
00d99eff96a6 Updated version to 2.0.4
Sam Lantinga <slouken@libsdl.org>
parents: 9112
diff changeset
    23
SDL_MICRO_VERSION=4
00d99eff96a6 Updated version to 2.0.4
Sam Lantinga <slouken@libsdl.org>
parents: 9112
diff changeset
    24
SDL_INTERFACE_AGE=0
00d99eff96a6 Updated version to 2.0.4
Sam Lantinga <slouken@libsdl.org>
parents: 9112
diff changeset
    25
SDL_BINARY_AGE=4
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
9252
a11e8f6d82d1 Fixed bug 2795 - SDL library detection selects the wrong lib
Sam Lantinga <slouken@libsdl.org>
parents: 9164
diff changeset
   145
    for path in $env_lib_path $gcc_bin_path $gcc_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
7988
9f15374d872d Turning --no-undefined back on, to see what platforms are still broken.
Ryan C. Gordon <icculus@icculus.org>
parents: 7985
diff changeset
   207
AC_MSG_CHECKING(for linker option --no-undefined)
9f15374d872d Turning --no-undefined back on, to see what platforms are still broken.
Ryan C. Gordon <icculus@icculus.org>
parents: 7985
diff changeset
   208
have_no_undefined=no
8003
998458760218 Turn off --no-undefined on OpenBSD again. Leave it on everywhere else for now.
Ryan C. Gordon <icculus@icculus.org>
parents: 8001
diff changeset
   209
case "$host" in
998458760218 Turn off --no-undefined on OpenBSD again. Leave it on everywhere else for now.
Ryan C. Gordon <icculus@icculus.org>
parents: 8001
diff changeset
   210
    dnl Skip this on platforms where it is just simply busted.
998458760218 Turn off --no-undefined on OpenBSD again. Leave it on everywhere else for now.
Ryan C. Gordon <icculus@icculus.org>
parents: 8001
diff changeset
   211
    *-*-openbsd*)
998458760218 Turn off --no-undefined on OpenBSD again. Leave it on everywhere else for now.
Ryan C. Gordon <icculus@icculus.org>
parents: 8001
diff changeset
   212
        ;;
998458760218 Turn off --no-undefined on OpenBSD again. Leave it on everywhere else for now.
Ryan C. Gordon <icculus@icculus.org>
parents: 8001
diff changeset
   213
998458760218 Turn off --no-undefined on OpenBSD again. Leave it on everywhere else for now.
Ryan C. Gordon <icculus@icculus.org>
parents: 8001
diff changeset
   214
    *)
998458760218 Turn off --no-undefined on OpenBSD again. Leave it on everywhere else for now.
Ryan C. Gordon <icculus@icculus.org>
parents: 8001
diff changeset
   215
        save_LDFLAGS="$LDFLAGS"
998458760218 Turn off --no-undefined on OpenBSD again. Leave it on everywhere else for now.
Ryan C. Gordon <icculus@icculus.org>
parents: 8001
diff changeset
   216
        LDFLAGS="$LDFLAGS -Wl,--no-undefined"
998458760218 Turn off --no-undefined on OpenBSD again. Leave it on everywhere else for now.
Ryan C. Gordon <icculus@icculus.org>
parents: 8001
diff changeset
   217
        AC_TRY_LINK([
998458760218 Turn off --no-undefined on OpenBSD again. Leave it on everywhere else for now.
Ryan C. Gordon <icculus@icculus.org>
parents: 8001
diff changeset
   218
        ],[
998458760218 Turn off --no-undefined on OpenBSD again. Leave it on everywhere else for now.
Ryan C. Gordon <icculus@icculus.org>
parents: 8001
diff changeset
   219
        ],[
998458760218 Turn off --no-undefined on OpenBSD again. Leave it on everywhere else for now.
Ryan C. Gordon <icculus@icculus.org>
parents: 8001
diff changeset
   220
        have_no_undefined=yes
998458760218 Turn off --no-undefined on OpenBSD again. Leave it on everywhere else for now.
Ryan C. Gordon <icculus@icculus.org>
parents: 8001
diff changeset
   221
        EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,--no-undefined"
998458760218 Turn off --no-undefined on OpenBSD again. Leave it on everywhere else for now.
Ryan C. Gordon <icculus@icculus.org>
parents: 8001
diff changeset
   222
        ])
998458760218 Turn off --no-undefined on OpenBSD again. Leave it on everywhere else for now.
Ryan C. Gordon <icculus@icculus.org>
parents: 8001
diff changeset
   223
        LDFLAGS="$save_LDFLAGS"
998458760218 Turn off --no-undefined on OpenBSD again. Leave it on everywhere else for now.
Ryan C. Gordon <icculus@icculus.org>
parents: 8001
diff changeset
   224
        ;;
998458760218 Turn off --no-undefined on OpenBSD again. Leave it on everywhere else for now.
Ryan C. Gordon <icculus@icculus.org>
parents: 8001
diff changeset
   225
esac
7988
9f15374d872d Turning --no-undefined back on, to see what platforms are still broken.
Ryan C. Gordon <icculus@icculus.org>
parents: 7985
diff changeset
   226
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
   227
1361
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents: 1354
diff changeset
   228
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
   229
AC_ARG_ENABLE(libc,
1637
9ba366b919c7 Date: Fri, 31 Mar 2006 18:28:55 -0500
Sam Lantinga <slouken@libsdl.org>
parents: 1632
diff changeset
   230
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
   231
              , 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
   232
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
   233
    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
   234
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents: 1354
diff changeset
   235
    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
   236
    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
   237
    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
   238
1361
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents: 1354
diff changeset
   239
    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
   240
    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
   241
3012
7e30c2dc7783 Fixed Visual C++ release build for Visual C++ 2005
Sam Lantinga <slouken@libsdl.org>
parents: 3007
diff changeset
   242
    dnl Check for defines
7e30c2dc7783 Fixed Visual C++ release build for Visual C++ 2005
Sam Lantinga <slouken@libsdl.org>
parents: 3007
diff changeset
   243
    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
   244
1361
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents: 1354
diff changeset
   245
    dnl Checks for library functions.
2079
1ed2155b7ee4 From: Torsten Giebl
Ryan C. Gordon <icculus@icculus.org>
parents: 2070
diff changeset
   246
    case "$host" in
1ed2155b7ee4 From: Torsten Giebl
Ryan C. Gordon <icculus@icculus.org>
parents: 2070
diff changeset
   247
    *-*-cygwin* | *-*-mingw32*)
1ed2155b7ee4 From: Torsten Giebl
Ryan C. Gordon <icculus@icculus.org>
parents: 2070
diff changeset
   248
        ;;
1ed2155b7ee4 From: Torsten Giebl
Ryan C. Gordon <icculus@icculus.org>
parents: 2070
diff changeset
   249
    *)
1ed2155b7ee4 From: Torsten Giebl
Ryan C. Gordon <icculus@icculus.org>
parents: 2070
diff changeset
   250
        AC_FUNC_ALLOCA
1ed2155b7ee4 From: Torsten Giebl
Ryan C. Gordon <icculus@icculus.org>
parents: 2070
diff changeset
   251
        ;;
1ed2155b7ee4 From: Torsten Giebl
Ryan C. Gordon <icculus@icculus.org>
parents: 2070
diff changeset
   252
    esac
1ed2155b7ee4 From: Torsten Giebl
Ryan C. Gordon <icculus@icculus.org>
parents: 2070
diff changeset
   253
1361
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents: 1354
diff changeset
   254
    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
   255
    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
   256
        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
   257
    fi
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents: 1354
diff changeset
   258
    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
   259
    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
   260
        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
   261
    fi
3405
d5f2dd33f4eb Merged improvements to SDL_SoftStretch() from SDL 1.2
Sam Lantinga <slouken@libsdl.org>
parents: 3394
diff changeset
   262
    AC_CHECK_FUNC(mprotect,
d5f2dd33f4eb Merged improvements to SDL_SoftStretch() from SDL 1.2
Sam Lantinga <slouken@libsdl.org>
parents: 3394
diff changeset
   263
        AC_TRY_COMPILE([
d5f2dd33f4eb Merged improvements to SDL_SoftStretch() from SDL 1.2
Sam Lantinga <slouken@libsdl.org>
parents: 3394
diff changeset
   264
          #include <sys/types.h>
d5f2dd33f4eb Merged improvements to SDL_SoftStretch() from SDL 1.2
Sam Lantinga <slouken@libsdl.org>
parents: 3394
diff changeset
   265
          #include <sys/mman.h>
d5f2dd33f4eb Merged improvements to SDL_SoftStretch() from SDL 1.2
Sam Lantinga <slouken@libsdl.org>
parents: 3394
diff changeset
   266
        ],[
d5f2dd33f4eb Merged improvements to SDL_SoftStretch() from SDL 1.2
Sam Lantinga <slouken@libsdl.org>
parents: 3394
diff changeset
   267
        ],[
5548
8f0abb6ef37d Updated configure.in to be compatible with autoconf 2.67.
Ryan C. Gordon <icculus@icculus.org>
parents: 5512
diff changeset
   268
        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
   269
        ]),
d5f2dd33f4eb Merged improvements to SDL_SoftStretch() from SDL 1.2
Sam Lantinga <slouken@libsdl.org>
parents: 3394
diff changeset
   270
    )
8090
0098d4459b7a We don't need to check for snprintf() anymore, we don't use it.
Ryan C. Gordon <icculus@icculus.org>
parents: 8089
diff changeset
   271
    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 vsscanf vsnprintf fseeko fseeko64 sigaction setjmp nanosleep sysconf sysctlbyname)
1373
04499d3e1b6b *** empty log message ***
Sam Lantinga <slouken@libsdl.org>
parents: 1370
diff changeset
   272
3014
cacb282192a1 Check for functions after including the libraries that they might be in.
Sam Lantinga <slouken@libsdl.org>
parents: 3012
diff changeset
   273
    AC_CHECK_LIB(m, pow, [LIBS="$LIBS -lm"; EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lm"])
9080
2e4e71ec140f Removed SDL_round() because the license wasn't compatible with zlib
Sam Lantinga <slouken@libsdl.org>
parents: 9075
diff changeset
   274
    AC_CHECK_FUNCS(atan atan2 acos asin ceil copysign cos cosf fabs floor log pow scalbn sin sinf sqrt sqrtf tan tanf)
3014
cacb282192a1 Check for functions after including the libraries that they might be in.
Sam Lantinga <slouken@libsdl.org>
parents: 3012
diff changeset
   275
5040
ff8873816c30 Fixed test for libiconv
Sam Lantinga <slouken@libsdl.org>
parents: 5030
diff changeset
   276
    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
   277
    AC_CHECK_FUNCS(iconv)
5577
ced8a6788629 Work on systems without sa_sigaction.
Ryan C. Gordon <icculus@icculus.org>
parents: 5557
diff changeset
   278
ced8a6788629 Work on systems without sa_sigaction.
Ryan C. Gordon <icculus@icculus.org>
parents: 5557
diff changeset
   279
    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
   280
fi
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents: 1354
diff changeset
   281
7554
4b653ef6050d Further fix SIZEOF_VOIDP in SDL_config.h.in
Edward Rudd <urkle@outoforder.cc>
parents: 7507
diff changeset
   282
dnl AC_CHECK_SIZEOF(void*)
1341
d02b552e5304 Configure dynamically generates SDL_config.h
Sam Lantinga <slouken@libsdl.org>
parents: 1330
diff changeset
   283
5004
0c72ae7b7cb2 Added native atomic operations for Windows, Mac OS X, and gcc compiler intrinsics.
Sam Lantinga <slouken@libsdl.org>
parents: 5003
diff changeset
   284
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
   285
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
   286
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
   287
               [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
   288
              , 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
   289
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
   290
    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
   291
    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
   292
    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
   293
    ],[
0c72ae7b7cb2 Added native atomic operations for Windows, Mac OS X, and gcc compiler intrinsics.
Sam Lantinga <slouken@libsdl.org>
parents: 5003
diff changeset
   294
    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
   295
    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
   296
    __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
   297
    __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
   298
    __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
   299
    __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
   300
    __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
   301
    ],[
0c72ae7b7cb2 Added native atomic operations for Windows, Mac OS X, and gcc compiler intrinsics.
Sam Lantinga <slouken@libsdl.org>
parents: 5003
diff changeset
   302
    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
   303
    ])
0c72ae7b7cb2 Added native atomic operations for Windows, Mac OS X, and gcc compiler intrinsics.
Sam Lantinga <slouken@libsdl.org>
parents: 5003
diff changeset
   304
    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
   305
5068
231dbbc3e31c Fixed atomic intrinsic test
Sam Lantinga <slouken@libsdl.org>
parents: 5066
diff changeset
   306
    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
   307
        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
   308
    else
55ff76cdbbb8 HAVE_GCC_ATOMICS covers the test and set
Sam Lantinga <slouken@libsdl.org>
parents: 5069
diff changeset
   309
        # 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
   310
        AC_TRY_LINK([
55ff76cdbbb8 HAVE_GCC_ATOMICS covers the test and set
Sam Lantinga <slouken@libsdl.org>
parents: 5069
diff changeset
   311
        ],[
55ff76cdbbb8 HAVE_GCC_ATOMICS covers the test and set
Sam Lantinga <slouken@libsdl.org>
parents: 5069
diff changeset
   312
        int a;
55ff76cdbbb8 HAVE_GCC_ATOMICS covers the test and set
Sam Lantinga <slouken@libsdl.org>
parents: 5069
diff changeset
   313
        __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
   314
        __sync_lock_release(&a);
5071
55ff76cdbbb8 HAVE_GCC_ATOMICS covers the test and set
Sam Lantinga <slouken@libsdl.org>
parents: 5069
diff changeset
   315
        ],[
55ff76cdbbb8 HAVE_GCC_ATOMICS covers the test and set
Sam Lantinga <slouken@libsdl.org>
parents: 5069
diff changeset
   316
        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
   317
        ])
55ff76cdbbb8 HAVE_GCC_ATOMICS covers the test and set
Sam Lantinga <slouken@libsdl.org>
parents: 5069
diff changeset
   318
        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
   319
            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
   320
        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
   321
    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
   322
fi
0c72ae7b7cb2 Added native atomic operations for Windows, Mac OS X, and gcc compiler intrinsics.
Sam Lantinga <slouken@libsdl.org>
parents: 5003
diff changeset
   323
1361
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents: 1354
diff changeset
   324
# 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
   325
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
   326
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
   327
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
   328
SOURCES="$SOURCES $srcdir/src/cpuinfo/*.c"
8094
9efaae827924 Implemented the Dynamic API magic.
Ryan C. Gordon <icculus@icculus.org>
parents: 8090
diff changeset
   329
SOURCES="$SOURCES $srcdir/src/dynapi/*.c"
1361
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents: 1354
diff changeset
   330
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
   331
SOURCES="$SOURCES $srcdir/src/file/*.c"
7307
5d6b7b9432d3 Fixed SDL building with the minimal configuration
Sam Lantinga <slouken@libsdl.org>
parents: 7300
diff changeset
   332
SOURCES="$SOURCES $srcdir/src/haptic/*.c"
5d6b7b9432d3 Fixed SDL building with the minimal configuration
Sam Lantinga <slouken@libsdl.org>
parents: 7300
diff changeset
   333
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
   334
SOURCES="$SOURCES $srcdir/src/libm/*.c"
7307
5d6b7b9432d3 Fixed SDL building with the minimal configuration
Sam Lantinga <slouken@libsdl.org>
parents: 7300
diff changeset
   335
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
   336
#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
   337
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
   338
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
   339
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
   340
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
   341
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
   342
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
   343
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   344
dnl Enable/disable various subsystems of the SDL library
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   345
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
   346
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
   347
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
   348
              , 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
   349
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
   350
    AC_DEFINE(SDL_ATOMIC_DISABLED, 1, [ ])
8124
5226058345bf autoconf script tweaks
Edward Rudd <urkle@outoforder.cc>
parents: 8104
diff changeset
   351
else
5226058345bf autoconf script tweaks
Edward Rudd <urkle@outoforder.cc>
parents: 8104
diff changeset
   352
    SUMMARY_modules="${SUMMARY_modules} atomic"
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
   353
fi
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   354
AC_ARG_ENABLE(audio,
1637
9ba366b919c7 Date: Fri, 31 Mar 2006 18:28:55 -0500
Sam Lantinga <slouken@libsdl.org>
parents: 1632
diff changeset
   355
AC_HELP_STRING([--enable-audio], [Enable the audio subsystem [[default=yes]]]),
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   356
              , 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
   357
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
   358
    AC_DEFINE(SDL_AUDIO_DISABLED, 1, [ ])
8124
5226058345bf autoconf script tweaks
Edward Rudd <urkle@outoforder.cc>
parents: 8104
diff changeset
   359
else
5226058345bf autoconf script tweaks
Edward Rudd <urkle@outoforder.cc>
parents: 8104
diff changeset
   360
    SUMMARY_modules="${SUMMARY_modules} audio"
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   361
fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   362
AC_ARG_ENABLE(video,
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-video], [Enable the video subsystem [[default=yes]]]),
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   364
              , 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
   365
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
   366
    AC_DEFINE(SDL_VIDEO_DISABLED, 1, [ ])
8124
5226058345bf autoconf script tweaks
Edward Rudd <urkle@outoforder.cc>
parents: 8104
diff changeset
   367
else
5226058345bf autoconf script tweaks
Edward Rudd <urkle@outoforder.cc>
parents: 8104
diff changeset
   368
    SUMMARY_modules="${SUMMARY_modules} video"
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   369
fi
5226
710d00cb3a6a Made it possible to disable the rendering subsystem with configure --disable-render
Sam Lantinga <slouken@libsdl.org>
parents: 5225
diff changeset
   370
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
   371
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
   372
              , 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
   373
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
   374
    AC_DEFINE(SDL_RENDER_DISABLED, 1, [ ])
8124
5226058345bf autoconf script tweaks
Edward Rudd <urkle@outoforder.cc>
parents: 8104
diff changeset
   375
else
5226058345bf autoconf script tweaks
Edward Rudd <urkle@outoforder.cc>
parents: 8104
diff changeset
   376
    SUMMARY_modules="${SUMMARY_modules} render"
5226
710d00cb3a6a Made it possible to disable the rendering subsystem with configure --disable-render
Sam Lantinga <slouken@libsdl.org>
parents: 5225
diff changeset
   377
fi
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   378
AC_ARG_ENABLE(events,
1637
9ba366b919c7 Date: Fri, 31 Mar 2006 18:28:55 -0500
Sam Lantinga <slouken@libsdl.org>
parents: 1632
diff changeset
   379
AC_HELP_STRING([--enable-events], [Enable the events subsystem [[default=yes]]]),
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   380
              , 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
   381
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
   382
    AC_DEFINE(SDL_EVENTS_DISABLED, 1, [ ])
8124
5226058345bf autoconf script tweaks
Edward Rudd <urkle@outoforder.cc>
parents: 8104
diff changeset
   383
else
5226058345bf autoconf script tweaks
Edward Rudd <urkle@outoforder.cc>
parents: 8104
diff changeset
   384
    SUMMARY_modules="${SUMMARY_modules} events"
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   385
fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   386
AC_ARG_ENABLE(joystick,
1637
9ba366b919c7 Date: Fri, 31 Mar 2006 18:28:55 -0500
Sam Lantinga <slouken@libsdl.org>
parents: 1632
diff changeset
   387
AC_HELP_STRING([--enable-joystick], [Enable the joystick subsystem [[default=yes]]]),
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   388
              , 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
   389
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
   390
    AC_DEFINE(SDL_JOYSTICK_DISABLED, 1, [ ])
8124
5226058345bf autoconf script tweaks
Edward Rudd <urkle@outoforder.cc>
parents: 8104
diff changeset
   391
else
5226058345bf autoconf script tweaks
Edward Rudd <urkle@outoforder.cc>
parents: 8104
diff changeset
   392
    SUMMARY_modules="${SUMMARY_modules} joystick"
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   393
fi
2713
0906692aa6a4 Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents: 2710
diff changeset
   394
AC_ARG_ENABLE(haptic,
0906692aa6a4 Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents: 2710
diff changeset
   395
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
   396
              , enable_haptic=yes)
0906692aa6a4 Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents: 2710
diff changeset
   397
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
   398
    AC_DEFINE(SDL_HAPTIC_DISABLED, 1, [ ])
8124
5226058345bf autoconf script tweaks
Edward Rudd <urkle@outoforder.cc>
parents: 8104
diff changeset
   399
else
5226058345bf autoconf script tweaks
Edward Rudd <urkle@outoforder.cc>
parents: 8104
diff changeset
   400
    SUMMARY_modules="${SUMMARY_modules} haptic"
2713
0906692aa6a4 Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents: 2710
diff changeset
   401
fi
3170
b7a48f533966 Initial work on power subsystem for SDL 1.3.
Ryan C. Gordon <icculus@icculus.org>
parents: 3168
diff changeset
   402
AC_ARG_ENABLE(power,
b7a48f533966 Initial work on power subsystem for SDL 1.3.
Ryan C. Gordon <icculus@icculus.org>
parents: 3168
diff changeset
   403
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
   404
              , enable_power=yes)
b7a48f533966 Initial work on power subsystem for SDL 1.3.
Ryan C. Gordon <icculus@icculus.org>
parents: 3168
diff changeset
   405
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
   406
    AC_DEFINE(SDL_POWER_DISABLED, 1, [ ])
8124
5226058345bf autoconf script tweaks
Edward Rudd <urkle@outoforder.cc>
parents: 8104
diff changeset
   407
else
5226058345bf autoconf script tweaks
Edward Rudd <urkle@outoforder.cc>
parents: 8104
diff changeset
   408
    SUMMARY_modules="${SUMMARY_modules} power"
3170
b7a48f533966 Initial work on power subsystem for SDL 1.3.
Ryan C. Gordon <icculus@icculus.org>
parents: 3168
diff changeset
   409
fi
7667
be1cc6f55840 Added SDL_GetBasePath() and SDL_GetPrefPath() in new filesystem module.
Ryan C. Gordon <icculus@icculus.org>
parents: 7659
diff changeset
   410
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
   411
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
   412
              , enable_filesystem=yes)
be1cc6f55840 Added SDL_GetBasePath() and SDL_GetPrefPath() in new filesystem module.
Ryan C. Gordon <icculus@icculus.org>
parents: 7659
diff changeset
   413
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
   414
    AC_DEFINE(SDL_FILESYSTEM_DISABLED, 1, [ ])
8124
5226058345bf autoconf script tweaks
Edward Rudd <urkle@outoforder.cc>
parents: 8104
diff changeset
   415
else
5226058345bf autoconf script tweaks
Edward Rudd <urkle@outoforder.cc>
parents: 8104
diff changeset
   416
    SUMMARY_modules="${SUMMARY_modules} filesystem"
7667
be1cc6f55840 Added SDL_GetBasePath() and SDL_GetPrefPath() in new filesystem module.
Ryan C. Gordon <icculus@icculus.org>
parents: 7659
diff changeset
   417
fi
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   418
AC_ARG_ENABLE(threads,
1637
9ba366b919c7 Date: Fri, 31 Mar 2006 18:28:55 -0500
Sam Lantinga <slouken@libsdl.org>
parents: 1632
diff changeset
   419
AC_HELP_STRING([--enable-threads], [Enable the threading subsystem [[default=yes]]]),
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   420
              , enable_threads=yes)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   421
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
   422
    AC_DEFINE(SDL_THREADS_DISABLED, 1, [ ])
8124
5226058345bf autoconf script tweaks
Edward Rudd <urkle@outoforder.cc>
parents: 8104
diff changeset
   423
else
5226058345bf autoconf script tweaks
Edward Rudd <urkle@outoforder.cc>
parents: 8104
diff changeset
   424
    SUMMARY_modules="${SUMMARY_modules} threads"
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   425
fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   426
AC_ARG_ENABLE(timers,
1637
9ba366b919c7 Date: Fri, 31 Mar 2006 18:28:55 -0500
Sam Lantinga <slouken@libsdl.org>
parents: 1632
diff changeset
   427
AC_HELP_STRING([--enable-timers], [Enable the timer subsystem [[default=yes]]]),
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   428
              , 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
   429
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
   430
    AC_DEFINE(SDL_TIMERS_DISABLED, 1, [ ])
8124
5226058345bf autoconf script tweaks
Edward Rudd <urkle@outoforder.cc>
parents: 8104
diff changeset
   431
else
5226058345bf autoconf script tweaks
Edward Rudd <urkle@outoforder.cc>
parents: 8104
diff changeset
   432
    SUMMARY_modules="${SUMMARY_modules} timers"
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   433
fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   434
AC_ARG_ENABLE(file,
1637
9ba366b919c7 Date: Fri, 31 Mar 2006 18:28:55 -0500
Sam Lantinga <slouken@libsdl.org>
parents: 1632
diff changeset
   435
AC_HELP_STRING([--enable-file], [Enable the file subsystem [[default=yes]]]),
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   436
              , 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
   437
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
   438
    AC_DEFINE(SDL_FILE_DISABLED, 1, [ ])
8124
5226058345bf autoconf script tweaks
Edward Rudd <urkle@outoforder.cc>
parents: 8104
diff changeset
   439
else
5226058345bf autoconf script tweaks
Edward Rudd <urkle@outoforder.cc>
parents: 8104
diff changeset
   440
    SUMMARY_modules="${SUMMARY_modules} file"
1361
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents: 1354
diff changeset
   441
fi
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents: 1354
diff changeset
   442
AC_ARG_ENABLE(loadso,
1637
9ba366b919c7 Date: Fri, 31 Mar 2006 18:28:55 -0500
Sam Lantinga <slouken@libsdl.org>
parents: 1632
diff changeset
   443
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
   444
              , 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
   445
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
   446
    AC_DEFINE(SDL_LOADSO_DISABLED, 1, [ ])
8124
5226058345bf autoconf script tweaks
Edward Rudd <urkle@outoforder.cc>
parents: 8104
diff changeset
   447
else
5226058345bf autoconf script tweaks
Edward Rudd <urkle@outoforder.cc>
parents: 8104
diff changeset
   448
    SUMMARY_modules="${SUMMARY_modules} loadso"
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   449
fi
740
e70f80e98f60 Actually hook the cpuinfo module into the library. :)
Sam Lantinga <slouken@libsdl.org>
parents: 739
diff changeset
   450
AC_ARG_ENABLE(cpuinfo,
1637
9ba366b919c7 Date: Fri, 31 Mar 2006 18:28:55 -0500
Sam Lantinga <slouken@libsdl.org>
parents: 1632
diff changeset
   451
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
   452
              , 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
   453
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
   454
    AC_DEFINE(SDL_CPUINFO_DISABLED, 1, [ ])
8124
5226058345bf autoconf script tweaks
Edward Rudd <urkle@outoforder.cc>
parents: 8104
diff changeset
   455
else
5226058345bf autoconf script tweaks
Edward Rudd <urkle@outoforder.cc>
parents: 8104
diff changeset
   456
    SUMMARY_modules="${SUMMARY_modules} cpuinfo"
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
   457
fi
1402
d910939febfa Use consistent identifiers for the various platforms we support.
Sam Lantinga <slouken@libsdl.org>
parents: 1399
diff changeset
   458
AC_ARG_ENABLE(assembly,
1637
9ba366b919c7 Date: Fri, 31 Mar 2006 18:28:55 -0500
Sam Lantinga <slouken@libsdl.org>
parents: 1632
diff changeset
   459
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
   460
              , enable_assembly=yes)
d910939febfa Use consistent identifiers for the various platforms we support.
Sam Lantinga <slouken@libsdl.org>
parents: 1399
diff changeset
   461
if test x$enable_assembly = xyes; then
8124
5226058345bf autoconf script tweaks
Edward Rudd <urkle@outoforder.cc>
parents: 8104
diff changeset
   462
    SUMMARY_modules="${SUMMARY_modules} assembly"
5226058345bf autoconf script tweaks
Edward Rudd <urkle@outoforder.cc>
parents: 8104
diff changeset
   463
5548
8f0abb6ef37d Updated configure.in to be compatible with autoconf 2.67.
Ryan C. Gordon <icculus@icculus.org>
parents: 5512
diff changeset
   464
    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
   465
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
   466
    # 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
   467
    # 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
   468
    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
   469
        *-*-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
   470
            # 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
   471
            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
   472
            ;;
c765f5fa4a2c Default SSE2 off on iX86, since gcc will use it for floating point operations
Sam Lantinga <slouken@libsdl.org>
parents: 2820
diff changeset
   473
        *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
   474
            # 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
   475
            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
   476
            ;;
3392
efc22582afc5 Only show the dynamic audio libraries if we'll be dynamically loading them
Sam Lantinga <slouken@libsdl.org>
parents: 3391
diff changeset
   477
        *)
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
   478
            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
   479
            ;;
c765f5fa4a2c Default SSE2 off on iX86, since gcc will use it for floating point operations
Sam Lantinga <slouken@libsdl.org>
parents: 2820
diff changeset
   480
    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
   481
    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
   482
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
   483
                  , 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
   484
    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
   485
        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
   486
            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
   487
        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
   488
    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
   489
2247
93994f65c74c Removed hermes since it's LGPL and not compatible with a commercial license.
Sam Lantinga <slouken@libsdl.org>
parents: 2238
diff changeset
   490
    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
   491
    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
   492
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
   493
                  , 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
   494
    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
   495
        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
   496
        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
   497
        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
   498
        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
   499
        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
   500
93994f65c74c Removed hermes since it's LGPL and not compatible with a commercial license.
Sam Lantinga <slouken@libsdl.org>
parents: 2238
diff changeset
   501
        AC_TRY_COMPILE([
4426
1bceff8f008f Fixed bug #943
Sam Lantinga <slouken@libsdl.org>
parents: 3696
diff changeset
   502
        #ifdef __MINGW32__
1bceff8f008f Fixed bug #943
Sam Lantinga <slouken@libsdl.org>
parents: 3696
diff changeset
   503
        #include <_mingw.h>
1bceff8f008f Fixed bug #943
Sam Lantinga <slouken@libsdl.org>
parents: 3696
diff changeset
   504
        #ifdef __MINGW64_VERSION_MAJOR
1bceff8f008f Fixed bug #943
Sam Lantinga <slouken@libsdl.org>
parents: 3696
diff changeset
   505
        #include <intrin.h>
1bceff8f008f Fixed bug #943
Sam Lantinga <slouken@libsdl.org>
parents: 3696
diff changeset
   506
        #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
   507
        #include <mmintrin.h>
4426
1bceff8f008f Fixed bug #943
Sam Lantinga <slouken@libsdl.org>
parents: 3696
diff changeset
   508
        #endif
1bceff8f008f Fixed bug #943
Sam Lantinga <slouken@libsdl.org>
parents: 3696
diff changeset
   509
        #else
1bceff8f008f Fixed bug #943
Sam Lantinga <slouken@libsdl.org>
parents: 3696
diff changeset
   510
        #include <mmintrin.h>
1bceff8f008f Fixed bug #943
Sam Lantinga <slouken@libsdl.org>
parents: 3696
diff changeset
   511
        #endif
2261
c20476d7d7b3 Enabled 3DNow! intrinsic support
Sam Lantinga <slouken@libsdl.org>
parents: 2247
diff changeset
   512
        #ifndef __MMX__
c20476d7d7b3 Enabled 3DNow! intrinsic support
Sam Lantinga <slouken@libsdl.org>
parents: 2247
diff changeset
   513
        #error Assembler CPP flag not enabled
c20476d7d7b3 Enabled 3DNow! intrinsic support
Sam Lantinga <slouken@libsdl.org>
parents: 2247
diff changeset
   514
        #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
   515
        ],[
93994f65c74c Removed hermes since it's LGPL and not compatible with a commercial license.
Sam Lantinga <slouken@libsdl.org>
parents: 2238
diff changeset
   516
        ],[
93994f65c74c Removed hermes since it's LGPL and not compatible with a commercial license.
Sam Lantinga <slouken@libsdl.org>
parents: 2238
diff changeset
   517
        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
   518
        ])
93994f65c74c Removed hermes since it's LGPL and not compatible with a commercial license.
Sam Lantinga <slouken@libsdl.org>
parents: 2238
diff changeset
   519
        AC_MSG_RESULT($have_gcc_mmx)
2290
323a5af2924b Christian Walther fixed bug #530
Sam Lantinga <slouken@libsdl.org>
parents: 2271
diff changeset
   520
        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
   521
93994f65c74c Removed hermes since it's LGPL and not compatible with a commercial license.
Sam Lantinga <slouken@libsdl.org>
parents: 2238
diff changeset
   522
        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
   523
            EXTRA_CFLAGS="$EXTRA_CFLAGS $mmx_CFLAGS"
8124
5226058345bf autoconf script tweaks
Edward Rudd <urkle@outoforder.cc>
parents: 8104
diff changeset
   524
            SUMMARY_math="${SUMMARY_math} mmx"
2247
93994f65c74c Removed hermes since it's LGPL and not compatible with a commercial license.
Sam Lantinga <slouken@libsdl.org>
parents: 2238
diff changeset
   525
        fi
93994f65c74c Removed hermes since it's LGPL and not compatible with a commercial license.
Sam Lantinga <slouken@libsdl.org>
parents: 2238
diff changeset
   526
    fi
93994f65c74c Removed hermes since it's LGPL and not compatible with a commercial license.
Sam Lantinga <slouken@libsdl.org>
parents: 2238
diff changeset
   527
5389
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   528
    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
   529
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
   530
                  , enable_3dnow=yes)
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   531
    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
   532
        save_CFLAGS="$CFLAGS"
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   533
        have_gcc_3dnow=no
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   534
        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
   535
        amd3dnow_CFLAGS="-m3dnow"
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   536
        CFLAGS="$save_CFLAGS $amd3dnow_CFLAGS"
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   537
6443
21827b6a7cfd Fixed 3DNow! detection for clang llvm
Sam Lantinga <slouken@libsdl.org>
parents: 6431
diff changeset
   538
        AC_TRY_LINK([
5389
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   539
        #include <mm3dnow.h>
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   540
        #ifndef __3dNOW__
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   541
        #error Assembler CPP flag not enabled
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   542
        #endif
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   543
        ],[
6443
21827b6a7cfd Fixed 3DNow! detection for clang llvm
Sam Lantinga <slouken@libsdl.org>
parents: 6431
diff changeset
   544
        void *p = 0;
21827b6a7cfd Fixed 3DNow! detection for clang llvm
Sam Lantinga <slouken@libsdl.org>
parents: 6431
diff changeset
   545
        _m_prefetch(p);
5389
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   546
        ],[
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   547
        have_gcc_3dnow=yes
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   548
        ])
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   549
        AC_MSG_RESULT($have_gcc_3dnow)
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   550
        CFLAGS="$save_CFLAGS"
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   551
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   552
        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
   553
            EXTRA_CFLAGS="$EXTRA_CFLAGS $amd3dnow_CFLAGS"
8124
5226058345bf autoconf script tweaks
Edward Rudd <urkle@outoforder.cc>
parents: 8104
diff changeset
   554
            SUMMARY_math="${SUMMARY_math} 3dnow"
5389
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   555
        fi
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   556
    fi
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   557
2247
93994f65c74c Removed hermes since it's LGPL and not compatible with a commercial license.
Sam Lantinga <slouken@libsdl.org>
parents: 2238
diff changeset
   558
    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
   559
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
   560
                  , 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
   561
    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
   562
        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
   563
        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
   564
        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
   565
        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
   566
        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
   567
93994f65c74c Removed hermes since it's LGPL and not compatible with a commercial license.
Sam Lantinga <slouken@libsdl.org>
parents: 2238
diff changeset
   568
        AC_TRY_COMPILE([
4426
1bceff8f008f Fixed bug #943
Sam Lantinga <slouken@libsdl.org>
parents: 3696
diff changeset
   569
        #ifdef __MINGW32__
1bceff8f008f Fixed bug #943
Sam Lantinga <slouken@libsdl.org>
parents: 3696
diff changeset
   570
        #include <_mingw.h>
1bceff8f008f Fixed bug #943
Sam Lantinga <slouken@libsdl.org>
parents: 3696
diff changeset
   571
        #ifdef __MINGW64_VERSION_MAJOR
1bceff8f008f Fixed bug #943
Sam Lantinga <slouken@libsdl.org>
parents: 3696
diff changeset
   572
        #include <intrin.h>
1bceff8f008f Fixed bug #943
Sam Lantinga <slouken@libsdl.org>
parents: 3696
diff changeset
   573
        #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
   574
        #include <xmmintrin.h>
4426
1bceff8f008f Fixed bug #943
Sam Lantinga <slouken@libsdl.org>
parents: 3696
diff changeset
   575
        #endif
1bceff8f008f Fixed bug #943
Sam Lantinga <slouken@libsdl.org>
parents: 3696
diff changeset
   576
        #else
1bceff8f008f Fixed bug #943
Sam Lantinga <slouken@libsdl.org>
parents: 3696
diff changeset
   577
        #include <xmmintrin.h>
1bceff8f008f Fixed bug #943
Sam Lantinga <slouken@libsdl.org>
parents: 3696
diff changeset
   578
        #endif
2261
c20476d7d7b3 Enabled 3DNow! intrinsic support
Sam Lantinga <slouken@libsdl.org>
parents: 2247
diff changeset
   579
        #ifndef __SSE__
c20476d7d7b3 Enabled 3DNow! intrinsic support
Sam Lantinga <slouken@libsdl.org>
parents: 2247
diff changeset
   580
        #error Assembler CPP flag not enabled
c20476d7d7b3 Enabled 3DNow! intrinsic support
Sam Lantinga <slouken@libsdl.org>
parents: 2247
diff changeset
   581
        #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
   582
        ],[
93994f65c74c Removed hermes since it's LGPL and not compatible with a commercial license.
Sam Lantinga <slouken@libsdl.org>
parents: 2238
diff changeset
   583
        ],[
93994f65c74c Removed hermes since it's LGPL and not compatible with a commercial license.
Sam Lantinga <slouken@libsdl.org>
parents: 2238
diff changeset
   584
        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
   585
        ])
93994f65c74c Removed hermes since it's LGPL and not compatible with a commercial license.
Sam Lantinga <slouken@libsdl.org>
parents: 2238
diff changeset
   586
        AC_MSG_RESULT($have_gcc_sse)
2290
323a5af2924b Christian Walther fixed bug #530
Sam Lantinga <slouken@libsdl.org>
parents: 2271
diff changeset
   587
        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
   588
93994f65c74c Removed hermes since it's LGPL and not compatible with a commercial license.
Sam Lantinga <slouken@libsdl.org>
parents: 2238
diff changeset
   589
        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
   590
            EXTRA_CFLAGS="$EXTRA_CFLAGS $sse_CFLAGS"
8124
5226058345bf autoconf script tweaks
Edward Rudd <urkle@outoforder.cc>
parents: 8104
diff changeset
   591
            SUMMARY_math="${SUMMARY_math} sse"
2247
93994f65c74c Removed hermes since it's LGPL and not compatible with a commercial license.
Sam Lantinga <slouken@libsdl.org>
parents: 2238
diff changeset
   592
        fi
93994f65c74c Removed hermes since it's LGPL and not compatible with a commercial license.
Sam Lantinga <slouken@libsdl.org>
parents: 2238
diff changeset
   593
    fi
93994f65c74c Removed hermes since it's LGPL and not compatible with a commercial license.
Sam Lantinga <slouken@libsdl.org>
parents: 2238
diff changeset
   594
2264
f7f80b822c1f Enabled SSE2 intrinsics
Sam Lantinga <slouken@libsdl.org>
parents: 2261
diff changeset
   595
    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
   596
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
   597
                  , enable_sse2=$default_ssemath)
2264
f7f80b822c1f Enabled SSE2 intrinsics
Sam Lantinga <slouken@libsdl.org>
parents: 2261
diff changeset
   598
    if test x$enable_sse2 = xyes; then
f7f80b822c1f Enabled SSE2 intrinsics
Sam Lantinga <slouken@libsdl.org>
parents: 2261
diff changeset
   599
        save_CFLAGS="$CFLAGS"
f7f80b822c1f Enabled SSE2 intrinsics
Sam Lantinga <slouken@libsdl.org>
parents: 2261
diff changeset
   600
        have_gcc_sse2=no
f7f80b822c1f Enabled SSE2 intrinsics
Sam Lantinga <slouken@libsdl.org>
parents: 2261
diff changeset
   601
        AC_MSG_CHECKING(for GCC -msse2 option)
f7f80b822c1f Enabled SSE2 intrinsics
Sam Lantinga <slouken@libsdl.org>
parents: 2261
diff changeset
   602
        sse2_CFLAGS="-msse2"
f7f80b822c1f Enabled SSE2 intrinsics
Sam Lantinga <slouken@libsdl.org>
parents: 2261
diff changeset
   603
        CFLAGS="$save_CFLAGS $sse2_CFLAGS"
f7f80b822c1f Enabled SSE2 intrinsics
Sam Lantinga <slouken@libsdl.org>
parents: 2261
diff changeset
   604
f7f80b822c1f Enabled SSE2 intrinsics
Sam Lantinga <slouken@libsdl.org>
parents: 2261
diff changeset
   605
        AC_TRY_COMPILE([
4426
1bceff8f008f Fixed bug #943
Sam Lantinga <slouken@libsdl.org>
parents: 3696
diff changeset
   606
        #ifdef __MINGW32__
1bceff8f008f Fixed bug #943
Sam Lantinga <slouken@libsdl.org>
parents: 3696
diff changeset
   607
        #include <_mingw.h>
1bceff8f008f Fixed bug #943
Sam Lantinga <slouken@libsdl.org>
parents: 3696
diff changeset
   608
        #ifdef __MINGW64_VERSION_MAJOR
1bceff8f008f Fixed bug #943
Sam Lantinga <slouken@libsdl.org>
parents: 3696
diff changeset
   609
        #include <intrin.h>
1bceff8f008f Fixed bug #943
Sam Lantinga <slouken@libsdl.org>
parents: 3696
diff changeset
   610
        #else
2264
f7f80b822c1f Enabled SSE2 intrinsics
Sam Lantinga <slouken@libsdl.org>
parents: 2261
diff changeset
   611
        #include <emmintrin.h>
4426
1bceff8f008f Fixed bug #943
Sam Lantinga <slouken@libsdl.org>
parents: 3696
diff changeset
   612
        #endif
1bceff8f008f Fixed bug #943
Sam Lantinga <slouken@libsdl.org>
parents: 3696
diff changeset
   613
        #else
1bceff8f008f Fixed bug #943
Sam Lantinga <slouken@libsdl.org>
parents: 3696
diff changeset
   614
        #include <emmintrin.h>
1bceff8f008f Fixed bug #943
Sam Lantinga <slouken@libsdl.org>
parents: 3696
diff changeset
   615
        #endif
2264
f7f80b822c1f Enabled SSE2 intrinsics
Sam Lantinga <slouken@libsdl.org>
parents: 2261
diff changeset
   616
        #ifndef __SSE2__
f7f80b822c1f Enabled SSE2 intrinsics
Sam Lantinga <slouken@libsdl.org>
parents: 2261
diff changeset
   617
        #error Assembler CPP flag not enabled
f7f80b822c1f Enabled SSE2 intrinsics
Sam Lantinga <slouken@libsdl.org>
parents: 2261
diff changeset
   618
        #endif
f7f80b822c1f Enabled SSE2 intrinsics
Sam Lantinga <slouken@libsdl.org>
parents: 2261
diff changeset
   619
        ],[
f7f80b822c1f Enabled SSE2 intrinsics
Sam Lantinga <slouken@libsdl.org>
parents: 2261
diff changeset
   620
        ],[
f7f80b822c1f Enabled SSE2 intrinsics
Sam Lantinga <slouken@libsdl.org>
parents: 2261
diff changeset
   621
        have_gcc_sse2=yes
f7f80b822c1f Enabled SSE2 intrinsics
Sam Lantinga <slouken@libsdl.org>
parents: 2261
diff changeset
   622
        ])
f7f80b822c1f Enabled SSE2 intrinsics
Sam Lantinga <slouken@libsdl.org>
parents: 2261
diff changeset
   623
        AC_MSG_RESULT($have_gcc_sse2)
2290
323a5af2924b Christian Walther fixed bug #530
Sam Lantinga <slouken@libsdl.org>
parents: 2271
diff changeset
   624
        CFLAGS="$save_CFLAGS"
2264
f7f80b822c1f Enabled SSE2 intrinsics
Sam Lantinga <slouken@libsdl.org>
parents: 2261
diff changeset
   625
f7f80b822c1f Enabled SSE2 intrinsics
Sam Lantinga <slouken@libsdl.org>
parents: 2261
diff changeset
   626
        if test x$have_gcc_sse2 = xyes; then
f7f80b822c1f Enabled SSE2 intrinsics
Sam Lantinga <slouken@libsdl.org>
parents: 2261
diff changeset
   627
            EXTRA_CFLAGS="$EXTRA_CFLAGS $sse2_CFLAGS"
8124
5226058345bf autoconf script tweaks
Edward Rudd <urkle@outoforder.cc>
parents: 8104
diff changeset
   628
            SUMMARY_math="${SUMMARY_math} sse2"
2264
f7f80b822c1f Enabled SSE2 intrinsics
Sam Lantinga <slouken@libsdl.org>
parents: 2261
diff changeset
   629
        fi
f7f80b822c1f Enabled SSE2 intrinsics
Sam Lantinga <slouken@libsdl.org>
parents: 2261
diff changeset
   630
    fi
5389
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
    AC_ARG_ENABLE(altivec,
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   633
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
   634
                  , enable_altivec=yes)
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   635
    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
   636
        save_CFLAGS="$CFLAGS"
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   637
        have_gcc_altivec=no
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   638
        have_altivec_h_hdr=no
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   639
        altivec_CFLAGS="-maltivec"
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   640
        CFLAGS="$save_CFLAGS $altivec_CFLAGS"
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
        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
   643
        AC_TRY_COMPILE([
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   644
        #include <altivec.h>
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   645
        vector unsigned int vzero() {
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   646
            return vec_splat_u32(0);
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   647
        }
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
        ],[
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   650
        have_gcc_altivec=yes
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   651
        have_altivec_h_hdr=yes
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   652
        ])
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   653
        AC_MSG_RESULT($have_gcc_altivec)
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
        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
   656
            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
   657
            AC_TRY_COMPILE([
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   658
            vector unsigned int vzero() {
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   659
                return vec_splat_u32(0);
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   660
            }
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   661
            ],[
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
            have_gcc_altivec=yes
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   664
            ])
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   665
            AC_MSG_RESULT($have_gcc_altivec)
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   666
        fi
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   667
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   668
        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
   669
            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
   670
            altivec_CFLAGS="-faltivec"
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   671
            CFLAGS="$save_CFLAGS $altivec_CFLAGS"
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   672
            AC_TRY_COMPILE([
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   673
            #include <altivec.h>
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   674
            vector unsigned int vzero() {
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   675
                return vec_splat_u32(0);
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   676
            }
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   677
            ],[
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   678
            ],[
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   679
            have_gcc_altivec=yes
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   680
            have_altivec_h_hdr=yes
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   681
            ])
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   682
            AC_MSG_RESULT($have_gcc_altivec)
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   683
        fi
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   684
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   685
        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
   686
            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
   687
            AC_TRY_COMPILE([
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   688
            vector unsigned int vzero() {
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   689
                return vec_splat_u32(0);
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   690
            }
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   691
            ],[
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   692
            ],[
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   693
            have_gcc_altivec=yes
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   694
            ])
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   695
            AC_MSG_RESULT($have_gcc_altivec)
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   696
        fi
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   697
        CFLAGS="$save_CFLAGS"
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   698
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   699
        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
   700
            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
   701
            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
   702
              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
   703
            fi
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   704
            EXTRA_CFLAGS="$EXTRA_CFLAGS $altivec_CFLAGS"
8124
5226058345bf autoconf script tweaks
Edward Rudd <urkle@outoforder.cc>
parents: 8104
diff changeset
   705
            SUMMARY_math="${SUMMARY_math} altivec"
5389
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   706
        fi
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   707
    fi
740
e70f80e98f60 Actually hook the cpuinfo module into the library. :)
Sam Lantinga <slouken@libsdl.org>
parents: 739
diff changeset
   708
fi
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   709
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   710
dnl See if the OSS audio interface is supported
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   711
CheckOSS()
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   712
{
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   713
    AC_ARG_ENABLE(oss,
7380
e5830832d3f0 Disable OSS and BSD audio targets on OpenBSD.
Ryan C. Gordon <icculus@icculus.org>
parents: 7379
diff changeset
   714
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
   715
                  , enable_oss=maybe)
e5830832d3f0 Disable OSS and BSD audio targets on OpenBSD.
Ryan C. Gordon <icculus@icculus.org>
parents: 7379
diff changeset
   716
e5830832d3f0 Disable OSS and BSD audio targets on OpenBSD.
Ryan C. Gordon <icculus@icculus.org>
parents: 7379
diff changeset
   717
    # 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
   718
    #  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
   719
    #  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
   720
    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
   721
        enable_oss=yes
e5830832d3f0 Disable OSS and BSD audio targets on OpenBSD.
Ryan C. Gordon <icculus@icculus.org>
parents: 7379
diff changeset
   722
        case "$host" in
e5830832d3f0 Disable OSS and BSD audio targets on OpenBSD.
Ryan C. Gordon <icculus@icculus.org>
parents: 7379
diff changeset
   723
            *-*-openbsd*)
e5830832d3f0 Disable OSS and BSD audio targets on OpenBSD.
Ryan C. Gordon <icculus@icculus.org>
parents: 7379
diff changeset
   724
                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
   725
        esac
7380
e5830832d3f0 Disable OSS and BSD audio targets on OpenBSD.
Ryan C. Gordon <icculus@icculus.org>
parents: 7379
diff changeset
   726
    fi
e5830832d3f0 Disable OSS and BSD audio targets on OpenBSD.
Ryan C. Gordon <icculus@icculus.org>
parents: 7379
diff changeset
   727
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   728
    if test x$enable_audio = xyes -a x$enable_oss = xyes; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   729
        AC_MSG_CHECKING(for OSS audio support)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   730
        have_oss=no
94
ae6e6b73333f Cleaned up the OpenBSD port, thanks to Peter Valchev
Sam Lantinga <slouken@lokigames.com>
parents: 86
diff changeset
   731
        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
   732
            AC_TRY_COMPILE([
ae6e6b73333f Cleaned up the OpenBSD port, thanks to Peter Valchev
Sam Lantinga <slouken@lokigames.com>
parents: 86
diff changeset
   733
              #include <sys/soundcard.h>
ae6e6b73333f Cleaned up the OpenBSD port, thanks to Peter Valchev
Sam Lantinga <slouken@lokigames.com>
parents: 86
diff changeset
   734
            ],[
ae6e6b73333f Cleaned up the OpenBSD port, thanks to Peter Valchev
Sam Lantinga <slouken@lokigames.com>
parents: 86
diff changeset
   735
              int arg = SNDCTL_DSP_SETFRAGMENT;
ae6e6b73333f Cleaned up the OpenBSD port, thanks to Peter Valchev
Sam Lantinga <slouken@lokigames.com>
parents: 86
diff changeset
   736
            ],[
ae6e6b73333f Cleaned up the OpenBSD port, thanks to Peter Valchev
Sam Lantinga <slouken@lokigames.com>
parents: 86
diff changeset
   737
            have_oss=yes
ae6e6b73333f Cleaned up the OpenBSD port, thanks to Peter Valchev
Sam Lantinga <slouken@lokigames.com>
parents: 86
diff changeset
   738
            ])
ae6e6b73333f Cleaned up the OpenBSD port, thanks to Peter Valchev
Sam Lantinga <slouken@lokigames.com>
parents: 86
diff changeset
   739
        fi
ae6e6b73333f Cleaned up the OpenBSD port, thanks to Peter Valchev
Sam Lantinga <slouken@lokigames.com>
parents: 86
diff changeset
   740
        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
   741
            AC_TRY_COMPILE([
ae6e6b73333f Cleaned up the OpenBSD port, thanks to Peter Valchev
Sam Lantinga <slouken@lokigames.com>
parents: 86
diff changeset
   742
              #include <soundcard.h>
ae6e6b73333f Cleaned up the OpenBSD port, thanks to Peter Valchev
Sam Lantinga <slouken@lokigames.com>
parents: 86
diff changeset
   743
            ],[
ae6e6b73333f Cleaned up the OpenBSD port, thanks to Peter Valchev
Sam Lantinga <slouken@lokigames.com>
parents: 86
diff changeset
   744
              int arg = SNDCTL_DSP_SETFRAGMENT;
ae6e6b73333f Cleaned up the OpenBSD port, thanks to Peter Valchev
Sam Lantinga <slouken@lokigames.com>
parents: 86
diff changeset
   745
            ],[
ae6e6b73333f Cleaned up the OpenBSD port, thanks to Peter Valchev
Sam Lantinga <slouken@lokigames.com>
parents: 86
diff changeset
   746
            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
   747
            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
   748
            ])
ae6e6b73333f Cleaned up the OpenBSD port, thanks to Peter Valchev
Sam Lantinga <slouken@lokigames.com>
parents: 86
diff changeset
   749
        fi
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   750
        AC_MSG_RESULT($have_oss)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   751
        if test x$have_oss = xyes; then
8124
5226058345bf autoconf script tweaks
Edward Rudd <urkle@outoforder.cc>
parents: 8104
diff changeset
   752
            SUMMARY_audio="${SUMMARY_audio} oss"
5548
8f0abb6ef37d Updated configure.in to be compatible with autoconf 2.67.
Ryan C. Gordon <icculus@icculus.org>
parents: 5512
diff changeset
   753
            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
   754
            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
   755
            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
   756
1565
57431b199aed Fixed bug #52
Sam Lantinga <slouken@libsdl.org>
parents: 1556
diff changeset
   757
            # We may need to link with ossaudio emulation library
1550
31c2b8e4885e Fixed bug #166
Sam Lantinga <slouken@libsdl.org>
parents: 1548
diff changeset
   758
            case "$host" in
1383
1736c5e2173f NetBSD support
Sam Lantinga <slouken@libsdl.org>
parents: 1380
diff changeset
   759
                *-*-openbsd*|*-*-netbsd*)
1521
9b9212e4810c CFLAGS are separate from EXTRA_CFLAGS
Sam Lantinga <slouken@libsdl.org>
parents: 1520
diff changeset
   760
                    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
   761
            esac
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   762
        fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   763
    fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   764
}
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   765
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   766
dnl See if the ALSA audio interface is supported
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   767
CheckALSA()
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   768
{
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   769
    AC_ARG_ENABLE(alsa,
1637
9ba366b919c7 Date: Fri, 31 Mar 2006 18:28:55 -0500
Sam Lantinga <slouken@libsdl.org>
parents: 1632
diff changeset
   770
AC_HELP_STRING([--enable-alsa], [support the ALSA audio API [[default=yes]]]),
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   771
                  , enable_alsa=yes)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   772
    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
   773
        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
   774
        # 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
   775
        CFLAGS="$alsa_save_CFLAGS"
027688378762 No really, don't link with the ALSA library!
Sam Lantinga <slouken@libsdl.org>
parents: 991
diff changeset
   776
        LDFLAGS="$alsa_save_LDFLAGS"
027688378762 No really, don't link with the ALSA library!
Sam Lantinga <slouken@libsdl.org>
parents: 991
diff changeset
   777
        LIBS="$alsa_save_LIBS"
354
30935e76acb5 Updated ALSA audio support for ALSA 0.9
Sam Lantinga <slouken@libsdl.org>
parents: 350
diff changeset
   778
        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
   779
            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
   780
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
   781
                          , 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
   782
            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
   783
5548
8f0abb6ef37d Updated configure.in to be compatible with autoconf 2.67.
Ryan C. Gordon <icculus@icculus.org>
parents: 5512
diff changeset
   784
            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
   785
            SOURCES="$SOURCES $srcdir/src/audio/alsa/*.c"
1521
9b9212e4810c CFLAGS are separate from EXTRA_CFLAGS
Sam Lantinga <slouken@libsdl.org>
parents: 1520
diff changeset
   786
            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
   787
            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
   788
               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
   789
                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
   790
            fi
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents: 1354
diff changeset
   791
            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
   792
               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
   793
                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
   794
                AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_ALSA_DYNAMIC, "$alsa_lib", [ ])
8124
5226058345bf autoconf script tweaks
Edward Rudd <urkle@outoforder.cc>
parents: 8104
diff changeset
   795
                SUMMARY_audio="${SUMMARY_audio} alsa(dynamic)"
1361
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents: 1354
diff changeset
   796
            else
1521
9b9212e4810c CFLAGS are separate from EXTRA_CFLAGS
Sam Lantinga <slouken@libsdl.org>
parents: 1520
diff changeset
   797
                EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ALSA_LIBS"
8124
5226058345bf autoconf script tweaks
Edward Rudd <urkle@outoforder.cc>
parents: 8104
diff changeset
   798
                SUMMARY_audio="${SUMMARY_audio} alsa"
1361
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents: 1354
diff changeset
   799
            fi
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents: 1354
diff changeset
   800
            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
   801
        fi
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents: 1354
diff changeset
   802
    fi
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   803
}
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   804
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   805
dnl Find the ESD includes and libraries
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   806
CheckESD()
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   807
{
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   808
    AC_ARG_ENABLE(esd,
1637
9ba366b919c7 Date: Fri, 31 Mar 2006 18:28:55 -0500
Sam Lantinga <slouken@libsdl.org>
parents: 1632
diff changeset
   809
AC_HELP_STRING([--enable-esd], [support the Enlightened Sound Daemon [[default=yes]]]),
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   810
                  , enable_esd=yes)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   811
    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
   812
        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
   813
        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
   814
            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
   815
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
   816
                          , 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
   817
            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
   818
5548
8f0abb6ef37d Updated configure.in to be compatible with autoconf 2.67.
Ryan C. Gordon <icculus@icculus.org>
parents: 5512
diff changeset
   819
            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
   820
            SOURCES="$SOURCES $srcdir/src/audio/esd/*.c"
1521
9b9212e4810c CFLAGS are separate from EXTRA_CFLAGS
Sam Lantinga <slouken@libsdl.org>
parents: 1520
diff changeset
   821
            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
   822
            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
   823
               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
   824
                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
   825
            fi
1173
e9cf8c1b4590 Split up src/SDL_loadso.c into platform directories.
Ryan C. Gordon <icculus@icculus.org>
parents: 1170
diff changeset
   826
            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
   827
               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
   828
                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
   829
                AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_ESD_DYNAMIC, "$esd_lib", [ ])
8124
5226058345bf autoconf script tweaks
Edward Rudd <urkle@outoforder.cc>
parents: 8104
diff changeset
   830
                SUMMARY_audio="${SUMMARY_audio} esd(dynamic)"
1467
b69f2b0309a0 Removed accidentally copied/pasted script for ALSA detection
Sam Lantinga <slouken@libsdl.org>
parents: 1459
diff changeset
   831
            else
1521
9b9212e4810c CFLAGS are separate from EXTRA_CFLAGS
Sam Lantinga <slouken@libsdl.org>
parents: 1520
diff changeset
   832
                EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ESD_LIBS"
8124
5226058345bf autoconf script tweaks
Edward Rudd <urkle@outoforder.cc>
parents: 8104
diff changeset
   833
                SUMMARY_audio="${SUMMARY_audio} esd"
294
d2d48e10f370 Added a new header file: SDL_loadso.h
Sam Lantinga <slouken@libsdl.org>
parents: 292
diff changeset
   834
            fi
1361
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents: 1354
diff changeset
   835
            have_audio=yes
294
d2d48e10f370 Added a new header file: SDL_loadso.h
Sam Lantinga <slouken@libsdl.org>
parents: 292
diff changeset
   836
        fi
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   837
    fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   838
}
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   839
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
   840
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
   841
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
   842
{
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
   843
    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
   844
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
   845
                  , 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
   846
    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
   847
        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
   848
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
        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
   850
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
        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
   852
        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
   853
        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
   854
        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
   855
                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
   856
                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
   857
                audio_pulseaudio=yes
3391
188fc5ecc58c Simplify and improve dynamic library detection, taken from SDL_image
Sam Lantinga <slouken@libsdl.org>
parents: 3390
diff changeset
   858
            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
   859
        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
   860
        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
   861
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
   862
        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
   863
            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
   864
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
   865
                          , 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
   866
            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
   867
5548
8f0abb6ef37d Updated configure.in to be compatible with autoconf 2.67.
Ryan C. Gordon <icculus@icculus.org>
parents: 5512
diff changeset
   868
            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
   869
            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
   870
            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
   871
            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
   872
               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
   873
                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
   874
            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
   875
            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
   876
               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
   877
                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
   878
                AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_PULSEAUDIO_DYNAMIC, "$pulseaudio_lib", [ ])
8124
5226058345bf autoconf script tweaks
Edward Rudd <urkle@outoforder.cc>
parents: 8104
diff changeset
   879
                SUMMARY_audio="${SUMMARY_audio} pulse(dynamic)"
6967
adc80d085ddf Fix pulseaudio dynamic linking for Solaris builds.
Shawn Walker <eviltypeguy@icculus.org>
parents: 6960
diff changeset
   880
adc80d085ddf Fix pulseaudio dynamic linking for Solaris builds.
Shawn Walker <eviltypeguy@icculus.org>
parents: 6960
diff changeset
   881
                case "$host" in
adc80d085ddf Fix pulseaudio dynamic linking for Solaris builds.
Shawn Walker <eviltypeguy@icculus.org>
parents: 6960
diff changeset
   882
                    # 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
   883
                    # to prevent undefined symbol failures.
adc80d085ddf Fix pulseaudio dynamic linking for Solaris builds.
Shawn Walker <eviltypeguy@icculus.org>
parents: 6960
diff changeset
   884
                    *-*-solaris*)
adc80d085ddf Fix pulseaudio dynamic linking for Solaris builds.
Shawn Walker <eviltypeguy@icculus.org>
parents: 6960
diff changeset
   885
                        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
   886
                        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
   887
                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
   888
            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
   889
                EXTRA_LDFLAGS="$EXTRA_LDFLAGS $PULSEAUDIO_LIBS"
8124
5226058345bf autoconf script tweaks
Edward Rudd <urkle@outoforder.cc>
parents: 8104
diff changeset
   890
                SUMMARY_audio="${SUMMARY_audio} pulse"
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
   891
            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
   892
            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
   893
        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
   894
    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
   895
}
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
   896
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   897
CheckARTSC()
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   898
{
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   899
    AC_ARG_ENABLE(arts,
1637
9ba366b919c7 Date: Fri, 31 Mar 2006 18:28:55 -0500
Sam Lantinga <slouken@libsdl.org>
parents: 1632
diff changeset
   900
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
   901
                  , enable_arts=yes)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   902
    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
   903
        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
   904
        if test x$ARTSCONFIG = x -o x$ARTSCONFIG = x'"$ARTSCONFIG"'; then
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   905
            : # arts isn't installed
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   906
        else
1361
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents: 1354
diff changeset
   907
            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
   908
            ARTS_LIBS=`$ARTSCONFIG --libs`
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   909
            AC_MSG_CHECKING(for aRts development environment)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   910
            audio_arts=no
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   911
            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
   912
            CFLAGS="$CFLAGS $ARTS_CFLAGS"
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   913
            AC_TRY_COMPILE([
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   914
             #include <artsc.h>
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   915
            ],[
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   916
             arts_stream_t stream;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   917
            ],[
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   918
            audio_arts=yes
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   919
            ])
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   920
            CFLAGS="$save_CFLAGS"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   921
            AC_MSG_RESULT($audio_arts)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   922
            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
   923
                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
   924
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
   925
                              , 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
   926
                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
   927
5548
8f0abb6ef37d Updated configure.in to be compatible with autoconf 2.67.
Ryan C. Gordon <icculus@icculus.org>
parents: 5512
diff changeset
   928
                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
   929
                SOURCES="$SOURCES $srcdir/src/audio/arts/*.c"
1521
9b9212e4810c CFLAGS are separate from EXTRA_CFLAGS
Sam Lantinga <slouken@libsdl.org>
parents: 1520
diff changeset
   930
                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
   931
                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
   932
                   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
   933
                    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
   934
                fi
1173
e9cf8c1b4590 Split up src/SDL_loadso.c into platform directories.
Ryan C. Gordon <icculus@icculus.org>
parents: 1170
diff changeset
   935
                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
   936
                   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
   937
                    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
   938
                    AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_ARTS_DYNAMIC, "$arts_lib", [ ])
8124
5226058345bf autoconf script tweaks
Edward Rudd <urkle@outoforder.cc>
parents: 8104
diff changeset
   939
                    SUMMARY_audio="${SUMMARY_audio} arts(dynamic)"
1467
b69f2b0309a0 Removed accidentally copied/pasted script for ALSA detection
Sam Lantinga <slouken@libsdl.org>
parents: 1459
diff changeset
   940
                else
1521
9b9212e4810c CFLAGS are separate from EXTRA_CFLAGS
Sam Lantinga <slouken@libsdl.org>
parents: 1520
diff changeset
   941
                    EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ARTS_LIBS"
8124
5226058345bf autoconf script tweaks
Edward Rudd <urkle@outoforder.cc>
parents: 8104
diff changeset
   942
                    SUMMARY_audio="${SUMMARY_audio} arts"
294
d2d48e10f370 Added a new header file: SDL_loadso.h
Sam Lantinga <slouken@libsdl.org>
parents: 292
diff changeset
   943
                fi
1361
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents: 1354
diff changeset
   944
                have_audio=yes
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   945
            fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   946
        fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   947
    fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   948
}
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   949
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   950
dnl See if the NAS audio interface is supported
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   951
CheckNAS()
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   952
{
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   953
    AC_ARG_ENABLE(nas,
1637
9ba366b919c7 Date: Fri, 31 Mar 2006 18:28:55 -0500
Sam Lantinga <slouken@libsdl.org>
parents: 1632
diff changeset
   954
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
   955
                  , enable_nas=yes)
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   956
    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
   957
        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
   958
        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
   959
41
8de9e8baaecc *** empty log message ***
Sam Lantinga <slouken@lokigames.com>
parents: 39
diff changeset
   960
        AC_MSG_CHECKING(for NAS audio support)
8de9e8baaecc *** empty log message ***
Sam Lantinga <slouken@lokigames.com>
parents: 39
diff changeset
   961
        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
   962
5f6550e5184f Merged SDL-ryan-multiple-audio-device branch r2803:2871 into the trunk.
Ryan C. Gordon <icculus@icculus.org>
parents: 2040
diff changeset
   963
        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
   964
            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
   965
            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
   966
5f6550e5184f Merged SDL-ryan-multiple-audio-device branch r2803:2871 into the trunk.
Ryan C. Gordon <icculus@icculus.org>
parents: 2040
diff changeset
   967
        elif test -r /usr/X11R6/include/audio/audiolib.h; then
41
8de9e8baaecc *** empty log message ***
Sam Lantinga <slouken@lokigames.com>
parents: 39
diff changeset
   968
            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
   969
            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
   970
            NAS_LIBS="-L/usr/X11R6/lib -laudio -lXt"
605
6399f4e90211 IRIX patches from Andrea Suatoni
Sam Lantinga <slouken@libsdl.org>
parents: 599
diff changeset
   971
41
8de9e8baaecc *** empty log message ***
Sam Lantinga <slouken@lokigames.com>
parents: 39
diff changeset
   972
        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
   973
605
6399f4e90211 IRIX patches from Andrea Suatoni
Sam Lantinga <slouken@libsdl.org>
parents: 599
diff changeset
   974
        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
   975
1361
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents: 1354
diff changeset
   976
        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
   977
            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
   978
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
   979
                          , 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
   980
            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
   981
5f6550e5184f Merged SDL-ryan-multiple-audio-device branch r2803:2871 into the trunk.
Ryan C. Gordon <icculus@icculus.org>
parents: 2040
diff changeset
   982
            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
   983
               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
   984
                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
   985
            fi
5f6550e5184f Merged SDL-ryan-multiple-audio-device branch r2803:2871 into the trunk.
Ryan C. Gordon <icculus@icculus.org>
parents: 2040
diff changeset
   986
            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
   987
               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
   988
                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
   989
                AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_NAS_DYNAMIC, "$nas_lib", [ ])
8124
5226058345bf autoconf script tweaks
Edward Rudd <urkle@outoforder.cc>
parents: 8104
diff changeset
   990
                SUMMARY_audio="${SUMMARY_audio} nas(dynamic)"
2049
5f6550e5184f Merged SDL-ryan-multiple-audio-device branch r2803:2871 into the trunk.
Ryan C. Gordon <icculus@icculus.org>
parents: 2040
diff changeset
   991
            else
5f6550e5184f Merged SDL-ryan-multiple-audio-device branch r2803:2871 into the trunk.
Ryan C. Gordon <icculus@icculus.org>
parents: 2040
diff changeset
   992
                EXTRA_LDFLAGS="$EXTRA_LDFLAGS $NAS_LIBS"
8124
5226058345bf autoconf script tweaks
Edward Rudd <urkle@outoforder.cc>
parents: 8104
diff changeset
   993
                SUMMARY_audio="${SUMMARY_audio} 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
   994
            fi
5f6550e5184f Merged SDL-ryan-multiple-audio-device branch r2803:2871 into the trunk.
Ryan C. Gordon <icculus@icculus.org>
parents: 2040
diff changeset
   995
5548
8f0abb6ef37d Updated configure.in to be compatible with autoconf 2.67.
Ryan C. Gordon <icculus@icculus.org>
parents: 5512
diff changeset
   996
            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
   997
            SOURCES="$SOURCES $srcdir/src/audio/nas/*.c"
1521
9b9212e4810c CFLAGS are separate from EXTRA_CFLAGS
Sam Lantinga <slouken@libsdl.org>
parents: 1520
diff changeset
   998
            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
   999
            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
  1000
        fi
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
  1001
    fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
  1002
}
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
  1003
7367
d6eabafa8776 Added an SDL2 OpenBSD sndio(7) audio target.
Ryan C. Gordon <icculus@icculus.org>
parents: 7307
diff changeset
  1004
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
  1005
CheckSNDIO()
d6eabafa8776 Added an SDL2 OpenBSD sndio(7) audio target.
Ryan C. Gordon <icculus@icculus.org>
parents: 7307
diff changeset
  1006
{
d6eabafa8776 Added an SDL2 OpenBSD sndio(7) audio target.
Ryan C. Gordon <icculus@icculus.org>
parents: 7307
diff changeset
  1007
    AC_ARG_ENABLE(sndio,
d6eabafa8776 Added an SDL2 OpenBSD sndio(7) audio target.
Ryan C. Gordon <icculus@icculus.org>
parents: 7307
diff changeset
  1008
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
  1009
                  , enable_sndio=yes)
d6eabafa8776 Added an SDL2 OpenBSD sndio(7) audio target.
Ryan C. Gordon <icculus@icculus.org>
parents: 7307
diff changeset
  1010
    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
  1011
        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
  1012
        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
  1013
d6eabafa8776 Added an SDL2 OpenBSD sndio(7) audio target.
Ryan C. Gordon <icculus@icculus.org>
parents: 7307
diff changeset
  1014
        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
  1015
        have_sndio=no
d6eabafa8776 Added an SDL2 OpenBSD sndio(7) audio target.
Ryan C. Gordon <icculus@icculus.org>
parents: 7307
diff changeset
  1016
d6eabafa8776 Added an SDL2 OpenBSD sndio(7) audio target.
Ryan C. Gordon <icculus@icculus.org>
parents: 7307
diff changeset
  1017
        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
  1018
            have_sndio=yes
d6eabafa8776 Added an SDL2 OpenBSD sndio(7) audio target.
Ryan C. Gordon <icculus@icculus.org>
parents: 7307
diff changeset
  1019
            SNDIO_LIBS="-lsndio"
d6eabafa8776 Added an SDL2 OpenBSD sndio(7) audio target.
Ryan C. Gordon <icculus@icculus.org>
parents: 7307
diff changeset
  1020
        fi
d6eabafa8776 Added an SDL2 OpenBSD sndio(7) audio target.
Ryan C. Gordon <icculus@icculus.org>
parents: 7307
diff changeset
  1021
d6eabafa8776 Added an SDL2 OpenBSD sndio(7) audio target.
Ryan C. Gordon <icculus@icculus.org>
parents: 7307
diff changeset
  1022
        AC_MSG_RESULT($have_sndio)
d6eabafa8776 Added an SDL2 OpenBSD sndio(7) audio target.
Ryan C. Gordon <icculus@icculus.org>
parents: 7307
diff changeset
  1023
d6eabafa8776 Added an SDL2 OpenBSD sndio(7) audio target.
Ryan C. Gordon <icculus@icculus.org>
parents: 7307
diff changeset
  1024
        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
  1025
            AC_ARG_ENABLE(sndio-shared,
d6eabafa8776 Added an SDL2 OpenBSD sndio(7) audio target.
Ryan C. Gordon <icculus@icculus.org>
parents: 7307
diff changeset
  1026
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
  1027
                          , enable_sndio_shared=yes)
d6eabafa8776 Added an SDL2 OpenBSD sndio(7) audio target.
Ryan C. Gordon <icculus@icculus.org>
parents: 7307
diff changeset
  1028
            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
  1029
d6eabafa8776 Added an SDL2 OpenBSD sndio(7) audio target.
Ryan C. Gordon <icculus@icculus.org>
parents: 7307
diff changeset
  1030
            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
  1031
               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
  1032
                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
  1033
            fi
d6eabafa8776 Added an SDL2 OpenBSD sndio(7) audio target.
Ryan C. Gordon <icculus@icculus.org>
parents: 7307
diff changeset
  1034
            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
  1035
               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
  1036
                echo "-- dynamic libsndio -> $sndio_lib"
d6eabafa8776 Added an SDL2 OpenBSD sndio(7) audio target.
Ryan C. Gordon <icculus@icculus.org>
parents: 7307
diff changeset
  1037
                AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_SNDIO_DYNAMIC, "$sndio_lib", [ ])
8124
5226058345bf autoconf script tweaks
Edward Rudd <urkle@outoforder.cc>
parents: 8104
diff changeset
  1038
                SUMMARY_audio="${SUMMARY_audio} sndio(dynamic)"
7367
d6eabafa8776 Added an SDL2 OpenBSD sndio(7) audio target.
Ryan C. Gordon <icculus@icculus.org>
parents: 7307
diff changeset
  1039
            else
d6eabafa8776 Added an SDL2 OpenBSD sndio(7) audio target.
Ryan C. Gordon <icculus@icculus.org>
parents: 7307
diff changeset
  1040
                EXTRA_LDFLAGS="$EXTRA_LDFLAGS $SNDIO_LIBS"
8124
5226058345bf autoconf script tweaks
Edward Rudd <urkle@outoforder.cc>
parents: 8104
diff changeset
  1041
                SUMMARY_audio="${SUMMARY_audio} sndio"
7367
d6eabafa8776 Added an SDL2 OpenBSD sndio(7) audio target.
Ryan C. Gordon <icculus@icculus.org>
parents: 7307
diff changeset
  1042
            fi
d6eabafa8776 Added an SDL2 OpenBSD sndio(7) audio target.
Ryan C. Gordon <icculus@icculus.org>
parents: 7307
diff changeset
  1043
d6eabafa8776 Added an SDL2 OpenBSD sndio(7) audio target.
Ryan C. Gordon <icculus@icculus.org>
parents: 7307
diff changeset
  1044
            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
  1045
            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
  1046
            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
  1047
            have_audio=yes
d6eabafa8776 Added an SDL2 OpenBSD sndio(7) audio target.
Ryan C. Gordon <icculus@icculus.org>
parents: 7307
diff changeset
  1048
        fi
d6eabafa8776 Added an SDL2 OpenBSD sndio(7) audio target.
Ryan C. Gordon <icculus@icculus.org>
parents: 7307
diff changeset
  1049
    fi
d6eabafa8776 Added an SDL2 OpenBSD sndio(7) audio target.
Ryan C. Gordon <icculus@icculus.org>
parents: 7307
diff changeset
  1050
}
d6eabafa8776 Added an SDL2 OpenBSD sndio(7) audio target.
Ryan C. Gordon <icculus@icculus.org>
parents: 7307
diff changeset
  1051
68
ac6645260d31 Added an audio driver that writes to disk (thanks Ryan!)
Sam Lantinga <slouken@lokigames.com>
parents: 53
diff changeset
  1052
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
  1053
CheckDiskAudio()
ac6645260d31 Added an audio driver that writes to disk (thanks Ryan!)
Sam Lantinga <slouken@lokigames.com>
parents: 53
diff changeset
  1054
{
ac6645260d31 Added an audio driver that writes to disk (thanks Ryan!)
Sam Lantinga <slouken@lokigames.com>
parents: 53
diff changeset
  1055
    AC_ARG_ENABLE(diskaudio,
1637
9ba366b919c7 Date: Fri, 31 Mar 2006 18:28:55 -0500
Sam Lantinga <slouken@libsdl.org>
parents: 1632
diff changeset
  1056
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
  1057
                  , enable_diskaudio=yes)
68
ac6645260d31 Added an audio driver that writes to disk (thanks Ryan!)
Sam Lantinga <slouken@lokigames.com>
parents: 53
diff changeset
  1058
    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
  1059
        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
  1060
        SOURCES="$SOURCES $srcdir/src/audio/disk/*.c"
8124
5226058345bf autoconf script tweaks
Edward Rudd <urkle@outoforder.cc>
parents: 8104
diff changeset
  1061
        SUMMARY_audio="${SUMMARY_audio} disk"
68
ac6645260d31 Added an audio driver that writes to disk (thanks Ryan!)
Sam Lantinga <slouken@lokigames.com>
parents: 53
diff changeset
  1062
    fi
ac6645260d31 Added an audio driver that writes to disk (thanks Ryan!)
Sam Lantinga <slouken@lokigames.com>
parents: 53
diff changeset
  1063
}
ac6645260d31 Added an audio driver that writes to disk (thanks Ryan!)
Sam Lantinga <slouken@lokigames.com>
parents: 53
diff changeset
  1064
1532
30f189cdd82b Implemented dummy audio driver.
Ryan C. Gordon <icculus@icculus.org>
parents: 1521
diff changeset
  1065
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
  1066
CheckDummyAudio()
30f189cdd82b Implemented dummy audio driver.
Ryan C. Gordon <icculus@icculus.org>
parents: 1521
diff changeset
  1067
{
30f189cdd82b Implemented dummy audio driver.
Ryan C. Gordon <icculus@icculus.org>
parents: 1521
diff changeset
  1068
    AC_ARG_ENABLE(dummyaudio,
1637
9ba366b919c7 Date: Fri, 31 Mar 2006 18:28:55 -0500
Sam Lantinga <slouken@libsdl.org>
parents: 1632
diff changeset
  1069
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
  1070
                  , enable_dummyaudio=yes)
30f189cdd82b Implemented dummy audio driver.
Ryan C. Gordon <icculus@icculus.org>
parents: 1521
diff changeset
  1071
    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
  1072
        AC_DEFINE(SDL_AUDIO_DRIVER_DUMMY, 1, [ ])
1532
30f189cdd82b Implemented dummy audio driver.
Ryan C. Gordon <icculus@icculus.org>
parents: 1521
diff changeset
  1073
        SOURCES="$SOURCES $srcdir/src/audio/dummy/*.c"
8124
5226058345bf autoconf script tweaks
Edward Rudd <urkle@outoforder.cc>
parents: 8104
diff changeset
  1074
        SUMMARY_audio="${SUMMARY_audio} dummy"
1532
30f189cdd82b Implemented dummy audio driver.
Ryan C. Gordon <icculus@icculus.org>
parents: 1521
diff changeset
  1075
    fi
30f189cdd82b Implemented dummy audio driver.
Ryan C. Gordon <icculus@icculus.org>
parents: 1521
diff changeset
  1076
}
30f189cdd82b Implemented dummy audio driver.
Ryan C. Gordon <icculus@icculus.org>
parents: 1521
diff changeset
  1077
1573
2422ca15ba42 Added support for gcc4's -fvisibility=hidden option.
Ryan C. Gordon <icculus@icculus.org>
parents: 1571
diff changeset
  1078
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
  1079
dnl  Details of this flag are here: http://gcc.gnu.org/wiki/Visibility
2422ca15ba42 Added support for gcc4's -fvisibility=hidden option.
Ryan