configure.in
author Sam Lantinga <slouken@lokigames.com>
Sun, 27 May 2001 00:24:43 +0000
changeset 41 8de9e8baaecc
parent 39 a6a2fbe66fd1
child 42 eb1459f3a3ae
permissions -rw-r--r--
*** empty log message ***
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@1
    17
SDL_MICRO_VERSION=1
slouken@1
    18
SDL_INTERFACE_AGE=1
slouken@1
    19
SDL_BINARY_AGE=1
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 Setup for automake
slouken@0
    41
AM_INIT_AUTOMAKE(SDL, $SDL_VERSION)
slouken@0
    42
slouken@0
    43
dnl Detect the canonical host and target build environment
slouken@0
    44
AC_CANONICAL_HOST
slouken@0
    45
AC_CANONICAL_TARGET
slouken@0
    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@0
    55
case "$target" in
slouken@0
    56
    *-*-beos*)
slouken@0
    57
        AC_PROG_CXX
slouken@0
    58
        ;;
slouken@0
    59
    *-*-aix*)
slouken@0
    60
        AC_PROG_CXX
slouken@0
    61
        ;;
slouken@0
    62
    # This is stupid, but necessary on some versions of Linux (joysticks)
slouken@0
    63
    *-*-linux*)
slouken@0
    64
        AC_PROG_CXX
slouken@0
    65
        ;;
slouken@0
    66
esac
slouken@0
    67
AC_PROG_INSTALL
slouken@0
    68
AC_FUNC_ALLOCA
slouken@0
    69
slouken@0
    70
dnl The alpha architecture needs special flags for binary portability
slouken@0
    71
case "$target" in
slouken@0
    72
    alpha*-*-linux*)
slouken@0
    73
        if test x$ac_cv_prog_gcc = xyes; then
slouken@0
    74
            CFLAGS="$CFLAGS -mcpu=ev4 -Wa,-mall"
slouken@0
    75
        fi
slouken@0
    76
        ;;
slouken@0
    77
esac
slouken@0
    78
slouken@0
    79
dnl Add compiler-specific optimization flags
slouken@0
    80
slouken@0
    81
dnl See if the user wants aggressive optimizations of the code
slouken@0
    82
AC_ARG_ENABLE(debug,
slouken@0
    83
[  --enable-debug          Disable aggressive optimizations [default=yes]],
slouken@0
    84
              , enable_debug=yes)
slouken@0
    85
if test x$enable_debug != xyes; then
slouken@0
    86
    if test x$ac_cv_prog_gcc = xyes; then
slouken@0
    87
        CFLAGS="$CFLAGS -fexpensive-optimizations"
slouken@0
    88
        # Ack! This breaks the MMX YV12 conversion on gcc 2.95.2
slouken@0
    89
        # CFLAGS="$CFLAGS -fomit-frame-pointer"
slouken@0
    90
    fi
slouken@0
    91
    case "$target" in
slouken@0
    92
        i486-*-*)
slouken@0
    93
            if test x$ac_cv_prog_gcc = xyes; then
slouken@0
    94
                CFLAGS="$CFLAGS -march=486"
slouken@0
    95
            fi
slouken@0
    96
            ;;
slouken@0
    97
        i?86-*-*)
slouken@0
    98
            if test x$ac_cv_prog_gcc = xyes; then
slouken@0
    99
                CFLAGS="$CFLAGS -march=pentium -mcpu=pentiumpro"
slouken@0
   100
            fi
slouken@0
   101
            ;;
slouken@0
   102
        *-*-osf*)
slouken@0
   103
            if test x$ac_cv_prog_gcc != xyes; then
slouken@0
   104
                CFLAGS="-g3 -fast -arch host"
slouken@0
   105
            fi
slouken@0
   106
            ;;
slouken@0
   107
    esac
slouken@0
   108
fi
slouken@0
   109
slouken@0
   110
dnl Add verbose warnings by default, and allow ANSI compliance checking
slouken@0
   111
AC_ARG_ENABLE(strict-ansi,
slouken@0
   112
[  --enable-strict-ansi    Enable strict ANSI compliance build [default=no]],
slouken@0
   113
              , enable_strict_ansi=no)
slouken@0
   114
if test x$ac_cv_prog_gcc = xyes; then
slouken@0
   115
    CFLAGS="$CFLAGS -Wall"
slouken@0
   116
    if test x$enable_strict_ansi = xyes; then
slouken@0
   117
        CFLAGS="$CFLAGS -ansi -pedantic -D_XOPEN_SOURCE"
slouken@0
   118
    fi
slouken@0
   119
fi
slouken@0
   120
slouken@0
   121
dnl Initialize the compiler and linker flags for SDL applications
slouken@0
   122
slouken@0
   123
SDL_CFLAGS=""
slouken@0
   124
SDL_LIBS="-lSDL"
slouken@0
   125
slouken@0
   126
dnl Add the math library for the new gamma correction support
slouken@0
   127
slouken@0
   128
case "$target" in
slouken@0
   129
    *-*-cygwin* | *-*-mingw32*)
slouken@0
   130
        MATHLIB=""
slouken@0
   131
        ;;
slouken@0
   132
    *-*-beos*)
slouken@0
   133
        MATHLIB=""
slouken@0
   134
        ;;
slouken@0
   135
    *-*-darwin*)
slouken@0
   136
        MATHLIB=""
slouken@0
   137
        ;;
slouken@0
   138
    *)
slouken@0
   139
        MATHLIB="-lm"
slouken@0
   140
        ;;
slouken@0
   141
esac
slouken@0
   142
SYSTEM_LIBS="$SYSTEM_LIBS $MATHLIB"
slouken@0
   143
slouken@0
   144
dnl Enable/disable various subsystems of the SDL library
slouken@0
   145
slouken@0
   146
AC_ARG_ENABLE(audio,
slouken@0
   147
[  --enable-audio          Enable the audio subsystem [default=yes]],
slouken@0
   148
              , enable_audio=yes)
slouken@0
   149
if test x$enable_audio = xyes; then
slouken@0
   150
    SDL_EXTRADIRS="$SDL_EXTRADIRS audio"
slouken@0
   151
    SDL_EXTRALIBS="$SDL_EXTRALIBS audio/libaudio.la"
slouken@0
   152
else
slouken@0
   153
    CFLAGS="$CFLAGS -DDISABLE_AUDIO"
slouken@0
   154
fi
slouken@0
   155
AC_ARG_ENABLE(video,
slouken@0
   156
[  --enable-video          Enable the video subsystem [default=yes]],
slouken@0
   157
              , enable_video=yes)
slouken@0
   158
if test x$enable_video = xyes; then
slouken@0
   159
    SDL_EXTRADIRS="$SDL_EXTRADIRS video"
slouken@0
   160
    SDL_EXTRALIBS="$SDL_EXTRALIBS video/libvideo.la"
slouken@0
   161
else
slouken@0
   162
    CFLAGS="$CFLAGS -DDISABLE_VIDEO"
slouken@0
   163
fi
slouken@0
   164
AC_ARG_ENABLE(events,
slouken@0
   165
[  --enable-events         Enable the events subsystem [default=yes]],
slouken@0
   166
              , enable_events=yes)
slouken@0
   167
if test x$enable_video = xyes -a x$enable_events = xyes; then
slouken@0
   168
    SDL_EXTRADIRS="$SDL_EXTRADIRS events"
slouken@0
   169
    SDL_EXTRALIBS="$SDL_EXTRALIBS events/libevents.la"
slouken@0
   170
else
slouken@0
   171
    CFLAGS="$CFLAGS -DDISABLE_EVENTS"
slouken@0
   172
fi
slouken@0
   173
AC_ARG_ENABLE(joystick,
slouken@0
   174
[  --enable-joystick       Enable the joystick subsystem [default=yes]],
slouken@0
   175
              , enable_joystick=yes)
slouken@0
   176
if test x$enable_joystick = xyes; then
slouken@0
   177
    SDL_EXTRADIRS="$SDL_EXTRADIRS joystick"
slouken@0
   178
    SDL_EXTRALIBS="$SDL_EXTRALIBS joystick/libjoystick.la"
slouken@0
   179
else
slouken@0
   180
    CFLAGS="$CFLAGS -DDISABLE_JOYSTICK"
slouken@0
   181
fi
slouken@0
   182
AC_ARG_ENABLE(cdrom,
slouken@0
   183
[  --enable-cdrom          Enable the cdrom subsystem [default=yes]],
slouken@0
   184
              , enable_cdrom=yes)
slouken@0
   185
if test x$enable_cdrom = xyes; then
slouken@0
   186
    SDL_EXTRADIRS="$SDL_EXTRADIRS cdrom"
slouken@0
   187
    SDL_EXTRALIBS="$SDL_EXTRALIBS cdrom/libcdrom.la"
slouken@0
   188
else
slouken@0
   189
    CFLAGS="$CFLAGS -DDISABLE_CDROM"
slouken@0
   190
fi
slouken@0
   191
AC_ARG_ENABLE(threads,
slouken@0
   192
[  --enable-threads        Enable the threading subsystem [default=yes]],
slouken@0
   193
              , enable_threads=yes)
slouken@0
   194
SDL_EXTRADIRS="$SDL_EXTRADIRS thread"
slouken@0
   195
SDL_EXTRALIBS="$SDL_EXTRALIBS thread/libthread.la"
slouken@0
   196
if test x$enable_threads != xyes; then
slouken@0
   197
    CFLAGS="$CFLAGS -DDISABLE_THREADS"
slouken@0
   198
    COPY_ARCH_SRC(src/thread, generic, SDL_systhread.c)
slouken@0
   199
    COPY_ARCH_SRC(src/thread, generic, SDL_systhread_c.h)
slouken@0
   200
    COPY_ARCH_SRC(src/thread, generic, SDL_sysmutex.c)
slouken@0
   201
    COPY_ARCH_SRC(src/thread, generic, SDL_sysmutex_c.h)
slouken@0
   202
    COPY_ARCH_SRC(src/thread, generic, SDL_syssem.c)
slouken@0
   203
    COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
slouken@0
   204
    COPY_ARCH_SRC(src/thread, generic, SDL_syscond.c)
slouken@0
   205
    COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
slouken@0
   206
fi
slouken@0
   207
AC_ARG_ENABLE(timers,
slouken@0
   208
[  --enable-timers         Enable the timer subsystem [default=yes]],
slouken@0
   209
              , enable_timers=yes)
slouken@0
   210
if test x$enable_timers = xyes; then
slouken@0
   211
    SDL_EXTRADIRS="$SDL_EXTRADIRS timer"
slouken@0
   212
    SDL_EXTRALIBS="$SDL_EXTRALIBS timer/libtimer.la"
slouken@0
   213
else
slouken@0
   214
    CFLAGS="$CFLAGS -DDISABLE_TIMERS"
slouken@0
   215
fi
slouken@0
   216
AC_ARG_ENABLE(endian,
slouken@0
   217
[  --enable-endian         Enable the endian subsystem [default=yes]],
slouken@0
   218
              , enable_endian=yes)
slouken@0
   219
if test x$enable_endian = xyes; then
slouken@0
   220
    SDL_EXTRADIRS="$SDL_EXTRADIRS endian"
slouken@0
   221
    SDL_EXTRALIBS="$SDL_EXTRALIBS endian/libendian.la"
slouken@0
   222
else
slouken@0
   223
    CFLAGS="$CFLAGS -DDISABLE_ENDIAN"
slouken@0
   224
fi
slouken@0
   225
AC_ARG_ENABLE(file,
slouken@0
   226
[  --enable-file           Enable the file subsystem [default=yes]],
slouken@0
   227
              , enable_file=yes)
slouken@0
   228
if test x$enable_file = xyes; then
slouken@0
   229
    SDL_EXTRADIRS="$SDL_EXTRADIRS file"
slouken@0
   230
    SDL_EXTRALIBS="$SDL_EXTRALIBS file/libfile.la"
slouken@0
   231
else
slouken@0
   232
    CFLAGS="$CFLAGS -DDISABLE_FILE"
slouken@0
   233
fi
slouken@0
   234
slouken@0
   235
dnl See if the OSS audio interface is supported
slouken@0
   236
CheckOSS()
slouken@0
   237
{
slouken@0
   238
    AC_ARG_ENABLE(oss,
slouken@0
   239
[  --enable-oss            support the OSS audio API [default=yes]],
slouken@0
   240
                  , enable_oss=yes)
slouken@0
   241
    if test x$enable_audio = xyes -a x$enable_oss = xyes; then
slouken@0
   242
        AC_MSG_CHECKING(for OSS audio support)
slouken@0
   243
        have_oss=no
slouken@0
   244
        AC_TRY_COMPILE([
slouken@0
   245
          #include <sys/soundcard.h>
slouken@0
   246
        ],[
slouken@41
   247
          int arg = SNDCTL_DSP_SETFRAGMENT;
slouken@0
   248
        ],[
slouken@0
   249
        have_oss=yes
slouken@0
   250
        ])
slouken@0
   251
        AC_MSG_RESULT($have_oss)
slouken@0
   252
        if test x$have_oss = xyes; then
slouken@0
   253
            CFLAGS="$CFLAGS -DOSS_SUPPORT"
slouken@0
   254
            AUDIO_SUBDIRS="$AUDIO_SUBDIRS dsp"
slouken@0
   255
            AUDIO_DRIVERS="$AUDIO_DRIVERS dsp/libaudio_dsp.la"
slouken@0
   256
            AUDIO_SUBDIRS="$AUDIO_SUBDIRS dma"
slouken@0
   257
            AUDIO_DRIVERS="$AUDIO_DRIVERS dma/libaudio_dma.la"
slouken@0
   258
        fi
slouken@0
   259
    fi
slouken@0
   260
}
slouken@0
   261
slouken@0
   262
dnl See if the ALSA audio interface is supported
slouken@0
   263
CheckALSA()
slouken@0
   264
{
slouken@0
   265
    AC_ARG_ENABLE(alsa,
slouken@0
   266
[  --enable-alsa           support the ALSA audio API [default=yes]],
slouken@0
   267
                  , enable_alsa=yes)
slouken@0
   268
    if test x$enable_audio = xyes -a x$enable_alsa = xyes; then
slouken@0
   269
        have_alsa=no
slouken@0
   270
        AC_CHECK_HEADER(sys/asoundlib.h, have_alsa_hdr=yes)
slouken@0
   271
        AC_CHECK_LIB(asound, snd_pcm_open, have_alsa_lib=yes)
slouken@0
   272
        if test x$have_alsa_hdr = xyes -a x$have_alsa_lib = xyes; then
slouken@0
   273
            CFLAGS="$CFLAGS -DALSA_SUPPORT"
slouken@0
   274
            SYSTEM_LIBS="$SYSTEM_LIBS -lasound"
slouken@0
   275
            AUDIO_SUBDIRS="$AUDIO_SUBDIRS alsa"
slouken@0
   276
            AUDIO_DRIVERS="$AUDIO_DRIVERS alsa/libaudio_alsa.la"
slouken@0
   277
        fi
slouken@0
   278
    fi
slouken@0
   279
}
slouken@0
   280
slouken@37
   281
dnl Check whether we want to use OpenBSD native audio or not
slouken@37
   282
