configure.in
author Sam Lantinga <slouken@libsdl.org>
Thu, 18 Apr 2002 04:28:58 +0000
changeset 360 8c1f8c4d2dd1
parent 354 30935e76acb5
child 371 db0cc6034336
permissions -rw-r--r--
Configure fixes from Wilbern Cobb for FreeBSD joystick support.
slouken@0
     1
dnl Process this file with autoconf to produce a configure script.
slouken@0
     2
AC_INIT(README)
slouken@0
     3
slouken@0
     4
dnl Set various version strings - taken gratefully from the GTk sources
slouken@0
     5
#
slouken@0
     6
# Making releases:
slouken@0
     7
# Edit include/SDL/SDL_version.h and change the version, then:
slouken@0
     8
#   SDL_MICRO_VERSION += 1;
slouken@0
     9
#   SDL_INTERFACE_AGE += 1;
slouken@0
    10
#   SDL_BINARY_AGE += 1;
slouken@0
    11
# if any functions have been added, set SDL_INTERFACE_AGE to 0.
slouken@0
    12
# if backwards compatibility has been broken,
slouken@0
    13
# set SDL_BINARY_AGE and SDL_INTERFACE_AGE to 0.
slouken@0
    14
#
slouken@0
    15
SDL_MAJOR_VERSION=1
slouken@0
    16
SDL_MINOR_VERSION=2
slouken@350
    17
SDL_MICRO_VERSION=5
slouken@350
    18
SDL_INTERFACE_AGE=5
slouken@350
    19
SDL_BINARY_AGE=5
slouken@0
    20
SDL_VERSION=$SDL_MAJOR_VERSION.$SDL_MINOR_VERSION.$SDL_MICRO_VERSION
slouken@0
    21
slouken@0
    22
AC_SUBST(SDL_MAJOR_VERSION)
slouken@0
    23
AC_SUBST(SDL_MINOR_VERSION)
slouken@0
    24
AC_SUBST(SDL_MICRO_VERSION)
slouken@0
    25
AC_SUBST(SDL_INTERFACE_AGE)
slouken@0
    26
AC_SUBST(SDL_BINARY_AGE)
slouken@0
    27
AC_SUBST(SDL_VERSION)
slouken@0
    28
slouken@0
    29
# libtool versioning
slouken@0
    30
LT_RELEASE=$SDL_MAJOR_VERSION.$SDL_MINOR_VERSION
slouken@0
    31
LT_CURRENT=`expr $SDL_MICRO_VERSION - $SDL_INTERFACE_AGE`
slouken@0
    32
LT_REVISION=$SDL_INTERFACE_AGE
slouken@0
    33
LT_AGE=`expr $SDL_BINARY_AGE - $SDL_INTERFACE_AGE`
slouken@0
    34
slouken@0
    35
AC_SUBST(LT_RELEASE)
slouken@0
    36
AC_SUBST(LT_CURRENT)
slouken@0
    37
AC_SUBST(LT_REVISION)
slouken@0
    38
AC_SUBST(LT_AGE)
slouken@0
    39
slouken@0
    40
dnl Detect the canonical host and target build environment
slouken@0
    41
AC_CANONICAL_HOST
slouken@0
    42
AC_CANONICAL_TARGET
slouken@0
    43
slouken@51
    44
dnl Setup for automake
slouken@51
    45
AM_INIT_AUTOMAKE(SDL, $SDL_VERSION)
slouken@51
    46
slouken@0
    47
dnl Check for tools
slouken@0
    48
slouken@0
    49
AC_LIBTOOL_WIN32_DLL
slouken@0
    50
AM_PROG_LIBTOOL
slouken@0
    51
AC_PROG_MAKE_SET
slouken@0
    52
AC_PROG_CC
slouken@0
    53
AC_C_INLINE
slouken@0
    54
AC_C_CONST
slouken@200
    55
AC_PROG_CXX
slouken@0
    56
AC_PROG_INSTALL
slouken@0
    57
AC_FUNC_ALLOCA
slouken@258
    58
ASFLAGS=""
slouken@258
    59
AC_SUBST(ASFLAGS)
slouken@0
    60
slouken@0
    61
dnl The alpha architecture needs special flags for binary portability
slouken@0
    62
case "$target" in
slouken@0
    63
    alpha*-*-linux*)
slouken@0
    64
        if test x$ac_cv_prog_gcc = xyes; then
slouken@0
    65
            CFLAGS="$CFLAGS -mcpu=ev4 -Wa,-mall"
slouken@0
    66
        fi
slouken@0
    67
        ;;
slouken@0
    68
esac
slouken@0
    69
slouken@0
    70
dnl Add compiler-specific optimization flags
slouken@0
    71
slouken@0
    72
dnl See if the user wants aggressive optimizations of the code
slouken@0
    73
AC_ARG_ENABLE(debug,
slouken@0
    74
[  --enable-debug          Disable aggressive optimizations [default=yes]],
slouken@0
    75
              , enable_debug=yes)
slouken@0
    76
if test x$enable_debug != xyes; then
slouken@0
    77
    if test x$ac_cv_prog_gcc = xyes; then
slouken@0
    78
        CFLAGS="$CFLAGS -fexpensive-optimizations"
slouken@0
    79
        # Ack! This breaks the MMX YV12 conversion on gcc 2.95.2
slouken@0
    80
        # CFLAGS="$CFLAGS -fomit-frame-pointer"
slouken@0
    81
    fi
slouken@0
    82
    case "$target" in
slouken@0
    83
        i486-*-*)
slouken@0
    84
            if test x$ac_cv_prog_gcc = xyes; then
slouken@0
    85
                CFLAGS="$CFLAGS -march=486"
slouken@0
    86
            fi
slouken@0
    87
            ;;
slouken@0
    88
        i?86-*-*)
slouken@0
    89
            if test x$ac_cv_prog_gcc = xyes; then
slouken@0
    90
                CFLAGS="$CFLAGS -march=pentium -mcpu=pentiumpro"
slouken@0
    91
            fi
slouken@0
    92
            ;;
slouken@0
    93
        *-*-osf*)
slouken@0
    94
            if test x$ac_cv_prog_gcc != xyes; then
slouken@0
    95
                CFLAGS="-g3 -fast -arch host"
slouken@0
    96
            fi
slouken@0
    97
            ;;
slouken@0
    98
    esac
slouken@0
    99
fi
slouken@0
   100
slouken@0
   101
dnl Add verbose warnings by default, and allow ANSI compliance checking
slouken@0
   102
AC_ARG_ENABLE(strict-ansi,
slouken@0
   103
[  --enable-strict-ansi    Enable strict ANSI compliance build [default=no]],
slouken@0
   104
              , enable_strict_ansi=no)
slouken@0
   105
if test x$ac_cv_prog_gcc = xyes; then
slouken@0
   106
    CFLAGS="$CFLAGS -Wall"
slouken@0
   107
    if test x$enable_strict_ansi = xyes; then
slouken@0
   108
        CFLAGS="$CFLAGS -ansi -pedantic -D_XOPEN_SOURCE"
slouken@0
   109
    fi
slouken@0
   110
fi
slouken@0
   111
slouken@0
   112
dnl Initialize the compiler and linker flags for SDL applications
slouken@0
   113
slouken@0
   114
SDL_CFLAGS=""
slouken@0
   115
SDL_LIBS="-lSDL"
slouken@0
   116
slouken@0
   117
dnl Add the math library for the new gamma correction support
slouken@0
   118
slouken@0
   119
case "$target" in
slouken@0
   120
    *-*-cygwin* | *-*-mingw32*)
slouken@0
   121
        MATHLIB=""
slouken@0
   122
        ;;
slouken@0
   123
    *-*-beos*)
slouken@0
   124
        MATHLIB=""
slouken@0
   125
        ;;
slouken@0
   126
    *-*-darwin*)
slouken@0
   127
        MATHLIB=""
slouken@0
   128
        ;;
slouken@0
   129
    *)
slouken@0
   130
        MATHLIB="-lm"
slouken@0
   131
        ;;
slouken@0
   132
esac
slouken@0
   133
SYSTEM_LIBS="$SYSTEM_LIBS $MATHLIB"
slouken@0
   134
slouken@0
   135
dnl Enable/disable various subsystems of the SDL library
slouken@0
   136
slouken@0
   137
AC_ARG_ENABLE(audio,
slouken@0
   138
[  --enable-audio          Enable the audio subsystem [default=yes]],
slouken@0
   139
              , enable_audio=yes)
slouken@0
   140
if test x$enable_audio = xyes; then
slouken@0
   141
    SDL_EXTRADIRS="$SDL_EXTRADIRS audio"
slouken@0
   142
    SDL_EXTRALIBS="$SDL_EXTRALIBS audio/libaudio.la"
slouken@0
   143
else
slouken@0
   144
    CFLAGS="$CFLAGS -DDISABLE_AUDIO"
slouken@0
   145
fi
slouken@0
   146
AC_ARG_ENABLE(video,
slouken@0
   147
[  --enable-video          Enable the video subsystem [default=yes]],
slouken@0
   148
              , enable_video=yes)
slouken@0
   149
if test x$enable_video = xyes; then
slouken@0
   150
    SDL_EXTRADIRS="$SDL_EXTRADIRS video"
slouken@0
   151
    SDL_EXTRALIBS="$SDL_EXTRALIBS video/libvideo.la"
slouken@0
   152
else
slouken@0
   153
    CFLAGS="$CFLAGS -DDISABLE_VIDEO"
slouken@0
   154
fi
slouken@0
   155
AC_ARG_ENABLE(events,
slouken@0
   156
[  --enable-events         Enable the events subsystem [default=yes]],
slouken@0
   157
              , enable_events=yes)
slouken@0
   158
if test x$enable_video = xyes -a x$enable_events = xyes; then
slouken@0
   159
    SDL_EXTRADIRS="$SDL_EXTRADIRS events"
slouken@0
   160
    SDL_EXTRALIBS="$SDL_EXTRALIBS events/libevents.la"
slouken@0
   161
else
slouken@0
   162
    CFLAGS="$CFLAGS -DDISABLE_EVENTS"
slouken@0
   163
fi
slouken@0
   164
AC_ARG_ENABLE(joystick,
slouken@0
   165
[  --enable-joystick       Enable the joystick subsystem [default=yes]],
slouken@0
   166
              , enable_joystick=yes)
slouken@0
   167
if test x$enable_joystick = xyes; then
slouken@0
   168
    SDL_EXTRADIRS="$SDL_EXTRADIRS joystick"
slouken@0
   169
    SDL_EXTRALIBS="$SDL_EXTRALIBS joystick/libjoystick.la"
slouken@0
   170
else
slouken@0
   171
    CFLAGS="$CFLAGS -DDISABLE_JOYSTICK"
slouken@0
   172
fi
slouken@0
   173
AC_ARG_ENABLE(cdrom,
slouken@0
   174
[  --enable-cdrom          Enable the cdrom subsystem [default=yes]],
slouken@0
   175
              , enable_cdrom=yes)
slouken@0
   176
if test x$enable_cdrom = xyes; then
slouken@0
   177
    SDL_EXTRADIRS="$SDL_EXTRADIRS cdrom"
slouken@0
   178
    SDL_EXTRALIBS="$SDL_EXTRALIBS cdrom/libcdrom.la"
slouken@0
   179
else
slouken@0
   180
    CFLAGS="$CFLAGS -DDISABLE_CDROM"
slouken@0
   181
fi
slouken@0
   182
AC_ARG_ENABLE(threads,
slouken@0
   183
[  --enable-threads        Enable the threading subsystem [default=yes]],
slouken@0
   184
              , enable_threads=yes)
slouken@0
   185
SDL_EXTRADIRS="$SDL_EXTRADIRS thread"
slouken@0
   186
SDL_EXTRALIBS="$SDL_EXTRALIBS thread/libthread.la"
slouken@0
   187
if test x$enable_threads != xyes; then
slouken@0
   188
    CFLAGS="$CFLAGS -DDISABLE_THREADS"
slouken@0
   189
    COPY_ARCH_SRC(src/thread, generic, SDL_systhread.c)
slouken@0
   190
    COPY_ARCH_SRC(src/thread, generic, SDL_systhread_c.h)
slouken@0
   191
    COPY_ARCH_SRC(src/thread, generic, SDL_sysmutex.c)
slouken@0
   192
    COPY_ARCH_SRC(src/thread, generic, SDL_sysmutex_c.h)
slouken@0
   193
    COPY_ARCH_SRC(src/thread, generic, SDL_syssem.c)
slouken@0
   194
    COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
slouken@0
   195
    COPY_ARCH_SRC(src/thread, generic, SDL_syscond.c)
slouken@0
   196
    COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
slouken@0
   197
fi
slouken@0
   198
AC_ARG_ENABLE(timers,
slouken@0
   199
[  --enable-timers         Enable the timer subsystem [default=yes]],
slouken@0
   200
              , enable_timers=yes)
slouken@0
   201
if test x$enable_timers = xyes; then
slouken@0
   202
    SDL_EXTRADIRS="$SDL_EXTRADIRS timer"
slouken@0
   203
    SDL_EXTRALIBS="$SDL_EXTRALIBS timer/libtimer.la"
slouken@0
   204
else
slouken@0
   205
    CFLAGS="$CFLAGS -DDISABLE_TIMERS"
slouken@0
   206
fi
slouken@0
   207
AC_ARG_ENABLE(endian,
slouken@0
   208
[  --enable-endian         Enable the endian subsystem [default=yes]],
slouken@0
   209
              , enable_endian=yes)
slouken@0
   210
if test x$enable_endian = xyes; then
slouken@0
   211
    SDL_EXTRADIRS="$SDL_EXTRADIRS endian"
slouken@0
   212
    SDL_EXTRALIBS="$SDL_EXTRALIBS endian/libendian.la"
slouken@0
   213
else
slouken@0
   214
    CFLAGS="$CFLAGS -DDISABLE_ENDIAN"
slouken@0
   215
fi
slouken@0
   216
AC_ARG_ENABLE(file,
slouken@0
   217
[  --enable-file           Enable the file subsystem [default=yes]],
slouken@0
   218
              , enable_file=yes)
slouken@0
   219
if test x$enable_file = xyes; then
slouken@0
   220
    SDL_EXTRADIRS="$SDL_EXTRADIRS file"
slouken@0
   221
    SDL_EXTRALIBS="$SDL_EXTRALIBS file/libfile.la"
slouken@0
   222
else
slouken@0
   223
    CFLAGS="$CFLAGS -DDISABLE_FILE"
slouken@0
   224
fi
slouken@0
   225
slouken@0
   226
dnl See if the OSS audio interface is supported
slouken@0
   227
CheckOSS()
slouken@0
   228
{
slouken@0
   229
    AC_ARG_ENABLE(oss,
slouken@0
   230
[  --enable-oss            support the OSS audio API [default=yes]],
slouken@0
   231
                  , enable_oss=yes)
slouken@0
   232
    if test x$enable_audio = xyes -a x$enable_oss = xyes; then
slouken@0
   233
        AC_MSG_CHECKING(for OSS audio support)
slouken@0
   234
        have_oss=no
slouken@94
   235
        if test x$have_oss != xyes; then
slouken@94
   236
            AC_TRY_COMPILE([
slouken@94
   237
              #include <sys/soundcard.h>
slouken@94
   238
            ],[
slouken@94
   239
              int arg = SNDCTL_DSP_SETFRAGMENT;
slouken@94
   240
            ],[
slouken@94
   241
            have_oss=yes
slouken@94
   242
            ])
slouken@94
   243
        fi
slouken@94
   244
        if test x$have_oss != xyes; then
slouken@94
   245
            AC_TRY_COMPILE([
slouken@94
   246
              #include <soundcard.h>
slouken@94
   247
            ],[
slouken@94
   248
              int arg = SNDCTL_DSP_SETFRAGMENT;
slouken@94
   249
            ],[
slouken@94
   250
            have_oss=yes
slouken@94
   251
            CFLAGS="$CFLAGS -DOSS_USE_SOUNDCARD_H"
slouken@94
   252
            ])
slouken@94
   253
        fi
slouken@0
   254
        AC_MSG_RESULT($have_oss)
slouken@0
   255
        if test x$have_oss = xyes; then
slouken@0
   256
            CFLAGS="$CFLAGS -DOSS_SUPPORT"
slouken@0
   257
            AUDIO_SUBDIRS="$AUDIO_SUBDIRS dsp"
slouken@0
   258
            AUDIO_DRIVERS="$AUDIO_DRIVERS dsp/libaudio_dsp.la"
slouken@0
   259
            AUDIO_SUBDIRS="$AUDIO_SUBDIRS dma"
slouken@0
   260
            AUDIO_DRIVERS="$AUDIO_DRIVERS dma/libaudio_dma.la"
slouken@0
   261
        fi
slouken@0
   262
    fi
slouken@0
   263
}
slouken@0
   264
slouken@0
   265
dnl See if the ALSA audio interface is supported
slouken@0
   266
CheckALSA()
slouken@0
   267
{
slouken@0
   268
    AC_ARG_ENABLE(alsa,
slouken@0
   269
[  --enable-alsa           support the ALSA audio API [default=yes]],
slouken@0
   270
                  , enable_alsa=yes)
slouken@0
   271
    if test x$enable_audio = xyes -a x$enable_alsa = xyes; then
slouken@354
   272
        AC_MSG_CHECKING(for ALSA audio support)
slouken@0
   273
        have_alsa=no
slouken@354
   274
        AC_TRY_COMPILE([
slouken@354
   275
          #include <alsa/asoundlib.h>
slouken@354
   276
        ],[
slouken@354
   277
          #if SND_LIB_VERSION < ((0<<16)|(9<<8)|0)
slouken@354
   278
          #error Your version of ALSA is too old
slouken@354
   279
          #endif
slouken@354
   280
          snd_pcm_t *pcm_handle;
slouken@354
   281
        ],[
slouken@354
   282
        AC_CHECK_LIB(asound, snd_pcm_open, have_alsa=yes)
slouken@354
   283
        ])
slouken@354
   284
        if test x$have_alsa = xyes; then
slouken@0
   285
            CFLAGS="$CFLAGS -DALSA_SUPPORT"
slouken@0
   286
            SYSTEM_LIBS="$SYSTEM_LIBS -lasound"
slouken@0
   287
            AUDIO_SUBDIRS="$AUDIO_SUBDIRS alsa"
slouken@0
   288
            AUDIO_DRIVERS="$AUDIO_DRIVERS alsa/libaudio_alsa.la"
slouken@354
   289
        else
slouken@354
   290
            AC_MSG_RESULT($have_alsa)
slouken@0
   291
        fi
slouken@0
   292
    fi
slouken@0
   293
}
slouken@0
   294
slouken@148
   295
dnl Check whether we want to use IRIX 6.5+ native audio or not
slouken@148
   296
CheckDMEDIA()
slouken@148
   297
{
slouken@148
   298
    if test x$enable_audio = xyes; then
slouken@148
   299
        AC_MSG_CHECKING(for dmedia audio support)
slouken@148
   300
        have_dmedia=no
slouken@148
   301
        AC_TRY_COMPILE([
slouken@148
   302
          #include <dmedia/audio.h>
slouken@148
   303
        ],[
slouken@148
   304
          ALport audio_port;
slouken@148
   305
        ],[
slouken@148
   306
        have_dmedia=yes
slouken@148
   307
        ])
slouken@148
   308
        # Set up files for the audio library
slouken@148
   309
        if test x$have_dmedia = xyes; then
slouken@148
   310
            CFLAGS="$CFLAGS -DDMEDIA_SUPPORT"
slouken@148
   311
            AUDIO_SUBDIRS="$AUDIO_SUBDIRS dmedia"
slouken@148
   312
            AUDIO_DRIVERS="$AUDIO_DRIVERS dmedia/libaudio_dmedia.la"
slouken@148
   313
            SYSTEM_LIBS="$SYSTEM_LIBS -laudio"
slouken@148
   314
        fi
slouken@148
   315
    fi
slouken@148
   316
}
slouken@148
   317
slouken@0
   318
dnl Find the ESD includes and libraries
slouken@0
   319
