# Process this file with autoconf to produce a configure script. AC_INIT AC_CONFIG_SRCDIR([src/emu.c]) AC_CANONICAL_TARGET([]) AM_CONFIG_HEADER(config.h) AM_INIT_AUTOMAKE(gngeo,0.7) # devel version #AM_INIT_AUTOMAKE(gngeo,20060711) # it's not optimal, but at least, it work if test -z "$CC_FOR_BUILD"; then CC_FOR_BUILD=gcc fi AC_SUBST(CC_FOR_BUILD) # Humm is this a good idea? CFLAGS="" #echo $CC # Checks for programs. AC_PROG_CC AC_PROG_RANLIB #echo $CC CC_VERSION=`$CC -dumpversion` CC_MAJOR=`echo $CC_VERSION|sed 's/\..*$//'` #echo major $CC_MAJOR major # Checks for libraries. #AC_SUBST(LIBOBJS) AC_CHECK_LIB([m], [acos]) AC_CHECK_LIB([z], [gzopen],,AC_MSG_ERROR(can't find zlib on your system)) AC_ARG_ENABLE(gp2x, [ --enable-gp2x Enable GP2X build], [enable_gp2x="$enableval"],[enable_gp2x="false"]) echo GP2X $enable_gp2x if test "$enable_gp2x" = yes ; then CFLAGS="$CFLAGS -DGP2X -mtune=arm920t" enable_gp2x=true AC_CHECK_PROG(SDL_CONFIG, arm-linux-sdl-config, yes,no) if test "$SDL_CONFIG" = yes ; then CFLAGS="$CFLAGS `arm-linux-sdl-config --cflags` "; LIBS="$LIBS `arm-linux-sdl-config --libs` -lpthread -static"; AC_CHECK_LIB([SDL], [SDL_Init],,AC_MSG_ERROR(can't find gp2x SDL on your system)) else AC_MSG_ERROR(can't find arm-linux-sdl-config on your system); fi else AC_CHECK_PROG(SDL_CONFIG, sdl-config, yes,no) if test "$SDL_CONFIG" = yes ; then CFLAGS="$CFLAGS `sdl-config --cflags`"; LIBS="$LIBS `sdl-config --libs`"; AC_CHECK_LIB([SDL], [SDL_Init],,AC_MSG_ERROR(can't find SDL on your system)) else AC_MSG_ERROR(can't find sdl-config on your system); fi enable_gp2x=false fi AC_CHECK_LIB([SDL_image], [IMG_Load]) AC_CHECK_FUNCS(getopt_long , , [ AC_LIBOBJ(getopt) AC_LIBOBJ(getopt1) ]) AC_CHECK_FUNCS(scandir) have_nasm=false use_starscream=false use_raze=false use_generator68k=false use_cyclone=false use_mamez80=false choice_68k=ko choice_z80=ko AC_ARG_ENABLE(starscream, [ --enable-star use starscream as 68k emu (need nasm, i386 only)], [use_starscream=true;choice_68k=ok], [use_starscream=false]) AC_ARG_ENABLE(gen68k, [ --enable-gen68k use generator68k as 68k emu (portable C)], [use_generator68k=true;choice_68k=ok], [use_generator68k=false]) AC_ARG_ENABLE(cyclone, [ --enable-cyclone use cyclone as 68k emu (Arm asm)], [use_cyclone=true;choice_68k=ok], [use_cyclone=false]) AC_ARG_ENABLE(raze, [ --enable-raze use raze as z80 emu (need nasm, i386 only)], [use_raze=true;choice_z80=ok], [use_raze=false]) AC_ARG_ENABLE(mamez80, [ --enable-mamez80 use mamez80 as z80 emu (portable C)], [use_mamez80=true;choice_z80=ok], [use_mamez80=false]) AC_ARG_ENABLE(drz80, [ --enable-drz80 use drz80 as z80 emu (Arm asm)], [use_drz80=true;choice_z80=ok], [use_drz80=false]) AC_ARG_ENABLE(gui, [ --enable-gui Enable gui support (experimental)], [enable_gui="$enableval"],[enable_gui="false"]) if test "$enable_gui" = yes ; then CFLAGS="$CFLAGS -DUSE_GUI" enable_gui=true else enable_gui=false fi AC_ARG_ENABLE(gl2, [ --enable-gl2 Use an other opengl blitter (may help some driver)], [enable_gl2="$enableval"],[enable_gl2="false"]) if test "$enable_gl2" = yes ; then CFLAGS="$CFLAGS -DUSE_GL2" fi #echo "CPU68K STAR = $use_starscream $choice_68k" #echo "CPU68K GEN68K = $use_generator68k $choice_68k" #echo "CPUZ80 RAZE = $use_raze $choice_68k" #echo "CPUZ80 MAMEZ80 = $use_mamez80 $choice_68k" # TODO: check mmx support AC_ARG_ENABLE(i386asm, [ --disable-i386asm disable the use of i386 optimisation], [enablei386asm=$enableval],[enablei386asm=yes]) if test "$enablei386asm" = yes ; then AC_CHECK_PROG(NASM, nasm, yes,no) else NASM=no fi if test "$NASM" = yes ; then CFLAGS="$CFLAGS -DI386_ASM" have_nasm=true if test "$choice_68k" = ko ; then use_starscream=true fi if test "$choice_z80" = ko ; then use_raze=true fi echo "Enable i386 optimisation" else have_nasm=false if test "$choice_68k" = ko ; then use_generator68k=true fi if test "$choice_z80" = ko ; then use_mamez80=true fi echo "Disable i386 optimisation" fi if test "$use_starscream" = true ; then CFLAGS="$CFLAGS -DUSE_STARSCREAM" echo "Use Starscream as 68000 core" fi if test "$use_generator68k" = true ; then CFLAGS="$CFLAGS -DUSE_GENERATOR68K" echo "Use Generator68k as 68000 core" fi if test "$use_cyclone" = true ; then CFLAGS="$CFLAGS -DUSE_CYCLONE" echo "Use Cyclone as 68000 core" fi if test "$use_raze" = true ; then CFLAGS="$CFLAGS -DUSE_RAZE" echo "Use Raze as Z80 core" fi if test "$use_mamez80" = true ; then CFLAGS="$CFLAGS -DUSE_MAMEZ80" echo "Use MameZ80 as Z80 core" fi if test "$use_drz80" = true ; then CFLAGS="$CFLAGS -DUSE_DRZ80" echo "Use DrZ80 as Z80 core" fi AM_CONDITIONAL(HAVE_NASM,$have_nasm) AM_CONDITIONAL(USE_STARSCREAM,$use_starscream) AM_CONDITIONAL(USE_RAZE,$use_raze) AM_CONDITIONAL(USE_GENERATOR68K,$use_generator68k) AM_CONDITIONAL(USE_CYCLONE,$use_cyclone) AM_CONDITIONAL(USE_MAMEZ80,$use_mamez80) AM_CONDITIONAL(USE_DRZ80,$use_drz80) AM_CONDITIONAL(USE_GUI,$enable_gui) AM_CONDITIONAL(USE_GP2X,$enable_gp2x) # Checks for header files. AC_HEADER_DIRENT AC_HEADER_STDC AC_CHECK_HEADERS([errno.h limits.h malloc.h stddef.h stdlib.h string.h sys/time.h unistd.h]) # Checks for typedefs, structures, and compiler characteristics. AC_C_CONST AC_C_INLINE AC_HEADER_TIME AC_STRUCT_TM AC_C_BIGENDIAN # Checks for library functions. AC_FUNC_VPRINTF AC_CHECK_FUNCS([atexit floor gettimeofday memset mkdir pow strchr strstr strtoul]) # CFLAGS="$CFLAGS -DFULL_GL" # LIBS="$LIBS -lGL" #echo target_cpu: $target_cpu dnl Check for processor. case $target_cpu in i?86) AC_MSG_RESULT(Turning on x86 processor optimisations) AC_DEFINE(PROCESSOR_INTEL, 1, [Define if you have an x86 processor]) ALIGNLONGS=0 if test $CC_MAJOR -ge 3 ; then CFLAGS="$CFLAGS -O3 -fstrength-reduce -frerun-loop-opt -Wall -Wno-unused -funroll-loops \ -ffast-math -falign-functions=2 -falign-jumps=2 -fexpensive-optimizations \ -falign-loops=2 -fschedule-insns2 -malign-double -fomit-frame-pointer -g \ -fno-strict-aliasing -pipe -mtune=$target_cpu -DCPU=$target_cpu" else CFLAGS="$CFLAGS -O3 -fstrength-reduce -frerun-loop-opt -Wall -Wno-unused -funroll-loops \ -ffast-math -malign-functions=2 -malign-jumps=2 -fexpensive-optimizations \ -malign-loops=2 -fschedule-insns2 -malign-double -fomit-frame-pointer -g \ -fno-strict-aliasing -pipe -mcpu=$target_cpu -DCPU=$target_cpu" fi ;; sparc*) AC_MSG_RESULT(Turning on sparc processor optimisations) AC_DEFINE(PROCESSOR_SPARC, 1, [Define if you have a sparc processor]) ALIGNLONGS=1 if test $target_cpu = sparc64 && test $CC_MAJOR -ge 3 ; then CFLAGS="$CFLAGS -mcpu=v9" fi CFLAGS="$CFLAGS -O3 -Wall -Wno-unused -funroll-loops \ -ffast-math -fomit-frame-pointer -g" ;; arm) AC_MSG_RESULT(Turning on arm processor optimisations) #AC_DEFINE(PROCESSOR_ARM, 1, [Define if you have an ARM processor]) ALIGNLONGS=1 CFLAGS="$CFLAGS -O3 -Wall -ftracer -fstrength-reduce -Wno-unused -funroll-loops \ -fomit-frame-pointer -fstrict-aliasing -ffast-math \ " #CFLAGS="$CFLAGS -O2 -Wall -ftracer -fstrength-reduce -Wno-unused \ # -fomit-frame-pointer -fstrict-aliasing -ffast-math \ # " #CFLAGS="$CFLAGS -pg -g -O2 -fno-omit-frame-pointer -funroll-loops -ffast-math -Wall -Wno-unused " ;; *) AC_MSG_WARN(Processor type not known - Use generic optimisations) ALIGNLONGS=1 optimum=no CFLAGS="$CFLAGS -O3 -Wall -Wno-unused -funroll-loops \ -ffast-math -g" ;; esac AC_DEFINE(ALIGNLONGS, ALIGNLONGS, [Undefine if your processor can read unaligned 32-bit values]) #dnl Arch #echo "Target : $target" #echo "Build : $build" #echo "Host : $host" #CFLAGS="$CFLAGS -O3 -Wall -Wno-unused -funroll-loops \ # -ffast-math -malign-functions=4 -malign-jumps=4 \ # -malign-loops=4 -g -pg" AC_CONFIG_FILES([Makefile src/Makefile src/raze/Makefile src/star/Makefile src/mamez80/Makefile src/generator68k/Makefile src/cyclone/Makefile src/drz80/Makefile src/effect/Makefile src/blitter/Makefile src/ym2610/Makefile src/gui/Makefile romrc.d/Makefile data/Makefile]) AC_OUTPUT