CheckOPENBSDAUDIO()
slouken@37
   283
{
slouken@37
   284
    AC_ARG_ENABLE(openbsdaudio,
slouken@37
   285
[  --enable-openbsdaudio   OpenBSD native audio support [default=no]],
slouken@37
   286
                  , enable_openbsdaudio=no)
slouken@37
   287
    if test x$enable_audio = xyes -a x$enable_openbsdaudio = xyes; then
slouken@37
   288
        SYSTEM_LIBS="$SYSTEM_LIBS $ESD_LIBS"
slouken@37
   289
        AUDIO_SUBDIRS="$AUDIO_SUBDIRS openbsd"
slouken@37
   290
        AUDIO_DRIVERS="$AUDIO_DRIVERS openbsd/libaudio_openbsd.la"
slouken@37
   291
    fi
slouken@37
   292
}
slouken@37
   293
slouken@0
   294
dnl Find the ESD includes and libraries
slouken@0
   295
CheckESD()
slouken@0
   296
{
slouken@0
   297
    AC_ARG_ENABLE(esd,
slouken@0
   298
[  --enable-esd            support the Enlightened Sound Daemon [default=yes]],
slouken@0
   299
                  , enable_esd=yes)
slouken@0
   300
    if test x$enable_audio = xyes -a x$enable_esd = xyes; then
slouken@0
   301
        AM_PATH_ESD(0.2.8, [
slouken@0
   302
            CFLAGS="$CFLAGS -DESD_SUPPORT $ESD_CFLAGS"
slouken@0
   303
            SYSTEM_LIBS="$SYSTEM_LIBS $ESD_LIBS"
slouken@0
   304
            AUDIO_SUBDIRS="$AUDIO_SUBDIRS esd"
slouken@0
   305
            AUDIO_DRIVERS="$AUDIO_DRIVERS esd/libaudio_esd.la"
slouken@0
   306
        ])
slouken@0
   307
    fi
slouken@0
   308
}
slouken@0
   309
slouken@0
   310
CheckARTSC()
slouken@0
   311
{
slouken@0
   312
    AC_ARG_ENABLE(arts,
slouken@0
   313
[  --enable-arts           support the Analog Real Time Synthesizer [default=yes]],
slouken@0
   314
                  , enable_arts=yes)
slouken@0
   315
    if test x$enable_audio = xyes -a x$enable_arts = xyes; then
slouken@0
   316
        AC_PATH_PROG(ARTSCCONFIG, artsc-config)
slouken@0
   317
        if test x$ARTSCCONFIG = x -o x$ARTSCCONFIG = x'"$ARTSCCONFIG"'; then
slouken@0
   318
            : # arts isn't installed
slouken@0
   319
        else
slouken@0
   320
            ARTSC_CFLAGS=`$ARTSCCONFIG --cflags`
slouken@0
   321
            ARTSC_LIBS=`$ARTSCCONFIG --libs`
slouken@0
   322
            AC_MSG_CHECKING(for aRts development environment)
slouken@0
   323
            audio_arts=no
slouken@0
   324
            save_CFLAGS="$CFLAGS"
slouken@0
   325
            CFLAGS="$CFLAGS $ARTSC_CFLAGS"
slouken@0
   326
            AC_TRY_COMPILE([
slouken@0
   327
             #include <artsc.h>
slouken@0
   328
            ],[
slouken@0
   329
             arts_stream_t stream;
slouken@0
   330
            ],[
slouken@0
   331
            audio_arts=yes
slouken@0
   332
            ])
slouken@0
   333
            CFLAGS="$save_CFLAGS"
slouken@0
   334
            AC_MSG_RESULT($audio_arts)
slouken@0
   335
            if test x$audio_arts = xyes; then
slouken@0
   336
                CFLAGS="$CFLAGS -DARTSC_SUPPORT $ARTSC_CFLAGS"
slouken@0
   337
                SYSTEM_LIBS="$SYSTEM_LIBS $ARTSC_LIBS"
slouken@0
   338
                AUDIO_SUBDIRS="$AUDIO_SUBDIRS arts"
slouken@0
   339
                AUDIO_DRIVERS="$AUDIO_DRIVERS arts/libaudio_arts.la"
slouken@0
   340
            fi
slouken@0
   341
        fi
slouken@0
   342
    fi
slouken@0
   343
}
slouken@0
   344
slouken@0
   345
dnl See if the NAS audio interface is supported
slouken@0
   346
CheckNAS()
slouken@0
   347
{
slouken@0
   348
    AC_ARG_ENABLE(nas,
slouken@16
   349
[  --enable-nas		  support the NAS audio API [default=yes]],
slouken@41
   350
                  , enable_nas=yes)
slouken@0
   351
    if test x$enable_audio = xyes -a x$enable_nas = xyes; then
slouken@41
   352
        AC_MSG_CHECKING(for NAS audio support)
slouken@41
   353
        have_nas=no
slouken@41
   354
        if test -r /usr/X11R6/include/audio/audiolib.h; then
slouken@41
   355
            have_nas=yes
slouken@41
   356
        fi
slouken@41
   357
        AC_MSG_RESULT($have_nas)
slouken@41
   358
        if test x$have_nas = xyes; then
slouken@41
   359
            CFLAGS="$CFLAGS -DNAS_SUPPORT"
slouken@41
   360
            SYSTEM_LIBS="$SYSTEM_LIBS -laudio -lXt"
slouken@41
   361
            AUDIO_SUBDIRS="$AUDIO_SUBDIRS nas"
slouken@41
   362
            AUDIO_DRIVERS="$AUDIO_DRIVERS nas/libaudio_nas.la"
slouken@41
   363
        fi
slouken@0
   364
    fi
slouken@0
   365
}
slouken@0
   366
slouken@0
   367
dnl See if we can use x86 assembly blitters
slouken@0
   368
CheckNASM()
slouken@0
   369
{
slouken@0
   370
    dnl Make sure we are running on an x86 platform
slouken@0
   371
    case $target in
slouken@0
   372
        i?86*)
slouken@0
   373
            ;;
slouken@0
   374
        *)
slouken@0
   375
        # Nope, bail early.
slouken@0
   376
            return
slouken@0
   377
            ;;
slouken@0
   378
    esac
slouken@0
   379
    dnl Check for NASM (for assembly blit routines)
slouken@0
   380
    AC_ARG_ENABLE(nasm,
slouken@0
   381
[  --enable-nasm           use nasm assembly blitters on x86 [default=yes]],
slouken@0
   382
                  , enable_nasm=yes)
slouken@0
   383
    if test x$enable_video = xyes -a x$enable_nasm = xyes; then
slouken@0
   384
        AC_PATH_PROG(NASM, nasm)
slouken@0
   385
        if test x$NASM = x -o x$NASM = x'"$NASM"'; then
slouken@0
   386
            : # nasm isn't installed
slouken@0
   387
        else
slouken@0
   388
            CFLAGS="$CFLAGS -DUSE_ASMBLIT -I$srcdir/hermes"
slouken@0
   389
            case $ARCH in
slouken@0
   390
              win32)
slouken@0
   391
                  NASMFLAGS="-f win32"
slouken@0
   392
                  ;;
slouken@0
   393
              *)
slouken@0
   394
                  NASMFLAGS="-f elf"
slouken@0
   395
                  ;;
slouken@0
   396
            esac
slouken@0
   397
            AC_SUBST(NASMFLAGS)
slouken@0
   398
            CFLAGS="$CFLAGS -I\$(top_srcdir)/src/hermes"
slouken@0
   399
            SDL_EXTRADIRS="$SDL_EXTRADIRS hermes"
slouken@0
   400
            SDL_EXTRALIBS="$SDL_EXTRALIBS hermes/libhermes.la"
slouken@0
   401
        fi
slouken@0
   402
    fi
slouken@0
   403
}
slouken@0
   404
slouken@30
   405
dnl Find the nanox include and library directories
slouken@30
   406
CheckNANOX()
slouken@30
   407
{
slouken@30
   408
	AC_ARG_ENABLE(video-nanox,
slouken@30
   409
		[  --enable-video-nanox use nanox video driver [default=no]],
slouken@30
   410
	        , enable_video_nanox=no)
slouken@30
   411
	AC_ARG_ENABLE(nanox-debug,  
slouken@30
   412
		[  --enable-nanox-debug print debug messages [default=no]],
slouken@30
   413
		, enable_nanox_debug=no)
slouken@30
   414
	AC_ARG_ENABLE(nanox-share-memory,  
slouken@30
   415
		[  --enable-nanox-share-memory use share memory [default=no]],
slouken@30
   416
		, enable_nanox_share_memory=no)
slouken@30
   417
slouken@30
   418
	AC_ARG_WITH(nanox_pixel_type, 
slouken@30
   419
		[  --with-nanox-pixel-type=[rgb/0888/888/565/555/332/pal]])
slouken@30
   420
slouken@30
   421
	if test x$enable_video = xyes -a x$enable_video_nanox = xyes; then
slouken@30
   422
		if test x$enable_nanox_debug = xyes; then
slouken@30
   423
			CFLAGS="$CFLAGS -DENABLE_NANOX_DEBUG"
slouken@30
   424
		fi
slouken@30
   425
slouken@30
   426
		if test x$enable_nanox_share_memory = xyes; then
slouken@30
   427
			CFLAGS="$CFLAGS -DNANOX_SHARE_MEMORY"
slouken@30
   428
		fi
slouken@30
   429
slouken@30
   430
		case "$with_nanox_pixel_type" in
slouken@30
   431
			 rgb) CFLAGS="$CFLAGS -DNANOX_PIXEL_RGB" ;;
slouken@30
   432
			0888) CFLAGS="$CFLAGS -DNANOX_PIXEL_0888" ;;
slouken@30
   433
			 888) CFLAGS="$CFLAGS -DNANOX_PIXEL_888"  ;;
slouken@30
   434
			 565) CFLAGS="$CFLAGS -DNANOX_PIXEL_565"  ;;
slouken@30
   435
			 555) CFLAGS="$CFLAGS -DNANOX_PIXEL_555"  ;;
slouken@30
   436
			 332) CFLAGS="$CFLAGS -DNANOX_PIXEL_332"  ;;
slouken@30
   437
			 pal) CFLAGS="$CFLAGS -DNANOX_PIXEL_PAL"  ;;
slouken@30
   438
			   *) AC_MSG_ERROR([Invalid nanox_pixel_type]);;
slouken@30
   439
		esac
slouken@30
   440
slouken@30
   441
		CFLAGS="$CFLAGS $X_CFLAGS -DENABLE_NANOX"
slouken@30
   442
		SYSTEM_LIBS="$SYSTEM_LIBS -lnano-X"
slouken@30
   443
		VIDEO_SUBDIRS="$VIDEO_SUBDIRS nanox"
slouken@30
   444
		VIDEO_DRIVERS="$VIDEO_DRIVERS nanox/libvideo_nanox.la"
slouken@30
   445
	fi
slouken@30
   446
}
slouken@30
   447
slouken@0
   448
dnl Find the X11 include and library directories
slouken@0
   449
CheckX11()
slouken@0
   450
{
slouken@0
   451
    AC_ARG_ENABLE(video-x11,
slouken@0
   452
[  --enable-video-x11      use X11 video driver [default=yes]],
slouken@0
   453
                  , enable_video_x11=yes)
slouken@0
   454
    if test x$enable_video = xyes -a x$enable_video_x11 = xyes; then
slouken@0
   455
        AC_PATH_X
slouken@0
   456
        AC_PATH_XTRA
slouken@0
   457
        if test x$have_x = xyes; then
slouken@0
   458
            CFLAGS="$CFLAGS $X_CFLAGS -DENABLE_X11"
slouken@0
   459
            if test x$ac_cv_func_shmat != xyes; then
slouken@0
   460
                CFLAGS="$CFLAGS -DNO_SHARED_MEMORY"
slouken@0
   461
            fi
slouken@0
   462
            SYSTEM_LIBS="$SYSTEM_LIBS $X_LIBS -lX11 -lXext"
slouken@0
   463
            VIDEO_SUBDIRS="$VIDEO_SUBDIRS x11"
slouken@0
   464
            VIDEO_DRIVERS="$VIDEO_DRIVERS x11/libvideo_x11.la"
slouken@0
   465
slouken@0
   466
            AC_ARG_ENABLE(video-x11-vm,
slouken@0
   467
[  --enable-video-x11-vm   use X11 VM extension for fullscreen [default=yes]],
slouken@0
   468
                          , enable_video_x11_vm=yes)
slouken@0
   469
            if test x$enable_video_x11_vm = xyes; then
slouken@0
   470
                AC_MSG_CHECKING(for XFree86 VidMode 1.0 support)
slouken@0
   471
                video_x11_vm=no
slouken@0
   472
                AC_TRY_COMPILE([
slouken@0
   473
                 #include <X11/Xlib.h>
slouken@0
   474
                 #include <X11/extensions/xf86vmode.h>
slouken@0
   475
                ],[
slouken@0
   476
                ],[
slouken@0
   477
                video_x11_vm=yes
slouken@0
   478
                ])
slouken@0
   479
                AC_MSG_RESULT($video_x11_vm)
slouken@0
   480
                if test x$video_x11_vm = xyes; then
slouken@0
   481
                    CFLAGS="$CFLAGS -DXFREE86_VM"
slouken@0
   482
                    # Check for nasty XFree86 4.0/Glide hack
slouken@0
   483
                    AC_ARG_ENABLE(xfree86_glidehack,
slouken@0
   484
[  --enable-xfree86-glidehack Alternate vidmode lib for old Glide [default=no]],
slouken@0
   485
                                  , enable_xfreeglidehack=no)
slouken@0
   486
                    if test x$enable_xfree86_glidehack = xyes; then
slouken@0
   487
                        ac_save_libs="$LIBS"
slouken@0
   488
                        LIBS="$LIBS $X_LIBS -lX11 -lXext"
slouken@0
   489
                        if test x$xfree86_glidehack = x; then
slouken@0
   490
                            AC_CHECK_LIB(Xxf86vm, XF40VidModeQueryExtension, xfree86_glidehack=Xxf86vm)
slouken@0
   491
                        fi
slouken@0
   492
                        if test x$xfree86_glidehack = x; then
slouken@0
   493
                            AC_CHECK_LIB(Xxf86vm40, XF40VidModeQueryExtension, xfree86_glidehack=Xxf86vm40)
slouken@0
   494
                        fi
slouken@0
   495
                        LIBS="$ac_save_libs"
slouken@0
   496
                    fi
slouken@0
   497
                    if test x$xfree86_glidehack != x; then
slouken@0
   498
                        CFLAGS="$CFLAGS -DXFREE86_VM_DYNAMIC_HACK"
slouken@0
   499
                        SYSTEM_LIBS="$SYSTEM_LIBS -l$xfree86_glidehack"
slouken@0
   500
                    else
slouken@0
   501
                        SYSTEM_LIBS="$SYSTEM_LIBS -lXxf86vm"
slouken@0
   502
                    fi
slouken@0
   503
                    AC_MSG_CHECKING(for XFree86 VidMode gamma support)
slouken@0
   504
                    video_x11_vmgamma=no
slouken@0
   505
                    AC_TRY_COMPILE([
slouken@0
   506
                     #include <X11/Xlib.h>
slouken@0
   507
                     #include <X11/extensions/xf86vmode.h>
slouken@0
   508
                    ],[
slouken@0
   509
                     XF86VidModeGamma gamma;
slouken@0
   510
                    ],[
slouken@0
   511
                    video_x11_vmgamma=yes
slouken@0
   512
                    ])
slouken@0
   513
                    AC_MSG_RESULT($video_x11_vmgamma)
slouken@0
   514
                    if test x$video_x11_vmgamma = xyes; then
slouken@0
   515
                        CFLAGS="$CFLAGS -DXFREE86_VMGAMMA"
slouken@0
   516
                    fi
slouken@0
   517
                fi
slouken@0
   518
            fi
slouken@16
   519
            AC_ARG_ENABLE(dga,
slouken@16
   520
[  --enable-dga            allow use of X11 DGA code [default=yes]],
slouken@16
   521
                          , enable_dga=yes)
slouken@0
   522
            AC_ARG_ENABLE(video-x11-dgamouse,
slouken@0
   523
[  --enable-video-x11-dgamouse  use X11 DGA for mouse events [default=yes]],
slouken@0
   524
                          , enable_video_x11_dgamouse=yes)
slouken@16
   525
            if test x$enable_dga = xyes; then
slouken@16
   526
                AC_MSG_CHECKING(for XFree86 DGA 1.0 support)
slouken@16
   527
                video_x11_dga=no
slouken@16
   528
                AC_TRY_COMPILE([
slouken@16
   529
                 #include <X11/Xlib.h>
slouken@16
   530
                 #include <X11/extensions/xf86dga.h>
slouken@16
   531
                ],[
slouken@16
   532
                ],[
slouken@16
   533
                video_x11_dga=yes
slouken@16
   534
                ])
slouken@16
   535
                AC_MSG_RESULT($video_x11_dga)
slouken@16
   536
                if test x$video_x11_dga = xyes; then
slouken@16
   537
                    CFLAGS="$CFLAGS -DXFREE86_DGAMOUSE"
slouken@16
   538
                    if test x$enable_video_x11_dgamouse = xyes; then
slouken@16
   539
                        CFLAGS="$CFLAGS -DDEFAULT_DGAMOUSE"
slouken@16
   540
                    fi
slouken@16
   541
                    SYSTEM_LIBS="$SYSTEM_LIBS -lXxf86dga"
slouken@0
   542
                fi
slouken@0
   543
            fi
slouken@0
   544
            AC_ARG_ENABLE(video-x11-xv,
slouken@0
   545
[  --enable-video-x11-xv   use X11 XvImage extension for video [default=yes]],
slouken@0
   546
                          , enable_video_x11_xv=yes)
slouken@0
   547
            if test x$enable_video_x11_xv = xyes; then
slouken@0
   548
                AC_MSG_CHECKING(for XFree86 XvImage support)
slouken@0
   549
                video_x11_xv=no
slouken@0
   550
                AC_TRY_COMPILE([
slouken@0
   551
                 #include <X11/Xlib.h>
slouken@0
   552
                 #include <sys/ipc.h>
slouken@0
   553
                 #include <sys/shm.h>
slouken@0
   554
                 #include <X11/extensions/XShm.h>
slouken@0
   555
                 #include <X11/extensions/Xvlib.h>
slouken@0
   556
                ],[
slouken@0
   557
                 XvImage *image;
slouken@0
   558
                ],[
slouken@0
   559
                video_x11_xv=yes
slouken@0
   560
                ])
slouken@0
   561
                AC_MSG_RESULT($video_x11_xv)
slouken@0
   562
                if test x$video_x11_xv = xyes; then
slouken@0
   563
                    CFLAGS="$CFLAGS -DXFREE86_XV"
slouken@0
   564
                    SYSTEM_LIBS="$SYSTEM_LIBS -lXv"
slouken@0
   565
                fi
slouken@0
   566
            fi
slouken@0
   567
        fi
slouken@0
   568
    fi
slouken@0
   569
}
slouken@0
   570