CheckESD()
slouken@0
   320
{
slouken@0
   321
    AC_ARG_ENABLE(esd,
slouken@0
   322
[  --enable-esd            support the Enlightened Sound Daemon [default=yes]],
slouken@0
   323
                  , enable_esd=yes)
slouken@0
   324
    if test x$enable_audio = xyes -a x$enable_esd = xyes; then
slouken@294
   325
	use_esd=no
slouken@294
   326
        AM_PATH_ESD(0.2.8, use_esd=yes)
slouken@294
   327
	if test x$use_esd = xyes; then
slouken@294
   328
            AC_ARG_ENABLE(esd-shared,
slouken@296
   329
[  --enable-esd-shared     dynamically load ESD audio support [default=no]],
slouken@296
   330
                          , enable_esd_shared=no)
slouken@294
   331
            esd_lib_spec=`echo $ESD_LIBS | sed 's/.*-L\([[^ ]]*\).*/\1\/libesd.so.*/'`
slouken@294
   332
	    esd_lib=`ls $esd_lib_spec | head -1 | sed 's/.*\/\(.*\)/\1/'`
slouken@294
   333
	    echo "-- $esd_lib_spec -> $esd_lib"
slouken@296
   334
            if test x$enable_dlopen != xyes && \
slouken@296
   335
               test x$enable_esd_shared = xyes; then
slouken@296
   336
                AC_MSG_ERROR([You must have dlopen() support and use the --enable-dlopen option])
slouken@296
   337
            fi
slouken@294
   338
            if test x$enable_dlopen = xyes && \
slouken@294
   339
               test x$enable_esd_shared = xyes && test x$esd_lib != x; then
slouken@294
   340
                CFLAGS="$CFLAGS -DESD_SUPPORT -DESD_DYNAMIC=\$(esd_lib) $ESD_CFLAGS"
slouken@294
   341
		AC_SUBST(esd_lib)
slouken@294
   342
            else
slouken@294
   343
                CFLAGS="$CFLAGS -DESD_SUPPORT $ESD_CFLAGS"
slouken@294
   344
                SYSTEM_LIBS="$SYSTEM_LIBS $ESD_LIBS"
slouken@294
   345
            fi
slouken@0
   346
            AUDIO_SUBDIRS="$AUDIO_SUBDIRS esd"
slouken@0
   347
            AUDIO_DRIVERS="$AUDIO_DRIVERS esd/libaudio_esd.la"
slouken@294
   348
        fi
slouken@0
   349
    fi
slouken@0
   350
}
slouken@0
   351
slouken@0
   352
CheckARTSC()
slouken@0
   353
{
slouken@0
   354
    AC_ARG_ENABLE(arts,
slouken@0
   355
[  --enable-arts           support the Analog Real Time Synthesizer [default=yes]],
slouken@0
   356
                  , enable_arts=yes)
slouken@0
   357
    if test x$enable_audio = xyes -a x$enable_arts = xyes; then
slouken@0
   358
        AC_PATH_PROG(ARTSCCONFIG, artsc-config)
slouken@0
   359
        if test x$ARTSCCONFIG = x -o x$ARTSCCONFIG = x'"$ARTSCCONFIG"'; then
slouken@0
   360
            : # arts isn't installed
slouken@0
   361
        else
slouken@0
   362
            ARTSC_CFLAGS=`$ARTSCCONFIG --cflags`
slouken@0
   363
            ARTSC_LIBS=`$ARTSCCONFIG --libs`
slouken@0
   364
            AC_MSG_CHECKING(for aRts development environment)
slouken@0
   365
            audio_arts=no
slouken@0
   366
            save_CFLAGS="$CFLAGS"
slouken@0
   367
            CFLAGS="$CFLAGS $ARTSC_CFLAGS"
slouken@0
   368
            AC_TRY_COMPILE([
slouken@0
   369
             #include <artsc.h>
slouken@0
   370
            ],[
slouken@0
   371
             arts_stream_t stream;
slouken@0
   372
            ],[
slouken@0
   373
            audio_arts=yes
slouken@0
   374
            ])
slouken@0
   375
            CFLAGS="$save_CFLAGS"
slouken@0
   376
            AC_MSG_RESULT($audio_arts)
slouken@0
   377
            if test x$audio_arts = xyes; then
slouken@294
   378
                AC_ARG_ENABLE(arts-shared,
slouken@296
   379
[  --enable-arts-shared     dynamically load aRts audio support [default=no]],
slouken@296
   380
                              , enable_arts_shared=no)
slouken@300
   381
                arts_lib_spec=`echo $ARTSC_LIBS | sed 's/.*-L\([[^ ]]*\).*/\1\/libartsc.so.*/'`
slouken@294
   382
	        arts_lib=`ls $arts_lib_spec | head -1 | sed 's/.*\/\(.*\)/\1/'`
slouken@294
   383
	        echo "-- $arts_lib_spec -> $arts_lib"
slouken@296
   384
                if test x$enable_dlopen != xyes && \
slouken@296
   385
                   test x$enable_arts_shared = xyes; then
slouken@296
   386
                    AC_MSG_ERROR([You must have dlopen() support and use the --enable-dlopen option])
slouken@296
   387
                fi
slouken@294
   388
                if test x$enable_dlopen = xyes && \
slouken@294
   389
                   test x$enable_arts_shared = xyes && test x$arts_lib != x; then
slouken@294
   390
                    CFLAGS="$CFLAGS -DARTSC_SUPPORT -DARTSC_DYNAMIC=\$(arts_lib) $ARTSC_CFLAGS"
slouken@294
   391
		    AC_SUBST(arts_lib)
slouken@294
   392
                else
slouken@294
   393
                    CFLAGS="$CFLAGS -DARTSC_SUPPORT $ARTSC_CFLAGS"
slouken@294
   394
                    SYSTEM_LIBS="$SYSTEM_LIBS $ARTSC_LIBS"
slouken@294
   395
                fi
slouken@0
   396
                AUDIO_SUBDIRS="$AUDIO_SUBDIRS arts"
slouken@0
   397
                AUDIO_DRIVERS="$AUDIO_DRIVERS arts/libaudio_arts.la"
slouken@0
   398
            fi
slouken@0
   399
        fi
slouken@0
   400
    fi
slouken@0
   401
}
slouken@0
   402
slouken@0
   403
dnl See if the NAS audio interface is supported
slouken@0
   404
CheckNAS()
slouken@0
   405
{
slouken@0
   406
    AC_ARG_ENABLE(nas,
slouken@292
   407
[  --enable-nas                  support the NAS audio API [default=yes]],
slouken@41
   408
                  , enable_nas=yes)
slouken@0
   409
    if test x$enable_audio = xyes -a x$enable_nas = xyes; then
slouken@41
   410
        AC_MSG_CHECKING(for NAS audio support)
slouken@41
   411
        have_nas=no
slouken@41
   412
        if test -r /usr/X11R6/include/audio/audiolib.h; then
slouken@41
   413
            have_nas=yes
slouken@41
   414
        fi
slouken@41
   415
        AC_MSG_RESULT($have_nas)
slouken@41
   416
        if test x$have_nas = xyes; then
slouken@41
   417
            CFLAGS="$CFLAGS -DNAS_SUPPORT"
slouken@41
   418
            SYSTEM_LIBS="$SYSTEM_LIBS -laudio -lXt"
slouken@41
   419
            AUDIO_SUBDIRS="$AUDIO_SUBDIRS nas"
slouken@41
   420
            AUDIO_DRIVERS="$AUDIO_DRIVERS nas/libaudio_nas.la"
slouken@41
   421
        fi
slouken@0
   422
    fi
slouken@0
   423
}
slouken@0
   424
slouken@68
   425
dnl rcg07142001 See if the user wants the disk writer audio driver...
slouken@68
   426
CheckDiskAudio()
slouken@68
   427
{
slouken@68
   428
    AC_ARG_ENABLE(diskaudio,
slouken@292
   429
[  --enable-diskaudio            support the disk writer audio driver [default=yes]],
slouken@86
   430
                  , enable_diskaudio=yes)
slouken@68
   431
    if test x$enable_audio = xyes -a x$enable_diskaudio = xyes; then
slouken@68
   432
        CFLAGS="$CFLAGS -DDISKAUD_SUPPORT"
slouken@68
   433
        AUDIO_SUBDIRS="$AUDIO_SUBDIRS disk"
slouken@68
   434
        AUDIO_DRIVERS="$AUDIO_DRIVERS disk/libaudio_disk.la"
slouken@68
   435
    fi
slouken@68
   436
}
slouken@68
   437
slouken@0
   438
dnl See if we can use x86 assembly blitters
slouken@212
   439
# NASM is available from: http://nasm.octium.net/
slouken@0
   440
CheckNASM()
slouken@0
   441
{
slouken@0
   442
    dnl Make sure we are running on an x86 platform
slouken@0
   443
    case $target in
slouken@0
   444
        i?86*)
slouken@0
   445
            ;;
slouken@0
   446
        *)
slouken@0
   447
        # Nope, bail early.
slouken@0
   448
            return
slouken@0
   449
            ;;
slouken@0
   450
    esac
slouken@0
   451
    dnl Check for NASM (for assembly blit routines)
slouken@0
   452
    AC_ARG_ENABLE(nasm,
slouken@0
   453
[  --enable-nasm           use nasm assembly blitters on x86 [default=yes]],
slouken@0
   454
                  , enable_nasm=yes)
slouken@0
   455
    if test x$enable_video = xyes -a x$enable_nasm = xyes; then
slouken@0
   456
        AC_PATH_PROG(NASM, nasm)
slouken@0
   457
        if test x$NASM = x -o x$NASM = x'"$NASM"'; then
slouken@0
   458
            : # nasm isn't installed
slouken@0
   459
        else
slouken@0
   460
            CFLAGS="$CFLAGS -DUSE_ASMBLIT -I$srcdir/hermes"
slouken@0
   461
            case $ARCH in
slouken@0
   462
              win32)
slouken@0
   463
                  NASMFLAGS="-f win32"
slouken@0
   464
                  ;;
slouken@360
   465
              openbsd)
slouken@360
   466
                  NASMFLAGS="-f aoutb"
slouken@360
   467
                  ;;
slouken@0
   468
              *)
slouken@0
   469
                  NASMFLAGS="-f elf"
slouken@0
   470
                  ;;
slouken@0
   471
            esac
slouken@0
   472
            AC_SUBST(NASMFLAGS)
slouken@0
   473
            CFLAGS="$CFLAGS -I\$(top_srcdir)/src/hermes"
slouken@0
   474
            SDL_EXTRADIRS="$SDL_EXTRADIRS hermes"
slouken@0
   475
            SDL_EXTRALIBS="$SDL_EXTRALIBS hermes/libhermes.la"
slouken@0
   476
        fi
slouken@0
   477
    fi
slouken@0
   478
}
slouken@0
   479
slouken@30
   480
dnl Find the nanox include and library directories
slouken@30
   481
CheckNANOX()
slouken@30
   482
{
slouken@292
   483
    AC_ARG_ENABLE(video-nanox,
slouken@292
   484
        [  --enable-video-nanox use nanox video driver [default=no]],
slouken@292
   485
        , enable_video_nanox=no)
slouken@292
   486
    AC_ARG_ENABLE(nanox-debug,  
slouken@292
   487
        [  --enable-nanox-debug print debug messages [default=no]],
slouken@292
   488
        , enable_nanox_debug=no)
slouken@292
   489
    AC_ARG_ENABLE(nanox-share-memory,  
slouken@292
   490
        [  --enable-nanox-share-memory use share memory [default=no]],
slouken@292
   491
        , enable_nanox_share_memory=no)
slouken@30
   492
slouken@292
   493
    AC_ARG_WITH(nanox_pixel_type, 
slouken@292
   494
        [  --with-nanox-pixel-type=[rgb/0888/888/565/555/332/pal]])
slouken@30
   495
slouken@292
   496
    if test x$enable_video = xyes -a x$enable_video_nanox = xyes; then
slouken@292
   497
        if test x$enable_nanox_debug = xyes; then
slouken@292
   498
            CFLAGS="$CFLAGS -DENABLE_NANOX_DEBUG"
slouken@292
   499
        fi
slouken@30
   500
slouken@292
   501
        if test x$enable_nanox_share_memory = xyes; then
slouken@292
   502
            CFLAGS="$CFLAGS -DNANOX_SHARE_MEMORY"
slouken@292
   503
        fi
slouken@30
   504
slouken@292
   505
        case "$with_nanox_pixel_type" in
slouken@292
   506
             rgb) CFLAGS="$CFLAGS -DNANOX_PIXEL_RGB" ;;
slouken@292
   507
            0888) CFLAGS="$CFLAGS -DNANOX_PIXEL_0888" ;;
slouken@292
   508
             888) CFLAGS="$CFLAGS -DNANOX_PIXEL_888"  ;;
slouken@292
   509
             565) CFLAGS="$CFLAGS -DNANOX_PIXEL_565"  ;;
slouken@292
   510
             555) CFLAGS="$CFLAGS -DNANOX_PIXEL_555"  ;;
slouken@292
   511
             332) CFLAGS="$CFLAGS -DNANOX_PIXEL_332"  ;;
slouken@292
   512
             pal) CFLAGS="$CFLAGS -DNANOX_PIXEL_PAL"  ;;
slouken@292
   513
               *) AC_MSG_ERROR([Invalid nanox_pixel_type]);;
slouken@292
   514
        esac
slouken@30
   515
slouken@292
   516
        CFLAGS="$CFLAGS $X_CFLAGS -DENABLE_NANOX"
slouken@292
   517
        SYSTEM_LIBS="$SYSTEM_LIBS -lnano-X"
slouken@292
   518
        VIDEO_SUBDIRS="$VIDEO_SUBDIRS nanox"
slouken@292
   519
        VIDEO_DRIVERS="$VIDEO_DRIVERS nanox/libvideo_nanox.la"
slouken@292
   520
    fi
slouken@30
   521
}
slouken@30
   522
slouken@0
   523
dnl Find the X11 include and library directories
slouken@0
   524
CheckX11()
slouken@0
   525
{
slouken@0
   526
    AC_ARG_ENABLE(video-x11,
slouken@0
   527
[  --enable-video-x11      use X11 video driver [default=yes]],
slouken@0
   528
                  , enable_video_x11=yes)
slouken@0
   529
    if test x$enable_video = xyes -a x$enable_video_x11 = xyes; then
slouken@0
   530
        AC_PATH_X
slouken@0
   531
        AC_PATH_XTRA
slouken@0
   532
        if test x$have_x = xyes; then
slouken@318
   533
            CFLAGS="$CFLAGS $X_CFLAGS -DENABLE_X11 -Iinclude -Isrc/video"
slouken@0
   534
            if test x$ac_cv_func_shmat != xyes; then
slouken@0
   535
                CFLAGS="$CFLAGS -DNO_SHARED_MEMORY"
slouken@0
   536
            fi
slouken@0
   537
            SYSTEM_LIBS="$SYSTEM_LIBS $X_LIBS -lX11 -lXext"
slouken@0
   538
            VIDEO_SUBDIRS="$VIDEO_SUBDIRS x11"
slouken@0
   539
            VIDEO_DRIVERS="$VIDEO_DRIVERS x11/libvideo_x11.la"
slouken@0
   540
slouken@0
   541
            AC_ARG_ENABLE(video-x11-vm,
slouken@0
   542
[  --enable-video-x11-vm   use X11 VM extension for fullscreen [default=yes]],
slouken@0
   543
                          , enable_video_x11_vm=yes)
slouken@0
   544
            if test x$enable_video_x11_vm = xyes; then
slouken@0
   545
                AC_MSG_CHECKING(for XFree86 VidMode 1.0 support)
slouken@0
   546
                video_x11_vm=no
slouken@0
   547
                AC_TRY_COMPILE([
slouken@0
   548
                 #include <X11/Xlib.h>
slouken@292
   549
                 #include <XFree86/extensions/xf86vmode.h>
slouken@0
   550
                ],[
slouken@0
   551
                ],[
slouken@0
   552
                video_x11_vm=yes
slouken@0
   553
                ])
slouken@0
   554
                AC_MSG_RESULT($video_x11_vm)
slouken@0
   555
                if test x$video_x11_vm = xyes; then
slouken@0
   556
                    CFLAGS="$CFLAGS -DXFREE86_VM"
slouken@292
   557
                    VIDEO_SUBDIRS="$VIDEO_SUBDIRS XFree86/Xxf86vm"
slouken@292
   558
                    VIDEO_DRIVERS="$VIDEO_DRIVERS XFree86/Xxf86vm/libXFree86_Xxf86vm.la"
slouken@0
   559
                    AC_MSG_CHECKING(for XFree86 VidMode gamma support)
slouken@0
   560
                    video_x11_vmgamma=no
slouken@0
   561
                    AC_TRY_COMPILE([
slouken@0
   562
                     #include <X11/Xlib.h>
slouken@292
   563
                     #include <XFree86/extensions/xf86vmode.h>
slouken@0
   564
                    ],[
slouken@292
   565
                     SDL_NAME(XF86VidModeGamma) gamma;
slouken@0
   566
                    ],[
slouken@0
   567
                    video_x11_vmgamma=yes
slouken@0
   568
                    ])
slouken@0
   569
                    AC_MSG_RESULT($video_x11_vmgamma)
slouken@0
   570
                    if test x$video_x11_vmgamma = xyes; then
slouken@0
   571
                        CFLAGS="$CFLAGS -DXFREE86_VMGAMMA"
slouken@0
   572
                    fi
slouken@0
   573
                fi
slouken@0
   574
            fi
slouken@16
   575
            AC_ARG_ENABLE(dga,
slouken@16
   576
[  --enable-dga            allow use of X11 DGA code [default=yes]],
slouken@16
   577
                          , enable_dga=yes)
slouken@0
   578
            AC_ARG_ENABLE(video-x11-dgamouse,
slouken@0
   579
[  --enable-video-x11-dgamouse  use X11 DGA for mouse events [default=yes]],
slouken@0
   580
                          , enable_video_x11_dgamouse=yes)
slouken@16
   581
            if test x$enable_dga = xyes; then
slouken@16
   582
                AC_MSG_CHECKING(for XFree86 DGA 1.0 support)
slouken@16
   583
                video_x11_dga=no
slouken@16
   584
                AC_TRY_COMPILE([
slouken@16
   585
                 #include <X11/Xlib.h>
slouken@292
   586
                 #include <XFree86/extensions/xf86dga.h>
slouken@16
   587
                ],[
slouken@16
   588
                ],[
slouken@16
   589
                video_x11_dga=yes
slouken@16
   590
                ])
slouken@16
   591
                AC_MSG_RESULT($video_x11_dga)
slouken@16
   592
                if test x$video_x11_dga = xyes; then
slouken@16
   593
                    CFLAGS="$CFLAGS -DXFREE86_DGAMOUSE"
slouken@16
   594
                    if test x$enable_video_x11_dgamouse = xyes; then
slouken@16
   595
                        CFLAGS="$CFLAGS -DDEFAULT_DGAMOUSE"
slouken@16
   596
                    fi
slouken@292
   597
                    VIDEO_SUBDIRS="$VIDEO_SUBDIRS XFree86/Xxf86dga"
slouken@292
   598
                    VIDEO_DRIVERS="$VIDEO_DRIVERS XFree86/Xxf86dga/libXFree86_Xxf86dga.la"
slouken@0
   599
                fi
slouken@0
   600
            fi
slouken@0
   601
            AC_ARG_ENABLE(video-x11-xv,
slouken@0
   602
[  --enable-video-x11-xv   use X11 XvImage extension for video [default=yes]],
slouken@0
   603
                          , enable_video_x11_xv=yes)
slouken@0
   604
            if test x$enable_video_x11_xv = xyes; then
slouken@0
   605
                AC_MSG_CHECKING(for XFree86 XvImage support)
slouken@0
   606
                video_x11_xv=no
slouken@0
   607
                AC_TRY_COMPILE([
slouken@0
   608
                 #include <X11/Xlib.h>
slouken@0
   609
                 #include <sys/ipc.h>
slouken@0
   610
                 #include <sys/shm.h>
slouken@0
   611
                 #include <X11/extensions/XShm.h>
slouken@292
   612
                 #include <XFree86/extensions/Xvlib.h>
slouken@0
   613
                ],[
slouken@292
   614
                 SDL_NAME(XvImage) *image;
slouken@0
   615
                ],[
slouken@0
   616
                video_x11_xv=yes
slouken@0
   617
                ])
slouken@0
   618
                AC_MSG_RESULT($video_x11_xv)
slouken@0
   619
                if test x$video_x11_xv = xyes; then
slouken@0
   620
                    CFLAGS="$CFLAGS -DXFREE86_XV"
slouken@292
   621
                    VIDEO_SUBDIRS="$VIDEO_SUBDIRS XFree86/Xv"
slouken@292
   622
                    VIDEO_DRIVERS="$VIDEO_DRIVERS XFree86/Xv/libXFree86_Xv.la"
slouken@0
   623
                fi
slouken@0
   624
            fi
slouken@227
   625
            AC_ARG_ENABLE(video-x11-xinerama,
slouken@227
   626
[  --enable-video-x11-xinerama   enable X11 Xinerama support [default=yes]],
slouken@227
   627
                            , enable_video_x11_xinerama=yes)
slouken@227
   628
            if test x$enable_video_x11_xinerama = xyes; then
slouken@227
   629
                AC_MSG_CHECKING(for X11 Xinerama support)
slouken@227
   630
                video_x11_xinerama=no
slouken@227
   631
                AC_TRY_COMPILE([
slouken@227
   632
                 #include <X11/Xlib.h>
slouken@292
   633
                 #include <XFree86/extensions/Xinerama.h>
slouken@227
   634
                ],[
slouken@292
   635
                 SDL_NAME(XineramaScreenInfo) *xinerama;
slouken@227
   636
                ],[
slouken@227
   637
                video_x11_xinerama=yes
slouken@227
   638
                ])
slouken@227
   639
                AC_MSG_RESULT($video_x11_xinerama)
slouken@227
   640
                if test x$video_x11_xinerama = xyes; then
slouken@227
   641
                    CFLAGS="$CFLAGS -DHAVE_XINERAMA"
slouken@292
   642
                    VIDEO_SUBDIRS="$VIDEO_SUBDIRS XFree86/Xinerama"
slouken@292
   643
                    VIDEO_DRIVERS="$VIDEO_DRIVERS XFree86/Xinerama/libXFree86_Xinerama.la"
slouken@227
   644
                fi
slouken@227
   645
            fi
slouken@242
   646
            AC_ARG_ENABLE(video-x11-xme,
slouken@242
   647
[  --enable-video-x11-xme  enable Xi Graphics XME for fullscreen [default=yes]],
slouken@242
   648
                            , enable_video_x11_xme=yes)
slouken@242
   649
            if test x$enable_video_x11_xme = xyes; then
slouken@242
   650
                AC_MSG_CHECKING(for Xi Graphics XiGMiscExtension support)
slouken@242
   651
                video_x11_xme=no
slouken@242
   652
                AC_TRY_COMPILE([
slouken@242
   653
                 #include <X11/Xlib.h>
slouken@242
   654
                 #include <X11/extensions/xme.h>
slouken@242
   655
                ],[
slouken@242
   656
                 XiGMiscResolutionInfo *resolutions;
slouken@242
   657
                ],[
slouken@242
   658
                video_x11_xme=yes
slouken@242
   659
                ])
slouken@242
   660
                AC_MSG_RESULT($video_x11_xme)
slouken@242
   661
                if test x$video_x11_xme = xyes; then
slouken@242
   662
                    CFLAGS="$CFLAGS -DHAVE_XIGXME"
slouken@242
   663
                    SYSTEM_LIBS="$SYSTEM_LIBS -lxme"
slouken@242
   664
                fi
slouken@242
   665
            fi
slouken@0
   666
        fi
slouken@0
   667
    fi
slouken@0
   668
}
slouken@279
   669
