configure.in
author Ryan C. Gordon <icculus@icculus.org>
Sun, 24 Jul 2011 03:37:13 -0700
changeset 5586 7fe92c1dc1d9
parent 5577 ced8a6788629
child 5587 9c554d44ea66
permissions -rw-r--r--
Removed /dev/dsp DMA audio target.
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.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
     2
AC_INIT(README)
1341
d02b552e5304 Configure dynamically generates SDL_config.h
Sam Lantinga <slouken@libsdl.org>
parents: 1330
diff changeset
     3
AC_CONFIG_HEADER(include/SDL_config.h)
1353
7ba544e2888d Started the process of improving configure support, and merging C types
Sam Lantinga <slouken@libsdl.org>
parents: 1352
diff changeset
     4
AC_GNU_SOURCE
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
     5
AC_CONFIG_AUX_DIRS($srcdir/build-scripts)
5548
8f0abb6ef37d Updated configure.in to be compatible with autoconf 2.67.
Ryan C. Gordon <icculus@icculus.org>
parents: 5512
diff changeset
     6
AC_CONFIG_MACRO_DIR([acinclude])
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
     7
3382
294fb5e6f301 A better solution to making the default build optimization -O3
Sam Lantinga <slouken@libsdl.org>
parents: 3372
diff changeset
     8
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
     9
orig_CFLAGS="$CFLAGS"
294fb5e6f301 A better solution to making the default build optimization -O3
Sam Lantinga <slouken@libsdl.org>
parents: 3372
diff changeset
    10
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    11
dnl Set various version strings - taken gratefully from the GTk sources
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    12
#
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    13
# Making releases:
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    14
# Edit include/SDL/SDL_version.h and change the version, then:
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    15
#   SDL_MICRO_VERSION += 1;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    16
#   SDL_INTERFACE_AGE += 1;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    17
#   SDL_BINARY_AGE += 1;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    18
# if any functions have been added, set SDL_INTERFACE_AGE to 0.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    19
# if backwards compatibility has been broken,
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    20
# set SDL_BINARY_AGE and SDL_INTERFACE_AGE to 0.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    21
#
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    22
SDL_MAJOR_VERSION=1
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_MINOR_VERSION=3
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
    24
SDL_MICRO_VERSION=0
1886
44635227a939 Updated the version to 1.2.11
Sam Lantinga <slouken@libsdl.org>
parents: 1879
diff changeset
    25
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
    26
SDL_BINARY_AGE=0
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    27
SDL_VERSION=$SDL_MAJOR_VERSION.$SDL_MINOR_VERSION.$SDL_MICRO_VERSION
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    28
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    29
AC_SUBST(SDL_MAJOR_VERSION)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    30
AC_SUBST(SDL_MINOR_VERSION)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    31
AC_SUBST(SDL_MICRO_VERSION)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    32
AC_SUBST(SDL_INTERFACE_AGE)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    33
AC_SUBST(SDL_BINARY_AGE)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    34
AC_SUBST(SDL_VERSION)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    35
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    36
# 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
    37
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
    38
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    39
LT_RELEASE=$SDL_MAJOR_VERSION.$SDL_MINOR_VERSION
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    40
LT_CURRENT=`expr $SDL_MICRO_VERSION - $SDL_INTERFACE_AGE`
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    41
LT_REVISION=$SDL_INTERFACE_AGE
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    42
LT_AGE=`expr $SDL_BINARY_AGE - $SDL_INTERFACE_AGE`
3368
ca6f355e44b2 Fixed bug #833
Sam Lantinga <slouken@libsdl.org>
parents: 3358
diff changeset
    43
m4_pattern_allow([^LT_])
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    44
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    45
AC_SUBST(LT_RELEASE)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    46
AC_SUBST(LT_CURRENT)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    47
AC_SUBST(LT_REVISION)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    48
AC_SUBST(LT_AGE)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    49
1550
31c2b8e4885e Fixed bug #166
Sam Lantinga <slouken@libsdl.org>
parents: 1548
diff changeset
    50
dnl Detect the canonical build and host environments
3368
ca6f355e44b2 Fixed bug #833
Sam Lantinga <slouken@libsdl.org>
parents: 3358
diff changeset
    51
dnl AC_CANONICAL_HOST
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    52
3332
da1cb54d74ef You should check for the C compiler before you set CFLAGS. :)
Sam Lantinga <slouken@libsdl.org>
parents: 3307
diff changeset
    53
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
    54
AC_PROG_LIBTOOL
da1cb54d74ef You should check for the C compiler before you set CFLAGS. :)
Sam Lantinga <slouken@libsdl.org>
parents: 3307
diff changeset
    55
AC_PROG_CC
da1cb54d74ef You should check for the C compiler before you set CFLAGS. :)
Sam Lantinga <slouken@libsdl.org>
parents: 3307
diff changeset
    56
AC_PROG_CXX
da1cb54d74ef You should check for the C compiler before you set CFLAGS. :)
Sam Lantinga <slouken@libsdl.org>
parents: 3307
diff changeset
    57
AC_PROG_INSTALL
da1cb54d74ef You should check for the C compiler before you set CFLAGS. :)
Sam Lantinga <slouken@libsdl.org>
parents: 3307
diff changeset
    58
AC_PROG_MAKE_SET
da1cb54d74ef You should check for the C compiler before you set CFLAGS. :)
Sam Lantinga <slouken@libsdl.org>
parents: 3307
diff changeset
    59
if test -z "$host_alias"; then
da1cb54d74ef You should check for the C compiler before you set CFLAGS. :)
Sam Lantinga <slouken@libsdl.org>
parents: 3307
diff changeset
    60
    hostaliaswindres=
da1cb54d74ef You should check for the C compiler before you set CFLAGS. :)
Sam Lantinga <slouken@libsdl.org>
parents: 3307
diff changeset
    61
else
da1cb54d74ef You should check for the C compiler before you set CFLAGS. :)
Sam Lantinga <slouken@libsdl.org>
parents: 3307
diff changeset
    62
    hostaliaswindres="$host_alias-windres"
da1cb54d74ef You should check for the C compiler before you set CFLAGS. :)
Sam Lantinga <slouken@libsdl.org>
parents: 3307
diff changeset
    63
fi
da1cb54d74ef You should check for the C compiler before you set CFLAGS. :)
Sam Lantinga <slouken@libsdl.org>
parents: 3307
diff changeset
    64
AC_CHECK_PROGS(WINDRES, [windres $hostaliaswindres $host_os-windres])
da1cb54d74ef You should check for the C compiler before you set CFLAGS. :)
Sam Lantinga <slouken@libsdl.org>
parents: 3307
diff changeset
    65
1389
ce65f014190a Fixed X11 library detection
Sam Lantinga <slouken@libsdl.org>
parents: 1384
diff changeset
    66
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
    67
INCLUDE="-I$srcdir/include"
1373
04499d3e1b6b *** empty log message ***
Sam Lantinga <slouken@libsdl.org>
parents: 1370
diff changeset
    68
if test x$srcdir != x.; then
5482
2c0477323626 If we leave the default SDL_config.h in place, it'll override the one generated by configure when building from a different directory. Argh...
Sam Lantinga <slouken@libsdl.org>
parents: 5475
diff changeset
    69
    # Remove SDL_config.h from the source directory, since it's the
2c0477323626 If we leave the default SDL_config.h in place, it'll override the one generated by configure when building from a different directory. Argh...
Sam Lantinga <slouken@libsdl.org>
parents: 5475
diff changeset
    70
    # default one, and we want to include the one that we generate.
2c0477323626 If we leave the default SDL_config.h in place, it'll override the one generated by configure when building from a different directory. Argh...
Sam Lantinga <slouken@libsdl.org>
parents: 5475
diff changeset
    71
    if test -f $srcdir/include/SDL_config.h; then
2c0477323626 If we leave the default SDL_config.h in place, it'll override the one generated by configure when building from a different directory. Argh...
Sam Lantinga <slouken@libsdl.org>
parents: 5475
diff changeset
    72
        rm $srcdir/include/SDL_config.h
2c0477323626 If we leave the default SDL_config.h in place, it'll override the one generated by configure when building from a different directory. Argh...
Sam Lantinga <slouken@libsdl.org>
parents: 5475
diff changeset
    73
    fi
1571
0160eb7cccee Add /usr/local to the build paths by default
Sam Lantinga <slouken@libsdl.org>
parents: 1569
diff changeset
    74
    INCLUDE="-Iinclude $INCLUDE"
1373
04499d3e1b6b *** empty log message ***
Sam Lantinga <slouken@libsdl.org>
parents: 1370
diff changeset
    75
fi
1550
31c2b8e4885e Fixed bug #166
Sam Lantinga <slouken@libsdl.org>
parents: 1548
diff changeset
    76
case "$host" in
1389
ce65f014190a Fixed X11 library detection
Sam Lantinga <slouken@libsdl.org>
parents: 1384
diff changeset
    77
    *-*-cygwin*)
ce65f014190a Fixed X11 library detection
Sam Lantinga <slouken@libsdl.org>
parents: 1384
diff changeset
    78
        # We build SDL on cygwin without the UNIX emulation layer
1521
9b9212e4810c CFLAGS are separate from EXTRA_CFLAGS
Sam Lantinga <slouken@libsdl.org>
parents: 1520
diff changeset
    79
        BASE_CFLAGS="-I/usr/include/mingw -mno-cygwin"
9b9212e4810c CFLAGS are separate from EXTRA_CFLAGS
Sam Lantinga <slouken@libsdl.org>
parents: 1520
diff changeset
    80
        BASE_LDFLAGS="-mno-cygwin"
1389
ce65f014190a Fixed X11 library detection
Sam Lantinga <slouken@libsdl.org>
parents: 1384
diff changeset
    81
        ;;
ce65f014190a Fixed X11 library detection
Sam Lantinga <slouken@libsdl.org>
parents: 1384
diff changeset
    82
    *)
3604
e569bbb266eb Fixed bug #915
Sam Lantinga <slouken@libsdl.org>
parents: 3586
diff changeset
    83
        BASE_CFLAGS=""
1521
9b9212e4810c CFLAGS are separate from EXTRA_CFLAGS
Sam Lantinga <slouken@libsdl.org>
parents: 1520
diff changeset
    84
        BASE_LDFLAGS=""
1389
ce65f014190a Fixed X11 library detection
Sam Lantinga <slouken@libsdl.org>
parents: 1384
diff changeset
    85
        ;;
ce65f014190a Fixed X11 library detection
Sam Lantinga <slouken@libsdl.org>
parents: 1384
diff changeset
    86
esac
5030
6a0803e47c7b Greg Jandl to SDL
Sam Lantinga <slouken@libsdl.org>
parents: 5029
diff changeset
    87
# 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
    88
# built with it to be compiled for a particular architecture.
6a0803e47c7b Greg Jandl to SDL
Sam Lantinga <slouken@libsdl.org>
parents: 5029
diff changeset
    89
#AX_GCC_ARCHFLAG([no], [BASE_CFLAGS="$BASE_CFLAGS $ax_cv_gcc_archflag]")
1648
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1640
diff changeset
    90
BUILD_CFLAGS="$CFLAGS $CPPFLAGS"
3382
294fb5e6f301 A better solution to making the default build optimization -O3
Sam Lantinga <slouken@libsdl.org>
parents: 3372
diff changeset
    91
# The default optimization for SDL 1.3 is -O3 (Bug #31)
294fb5e6f301 A better solution to making the default build optimization -O3
Sam Lantinga <slouken@libsdl.org>
parents: 3372
diff changeset
    92
if test x$orig_CFLAGS = x; then
294fb5e6f301 A better solution to making the default build optimization -O3
Sam Lantinga <slouken@libsdl.org>
parents: 3372
diff changeset
    93
    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
    94
fi
1521
9b9212e4810c CFLAGS are separate from EXTRA_CFLAGS
Sam Lantinga <slouken@libsdl.org>
parents: 1520
diff changeset
    95
EXTRA_CFLAGS="$INCLUDE $BASE_CFLAGS"
9b9212e4810c CFLAGS are separate from EXTRA_CFLAGS
Sam Lantinga <slouken@libsdl.org>
parents: 1520
diff changeset
    96
BUILD_LDFLAGS="$LDFLAGS"
9b9212e4810c CFLAGS are separate from EXTRA_CFLAGS
Sam Lantinga <slouken@libsdl.org>
parents: 1520
diff changeset
    97
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
    98
## 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
    99
#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
   100
#    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
   101
#        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
   102
#    fi
d2b0f8b18ab8 Whoops, need a space after dnl to make it meaningful. :)
Sam Lantinga <slouken@libsdl.org>
parents: 1822
diff changeset
   103
#    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
   104
#        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
   105
#    fi
d2b0f8b18ab8 Whoops, need a space after dnl to make it meaningful. :)
Sam Lantinga <slouken@libsdl.org>
parents: 1822
diff changeset
   106
#done
1521
9b9212e4810c CFLAGS are separate from EXTRA_CFLAGS
Sam Lantinga <slouken@libsdl.org>
parents: 1520
diff changeset
   107