CheckPHOTON()
slouken@0
   571
{
slouken@0
   572
    AC_ARG_ENABLE(video-photon,
slouken@0
   573
[  --enable-video-photon   use QNX Photonvideo driver [default=yes]],
slouken@0
   574
                  , enable_video_photon=yes)
slouken@0
   575
    if test x$enable_video = xyes -a x$enable_video_photon = xyes; then
slouken@0
   576
        AC_MSG_CHECKING(for QNX Photon support)
slouken@0
   577
        video_photon=no
slouken@0
   578
        AC_TRY_COMPILE([
slouken@0
   579
          #include <Ph.h>
slouken@0
   580
          #include <Pt.h>
slouken@0
   581
          #include <photon/Pg.h>
slouken@0
   582
          #include <photon/PdDirect.h>
slouken@0
   583
        ],[
slouken@0
   584
         PgDisplaySettings_t *visual;
slouken@0
   585
        ],[
slouken@0
   586
        video_photon=yes
slouken@0
   587
        ])
slouken@0
   588
        AC_MSG_RESULT($video_photon)
slouken@0
   589
        if test x$video_photon = xyes; then
slouken@19
   590
            CFLAGS="$CFLAGS -DENABLE_PHOTON"
slouken@0
   591
            SYSTEM_LIBS="$SYSTEM_LIBS -lph"
slouken@0
   592
            VIDEO_SUBDIRS="$VIDEO_SUBDIRS photon"
slouken@0
   593
            VIDEO_DRIVERS="$VIDEO_DRIVERS photon/libvideo_photon.la"
slouken@0
   594
        fi
slouken@0
   595
    fi
slouken@0
   596
}
slouken@0
   597
slouken@0
   598
dnl Find the X11 DGA 2.0 include and library directories
slouken@0
   599
CheckDGA()
slouken@0
   600
{
slouken@0
   601
    AC_ARG_ENABLE(video-dga,
slouken@0
   602
[  --enable-video-dga      use DGA 2.0 video driver [default=yes]],
slouken@0
   603
                  , enable_video_dga=yes)
slouken@0
   604
    if test x$video_x11_dga = xyes -a x$enable_video_dga = xyes; then
slouken@0
   605
        AC_MSG_CHECKING(for XFree86 DGA 2.0 support)
slouken@0
   606
        video_x11_dga2=no
slouken@0
   607
        AC_TRY_COMPILE([
slouken@0
   608
         #include <X11/Xlib.h>
slouken@0
   609
         #include <X11/extensions/xf86dga.h>
slouken@0
   610
        ],[
slouken@0
   611
         XDGAEvent xevent;
slouken@0
   612
        ],[
slouken@0
   613
        video_x11_dga2=yes
slouken@0
   614
        ])
slouken@0
   615
        AC_MSG_RESULT($video_x11_dga2)
slouken@0
   616
        if test x$video_x11_dga2 = xyes; then
slouken@0
   617
            CFLAGS="$CFLAGS -DENABLE_DGA"
slouken@0
   618
            VIDEO_SUBDIRS="$VIDEO_SUBDIRS dga"
slouken@0
   619
            VIDEO_DRIVERS="$VIDEO_DRIVERS dga/libvideo_dga.la"
slouken@0
   620
        fi
slouken@0
   621
    fi
slouken@0
   622
}
slouken@0
   623
slouken@0
   624
dnl Find the framebuffer console includes
slouken@0
   625
CheckFBCON()
slouken@0
   626
{
slouken@0
   627
    AC_ARG_ENABLE(video-fbcon,
slouken@0
   628
[  --enable-video-fbcon    use framebuffer console video driver [default=yes]],
slouken@0
   629
                  , enable_video_fbcon=yes)
slouken@0
   630
    if test x$enable_video = xyes -a x$enable_video_fbcon = xyes; then
slouken@0
   631
        AC_MSG_CHECKING(for framebuffer console support)
slouken@0
   632
        video_fbcon=no
slouken@0
   633
        AC_TRY_COMPILE([
slouken@0
   634
         #include <linux/fb.h>
slouken@0
   635
         #include <linux/kd.h>
slouken@0
   636
         #include <linux/keyboard.h>
slouken@0
   637
        ],[
slouken@0
   638
        ],[
slouken@0
   639
        video_fbcon=yes
slouken@0
   640
        ])
slouken@0
   641
        AC_MSG_RESULT($video_fbcon)
slouken@0
   642
        if test x$video_fbcon = xyes; then
slouken@0
   643
            CFLAGS="$CFLAGS -DENABLE_FBCON"
slouken@0
   644
            VIDEO_SUBDIRS="$VIDEO_SUBDIRS fbcon"
slouken@0
   645
            VIDEO_DRIVERS="$VIDEO_DRIVERS fbcon/libvideo_fbcon.la"
slouken@0
   646
        fi
slouken@0
   647
    fi
slouken@0
   648
}
slouken@0
   649
slouken@0
   650
dnl Find the GGI includes
slouken@0
   651
CheckGGI()
slouken@0
   652
{
slouken@0
   653
    AC_ARG_ENABLE(video-ggi,
slouken@0
   654
[  --enable-video-ggi      use GGI video driver [default=no]],
slouken@0
   655
                  , enable_video_ggi=no)
slouken@0
   656
    if test x$enable_video = xyes -a x$enable_video_ggi = xyes; then
slouken@0
   657
        AC_MSG_CHECKING(for GGI support)
slouken@0
   658
        video_ggi=no
slouken@0
   659
        AC_TRY_COMPILE([
slouken@0
   660
         #include <ggi/ggi.h>
slouken@0
   661
         #include <ggi/gii.h>
slouken@0
   662
        ],[
slouken@0
   663
        ],[
slouken@0
   664
        video_ggi=yes
slouken@0
   665
        ])
slouken@0
   666
        AC_MSG_RESULT($video_ggi)
slouken@0
   667
        if test x$video_ggi = xyes; then
slouken@0
   668
            CFLAGS="$CFLAGS $X_CFLAGS -DENABLE_GGI"
slouken@0
   669
            SYSTEM_LIBS="$SYSTEM_LIBS -lggi -lgii -lgg"
slouken@0
   670
slouken@0
   671
            VIDEO_SUBDIRS="$VIDEO_SUBDIRS ggi"
slouken@0
   672
            VIDEO_DRIVERS="$VIDEO_DRIVERS ggi/libvideo_ggi.la"
slouken@0
   673
        fi
slouken@0
   674
    fi
slouken@0
   675
}
slouken@0
   676
slouken@0
   677
dnl Find the SVGAlib includes and libraries
slouken@0
   678
CheckSVGA()
slouken@0
   679
{
slouken@0
   680
    AC_ARG_ENABLE(video-svga,
slouken@0
   681
[  --enable-video-svga     use SVGAlib video driver [default=no]],
slouken@0
   682
                  , enable_video_svga=no)
slouken@0
   683
    if test x$enable_video = xyes -a x$enable_video_svga = xyes; then
slouken@0
   684
        AC_MSG_CHECKING(for SVGAlib (1.4.0+) support)
slouken@0
   685
        video_svga=no
slouken@0
   686
        AC_TRY_COMPILE([
slouken@0
   687
         #include <vga.h>
slouken@0
   688
         #include <vgamouse.h>
slouken@0
   689
         #include <vgakeyboard.h>
slouken@0
   690
        ],[
slouken@0
   691
         if ( SCANCODE_RIGHTWIN && SCANCODE_LEFTWIN ) {
slouken@0
   692
             exit(0);
slouken@0
   693
         }
slouken@0
   694
        ],[
slouken@0
   695
        video_svga=yes
slouken@0
   696
        ])
slouken@0
   697
        AC_MSG_RESULT($video_svga)
slouken@0
   698
        if test x$video_svga = xyes; then
slouken@0
   699
            CFLAGS="$CFLAGS -DENABLE_SVGALIB"
slouken@0
   700
            SYSTEM_LIBS="$SYSTEM_LIBS -lvga"
slouken@0
   701
slouken@0
   702
            VIDEO_SUBDIRS="$VIDEO_SUBDIRS svga"
slouken@0
   703
            VIDEO_DRIVERS="$VIDEO_DRIVERS svga/libvideo_svga.la"
slouken@0
   704
        fi
slouken@0
   705
    fi
slouken@0
   706
}
slouken@0
   707
slouken@0
   708
dnl Find the AAlib includes
slouken@0
   709
CheckAAlib()
slouken@0
   710
{
slouken@0
   711
    AC_ARG_ENABLE(video-aalib,
slouken@0
   712
[  --enable-video-aalib    use AAlib video driver [default=no]],
slouken@0
   713
                  , enable_video_aalib=no)
slouken@0
   714
    if test x$enable_video = xyes -a x$enable_video_aalib = xyes; then
slouken@0
   715
        AC_MSG_CHECKING(for AAlib support)
slouken@0
   716
        video_aalib=no
slouken@0
   717
        AC_TRY_COMPILE([
slouken@0
   718
         #include <aalib.h>
slouken@0
   719
        ],[
slouken@0
   720
        ],[
slouken@0
   721
        video_aalib=yes
slouken@0
   722
        ])
slouken@0
   723
        AC_MSG_RESULT($video_aalib)
slouken@0
   724
        if test x$video_aalib = xyes; then
slouken@0
   725
            CFLAGS="$CFLAGS -DENABLE_AALIB"
slouken@0
   726
            SYSTEM_LIBS="$SYSTEM_LIBS -laa"
slouken@0
   727
slouken@0
   728
            VIDEO_SUBDIRS="$VIDEO_SUBDIRS aalib"
slouken@0
   729
            VIDEO_DRIVERS="$VIDEO_DRIVERS aalib/libvideo_aa.la"
slouken@0
   730
        fi
slouken@0
   731
    fi
slouken@0
   732
}
slouken@0
   733
slouken@1
   734
dnl rcg04172001 Set up the Null video driver.
slouken@1
   735
CheckDummyVideo()
slouken@1
   736
{
slouken@1
   737
    AC_ARG_ENABLE(video-dummy,
slouken@16
   738
[  --enable-video-dummy    use dummy video driver [default=no]],
slouken@1
   739
                  , enable_video_dummy=no)
slouken@1
   740
    if test x$enable_video_dummy = xyes; then
slouken@1
   741
      CFLAGS="$CFLAGS -DENABLE_DUMMYVIDEO"
slouken@1
   742
      VIDEO_SUBDIRS="$VIDEO_SUBDIRS dummy"
slouken@1
   743
      VIDEO_DRIVERS="$VIDEO_DRIVERS dummy/libvideo_null.la"
slouken@1
   744
    fi
slouken@1
   745
}
slouken@1
   746
slouken@0
   747
dnl Check to see if OpenGL support is desired
slouken@0
   748
AC_ARG_ENABLE(video-opengl,
slouken@0
   749
[  --enable-video-opengl   include OpenGL context creation [default=yes]],
slouken@0
   750
              , enable_video_opengl=yes)
slouken@0
   751
slouken@0
   752
dnl Find OpenGL
slouken@0
   753
CheckOpenGL()
slouken@0
   754
{
slouken@0
   755
    if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then
slouken@0
   756
        AC_MSG_CHECKING(for OpenGL (GLX) support)
slouken@0
   757
        video_opengl=no
slouken@0
   758
        AC_TRY_COMPILE([
slouken@0
   759
         #include <GL/gl.h>
slouken@0
   760
         #include <GL/glx.h>
slouken@0
   761
         #include <dlfcn.h> /* For loading extensions */
slouken@0
   762
        ],[
slouken@0
   763
        ],[
slouken@0
   764
        video_opengl=yes
slouken@0
   765
        ])
slouken@0
   766
        AC_MSG_RESULT($video_opengl)
slouken@0
   767
        if test x$video_opengl = xyes; then
slouken@0
   768
            CFLAGS="$CFLAGS -DHAVE_OPENGL"
slouken@0
   769
            AC_CHECK_LIB(dl, dlopen, SYSTEM_LIBS="$SYSTEM_LIBS -ldl")
slouken@0
   770
        fi
slouken@0
   771
    fi
slouken@0
   772
}
slouken@0
   773