slouken@292
   670
dnl Find the X11 DGA 2.0 include and library directories
slouken@292
   671
CheckDGA()
slouken@292
   672
{
slouken@292
   673
    AC_ARG_ENABLE(video-dga,
slouken@292
   674
[  --enable-video-dga      use DGA 2.0 video driver [default=yes]],
slouken@292
   675
                  , enable_video_dga=yes)
slouken@292
   676
    if test x$video_x11_dga = xyes -a x$enable_video_dga = xyes; then
slouken@292
   677
        save_CFLAGS="$CFLAGS"; CFLAGS="$CFLAGS -Isrc/video"
slouken@292
   678
        AC_MSG_CHECKING(for XFree86 DGA 2.0 support)
slouken@292
   679
        video_x11_dga2=no
slouken@292
   680
        AC_TRY_COMPILE([
slouken@292
   681
         #include <X11/Xlib.h>
slouken@292
   682
         #include <XFree86/extensions/xf86dga.h>
slouken@292
   683
        ],[
slouken@292
   684
         SDL_NAME(XDGAEvent) xevent;
slouken@292
   685
        ],[
slouken@292
   686
        video_x11_dga2=yes
slouken@292
   687
        ])
slouken@292
   688
        AC_MSG_RESULT($video_x11_dga2)
slouken@292
   689
        if test x$video_x11_dga2 = xyes; then
slouken@292
   690
            CFLAGS="$CFLAGS -DENABLE_DGA"
slouken@292
   691
            VIDEO_SUBDIRS="$VIDEO_SUBDIRS dga"
slouken@292
   692
            VIDEO_DRIVERS="$VIDEO_DRIVERS dga/libvideo_dga.la"
slouken@292
   693
        fi
slouken@292
   694
    fi
slouken@292
   695
}
slouken@292
   696
slouken@0
   697
CheckPHOTON()
slouken@0
   698
{
slouken@0
   699
    AC_ARG_ENABLE(video-photon,
slouken@72
   700
[  --enable-video-photon   use QNX Photon video driver [default=yes]],
slouken@0
   701
                  , enable_video_photon=yes)
slouken@0
   702
    if test x$enable_video = xyes -a x$enable_video_photon = xyes; then
slouken@0
   703
        AC_MSG_CHECKING(for QNX Photon support)
slouken@0
   704
        video_photon=no
slouken@0
   705
        AC_TRY_COMPILE([
slouken@0
   706
          #include <Ph.h>
slouken@0
   707
          #include <Pt.h>
slouken@0
   708
          #include <photon/Pg.h>
slouken@0
   709
          #include <photon/PdDirect.h>
slouken@0
   710
        ],[
slouken@0
   711
         PgDisplaySettings_t *visual;
slouken@0
   712
        ],[
slouken@0
   713
        video_photon=yes
slouken@0
   714
        ])
slouken@0
   715
        AC_MSG_RESULT($video_photon)
slouken@0
   716
        if test x$video_photon = xyes; then
slouken@19
   717
            CFLAGS="$CFLAGS -DENABLE_PHOTON"
slouken@0
   718
            SYSTEM_LIBS="$SYSTEM_LIBS -lph"
slouken@0
   719
            VIDEO_SUBDIRS="$VIDEO_SUBDIRS photon"
slouken@0
   720
            VIDEO_DRIVERS="$VIDEO_DRIVERS photon/libvideo_photon.la"
slouken@279
   721
            CheckOpenGLQNX
slouken@0
   722
        fi
slouken@0
   723
    fi
slouken@0
   724
}
slouken@0
   725
slouken@0
   726
dnl Find the framebuffer console includes
slouken@0
   727
CheckFBCON()
slouken@0
   728
{
slouken@0
   729
    AC_ARG_ENABLE(video-fbcon,
slouken@0
   730
[  --enable-video-fbcon    use framebuffer console video driver [default=yes]],
slouken@0
   731
                  , enable_video_fbcon=yes)
slouken@0
   732
    if test x$enable_video = xyes -a x$enable_video_fbcon = xyes; then
slouken@0
   733
        AC_MSG_CHECKING(for framebuffer console support)
slouken@0
   734
        video_fbcon=no
slouken@0
   735
        AC_TRY_COMPILE([
slouken@0
   736
         #include <linux/fb.h>
slouken@0
   737
         #include <linux/kd.h>
slouken@0
   738
         #include <linux/keyboard.h>
slouken@0
   739
        ],[
slouken@0
   740
        ],[
slouken@0
   741
        video_fbcon=yes
slouken@0
   742
        ])
slouken@0
   743
        AC_MSG_RESULT($video_fbcon)
slouken@0
   744
        if test x$video_fbcon = xyes; then
slouken@0
   745
            CFLAGS="$CFLAGS -DENABLE_FBCON"
slouken@0
   746
            VIDEO_SUBDIRS="$VIDEO_SUBDIRS fbcon"
slouken@0
   747
            VIDEO_DRIVERS="$VIDEO_DRIVERS fbcon/libvideo_fbcon.la"
slouken@0
   748
        fi
slouken@0
   749
    fi
slouken@0
   750
}
slouken@0
   751
slouken@167
   752
dnl Find DirectFB
slouken@167
   753
CheckDirectFB()
slouken@167
   754
{
slouken@167
   755
    AC_ARG_ENABLE(video-directfb,
slouken@167
   756
[  --enable-video-directfb    use DirectFB video driver [default=yes]],
slouken@167
   757
                  , enable_video_directfb=yes)
slouken@167
   758
    if test x$enable_video = xyes -a x$enable_video_directfb = xyes; then
slouken@167
   759
        video_directfb=no
slouken@167
   760
slouken@167
   761
        AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
slouken@167
   762
        if test x$PKG_CONFIG = xno ; then
slouken@167
   763
            AC_MSG_WARN([*** pkg-config is required to build the DirectFB video driver.])
slouken@167
   764
        else
slouken@167
   765
            AC_MSG_CHECKING(for DirectFB support)
slouken@167
   766
slouken@222
   767
            if ! $PKG_CONFIG --atleast-pkgconfig-version 0.5 ; then
slouken@167
   768
                AC_MSG_ERROR([*** pkg-config too old; version 0.5 or better required.])
slouken@167
   769
            fi
slouken@167
   770
slouken@286
   771
            DIRECTFB_REQUIRED_VERSION=0.9.9
slouken@167
   772
slouken@167
   773
            if $PKG_CONFIG --atleast-version $DIRECTFB_REQUIRED_VERSION directfb ; then
slouken@167
   774
                DIRECTFB_CFLAGS=`$PKG_CONFIG --cflags directfb`
slouken@167
   775
                DIRECTFB_LIBS=`$PKG_CONFIG --libs directfb`
slouken@167
   776
                video_directfb=yes
slouken@167
   777
            fi
slouken@167
   778
        fi
slouken@167
   779
slouken@167
   780
        AC_MSG_RESULT($video_directfb)
slouken@167
   781
        if test x$video_directfb = xyes; then
slouken@167
   782
            CFLAGS="$CFLAGS -DENABLE_DIRECTFB"
slouken@167
   783
            VIDEO_SUBDIRS="$VIDEO_SUBDIRS directfb"
slouken@167
   784
            VIDEO_DRIVERS="$VIDEO_DRIVERS directfb/libvideo_directfb.la"
slouken@167
   785
slouken@167
   786
            AC_SUBST(DIRECTFB_CFLAGS)
slouken@167
   787
            AC_SUBST(DIRECTFB_LIBS)
slouken@167
   788
        fi
slouken@167
   789
    fi
slouken@167
   790
}
slouken@167
   791
slouken@70
   792
dnl See if we're running on PlayStation 2 hardware
slouken@70
   793
CheckPS2GS()
slouken@70
   794
{
slouken@72
   795
    AC_ARG_ENABLE(video-ps2gs,
slouken@72
   796
[  --enable-video-ps2gs    use PlayStation 2 GS video driver [default=yes]],
slouken@72
   797
                  , enable_video_ps2gs=yes)
slouken@70
   798
    if test x$enable_video = xyes -a x$enable_video_ps2gs = xyes; then
slouken@72
   799
        AC_MSG_CHECKING(for PlayStation 2 GS support)
slouken@70
   800
        video_ps2gs=no
slouken@70
   801
        AC_TRY_COMPILE([
slouken@70
   802
         #include <linux/ps2/dev.h>
slouken@70
   803
         #include <linux/ps2/gs.h>
slouken@70
   804
        ],[
slouken@70
   805
        ],[
slouken@70
   806
        video_ps2gs=yes
slouken@70
   807
        ])
slouken@72
   808
        AC_MSG_RESULT($video_ps2gs)
slouken@70
   809
        if test x$video_ps2gs = xyes; then
slouken@70
   810
            CFLAGS="$CFLAGS -DENABLE_PS2GS"
slouken@70
   811
            VIDEO_SUBDIRS="$VIDEO_SUBDIRS ps2gs"
slouken@70
   812
            VIDEO_DRIVERS="$VIDEO_DRIVERS ps2gs/libvideo_ps2gs.la"
slouken@70
   813
        fi
slouken@70
   814
    fi
slouken@70
   815
}
slouken@70
   816
slouken@0
   817
dnl Find the GGI includes
slouken@0
   818
CheckGGI()
slouken@0
   819
{
slouken@0
   820
    AC_ARG_ENABLE(video-ggi,
slouken@0
   821
[  --enable-video-ggi      use GGI video driver [default=no]],
slouken@0
   822
                  , enable_video_ggi=no)
slouken@0
   823
    if test x$enable_video = xyes -a x$enable_video_ggi = xyes; then
slouken@0
   824
        AC_MSG_CHECKING(for GGI support)
slouken@0
   825
        video_ggi=no
slouken@0
   826
        AC_TRY_COMPILE([
slouken@0
   827
         #include <ggi/ggi.h>
slouken@0
   828
         #include <ggi/gii.h>
slouken@0
   829
        ],[
slouken@0
   830
        ],[
slouken@0
   831
        video_ggi=yes
slouken@0
   832
        ])
slouken@0
   833
        AC_MSG_RESULT($video_ggi)
slouken@0
   834
        if test x$video_ggi = xyes; then
slouken@0
   835
            CFLAGS="$CFLAGS $X_CFLAGS -DENABLE_GGI"
slouken@0
   836
            SYSTEM_LIBS="$SYSTEM_LIBS -lggi -lgii -lgg"
slouken@0
   837
slouken@0
   838
            VIDEO_SUBDIRS="$VIDEO_SUBDIRS ggi"
slouken@0
   839
            VIDEO_DRIVERS="$VIDEO_DRIVERS ggi/libvideo_ggi.la"
slouken@0
   840
        fi
slouken@0
   841
    fi
slouken@0
   842
}
slouken@0
   843
slouken@0
   844
dnl Find the SVGAlib includes and libraries
slouken@0
   845
CheckSVGA()
slouken@0
   846
{
slouken@0
   847
    AC_ARG_ENABLE(video-svga,
slouken@0
   848
[  --enable-video-svga     use SVGAlib video driver [default=no]],
slouken@0
   849
                  , enable_video_svga=no)
slouken@0
   850
    if test x$enable_video = xyes -a x$enable_video_svga = xyes; then
slouken@0
   851
        AC_MSG_CHECKING(for SVGAlib (1.4.0+) support)
slouken@0
   852
        video_svga=no
slouken@0
   853
        AC_TRY_COMPILE([
slouken@0
   854
         #include <vga.h>
slouken@0
   855
         #include <vgamouse.h>
slouken@0
   856
         #include <vgakeyboard.h>
slouken@0
   857
        ],[
slouken@0
   858
         if ( SCANCODE_RIGHTWIN && SCANCODE_LEFTWIN ) {
slouken@0
   859
             exit(0);
slouken@0
   860
         }
slouken@0
   861
        ],[
slouken@0
   862
        video_svga=yes
slouken@0
   863
        ])
slouken@0
   864
        AC_MSG_RESULT($video_svga)
slouken@0
   865
        if test x$video_svga = xyes; then
slouken@0
   866
            CFLAGS="$CFLAGS -DENABLE_SVGALIB"
slouken@0
   867
            SYSTEM_LIBS="$SYSTEM_LIBS -lvga"
slouken@0
   868
slouken@0
   869
            VIDEO_SUBDIRS="$VIDEO_SUBDIRS svga"
slouken@0
   870
            VIDEO_DRIVERS="$VIDEO_DRIVERS svga/libvideo_svga.la"
slouken@0
   871
        fi
slouken@0
   872
    fi
slouken@0
   873
}
slouken@0
   874
slouken@75
   875
dnl Find the VGL includes and libraries
slouken@75
   876
CheckVGL()
slouken@75
   877
{
slouken@75
   878
    AC_ARG_ENABLE(video-vgl,
slouken@75
   879
[  --enable-video-vgl     use VGL video driver [default=no]],
slouken@75
   880
                  , enable_video_vgl=no)
slouken@75
   881
    if test x$enable_video = xyes -a x$enable_video_vgl = xyes; then
slouken@75
   882
        AC_MSG_CHECKING(for libVGL support)
slouken@75
   883
        video_vgl=no
slouken@75
   884
        AC_TRY_COMPILE([
slouken@75
   885
         #include <sys/fbio.h>
slouken@75
   886
         #include <sys/consio.h>
slouken@75
   887
         #include <sys/kbio.h>
slouken@75
   888
         #include <vgl.h>
slouken@75
   889
        ],[
slouken@75
   890
         VGLBitmap bitmap;
slouken@144
   891
         exit(bitmap.Bitmap);
slouken@75
   892
        ],[
slouken@75
   893
        video_vgl=yes
slouken@75
   894
        ])
slouken@75
   895
        AC_MSG_RESULT($video_vgl)
slouken@75
   896
        if test x$video_vgl = xyes; then
slouken@75
   897
            CFLAGS="$CFLAGS -DENABLE_VGL"
slouken@75
   898
            SYSTEM_LIBS="$SYSTEM_LIBS -lvgl"
slouken@75
   899
slouken@75
   900
            VIDEO_SUBDIRS="$VIDEO_SUBDIRS vgl"
slouken@75
   901
            VIDEO_DRIVERS="$VIDEO_DRIVERS vgl/libvideo_vgl.la"
slouken@75
   902
        fi
slouken@75
   903
    fi
slouken@75
   904
}
slouken@75
   905
slouken@0
   906
dnl Find the AAlib includes
slouken@0
   907
CheckAAlib()
slouken@0
   908
{
slouken@0
   909
    AC_ARG_ENABLE(video-aalib,
slouken@0
   910
[  --enable-video-aalib    use AAlib video driver [default=no]],
slouken@0
   911
                  , enable_video_aalib=no)
slouken@0
   912
    if test x$enable_video = xyes -a x$enable_video_aalib = xyes; then
slouken@0
   913
        AC_MSG_CHECKING(for AAlib support)
slouken@0
   914
        video_aalib=no
slouken@0
   915
        AC_TRY_COMPILE([
slouken@0
   916
         #include <aalib.h>
slouken@0
   917
        ],[
slouken@0
   918
        ],[
slouken@0
   919
        video_aalib=yes
slouken@0
   920
        ])
slouken@0
   921
        AC_MSG_RESULT($video_aalib)
slouken@0
   922
        if test x$video_aalib = xyes; then
slouken@0
   923
            CFLAGS="$CFLAGS -DENABLE_AALIB"
slouken@0
   924
            SYSTEM_LIBS="$SYSTEM_LIBS -laa"
slouken@0
   925
slouken@0
   926
            VIDEO_SUBDIRS="$VIDEO_SUBDIRS aalib"
slouken@0
   927
            VIDEO_DRIVERS="$VIDEO_DRIVERS aalib/libvideo_aa.la"
slouken@0
   928
        fi
slouken@0
   929
    fi
slouken@0
   930
}
slouken@0
   931
slouken@281
   932
dnl Set up the Atari Xbios driver
slouken@281
   933