SDL_CFLAGS="$BASE_CFLAGS"
9b9212e4810c CFLAGS are separate from EXTRA_CFLAGS
Sam Lantinga <slouken@libsdl.org>
parents: 1520
diff changeset
   108
SDL_LIBS="-lSDL $BASE_LDFLAGS"
9b9212e4810c CFLAGS are separate from EXTRA_CFLAGS
Sam Lantinga <slouken@libsdl.org>
parents: 1520
diff changeset
   109
CPPFLAGS="$CPPFLAGS $EXTRA_CFLAGS"
9b9212e4810c CFLAGS are separate from EXTRA_CFLAGS
Sam Lantinga <slouken@libsdl.org>
parents: 1520
diff changeset
   110
CFLAGS="$CFLAGS $EXTRA_CFLAGS"
9b9212e4810c CFLAGS are separate from EXTRA_CFLAGS
Sam Lantinga <slouken@libsdl.org>
parents: 1520
diff changeset
   111
LDFLAGS="$LDFLAGS $EXTRA_LDFLAGS"
1373
04499d3e1b6b *** empty log message ***
Sam Lantinga <slouken@libsdl.org>
parents: 1370
diff changeset
   112
3391
188fc5ecc58c Simplify and improve dynamic library detection, taken from SDL_image
Sam Lantinga <slouken@libsdl.org>
parents: 3390
diff changeset
   113
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
   114
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
   115
188fc5ecc58c Simplify and improve dynamic library detection, taken from SDL_image
Sam Lantinga <slouken@libsdl.org>
parents: 3390
diff changeset
   116
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
   117
find_lib()
188fc5ecc58c Simplify and improve dynamic library detection, taken from SDL_image
Sam Lantinga <slouken@libsdl.org>
parents: 3390
diff changeset
   118
{
188fc5ecc58c Simplify and improve dynamic library detection, taken from SDL_image
Sam Lantinga <slouken@libsdl.org>
parents: 3390
diff changeset
   119
    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
   120
    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
   121
    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
   122
    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
   123
        host_lib_path=""
188fc5ecc58c Simplify and improve dynamic library detection, taken from SDL_image
Sam Lantinga <slouken@libsdl.org>
parents: 3390
diff changeset
   124
    else
188fc5ecc58c Simplify and improve dynamic library detection, taken from SDL_image
Sam Lantinga <slouken@libsdl.org>
parents: 3390
diff changeset
   125
        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
   126
    fi
188fc5ecc58c Simplify and improve dynamic library detection, taken from SDL_image
Sam Lantinga <slouken@libsdl.org>
parents: 3390
diff changeset
   127
    for path in $gcc_bin_path $gcc_lib_path $env_lib_path $host_lib_path; do
188fc5ecc58c Simplify and improve dynamic library detection, taken from SDL_image
Sam Lantinga <slouken@libsdl.org>
parents: 3390
diff changeset
   128
        lib=[`ls -- $path/$1 2>/dev/null | sort | sed 's/.*\/\(.*\)/\1/; q'`]
188fc5ecc58c Simplify and improve dynamic library detection, taken from SDL_image
Sam Lantinga <slouken@libsdl.org>
parents: 3390
diff changeset
   129
        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
   130
            echo $lib
188fc5ecc58c Simplify and improve dynamic library detection, taken from SDL_image
Sam Lantinga <slouken@libsdl.org>
parents: 3390
diff changeset
   131
            return
188fc5ecc58c Simplify and improve dynamic library detection, taken from SDL_image
Sam Lantinga <slouken@libsdl.org>
parents: 3390
diff changeset
   132
        fi
188fc5ecc58c Simplify and improve dynamic library detection, taken from SDL_image
Sam Lantinga <slouken@libsdl.org>
parents: 3390
diff changeset
   133
    done
188fc5ecc58c Simplify and improve dynamic library detection, taken from SDL_image
Sam Lantinga <slouken@libsdl.org>
parents: 3390
diff changeset
   134
}
188fc5ecc58c Simplify and improve dynamic library detection, taken from SDL_image
Sam Lantinga <slouken@libsdl.org>
parents: 3390
diff changeset
   135
1353
7ba544e2888d Started the process of improving configure support, and merging C types
Sam Lantinga <slouken@libsdl.org>
parents: 1352
diff changeset
   136
dnl Check for compiler characteristics
1341
d02b552e5304 Configure dynamically generates SDL_config.h
Sam Lantinga <slouken@libsdl.org>
parents: 1330
diff changeset
   137
AC_C_CONST
d02b552e5304 Configure dynamically generates SDL_config.h
Sam Lantinga <slouken@libsdl.org>
parents: 1330
diff changeset
   138
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
   139
AC_C_VOLATILE
7ba544e2888d Started the process of improving configure support, and merging C types
Sam Lantinga <slouken@libsdl.org>
parents: 1352
diff changeset
   140
3647
c5925cd41955 First pass at Ryan's assertion code, minor tweaks to come.
Sam Lantinga <slouken@libsdl.org>
parents: 3639
diff changeset
   141
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
   142
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
   143
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
   144
               [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
   145
              , 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
   146
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
   147
    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
   148
        ;;
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
   149
    disabled)
5548
8f0abb6ef37d Updated configure.in to be compatible with autoconf 2.67.
Ryan C. Gordon <icculus@icculus.org>
parents: 5512
diff changeset
   150
        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
   151
        ;;
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
   152
    release)
5548
8f0abb6ef37d Updated configure.in to be compatible with autoconf 2.67.
Ryan C. Gordon <icculus@icculus.org>
parents: 5512
diff changeset
   153
        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
   154
        ;;
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
    enabled)
5548
8f0abb6ef37d Updated configure.in to be compatible with autoconf 2.67.
Ryan C. Gordon <icculus@icculus.org>
parents: 5512
diff changeset
   156
        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
   157
        ;;
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
    paranoid)
5548
8f0abb6ef37d Updated configure.in to be compatible with autoconf 2.67.
Ryan C. Gordon <icculus@icculus.org>
parents: 5512
diff changeset
   159
        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
   160
        ;;
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
   161
    *)
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
        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
   163
        ;;
336f3df1578d Allow configure to override assertion settings, but by default this comes from the build optimization level.
Sam Lantinga <slouken@libsdl.org>
parents: 3649
diff changeset
   164
esac
3647
c5925cd41955 First pass at Ryan's assertion code, minor tweaks to come.
Sam Lantinga <slouken@libsdl.org>
parents: 3639
diff changeset
   165
3354
98c5b421426e Fixed bug #828
Sam Lantinga <slouken@libsdl.org>
parents: 3351
diff changeset
   166
dnl See whether we can use gcc style dependency tracking
98c5b421426e Fixed bug #828
Sam Lantinga <slouken@libsdl.org>
parents: 3351
diff changeset
   167
AC_ARG_ENABLE(dependency-tracking,
98c5b421426e Fixed bug #828
Sam Lantinga <slouken@libsdl.org>
parents: 3351
diff changeset
   168
AC_HELP_STRING([--enable-dependency-tracking],
98c5b421426e Fixed bug #828
Sam Lantinga <slouken@libsdl.org>
parents: 3351
diff changeset
   169
               [Use gcc -MMD -MT dependency tracking [[default=yes]]]),
98c5b421426e Fixed bug #828
Sam Lantinga <slouken@libsdl.org>
parents: 3351
diff changeset
   170
              , enable_dependency_tracking=yes)
98c5b421426e Fixed bug #828
Sam Lantinga <slouken@libsdl.org>
parents: 3351
diff changeset
   171
if test x$enable_dependency_tracking = xyes; then
98c5b421426e Fixed bug #828
Sam Lantinga <slouken@libsdl.org>
parents: 3351
diff changeset
   172
    have_gcc_mmd_mt=no
98c5b421426e Fixed bug #828
Sam Lantinga <slouken@libsdl.org>
parents: 3351
diff changeset
   173
    AC_MSG_CHECKING(for GCC -MMD -MT option)
98c5b421426e Fixed bug #828
Sam Lantinga <slouken@libsdl.org>
parents: 3351
diff changeset
   174
    AC_TRY_COMPILE([
98c5b421426e Fixed bug #828
Sam Lantinga <slouken@libsdl.org>
parents: 3351
diff changeset
   175
    #if !defined(__GNUC__) || __GNUC__ < 3
98c5b421426e Fixed bug #828
Sam Lantinga <slouken@libsdl.org>
parents: 3351
diff changeset
   176
    #error Dependency tracking requires GCC 3.0 or newer
98c5b421426e Fixed bug #828
Sam Lantinga <slouken@libsdl.org>
parents: 3351
diff changeset
   177
    #endif
98c5b421426e Fixed bug #828
Sam Lantinga <slouken@libsdl.org>
parents: 3351
diff changeset
   178
    ],[
98c5b421426e Fixed bug #828
Sam Lantinga <slouken@libsdl.org>
parents: 3351
diff changeset
   179
    ],[
98c5b421426e Fixed bug #828
Sam Lantinga <slouken@libsdl.org>
parents: 3351
diff changeset
   180
    have_gcc_mmd_mt=yes
98c5b421426e Fixed bug #828
Sam Lantinga <slouken@libsdl.org>
parents: 3351
diff changeset
   181
    ])
98c5b421426e Fixed bug #828
Sam Lantinga <slouken@libsdl.org>
parents: 3351
diff changeset
   182
    AC_MSG_RESULT($have_gcc_mmd_mt)
98c5b421426e Fixed bug #828
Sam Lantinga <slouken@libsdl.org>
parents: 3351
diff changeset
   183
98c5b421426e Fixed bug #828
Sam Lantinga <slouken@libsdl.org>
parents: 3351
diff changeset
   184
    if test x$have_gcc_mmd_mt = xyes; then
98c5b421426e Fixed bug #828
Sam Lantinga <slouken@libsdl.org>
parents: 3351
diff changeset
   185
        DEPENDENCY_TRACKING_OPTIONS="-MMD -MT \$@"
98c5b421426e Fixed bug #828
Sam Lantinga <slouken@libsdl.org>
parents: 3351
diff changeset
   186
    fi
98c5b421426e Fixed bug #828
Sam Lantinga <slouken@libsdl.org>
parents: 3351
diff changeset
   187
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
   188
1361
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents: 1354
diff changeset
   189
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
   190
AC_ARG_ENABLE(libc,
1637
9ba366b919c7 Date: Fri, 31 Mar 2006 18:28:55 -0500
Sam Lantinga <slouken@libsdl.org>
parents: 1632
diff changeset
   191
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
   192
              , 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
   193
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
   194
    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
   195
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents: 1354
diff changeset
   196
    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
   197
    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
   198
    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
   199
1361
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents: 1354
diff changeset
   200
    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
   201
    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
   202
3012
7e30c2dc7783 Fixed Visual C++ release build for Visual C++ 2005
Sam Lantinga <slouken@libsdl.org>
parents: 3007
diff changeset
   203
    dnl Check for defines
7e30c2dc7783 Fixed Visual C++ release build for Visual C++ 2005
Sam Lantinga <slouken@libsdl.org>
parents: 3007
diff changeset
   204
    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
   205
1361
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents: 1354
diff changeset
   206
    dnl Checks for library functions.
2079
1ed2155b7ee4 From: Torsten Giebl
Ryan C. Gordon <icculus@icculus.org>
parents: 2070
diff changeset
   207
    case "$host" in
1ed2155b7ee4 From: Torsten Giebl
Ryan C. Gordon <icculus@icculus.org>
parents: 2070
diff changeset
   208
    *-*-cygwin* | *-*-mingw32*)
1ed2155b7ee4 From: Torsten Giebl
Ryan C. Gordon <icculus@icculus.org>
parents: 2070
diff changeset
   209
        ;;
1ed2155b7ee4 From: Torsten Giebl
Ryan C. Gordon <icculus@icculus.org>
parents: 2070
diff changeset
   210
    *)
1ed2155b7ee4 From: Torsten Giebl
Ryan C. Gordon <icculus@icculus.org>
parents: 2070
diff changeset
   211
        AC_FUNC_ALLOCA
1ed2155b7ee4 From: Torsten Giebl
Ryan C. Gordon <icculus@icculus.org>
parents: 2070
diff changeset
   212
        ;;
1ed2155b7ee4 From: Torsten Giebl
Ryan C. Gordon <icculus@icculus.org>
parents: 2070
diff changeset
   213
    esac
1ed2155b7ee4 From: Torsten Giebl
Ryan C. Gordon <icculus@icculus.org>
parents: 2070
diff changeset
   214
1361
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents: 1354
diff changeset
   215
    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
   216
    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
   217
        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
   218
    fi
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents: 1354
diff changeset
   219
    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
   220
    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
   221
        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
   222
    fi
