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