CheckAtariXbiosVideo()
slouken@281
   934
{
slouken@281
   935
    AC_ARG_ENABLE(xbios,
slouken@281
   936
[  --enable-video-xbios    use Atari Xbios video driver [default=yes]],
slouken@281
   937
                  , enable_video_xbios=yes)
slouken@281
   938
    video_xbios=no
slouken@281
   939
    if test x$enable_video = xyes -a x$enable_video_xbios = xyes; then
slouken@281
   940
        video_xbios=yes
slouken@281
   941
        CFLAGS="$CFLAGS -DENABLE_XBIOS"
slouken@281
   942
        VIDEO_SUBDIRS="$VIDEO_SUBDIRS xbios"
slouken@281
   943
        VIDEO_DRIVERS="$VIDEO_DRIVERS xbios/libvideo_xbios.la"
slouken@281
   944
    fi
slouken@281
   945
}
slouken@281
   946
slouken@281
   947
dnl Set up the Atari Gem driver
slouken@281
   948
CheckAtariGemVideo()
slouken@281
   949
{
slouken@281
   950
    AC_ARG_ENABLE(gem,
slouken@281
   951
[  --enable-video-gem      use Atari Gem video driver [default=yes]],
slouken@281
   952
                  , enable_video_gem=yes)
slouken@281
   953
    if test x$enable_video = xyes -a x$enable_video_gem = xyes; then
slouken@281
   954
        video_gem=no
slouken@281
   955
        AC_CHECK_HEADER(gem.h, have_gem_hdr=yes)
slouken@281
   956
        AC_CHECK_LIB(gem, appl_init, have_gem_lib=yes)
slouken@281
   957
        if test x$have_gem_hdr = xyes -a x$have_gem_lib = xyes; then
slouken@281
   958
            video_gem=yes
slouken@281
   959
            CFLAGS="$CFLAGS -DENABLE_GEM"
slouken@281
   960
            SYSTEM_LIBS="$SYSTEM_LIBS -lgem"
slouken@281
   961
            VIDEO_SUBDIRS="$VIDEO_SUBDIRS gem"
slouken@281
   962
            VIDEO_DRIVERS="$VIDEO_DRIVERS gem/libvideo_gem.la"
slouken@281
   963
        fi
slouken@281
   964
    fi
slouken@281
   965
}
slouken@281
   966
slouken@281
   967
dnl Set up the Atari Bios keyboard driver
slouken@281
   968
CheckAtariBiosEvent()
slouken@281
   969
{
slouken@281
   970
    CFLAGS="$CFLAGS -I\$(top_srcdir)/src/video/ataricommon"
slouken@281
   971
    VIDEO_SUBDIRS="$VIDEO_SUBDIRS ataricommon"
slouken@281
   972
    VIDEO_DRIVERS="$VIDEO_DRIVERS ataricommon/libvideo_ataricommon.la"
slouken@281
   973
}
slouken@281
   974
slouken@1
   975
dnl rcg04172001 Set up the Null video driver.
slouken@1
   976
CheckDummyVideo()
slouken@1
   977
{
slouken@1
   978
    AC_ARG_ENABLE(video-dummy,
slouken@86
   979
[  --enable-video-dummy    use dummy video driver [default=yes]],
slouken@86
   980
                  , enable_video_dummy=yes)
slouken@1
   981
    if test x$enable_video_dummy = xyes; then
slouken@1
   982
      CFLAGS="$CFLAGS -DENABLE_DUMMYVIDEO"
slouken@1
   983
      VIDEO_SUBDIRS="$VIDEO_SUBDIRS dummy"
slouken@1
   984
      VIDEO_DRIVERS="$VIDEO_DRIVERS dummy/libvideo_null.la"
slouken@1
   985
    fi
slouken@1
   986
}
slouken@1
   987
slouken@0
   988
dnl Check to see if OpenGL support is desired
slouken@0
   989
AC_ARG_ENABLE(video-opengl,
slouken@0
   990
[  --enable-video-opengl   include OpenGL context creation [default=yes]],
slouken@0
   991
              , enable_video_opengl=yes)
slouken@0
   992
slouken@0
   993
dnl Find OpenGL
slouken@0
   994
CheckOpenGL()
slouken@0
   995
{
slouken@0
   996
    if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then
slouken@0
   997
        AC_MSG_CHECKING(for OpenGL (GLX) support)
slouken@0
   998
        video_opengl=no
slouken@0
   999
        AC_TRY_COMPILE([
slouken@0
  1000
         #include <GL/gl.h>
slouken@0
  1001
         #include <GL/glx.h>
slouken@0
  1002
         #include <dlfcn.h> /* For loading extensions */
slouken@0
  1003
        ],[
slouken@0
  1004
        ],[
slouken@0
  1005
        video_opengl=yes
slouken@0
  1006
        ])
slouken@0
  1007
        AC_MSG_RESULT($video_opengl)
slouken@0
  1008
        if test x$video_opengl = xyes; then
slouken@0
  1009
            CFLAGS="$CFLAGS -DHAVE_OPENGL"
slouken@296
  1010
            if test x$use_dlopen != xyes; then
slouken@296
  1011
                AC_CHECK_LIB(dl, dlopen, SYSTEM_LIBS="$SYSTEM_LIBS -ldl")
slouken@296
  1012
            fi
slouken@0
  1013
        fi
slouken@0
  1014
    fi
slouken@0
  1015
}
slouken@0
  1016
slouken@279
  1017
dnl Find QNX RtP OpenGL
slouken@279
  1018
CheckOpenGLQNX()
slouken@279
  1019
{
slouken@279
  1020
    if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then
slouken@279
  1021
        AC_MSG_CHECKING(for OpenGL (Photon) support)
slouken@279
  1022
        video_opengl=no
slouken@279
  1023
        AC_TRY_COMPILE([
slouken@279
  1024
         #include <GL/gl.h>
slouken@279
  1025
        ],[
slouken@279
  1026
        ],[
slouken@279
  1027
        video_opengl=yes
slouken@279
  1028
        ])
slouken@279
  1029
        AC_MSG_RESULT($video_opengl)
slouken@279
  1030
        if test x$video_opengl = xyes; then
slouken@279
  1031
            CFLAGS="$CFLAGS -DHAVE_OPENGL"
slouken@279
  1032
            SYSTEM_LIBS="$SYSTEM_LIBS -lGL"
slouken@279
  1033
        fi
slouken@279
  1034
    fi
slouken@279
  1035
}
slouken@279
  1036
slouken@0
  1037
dnl Check for BeOS OpenGL
slouken@0
  1038
CheckBeGL()
slouken@0
  1039
{
slouken@0
  1040
    if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then
slouken@0
  1041
        CFLAGS="$CFLAGS -DHAVE_OPENGL"
slouken@0
  1042
        SYSTEM_LIBS="$SYSTEM_LIBS -lGL"
slouken@0
  1043
    fi
slouken@0
  1044
}
slouken@0
  1045
slouken@0
  1046
dnl Check for MacOS OpenGL
slouken@0
  1047
CheckMacGL()
slouken@0
  1048
{
slouken@0
  1049
    if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then
slouken@0
  1050
        CFLAGS="$CFLAGS -DHAVE_OPENGL"
slouken@0
  1051
        case "$target" in
slouken@0
  1052
            *-*-darwin*)
slouken@0
  1053
                SDL_LIBS="$SDL_LIBS -framework OpenGL -framework AGL"
slouken@0
  1054
        esac
slouken@0
  1055
    fi
slouken@0
  1056
}
slouken@0
  1057
slouken@0
  1058
dnl See if we can use the new unified event interface in Linux 2.4
slouken@0
  1059
CheckInputEvents()
slouken@0
  1060
{
slouken@0
  1061
    dnl Check for Linux 2.4 unified input event interface support
slouken@0
  1062
    AC_ARG_ENABLE(input-events,
slouken@211
  1063
[  --enable-input-events   use Linux 2.4 unified input interface [default=yes]],
slouken@211
  1064
                  , enable_input_events=yes)
slouken@0
  1065
    if test x$enable_input_events = xyes; then
slouken@0
  1066
        AC_MSG_CHECKING(for Linux 2.4 unified input interface)
slouken@0
  1067
        use_input_events=no
slouken@0
  1068
        AC_TRY_COMPILE([
slouken@0
  1069
          #include <linux/input.h>
slouken@0
  1070
        ],[
slouken@0
  1071
          #ifndef EVIOCGNAME
slouken@0
  1072
          #error EVIOCGNAME() ioctl not available
slouken@0
  1073
          #endif
slouken@0
  1074
        ],[
slouken@0
  1075
        use_input_events=yes
slouken@0
  1076
        ])
slouken@0
  1077
        AC_MSG_RESULT($use_input_events)
slouken@0
  1078
        if test x$use_input_events = xyes; then
slouken@0
  1079
            CFLAGS="$CFLAGS -DUSE_INPUT_EVENTS"
slouken@0
  1080
        fi
slouken@0
  1081
    fi
slouken@0
  1082
}
slouken@0
  1083
slouken@0
  1084
dnl See what type of thread model to use on Linux and Solaris
slouken@0
  1085
CheckPTHREAD()
slouken@0
  1086
{
slouken@0
  1087
    dnl Check for pthread support
slouken@0
  1088
    AC_ARG_ENABLE(pthreads,
slouken@0
  1089
[  --enable-pthreads       use POSIX threads for multi-threading [default=yes]],
slouken@0
  1090
                  , enable_pthreads=yes)
slouken@0
  1091
    dnl This is used on Linux for glibc binary compatibility (Doh!)
slouken@0
  1092
    AC_ARG_ENABLE(pthread-sem,
slouken@86
  1093
[  --enable-pthread-sem    use pthread semaphores [default=yes]],
slouken@0
  1094
                  , enable_pthread_sem=yes)
slouken@0
  1095
    ac_save_libs="$LIBS"
slouken@0
  1096
    case "$target" in
slouken@0
  1097
        *-*-bsdi*)
slouken@0
  1098
            pthread_cflags="-D_REENTRANT -D_THREAD_SAFE"
slouken@0
  1099
            pthread_lib=""
slouken@0
  1100
            ;;
slouken@0
  1101
        *-*-darwin*)
slouken@0
  1102
            pthread_cflags="-D_THREAD_SAFE"
slouken@0
  1103
# causes Carbon.p complaints?
slouken@0
  1104
#            pthread_cflags="-D_REENTRANT -D_THREAD_SAFE"
slouken@0
  1105
            ;;
slouken@0
  1106
        *-*-freebsd*)
slouken@0
  1107
            pthread_cflags="-D_REENTRANT -D_THREAD_SAFE"
slouken@0
  1108
            pthread_lib="-pthread"
slouken@0
  1109
            ;;
slouken@43
  1110
        *-*-netbsd*)
slouken@43
  1111
            pthread_cflags="-I/usr/pkg/include -D_REENTRANT"
slouken@43
  1112
            pthread_lib="-L/usr/pkg/lib -lpthread -lsem"
slouken@43
  1113
            ;;
slouken@0
  1114
        *-*-openbsd*)
slouken@0
  1115
            pthread_cflags="-D_REENTRANT"
slouken@0
  1116
            pthread_lib="-pthread"
slouken@0
  1117
            ;;
slouken@0
  1118
        *-*-solaris*)
slouken@0
  1119
            pthread_cflags="-D_REENTRANT"
slouken@0
  1120
            pthread_lib="-lpthread -lposix4"
slouken@0
  1121
            ;;
slouken@0
  1122
        *-*-sysv5*)
slouken@0
  1123
            pthread_cflags="-D_REENTRANT -Kthread"
slouken@0
  1124
            pthread_lib=""
slouken@0
  1125
            ;;
slouken@0
  1126
        *-*-irix*)
slouken@0
  1127
            pthread_cflags="-D_SGI_MP_SOURCE"
slouken@0
  1128
            pthread_lib="-lpthread"
slouken@0
  1129
            ;;
slouken@0
  1130
        *-*-aix*)
slouken@0
  1131
            pthread_cflags="-D_REENTRANT -mthreads"
slouken@0
  1132
            pthread_lib="-lpthread"
slouken@0
  1133
            ;;
slouken@0
  1134
        *-*-qnx*)
slouken@0
  1135
            pthread_cflags=""
slouken@0
  1136
            pthread_lib=""
slouken@0
  1137
            ;;
slouken@0
  1138
        *)
slouken@0
  1139
            pthread_cflags="-D_REENTRANT"
slouken@0
  1140
            pthread_lib="-lpthread"
slouken@0
  1141
            ;;
slouken@0
  1142
    esac
slouken@0
  1143
    LIBS="$LIBS $pthread_lib"
slouken@0
  1144
    if test x$enable_threads = xyes -a x$enable_pthreads = xyes; then
slouken@0
  1145
        AC_MSG_CHECKING(for pthreads)
slouken@0
  1146
        use_pthreads=no
slouken@0
  1147
        AC_TRY_LINK([
slouken@0
  1148
         #include <pthread.h>
slouken@0
  1149
        ],[
slouken@0
  1150
         pthread_attr_t type;
slouken@0
  1151
         pthread_attr_init(&type);
slouken@0
  1152
        ],[
slouken@0
  1153
        use_pthreads=yes
slouken@0
  1154
        ])
slouken@0
  1155
        AC_MSG_RESULT($use_pthreads)
slouken@0
  1156
        if test x$use_pthreads = xyes; then
slouken@0
  1157
            CFLAGS="$CFLAGS $pthread_cflags -DSDL_USE_PTHREADS"
slouken@0
  1158
            SDL_CFLAGS="$SDL_CFLAGS $pthread_cflags"
slouken@0
  1159
            SDL_LIBS="$SDL_LIBS $pthread_lib"
slouken@0
  1160
slouken@0
  1161
            # Check to see if recursive mutexes are available
slouken@0
  1162
            AC_MSG_CHECKING(for recursive mutexes)
slouken@0
  1163
            has_recursive_mutexes=no
slouken@0
  1164
            AC_TRY_LINK([
slouken@0
  1165
              #include <pthread.h>
slouken@0
  1166
            ],[
slouken@0
  1167
              pthread_mutexattr_t attr;
slouken@0
  1168
              #ifdef linux
slouken@0
  1169
              pthread_mutexattr_setkind_np(&attr, PTHREAD_MUTEX_RECURSIVE_NP);
slouken@0
  1170
              #else
slouken@0
  1171
              pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
slouken@0
  1172
              #endif
slouken@0
  1173
            ],[
slouken@0
  1174
            has_recursive_mutexes=yes
slouken@0
  1175
            ])
slouken@0
  1176
            # Some systems have broken recursive mutex implementations
slouken@0
  1177
            case "$target" in
slouken@0
  1178
                *-*-solaris*)
slouken@0
  1179
                    has_recursive_mutexes=no
slouken@0
  1180
                    ;;
slouken@0
  1181
            esac
slouken@0
  1182
            AC_MSG_RESULT($has_recursive_mutexes)
slouken@0
  1183
            if test x$has_recursive_mutexes != xyes; then
slouken@0
  1184
                CFLAGS="$CFLAGS -DPTHREAD_NO_RECURSIVE_MUTEX"
slouken@0
  1185
            fi
slouken@0
  1186
slouken@94
  1187
            # Check to see if pthread semaphore support is missing
slouken@94
  1188
            if test x$enable_pthread_sem = xyes; then
slouken@94
  1189
                AC_MSG_CHECKING(for pthread semaphores)
slouken@94
  1190
                have_pthread_sem=no
slouken@94
  1191
                AC_TRY_COMPILE([
slouken@94
  1192
                  #include <pthread.h>
slouken@94
  1193
                  #include <semaphore.h>
slouken@94
  1194
                ],[
slouken@94
  1195
                ],[
slouken@94
  1196
                have_pthread_sem=yes
slouken@94
  1197
                ])
slouken@94
  1198
                AC_MSG_RESULT($have_pthread_sem)
slouken@94
  1199
            fi
slouken@94
  1200
slouken@0
  1201
            # Check to see if this is broken glibc 2.0 pthreads
slouken@0
  1202
            case "$target" in
slouken@0
  1203
                *-*-linux*)
slouken@0
  1204
                    AC_MSG_CHECKING(for broken glibc 2.0 pthreads)
slouken@0
  1205
                    glibc20_pthreads=no
slouken@0
  1206
                    AC_TRY_COMPILE([
slouken@0
  1207
                      #include <features.h>
slouken@0
  1208
                      #if (__GLIBC__ == 2) && (__GLIBC_MINOR__ == 0)
slouken@0
  1209
                      #warning Working around a bug in glibc 2.0 pthreads
slouken@0
  1210
                      #else
slouken@0
  1211
                      #error pthread implementation okay
slouken@0
  1212
                      #endif /* glibc 2.0 */
slouken@0
  1213
                    ],[
slouken@0
  1214
                    ],[
slouken@0
  1215
                    glibc20_pthreads=yes
slouken@0
  1216
                    ])
slouken@0
  1217
                    AC_MSG_RESULT($glibc20_pthreads)
slouken@0
  1218
            esac
slouken@0
  1219
        fi
slouken@0
  1220
    fi
slouken@0
  1221
    LIBS="$ac_save_libs"
slouken@0
  1222
slouken@0
  1223
    AC_MSG_CHECKING(whether semun is defined in /usr/include/sys/sem.h)
slouken@0
  1224
    have_semun=no
slouken@0
  1225
    AC_TRY_COMPILE([
slouken@0
  1226
      #include <sys/types.h>
slouken@0
  1227
      #include <sys/sem.h>
slouken@0
  1228
    ],[
slouken@0
  1229
      union semun t;
slouken@0
  1230
    ],[
slouken@0
  1231
    have_semun=yes
slouken@0
  1232
    ])
slouken@0
  1233
    AC_MSG_RESULT($have_semun)
slouken@0
  1234
    if test x$have_semun = xyes; then
slouken@0
  1235
        CFLAGS="$CFLAGS -DHAVE_SEMUN"
slouken@0
  1236
    fi
slouken@0
  1237
slouken@0
  1238
    # See if we can use clone() on Linux directly
slouken@0
  1239
    use_clone=no
slouken@0
  1240
    if test x$enable_threads = xyes -a x$use_pthreads != xyes; then
slouken@0
  1241
        case "$target" in
slouken@0
  1242
            *-*-linux*)
slouken@0
  1243
                use_clone=yes
slouken@0
  1244
                ;;
slouken@0
  1245
            *)
slouken@0
  1246
                CFLAGS="$CFLAGS -DFORK_HACK"
slouken@0
  1247
                ;;
slouken@0
  1248
        esac
slouken@0
  1249
    fi
slouken@0
  1250
    AM_CONDITIONAL(USE_CLONE, test x$use_clone = xyes)
slouken@0
  1251
}
slouken@0
  1252
slouken@185
  1253
dnl See if we can use GNU pth library for threads
slouken@185
  1254
CheckPTH()
slouken@185
  1255
{
slouken@185
  1256
    dnl Check for pth support
slouken@185
  1257
    AC_ARG_ENABLE(pth,
slouken@185
  1258
[  --enable-pth            use GNU pth library for multi-threading [default=yes]],
slouken@185
  1259
                  , enable_pth=yes)
slouken@185
  1260
    if test x$enable_threads = xyes -a x$enable_pth = xyes; then
slouken@185
  1261
        AC_PATH_PROG(PTH_CONFIG, pth-config, no)
slouken@185
  1262
        if test "$PTH_CONFIG" = "no"; then
slouken@185
  1263
            use_pth=no
slouken@185
  1264
        else
slouken@185
  1265
            PTH_CFLAGS=`$PTH_CONFIG --cflags`
slouken@321
  1266
            PTH_LIBS=`$PTH_CONFIG --libs --all`
slouken@185
  1267
            SDL_CFLAGS="$SDL_CFLAGS $PTH_CFLAGS"
slouken@185
  1268
            SDL_LIBS="$SDL_LIBS $PTH_LIBS"
slouken@329
  1269
            CFLAGS="$CFLAGS -DENABLE_PTH"
slouken@185
  1270
            use_pth=yes
slouken@185
  1271
        fi
slouken@185
  1272
        AC_MSG_CHECKING(pth)
slouken@185
  1273
        if test "x$use_pth" = xyes; then
slouken@185
  1274
            AC_MSG_RESULT(yes)
slouken@185
  1275
        else
slouken@185
  1276
            AC_MSG_RESULT(no)
slouken@185
  1277
        fi
slouken@185
  1278
    fi
slouken@185
  1279
}
slouken@185
  1280
slouken@0
  1281
dnl Determine whether the compiler can produce Win32 executables
slouken@0
  1282
