Add VCS links
[debian-dgen.git] / configure.ac
blobdf34819fea38c3568f288dcf9635d401591a6863
1 dnl DGen/SDL v1.33
2 dnl At long last, the configure script!
4 AC_INIT(
5         [DGen/SDL],
6         [1.33],
7         [zamaz@users.sourceforge.net],
8         [dgen-sdl],
9         [http://sourceforge.net/projects/dgen],
12 dnl We'll need machine type later.
13 AC_CANONICAL_SYSTEM
15 dnl Initialize Automake.
16 AM_INIT_AUTOMAKE([silent-rules])
17 AM_SILENT_RULES([yes])
18 AM_PROG_AS
20 dnl Check for standard programs.
21 AC_PROG_CC
22 AC_PROG_CC_C99
23 AC_PROG_CPP
24 AC_PROG_CXX
25 AC_PROG_CXXCPP
26 AC_PROG_INSTALL
27 AC_PROG_LN_S
28 AC_PROG_RANLIB
30 dnl Set the value of make, if make doesn't already.
31 AC_PROG_MAKE_SET
33 dnl We're using C.
34 AC_LANG([C])
36 dnl Check endianness.
37 AC_C_BIGENDIAN
39 dnl Cross compilation stuff.
40 AS_IF(
41         [test "x$cross_compiling" = xno],
42         [CC_FOR_BUILD="${CC}"]
43         [CXX_FOR_BUILD="${CXX}"]
44         [CPPFLAGS_FOR_BUILD="${CPPFLAGS}"]
45         [CFLAGS_FOR_BUILD="${CFLAGS}"]
46         [CXXFLAGS_FOR_BUILD="${CXXFLAGS}"]
47         [LDFLAGS_FOR_BUILD="${LDFLAGS}"]
48         [OBJEXT_FOR_BUILD="${OBJEXT}"]
49         [EXEEXT_FOR_BUILD="${EXEEXT}"]
51 AS_IF(
52         [test "x$cross_compiling" = xyes],
53         [AC_MSG_CHECKING([for host C compiler])]
54         [CC_FOR_BUILD="${CC_FOR_BUILD-cc}"]
55         [AC_MSG_RESULT([$CC_FOR_BUILD])]
56         [AC_MSG_CHECKING([for host C++ compiler])]
57         [CXX_FOR_BUILD="${CXX_FOR_BUILD-c++}"]
58         [AC_MSG_RESULT([$CXX_FOR_BUILD])]
59         [AC_MSG_CHECKING([for suffix of host object files])]
60         [
62         # Sane values by default.
63         OBJEXT_FOR_BUILD=o
64         EXEEXT_FOR_BUILD=
65         # Try to compile a program, find out default extensions.
66         EXT_SUCCESS=0
67         rm -f conftest*
68         cat <<EOF > conftest.c &&
69 int main(void) { return 0; }
70 EOF
71         $CC_FOR_BUILD -c conftest.c &&
72         rm -f conftest.c &&
73         for file in conftest.*
74         do
75                 test -f $file ||
76                 ! continue
77                 OBJEXT_FOR_BUILD="${file##*.}"
78                 test -z "$OBJEXT_FOR_BUILD" &&
79                 ! continue
80                 break
81         done &&
82         for ext in '' '.exe'
83         do
84                 $CC_FOR_BUILD -o conftest$ext $file &&
85                 ./conftest$ext ||
86                 ! continue
87                 EXEEXT_FOR_BUILD="$ext"
88                 break
89         done &&
90         EXT_SUCCESS=1
91         rm -f conftest*
92 } 1>&AS_MESSAGE_LOG_FD 2>&1
93         ]
94         [AS_IF(
95                 [test "x$EXT_SUCCESS" = x1],
96                 [AC_MSG_RESULT([$OBJEXT_FOR_BUILD])]
97                 [AC_MSG_CHECKING([for suffix of host executables])]
98                 [AS_IF(
99                         [test "x$EXEEXT_FOR_BUILD" = x],
100                         [AC_MSG_RESULT([none])],
101                         [AC_MSG_RESULT([$EXEEXT_FOR_BUILD])]
102                 )],
103                 [AC_MSG_RESULT([unable to determine])]
104                 [AC_MSG_FAILURE([can't cross-compile if host objects \
105 extension isn't known])]
106         )]
109 dnl Libraries used by dgen_tobin.
110 TOBIN_LIBS="${LIBS} ${TOBIN_LIBS}"
112 dnl Check for SDL libs.
113 AM_PATH_SDL([1.2.0], [], [AC_MSG_ERROR([SDL version >= 1.2.0 not found.])])
114 CFLAGS="$CFLAGS $SDL_CFLAGS"
115 CPPFLAGS="$CPPFLAGS $SDL_CFLAGS"
116 LIBS="$LIBS $SDL_LIBS"
118 dnl Check for the SDL_WM_ToggleFullScreen function.
119 AC_CHECK_FUNCS([SDL_WM_ToggleFullScreen])
121 dnl Check for ftello().
122 AC_CHECK_FUNCS([ftello])
124 dnl Debugging?
125 AC_ARG_ENABLE(
126         [debug],
127         [AS_HELP_STRING(
128                 [--enable-debug],
129                 [enable internal debugging [default=no]]
130         )],
131         [USE_DEBUG=$enableval],
132         [USE_DEBUG=no]
135 dnl Check for joystick support.
136 AC_ARG_ENABLE(
137         [joystick],
138         [AS_HELP_STRING(
139                 [--enable-joystick],
140                 [enable joystick support [default=auto]]
141         )],
142         [USE_JOYSTICK=$enableval],
143         [USE_JOYSTICK=auto]
145 AS_IF(
146         [test "x$USE_JOYSTICK" != xno],
147         [AC_CHECK_HEADER(
148                 [SDL_joystick.h],
149                 [USE_JOYSTICK=yes],
150                 [USE_JOYSTICK=no]
151         )]
153 AS_IF(
154         [test "x$enable_joystick" = xyes -a "x$USE_JOYSTICK" = xno],
155         [AC_MSG_FAILURE([joystick support seems unavailable])]
158 dnl Check for OpenGL support.
159 AC_ARG_ENABLE(
160         [opengl],
161         [AS_HELP_STRING(
162                 [--enable-opengl],
163                 [enable OpenGL support [default=auto]]
164         )],
165         [USE_OPENGL=$enableval],
166         [USE_OPENGL=auto]
168 AS_IF(
169         [test "x$USE_OPENGL" != xno],
170         [AC_CHECK_HEADER(
171                 [SDL_opengl.h],
172                 [AC_SEARCH_LIBS(
173                         [glEnd],
174                         [GL opengl32 gl],
175                         [USE_OPENGL=yes],
176                         [AS_IF(
177                                 [test "x$cross_compiling" = xyes],
178                                 dnl When nothing works, use brute force.
179                                 [USE_OPENGL=no]
180                                 [AC_CHECK_LIB(
181                                         [GL],
182                                         [main],
183                                         [LIBS="-lGL $LIBS"]
184                                         [USE_OPENGL=yes]
185                                 )]
186                                 [AC_CHECK_LIB(
187                                         [opengl32],
188                                         [main],
189                                         [LIBS="-lopengl32 $LIBS"]
190                                         [USE_OPENGL=yes]
191                                 )]
192                                 [AC_CHECK_LIB(
193                                         [gl],
194                                         [main],
195                                         [LIBS="-lgl $LIBS"]
196                                         [USE_OPENGL=yes]
197                                 )],
198                                 [USE_OPENGL=no]
199                         )]
200                 )],
201                 [USE_OPENGL=no]
202         )]
204 AS_IF(
205         [test "x$enable_opengl" = xyes -a "x$USE_OPENGL" = xno],
206         [AC_MSG_FAILURE([OpenGL support seems unavailable])]
209 dnl Check for threads support.
210 AC_ARG_ENABLE(
211         [threads],
212         [AS_HELP_STRING(
213                 [--enable-threads],
214                 [enable multi-threading support [default=auto]]
215         )],
216         [USE_THREADS=$enableval],
217         [USE_THREADS=auto]
219 AS_IF(
220         [test "x$USE_THREADS" != xno],
221         [AC_CHECK_HEADER(
222                 [SDL_thread.h],
223                 [USE_THREADS=yes],
224                 [USE_THREADS=no]
225         )]
227 AS_IF(
228         [test "x$enable_threads" = xyes -a "x$USE_THREADS" = xno],
229         [AC_MSG_FAILURE([multi-threading support seems unavailable])]
232 dnl Check for libarchive. Note that older versions of libarchive don't have
233 dnl archive_read_support_format_raw().
234 AC_ARG_WITH(
235         [libarchive],
236         [AS_HELP_STRING(
237                 [--with-libarchive],
238                 [use libarchive for compressed ROMs [default=auto]]
239         )],
240         [USE_LIBARCHIVE=$withval],
241         [USE_LIBARCHIVE=auto]
243 AS_IF(
244         [test "x$USE_LIBARCHIVE" != xno],
245         [AC_CHECK_HEADER(
246                 [archive.h],
247                 [AC_CHECK_LIB(
248                         [archive],
249                         [archive_read_support_format_raw],
250                         [LIBS="-larchive $LIBS"]
251                         [TOBIN_LIBS="-larchive $TOBIN_LIBS"]
252                         [USE_LIBARCHIVE=yes],
253                         [USE_LIBARCHIVE=no]
254                 )],
255                 [USE_LIBARCHIVE=no]
256         )]
259 dnl Check for glob.h.
260 AC_CHECK_HEADERS([glob.h])
262 dnl Try to add shell32.
263 AC_CHECK_LIB([shell32], [main])
265 dnl Check for ASM availability.
266 AC_ARG_ENABLE(
267         [asm],
268         [AS_HELP_STRING(
269                 [--disable-asm],
270                 [disable all ASM-related options [default=auto]]
271         )],
272         [USE_ASM=$enableval],
273         [USE_ASM=auto]
275 USE_X86_ASM=no
276 USE_ARM_ASM=no
277 AS_IF(
278         [test "x$USE_ASM" != xno],
279         [AS_CASE(
280                 [$target],
282                 [i?86-*],
283                 [AC_PATH_PROG([NASM], [nasm])]
284                 [AS_IF(
285                         [test "x$NASM" != x],
286                         [USE_ASM=yes]
287                         [USE_X86_ASM=yes],
288                         [USE_ASM=no]
289                 )],
291                 [arm*-*],
292                 [AC_MSG_NOTICE([ARM-specific ASM routines enabled])]
293                 [USE_ASM=yes]
294                 [USE_ARM_ASM=yes],
296                 [AC_MSG_NOTICE([no ASM routines available for this target])]
297                 [USE_ASM=unavailable]
298                 [NASM=]
299         )]
301 AS_IF(
302         [test "x$enable_asm" = xyes -a "x$USE_ASM" = xno],
303         [AC_MSG_FAILURE([unable to enable ASM routines])]
306 dnl Check for NASM output format.
307 AC_ARG_WITH(
308         [nasm-format],
309         [AC_HELP_STRING(
310                 [--with-nasm-format[[=format]]],
311                 [use this output format for NASM (see "nasm -hf" output for]
312                 [available formats) [default=auto]]
313         )],
314         [NASM_FORMAT=$withval],
315         [AS_IF([test "x$NASM" != x], [NASM_FORMAT=auto], [NASM_FORMAT=])]
317 AS_IF(
318         [test "x$NASM_FORMAT" = xauto],
319         [AC_MSG_CHECKING([for nasm output format])]
320         [AS_CASE(
321                 [$target],
323                 [i?86-*mingw*],
324                 [NASM_FORMAT=win32],
326                 [x86_64-*mingw*],
327                 [NASM_FORMAT=win64],
329                 [i?86-*],
330                 [NASM_FORMAT=elf32],
332                 [x86_64-*],
333                 [NASM_FORMAT=elf64],
335                 [AC_MSG_RESULT([failed])]
336                 [AC_MSG_ERROR(
337                         [can't determine what format NASM should use, \
338 please specify --with-nasm-format=format]
339                 )]
340         )]
341         [AC_MSG_RESULT([$NASM_FORMAT])]
342         [AC_MSG_WARN([NASM format auto-detection is crappy at best])],
343         [AS_IF(
344                 [test "x$NASM_FORMAT" != x],
345                 [AC_MSG_NOTICE([NASM output format is $NASM_FORMAT])]
346         )]
349 dnl Check for the need to prefix ASM globals with underscores.
350 dnl For ELF, also add -DNASM_STACK_NOEXEC.
351 AS_IF(
352         [! test -z "$NASM_FORMAT"],
353         [AC_MSG_CHECKING([whether ASM globals require an underscore])]
354         [AS_CASE(
355                 [$NASM_FORMAT],
357                 [elf*],
358                 [AC_MSG_RESULT([no])]
359                 [NASM="$NASM -DNASM_STACK_NOEXEC"],
361                 [AC_MSG_RESULT([yes])]
362                 [NASM="$NASM --prefix _"]
363         )]
366 dnl Crap TV filters support.
367 AC_ARG_ENABLE(
368         [ctv],
369         [AC_HELP_STRING([--disable-ctv], [disable Crap TV filters])],
370         [USE_CTV=$enableval],
371         [USE_CTV=yes]
374 dnl hqx filters support.
375 AC_ARG_ENABLE(
376         [hqx],
377         [AS_HELP_STRING([--disable-hqx], [disable hqx filters])],
378         [USE_HQX=$enableval],
379         [USE_HQX=yes]
382 dnl scale2x filters support.
383 AC_ARG_ENABLE(
384         [scale2x],
385         [AS_HELP_STRING([--disable-scale2x], [disable scale2x filters])],
386         [USE_SCALE2X=$enableval],
387         [USE_SCALE2X=yes]
390 dnl x86-specific ASM options.
391 AC_ARG_ENABLE(
392         [x86-mmx],
393         [AC_HELP_STRING([--enable-x86-mmx], [enable MMX memcpy])],
394         dnl If --disable-asm isn't specified, MMX must be auto-detected,
395         dnl unless forced via --enable-x86-mmx.
396         [USE_X86_MMX=$enableval],
397         [AS_IF(
398                 [test "x$USE_X86_ASM" != xno],
399                 [USE_X86_MMX=auto],
400                 [USE_X86_MMX=no]
401         )]
403 AC_ARG_ENABLE(
404         [x86-ctv],
405         [AC_HELP_STRING([--enable-x86-ctv], [enable ASM Crap TV filters])],
406         dnl Disable this if --disable-ctv is given.
407         [AS_IF(
408                 [test "x$USE_CTV" != xno],
409                 [USE_X86_CTV=$enableval],
410                 [USE_X86_CTV=no]
411         )],
412         [AS_IF(
413                 [test "x$USE_CTV" != xno],
414                 [USE_X86_CTV=$USE_X86_ASM],
415                 [USE_X86_CTV=no]
416         )]
418 AC_ARG_ENABLE(
419         [x86-tiles],
420         [AC_HELP_STRING([--enable-x86-tiles], [enable ASM tiles])],
421         [USE_X86_TILES=$enableval],
422         [USE_X86_TILES=$USE_X86_ASM]
424 AC_ARG_ENABLE(
425         [x86-mz80],
426         [AC_HELP_STRING([--enable-x86-mz80], [use ASM version of MZ80])],
427         [USE_X86_MZ80=$enableval],
428         [USE_X86_MZ80=$USE_X86_ASM]
431 dnl If MMX is to be automatically enabled, make sure it is actually supported.
432 AS_IF(
433         [test "x$USE_X86_MMX" = xauto],
434         [AC_MSG_CHECKING([for MMX support])]
435         [AS_IF(
436                 [test "x$cross_compiling" = xyes],
437                 USE_X86_MMX=$USE_X86_ASM
438                 [AC_MSG_RESULT([$USE_X86_ASM (untested)])],
439                 [
441         cat <<EOF > conftest.asm &&
442 bits 32
443 section .text
444 global main
445 main:
446         emms
447         xor eax, eax    ; Return value of 0
448         ret
450         $NASM -f $NASM_FORMAT -o conftest.$OBJEXT -- conftest.asm &&
451         $CC -o conftest$EXEEXT conftest.$OBJEXT &&
452         ./conftest$EXEEXT &&
453         USE_X86_MMX=yes ||
454         USE_X86_MMX=no
455         rm -f conftest*
456 } 1>&AS_MESSAGE_LOG_FD 2>&1
457                 ]
458                 [AC_MSG_RESULT([$USE_X86_MMX])]
459         )]
462 AS_IF(
463         [test "x$USE_X86_ASM" = xno &&  \
464          test "x$USE_X86_MMX" = xyes -o \
465          "x$USE_X86_CTV" = xyes -o      \
466          "x$USE_X86_TILES" = xyes -o    \
467          "x$USE_X86_MZ80" = xyes],
468         [AC_MSG_FAILURE(
469                 [x86 ASM support is unavailable, you can't use x86 options]
470         )]
473 dnl CPU emulators.
474 AC_ARG_WITH(
475         [star],
476         [AS_HELP_STRING(
477                 [--with-star],
478                 [include StarScream CPU core [default=auto]]
479         )],
480         [WITH_STAR=$withval],
481         [WITH_STAR=$USE_X86_ASM]
483 AS_IF(
484         [test "x$WITH_STAR" = xyes -a "x$USE_X86_ASM" = xno],
485         [AC_MSG_FAILURE(
486                 [StarScream can only be enabled on x86 targets with a \
487 working ASM support]
488         )]
491 AC_ARG_WITH(
492         [musa],
493         [AS_HELP_STRING(
494                 [--with-musa],
495                 [include Musashi CPU core [default=yes]]
496         )],
497         [WITH_MUSA=$withval],
498         [WITH_MUSA=yes]
500 AS_IF(
501         [test "x$WITH_MUSA" != xyes -a "x$WITH_STAR" != xyes],
502         [AC_MSG_WARN([neither Musashi nor StarScream are enabled])]
505 AC_ARG_WITH(
506         [cyclone],
507         [AS_HELP_STRING(
508                 [--with-cyclone],
509                 [include Cyclone 68000 CPU core [default=auto]]
510         )],
511         [WITH_CYCLONE=$withval],
512         [WITH_CYCLONE=$USE_ARM_ASM]
514 AS_IF(
515         [test "x$WITH_CYCLONE" = xyes -a "x$USE_ARM_ASM" = xno],
516         [AC_MSG_FAILURE(
517                 [Cyclone 68000 can only be enabled on ARM targets with a \
518 working ASM support]
519         )]
522 AC_ARG_WITH(
523         [mz80],
524         [AS_HELP_STRING(
525                 [--with-mz80],
526                 [include MZ80 CPU core [default=yes]]
527         )],
528         [WITH_MZ80=$withval],
529         [WITH_MZ80=yes]
532 AC_ARG_WITH(
533         [cz80],
534         [AS_HELP_STRING(
535                 [--with-cz80],
536                 [include CZ80 CPU core [default=yes]]
537         )],
538         [WITH_CZ80=$withval],
539         [WITH_CZ80=yes]
542 AC_ARG_WITH(
543         [drz80],
544         [AS_HELP_STRING(
545                 [--with-drz80],
546                 [include DrZ80 CPU core [default=auto]]
547         )],
548         [WITH_DRZ80=$withval],
549         [WITH_DRZ80=$USE_ARM_ASM]
551 AS_IF(
552         [test "x$WITH_DRZ80" = xyes -a "x$USE_ARM_ASM" = xno],
553         [AC_MSG_FAILURE(
554                 [DrZ80 can only be enabled on ARM targets with a \
555 working ASM support]
556         )]
559 dnl Check if debugger should be enabled.
560 AC_ARG_ENABLE(
561         [debugger],
562         [AS_HELP_STRING(
563                 [--enable-debugger],
564                 [enable debugger [default=no]]
565         )],
566         [USE_DEBUGGER=$enableval],
567         [USE_DEBUGGER=no]
570 dnl Check if dZ80 is to be included.
571 AC_ARG_WITH(
572         [dz80],
573         [AS_HELP_STRING(
574                 [--with-dz80],
575                 [include dZ80 disassembler in debugger [default=auto]],
576         )],
577         [WITH_DZ80=$withval],
578         [WITH_DZ80=$USE_DEBUGGER]
580 AS_IF(
581         [test "x$WITH_DZ80" = xyes -a "x$USE_DEBUGGER" != xyes],
582         [AC_MSG_FAILURE([dZ80 is only meaningful if debugger is also enabled])]
585 dnl Check if VDP debugging should be enabled.
586 AC_ARG_ENABLE(
587         [debug-vdp],
588         [AS_HELP_STRING(
589                 [--enable-debug-vdp],
590                 [enable extra debugging for the VDP [default=auto]]
591         )],
592         [USE_DEBUG_VDP=$enableval],
593         [USE_DEBUG_VDP=auto]
595 AS_IF(
596         [test "x$USE_DEBUG_VDP" != xno -a "x$USE_DEBUG_VDP" != xyes],
597         [AS_IF(
598                 [test "x$USE_DEBUG" = xyes -o "x$USE_DEBUGGER" = xyes],
599                 [USE_DEBUG_VDP=yes],
600                 [USE_DEBUG_VDP=no]
601         )]
604 dnl Check if Sega Pico emulation should be enabled.
605 AC_ARG_ENABLE(
606         [pico],
607         [AS_HELP_STRING(
608                 [--enable-pico],
609                 [enable Sega Pico emulation (experimental) [default=no]]
610         )],
611         [USE_PICO=$enableval],
612         [USE_PICO=no]
615 dnl Check if VGM dumping functionality should be enabled.
616 AC_ARG_ENABLE(
617         [vgmdump],
618         [AS_HELP_STRING(
619                 [--enable-vgmdump],
620                 [enable VGM dumping [default=no]]
621         )],
622         [USE_VGMDUMP=$enableval],
623         [USE_VGMDUMP=no]
626 dnl Check for Doxygen.
627 AC_ARG_WITH(
628         [doxygen],
629         [AS_HELP_STRING(
630                 [--with-doxygen],
631                 [build Doxygen documentation [default=auto]]
632         )],
633         [WITH_DOXYGEN=$withval],
634         [WITH_DOXYGEN=auto]
636 AS_IF(
637         [test "x$WITH_DOXYGEN" != xno],
638         [AC_CHECK_PROGS([DOXYGEN], [doxygen])]
639         [AS_IF(
640                 [test "x$DOXYGEN" = x],
641                 [AS_IF(
642                         [test "x$WITH_DOXYGEN" = xyes],
643                         [AC_MSG_FAILURE(
644                                 [Doxygen not found, try --without-doxygen.]
645                         )],
646                         [WITH_DOXYGEN=no]
647                 )],
648                 [WITH_DOXYGEN=yes]
649         )]
652 dnl Prevent dgen_tobin from being linked with unnecessary libraries.
653 DGEN_LIBS="$LIBS"
654 LIBS="$TOBIN_LIBS"
656 dnl Define everything.
657 AS_IF([test "x$USE_OPENGL" = xyes], [AC_DEFINE([WITH_OPENGL])])
658 AS_IF([test "x$USE_LIBARCHIVE" = xyes], [AC_DEFINE([WITH_LIBARCHIVE])])
659 AS_IF([test "x$USE_DEBUGGER" = xyes], [AC_DEFINE([WITH_DEBUGGER])])
660 AS_IF([test "x$WITH_DZ80" = xyes], [AC_DEFINE([WITH_DZ80])])
661 AS_IF([test "x$USE_DEBUG" != xyes], [AC_DEFINE([NDEBUG])])
662 AS_IF([test "x$USE_DEBUG_VDP" = xyes], [AC_DEFINE([WITH_DEBUG_VDP])])
663 AS_IF([test "x$USE_PICO" = xyes], [AC_DEFINE([WITH_PICO])])
664 AS_IF([test "x$USE_VGMDUMP" = xyes], [AC_DEFINE([WITH_VGMDUMP])])
665 AS_IF([test "x$USE_JOYSTICK" = xyes], [AC_DEFINE([WITH_JOYSTICK])])
666 AS_IF([test "x$USE_THREADS" = xyes], [AC_DEFINE([WITH_THREADS])])
667 AS_IF([test "x$WITH_MUSA" = xyes], [AC_DEFINE([WITH_MUSA])])
668 AS_IF([test "x$WITH_STAR" = xyes], [AC_DEFINE([WITH_STAR])])
669 AS_IF([test "x$WITH_MZ80" = xyes], [AC_DEFINE([WITH_MZ80])])
670 AS_IF([test "x$WITH_CZ80" = xyes], [AC_DEFINE([WITH_CZ80])])
671 AS_IF([test "x$WITH_DRZ80" = xyes], [AC_DEFINE([WITH_DRZ80])])
672 AS_IF([test "x$WITH_CYCLONE" = xyes], [AC_DEFINE([WITH_CYCLONE])])
673 AS_IF([test "x$USE_ASM" = xyes], [AC_DEFINE([WITH_ASM])])
674 AS_IF(
675         [test "x$USE_X86_ASM" = xyes],
676         [AC_DEFINE([WITH_X86_ASM])]
677         [AC_DEFINE([HAVE_MEMCPY_H])]
679 AS_IF([test "x$USE_CTV" = xyes], [AC_DEFINE([WITH_CTV])])
680 AS_IF([test "x$USE_HQX" = xyes], [AC_DEFINE([WITH_HQX])])
681 AS_IF([test "x$USE_SCALE2X" = xyes], [AC_DEFINE([WITH_SCALE2X])])
682 AS_IF([test "x$USE_X86_MZ80" = xyes], [AC_DEFINE([WITH_X86_MZ80])])
683 AS_IF([test "x$USE_X86_MMX" = xyes], [AC_DEFINE([WITH_X86_MMX])])
684 AS_IF([test "x$USE_X86_CTV" = xyes], [AC_DEFINE([WITH_X86_CTV])])
685 AS_IF([test "x$USE_X86_TILES" = xyes], [AC_DEFINE([WITH_X86_TILES])])
687 AM_CONDITIONAL([WITH_DEBUG_VDP], [test "x$USE_DEBUG_VDP" = xyes])
688 AM_CONDITIONAL([WITH_PICO], [test "x$USE_PICO" = xyes])
689 AM_CONDITIONAL([WITH_VGMDUMP], [test "x$USE_VGMDUMP" = xyes])
690 AM_CONDITIONAL([WITH_DEBUGGER], [test "x$USE_DEBUGGER" = xyes])
691 AM_CONDITIONAL([WITH_DZ80], [test "x$WITH_DZ80" = xyes])
692 AM_CONDITIONAL([WITH_CTV], [test "x$USE_CTV" = xyes])
693 AM_CONDITIONAL([WITH_HQX], [test "x$USE_HQX" = xyes])
694 AM_CONDITIONAL([WITH_SCALE2X], [test "x$USE_SCALE2X" = xyes])
695 AM_CONDITIONAL([WITH_MUSA], [test "x$WITH_MUSA" = xyes])
696 AM_CONDITIONAL([WITH_STAR], [test "x$WITH_STAR" = xyes])
697 AM_CONDITIONAL([WITH_MZ80], [test "x$WITH_MZ80" = xyes])
698 AM_CONDITIONAL([WITH_CZ80], [test "x$WITH_CZ80" = xyes])
699 AM_CONDITIONAL([WITH_DRZ80], [test "x$WITH_DRZ80" = xyes])
700 AM_CONDITIONAL([WITH_CYCLONE], [test "x$WITH_CYCLONE" = xyes])
701 AM_CONDITIONAL([WITH_X86_ASM], [test "x$USE_X86_ASM" = xyes])
702 AM_CONDITIONAL([WITH_X86_MZ80], [test "x$USE_X86_MZ80" = xyes])
703 AM_CONDITIONAL([WITH_X86_MMX], [test "x$USE_X86_MMX" = xyes])
704 AM_CONDITIONAL([WITH_X86_CTV], [test "x$USE_X86_CTV" = xyes])
705 AM_CONDITIONAL([WITH_X86_TILES], [test "x$USE_X86_TILES" = xyes])
706 AM_CONDITIONAL([WITH_DOXYGEN], [test "x$WITH_DOXYGEN" = xyes])
707 AM_COND_IF([WITH_DOXYGEN], [AC_CONFIG_FILES([doc/Doxyfile])])
709 AC_SUBST(CC_FOR_BUILD)
710 AC_SUBST(CXX_FOR_BUILD)
711 AC_SUBST(CPPFLAGS_FOR_BUILD)
712 AC_SUBST(CFLAGS_FOR_BUILD)
713 AC_SUBST(CXXFLAGS_FOR_BUILD)
714 AC_SUBST(LDFLAGS_FOR_BUILD)
715 AC_SUBST(OBJEXT_FOR_BUILD)
716 AC_SUBST(EXEEXT_FOR_BUILD)
717 AC_SUBST(NASM)
718 AC_SUBST(NASM_FORMAT)
719 AC_SUBST(DGEN_LIBS)
721 dnl The following shuts up automake when overriding *FLAGS macros.
722 CPPFLAGS_B=CPPFLAGS
723 CFLAGS_B=CFLAGS
724 CXXFLAGS_B=CXXFLAGS
725 LDFLAGS_B=LDFLAGS
726 AC_SUBST(CPPFLAGS_B)
727 AC_SUBST(CFLAGS_B)
728 AC_SUBST(CXXFLAGS_B)
729 AC_SUBST(LDFLAGS_B)
731 dnl Done!
732 AC_OUTPUT(
733         [Makefile]
734         [star/Makefile]
735         [musa/Makefile]
736         [cyclone/Makefile]
737         [mz80/Makefile]
738         [sdl/Makefile]
739         [doc/Makefile]
742 AC_MSG_NOTICE([
744 Front-end
745   OpenGL: $USE_OPENGL
746   Joystick: $USE_JOYSTICK
747   Multi-threading: $USE_THREADS
748   Crap TV filters: $USE_CTV
749   hqx filters: $USE_HQX
750   scale2x filters: $USE_SCALE2X
751   Compressed ROMs: $USE_LIBARCHIVE
752   Debugger: $USE_DEBUGGER
753   dZ80 disassembler: $WITH_DZ80
754   Debugging: $USE_DEBUG
755   VDP debugging: $USE_DEBUG_VDP
756   Sega Pico: $USE_PICO
757   VGM dumping: $USE_VGMDUMP
759 CPU cores
760   Musashi M68K: $WITH_MUSA
761   StarScream: $WITH_STAR
762   Cyclone: $WITH_CYCLONE
763   MZ80: $WITH_MZ80
764   CZ80: $WITH_CZ80
765   DrZ80: $WITH_DRZ80
767 ASM support ($USE_ASM)
768   x86 ASM
769     MZ80: $USE_X86_MZ80
770     MMX memcpy: $USE_X86_MMX
771     Crap TV filters: $USE_X86_CTV
772     Tiles: $USE_X86_TILES
773   ARM ASM
774     Cyclone: $WITH_CYCLONE
775     DrZ80: $WITH_DRZ80
777 Doxygen documentation: $WITH_DOXYGEN