slouken@0
   774
dnl Check for BeOS OpenGL
slouken@0
   775
CheckBeGL()
slouken@0
   776
{
slouken@0
   777
    if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then
slouken@0
   778
        CFLAGS="$CFLAGS -DHAVE_OPENGL"
slouken@0
   779
        SYSTEM_LIBS="$SYSTEM_LIBS -lGL"
slouken@0
   780
    fi
slouken@0
   781
}
slouken@0
   782
slouken@0
   783
dnl Check for MacOS OpenGL
slouken@0
   784
CheckMacGL()
slouken@0
   785
{
slouken@0
   786
    if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then
slouken@0
   787
        CFLAGS="$CFLAGS -DHAVE_OPENGL"
slouken@0
   788
        case "$target" in
slouken@0
   789
            *-*-darwin*)
slouken@0
   790
                SDL_LIBS="$SDL_LIBS -framework OpenGL -framework AGL"
slouken@0
   791
        esac
slouken@0
   792
    fi
slouken@0
   793
}
slouken@0
   794
slouken@0
   795
dnl See if we can use the new unified event interface in Linux 2.4
slouken@0
   796
CheckInputEvents()
slouken@0
   797
{
slouken@0
   798
    dnl Check for Linux 2.4 unified input event interface support
slouken@0
   799
    AC_ARG_ENABLE(input-events,
slouken@0
   800
[  --enable-input-events   use Linux 2.4 unified input interface [default=yes]],
slouken@0
   801
                  , enable_input_events=yes)
slouken@0
   802
    if test x$enable_input_events = xyes; then
slouken@0
   803
        AC_MSG_CHECKING(for Linux 2.4 unified input interface)
slouken@0
   804
        use_input_events=no
slouken@0
   805
        AC_TRY_COMPILE([
slouken@0
   806
          #include <linux/input.h>
slouken@0
   807
        ],[
slouken@0
   808
          #ifndef EVIOCGNAME
slouken@0
   809
          #error EVIOCGNAME() ioctl not available
slouken@0
   810
          #endif
slouken@0
   811
        ],[
slouken@0
   812
        use_input_events=yes
slouken@0
   813
        ])
slouken@0
   814
        AC_MSG_RESULT($use_input_events)
slouken@0
   815
        if test x$use_input_events = xyes; then
slouken@0
   816
            CFLAGS="$CFLAGS -DUSE_INPUT_EVENTS"
slouken@0
   817
        fi
slouken@0
   818
    fi
slouken@0
   819
}
slouken@0
   820
slouken@0
   821
dnl See what type of thread model to use on Linux and Solaris
slouken@0
   822
CheckPTHREAD()
slouken@0
   823
{
slouken@0
   824
    dnl Check for pthread support
slouken@0
   825
    AC_ARG_ENABLE(pthreads,
slouken@0
   826
[  --enable-pthreads       use POSIX threads for multi-threading [default=yes]],
slouken@0
   827
                  , enable_pthreads=yes)
slouken@0
   828
    dnl This is used on Linux for glibc binary compatibility (Doh!)
slouken@0
   829
    AC_ARG_ENABLE(pthread-sem,
slouken@0
   830
[    --enable-pthread-sem  use pthread semaphores [default=yes]],
slouken@0
   831
                  , enable_pthread_sem=yes)
slouken@0
   832
    ac_save_libs="$LIBS"
slouken@0
   833
    case "$target" in
slouken@0
   834
        *-*-bsdi*)
slouken@0
   835
            pthread_cflags="-D_REENTRANT -D_THREAD_SAFE"
slouken@0
   836
            pthread_lib=""
slouken@0
   837
            ;;
slouken@0
   838
        *-*-darwin*)
slouken@0
   839
            pthread_cflags="-D_THREAD_SAFE"
slouken@0
   840
# causes Carbon.p complaints?
slouken@0
   841
#            pthread_cflags="-D_REENTRANT -D_THREAD_SAFE"
slouken@0
   842
            ;;
slouken@0
   843
        *-*-freebsd*)
slouken@0
   844
            pthread_cflags="-D_REENTRANT -D_THREAD_SAFE"
slouken@0
   845
            pthread_lib="-pthread"
slouken@0
   846
            ;;
slouken@0
   847
        *-*-openbsd*)
slouken@0
   848
            pthread_cflags="-D_REENTRANT"
slouken@0
   849
            pthread_lib="-pthread"
slouken@0
   850
            ;;
slouken@0
   851
        *-*-solaris*)
slouken@0
   852
            pthread_cflags="-D_REENTRANT"
slouken@0
   853
            pthread_lib="-lpthread -lposix4"
slouken@0
   854
            ;;
slouken@0
   855
        *-*-sysv5*)
slouken@0
   856
            pthread_cflags="-D_REENTRANT -Kthread"
slouken@0
   857
            pthread_lib=""
slouken@0
   858
            ;;
slouken@0
   859
        *-*-irix*)
slouken@0
   860
            pthread_cflags="-D_SGI_MP_SOURCE"
slouken@0
   861
            pthread_lib="-lpthread"
slouken@0
   862
            ;;
slouken@0
   863
        *-*-aix*)
slouken@0
   864
            pthread_cflags="-D_REENTRANT -mthreads"
slouken@0
   865
            pthread_lib="-lpthread"
slouken@0
   866
            ;;
slouken@0
   867
        *-*-qnx*)
slouken@0
   868
            pthread_cflags=""
slouken@0
   869
            pthread_lib=""
slouken@0
   870
            ;;
slouken@0
   871
        *)
slouken@0
   872
            pthread_cflags="-D_REENTRANT"
slouken@0
   873
            pthread_lib="-lpthread"
slouken@0
   874
            ;;
slouken@0
   875
    esac
slouken@0
   876
    LIBS="$LIBS $pthread_lib"
slouken@0
   877
    if test x$enable_threads = xyes -a x$enable_pthreads = xyes; then
slouken@0
   878
        AC_MSG_CHECKING(for pthreads)
slouken@0
   879
        use_pthreads=no
slouken@0
   880
        AC_TRY_LINK([
slouken@0
   881
         #include <pthread.h>
slouken@0
   882
        ],[
slouken@0
   883
         pthread_attr_t type;
slouken@0
   884
         pthread_attr_init(&type);
slouken@0
   885
        ],[
slouken@0
   886
        use_pthreads=yes
slouken@0
   887
        ])
slouken@0
   888
        AC_MSG_RESULT($use_pthreads)
slouken@0
   889
        if test x$use_pthreads = xyes; then
slouken@0
   890
            CFLAGS="$CFLAGS $pthread_cflags -DSDL_USE_PTHREADS"
slouken@0
   891
            SDL_CFLAGS="$SDL_CFLAGS $pthread_cflags"
slouken@0
   892
            SDL_LIBS="$SDL_LIBS $pthread_lib"
slouken@0
   893
slouken@0
   894
            # Check to see if recursive mutexes are available
slouken@0
   895
            AC_MSG_CHECKING(for recursive mutexes)
slouken@0
   896
            has_recursive_mutexes=no
slouken@0
   897
            AC_TRY_LINK([
slouken@0
   898
              #include <pthread.h>
slouken@0
   899
            ],[
slouken@0
   900
              pthread_mutexattr_t attr;
slouken@0
   901
              #ifdef linux
slouken@0
   902
              pthread_mutexattr_setkind_np(&attr, PTHREAD_MUTEX_RECURSIVE_NP);
slouken@0
   903
              #else
slouken@0
   904
              pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
slouken@0
   905
              #endif
slouken@0
   906
            ],[
slouken@0
   907
            has_recursive_mutexes=yes
slouken@0
   908
            ])
slouken@0
   909
            # Some systems have broken recursive mutex implementations
slouken@0
   910
            case "$target" in
slouken@0
   911
                *-*-solaris*)
slouken@0
   912
                    has_recursive_mutexes=no
slouken@0
   913
                    ;;
slouken@0
   914
            esac
slouken@0
   915
            AC_MSG_RESULT($has_recursive_mutexes)
slouken@0
   916
            if test x$has_recursive_mutexes != xyes; then
slouken@0
   917
                CFLAGS="$CFLAGS -DPTHREAD_NO_RECURSIVE_MUTEX"
slouken@0
   918
            fi
slouken@0
   919
slouken@0
   920
            # Check to see if this is broken glibc 2.0 pthreads
slouken@0
   921
            case "$target" in
slouken@0
   922
                *-*-linux*)
slouken@0
   923
                    AC_MSG_CHECKING(for broken glibc 2.0 pthreads)
slouken@0
   924
                    glibc20_pthreads=no
slouken@0
   925
                    AC_TRY_COMPILE([
slouken@0
   926
                      #include <features.h>
slouken@0
   927
                      #if (__GLIBC__ == 2) && (__GLIBC_MINOR__ == 0)
slouken@0
   928
                      #warning Working around a bug in glibc 2.0 pthreads
slouken@0
   929
                      #else
slouken@0
   930
                      #error pthread implementation okay
slouken@0
   931
                      #endif /* glibc 2.0 */
slouken@0
   932
                    ],[
slouken@0
   933
                    ],[
slouken@0
   934
                    glibc20_pthreads=yes
slouken@0
   935
                    ])
slouken@0
   936
                    AC_MSG_RESULT($glibc20_pthreads)
slouken@0
   937
            esac
slouken@0
   938
        fi
slouken@0
   939
    fi
slouken@0
   940
    LIBS="$ac_save_libs"
slouken@0
   941
slouken@0
   942
    AC_MSG_CHECKING(whether semun is defined in /usr/include/sys/sem.h)
slouken@0
   943
    have_semun=no
slouken@0
   944
    AC_TRY_COMPILE([
slouken@0
   945
      #include <sys/types.h>
slouken@0
   946
      #include <sys/sem.h>
slouken@0
   947
    ],[
slouken@0
   948
      union semun t;
slouken@0
   949
    ],[
slouken@0
   950
    have_semun=yes
slouken@0
   951
    ])
slouken@0
   952
    AC_MSG_RESULT($have_semun)
slouken@0
   953
    if test x$have_semun = xyes; then
slouken@0
   954
        CFLAGS="$CFLAGS -DHAVE_SEMUN"
slouken@0
   955
    fi
slouken@0
   956
slouken@0
   957
    # See if we can use clone() on Linux directly
slouken@0
   958
    use_clone=no
slouken@0
   959
    if test x$enable_threads = xyes -a x$use_pthreads != xyes; then
slouken@0
   960
        case "$target" in
slouken@0
   961
            *-*-linux*)
slouken@0
   962
                use_clone=yes
slouken@0
   963
                ;;
slouken@0
   964
            *)
slouken@0
   965
                CFLAGS="$CFLAGS -DFORK_HACK"
slouken@0
   966
                ;;
slouken@0
   967
        esac
slouken@0
   968
    fi
slouken@0
   969
    AM_CONDITIONAL(USE_CLONE, test x$use_clone = xyes)
slouken@0
   970
}
slouken@0
   971
slouken@0
   972
dnl Determine whether the compiler can produce Win32 executables
slouken@0
   973
CheckWIN32()
slouken@0
   974
{
slouken@0
   975
    AC_MSG_CHECKING(Win32 compiler)
slouken@0
   976
    have_win32_gcc=no
slouken@0
   977
    AC_TRY_COMPILE([
slouken@0
   978
     #include <windows.h>
slouken@0
   979
    ],[
slouken@0
   980
    ],[
slouken@0
   981
    have_win32_gcc=yes
slouken@0
   982
    ])
slouken@0
   983
    AC_MSG_RESULT($have_win32_gcc)
slouken@0
   984
    if test x$have_win32_gcc != xyes; then
slouken@0
   985
       AC_MSG_ERROR([
slouken@0
   986
*** Your compiler ($CC) does not produce Win32 executables!
slouken@0
   987
       ])
slouken@0
   988
    fi
slouken@0
   989
slouken@0
   990
    dnl See if the user wants to redirect standard output to files
slouken@0
   991
    AC_ARG_ENABLE(stdio-redirect,
slouken@0
   992
[  --enable-stdio-redirect Redirect STDIO to files on Win32 [default=yes]],
slouken@0
   993
                  , enable_stdio_redirect=yes)
slouken@0
   994
    if test x$enable_stdio_redirect != xyes; then
slouken@0
   995
        CFLAGS="$CFLAGS -DNO_STDIO_REDIRECT"
slouken@0
   996
    fi
slouken@0
   997
}
slouken@0
   998
slouken@0
   999
dnl Find the DirectX includes and libraries
slouken@0
  1000
CheckDIRECTX()
slouken@0
  1001
{
slouken@0
  1002
    AC_ARG_ENABLE(directx,
slouken@0
  1003
[  --enable-directx        use DirectX for Win32 audio/video [default=yes]],
slouken@0
  1004
                  , enable_directx=yes)
slouken@0
  1005
    if test x$enable_directx = xyes; then
slouken@0
  1006
        AC_MSG_CHECKING(for DirectX headers and libraries)
slouken@0
  1007
        use_directx=no
slouken@0
  1008
        AC_TRY_COMPILE([
slouken@0
  1009
         #include "src/video/windx5/directx.h"
slouken@0
  1010
        ],[
slouken@0
  1011
        ],[
slouken@0
  1012
        use_directx=yes
slouken@0
  1013
        ])
slouken@0
  1014
        AC_MSG_RESULT($use_directx)
slouken@0
  1015
    fi
slouken@0
  1016
    AM_CONDITIONAL(USE_DIRECTX, test x$use_directx = xyes)
slouken@0
  1017
slouken@0
  1018
    CFLAGS="$CFLAGS -I\$(top_srcdir)/src/video/wincommon"
slouken@0
  1019
    SYSTEM_LIBS="$SYSTEM_LIBS -luser32 -lgdi32 -lwinmm"
slouken@0
  1020
    VIDEO_SUBDIRS="$VIDEO_SUBDIRS wincommon"
slouken@0
  1021
    VIDEO_DRIVERS="$VIDEO_DRIVERS wincommon/libvideo_wincommon.la"
slouken@0
  1022
    # Enable the DIB driver
slouken@0
  1023
    CFLAGS="$CFLAGS -DENABLE_WINDIB"
slouken@0
  1024
    VIDEO_SUBDIRS="$VIDEO_SUBDIRS windib"
slouken@0
  1025
    VIDEO_DRIVERS="$VIDEO_DRIVERS windib/libvideo_windib.la"
slouken@0
  1026
    # See if we should enable the DirectX driver
slouken@0
  1027
    if test x$use_directx = xyes; then
slouken@0
  1028
        CFLAGS="$CFLAGS -DENABLE_DIRECTX"
slouken@0
  1029
        SYSTEM_LIBS="$SYSTEM_LIBS -ldxguid"
slouken@0
  1030
        VIDEO_SUBDIRS="$VIDEO_SUBDIRS windx5"
slouken@0
  1031
        VIDEO_DRIVERS="$VIDEO_DRIVERS windx5/libvideo_windx5.la"
slouken@0
  1032
    fi
slouken@0
  1033
}
slouken@0
  1034