CheckWIN32()
slouken@0
  1283
{
slouken@0
  1284
    AC_MSG_CHECKING(Win32 compiler)
slouken@0
  1285
    have_win32_gcc=no
slouken@0
  1286
    AC_TRY_COMPILE([
slouken@0
  1287
     #include <windows.h>
slouken@0
  1288
    ],[
slouken@0
  1289
    ],[
slouken@0
  1290
    have_win32_gcc=yes
slouken@0
  1291
    ])
slouken@0
  1292
    AC_MSG_RESULT($have_win32_gcc)
slouken@0
  1293
    if test x$have_win32_gcc != xyes; then
slouken@0
  1294
       AC_MSG_ERROR([
slouken@0
  1295
*** Your compiler ($CC) does not produce Win32 executables!
slouken@0
  1296
       ])
slouken@0
  1297
    fi
slouken@0
  1298
slouken@0
  1299
    dnl See if the user wants to redirect standard output to files
slouken@0
  1300
    AC_ARG_ENABLE(stdio-redirect,
slouken@0
  1301
[  --enable-stdio-redirect Redirect STDIO to files on Win32 [default=yes]],
slouken@0
  1302
                  , enable_stdio_redirect=yes)
slouken@0
  1303
    if test x$enable_stdio_redirect != xyes; then
slouken@0
  1304
        CFLAGS="$CFLAGS -DNO_STDIO_REDIRECT"
slouken@0
  1305
    fi
slouken@0
  1306
}
slouken@0
  1307
slouken@0
  1308
dnl Find the DirectX includes and libraries
slouken@0
  1309
CheckDIRECTX()
slouken@0
  1310
{
slouken@0
  1311
    AC_ARG_ENABLE(directx,
slouken@0
  1312
[  --enable-directx        use DirectX for Win32 audio/video [default=yes]],
slouken@0
  1313
                  , enable_directx=yes)
slouken@0
  1314
    if test x$enable_directx = xyes; then
slouken@0
  1315
        AC_MSG_CHECKING(for DirectX headers and libraries)
slouken@0
  1316
        use_directx=no
slouken@0
  1317
        AC_TRY_COMPILE([
slouken@0
  1318
         #include "src/video/windx5/directx.h"
slouken@0
  1319
        ],[
slouken@0
  1320
        ],[
slouken@0
  1321
        use_directx=yes
slouken@0
  1322
        ])
slouken@0
  1323
        AC_MSG_RESULT($use_directx)
slouken@0
  1324
    fi
slouken@0
  1325
    AM_CONDITIONAL(USE_DIRECTX, test x$use_directx = xyes)
slouken@0
  1326
slouken@0
  1327
    CFLAGS="$CFLAGS -I\$(top_srcdir)/src/video/wincommon"
slouken@0
  1328
    SYSTEM_LIBS="$SYSTEM_LIBS -luser32 -lgdi32 -lwinmm"
slouken@0
  1329
    VIDEO_SUBDIRS="$VIDEO_SUBDIRS wincommon"
slouken@0
  1330
    VIDEO_DRIVERS="$VIDEO_DRIVERS wincommon/libvideo_wincommon.la"
slouken@0
  1331
    # Enable the DIB driver
slouken@0
  1332
    CFLAGS="$CFLAGS -DENABLE_WINDIB"
slouken@0
  1333
    VIDEO_SUBDIRS="$VIDEO_SUBDIRS windib"
slouken@0
  1334
    VIDEO_DRIVERS="$VIDEO_DRIVERS windib/libvideo_windib.la"
slouken@0
  1335
    # See if we should enable the DirectX driver
slouken@0
  1336
    if test x$use_directx = xyes; then
slouken@0
  1337
        CFLAGS="$CFLAGS -DENABLE_DIRECTX"
slouken@0
  1338
        SYSTEM_LIBS="$SYSTEM_LIBS -ldxguid"
slouken@0
  1339
        VIDEO_SUBDIRS="$VIDEO_SUBDIRS windx5"
slouken@0
  1340
        VIDEO_DRIVERS="$VIDEO_DRIVERS windx5/libvideo_windx5.la"
slouken@0
  1341
    fi
slouken@0
  1342
}
slouken@0
  1343
slouken@0
  1344
dnl Set up the BWindow video driver on BeOS
slouken@0
  1345
CheckBWINDOW()
slouken@0
  1346
{
slouken@0
  1347
    CFLAGS="$CFLAGS -DENABLE_BWINDOW"
slouken@0
  1348
    VIDEO_SUBDIRS="$VIDEO_SUBDIRS bwindow"
slouken@0
  1349
    VIDEO_DRIVERS="$VIDEO_DRIVERS bwindow/libvideo_bwindow.la"
slouken@0
  1350
}
slouken@0
  1351
slouken@0
  1352
dnl Set up the Mac toolbox video driver for Mac OS 7-9
slouken@0
  1353
CheckTOOLBOX()
slouken@0
  1354
{
slouken@0
  1355
    VIDEO_SUBDIRS="$VIDEO_SUBDIRS maccommon"
slouken@0
  1356
    VIDEO_DRIVERS="$VIDEO_DRIVERS maccommon/libvideo_maccommon.la"
slouken@0
  1357
    VIDEO_SUBDIRS="$VIDEO_SUBDIRS macrom"
slouken@0
  1358
    VIDEO_DRIVERS="$VIDEO_DRIVERS macrom/libvideo_macrom.la"
slouken@0
  1359
}
slouken@0
  1360
slouken@0
  1361
dnl Set up the Mac toolbox video driver for Mac OS X
slouken@0
  1362
CheckCARBON()
slouken@0
  1363
{
slouken@0
  1364
    # "MACOSX" is not an official definition, but it's commonly
slouken@0
  1365
    # accepted as a way to differentiate between what runs on X
slouken@0
  1366
    # and what runs on older Macs - while in theory "Carbon" defns
slouken@0
  1367
    # are consistent between the two, in practice Carbon is still
slouken@0
  1368
    # changing. -sts Aug 2000
slouken@0
  1369
    mac_autoconf_target_workaround="MAC"
slouken@0
  1370
    CFLAGS="$CFLAGS -I/System/Library/Frameworks/Carbon.framework/Headers \
slouken@0
  1371
      -fpascal-strings -DENABLE_TOOLBOX -DMACOSX -DTARGET_API_${mac_autoconf_target_workaround}_CARBON=1 -I\$(top_srcdir)/src/video/maccommon -I\$(top_srcdir)/src/video/macrom -I\$(top_srcdir)/src/video/macdsp"
slouken@0
  1372
    VIDEO_SUBDIRS="$VIDEO_SUBDIRS maccommon"
slouken@0
  1373
    VIDEO_DRIVERS="$VIDEO_DRIVERS maccommon/libvideo_maccommon.la"
slouken@0
  1374
    VIDEO_SUBDIRS="$VIDEO_SUBDIRS macrom"
slouken@0
  1375
    VIDEO_DRIVERS="$VIDEO_DRIVERS macrom/libvideo_macrom.la"
slouken@0
  1376
}
slouken@0
  1377
slouken@158
  1378
dnl Set up the Mac toolbox video driver for Mac OS X
slouken@158
  1379
CheckQUARTZ()
slouken@158
  1380
{
slouken@158
  1381
    # "MACOSX" is not an official definition, but it's commonly
slouken@158
  1382
    # accepted as a way to differentiate between what runs on X
slouken@158
  1383
    # and what runs on older Macs - while in theory "Carbon" defns
slouken@158
  1384
    # are consistent between the two, in practice Carbon is still
slouken@158
  1385
    # changing. -sts Aug 2000
slouken@166
  1386
    mac_autoconf_target_workaround="MAC"
slouken@158
  1387
    CFLAGS="$CFLAGS -I/System/Library/Frameworks/Carbon.framework/Headers \
slouken@158
  1388
      -I/System/Library/Frameworks/Cocoa.framework/Headers -fpascal-strings \
slouken@166
  1389
      -DENABLE_QUARTZ -DMACOSX -DTARGET_API_${mac_autoconf_target_workaround}_CARBON=1 -I\$(top_srcdir)/src/video/quartz"
slouken@158
  1390
    VIDEO_SUBDIRS="$VIDEO_SUBDIRS quartz"
slouken@158
  1391
    VIDEO_DRIVERS="$VIDEO_DRIVERS quartz/libvideo_quartz.la"
slouken@158
  1392
}
slouken@158
  1393
slouken@294
  1394
dnl Check for the dlfcn.h interface for dynamically loading objects
slouken@294
  1395
CheckDLOPEN()
slouken@294
  1396
{
slouken@294
  1397
    AC_ARG_ENABLE(dlopen,
slouken@296
  1398
[  --enable-dlopen         use dlopen for shared object loading [default=no]],
slouken@296
  1399
                  , enable_dlopen=no)
slouken@294
  1400
    if test x$enable_dlopen = xyes; then
slouken@294
  1401
        AC_MSG_CHECKING(for dlopen)
slouken@294
  1402
        use_dlopen=no
slouken@294
  1403
        AC_TRY_COMPILE([
slouken@294
  1404
         #include <dlfcn.h>
slouken@294
  1405
        ],[
slouken@294
  1406
        ],[
slouken@294
  1407
        use_dlopen=yes
slouken@294
  1408
        ])
slouken@294
  1409
        AC_MSG_RESULT($use_dlopen)
slouken@294
  1410
slouken@294
  1411
        if test x$use_dlopen = xyes; then
slouken@294
  1412
            CFLAGS="$CFLAGS -DUSE_DLOPEN"
slouken@296
  1413
            AC_CHECK_LIB(dl, dlopen, SYSTEM_LIBS="$SYSTEM_LIBS -ldl")
slouken@294
  1414
        fi
slouken@294
  1415
    fi
slouken@294
  1416
}
slouken@294
  1417
slouken@0
  1418
case "$target" in
slouken@0
  1419
    *-*-linux*)
slouken@0
  1420
        ARCH=linux
slouken@1
  1421
        CheckDummyVideo
slouken@68
  1422
        CheckDiskAudio
slouken@294
  1423
	CheckDLOPEN
slouken@0
  1424
        CheckNASM
slouken@0
  1425
        CheckOSS
slouken@0
  1426
        CheckALSA
slouken@0
  1427
        CheckARTSC
slouken@0
  1428
        CheckESD
slouken@0
  1429
        CheckNAS
slouken@0
  1430
        CheckX11
slouken@30
  1431
        CheckNANOX
slouken@0
  1432
        CheckDGA
slouken@0
  1433
        CheckFBCON
slouken@167
  1434
        CheckDirectFB
slouken@70
  1435
        CheckPS2GS
slouken@0
  1436
        CheckGGI
slouken@0
  1437
        CheckSVGA
slouken@0
  1438
        CheckAAlib
slouken@0
  1439
        CheckOpenGL
slouken@0
  1440
        CheckInputEvents
slouken@0
  1441
        CheckPTHREAD
slouken@0
  1442
        # Set up files for the main() stub
slouken@0
  1443
        COPY_ARCH_SRC(src/main, linux, SDL_main.c)
slouken@0
  1444
        # Set up files for the audio library
slouken@0
  1445
        # We use the OSS and ALSA API's, not the Sun audio API
slouken@0
  1446
        #if test x$enable_audio = xyes; then
slouken@148
  1447
        #    CFLAGS="$CFLAGS -DSUNAUDIO_SUPPORT"
slouken@0
  1448
        #    AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun"
slouken@0
  1449
        #    AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la"
slouken@0
  1450
        #fi
slouken@0
  1451
        # Set up files for the joystick library
slouken@0
  1452
        if test x$enable_joystick = xyes; then
slouken@0
  1453
            JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS linux"
slouken@0
  1454
            JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS linux/libjoystick_linux.la"
slouken@0
  1455
        fi
slouken@0
  1456
        # Set up files for the cdrom library
slouken@0
  1457
        if test x$enable_cdrom = xyes; then
slouken@153
  1458
            CDROM_SUBDIRS="$CDROM_SUBDIRS linux"
slouken@153
  1459
            CDROM_DRIVERS="$CDROM_DRIVERS linux/libcdrom_linux.la"
slouken@0
  1460
        fi
slouken@0
  1461
        # Set up files for the thread library
slouken@0
  1462
        if test x$enable_threads = xyes; then
slouken@0
  1463
            if test x$use_pthreads != xyes; then
slouken@0
  1464
                COPY_ARCH_SRC(src/thread, linux, clone.S)
slouken@0
  1465
            fi
slouken@0
  1466
            COPY_ARCH_SRC(src/thread, linux, SDL_systhread.c)
slouken@0
  1467
            COPY_ARCH_SRC(src/thread, linux, SDL_systhread_c.h)
slouken@94
  1468
            if test x$use_pthreads = xyes -a x$have_pthread_sem != xyes; then
slouken@0
  1469
                COPY_ARCH_SRC(src/thread, generic, SDL_syssem.c)
slouken@0
  1470
            else
slouken@0
  1471
                COPY_ARCH_SRC(src/thread, linux, SDL_syssem.c)
slouken@0
  1472
            fi
slouken@0
  1473
            COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
slouken@0
  1474
            if test x$glibc20_pthreads = xyes; then
slouken@0
  1475
                COPY_ARCH_SRC(src/thread, generic, SDL_sysmutex.c)
slouken@0
  1476
                COPY_ARCH_SRC(src/thread, generic, SDL_sysmutex_c.h)
slouken@0
  1477
                COPY_ARCH_SRC(src/thread, generic, SDL_syscond.c)
slouken@0
  1478
                COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
slouken@0
  1479
            else
slouken@0
  1480
                COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex.c)
slouken@0
  1481
                COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex_c.h)
slouken@0
  1482
                COPY_ARCH_SRC(src/thread, linux, SDL_syscond.c)
slouken@0
  1483
                COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
slouken@0
  1484
            fi
slouken@0
  1485
        fi
slouken@0
  1486
        # Set up files for the timer library
slouken@0
  1487
        if test x$enable_timers = xyes; then
slouken@0
  1488
            COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
slouken@0
  1489
        fi
slouken@0
  1490
        ;;
slouken@0
  1491
    *-*-bsdi*)
slouken@0
  1492
        ARCH=bsdi
slouken@1
  1493
        CheckDummyVideo
slouken@68
  1494
        CheckDiskAudio
slouken@294
  1495
	CheckDLOPEN
slouken@0
  1496
        CheckNASM
slouken@0
  1497
        CheckOSS
slouken@35
  1498
        CheckARTSC
slouken@35
  1499
        CheckESD
slouken@0
  1500
        CheckNAS
slouken@0
  1501
        CheckX11
slouken@0
  1502
        CheckDGA
slouken@0
  1503
        CheckSVGA
slouken@0
  1504
        CheckAAlib
slouken@0
  1505
        CheckOpenGL
slouken@0
  1506
        CheckPTHREAD
slouken@0
  1507
        # Set up files for the main() stub
slouken@0
  1508
        COPY_ARCH_SRC(src/main, linux, SDL_main.c)
slouken@148
  1509
        # Set up files for the audio library
slouken@148
  1510
        # We use the OSS and ALSA API's, not the Sun audio API
slouken@148
  1511
        #if test x$enable_audio = xyes; then
slouken@148
  1512
        #    CFLAGS="$CFLAGS -DSUNAUDIO_SUPPORT"
slouken@148
  1513
        #    AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun"
slouken@148
  1514
        #    AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la"
slouken@148
  1515
        #fi
slouken@0
  1516
        # Set up files for the joystick library
slouken@0
  1517
        # (No joystick support yet)
slouken@0
  1518
        if test x$enable_joystick = xyes; then
slouken@0
  1519
            JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS dummy"
slouken@0
  1520
            JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS dummy/libjoystick_dummy.la"
slouken@0
  1521
        fi
slouken@0
  1522
        # Set up files for the cdrom library
slouken@0
  1523
        if test x$enable_cdrom = xyes; then
slouken@178
  1524
            CDROM_SUBDIRS="$CDROM_SUBDIRS bsdi"
slouken@178
  1525
            CDROM_DRIVERS="$CDROM_DRIVERS bsdi/libcdrom_bsdi.la"
slouken@0
  1526
        fi
slouken@0
  1527
        # Set up files for the thread library
slouken@0
  1528
        if test x$enable_threads = xyes; then
slouken@0
  1529
            COPY_ARCH_SRC(src/thread, linux, SDL_systhread.c)
slouken@0
  1530
            COPY_ARCH_SRC(src/thread, linux, SDL_systhread_c.h)
slouken@0
  1531
            COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex.c)
slouken@0
  1532
            COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex_c.h)
slouken@191
  1533
            COPY_ARCH_SRC(src/thread, bsdi, SDL_syssem.c)
slouken@0
  1534
            COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
slouken@0
  1535
            COPY_ARCH_SRC(src/thread, linux, SDL_syscond.c)
slouken@0
  1536
            COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
slouken@0
  1537
        fi
slouken@0
  1538
        # Set up files for the timer library
slouken@0
  1539
        if test x$enable_timers = xyes; then
slouken@0
  1540
            COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
slouken@0
  1541
        fi
slouken@0
  1542
        ;;
slouken@0
  1543
    *-*-freebsd*)
slouken@0
  1544
        ARCH=freebsd
slouken@1
  1545
        CheckDummyVideo
slouken@68
  1546
        CheckDiskAudio
slouken@294
  1547
	CheckDLOPEN
slouken@129
  1548
        CheckVGL
slouken@0
  1549
        CheckNASM
slouken@0
  1550
        CheckOSS
slouken@0
  1551
        CheckARTSC
slouken@0
  1552
        CheckESD
slouken@0
  1553
        CheckNAS
slouken@0
  1554
        CheckX11
slouken@0
  1555
        CheckDGA
slouken@0
  1556
        CheckSVGA
slouken@0
  1557
        CheckAAlib
slouken@0
  1558
        CheckOpenGL
slouken@0
  1559
        CheckPTHREAD
slouken@0
  1560
        # Set up files for the main() stub
slouken@0
  1561
        COPY_ARCH_SRC(src/main, linux, SDL_main.c)
slouken@0
  1562
        # Set up files for the audio library
slouken@0
  1563
        # We use the OSS and ALSA API's, not the Sun audio API
slouken@0
  1564
        #if test x$enable_audio = xyes; then
slouken@148
  1565
        #    CFLAGS="$CFLAGS -DSUNAUDIO_SUPPORT"
slouken@0
  1566
        #    AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun"
slouken@0
  1567
        #    AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la"
slouken@0
  1568
        #fi
slouken@0
  1569
        # Set up files for the joystick library
slouken@0
  1570
        if test x$enable_joystick = xyes; then
slouken@278
  1571
            JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS bsd"
slouken@278
  1572
            JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS bsd/libjoystick_bsd.la"
slouken@360
  1573
            SYSTEM_LIBS="$SYSTEM_LIBS -lusb"
slouken@0
  1574
        fi
slouken@0
  1575
        # Set up files for the cdrom library
slouken@0
  1576
        if test x$enable_cdrom = xyes; then
slouken@153
  1577
            CDROM_SUBDIRS="$CDROM_SUBDIRS freebsd"
slouken@153
  1578
            CDROM_DRIVERS="$CDROM_DRIVERS freebsd/libcdrom_freebsd.la"
slouken@0
  1579
        fi
slouken@0
  1580
        # Set up files for the thread library
slouken@0
  1581
        if test x$enable_threads = xyes; then
slouken@0
  1582
            COPY_ARCH_SRC(src/thread, linux, SDL_systhread.c)
slouken@0
  1583
            COPY_ARCH_SRC(src/thread, linux, SDL_systhread_c.h)
slouken@0
  1584
            COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex.c)
slouken@0
  1585
            COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex_c.h)
slouken@94
  1586
            if test x$use_pthreads = xyes -a x$have_pthread_sem != xyes; then
slouken@0
  1587
                COPY_ARCH_SRC(src/thread, generic, SDL_syssem.c)
slouken@0
  1588
            else
slouken@0
  1589
                COPY_ARCH_SRC(src/thread, linux, SDL_syssem.c)
slouken@0
  1590
            fi
