comparison configure.in @ 1361:19418e4422cb

New configure-based build system. Still work in progress, but much improved
author Sam Lantinga <slouken@libsdl.org>
date Thu, 16 Feb 2006 10:11:48 +0000
parents 22f39393668a
children dc623bb58c9a
comparison
equal deleted inserted replaced
1360:70a9cfb4cf1b 1361:19418e4422cb
38 AC_SUBST(LT_CURRENT) 38 AC_SUBST(LT_CURRENT)
39 AC_SUBST(LT_REVISION) 39 AC_SUBST(LT_REVISION)
40 AC_SUBST(LT_AGE) 40 AC_SUBST(LT_AGE)
41 41
42 dnl Detect the canonical host and target build environment 42 dnl Detect the canonical host and target build environment
43 AC_CONFIG_AUX_DIRS($srcdir/build-scripts)
43 AC_CANONICAL_SYSTEM 44 AC_CANONICAL_SYSTEM
44 AC_C_BIGENDIAN 45 AC_C_BIGENDIAN
45 if test x$ac_cv_c_bigendian = xyes; then 46 if test x$ac_cv_c_bigendian = xyes; then
46 AC_DEFINE(SDL_BYTEORDER, 4321) 47 AC_DEFINE(SDL_BYTEORDER, 4321)
47 else 48 else
48 AC_DEFINE(SDL_BYTEORDER, 1234) 49 AC_DEFINE(SDL_BYTEORDER, 1234)
49 fi 50 fi
50 51
51 dnl Setup for automake
52 AM_INIT_AUTOMAKE(SDL, $SDL_VERSION)
53
54 dnl Disable autoheader
55 AUTOHEADER=:
56
57 dnl Check for tools 52 dnl Check for tools
58 53 #AC_LIBTOOL_DLOPEN
59 AC_LIBTOOL_WIN32_DLL 54 AC_LIBTOOL_WIN32_DLL
60 AM_PROG_LIBTOOL 55 AC_PROG_LIBTOOL
61 AC_PROG_MAKE_SET
62 AC_PROG_CC 56 AC_PROG_CC
63 AC_PROG_CXX 57 AC_PROG_CXX
64 AC_PROG_INSTALL 58 AC_PROG_INSTALL
65 ASFLAGS=""
66 AC_SUBST(ASFLAGS)
67 CCAS="$CC"
68 AC_SUBST(CCAS)
69 CCASFLAGS=""
70 AC_SUBST(CCASFLAGS)
71 AM_CONDITIONAL([am__fastdepOBJC], false)
72
73 dnl The alpha architecture needs special flags for binary portability
74 case "$target" in
75 alpha*-*-linux*)
76 if test x$ac_cv_prog_gcc = xyes; then
77 CFLAGS="$CFLAGS -mcpu=ev4 -Wa,-mall"
78 fi
79 ;;
80 esac
81
82 dnl Add compiler-specific optimization flags
83
84 dnl See if the user wants aggressive optimizations of the code
85 AC_ARG_ENABLE(debug,
86 [ --enable-debug Disable aggressive optimizations [default=yes]],
87 , enable_debug=yes)
88 if test x$enable_debug != xyes; then
89 if test x$ac_cv_prog_gcc = xyes; then
90 CFLAGS="$CFLAGS -fexpensive-optimizations"
91 # Ack! This breaks the MMX YV12 conversion on gcc 2.95.2
92 # CFLAGS="$CFLAGS -fomit-frame-pointer"
93 fi
94 case "$target" in
95 i486-*-*)
96 if test x$ac_cv_prog_gcc = xyes; then
97 CFLAGS="$CFLAGS -march=i486"
98 fi
99 ;;
100 i?86-*-*)
101 if test x$ac_cv_prog_gcc = xyes; then
102 CFLAGS="$CFLAGS -march=pentium -mcpu=pentiumpro"
103 fi
104 ;;
105 *-*-osf*)
106 if test x$ac_cv_prog_gcc != xyes; then
107 CFLAGS="-g3 -fast -arch host"
108 fi
109 ;;
110 esac
111 fi
112
113 dnl Add verbose warnings by default, and allow ANSI compliance checking
114 AC_ARG_ENABLE(strict-ansi,
115 [ --enable-strict-ansi Enable strict ANSI compliance build [default=no]],
116 , enable_strict_ansi=no)
117 if test x$ac_cv_prog_gcc = xyes; then
118 CFLAGS="$CFLAGS -Wall"
119 if test x$enable_strict_ansi = xyes; then
120 CFLAGS="$CFLAGS -ansi -pedantic -D_XOPEN_SOURCE"
121 fi
122 fi
123
124 dnl See whether we are allowed to use the system C library
125 AC_ARG_ENABLE(libc,
126 [ --enable-libc Use the system C library [default=yes]],
127 , AC_DEFINE(HAVE_LIBC))
128 59
129 dnl Check for compiler characteristics 60 dnl Check for compiler characteristics
130 AC_C_CONST 61 AC_C_CONST
131 AC_C_INLINE 62 AC_C_INLINE
132 AC_C_VOLATILE 63 AC_C_VOLATILE
133 64
134 dnl Check for header files 65 dnl See whether we are allowed to use the system C library
135 AC_HEADER_STDC 66 AC_ARG_ENABLE(libc,
136 AC_CHECK_HEADERS(sys/types.h stdio.h stdlib.h stddef.h stdarg.h malloc.h memory.h string.h strings.h inttypes.h stdint.h ctype.h signal.h) 67 AC_HELP_STRING([--enable-libc], [Use the system C library [default=yes]]),
137 68 , enable_libc=yes)
138 dnl Check for typedefs, structures, etc. 69 if test x$enable_libc = xyes; then
139 AC_TYPE_SIZE_T 70 AC_DEFINE(HAVE_LIBC)
140 if test x$ac_cv_header_inttypes_h = xyes -o x$ac_cv_header_stdint_h = xyes; then 71
141 AC_CHECK_TYPE(int64_t) 72 dnl Check for C library headers
142 if test x$ac_cv_type_int64_t = xyes; then 73 AC_HEADER_STDC
143 AC_DEFINE(SDL_HAS_64BIT_TYPE) 74 AC_CHECK_HEADERS(sys/types.h stdio.h stdlib.h stddef.h stdarg.h malloc.h memory.h string.h strings.h inttypes.h stdint.h ctype.h math.h signal.h)
144 fi 75
145 else 76 dnl Check for typedefs, structures, etc.
77 AC_TYPE_SIZE_T
78 if test x$ac_cv_header_inttypes_h = xyes -o x$ac_cv_header_stdint_h = xyes; then
79 AC_CHECK_TYPE(int64_t)
80 if test x$ac_cv_type_int64_t = xyes; then
81 AC_DEFINE(SDL_HAS_64BIT_TYPE)
82 fi
83 have_inttypes=yes
84 fi
85
86 dnl Checks for library functions.
87 AC_FUNC_ALLOCA
88 AC_FUNC_MEMCMP
89 if test x$ac_cv_func_memcmp_working = xyes; then
90 AC_DEFINE(HAVE_MEMCMP)
91 fi
92 AC_FUNC_STRTOD
93 if test x$ac_cv_func_strtod = xyes; then
94 AC_DEFINE(HAVE_STRTOD)
95 fi
96 AC_CHECK_FUNCS(malloc calloc realloc free getenv putenv unsetenv qsort abs bcopy memset memcpy memmove strlen strcpy strncpy strcat strncat strdup _strrev _strupr _strlwr strchr strrchr strstr itoa _ltoa _uitoa _ultoa strtol _i64toa _ui64toa strtoll atoi atof strcmp strncmp stricmp strcasecmp sscanf snprintf vsnprint sigaction setjmp nanosleep)
97 fi
98
99 if test x$have_inttypes != xyes; then
146 AC_CHECK_SIZEOF(char, 1) 100 AC_CHECK_SIZEOF(char, 1)
147 AC_CHECK_SIZEOF(short, 2) 101 AC_CHECK_SIZEOF(short, 2)
148 AC_CHECK_SIZEOF(int, 4) 102 AC_CHECK_SIZEOF(int, 4)
149 AC_CHECK_SIZEOF(long, 4) 103 AC_CHECK_SIZEOF(long, 4)
150 AC_CHECK_SIZEOF(long long, 8) 104 AC_CHECK_SIZEOF(long long, 8)
179 AC_DEFINE(int64_t, signed long long) 133 AC_DEFINE(int64_t, signed long long)
180 AC_DEFINE(uint64_t, unsigned long long) 134 AC_DEFINE(uint64_t, unsigned long long)
181 AC_DEFINE(SDL_HAS_64BIT_TYPE) 135 AC_DEFINE(SDL_HAS_64BIT_TYPE)
182 fi 136 fi
183 fi 137 fi
184 AC_CHECK_TYPE(uintptr_t, unsigned long) 138 AC_DEFINE(size_t, unsigned int)
139 AC_DEFINE(uintptr_t, unsigned long)
185 fi 140 fi
186 141
187 dnl Checks for library functions. 142 # Set up the build preprocessor flags
188 AC_FUNC_ALLOCA 143 INCLUDE="-I$srcdir/include"
189 AC_FUNC_MEMCMP 144 if test x$srcdir != x.; then
190 if test x$ac_cv_func_memcmp_working = xyes; then 145 INCLUDE="-Iinclude $INCLUDE"
191 AC_DEFINE(HAVE_MEMCMP)
192 fi 146 fi
193 AC_FUNC_STRTOD 147 BUILD_CFLAGS='-D_GNU_SOURCE=1 $(INCLUDE)'
194 if test x$ac_cv_func_strtod = xyes; then 148
195 AC_DEFINE(HAVE_STRTOD) 149 # Standard C sources
196 fi 150 SOURCES="$SOURCES $srcdir/src/*.c"
197 AC_CHECK_FUNCS(malloc calloc realloc free getenv putenv unsetenv qsort abs bcopy memset memcpy memmove strlen strcpy strncpy strcat strncat strdup _strrev _strupr _strlwr strchr strrchr strstr itoa _ltoa _uitoa _ultoa strtol _i64toa _ui64toa strtoll atoi atof strcmp strncmp stricmp strcasecmp sscanf snprintf vsnprint) 151 SOURCES="$SOURCES $srcdir/src/audio/*.c"
198 152 SOURCES="$SOURCES $srcdir/src/cdrom/*.c"
153 SOURCES="$SOURCES $srcdir/src/cpuinfo/*.c"
154 SOURCES="$SOURCES $srcdir/src/events/*.c"
155 SOURCES="$SOURCES $srcdir/src/file/*.c"
156 SOURCES="$SOURCES $srcdir/src/joystick/*.c"
157 SOURCES="$SOURCES $srcdir/src/stdlib/*.c"
158 SOURCES="$SOURCES $srcdir/src/thread/*.c"
159 SOURCES="$SOURCES $srcdir/src/timer/*.c"
160 SOURCES="$SOURCES $srcdir/src/video/*.c"
161
162 # Set up the build libraries needed
163 BUILD_LIBS=""
199 164
200 dnl Initialize the compiler and linker flags for SDL applications 165 dnl Initialize the compiler and linker flags for SDL applications
201 166
202 SDL_CFLAGS="" 167 SDL_CFLAGS=""
203 SDL_LIBS="-lSDL" 168 SDL_LIBS="-lSDL"
216 ;; 181 ;;
217 *) 182 *)
218 MATHLIB="-lm" 183 MATHLIB="-lm"
219 ;; 184 ;;
220 esac 185 esac
221 SYSTEM_LIBS="$SYSTEM_LIBS $MATHLIB" 186 BUILD_LIBS="$BUILD_LIBS $MATHLIB"
222 187
223 dnl Enable/disable various subsystems of the SDL library 188 dnl Enable/disable various subsystems of the SDL library
224 189
225 AC_ARG_ENABLE(audio, 190 AC_ARG_ENABLE(audio,
226 [ --enable-audio Enable the audio subsystem [default=yes]], 191 AC_HELP_STRING([--enable-audio], [Enable the audio subsystem [default=yes]]),
227 , enable_audio=yes) 192 , enable_audio=yes)
228 if test x$enable_audio = xyes; then 193 if test x$enable_audio != xyes; then
229 SDL_EXTRADIRS="$SDL_EXTRADIRS audio" 194 AC_DEFINE(SDL_AUDIO_DISABLED)
230 SDL_EXTRALIBS="$SDL_EXTRALIBS audio/libaudio.la"
231 else
232 CFLAGS="$CFLAGS -DDISABLE_AUDIO"
233 fi 195 fi
234 AC_ARG_ENABLE(video, 196 AC_ARG_ENABLE(video,
235 [ --enable-video Enable the video subsystem [default=yes]], 197 AC_HELP_STRING([--enable-video], [Enable the video subsystem [default=yes]]),
236 , enable_video=yes) 198 , enable_video=yes)
237 if test x$enable_video = xyes; then 199 if test x$enable_video != xyes; then
238 SDL_EXTRADIRS="$SDL_EXTRADIRS video" 200 AC_DEFINE(SDL_VIDEO_DISABLED)
239 SDL_EXTRALIBS="$SDL_EXTRALIBS video/libvideo.la"
240 else
241 CFLAGS="$CFLAGS -DDISABLE_VIDEO"
242 fi 201 fi
243 AC_ARG_ENABLE(events, 202 AC_ARG_ENABLE(events,
244 [ --enable-events Enable the events subsystem [default=yes]], 203 AC_HELP_STRING([--enable-events], [Enable the events subsystem [default=yes]]),
245 , enable_events=yes) 204 , enable_events=yes)
246 if test x$enable_video = xyes -a x$enable_events = xyes; then 205 if test x$enable_events != xyes; then
247 SDL_EXTRADIRS="$SDL_EXTRADIRS events" 206 AC_DEFINE(SDL_EVENTS_DISABLED)
248 SDL_EXTRALIBS="$SDL_EXTRALIBS events/libevents.la"
249 else
250 CFLAGS="$CFLAGS -DDISABLE_EVENTS"
251 fi 207 fi
252 AC_ARG_ENABLE(joystick, 208 AC_ARG_ENABLE(joystick,
253 [ --enable-joystick Enable the joystick subsystem [default=yes]], 209 AC_HELP_STRING([--enable-joystick], [Enable the joystick subsystem [default=yes]]),
254 , enable_joystick=yes) 210 , enable_joystick=yes)
255 if test x$enable_joystick = xyes; then 211 if test x$enable_joystick != xyes; then
256 SDL_EXTRADIRS="$SDL_EXTRADIRS joystick" 212 AC_DEFINE(SDL_JOYSTICK_DISABLED)
257 SDL_EXTRALIBS="$SDL_EXTRALIBS joystick/libjoystick.la"
258 else
259 CFLAGS="$CFLAGS -DDISABLE_JOYSTICK"
260 fi 213 fi
261 AC_ARG_ENABLE(cdrom, 214 AC_ARG_ENABLE(cdrom,
262 [ --enable-cdrom Enable the cdrom subsystem [default=yes]], 215 AC_HELP_STRING([--enable-cdrom], [Enable the cdrom subsystem [default=yes]]),
263 , enable_cdrom=yes) 216 , enable_cdrom=yes)
264 if test x$enable_cdrom = xyes; then 217 if test x$enable_cdrom != xyes; then
265 SDL_EXTRADIRS="$SDL_EXTRADIRS cdrom" 218 AC_DEFINE(SDL_CDROM_DISABLED)
266 SDL_EXTRALIBS="$SDL_EXTRALIBS cdrom/libcdrom.la"
267 else
268 CFLAGS="$CFLAGS -DDISABLE_CDROM"
269 fi 219 fi
270 AC_ARG_ENABLE(threads, 220 AC_ARG_ENABLE(threads,
271 [ --enable-threads Enable the threading subsystem [default=yes]], 221 AC_HELP_STRING([--enable-threads], [Enable the threading subsystem [default=yes]]),
272 , enable_threads=yes) 222 , enable_threads=yes)
273 SDL_EXTRADIRS="$SDL_EXTRADIRS thread"
274 SDL_EXTRALIBS="$SDL_EXTRALIBS thread/libthread.la"
275 if test x$enable_threads != xyes; then 223 if test x$enable_threads != xyes; then
276 CFLAGS="$CFLAGS -DDISABLE_THREADS" 224 AC_DEFINE(SDL_THREADS_DISABLED)
277 COPY_ARCH_SRC(src/thread, generic, SDL_systhread.c)
278 COPY_ARCH_SRC(src/thread, generic, SDL_systhread_c.h)
279 COPY_ARCH_SRC(src/thread, generic, SDL_sysmutex.c)
280 COPY_ARCH_SRC(src/thread, generic, SDL_sysmutex_c.h)
281 COPY_ARCH_SRC(src/thread, generic, SDL_syssem.c)
282 COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
283 COPY_ARCH_SRC(src/thread, generic, SDL_syscond.c)
284 COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
285 fi 225 fi
286 AC_ARG_ENABLE(timers, 226 AC_ARG_ENABLE(timers,
287 [ --enable-timers Enable the timer subsystem [default=yes]], 227 AC_HELP_STRING([--enable-timers], [Enable the timer subsystem [default=yes]]),
288 , enable_timers=yes) 228 , enable_timers=yes)
289 if test x$enable_timers = xyes; then 229 if test x$enable_timers != xyes; then
290 SDL_EXTRADIRS="$SDL_EXTRADIRS timer" 230 AC_DEFINE(SDL_TIMERS_DISABLED)
291 SDL_EXTRALIBS="$SDL_EXTRALIBS timer/libtimer.la"
292 else
293 CFLAGS="$CFLAGS -DDISABLE_TIMERS"
294 fi 231 fi
295 AC_ARG_ENABLE(file, 232 AC_ARG_ENABLE(file,
296 [ --enable-file Enable the file subsystem [default=yes]], 233 AC_HELP_STRING([--enable-file], [Enable the file subsystem [default=yes]]),
297 , enable_file=yes) 234 , enable_file=yes)
298 if test x$enable_file = xyes; then 235 if test x$enable_file != xyes; then
299 SDL_EXTRADIRS="$SDL_EXTRADIRS file" 236 AC_DEFINE(SDL_FILE_DISABLED)
300 SDL_EXTRALIBS="$SDL_EXTRALIBS file/libfile.la" 237 fi
301 else 238 AC_ARG_ENABLE(loadso,
302 CFLAGS="$CFLAGS -DDISABLE_FILE" 239 AC_HELP_STRING([--enable-loadso], [Enable the shared object loading subsystem [default=yes]]),
240 , enable_loadso=yes)
241 if test x$enable_loadso != xyes; then
242 AC_DEFINE(SDL_LOADSO_DISABLED)
303 fi 243 fi
304 AC_ARG_ENABLE(cpuinfo, 244 AC_ARG_ENABLE(cpuinfo,
305 [ --enable-cpuinfo Enable the cpuinfo subsystem [default=yes]], 245 AC_HELP_STRING([--enable-cpuinfo], [Enable the cpuinfo subsystem [default=yes]]),
306 , enable_cpuinfo=yes) 246 , enable_cpuinfo=yes)
307 if test x$enable_cpuinfo = xyes; then 247 if test x$enable_cpuinfo != xyes; then
308 SDL_EXTRADIRS="$SDL_EXTRADIRS cpuinfo" 248 AC_DEFINE(SDL_CPUINFO_DISABLED)
309 SDL_EXTRALIBS="$SDL_EXTRALIBS cpuinfo/libcpuinfo.la" 249 fi
310 else 250 AC_ARG_ENABLE(assembly-blit,
311 CFLAGS="$CFLAGS -DDISABLE_CPUINFO" 251 AC_HELP_STRING([--enable-asm-blit], [Enable assembly blitters [default=yes]]),
252 , enable_asm_blit=yes)
253 if test x$enable_asm_blit = xyes; then
254 AC_DEFINE(SDL_ASSEMBLY_BLITTERS)
312 fi 255 fi
313 256
314 dnl See if the OSS audio interface is supported 257 dnl See if the OSS audio interface is supported
315 CheckOSS() 258 CheckOSS()
316 { 259 {
317 AC_ARG_ENABLE(oss, 260 AC_ARG_ENABLE(oss,
318 [ --enable-oss support the OSS audio API [default=yes]], 261 AC_HELP_STRING([--enable-oss], [support the OSS audio API [default=yes]]),
319 , enable_oss=yes) 262 , enable_oss=yes)
320 if test x$enable_audio = xyes -a x$enable_oss = xyes; then 263 if test x$enable_audio = xyes -a x$enable_oss = xyes; then
321 AC_MSG_CHECKING(for OSS audio support) 264 AC_MSG_CHECKING(for OSS audio support)
322 have_oss=no 265 have_oss=no
323 if test x$have_oss != xyes; then 266 if test x$have_oss != xyes; then
334 #include <soundcard.h> 277 #include <soundcard.h>
335 ],[ 278 ],[
336 int arg = SNDCTL_DSP_SETFRAGMENT; 279 int arg = SNDCTL_DSP_SETFRAGMENT;
337 ],[ 280 ],[
338 have_oss=yes 281 have_oss=yes
339 CFLAGS="$CFLAGS -DOSS_USE_SOUNDCARD_H" 282 AC_DEFINE(SDL_AUDIO_DRIVER_OSS_SOUNDCARD_H)
340 ]) 283 ])
341 fi 284 fi
342 AC_MSG_RESULT($have_oss) 285 AC_MSG_RESULT($have_oss)
343 if test x$have_oss = xyes; then 286 if test x$have_oss = xyes; then
344 CFLAGS="$CFLAGS -DOSS_SUPPORT" 287 AC_DEFINE(SDL_AUDIO_DRIVER_OSS)
345 AUDIO_SUBDIRS="$AUDIO_SUBDIRS dsp" 288 SOURCES="$SOURCES $srcdir/src/audio/dsp/*.c"
346 AUDIO_DRIVERS="$AUDIO_DRIVERS dsp/libaudio_dsp.la" 289 SOURCES="$SOURCES $srcdir/src/audio/dma/*.c"
347 AUDIO_SUBDIRS="$AUDIO_SUBDIRS dma" 290 have_audio=yes
348 AUDIO_DRIVERS="$AUDIO_DRIVERS dma/libaudio_dma.la" 291
292 # OpenBSD needs linking with ossaudio emulation library
293 case "$target" in
294 *-*-openbsd*)
295 BUILD_LIBS="$BUILD_LIBS -lossaudio";;
296 esac
349 fi 297 fi
350 fi 298 fi
351 } 299 }
352 300
353 dnl See if the ALSA audio interface is supported 301 dnl See if the ALSA audio interface is supported
354 CheckALSA() 302 CheckALSA()
355 { 303 {
356 AC_ARG_ENABLE(alsa, 304 AC_ARG_ENABLE(alsa,
357 [ --enable-alsa support the ALSA audio API [default=yes]], 305 AC_HELP_STRING([--enable-alsa], [support the ALSA audio API [default=yes]]),
358 , enable_alsa=yes) 306 , enable_alsa=yes)
359 if test x$enable_audio = xyes -a x$enable_alsa = xyes; then 307 if test x$enable_audio = xyes -a x$enable_alsa = xyes; then
360 AM_PATH_ALSA(0.9.0, have_alsa=yes, have_alsa=no) 308 AM_PATH_ALSA(0.9.0, have_alsa=yes, have_alsa=no)
361 # Restore all flags from before the ALSA detection runs 309 # Restore all flags from before the ALSA detection runs
362 CFLAGS="$alsa_save_CFLAGS" 310 CFLAGS="$alsa_save_CFLAGS"
363 LDFLAGS="$alsa_save_LDFLAGS" 311 LDFLAGS="$alsa_save_LDFLAGS"
364 LIBS="$alsa_save_LIBS" 312 LIBS="$alsa_save_LIBS"
313 if test x$have_alsa = xyes; then
314 AC_ARG_ENABLE(alsa-shared,
315 AC_HELP_STRING([--enable-alsa-shared], [dynamically load ALSA audio support [default=yes]]),
316 , enable_alsa_shared=yes)
317 if test "x`echo $ALSA_LIBS | grep -- -L`" = "x"; then
318 if test "x`ls /lib/libasound.so.* 2> /dev/null`" != "x"; then
319 ALSA_LIBS="-L/lib $ALSA_LIBS"
320 elif test "x`ls /usr/lib/libasound.so.* 2> /dev/null`" != "x"; then
321 ALSA_LIBS="-L/usr/lib $ALSA_LIBS"
322 elif test "x`ls /usr/local/lib/libasound.so.* 2> /dev/null`" != "x"; then
323 ALSA_LIBS="-L/usr/local/lib $ALSA_LIBS"
324 fi
325 fi
326 alsa_lib_spec=`echo $ALSA_LIBS | sed 's/.*-L\([[^ ]]*\).*/\1\/libasound.so.*/'`
327 alsa_lib=`ls $alsa_lib_spec | sed 's/.*\/\(.*\)/\1/; q'`
328 echo "-- $alsa_lib_spec -> $alsa_lib"
329
330 AC_DEFINE(SDL_AUDIO_DRIVER_ALSA)
331 SOURCES="$SOURCES $srcdir/src/audio/alsa/*.c"
332 BUILD_CFLAGS="$BUILD_CFLAGS $ALSA_CFLAGS"
333 if test x$have_loadso != xyes && \
334 test x$enable_alsa_shared = xyes; then
335 AC_MSG_ERROR([You must have SDL_LoadObject() support])
336 fi
337 if test x$have_loadso = xyes && \
338 test x$enable_alsa_shared = xyes && test x$alsa_lib != x; then
339 AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_ALSA_DYNAMIC, "$alsa_lib")
340 else
341 BUILD_LIBS="$BUILD_LIBS $ALSA_LIBS"
342 fi
343 have_audio=yes
344 fi
345 fi
365 if test x$have_alsa = xyes; then 346 if test x$have_alsa = xyes; then
366 AC_ARG_ENABLE(alsa-shared, 347 AC_ARG_ENABLE(alsa-shared,
367 [ --enable-alsa-shared dynamically load ALSA audio support [default=yes]], 348 [ --enable-alsa-shared dynamically load ALSA audio support [default=yes]],
368 , enable_alsa_shared=yes) 349 , enable_alsa_shared=yes)
369 if test "x`echo $ALSA_LIBS | grep -- -L`" = "x"; then 350 if test "x`echo $ALSA_LIBS | grep -- -L`" = "x"; then
395 fi 376 fi
396 else 377 else
397 CFLAGS="$CFLAGS -DALSA_SUPPORT $ALSA_CFLAGS" 378 CFLAGS="$CFLAGS -DALSA_SUPPORT $ALSA_CFLAGS"
398 SYSTEM_LIBS="$SYSTEM_LIBS $ALSA_LIBS" 379 SYSTEM_LIBS="$SYSTEM_LIBS $ALSA_LIBS"
399 fi 380 fi
400 AUDIO_SUBDIRS="$AUDIO_SUBDIRS alsa" 381 SDL_SRCS="$SDL_SRCS `(cd $srcdir && ls audio/alsa/*.c)`"
401 AUDIO_DRIVERS="$AUDIO_DRIVERS alsa/libaudio_alsa.la" 382 fi
402 fi
403 fi
404 } 383 }
405 384
406 dnl Check whether we want to use IRIX 6.5+ native audio or not 385 dnl Check whether we want to use IRIX 6.5+ native audio or not
407 CheckDMEDIA() 386 CheckDMEDIA()
408 { 387 {
417 have_dmedia=yes 396 have_dmedia=yes
418 ]) 397 ])
419 AC_MSG_RESULT($have_dmedia) 398 AC_MSG_RESULT($have_dmedia)
420 # Set up files for the audio library 399 # Set up files for the audio library
421 if test x$have_dmedia = xyes; then 400 if test x$have_dmedia = xyes; then
422 CFLAGS="$CFLAGS -DDMEDIA_SUPPORT" 401 AC_DEFINE(SDL_AUDIO_DRIVER_DMEDIA)
423 AUDIO_SUBDIRS="$AUDIO_SUBDIRS dmedia" 402 SOURCES="$SOURCES $srcdir/src/audio/dmedia/*.c"
424 AUDIO_DRIVERS="$AUDIO_DRIVERS dmedia/libaudio_dmedia.la" 403 BUILD_LIBS="$BUILD_LIBS -laudio"
425 SYSTEM_LIBS="$SYSTEM_LIBS -laudio" 404 have_audio=yes
426 fi 405 fi
427 fi 406 fi
428 } 407 }
429 408
430 dnl Find the ESD includes and libraries 409 dnl Find the ESD includes and libraries
431 CheckESD() 410 CheckESD()
432 { 411 {
433 AC_ARG_ENABLE(esd, 412 AC_ARG_ENABLE(esd,
434 [ --enable-esd support the Enlightened Sound Daemon [default=yes]], 413 AC_HELP_STRING([--enable-esd], [support the Enlightened Sound Daemon [default=yes]]),
435 , enable_esd=yes) 414 , enable_esd=yes)
436 if test x$enable_audio = xyes -a x$enable_esd = xyes; then 415 if test x$enable_audio = xyes -a x$enable_esd = xyes; then
437 AM_PATH_ESD(0.2.8, have_esd=yes, have_esd=no) 416 AM_PATH_ESD(0.2.8, have_esd=yes, have_esd=no)
438 if test x$have_esd = xyes; then 417 if test x$have_esd = xyes; then
439 AC_ARG_ENABLE(esd-shared, 418 AC_ARG_ENABLE(esd-shared,
440 [ --enable-esd-shared dynamically load ESD audio support [default=yes]], 419 AC_HELP_STRING([--enable-esd-shared], [dynamically load ESD audio support [default=yes]]),
441 , enable_esd_shared=yes) 420 , enable_esd_shared=yes)
442 esd_lib_spec=`echo $ESD_LIBS | sed 's/.*-L\([[^ ]]*\).*/\1\/libesd.so.*/'` 421 esd_lib_spec=`echo $ESD_LIBS | sed 's/.*-L\([[^ ]]*\).*/\1\/libesd.so.*/'`
443 esd_lib=`ls $esd_lib_spec | sed 's/.*\/\(.*\)/\1/; q'` 422 esd_lib=`ls $esd_lib_spec | sed 's/.*\/\(.*\)/\1/; q'`
444 echo "-- $esd_lib_spec -> $esd_lib" 423 echo "-- $esd_lib_spec -> $esd_lib"
445 if test x$have_loadso != xyes && \ 424 if test x$have_loadso != xyes && \
446 test x$enable_esd_shared = xyes; then 425 test x$enable_esd_shared = xyes; then
447 AC_MSG_ERROR([You must have SDL_LoadObject() support]) 426 AC_MSG_ERROR([You must have SDL_LoadObject() support])
448 fi 427 fi
449 if test x$have_loadso = xyes && \ 428 if test x$have_loadso = xyes && \
450 test x$enable_esd_shared = xyes && test x$esd_lib != x; then 429 test x$enable_esd_shared = xyes && test x$esd_lib != x; then
451 CFLAGS="$CFLAGS -DESD_SUPPORT -DESD_DYNAMIC=\$(esd_lib) $ESD_CFLAGS" 430 AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_ESD_DYNAMIC, "$esd_lib")
452 AC_SUBST(esd_lib) 431 fi
453 else 432 AC_DEFINE(SDL_AUDIO_DRIVER_ESD)
454 CFLAGS="$CFLAGS -DESD_SUPPORT $ESD_CFLAGS" 433 SOURCES="$SOURCES $srcdir/src/audio/esd/*.c"
455 SYSTEM_LIBS="$SYSTEM_LIBS $ESD_LIBS" 434 BUILD_CFLAGS="$BUILD_CFLAGS $ESD_CFLAGS"
456 fi 435 BUILD_LIBS="$BUILD_LIBS $ESD_LIBS"
457 AUDIO_SUBDIRS="$AUDIO_SUBDIRS esd" 436 have_audio=yes
458 AUDIO_DRIVERS="$AUDIO_DRIVERS esd/libaudio_esd.la"
459 fi 437 fi
460 fi 438 fi
461 } 439 }
462 440
463 CheckARTSC() 441 CheckARTSC()
464 { 442 {
465 AC_ARG_ENABLE(arts, 443 AC_ARG_ENABLE(arts,
466 [ --enable-arts support the Analog Real Time Synthesizer [default=yes]], 444 AC_HELP_STRING([--enable-arts], [support the Analog Real Time Synthesizer [default=yes]]),
467 , enable_arts=yes) 445 , enable_arts=yes)
468 if test x$enable_audio = xyes -a x$enable_arts = xyes; then 446 if test x$enable_audio = xyes -a x$enable_arts = xyes; then
469 AC_PATH_PROG(ARTSCCONFIG, artsc-config) 447 AC_PATH_PROG(ARTSCONFIG, artsc-config)
470 if test x$ARTSCCONFIG = x -o x$ARTSCCONFIG = x'"$ARTSCCONFIG"'; then 448 if test x$ARTSCONFIG = x -o x$ARTSCONFIG = x'"$ARTSCONFIG"'; then
471 : # arts isn't installed 449 : # arts isn't installed
472 else 450 else
473 ARTSC_CFLAGS=`$ARTSCCONFIG --cflags` 451 ARTS_CFLAGS=`$ARTSCONFIG --cflags`
474 ARTSC_LIBS=`$ARTSCCONFIG --libs` 452 ARTS_LIBS=`$ARTSCONFIG --libs`
475 ARTSC_PREFIX=`$ARTSCCONFIG --arts-prefix` 453 ARTS_PREFIX=`$ARTSCONFIG --arts-prefix`
476 AC_MSG_CHECKING(for aRts development environment) 454 AC_MSG_CHECKING(for aRts development environment)
477 audio_arts=no 455 audio_arts=no
478 save_CFLAGS="$CFLAGS" 456 save_CFLAGS="$CFLAGS"
479 CFLAGS="$CFLAGS $ARTSC_CFLAGS" 457 CFLAGS="$CFLAGS $ARTS_CFLAGS"
480 AC_TRY_COMPILE([ 458 AC_TRY_COMPILE([
481 #include <artsc.h> 459 #include <artsc.h>
482 ],[ 460 ],[
483 arts_stream_t stream; 461 arts_stream_t stream;
484 ],[ 462 ],[
486 ]) 464 ])
487 CFLAGS="$save_CFLAGS" 465 CFLAGS="$save_CFLAGS"
488 AC_MSG_RESULT($audio_arts) 466 AC_MSG_RESULT($audio_arts)
489 if test x$audio_arts = xyes; then 467 if test x$audio_arts = xyes; then
490 AC_ARG_ENABLE(arts-shared, 468 AC_ARG_ENABLE(arts-shared,
491 [ --enable-arts-shared dynamically load aRts audio support [default=yes]], 469 AC_HELP_STRING([--enable-arts-shared], [dynamically load aRts audio support [default=yes]]),
492 , enable_arts_shared=yes) 470 , enable_arts_shared=yes)
493 arts_lib_spec="$ARTSC_PREFIX/lib/libartsc.so.*" 471 arts_lib_spec="$ARTS_PREFIX/lib/libartsc.so.*"
494 arts_lib=`ls $arts_lib_spec | sed 's/.*\/\(.*\)/\1/; q'` 472 arts_lib=`ls $arts_lib_spec | sed 's/.*\/\(.*\)/\1/; q'`
495 echo "-- $arts_lib_spec -> $arts_lib" 473 echo "-- $arts_lib_spec -> $arts_lib"
496 if test x$have_loadso != xyes && \ 474 if test x$have_loadso != xyes && \
497 test x$enable_arts_shared = xyes; then 475 test x$enable_arts_shared = xyes; then
498 AC_MSG_ERROR([You must have SDL_LoadObject() support]) 476 AC_MSG_ERROR([You must have SDL_LoadObject() support])
499 fi 477 fi
500 if test x$have_loadso = xyes && \ 478 if test x$have_loadso = xyes && \
501 test x$enable_arts_shared = xyes && test x$arts_lib != x; then 479 test x$enable_arts_shared = xyes && test x$arts_lib != x; then
502 CFLAGS="$CFLAGS -DARTSC_SUPPORT -DARTSC_DYNAMIC=\$(arts_lib) $ARTSC_CFLAGS" 480 AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_ARTS_DYNAMIC, "$arts_lib")
503 AC_SUBST(arts_lib)
504 else
505 CFLAGS="$CFLAGS -DARTSC_SUPPORT $ARTSC_CFLAGS"
506 SYSTEM_LIBS="$SYSTEM_LIBS $ARTSC_LIBS"
507 fi 481 fi
508 AUDIO_SUBDIRS="$AUDIO_SUBDIRS arts" 482 AC_DEFINE(SDL_AUDIO_DRIVER_ARTS)
509 AUDIO_DRIVERS="$AUDIO_DRIVERS arts/libaudio_arts.la" 483 SOURCES="$SOURCES $srcdir/src/audio/arts/*.c"
484 BUILD_CFLAGS="$BUILD_CFLAGS $ARTS_CFLAGS"
485 BUILD_LIBS="$BUILD_LIBS $ARTS_LIBS"
486 have_audio=yes
510 fi 487 fi
511 fi 488 fi
512 fi 489 fi
513 } 490 }
514 491
515 dnl See if the NAS audio interface is supported 492 dnl See if the NAS audio interface is supported
516 CheckNAS() 493 CheckNAS()
517 { 494 {
518 AC_ARG_ENABLE(nas, 495 AC_ARG_ENABLE(nas,
519 [ --enable-nas support the NAS audio API [default=yes]], 496 AC_HELP_STRING([--enable-nas], [support the NAS audio API [default=yes]]),
520 , enable_nas=yes) 497 , enable_nas=yes)
521 if test x$enable_audio = xyes -a x$enable_nas = xyes; then 498 if test x$enable_audio = xyes -a x$enable_nas = xyes; then
522 AC_MSG_CHECKING(for NAS audio support) 499 AC_MSG_CHECKING(for NAS audio support)
523 have_nas=no 500 have_nas=no
524 if test -r /usr/X11R6/include/audio/audiolib.h; then 501 if test -r /usr/X11R6/include/audio/audiolib.h; then
525 have_nas=yes 502 have_nas=yes
526 CFLAGS="$CFLAGS -DNAS_SUPPORT -I/usr/X11R6/include/" 503 NAS_CFLAGS="-I/usr/X11R6/include/"
527 SYSTEM_LIBS="$SYSTEM_LIBS -laudio -lXt" 504 NAS_LIBS="-laudio -lXt"
528 AUDIO_SUBDIRS="$AUDIO_SUBDIRS nas"
529 AUDIO_DRIVERS="$AUDIO_DRIVERS nas/libaudio_nas.la"
530 505
531 dnl On IRIX, the NAS includes are in a different directory, 506 dnl On IRIX, the NAS includes are in a different directory,
532 dnl and libnas must be explicitly linked in 507 dnl and libnas must be explicitly linked in
533 508
534 elif test -r /usr/freeware/include/nas/audiolib.h; then 509 elif test -r /usr/freeware/include/nas/audiolib.h; then
535 have_nas=yes 510 have_nas=yes
536 CFLAGS="$CFLAGS -DNAS_SUPPORT" 511 NAS_LIBS="-lnas -lXt"
537 SYSTEM_LIBS="$SYSTEM_LIBS -lnas -lXt"
538 AUDIO_SUBDIRS="$AUDIO_SUBDIRS nas"
539 AUDIO_DRIVERS="$AUDIO_DRIVERS nas/libaudio_nas.la"
540 fi 512 fi
541 AC_MSG_RESULT($have_nas) 513 AC_MSG_RESULT($have_nas)
514 if test x$have_nas = xyes; then
515 AC_DEFINE(SDL_AUDIO_DRIVER_NAS)
516 SOURCES="$SOURCES $srcdir/src/audio/nas/*.c"
517 BUILD_CFLAGS="$BUILD_CFLAGS $NAS_CFLAGS"
518 BUILD_LIBS="$BUILD_LIBS $NAS_LIBS"
519 have_audio=yes
520 fi
542 fi 521 fi
543 } 522 }
544 523
545 dnl rcg07142001 See if the user wants the disk writer audio driver... 524 dnl rcg07142001 See if the user wants the disk writer audio driver...
546 CheckDiskAudio() 525 CheckDiskAudio()
547 { 526 {
548 AC_ARG_ENABLE(diskaudio, 527 AC_ARG_ENABLE(diskaudio,
549 [ --enable-diskaudio support the disk writer audio driver [default=yes]], 528 AC_HELP_STRING([--enable-diskaudio], [support the disk writer audio driver [default=yes]]),
550 , enable_diskaudio=yes) 529 , enable_diskaudio=yes)
551 if test x$enable_audio = xyes -a x$enable_diskaudio = xyes; then 530 if test x$enable_audio = xyes -a x$enable_diskaudio = xyes; then
552 CFLAGS="$CFLAGS -DDISKAUD_SUPPORT" 531 AC_DEFINE(SDL_AUDIO_DRIVER_DISK)
553 AUDIO_SUBDIRS="$AUDIO_SUBDIRS disk" 532 SOURCES="$SOURCES $srcdir/src/audio/disk/*.c"
554 AUDIO_DRIVERS="$AUDIO_DRIVERS disk/libaudio_disk.la"
555 fi 533 fi
556 } 534 }
557 535
558 dnl Set up the Atari Audio driver 536 dnl Set up the Atari Audio driver
559 CheckAtariAudio() 537 CheckAtariAudio()
560 { 538 {
561 AC_ARG_ENABLE(mintaudio, 539 AC_ARG_ENABLE(mintaudio,
562 [ --enable-mintaudio support Atari audio driver [default=yes]], 540 AC_HELP_STRING([--enable-mintaudio], [support Atari audio driver [default=yes]]),
563 , enable_mintaudio=yes) 541 , enable_mintaudio=yes)
564 if test x$enable_audio = xyes -a x$enable_mintaudio = xyes; then 542 if test x$enable_audio = xyes -a x$enable_mintaudio = xyes; then
565 mintaudio=no 543 mintaudio=no
566 AC_CHECK_HEADER(mint/falcon.h, have_mint_falcon_hdr=yes) 544 AC_CHECK_HEADER(mint/falcon.h, have_mint_falcon_hdr=yes)
567 if test x$have_mint_falcon_hdr = xyes; then 545 if test x$have_mint_falcon_hdr = xyes; then
568 mintaudio=yes 546 mintaudio=yes
569 CFLAGS="$CFLAGS -DMINTAUDIO_SUPPORT" 547 AC_DEFINE(SDL_AUDIO_DRIVER_MINT)
570 AUDIO_SUBDIRS="$AUDIO_SUBDIRS mint" 548 SOURCES="$SOURCES $srcdir/src/audio/ming/*.c"
571 AUDIO_DRIVERS="$AUDIO_DRIVERS mint/libaudio_mintaudio.la" 549 have_audio=yes
572 fi 550 fi
573 fi 551 fi
574 } 552 }
575 553
576 dnl See if we can use x86 assembly blitters 554 dnl See if we can use x86 assembly blitters
577 # NASM is available from: http://nasm.octium.net/ 555 # NASM is available from: http://nasm.sourceforge.net
578 CheckNASM() 556 CheckNASM()
579 { 557 {
580 dnl Make sure we are running on an x86 platform 558 dnl Make sure we are running on an x86 platform
581 case $target in 559 case $target in
582 i?86*) 560 i?86*)
586 return 564 return
587 ;; 565 ;;
588 esac 566 esac
589 dnl Check for NASM (for assembly blit routines) 567 dnl Check for NASM (for assembly blit routines)
590 AC_ARG_ENABLE(nasm, 568 AC_ARG_ENABLE(nasm,
591 [ --enable-nasm use nasm assembly blitters on x86 [default=yes]], 569 AC_HELP_STRING([--enable-nasm], [use nasm assembly blitters on x86 [default=yes]]),
592 , enable_nasm=yes) 570 , enable_nasm=yes)
593 if test x$enable_video = xyes -a x$enable_nasm = xyes; then 571 if test x$enable_video = xyes -a x$enable_asm_blit = xyes -a x$enable_nasm = xyes; then
594 AC_PATH_PROG(NASM, nasm) 572 AC_PATH_PROG(NASM, nasm)
595 if test x$NASM = x -o x$NASM = x'"$NASM"'; then 573 if test x$NASM != x -a x$NASM != x'"$NASM"'; then
596 : # nasm isn't installed 574 AC_DEFINE(SDL_HERMES_BLITTERS)
597 else 575 SOURCES="$SOURCES $srcdir/src/hermes/*.asm"
598 CFLAGS="$CFLAGS -DUSE_ASMBLIT -I$srcdir/hermes"
599 case $ARCH in 576 case $ARCH in
600 win32) 577 win32)
601 NASMFLAGS="-f win32" 578 NASMFLAGS="-f win32"
602 ;; 579 ;;
603 openbsd) 580 openbsd)
605 ;; 582 ;;
606 *) 583 *)
607 NASMFLAGS="-f elf" 584 NASMFLAGS="-f elf"
608 ;; 585 ;;
609 esac 586 esac
587 AC_SUBST(NASM)
610 AC_SUBST(NASMFLAGS) 588 AC_SUBST(NASMFLAGS)
611 CFLAGS="$CFLAGS -I\$(top_srcdir)/src/hermes" 589
612 SDL_EXTRADIRS="$SDL_EXTRADIRS hermes"
613 SDL_EXTRALIBS="$SDL_EXTRALIBS hermes/libhermes.la"
614 use_nasm=yes
615
616 case "$target" in 590 case "$target" in
617 # this line is needed for QNX, because it's not defined the __ELF__ 591 # this line is needed for QNX, because it's not defined the __ELF__
618 *-*-qnx*) CFLAGS="$CFLAGS -D__ELF__" 592 *-*-qnx*)
619 ;; 593 BUILD_CFLAGS="$BUILD_CFLAGS -D__ELF__";;
620 594 *-*-solaris*)
595 BUILD_CFLAGS="$BUILD_CFLAGS -D__ELF__";;
621 esac 596 esac
622 597 fi
598 fi
599 }
600
601 dnl Check for altivec instruction support using gas syntax
602 CheckAltivec()
603 {
604 AC_ARG_ENABLE(altivec,
605 AC_HELP_STRING([--enable-altivec], [use altivec assembly blitters on PPC [default=yes]]),
606 , enable_altivec=yes)
607 if test x$enable_video = xyes -a x$enable_asm_blit = xyes -a x$enable_altivec = xyes; then
608 have_altivec_h_hdr=no
609 AC_CHECK_HEADER(altivec.h, have_altivec_h_hdr=yes)
610
611 save_CFLAGS="$CFLAGS"
612 have_gcc_altivec=no
613 AC_MSG_CHECKING(for Altivec with GCC -maltivec option)
614 altivec_CFLAGS="-maltivec"
615 CFLAGS="$save_CFLAGS $altivec_CFLAGS"
616
617 if test x$have_altivec_h_hdr = xyes; then
618 AC_TRY_COMPILE([
619 #include <altivec.h>
620 vector unsigned int vzero() {
621 return vec_splat_u32(0);
622 }
623 ],[
624 ],[
625 have_gcc_altivec=yes
626 ])
627 AC_MSG_RESULT($have_gcc_altivec)
628 else
629 AC_TRY_COMPILE([
630 vector unsigned int vzero() {
631 return vec_splat_u32(0);
632 }
633 ],[
634 ],[
635 have_gcc_altivec=yes
636 ])
637 AC_MSG_RESULT($have_gcc_altivec)
638 fi
639
640 if test x$have_gcc_altivec = xno; then
641 AC_MSG_CHECKING(for Altivec with GCC -faltivec option)
642 altivec_CFLAGS="-faltivec"
643 CFLAGS="$save_CFLAGS $altivec_CFLAGS"
644 if test x$have_altivec_h_hdr = xyes; then
645 AC_TRY_COMPILE([
646 #include <altivec.h>
647 vector unsigned int vzero() {
648 return vec_splat_u32(0);
649 }
650 ],[
651 ],[
652 have_gcc_altivec=yes
653 ])
654 AC_MSG_RESULT($have_gcc_altivec)
655 else
656 AC_TRY_COMPILE([
657 vector unsigned int vzero() {
658 return vec_splat_u32(0);
659 }
660 ],[
661 ],[
662 have_gcc_altivec=yes
663 ])
664 AC_MSG_RESULT($have_gcc_altivec)
665 fi
666 fi
667 CFLAGS="$save_CFLAGS"
668
669 if test x$have_gcc_altivec = xyes; then
670 AC_DEFINE(SDL_ALTIVEC_BLITTERS)
671 if test x$have_altivec_h_hdr = xyes; then
672 AC_DEFINE(HAVE_ALTIVEC_H)
673 fi
674 BUILD_CFLAGS="$BUILD_CFLAGS $altivec_CFLAGS"
623 fi 675 fi
624 fi 676 fi
625 } 677 }
626 678
627 dnl Do the iPod thing 679 dnl Do the iPod thing
628 CheckIPod() 680 CheckIPod()
629 { 681 {
630 AC_ARG_ENABLE(ipod, 682 AC_ARG_ENABLE(ipod,
631 [ --enable-ipod configure SDL to work with iPodLinux [default=yes on arm-elf]], 683 AC_HELP_STRING([--enable-ipod], [configure SDL to work with iPodLinux [default=yes on arm-elf]]),
632 , enable_ipod=yes) 684 , enable_ipod=yes)
633 685
634 if test x$enable_ipod = xyes; then 686 if test x$enable_ipod = xyes; then
635 CFLAGS="$CFLAGS -DENABLE_IPOD -DIPOD" 687 BUILD_CFLAGS="$BUILD_CFLAGS -DIPOD"
636 VIDEO_SUBDIRS="$VIDEO_SUBDIRS ipod" 688 AC_DEFINE(SDL_VIDEO_DRIVER_IPOD)
637 VIDEO_DRIVERS="$VIDEO_DRIVERS ipod/libvideo_ipod.la" 689 SOURCES="$SOURCES $srcdir/src/video/ipod/*.c"
638 fi 690 fi
639 } 691 }
640 692
641 dnl Find the nanox include and library directories 693 dnl Find the nanox include and library directories
642 CheckNANOX() 694 CheckNANOX()
643 { 695 {
644 AC_ARG_ENABLE(video-nanox, 696 AC_ARG_ENABLE(video-nanox,
645 [ --enable-video-nanox use nanox video driver [default=no]], 697 AC_HELP_STRING([--enable-video-nanox], [use nanox video driver [default=no]]),
646 , enable_video_nanox=no) 698 , enable_video_nanox=no)
647 AC_ARG_ENABLE(nanox-debug,
648 [ --enable-nanox-debug print debug messages [default=no]],
649 , enable_nanox_debug=no)
650 AC_ARG_ENABLE(nanox-share-memory,
651 [ --enable-nanox-share-memory use share memory [default=no]],
652 , enable_nanox_share_memory=no)
653 AC_ARG_ENABLE(nanox_direct_fb,
654 [ --enable-nanox-direct-fb use direct framebuffer access [default=no]],
655 , enable_nanox_direct_fb=no)
656 699
657 if test x$enable_video = xyes -a x$enable_video_nanox = xyes; then 700 if test x$enable_video = xyes -a x$enable_video_nanox = xyes; then
701 AC_ARG_ENABLE(nanox-debug,
702 AC_HELP_STRING([--enable-nanox-debug], [print debug messages [default=no]]),
703 , enable_nanox_debug=no)
658 if test x$enable_nanox_debug = xyes; then 704 if test x$enable_nanox_debug = xyes; then
659 CFLAGS="$CFLAGS -DENABLE_NANOX_DEBUG" 705 BUILD_CFLAGS="$BUILD_CFLAGS -DENABLE_NANOX_DEBUG"
660 fi 706 fi
661 707
708 AC_ARG_ENABLE(nanox-share-memory,
709 AC_HELP_STRING([--enable-nanox-share-memory], [use share memory [default=no]]),
710 , enable_nanox_share_memory=no)
662 if test x$enable_nanox_share_memory = xyes; then 711 if test x$enable_nanox_share_memory = xyes; then
663 CFLAGS="$CFLAGS -DNANOX_SHARE_MEMORY" 712 BUILD_CFLAGS="$BUILD_CFLAGS -DNANOX_SHARE_MEMORY"
664 fi 713 fi
665 714
715 AC_ARG_ENABLE(nanox_direct_fb,
716 AC_HELP_STRING([--enable-nanox-direct-fb], [use direct framebuffer access [default=no]]),
717 , enable_nanox_direct_fb=no)
666 if test x$enable_nanox_direct_fb = xyes; then 718 if test x$enable_nanox_direct_fb = xyes; then
667 CFLAGS="$CFLAGS -DENABLE_NANOX_DIRECT_FB" 719 BUILD_CFLAGS="$BUILD_CFLAGS -DENABLE_NANOX_DIRECT_FB"
668 fi 720 fi
669 721
670 CFLAGS="$CFLAGS $X_CFLAGS -DENABLE_NANOX" 722 AC_DEFINE(SDL_VIDEO_DRIVER_NANOX)
671 SYSTEM_LIBS="$SYSTEM_LIBS -lnano-X" 723 SOURCES="$SOURCES $srcdir/src/video/nanox/*.c"
672 VIDEO_SUBDIRS="$VIDEO_SUBDIRS nanox" 724 BUILD_LIBS="$BUILD_LIBS -lnano-X"
673 VIDEO_DRIVERS="$VIDEO_DRIVERS nanox/libvideo_nanox.la" 725 have_video=yes
674 fi 726 fi
675 } 727 }
676 728
677 dnl Find the X11 include and library directories 729 dnl Find the X11 include and library directories
678 CheckX11() 730 CheckX11()
679 { 731 {
680 AC_ARG_ENABLE(video-x11, 732 AC_ARG_ENABLE(video-x11,
681 [ --enable-video-x11 use X11 video driver [default=yes]], 733 AC_HELP_STRING([--enable-video-x11], [use X11 video driver [default=yes]]),
682 , enable_video_x11=yes) 734 , enable_video_x11=yes)
683 if test x$enable_video = xyes -a x$enable_video_x11 = xyes; then 735 if test x$enable_video = xyes -a x$enable_video_x11 = xyes; then
684 AC_PATH_X 736 AC_PATH_X
685 AC_PATH_XTRA 737 AC_PATH_XTRA
686 if test x$have_x = xyes; then 738 if test x$have_x = xyes; then
687 AC_ARG_ENABLE(x11-shared, 739 AC_ARG_ENABLE(x11-shared,
688 [ --enable-x11-shared dynamically load X11 support [default=yes]], 740 AC_HELP_STRING([--enable-x11-shared], [dynamically load X11 support [default=yes]]),
689 , enable_x11_shared=yes) 741 , enable_x11_shared=yes)
690 742
691 dnl !!! FIXME: if a platform needs more than this, fill it in!
692 case "$target" in 743 case "$target" in
693 *-*-darwin* ) 744 *-*-darwin* )
694 x11_lib='/usr/X11R6/lib/libX11.6.dylib' 745 x11_lib='/usr/X11R6/lib/libX11.6.dylib'
695 x11ext_lib='/usr/X11R6/lib/libXext.6.dylib' 746 x11ext_lib='/usr/X11R6/lib/libXext.6.dylib'
696 ;; 747 ;;
702 x11_lib='libX11.so.6' 753 x11_lib='libX11.so.6'
703 x11ext_lib='libXext.so.6' 754 x11ext_lib='libXext.so.6'
704 ;; 755 ;;
705 esac 756 esac
706 757
758 X_CFLAGS="$X_CFLAGS -DXTHREADS"
759 if test x$ac_cv_func_shmat != xyes; then
760 X_CFLAGS="$X_CFLAGS -DNO_SHARED_MEMORY"
761 fi
707 if test x$have_loadso != xyes && \ 762 if test x$have_loadso != xyes && \
708 test x$enable_x11_shared = xyes; then 763 test x$enable_x11_shared = xyes; then
709 AC_MSG_ERROR([You must have SDL_LoadObject() support]) 764 AC_MSG_ERROR([You must have SDL_LoadObject() support])
710 fi 765 fi
711 766
712 if test x$have_loadso = xyes && \ 767 if test x$have_loadso = xyes && \
713 test x$enable_x11_shared = xyes && test x$x11_lib != x && test x$x11ext_lib != x; then 768 test x$enable_x11_shared = xyes && test x$x11_lib != x && test x$x11ext_lib != x; then
714 CFLAGS="$CFLAGS $X_CFLAGS -DENABLE_X11 -DXTHREADS -DX11_DYNAMIC=\$(x11_lib) -DX11EXT_DYNAMIC=\$(x11ext_lib) -I$srcdir/include -I$srcdir/src/video"
715 SYSTEM_LIBS="$SYSTEM_LIBS $X_LIBS"
716 echo "-- dynamic libX11 -> $x11_lib" 769 echo "-- dynamic libX11 -> $x11_lib"
717 echo "-- dynamic libX11ext -> $x11ext_lib" 770 echo "-- dynamic libX11ext -> $x11ext_lib"
718 AC_SUBST(x11_lib) 771 AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC, "$x11_lib")
719 AC_SUBST(x11ext_lib) 772 AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT, "$x11ext_lib")
720 else 773 else
721 CFLAGS="$CFLAGS $X_CFLAGS -DENABLE_X11 -DXTHREADS -I$srcdir/include -I$srcdir/src/video" 774 X_LIBS="$X_LIBS -lX11 -lXext"
722 SYSTEM_LIBS="$SYSTEM_LIBS $X_LIBS -lX11 -lXext" 775 fi
723 fi 776
724 777
725 if test x$ac_cv_func_shmat != xyes; then 778 AC_DEFINE(SDL_VIDEO_DRIVER_X11)
726 CFLAGS="$CFLAGS -DNO_SHARED_MEMORY" 779 SOURCES="$SOURCES $srcdir/src/video/x11/*.c"
727 fi 780 BUILD_CFLAGS="$BUILD_CFLAGS $X_CFLAGS"
728 781 BUILD_LIBS="$BUILD_LIBS $X_LIBS"
729 VIDEO_SUBDIRS="$VIDEO_SUBDIRS x11" 782 have_video=yes
730 VIDEO_DRIVERS="$VIDEO_DRIVERS x11/libvideo_x11.la"
731 783
732 AC_ARG_ENABLE(dga, 784 AC_ARG_ENABLE(dga,
733 [ --enable-dga allow use of X11 DGA code [default=yes]], 785 AC_HELP_STRING([--enable-dga], [allow use of X11 DGA code [default=yes]]),
734 , enable_dga=yes) 786 , enable_dga=yes)
735 if test x$enable_dga = xyes; then 787 if test x$enable_dga = xyes; then
736 VIDEO_SUBDIRS="$VIDEO_SUBDIRS Xext/Xxf86dga" 788 SOURCES="$SOURCES $srcdir/src/video/Xext/Xxf86dga/*.c"
737 VIDEO_DRIVERS="$VIDEO_DRIVERS Xext/Xxf86dga/libXext_Xxf86dga.la"
738 fi 789 fi
739 AC_ARG_ENABLE(video-dga, 790 AC_ARG_ENABLE(video-dga,
740 [ --enable-video-dga use DGA 2.0 video driver [default=yes]], 791 AC_HELP_STRING([--enable-video-dga], [use DGA 2.0 video driver [default=yes]]),
741 , enable_video_dga=yes) 792 , enable_video_dga=yes)
742 if test x$enable_dga = xyes -a x$enable_video_dga = xyes; then 793 if test x$enable_dga = xyes -a x$enable_video_dga = xyes; then
743 CFLAGS="$CFLAGS -DENABLE_DGA" 794 AC_DEFINE(SDL_VIDEO_DRIVER_DGA)
744 VIDEO_SUBDIRS="$VIDEO_SUBDIRS dga" 795 SOURCES="$SOURCES $srcdir/src/video/dga/*.c"
745 VIDEO_DRIVERS="$VIDEO_DRIVERS dga/libvideo_dga.la"
746 fi 796 fi
747 AC_ARG_ENABLE(video-x11-dgamouse, 797 AC_ARG_ENABLE(video-x11-dgamouse,
748 [ --enable-video-x11-dgamouse use X11 DGA for mouse events [default=yes]], 798 AC_HELP_STRING([--enable-video-x11-dgamouse], [use X11 DGA for mouse events [default=yes]]),
749 , enable_video_x11_dgamouse=yes) 799 , enable_video_x11_dgamouse=yes)
750 if test x$enable_dga = xyes -a x$enable_video_x11_dgamouse = xyes; then 800 if test x$enable_dga = xyes -a x$enable_video_x11_dgamouse = xyes; then
751 CFLAGS="$CFLAGS -DXFREE86_DGAMOUSE -DDEFAULT_DGAMOUSE" 801 AC_DEFINE(SDL_VIDEO_DRIVER_X11_DGAMOUSE)
752 fi 802 fi
753 AC_ARG_ENABLE(video-x11-vm, 803 AC_ARG_ENABLE(video-x11-vm,
754 [ --enable-video-x11-vm use X11 VM extension for fullscreen [default=yes]], 804 AC_HELP_STRING([--enable-video-x11-vm], [use X11 VM extension for fullscreen [default=yes]]),
755 , enable_video_x11_vm=yes) 805 , enable_video_x11_vm=yes)
756 if test x$enable_video_x11_vm = xyes; then 806 if test x$enable_video_x11_vm = xyes; then
757 CFLAGS="$CFLAGS -DXFREE86_VM -DXFREE86_VMGAMMA" 807 AC_DEFINE(SDL_VIDEO_DRIVER_X11_VIDMODE)
758 VIDEO_SUBDIRS="$VIDEO_SUBDIRS Xext/Xxf86vm" 808 SOURCES="$SOURCES $srcdir/src/video/Xext/Xxf86vm/*.c"
759 VIDEO_DRIVERS="$VIDEO_DRIVERS Xext/Xxf86vm/libXext_Xxf86vm.la"
760 fi 809 fi
761 AC_ARG_ENABLE(video-x11-xv, 810 AC_ARG_ENABLE(video-x11-xv,
762 [ --enable-video-x11-xv use X11 XvImage extension for video [default=yes]], 811 AC_HELP_STRING([--enable-video-x11-xv], [use X11 XvImage extension for video [default=yes]]),
763 , enable_video_x11_xv=yes) 812 , enable_video_x11_xv=yes)
764 if test x$enable_video_x11_xv = xyes; then 813 if test x$enable_video_x11_xv = xyes; then
765 CFLAGS="$CFLAGS -DXFREE86_XV" 814 AC_DEFINE(SDL_VIDEO_DRIVER_X11_XV)
766 VIDEO_SUBDIRS="$VIDEO_SUBDIRS Xext/Xv" 815 SOURCES="$SOURCES $srcdir/src/video/Xext/Xv/*.c"
767 VIDEO_DRIVERS="$VIDEO_DRIVERS Xext/Xv/libXext_Xv.la"
768 fi 816 fi
769 AC_ARG_ENABLE(video-x11-xinerama, 817 AC_ARG_ENABLE(video-x11-xinerama,
770 [ --enable-video-x11-xinerama enable X11 Xinerama support [default=yes]], 818 AC_HELP_STRING([--enable-video-x11-xinerama], [enable X11 Xinerama support [default=yes]]),
771 , enable_video_x11_xinerama=yes) 819 , enable_video_x11_xinerama=yes)
772 if test x$enable_video_x11_xinerama = xyes; then 820 if test x$enable_video_x11_xinerama = xyes; then
773 CFLAGS="$CFLAGS -DHAVE_XINERAMA" 821 AC_DEFINE(SDL_VIDEO_DRIVER_X11_XINERAMA)
774 VIDEO_SUBDIRS="$VIDEO_SUBDIRS Xext/Xinerama" 822 SOURCES="$SOURCES $srcdir/src/video/Xext/Xinerama/*.c"
775 VIDEO_DRIVERS="$VIDEO_DRIVERS Xext/Xinerama/libXext_Xinerama.la"
776 fi 823 fi
777 AC_ARG_ENABLE(video-x11-xme, 824 AC_ARG_ENABLE(video-x11-xme,
778 [ --enable-video-x11-xme enable Xi Graphics XME for fullscreen [default=yes]], 825 AC_HELP_STRING([--enable-video-x11-xme], [enable Xi Graphics XME for fullscreen [default=yes]]),
779 , enable_video_x11_xme=yes) 826 , enable_video_x11_xme=yes)
780 if test x$enable_video_x11_xme = xyes; then 827 if test x$enable_video_x11_xme = xyes; then
781 CFLAGS="$CFLAGS -DHAVE_XIGXME" 828 AC_DEFINE(SDL_VIDEO_DRIVER_X11_XME)
782 VIDEO_SUBDIRS="$VIDEO_SUBDIRS Xext/XME" 829 SOURCES="$SOURCES $srcdir/src/video/Xext/XME/*.c"
783 VIDEO_DRIVERS="$VIDEO_DRIVERS Xext/XME/libXME.la" 830 fi
784 fi 831 fi
785 fi 832 fi
786 fi 833 }
787 } 834
788 835 dnl Check for QNX photon video driver
789 CheckPHOTON() 836 CheckPHOTON()
790 { 837 {
791 AC_ARG_ENABLE(video-photon, 838 AC_ARG_ENABLE(video-photon,
792 [ --enable-video-photon use QNX Photon video driver [default=yes]], 839 AC_HELP_STRING([--enable-video-photon], [use QNX Photon video driver [default=yes]]),
793 , enable_video_photon=yes) 840 , enable_video_photon=yes)
794 if test x$enable_video = xyes -a x$enable_video_photon = xyes; then 841 if test x$enable_video = xyes -a x$enable_video_photon = xyes; then
795 AC_MSG_CHECKING(for QNX Photon support) 842 AC_MSG_CHECKING(for QNX Photon support)
796 video_photon=no 843 video_photon=no
797 AC_TRY_COMPILE([ 844 AC_TRY_COMPILE([
804 ],[ 851 ],[
805 video_photon=yes 852 video_photon=yes
806 ]) 853 ])
807 AC_MSG_RESULT($video_photon) 854 AC_MSG_RESULT($video_photon)
808 if test x$video_photon = xyes; then 855 if test x$video_photon = xyes; then
809 CFLAGS="$CFLAGS -DENABLE_PHOTON" 856 AC_DEFINE(SDL_VIDEO_DRIVER_PHOTON)
810 SYSTEM_LIBS="$SYSTEM_LIBS -lph" 857 SOURCES="$SOURCES $srcdir/src/video/photon/*.c"
811 VIDEO_SUBDIRS="$VIDEO_SUBDIRS photon" 858 BUILD_LIBS="$BUILD_LIBS -lph"
812 VIDEO_DRIVERS="$VIDEO_DRIVERS photon/libvideo_photon.la" 859 have_video=yes
860
813 CheckOpenGLQNX 861 CheckOpenGLQNX
862 fi
863 fi
864 }
865
866 dnl Set up the BWindow video driver if enabled
867 CheckBWINDOW()
868 {
869 if test x$enable_video = xyes; then
870 AC_DEFINE(SDL_VIDEO_DRIVER_BWINDOW)
871 SOURCES="$SOURCES $srcdir/src/video/bwindow/*.cc"
872 have_video=yes
873 fi
874 }
875
876 dnl Set up the Carbon/QuickDraw video driver for Mac OS X (but not Darwin)
877 CheckCARBON()
878 {
879 AC_ARG_ENABLE(video-carbon,
880 AC_HELP_STRING([--enable-video-carbon], [use Carbon/QuickDraw video driver [default=no]]),
881 , enable_video_carbon=no)
882 if test x$enable_video = xyes -a x$enable_video_carbon = xyes; then
883 AC_MSG_CHECKING(for Carbon framework)
884 have_carbon=no
885 AC_TRY_COMPILE([
886 #include <Carbon/Carbon.h>
887 ],[
888 ],[
889 have_carbon=yes
890 ])
891 AC_MSG_RESULT($have_carbon)
892 if test x$have_carbon = xyes; then
893 AC_DEFINE(SDL_VIDEO_DRIVER_TOOLBOX)
894 SOURCES="$SOURCES $srcdir/src/video/maccommon/*.c"
895 SOURCES="$SOURCES $srcdir/src/video/macrom/*.c"
896 have_video=yes
897 fi
898 fi
899 }
900
901 dnl Set up the Cocoa/Quartz video driver for Mac OS X (but not Darwin)
902 CheckCOCOA()
903 {
904 AC_ARG_ENABLE(video-cocoa,
905 AC_HELP_STRING([--enable-video-cocoa], [use Cocoa/Quartz video driver [default=yes]]),
906 , enable_video_cocoa=yes)
907 if test x$enable_video = xyes -a x$enable_video_cocoa = xyes; then
908 save_CFLAGS="$CFLAGS"
909 dnl work around that we don't have Objective-C support in autoconf
910 CFLAGS="$CFLAGS -x objective-c"
911 AC_MSG_CHECKING(for Cocoa framework)
912 have_cocoa=no
913 AC_TRY_COMPILE([
914 #import <Cocoa/Cocoa.h>
915 ],[
916 ],[
917 have_cocoa=yes
918 ])
919 AC_MSG_RESULT($have_cocoa)
920 CFLAGS="$save_CFLAGS"
921 if test x$have_cocoa = xyes; then
922 AC_DEFINE(SDL_VIDEO_DRIVER_QUARTZ)
923 SOURCES="$SOURCES $srcdir/src/video/quartz/*.m"
924 have_video=yes
814 fi 925 fi
815 fi 926 fi
816 } 927 }
817 928
818 dnl Find the framebuffer console includes 929 dnl Find the framebuffer console includes
819 CheckFBCON() 930 CheckFBCON()
820 { 931 {
821 AC_ARG_ENABLE(video-fbcon, 932 AC_ARG_ENABLE(video-fbcon,
822 [ --enable-video-fbcon use framebuffer console video driver [default=yes]], 933 AC_HELP_STRING([--enable-video-fbcon], [use framebuffer console video driver [default=yes]]),
823 , enable_video_fbcon=yes) 934 , enable_video_fbcon=yes)
824 if test x$enable_video = xyes -a x$enable_video_fbcon = xyes; then 935 if test x$enable_video = xyes -a x$enable_video_fbcon = xyes; then
825 AC_MSG_CHECKING(for framebuffer console support) 936 AC_MSG_CHECKING(for framebuffer console support)
826 video_fbcon=no 937 video_fbcon=no
827 AC_TRY_COMPILE([ 938 AC_TRY_COMPILE([
832 ],[ 943 ],[
833 video_fbcon=yes 944 video_fbcon=yes
834 ]) 945 ])
835 AC_MSG_RESULT($video_fbcon) 946 AC_MSG_RESULT($video_fbcon)
836 if test x$video_fbcon = xyes; then 947 if test x$video_fbcon = xyes; then
837 CFLAGS="$CFLAGS -DENABLE_FBCON" 948 AC_DEFINE(SDL_VIDEO_DRIVER_FBCON)
838 VIDEO_SUBDIRS="$VIDEO_SUBDIRS fbcon" 949 SOURCES="$SOURCES $srcdir/src/video/fbcon/*.c"
839 VIDEO_DRIVERS="$VIDEO_DRIVERS fbcon/libvideo_fbcon.la" 950 have_video=yes
840 fi 951 fi
841 fi 952 fi
842 } 953 }
843 954
844 dnl Find DirectFB 955 dnl Find DirectFB
845 CheckDirectFB() 956 CheckDirectFB()
846 { 957 {
847 AC_ARG_ENABLE(video-directfb, 958 AC_ARG_ENABLE(video-directfb,
848 [ --enable-video-directfb use DirectFB video driver [default=no]], 959 AC_HELP_STRING([--enable-video-directfb], [use DirectFB video driver [default=no]]),
849 , enable_video_directfb=no) 960 , enable_video_directfb=no)
850 if test x$enable_video = xyes -a x$enable_video_directfb = xyes; then 961 if test x$enable_video = xyes -a x$enable_video_directfb = xyes; then
851 video_directfb=no 962 video_directfb=no
852 963
853 AC_PATH_PROG(PKG_CONFIG, pkg-config, no) 964 AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
869 fi 980 fi
870 fi 981 fi
871 982
872 AC_MSG_RESULT($video_directfb) 983 AC_MSG_RESULT($video_directfb)
873 if test x$video_directfb = xyes; then 984 if test x$video_directfb = xyes; then
874 CFLAGS="$CFLAGS -DENABLE_DIRECTFB" 985 AC_DEFINE(SDL_VIDEO_DRIVER_DIRECTFB)
875 VIDEO_SUBDIRS="$VIDEO_SUBDIRS directfb" 986 SOURCES="$SOURCES $srcdir/src/video/directfb/*.c"
876 VIDEO_DRIVERS="$VIDEO_DRIVERS directfb/libvideo_directfb.la" 987 BUILD_CFLAGS="$BUILD_CFLAGS $DIRECTFB_CFLAGS"
877 988 BUILD_LIBS="$BUILD_LIBS $DIRECTFB_LIBS"
878 AC_SUBST(DIRECTFB_CFLAGS) 989 have_video=yes
879 AC_SUBST(DIRECTFB_LIBS)
880 fi 990 fi
881 fi 991 fi
882 } 992 }
883 993
884 dnl See if we're running on PlayStation 2 hardware 994 dnl See if we're running on PlayStation 2 hardware
885 CheckPS2GS() 995 CheckPS2GS()
886 { 996 {
887 AC_ARG_ENABLE(video-ps2gs, 997 AC_ARG_ENABLE(video-ps2gs,
888 [ --enable-video-ps2gs use PlayStation 2 GS video driver [default=yes]], 998 AC_HELP_STRING([--enable-video-ps2gs], [use PlayStation 2 GS video driver [default=yes]]),
889 , enable_video_ps2gs=yes) 999 , enable_video_ps2gs=yes)
890 if test x$enable_video = xyes -a x$enable_video_ps2gs = xyes; then 1000 if test x$enable_video = xyes -a x$enable_video_ps2gs = xyes; then
891 AC_MSG_CHECKING(for PlayStation 2 GS support) 1001 AC_MSG_CHECKING(for PlayStation 2 GS support)
892 video_ps2gs=no 1002 video_ps2gs=no
893 AC_TRY_COMPILE([ 1003 AC_TRY_COMPILE([
897 ],[ 1007 ],[
898 video_ps2gs=yes 1008 video_ps2gs=yes
899 ]) 1009 ])
900 AC_MSG_RESULT($video_ps2gs) 1010 AC_MSG_RESULT($video_ps2gs)
901 if test x$video_ps2gs = xyes; then 1011 if test x$video_ps2gs = xyes; then
902 CFLAGS="$CFLAGS -DENABLE_PS2GS" 1012 AC_DEFINE(SDL_VIDEO_DRIVER_PS2GS)
903 VIDEO_SUBDIRS="$VIDEO_SUBDIRS ps2gs" 1013 SOURCES="$SOURCES $srcdir/src/video/ps2gs/*.c"
904 VIDEO_DRIVERS="$VIDEO_DRIVERS ps2gs/libvideo_ps2gs.la" 1014 have_video=yes
905 fi 1015 fi
906 fi 1016 fi
907 } 1017 }
908 1018
909 dnl Find the GGI includes 1019 dnl Find the GGI includes
910 CheckGGI() 1020 CheckGGI()
911 { 1021 {
912 AC_ARG_ENABLE(video-ggi, 1022 AC_ARG_ENABLE(video-ggi,
913 [ --enable-video-ggi use GGI video driver [default=no]], 1023 AC_HELP_STRING([--enable-video-ggi], [use GGI video driver [default=no]]),
914 , enable_video_ggi=no) 1024 , enable_video_ggi=no)
915 if test x$enable_video = xyes -a x$enable_video_ggi = xyes; then 1025 if test x$enable_video = xyes -a x$enable_video_ggi = xyes; then
916 AC_MSG_CHECKING(for GGI support) 1026 AC_MSG_CHECKING(for GGI support)
917 video_ggi=no 1027 video_ggi=no
918 AC_TRY_COMPILE([ 1028 AC_TRY_COMPILE([
922 ],[ 1032 ],[
923 video_ggi=yes 1033 video_ggi=yes
924 ]) 1034 ])
925 AC_MSG_RESULT($video_ggi) 1035 AC_MSG_RESULT($video_ggi)
926 if test x$video_ggi = xyes; then 1036 if test x$video_ggi = xyes; then
927 CFLAGS="$CFLAGS $X_CFLAGS -DENABLE_GGI" 1037 AC_DEFINE(SDL_VIDEO_DRIVER_GGI)
928 SYSTEM_LIBS="$SYSTEM_LIBS -lggi -lgii -lgg" 1038 SOURCES="$SOURCES $srcdir/src/video/ggi/*.c"
929 1039 BUILD_LIBS="$BUILD_LIBS -lggi -lgii -lgg"
930 VIDEO_SUBDIRS="$VIDEO_SUBDIRS ggi" 1040 have_video=yes
931 VIDEO_DRIVERS="$VIDEO_DRIVERS ggi/libvideo_ggi.la"
932 fi 1041 fi
933 fi 1042 fi
934 } 1043 }
935 1044
936 dnl Find the SVGAlib includes and libraries 1045 dnl Find the SVGAlib includes and libraries
937 CheckSVGA() 1046 CheckSVGA()
938 { 1047 {
939 AC_ARG_ENABLE(video-svga, 1048 AC_ARG_ENABLE(video-svga,
940 [ --enable-video-svga use SVGAlib video driver [default=no]], 1049 AC_HELP_STRING([--enable-video-svga], [use SVGAlib video driver [default=no]]),
941 , enable_video_svga=no) 1050 , enable_video_svga=no)
942 if test x$enable_video = xyes -a x$enable_video_svga = xyes; then 1051 if test x$enable_video = xyes -a x$enable_video_svga = xyes; then
943 AC_MSG_CHECKING(for SVGAlib (1.4.0+) support) 1052 AC_MSG_CHECKING(for SVGAlib (1.4.0+) support)
944 video_svga=no 1053 video_svga=no
945 AC_TRY_COMPILE([ 1054 AC_TRY_COMPILE([
953 ],[ 1062 ],[
954 video_svga=yes 1063 video_svga=yes
955 ]) 1064 ])
956 AC_MSG_RESULT($video_svga) 1065 AC_MSG_RESULT($video_svga)
957 if test x$video_svga = xyes; then 1066 if test x$video_svga = xyes; then
958 CFLAGS="$CFLAGS -DENABLE_SVGALIB" 1067 AC_DEFINE(SDL_VIDEO_DRIVER_SVGALIB)
959 SYSTEM_LIBS="$SYSTEM_LIBS -lvga" 1068 SOURCES="$SOURCES $srcdir/src/video/svga/*.c"
960 1069 BUILD_LIBS="$BUILD_LIBS -lvga"
961 VIDEO_SUBDIRS="$VIDEO_SUBDIRS svga" 1070 have_video=yes
962 VIDEO_DRIVERS="$VIDEO_DRIVERS svga/libvideo_svga.la"
963 fi 1071 fi
964 fi 1072 fi
965 } 1073 }
966 1074
967 dnl Find the VGL includes and libraries 1075 dnl Find the VGL includes and libraries
968 CheckVGL() 1076 CheckVGL()
969 { 1077 {
970 AC_ARG_ENABLE(video-vgl, 1078 AC_ARG_ENABLE(video-vgl,
971 [ --enable-video-vgl use VGL video driver [default=no]], 1079 AC_HELP_STRING([--enable-video-vgl], [use VGL video driver [default=no]]),
972 , enable_video_vgl=no) 1080 , enable_video_vgl=no)
973 if test x$enable_video = xyes -a x$enable_video_vgl = xyes; then 1081 if test x$enable_video = xyes -a x$enable_video_vgl = xyes; then
974 AC_MSG_CHECKING(for libVGL support) 1082 AC_MSG_CHECKING(for libVGL support)
975 video_vgl=no 1083 video_vgl=no
976 AC_TRY_COMPILE([ 1084 AC_TRY_COMPILE([
984 ],[ 1092 ],[
985 video_vgl=yes 1093 video_vgl=yes
986 ]) 1094 ])
987 AC_MSG_RESULT($video_vgl) 1095 AC_MSG_RESULT($video_vgl)
988 if test x$video_vgl = xyes; then 1096 if test x$video_vgl = xyes; then
989 CFLAGS="$CFLAGS -DENABLE_VGL" 1097 AC_DEFINE(SDL_VIDEO_DRIVER_VGL)
990 SYSTEM_LIBS="$SYSTEM_LIBS -lvgl" 1098 SOURCES="$SOURCES $srcdir/src/video/vgl/*.c"
991 1099 BUILD_LIBS="$BUILD_LIBS -lvgl"
992 VIDEO_SUBDIRS="$VIDEO_SUBDIRS vgl" 1100 have_video=yes
993 VIDEO_DRIVERS="$VIDEO_DRIVERS vgl/libvideo_vgl.la" 1101 fi
994 fi 1102 fi
995 fi 1103 }
996 } 1104
1105 dnl Set up the wscons video driver if enabled
1106 CheckWscons()
1107 {
1108 AC_ARG_ENABLE(video-wscons,
1109 AC_HELP_STRING([--enable-video-wscons], [use wscons video driver [default=yes]]),
1110 , enable_video_wscons=yes)
1111 if test x$enable_video = xyes -a x$enable_video_wscons = xyes; then
1112 AC_MSG_CHECKING(for wscons support)
1113 video_wscons=no
1114 AC_TRY_COMPILE([
1115 #include <sys/time.h>
1116 #include <dev/wscons/wsconsio.h>
1117 ],[
1118 ],[
1119 video_wscons=yes
1120 ])
1121 AC_MSG_RESULT($video_wscons)
1122 if test x$video_wscons = xyes; then
1123 AC_DEFINE(SDL_VIDEO_DRIVER_WSCONS)
1124 SOURCES="$SOURCES $srcdir/src/video/wscons/*.c"
1125 have_video=yes
1126 fi
1127 fi
1128 }
1129
997 1130
998 dnl Find the AAlib includes 1131 dnl Find the AAlib includes
999 CheckAAlib() 1132 CheckAAlib()
1000 { 1133 {
1001 AC_ARG_ENABLE(video-aalib, 1134 AC_ARG_ENABLE(video-aalib,
1002 [ --enable-video-aalib use AAlib video driver [default=no]], 1135 AC_HELP_STRING([--enable-video-aalib], [use AAlib video driver [default=no]]),
1003 , enable_video_aalib=no) 1136 , enable_video_aalib=no)
1004 if test x$enable_video = xyes -a x$enable_video_aalib = xyes; then 1137 if test x$enable_video = xyes -a x$enable_video_aalib = xyes; then
1005 AC_MSG_CHECKING(for AAlib support) 1138 AC_MSG_CHECKING(for AAlib support)
1006 video_aalib=no 1139 video_aalib=no
1007 AC_TRY_COMPILE([ 1140 AC_TRY_COMPILE([
1010 ],[ 1143 ],[
1011 video_aalib=yes 1144 video_aalib=yes
1012 ]) 1145 ])
1013 AC_MSG_RESULT($video_aalib) 1146 AC_MSG_RESULT($video_aalib)
1014 if test x$video_aalib = xyes; then 1147 if test x$video_aalib = xyes; then
1015 CFLAGS="$CFLAGS -DENABLE_AALIB" 1148 AC_DEFINE(SDL_VIDEO_DRIVER_AALIB)
1016 SYSTEM_LIBS="$SYSTEM_LIBS -laa" 1149 SOURCES="$SOURCES $srcdir/src/video/aalib/*.c"
1017 1150 BUILD_LIBS="$BUILD_LIBS -laa"
1018 VIDEO_SUBDIRS="$VIDEO_SUBDIRS aalib" 1151 have_video=yes
1019 VIDEO_DRIVERS="$VIDEO_DRIVERS aalib/libvideo_aa.la" 1152 fi
1020 fi 1153 fi
1021 fi 1154 }
1155
1156 dnl Set up the QTopia video driver if enabled
1157 CheckQtopia()
1158 {
1159 AC_ARG_ENABLE(video-qtopia,
1160 AC_HELP_STRING([--enable-video-qtopia], [use Qtopia video driver [default=no]]),
1161 , enable_video_qtopia=no)
1162 if test x$enable_video = xyes -a x$enable_video_qtopia = xyes; then
1163 AC_MSG_CHECKING(for Qtopia support)
1164 video_qtopia=no
1165 QTOPIA_FLAGS="-DQT_QWS_EBX -DQT_QWS_CUSTOM -DQWS -I${QPEDIR}/include -I${QTDIR}/include/ -DNO_DEBUG -fno-rtti -fno-exceptions"
1166 AC_LANG_CPLUSPLUS
1167 OLD_CXX="$CXXFLAGS"
1168 CXXFLAGS="$QTOPIA_FLAGS"
1169 AC_TRY_COMPILE([
1170 #include <qpe/qpeapplication.h>
1171 ],[
1172 ],[
1173 video_qtopia=yes
1174 ])
1175 CXXFLAGS="$OLD_CXX"
1176 AC_MSG_RESULT($video_qtopia)
1177 if test x$video_qtopia = xyes; then
1178 AC_DEFINE(SDL_VIDEO_DRIVER_QTOPIA)
1179 SOURCES="$SOURCES $srcdir/src/video/qtopia/*.cc"
1180 BUILD_CFLAGS="$BUILD_CFLAGS $QTOPIA_FLAGS"
1181 SDL_CFLAGS="$SDL_CFLAGS -DQWS -Dmain=SDL_main"
1182 SDL_LIBS="-lSDLmain $SDL_LIBS -L${QPEDIR}/lib -L${QTDIR}/lib/ -lqpe -lqte"
1183 have_video=yes
1184 fi
1185 AC_LANG_C
1186 fi
1187 }
1188
1189 dnl Set up the PicoGUI video driver if enabled
1190 CheckPicoGUI()
1191 {
1192 AC_ARG_ENABLE(video-picogui,
1193 AC_HELP_STRING([--enable-video-picogui], [use PicoGUI video driver [default=no]]),
1194 , enable_video_picogui=no)
1195 if test x$enable_video = xyes -a x$enable_video_picogui = xyes; then
1196 AC_MSG_CHECKING(for PicoGUI support)
1197 video_picogui=no
1198 AC_TRY_COMPILE([
1199 #include <picogui.h>
1200 ],[
1201 ],[
1202 video_picogui=yes
1203 ])
1204 AC_MSG_RESULT($video_picogui)
1205 if test x$video_picogui = xyes; then
1206 AC_DEFINE(SDL_VIDEO_DRIVER_PICOGUI)
1207 SOURCES="$SOURCES $srcdir/src/video/picogui/*.c"
1208 SDL_LIBS="$SDL_LIBS -lpgui"
1209 have_video=yes
1210 fi
1211 fi
1212 }
1213
1214 dnl Set up the Atari Bios keyboard driver
1215 CheckAtariBiosEvent()
1216 {
1217 SOURCES="$SOURCES $srcdir/src/video/ataricommon/*.c"
1022 } 1218 }
1023 1219
1024 dnl Set up the Atari Xbios driver 1220 dnl Set up the Atari Xbios driver
1025 CheckAtariXbiosVideo() 1221 CheckAtariXbiosVideo()
1026 { 1222 {
1027 AC_ARG_ENABLE(xbios, 1223 AC_ARG_ENABLE(xbios,
1028 [ --enable-video-xbios use Atari Xbios video driver [default=yes]], 1224 AC_HELP_STRING([--enable-video-xbios], [use Atari Xbios video driver [default=yes]]),
1029 , enable_video_xbios=yes) 1225 , enable_video_xbios=yes)
1030 video_xbios=no 1226 video_xbios=no
1031 if test x$enable_video = xyes -a x$enable_video_xbios = xyes; then 1227 if test x$enable_video = xyes -a x$enable_video_xbios = xyes; then
1032 video_xbios=yes 1228 video_xbios=yes
1033 CFLAGS="$CFLAGS -DENABLE_XBIOS" 1229 AC_DEFINE(SDL_VIDEO_DRIVER_XBIOS)
1034 VIDEO_SUBDIRS="$VIDEO_SUBDIRS xbios" 1230 SOURCES="$SOURCES $srcdir/src/video/xbios/*.c"
1035 VIDEO_DRIVERS="$VIDEO_DRIVERS xbios/libvideo_xbios.la" 1231 have_video=yes
1036 fi 1232 fi
1037 } 1233 }
1038 1234
1039 dnl Set up the Atari Gem driver 1235 dnl Set up the Atari Gem driver
1040 CheckAtariGemVideo() 1236 CheckAtariGemVideo()
1041 { 1237 {
1042 AC_ARG_ENABLE(gem, 1238 AC_ARG_ENABLE(gem,
1043 [ --enable-video-gem use Atari Gem video driver [default=yes]], 1239 AC_HELP_STRING([--enable-video-gem], [use Atari Gem video driver [default=yes]]),
1044 , enable_video_gem=yes) 1240 , enable_video_gem=yes)
1045 if test x$enable_video = xyes -a x$enable_video_gem = xyes; then 1241 if test x$enable_video = xyes -a x$enable_video_gem = xyes; then
1046 video_gem=no 1242 video_gem=no
1047 AC_CHECK_HEADER(gem.h, have_gem_hdr=yes) 1243 AC_CHECK_HEADER(gem.h, have_gem_hdr=yes)
1048 AC_CHECK_LIB(gem, appl_init, have_gem_lib=yes) 1244 AC_CHECK_LIB(gem, appl_init, have_gem_lib=yes)
1049 if test x$have_gem_hdr = xyes -a x$have_gem_lib = xyes; then 1245 if test x$have_gem_hdr = xyes -a x$have_gem_lib = xyes; then
1050 video_gem=yes 1246 AC_DEFINE(SDL_VIDEO_DRIVER_GEM)
1051 CFLAGS="$CFLAGS -DENABLE_GEM" 1247 SOURCES="$SOURCES $srcdir/src/video/gem/*.c"
1052 SYSTEM_LIBS="$SYSTEM_LIBS -lgem" 1248 BUILD_LIBS="$BUILD_LIBS -lgem"
1053 VIDEO_SUBDIRS="$VIDEO_SUBDIRS gem" 1249 have_video=yes
1054 VIDEO_DRIVERS="$VIDEO_DRIVERS gem/libvideo_gem.la" 1250 fi
1055 fi 1251 fi
1056 fi
1057 }
1058
1059 dnl Set up the Atari Bios keyboard driver
1060 CheckAtariBiosEvent()
1061 {
1062 CFLAGS="$CFLAGS -I\$(top_srcdir)/src/video/ataricommon"
1063 VIDEO_SUBDIRS="$VIDEO_SUBDIRS ataricommon"
1064 VIDEO_DRIVERS="$VIDEO_DRIVERS ataricommon/libvideo_ataricommon.la"
1065 } 1252 }
1066 1253
1067 dnl rcg04172001 Set up the Null video driver. 1254 dnl rcg04172001 Set up the Null video driver.
1068 CheckDummyVideo() 1255 CheckDummyVideo()
1069 { 1256 {
1070 AC_ARG_ENABLE(video-dummy, 1257 AC_ARG_ENABLE(video-dummy,
1071 [ --enable-video-dummy use dummy video driver [default=yes]], 1258 AC_HELP_STRING([--enable-video-dummy], [use dummy video driver [default=yes]]),
1072 , enable_video_dummy=yes) 1259 , enable_video_dummy=yes)
1073 if test x$enable_video_dummy = xyes; then 1260 if test x$enable_video_dummy = xyes; then
1074 CFLAGS="$CFLAGS -DENABLE_DUMMYVIDEO" 1261 AC_DEFINE(SDL_VIDEO_DRIVER_DUMMY)
1075 VIDEO_SUBDIRS="$VIDEO_SUBDIRS dummy" 1262 SOURCES="$SOURCES $srcdir/src/video/dummy/*.c"
1076 VIDEO_DRIVERS="$VIDEO_DRIVERS dummy/libvideo_null.la" 1263 have_video=yes
1077 fi 1264 fi
1078 } 1265 }
1079 1266
1080 dnl Check to see if OpenGL support is desired 1267 dnl Check to see if OpenGL support is desired
1081 AC_ARG_ENABLE(video-opengl, 1268 AC_ARG_ENABLE(video-opengl,
1082 [ --enable-video-opengl include OpenGL context creation [default=yes]], 1269 AC_HELP_STRING([--enable-video-opengl], [include OpenGL context creation [default=yes]]),
1083 , enable_video_opengl=yes) 1270 , enable_video_opengl=yes)
1084 1271
1085 dnl Find OpenGL 1272 dnl Find OpenGL
1086 CheckOpenGLX11() 1273 CheckOpenGLX11()
1087 { 1274 {
1089 AC_MSG_CHECKING(for OpenGL (GLX) support) 1276 AC_MSG_CHECKING(for OpenGL (GLX) support)
1090 video_opengl=no 1277 video_opengl=no
1091 AC_TRY_COMPILE([ 1278 AC_TRY_COMPILE([
1092 #include <GL/gl.h> 1279 #include <GL/gl.h>
1093 #include <GL/glx.h> 1280 #include <GL/glx.h>
1094 #include <dlfcn.h> /* For loading extensions */
1095 ],[ 1281 ],[
1096 ],[ 1282 ],[
1097 video_opengl=yes 1283 video_opengl=yes
1098 ]) 1284 ])
1099 AC_MSG_RESULT($video_opengl) 1285 AC_MSG_RESULT($video_opengl)
1100 if test x$video_opengl = xyes; then 1286 if test x$video_opengl = xyes; then
1101 CFLAGS="$CFLAGS -DHAVE_OPENGL -DHAVE_OPENGL_X11" 1287 AC_DEFINE(SDL_VIDEO_OPENGL)
1102 if test x$have_loadso != xyes; then 1288 AC_DEFINE(SDL_VIDEO_OPENGL_GLX)
1103 AC_CHECK_LIB(dl, dlopen, SYSTEM_LIBS="$SYSTEM_LIBS -ldl")
1104 fi
1105 fi 1289 fi
1106 fi 1290 fi
1107 } 1291 }
1108 1292
1109 dnl Find QNX RtP OpenGL 1293 dnl Find QNX RtP OpenGL
1118 ],[ 1302 ],[
1119 video_opengl=yes 1303 video_opengl=yes
1120 ]) 1304 ])
1121 AC_MSG_RESULT($video_opengl) 1305 AC_MSG_RESULT($video_opengl)
1122 if test x$video_opengl = xyes; then 1306 if test x$video_opengl = xyes; then
1123 CFLAGS="$CFLAGS -DHAVE_OPENGL" 1307 AC_DEFINE(SDL_VIDEO_OPENGL)
1124 SYSTEM_LIBS="$SYSTEM_LIBS -lGL" 1308 BUILD_LIBS="$BUILD_LIBS -lGL"
1125 if test x$have_loadso != xyes; then 1309 fi
1126 AC_CHECK_LIB(c, dlopen, SYSTEM_LIBS="$SYSTEM_LIBS", AC_CHECK_LIB(ltdl, dlopen, SYSTEM_LIBS="$SYSTEM_LIBS -lltdl")) 1310 fi
1127 fi 1311 }
1128 fi 1312
1313 dnl Check for Win32 OpenGL
1314 CheckWIN32GL()
1315 {
1316 if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then
1317 AC_DEFINE(SDL_VIDEO_OPENGL)
1318 AC_DEFINE(SDL_VIDEO_OPENGL_WGL)
1129 fi 1319 fi
1130 } 1320 }
1131 1321
1132 dnl Check for BeOS OpenGL 1322 dnl Check for BeOS OpenGL
1133 CheckBeGL() 1323 CheckBeGL()
1134 { 1324 {
1135 if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then 1325 if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then
1136 CFLAGS="$CFLAGS -DHAVE_OPENGL" 1326 AC_DEFINE(SDL_VIDEO_OPENGL)
1137 SYSTEM_LIBS="$SYSTEM_LIBS -lGL" 1327 BUILD_LIBS="$BUILD_LIBS -lGL"
1138 fi 1328 fi
1139 } 1329 }
1140 1330
1141 dnl Check for MacOS OpenGL 1331 dnl Check for MacOS OpenGL
1142 CheckMacGL() 1332 CheckMacGL()
1143 { 1333 {
1144 if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then 1334 if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then
1145 CFLAGS="$CFLAGS -DHAVE_OPENGL" 1335 AC_DEFINE(SDL_VIDEO_OPENGL)
1146 case "$target" in 1336 case "$target" in
1147 *-*-darwin*) 1337 *-*-darwin*)
1148 SYSTEM_LIBS="$SYSTEM_LIBS -framework OpenGL" 1338 BUILD_LIBS="$BUILD_LIBS -framework OpenGL"
1149 # The following is probably not available in Darwin: 1339 # The following is probably not available in Darwin:
1150 SYSTEM_LIBS="$SYSTEM_LIBS -framework AGL" 1340 BUILD_LIBS="$BUILD_LIBS -framework AGL"
1151 esac 1341 esac
1152 fi 1342 fi
1153 } 1343 }
1154 1344
1155 dnl Check for Mesa offscreen rendering 1345 dnl Check for Mesa offscreen rendering
1162 # Static linking to -lOSMesa 1352 # Static linking to -lOSMesa
1163 AC_PATH_PROG(OSMESA_CONFIG, osmesa-config, no) 1353 AC_PATH_PROG(OSMESA_CONFIG, osmesa-config, no)
1164 if test "x$OSMESA_CONFIG" = "xno" -o "x$enable_atari_ldg" = "xno"; then 1354 if test "x$OSMESA_CONFIG" = "xno" -o "x$enable_atari_ldg" = "xno"; then
1165 # -lOSMesa is really the static library 1355 # -lOSMesa is really the static library
1166 if test "x$have_osmesa_hdr" = "xyes" -a "x$have_osmesa_lib" = "xyes"; then 1356 if test "x$have_osmesa_hdr" = "xyes" -a "x$have_osmesa_lib" = "xyes"; then
1167 CFLAGS="$CFLAGS -DHAVE_OPENGL" 1357 OSMESA_LIBS="-lOSMesa"
1168 SYSTEM_LIBS="$SYSTEM_LIBS -lOSMesa"
1169 fi 1358 fi
1170 else 1359 else
1171 # -lOSMesa is a loader for OSMesa.ldg 1360 # -lOSMesa is a loader for OSMesa.ldg
1172 OSMESA_CFLAGS=`$OSMESA_CONFIG --cflags` 1361 OSMESA_CFLAGS=`$OSMESA_CONFIG --cflags`
1173 OSMESA_LIBS=`$OSMESA_CONFIG --libs` 1362 OSMESA_LIBS=`$OSMESA_CONFIG --libs`
1174 CFLAGS="$CFLAGS -DHAVE_OPENGL $OSMESA_CFLAGS" 1363 fi
1175 SYSTEM_LIBS="$SYSTEM_LIBS $OSMESA_LIBS" 1364 AC_DEFINE(SDL_VIDEO_OPENGL)
1176 fi 1365 AC_DEFINE(SDL_VIDEO_OPENGL_OSMESA)
1366 BUILD_CFLAGS="$BUILD_CFLAGS $OSMESA_CFLAGS"
1367 BUILD_LIBS="$BUILD_LIBS $OSMESA_LIBS"
1177 1368
1178 AC_ARG_ENABLE(osmesa-shared, 1369 AC_ARG_ENABLE(osmesa-shared,
1179 [ --enable-osmesa-shared dynamically load OSMesa OpenGL support [default=yes]], 1370 AC_HELP_STRING([--enable-osmesa-shared], [dynamically load OSMesa OpenGL support [default=yes]]),
1180 , enable_osmesa_shared=yes) 1371 , enable_osmesa_shared=yes)
1181 if test "x$enable_osmesa_shared" = "xyes" -a "x$enable_atari_ldg" = "xyes"; then 1372 if test "x$enable_osmesa_shared" = "xyes" -a "x$enable_atari_ldg" = "xyes"; then
1182 # Dynamic linking 1373 # Dynamic linking
1183 if test "x$have_osmesa_hdr" = "xyes"; then 1374 if test "x$have_osmesa_hdr" = "xyes"; then
1184 CFLAGS="$CFLAGS -DENABLE_OSMESA_SHARED" 1375 AC_DEFINE(SDL_VIDEO_OPENGL_OSMESA_DYNAMIC)
1185 fi 1376 fi
1186 fi 1377 fi
1187 fi 1378 fi
1188 } 1379 }
1189 1380
1190 dnl See if we can use the new unified event interface in Linux 2.4 1381 dnl See if we can use the new unified event interface in Linux 2.4
1191 CheckInputEvents() 1382 CheckInputEvents()
1192 { 1383 {
1193 dnl Check for Linux 2.4 unified input event interface support 1384 dnl Check for Linux 2.4 unified input event interface support
1194 AC_ARG_ENABLE(input-events, 1385 AC_ARG_ENABLE(input-events,
1195 [ --enable-input-events use Linux 2.4 unified input interface [default=yes]], 1386 AC_HELP_STRING([--enable-input-events], [use Linux 2.4 unified input interface [default=yes]]),
1196 , enable_input_events=yes) 1387 , enable_input_events=yes)
1197 if test x$enable_input_events = xyes; then 1388 if test x$enable_input_events = xyes; then
1198 AC_MSG_CHECKING(for Linux 2.4 unified input interface) 1389 AC_MSG_CHECKING(for Linux 2.4 unified input interface)
1199 use_input_events=no 1390 use_input_events=no
1200 AC_TRY_COMPILE([ 1391 AC_TRY_COMPILE([
1206 ],[ 1397 ],[
1207 use_input_events=yes 1398 use_input_events=yes
1208 ]) 1399 ])
1209 AC_MSG_RESULT($use_input_events) 1400 AC_MSG_RESULT($use_input_events)
1210 if test x$use_input_events = xyes; then 1401 if test x$use_input_events = xyes; then
1211 CFLAGS="$CFLAGS -DUSE_INPUT_EVENTS" 1402 AC_DEFINE(SDL_INPUT_LINUXEV)
1212 fi 1403 fi
1213 fi 1404 fi
1214 } 1405 }
1215 1406
1216 dnl See if we can use the Touchscreen input library 1407 dnl See if we can use the Touchscreen input library
1217 CheckTslib() 1408 CheckTslib()
1218 { 1409 {
1219 AC_ARG_ENABLE(input-tslib, 1410 AC_ARG_ENABLE(input-tslib,
1220 [ --enable-input-tslib use the Touchscreen library for input [default=yes]], 1411 AC_HELP_STRING([--enable-input-tslib], [use the Touchscreen library for input [default=yes]]),
1221 , enable_input_tslib=yes) 1412 , enable_input_tslib=yes)
1222 if test x$enable_input_tslib = xyes; then 1413 if test x$enable_input_tslib = xyes; then
1223 AC_MSG_CHECKING(for Touchscreen library support) 1414 AC_MSG_CHECKING(for Touchscreen library support)
1224 enable_input_tslib=no 1415 enable_input_tslib=no
1225 AC_TRY_COMPILE([ 1416 AC_TRY_COMPILE([
1228 ],[ 1419 ],[
1229 enable_input_tslib=yes 1420 enable_input_tslib=yes
1230 ]) 1421 ])
1231 AC_MSG_RESULT($enable_input_tslib) 1422 AC_MSG_RESULT($enable_input_tslib)
1232 if test x$enable_input_tslib = xyes; then 1423 if test x$enable_input_tslib = xyes; then
1233 CFLAGS="$CFLAGS -DHAVE_TSLIB" 1424 AC_DEFINE(SDL_INPUT_TSLIB)
1234 SYSTEM_LIBS="$SYSTEM_LIBS -lts" 1425 BUILD_LIBS="$BUILD_LIBS -lts"
1235 fi 1426 fi
1236 fi 1427 fi
1237 } 1428 }
1238 1429
1239 dnl See if we can use GNU pth library for threads 1430 dnl See if we can use GNU pth library for threads
1240 CheckPTH() 1431 CheckPTH()
1241 { 1432 {
1242 dnl Check for pth support 1433 dnl Check for pth support
1243 AC_ARG_ENABLE(pth, 1434 AC_ARG_ENABLE(pth,
1244 [ --enable-pth use GNU pth library for multi-threading [default=yes]], 1435 AC_HELP_STRING([--enable-pth], [use GNU pth library for multi-threading [default=yes]]),
1245 , enable_pth=yes) 1436 , enable_pth=yes)
1246 if test x$enable_threads = xyes -a x$enable_pth = xyes; then 1437 if test x$enable_threads = xyes -a x$enable_pth = xyes; then
1247 AC_PATH_PROG(PTH_CONFIG, pth-config, no) 1438 AC_PATH_PROG(PTH_CONFIG, pth-config, no)
1248 if test "$PTH_CONFIG" = "no"; then 1439 if test "$PTH_CONFIG" = "no"; then
1249 use_pth=no 1440 use_pth=no
1250 else 1441 else
1251 PTH_CFLAGS=`$PTH_CONFIG --cflags`
1252 PTH_LIBS=`$PTH_CONFIG --libs --all`
1253 SDL_CFLAGS="$SDL_CFLAGS $PTH_CFLAGS"
1254 SDL_LIBS="$SDL_LIBS $PTH_LIBS"
1255 CFLAGS="$CFLAGS -DENABLE_PTH"
1256 use_pth=yes 1442 use_pth=yes
1257 fi 1443 fi
1258 AC_MSG_CHECKING(pth) 1444 AC_MSG_CHECKING(pth)
1445 AC_MSG_RESULT($use_pth)
1259 if test "x$use_pth" = xyes; then 1446 if test "x$use_pth" = xyes; then
1260 AC_MSG_RESULT(yes) 1447 AC_DEFINE(SDL_THREAD_PTH)
1261 else 1448 SOURCES="$SOURCES $srcdir/src/thread/pth/*.c"
1262 AC_MSG_RESULT(no) 1449 SOURCES="$SOURCES $srcdir/src/thread/generic/SDL_syssem.c"
1450 SDL_CFLAGS="$SDL_CFLAGS `$PTH_CONFIG --cflags`"
1451 SDL_LIBS="$SDL_LIBS `$PTH_CONFIG --libs --all`"
1452 have_threads=yes
1263 fi 1453 fi
1264 fi 1454 fi
1265 } 1455 }
1266 1456
1267 dnl See what type of thread model to use on Linux and Solaris 1457 dnl See what type of thread model to use on Linux and Solaris
1268 CheckPTHREAD() 1458 CheckPTHREAD()
1269 { 1459 {
1270 dnl Check for pthread support 1460 dnl Check for pthread support
1271 AC_ARG_ENABLE(pthreads, 1461 AC_ARG_ENABLE(pthreads,
1272 [ --enable-pthreads use POSIX threads for multi-threading [default=yes]], 1462 AC_HELP_STRING([--enable-pthreads], [use POSIX threads for multi-threading [default=yes]]),
1273 , enable_pthreads=yes) 1463 , enable_pthreads=yes)
1274 dnl This is used on Linux for glibc binary compatibility (Doh!) 1464 dnl This is used on Linux for glibc binary compatibility (Doh!)
1275 AC_ARG_ENABLE(pthread-sem, 1465 AC_ARG_ENABLE(pthread-sem,
1276 [ --enable-pthread-sem use pthread semaphores [default=yes]], 1466 AC_HELP_STRING([--enable-pthread-sem], [use pthread semaphores [default=yes]]),
1277 , enable_pthread_sem=yes) 1467 , enable_pthread_sem=yes)
1278 case "$target" in 1468 case "$target" in
1279 *-*-linux*) 1469 *-*-linux*)
1280 pthread_cflags="-D_REENTRANT -D_GNU_SOURCE" 1470 pthread_cflags="-D_REENTRANT"
1281 pthread_lib="-lpthread" 1471 pthread_lib="-lpthread"
1282 ;; 1472 ;;
1283 *-*-bsdi*) 1473 *-*-bsdi*)
1284 pthread_cflags="-D_REENTRANT -D_THREAD_SAFE" 1474 pthread_cflags="-D_REENTRANT -D_THREAD_SAFE"
1285 pthread_lib="" 1475 pthread_lib=""
1292 *-*-freebsd*) 1482 *-*-freebsd*)
1293 pthread_cflags="-D_REENTRANT -D_THREAD_SAFE" 1483 pthread_cflags="-D_REENTRANT -D_THREAD_SAFE"
1294 pthread_lib="-pthread" 1484 pthread_lib="-pthread"
1295 ;; 1485 ;;
1296 *-*-netbsd*) 1486 *-*-netbsd*)
1297 pthread_cflags="-I/usr/include -D_REENTRANT -D_THREAD_SAFE" 1487 pthread_cflags="-I/usr/include -D_REENTRANT -D_THREAD_SAFE -D_POSIX_THREAD_SYSCALL_SOFT=1"
1298 pthread_lib="-L/usr/lib -lpthread" 1488 pthread_lib="-L/usr/lib -lpthread"
1299 ;; 1489 ;;
1300 *-*-openbsd*) 1490 *-*-openbsd*)
1301 pthread_cflags="-D_REENTRANT" 1491 pthread_cflags="-D_REENTRANT"
1302 pthread_lib="-pthread" 1492 pthread_lib="-pthread"
1355 use_pthreads=yes 1545 use_pthreads=yes
1356 ]) 1546 ])
1357 AC_MSG_RESULT($use_pthreads) 1547 AC_MSG_RESULT($use_pthreads)
1358 # Restore the compiler flags and libraries 1548 # Restore the compiler flags and libraries
1359 CFLAGS="$ac_save_cflags"; LIBS="$ac_save_libs" 1549 CFLAGS="$ac_save_cflags"; LIBS="$ac_save_libs"
1550
1360 # Do futher testing if we have pthread support... 1551 # Do futher testing if we have pthread support...
1361 if test x$use_pthreads = xyes; then 1552 if test x$use_pthreads = xyes; then
1362 CFLAGS="$CFLAGS $pthread_cflags -DSDL_USE_PTHREADS" 1553 AC_DEFINE(SDL_THREAD_PTHREAD)
1363 LIBS="$LIBS $pthread_lib" 1554 BUILD_CFLAGS="$BUILD_CFLAGS $pthread_cflags"
1555 BUILD_LIBS="$BUILD_LIBS $pthread_lib"
1364 SDL_CFLAGS="$SDL_CFLAGS $pthread_cflags" 1556 SDL_CFLAGS="$SDL_CFLAGS $pthread_cflags"
1365 SDL_LIBS="$SDL_LIBS $pthread_lib" 1557 SDL_LIBS="$SDL_LIBS $pthread_lib"
1366 1558
1367 # Check to see if recursive mutexes are available 1559 # Check to see if recursive mutexes are available
1368 AC_MSG_CHECKING(for recursive mutexes) 1560 AC_MSG_CHECKING(for recursive mutexes)
1373 ],[ 1565 ],[
1374 pthread_mutexattr_t attr; 1566 pthread_mutexattr_t attr;
1375 pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE); 1567 pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
1376 ],[ 1568 ],[
1377 has_recursive_mutexes=yes 1569 has_recursive_mutexes=yes
1378 CFLAGS="$CFLAGS -DPTHREAD_RECURSIVE_MUTEX" 1570 AC_DEFINE(SDL_THREAD_PTHREAD_RECURSIVE_MUTEX)
1379 ]) 1571 ])
1380 fi 1572 fi
1381 if test x$has_recursive_mutexes = xno; then 1573 if test x$has_recursive_mutexes = xno; then
1382 AC_TRY_COMPILE([ 1574 AC_TRY_COMPILE([
1383 #include <pthread.h> 1575 #include <pthread.h>
1384 ],[ 1576 ],[
1385 pthread_mutexattr_t attr; 1577 pthread_mutexattr_t attr;
1386 pthread_mutexattr_setkind_np(&attr, PTHREAD_MUTEX_RECURSIVE_NP); 1578 pthread_mutexattr_setkind_np(&attr, PTHREAD_MUTEX_RECURSIVE_NP);
1387 ],[ 1579 ],[
1388 has_recursive_mutexes=yes 1580 has_recursive_mutexes=yes
1389 CFLAGS="$CFLAGS -DPTHREAD_RECURSIVE_MUTEX_NP" 1581 AC_DEFINE(SDL_THREAD_PTHREAD_RECURSIVE_MUTEX_NP)
1390 ]) 1582 ])
1391 fi 1583 fi
1392 AC_MSG_RESULT($has_recursive_mutexes) 1584 AC_MSG_RESULT($has_recursive_mutexes)
1393 if test x$has_recursive_mutexes = xno; then
1394 CFLAGS="$CFLAGS -DPTHREAD_NO_RECURSIVE_MUTEX"
1395 fi
1396 1585
1397 # Check to see if pthread semaphore support is missing 1586 # Check to see if pthread semaphore support is missing
1398 if test x$enable_pthread_sem = xyes; then 1587 if test x$enable_pthread_sem = xyes; then
1399 AC_MSG_CHECKING(for pthread semaphores) 1588 AC_MSG_CHECKING(for pthread semaphores)
1400 have_pthread_sem=no 1589 have_pthread_sem=no
1406 have_pthread_sem=yes 1595 have_pthread_sem=yes
1407 ]) 1596 ])
1408 AC_MSG_RESULT($have_pthread_sem) 1597 AC_MSG_RESULT($have_pthread_sem)
1409 fi 1598 fi
1410 1599
1411 # Check to see if this is broken glibc 2.0 pthreads 1600 # Basic thread creation functions
1412 case "$target" in 1601 SOURCES="$SOURCES $srcdir/src/thread/pthread/SDL_systhread.c"
1413 *-*-linux*) 1602
1414 AC_MSG_CHECKING(for broken glibc 2.0 pthreads) 1603 # Semaphores
1415 glibc20_pthreads=no 1604 # We can fake these with mutexes and condition variables if necessary
1416 AC_TRY_COMPILE([ 1605 if test x$have_pthread_sem = xyes; then
1417 #include <features.h> 1606 SOURCES="$SOURCES $srcdir/src/thread/pthread/SDL_syssem.c"
1418 #if (__GLIBC__ == 2) && (__GLIBC_MINOR__ == 0) 1607 else
1419 #warning Working around a bug in glibc 2.0 pthreads 1608 SOURCES="$SOURCES $srcdir/src/thread/generic/SDL_syssem.c"
1420 #else 1609 fi
1421 #error pthread implementation okay 1610
1422 #endif /* glibc 2.0 */ 1611 # Mutexes
1423 ],[ 1612 # We can fake these with semaphores if necessary
1424 ],[ 1613 SOURCES="$SOURCES $srcdir/src/thread/pthread/SDL_sysmutex.c"
1425 glibc20_pthreads=yes 1614
1426 ]) 1615 # Condition variables
1427 AC_MSG_RESULT($glibc20_pthreads) 1616 # We can fake these with semaphores and mutexes if necessary
1428 esac 1617 SOURCES="$SOURCES $srcdir/src/thread/pthread/SDL_syscond.c"
1429 fi 1618
1430 fi 1619 have_threads=yes
1431
1432 AC_MSG_CHECKING(whether semun is defined in /usr/include/sys/sem.h)
1433 have_semun=no
1434 AC_TRY_COMPILE([
1435 #include <sys/types.h>
1436 #include <sys/sem.h>
1437 ],[
1438 union semun t;
1439 ],[
1440 have_semun=yes
1441 ])
1442 AC_MSG_RESULT($have_semun)
1443 if test x$have_semun = xyes; then
1444 CFLAGS="$CFLAGS -DHAVE_SEMUN"
1445 fi
1446
1447 # See if we can use GNU Pth or clone() on Linux directly
1448 if test x$enable_threads = xyes -a x$use_pthreads != xyes; then
1449 CheckPTH
1450 if test x$use_pth != xyes; then
1451 case "$target" in
1452 *-*-linux*)
1453 use_clone=yes
1454 ;;
1455 esac
1456 fi
1457 fi
1458 }
1459
1460 # Note that we need to have either semaphores or to have mutexes and
1461 # condition variables to implement all thread synchronization primitives
1462 CopyUnixThreadSource()
1463 {
1464 if test x$use_pthreads = xyes -o x$use_clone = xyes; then
1465 # Basic thread creation functions
1466 COPY_ARCH_SRC(src/thread, linux, SDL_systhread.c)
1467 COPY_ARCH_SRC(src/thread, linux, SDL_systhread_c.h)
1468
1469 # Semaphores
1470 # We can fake these with mutexes and condition variables if necessary
1471 if test x$use_pthreads = xyes -a x$have_pthread_sem != xyes; then
1472 COPY_ARCH_SRC(src/thread, generic, SDL_syssem.c)
1473 else 1620 else
1474 COPY_ARCH_SRC(src/thread, linux, SDL_syssem.c) 1621 CheckPTH
1475 fi
1476 COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
1477
1478 # Mutexes
1479 # We can fake these with semaphores if necessary
1480 case "$target" in
1481 *-*-bsdi*)
1482 COPY_ARCH_SRC(src/thread, bsdi, SDL_syssem.c)
1483 COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
1484 COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex.c)
1485 COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex_c.h)
1486 ;;
1487 *)
1488 if test x$glibc20_pthreads = xyes; then
1489 COPY_ARCH_SRC(src/thread, generic, SDL_sysmutex.c)
1490 COPY_ARCH_SRC(src/thread, generic, SDL_sysmutex_c.h)
1491 else
1492 COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex.c)
1493 COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex_c.h)
1494 fi
1495 ;;
1496 esac
1497
1498 # Condition variables
1499 # We can fake these with semaphores and mutexes if necessary
1500 if test x$glibc20_pthreads = xyes -o x$has_recursive_mutexes != xyes; then
1501 COPY_ARCH_SRC(src/thread, generic, SDL_syscond.c)
1502 else
1503 COPY_ARCH_SRC(src/thread, linux, SDL_syscond.c)
1504 fi
1505 COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
1506
1507 elif test x$use_pth = xyes; then
1508 COPY_ARCH_SRC(src/thread, pth, SDL_systhread.c)
1509 COPY_ARCH_SRC(src/thread, pth, SDL_systhread_c.h)
1510 COPY_ARCH_SRC(src/thread, pth, SDL_sysmutex.c)
1511 COPY_ARCH_SRC(src/thread, pth, SDL_sysmutex_c.h)
1512 COPY_ARCH_SRC(src/thread, pth, SDL_syscond.c)
1513 COPY_ARCH_SRC(src/thread, pth, SDL_syscond_c.h)
1514 COPY_ARCH_SRC(src/thread, generic, SDL_syssem.c)
1515 COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
1516 else
1517 AC_MSG_ERROR([
1518 *** No thread support detected
1519 ])
1520 fi
1521 }
1522
1523 dnl See if we can use sigaction() instead of signal()
1524 CheckSIGACTION()
1525 {
1526 dnl Check for sigaction support
1527 AC_ARG_ENABLE(sigaction,
1528 [ --enable-sigaction use sigaction instead of signal [default=yes]],
1529 , enable_sigaction=yes)
1530 if test x$enable_sigaction = xyes; then
1531 AC_MSG_CHECKING(sigaction)
1532 have_sigaction=no
1533 AC_TRY_COMPILE([
1534 #include <signal.h>
1535 ],[
1536 struct sigaction junk;
1537 sigaction(0, &junk, &junk);
1538 ],[
1539 have_sigaction=yes
1540 ])
1541 AC_MSG_RESULT($have_sigaction)
1542 if test x$have_sigaction = xyes; then
1543 CFLAGS="$CFLAGS -DHAVE_SIGACTION"
1544 fi 1622 fi
1545 fi 1623 fi
1546 } 1624 }
1547 1625
1548 dnl Determine whether the compiler can produce Win32 executables 1626 dnl Determine whether the compiler can produce Win32 executables
1563 ]) 1641 ])
1564 fi 1642 fi
1565 1643
1566 dnl See if the user wants to redirect standard output to files 1644 dnl See if the user wants to redirect standard output to files
1567 AC_ARG_ENABLE(stdio-redirect, 1645 AC_ARG_ENABLE(stdio-redirect,
1568 [ --enable-stdio-redirect Redirect STDIO to files on Win32 [default=yes]], 1646 AC_HELP_STRING([--enable-stdio-redirect], [Redirect STDIO to files on Win32 [default=yes]]),
1569 , enable_stdio_redirect=yes) 1647 , enable_stdio_redirect=yes)
1570 if test x$enable_stdio_redirect != xyes; then 1648 if test x$enable_stdio_redirect != xyes; then
1571 CFLAGS="$CFLAGS -DNO_STDIO_REDIRECT" 1649 BUILD_CFLAGS="$BUILD_CFLAGS -DNO_STDIO_REDIRECT"
1650 fi
1651
1652 if test x$enable_video = xyes; then
1653 AC_DEFINE(SDL_VIDEO_DRIVER_WINDIB)
1654 SOURCES="$SOURCES $srcdir/src/video/wincommon/*.c"
1655 SOURCES="$SOURCES $srcdir/src/video/windib/*.c"
1656 have_video=yes
1572 fi 1657 fi
1573 } 1658 }
1574 1659
1575 dnl Find the DirectX includes and libraries 1660 dnl Find the DirectX includes and libraries
1576 CheckDIRECTX() 1661 CheckDIRECTX()
1577 { 1662 {
1578 AC_ARG_ENABLE(directx, 1663 AC_ARG_ENABLE(directx,
1579 [ --enable-directx use DirectX for Win32 audio/video [default=yes]], 1664 AC_HELP_STRING([--enable-directx], [use DirectX for Win32 audio/video [default=yes]]),
1580 , enable_directx=yes) 1665 , enable_directx=yes)
1581 if test x$enable_directx = xyes; then 1666 if test x$enable_directx = xyes; then
1582 AC_MSG_CHECKING(for DirectX headers and libraries) 1667 have_directx=no
1583 use_directx=no 1668 AC_CHECK_HEADER(ddraw.h, have_ddraw=yes)
1584 tmp_cflags=$CFLAGS 1669 AC_CHECK_HEADER(dsound.h, have_dsound=yes)
1585 CFLAGS="$CFLAGS -I$srcdir" 1670 AC_CHECK_HEADER(dinput.h, use_dinput=yes)
1586 AC_TRY_COMPILE([ 1671 if test x$have_ddraw = xyes -a x$have_dsound = xyes -a x$use_dinput = xyes; then
1587 #include "src/video/windx5/directx.h" 1672 have_directx=yes
1588 ],[ 1673 fi
1589 ],[ 1674 if test x$enable_video = xyes -a x$have_directx = xyes; then
1590 use_directx=yes 1675 AC_DEFINE(SDL_VIDEO_DRIVER_DDRAW)
1591 ]) 1676 SOURCES="$SOURCES $srcdir/src/video/windx5/*.c"
1592 CFLAGS=$tmp_cflags 1677 have_video=yes
1593 AC_MSG_RESULT($use_directx) 1678 fi
1594 fi 1679 fi
1595
1596 CFLAGS="$CFLAGS -I\$(top_srcdir)/src/video/wincommon"
1597 SYSTEM_LIBS="$SYSTEM_LIBS -luser32 -lgdi32 -lwinmm"
1598 VIDEO_SUBDIRS="$VIDEO_SUBDIRS wincommon"
1599 VIDEO_DRIVERS="$VIDEO_DRIVERS wincommon/libvideo_wincommon.la"
1600 # Enable the DIB driver
1601 CFLAGS="$CFLAGS -DENABLE_WINDIB"
1602 VIDEO_SUBDIRS="$VIDEO_SUBDIRS windib"
1603 VIDEO_DRIVERS="$VIDEO_DRIVERS windib/libvideo_windib.la"
1604 # See if we should enable the DirectX driver
1605 if test x$use_directx = xyes; then
1606 CFLAGS="$CFLAGS -DENABLE_DIRECTX"
1607 SYSTEM_LIBS="$SYSTEM_LIBS -ldxguid"
1608 VIDEO_SUBDIRS="$VIDEO_SUBDIRS windx5"
1609 VIDEO_DRIVERS="$VIDEO_DRIVERS windx5/libvideo_windx5.la"
1610 fi
1611 }
1612
1613 dnl Set up the BWindow video driver on BeOS
1614 CheckBWINDOW()
1615 {
1616 CFLAGS="$CFLAGS -DENABLE_BWINDOW"
1617 VIDEO_SUBDIRS="$VIDEO_SUBDIRS bwindow"
1618 VIDEO_DRIVERS="$VIDEO_DRIVERS bwindow/libvideo_bwindow.la"
1619 }
1620
1621 dnl Set up the QTopia video driver if enabled
1622 CheckQtopia()
1623 {
1624 AC_ARG_ENABLE(video-qtopia,
1625 [ --enable-video-qtopia use Qtopia video driver [default=no]],
1626 , enable_video_qtopia=no)
1627 if test x$enable_video = xyes -a x$enable_video_qtopia = xyes; then
1628 AC_MSG_CHECKING(for Qtopia support)
1629 video_qtopia=no
1630 AC_LANG_CPLUSPLUS
1631 OLD_CXX="$CXXFLAGS"
1632 CXXFLAGS="-DQT_QWS_EBX -fno-rtti -fno-exceptions -DQT_QWS_CUSTOM -DQWS -I${QPEDIR}/include -I${QTDIR}/include/ -DNO_DEBUG"
1633 AC_TRY_COMPILE([
1634 #include <qpe/qpeapplication.h>
1635 ],[
1636 ],[
1637 video_qtopia=yes
1638 ])
1639 CXXFLAGS="$OLD_CXX"
1640 AC_MSG_RESULT($video_qtopia)
1641 if test x$video_qtopia = xyes; then
1642 CFLAGS="$CFLAGS -DENABLE_QTOPIA -DQT_QWS_EBX -DQT_QWS_CUSTOM -DQWS -I${QPEDIR}/include -I${QTDIR}/include/ -DNO_DEBUG -fno-rtti -fno-exceptions"
1643 SDL_LIBS="$SDL_LIBS -L${QPEDIR}/lib -L${QTDIR}/lib/ -lqpe -lqte"
1644 SDL_CFLAGS="$SDL_CFLAGS -DQWS"
1645 VIDEO_SUBDIRS="$VIDEO_SUBDIRS qtopia"
1646 VIDEO_DRIVERS="$VIDEO_DRIVERS qtopia/libvideo_qtopia.la"
1647 else
1648 AC_MSG_ERROR([
1649 *** Failed to find Qtopia includes. Make sure that the QTDIR and QPEDIR
1650 *** environment variables are set correctly.])
1651 fi
1652 AC_LANG_C
1653 fi
1654 }
1655
1656 dnl Set up the wscons video driver if enabled
1657 CheckWscons()
1658 {
1659 AC_ARG_ENABLE(video-wscons,
1660 [ --enable-video-wscons use wscons video driver [default=no]],
1661 , enable_video_wscons=no)
1662 if test x$enable_video = xyes -a x$enable_video_wscons = xyes; then
1663 AC_MSG_CHECKING(for wscons support)
1664 video_wscons=no
1665 AC_LANG_C
1666 AC_TRY_COMPILE([
1667 #include <sys/time.h>
1668 #include <dev/wscons/wsconsio.h>
1669 ],[
1670 ],[
1671 video_wscons=yes
1672 ])
1673 AC_MSG_RESULT($video_wscons)
1674 if test x$video_wscons = xyes; then
1675 CFLAGS="$CFLAGS -DENABLE_WSCONS"
1676 VIDEO_SUBDIRS="$VIDEO_SUBDIRS wscons"
1677 VIDEO_DRIVERS="$VIDEO_DRIVERS wscons/libvideo_wscons.la"
1678 else
1679 AC_MSG_ERROR([
1680 *** Failed to find wscons includes.])
1681 fi
1682 AC_LANG_C
1683 fi
1684 }
1685
1686
1687 dnl Set up the PicoGUI video driver if enabled
1688 CheckPicoGUI()
1689 {
1690 AC_ARG_ENABLE(video-picogui,
1691 [ --enable-video-picogui use PicoGUI video driver [default=no]],
1692 , enable_video_picogui=no)
1693 if test x$enable_video = xyes -a x$enable_video_picogui = xyes; then
1694 AC_MSG_CHECKING(for PicoGUI support)
1695 video_picogui=no
1696 AC_TRY_COMPILE([
1697 #include <picogui.h>
1698 ],[
1699 ],[
1700 video_picogui=yes
1701 ])
1702 AC_MSG_RESULT($video_picogui)
1703 if test x$video_picogui = xyes; then
1704 SDL_LIBS="$SDL_LIBS -lpgui"
1705 CFLAGS="$CFLAGS -DENABLE_PICOGUI"
1706 VIDEO_SUBDIRS="$VIDEO_SUBDIRS picogui"
1707 VIDEO_DRIVERS="$VIDEO_DRIVERS picogui/libvideo_picogui.la"
1708 fi
1709 AC_LANG_C
1710 fi
1711 }
1712
1713 dnl Set up the Mac toolbox video driver for Mac OS 7-9
1714 CheckTOOLBOX()
1715 {
1716 CFLAGS="$CFLAGS -DENABLE_TOOLBOX -DENABLE_DRAWSPROCKET"
1717 VIDEO_SUBDIRS="$VIDEO_SUBDIRS maccommon"
1718 VIDEO_DRIVERS="$VIDEO_DRIVERS maccommon/libvideo_maccommon.la"
1719 VIDEO_SUBDIRS="$VIDEO_SUBDIRS macrom"
1720 VIDEO_DRIVERS="$VIDEO_DRIVERS macrom/libvideo_macrom.la"
1721 VIDEO_SUBDIRS="$VIDEO_SUBDIRS macdsp"
1722 VIDEO_DRIVERS="$VIDEO_DRIVERS macdsp/libvideo_macdsp.la"
1723 }
1724
1725 dnl Set up the Carbon/QuickDraw video driver for Mac OS X (but not Darwin)
1726 CheckCARBON()
1727 {
1728 AC_ARG_ENABLE(video-carbon,
1729 [ --enable-video-carbon use Carbon/QuickDraw video driver [default=no]],
1730 , enable_video_carbon=no)
1731 if test x$enable_video = xyes -a x$enable_video_carbon = xyes; then
1732 AC_MSG_CHECKING(for Carbon framework)
1733 have_carbon=no
1734 if test x$have_carbon != xyes; then
1735 AC_TRY_COMPILE([
1736 #include <Carbon/Carbon.h>
1737 ],[
1738 ],[
1739 have_carbon=yes
1740 ])
1741 fi
1742 AC_MSG_RESULT($have_carbon)
1743 if test x$have_carbon = xyes; then
1744 # "MACOSX" is not an official definition, but it's commonly
1745 # accepted as a way to differentiate between what runs on X
1746 # and what runs on older Macs - while in theory "Carbon" defns
1747 # are consistent between the two, in practice Carbon is still
1748 # changing. -sts Aug 2000
1749 mac_autoconf_target_workaround="MAC"
1750 CFLAGS="$CFLAGS -I/System/Library/Frameworks/Carbon.framework/Headers \
1751 -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"
1752 VIDEO_SUBDIRS="$VIDEO_SUBDIRS maccommon"
1753 VIDEO_DRIVERS="$VIDEO_DRIVERS maccommon/libvideo_maccommon.la"
1754 VIDEO_SUBDIRS="$VIDEO_SUBDIRS macrom"
1755 VIDEO_DRIVERS="$VIDEO_DRIVERS macrom/libvideo_macrom.la"
1756 #VIDEO_SUBDIRS="$VIDEO_SUBDIRS macdsp"
1757 #VIDEO_DRIVERS="$VIDEO_DRIVERS macdsp/libvideo_macdsp.la"
1758 fi
1759 fi
1760 }
1761
1762 dnl Set up the Cocoa/Quartz video driver for Mac OS X (but not Darwin)
1763 CheckCOCOA()
1764 {
1765 AC_ARG_ENABLE(video-cocoa,
1766 [ --enable-video-cocoa use Cocoa/Quartz video driver [default=yes]],
1767 , enable_video_cocoa=yes)
1768 if test x$enable_video = xyes -a x$enable_video_cocoa = xyes; then
1769 old_CFLAGS="$CFLAGS"
1770 dnl work around that we don't have Objective-C support in autoconf
1771 CFLAGS="$CFLAGS -x objective-c"
1772 AC_MSG_CHECKING(for Cocoa framework)
1773 have_cocoa=no
1774 if test x$have_cocoa != xyes; then
1775 AC_TRY_COMPILE([
1776 #import <Cocoa/Cocoa.h>
1777 ],[
1778 ],[
1779 have_cocoa=yes
1780 ])
1781 fi
1782 AC_MSG_RESULT($have_cocoa)
1783 CFLAGS="$old_CFLAGS"
1784 if test x$have_cocoa = xyes; then
1785 # "MACOSX" is not an official definition, but it's commonly
1786 # accepted as a way to differentiate between what runs on X
1787 # and what runs on older Macs - while in theory "Carbon" defns
1788 # are consistent between the two, in practice Carbon is still
1789 # changing. -sts Aug 2000
1790 mac_autoconf_target_workaround="MAC"
1791 CFLAGS="$CFLAGS -I/System/Library/Frameworks/Carbon.framework/Headers \
1792 -I/System/Library/Frameworks/Cocoa.framework/Headers -fpascal-strings \
1793 -DENABLE_QUARTZ -DMACOSX -DTARGET_API_${mac_autoconf_target_workaround}_CARBON=1 -I\$(top_srcdir)/src/video/quartz"
1794 VIDEO_SUBDIRS="$VIDEO_SUBDIRS quartz"
1795 VIDEO_DRIVERS="$VIDEO_DRIVERS quartz/libvideo_quartz.la"
1796 fi
1797 fi
1798 } 1680 }
1799 1681
1800 dnl Check for the dlfcn.h interface for dynamically loading objects 1682 dnl Check for the dlfcn.h interface for dynamically loading objects
1801 CheckDLOPEN() 1683 CheckDLOPEN()
1802 { 1684 {
1803 AC_ARG_ENABLE(sdl-dlopen, 1685 AC_ARG_ENABLE(sdl-dlopen,
1804 [ --enable-sdl-dlopen use dlopen for shared object loading [default=yes]], 1686 AC_HELP_STRING([--enable-sdl-dlopen], [use dlopen for shared object loading [default=yes]]),
1805 , enable_sdl_dlopen=yes) 1687 , enable_sdl_dlopen=yes)
1806 if test x$enable_sdl_dlopen = xyes; then 1688 if test x$enable_sdl_dlopen = xyes; then
1807 AC_MSG_CHECKING(for dlopen) 1689 AC_MSG_CHECKING(for dlopen)
1808 have_loadso=no 1690 have_dlopen=no
1809 AC_TRY_COMPILE([ 1691 AC_TRY_COMPILE([
1810 #include <dlfcn.h> 1692 #include <dlfcn.h>
1811 ],[ 1693 ],[
1812 ],[ 1694 ],[
1813 have_loadso=yes 1695 have_dlopen=yes
1814 ]) 1696 ])
1815 AC_MSG_RESULT($have_loadso) 1697 AC_MSG_RESULT($have_dlopen)
1816 1698
1817 if test x$have_loadso = xyes; then 1699 if test x$have_dlopen = xyes; then
1818 CFLAGS="$CFLAGS -DUSE_DLOPEN" 1700 AC_CHECK_LIB(c, dlopen, BUILD_LIBS="$BUILD_LIBS",
1819 AC_CHECK_LIB(c, dlopen, SYSTEM_LIBS="$SYSTEM_LIBS", 1701 AC_CHECK_LIB(dl, dlopen, BUILD_LIBS="$BUILD_LIBS -ldl",
1820 AC_CHECK_LIB(dl, dlopen, SYSTEM_LIBS="$SYSTEM_LIBS -ldl", 1702 AC_CHECK_LIB(ltdl, dlopen, BUILD_LIBS="$BUILD_LIBS -lltdl")))
1821 AC_CHECK_LIB(ltdl, dlopen, SYSTEM_LIBS="$SYSTEM_LIBS -lltdl"))) 1703 AC_CHECK_LIB(dl, dlvsym, have_dlvsym=yes)
1704 if test x$have_dlvsym = xyes; then
1705 AC_DEFINE(HAVE_DLVSYM)
1706 fi
1707 AC_DEFINE(SDL_LOADSO_DLOPEN)
1708 SOURCES="$SOURCES $srcdir/src/loadso/dlopen/*.c"
1709 have_loadso=yes
1822 fi 1710 fi
1823 fi 1711 fi
1824 } 1712 }
1825 1713
1826 dnl Set up the Atari LDG (shared object loader) 1714 dnl Set up the Atari LDG (shared object loader)
1827 CheckAtariLdg() 1715 CheckAtariLdg()
1828 { 1716 {
1829 AC_ARG_ENABLE(atari-ldg, 1717 AC_ARG_ENABLE(atari-ldg,
1830 [ --enable-atari-ldg use Atari LDG for shared object loading [default=yes]], 1718 AC_HELP_STRING([--enable-atari-ldg], [use Atari LDG for shared object loading [default=yes]]),
1831 , enable_atari_ldg=yes) 1719 , enable_atari_ldg=yes)
1832 if test x$video_gem = xyes -a x$enable_atari_ldg = xyes; then 1720 if test x$video_gem = xyes -a x$enable_atari_ldg = xyes; then
1833 AC_CHECK_HEADER(ldg.h, have_ldg_hdr=yes) 1721 AC_CHECK_HEADER(ldg.h, have_ldg_hdr=yes)
1834 AC_CHECK_LIB(ldg, ldg_open, have_ldg_lib=yes, have_ldg_lib=no, -lgem) 1722 AC_CHECK_LIB(ldg, ldg_open, have_ldg_lib=yes, have_ldg_lib=no, -lgem)
1835 if test x$have_ldg_hdr = xyes -a x$have_ldg_lib = xyes; then 1723 if test x$have_ldg_hdr = xyes -a x$have_ldg_lib = xyes; then
1724 AC_DEFINE(SDL_LOADSO_LDG)
1725 SOURCES="$SOURCES $srcdir/src/loadso/mint/*.c"
1726 BUILD_LIBS="$BUILD_LIBS -lldg -lgem"
1836 have_loadso=yes 1727 have_loadso=yes
1837 CFLAGS="$CFLAGS -DENABLE_LDG"
1838 SYSTEM_LIBS="$SYSTEM_LIBS -lldg -lgem"
1839 fi 1728 fi
1840 fi 1729 fi
1841 } 1730 }
1842 1731
1843 dnl Check for the usbhid(3) library on *BSD 1732 dnl Check for the usbhid(3) library on *BSD
1844 CheckUSBHID() 1733 CheckUSBHID()
1845 { 1734 {
1846 if test x$enable_joystick = xyes; then 1735 if test x$enable_joystick = xyes; then
1847 have_libusbhid=no 1736 AC_CHECK_HEADER(usb.h, [USB_CFLAGS="-DHAVE_USB_H"])
1848 have_libusb=no 1737 AC_CHECK_HEADER(usbhid.h, [USB_CFLAGS="-DHAVE_USBHID_H"])
1849 AC_CHECK_LIB(usbhid, hid_init, have_libusbhid=yes) 1738 AC_CHECK_HEADER(libusb.h, [USB_CFLAGS="-DHAVE_LIBUSB_H"])
1850 AC_CHECK_LIB(usb, hid_init, have_libusb=yes) 1739 AC_CHECK_HEADER(libusbhid.h, [USB_CFLAGS="-DHAVE_LIBUSBHID_H"])
1851 if test x$have_libusbhid = xyes; then 1740
1852 SYSTEM_LIBS="$SYSTEM_LIBS -lusbhid" 1741 AC_CHECK_LIB(usbhid, hid_init, [USB_LIBS="$USB_LIBS -lusbhid"])
1853 fi 1742 AC_CHECK_LIB(usb, hid_init, [USB_LIBS="$USB_LIBS -lusb"])
1854 if test x$have_libusb = xyes; then 1743
1855 SYSTEM_LIBS="$SYSTEM_LIBS -lusb" 1744 save_CFLAGS="$CFLAGS"
1856 fi 1745 CFLAGS="$CFLAGS $USB_CFLAGS"
1857
1858 AC_CHECK_HEADER(usb.h, have_usb_h=yes)
1859 AC_CHECK_HEADER(usbhid.h, have_usbhid_h=yes)
1860 AC_CHECK_HEADER(libusb.h, have_libusb_h=yes)
1861 AC_CHECK_HEADER(libusbhid.h, have_libusbhid_h=yes)
1862 if test x$have_usb_h = xyes; then
1863 CFLAGS="$CFLAGS -DHAVE_USB_H"
1864 fi
1865 if test x$have_usbhid_h = xyes; then
1866 CFLAGS="$CFLAGS -DHAVE_USBHID_H"
1867 fi
1868 if test x$have_libusb_h = xyes; then
1869 CFLAGS="$CFLAGS -DHAVE_LIBUSB_H"
1870 fi
1871 if test x$have_libusbhid_h = xyes; then
1872 CFLAGS="$CFLAGS -DHAVE_LIBUSBHID_H"
1873 fi
1874 1746
1875 AC_MSG_CHECKING(for usbhid) 1747 AC_MSG_CHECKING(for usbhid)
1876 have_usbhid=no 1748 have_usbhid=no
1877 AC_TRY_COMPILE([ 1749 AC_TRY_COMPILE([
1878 #include <sys/types.h> 1750 #include <sys/types.h>
1919 if (buf.ucr_data) { } 1791 if (buf.ucr_data) { }
1920 ],[ 1792 ],[
1921 have_usbhid_ucr_data=yes 1793 have_usbhid_ucr_data=yes
1922 ]) 1794 ])
1923 if test x$have_usbhid_ucr_data = xyes; then 1795 if test x$have_usbhid_ucr_data = xyes; then
1924 CFLAGS="$CFLAGS -DUSBHID_UCR_DATA" 1796 USB_CFLAGS="$USB_CFLAGS -DUSBHID_UCR_DATA"
1925 fi 1797 fi
1926 AC_MSG_RESULT($have_usbhid_ucr_data) 1798 AC_MSG_RESULT($have_usbhid_ucr_data)
1927 1799
1928 AC_MSG_CHECKING(for new usbhid API) 1800 AC_MSG_CHECKING(for new usbhid API)
1929 have_usbhid_new=no 1801 have_usbhid_new=no
1930 AC_TRY_COMPILE([ 1802 AC_TRY_COMPILE([
1931 #include <sys/types.h> 1803 #include <sys/types.h>
1932 #if defined(HAVE_USB_H) 1804 #if defined(HAVE_USB_H)
1933 #include <usb.h> 1805 #include <usb.h>
1941 #elif defined(HAVE_LIBUSBHID_H) 1813 #elif defined(HAVE_LIBUSBHID_H)
1942 #include <libusbhid.h> 1814 #include <libusbhid.h>
1943 #endif 1815 #endif
1944 ],[ 1816 ],[
1945 report_desc_t d; 1817 report_desc_t d;
1946 hid_start_parse(d, 1, 1); 1818 hid_start_parse(d, 1, 1);
1947 ],[ 1819 ],[
1948 have_usbhid_new=yes 1820 have_usbhid_new=yes
1949 ]) 1821 ])
1950 if test x$have_usbhid_new = xyes; then 1822 if test x$have_usbhid_new = xyes; then
1951 CFLAGS="$CFLAGS -DUSBHID_NEW" 1823 USB_CFLAGS="$USB_CFLAGS -DUSBHID_NEW"
1952 fi 1824 fi
1953 AC_MSG_RESULT($have_usbhid_new) 1825 AC_MSG_RESULT($have_usbhid_new)
1954 1826
1955 JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS bsd" 1827 AC_DEFINE(SDL_JOYSTICK_USBHID)
1956 JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS bsd/libjoystick_bsd.la" 1828 SOURCES="$SOURCES $srcdir/src/joystick/bsd/*.c"
1957 fi 1829 BUILD_CFLAGS="$BUILD_CFLAGS $USB_CFLAGS"
1958 fi 1830 BUILD_LIBS="$BUILD_CFLAGS $USB_LIBS"
1959 } 1831 have_joystick=yes
1960 1832 fi
1961 dnl Check for altivec instruction support using gas syntax 1833 CFLAGS="$save_CFLAGS"
1962 CheckAltivec() 1834 fi
1963 { 1835 }
1964 have_altivec_h_hdr=no 1836
1965 AC_CHECK_HEADER(altivec.h, have_altivec_h_hdr=yes) 1837 dnl Check for clock_gettime()
1966 1838 CheckClockGettime()
1967 save_CFLAGS="${CFLAGS}" 1839 {
1968 have_gcc_altivec=no 1840 AC_ARG_ENABLE(clock_gettime,
1969 AC_MSG_CHECKING(for Altivec with GCC -maltivec option) 1841 AC_HELP_STRING([--enable-clock_gettime], [use clock_gettime() instead of gettimeofday() on UNIX [default=no]]),
1970 CFLAGS="${save_CFLAGS} -DGCC_ALTIVEC -DUSE_ALTIVEC_BLITTERS -maltivec" 1842 , enable_clock_gettime=no)
1971 1843 if test x$enable_clock_gettime = xyes; then
1972 if test x$have_altivec_h_hdr = xyes; then 1844 AC_CHECK_LIB(rt, clock_gettime, have_clock_gettime=yes)
1973 AC_TRY_COMPILE([ 1845 if test x$have_clock_gettime = xyes; then
1974 #include <altivec.h> 1846 AC_DEFINE(HAVE_CLOCK_GETTIME)
1975 vector unsigned int vzero() { 1847 BUILD_LIBS="$BUILD_LIBS -lrt"
1976 return vec_splat_u32(0);
1977 }
1978 ],[
1979 ],[
1980 have_gcc_altivec=yes
1981 ])
1982 AC_MSG_RESULT($have_gcc_altivec)
1983 else
1984 AC_TRY_COMPILE([
1985 vector unsigned int vzero() {
1986 return vec_splat_u32(0);
1987 }
1988 ],[
1989 ],[
1990 have_gcc_altivec=yes
1991 ])
1992 AC_MSG_RESULT($have_gcc_altivec)
1993 fi
1994
1995 if test x$have_gcc_altivec = xno; then
1996 AC_MSG_CHECKING(for Altivec with GCC -faltivec option)
1997 CFLAGS="${save_CFLAGS} -DGCC_ALTIVEC -DUSE_ALTIVEC_BLITTERS -faltivec"
1998 if test x$have_altivec_h_hdr = xyes; then
1999 AC_TRY_COMPILE([
2000 #include <altivec.h>
2001 vector unsigned int vzero() {
2002 return vec_splat_u32(0);
2003 }
2004 ],[
2005 ],[
2006 have_gcc_altivec=yes
2007 ])
2008 AC_MSG_RESULT($have_gcc_altivec)
2009 else
2010 AC_TRY_COMPILE([
2011 vector unsigned int vzero() {
2012 return vec_splat_u32(0);
2013 }
2014 ],[
2015 ],[
2016 have_gcc_altivec=yes
2017 ])
2018 AC_MSG_RESULT($have_gcc_altivec)
2019 fi
2020 fi
2021
2022 if test x$have_gcc_altivec = xno; then
2023 CFLAGS="${save_CFLAGS}"
2024 else
2025 if test x$have_altivec_h_hdr = xyes; then
2026 CFLAGS="${CFLAGS} -DHAVE_ALTIVEC_H"
2027 fi 1848 fi
2028 fi 1849 fi
2029 } 1850 }
2030 1851
2031 dnl Check for a valid linux/version.h 1852 dnl Check for a valid linux/version.h
2032 CheckLinuxVersion() 1853 CheckLinuxVersion()
2033 { 1854 {
2034 AC_CHECK_HEADER(linux/version.h, have_linux_version_h=yes) 1855 AC_CHECK_HEADER(linux/version.h, have_linux_version_h=yes)
2035 if test x$have_linux_version_h = xyes; then 1856 if test x$have_linux_version_h = xyes; then
2036 CFLAGS="$CFLAGS -DHAVE_LINUX_VERSION_H" 1857 BUILD_CFLAGS="$BUILD_CFLAGS -DHAVE_LINUX_VERSION_H"
2037 fi 1858 fi
2038 } 1859 }
2039 1860
2040 dnl Check if we want to use RPATH 1861 dnl Check if we want to use RPATH
2041 CheckRPATH() 1862 CheckRPATH()
2042 { 1863 {
2043 AC_ARG_ENABLE(rpath, 1864 AC_ARG_ENABLE(rpath,
2044 [ --enable-rpath use an rpath when linking SDL [default=yes]], 1865 AC_HELP_STRING([--enable-rpath], [use an rpath when linking SDL [default=yes]]),
2045 , enable_rpath=yes) 1866 , enable_rpath=yes)
2046 } 1867 }
2047 1868
2048 have_loadso=no 1869 dnl Set up the configuration based on the target platform!
2049 case "$target" in 1870 case "$target" in
2050 arm-*-elf*) 1871 arm-*-elf*) # FIXME: Can we get more specific for iPodLinux?
2051 ARCH=linux 1872 ARCH=linux
2052 CheckDummyVideo 1873 CheckDummyVideo
2053 CheckIPod 1874 CheckIPod
2054 # Set up files for the timer library 1875 # Set up files for the timer library
2055 if test x$enable_timers = xyes; then 1876 if test x$enable_timers = xyes; then
2056 COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c) 1877 AC_DEFINE(SDL_TIMER_UNIX)
2057 fi 1878 SOURCES="$SOURCES $srcdir/src/timer/unix/*.c"
2058 ;; 1879 have_timers=yes
2059 *-*-linux*|*-*-gnu*|*-*-k*bsd*-gnu) 1880 fi
1881 ;;
1882 *-*-linux*|*-*-gnu*|*-*-k*bsd*-gnu|*-*-bsdi*|*-*-freebsd*|*-*-netbsd*|*-*-openbsd*|*-*-sysv5*|*-*-solaris*|*-*-hpux*|*-*-irix*|*-*-aix*|*-*-osf*)
2060 case "$target" in 1883 case "$target" in
2061 *-*-linux*) ARCH=linux ;; 1884 *-*-linux*) ARCH=linux ;;
2062 *-*-kfreebsd*-gnu) ARCH=kfreebsd-gnu ;; 1885 *-*-kfreebsd*-gnu) ARCH=kfreebsd-gnu ;;
2063 *-*-knetbsd*-gnu) ARCH=knetbsd-gnu ;; 1886 *-*-knetbsd*-gnu) ARCH=knetbsd-gnu ;;
2064 *-*-kopenbsd*-gnu) ARCH=kopenbsd-gnu ;; 1887 *-*-kopenbsd*-gnu) ARCH=kopenbsd-gnu ;;
2065 *-*-gnu*) ARCH=gnu ;; # must be last 1888 *-*-gnu*) ARCH=gnu ;; # must be last of the gnu variants
1889 *-*-bsdi*) ARCH=bsdi ;;
1890 *-*-freebsd*) ARCH=freebsd ;;
1891 *-*-netbsd*) ARCH=netbsd ;;
1892 *-*-openbsd*) ARCH=openbsd ;;
1893 *-*-sysv5*) ARCH=sysv5 ;;
1894 *-*-solaris*) ARCH=solaris ;;
1895 *-*-hpux*) ARCH=hpux ;;
1896 *-*-irix*) ARCH=irix ;;
1897 *-*-aix*) ARCH=aix ;;
1898 *-*-osf*) ARCH=osf ;;
2066 esac 1899 esac
2067 CheckDummyVideo 1900 CheckDummyVideo
2068 CheckDiskAudio 1901 CheckDiskAudio
2069 CheckDLOPEN 1902 CheckDLOPEN
2070 CheckNASM 1903 CheckNASM
1904 CheckAltivec
2071 CheckOSS 1905 CheckOSS
1906 CheckDMEDIA
2072 CheckALSA 1907 CheckALSA
2073 CheckARTSC 1908 CheckARTSC
2074 CheckESD 1909 CheckESD
2075 CheckNAS 1910 CheckNAS
2076 CheckX11 1911 CheckX11
2078 CheckFBCON 1913 CheckFBCON
2079 CheckDirectFB 1914 CheckDirectFB
2080 CheckPS2GS 1915 CheckPS2GS
2081 CheckGGI 1916 CheckGGI
2082 CheckSVGA 1917 CheckSVGA
1918 CheckVGL
1919 CheckWscons
2083 CheckAAlib 1920 CheckAAlib
2084 CheckQtopia 1921 CheckQtopia
2085 CheckPicoGUI 1922 CheckPicoGUI
2086 CheckOpenGLX11 1923 CheckOpenGLX11
2087 CheckInputEvents 1924 CheckInputEvents
2088 CheckTslib 1925 CheckTslib
1926 CheckUSBHID
2089 CheckPTHREAD 1927 CheckPTHREAD
2090 CheckSIGACTION 1928 CheckClockGettime
2091 CheckAltivec
2092 CheckLinuxVersion 1929 CheckLinuxVersion
2093 CheckRPATH
2094
2095 # Set up files for the main() stub
2096 if test "x$video_qtopia" = "xyes"; then
2097 SDL_CFLAGS="$SDL_CFLAGS -Dmain=SDL_main"
2098 SDL_LIBS="-lSDLmain $SDL_LIBS"
2099 fi
2100 # Set up files for the audio library
2101 # We use the OSS and ALSA API's, not the Sun audio API
2102 #if test x$enable_audio = xyes; then
2103 # CFLAGS="$CFLAGS -DSUNAUDIO_SUPPORT"
2104 # AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun"
2105 # AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la"
2106 #fi
2107 # Set up files for the joystick library
2108 if test x$enable_joystick = xyes; then
2109 case $ARCH in
2110 linux)
2111 JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS linux"
2112 JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS linux/libjoystick_linux.la"
2113 ;;
2114 gnu)
2115 JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS dummy"
2116 JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS dummy/libjoystick_dummy.la"
2117 ;;
2118 k*bsd-gnu)
2119 JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS bsd"
2120 JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS bsd/libjoystick_bsd.la"
2121 ;;
2122 esac
2123 fi
2124 # Set up files for the cdrom library
2125 if test x$enable_cdrom = xyes; then
2126 case $ARCH in
2127 linux)
2128 CDROM_SUBDIRS="$CDROM_SUBDIRS linux"
2129 CDROM_DRIVERS="$CDROM_DRIVERS linux/libcdrom_linux.la"
2130 ;;
2131 gnu)
2132 CDROM_SUBDIRS="$CDROM_SUBDIRS dummy"
2133 CDROM_DRIVERS="$CDROM_DRIVERS dummy/libcdrom_dummy.la"
2134 ;;
2135 kfreebsd-gnu)
2136 CDROM_SUBDIRS="$CDROM_SUBDIRS freebsd"
2137 CDROM_DRIVERS="$CDROM_DRIVERS freebsd/libcdrom_freebsd.la"
2138 ;;
2139 knetbsd-gnu|kopenbsd-gnu)
2140 CDROM_SUBDIRS="$CDROM_SUBDIRS openbsd"
2141 CDROM_DRIVERS="$CDROM_DRIVERS openbsd/libcdrom_openbsd.la"
2142 ;;
2143 esac
2144 fi
2145 # Set up files for the thread library
2146 if test x$enable_threads = xyes; then
2147 CopyUnixThreadSource
2148 fi
2149 # Set up files for the timer library
2150 if test x$enable_timers = xyes; then
2151 COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
2152 fi
2153 ;;
2154 *-*-bsdi*)
2155 ARCH=bsdi
2156 CheckDummyVideo
2157 CheckDiskAudio
2158 CheckDLOPEN
2159 CheckNASM
2160 CheckOSS
2161 CheckARTSC
2162 CheckESD
2163 CheckNAS
2164 CheckX11
2165 CheckSVGA
2166 CheckAAlib
2167 CheckOpenGLX11
2168 CheckPTHREAD
2169 CheckSIGACTION
2170 CheckRPATH
2171 # Set up files for the audio library
2172 # We use the OSS and ALSA API's, not the Sun audio API
2173 #if test x$enable_audio = xyes; then
2174 # CFLAGS="$CFLAGS -DSUNAUDIO_SUPPORT"
2175 # AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun"
2176 # AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la"
2177 #fi
2178 # Set up files for the joystick library
2179 # (No joystick support yet)
2180 if test x$enable_joystick = xyes; then
2181 JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS dummy"
2182 JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS dummy/libjoystick_dummy.la"
2183 fi
2184 # Set up files for the cdrom library
2185 if test x$enable_cdrom = xyes; then
2186 CDROM_SUBDIRS="$CDROM_SUBDIRS bsdi"
2187 CDROM_DRIVERS="$CDROM_DRIVERS bsdi/libcdrom_bsdi.la"
2188 fi
2189 # Set up files for the thread library
2190 if test x$enable_threads = xyes; then
2191 CopyUnixThreadSource
2192 fi
2193 # Set up files for the timer library
2194 if test x$enable_timers = xyes; then
2195 COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
2196 fi
2197 ;;
2198 *-*-freebsd*)
2199 ARCH=freebsd
2200 CheckDummyVideo
2201 CheckDiskAudio
2202 CheckDLOPEN
2203 CheckVGL
2204 CheckNASM
2205 CheckOSS
2206 CheckARTSC
2207 CheckESD
2208 CheckNAS
2209 CheckX11
2210 CheckSVGA
2211 CheckAAlib
2212 CheckOpenGLX11
2213 CheckPTHREAD
2214 CheckSIGACTION
2215 CheckUSBHID
2216 CheckRPATH
2217 # Set up files for the audio library
2218 # We use the OSS and ALSA API's, not the Sun audio API
2219 #if test x$enable_audio = xyes; then
2220 # CFLAGS="$CFLAGS -DSUNAUDIO_SUPPORT"
2221 # AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun"
2222 # AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la"
2223 #fi
2224 # Set up files for the cdrom library
2225 if test x$enable_cdrom = xyes; then
2226 CDROM_SUBDIRS="$CDROM_SUBDIRS freebsd"
2227 CDROM_DRIVERS="$CDROM_DRIVERS freebsd/libcdrom_freebsd.la"
2228 fi
2229 # Set up files for the thread library
2230 if test x$enable_threads = xyes; then
2231 CopyUnixThreadSource
2232 fi
2233 # Set up files for the timer library
2234 if test x$enable_timers = xyes; then
2235 COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
2236 fi
2237 ;;
2238 *-*-netbsd*)
2239 ARCH=netbsd
2240 CheckDummyVideo
2241 CheckDiskAudio
2242 CheckDLOPEN
2243 CheckNASM
2244 CheckOSS
2245 CheckARTSC
2246 CheckESD
2247 CheckNAS
2248 CheckX11
2249 CheckAAlib
2250 CheckWscons
2251 CheckOpenGLX11
2252 CheckPTHREAD
2253 CheckSIGACTION
2254 CheckUSBHID
2255 CheckRPATH 1930 CheckRPATH
2256 # Set up files for the audio library 1931 # Set up files for the audio library
2257 if test x$enable_audio = xyes; then 1932 if test x$enable_audio = xyes; then
2258 CFLAGS="$CFLAGS -DSUNAUDIO_SUPPORT" 1933 case $ARCH in
2259 AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun" 1934 netbsd|sysv5|solaris|hpux)
2260 AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la" 1935 AC_DEFINE(SDL_AUDIO_DRIVER_SUNAUDIO)
1936 SOURCES="$SOURCES $srcdir/src/audio/sun/*.c"
1937 have_audio=yes
1938 ;;
1939 openbsd)
1940 AC_DEFINE(SDL_AUDIO_DRIVER_OPENBSD)
1941 SOURCES="$SOURCES $srcdir/src/audio/openbsd/*.c"
1942 have_audio=yes
1943 ;;
1944 aix)
1945 AC_DEFINE(SDL_AUDIO_DRIVER_PAUD)
1946 SOURCES="$SOURCES $srcdir/src/audio/paudio/*.c"
1947 have_audio=yes
1948 ;;
1949 osf)
1950 AC_DEFINE(SDL_AUDIO_DRIVER_MMEAUDIO)
1951 SOURCES="$SOURCES $srcdir/src/audio/mme/*.c"
1952 BUILD_LIBS="$BUILD_LIBS -lmme"
1953 have_audio=yes
1954 ;;
1955 esac
1956 fi
1957 # Set up files for the joystick library
1958 if test x$enable_joystick = xyes; then
1959 case $ARCH in
1960 linux)
1961 AC_DEFINE(SDL_JOYSTICK_LINUX)
1962 SOURCES="$SOURCES $srcdir/src/joystick/linux/*.c"
1963 have_joystick=yes
1964 ;;
1965 esac
2261 fi 1966 fi
2262 # Set up files for the cdrom library 1967 # Set up files for the cdrom library
2263 if test x$enable_cdrom = xyes; then 1968 if test x$enable_cdrom = xyes; then
2264 CDROM_SUBDIRS="$CDROM_SUBDIRS openbsd" 1969 case $ARCH in
2265 CDROM_DRIVERS="$CDROM_DRIVERS openbsd/libcdrom_openbsd.la" 1970 linux|solaris)
1971 AC_DEFINE(SDL_CDROM_LINUX)
1972 SOURCES="$SOURCES $srcdir/src/cdrom/linux/*.c"
1973 have_cdrom=yes
1974 ;;
1975 *freebsd*)
1976 AC_DEFINE(SDL_CDROM_FREEBSD)
1977 SOURCES="$SOURCES $srcdir/src/cdrom/freebsd/*.c"
1978 have_cdrom=yes
1979 ;;
1980 *netbsd*|*openbsd*)
1981 AC_DEFINE(SDL_CDROM_OPENBSD)
1982 SOURCES="$SOURCES $srcdir/src/cdrom/openbsd/*.c"
1983 have_cdrom=yes
1984 ;;
1985 bsdi)
1986 AC_DEFINE(SDL_CDROM_BSDI)
1987 SOURCES="$SOURCES $srcdir/src/cdrom/bsdi/*.c"
1988 have_cdrom=yes
1989 ;;
1990 aix)
1991 AC_DEFINE(SDL_CDROM_AIX)
1992 SOURCES="$SOURCES $srcdir/src/cdrom/aix/*.c"
1993 have_cdrom=yes
1994 ;;
1995 osf)
1996 AC_DEFINE(SDL_CDROM_OSF)
1997 SOURCES="$SOURCES $srcdir/src/cdrom/osf/*.c"
1998 have_cdrom=yes
1999 ;;
2000 esac
2266 fi 2001 fi
2267 # Set up files for the thread library 2002 # Set up files for the thread library
2268 if test x$enable_threads = xyes; then 2003 if test x$enable_threads = xyes -a x$use_pthreads != xyes -a x$use_pth != xyes -a x$ARCH = xirix; then
2269 if test x$use_pthreads = xyes; then 2004 AC_DEFINE(SDL_THREAD_SPROC)
2270 CFLAGS="$CFLAGS -D_POSIX_THREAD_SYSCALL_SOFT=1" 2005 SOURCES="$SOURCES $srcdir/src/thread/irix/*.c"
2271 fi 2006 SOURCES="$SOURCES $srcdir/src/thread/generic/SDL_sysmutex.c"
2272 CopyUnixThreadSource 2007 SOURCES="$SOURCES $srcdir/src/thread/generic/SDL_syscond.c"
2008 have_threads=yes
2273 fi 2009 fi
2274 # Set up files for the timer library 2010 # Set up files for the timer library
2275 if test x$enable_timers = xyes; then 2011 if test x$enable_timers = xyes; then
2276 COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c) 2012 AC_DEFINE(SDL_TIMER_UNIX)
2277 fi 2013 SOURCES="$SOURCES $srcdir/src/timer/unix/*.c"
2278 # NetBSD does not define "unix" 2014 have_timers=yes
2279 CFLAGS="$CFLAGS -Dunix" 2015 fi
2280 ;; 2016 # Do any final platform setup
2281 *-*-openbsd*) 2017 case $ARCH in
2282 ARCH=openbsd 2018 netbsd)
2283 CheckDummyVideo 2019 # NetBSD does not define "unix"
2284 CheckDiskAudio 2020 BUILD_CFLAGS="$BUILD_CFLAGS -Dunix"
2285 CheckDLOPEN 2021 ;;
2286 CheckNASM 2022 openbsd)
2287 CheckOSS 2023 # OpenBSD does not define "unix"
2288 CheckARTSC 2024 BUILD_CFLAGS="$BUILD_CFLAGS -Dunix"
2289 CheckESD 2025 ;;
2290 CheckNAS 2026 esac
2291 CheckX11
2292 CheckAAlib
2293 CheckOpenGLX11
2294 CheckPTHREAD
2295 CheckSIGACTION
2296 CheckUSBHID
2297 CheckRPATH
2298 # Set up files for the audio library
2299 if test x$enable_audio = xyes; then
2300 CFLAGS="$CFLAGS -DOPENBSD_AUDIO_SUPPORT"
2301 AUDIO_SUBDIRS="$AUDIO_SUBDIRS openbsd"
2302 AUDIO_DRIVERS="$AUDIO_DRIVERS openbsd/libaudio_openbsd.la"
2303 fi
2304 # OpenBSD needs linking with ossaudio emulation library
2305 if test x$have_oss = xyes; then
2306 SYSTEM_LIBS="$SYSTEM_LIBS -lossaudio"
2307 fi
2308 # Set up files for the cdrom library
2309 if test x$enable_cdrom = xyes; then
2310 CDROM_SUBDIRS="$CDROM_SUBDIRS openbsd"
2311 CDROM_DRIVERS="$CDROM_DRIVERS openbsd/libcdrom_openbsd.la"
2312 fi
2313 # Set up files for the thread library
2314 if test x$enable_threads = xyes; then
2315 CopyUnixThreadSource
2316 fi
2317 # Set up files for the timer library
2318 if test x$enable_timers = xyes; then
2319 COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
2320 fi
2321 # OpenBSD does not define "unix"
2322 CFLAGS="$CFLAGS -Dunix"
2323 ;;
2324 *-*-sysv5*)
2325 ARCH=sysv5
2326 CheckDummyVideo
2327 CheckDiskAudio
2328 CheckDLOPEN
2329 CheckNASM
2330 CheckOSS
2331 CheckARTSC
2332 CheckESD
2333 CheckNAS
2334 CheckX11
2335 CheckAAlib
2336 CheckOpenGLX11
2337 CheckPTHREAD
2338 CheckSIGACTION
2339 CheckRPATH
2340 # Set up files for the audio library
2341 if test x$enable_audio = xyes; then
2342 CFLAGS="$CFLAGS -DSUNAUDIO_SUPPORT"
2343 AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun"
2344 AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la"
2345 fi
2346 # Set up files for the joystick library
2347 # (No joystick support yet)
2348 if test x$enable_joystick = xyes; then
2349 JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS dummy"
2350 JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS dummy/libjoystick_dummy.la"
2351 fi
2352 # Set up files for the cdrom library
2353 if test x$enable_cdrom = xyes; then
2354 CDROM_SUBDIRS="$CDROM_SUBDIRS dummy"
2355 CDROM_DRIVERS="$CDROM_DRIVERS dummy/libcdrom_dummy.la"
2356 fi
2357 # Set up files for the thread library
2358 if test x$enable_threads = xyes; then
2359 CopyUnixThreadSource
2360 fi
2361 # Set up files for the timer library
2362 if test x$enable_timers = xyes; then
2363 COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
2364 fi
2365 ;;
2366 *-*-solaris*)
2367 ARCH=solaris
2368 CFLAGS="$CFLAGS -D__ELF__" # Fix for nasm on Solaris x86
2369 CheckDummyVideo
2370 CheckDiskAudio
2371 CheckDLOPEN
2372 CheckNASM
2373 CheckOSS
2374 CheckARTSC
2375 CheckESD
2376 CheckNAS
2377 CheckX11
2378 CheckAAlib
2379 CheckOpenGLX11
2380 CheckPTHREAD
2381 CheckSIGACTION
2382 CheckRPATH
2383 # Set up files for the audio library
2384 if test x$enable_audio = xyes; then
2385 CFLAGS="$CFLAGS -DSUNAUDIO_SUPPORT"
2386 AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun"
2387 AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la"
2388 fi
2389 # Set up files for the joystick library
2390 # (No joystick support yet)
2391 if test x$enable_joystick = xyes; then
2392 JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS dummy"
2393 JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS dummy/libjoystick_dummy.la"
2394 fi
2395 # Set up files for the cdrom library
2396 if test x$enable_cdrom = xyes; then
2397 CDROM_SUBDIRS="$CDROM_SUBDIRS linux"
2398 CDROM_DRIVERS="$CDROM_DRIVERS linux/libcdrom_linux.la"
2399 fi
2400 # Set up files for the thread library
2401 if test x$enable_threads = xyes; then
2402 CopyUnixThreadSource
2403 fi
2404 # Set up files for the timer library
2405 if test x$enable_timers = xyes; then
2406 COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
2407 fi
2408 ;;
2409 *-*-irix*)
2410 ARCH=irix
2411 CheckDummyVideo
2412 CheckDiskAudio
2413 CheckDLOPEN
2414 CheckDMEDIA
2415 CheckESD
2416 CheckNAS
2417 CheckX11
2418 CheckAAlib
2419 CheckOpenGLX11
2420 CheckPTHREAD
2421 CheckSIGACTION
2422 # We use the dmedia audio API, not the Sun audio API
2423 #if test x$enable_audio = xyes; then
2424 # CFLAGS="$CFLAGS -DSUNAUDIO_SUPPORT"
2425 # AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun"
2426 # AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la"
2427 #fi
2428 # Set up files for the joystick library
2429 # (No joystick support yet)
2430 if test x$enable_joystick = xyes; then
2431 JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS dummy"
2432 JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS dummy/libjoystick_dummy.la"
2433 fi
2434 # Set up files for the cdrom library
2435 # (No CD-ROM support yet)
2436 if test x$enable_cdrom = xyes; then
2437 CDROM_SUBDIRS="$CDROM_SUBDIRS dummy"
2438 CDROM_DRIVERS="$CDROM_DRIVERS dummy/libcdrom_dummy.la"
2439 fi
2440 # Set up files for the thread library
2441 if test x$enable_threads = xyes; then
2442 if test x$use_pthreads = xyes -o x$use_pth = xyes; then
2443 CopyUnixThreadSource
2444 else
2445 COPY_ARCH_SRC(src/thread, irix, SDL_systhread.c)
2446 COPY_ARCH_SRC(src/thread, irix, SDL_systhread_c.h)
2447 COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex.c)
2448 COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex_c.h)
2449 COPY_ARCH_SRC(src/thread, linux, SDL_syssem.c)
2450 COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
2451 COPY_ARCH_SRC(src/thread, generic, SDL_syscond.c)
2452 COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
2453 fi
2454 fi
2455 # Set up files for the timer library
2456 if test x$enable_timers = xyes; then
2457 COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
2458 fi
2459 ;;
2460 *-*-hpux*)
2461 ARCH=hpux
2462 CheckDummyVideo
2463 CheckDiskAudio
2464 CheckDLOPEN
2465 CheckOSS
2466 CheckNAS
2467 CheckX11
2468 CheckGGI
2469 CheckAAlib
2470 CheckOpenGLX11
2471 CheckPTHREAD
2472 CheckSIGACTION
2473 # Set up files for the audio library
2474 if test x$enable_audio = xyes; then
2475 CFLAGS="$CFLAGS -DSUNAUDIO_SUPPORT"
2476 AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun"
2477 AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la"
2478 fi
2479 # Set up files for the joystick library
2480 # (No joystick support yet)
2481 if test x$enable_joystick = xyes; then
2482 JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS dummy"
2483 JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS dummy/libjoystick_dummy.la"
2484 fi
2485 # Set up files for the cdrom library
2486 # (No CD-ROM support yet)
2487 if test x$enable_cdrom = xyes; then
2488 CDROM_SUBDIRS="$CDROM_SUBDIRS dummy"
2489 CDROM_DRIVERS="$CDROM_DRIVERS dummy/libcdrom_dummy.la"
2490 fi
2491 # Set up files for the thread library
2492 if test x$enable_threads = xyes; then
2493 CopyUnixThreadSource
2494 fi
2495 # Set up files for the timer library
2496 if test x$enable_timers = xyes; then
2497 COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
2498 fi
2499 ;;
2500 *-*-aix*)
2501 ARCH=aix
2502 CheckDummyVideo
2503 CheckDiskAudio
2504 CheckDLOPEN
2505 CheckOSS
2506 CheckNAS
2507 CheckX11
2508 CheckGGI
2509 CheckAAlib
2510 CheckOpenGLX11
2511 CheckPTHREAD
2512 CheckSIGACTION
2513 # Set up files for the audio library
2514 if test x$enable_audio = xyes; then
2515 AUDIO_SUBDIRS="$AUDIO_SUBDIRS paudio"
2516 AUDIO_DRIVERS="$AUDIO_DRIVERS paudio/libaudio_paudio.la"
2517 fi
2518 # Set up files for the joystick library
2519 # (No joystick support yet)
2520 if test x$enable_joystick = xyes; then
2521 JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS dummy"
2522 JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS dummy/libjoystick_dummy.la"
2523 fi
2524 # Set up files for the cdrom library
2525 if test x$enable_cdrom = xyes; then
2526 CDROM_SUBDIRS="$CDROM_SUBDIRS aix"
2527 CDROM_DRIVERS="$CDROM_DRIVERS aix/libcdrom_aix.la"
2528 fi
2529 # Set up files for the thread library
2530 if test x$enable_threads = xyes; then
2531 CopyUnixThreadSource
2532 fi
2533 # Set up files for the timer library
2534 if test x$enable_timers = xyes; then
2535 COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
2536 fi
2537 ;;
2538 *-*-osf*)
2539 ARCH=osf
2540 CheckDummyVideo
2541 CheckDiskAudio
2542 CheckDLOPEN
2543 CheckNAS
2544 CheckX11
2545 CheckGGI
2546 CheckAAlib
2547 CheckOpenGLX11
2548 CheckPTHREAD
2549 CheckSIGACTION
2550 # Set up files for the audio library
2551 if test x$enable_audio = xyes; then
2552 CFLAGS="$CFLAGS -I/usr/include/mme -DMMEAUDIO_SUPPORT"
2553 SYSTEM_LIBS="$SYSTEM_LIBS -lmme"
2554 AUDIO_SUBDIRS="$AUDIO_SUBDIRS mme"
2555 AUDIO_DRIVERS="$AUDIO_DRIVERS mme/libaudio_mme.la"
2556 fi
2557 # Set up files for the joystick library
2558 # (No joystick support yet)
2559 if test x$enable_joystick = xyes; then
2560 JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS dummy"
2561 JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS dummy/libjoystick_dummy.la"
2562 fi
2563 # Set up files for the cdrom library
2564 # (No cdrom support yet)
2565 if test x$enable_cdrom = xyes; then
2566 CDROM_SUBDIRS="$CDROM_SUBDIRS osf"
2567 CDROM_DRIVERS="$CDROM_DRIVERS osf/libcdrom_osf.la"
2568 fi
2569 # Set up files for the thread library
2570 if test x$enable_threads = xyes; then
2571 CopyUnixThreadSource
2572 fi
2573 # Set up files for the timer library
2574 if test x$enable_timers = xyes; then
2575 COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
2576 fi
2577 # FIXME: If building without -lX11, you get the following messages.
2578 # Xlib: connection to ":0.0" refused by server
2579 # Xlib: XDM authorization key matches an existing client!
2580 # It only has to run xhost +localhost in a such case.
2581 #if test x$enable_x11_shared = xyes; then
2582 # SYSTEM_LIBS="$SYSTEM_LIBS -lX11"
2583 #fi
2584 ;; 2027 ;;
2585 *-*-qnx*) 2028 *-*-qnx*)
2586 ARCH=qnx 2029 ARCH=qnx
2587 CheckDummyVideo 2030 CheckDummyVideo
2588 CheckDiskAudio 2031 CheckDiskAudio
2591 CheckNAS 2034 CheckNAS
2592 CheckPHOTON 2035 CheckPHOTON
2593 CheckX11 2036 CheckX11
2594 CheckOpenGLX11 2037 CheckOpenGLX11
2595 CheckPTHREAD 2038 CheckPTHREAD
2596 CheckSIGACTION
2597 # Set up files for the audio library 2039 # Set up files for the audio library
2598 if test x$enable_audio = xyes; then 2040 if test x$enable_audio = xyes; then
2599 CFLAGS="$CFLAGS -DQNXNTOAUDIO_SUPPORT" 2041 AC_DEFINE(SDL_AUDIO_DRIVER_QNXNTO)
2600 SYSTEM_LIBS="$SYSTEM_LIBS -lasound" 2042 SOURCES="$SOURCES $srcdir/src/audio/nto/*.c"
2601 AUDIO_SUBDIRS="$AUDIO_SUBDIRS nto" 2043 BUILD_LIBS="$BUILD_LIBS -lasound"
2602 AUDIO_DRIVERS="$AUDIO_DRIVERS nto/libaudio_nto.la" 2044 have_audio=yes
2603 fi
2604 # Set up files for the joystick library
2605 if test x$enable_joystick = xyes; then
2606 # (No joystick support yet)
2607 JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS dummy"
2608 JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS dummy/libjoystick_dummy.la"
2609 fi 2045 fi
2610 # Set up files for the cdrom library 2046 # Set up files for the cdrom library
2611 if test x$enable_cdrom = xyes; then 2047 if test x$enable_cdrom = xyes; then
2612 CDROM_SUBDIRS="$CDROM_SUBDIRS qnx" 2048 AC_DEFINE(SDL_CDROM_QNX)
2613 CDROM_DRIVERS="$CDROM_DRIVERS qnx/libcdrom_qnx.la" 2049 SOURCES="$SOURCES $srcdir/src/cdrom/qnx/*.c"
2614 fi 2050 have_cdrom=yes
2615 # Set up files for the thread library
2616 if test x$enable_threads = xyes; then
2617 CopyUnixThreadSource
2618 fi 2051 fi
2619 # Set up files for the timer library 2052 # Set up files for the timer library
2620 if test x$enable_timers = xyes; then 2053 if test x$enable_timers = xyes; then
2621 COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c) 2054 AC_DEFINE(SDL_TIMER_UNIX)
2055 SOURCES="$SOURCES $srcdir/src/timer/unix/*.c"
2056 have_timers=yes
2622 fi 2057 fi
2623 ;; 2058 ;;
2624 *-*-cygwin* | *-*-mingw32*) 2059 *-*-cygwin* | *-*-mingw32*)
2625 ARCH=win32 2060 ARCH=win32
2626 have_loadso=yes
2627 if test "$build" != "$target"; then # cross-compiling 2061 if test "$build" != "$target"; then # cross-compiling
2628 # Default cross-compile location 2062 # Default cross-compile location
2629 ac_default_prefix=/usr/local/cross-tools/i386-mingw32msvc 2063 ac_default_prefix=/usr/local/cross-tools/i386-mingw32msvc
2630 else 2064 else
2631 # Look for the location of the tools and install there 2065 # Look for the location of the tools and install there
2634 fi 2068 fi
2635 fi 2069 fi
2636 CheckDummyVideo 2070 CheckDummyVideo
2637 CheckDiskAudio 2071 CheckDiskAudio
2638 CheckWIN32 2072 CheckWIN32
2073 CheckWIN32GL
2639 CheckDIRECTX 2074 CheckDIRECTX
2640 CheckNASM 2075 CheckNASM
2641 # Set up files for the audio library 2076 # Set up files for the audio library
2642 if test x$enable_audio = xyes; then 2077 if test x$enable_audio = xyes; then
2643 AUDIO_SUBDIRS="$AUDIO_SUBDIRS windib" 2078 AC_DEFINE(SDL_AUDIO_DRIVER_WAVEOUT)
2644 AUDIO_DRIVERS="$AUDIO_DRIVERS windib/libaudio_windib.la" 2079 SOURCES="$SOURCES $srcdir/src/audio/windib/*.c"
2645 if test x$use_directx = xyes; then 2080 if test x$have_directx = xyes; then
2646 AUDIO_SUBDIRS="$AUDIO_SUBDIRS windx5" 2081 AC_DEFINE(SDL_AUDIO_DRIVER_DSOUND)
2647 AUDIO_DRIVERS="$AUDIO_DRIVERS windx5/libaudio_windx5.la" 2082 SOURCES="$SOURCES $srcdir/src/audio/windx5/*.c"
2648 fi 2083 fi
2084 have_audio=yes
2649 fi 2085 fi
2650 # Set up files for the joystick library 2086 # Set up files for the joystick library
2651 if test x$enable_joystick = xyes; then 2087 if test x$enable_joystick = xyes; then
2652 JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS win32" 2088 AC_DEFINE(SDL_JOYSTICK_WINMM)
2653 JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS win32/libjoystick_winmm.la" 2089 SOURCES="$SOURCES $srcdir/src/joystick/win32/*.c"
2090 have_joystick=yes
2654 fi 2091 fi
2655 # Set up files for the cdrom library 2092 # Set up files for the cdrom library
2656 if test x$enable_cdrom = xyes; then 2093 if test x$enable_cdrom = xyes; then
2657 CDROM_SUBDIRS="$CDROM_SUBDIRS win32" 2094 AC_DEFINE(SDL_CDROM_WIN32)
2658 CDROM_DRIVERS="$CDROM_DRIVERS win32/libcdrom_win32.la" 2095 SOURCES="$SOURCES $srcdir/src/cdrom/win32/*.c"
2096 have_cdrom=yes
2659 fi 2097 fi
2660 # Set up files for the thread library 2098 # Set up files for the thread library
2661 if test x$enable_threads = xyes; then 2099 if test x$enable_threads = xyes; then
2662 COPY_ARCH_SRC(src/thread, win32, SDL_systhread.c) 2100 AC_DEFINE(SDL_THREAD_WIN32)
2663 COPY_ARCH_SRC(src/thread, win32, SDL_systhread_c.h) 2101 SOURCES="$SOURCES $srcdir/src/thread/win32/SDL_sysmutex.c"
2664 COPY_ARCH_SRC(src/thread, win32, SDL_sysmutex.c) 2102 SOURCES="$SOURCES $srcdir/src/thread/win32/SDL_syssem.c"
2665 COPY_ARCH_SRC(src/thread, generic, SDL_sysmutex_c.h) 2103 SOURCES="$SOURCES $srcdir/src/thread/win32/SDL_systhread.c"
2666 COPY_ARCH_SRC(src/thread, win32, SDL_syssem.c) 2104 SOURCES="$SOURCES $srcdir/src/thread/generic/SDL_syscond.c"
2667 COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h) 2105 have_threads=yes
2668 COPY_ARCH_SRC(src/thread, generic, SDL_syscond.c)
2669 COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
2670 fi 2106 fi
2671 # Set up files for the timer library 2107 # Set up files for the timer library
2672 if test x$enable_timers = xyes; then 2108 if test x$enable_timers = xyes; then
2673 COPY_ARCH_SRC(src/timer, win32, SDL_systimer.c) 2109 AC_DEFINE(SDL_TIMER_WIN32)
2110 SOURCES="$SOURCES $srcdir/src/timer/win32/*.c"
2111 have_timers=yes
2112 fi
2113 # Set up files for the shared object loading library
2114 if test x$enable_loadso = xyes; then
2115 AC_DEFINE(SDL_LOADSO_WIN32)
2116 SOURCES="$SOURCES $srcdir/src/loadso/win32/*.c"
2117 have_loadso=yes
2118 fi
2119 # Set up the system libraries we need
2120 BUILD_LIBS="$BUILD_LIBS -luser32 -lgdi32 -lwinmm"
2121 if test x$have_directx = xyes; then
2122 BUILD_LIBS="$BUILD_LIBS -ldxguid"
2674 fi 2123 fi
2675 # The Win32 platform requires special setup 2124 # The Win32 platform requires special setup
2676 SDL_CFLAGS="$SDL_CFLAGS -Dmain=SDL_main" 2125 SDL_CFLAGS="$SDL_CFLAGS -Dmain=SDL_main"
2677 case "$target" in 2126 case "$target" in
2678 *-*-cygwin*) 2127 *-*-cygwin*)
2679 CFLAGS="$CFLAGS -I/usr/include/mingw -DWIN32 -Uunix -mno-cygwin" 2128 BUILD_CFLAGS="$BUILD_CFLAGS -I/usr/include/mingw -DWIN32 -Uunix -mno-cygwin"
2680 SDL_CFLAGS="$SDL_CFLAGS -I/usr/include/mingw -DWIN32 -Uunix -mno-cygwin" 2129 SDL_CFLAGS="$SDL_CFLAGS -I/usr/include/mingw -DWIN32 -Uunix -mno-cygwin"
2681 LIBS="$LIBS -mno-cygwin" 2130 BUILD_LIBS="$BUILD_LIBS -mno-cygwin"
2682 SDL_LIBS="-lmingw32 -lSDLmain $SDL_LIBS -mwindows -mno-cygwin" 2131 SDL_LIBS="-lmingw32 -lSDLmain $SDL_LIBS -mwindows -mno-cygwin"
2683 ;; 2132 ;;
2684 *-*-mingw32*) 2133 *-*-mingw32*)
2685 SDL_LIBS="-lmingw32 -lSDLmain $SDL_LIBS -mwindows" 2134 SDL_LIBS="-lmingw32 -lSDLmain $SDL_LIBS -mwindows"
2686 ;; 2135 ;;
2687 esac 2136 esac
2688 ;; 2137 ;;
2689 *-*-beos*) 2138 *-*-beos*)
2690 ARCH=beos 2139 ARCH=beos
2691 ac_default_prefix=/boot/develop/tools/gnupro 2140 ac_default_prefix=/boot/develop/tools/gnupro
2692 have_loadso=yes
2693 CheckDummyVideo 2141 CheckDummyVideo
2694 CheckDiskAudio 2142 CheckDiskAudio
2695 CheckNASM 2143 CheckNASM
2696 CheckBWINDOW 2144 CheckBWINDOW
2697 CheckBeGL 2145 CheckBeGL
2698 # Set up files for the audio library 2146 # Set up files for the audio library
2699 if test x$enable_audio = xyes; then 2147 if test x$enable_audio = xyes; then
2700 AUDIO_SUBDIRS="$AUDIO_SUBDIRS baudio" 2148 AC_DEFINE(SDL_AUDIO_DRIVER_BAUDIO)
2701 AUDIO_DRIVERS="$AUDIO_DRIVERS baudio/libaudio_baudio.la" 2149 SOURCES="$SOURCES $srcdir/src/audio/baudio/*.cc"
2150 have_audio=yes
2702 fi 2151 fi
2703 # Set up files for the joystick library 2152 # Set up files for the joystick library
2704 if test x$enable_joystick = xyes; then 2153 if test x$enable_joystick = xyes; then
2705 JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS beos" 2154 AC_DEFINE(SDL_JOYSTICK_BEOS)
2706 JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS beos/libjoystick_beos.la" 2155 SOURCES="$SOURCES $srcdir/src/joystick/beos/*.cc"
2156 have_joystick=yes
2707 fi 2157 fi
2708 # Set up files for the cdrom library 2158 # Set up files for the cdrom library
2709 if test x$enable_cdrom = xyes; then 2159 if test x$enable_cdrom = xyes; then
2710 CDROM_SUBDIRS="$CDROM_SUBDIRS beos" 2160 AC_DEFINE(SDL_CDROM_BEOS)
2711 CDROM_DRIVERS="$CDROM_DRIVERS beos/libcdrom_beos.la" 2161 SOURCES="$SOURCES $srcdir/src/cdrom/beos/*.cc"
2162 have_cdrom=yes
2712 fi 2163 fi
2713 # Set up files for the thread library 2164 # Set up files for the thread library
2714 if test x$enable_threads = xyes; then 2165 if test x$enable_threads = xyes; then
2715 COPY_ARCH_SRC(src/thread, beos, SDL_systhread.c) 2166 AC_DEFINE(SDL_THREAD_BEOS)
2716 COPY_ARCH_SRC(src/thread, beos, SDL_systhread_c.h) 2167 SOURCES="$SOURCES $srcdir/src/thread/beos/*.c"
2717 COPY_ARCH_SRC(src/thread, generic, SDL_sysmutex.c) 2168 SOURCES="$SOURCES $srcdir/src/thread/generic/SDL_sysmutex.c"
2718 COPY_ARCH_SRC(src/thread, generic, SDL_sysmutex_c.h) 2169 SOURCES="$SOURCES $srcdir/src/thread/generic/SDL_syscond.c"
2719 COPY_ARCH_SRC(src/thread, beos, SDL_syssem.c) 2170 have_threads=yes
2720 COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
2721 COPY_ARCH_SRC(src/thread, generic, SDL_syscond.c)
2722 COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
2723 fi 2171 fi
2724 # Set up files for the timer library 2172 # Set up files for the timer library
2725 if test x$enable_timers = xyes; then 2173 if test x$enable_timers = xyes; then
2726 COPY_ARCH_SRC(src/timer, beos, SDL_systimer.c) 2174 AC_DEFINE(SDL_TIMER_BEOS)
2175 SOURCES="$SOURCES $srcdir/src/timer/beos/*.c"
2176 have_timers=yes
2177 fi
2178 # Set up files for the shared object loading library
2179 if test x$enable_loadso = xyes; then
2180 AC_DEFINE(SDL_LOADSO_BEOS)
2181 SOURCES="$SOURCES $srcdir/src/loadso/beos/*.c"
2182 have_loadso=yes
2727 fi 2183 fi
2728 # The BeOS platform requires special libraries 2184 # The BeOS platform requires special libraries
2729 SYSTEM_LIBS="$SYSTEM_LIBS -lroot -lbe -lmedia -lgame -ldevice -ltextencoding" 2185 BUILD_LIBS="$BUILD_LIBS -lroot -lbe -lmedia -lgame -ldevice -ltextencoding"
2730 ;;
2731 *-*-macos*)
2732 # This would be used if cross-compiling to MacOS 9. No way to
2733 # use it at present, but Apple is working on a X-to-9 compiler
2734 # for which this case would be handy.
2735 ARCH=macos
2736 have_loadso=yes
2737 CheckDummyVideo
2738 CheckDiskAudio
2739 CheckTOOLBOX
2740 CheckMacGL
2741 # Set up files for the audio library
2742 if test x$enable_audio = xyes; then
2743 AUDIO_SUBDIRS="$AUDIO_SUBDIRS macrom"
2744 AUDIO_DRIVERS="$AUDIO_DRIVERS macrom/libaudio_macrom.la"
2745 fi
2746 # Set up files for the joystick library
2747 if test x$enable_joystick = xyes; then
2748 JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS macos"
2749 JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS macos/libjoystick_macos.la"
2750 fi
2751 # Set up files for the cdrom library
2752 if test x$enable_cdrom = xyes; then
2753 CDROM_SUBDIRS="$CDROM_SUBDIRS macos"
2754 CDROM_DRIVERS="$CDROM_DRIVERS macos/libcdrom_macos.la"
2755 fi
2756 # Set up files for the thread library
2757 if test x$enable_threads = xyes; then
2758 COPY_ARCH_SRC(src/thread, macos, SDL_systhread.c)
2759 COPY_ARCH_SRC(src/thread, macos, SDL_systhread_c.h)
2760 COPY_ARCH_SRC(src/thread, generic, SDL_sysmutex.c)
2761 COPY_ARCH_SRC(src/thread, generic, SDL_sysmutex_c.h)
2762 COPY_ARCH_SRC(src/thread, macos, SDL_syssem.c)
2763 COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
2764 COPY_ARCH_SRC(src/thread, generic, SDL_syscond.c)
2765 COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
2766 fi
2767 # Set up files for the timer library
2768 if test x$enable_timers = xyes; then
2769 COPY_ARCH_SRC(src/timer, macos, SDL_systimer.c)
2770 fi
2771 # The MacOS platform requires special setup
2772 SDL_CFLAGS="$SDL_CFLAGS -Dmain=SDL_main"
2773 SDL_LIBS="-lSDLmain $SDL_LIBS"
2774 ;; 2186 ;;
2775 *-*-darwin* ) 2187 *-*-darwin* )
2776 # This could be either full "Mac OS X", or plain "Darwin" which is 2188 # This could be either full "Mac OS X", or plain "Darwin" which is
2777 # just the OS X kernel sans upper layers like Carbon and Cocoa. 2189 # just the OS X kernel sans upper layers like Carbon and Cocoa.
2778 # Next line is broken, and a few files below require Mac OS X (full) 2190 # Next line is broken, and a few files below require Mac OS X (full)
2779 ARCH=macosx 2191 ARCH=macosx
2780 have_loadso=yes
2781 CheckDummyVideo 2192 CheckDummyVideo
2782 CheckDiskAudio 2193 CheckDiskAudio
2194 CheckDLOPEN
2783 CheckCOCOA 2195 CheckCOCOA
2784 CheckCARBON 2196 CheckCARBON
2785 CheckX11 2197 CheckX11
2786 CheckMacGL 2198 CheckMacGL
2787 CheckOpenGLX11 2199 CheckOpenGLX11
2788 CheckPTHREAD 2200 CheckPTHREAD
2789 CheckSIGACTION
2790 CheckAltivec 2201 CheckAltivec
2202 # Set up files for the audio library
2203 if test x$enable_audio = xyes; then
2204 AC_DEFINE(SDL_AUDIO_DRIVER_COREAUDIO)
2205 SOURCES="$SOURCES $srcdir/src/audio/macosx/*.c"
2206 AC_DEFINE(SDL_AUDIO_DRIVER_SNDMGR)
2207 SOURCES="$SOURCES $srcdir/src/audio/macrom/*.c"
2208 have_audio=yes
2209 fi
2210 # Set up files for the joystick library
2211 if test x$enable_joystick = xyes; then
2212 AC_DEFINE(SDL_JOYSTICK_IOKIT)
2213 SOURCES="$SOURCES $srcdir/src/joystick/darwin/*.c"
2214 BUILD_LIBS="$BUILD_LIBS -framework IOKit"
2215 have_joystick=yes
2216 fi
2217 # Set up files for the cdrom library
2218 if test x$enable_cdrom = xyes; then
2219 AC_DEFINE(SDL_CDROM_MACOSX)
2220 SOURCES="$SOURCES $srcdir/src/cdrom/macosx/*.c"
2221 have_cdrom=yes
2222 fi
2223 # Set up files for the timer library
2224 if test x$enable_timers = xyes; then
2225 AC_DEFINE(SDL_TIMER_UNIX)
2226 SOURCES="$SOURCES $srcdir/src/timer/unix/*.c"
2227 have_timers=yes
2228 fi
2229 # Set up files for the shared object loading library
2230 if test x$enable_loadso = xyes -a x$have_dlopen != xyes; then
2231 AC_DEFINE(SDL_LOADSO_DLCOMPAT)
2232 SOURCES="$SOURCES $srcdir/src/loadso/macosx/*.c"
2233 have_loadso=yes
2234 fi
2235 # The MacOS X platform requires special setup.
2236 AC_DEFINE(TARGET_API_MAC_CARBON)
2237 BUILD_CFLAGS="$BUILD_CFLAGS -fpascal-strings -DMACOSX"
2238 SDL_LIBS="-lSDLmain $SDL_LIBS"
2239 if test x$enable_video_cocoa = xyes; then
2240 BUILD_LIBS="$BUILD_LIBS -framework Cocoa"
2241 fi
2242 if test x$enable_video_carbon = xyes -o x$enable_video_cocoa = xyes; then
2243 # The Cocoa backend still needs Carbon, and the YUV code QuickTime
2244 BUILD_LIBS="$BUILD_LIBS -framework Carbon -framework QuickTime"
2245 fi
2791 # If either the audio or CD driver is used, add the AudioUnit framework 2246 # If either the audio or CD driver is used, add the AudioUnit framework
2792 if test x$enable_audio = xyes -o x$enable_cdrom = xyes; then 2247 if test x$enable_audio = xyes -o x$enable_cdrom = xyes; then
2793 SYSTEM_LIBS="$SYSTEM_LIBS -framework AudioToolbox -framework AudioUnit" 2248 BUILD_LIBS="$BUILD_LIBS -framework AudioToolbox -framework AudioUnit"
2794 fi 2249 fi
2795 # Set up files for the audio library
2796 if test x$enable_audio = xyes; then
2797 AUDIO_SUBDIRS="$AUDIO_SUBDIRS macosx"
2798 AUDIO_DRIVERS="$AUDIO_DRIVERS macosx/libaudio_macosx.la"
2799 AUDIO_SUBDIRS="$AUDIO_SUBDIRS macrom"
2800 AUDIO_DRIVERS="$AUDIO_DRIVERS macrom/libaudio_macrom.la"
2801 fi
2802 # Set up files for the joystick library
2803 if test x$enable_joystick = xyes; then
2804 JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS darwin"
2805 JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS darwin/libjoystick_darwin.la"
2806 SYSTEM_LIBS="$SYSTEM_LIBS -framework IOKit"
2807 fi
2808 # Set up files for the cdrom library
2809 if test x$enable_cdrom = xyes; then
2810 CDROM_SUBDIRS="$CDROM_SUBDIRS macosx"
2811 CDROM_DRIVERS="$CDROM_DRIVERS macosx/libcdrom_macosx.la"
2812 fi
2813 # Set up files for the thread library
2814 if test x$enable_threads = xyes; then
2815 CopyUnixThreadSource
2816 fi
2817 # Set up files for the timer library
2818 if test x$enable_timers = xyes; then
2819 COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
2820 fi
2821 # The MacOS X platform requires special setup.
2822 SDL_LIBS="-lSDLmain $SDL_LIBS"
2823 if test x$enable_video_cocoa = xyes; then
2824 SYSTEM_LIBS="$SYSTEM_LIBS -framework Cocoa"
2825 fi
2826 if test x$enable_video_carbon = xyes -o x$enable_video_cocoa = xyes; then
2827 # The Cocoa backend still needs Carbon, and the YUV code QuickTime
2828 SYSTEM_LIBS="$SYSTEM_LIBS -framework Carbon -framework QuickTime"
2829 fi
2830 #if test x$enable_video_carbon = xyes; then
2831 # SYSTEM_LIBS="$SYSTEM_LIBS -framework DrawSprocket"
2832 #fi
2833 ;; 2250 ;;
2834 *-*-mint*) 2251 *-*-mint*)
2835 ARCH=mint 2252 ARCH=mint
2836 CheckDummyVideo 2253 CheckDummyVideo
2837 CheckDiskAudio 2254 CheckDiskAudio
2838 CheckAtariBiosEvent 2255 CheckAtariBiosEvent
2839 CheckAtariXbiosVideo 2256 CheckAtariXbiosVideo
2840 CheckAtariGemVideo 2257 CheckAtariGemVideo
2841 CheckAtariAudio 2258 CheckAtariAudio
2842 CheckAtariLdg 2259 CheckAtariLdg
2843 CheckAtariOSMesa 2260 CheckAtariOSMesa
2844 CheckPTH 2261 CheckPTH
2845 # Set up files for the audio library 2262 # Set up files for the audio library
2846 if test x$enable_threads = xyes -a x$enable_pth = xyes; then 2263 if test x$enable_threads = xyes -a x$enable_pth = xyes; then
2847 if test x$enable_audio = xyes; then 2264 if test x$enable_audio = xyes; then
2848 CFLAGS="$CFLAGS -DSUNAUDIO_SUPPORT" 2265 AC_DEFINE(SDL_AUDIO_DRIVER_SUNAUDIO)
2849 AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun" 2266 SOURCES="$SOURCES $srcdir/src/audio/sun/*.c"
2850 AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la" 2267 have_audio=yes
2851 fi 2268 fi
2852 fi 2269 fi
2853 # Set up files for the joystick library 2270 # Set up files for the joystick library
2854 if test x$enable_joystick = xyes; then 2271 if test x$enable_joystick = xyes; then
2855 JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS mint" 2272 AC_DEFINE(SDL_JOYSTICK_MINT)
2856 JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS mint/libjoystick_mint.la" 2273 SOURCES="$SOURCES $srcdir/src/joystick/mint/*.c"
2274 have_joystick=yes
2857 fi 2275 fi
2858 # Set up files for the cdrom library 2276 # Set up files for the cdrom library
2859 if test x$enable_cdrom = xyes; then 2277 if test x$enable_cdrom = xyes; then
2860 CDROM_SUBDIRS="$CDROM_SUBDIRS mint" 2278 AC_DEFINE(SDL_CDROM_MINT)
2861 CDROM_DRIVERS="$CDROM_DRIVERS mint/libcdrom_mint.la" 2279 SOURCES="$SOURCES $srcdir/src/cdrom/mint/*.c"
2862 fi 2280 have_cdrom=yes
2863 # Set up files for the thread library
2864 if test x$enable_threads = xyes; then
2865 CopyUnixThreadSource
2866 fi 2281 fi
2867 # Set up files for the timer library 2282 # Set up files for the timer library
2868 if test x$enable_timers = xyes; then 2283 if test x$enable_timers = xyes; then
2869 if test x$enable_threads = xyes -a x$enable_pth = xyes; then 2284 if test x$enable_threads = xyes -a x$enable_pth = xyes; then
2870 COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c) 2285 AC_DEFINE(SDL_TIMER_UNIX)
2286 SOURCES="$SOURCES $srcdir/src/timer/unix/*.c"
2871 else 2287 else
2872 COPY_ARCH_SRC(src/timer, mint, SDL_systimer.c) 2288 AC_DEFINE(SDL_TIMER_MINT)
2873 fi 2289 SOURCES="$SOURCES $srcdir/src/timer/mint/*.c"
2290 fi
2291 have_timers=yes
2874 fi 2292 fi
2875 # MiNT does not define "unix" 2293 # MiNT does not define "unix"
2876 CFLAGS="$CFLAGS -Dunix" 2294 BUILD_CFLAGS="$BUILD_CFLAGS -Dunix"
2877 ;; 2295 ;;
2878 *-riscos) 2296 *-riscos)
2879 ARCH=riscos 2297 ARCH=riscos
2298 CheckOSS
2299 CheckPTHREAD
2880 # Set up files for the video library 2300 # Set up files for the video library
2881 if test x$enable_video = xyes; then 2301 if test x$enable_video = xyes; then
2882 VIDEO_SUBDIRS="$VIDEO_SUBDIRS riscos" 2302 AC_DEFINE(SDL_VIDEO_DRIVER_RISCOS)
2883 VIDEO_DRIVERS="$VIDEO_DRIVERS riscos/libvideo_riscos.la" 2303 SOURCES="$SOURCES $srcdir/src/video/riscos/*.c"
2884 fi 2304 have_video=yes
2885 # Set up files for the audio library
2886 if test x$enable_audio = xyes; then
2887 CFLAGS="$CFLAGS -DOSS_SUPPORT"
2888 AUDIO_SUBDIRS="$AUDIO_SUBDIRS dsp"
2889 AUDIO_DRIVERS="$AUDIO_DRIVERS dsp/libaudio_dsp.la"
2890 AUDIO_SUBDIRS="$AUDIO_SUBDIRS dma"
2891 AUDIO_DRIVERS="$AUDIO_DRIVERS dma/libaudio_dma.la"
2892 fi 2305 fi
2893 # Set up files for the joystick library 2306 # Set up files for the joystick library
2894 if test x$enable_joystick = xyes; then 2307 if test x$enable_joystick = xyes; then
2895 JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS riscos" 2308 AC_DEFINE(SDL_JOYSTICK_RISCOS)
2896 JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS riscos/libjoystick_riscos.la" 2309 SOURCES="$SOURCES $srcdir/src/joystick/riscos/*.c"
2897 fi 2310 have_joystick=yes
2898 # Set up files for the cdrom library
2899 if test x$enable_cdrom = xyes; then
2900 CDROM_SUBDIRS="$CDROM_SUBDIRS dummy"
2901 CDROM_DRIVERS="$CDROM_DRIVERS dummy/libcdrom_dummy.la"
2902 fi
2903 # Set up files for the thread library
2904 if test x$enable_threads = xyes; then
2905 COPY_ARCH_SRC(src/thread, riscos, SDL_systhread.c)
2906 COPY_ARCH_SRC(src/thread, riscos, SDL_systhread_c.h)
2907 COPY_ARCH_SRC(src/thread, riscos, SDL_sysmutex.c)
2908 COPY_ARCH_SRC(src/thread, riscos, SDL_sysmutex_c.h)
2909 COPY_ARCH_SRC(src/thread, riscos, SDL_syssem.c)
2910 COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
2911 COPY_ARCH_SRC(src/thread, riscos, SDL_syscond.c)
2912 COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
2913 else
2914 CFLAGS="$CFLAGS -DDISABLE_THREADS"
2915 fi 2311 fi
2916 # Set up files for the timer library 2312 # Set up files for the timer library
2917 if test x$enable_timers = xyes; then 2313 if test x$enable_timers = xyes; then
2918 COPY_ARCH_SRC(src/timer, riscos, SDL_systimer.c) 2314 AC_DEFINE(SDL_TIMER_RISCOS)
2919 fi 2315 SOURCES="$SOURCES $srcdir/src/timer/riscos/*.c"
2920 2316 have_timers=yes
2921 CFLAGS="$CFLAGS -DENABLE_RISCOS" 2317 fi
2922 2318 # The RISC OS platform requires special setup.
2923 SYSTEM_LIBS="$SYSTEM_LIBS -ljpeg -ltiff -lpng -lz" 2319 BUILD_LIBS="$BUILD_LIBS -ljpeg -ltiff -lpng -lz"
2924 ;; 2320 ;;
2925 *) 2321 *)
2926 AC_MSG_ERROR(Unsupported target: Please add to configure.in) 2322 AC_MSG_ERROR([
2323 *** Unsupported target: Please add to configure.in
2324 ])
2927 ;; 2325 ;;
2928 esac 2326 esac
2929 AC_SUBST(ARCH) 2327
2930 2328 # Verify that we have all the platform specific files we need
2931 # Set the conditional variables for this target 2329 if test x$have_joystick != xyes; then
2932 AM_CONDITIONAL(TARGET_LINUX, test $ARCH = linux) 2330 if test x$enable_joystick = xyes; then
2933 AM_CONDITIONAL(TARGET_QTOPIA, test "x$video_qtopia" = "xyes") 2331 AC_DEFINE(SDL_JOYSTICK_DISABLED)
2934 AM_CONDITIONAL(TARGET_SOLARIS, test $ARCH = solaris) 2332 fi
2935 AM_CONDITIONAL(TARGET_IRIX, test $ARCH = irix) 2333 SOURCES="$SOURCES $srcdir/src/joystick/dummy/*.c"
2936 AM_CONDITIONAL(TARGET_BSDI, test $ARCH = bsdi) 2334 fi
2937 AM_CONDITIONAL(TARGET_FREEBSD, test $ARCH = freebsd) 2335 if test x$have_cdrom != xyes; then
2938 AM_CONDITIONAL(TARGET_NETBSD, test $ARCH = netbsd) 2336 if test x$enable_cdrom = xyes; then
2939 AM_CONDITIONAL(TARGET_OPENBSD, test $ARCH = openbsd) 2337 AC_DEFINE(SDL_CDROM_DISABLED)
2940 AM_CONDITIONAL(TARGET_AIX, test $ARCH = aix) 2338 fi
2941 AM_CONDITIONAL(TARGET_WIN32, test $ARCH = win32) 2339 SOURCES="$SOURCES $srcdir/src/cdrom/dummy/*.c"
2942 AM_CONDITIONAL(TARGET_BEOS, test $ARCH = beos) 2340 fi
2943 AM_CONDITIONAL(TARGET_MACOS, test $ARCH = macos) 2341 if test x$have_threads != xyes; then
2944 AM_CONDITIONAL(TARGET_MACOSX, test $ARCH = macosx) 2342 if test x$enable_threads = xyes; then
2945 AM_CONDITIONAL(TARGET_QNX, test $ARCH = qnx) 2343 AC_DEFINE(SDL_THREADS_DISABLED)
2946 AM_CONDITIONAL(TARGET_MINT, test $ARCH = mint) 2344 fi
2947 AM_CONDITIONAL(TARGET_IPOD, test x$enable_ipod = xyes) 2345 SOURCES="$SOURCES $srcdir/src/thread/generic/*.c"
2948 2346 fi
2949 # More automake conditionals 2347 if test x$have_timers != xyes; then
2950 AM_CONDITIONAL(USE_DIRECTX, test x$use_directx = xyes) 2348 if test x$enable_timers = xyes; then
2951 AM_CONDITIONAL(USE_CLONE, test x$use_clone = xyes) 2349 AC_DEFINE(SDL_TIMERS_DISABLED)
2952 AM_CONDITIONAL(HAVE_NASM, test x$use_nasm = xyes) 2350 fi
2953 AM_CONDITIONAL(USE_COCOA, test x$enable_video_cocoa = xyes) 2351 SOURCES="$SOURCES $srcdir/src/timer/dummy/*.c"
2954 AM_CONDITIONAL(USE_CARBON, test x$enable_video_carbon = xyes) 2352 fi
2955 2353 if test x$have_loadso != xyes; then
2956 # Set conditional variables for shared and static library selection. 2354 if test x$enable_loadso = xyes; then
2957 # These are not used in any Makefile.am but in sdl-config.in. 2355 AC_DEFINE(SDL_LOADSO_DISABLED)
2958 AM_CONDITIONAL([ENABLE_SHARED], [test "$enable_shared" = yes]) 2356 fi
2959 AM_CONDITIONAL([ENABLE_STATIC], [test "$enable_static" = yes]) 2357 SOURCES="$SOURCES $srcdir/src/loadso/dummy/*.c"
2358 fi
2359
2360 OBJECTS=`echo $SOURCES | sed 's,[[^ ]]*/\([[^ ]]*\)\.asm,$(objects)/\1.lo,g'`
2361 OBJECTS=`echo $OBJECTS | sed 's,[[^ ]]*/\([[^ ]]*\)\.cc,$(objects)/\1.lo,g'`
2362 OBJECTS=`echo $OBJECTS | sed 's,[[^ ]]*/\([[^ ]]*\)\.m,$(objects)/\1.lo,g'`
2363 OBJECTS=`echo $OBJECTS | sed 's,[[^ ]]*/\([[^ ]]*\)\.c,$(objects)/\1.lo,g'`
2960 2364
2961 # Set runtime shared library paths as needed 2365 # Set runtime shared library paths as needed
2962 2366
2963 if test "x$enable_rpath" = "xyes"; then 2367 if test "x$enable_rpath" = "xyes"; then
2964 if test $ARCH = linux -o $ARCH = freebsd -o $ARCH = bsdi; then 2368 if test $ARCH = linux -o $ARCH = freebsd -o $ARCH = bsdi; then
3003 *) 2407 *)
3004 SDL_STATIC_LIBS="$SDL_LIBS" 2408 SDL_STATIC_LIBS="$SDL_LIBS"
3005 ;; 2409 ;;
3006 esac 2410 esac
3007 2411
3008
3009 STATIC_SYSTEM_LIBS="$SYSTEM_LIBS" 2412 STATIC_SYSTEM_LIBS="$SYSTEM_LIBS"
3010
3011 dnl Output the video drivers we use
3012 if test x$enable_video = xtrue; then
3013 if test "$VIDEO_SUBDIRS" = ""; then
3014 AC_MSG_ERROR(*** No video drivers are enabled!)
3015 fi
3016 fi
3017 AC_SUBST(AUDIO_SUBDIRS)
3018 AC_SUBST(AUDIO_DRIVERS)
3019 AC_SUBST(VIDEO_SUBDIRS)
3020 AC_SUBST(VIDEO_DRIVERS)
3021 AC_SUBST(JOYSTICK_SUBDIRS)
3022 AC_SUBST(JOYSTICK_DRIVERS)
3023 AC_SUBST(CDROM_SUBDIRS)
3024 AC_SUBST(CDROM_DRIVERS)
3025 AC_SUBST(SDL_EXTRADIRS)
3026 AC_SUBST(SDL_EXTRALIBS)
3027 2413
3028 dnl Expand the cflags and libraries needed by apps using SDL 2414 dnl Expand the cflags and libraries needed by apps using SDL
3029 AC_SUBST(SDL_CFLAGS) 2415 AC_SUBST(SDL_CFLAGS)
3030 AC_SUBST(SDL_LIBS) 2416 AC_SUBST(SDL_LIBS)
3031 AC_SUBST(SDL_STATIC_LIBS) 2417 AC_SUBST(SDL_STATIC_LIBS)
3032 AC_SUBST(SDL_RLD_FLAGS) 2418 AC_SUBST(SDL_RLD_FLAGS)
2419 if test x$enable_shared = xyes; then
2420 ENABLE_SHARED_TRUE=
2421 ENABLE_SHARED_FALSE="#"
2422 else
2423 ENABLE_SHARED_TRUE="#"
2424 ENABLE_SHARED_FALSE=
2425 fi
2426 if test x$enable_static = xyes; then
2427 ENABLE_STATIC_TRUE=
2428 ENABLE_STATIC_FALSE="#"
2429 else
2430 ENABLE_STATIC_TRUE="#"
2431 ENABLE_STATIC_FALSE=
2432 fi
2433 AC_SUBST(ENABLE_SHARED_TRUE)
2434 AC_SUBST(ENABLE_SHARED_FALSE)
2435 AC_SUBST(ENABLE_STATIC_TRUE)
2436 AC_SUBST(ENABLE_STATIC_FALSE)
3033 2437
3034 dnl Expand the libraries needed for static and dynamic linking 2438 dnl Expand the libraries needed for static and dynamic linking
3035 AC_SUBST(STATIC_SYSTEM_LIBS) 2439 AC_SUBST(STATIC_SYSTEM_LIBS)
3036 AC_SUBST(SHARED_SYSTEM_LIBS) 2440 AC_SUBST(SHARED_SYSTEM_LIBS)
3037 AC_SUBST(SYSTEM_LIBS) 2441 AC_SUBST(SYSTEM_LIBS)
3038 2442
3039 dnl Expand the include directories for building SDL 2443 dnl Expand the sources and objects needed to build the library
3040 CFLAGS="$CFLAGS -I\$(top_srcdir)/include" 2444 AC_SUBST(ac_aux_dir)
3041 CFLAGS="$CFLAGS -I\$(top_srcdir)/include/SDL" 2445 AC_SUBST(INCLUDE)
3042 CFLAGS="$CFLAGS -I\$(top_srcdir)/src -I\$(top_srcdir)/src/main/$ARCH" 2446 AC_SUBST(SOURCES)
3043 CFLAGS="$CFLAGS -I\$(top_srcdir)/src/audio" 2447 AC_SUBST(OBJECTS)
3044 CFLAGS="$CFLAGS -I\$(top_srcdir)/src/video" 2448 AC_SUBST(BUILD_CFLAGS)
3045 CFLAGS="$CFLAGS -I\$(top_srcdir)/src/video/Xext/extensions" 2449 AC_SUBST(BUILD_LIBS)
3046 CFLAGS="$CFLAGS -I\$(top_srcdir)/src/events" 2450
3047 CFLAGS="$CFLAGS -I\$(top_srcdir)/src/joystick"
3048 CFLAGS="$CFLAGS -I\$(top_srcdir)/src/cdrom"
3049 CFLAGS="$CFLAGS -I\$(top_srcdir)/src/thread"
3050 CFLAGS="$CFLAGS -I\$(top_srcdir)/src/timer"
3051 CFLAGS="$CFLAGS -I\$(top_srcdir)/src/file"
3052 CFLAGS="$CFLAGS -I\$(top_builddir)/src/thread"
3053 CXXFLAGS="$CFLAGS"
3054
3055
3056 # Check for darwin at the very end and set up the Objective C compiler
3057 # We do this here so that we get the full CFLAGS into OBJCFLAGS
3058 case "$target" in
3059 *-*-darwin*)
3060 dnl AC_PROG_OBJC doesn't seem to exist, this is the SDL workaround
3061 AC_MSG_CHECKING(for an Objective-C compiler)
3062 OBJC="$CC"
3063 AC_SUBST(OBJC)
3064 OBJCFLAGS="$CFLAGS"
3065 AC_SUBST(OBJCFLAGS)
3066 _AM_DEPENDENCIES(OBJC)
3067 ;;
3068 esac
3069
3070 # Finally create all the generated files
3071 dnl Important: Any directory that you want to be in the distcheck should
3072 dnl have a file listed here, so that configure generates the
3073 dnl subdirectories on the build target.
3074 AC_OUTPUT([ 2451 AC_OUTPUT([
3075 Makefile 2452 Makefile sdl-config SDL.spec SDL.qpg
3076 docs/Makefile 2453 ], [
3077 docs/html/Makefile 2454 : >build-deps
3078 docs/man3/Makefile 2455 make depend
3079 include/Makefile 2456 ])
3080 src/Makefile
3081 src/main/Makefile
3082 src/main/macos/Makefile
3083 src/main/macosx/Makefile
3084 src/main/macosx/Info.plist
3085 src/stdlib/Makefile
3086 src/audio/Makefile
3087 src/audio/alsa/Makefile
3088 src/audio/arts/Makefile
3089 src/audio/baudio/Makefile
3090 src/audio/dc/Makefile
3091 src/audio/disk/Makefile
3092 src/audio/dma/Makefile
3093 src/audio/dmedia/Makefile
3094 src/audio/dsp/Makefile
3095 src/audio/esd/Makefile
3096 src/audio/macosx/Makefile
3097 src/audio/macrom/Makefile
3098 src/audio/mint/Makefile
3099 src/audio/mme/Makefile
3100 src/audio/nas/Makefile
3101 src/audio/nto/Makefile
3102 src/audio/openbsd/Makefile
3103 src/audio/paudio/Makefile
3104 src/audio/sun/Makefile
3105 src/audio/ums/Makefile
3106 src/audio/windib/Makefile
3107 src/audio/windx5/Makefile
3108 src/video/Makefile
3109 src/video/aalib/Makefile
3110 src/video/ataricommon/Makefile
3111 src/video/bwindow/Makefile
3112 src/video/cybergfx/Makefile
3113 src/video/dc/Makefile
3114 src/video/dga/Makefile
3115 src/video/directfb/Makefile
3116 src/video/dummy/Makefile
3117 src/video/epoc/Makefile
3118 src/video/fbcon/Makefile
3119 src/video/gem/Makefile
3120 src/video/ggi/Makefile
3121 src/video/ipod/Makefile
3122 src/video/os2fslib/Makefile
3123 src/video/maccommon/Makefile
3124 src/video/macdsp/Makefile
3125 src/video/macrom/Makefile
3126 src/video/nanox/Makefile
3127 src/video/photon/Makefile
3128 src/video/picogui/Makefile
3129 src/video/ps2gs/Makefile
3130 src/video/qtopia/Makefile
3131 src/video/wscons/Makefile
3132 src/video/quartz/Makefile
3133 src/video/riscos/Makefile
3134 src/video/svga/Makefile
3135 src/video/vgl/Makefile
3136 src/video/wincommon/Makefile
3137 src/video/windib/Makefile
3138 src/video/windx5/Makefile
3139 src/video/gapi/Makefile
3140 src/video/x11/Makefile
3141 src/video/xbios/Makefile
3142 src/video/Xext/Makefile
3143 src/video/Xext/extensions/Makefile
3144 src/video/Xext/Xinerama/Makefile
3145 src/video/Xext/Xv/Makefile
3146 src/video/Xext/Xxf86dga/Makefile
3147 src/video/Xext/Xxf86vm/Makefile
3148 src/video/Xext/XME/Makefile
3149 src/events/Makefile
3150 src/joystick/Makefile
3151 src/joystick/amigaos/Makefile
3152 src/joystick/beos/Makefile
3153 src/joystick/bsd/Makefile
3154 src/joystick/darwin/Makefile
3155 src/joystick/dc/Makefile
3156 src/joystick/dummy/Makefile
3157 src/joystick/linux/Makefile
3158 src/joystick/macos/Makefile
3159 src/joystick/mint/Makefile
3160 src/joystick/riscos/Makefile
3161 src/joystick/win32/Makefile
3162 src/cdrom/Makefile
3163 src/cdrom/aix/Makefile
3164 src/cdrom/beos/Makefile
3165 src/cdrom/dc/Makefile
3166 src/cdrom/dummy/Makefile
3167 src/cdrom/bsdi/Makefile
3168 src/cdrom/freebsd/Makefile
3169 src/cdrom/linux/Makefile
3170 src/cdrom/macos/Makefile
3171 src/cdrom/macosx/Makefile
3172 src/cdrom/mint/Makefile
3173 src/cdrom/openbsd/Makefile
3174 src/cdrom/osf/Makefile
3175 src/cdrom/qnx/Makefile
3176 src/cdrom/win32/Makefile
3177 src/thread/Makefile
3178 src/timer/Makefile
3179 src/file/Makefile
3180 src/cpuinfo/Makefile
3181 src/hermes/Makefile
3182 sdl-config
3183 SDL.spec
3184 SDL.qpg
3185 ], [chmod +x sdl-config])