3405
d5f2dd33f4eb Merged improvements to SDL_SoftStretch() from SDL 1.2
Sam Lantinga <slouken@libsdl.org>
parents: 3394
diff changeset
   223
    AC_CHECK_FUNC(mprotect,
d5f2dd33f4eb Merged improvements to SDL_SoftStretch() from SDL 1.2
Sam Lantinga <slouken@libsdl.org>
parents: 3394
diff changeset
   224
        AC_TRY_COMPILE([
d5f2dd33f4eb Merged improvements to SDL_SoftStretch() from SDL 1.2
Sam Lantinga <slouken@libsdl.org>
parents: 3394
diff changeset
   225
          #include <sys/types.h>
d5f2dd33f4eb Merged improvements to SDL_SoftStretch() from SDL 1.2
Sam Lantinga <slouken@libsdl.org>
parents: 3394
diff changeset
   226
          #include <sys/mman.h>
d5f2dd33f4eb Merged improvements to SDL_SoftStretch() from SDL 1.2
Sam Lantinga <slouken@libsdl.org>
parents: 3394
diff changeset
   227
        ],[
d5f2dd33f4eb Merged improvements to SDL_SoftStretch() from SDL 1.2
Sam Lantinga <slouken@libsdl.org>
parents: 3394
diff changeset
   228
        ],[
5548
8f0abb6ef37d Updated configure.in to be compatible with autoconf 2.67.
Ryan C. Gordon <icculus@icculus.org>
parents: 5512
diff changeset
   229
        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
   230
        ]),
d5f2dd33f4eb Merged improvements to SDL_SoftStretch() from SDL 1.2
Sam Lantinga <slouken@libsdl.org>
parents: 3394
diff changeset
   231
    )
3586
b6758aee0dd4 Added support for querying the number of CPUs available on Linux. This also happens to work on Mac OS X.
Sam Lantinga <slouken@libsdl.org>
parents: 3581
diff changeset
   232
    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 sigaction setjmp nanosleep sysconf sysctlbyname)
1373
04499d3e1b6b *** empty log message ***
Sam Lantinga <slouken@libsdl.org>
parents: 1370
diff changeset
   233
3014
cacb282192a1 Check for functions after including the libraries that they might be in.
Sam Lantinga <slouken@libsdl.org>
parents: 3012
diff changeset
   234
    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
   235
    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
   236
5040
ff8873816c30 Fixed test for libiconv
Sam Lantinga <slouken@libsdl.org>
parents: 5030
diff changeset
   237
    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
   238
    AC_CHECK_FUNCS(iconv)
5577
ced8a6788629 Work on systems without sa_sigaction.
Ryan C. Gordon <icculus@icculus.org>
parents: 5557
diff changeset
   239
ced8a6788629 Work on systems without sa_sigaction.
Ryan C. Gordon <icculus@icculus.org>
parents: 5557
diff changeset
   240
    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
   241
fi
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents: 1354
diff changeset
   242
3180
77d6336711fc First commit for SDL atomic operations.
Bob Pendleton <bob@pendleton.com>
parents: 3173
diff changeset
   243
AC_CHECK_SIZEOF(void*)
1341
d02b552e5304 Configure dynamically generates SDL_config.h
Sam Lantinga <slouken@libsdl.org>
parents: 1330
diff changeset
   244
5004
0c72ae7b7cb2 Added native atomic operations for Windows, Mac OS X, and gcc compiler intrinsics.
Sam Lantinga <slouken@libsdl.org>
parents: 5003
diff changeset
   245
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
   246
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
   247
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
   248
               [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
   249
              , 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
   250
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
   251
    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
   252
    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
   253
    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
   254
    ],[
0c72ae7b7cb2 Added native atomic operations for Windows, Mac OS X, and gcc compiler intrinsics.
Sam Lantinga <slouken@libsdl.org>
parents: 5003
diff changeset
   255
    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
   256
    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
   257
    __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
   258
    __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
   259
    __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
   260
    __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
   261
    __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
   262
    ],[
0c72ae7b7cb2 Added native atomic operations for Windows, Mac OS X, and gcc compiler intrinsics.
Sam Lantinga <slouken@libsdl.org>
parents: 5003
diff changeset
   263
    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
   264
    ])
0c72ae7b7cb2 Added native atomic operations for Windows, Mac OS X, and gcc compiler intrinsics.
Sam Lantinga <slouken@libsdl.org>
parents: 5003
diff changeset
   265
    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
   266
5068
231dbbc3e31c Fixed atomic intrinsic test
Sam Lantinga <slouken@libsdl.org>
parents: 5066
diff changeset
   267
    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
   268
        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
   269
    else
55ff76cdbbb8 HAVE_GCC_ATOMICS covers the test and set
Sam Lantinga <slouken@libsdl.org>
parents: 5069
diff changeset
   270
        # 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
   271
        AC_TRY_LINK([
55ff76cdbbb8 HAVE_GCC_ATOMICS covers the test and set
Sam Lantinga <slouken@libsdl.org>
parents: 5069
diff changeset
   272
        ],[
55ff76cdbbb8 HAVE_GCC_ATOMICS covers the test and set
Sam Lantinga <slouken@libsdl.org>
parents: 5069
diff changeset
   273
        int a;
55ff76cdbbb8 HAVE_GCC_ATOMICS covers the test and set
Sam Lantinga <slouken@libsdl.org>
parents: 5069
diff changeset
   274
        __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
   275
        __sync_lock_release(&a);
5071
55ff76cdbbb8 HAVE_GCC_ATOMICS covers the test and set
Sam Lantinga <slouken@libsdl.org>
parents: 5069
diff changeset
   276
        ],[
55ff76cdbbb8 HAVE_GCC_ATOMICS covers the test and set
Sam Lantinga <slouken@libsdl.org>
parents: 5069
diff changeset
   277
        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
   278
        ])
55ff76cdbbb8 HAVE_GCC_ATOMICS covers the test and set
Sam Lantinga <slouken@libsdl.org>
parents: 5069
diff changeset
   279
        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
   280
            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
   281
        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
   282
    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
   283
fi
0c72ae7b7cb2 Added native atomic operations for Windows, Mac OS X, and gcc compiler intrinsics.
Sam Lantinga <slouken@libsdl.org>
parents: 5003
diff changeset
   284
5557
c1ed57cbfd66 Implemented pthread spinlocks.
Nathan Heisey <nathanheisey@gmail.com>
parents: 5548
diff changeset
   285
# Check for pthread implementation
c1ed57cbfd66 Implemented pthread spinlocks.
Nathan Heisey <nathanheisey@gmail.com>
parents: 5548
diff changeset
   286
AC_MSG_CHECKING(for pthread spinlock)
c1ed57cbfd66 Implemented pthread spinlocks.
Nathan Heisey <nathanheisey@gmail.com>
parents: 5548
diff changeset
   287
have_pthread_spinlock=no
c1ed57cbfd66 Implemented pthread spinlocks.
Nathan Heisey <nathanheisey@gmail.com>
parents: 5548
diff changeset
   288
c1ed57cbfd66 Implemented pthread spinlocks.
Nathan Heisey <nathanheisey@gmail.com>
parents: 5548
diff changeset
   289
AC_TRY_LINK([
c1ed57cbfd66 Implemented pthread spinlocks.
Nathan Heisey <nathanheisey@gmail.com>
parents: 5548
diff changeset
   290
#include <pthread.h>
c1ed57cbfd66 Implemented pthread spinlocks.
Nathan Heisey <nathanheisey@gmail.com>
parents: 5548
diff changeset
   291
],[
c1ed57cbfd66 Implemented pthread spinlocks.
Nathan Heisey <nathanheisey@gmail.com>
parents: 5548
diff changeset
   292
pthread_spinlock_t a;
c1ed57cbfd66 Implemented pthread spinlocks.
Nathan Heisey <nathanheisey@gmail.com>
parents: 5548
diff changeset
   293
pthread_spin_trylock(&a);
c1ed57cbfd66 Implemented pthread spinlocks.
Nathan Heisey <nathanheisey@gmail.com>
parents: 5548
diff changeset
   294
pthread_spin_unlock(&a);
c1ed57cbfd66 Implemented pthread spinlocks.
Nathan Heisey <nathanheisey@gmail.com>
parents: 5548
diff changeset
   295
],[
c1ed57cbfd66 Implemented pthread spinlocks.
Nathan Heisey <nathanheisey@gmail.com>
parents: 5548
diff changeset
   296
have_pthread_spinlock=yes
c1ed57cbfd66 Implemented pthread spinlocks.
Nathan Heisey <nathanheisey@gmail.com>
parents: 5548
diff changeset
   297
])
c1ed57cbfd66 Implemented pthread spinlocks.
Nathan Heisey <nathanheisey@gmail.com>
parents: 5548
diff changeset
   298
AC_MSG_RESULT($have_pthread_spinlock)
c1ed57cbfd66 Implemented pthread spinlocks.
Nathan Heisey <nathanheisey@gmail.com>
parents: 5548
diff changeset
   299
if test x$have_pthread_spinlock = xyes; then
c1ed57cbfd66 Implemented pthread spinlocks.
Nathan Heisey <nathanheisey@gmail.com>
parents: 5548
diff changeset
   300
    AC_DEFINE(HAVE_PTHREAD_SPINLOCK, 1, [ ])
c1ed57cbfd66 Implemented pthread spinlocks.
Nathan Heisey <nathanheisey@gmail.com>
parents: 5548
diff changeset
   301
fi
c1ed57cbfd66 Implemented pthread spinlocks.
Nathan Heisey <nathanheisey@gmail.com>
parents: 5548
diff changeset
   302
c1ed57cbfd66 Implemented pthread spinlocks.
Nathan Heisey <nathanheisey@gmail.com>
parents: 5548
diff changeset
   303
1361
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents: 1354
diff changeset
   304
# 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
   305
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
   306
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
   307
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
   308
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
   309
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
   310
SOURCES="$SOURCES $srcdir/src/file/*.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
   311
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
   312
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
   313
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
   314
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
   315
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
   316
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
   317
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   318
dnl Enable/disable various subsystems of the SDL library
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   319
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
   320
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
   321
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
   322
              , 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
   323
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
   324
    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
   325