slouken@0
  1035
dnl Set up the BWindow video driver on BeOS
slouken@0
  1036
CheckBWINDOW()
slouken@0
  1037
{
slouken@0
  1038
    CFLAGS="$CFLAGS -DENABLE_BWINDOW"
slouken@0
  1039
    VIDEO_SUBDIRS="$VIDEO_SUBDIRS bwindow"
slouken@0
  1040
    VIDEO_DRIVERS="$VIDEO_DRIVERS bwindow/libvideo_bwindow.la"
slouken@0
  1041
}
slouken@0
  1042
slouken@0
  1043
dnl Set up the Mac toolbox video driver for Mac OS 7-9
slouken@0
  1044
CheckTOOLBOX()
slouken@0
  1045
{
slouken@0
  1046
    VIDEO_SUBDIRS="$VIDEO_SUBDIRS maccommon"
slouken@0
  1047
    VIDEO_DRIVERS="$VIDEO_DRIVERS maccommon/libvideo_maccommon.la"
slouken@0
  1048
    VIDEO_SUBDIRS="$VIDEO_SUBDIRS macrom"
slouken@0
  1049
    VIDEO_DRIVERS="$VIDEO_DRIVERS macrom/libvideo_macrom.la"
slouken@0
  1050
}
slouken@0
  1051
slouken@0
  1052
dnl Set up the Mac toolbox video driver for Mac OS X
slouken@0
  1053
CheckCARBON()
slouken@0
  1054
{
slouken@0
  1055
    # "MACOSX" is not an official definition, but it's commonly
slouken@0
  1056
    # accepted as a way to differentiate between what runs on X
slouken@0
  1057
    # and what runs on older Macs - while in theory "Carbon" defns
slouken@0
  1058
    # are consistent between the two, in practice Carbon is still
slouken@0
  1059
    # changing. -sts Aug 2000
slouken@0
  1060
    mac_autoconf_target_workaround="MAC"
slouken@0
  1061
    CFLAGS="$CFLAGS -I/System/Library/Frameworks/Carbon.framework/Headers \
slouken@0
  1062
      -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
  1063
    VIDEO_SUBDIRS="$VIDEO_SUBDIRS maccommon"
slouken@0
  1064
    VIDEO_DRIVERS="$VIDEO_DRIVERS maccommon/libvideo_maccommon.la"
slouken@0
  1065
    VIDEO_SUBDIRS="$VIDEO_SUBDIRS macrom"
slouken@0
  1066
    VIDEO_DRIVERS="$VIDEO_DRIVERS macrom/libvideo_macrom.la"
slouken@0
  1067
}
slouken@0
  1068
slouken@0
  1069
dnl Set up the kernel statistics library for Solaris
slouken@0
  1070
CheckKSTAT()
slouken@0
  1071
{
slouken@0
  1072
    CFLAGS="$CFLAGS -DHAVE_KSTAT"
slouken@0
  1073
    SYSTEM_LIBS="$SYSTEM_LIBS -lkstat"
slouken@0
  1074
}
slouken@0
  1075
slouken@0
  1076
case "$target" in
slouken@0
  1077
    *-*-linux*)
slouken@0
  1078
        ARCH=linux
slouken@1
  1079
        CheckDummyVideo
slouken@0
  1080
        CheckNASM
slouken@0
  1081
        CheckOSS
slouken@0
  1082
        CheckALSA
slouken@0
  1083
        CheckARTSC
slouken@0
  1084
        CheckESD
slouken@0
  1085
        CheckNAS
slouken@0
  1086
        CheckX11
slouken@30
  1087
        CheckNANOX
slouken@0
  1088
        CheckDGA
slouken@0
  1089
        CheckFBCON
slouken@0
  1090
        CheckGGI
slouken@0
  1091
        CheckSVGA
slouken@0
  1092
        CheckAAlib
slouken@0
  1093
        CheckOpenGL
slouken@0
  1094
        CheckInputEvents
slouken@0
  1095
        CheckPTHREAD
slouken@0
  1096
        # Set up files for the main() stub
slouken@0
  1097
        COPY_ARCH_SRC(src/main, linux, SDL_main.c)
slouken@0
  1098
        # Set up files for the audio library
slouken@0
  1099
        # We use the OSS and ALSA API's, not the Sun audio API
slouken@0
  1100
        #if test x$enable_audio = xyes; then
slouken@0
  1101
        #    AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun"
slouken@0
  1102
        #    AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la"
slouken@0
  1103
        #fi
slouken@0
  1104
        # Set up files for the joystick library
slouken@0
  1105
        if test x$enable_joystick = xyes; then
slouken@0
  1106
            JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS linux"
slouken@0
  1107
            JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS linux/libjoystick_linux.la"
slouken@0
  1108
        fi
slouken@0
  1109
        # Set up files for the cdrom library
slouken@0
  1110
        if test x$enable_cdrom = xyes; then
slouken@0
  1111
            COPY_ARCH_SRC(src/cdrom, linux, SDL_syscdrom.c)
slouken@0
  1112
        fi
slouken@0
  1113
        # Set up files for the thread library
slouken@0
  1114
        if test x$enable_threads = xyes; then
slouken@0
  1115
            if test x$use_pthreads != xyes; then
slouken@0
  1116
                COPY_ARCH_SRC(src/thread, linux, clone.S)
slouken@0
  1117
            fi
slouken@0
  1118
            COPY_ARCH_SRC(src/thread, linux, SDL_systhread.c)
slouken@0
  1119
            COPY_ARCH_SRC(src/thread, linux, SDL_systhread_c.h)
slouken@0
  1120
            if test x$use_pthreads = xyes -a x$enable_pthread_sem != xyes; then
slouken@0
  1121
                COPY_ARCH_SRC(src/thread, generic, SDL_syssem.c)
slouken@0
  1122
            else
slouken@0
  1123
                COPY_ARCH_SRC(src/thread, linux, SDL_syssem.c)
slouken@0
  1124
            fi
slouken@0
  1125
            COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
slouken@0
  1126
            if test x$glibc20_pthreads = xyes; then
slouken@0
  1127
                COPY_ARCH_SRC(src/thread, generic, SDL_sysmutex.c)
slouken@0
  1128
                COPY_ARCH_SRC(src/thread, generic, SDL_sysmutex_c.h)
slouken@0
  1129
                COPY_ARCH_SRC(src/thread, generic, SDL_syscond.c)
slouken@0
  1130
                COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
slouken@0
  1131
            else
slouken@0
  1132
                COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex.c)
slouken@0
  1133
                COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex_c.h)
slouken@0
  1134
                COPY_ARCH_SRC(src/thread, linux, SDL_syscond.c)
slouken@0
  1135
                COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
slouken@0
  1136
            fi
slouken@0
  1137
        fi
slouken@0
  1138
        # Set up files for the timer library
slouken@0
  1139
        if test x$enable_timers = xyes; then
slouken@0
  1140
            COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
slouken@0
  1141
        fi
slouken@0
  1142
        ;;
slouken@0
  1143
    *-*-bsdi*)
slouken@0
  1144
        ARCH=bsdi
slouken@1
  1145
        CheckDummyVideo
slouken@0
  1146
        CheckNASM
slouken@0
  1147
        CheckOSS
slouken@35
  1148
        CheckARTSC
slouken@35
  1149
        CheckESD
slouken@0
  1150
        CheckNAS
slouken@0
  1151
        CheckX11
slouken@0
  1152
        CheckDGA
slouken@0
  1153
        CheckSVGA
slouken@0
  1154
        CheckAAlib
slouken@0
  1155
        CheckOpenGL
slouken@0
  1156
        CheckPTHREAD
slouken@0
  1157
        # Set up files for the main() stub
slouken@0
  1158
        COPY_ARCH_SRC(src/main, linux, SDL_main.c)
slouken@0
  1159
        # Set up files for the joystick library
slouken@0
  1160
        # (No joystick support yet)
slouken@0
  1161
        if test x$enable_joystick = xyes; then
slouken@0
  1162
            JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS dummy"
slouken@0
  1163
            JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS dummy/libjoystick_dummy.la"
slouken@0
  1164
        fi
slouken@0
  1165
        # Set up files for the cdrom library
slouken@0
  1166
        # (No cdrom support yet)
slouken@0
  1167
        if test x$enable_cdrom = xyes; then
slouken@0
  1168
            COPY_ARCH_SRC(src/cdrom, dummy, SDL_syscdrom.c)
slouken@0
  1169
        fi
slouken@0
  1170
        # Set up files for the thread library
slouken@0
  1171
        if test x$enable_threads = xyes; then
slouken@0
  1172
            COPY_ARCH_SRC(src/thread, linux, SDL_systhread.c)
slouken@0
  1173
            COPY_ARCH_SRC(src/thread, linux, SDL_systhread_c.h)
slouken@0
  1174
            COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex.c)
slouken@0
  1175
            COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex_c.h)
slouken@0
  1176
            COPY_ARCH_SRC(src/thread, generic, SDL_syssem.c)
slouken@0
  1177
            COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
slouken@0
  1178
            COPY_ARCH_SRC(src/thread, linux, SDL_syscond.c)
slouken@0
  1179
            COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
slouken@0
  1180
        fi
slouken@0
  1181
        # Set up files for the timer library
slouken@0
  1182
        if test x$enable_timers = xyes; then
slouken@0
  1183
            COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
slouken@0
  1184
        fi
slouken@0
  1185
        ;;
slouken@0
  1186
    *-*-freebsd*)
slouken@0
  1187
        ARCH=freebsd
slouken@1
  1188
        CheckDummyVideo
slouken@0
  1189
        CheckNASM
slouken@0
  1190
        CheckOSS
slouken@0
  1191
        CheckARTSC
slouken@0
  1192
        CheckESD
slouken@0
  1193
        CheckNAS
slouken@0
  1194
        CheckX11
slouken@0
  1195
        CheckDGA
slouken@0
  1196
        CheckSVGA
slouken@0
  1197
        CheckAAlib
slouken@0
  1198
        CheckOpenGL
slouken@0
  1199
        CheckPTHREAD
slouken@0
  1200
        # Set up files for the main() stub
slouken@0
  1201
        COPY_ARCH_SRC(src/main, linux, SDL_main.c)
slouken@0
  1202
        # Set up files for the audio library
slouken@0
  1203
        # We use the OSS and ALSA API's, not the Sun audio API
slouken@0
  1204
        #if test x$enable_audio = xyes; then
slouken@0
  1205
        #    AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun"
slouken@0
  1206
        #    AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la"
slouken@0
  1207
        #fi
slouken@0
  1208
        # Set up files for the joystick library
slouken@0
  1209
        # (No joystick support yet)
slouken@0
  1210
        if test x$enable_joystick = xyes; then
slouken@0
  1211
            JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS dummy"
slouken@0
  1212
            JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS dummy/libjoystick_dummy.la"
slouken@0
  1213
        fi
slouken@0
  1214
        # Set up files for the cdrom library
slouken@0
  1215
        if test x$enable_cdrom = xyes; then
slouken@0
  1216
            COPY_ARCH_SRC(src/cdrom, freebsd, SDL_syscdrom.c)
slouken@0
  1217
        fi
slouken@0
  1218
        # Set up files for the thread library
slouken@0
  1219
        if test x$enable_threads = xyes; then
slouken@0
  1220
            COPY_ARCH_SRC(src/thread, linux, SDL_systhread.c)
slouken@0
  1221
            COPY_ARCH_SRC(src/thread, linux, SDL_systhread_c.h)
slouken@0
  1222
            COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex.c)
slouken@0
  1223
            COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex_c.h)
slouken@0
  1224
            if test x$use_pthreads = xyes -a x$enable_pthread_sem != xyes; then
slouken@0
  1225
                COPY_ARCH_SRC(src/thread, generic, SDL_syssem.c)
slouken@0
  1226
            else
slouken@0
  1227
                COPY_ARCH_SRC(src/thread, linux, SDL_syssem.c)
slouken@0
  1228
            fi
slouken@0
  1229
            COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
slouken@0
  1230
            COPY_ARCH_SRC(src/thread, linux, SDL_syscond.c)
slouken@0
  1231
            COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
slouken@0
  1232
        fi
slouken@0
  1233
        # Set up files for the timer library
slouken@0
  1234
        if test x$enable_timers = xyes; then
slouken@0
  1235
            COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
slouken@0
  1236
        fi
slouken@0
  1237
        ;;
slouken@0
  1238
    *-*-netbsd*)
slouken@0
  1239
        ARCH=netbsd
slouken@1
  1240
        CheckDummyVideo
slouken@0
  1241
        CheckNASM
slouken@0
  1242
        CheckOSS
slouken@0
  1243
        CheckARTSC
slouken@0
  1244
        CheckESD
slouken@0
  1245
        CheckNAS
slouken@0
  1246
        CheckX11
slouken@0
  1247
        CheckAAlib
slouken@0
  1248
        CheckOpenGL
slouken@0
  1249
        CheckPTHREAD
slouken@0
  1250
        # Set up files for the main() stub
slouken@0
  1251
        COPY_ARCH_SRC(src/main, linux, SDL_main.c)
slouken@0
  1252
        # Set up files for the audio library
slouken@0
  1253
        if test x$enable_audio = xyes; then
slouken@0
  1254
            AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun"
slouken@0
  1255
            AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la"
slouken@0
  1256
        fi
slouken@0
  1257
        # Set up files for the joystick library
slouken@0
  1258
        # (No joystick support yet)
slouken@0
  1259
        if test x$enable_joystick = xyes; then
slouken@0
  1260
            JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS dummy"
slouken@0
  1261
            JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS dummy/libjoystick_dummy.la"
slouken@0
  1262
        fi
slouken@0
  1263
        # Set up files for the cdrom library
slouken@0
  1264
        if test x$enable_cdrom = xyes; then
slouken@0
  1265
            COPY_ARCH_SRC(src/cdrom, openbsd, SDL_syscdrom.c)
slouken@0
  1266
        fi
slouken@0
  1267
        # Set up files for the thread library
slouken@0
  1268
        if test x$enable_threads = xyes; then
slouken@0
  1269
            COPY_ARCH_SRC(src/thread, linux, SDL_systhread.c)
slouken@0
  1270
            COPY_ARCH_SRC(src/thread, linux, SDL_systhread_c.h)
slouken@0
  1271
            COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex.c)
slouken@0
  1272
            COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex_c.h)
slouken@41
  1273
            if test x$use_pthreads = xyes -a x$enable_pthread_sem != xyes; then
slouken@41
  1274
                COPY_ARCH_SRC(src/thread, generic, SDL_syssem.c)
slouken@41
  1275
            else
slouken@41
  1276
                COPY_ARCH_SRC(src/thread, linux, SDL_syssem.c)
slouken@41
  1277
            fi
slouken@0
  1278
            COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
slouken@0
  1279
            COPY_ARCH_SRC(src/thread, linux, SDL_syscond.c)
slouken@0
  1280
            COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
slouken@0
  1281
        fi
slouken@0
  1282
        # Set up files for the timer library
slouken@0
  1283
        if test x$enable_timers = xyes; then
slouken@0
  1284
            COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
slouken@0
  1285
        fi
slouken@0
  1286
        # NetBSD does not define "unix"
