nkeynes@1 | 1 | dnl Process this file with autoconf to produce a configure script.
|
nkeynes@1 | 2 |
|
nkeynes@1 | 3 | AC_INIT(configure.in)
|
nkeynes@503 | 4 | AM_INIT_AUTOMAKE(lxdream, 0.8.1)
|
nkeynes@1 | 5 | AM_MAINTAINER_MODE
|
nkeynes@1 | 6 | AM_CONFIG_HEADER(config.h)
|
nkeynes@1 | 7 |
|
nkeynes@1 | 8 | AC_ISC_POSIX
|
nkeynes@1 | 9 | AC_PROG_CC
|
nkeynes@1 | 10 | AM_PROG_CC_STDC
|
nkeynes@586 | 11 | AM_PROG_AS
|
nkeynes@1 | 12 | AC_HEADER_STDC
|
nkeynes@521 | 13 | AC_CANONICAL_BUILD
|
nkeynes@521 | 14 | AC_CANONICAL_HOST
|
nkeynes@586 | 15 | AC_ARG_ENABLE( trace,
|
nkeynes@586 | 16 | AS_HELP_STRING( [--enable-trace], [Enable generation of IO traces (warning: hurts performance)]),
|
nkeynes@586 | 17 | [if test "$enableval" == "yes"; then
|
nkeynes@586 | 18 | AC_DEFINE(ENABLE_TRACE_IO, 1, [Enable IO tracing])
|
nkeynes@586 | 19 | fi] )
|
nkeynes@586 | 20 | AC_ARG_ENABLE( watch,
|
nkeynes@586 | 21 | AS_HELP_STRING( [--enable-watch], [Enable watchpoints in the debugger (warning: hurts performance)]),
|
nkeynes@586 | 22 | [if test "$enableval" == "yes"; then
|
nkeynes@586 | 23 | AC_DEFINE(ENABLE_WATCH, 1, [Enable watchpoints])
|
nkeynes@586 | 24 | fi] )
|
nkeynes@653 | 25 | AC_ARG_WITH( osmesa,
|
nkeynes@653 | 26 | AS_HELP_STRING( [--with-osmesa], [Build with the osmesa GL library (software rendering)]),
|
nkeynes@653 | 27 | [], [with_osmesa=no])
|
nkeynes@653 | 28 |
|
nkeynes@653 | 29 | AS_IF([test "x$with_osmesa" != xno], [
|
nkeynes@653 | 30 | AC_CHECK_LIB([OSMesa], [OSMesaCreateContext], [],
|
nkeynes@653 | 31 | [AC_MSG_FAILURE( [--with-osmesa was given, but OSMesa library could not be found])])
|
nkeynes@653 | 32 | AC_CHECK_HEADER([GL/osmesa.h], [],
|
nkeynes@653 | 33 | [AC_MSG_FAILURE( [--with-osmesa was given, but osmesa.h could not be found])])
|
nkeynes@653 | 34 | ])
|
nkeynes@653 | 35 | AM_CONDITIONAL(OSMESA_DRIVER, [test "x$with_osmesa" != xno])
|
nkeynes@653 | 36 |
|
nkeynes@537 | 37 | dnl ----------- Check for mandatory dependencies --------------
|
nkeynes@539 | 38 | dnl Building on MAC?
|
nkeynes@539 | 39 | AC_CHECK_HEADER([Carbon/Carbon.h], [
|
nkeynes@539 | 40 | HAVE_CARBON='yes'
|
nkeynes@539 | 41 | APPLE_BUILD='yes'
|
nkeynes@542 | 42 | LIBS="$LIBS -framework OpenGL -framework AGL -framework Carbon -L/usr/X11R6/lib -lGL"
|
nkeynes@539 | 43 | AC_DEFINE(HAVE_CARBON,[1],[Have Carbon framework])
|
nkeynes@539 | 44 | AC_DEFINE(APPLE_BUILD,[1],[Building on an apple platform. Things are different...])
|
nkeynes@539 | 45 | ])
|
nkeynes@539 | 46 |
|
nkeynes@537 | 47 | dnl Check for libpng (required)
|
nkeynes@537 | 48 | PKG_CHECK_MODULES(LIBPNG, [libpng] )
|
nkeynes@529 | 49 |
|
nkeynes@539 | 50 | dnl Implied by libpng, but check explicitly just in case
|
nkeynes@539 | 51 | AC_CHECK_LIB(z, uncompress, [], [
|
nkeynes@539 | 52 | echo "Zlib (libz.so) could not be found, but is required."
|
nkeynes@539 | 53 | exit 1])
|
nkeynes@539 | 54 |
|
nkeynes@539 | 55 | if test "$APPLE_BUILD" != 'yes'; then
|
nkeynes@653 | 56 | if test "x$with_osmesa" == "xno"; then
|
nkeynes@487 | 57 | AC_CHECK_LIB(GL, glXQueryVersion, [], [
|
nkeynes@487 | 58 | echo "The OpenGL library (libGL.so) could not be found, but is required."
|
nkeynes@487 | 59 | exit 1])
|
nkeynes@521 | 60 | AC_CHECK_HEADER([GL/gl.h], [], [
|
nkeynes@521 | 61 | echo "The OpenGL header files (eg GL/gl.h) could not be found, but are required."
|
nkeynes@521 | 62 | exit 1])
|
nkeynes@539 | 63 | fi
|
nkeynes@653 | 64 | fi
|
nkeynes@537 | 65 |
|
nkeynes@656 | 66 | AC_CHECK_FUNC(glGenFramebuffersEXT, [ AC_DEFINE([HAVE_OPENGL_FBO],1,[Have EXT_framebuffer_object support]) ], [])
|
nkeynes@656 | 67 | AC_CHECK_FUNC(glCreateShader, [ AC_DEFINE([HAVE_OPENGL_SHADER],1,[Have 2.0 shader support]) ], [])
|
nkeynes@656 | 68 | AC_CHECK_FUNC(glCreateShaderObjectARB, [ AC_DEFINE([HAVE_OPENGL_SHADER_ARB],1,[Have ARB shader support]) ], [])
|
nkeynes@656 | 69 |
|
nkeynes@537 | 70 | dnl Check for GTK (required for unix systems)
|
nkeynes@539 | 71 | PKG_CHECK_MODULES(GTK, gtk+-2.0, [
|
nkeynes@539 | 72 | HAVE_GTK='yes'
|
nkeynes@539 | 73 | AC_DEFINE([HAVE_GTK],1,[Have GTK libraries])
|
nkeynes@539 | 74 | ])
|
nkeynes@539 | 75 |
|
nkeynes@539 | 76 | AM_CONDITIONAL(GUI_CARBON, [test "$HAVE_CARBON" = 'yes'])
|
nkeynes@537 | 77 | AM_CONDITIONAL(GUI_GTK, [test "$HAVE_GTK" = 'yes'])
|
nkeynes@521 | 78 |
|
nkeynes@521 | 79 | dnl Check for a supported cpu target for translation purposes
|
nkeynes@521 | 80 | case $host_cpu in
|
nkeynes@526 | 81 | i386|i486|i586|i686)
|
nkeynes@526 | 82 | SH4_TRANSLATOR="x86"
|
nkeynes@528 | 83 | AC_DEFINE_UNQUOTED(SH4_TRANSLATOR,[TARGET_X86], [SH4 Translator to use (if any)] );;
|
nkeynes@526 | 84 | x86_64)
|
nkeynes@526 | 85 | SH4_TRANSLATOR="x86_64"
|
nkeynes@528 | 86 | AC_DEFINE_UNQUOTED(SH4_TRANSLATOR,[TARGET_X86_64], [SH4 Translator to use (if any)] );;
|
nkeynes@521 | 87 | *)
|
nkeynes@521 | 88 | echo "Warning: No translator available for $host. Building emulation core only";;
|
nkeynes@521 | 89 | esac
|
nkeynes@526 | 90 | AM_CONDITIONAL(BUILD_SH4X86, [test "$SH4_TRANSLATOR" = "x86" -o "$SH4_TRANSLATOR" = "x86_64"])
|
nkeynes@586 | 91 | AM_CONDITIONAL(BUILD_X86_64, [test "$SH4_TRANSLATOR" = "x86_64"])
|
nkeynes@94 | 92 |
|
nkeynes@537 | 93 | dnl ------------------ Optional driver support -------------------
|
nkeynes@537 | 94 | dnl Check for esound
|
nkeynes@537 | 95 | PKG_CHECK_MODULES(ESOUND, [esound], [
|
nkeynes@537 | 96 | HAVE_ESOUND='yes'
|
nkeynes@537 | 97 | AC_DEFINE([HAVE_ESOUND],1,[Have esound support]) ],
|
bhaal22@643 | 98 | [ echo "Warning: esound not found - building without esd audio support" ])
|
nkeynes@537 | 99 | AM_CONDITIONAL( AUDIO_ESOUND, [test "$HAVE_ESOUND" = 'yes'] )
|
nkeynes@537 | 100 |
|
bhaal22@643 | 101 | dnl Check for alsa support
|
bhaal22@643 | 102 | PKG_CHECK_MODULES(ALSA, [alsa], [
|
bhaal22@643 | 103 | HAVE_ALSA='yes'
|
bhaal22@643 | 104 | AC_DEFINE([HAVE_ALSA],1,[Have alsa support]) ],
|
bhaal22@643 | 105 | [ echo "Warning: alsa not found - building without alsa audio support" ])
|
bhaal22@643 | 106 | AM_CONDITIONAL( AUDIO_ALSA, [test "$HAVE_ALSA" = 'yes'] )
|
bhaal22@643 | 107 |
|
nkeynes@537 | 108 | dnl Check for linux cdrom device support
|
nkeynes@489 | 109 | AC_CHECK_HEADER([linux/cdrom.h], [HAVE_LINUX_CDROM_H=yes], [
|
nkeynes@489 | 110 | echo "Linux CDROM support not found, building without it."] )
|
nkeynes@489 | 111 | AM_CONDITIONAL(CDROM_LINUX, [test "$HAVE_LINUX_CDROM_H" = "yes"])
|
nkeynes@489 | 112 |
|
nkeynes@614 | 113 | AC_CHECK_HEADER([linux/joystick.h], [
|
nkeynes@614 | 114 | HAVE_LINUX_JOYSTICK_H=yes
|
nkeynes@614 | 115 | AC_DEFINE([HAVE_LINUX_JOYSTICK], 1, [Have linux joystick support]) ],
|
nkeynes@614 | 116 | [ echo "Linux Joystick support not found, building without it."] )
|
nkeynes@614 | 117 | AM_CONDITIONAL(JOY_LINUX, [test "$HAVE_LINUX_JOYSTICK_H" = "yes"])
|
nkeynes@614 | 118 |
|
nkeynes@537 | 119 | dnl Check for cross-compiler availability - needed for system tests
|
nkeynes@521 | 120 | AC_PATH_PROG(SHCC, [sh-elf-gcc])
|
nkeynes@521 | 121 | AC_PATH_PROG(SHLD, [sh-elf-ld])
|
nkeynes@521 | 122 | AC_PATH_PROG(SHOBJCOPY, [sh-elf-objcopy])
|
nkeynes@521 | 123 | AC_PATH_PROG(ARMCC, [arm-elf-gcc])
|
nkeynes@521 | 124 | AC_PATH_PROG(ARMLD, [arm-elf-ld])
|
nkeynes@521 | 125 | AC_PATH_PROG(ARMOBJCOPY, [arm-elf-objcopy])
|
nkeynes@521 | 126 |
|
nkeynes@521 | 127 | if test "x$SHCC" = "x" -o "x$SHLD" = "x" -o "x$SHOBJCOPY" = "x"; then
|
nkeynes@521 | 128 | BUILD_SH="no"
|
nkeynes@521 | 129 | echo "Warning: SH4 cross-compiler not found, system tests will be disabled."
|
nkeynes@521 | 130 | else
|
nkeynes@521 | 131 | BUILD_SH="yes"
|
nkeynes@521 | 132 | fi
|
nkeynes@521 | 133 | if test "x$ARMCC" = "x" -o "x$ARMLD" = "x" -o "x$ARMOBJCOPY" = "x"; then
|
nkeynes@521 | 134 | BUILD_ARM="no"
|
nkeynes@521 | 135 | echo "Warning: ARM cross-compiler not found, AICA tests will be disabled."
|
nkeynes@521 | 136 | else
|
nkeynes@521 | 137 | BUILD_ARM="yes"
|
nkeynes@521 | 138 | fi
|
nkeynes@521 | 139 | AM_CONDITIONAL(BUILD_SYSTEST, [test "$BUILD_SH" = "yes"])
|
nkeynes@521 | 140 | AM_CONDITIONAL(BUILD_ARMTEST, [test "$BUILD_ARM" = "yes"])
|
nkeynes@521 | 141 |
|
nkeynes@537 | 142 |
|
nkeynes@537 | 143 | dnl ----------------------- All done, finish up -----------------------
|
nkeynes@503 | 144 | GETTEXT_PACKAGE=lxdream
|
nkeynes@1 | 145 | AC_SUBST(GETTEXT_PACKAGE)
|
nkeynes@529 | 146 | AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE",[translation domain])
|
nkeynes@1 | 147 |
|
nkeynes@1 | 148 | dnl Add the languages which your application supports here.
|
nkeynes@509 | 149 | ALL_LINGUAS="de pt_BR"
|
nkeynes@1 | 150 | AM_GLIB_GNU_GETTEXT
|
nkeynes@1 | 151 |
|
nkeynes@1 | 152 | AC_OUTPUT([
|
nkeynes@1 | 153 | Makefile
|
nkeynes@1 | 154 | src/Makefile
|
nkeynes@1 | 155 | po/Makefile.in
|
nkeynes@521 | 156 | test/Makefile
|
nkeynes@1 | 157 | ])
|
nkeynes@1 | 158 |
|