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