slouken@0
  1591
            COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
slouken@0
  1592
            COPY_ARCH_SRC(src/thread, linux, SDL_syscond.c)
slouken@0
  1593
            COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
slouken@0
  1594
        fi
slouken@0
  1595
        # Set up files for the timer library
slouken@0
  1596
        if test x$enable_timers = xyes; then
slouken@0
  1597
            COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
slouken@0
  1598
        fi
slouken@0
  1599
        ;;
slouken@0
  1600
    *-*-netbsd*)
slouken@0
  1601
        ARCH=netbsd
slouken@1
  1602
        CheckDummyVideo
slouken@68
  1603
        CheckDiskAudio
slouken@294
  1604
	CheckDLOPEN
slouken@0
  1605
        CheckNASM
slouken@0
  1606
        CheckOSS
slouken@0
  1607
        CheckARTSC
slouken@0
  1608
        CheckESD
slouken@0
  1609
        CheckNAS
slouken@0
  1610
        CheckX11
slouken@0
  1611
        CheckAAlib
slouken@0
  1612
        CheckOpenGL
slouken@0
  1613
        CheckPTHREAD
slouken@0
  1614
        # Set up files for the main() stub
slouken@0
  1615
        COPY_ARCH_SRC(src/main, linux, SDL_main.c)
slouken@0
  1616
        # Set up files for the audio library
slouken@0
  1617
        if test x$enable_audio = xyes; then
slouken@148
  1618
            CFLAGS="$CFLAGS -DSUNAUDIO_SUPPORT"
slouken@0
  1619
            AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun"
slouken@0
  1620
            AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la"
slouken@0
  1621
        fi
slouken@0
  1622
        # Set up files for the joystick library
slouken@0
  1623
        if test x$enable_joystick = xyes; then
slouken@278
  1624
            JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS bsd"
slouken@278
  1625
            JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS bsd/libjoystick_bsd.la"
slouken@360
  1626
            SYSTEM_LIBS="$SYSTEM_LIBS -lusb"
slouken@0
  1627
        fi
slouken@0
  1628
        # Set up files for the cdrom library
slouken@0
  1629
        if test x$enable_cdrom = xyes; then
slouken@153
  1630
            CDROM_SUBDIRS="$CDROM_SUBDIRS openbsd"
slouken@153
  1631
            CDROM_DRIVERS="$CDROM_DRIVERS openbsd/libcdrom_openbsd.la"
slouken@0
  1632
        fi
slouken@0
  1633
        # Set up files for the thread library
slouken@0
  1634
        if test x$enable_threads = xyes; then
slouken@0
  1635
            COPY_ARCH_SRC(src/thread, linux, SDL_systhread.c)
slouken@0
  1636
            COPY_ARCH_SRC(src/thread, linux, SDL_systhread_c.h)
slouken@0
  1637
            COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex.c)
slouken@0
  1638
            COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex_c.h)
slouken@94
  1639
            if test x$use_pthreads = xyes -a x$have_pthread_sem != xyes; then
slouken@41
  1640
                COPY_ARCH_SRC(src/thread, generic, SDL_syssem.c)
slouken@41
  1641
            else
slouken@41
  1642
                COPY_ARCH_SRC(src/thread, linux, SDL_syssem.c)
slouken@41
  1643
            fi
slouken@0
  1644
            COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
slouken@0
  1645
            COPY_ARCH_SRC(src/thread, linux, SDL_syscond.c)
slouken@0
  1646
            COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
slouken@0
  1647
        fi
slouken@0
  1648
        # Set up files for the timer library
slouken@0
  1649
        if test x$enable_timers = xyes; then
slouken@0
  1650
            COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
slouken@0
  1651
        fi
slouken@0
  1652
        # NetBSD does not define "unix"
slouken@43
  1653
        CFLAGS="$CFLAGS -Dunix -D_POSIX_THREAD_SYSCALL_SOFT=1"
slouken@0
  1654
        ;;
slouken@0
  1655
    *-*-openbsd*)
slouken@0
  1656
        ARCH=openbsd
slouken@1
  1657
        CheckDummyVideo
slouken@68
  1658
        CheckDiskAudio
slouken@294
  1659
	CheckDLOPEN
slouken@0
  1660
        CheckNASM
slouken@0
  1661
        CheckOSS
slouken@0
  1662
        CheckARTSC
slouken@0
  1663
        CheckESD
slouken@0
  1664
        CheckNAS
slouken@0
  1665
        CheckX11
slouken@0
  1666
        CheckAAlib
slouken@0
  1667
        CheckOpenGL
slouken@0
  1668
        CheckPTHREAD
slouken@0
  1669
        # Set up files for the main() stub
slouken@0
  1670
        COPY_ARCH_SRC(src/main, linux, SDL_main.c)
slouken@0
  1671
        # Set up files for the audio library
slouken@360
  1672
        if test x$enable_audio = xyes; then
slouken@360
  1673
            CFLAGS="$CFLAGS -DOPENBSD_AUDIO_SUPPORT"
slouken@360
  1674
            AUDIO_SUBDIRS="$AUDIO_SUBDIRS openbsd"
slouken@360
  1675
            AUDIO_DRIVERS="$AUDIO_DRIVERS openbsd/libaudio_openbsd.la"
slouken@360
  1676
        fi
slouken@94
  1677
        # OpenBSD needs linking with ossaudio emulation library
slouken@94
  1678
        if test x$have_oss = xyes; then
slouken@94
  1679
            SYSTEM_LIBS="$SYSTEM_LIBS -lossaudio"
slouken@94
  1680
        fi
slouken@0
  1681
        # Set up files for the joystick library
slouken@0
  1682
        if test x$enable_joystick = xyes; then
slouken@278
  1683
            JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS bsd"
slouken@278
  1684
            JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS bsd/libjoystick_bsd.la"
slouken@360
  1685
            SYSTEM_LIBS="$SYSTEM_LIBS -lusbhid"
slouken@0
  1686
        fi
slouken@0
  1687
        # Set up files for the cdrom library
slouken@0
  1688
        if test x$enable_cdrom = xyes; then
slouken@153
  1689
            CDROM_SUBDIRS="$CDROM_SUBDIRS openbsd"
slouken@153
  1690
            CDROM_DRIVERS="$CDROM_DRIVERS openbsd/libcdrom_openbsd.la"
slouken@0
  1691
        fi
slouken@0
  1692
        # Set up files for the thread library
slouken@0
  1693
        if test x$enable_threads = xyes; then
slouken@0
  1694
            COPY_ARCH_SRC(src/thread, linux, SDL_systhread.c)
slouken@0
  1695
            COPY_ARCH_SRC(src/thread, linux, SDL_systhread_c.h)
slouken@0
  1696
            COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex.c)
slouken@0
  1697
            COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex_c.h)
slouken@94
  1698
            if test x$use_pthreads = xyes -a x$have_pthread_sem != xyes; then
slouken@0
  1699
                COPY_ARCH_SRC(src/thread, generic, SDL_syssem.c)
slouken@0
  1700
            else
slouken@0
  1701
                COPY_ARCH_SRC(src/thread, linux, SDL_syssem.c)
slouken@0
  1702
            fi
slouken@0
  1703
            COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
slouken@0
  1704
            COPY_ARCH_SRC(src/thread, linux, SDL_syscond.c)
slouken@0
  1705
            COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
slouken@0
  1706
        fi
slouken@0
  1707
        # Set up files for the timer library
slouken@0
  1708
        if test x$enable_timers = xyes; then
slouken@0
  1709
            COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
slouken@0
  1710
        fi
slouken@37
  1711
        # OpenBSD does not define "unix"
slouken@37
  1712
        CFLAGS="$CFLAGS -Dunix"
slouken@0
  1713
        ;;
slouken@0
  1714
    *-*-sysv5*)
slouken@0
  1715
        ARCH=sysv5
slouken@1
  1716
        CheckDummyVideo
slouken@68
  1717
        CheckDiskAudio
slouken@294
  1718
	CheckDLOPEN
slouken@0
  1719
        CheckNASM
slouken@0
  1720
        CheckOSS
slouken@0
  1721
        CheckARTSC
slouken@0
  1722
        CheckESD
slouken@0
  1723
        CheckNAS
slouken@0
  1724
        CheckX11
slouken@0
  1725
        CheckAAlib
slouken@0
  1726
        CheckOpenGL
slouken@0
  1727
        CheckPTHREAD
slouken@0
  1728
        # Set up files for the main() stub
slouken@0
  1729
        COPY_ARCH_SRC(src/main, linux, SDL_main.c)
slouken@0
  1730
        # Set up files for the audio library
slouken@0
  1731
        if test x$enable_audio = xyes; then
slouken@148
  1732
            CFLAGS="$CFLAGS -DSUNAUDIO_SUPPORT"
slouken@0
  1733
            AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun"
slouken@0
  1734
            AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la"
slouken@0
  1735
        fi
slouken@0
  1736
        # Set up files for the joystick library
slouken@0
  1737
        # (No joystick support yet)
slouken@0
  1738
        if test x$enable_joystick = xyes; then
slouken@0
  1739
            JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS dummy"
slouken@0
  1740
            JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS dummy/libjoystick_dummy.la"
slouken@0
  1741
        fi
slouken@0
  1742
        # Set up files for the cdrom library
slouken@0
  1743
        if test x$enable_cdrom = xyes; then
slouken@153
  1744
            CDROM_SUBDIRS="$CDROM_SUBDIRS dummy"
slouken@153
  1745
            CDROM_DRIVERS="$CDROM_DRIVERS dummy/libcdrom_dummy.la"
slouken@0
  1746
        fi
slouken@0
  1747
        # Set up files for the thread library
slouken@0
  1748
        if test x$enable_threads = xyes; then
slouken@0
  1749
            COPY_ARCH_SRC(src/thread, generic, SDL_systhread.c)
slouken@0
  1750
            COPY_ARCH_SRC(src/thread, generic, SDL_systhread_c.h)
slouken@0
  1751
            COPY_ARCH_SRC(src/thread, generic, SDL_sysmutex.c)
slouken@0
  1752
            COPY_ARCH_SRC(src/thread, generic, SDL_sysmutex_c.h)
slouken@0
  1753
            COPY_ARCH_SRC(src/thread, generic, SDL_syssem.c)
slouken@0
  1754
            COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
slouken@0
  1755
            COPY_ARCH_SRC(src/thread, generic, SDL_syscond.c)
slouken@0
  1756
            COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
slouken@0
  1757
        fi
slouken@0
  1758
        # Set up files for the timer library
slouken@0
  1759
        if test x$enable_timers = xyes; then
slouken@0
  1760
            COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
slouken@0
  1761
        fi
slouken@0
  1762
        ;;
slouken@0
  1763
    *-*-solaris*)
slouken@0
  1764
        ARCH=solaris
slouken@1
  1765
        CFLAGS="$CFLAGS -D__ELF__" # Fix for nasm on Solaris x86
slouken@1
  1766
        CheckDummyVideo
slouken@68
  1767
        CheckDiskAudio
slouken@294
  1768
	CheckDLOPEN
slouken@0
  1769
        CheckNASM
slouken@35
  1770
        CheckOSS
slouken@0
  1771
        CheckARTSC
slouken@0
  1772
        CheckESD
slouken@0
  1773
        CheckNAS
slouken@0
  1774
        CheckX11
slouken@0
  1775
        CheckAAlib
slouken@0
  1776
        CheckOpenGL
slouken@0
  1777
        CheckPTHREAD
slouken@0
  1778
        # Set up files for the main() stub
slouken@0
  1779
        COPY_ARCH_SRC(src/main, linux, SDL_main.c)
slouken@0
  1780
        # Set up files for the audio library
slouken@0
  1781
        if test x$enable_audio = xyes; then
slouken@148
  1782
            CFLAGS="$CFLAGS -DSUNAUDIO_SUPPORT"
slouken@0
  1783
            AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun"
slouken@0
  1784
            AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la"
slouken@0
  1785
        fi
slouken@0
  1786
        # Set up files for the joystick library
slouken@0
  1787
        # (No joystick support yet)
slouken@0
  1788
        if test x$enable_joystick = xyes; then
slouken@0
  1789
            JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS dummy"
slouken@0
  1790
            JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS dummy/libjoystick_dummy.la"
slouken@0
  1791
        fi
slouken@0
  1792
        # Set up files for the cdrom library
slouken@0
  1793
        if test x$enable_cdrom = xyes; then
slouken@153
  1794
            CDROM_SUBDIRS="$CDROM_SUBDIRS linux"
slouken@153
  1795
            CDROM_DRIVERS="$CDROM_DRIVERS linux/libcdrom_linux.la"
slouken@0
  1796
        fi
slouken@0
  1797
        # Set up files for the thread library
slouken@0
  1798
        if test x$enable_threads = xyes; then
slouken@0
  1799
            COPY_ARCH_SRC(src/thread, linux, SDL_systhread.c)
slouken@0
  1800
            COPY_ARCH_SRC(src/thread, linux, SDL_systhread_c.h)
slouken@0
  1801
            COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex.c)
slouken@0
  1802
            COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex_c.h)
slouken@0
  1803
            COPY_ARCH_SRC(src/thread, linux, SDL_syssem.c)
slouken@0
  1804
            COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
slouken@0
  1805
            COPY_ARCH_SRC(src/thread, generic, SDL_syscond.c)
slouken@0
  1806
            COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
slouken@0
  1807
        fi
slouken@0
  1808
        # Set up files for the timer library
slouken@0
  1809
        if test x$enable_timers = xyes; then
slouken@0
  1810
            COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
slouken@0
  1811
        fi
slouken@0
  1812
        ;;
slouken@0
  1813
    *-*-irix*)
slouken@0
  1814
        ARCH=irix
slouken@1
  1815
        CheckDummyVideo
slouken@68
  1816
        CheckDiskAudio
slouken@294
  1817
	CheckDLOPEN
slouken@148
  1818
        CheckDMEDIA
slouken@148
  1819
        CheckESD
slouken@0
  1820
        CheckNAS
slouken@0
  1821
        CheckX11
slouken@0
  1822
        CheckAAlib
slouken@0
  1823
        CheckOpenGL
slouken@0
  1824
        CheckPTHREAD
slouken@0
  1825
        # Set up files for the main() stub
slouken@0
  1826
        COPY_ARCH_SRC(src/main, linux, SDL_main.c)
slouken@148
  1827
        # We use the dmedia audio API, not the Sun audio API
slouken@148
  1828
        #if test x$enable_audio = xyes; then
slouken@148
  1829
        #    CFLAGS="$CFLAGS -DSUNAUDIO_SUPPORT"
slouken@148
  1830
        #    AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun"
slouken@148
  1831
        #    AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la"
slouken@148
  1832
        #fi
slouken@0
  1833
        # Set up files for the joystick library
slouken@0
  1834
        # (No joystick support yet)
slouken@0
  1835
        if test x$enable_joystick = xyes; then
slouken@0
  1836
            JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS dummy"
slouken@0
  1837
            JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS dummy/libjoystick_dummy.la"
slouken@0
  1838
        fi
slouken@0
  1839
        # Set up files for the cdrom library
slouken@0
  1840
        # (No CD-ROM support yet)
slouken@0
  1841
        if test x$enable_cdrom = xyes; then
slouken@153
  1842
            CDROM_SUBDIRS="$CDROM_SUBDIRS dummy"
slouken@153
  1843
            CDROM_DRIVERS="$CDROM_DRIVERS dummy/libcdrom_dummy.la"
slouken@0
  1844
        fi
slouken@0
  1845
        # Set up files for the thread library
slouken@0
  1846
        if test x$enable_threads = xyes; then
slouken@0
  1847
            if test x$use_pthreads = xyes; then
slouken@0
  1848
                COPY_ARCH_SRC(src/thread, linux, SDL_systhread.c)
slouken@0
  1849
                COPY_ARCH_SRC(src/thread, linux, SDL_systhread_c.h)
slouken@0
  1850
                COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex.c)
slouken@0
  1851
                COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex_c.h)
slouken@94
  1852
                if test x$have_pthread_sem != xyes; then
slouken@0
  1853
                    COPY_ARCH_SRC(src/thread, generic, SDL_syssem.c)
slouken@0
  1854
                else
slouken@0
  1855
                    COPY_ARCH_SRC(src/thread, linux, SDL_syssem.c)
slouken@0
  1856
                fi
slouken@0
  1857
                COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
slouken@0
  1858
                COPY_ARCH_SRC(src/thread, linux, SDL_syscond.c)
slouken@0
  1859
                COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
slouken@0
  1860
            else
slouken@0
  1861
                COPY_ARCH_SRC(src/thread, irix, SDL_systhread.c)
slouken@0
  1862
                COPY_ARCH_SRC(src/thread, irix, SDL_systhread_c.h)
slouken@0
  1863
                COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex.c)
slouken@0
  1864
                COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex_c.h)
slouken@0
  1865
                COPY_ARCH_SRC(src/thread, linux, SDL_syssem.c)
slouken@0
  1866
                COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
slouken@0
  1867
                COPY_ARCH_SRC(src/thread, generic, SDL_syscond.c)
slouken@0
  1868
                COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
slouken@0
  1869
            fi
slouken@0
  1870
        fi
slouken@0
  1871
        # Set up files for the timer library
slouken@0
  1872
        if test x$enable_timers = xyes; then
slouken@0
  1873
            COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
slouken@0
  1874
        fi
slouken@0
  1875
        ;;
slouken@0
  1876
    *-*-hpux*)
slouken@0
  1877
        ARCH=hpux
slouken@1
  1878
        CheckDummyVideo
slouken@68
  1879
        CheckDiskAudio
slouken@294
  1880
	CheckDLOPEN
slouken@35
  1881
        CheckOSS
slouken@0
  1882
        CheckNAS
slouken@0
  1883
        CheckX11
slouken@0
  1884
        CheckGGI
slouken@0
  1885
        CheckAAlib
slouken@0
  1886
        CheckOpenGL
slouken@0
  1887
        CheckPTHREAD
slouken@0
  1888
        # Set up files for the main() stub
slouken@0
  1889
        COPY_ARCH_SRC(src/main, linux, SDL_main.c)
slouken@0
  1890
        # Set up files for the audio library
slouken@0
  1891
        if test x$enable_audio = xyes; then
slouken@148
  1892
            CFLAGS="$CFLAGS -DSUNAUDIO_SUPPORT"
slouken@0
  1893
            AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun"
slouken@0
  1894
            AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la"
slouken@0
  1895
        fi
slouken@0
  1896
        # Set up files for the joystick library
slouken@0
  1897
        # (No joystick support yet)
slouken@0
  1898
        if test x$enable_joystick = xyes; then
slouken@0
  1899
            JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS dummy"
slouken@0
  1900
            JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS dummy/libjoystick_dummy.la"
slouken@0
  1901
        fi
slouken@0
  1902
        # Set up files for the cdrom library
slouken@0
  1903
        # (No CD-ROM support yet)
slouken@0
  1904
        if test x$enable_cdrom = xyes; then
slouken@153
  1905
            CDROM_SUBDIRS="$CDROM_SUBDIRS dummy"
slouken@153
  1906
            CDROM_DRIVERS="$CDROM_DRIVERS dummy/libcdrom_dummy.la"
slouken@0
  1907
        fi
slouken@0
  1908
        # Set up files for the thread library
slouken@0
  1909
        if test x$enable_threads = xyes; then
slouken@0
  1910
            COPY_ARCH_SRC(src/thread, linux, SDL_systhread.c)
slouken@0
  1911
            COPY_ARCH_SRC(src/thread, linux, SDL_systhread_c.h)
slouken@0
  1912
            COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex.c)
slouken@0
  1913
            COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex_c.h)
slouken@0
  1914
            COPY_ARCH_SRC(src/thread, linux, SDL_syssem.c)
slouken@0
  1915
            COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
slouken@0
  1916
            COPY_ARCH_SRC(src/thread, linux, SDL_syscond.c)
slouken@0
  1917
            COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
slouken@0
  1918
        fi
slouken@0
  1919
        # Set up files for the timer library