slouken@39
  1287
        CFLAGS="$CFLAGS -Dunix -D_POSIX_THREAD_SYSCALL_SOFT=1"
slouken@0
  1288
        ;;
slouken@0
  1289
    *-*-openbsd*)
slouken@0
  1290
        ARCH=openbsd
slouken@1
  1291
        CheckDummyVideo
slouken@0
  1292
        CheckNASM
slouken@0
  1293
        CheckOSS
slouken@0
  1294
        CheckARTSC
slouken@0
  1295
        CheckESD
slouken@0
  1296
        CheckNAS
slouken@0
  1297
        CheckX11
slouken@0
  1298
        CheckAAlib
slouken@0
  1299
        CheckOpenGL
slouken@0
  1300
        CheckPTHREAD
slouken@0
  1301
        # Set up files for the main() stub
slouken@0
  1302
        COPY_ARCH_SRC(src/main, linux, SDL_main.c)
slouken@0
  1303
        # Set up files for the audio library
slouken@37
  1304
        CheckOPENBSDAUDIO
slouken@0
  1305
        # Set up files for the joystick library
slouken@0
  1306
        # (No joystick support yet)
slouken@0
  1307
        if test x$enable_joystick = xyes; then
slouken@0
  1308
            JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS dummy"
slouken@0
  1309
            JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS dummy/libjoystick_dummy.la"
slouken@0
  1310
        fi
slouken@0
  1311
        # Set up files for the cdrom library
slouken@0
  1312
        if test x$enable_cdrom = xyes; then
slouken@0
  1313
            COPY_ARCH_SRC(src/cdrom, openbsd, SDL_syscdrom.c)
slouken@0
  1314
        fi
slouken@0
  1315
        # Set up files for the thread library
slouken@0
  1316
        if test x$enable_threads = xyes; then
slouken@0
  1317
            COPY_ARCH_SRC(src/thread, linux, SDL_systhread.c)
slouken@0
  1318
            COPY_ARCH_SRC(src/thread, linux, SDL_systhread_c.h)
slouken@0
  1319
            COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex.c)
slouken@0
  1320
            COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex_c.h)
slouken@0
  1321
            if test x$use_pthreads = xyes -a x$enable_pthread_sem != xyes; then
slouken@0
  1322
                COPY_ARCH_SRC(src/thread, generic, SDL_syssem.c)
slouken@0
  1323
            else
slouken@0
  1324
                COPY_ARCH_SRC(src/thread, linux, SDL_syssem.c)
slouken@0
  1325
            fi
slouken@0
  1326
            COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
slouken@0
  1327
            COPY_ARCH_SRC(src/thread, linux, SDL_syscond.c)
slouken@0
  1328
            COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
slouken@0
  1329
        fi
slouken@0
  1330
        # Set up files for the timer library
slouken@0
  1331
        if test x$enable_timers = xyes; then
slouken@0
  1332
            COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
slouken@0
  1333
        fi
slouken@37
  1334
        # OpenBSD does not define "unix"
slouken@37
  1335
        CFLAGS="$CFLAGS -Dunix"
slouken@0
  1336
        ;;
slouken@0
  1337
    *-*-sysv5*)
slouken@0
  1338
        ARCH=sysv5
slouken@1
  1339
        CheckDummyVideo
slouken@0
  1340
        CheckNASM
slouken@0
  1341
        CheckOSS
slouken@0
  1342
        CheckARTSC
slouken@0
  1343
        CheckESD
slouken@0
  1344
        CheckNAS
slouken@0
  1345
        CheckX11
slouken@0
  1346
        CheckAAlib
slouken@0
  1347
        CheckOpenGL
slouken@0
  1348
        CheckPTHREAD
slouken@0
  1349
        CheckKSTAT
slouken@0
  1350
        # Set up files for the main() stub
slouken@0
  1351
        COPY_ARCH_SRC(src/main, linux, SDL_main.c)
slouken@0
  1352
        # Set up files for the audio library
slouken@0
  1353
        if test x$enable_audio = xyes; then
slouken@0
  1354
            AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun"
slouken@0
  1355
            AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la"
slouken@0
  1356
        fi
slouken@0
  1357
        # Set up files for the joystick library
slouken@0
  1358
        # (No joystick support yet)
slouken@0
  1359
        if test x$enable_joystick = xyes; then
slouken@0
  1360
            JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS dummy"
slouken@0
  1361
            JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS dummy/libjoystick_dummy.la"
slouken@0
  1362
        fi
slouken@0
  1363
        # Set up files for the cdrom library
slouken@0
  1364
        if test x$enable_cdrom = xyes; then
slouken@0
  1365
            COPY_ARCH_SRC(src/cdrom, dummy, SDL_syscdrom.c)
slouken@0
  1366
        fi
slouken@0
  1367
        # Set up files for the thread library
slouken@0
  1368
        if test x$enable_threads = xyes; then
slouken@0
  1369
            COPY_ARCH_SRC(src/thread, generic, SDL_systhread.c)
slouken@0
  1370
            COPY_ARCH_SRC(src/thread, generic, SDL_systhread_c.h)
slouken@0
  1371
            COPY_ARCH_SRC(src/thread, generic, SDL_sysmutex.c)
slouken@0
  1372
            COPY_ARCH_SRC(src/thread, generic, SDL_sysmutex_c.h)
slouken@0
  1373
            COPY_ARCH_SRC(src/thread, generic, SDL_syssem.c)
slouken@0
  1374
            COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
slouken@0
  1375
            COPY_ARCH_SRC(src/thread, generic, SDL_syscond.c)
slouken@0
  1376
            COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
slouken@0
  1377
        fi
slouken@0
  1378
        # Set up files for the timer library
slouken@0
  1379
        if test x$enable_timers = xyes; then
slouken@0
  1380
            COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
slouken@0
  1381
        fi
slouken@0
  1382
        ;;
slouken@0
  1383
    *-*-solaris*)
slouken@0
  1384
        ARCH=solaris
slouken@1
  1385
        CFLAGS="$CFLAGS -D__ELF__" # Fix for nasm on Solaris x86
slouken@1
  1386
        CheckDummyVideo
slouken@0
  1387
        CheckNASM
slouken@35
  1388
        CheckOSS
slouken@0
  1389
        CheckARTSC
slouken@0
  1390
        CheckESD
slouken@0
  1391
        CheckNAS
slouken@0
  1392
        CheckX11
slouken@0
  1393
        CheckAAlib
slouken@0
  1394
        CheckOpenGL
slouken@0
  1395
        CheckPTHREAD
slouken@0
  1396
        CheckKSTAT
slouken@0
  1397
        # Set up files for the main() stub
slouken@0
  1398
        COPY_ARCH_SRC(src/main, linux, SDL_main.c)
slouken@0
  1399
        # Set up files for the audio library
slouken@0
  1400
        if test x$enable_audio = xyes; then
slouken@0
  1401
            AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun"
slouken@0
  1402
            AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la"
slouken@0
  1403
        fi
slouken@0
  1404
        # Set up files for the joystick library
slouken@0
  1405
        # (No joystick support yet)
slouken@0
  1406
        if test x$enable_joystick = xyes; then
slouken@0
  1407
            JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS dummy"
slouken@0
  1408
            JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS dummy/libjoystick_dummy.la"
slouken@0
  1409
        fi
slouken@0
  1410
        # Set up files for the cdrom library
slouken@0
  1411
        if test x$enable_cdrom = xyes; then
slouken@0
  1412
            COPY_ARCH_SRC(src/cdrom, linux, SDL_syscdrom.c)
slouken@0
  1413
        fi
slouken@0
  1414
        # Set up files for the thread library
slouken@0
  1415
        if test x$enable_threads = xyes; then
slouken@0
  1416
            COPY_ARCH_SRC(src/thread, linux, SDL_systhread.c)
slouken@0
  1417
            COPY_ARCH_SRC(src/thread, linux, SDL_systhread_c.h)
slouken@0
  1418
            COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex.c)
slouken@0
  1419
            COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex_c.h)
slouken@0
  1420
            COPY_ARCH_SRC(src/thread, linux, SDL_syssem.c)
slouken@0
  1421
            COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
slouken@0
  1422
            COPY_ARCH_SRC(src/thread, generic, SDL_syscond.c)
slouken@0
  1423
            COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
slouken@0
  1424
        fi
slouken@0
  1425
        # Set up files for the timer library
slouken@0
  1426
        if test x$enable_timers = xyes; then
slouken@0
  1427
            COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
slouken@0
  1428
        fi
slouken@0
  1429
        ;;
slouken@0
  1430
    *-*-irix*)
slouken@0
  1431
        ARCH=irix
slouken@1
  1432
        CheckDummyVideo
slouken@0
  1433
        CheckNAS
slouken@0
  1434
        CheckX11
slouken@0
  1435
        CheckAAlib
slouken@0
  1436
        CheckOpenGL
slouken@0
  1437
        CheckPTHREAD
slouken@0
  1438
        # Set up files for the main() stub
slouken@0
  1439
        COPY_ARCH_SRC(src/main, linux, SDL_main.c)
slouken@0
  1440
        # Set up files for the audio library
slouken@0
  1441
        if test x$enable_audio = xyes; then
slouken@0
  1442
            AUDIO_SUBDIRS="$AUDIO_SUBDIRS dmedia"
slouken@0
  1443
            AUDIO_DRIVERS="$AUDIO_DRIVERS dmedia/libaudio_dmedia.la"
slouken@0
  1444
            LIBS="$LIBS -laudio"
slouken@0
  1445
        fi
slouken@0
  1446
        # Set up files for the joystick library
slouken@0
  1447
        # (No joystick support yet)
slouken@0
  1448
        if test x$enable_joystick = xyes; then
slouken@0
  1449
            JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS dummy"
slouken@0
  1450
            JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS dummy/libjoystick_dummy.la"
slouken@0
  1451
        fi
slouken@0
  1452
        # Set up files for the cdrom library
slouken@0
  1453
        # (No CD-ROM support yet)
slouken@0
  1454
        if test x$enable_cdrom = xyes; then
slouken@0
  1455
            COPY_ARCH_SRC(src/cdrom, dummy, SDL_syscdrom.c)
slouken@0
  1456
        fi
slouken@0
  1457
        # Set up files for the thread library
slouken@0
  1458
        if test x$enable_threads = xyes; then
slouken@0
  1459
            if test x$use_pthreads = xyes; then
slouken@0
  1460
                COPY_ARCH_SRC(src/thread, linux, SDL_systhread.c)
slouken@0
  1461
                COPY_ARCH_SRC(src/thread, linux, SDL_systhread_c.h)
slouken@0
  1462
                COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex.c)
slouken@0
  1463
                COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex_c.h)
slouken@0
  1464
                if test x$enable_pthread_sem != xyes; then
slouken@0
  1465
                    COPY_ARCH_SRC(src/thread, generic, SDL_syssem.c)
slouken@0
  1466
                else
slouken@0
  1467
                    COPY_ARCH_SRC(src/thread, linux, SDL_syssem.c)
slouken@0
  1468
                fi
slouken@0
  1469
                COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
slouken@0
  1470
                COPY_ARCH_SRC(src/thread, linux, SDL_syscond.c)
slouken@0
  1471
                COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
slouken@0
  1472
            else
slouken@0
  1473
                COPY_ARCH_SRC(src/thread, irix, SDL_systhread.c)
slouken@0
  1474
                COPY_ARCH_SRC(src/thread, irix, SDL_systhread_c.h)
slouken@0
  1475
                COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex.c)
slouken@0
  1476
                COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex_c.h)
slouken@0
  1477
                COPY_ARCH_SRC(src/thread, linux, SDL_syssem.c)
slouken@0
  1478
                COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
slouken@0
  1479
                COPY_ARCH_SRC(src/thread, generic, SDL_syscond.c)
slouken@0
  1480
                COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
slouken@0
  1481
            fi
slouken@0
  1482
        fi
slouken@0
  1483
        # Set up files for the timer library
slouken@0
  1484
        if test x$enable_timers = xyes; then
slouken@0
  1485
            COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
slouken@0
  1486
        fi
slouken@0
  1487
        ;;
slouken@0
  1488
    *-*-hpux*)
slouken@0
  1489
        ARCH=hpux
slouken@1
  1490
        CheckDummyVideo
slouken@35
  1491
        CheckOSS
slouken@0
  1492
        CheckNAS
slouken@0
  1493
        CheckX11
slouken@0
  1494
        CheckGGI
slouken@0
  1495
        CheckAAlib
slouken@0
  1496
        CheckOpenGL
slouken@0
  1497
        CheckPTHREAD
slouken@0
  1498
        # Set up files for the main() stub
slouken@0
  1499
        COPY_ARCH_SRC(src/main, linux, SDL_main.c)
slouken@0
  1500
        # Set up files for the audio library
slouken@0
  1501
        if test x$enable_audio = xyes; then
slouken@0
  1502
            AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun"
slouken@0
  1503
            AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la"
slouken@0
  1504
        fi
slouken@0
  1505
        # Set up files for the joystick library
slouken@0
  1506
        # (No joystick support yet)
slouken@0
  1507
        if test x$enable_joystick = xyes; then
slouken@0
  1508
            JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS dummy"
slouken@0
  1509
            JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS dummy/libjoystick_dummy.la"
slouken@0
  1510
        fi
slouken@0
  1511
        # Set up files for the cdrom library
slouken@0
  1512
        # (No CD-ROM support yet)
slouken@0
  1513
        if test x$enable_cdrom = xyes; then
slouken@0
  1514
            COPY_ARCH_SRC(src/cdrom, dummy, SDL_syscdrom.c)
slouken@0
  1515
        fi
slouken@0
  1516
        # Set up files for the thread library
slouken@0
  1517
        if test x$enable_threads = xyes; then
slouken@0
  1518
            COPY_ARCH_SRC(src/thread, linux, SDL_systhread.c)
slouken@0
  1519
            COPY_ARCH_SRC(src/thread, linux, SDL_systhread_c.h)
slouken@0
  1520
            COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex.c)
slouken@0
  1521
            COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex_c.h)
slouken@0
  1522
            COPY_ARCH_SRC(src/thread, linux, SDL_syssem.c)
slouken@0
  1523
            COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
slouken@0
  1524
            COPY_ARCH_SRC(src/thread, linux, SDL_syscond.c)
slouken@0
  1525
            COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
slouken@0
  1526
        fi
slouken@0
  1527
        # Set up files for the timer library
slouken@0
  1528
        if test x$enable_timers = xyes; then
slouken@0
  1529
            COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
slouken@0
  1530
        fi
slouken@0
  1531
        ;;
slouken@0
  1532
    *-*-aix*)
slouken@0
  1533
        ARCH=aix
slouken@1
  1534
        CheckDummyVideo
slouken@35
  1535
        CheckOSS
slouken@0
  1536
        CheckNAS
slouken@0
  1537
        CheckX11
slouken@0
  1538
        CheckGGI
slouken@0
  1539
        CheckAAlib
slouken@0
  1540
        CheckOpenGL
slouken@0
  1541
        CheckPTHREAD
slouken@0
  1542
        # Set up files for the main() stub
slouken@0
  1543
        COPY_ARCH_SRC(src/main, linux, SDL_main.c)
slouken@0
  1544
        # Set up files for the audio library