fi
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   326
AC_ARG_ENABLE(audio,
1637
9ba366b919c7 Date: Fri, 31 Mar 2006 18:28:55 -0500
Sam Lantinga <slouken@libsdl.org>
parents: 1632
diff changeset
   327
AC_HELP_STRING([--enable-audio], [Enable the audio subsystem [[default=yes]]]),
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   328
              , 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
   329
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
   330
    AC_DEFINE(SDL_AUDIO_DISABLED, 1, [ ])
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   331
fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   332
AC_ARG_ENABLE(video,
1637
9ba366b919c7 Date: Fri, 31 Mar 2006 18:28:55 -0500
Sam Lantinga <slouken@libsdl.org>
parents: 1632
diff changeset
   333
AC_HELP_STRING([--enable-video], [Enable the video subsystem [[default=yes]]]),
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   334
              , 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
   335
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
   336
    AC_DEFINE(SDL_VIDEO_DISABLED, 1, [ ])
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   337
fi
5226
710d00cb3a6a Made it possible to disable the rendering subsystem with configure --disable-render
Sam Lantinga <slouken@libsdl.org>
parents: 5225
diff changeset
   338
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
   339
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
   340
              , 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
   341
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
   342
    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
   343
fi
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   344
AC_ARG_ENABLE(events,
1637
9ba366b919c7 Date: Fri, 31 Mar 2006 18:28:55 -0500
Sam Lantinga <slouken@libsdl.org>
parents: 1632
diff changeset
   345
AC_HELP_STRING([--enable-events], [Enable the events subsystem [[default=yes]]]),
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   346
              , 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
   347
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
   348
    AC_DEFINE(SDL_EVENTS_DISABLED, 1, [ ])
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   349
fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   350
AC_ARG_ENABLE(joystick,
1637
9ba366b919c7 Date: Fri, 31 Mar 2006 18:28:55 -0500
Sam Lantinga <slouken@libsdl.org>
parents: 1632
diff changeset
   351
AC_HELP_STRING([--enable-joystick], [Enable the joystick subsystem [[default=yes]]]),
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   352
              , 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
   353
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
   354
    AC_DEFINE(SDL_JOYSTICK_DISABLED, 1, [ ])
2103
4a010418f3b9 Merged r3009:3011 from branches/SDL-1.2: Skip subsystem on --disable-joysticks.
Ryan C. Gordon <icculus@icculus.org>
parents: 2093
diff changeset
   355
else
4a010418f3b9 Merged r3009:3011 from branches/SDL-1.2: Skip subsystem on --disable-joysticks.
Ryan C. Gordon <icculus@icculus.org>
parents: 2093
diff changeset
   356
    SOURCES="$SOURCES $srcdir/src/joystick/*.c"
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   357
fi
2713
0906692aa6a4 Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents: 2710
diff changeset
   358
AC_ARG_ENABLE(haptic,
0906692aa6a4 Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents: 2710
diff changeset
   359
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
   360
              , enable_haptic=yes)
0906692aa6a4 Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents: 2710
diff changeset
   361
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
   362
    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
   363
else
0906692aa6a4 Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents: 2710
diff changeset
   364
    SOURCES="$SOURCES $srcdir/src/haptic/*.c"
0906692aa6a4 Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents: 2710
diff changeset
   365
fi
3170
b7a48f533966 Initial work on power subsystem for SDL 1.3.
Ryan C. Gordon <icculus@icculus.org>
parents: 3168
diff changeset
   366
AC_ARG_ENABLE(power,
b7a48f533966 Initial work on power subsystem for SDL 1.3.
Ryan C. Gordon <icculus@icculus.org>
parents: 3168
diff changeset
   367
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
   368
              , enable_power=yes)
b7a48f533966 Initial work on power subsystem for SDL 1.3.
Ryan C. Gordon <icculus@icculus.org>
parents: 3168
diff changeset
   369
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
   370
    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
   371
else
b7a48f533966 Initial work on power subsystem for SDL 1.3.
Ryan C. Gordon <icculus@icculus.org>
parents: 3168
diff changeset
   372
    SOURCES="$SOURCES $srcdir/src/power/*.c"
b7a48f533966 Initial work on power subsystem for SDL 1.3.
Ryan C. Gordon <icculus@icculus.org>
parents: 3168
diff changeset
   373
fi
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   374
AC_ARG_ENABLE(threads,
1637
9ba366b919c7 Date: Fri, 31 Mar 2006 18:28:55 -0500
Sam Lantinga <slouken@libsdl.org>
parents: 1632
diff changeset
   375
AC_HELP_STRING([--enable-threads], [Enable the threading subsystem [[default=yes]]]),
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   376
              , enable_threads=yes)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   377
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
   378
    AC_DEFINE(SDL_THREADS_DISABLED, 1, [ ])
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   379
fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   380
AC_ARG_ENABLE(timers,
1637
9ba366b919c7 Date: Fri, 31 Mar 2006 18:28:55 -0500
Sam Lantinga <slouken@libsdl.org>
parents: 1632
diff changeset
   381
AC_HELP_STRING([--enable-timers], [Enable the timer subsystem [[default=yes]]]),
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   382
              , 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
   383
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
   384
    AC_DEFINE(SDL_TIMERS_DISABLED, 1, [ ])
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   385
fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   386
AC_ARG_ENABLE(file,
1637
9ba366b919c7 Date: Fri, 31 Mar 2006 18:28:55 -0500
Sam Lantinga <slouken@libsdl.org>
parents: 1632
diff changeset
   387
AC_HELP_STRING([--enable-file], [Enable the file subsystem [[default=yes]]]),
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   388
              , 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
   389
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
   390
    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
   391
fi
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents: 1354
diff changeset
   392
AC_ARG_ENABLE(loadso,
1637
9ba366b919c7 Date: Fri, 31 Mar 2006 18:28:55 -0500
Sam Lantinga <slouken@libsdl.org>
parents: 1632
diff changeset
   393
AC_HELP_STRING([--enable-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
   394
              , 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
   395
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
   396
    AC_DEFINE(SDL_LOADSO_DISABLED, 1, [ ])
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   397
fi
740
e70f80e98f60 Actually hook the cpuinfo module into the library. :)
Sam Lantinga <slouken@libsdl.org>
parents: 739
diff changeset
   398
AC_ARG_ENABLE(cpuinfo,
1637
9ba366b919c7 Date: Fri, 31 Mar 2006 18:28:55 -0500
Sam Lantinga <slouken@libsdl.org>
parents: 1632
diff changeset
   399
AC_HELP_STRING([--enable-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
   400
              , 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
   401
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
   402
    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
   403
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
   404
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
   405
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
   406
              , 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
   407
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
   408
    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
   409
fi
1402
d910939febfa Use consistent identifiers for the various platforms we support.
Sam Lantinga <slouken@libsdl.org>
parents: 1399
diff changeset
   410
AC_ARG_ENABLE(assembly,
1637
9ba366b919c7 Date: Fri, 31 Mar 2006 18:28:55 -0500
Sam Lantinga <slouken@libsdl.org>
parents: 1632
diff changeset
   411
AC_HELP_STRING([--enable-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
   412
              , enable_assembly=yes)
d910939febfa Use consistent identifiers for the various platforms we support.
Sam Lantinga <slouken@libsdl.org>
parents: 1399
diff changeset
   413
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
   414
    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
   415
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
   416
    # 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
   417
    # 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
   418
    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
   419
        *-*-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
   420
            # 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
   421
            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
   422
            ;;
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
        *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
   424
            # 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
   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
            ;;
3392
efc22582afc5 Only show the dynamic audio libraries if we'll be dynamically loading them
Sam Lantinga <slouken@libsdl.org>
parents: 3391
diff changeset
   427
        *)
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
   428
            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
   429
            ;;
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
    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
   431
    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
   432
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
   433
                  , 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
   434
    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
   435
        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
   436
            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
   437
        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
   438
    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
   439
2247
93994f65c74c Removed hermes since it's LGPL and not compatible with a commercial license.
Sam Lantinga <slouken@libsdl.org>
parents: 2238
diff changeset
   440
    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
   441
    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
   442
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
   443
                  , 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
   444
    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
   445
        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
   446
        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
   447
        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
   448
        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
   449
        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
   450
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_TRY_COMPILE([
4426
1bceff8f008f Fixed bug #943
Sam Lantinga <slouken@libsdl.org>
parents: 3696
diff changeset
   452
        #ifdef __MINGW32__
1bceff8f008f Fixed bug #943
Sam Lantinga <slouken@libsdl.org>
parents: 3696
diff changeset
   453
        #include <_mingw.h>
1bceff8f008f Fixed bug #943
Sam Lantinga <slouken@libsdl.org>
parents: 3696
diff changeset
   454
        #ifdef __MINGW64_VERSION_MAJOR
1bceff8f008f Fixed bug #943
Sam Lantinga <slouken@libsdl.org>
parents: 3696
diff changeset
   455
        #include <intrin.h>
1bceff8f008f Fixed bug #943
Sam Lantinga <slouken@libsdl.org>
parents: 3696
diff changeset
   456
        #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
   457
        #include <mmintrin.h>
4426
1bceff8f008f Fixed bug #943
Sam Lantinga <slouken@libsdl.org>
parents: 3696
diff changeset
   458
        #endif
1bceff8f008f Fixed bug #943
Sam Lantinga <slouken@libsdl.org>
parents: 3696
diff changeset
   459
        #else
1bceff8f008f Fixed bug #943
Sam Lantinga <slouken@libsdl.org>
parents: 3696
diff changeset
   460
        #include <mmintrin.h>
1bceff8f008f Fixed bug #943
Sam Lantinga <slouken@libsdl.org>
parents: 3696
diff changeset
   461
        #endif
2261
c20476d7d7b3 Enabled 3DNow! intrinsic support
Sam Lantinga <slouken@libsdl.org>
parents: 2247
diff changeset
   462
        #ifndef __MMX__
c20476d7d7b3 Enabled 3DNow! intrinsic support
Sam Lantinga <slouken@libsdl.org>
parents: 2247
diff changeset
   463
        #error Assembler CPP flag not enabled
c20476d7d7b3 Enabled 3DNow! intrinsic support
Sam Lantinga <slouken@libsdl.org>
parents: 2247
diff changeset
   464
        #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
   465
        ],[
93994f65c74c Removed hermes since it's LGPL and not compatible with a commercial license.
Sam Lantinga <slouken@libsdl.org>
parents: 2238
diff changeset
   466
        ],[
93994f65c74c Removed hermes since it's LGPL and not compatible with a commercial license.
Sam Lantinga <slouken@libsdl.org>
parents: 2238
diff changeset
   467
        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
   468
        ])
93994f65c74c Removed hermes since it's LGPL and not compatible with a commercial license.
Sam Lantinga <slouken@libsdl.org>
parents: 2238
diff changeset
   469
        AC_MSG_RESULT($have_gcc_mmx)
2290
323a5af2924b Christian Walther fixed bug #530
Sam Lantinga <slouken@libsdl.org>
parents: 2271
diff changeset
   470
        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
   471
93994f65c74c Removed hermes since it's LGPL and not compatible with a commercial license.
Sam Lantinga <slouken@libsdl.org>
parents: 2238
diff changeset
   472
        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
   473
            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
   474
        fi
93994f65c74c Removed hermes since it's LGPL and not compatible with a commercial license.
Sam Lantinga <slouken@libsdl.org>
parents: 2238
diff changeset
   475
    fi
93994f65c74c Removed hermes since it's LGPL and not compatible with a commercial license.
Sam Lantinga <slouken@libsdl.org>
parents: 2238
diff changeset
   476
5389
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   477
    AC_ARG_ENABLE(3dnow,
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   478
AC_HELP_STRING([--enable-3dnow], [use MMX assembly routines [[default=yes]]]),
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   479
                  , enable_3dnow=yes)
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   480
    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
   481
        save_CFLAGS="$CFLAGS"
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   482
        have_gcc_3dnow=no
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   483
        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
   484
        amd3dnow_CFLAGS="-m3dnow"
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   485
        CFLAGS="$save_CFLAGS $amd3dnow_CFLAGS"
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   486
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   487
        AC_TRY_COMPILE([
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   488
        #include <mm3dnow.h>
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   489
        #ifndef __3dNOW__
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   490
        #error Assembler CPP flag not enabled
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   491
        #endif
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   492
        ],[
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   493
        ],[
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   494
        have_gcc_3dnow=yes
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   495
        ])
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   496
        AC_MSG_RESULT($have_gcc_3dnow)
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   497
        CFLAGS="$save_CFLAGS"
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   498
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   499
        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
   500
            EXTRA_CFLAGS="$EXTRA_CFLAGS $amd3dnow_CFLAGS"
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   501
        fi
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   502
    fi
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   503
2247
93994f65c74c Removed hermes since it's LGPL and not compatible with a commercial license.
Sam Lantinga <slouken@libsdl.org>
parents: 2238
diff changeset
   504
    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
   505
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
   506
                  , 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
   507
    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
   508
        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
   509
        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
   510
        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
   511
        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
   512
        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
   513
93994f65c74c Removed hermes since it's LGPL and not compatible with a commercial license.
Sam Lantinga <slouken@libsdl.org>
parents: 2238
diff changeset
   514
        AC_TRY_COMPILE([
4426
1bceff8f008f Fixed bug #943
Sam Lantinga <slouken@libsdl.org>
parents: 3696
diff changeset
   515
        #ifdef __MINGW32__
1bceff8f008f Fixed bug #943
Sam Lantinga <slouken@libsdl.org>
parents: 3696
diff changeset
   516
        #include <_mingw.h>
1bceff8f008f Fixed bug #943
Sam Lantinga <slouken@libsdl.org>
parents: 3696
diff changeset
   517
        #ifdef __MINGW64_VERSION_MAJOR
1bceff8f008f Fixed bug #943
Sam Lantinga <slouken@libsdl.org>
parents: 3696
diff changeset
   518
        #include <intrin.h>
1bceff8f008f Fixed bug #943
Sam Lantinga <slouken@libsdl.org>
parents: 3696
diff changeset
   519
        #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
   520
        #include <xmmintrin.h>
4426
1bceff8f008f Fixed bug #943
Sam Lantinga <slouken@libsdl.org>
parents: 3696
diff changeset
   521
        #endif
1bceff8f008f Fixed bug #943
Sam Lantinga <slouken@libsdl.org>
parents: 3696
diff changeset
   522
        #else
1bceff8f008f Fixed bug #943
Sam Lantinga <slouken@libsdl.org>
parents: 3696
diff changeset
   523
        #include <xmmintrin.h>
1bceff8f008f Fixed bug #943
Sam Lantinga <slouken@libsdl.org>
parents: 3696
diff changeset
   524
        #endif
2261
c20476d7d7b3 Enabled 3DNow! intrinsic support
Sam Lantinga <slouken@libsdl.org>
parents: 2247
diff changeset
   525
        #ifndef __SSE__
c20476d7d7b3 Enabled 3DNow! intrinsic support
Sam Lantinga <slouken@libsdl.org>
parents: 2247
diff changeset
   526
        #error Assembler CPP flag not enabled
c20476d7d7b3 Enabled 3DNow! intrinsic support
Sam Lantinga <slouken@libsdl.org>
parents: 2247
diff changeset
   527
        #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
   528
        ],[
93994f65c74c Removed hermes since it's LGPL and not compatible with a commercial license.
Sam Lantinga <slouken@libsdl.org>
parents: 2238
diff changeset
   529
        ],[
93994f65c74c Removed hermes since it's LGPL and not compatible with a commercial license.
Sam Lantinga <slouken@libsdl.org>
parents: 2238
diff changeset
   530
        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
   531
        ])
93994f65c74c Removed hermes since it's LGPL and not compatible with a commercial license.
Sam Lantinga <slouken@libsdl.org>
parents: 2238
diff changeset
   532
        AC_MSG_RESULT($have_gcc_sse)
2290
323a5af2924b Christian Walther fixed bug #530
Sam Lantinga <slouken@libsdl.org>
parents: 2271
diff changeset
   533
        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
   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
        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
   536
            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
   537
        fi
93994f65c74c Removed hermes since it's LGPL and not compatible with a commercial license.
Sam Lantinga <slouken@libsdl.org>
parents: 2238
diff changeset
   538
    fi
93994f65c74c Removed hermes since it's LGPL and not compatible with a commercial license.
Sam Lantinga <slouken@libsdl.org>
parents: 2238
diff changeset
   539
2264
f7f80b822c1f Enabled SSE2 intrinsics
Sam Lantinga <slouken@libsdl.org>
parents: 2261
diff changeset
   540
    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
   541
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
   542
                  , enable_sse2=$default_ssemath)
2264
f7f80b822c1f Enabled SSE2 intrinsics
Sam Lantinga <slouken@libsdl.org>
parents: 2261
diff changeset
   543
    if test x$enable_sse2 = xyes; then
f7f80b822c1f Enabled SSE2 intrinsics
Sam Lantinga <slouken@libsdl.org>
parents: 2261
diff changeset
   544
        save_CFLAGS="$CFLAGS"
f7f80b822c1f Enabled SSE2 intrinsics
Sam Lantinga <slouken@libsdl.org>
parents: 2261
diff changeset
   545
        have_gcc_sse2=no
f7f80b822c1f Enabled SSE2 intrinsics
Sam Lantinga <slouken@libsdl.org>
parents: 2261
diff changeset
   546
        AC_MSG_CHECKING(for GCC -msse2 option)
f7f80b822c1f Enabled SSE2 intrinsics
Sam Lantinga <slouken@libsdl.org>
parents: 2261
diff changeset
   547
        sse2_CFLAGS="-msse2"
f7f80b822c1f Enabled SSE2 intrinsics
Sam Lantinga <slouken@libsdl.org>
parents: 2261
diff changeset
   548
        CFLAGS="$save_CFLAGS $sse2_CFLAGS"
f7f80b822c1f Enabled SSE2 intrinsics
Sam Lantinga <slouken@libsdl.org>
parents: 2261
diff changeset
   549
f7f80b822c1f Enabled SSE2 intrinsics
Sam Lantinga <slouken@libsdl.org>
parents: 2261
diff changeset
   550
        AC_TRY_COMPILE([
4426
1bceff8f008f Fixed bug #943
Sam Lantinga <slouken@libsdl.org>
parents: 3696
diff changeset
   551
        #ifdef __MINGW32__
1bceff8f008f Fixed bug #943
Sam Lantinga <slouken@libsdl.org>
parents: 3696
diff changeset
   552
        #include <_mingw.h>
1bceff8f008f Fixed bug #943
Sam Lantinga <slouken@libsdl.org>
parents: 3696
diff changeset
   553
        #ifdef __MINGW64_VERSION_MAJOR
1bceff8f008f Fixed bug #943
Sam Lantinga <slouken@libsdl.org>
parents: 3696
diff changeset
   554
        #include <intrin.h>
1bceff8f008f Fixed bug #943
Sam Lantinga <slouken@libsdl.org>
parents: 3696
diff changeset
   555
        #else
2264
f7f80b822c1f Enabled SSE2 intrinsics
Sam Lantinga <slouken@libsdl.org>
parents: 2261
diff changeset
   556
        #include <emmintrin.h>
4426
1bceff8f008f Fixed bug #943
Sam Lantinga <slouken@libsdl.org>
parents: 3696
diff changeset
   557
        #endif
1bceff8f008f Fixed bug #943
Sam Lantinga <slouken@libsdl.org>
parents: 3696
diff changeset
   558
        #else
1bceff8f008f Fixed bug #943
Sam Lantinga <slouken@libsdl.org>
parents: 3696
diff changeset
   559
        #include <emmintrin.h>
1bceff8f008f Fixed bug #943
Sam Lantinga <slouken@libsdl.org>
parents: 3696
diff changeset
   560
        #endif
2264
f7f80b822c1f Enabled SSE2 intrinsics
Sam Lantinga <slouken@libsdl.org>
parents: 2261
diff changeset
   561
        #ifndef __SSE2__
f7f80b822c1f Enabled SSE2 intrinsics
Sam Lantinga <slouken@libsdl.org>
parents: 2261
diff changeset
   562
        #error Assembler CPP flag not enabled
f7f80b822c1f Enabled SSE2 intrinsics
Sam Lantinga <slouken@libsdl.org>
parents: 2261
diff changeset
   563
        #endif
f7f80b822c1f Enabled SSE2 intrinsics
Sam Lantinga <slouken@libsdl.org>
parents: 2261
diff changeset
   564
        ],[
f7f80b822c1f Enabled SSE2 intrinsics
Sam Lantinga <slouken@libsdl.org>
parents: 2261
diff changeset
   565
        ],[
f7f80b822c1f Enabled SSE2 intrinsics
Sam Lantinga <slouken@libsdl.org>
parents: 2261
diff changeset
   566
        have_gcc_sse2=yes
f7f80b822c1f Enabled SSE2 intrinsics
Sam Lantinga <slouken@libsdl.org>
parents: 2261
diff changeset
   567
        ])
f7f80b822c1f Enabled SSE2 intrinsics
Sam Lantinga <slouken@libsdl.org>
parents: 2261
diff changeset
   568
        AC_MSG_RESULT($have_gcc_sse2)
2290
323a5af2924b Christian Walther fixed bug #530
Sam Lantinga <slouken@libsdl.org>
parents: 2271
diff changeset
   569
        CFLAGS="$save_CFLAGS"
2264
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
        if test x$have_gcc_sse2 = xyes; then
f7f80b822c1f Enabled SSE2 intrinsics
Sam Lantinga <slouken@libsdl.org>
parents: 2261
diff changeset
   572
            EXTRA_CFLAGS="$EXTRA_CFLAGS $sse2_CFLAGS"
f7f80b822c1f Enabled SSE2 intrinsics
Sam Lantinga <slouken@libsdl.org>
parents: 2261
diff changeset
   573
        fi
f7f80b822c1f Enabled SSE2 intrinsics
Sam Lantinga <slouken@libsdl.org>
parents: 2261
diff changeset
   574
    fi
5389
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   575
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   576
    AC_ARG_ENABLE(altivec,
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   577
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
   578
                  , enable_altivec=yes)
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   579
    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
   580
        save_CFLAGS="$CFLAGS"
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   581
        have_gcc_altivec=no
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   582
        have_altivec_h_hdr=no
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   583
        altivec_CFLAGS="-maltivec"
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   584
        CFLAGS="$save_CFLAGS $altivec_CFLAGS"
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   585
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   586
        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
   587
        AC_TRY_COMPILE([
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   588
        #include <altivec.h>
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   589
        vector unsigned int vzero() {
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   590
            return vec_splat_u32(0);
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
        ],[
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   593
        ],[
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   594
        have_gcc_altivec=yes
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   595
        have_altivec_h_hdr=yes
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   596
        ])
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   597
        AC_MSG_RESULT($have_gcc_altivec)
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
        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
   600
            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
   601
            AC_TRY_COMPILE([
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   602
            vector unsigned int vzero() {
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   603
                return vec_splat_u32(0);
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
            ],[
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   606
            ],[
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   607
            have_gcc_altivec=yes
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   608
            ])
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   609
            AC_MSG_RESULT($have_gcc_altivec)
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   610
        fi
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
        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
   613
            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
   614
            altivec_CFLAGS="-faltivec"
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   615
            CFLAGS="$save_CFLAGS $altivec_CFLAGS"
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   616
            AC_TRY_COMPILE([
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   617
            #include <altivec.h>
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   618
            vector unsigned int vzero() {
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   619
                return vec_splat_u32(0);
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   620
            }
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   621
            ],[
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   622
            ],[
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   623
            have_gcc_altivec=yes
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   624
            have_altivec_h_hdr=yes
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   625
            ])
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   626
            AC_MSG_RESULT($have_gcc_altivec)
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   627
        fi
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
        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
   630
            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
   631
            AC_TRY_COMPILE([
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   632
            vector unsigned int vzero() {
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   633
                return vec_splat_u32(0);
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
            ],[
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   636
            ],[
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   637
            have_gcc_altivec=yes
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   638
            ])
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   639
            AC_MSG_RESULT($have_gcc_altivec)
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   640
        fi
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   641
        CFLAGS="$save_CFLAGS"
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
        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
   644
            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
   645
            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
   646
              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
   647
            fi
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   648
            EXTRA_CFLAGS="$EXTRA_CFLAGS $altivec_CFLAGS"
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   649
        fi
24903690f48a Re-added the 3DNow! and AltiVec instruction support.
Sam Lantinga <slouken@libsdl.org>
parents: 5345
diff changeset
   650
    fi
740
e70f80e98f60 Actually hook the cpuinfo module into the library. :)
Sam Lantinga <slouken@libsdl.org>
parents: 739
diff changeset
   651
fi
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   652
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   653
dnl See if the OSS audio interface is supported
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   654
CheckOSS()
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   655
{
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   656
    AC_ARG_ENABLE(oss,
1637
9ba366b919c7 Date: Fri, 31 Mar 2006 18:28:55 -0500
Sam Lantinga <slouken@libsdl.org>
parents: 1632
diff changeset
   657
AC_HELP_STRING([--enable-oss], [support the OSS audio API [[default=yes]]]),
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   658
                  , enable_oss=yes)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   659
    if test x$enable_audio = xyes -a x$enable_oss = xyes; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   660
        AC_MSG_CHECKING(for OSS audio support)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   661
        have_oss=no
94
ae6e6b73333f Cleaned up the OpenBSD port, thanks to Peter Valchev
Sam Lantinga <slouken@lokigames.com>
parents: 86
diff changeset
   662
        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
   663
            AC_TRY_COMPILE([
ae6e6b73333f Cleaned up the OpenBSD port, thanks to Peter Valchev
Sam Lantinga <slouken@lokigames.com>
parents: 86
diff changeset
   664
              #include <sys/soundcard.h>
ae6e6b73333f Cleaned up the OpenBSD port, thanks to Peter Valchev
Sam Lantinga <slouken@lokigames.com>
parents: 86
diff changeset
   665
            ],[
ae6e6b73333f Cleaned up the OpenBSD port, thanks to Peter Valchev
Sam Lantinga <slouken@lokigames.com>
parents: 86
diff changeset
   666
              int arg = SNDCTL_DSP_SETFRAGMENT;
ae6e6b73333f Cleaned up the OpenBSD port, thanks to Peter Valchev
Sam Lantinga <slouken@lokigames.com>
parents: 86
diff changeset
   667
            ],[
ae6e6b73333f Cleaned up the OpenBSD port, thanks to Peter Valchev
Sam Lantinga <slouken@lokigames.com>
parents: 86
diff changeset
   668
            have_oss=yes
ae6e6b73333f Cleaned up the OpenBSD port, thanks to Peter Valchev
Sam Lantinga <slouken@lokigames.com>
parents: 86
diff changeset
   669
            ])
ae6e6b73333f Cleaned up the OpenBSD port, thanks to Peter Valchev
Sam Lantinga <slouken@lokigames.com>
parents: 86
diff changeset
   670
        fi
ae6e6b73333f Cleaned up the OpenBSD port, thanks to Peter Valchev
Sam Lantinga <slouken@lokigames.com>
parents: 86
diff changeset
   671
        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
   672
            AC_TRY_COMPILE([
ae6e6b73333f Cleaned up the OpenBSD port, thanks to Peter Valchev
Sam Lantinga <slouken@lokigames.com>
parents: 86
diff changeset
   673
              #include <soundcard.h>
ae6e6b73333f Cleaned up the OpenBSD port, thanks to Peter Valchev
Sam Lantinga <slouken@lokigames.com>
parents: 86
diff changeset
   674
            ],[
ae6e6b73333f Cleaned up the OpenBSD port, thanks to Peter Valchev
Sam Lantinga <slouken@lokigames.com>
parents: 86
diff changeset
   675
              int arg = SNDCTL_DSP_SETFRAGMENT;
ae6e6b73333f Cleaned up the OpenBSD port, thanks to Peter Valchev
Sam Lantinga <slouken@lokigames.com>
parents: 86
diff changeset
   676
            ],[
ae6e6b73333f Cleaned up the OpenBSD port, thanks to Peter Valchev
Sam Lantinga <slouken@lokigames.com>
parents: 86
diff changeset
   677
            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
   678
            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
   679
            ])
ae6e6b73333f Cleaned up the OpenBSD port, thanks to Peter Valchev
Sam Lantinga <slouken@lokigames.com>
parents: 86
diff changeset
   680
        fi
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   681
        AC_MSG_RESULT($have_oss)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   682
        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
   683
            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
   684
            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
   685
            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
   686
1565
57431b199aed Fixed bug #52
Sam Lantinga <slouken@libsdl.org>
parents: 1556
diff changeset
   687
            # We may need to link with ossaudio emulation library
1550
31c2b8e4885e Fixed bug #166
Sam Lantinga <slouken@libsdl.org>
parents: 1548
diff changeset
   688
            case "$host" in
1383
1736c5e2173f NetBSD support
Sam Lantinga <slouken@libsdl.org>
parents: 1380
diff changeset
   689
                *-*-openbsd*|*-*-netbsd*)
1521
9b9212e4810c CFLAGS are separate from EXTRA_CFLAGS
Sam Lantinga <slouken@libsdl.org>
parents: 1520
diff changeset
   690
                    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
   691
            esac
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   692
        fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   693
    fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   694
}
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   695
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   696
dnl See if the ALSA audio interface is supported
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   697
CheckALSA()
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   698
{
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   699
    AC_ARG_ENABLE(alsa,
1637
9ba366b919c7 Date: Fri, 31 Mar 2006 18:28:55 -0500
Sam Lantinga <slouken@libsdl.org>
parents: 1632
diff changeset
   700
AC_HELP_STRING([--enable-alsa], [support the ALSA audio API [[default=yes]]]),
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   701
                  , enable_alsa=yes)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   702
    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
   703
        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
   704
        # 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
   705
        CFLAGS="$alsa_save_CFLAGS"
027688378762 No really, don't link with the ALSA library!
Sam Lantinga <slouken@libsdl.org>
parents: 991
diff changeset
   706
        LDFLAGS="$alsa_save_LDFLAGS"
027688378762 No really, don't link with the ALSA library!
Sam Lantinga <slouken@libsdl.org>
parents: 991
diff changeset
   707
        LIBS="$alsa_save_LIBS"
354
30935e76acb5 Updated ALSA audio support for ALSA 0.9
Sam Lantinga <slouken@libsdl.org>
parents: 350
diff changeset
   708
        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
   709
            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
   710
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
   711
                          , 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
   712
            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
   713
5548
8f0abb6ef37d Updated configure.in to be compatible with autoconf 2.67.
Ryan C. Gordon <icculus@icculus.org>
parents: 5512
diff changeset
   714
            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
   715
            SOURCES="$SOURCES $srcdir/src/audio/alsa/*.c"
1521
9b9212e4810c CFLAGS are separate from EXTRA_CFLAGS
Sam Lantinga <slouken@libsdl.org>
parents: 1520
diff changeset
   716
            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
   717
            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
   718
               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
   719
                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
   720
            fi
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents: 1354
diff changeset
   721
            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
   722
               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
   723
                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
   724
                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
   725
            else
1521
9b9212e4810c CFLAGS are separate from EXTRA_CFLAGS
Sam Lantinga <slouken@libsdl.org>
parents: 1520
diff changeset
   726
                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
   727
            fi
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents: 1354
diff changeset
   728
            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
   729
        fi
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents: 1354
diff changeset
   730
    fi
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   731
}
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   732
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   733
dnl Find the ESD includes and libraries
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   734
CheckESD()
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   735
{
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   736
    AC_ARG_ENABLE(esd,
1637
9ba366b919c7 Date: Fri, 31 Mar 2006 18:28:55 -0500
Sam Lantinga <slouken@libsdl.org>
parents: 1632
diff changeset
   737
AC_HELP_STRING([--enable-esd], [support the Enlightened Sound Daemon [[default=yes]]]),
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   738
                  , enable_esd=yes)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   739
    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
   740
        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
   741
        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
   742
            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
   743
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
   744
                          , 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
   745
            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
   746
5548
8f0abb6ef37d Updated configure.in to be compatible with autoconf 2.67.
Ryan C. Gordon <icculus@icculus.org>
parents: 5512
diff changeset
   747
            AC_DEFINE(SDL_AUDIO_DRIVER_ESD, 1, [ ])
1467
b69f2b0309a0 Removed accidentally copied/pasted script for ALSA detection
Sam Lantinga <slouken@libsdl.org>
parents: 1459
diff changeset
   748
            SOURCES="$SOURCES $srcdir/src/audio/esd/*.c"
1521
9b9212e4810c CFLAGS are separate from EXTRA_CFLAGS
Sam Lantinga <slouken@libsdl.org>
parents: 1520
diff changeset
   749
            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
   750
            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
   751
               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
   752
                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
   753
            fi
1173
e9cf8c1b4590 Split up src/SDL_loadso.c into platform directories.
Ryan C. Gordon <icculus@icculus.org>
parents: 1170
diff changeset
   754
            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
   755
               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
   756
                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
   757
                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
   758
            else
1521
9b9212e4810c CFLAGS are separate from EXTRA_CFLAGS
Sam Lantinga <slouken@libsdl.org>
parents: 1520
diff changeset
   759
                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
   760
            fi
1361
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents: 1354
diff changeset
   761
            have_audio=yes
294
d2d48e10f370 Added a new header file: SDL_loadso.h
Sam Lantinga <slouken@libsdl.org>
parents: 292
diff changeset
   762
        fi
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   763
    fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   764
}
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   765
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
   766
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
   767
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
   768
{
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
   769
    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
   770
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
   771
                  , 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
   772
    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
   773
        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
   774
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
   775
        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
   776
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
   777
        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
   778
        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
   779
        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
   780
        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
   781
                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
   782
                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
   783
                audio_pulseaudio=yes
3391
188fc5ecc58c Simplify and improve dynamic library detection, taken from SDL_image
Sam Lantinga <slouken@libsdl.org>
parents: 3390
diff changeset
   784
            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
   785
        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
   786
        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
   787
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
        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
   789
            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
   790
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
   791
                          , 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
   792
            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
   793
5548
8f0abb6ef37d Updated configure.in to be compatible with autoconf 2.67.
Ryan C. Gordon <icculus@icculus.org>
parents: 5512
diff changeset
   794
            AC_DEFINE(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
   795
            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
   796
            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
   797
            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
   798
               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
   799
                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
   800
            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
   801
            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
   802
               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
   803
                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
   804
                AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_PULSEAUDIO_DYNAMIC, "$pulseaudio_lib", [ ])
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
   805
            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
   806
                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
   807
            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
   808
            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
   809
        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
   810
    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
   811
}
60b4c52a7906 Ported PulseAudio target from 1.2 to 1.3 interfaces, and added it to the trunk.
Ryan C. Gordon <icculus@icculus.org>
parents: 2264
diff changeset
   812
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   813
CheckARTSC()
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   814
{
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   815
    AC_ARG_ENABLE(arts,
1637
9ba366b919c7 Date: Fri, 31 Mar 2006 18:28:55 -0500
Sam Lantinga <slouken@libsdl.org>
parents: 1632
diff changeset
   816
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
   817
                  , enable_arts=yes)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   818
    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
   819
        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
   820
        if test x$ARTSCONFIG = x -o x$ARTSCONFIG = x'"$ARTSCONFIG"'; then
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   821
            : # arts isn't installed
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   822
        else
1361
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents: 1354
diff changeset
   823
            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
   824
            ARTS_LIBS=`$ARTSCONFIG --libs`
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   825
            AC_MSG_CHECKING(for aRts development environment)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   826
            audio_arts=no
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   827
            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
   828
            CFLAGS="$CFLAGS $ARTS_CFLAGS"
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   829
            AC_TRY_COMPILE([
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   830
             #include <artsc.h>
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   831
            ],[
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   832
             arts_stream_t stream;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   833
            ],[
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   834
            audio_arts=yes
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   835
            ])
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   836
            CFLAGS="$save_CFLAGS"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   837
            AC_MSG_RESULT($audio_arts)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   838
            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
   839
                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
   840
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
   841
                              , 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
   842
                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
   843
5548
8f0abb6ef37d Updated configure.in to be compatible with autoconf 2.67.
Ryan C. Gordon <icculus@icculus.org>
parents: 5512
diff changeset
   844
                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
   845
                SOURCES="$SOURCES $srcdir/src/audio/arts/*.c"
1521
9b9212e4810c CFLAGS are separate from EXTRA_CFLAGS
Sam Lantinga <slouken@libsdl.org>
parents: 1520
diff changeset
   846
                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
   847
                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
   848
                   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
   849
                    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
   850
                fi
1173
e9cf8c1b4590 Split up src/SDL_loadso.c into platform directories.
Ryan C. Gordon <icculus@icculus.org>
parents: 1170
diff changeset
   851
                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
   852
                   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
   853
                    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
   854
                    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
   855
                else
1521
9b9212e4810c CFLAGS are separate from EXTRA_CFLAGS
Sam Lantinga <slouken@libsdl.org>
parents: 1520
diff changeset
   856
                    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
   857
                fi
1361
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents: 1354
diff changeset
   858
                have_audio=yes
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   859
            fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   860
        fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   861
    fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   862
}
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   863
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   864
dnl See if the NAS audio interface is supported
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   865
CheckNAS()
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   866
{
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   867
    AC_ARG_ENABLE(nas,
1637
9ba366b919c7 Date: Fri, 31 Mar 2006 18:28:55 -0500
Sam Lantinga <slouken@libsdl.org>
parents: 1632
diff changeset
   868
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
   869
                  , enable_nas=yes)
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   870
    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
   871
        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
   872
        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
   873
41
8de9e8baaecc *** empty log message ***
Sam Lantinga <slouken@lokigames.com>
parents: 39
diff changeset
   874
        AC_MSG_CHECKING(for NAS audio support)
8de9e8baaecc *** empty log message ***
Sam Lantinga <slouken@lokigames.com>
parents: 39
diff changeset
   875
        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
   876
5f6550e5184f Merged SDL-ryan-multiple-audio-device branch r2803:2871 into the trunk.
Ryan C. Gordon <icculus@icculus.org>
parents: 2040
diff changeset
   877
        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
   878
            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
   879
            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
   880
5f6550e5184f Merged SDL-ryan-multiple-audio-device branch r2803:2871 into the trunk.
Ryan C. Gordon <icculus@icculus.org>
parents: 2040
diff changeset
   881
        elif test -r /usr/X11R6/include/audio/audiolib.h; then
41
8de9e8baaecc *** empty log message ***
Sam Lantinga <slouken@lokigames.com>
parents: 39
diff changeset
   882
            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
   883
            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
   884
            NAS_LIBS="-L/usr/X11R6/lib -laudio -lXt"
605
6399f4e90211 IRIX patches from Andrea Suatoni
Sam Lantinga <slouken@libsdl.org>
parents: 599
diff changeset
   885
41
8de9e8baaecc *** empty log message ***
Sam Lantinga <slouken@lokigames.com>
parents: 39
diff changeset
   886
        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
   887
605
6399f4e90211 IRIX patches from Andrea Suatoni
Sam Lantinga <slouken@libsdl.org>
parents: 599
diff changeset
   888
        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
   889
1361
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents: 1354
diff changeset
   890
        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
   891
            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
   892
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
   893
                          , 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
   894
            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
   895
5f6550e5184f Merged SDL-ryan-multiple-audio-device branch r2803:2871 into the trunk.
Ryan C. Gordon <icculus@icculus.org>
parents: 2040
diff changeset
   896
            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
   897
               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
   898
                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
   899
            fi
5f6550e5184f Merged SDL-ryan-multiple-audio-device branch r2803:2871 into the trunk.
Ryan C. Gordon <icculus@icculus.org>
parents: 2040
diff changeset
   900
            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
   901
               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
   902
                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
   903
                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
   904
            else
5f6550e5184f Merged SDL-ryan-multiple-audio-device branch r2803:2871 into the trunk.
Ryan C. Gordon <icculus@icculus.org>
parents: 2040
diff changeset
   905
                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
   906
            fi
5f6550e5184f Merged SDL-ryan-multiple-audio-device branch r2803:2871 into the trunk.
Ryan C. Gordon <icculus@icculus.org>
parents: 2040
diff changeset
   907
5548
8f0abb6ef37d Updated configure.in to be compatible with autoconf 2.67.
Ryan C. Gordon <icculus@icculus.org>
parents: 5512
diff changeset
   908
            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
   909
            SOURCES="$SOURCES $srcdir/src/audio/nas/*.c"
1521
9b9212e4810c CFLAGS are separate from EXTRA_CFLAGS
Sam Lantinga <slouken@libsdl.org>
parents: 1520
diff changeset
   910
            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
   911
            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
   912
        fi
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   913
    fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   914
}
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   915
68
ac6645260d31 Added an audio driver that writes to disk (thanks Ryan!)
Sam Lantinga <slouken@lokigames.com>
parents: 53
diff changeset
   916
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
   917
CheckDiskAudio()
ac6645260d31 Added an audio driver that writes to disk (thanks Ryan!)
Sam Lantinga <slouken@lokigames.com>
parents: 53
diff changeset
   918
{
ac6645260d31 Added an audio driver that writes to disk (thanks Ryan!)
Sam Lantinga <slouken@lokigames.com>
parents: 53
diff changeset
   919
    AC_ARG_ENABLE(diskaudio,
1637
9ba366b919c7 Date: Fri, 31 Mar 2006 18:28:55 -0500
Sam Lantinga <slouken@libsdl.org>
parents: 1632
diff changeset
   920
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
   921
                  , enable_diskaudio=yes)
68
ac6645260d31 Added an audio driver that writes to disk (thanks Ryan!)
Sam Lantinga <slouken@lokigames.com>
parents: 53
diff changeset
   922
    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
   923
        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
   924
        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
   925
    fi
ac6645260d31 Added an audio driver that writes to disk (thanks Ryan!)
Sam Lantinga <slouken@lokigames.com>
parents: 53
diff changeset
   926
}
ac6645260d31 Added an audio driver that writes to disk (thanks Ryan!)
Sam Lantinga <slouken@lokigames.com>
parents: 53
diff changeset
   927
1532
30f189cdd82b Implemented dummy audio driver.
Ryan C. Gordon <icculus@icculus.org>
parents: 1521
diff changeset
   928
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
   929
CheckDummyAudio()
30f189cdd82b Implemented dummy audio driver.
Ryan C. Gordon <icculus@icculus.org>
parents: 1521
diff changeset
   930
{
30f189cdd82b Implemented dummy audio driver.
Ryan C. Gordon <icculus@icculus.org>
parents: 1521
diff changeset
   931
    AC_ARG_ENABLE(dummyaudio,
1637
9ba366b919c7 Date: Fri, 31 Mar 2006 18:28:55 -0500
Sam Lantinga <slouken@libsdl.org>
parents: 1632
diff changeset
   932
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
   933
                  , enable_dummyaudio=yes)
30f189cdd82b Implemented dummy audio driver.
Ryan C. Gordon <icculus@icculus.org>
parents: 1521
diff changeset
   934
    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
   935
        AC_DEFINE(SDL_AUDIO_DRIVER_DUMMY, 1, [ ])
1532
30f189cdd82b Implemented dummy audio driver.
Ryan C. Gordon <icculus@icculus.org>
parents: 1521
diff changeset
   936
        SOURCES="$SOURCES $srcdir/src/audio/dummy/*.c"
30f189cdd82b Implemented dummy audio driver.
Ryan C. Gordon <icculus@icculus.org>
parents: 1521
diff changeset
   937
    fi
30f189cdd82b Implemented dummy audio driver.
Ryan C. Gordon <icculus@icculus.org>
parents: 1521
diff changeset
   938
}
30f189cdd82b Implemented dummy audio driver.
Ryan C. Gordon <icculus@icculus.org>
parents: 1521
diff changeset
   939
1573
2422ca15ba42 Added support for gcc4's -fvisibility=hidden option.
Ryan C. Gordon <icculus@icculus.org>
parents: 1571
diff changeset
   940
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
   941
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
   942
CheckVisibilityHidden()
2422ca15ba42 Added support for gcc4's -fvisibility=hidden option.
Ryan C. Gordon <icculus@icculus.org>
parents: 1571
diff changeset
   943
{
2422ca15ba42 Added support for gcc4's -fvisibility=hidden option.
Ryan C. Gordon <icculus@icculus.org>
parents: 1571
diff changeset
   944
    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
   945
    have_gcc_fvisibility=no
2422ca15ba42 Added support for gcc4's -fvisibility=hidden option.
Ryan C. Gordon <icculus@icculus.org>
parents: 1571
diff changeset
   946
2422ca15ba42 Added support for gcc4's -fvisibility=hidden option.
Ryan C. Gordon <icculus@icculus.org>
parents: 1571
diff changeset
   947
    visibility_CFLAGS="-fvisibility=hidden"
2422ca15ba42 Added support for gcc4's -fvisibility=hidden option.
Ryan C. Gordon <icculus@icculus.org>
parents: 1571
diff changeset
   948
    save_CFLAGS="$CFLAGS"
2292
4845eb8d4221 Merged -fvisibility detection fix from SDL 1.2 revision 3500
Sam Lantinga <slouken@libsdl.org>
parents: 2290
diff changeset
   949
    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
   950
    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
   951
    #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
   952
    #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
   953
    #endif
1573
2422ca15ba42 Added support for gcc4's -fvisibility=hidden option.
Ryan C. Gordon <icculus@icculus.org>
parents: 1571
diff changeset
   954
    ],[
2422ca15ba42 Added support for gcc4's -fvisibility=hidden option.
Ryan C. Gordon <icculus@icculus.org>
parents: 1571
diff changeset
   955
    ],[
2422ca15ba42 Added support for gcc4's -fvisibility=hidden option.
Ryan C. Gordon <icculus@icculus.org>
parents: 1571
diff changeset
   956
    have_gcc_fvisibility=yes
2422ca15ba42 Added support for gcc4's -fvisibility=hidden option.
Ryan C. Gordon <icculus@icculus.org>
parents: 1571
diff changeset
   957
    ])
2422ca15ba42 Added support for gcc4's -fvisibility=hidden option.
Ryan C. Gordon <icculus@icculus.org>
parents: 1571
diff changeset
   958
    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
   959
    CFLAGS="$save_CFLAGS"
2422ca15ba42 Added support for gcc4's -fvisibility=hidden option.
Ryan C. Gordon <icculus@icculus.org>
parents: 1571
diff changeset
   960
2422ca15ba42 Added support for gcc4's -fvisibility=hidden option.
Ryan C. Gordon <icculus@icculus.org>
parents: 1571
diff changeset
   961
    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
   962
        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
   963
    fi
2422ca15ba42 Added support for gcc4's -fvisibility=hidden option.
Ryan C. Gordon <icculus@icculus.org>
parents: 1571
diff changeset
   964
}
2422ca15ba42 Added support for gcc4's -fvisibility=hidden option.
Ryan C. Gordon <icculus@icculus.org>
parents: 1571
diff changeset
   965
2422ca15ba42 Added support for gcc4's -fvisibility=hidden option.
Ryan C. Gordon <icculus@icculus.org>
parents: 1571
diff changeset
   966
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   967
dnl Find the X11 include and library directories
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   968
CheckX11()
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   969
{
4681
5378f2d0754f Fixed some Gesture bugs
Jim Grandpre <jim.tla@gmail.com>
parents: 4669
diff changeset
   970
5378f2d0754f Fixed some Gesture bugs
Jim Grandpre <jim.tla@gmail.com>
parents: 4669
diff changeset
   971
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   972
    AC_ARG_ENABLE(video-x11,
1637
9ba366b919c7 Date: Fri, 31 Mar 2006 18:28:55 -0500
Sam Lantinga <slouken@libsdl.org>
parents: 1632
diff changeset
   973
AC_HELP_STRING([--enable-video-x11], [use X11 video driver [[default=yes]]]),
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   974
                  , enable_video_x11=yes)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   975
    if test x$enable_video = xyes -a x$enable_video_x11 = xyes; then
1806
8baf6641cd57 Added hardcoded /usr/X11R6 path so GLX detection works on Mac OS X.
Sam Lantinga <slouken@libsdl.org>
parents: 1799
diff changeset
   976
        case "$host" in
1807
Sam Lantinga <slouken@libsdl.org>
parents: 1806
diff changeset
   977
            *-*-darwin*)
Sam Lantinga <slouken@libsdl.org>
parents: 1806
diff changeset
   978
                # This isn't necessary for X11, but fixes GLX detection
1808
3e5029051a6d Only set Mac OS X default if both parameters are left default
Sam Lantinga <slouken@libsdl.org>
parents: 1807
diff changeset
   979
                if test "x$x_includes" = xNONE && test "x$x_libraries" = xNONE; then
1806
8baf6641cd57 Added hardcoded /usr/X11R6 path so GLX detection works on Mac OS X.
Sam Lantinga <slouken@libsdl.org>
parents: 1799
diff changeset
   980
                    x_includes="/usr/X11R6/include"
8baf6641cd57 Added hardcoded /usr/X11R6 path so GLX detection works on Mac OS X.
Sam Lantinga <slouken@libsdl.org>
parents: 1799
diff changeset
   981
                    x_libraries="/usr/X11R6/lib"
8baf6641cd57 Added hardcoded /usr/X11R6 path so GLX detection works on Mac OS X.
Sam Lantinga <slouken@libsdl.org>
parents: 1799
diff changeset
   982
                fi
8baf6641cd57 Added hardcoded /usr/X11R6 path so GLX detection works on Mac OS X.
Sam Lantinga <slouken@libsdl.org>
parents: 1799
diff changeset
   983
                ;;
8baf6641cd57 Added hardcoded /usr/X11R6 path so GLX detection works on Mac OS X.
Sam Lantinga <slouken@libsdl.org>
parents: 1799
diff changeset
   984
        esac
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   985
        AC_PATH_X
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   986
        AC_PATH_XTRA
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   987
        if test x$have_x = xyes; then
1879
cb232e63552c Default the X11 dynamically loading on if the OS loader loads libraries
Sam Lantinga <slouken@libsdl.org>
parents: 1875
diff changeset
   988
            # Only allow dynamically loaded X11 if the X11 function pointers
cb232e63552c Default the X11 dynamically loading on if the OS loader loads libraries
Sam Lantinga <slouken@libsdl.org>
parents: 1875
diff changeset
   989
            # will not end up in the global namespace, which causes problems
cb232e63552c Default the X11 dynamically loading on if the OS loader loads libraries
Sam Lantinga <slouken@libsdl.org>
parents: 1875
diff changeset
   990
            # with other libraries calling X11 functions.
cb232e63552c Default the X11 dynamically loading on if the OS loader loads libraries
Sam Lantinga <slouken@libsdl.org>
parents: 1875
diff changeset
   991
            x11_symbols_private=$have_gcc_fvisibility
cb232e63552c Default the X11 dynamically loading on if the OS loader loads libraries
Sam Lantinga <slouken@libsdl.org>
parents: 1875
diff changeset
   992
1168
045f186426e1 Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents: 1162
diff changeset
   993
            AC_ARG_ENABLE(x11-shared,
1879
cb232e63552c Default the X11 dynamically loading on if the OS loader loads libraries
Sam Lantinga <slouken@libsdl.org>
parents: 1875
diff changeset
   994
AC_HELP_STRING([--enable-x11-shared], [dynamically load X11 support [[default=maybe]]]),
cb232e63552c Default the X11 dynamically loading on if the OS loader loads libraries
Sam Lantinga <slouken@libsdl.org>
parents: 1875
diff changeset
   995
                          , enable_x11_shared=maybe)
1168
045f186426e1 Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents: 1162
diff changeset
   996
1550
31c2b8e4885e Fixed bug #166
Sam Lantinga <slouken@libsdl.org>
parents: 1548
diff changeset
   997
            case "$host" in
5471
179adad3ae6f Added support for the Xcursor library for color cursors
Sam Lantinga <slouken@libsdl.org>
parents: 5448
diff changeset
   998
                *-*-darwin*)
1879
cb232e63552c Default the X11 dynamically loading on if the OS loader loads libraries
Sam Lantinga <slouken@libsdl.org>
parents: 1875
diff changeset
   999
                    x11_symbols_private=yes
1174
8c43aceeed81 Enable dynamic X11 on Mac OS X.
Ryan C. Gordon <icculus@icculus.org>
parents: 1173
diff changeset
  1000
                    x11_lib='/usr/X11R6/lib/libX11.6.dylib'
8c43aceeed81 Enable dynamic X11 on Mac OS X.
Ryan C. Gordon <icculus@icculus.org>
parents: 1173
diff changeset
  1001
                    x11ext_lib='/usr/X11R6/lib/libXext.6.dylib'
5471
179adad3ae6f Added support for the Xcursor library for color cursors
Sam Lantinga <slouken@libsdl.org>
parents: 5448
diff changeset
  1002
                    xcursor_lib='/usr/X11R6/lib/libXcursor.1.dylib'
5408
35a63789c3f2 Dynamically load the Xinerama and xf86vmode extensions
Sam Lantinga <slouken@libsdl.org>
parents: 5389
diff changeset
  1003
                    xinerama_lib='/usr/X11R6/lib/libXinerama.1.dylib'
2763
6fc50bdd88c0 Some cleanups on the new XInput code.
Ryan C. Gordon <icculus@icculus.org>
parents: 2717
diff changeset
  1004
                    xinput_lib='/usr/X11R6/lib/libXi.6.dylib'
5408
35a63789c3f2 Dynamically load the Xinerama and xf86vmode extensions
Sam Lantinga <slouken@libsdl.org>
parents: 5389
diff changeset
  1005
                    xrandr_lib='/usr/X11R6/lib/libXrandr.2.dylib'
35a63789c3f2 Dynamically load the Xinerama and xf86vmode extensions
Sam Lantinga <slouken@libsdl.org>
parents: 5389
diff changeset
  1006
                    xrender_lib='/usr/X11R6/lib/libXrender.1.dylib'
35a63789c3f2 Dynamically load the Xinerama and xf86vmode extensions
Sam Lantinga <slouken@libsdl.org>
parents: 5389
diff changeset
  1007
                    xss_lib='/usr/X11R6/lib/libXss.1.dylib'
35a63789c3f2 Dynamically load the Xinerama and xf86vmode extensions
Sam Lantinga <slouken@libsdl.org>
parents: 5389
diff changeset
  1008
                    xvidmode_lib='/usr/X11R6/lib/libXxf86vm.1.dylib'
1174
8c43aceeed81 Enable dynamic X11 on Mac OS X.
Ryan C. Gordon <icculus@icculus.org>
parents: 1173
diff changeset
  1009
                    ;;
8c43aceeed81 Enable dynamic X11 on Mac OS X.
Ryan C. Gordon <icculus@icculus.org>
parents: 1173
diff changeset
  1010
                *)
3391
188fc5ecc58c Simplify and improve dynamic library detection, taken from SDL_image
Sam Lantinga <slouken@libsdl.org>
parents: 3390
diff changeset
  1011
                    x11_lib=[`find_lib "libX11.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_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
  1012
                    x11ext_lib=[`find_lib "libXext.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'`]
5471
179adad3ae6f Added support for the Xcursor library for color cursors
Sam Lantinga <slouken@libsdl.org>
parents: 5448
diff changeset
  1013
                    xcursor_lib=[`find_lib "libXcursor.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'`]
5408
35a63789c3f2 Dynamically load the Xinerama and xf86vmode extensions
Sam Lantinga <slouken@libsdl.org>
parents: 5389
diff changeset
  1014
                    xinerama_lib=[`find_lib "libXinerama.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'`]
3391
188fc5ecc58c Simplify and improve dynamic library detection, taken from SDL_image
Sam Lantinga <slouken@libsdl.org>
parents: 3390
diff changeset
  1015
                    xinput_lib=[`find_lib "libXi.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'`]
5408
35a63789c3f2 Dynamically load the Xinerama and xf86vmode extensions
Sam Lantinga <slouken@libsdl.org>
parents: 5389
diff changeset
  1016
                    xrandr_lib=[`find_lib "libXrandr.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'`]
35a63789c3f2 Dynamically load the Xinerama and xf86vmode extensions
Sam Lantinga <slouken@libsdl.org>
parents: 5389
diff changeset
  1017
                    xrender_lib=[`find_lib "libXrender.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'`]
3391
188fc5ecc58c Simplify and improve dynamic library detection, taken from SDL_image
Sam Lantinga <slouken@libsdl.org>
parents: 3390
diff changeset
  1018
                    xss_lib=[`find_lib "libXss.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'`]
5408
35a63789c3f2 Dynamically load the Xinerama and xf86vmode extensions
Sam Lantinga <slouken@libsdl.org>
parents: 5389
diff changeset
  1019
                    xvidmode_lib=[`find_lib "libXxf86vm.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'`]
1174
8c43aceeed81 Enable dynamic X11 on Mac OS X.
Ryan C. Gordon <icculus@icculus.org>
parents: 1173
diff changeset
  1020
                    ;;
8c43aceeed81 Enable dynamic X11 on Mac OS X.
Ryan C. Gordon <icculus@icculus.org>
parents: 1173
diff changeset
  1021
            esac
1168
045f186426e1 Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents: 1162
diff changeset
  1022
1361
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents: 1354
diff changeset
  1023
            if test x$ac_cv_func_shmat != xyes; then
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents: 1354
diff changeset
  1024
                X_CFLAGS="$X_CFLAGS -DNO_SHARED_MEMORY"
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents: 1354
diff changeset
  1025
            fi
1799
50e9cca3fe7b Fixed X11 support on Mac OS X Universal build
Sam Lantinga <slouken@libsdl.org>
parents: 1783
diff changeset
  1026
            CFLAGS="$CFLAGS $X_CFLAGS"
50e9cca3fe7b Fixed X11 support on Mac OS X Universal build
Sam Lantinga <slouken@libsdl.org>
parents: 1783
diff changeset
  1027
            LDFLAGS="$LDFLAGS $X_LIBS"
1468
fecfef92fc94 Don't put X_LIBS in the linker flags if we're dynamically loading X11
Sam Lantinga <slouken@libsdl.org>
parents: 1467
diff changeset
  1028
5548
8f0abb6ef37d Updated configure.in to be compatible with autoconf 2.67.
Ryan C. Gordon <icculus@icculus.org>
parents: 5512
diff changeset
  1029
            AC_DEFINE(SDL_VIDEO_DRIVER_X11, 1, [ ])
1468
fecfef92fc94 Don't put X_LIBS in the linker flags if we're dynamically loading X11
Sam Lantinga <slouken@libsdl.org>
parents: 1467
diff changeset
  1030
            SOURCES="$SOURCES $srcdir/src/video/x11/*.c"
1521
9b9212e4810c CFLAGS are separate from EXTRA_CFLAGS
Sam Lantinga <slouken@libsdl.org>
parents: 1520
diff changeset
  1031
            EXTRA_CFLAGS="$EXTRA_CFLAGS $X_CFLAGS"
1879
cb232e63552c Default the X11 dynamically loading on if the OS loader loads libraries
Sam Lantinga <slouken@libsdl.org>
parents: 1875
diff changeset
  1032
cb232e63552c Default the X11 dynamically loading on if the OS loader loads libraries
Sam Lantinga <slouken@libsdl.org>
parents: 1875
diff changeset
  1033
            if test x$enable_x11_shared = xmaybe; then
cb232e63552c Default the X11 dynamically loading on if the OS loader loads libraries
Sam Lantinga <slouken@libsdl.org>
parents: 1875
diff changeset
  1034
                enable_x11_shared=$x11_symbols_private
cb232e63552c Default the X11 dynamically loading on if the OS loader loads libraries
Sam Lantinga <slouken@libsdl.org>
parents: 1875
diff changeset
  1035
            fi
1173
e9cf8c1b4590 Split up src/SDL_loadso.c into platform directories.
Ryan C. Gordon <icculus@icculus.org>
parents: 1170
diff changeset
  1036
            if test x$have_loadso != xyes && \
1168
045f186426e1 Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents: 1162
diff changeset
  1037
               test x$enable_x11_shared = xyes; then
1467
b69f2b0309a0 Removed accidentally copied/pasted script for ALSA detection
Sam Lantinga <slouken@libsdl.org>
parents: 1459
diff changeset
  1038
                AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic X11 loading])
1875
4627eca2c02b Only allow dynamic X11 if gcc4 (-fvisibility=hidden) is used.
Ryan C. Gordon <icculus@icculus.org>
parents: 1871
diff changeset
  1039
                enable_x11_shared=no
1168
045f186426e1 Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents: 1162
diff changeset
  1040
            fi
1879
cb232e63552c Default the X11 dynamically loading on if the OS loader loads libraries
Sam Lantinga <slouken@libsdl.org>
parents: 1875
diff changeset
  1041
            if test x$x11_symbols_private != xyes && \
1875
4627eca2c02b Only allow dynamic X11 if gcc4 (-fvisibility=hidden) is used.
Ryan C. Gordon <icculus@icculus.org>
parents: 1871
diff changeset
  1042
               test x$enable_x11_shared = xyes; then
4627eca2c02b Only allow dynamic X11 if gcc4 (-fvisibility=hidden) is used.
Ryan C. Gordon <icculus@icculus.org>
parents: 1871
diff changeset
  1043
                AC_MSG_WARN([You must have gcc4 (-fvisibility=hidden) for dynamic X11 loading])
4627eca2c02b Only allow dynamic X11 if gcc4 (-fvisibility=hidden) is used.
Ryan C. Gordon <icculus@icculus.org>
parents: 1871
diff changeset
  1044
                enable_x11_shared=no
4627eca2c02b Only allow dynamic X11 if gcc4 (-fvisibility=hidden) is used.
Ryan C. Gordon <icculus@icculus.org>
parents: 1871
diff changeset
  1045
            fi
4627eca2c02b Only allow dynamic X11 if gcc4 (-fvisibility=hidden) is used.
Ryan C. Gordon <icculus@icculus.org>
parents: 1871
diff changeset
  1046
1173
e9cf8c1b4590 Split up src/SDL_loadso.c into platform directories.
Ryan C. Gordon <icculus@icculus.org>
parents: 1170
diff changeset
  1047
            if test x$have_loadso = xyes && \
1170
bb1a52a8d3d6 Use the right libs in dynamic X11 loading.
Ryan C. Gordon <icculus@icculus.org>
parents: 1168
diff changeset
  1048
               test x$enable_x11_shared = xyes && test x$x11_lib != x && test x$x11ext_lib != x; then
1174
8c43aceeed81 Enable dynamic X11 on Mac OS X.
Ryan C. Gordon <icculus@icculus.org>
parents: 1173
diff changeset
  1049
                echo "-- dynamic libX11 -> $x11_lib"
8c43aceeed81 Enable dynamic X11 on Mac OS X.
Ryan C. Gordon <icculus@icculus.org>
parents: 1173
diff changeset
  1050
                echo "-- dynamic libX11ext -> $x11ext_lib"
5548
8f0abb6ef37d Updated configure.in to be compatible with autoconf 2.67.
Ryan C. Gordon <icculus@icculus.org>
parents: 5512
diff changeset
  1051
                AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC, "$x11_lib", [ ])
8f0abb6ef37d Updated configure.in to be compatible with autoconf 2.67.
Ryan C. Gordon <icculus@icculus.org>
parents: 5512
diff changeset
  1052
                AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT, "$x11ext_lib", [ ])
1168
045f186426e1 Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents: 1162
diff changeset
  1053
            else
1589
34cca785be57 Xrandr support in the X11 target.
Ryan C. Gordon <icculus@icculus.org>
parents: 1588
diff changeset
  1054
                enable_x11_shared=no
2763
6fc50bdd88c0 Some cleanups on the new XInput code.
Ryan C. Gordon <icculus@icculus.org>
parents: 2717
diff changeset
  1055
                EXTRA_LDFLAGS="$EXTRA_LDFLAGS $X_LIBS -lX11 -lXext"
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
  1056
            fi
1361
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents: 1354
diff changeset
  1057
            have_video=yes
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
  1058
5471
179adad3ae6f Added support for the Xcursor library for color cursors
Sam Lantinga <slouken@libsdl.org>
parents: 5448
diff changeset
  1059
            AC_ARG_ENABLE(video-x11-xcursor,
179adad3ae6f Added support for the Xcursor library for color cursors
Sam Lantinga <slouken@libsdl.org>
parents: 5448
diff changeset
  1060
AC_HELP_STRING([--enable-video-x11-xcursor], [enable X11 Xcursor support [[default=yes]]]),
179adad3ae6f Added support for the Xcursor library for color cursors
Sam Lantinga <slouken@libsdl.org>
parents: 5448
diff changeset
  1061
                            , enable_video_x11_xcursor=yes)
179adad3ae6f Added support for the Xcursor library for color cursors
Sam Lantinga <slouken@libsdl.org>
parents: 5448
diff changeset
  1062
            if test x$enable_video_x11_xcursor = xyes; then
179adad3ae6f Added support for the Xcursor library for color cursors
Sam Lantinga <slouken@libsdl.org>
parents: 5448
diff changeset
  1063
                definitely_enable_video_x11_xcursor=no
179adad3ae6f Added support for the Xcursor library for color cursors
Sam Lantinga <slouken@libsdl.org>
parents: 5448
diff changeset
  1064
                AC_CHECK_HEADER(X11/Xcursor/Xcursor.h,
179adad3ae6f Added support for the Xcursor library for color cursors
Sam Lantinga <slouken@libsdl.org>
parents: 5448
diff changeset
  1065
                                have_xcursor_h_hdr=yes,
179adad3ae6f Added support for the Xcursor library for color cursors
Sam Lantinga <slouken@libsdl.org>
parents: 5448
diff changeset
  1066
                                have_xcursor_h_hdr=no,
179adad3ae6f Added support for the Xcursor library for color cursors
Sam Lantinga <slouken@libsdl.org>
parents: 5448
diff changeset
  1067
                                [#include <X11/Xlib.h>
179adad3ae6f Added support for the Xcursor library for color cursors
Sam Lantinga <slouken@libsdl.org>
parents: 5448
diff changeset
  1068
                                ])
179adad3ae6f Added support for the Xcursor library for color cursors
Sam Lantinga <slouken@libsdl.org>
parents: 5448
diff changeset
  1069
                if test x$have_xcursor_h_hdr = xyes; then
179adad3ae6f Added support for the Xcursor library for color cursors
Sam Lantinga <slouken@libsdl.org>
parents: 5448
diff changeset
  1070
                    if test x$enable_x11_shared = xyes && test x$xcursor_lib != x ; then
179adad3ae6f Added support for the Xcursor library for color cursors
Sam Lantinga <slouken@libsdl.org>
parents: 5448
diff changeset
  1071
                        echo "-- dynamic libXcursor -> $xcursor_lib"
5548
8f0abb6ef37d Updated configure.in to be compatible with autoconf 2.67.
Ryan C. Gordon <icculus@icculus.org>
parents: 5512
diff changeset
  1072
                        AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC_XCURSOR, "$xcursor_lib", [ ])
5471
179adad3ae6f Added support for the Xcursor library for color cursors
Sam Lantinga <slouken@libsdl.org>
parents: 5448
diff changeset
  1073
                        definitely_enable_video_x11_xcursor=yes
179adad3ae6f Added support for the Xcursor library for color cursors
Sam Lantinga <slouken@libsdl.org>
parents: 5448
diff changeset
  1074
                    else
179adad3ae6f Added support for the Xcursor library for color cursors
Sam Lantinga <slouken@libsdl.org>
parents: 5448
diff changeset
  1075
                        AC_CHECK_LIB(Xcursor, XcursorImageCreate, have_xcursor_lib=yes)
179adad3ae6f Added support for the Xcursor library for color cursors
Sam Lantinga <slouken@libsdl.org>
parents: 5448
diff changeset
  1076
                        if test x$have_xcursor_lib = xyes ; then
179adad3ae6f Added support for the Xcursor library for color cursors
Sam Lantinga <slouken@libsdl.org>
parents: 5448
diff changeset
  1077
                            EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lXcursor"
179adad3ae6f Added support for the Xcursor library for color cursors
Sam Lantinga <slouken@libsdl.org>
parents: 5448
diff changeset
  1078
                            definitely_enable_video_x11_xcursor=yes
179adad3ae6f Added support for the Xcursor library for color cursors
Sam Lantinga <slouken@libsdl.org>
parents: 5448