slouken@0
  1920
        if test x$enable_timers = xyes; then
slouken@0
  1921
            COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
slouken@0
  1922
        fi
slouken@0
  1923
        ;;
slouken@0
  1924
    *-*-aix*)
slouken@0
  1925
        ARCH=aix
slouken@1
  1926
        CheckDummyVideo
slouken@68
  1927
        CheckDiskAudio
slouken@294
  1928
	CheckDLOPEN
slouken@35
  1929
        CheckOSS
slouken@0
  1930
        CheckNAS
slouken@0
  1931
        CheckX11
slouken@0
  1932
        CheckGGI
slouken@0
  1933
        CheckAAlib
slouken@0
  1934
        CheckOpenGL
slouken@0
  1935
        CheckPTHREAD
slouken@0
  1936
        # Set up files for the main() stub
slouken@0
  1937
        COPY_ARCH_SRC(src/main, linux, SDL_main.c)
slouken@0
  1938
        # Set up files for the audio library
slouken@0
  1939
        if test x$enable_audio = xyes; then
slouken@0
  1940
            AUDIO_SUBDIRS="$AUDIO_SUBDIRS paudio"
slouken@0
  1941
            AUDIO_DRIVERS="$AUDIO_DRIVERS paudio/libaudio_paudio.la"
slouken@0
  1942
        fi
slouken@0
  1943
        # Set up files for the joystick library
slouken@0
  1944
        # (No joystick support yet)
slouken@0
  1945
        if test x$enable_joystick = xyes; then
slouken@0
  1946
            JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS dummy"
slouken@0
  1947
            JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS dummy/libjoystick_dummy.la"
slouken@0
  1948
        fi
slouken@0
  1949
        # Set up files for the cdrom library
slouken@0
  1950
        if test x$enable_cdrom = xyes; then
slouken@153
  1951
            CDROM_SUBDIRS="$CDROM_SUBDIRS aix"
slouken@153
  1952
            CDROM_DRIVERS="$CDROM_DRIVERS aix/libcdrom_aix.la"
slouken@0
  1953
        fi
slouken@0
  1954
        # Set up files for the thread library
slouken@0
  1955
        if test x$enable_threads = xyes; then
slouken@0
  1956
            COPY_ARCH_SRC(src/thread, linux, SDL_systhread.c)
slouken@0
  1957
            COPY_ARCH_SRC(src/thread, linux, SDL_systhread_c.h)
slouken@0
  1958
            COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex.c)
slouken@0
  1959
            COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex_c.h)
slouken@0
  1960
            COPY_ARCH_SRC(src/thread, linux, SDL_syssem.c)
slouken@0
  1961
            COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
slouken@0
  1962
            COPY_ARCH_SRC(src/thread, linux, SDL_syscond.c)
slouken@0
  1963
            COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
slouken@0
  1964
        fi
slouken@0
  1965
        # Set up files for the timer library
slouken@0
  1966
        if test x$enable_timers = xyes; then
slouken@0
  1967
            COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
slouken@0
  1968
        fi
slouken@0
  1969
        ;;
slouken@0
  1970
    *-*-osf*)
slouken@0
  1971
        ARCH=osf
slouken@1
  1972
        CheckDummyVideo
slouken@68
  1973
        CheckDiskAudio
slouken@294
  1974
	CheckDLOPEN
slouken@0
  1975
        CheckNAS
slouken@0
  1976
        CheckX11
slouken@0
  1977
        CheckGGI
slouken@0
  1978
        CheckAAlib
slouken@0
  1979
        CheckOpenGL
slouken@0
  1980
        CheckPTHREAD
slouken@0
  1981
        # Set up files for the main() stub
slouken@0
  1982
        COPY_ARCH_SRC(src/main, linux, SDL_main.c)
slouken@0
  1983
        # Set up files for the audio library
slouken@0
  1984
        if test x$enable_audio = xyes; then
slouken@148
  1985
            CFLAGS="$CFLAGS -DSUNAUDIO_SUPPORT"
slouken@0
  1986
            AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun"
slouken@0
  1987
            AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la"
slouken@0
  1988
        fi
slouken@0
  1989
        # Set up files for the joystick library
slouken@0
  1990
        # (No joystick support yet)
slouken@0
  1991
        if test x$enable_joystick = xyes; then
slouken@0
  1992
            JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS dummy"
slouken@0
  1993
            JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS dummy/libjoystick_dummy.la"
slouken@0
  1994
        fi
slouken@0
  1995
        # Set up files for the cdrom library
slouken@0
  1996
        # (No cdrom support yet)
slouken@0
  1997
        if test x$enable_cdrom = xyes; then
slouken@153
  1998
            CDROM_SUBDIRS="$CDROM_SUBDIRS dummy"
slouken@153
  1999
            CDROM_DRIVERS="$CDROM_DRIVERS dummy/libcdrom_dummy.la"
slouken@0
  2000
        fi
slouken@0
  2001
        # Set up files for the thread library
slouken@0
  2002
        if test x$enable_threads = xyes; then
slouken@0
  2003
            COPY_ARCH_SRC(src/thread, linux, SDL_systhread.c)
slouken@0
  2004
            COPY_ARCH_SRC(src/thread, linux, SDL_systhread_c.h)
slouken@0
  2005
            COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex.c)
slouken@0
  2006
            COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex_c.h)
slouken@0
  2007
            COPY_ARCH_SRC(src/thread, generic, SDL_syssem.c)
slouken@0
  2008
            COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
slouken@0
  2009
            COPY_ARCH_SRC(src/thread, linux, SDL_syscond.c)
slouken@0
  2010
            COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
slouken@0
  2011
        fi
slouken@0
  2012
        # Set up files for the timer library
slouken@0
  2013
        if test x$enable_timers = xyes; then
slouken@0
  2014
            COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
slouken@0
  2015
        fi
slouken@0
  2016
        ;;
slouken@0
  2017
    *-*-qnx*)
slouken@0
  2018
        ARCH=qnx
slouken@1
  2019
        CheckDummyVideo
slouken@68
  2020
        CheckDiskAudio
slouken@294
  2021
	CheckDLOPEN
slouken@0
  2022
        CheckNAS
slouken@0
  2023
        CheckPHOTON
slouken@0
  2024
        CheckX11
slouken@0
  2025
        CheckOpenGL
slouken@0
  2026
        CheckPTHREAD
slouken@0
  2027
        # Set up files for the main() stub
slouken@0
  2028
        COPY_ARCH_SRC(src/main, linux, SDL_main.c)
slouken@0
  2029
        # Set up files for the audio library
slouken@0
  2030
        if test x$enable_audio = xyes; then
slouken@0
  2031
            CFLAGS="$CFLAGS -DALSA_SUPPORT"
slouken@0
  2032
            SYSTEM_LIBS="$SYSTEM_LIBS -lasound"
slouken@0
  2033
            AUDIO_SUBDIRS="$AUDIO_SUBDIRS nto"
slouken@0
  2034
            AUDIO_DRIVERS="$AUDIO_DRIVERS nto/libaudio_nto.la"
slouken@0
  2035
        fi
slouken@0
  2036
        # Set up files for the joystick library
slouken@0
  2037
        if test x$enable_joystick = xyes; then
slouken@0
  2038
        # (No joystick support yet)
slouken@0
  2039
            JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS dummy"
slouken@0
  2040
            JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS dummy/libjoystick_dummy.la"
slouken@0
  2041
        fi
slouken@0
  2042
        # Set up files for the cdrom library
slouken@0
  2043
        if test x$enable_cdrom = xyes; then
slouken@153
  2044
            CDROM_SUBDIRS="$CDROM_SUBDIRS qnx"
slouken@153
  2045
            CDROM_DRIVERS="$CDROM_DRIVERS qnx/libcdrom_qnx.la"
slouken@0
  2046
        fi
slouken@0
  2047
        # Set up files for the thread library
slouken@0
  2048
        if test x$enable_threads = xyes; then
slouken@0
  2049
            COPY_ARCH_SRC(src/thread, linux, SDL_systhread.c)
slouken@0
  2050
            COPY_ARCH_SRC(src/thread, linux, SDL_systhread_c.h)
slouken@0
  2051
            COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex.c)
slouken@0
  2052
            COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex_c.h)
slouken@0
  2053
            COPY_ARCH_SRC(src/thread, linux, SDL_syssem.c)
slouken@0
  2054
            COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
slouken@0
  2055
            COPY_ARCH_SRC(src/thread, linux, SDL_syscond.c)
slouken@0
  2056
            COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
slouken@0
  2057
        fi
slouken@0
  2058
        # Set up files for the timer library
slouken@0
  2059
        if test x$enable_timers = xyes; then
slouken@0
  2060
            COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
slouken@0
  2061
        fi
slouken@0
  2062
        ;;
slouken@0
  2063
    *-*-cygwin* | *-*-mingw32*)
slouken@0
  2064
        ARCH=win32
slouken@0
  2065
        if test "$build" != "$target"; then # cross-compiling
slouken@0
  2066
            # Default cross-compile location
slouken@0
  2067
            ac_default_prefix=/usr/local/cross-tools/i386-mingw32msvc
slouken@0
  2068
        else
slouken@0
  2069
            # Look for the location of the tools and install there
slouken@1
  2070
            if [ "$BUILD_PREFIX" != "" ]; then
slouken@1
  2071
                ac_default_prefix=$BUILD_PREFIX
slouken@1
  2072
            fi
slouken@0
  2073
        fi
slouken@1
  2074
        CheckDummyVideo
slouken@68
  2075
        CheckDiskAudio
slouken@0
  2076
        CheckWIN32
slouken@0
  2077
        CheckDIRECTX
slouken@0
  2078
        CheckNASM
slouken@0
  2079
        # Set up files for the main() stub
slouken@0
  2080
        COPY_ARCH_SRC(src/main, win32, SDL_main.c)
slouken@0
  2081
        # Set up files for the audio library
slouken@0
  2082
        if test x$enable_audio = xyes; then
slouken@0
  2083
            AUDIO_SUBDIRS="$AUDIO_SUBDIRS windib"
slouken@0
  2084
            AUDIO_DRIVERS="$AUDIO_DRIVERS windib/libaudio_windib.la"
slouken@0
  2085
            if test x$use_directx = xyes; then
slouken@41
  2086
                AUDIO_SUBDIRS="$AUDIO_SUBDIRS windx5"
slouken@41
  2087
                AUDIO_DRIVERS="$AUDIO_DRIVERS windx5/libaudio_windx5.la"
slouken@0
  2088
            fi
slouken@0
  2089
        fi
slouken@0
  2090
        # Set up files for the joystick library
slouken@0
  2091
        if test x$enable_joystick = xyes; then
slouken@0
  2092
            JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS win32"
slouken@0
  2093
            JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS win32/libjoystick_winmm.la"
slouken@0
  2094
        fi
slouken@0
  2095
        # Set up files for the cdrom library
slouken@0
  2096
        if test x$enable_cdrom = xyes; then
slouken@153
  2097
            CDROM_SUBDIRS="$CDROM_SUBDIRS win32"
slouken@153
  2098
            CDROM_DRIVERS="$CDROM_DRIVERS win32/libcdrom_win32.la"
slouken@0
  2099
        fi
slouken@0
  2100
        # Set up files for the thread library
slouken@0
  2101
        if test x$enable_threads = xyes; then
slouken@0
  2102
            COPY_ARCH_SRC(src/thread, win32, SDL_systhread.c)
slouken@0
  2103
            COPY_ARCH_SRC(src/thread, win32, SDL_systhread_c.h)
slouken@0
  2104
            COPY_ARCH_SRC(src/thread, win32, SDL_sysmutex.c)
slouken@0
  2105
            COPY_ARCH_SRC(src/thread, generic, SDL_sysmutex_c.h)
slouken@0
  2106
            COPY_ARCH_SRC(src/thread, win32, SDL_syssem.c)
slouken@0
  2107
            COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
slouken@0
  2108
            COPY_ARCH_SRC(src/thread, generic, SDL_syscond.c)
slouken@0
  2109
            COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
slouken@0
  2110
        fi
slouken@0
  2111
        # Set up files for the timer library
slouken@0
  2112
        if test x$enable_timers = xyes; then
slouken@0
  2113
            COPY_ARCH_SRC(src/timer, win32, SDL_systimer.c)
slouken@0
  2114
        fi
slouken@0
  2115
        # The Win32 platform requires special setup
slouken@0
  2116
        SDL_CFLAGS="$SDL_CFLAGS -Dmain=SDL_main"
slouken@1
  2117
        case "$target" in
slouken@1
  2118
            *-*-cygwin*)
slouken@263
  2119
                CFLAGS="$CFLAGS -I/usr/include/mingw -DWIN32 -Uunix -mno-cygwin"
slouken@263
  2120
                SDL_CFLAGS="$SDL_CFLAGS -I/usr/include/mingw -DWIN32 -Uunix -mno-cygwin"
slouken@1
  2121
                LIBS="$LIBS -mno-cygwin"
slouken@1
  2122
                SDL_LIBS="-lmingw32 -lSDLmain $SDL_LIBS -mwindows -mno-cygwin"
slouken@1
  2123
                ;;
slouken@1
  2124
            *-*-mingw32*)
slouken@1
  2125
                SDL_LIBS="-lmingw32 -lSDLmain $SDL_LIBS -mwindows"
slouken@1
  2126
                ;;
slouken@1
  2127
        esac
slouken@0
  2128
        ;;
slouken@0
  2129
    *-*-beos*)
slouken@0
  2130
        ARCH=beos
slouken@0
  2131
        ac_default_prefix=/boot/develop/tools/gnupro
slouken@1
  2132
        CheckDummyVideo
slouken@68
  2133
        CheckDiskAudio
slouken@0
  2134
        CheckNASM
slouken@0
  2135
        CheckBWINDOW
slouken@0
  2136
        CheckBeGL
slouken@0
  2137
        # Set up files for the main() stub
slouken@0
  2138
        COPY_ARCH_SRC(src/main, linux, SDL_main.c)
slouken@0
  2139
        COPY_ARCH_SRC(src/main, beos, SDL_BeApp.cc)
slouken@0
  2140
        COPY_ARCH_SRC(src/main, beos, SDL_BeApp.h)
slouken@0
  2141
        # Set up files for the audio library
slouken@0
  2142
        if test x$enable_audio = xyes; then
slouken@0
  2143
            AUDIO_SUBDIRS="$AUDIO_SUBDIRS baudio"
slouken@0
  2144
            AUDIO_DRIVERS="$AUDIO_DRIVERS baudio/libaudio_baudio.la"
slouken@0
  2145
        fi
slouken@0
  2146
        # Set up files for the joystick library
slouken@0
  2147
        if test x$enable_joystick = xyes; then
slouken@0
  2148
            JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS beos"
slouken@0
  2149
            JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS beos/libjoystick_beos.la"
slouken@0
  2150
        fi
slouken@0
  2151
        # Set up files for the cdrom library
slouken@0
  2152
        if test x$enable_cdrom = xyes; then
slouken@153
  2153
            CDROM_SUBDIRS="$CDROM_SUBDIRS beos"
slouken@153
  2154
            CDROM_DRIVERS="$CDROM_DRIVERS beos/libcdrom_beos.la"
slouken@0
  2155
        fi
slouken@0
  2156
        # Set up files for the thread library
slouken@0
  2157
        if test x$enable_threads = xyes; then
slouken@0
  2158
            COPY_ARCH_SRC(src/thread, beos, SDL_systhread.c)
slouken@0
  2159
            COPY_ARCH_SRC(src/thread, beos, SDL_systhread_c.h)
slouken@0
  2160
            COPY_ARCH_SRC(src/thread, generic, SDL_sysmutex.c)
slouken@0
  2161
            COPY_ARCH_SRC(src/thread, generic, SDL_sysmutex_c.h)
slouken@0
  2162
            COPY_ARCH_SRC(src/thread, beos, SDL_syssem.c)
slouken@0
  2163
            COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
slouken@0
  2164
            COPY_ARCH_SRC(src/thread, generic, SDL_syscond.c)
slouken@0
  2165
            COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
slouken@0
  2166
        fi
slouken@0
  2167
        # Set up files for the timer library
slouken@0
  2168
        if test x$enable_timers = xyes; then
slouken@0
  2169
            COPY_ARCH_SRC(src/timer, beos, SDL_systimer.c)
slouken@0
  2170
        fi
slouken@0
  2171
        # The BeOS platform requires special libraries
slouken@0
  2172
        SYSTEM_LIBS="$SYSTEM_LIBS -lroot -lbe -lmedia -lgame -ldevice -ltextencoding"
slouken@0
  2173
        ;;
slouken@0
  2174
    *-*-macos*)
slouken@0
  2175
        # This would be used if cross-compiling to MacOS 9.  No way to
slouken@0
  2176
        # use it at present, but Apple is working on a X-to-9 compiler
slouken@0
  2177
        # for which this case would be handy.
slouken@0
  2178
        ARCH=macos
slouken@1
  2179
        CheckDummyVideo
slouken@68
  2180
        CheckDiskAudio
slouken@0
  2181
        CheckTOOLBOX
slouken@0
  2182
        CheckMacGL
slouken@0
  2183
        # Set up files for the main() stub
slouken@0
  2184
        COPY_ARCH_SRC(src/main, macos, SDL_main.c)
slouken@0
  2185
        # Set up files for the audio library
slouken@0
  2186
        if test x$enable_audio = xyes; then
slouken@0
  2187
            AUDIO_SUBDIRS="$AUDIO_SUBDIRS macrom"
slouken@0
  2188
            AUDIO_DRIVERS="$AUDIO_DRIVERS macrom/libaudio_macrom.la"
slouken@0
  2189
        fi
slouken@0
  2190
        # Set up files for the joystick library
slouken@0
  2191
        if test x$enable_joystick = xyes; then
slouken@0
  2192
            JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS macos"
slouken@0
  2193
            JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS macos/libjoystick_macos.la"
slouken@0
  2194
        fi
slouken@0
  2195
        # Set up files for the cdrom library
slouken@0
  2196
        if test x$enable_cdrom = xyes; then
slouken@153
  2197
            CDROM_SUBDIRS="$CDROM_SUBDIRS macos"
slouken@153
  2198
            CDROM_DRIVERS="$CDROM_DRIVERS macos/libcdrom_macos.la"
slouken@0
  2199
        fi
slouken@0
  2200
        # Set up files for the thread library
slouken@0
  2201
        if test x$enable_threads = xyes; then
slouken@0
  2202
            COPY_ARCH_SRC(src/thread, macos, SDL_systhread.c)
slouken@0
  2203
            COPY_ARCH_SRC(src/thread, macos, SDL_systhread_c.h)
slouken@0
  2204
            COPY_ARCH_SRC(src/thread, generic, SDL_sysmutex.c)
slouken@0
  2205
            COPY_ARCH_SRC(src/thread, generic, SDL_sysmutex_c.h)
slouken@0
  2206
            COPY_ARCH_SRC(src/thread, macos, SDL_syssem.c)
slouken@0
  2207
            COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
slouken@0
  2208
            COPY_ARCH_SRC(src/thread, generic, SDL_syscond.c)
slouken@0
  2209
            COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
slouken@0
  2210
        fi
slouken@0
  2211
        # Set up files for the timer library
slouken@0
  2212
        if test x$enable_timers = xyes; then
slouken@0
  2213
            COPY_ARCH_SRC(src/timer, macos, SDL_systimer.c)
slouken@0
  2214
        fi
slouken@0
  2215
        # The MacOS platform requires special setup
slouken@0
  2216
        SDL_CFLAGS="$SDL_CFLAGS -Dmain=SDL_main"
slouken@0
  2217
        SDL_LIBS="-lSDLmain $SDL_LIBS"
slouken@0
  2218
        ;;
slouken@0
  2219
    *-*-darwin* )
slouken@0
  2220
        # Strictly speaking, we want "Mac OS X", not "Darwin", which is
slouken@158
  2221
        # just the OS X kernel sans upper layers like Carbon and Cocoa.
slouken@158
  2222
        # But config.guess comes back with "darwin", so go with the flow.
