-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfigure.in
More file actions
558 lines (490 loc) · 19.2 KB
/
Copy pathconfigure.in
File metadata and controls
558 lines (490 loc) · 19.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
dnl Process this file with autoconf to produce a configure script.
AC_INIT(configure.in)
AM_INIT_AUTOMAKE(lxdream, 0.9.1)
AM_MAINTAINER_MODE
AM_CONFIG_HEADER(config.h)
AC_CANONICAL_BUILD
AC_CANONICAL_HOST
m4_include([m4/ccforbuild.m4])
m4_include([m4/android.m4])
AC_ISC_POSIX
AC_PROG_CC
AM_PROG_CC_STDC
AC_PROG_CC_FOR_BUILD
AC_PROG_OBJC
AC_PROG_SED
AM_PROG_AS
AC_PROG_RANLIB
AC_CHECK_SIZEOF([void *])
AC_HEADER_STDC
_AM_DEPENDENCIES([OBJC])
AC_PATH_PROG(POD2MAN, [pod2man])
AC_PATH_PROG(POD2HTML, [pod2html])
AC_DEFINE_UNQUOTED(BUILD_SED_PROG, ["${SED}"], [Sed to use for build tools])
AC_DEFINE_UNQUOTED(BUILD_CPP_PROG, ["${CPP}"], [CPP to use for build tools])
dnl ---------------- enable/with flags ------------------
AC_ARG_ENABLE( strict-warn,
AS_HELP_STRING( [--enable-strict-warn], [Enable strict compilation warnings]),
[if test "$enableval" == "yes"; then
enable_strictwarn=yes
fi] )
AC_ARG_ENABLE( translator,
AS_HELP_STRING( [--disable-translator], [Disable the SH4 translator (Enabled by default)]),
[true], [enable_translator=yes] )
AC_ARG_ENABLE( optimized,
AS_HELP_STRING( [--disable-optimized], [Disable compile-time optimizations (Enabled by default)]),
[true], [enable_optimized=yes] )
AC_ARG_ENABLE( shared,
AS_HELP_STRING( [--enable-shared], [Build drivers as shared libraries (Enabled if available)]),
[if test "$enableval" == "yes"; then enable_shared=yes; else enable_shared=no; fi], [enable_shared=cond] )
AC_ARG_ENABLE( profiled,
AS_HELP_STRING( [--enable-profiled], [Enable profiling build]),
[if test "$enableval" == "yes"; then
enable_profiled=yes;
fi] )
AC_ARG_ENABLE( trace,
AS_HELP_STRING( [--enable-trace], [Enable generation of IO traces (warning: hurts performance)]),
[if test "$enableval" == "yes"; then
AC_DEFINE(ENABLE_TRACE_IO, 1, [Enable IO tracing])
fi] )
AC_ARG_ENABLE( watch,
AS_HELP_STRING( [--enable-watch], [Enable watchpoints in the debugger (warning: hurts performance)]),
[if test "$enableval" == "yes"; then
AC_DEFINE(ENABLE_WATCH, 1, [Enable watchpoints])
fi] )
AC_ARG_ENABLE( sh4stats,
AS_HELP_STRING( [--enable-sh4stats], [Enable statistics on executed sh4 instructions]),
[if test "$enableval" == "yes"; then
AC_DEFINE(ENABLE_SH4STATS, 1, [Enable SH4 statistics])
fi] )
AC_ARG_WITH( osmesa,
AS_HELP_STRING( [--with-osmesa], [Build with the osmesa GL library (software rendering)]),
[], [with_osmesa=no])
AC_ARG_WITH( gtk,
AS_HELP_STRING( [--with-gtk], [Build with the GTK UI. Default on X11 systems]), [with_gtk=yes], [with_gtk=x11] )
AC_ARG_WITH( esd,
AS_HELP_STRING( [--with-esd], [Build with support for the ESounD audio system]) )
AC_ARG_WITH( pulse,
AS_HELP_STRING( [--with-pulse], [Build with support for the PulseAudio audio system]) )
AC_ARG_WITH( sdl,
AS_HELP_STRING( [--with-sdl], [Build with support for SDL audio]) )
AC_ARG_WITH( sysroot,
AS_HELP_STRING( [--with-sysroot=SYSROOT], [Build using an alternate sysroot]),
[ m4_pattern_allow([PKG_CONFIG_LIBDIR])
if test -d "$with_sysroot/lib/pkgconfig"; then
LDFLAGS="$LDFLAGS -L$with_sysroot/lib"
CPPFLAGS="$CPPFLAGS -I$with_sysroot/include"
BUILD_PKG_CONFIG_LIBDIR="$PKG_CONFIG_LIBDIR"
TARGET_PKG_CONFIG_LIBDIR="$with_sysroot/lib/pkgconfig"
PKG_CONFIG_LIBDIR="$TARGET_PKG_CONFIG_LIBDIR"
export PKG_CONFIG_LIBDIR;
else
AC_MSG_FAILURE([pkg-config directory $with_sysroot/lib/pkgconfig not found, when using --with-sysroot=$with_sysroot option])
fi
])
LX_ANDROID_BUILD
dnl ------------ Check if we're building on Darwin or Android --------------
dnl For starters, do we have a working objective-c compiler?
if test "$ANDROID_BUILD" = "yes"; then
with_gtk=no;
EXTRA_OUTPUT_FILES="src/android/build.properties"
UI_DRIVER="Android"
with_sdl=no
else
AC_HAVE_OBJC([
AC_CHECK_HEADER([Cocoa/Cocoa.h], [
HAVE_COCOA='yes'
APPLE_BUILD='yes'
LIBS="$LIBS -framework AppKit -framework Carbon"
LIBS="$LIBS -Wl,-dylib_file,/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib -framework OpenGL"
LXDREAMCPPFLAGS="-DMAC_OS_X_VERSION_MIN_REQUIRED=MAC_OS_X_VERSION_10_4 -mdynamic-no-pic"
LDFLAGS="$LDFLAGS -Wl,-headerpad_max_install_names"
AC_DEFINE(HAVE_COCOA,[1],[Have Cocoa framework])
AC_DEFINE(APPLE_BUILD,[1],[Building on an apple platform. Things are different...])
UI_DRIVER="Cocoa"
if test "x$with_gtk" = "xx11"; then
with_gtk=no
fi
], [], [AC_INCLUDES_DEFAULT])
AC_OBJC_VERSION([ OBJCOPT="-O2"
OBJCFLAGS="$OBJCFLAGS -fno-strict-aliasing" ],
[ OBJCOPT="-O2" ], [] )
AC_CHECK_OBJCFLAG([-msse2])
AC_CHECK_OBJCFLAG([-mfpmath=sse])
])
fi
AM_CONDITIONAL(GUI_COCOA, [test "$HAVE_COCOA" = 'yes' -a "$with_gtk" = "no"])
if test "x$HAVE_COCOA" = 'xyes' -a "x$with_gtk" = "xno"; then
AC_DEFINE(OSX_BUNDLE, [1], [Generating a bundled application])
fi
dnl ------------------ C Compiler flags -----------------------
CFLAGS_FOR_BUILD="-O2 -std=c99"
CFLAGS="-g -fexceptions"
OBJCFLAGS="-g -fexceptions"
AC_DEFINE(HAVE_EXCEPTIONS, [1], [Have exception stack-frame information])
STDCFLAG="-std=c99"
AC_CC_VERSION([ CCOPT="-O2"
CFLAGS="$CFLAGS -fno-strict-aliasing" ],
[ CCOPT="$CFLAGS -fast"
CFLAGS="$CFLAGS -fno-strict-aliasing" ],
[ CCOPT="$CFLAGS -O2" ])
AC_CHECK_CFLAG([-msse2])
AC_CHECK_CFLAG([-mfpmath=sse])
if test "x$enable_optimized" = "xyes"; then
CFLAGS="$CFLAGS $CCOPT"
OBJCFLAGS="$OBJCFLAGS $OBJCOPT"
if test "x$enable_profiled" != "xyes"; then
dnl -fomit-frame-pointer can't be used with -pg
CFLAGS="$CFLAGS -fomit-frame-pointer"
OBJCFLAGS="$OBJCFLAGS -fomit-frame-pointer"
fi
else
CFLAGS="$CFLAGS -g3"
OBJCFLAGS="$OBJCFLAGS -g3"
fi
if test "x$enable_profiled" = "xyes"; then
CFLAGS="$CFLAGS -pg"
LDFLAGS="$LDFLAGS -pg";
OBJCFLAGS="$OBJCFLAGS -pg";
fi
if test "x$enable_strictwarn" = "xyes"; then
CFLAGS="$CFLAGS -Wall -Werror -Wno-unused"
OBJCFLAGS="$OBJCFLAGS -Wall -Werror -Wno-unused"
fi
if test "x$enable_shared" != "xno"; then
if test "x$APPLE_BUILD" = "xyes"; then
SOEXT="dylib"
PLUGINLDFLAGS="-dynamiclib -undefined dynamic_lookup"
else
SOEXT="so"
PLUGINLDFLAGS="-shared"
fi
PLUGINCFLAGS="-fPIC"
dnl Check for dlfcn.h and dlopen() (in libdl or libc)
AC_CHECK_HEADER( [dlfcn.h], [
AC_SEARCH_LIBS( [dlopen], [dl], [have_dlopen=yes]) ])
if test "x$have_dlopen" != "xyes"; then
if test "x$enable_shared" == "xyes"; then
AC_MSG_ERROR( "--enable-shared not supported on your system - can't find a working dlopen" )
else
AC_MSG_WARN("Statically linking all plugins")
fi
fi
dnl Check if linker accepts -rdynamic
AC_MSG_CHECKING([if linker accepts -rdynamic])
old_LDFLAGS="$LDFLAGS"
LDFLAGS="$LDFLAGS -rdynamic"
AC_LINK_IFELSE( [AC_LANG_SOURCE([int main() { return 0; }])], [
LXDREAMLDFLAGS="-rdynamic"
AC_MSG_RESULT([yes])
], [
LXDREAMLDFLAGS=""
AC_MSG_RESULT([no]) ])
LDFLAGS="$old_LDFLAGS"
AC_SUBST(SOEXT)
AC_SUBST(PLUGINCFLAGS)
AC_SUBST(PLUGINLDFLAGS)
AC_SUBST(LXDREAMLDFLAGS)
fi
if test "x$have_dlopen" = "xyes" -a "x$ANDROID_BUILD" != "xyes"; then
AC_DEFINE(BUILD_PLUGINS, [1], [Enable dynamic plugin support])
fi
AM_CONDITIONAL(BUILD_PLUGINS, [test "x$have_dlopen" = "xyes" -a "x$ANDROID_BUILD" != "xyes"])
AC_CHECK_FASTCALL([
AC_DEFINE(HAVE_FASTCALL, [1], [Use fast register-passing calling conventions])
])
AC_CHECK_FORCEINLINE()
AC_DEFINE_UNQUOTED(FORCEINLINE, [$FORCEINLINE], [Forcibly inline code])
AC_CHECK_FRAME_ADDRESS( [
AC_DEFINE(HAVE_FRAME_ADDRESS, [1], [Define if we have a working builtin frame_address])
], [ AC_MSG_WARN([Memory exceptions will be slow]) ])
AC_SUBST(LXDREAMCPPFLAGS)
AC_SEARCH_LIBS(listen, [socket])
AC_SEARCH_LIBS(inet_ntoa,[nsl])
dnl ----------- Check for mandatory dependencies --------------
dnl Check for libpng (required)
PKG_CHECK_MODULES(LIBPNG, [libpng] )
dnl Implied by libpng, but check explicitly just in case
AC_CHECK_LIB(z, uncompress, [], [
echo "Zlib (libz.so) could not be found, but is required."
exit 1])
dnl Check for libm (optional, required on some platforms)
AC_CHECK_LIB(m, sqrt)
if test "x$with_gtk" = "xno"; then
dnl Check for GLIB only
PKG_CHECK_MODULES(GLIB, glib-2.0)
else
dnl Check for GTK
PKG_CHECK_MODULES(GTK, gtk+-2.0, [
HAVE_GTK='yes'
AC_DEFINE([HAVE_GTK],1,[Have GTK libraries])
UI_DRIVER="GTK"
])
dnl Which GTK port do we have?
LIBS="$LIBS $GTK_LIBS"
AC_CHECK_FUNC(gdk_x11_display_get_xdisplay, [
HAVE_GTK_X11='yes'
AC_DEFINE([HAVE_GTK_X11],1,[Building with GTK+X11]) ], [])
dnl Add -lX11 explicitly as some pkg-configs get it wrong
GTK_LIBS="$GTK_LIBS -lX11"
LIBS="$LIBS -lX11"
AC_CHECK_FUNC(gdk_quartz_window_get_nsview, [
HAVE_GTK_OSX='yes'
AC_DEFINE([HAVE_GTK_OSX],1,[Building with GTK+Cocoa]) ], [])
if test "x$HAVE_GTK_X11$HAVE_GTK_OSX" = "x"; then
AC_MSG_FAILURE( [Unable to identify GTK platform] )
fi
fi
AC_PUSH_CC_FOR_BUILD
if test "$BUILD_PKG_CONFIG_LIBDIR" != "$TARGET_PKG_CONFIG_LIBDIR"; then
PKG_CONFIG_LIBDIR="$BUILD_PKG_CONFIG_LIBDIR";
if test "x$PKG_CONFIG_LIBDIR" = "x"; then
export -n PKG_CONFIG_LIBDIR
fi
fi
PKG_CHECK_MODULES(GLIB_FOR_BUILD, glib-2.0)
if test "$BUILD_PKG_CONFIG_LIBDIR" != "$TARGET_PKG_CONFIG_LIBDIR"; then
PKG_CONFIG_LIBDIR="$TARGET_PKG_CONFIG_LIBDIR";
export PKG_CONFIG_LIBDIR
fi
AC_POP_CC_FOR_BUILD
AM_CONDITIONAL(GUI_GTK, [test "$HAVE_GTK" = 'yes'])
PKG_CHECK_MODULES(LIBISOFS, [libisofs-1] )
dnl AC_CHECK_HEADER([libisofs/libisofs.h], [
dnl AC_CHECK_LIB(isofs, [iso_data_source_new_from_file], [
dnl LIBS="-lisofs $LIBS"
dnl ], [ AC_MSG_FAILURE( ["Libisofs library not found, but is required"]) ])],
dnl [ AC_MSG_FAILURE( ["Libisofs headers not found, but is required"]) ])
dnl ------------------ Video driver support -------------------
AS_IF([test "x$with_osmesa" != xno], [
dnl User requested OSMesa (ie pure software rendering)
AC_CHECK_LIB([OSMesa], [OSMesaCreateContext], [],
[AC_MSG_FAILURE( [--with-osmesa was given, but OSMesa library could not be found])])
AC_CHECK_HEADER([GL/osmesa.h], [],
[AC_MSG_FAILURE( [--with-osmesa was given, but osmesa.h could not be found])])
HAVE_OSMESA='yes'
VIDEO_DRIVERS="$VIDEO_DRIVERS osmesa"
AC_DEFINE([HAVE_OSMESA],1,[Building with the OSMesa video driver]) ], [
dnl Otherwise we want a real GL library (unless we're on darwin or android, in which case it's already
dnl taken care of above).
if test "x$APPLE_BUILD" != 'xyes'; then
PKG_CHECK_MODULES(LIBGL, [gl], [
LIBS="$LIBS $LIBGL_LIBS";
CPPFLAGS="$CPPFLAGS $LIBGL_CFLAGS";
], [
dnl GL library not found, try for GLESv2 + EGL
AC_CHECK_LIB(GLESv2, glEnable, [LIBS="-lGLESv2 $LIBS"; HAVE_GLES2='yes'],
[ AC_MSG_FAILURE([Neither the OpenGL library (libGL.so) nor the OpenGL ES 2.0 library (libGLESv2.so) could be found, but one is required.]) ])
])
else
AC_CHECK_FUNC(NSOpenGLGetVersion, [
HAVE_NSGL='yes'
VIDEO_DRIVERS="$VIDEO_DRIVERS nsgl"
AC_DEFINE([HAVE_NSGL],1, [Have NSOpenGL support]) ] )
if test "x$HAVE_GTK_X11" = "xyes"; then
LIBS="$LIBS -L/usr/X11/lib -lGL"
fi
fi
dnl Now work out how to get from the UI to GL - this is usually the painful part.
AC_CHECK_FUNC(glXQueryVersion, [
HAVE_GLX='yes'
VIDEO_DRIVERS="$VIDEO_DRIVERS glx"
AC_DEFINE([HAVE_GLX], 1, [Have GLX support]) ] )
AC_CHECK_LIB(EGL, eglGetDisplay, [
LIBS="-lEGL $LIBS"
HAVE_EGL='yes'
VIDEO_DRIVERS="$VIDEO_DRIVERS egl"])
])
if test "x$HAVE_GLES2" = "xyes"; then
AC_DEFINE(HAVE_GLES2, 1, [Using GLESv2])
fi
AM_CONDITIONAL(VIDEO_OSMESA, [test "x$HAVE_OSMESA" = "xyes"])
AM_CONDITIONAL(VIDEO_GLX, [test "x$HAVE_GLX" = "xyes"])
AM_CONDITIONAL(VIDEO_NSGL, [test "x$HAVE_NSGL" = "xyes"])
AM_CONDITIONAL(VIDEO_EGL, [test "x$HAVE_EGL" = "xyes"])
dnl Check for optional (but highly desireable) OpenGL features
AC_CHECK_FUNC(glGenFramebuffers, [ AC_DEFINE([HAVE_OPENGL_FBO],1,[Have 2.0 framebuffer_object support]) ], [])
AC_CHECK_FUNC(glGenFramebuffersEXT, [ AC_DEFINE([HAVE_OPENGL_FBO_EXT],1,[Have EXT_framebuffer_object support]) ], [])
AC_CHECK_FUNC(glCreateShader, [ AC_DEFINE([HAVE_OPENGL_SHADER],1,[Have 2.0 shader support]) ], [])
AC_CHECK_FUNC(glCreateShaderObjectARB, [ AC_DEFINE([HAVE_OPENGL_SHADER_ARB],1,[Have ARB shader support]) ], [])
AC_CHECK_FUNC(glClampColorARB, [ AC_DEFINE([HAVE_OPENGL_CLAMP_COLOR],1,[Have Color Clamp]) ], [])
AC_CHECK_FUNC(glClearDepthf, [ AC_DEFINE([HAVE_OPENGL_CLEAR_DEPTHF],1,[Have glClearDepthf function]) ], [])
AC_CHECK_FUNC(glAreTexturesResident, [ AC_DEFINE([HAVE_OPENGL_TEX_RESIDENT],1,[Have glAreTexturesResident function]) ], [])
AC_CHECK_FUNC(glDrawBuffer, [ AC_DEFINE([HAVE_OPENGL_DRAW_BUFFER],1,[Have glDrawBuffer function])], [])
AC_CHECK_FUNC(glTexEnvi, [ AC_DEFINE([HAVE_OPENGL_FIXEDFUNC],1,[Have OpenGL fixed-functionality]) ], [])dnl glTexEnvi is a pretty fair proxy for this.
dnl ------------------- SH4 translator target -------------------
if test "x$enable_translator" != "xno"; then
case $host_cpu in
i386|i486|i586|i686|x86_64)
SH4_TRANSLATOR="x86"
AC_DEFINE_UNQUOTED(SH4_TRANSLATOR,[TARGET_X86], [SH4 Translator to use (if any)] );;
esac
fi
AM_CONDITIONAL(BUILD_SH4X86, [test "$SH4_TRANSLATOR" = "x86"])
dnl ------------------ Optional driver support -------------------
dnl Check for Apple CoreAudio
AC_CHECK_HEADER([CoreAudio/CoreAudio.h], [
HAVE_CORE_AUDIO=yes
LIBS="$LIBS -framework CoreAudio"
AUDIO_DRIVERS="$AUDIO_DRIVERS osx"
AC_DEFINE([HAVE_CORE_AUDIO], 1, [Have Apple CoreAudio support]) ],[true ])
AM_CONDITIONAL( AUDIO_OSX, [test "$HAVE_CORE_AUDIO" = 'yes'] )
dnl Check for SDL (only used for audio at the moment)
if test "x$with_sdl" != "xno"; then
PKG_CHECK_MODULES(SDL, [sdl], [
HAVE_SDL='yes'
AUDIO_DRIVERS="$AUDIO_DRIVERS sdl"
AC_DEFINE([HAVE_SDL],1,[Have SDL support])
], [
if test "x$with_sdl" = "xyes"; then
AC_MSG_FAILURE( ["SDL libraries could not be found (but were required)] )
fi
])
fi
AM_CONDITIONAL( AUDIO_SDL, [test "$HAVE_SDL" = 'yes'] )
dnl Check for pulseaudio
if test "x$with_pulse" != "xno"; then
PKG_CHECK_MODULES(PULSE, [libpulse-simple], [
HAVE_PULSE='yes'
AUDIO_DRIVERS="$AUDIO_DRIVERS pulse"
AC_DEFINE([HAVE_PULSE],1,[Have pulseaudio support])
], [
if test "x$with_pulse" = "xyes"; then
AC_MSG_FAILURE( [PulseAudio audio package could not be found (but was required)] )
fi
])
fi
AM_CONDITIONAL( AUDIO_PULSE, [test "$HAVE_PULSE" = 'yes'] )
dnl Check for esound
if test "x$with_esd" != "xno"; then
PKG_CHECK_MODULES(ESOUND, [esound], [
HAVE_ESOUND='yes'
AUDIO_DRIVERS="$AUDIO_DRIVERS esd"
AC_DEFINE([HAVE_ESOUND],1,[Have esound support])
], [
if test "x$with_esd" = "xyes"; then
AC_MSG_FAILURE( [ESounD audio package could not be found (but was required)] )
fi
])
fi
AM_CONDITIONAL( AUDIO_ESOUND, [test "$HAVE_ESOUND" = 'yes'] )
dnl Check for alsa support
PKG_CHECK_MODULES(ALSA, [alsa], [
HAVE_ALSA='yes'
AUDIO_DRIVERS="$AUDIO_DRIVERS alsa"
AC_DEFINE([HAVE_ALSA],1,[Have alsa support]) ], [true])
AM_CONDITIONAL( AUDIO_ALSA, [test "$HAVE_ALSA" = 'yes'] )
dnl Check for native cdrom support. There can be only one.
if test "$ANDROID_BUILD" != "yes"; then
AC_CHECK_HEADER([linux/cdrom.h], [
CDROM_DRIVER=linux
dnl Some kernel versions have non-c99 compliant headers - check here
AC_MSG_CHECKING([C99 compliant kernel headers])
old_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $STDCFLAG"
AC_TRY_COMPILE([#include <linux/cdrom.h>], [], [AC_MSG_RESULT([Yes])], [
AC_MSG_RESULT([No])
STDCFLAG="-std=gnu99"])
CFLAGS="$old_CFLAGS"
], [true])
AC_CHECK_HEADER([IOKit/IOKitLib.h], [
CDROM_DRIVER=osx
LIBS="$LIBS -framework IOKit"],[true])
fi
AM_CONDITIONAL(CDROM_LINUX, [test "x$CDROM_DRIVER" = "xlinux"])
AM_CONDITIONAL(CDROM_OSX, [test "x$CDROM_DRIVER" = "xosx"])
AM_CONDITIONAL(CDROM_NONE, [test "x$CDROM_DRIVER" = "x"])
if test "x$CDROM_DRIVER" = "xlinux"; then
AC_DEFINE([HAVE_LINUX_CDROM],1,[Using the linux native CDROM driver])
fi
AC_CHECK_HEADER([linux/joystick.h], [
HAVE_LINUX_JOYSTICK_H=yes
AC_DEFINE([HAVE_LINUX_JOYSTICK], 1, [Have linux joystick support])
INPUT_DRIVERS="$INPUT_DRIVERS joy_linux" ],
[ echo "Linux Joystick support not found, building without it."] )
AM_CONDITIONAL(JOY_LINUX, [test "$HAVE_LINUX_JOYSTICK_H" = "yes"])
dnl Check for LIRC
if test "x$with_lirc" != "xno"; then
AC_CHECK_HEADER([lirc/lirc_client.h], [
HAVE_LIRC_CLIENT_H=yes
AC_DEFINE([HAVE_LIRC],1,[Have LIRC support])
INPUT_DRIVERS="$INPUT_DRIVERS lirc"
],
[ echo "LIRC support not found, building without it." ] )
fi
AM_CONDITIONAL(INPUT_LIRC, [test "$HAVE_LIRC_CLIENT_H" = "yes"])
dnl Check for cross-compiler availability - needed for system tests
AC_PATH_PROG(SHCC, [sh-elf-gcc])
AC_PATH_PROG(SHLD, [sh-elf-ld])
AC_PATH_PROG(SHOBJCOPY, [sh-elf-objcopy])
AC_PATH_PROG(ARMCC, [arm-elf-gcc])
AC_PATH_PROG(ARMLD, [arm-elf-ld])
AC_PATH_PROG(ARMOBJCOPY, [arm-elf-objcopy])
if test "x$SHCC" = "x" -o "x$SHLD" = "x" -o "x$SHOBJCOPY" = "x"; then
BUILD_SH="no"
echo "Warning: SH4 cross-compiler not found, system tests will be disabled."
else
BUILD_SH="yes"
fi
if test "x$ARMCC" = "x" -o "x$ARMLD" = "x" -o "x$ARMOBJCOPY" = "x"; then
BUILD_ARM="no"
echo "Warning: ARM cross-compiler not found, AICA tests will be disabled."
else
BUILD_ARM="yes"
fi
AM_CONDITIONAL(BUILD_SYSTEST, [test "$BUILD_SH" = "yes"])
AM_CONDITIONAL(BUILD_ARMTEST, [test "$BUILD_ARM" = "yes"])
CFLAGS="$CFLAGS $STDCFLAG"
dnl ----------------------- All done, finish up -----------------------
GETTEXT_PACKAGE=lxdream
LXDREAM_LIBS="$LIBS"
LIBS=""
AC_SUBST(LXDREAM_LIBS)
AC_SUBST(GETTEXT_PACKAGE)
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE",[translation domain])
dnl Add the languages which your application supports here.
ALL_LINGUAS="de es it nl pt_BR"
AM_GLIB_GNU_GETTEXT
AC_OUTPUT([
Makefile
src/Makefile
src/tools/Makefile
po/Makefile.in
test/Makefile
Info.plist
])
AS_MKDIR_P(test/sh4)
dnl ------------------------- Print out a summary ----------------------
echo
echo "Configuration complete"
echo
if test "x$UI_DRIVER" = x; then
echo " User interface: none"
else
echo " User interface: $UI_DRIVER"
fi
if test "x$SH4_TRANSLATOR" = "x"; then
echo " SH4 translator: none (emulation core only)"
else
echo " SH4 translator: $SH4_TRANSLATOR"
fi
if test "x$VIDEO_DRIVERS" = "x"; then
echo " Video drivers: none (no supported GL found)"
else
echo " Video drivers: $VIDEO_DRIVERS"
fi
if test "x$AUDIO_DRIVERS" = "x"; then
echo " Audio drivers: none (no supported output devices found)"
else
echo " Audio drivers: $AUDIO_DRIVERS"
fi
if test "x$INPUT_DRIVERS" = "x"; then
echo " Input drivers: none (no supported input devices found)"
else
echo " Input drivers: $INPUT_DRIVERS"
fi
if test "x$CDROM_DRIVER" = "x"; then
echo " CD-ROM driver: none (no supported cd-rom devices found)"
else
echo " CD-ROM driver: $CDROM_DRIVER"
fi