slouken@0
  1545
        if test x$enable_audio = xyes; then
slouken@0
  1546
            AUDIO_SUBDIRS="$AUDIO_SUBDIRS paudio"
slouken@0
  1547
            AUDIO_DRIVERS="$AUDIO_DRIVERS paudio/libaudio_paudio.la"
slouken@0
  1548
        fi
slouken@0
  1549
        # Set up files for the joystick library
slouken@0
  1550
        # (No joystick support yet)
slouken@0
  1551
        if test x$enable_joystick = xyes; then
slouken@0
  1552
            JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS dummy"
slouken@0
  1553
            JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS dummy/libjoystick_dummy.la"
slouken@0
  1554
        fi
slouken@0
  1555
        # Set up files for the cdrom library
slouken@0
  1556
        if test x$enable_cdrom = xyes; then
slouken@0
  1557
            COPY_ARCH_SRC(src/cdrom, aix, SDL_syscdrom.c)
slouken@0
  1558
        fi
slouken@0
  1559
        # Set up files for the thread library
slouken@0
  1560
        if test x$enable_threads = xyes; then
slouken@0
  1561
            COPY_ARCH_SRC(src/thread, linux, SDL_systhread.c)
slouken@0
  1562
            COPY_ARCH_SRC(src/thread, linux, SDL_systhread_c.h)
slouken@0
  1563
            COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex.c)
slouken@0
  1564
            COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex_c.h)
slouken@0
  1565
            COPY_ARCH_SRC(src/thread, linux, SDL_syssem.c)
slouken@0
  1566
            COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
slouken@0
  1567
            COPY_ARCH_SRC(src/thread, linux, SDL_syscond.c)
slouken@0
  1568
            COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
slouken@0
  1569
        fi
slouken@0
  1570
        # Set up files for the timer library
slouken@0
  1571
        if test x$enable_timers = xyes; then
slouken@0
  1572
            COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
slouken@0
  1573
        fi
slouken@0
  1574
        ;;
slouken@0
  1575
    *-*-osf*)
slouken@0
  1576
        ARCH=osf
slouken@1
  1577
        CheckDummyVideo
slouken@0
  1578
        CheckNAS
slouken@0
  1579
        CheckX11
slouken@0
  1580
        CheckGGI
slouken@0
  1581
        CheckAAlib
slouken@0
  1582
        CheckOpenGL
slouken@0
  1583
        CheckPTHREAD
slouken@0
  1584
        # Set up files for the main() stub
slouken@0
  1585
        COPY_ARCH_SRC(src/main, linux, SDL_main.c)
slouken@0
  1586
        # Set up files for the audio library
slouken@0
  1587
        if test x$enable_audio = xyes; then
slouken@0
  1588
            AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun"
slouken@0
  1589
            AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la"
slouken@0
  1590
        fi
slouken@0
  1591
        # Set up files for the joystick library
slouken@0
  1592
        # (No joystick support yet)
slouken@0
  1593
        if test x$enable_joystick = xyes; then
slouken@0
  1594
            JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS dummy"
slouken@0
  1595
            JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS dummy/libjoystick_dummy.la"
slouken@0
  1596
        fi
slouken@0
  1597
        # Set up files for the cdrom library
slouken@0
  1598
        # (No cdrom support yet)
slouken@0
  1599
        if test x$enable_cdrom = xyes; then
slouken@0
  1600
            COPY_ARCH_SRC(src/cdrom, dummy, SDL_syscdrom.c)
slouken@0
  1601
        fi
slouken@0
  1602
        # Set up files for the thread library
slouken@0
  1603
        if test x$enable_threads = xyes; then
slouken@0
  1604
            COPY_ARCH_SRC(src/thread, linux, SDL_systhread.c)
slouken@0
  1605
            COPY_ARCH_SRC(src/thread, linux, SDL_systhread_c.h)
slouken@0
  1606
            COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex.c)
slouken@0
  1607
            COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex_c.h)
slouken@0
  1608
            COPY_ARCH_SRC(src/thread, generic, SDL_syssem.c)
slouken@0
  1609
            COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
slouken@0
  1610
            COPY_ARCH_SRC(src/thread, linux, SDL_syscond.c)
slouken@0
  1611
            COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
slouken@0
  1612
        fi
slouken@0
  1613
        # Set up files for the timer library
slouken@0
  1614
        if test x$enable_timers = xyes; then
slouken@0
  1615
            COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
slouken@0
  1616
        fi
slouken@0
  1617
        ;;
slouken@0
  1618
    *-*-qnx*)
slouken@0
  1619
        ARCH=qnx
slouken@1
  1620
        CheckDummyVideo
slouken@0
  1621
        CheckNAS
slouken@0
  1622
        CheckPHOTON
slouken@0
  1623
        CheckX11
slouken@0
  1624
        CheckOpenGL
slouken@0
  1625
        CheckPTHREAD
slouken@0
  1626
        # Set up files for the main() stub
slouken@0
  1627
        COPY_ARCH_SRC(src/main, linux, SDL_main.c)
slouken@0
  1628
        # Set up files for the audio library
slouken@0
  1629
        if test x$enable_audio = xyes; then
slouken@0
  1630
            CFLAGS="$CFLAGS -DALSA_SUPPORT"
slouken@0
  1631
            SYSTEM_LIBS="$SYSTEM_LIBS -lasound"
slouken@0
  1632
            AUDIO_SUBDIRS="$AUDIO_SUBDIRS nto"
slouken@0
  1633
            AUDIO_DRIVERS="$AUDIO_DRIVERS nto/libaudio_nto.la"
slouken@0
  1634
            AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun"
slouken@0
  1635
            AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la"
slouken@0
  1636
        fi
slouken@0
  1637
        # Set up files for the joystick library
slouken@0
  1638
        if test x$enable_joystick = xyes; then
slouken@0
  1639
        # (No joystick support yet)
slouken@0
  1640
            JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS dummy"
slouken@0
  1641
            JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS dummy/libjoystick_dummy.la"
slouken@0
  1642
        fi
slouken@0
  1643
        # Set up files for the cdrom library
slouken@0
  1644
        if test x$enable_cdrom = xyes; then
slouken@0
  1645
            COPY_ARCH_SRC(src/cdrom, qnx, SDL_syscdrom.c)
slouken@0
  1646
        fi
slouken@0
  1647
        # Set up files for the thread library
slouken@0
  1648
        if test x$enable_threads = xyes; then
slouken@0
  1649
            COPY_ARCH_SRC(src/thread, linux, SDL_systhread.c)
slouken@0
  1650
            COPY_ARCH_SRC(src/thread, linux, SDL_systhread_c.h)
slouken@0
  1651
            COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex.c)
slouken@0
  1652
            COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex_c.h)
slouken@0
  1653
            COPY_ARCH_SRC(src/thread, linux, SDL_syssem.c)
slouken@0
  1654
            COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
slouken@0
  1655
            COPY_ARCH_SRC(src/thread, linux, SDL_syscond.c)
slouken@0
  1656
            COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
slouken@0
  1657
        fi
slouken@0
  1658
        # Set up files for the timer library
slouken@0
  1659
        if test x$enable_timers = xyes; then
slouken@0
  1660
            COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
slouken@0
  1661
        fi
slouken@0
  1662
        ;;
slouken@0
  1663
    *-*-cygwin* | *-*-mingw32*)
slouken@0
  1664
        ARCH=win32
slouken@0
  1665
        if test "$build" != "$target"; then # cross-compiling
slouken@0
  1666
            # Default cross-compile location
slouken@0
  1667
            ac_default_prefix=/usr/local/cross-tools/i386-mingw32msvc
slouken@0
  1668
        else
slouken@0
  1669
            # Look for the location of the tools and install there
slouken@1
  1670
            if [ "$BUILD_PREFIX" != "" ]; then
slouken@1
  1671
                ac_default_prefix=$BUILD_PREFIX
slouken@1
  1672
            fi
slouken@0
  1673
        fi
slouken@1
  1674
        CheckDummyVideo
slouken@0
  1675
        CheckWIN32
slouken@0
  1676
        CheckDIRECTX
slouken@0
  1677
        CheckNASM
slouken@0
  1678
        # Set up files for the main() stub
slouken@0
  1679
        COPY_ARCH_SRC(src/main, win32, SDL_main.c)
slouken@0
  1680
        # Set up files for the audio library
slouken@0
  1681
        if test x$enable_audio = xyes; then
slouken@0
  1682
            AUDIO_SUBDIRS="$AUDIO_SUBDIRS windib"
slouken@0
  1683
            AUDIO_DRIVERS="$AUDIO_DRIVERS windib/libaudio_windib.la"
slouken@0
  1684
            if test x$use_directx = xyes; then
slouken@41
  1685
                AUDIO_SUBDIRS="$AUDIO_SUBDIRS windx5"
slouken@41
  1686
                AUDIO_DRIVERS="$AUDIO_DRIVERS windx5/libaudio_windx5.la"
slouken@0
  1687
            fi
slouken@0
  1688
        fi
slouken@0
  1689
        # Set up files for the joystick library
slouken@0
  1690
        if test x$enable_joystick = xyes; then
slouken@0
  1691
            JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS win32"
slouken@0
  1692
            JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS win32/libjoystick_winmm.la"
slouken@0
  1693
        fi
slouken@0
  1694
        # Set up files for the cdrom library
slouken@0
  1695
        if test x$enable_cdrom = xyes; then
slouken@0
  1696
            COPY_ARCH_SRC(src/cdrom, win32, SDL_syscdrom.c)
slouken@0
  1697
        fi
slouken@0
  1698
        # Set up files for the thread library
slouken@0
  1699
        if test x$enable_threads = xyes; then
slouken@0
  1700
            COPY_ARCH_SRC(src/thread, win32, SDL_systhread.c)
slouken@0
  1701
            COPY_ARCH_SRC(src/thread, win32, SDL_systhread_c.h)
slouken@0
  1702
            COPY_ARCH_SRC(src/thread, win32, SDL_sysmutex.c)
slouken@0
  1703
            COPY_ARCH_SRC(src/thread, generic, SDL_sysmutex_c.h)
slouken@0
  1704
            COPY_ARCH_SRC(src/thread, win32, SDL_syssem.c)
slouken@0
  1705
            COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
slouken@0
  1706
            COPY_ARCH_SRC(src/thread, generic, SDL_syscond.c)
slouken@0
  1707
            COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
slouken@0
  1708
        fi
slouken@0
  1709
        # Set up files for the timer library
slouken@0
  1710
        if test x$enable_timers = xyes; then
slouken@0
  1711
            COPY_ARCH_SRC(src/timer, win32, SDL_systimer.c)
slouken@0
  1712
        fi
slouken@0
  1713
        # The Win32 platform requires special setup
slouken@0
  1714
        SDL_CFLAGS="$SDL_CFLAGS -Dmain=SDL_main"
slouken@1
  1715
        case "$target" in
slouken@1
  1716
            *-*-cygwin*)
slouken@1
  1717
                CFLAGS="$CFLAGS -I/usr/include/mingw -DWIN32 -Uunix"
slouken@1
  1718
                SDL_CFLAGS="$SDL_CFLAGS -I/usr/include/mingw -DWIN32 -Uunix"
slouken@1
  1719
                LIBS="$LIBS -mno-cygwin"
slouken@1
  1720
                SDL_LIBS="-lmingw32 -lSDLmain $SDL_LIBS -mwindows -mno-cygwin"
slouken@1
  1721
                ;;
slouken@1
  1722
            *-*-mingw32*)
slouken@1
  1723
                SDL_LIBS="-lmingw32 -lSDLmain $SDL_LIBS -mwindows"
slouken@1
  1724
                ;;
slouken@1
  1725
        esac
slouken@0
  1726
        ;;
slouken@0
  1727
    *-*-beos*)
slouken@0
  1728
        ARCH=beos
slouken@0
  1729
        ac_default_prefix=/boot/develop/tools/gnupro
slouken@1
  1730
        CheckDummyVideo
slouken@0
  1731
        CheckNASM
slouken@0
  1732
        CheckBWINDOW
slouken@0
  1733
        CheckBeGL
slouken@0
  1734
        # Set up files for the main() stub
slouken@0
  1735
        COPY_ARCH_SRC(src/main, linux, SDL_main.c)
slouken@0
  1736
        COPY_ARCH_SRC(src/main, beos, SDL_BeApp.cc)
slouken@0
  1737
        COPY_ARCH_SRC(src/main, beos, SDL_BeApp.h)
slouken@0
  1738
        # Set up files for the audio library
slouken@0
  1739
        if test x$enable_audio = xyes; then
slouken@0
  1740
            AUDIO_SUBDIRS="$AUDIO_SUBDIRS baudio"
slouken@0
  1741
            AUDIO_DRIVERS="$AUDIO_DRIVERS baudio/libaudio_baudio.la"
slouken@0
  1742
        fi
slouken@0
  1743
        # Set up files for the joystick library
slouken@0
  1744
        if test x$enable_joystick = xyes; then
slouken@0
  1745
            JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS beos"
slouken@0
  1746
            JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS beos/libjoystick_beos.la"
slouken@0
  1747
        fi
slouken@0
  1748
        # Set up files for the cdrom library
slouken@0
  1749
        if test x$enable_cdrom = xyes; then
slouken@0
  1750
            COPY_ARCH_SRC(src/cdrom, beos, SDL_syscdrom.c)
slouken@0
  1751
        fi
slouken@0
  1752
        # Set up files for the thread library
slouken@0
  1753
        if test x$enable_threads = xyes; then
slouken@0
  1754
            COPY_ARCH_SRC(src/thread, beos, SDL_systhread.c)
slouken@0
  1755
            COPY_ARCH_SRC(src/thread, beos, SDL_systhread_c.h)
slouken@0
  1756
            COPY_ARCH_SRC(src/thread, generic, SDL_sysmutex.c)
slouken@0
  1757
            COPY_ARCH_SRC(src/thread, generic, SDL_sysmutex_c.h)
slouken@0
  1758
            COPY_ARCH_SRC(src/thread, beos, SDL_syssem.c)
slouken@0
  1759
            COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
slouken@0
  1760
            COPY_ARCH_SRC(src/thread, generic, SDL_syscond.c)
slouken@0
  1761
            COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
slouken@0
  1762
        fi
slouken@0
  1763
        # Set up files for the timer library
slouken@0
  1764
        if test x$enable_timers = xyes; then
slouken@0
  1765
            COPY_ARCH_SRC(src/timer, beos, SDL_systimer.c)
slouken@0
  1766
        fi
slouken@0
  1767
        # The BeOS platform requires special libraries
slouken@0
  1768
        SYSTEM_LIBS="$SYSTEM_LIBS -lroot -lbe -lmedia -lgame -ldevice -ltextencoding"
slouken@0
  1769
        ;;
slouken@0
  1770
    *-*-macos*)
slouken@0
  1771
        # This would be used if cross-compiling to MacOS 9.  No way to
slouken@0
  1772
        # use it at present, but Apple is working on a X-to-9 compiler
slouken@0
  1773
        # for which this case would be handy.
slouken@0
  1774
        ARCH=macos
slouken@1
  1775
        CheckDummyVideo
slouken@0
  1776
        CheckTOOLBOX
slouken@0
  1777
        CheckMacGL
slouken@0
  1778
        # Set up files for the main() stub