slouken@158
  2223
        ARCH=macosx
slouken@1
  2224
        CheckDummyVideo
slouken@68
  2225
        CheckDiskAudio
slouken@158
  2226
        CheckQUARTZ
slouken@0
  2227
        CheckMacGL
slouken@0
  2228
        CheckPTHREAD
slouken@0
  2229
        # Set up files for the main() stub
slouken@194
  2230
        COPY_ARCH_SRC(src/main, macosx, SDLMain.m)
slouken@194
  2231
        COPY_ARCH_SRC(src/main, macosx, SDLMain.h)
slouken@0
  2232
        # Set up files for the audio library
slouken@0
  2233
        if test x$enable_audio = xyes; then
slouken@0
  2234
            AUDIO_SUBDIRS="$AUDIO_SUBDIRS macrom"
slouken@0
  2235
            AUDIO_DRIVERS="$AUDIO_DRIVERS macrom/libaudio_macrom.la"
slouken@0
  2236
        fi
slouken@0
  2237
        # Set up files for the joystick library
slouken@0
  2238
        if test x$enable_joystick = xyes; then
slouken@172
  2239
            JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS darwin"
slouken@172
  2240
            JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS darwin/libjoystick_darwin.la"
slouken@196
  2241
            SDL_LIBS="$SDL_LIBS -framework IOKit"
slouken@0
  2242
        fi
slouken@0
  2243
        # Set up files for the cdrom library
slouken@0
  2244
        if test x$enable_cdrom = xyes; then
slouken@153
  2245
            CDROM_SUBDIRS="$CDROM_SUBDIRS dummy"
slouken@153
  2246
            CDROM_DRIVERS="$CDROM_DRIVERS dummy/libcdrom_dummy.la"
slouken@0
  2247
        fi
slouken@0
  2248
        # Set up files for the thread library
slouken@0
  2249
        if test x$enable_threads = xyes; then
slouken@0
  2250
            COPY_ARCH_SRC(src/thread, linux, SDL_systhread.c)
slouken@0
  2251
            COPY_ARCH_SRC(src/thread, linux, SDL_systhread_c.h)
slouken@0
  2252
            COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex.c)
slouken@0
  2253
            COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex_c.h)
slouken@94
  2254
            if test x$use_pthreads = xyes -a x$have_pthread_sem != xyes; then
slouken@0
  2255
                COPY_ARCH_SRC(src/thread, generic, SDL_syssem.c)
slouken@0
  2256
            else
slouken@0
  2257
                COPY_ARCH_SRC(src/thread, linux, SDL_syssem.c)
slouken@0
  2258
            fi
slouken@0
  2259
            COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
slouken@0
  2260
            COPY_ARCH_SRC(src/thread, generic, SDL_syscond.c)
slouken@0
  2261
            COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
slouken@0
  2262
        fi
slouken@0
  2263
        # Set up files for the timer library
slouken@0
  2264
        if test x$enable_timers = xyes; then
slouken@0
  2265
            COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
slouken@0
  2266
        fi
slouken@0
  2267
        # The MacOS X platform requires special setup
slouken@158
  2268
        SDL_CFLAGS="$SDL_CFLAGS -F/System/Library/Frameworks/Carbon.framework -F/System/Library/Frameworks/Cocoa.framework"
slouken@158
  2269
        SDL_LIBS="-lSDLmain $SDL_LIBS -framework Carbon -framework Cocoa"
slouken@0
  2270
        ;;
slouken@281
  2271
    *-*-mint*)
slouken@281
  2272
        ARCH=mint
slouken@281
  2273
        CheckDummyVideo
slouken@281
  2274
        CheckDiskAudio
slouken@281
  2275
        CheckAtariBiosEvent
slouken@281
  2276
        CheckAtariXbiosVideo
slouken@281
  2277
        CheckAtariGemVideo
slouken@281
  2278
        CheckPTH
slouken@281
  2279
        # Set up files for the main() stub
slouken@281
  2280
        COPY_ARCH_SRC(src/main, linux, SDL_main.c)
slouken@281
  2281
        # Set up files for the audio library
slouken@281
  2282
        if test x$enable_audio = xyes; then
slouken@281
  2283
            AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun"
slouken@281
  2284
            AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la"
slouken@281
  2285
        fi
slouken@281
  2286
        # Set up files for the joystick library
slouken@281
  2287
        if test x$enable_joystick = xyes; then
slouken@302
  2288
            JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS mint"
slouken@302
  2289
            JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS mint/libjoystick_mint.la"
slouken@281
  2290
        fi
slouken@281
  2291
        # Set up files for the cdrom library
slouken@281
  2292
        if test x$enable_cdrom = xyes; then
slouken@281
  2293
            CDROM_SUBDIRS="$CDROM_SUBDIRS dummy"
slouken@281
  2294
            CDROM_DRIVERS="$CDROM_DRIVERS dummy/libcdrom_dummy.la"
slouken@281
  2295
        fi
slouken@281
  2296
        # Set up files for the thread library
slouken@281
  2297
        if test x$enable_threads = xyes; then
slouken@281
  2298
            if test x$enable_pth = xyes; then
slouken@281
  2299
                COPY_ARCH_SRC(src/thread, pth, SDL_systhread.c)
slouken@281
  2300
                COPY_ARCH_SRC(src/thread, pth, SDL_systhread_c.h)
slouken@329
  2301
                COPY_ARCH_SRC(src/thread, pth, SDL_sysmutex.c)
slouken@329
  2302
                COPY_ARCH_SRC(src/thread, pth, SDL_sysmutex_c.h)
slouken@329
  2303
                COPY_ARCH_SRC(src/thread, pth, SDL_syscond.c)
slouken@329
  2304
                COPY_ARCH_SRC(src/thread, pth, SDL_syscond_c.h)
slouken@281
  2305
            else
slouken@281
  2306
                COPY_ARCH_SRC(src/thread, generic, SDL_systhread.c)
slouken@281
  2307
                COPY_ARCH_SRC(src/thread, generic, SDL_systhread_c.h)
slouken@329
  2308
                COPY_ARCH_SRC(src/thread, generic, SDL_sysmutex.c)
slouken@329
  2309
                COPY_ARCH_SRC(src/thread, generic, SDL_sysmutex_c.h)
slouken@329
  2310
                COPY_ARCH_SRC(src/thread, generic, SDL_syscond.c)
slouken@329
  2311
                COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
slouken@281
  2312
            fi
slouken@329
  2313
            COPY_ARCH_SRC(src/thread, generic, SDL_syssem.c)
slouken@281
  2314
            COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
slouken@281
  2315
        fi
slouken@281
  2316
        # Set up files for the timer library
slouken@281
  2317
        if test x$enable_timers = xyes; then
slouken@281
  2318
            COPY_ARCH_SRC(src/timer, mint, SDL_systimer.c)
slouken@281
  2319
            COPY_ARCH_SRC(src/timer, mint, SDL_vbltimer.S)
slouken@281
  2320
            COPY_ARCH_SRC(src/timer, mint, SDL_vbltimer_s.h)
slouken@281
  2321
        fi
slouken@281
  2322
        # MiNT does not define "unix"
slouken@281
  2323
        CFLAGS="$CFLAGS -Dunix"
slouken@281
  2324
        ;;
slouken@0
  2325
    *)
slouken@0
  2326
        AC_MSG_ERROR(Unsupported target:  Please add to configure.in)
slouken@0
  2327
        ;;
slouken@0
  2328
esac
slouken@0
  2329
AC_SUBST(ARCH)
slouken@0
  2330
slouken@0
  2331
# Set the conditional variables for this target
slouken@0
  2332
AM_CONDITIONAL(TARGET_LINUX, test $ARCH = linux)
slouken@0
  2333
AM_CONDITIONAL(TARGET_SOLARIS, test $ARCH = solaris)
slouken@0
  2334
AM_CONDITIONAL(TARGET_IRIX, test $ARCH = irix)
slouken@0
  2335
AM_CONDITIONAL(TARGET_BSDI, test $ARCH = bsdi)
slouken@0
  2336
AM_CONDITIONAL(TARGET_FREEBSD, test $ARCH = freebsd)
slouken@39
  2337
AM_CONDITIONAL(TARGET_NETBSD, test $ARCH = netbsd)
slouken@0
  2338
AM_CONDITIONAL(TARGET_OPENBSD, test $ARCH = openbsd)
slouken@0
  2339
AM_CONDITIONAL(TARGET_AIX, test $ARCH = aix)
slouken@0
  2340
AM_CONDITIONAL(TARGET_WIN32, test $ARCH = win32)
slouken@0
  2341
AM_CONDITIONAL(TARGET_BEOS, test $ARCH = beos)
slouken@0
  2342
AM_CONDITIONAL(TARGET_MACOS, test $ARCH = macos)
slouken@158
  2343
AM_CONDITIONAL(TARGET_MACOSX, test $ARCH = macosx)
slouken@279
  2344
AM_CONDITIONAL(TARGET_QNX, test $ARCH = qnx)
slouken@281
  2345
AM_CONDITIONAL(TARGET_MINT, test $ARCH = mint)
slouken@0
  2346
slouken@0
  2347
# Set conditional variables for shared and static library selection.
slouken@0
  2348
# These are not used in any Makefile.am but in sdl-config.in.
slouken@0
  2349
AM_CONDITIONAL([ENABLE_SHARED], [test "$enable_shared" = yes])
slouken@0
  2350
AM_CONDITIONAL([ENABLE_STATIC], [test "$enable_static" = yes])
slouken@0
  2351
slouken@0
  2352
# Set runtime shared library paths as needed
slouken@0
  2353
slouken@0
  2354
if test $ARCH = linux -o $ARCH = freebsd -o $ARCH = bsdi; then
slouken@0
  2355
  SDL_RLD_FLAGS="-Wl,-rpath,\${exec_prefix}/lib"
slouken@0
  2356
fi
slouken@0
  2357
if test $ARCH = solaris; then
slouken@0
  2358
  SDL_RLD_FLAGS="-R\${exec_prefix}/lib"
slouken@0
  2359
fi
slouken@257
  2360
if test $ARCH = openbsd -o $ARCH = bsdi; then
slouken@257
  2361
    SHARED_SYSTEM_LIBS="$SYSTEM_LIBS"
slouken@257
  2362
else
slouken@257
  2363
    SHARED_SYSTEM_LIBS=""
slouken@1
  2364
fi
slouken@257
  2365
STATIC_SYSTEM_LIBS="$SYSTEM_LIBS"
slouken@1
  2366
slouken@0
  2367
dnl Output the video drivers we use
slouken@0
  2368
if test x$enable_video = xtrue; then
slouken@0
  2369
    if test "$VIDEO_SUBDIRS" = ""; then
slouken@0
  2370
        AC_MSG_ERROR(*** No video drivers are enabled!)
slouken@0
  2371
    fi
slouken@0
  2372
fi
slouken@0
  2373
AC_SUBST(AUDIO_SUBDIRS)
slouken@0
  2374
AC_SUBST(AUDIO_DRIVERS)
slouken@0
  2375
AC_SUBST(VIDEO_SUBDIRS)
slouken@0
  2376
AC_SUBST(VIDEO_DRIVERS)
slouken@0
  2377
AC_SUBST(JOYSTICK_SUBDIRS)
slouken@0
  2378
AC_SUBST(JOYSTICK_DRIVERS)
slouken@153
  2379
AC_SUBST(CDROM_SUBDIRS)
slouken@153
  2380
AC_SUBST(CDROM_DRIVERS)
slouken@0
  2381
AC_SUBST(SDL_EXTRADIRS)
slouken@0
  2382
AC_SUBST(SDL_EXTRALIBS)
slouken@0
  2383
slouken@0
  2384
dnl Expand the cflags and libraries needed by apps using SDL
slouken@0
  2385
AC_SUBST(SDL_CFLAGS)
slouken@0
  2386
AC_SUBST(SDL_LIBS)
slouken@0
  2387
AC_SUBST(SDL_RLD_FLAGS)
slouken@0
  2388
slouken@257
  2389
dnl Expand the libraries needed for static and dynamic linking
slouken@257
  2390
AC_SUBST(STATIC_SYSTEM_LIBS)
slouken@257
  2391
AC_SUBST(SHARED_SYSTEM_LIBS)
slouken@261
  2392
AC_SUBST(SYSTEM_LIBS)
slouken@257
  2393
slouken@0
  2394
dnl Expand the include directories for building SDL
slouken@0
  2395
CFLAGS="$CFLAGS -I\$(top_srcdir)/include"
slouken@0
  2396
CFLAGS="$CFLAGS -I\$(top_srcdir)/include/SDL"
slouken@0
  2397
CFLAGS="$CFLAGS -I\$(top_srcdir)/src -I\$(top_srcdir)/src/$ARCH"
slouken@0
  2398
CFLAGS="$CFLAGS -I\$(top_srcdir)/src/main"
slouken@0
  2399
CFLAGS="$CFLAGS -I\$(top_srcdir)/src/audio"
slouken@0
  2400
CFLAGS="$CFLAGS -I\$(top_srcdir)/src/video"
slouken@292
  2401
CFLAGS="$CFLAGS -I\$(top_srcdir)/src/video/XFree86/extensions"
slouken@0
  2402
CFLAGS="$CFLAGS -I\$(top_srcdir)/src/events"
slouken@0
  2403
CFLAGS="$CFLAGS -I\$(top_srcdir)/src/joystick"
slouken@0
  2404
CFLAGS="$CFLAGS -I\$(top_srcdir)/src/cdrom"
slouken@0
  2405
CFLAGS="$CFLAGS -I\$(top_srcdir)/src/thread"
slouken@0
  2406
CFLAGS="$CFLAGS -I\$(top_srcdir)/src/timer"
slouken@0
  2407
CFLAGS="$CFLAGS -I\$(top_srcdir)/src/endian"
slouken@0
  2408
CFLAGS="$CFLAGS -I\$(top_srcdir)/src/file"
slouken@0
  2409
CXXFLAGS="$CFLAGS"
slouken@0
  2410
slouken@158
  2411
slouken@158
  2412
# Check for darwin at the very end and set up the Objective C compiler
slouken@158
  2413
# We do this here so that we get the full CFLAGS into OBJCFLAGS
slouken@158
  2414
case "$target" in
slouken@158
  2415
    *-*-darwin*)
slouken@158
  2416
        OBJC="cc"
slouken@158
  2417
        OBJCFLAGS="$CFLAGS"
slouken@200
  2418
        OBJCDEPMODE="$CCDEPMODE"
slouken@158
  2419
        AC_SUBST(OBJC)
slouken@158
  2420
        AC_SUBST(OBJCFLAGS)
slouken@200
  2421
        AC_SUBST(OBJCDEPMODE)
slouken@158
  2422
        ;;
slouken@158
  2423
esac
slouken@158
  2424
slouken@0
  2425
# Finally create all the generated files
slouken@0
  2426
dnl Important: Any directory that you want to be in the distcheck should
slouken@0
  2427
dnl            have a file listed here, so that configure generates the
slouken@0
  2428
dnl            subdirectories on the build target.
slouken@0
  2429
AC_OUTPUT([
slouken@0
  2430
Makefile
slouken@0
  2431
docs/Makefile
slouken@0
  2432
docs/html/Makefile
slouken@0
  2433
docs/man3/Makefile
slouken@0
  2434
include/Makefile
slouken@0
  2435
src/Makefile
slouken@0
  2436
src/main/Makefile
slouken@168
  2437
src/main/macosx/Makefile
slouken@172
  2438
src/main/macosx/Info.plist
slouken@0
  2439
src/audio/Makefile
slouken@0
  2440
src/audio/alsa/Makefile
slouken@0
  2441
src/audio/arts/Makefile
slouken@0
  2442
src/audio/baudio/Makefile
slouken@0
  2443
src/audio/dma/Makefile
slouken@0
  2444
src/audio/dmedia/Makefile
slouken@0
  2445
src/audio/dsp/Makefile
slouken@0
  2446
src/audio/esd/Makefile
slouken@0
  2447
src/audio/macrom/Makefile
slouken@0
  2448
src/audio/nas/Makefile
slouken@0
  2449
src/audio/nto/Makefile
slouken@37
  2450
src/audio/openbsd/Makefile
slouken@0
  2451
src/audio/paudio/Makefile
slouken@0
  2452
src/audio/sun/Makefile
slouken@0
  2453
src/audio/ums/Makefile
slouken@0
  2454
src/audio/windib/Makefile
slouken@0
  2455
src/audio/windx5/Makefile
slouken@68
  2456
src/audio/disk/Makefile
slouken@0
  2457
src/video/Makefile
slouken@292
  2458
src/video/XFree86/Makefile
slouken@292
  2459
src/video/XFree86/extensions/Makefile
slouken@292
  2460
src/video/XFree86/Xinerama/Makefile
slouken@292
  2461
src/video/XFree86/Xv/Makefile
slouken@292
  2462
src/video/XFree86/Xxf86dga/Makefile
slouken@292
  2463
src/video/XFree86/Xxf86vm/Makefile
slouken@0
  2464
src/video/cybergfx/Makefile
slouken@0
  2465
src/video/x11/Makefile
slouken@0
  2466
src/video/dga/Makefile
slouken@30
  2467
src/video/nanox/Makefile
slouken@0
  2468
src/video/fbcon/Makefile
slouken@167
  2469
src/video/directfb/Makefile
slouken@70
  2470
src/video/ps2gs/Makefile
slouken@0
  2471
src/video/ggi/Makefile
slouken@0
  2472
src/video/maccommon/Makefile
slouken@0
  2473
src/video/macdsp/Makefile
slouken@0
  2474
src/video/macrom/Makefile
slouken@47
  2475
src/video/quartz/Makefile
slouken@0
  2476
src/video/svga/Makefile
slouken@75
  2477
src/video/vgl/Makefile
slouken@0
  2478
src/video/aalib/Makefile
slouken@0
  2479
src/video/wincommon/Makefile
slouken@0
  2480
src/video/windib/Makefile
slouken@0
  2481
src/video/windx5/Makefile
slouken@0
  2482
src/video/bwindow/Makefile
slouken@0
  2483
src/video/photon/Makefile
slouken@174
  2484
src/video/epoc/Makefile
slouken@1
  2485
src/video/dummy/Makefile
slouken@281
  2486
src/video/ataricommon/Makefile
slouken@281
  2487
src/video/xbios/Makefile
slouken@281
  2488
src/video/gem/Makefile
slouken@0
  2489
src/events/Makefile
slouken@0
  2490
src/joystick/Makefile
slouken@21
  2491
src/joystick/amigaos/Makefile
slouken@0
  2492
src/joystick/beos/Makefile
slouken@281
  2493
src/joystick/bsd/Makefile
slouken@172
  2494
src/joystick/darwin/Makefile
slouken@0
  2495
src/joystick/dummy/Makefile
slouken@0
  2496
src/joystick/linux/Makefile
slouken@0
  2497
src/joystick/macos/Makefile
slouken@302
  2498
src/joystick/mint/Makefile
slouken@0
  2499
src/joystick/win32/Makefile
slouken@0
  2500
src/cdrom/Makefile
slouken@153
  2501
src/cdrom/aix/Makefile
slouken@153
  2502
src/cdrom/beos/Makefile
slouken@153
  2503
src/cdrom/dummy/Makefile
slouken@178
  2504
src/cdrom/bsdi/Makefile
slouken@153
  2505
src/cdrom/freebsd/Makefile
slouken@153
  2506
src/cdrom/linux/Makefile
slouken@153
  2507
src/cdrom/macos/Makefile
slouken@153
  2508
src/cdrom/openbsd/Makefile
slouken@153
  2509
src/cdrom/qnx/Makefile
slouken@153
  2510
src/cdrom/win32/Makefile
slouken@0
  2511
src/thread/Makefile
slouken@0
  2512
src/timer/Makefile
slouken@0
  2513
src/endian/Makefile
slouken@0
  2514
src/file/Makefile
slouken@0
  2515
src/hermes/Makefile
slouken@0
  2516
sdl-config
slouken@0
  2517
SDL.spec
slouken@0
  2518
], [chmod +x sdl-config])