slouken@0
  1779
        COPY_ARCH_SRC(src/main, macos, SDL_main.c)
slouken@0
  1780
        # Set up files for the audio library
slouken@0
  1781
        if test x$enable_audio = xyes; then
slouken@0
  1782
            AUDIO_SUBDIRS="$AUDIO_SUBDIRS macrom"
slouken@0
  1783
            AUDIO_DRIVERS="$AUDIO_DRIVERS macrom/libaudio_macrom.la"
slouken@0
  1784
        fi
slouken@0
  1785
        # Set up files for the joystick library
slouken@0
  1786
        if test x$enable_joystick = xyes; then
slouken@0
  1787
            JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS macos"
slouken@0
  1788
            JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS macos/libjoystick_macos.la"
slouken@0
  1789
        fi
slouken@0
  1790
        # Set up files for the cdrom library
slouken@0
  1791
        if test x$enable_cdrom = xyes; then
slouken@0
  1792
            COPY_ARCH_SRC(src/cdrom, macos, SDL_syscdrom.c)
slouken@0
  1793
        fi
slouken@0
  1794
        # Set up files for the thread library
slouken@0
  1795
        if test x$enable_threads = xyes; then
slouken@0
  1796
            COPY_ARCH_SRC(src/thread, macos, SDL_systhread.c)
slouken@0
  1797
            COPY_ARCH_SRC(src/thread, macos, SDL_systhread_c.h)
slouken@0
  1798
            COPY_ARCH_SRC(src/thread, generic, SDL_sysmutex.c)
slouken@0
  1799
            COPY_ARCH_SRC(src/thread, generic, SDL_sysmutex_c.h)
slouken@0
  1800
            COPY_ARCH_SRC(src/thread, macos, SDL_syssem.c)
slouken@0
  1801
            COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
slouken@0
  1802
            COPY_ARCH_SRC(src/thread, generic, SDL_syscond.c)
slouken@0
  1803
            COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
slouken@0
  1804
        fi
slouken@0
  1805
        # Set up files for the timer library
slouken@0
  1806
        if test x$enable_timers = xyes; then
slouken@0
  1807
            COPY_ARCH_SRC(src/timer, macos, SDL_systimer.c)
slouken@0
  1808
        fi
slouken@0
  1809
        # The MacOS platform requires special setup
slouken@0
  1810
        SDL_CFLAGS="$SDL_CFLAGS -Dmain=SDL_main"
slouken@0
  1811
        SDL_LIBS="-lSDLmain $SDL_LIBS"
slouken@0
  1812
        ;;
slouken@0
  1813
    *-*-darwin* )
slouken@0
  1814
        # Strictly speaking, we want "Mac OS X", not "Darwin", which is
slouken@0
  1815
        # just the OS X kernel sans upper layers like Carbon.  But
slouken@0
  1816
        # config.guess comes back with "darwin", so go with the flow.
slouken@0
  1817
        ARCH=macos
slouken@1
  1818
        CheckDummyVideo
slouken@0
  1819
        CheckCARBON
slouken@0
  1820
        CheckMacGL
slouken@0
  1821
        CheckPTHREAD
slouken@0
  1822
        # Set up files for the main() stub
slouken@0
  1823
        # COPY_ARCH_SRC(src/main, macos, SDL_main.c)
slouken@0
  1824
        COPY_ARCH_SRC(src/main, linux, SDL_main.c)
slouken@0
  1825
        # Set up files for the audio library
slouken@0
  1826
        if test x$enable_audio = xyes; then
slouken@0
  1827
            AUDIO_SUBDIRS="$AUDIO_SUBDIRS macrom"
slouken@0
  1828
            AUDIO_DRIVERS="$AUDIO_DRIVERS macrom/libaudio_macrom.la"
slouken@0
  1829
        fi
slouken@0
  1830
        # Set up files for the joystick library
slouken@0
  1831
        if test x$enable_joystick = xyes; then
slouken@0
  1832
            JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS dummy"
slouken@0
  1833
            JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS dummy/libjoystick_dummy.la"
slouken@0
  1834
        fi
slouken@0
  1835
        # Set up files for the cdrom library
slouken@0
  1836
        if test x$enable_cdrom = xyes; then
slouken@0
  1837
            COPY_ARCH_SRC(src/cdrom, dummy, SDL_syscdrom.c)
slouken@0
  1838
        fi
slouken@0
  1839
        # Set up files for the thread library
slouken@0
  1840
        if test x$enable_threads = xyes; then
slouken@0
  1841
            COPY_ARCH_SRC(src/thread, linux, SDL_systhread.c)
slouken@0
  1842
            COPY_ARCH_SRC(src/thread, linux, SDL_systhread_c.h)
slouken@0
  1843
            COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex.c)
slouken@0
  1844
            COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex_c.h)
slouken@0
  1845
            if test x$use_pthreads = xyes -a x$enable_pthread_sem != xyes; then
slouken@0
  1846
                COPY_ARCH_SRC(src/thread, generic, SDL_syssem.c)
slouken@0
  1847
            else
slouken@0
  1848
                COPY_ARCH_SRC(src/thread, linux, SDL_syssem.c)
slouken@0
  1849
            fi
slouken@0
  1850
            COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
slouken@0
  1851
            COPY_ARCH_SRC(src/thread, generic, SDL_syscond.c)
slouken@0
  1852
            COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
slouken@0
  1853
        fi
slouken@0
  1854
        # Set up files for the timer library
slouken@0
  1855
        if test x$enable_timers = xyes; then
slouken@0
  1856
            COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
slouken@0
  1857
        fi
slouken@0
  1858
        # The MacOS X platform requires special setup
slouken@0
  1859
        SDL_CFLAGS="$SDL_CFLAGS -F/System/Library/Frameworks/Carbon.framework"
slouken@0
  1860
        SDL_LIBS="$SDL_LIBS -framework Carbon"
slouken@0
  1861
        ;;
slouken@0
  1862
    *)
slouken@0
  1863
        AC_MSG_ERROR(Unsupported target:  Please add to configure.in)
slouken@0
  1864
        ;;
slouken@0
  1865
esac
slouken@0
  1866
AC_SUBST(ARCH)
slouken@0
  1867
slouken@0
  1868
# Set the conditional variables for this target
slouken@0
  1869
AM_CONDITIONAL(TARGET_LINUX, test $ARCH = linux)
slouken@0
  1870
AM_CONDITIONAL(TARGET_SOLARIS, test $ARCH = solaris)
slouken@0
  1871
AM_CONDITIONAL(TARGET_IRIX, test $ARCH = irix)
slouken@0
  1872
AM_CONDITIONAL(TARGET_BSDI, test $ARCH = bsdi)
slouken@0
  1873
AM_CONDITIONAL(TARGET_FREEBSD, test $ARCH = freebsd)
slouken@39
  1874
AM_CONDITIONAL(TARGET_NETBSD, test $ARCH = netbsd)
slouken@0
  1875
AM_CONDITIONAL(TARGET_OPENBSD, test $ARCH = openbsd)
slouken@0
  1876
AM_CONDITIONAL(TARGET_AIX, test $ARCH = aix)
slouken@0
  1877
AM_CONDITIONAL(TARGET_WIN32, test $ARCH = win32)
slouken@0
  1878
AM_CONDITIONAL(TARGET_BEOS, test $ARCH = beos)
slouken@0
  1879
AM_CONDITIONAL(TARGET_MACOS, test $ARCH = macos)
slouken@0
  1880
slouken@0
  1881
# Set conditional variables for shared and static library selection.
slouken@0
  1882
# These are not used in any Makefile.am but in sdl-config.in.
slouken@0
  1883
AM_CONDITIONAL([ENABLE_SHARED], [test "$enable_shared" = yes])
slouken@0
  1884
AM_CONDITIONAL([ENABLE_STATIC], [test "$enable_static" = yes])
slouken@0
  1885
slouken@0
  1886
# Set runtime shared library paths as needed
slouken@0
  1887
slouken@0
  1888
if test $ARCH = linux -o $ARCH = freebsd -o $ARCH = bsdi; then
slouken@0
  1889
  SDL_RLD_FLAGS="-Wl,-rpath,\${exec_prefix}/lib"
slouken@0
  1890
fi
slouken@0
  1891
slouken@0
  1892
if test $ARCH = solaris; then
slouken@0
  1893
  SDL_RLD_FLAGS="-R\${exec_prefix}/lib"
slouken@0
  1894
fi
slouken@0
  1895
slouken@1
  1896
if test $ARCH = openbsd; then
slouken@37
  1897
  SDL_RLD_FLAGS="-L${X11BASE}/lib -Wl,-rpath,\${exec_prefix}/lib -Wl,-rpath,${X11BASE}/lib"
slouken@1
  1898
fi
slouken@1
  1899
slouken@0
  1900
dnl Output the video drivers we use
slouken@0
  1901
if test x$enable_video = xtrue; then
slouken@0
  1902
    if test "$VIDEO_SUBDIRS" = ""; then
slouken@0
  1903
        AC_MSG_ERROR(*** No video drivers are enabled!)
slouken@0
  1904
    fi
slouken@0
  1905
fi
slouken@0
  1906
AC_SUBST(AUDIO_SUBDIRS)
slouken@0
  1907
AC_SUBST(AUDIO_DRIVERS)
slouken@0
  1908
AC_SUBST(VIDEO_SUBDIRS)
slouken@0
  1909
AC_SUBST(VIDEO_DRIVERS)
slouken@0
  1910
AC_SUBST(JOYSTICK_SUBDIRS)
slouken@0
  1911
AC_SUBST(JOYSTICK_DRIVERS)
slouken@0
  1912
AC_SUBST(SDL_EXTRADIRS)
slouken@0
  1913
AC_SUBST(SDL_EXTRALIBS)
slouken@0
  1914
AC_SUBST(SYSTEM_LIBS)
slouken@0
  1915
slouken@0
  1916
dnl Expand the cflags and libraries needed by apps using SDL
slouken@0
  1917
AC_SUBST(SDL_CFLAGS)
slouken@0
  1918
AC_SUBST(SDL_LIBS)
slouken@0
  1919
AC_SUBST(SDL_RLD_FLAGS)
slouken@0
  1920
slouken@0
  1921
dnl Expand the libraries needed for static linking
slouken@0
  1922
AC_SUBST(SYSTEM_LIBS)
slouken@0
  1923
dnl Expand the include directories for building SDL
slouken@0
  1924
CFLAGS="$CFLAGS -I\$(top_srcdir)/include"
slouken@0
  1925
CFLAGS="$CFLAGS -I\$(top_srcdir)/include/SDL"
slouken@0
  1926
CFLAGS="$CFLAGS -I\$(top_srcdir)/src -I\$(top_srcdir)/src/$ARCH"
slouken@0
  1927
CFLAGS="$CFLAGS -I\$(top_srcdir)/src/main"
slouken@0
  1928
CFLAGS="$CFLAGS -I\$(top_srcdir)/src/audio"
slouken@0
  1929
CFLAGS="$CFLAGS -I\$(top_srcdir)/src/video"
slouken@0
  1930
CFLAGS="$CFLAGS -I\$(top_srcdir)/src/events"
slouken@0
  1931
CFLAGS="$CFLAGS -I\$(top_srcdir)/src/joystick"
slouken@0
  1932
CFLAGS="$CFLAGS -I\$(top_srcdir)/src/cdrom"
slouken@0
  1933
CFLAGS="$CFLAGS -I\$(top_srcdir)/src/thread"
slouken@0
  1934
CFLAGS="$CFLAGS -I\$(top_srcdir)/src/timer"
slouken@0
  1935
CFLAGS="$CFLAGS -I\$(top_srcdir)/src/endian"
slouken@0
  1936
CFLAGS="$CFLAGS -I\$(top_srcdir)/src/file"
slouken@0
  1937
CXXFLAGS="$CFLAGS"
slouken@0
  1938
slouken@0
  1939
# Finally create all the generated files
slouken@0
  1940
dnl Important: Any directory that you want to be in the distcheck should
slouken@0
  1941
dnl            have a file listed here, so that configure generates the
slouken@0
  1942
dnl            subdirectories on the build target.
slouken@0
  1943
AC_OUTPUT([
slouken@0
  1944
Makefile
slouken@0
  1945
docs/Makefile
slouken@0
  1946
docs/html/Makefile
slouken@0
  1947
docs/man3/Makefile
slouken@0
  1948
include/Makefile
slouken@0
  1949
src/Makefile
slouken@0
  1950
src/main/Makefile
slouken@0
  1951
src/audio/Makefile
slouken@0
  1952
src/audio/alsa/Makefile
slouken@0
  1953
src/audio/arts/Makefile
slouken@0
  1954
src/audio/baudio/Makefile
slouken@0
  1955
src/audio/dma/Makefile
slouken@0
  1956
src/audio/dmedia/Makefile
slouken@0
  1957
src/audio/dsp/Makefile
slouken@0
  1958
src/audio/esd/Makefile
slouken@0
  1959
src/audio/macrom/Makefile
slouken@0
  1960
src/audio/nas/Makefile
slouken@0
  1961
src/audio/nto/Makefile
slouken@37
  1962
src/audio/openbsd/Makefile
slouken@0
  1963
src/audio/paudio/Makefile
slouken@0
  1964
src/audio/sun/Makefile
slouken@0
  1965
src/audio/ums/Makefile
slouken@0
  1966
src/audio/windib/Makefile
slouken@0
  1967
src/audio/windx5/Makefile
slouken@0
  1968
src/video/Makefile
slouken@0
  1969
src/video/cybergfx/Makefile
slouken@0
  1970
src/video/x11/Makefile
slouken@0
  1971
src/video/dga/Makefile
slouken@30
  1972
src/video/nanox/Makefile
slouken@0
  1973
src/video/fbcon/Makefile
slouken@0
  1974
src/video/ggi/Makefile
slouken@0
  1975
src/video/maccommon/Makefile
slouken@0
  1976
src/video/macdsp/Makefile
slouken@0
  1977
src/video/macrom/Makefile
slouken@0
  1978
src/video/svga/Makefile
slouken@0
  1979
src/video/aalib/Makefile
slouken@0
  1980
src/video/wincommon/Makefile
slouken@0
  1981
src/video/windib/Makefile
slouken@0
  1982
src/video/windx5/Makefile
slouken@0
  1983
src/video/bwindow/Makefile
slouken@0
  1984
src/video/photon/Makefile
slouken@1
  1985
src/video/dummy/Makefile
slouken@0
  1986
src/events/Makefile
slouken@0
  1987
src/joystick/Makefile
slouken@21
  1988
src/joystick/amigaos/Makefile
slouken@0
  1989
src/joystick/beos/Makefile
slouken@0
  1990
src/joystick/dummy/Makefile
slouken@0
  1991
src/joystick/linux/Makefile
slouken@0
  1992
src/joystick/macos/Makefile
slouken@0
  1993
src/joystick/win32/Makefile
slouken@0
  1994
src/cdrom/Makefile
slouken@0
  1995
src/thread/Makefile
slouken@0
  1996
src/timer/Makefile
slouken@0
  1997
src/endian/Makefile
slouken@0
  1998
src/file/Makefile
slouken@0
  1999
src/hermes/Makefile
slouken@0
  2000
sdl-config
slouken@0
  2001
SDL.spec
slouken@0
  2002
], [chmod +x sdl-config])