1 dnl Process this file with autoconf to produce a configure script.
4 AC_CANONICAL_TARGET([])
7 AM_INIT_AUTOMAKE(scorched3d, 41)
16 LDFLAGS="-L/usr/X11R6/lib -L/usr/X11R6"
17 CPPFLAGS="-I/usr/X11R6/include -I/usr/X11R6"
19 if test `uname` == Darwin; then
20 LDFLAGS="$LDFLAGS -lmx"
21 CPPFLAGS="$CPPFLAGS -DFFTW_USE_DOUBLE -D__DARWIN__ -D__MACOSX__"
23 LDFLAGS="$LDFLAGS -L/usr/local/lib"
24 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
27 AC_CHECK_LIB(fridge, beer, echo "Hmm?!",[
28 echo "Warning: No beer found in fridge!";
29 echo "We highly suggest that you rectify this situation immediately."
32 AC_ARG_ENABLE(serveronly,
33 [ --enable-serveronly Enable server only compilation],
34 , enable_serveronly=no,
35 enable_serveronly=yes)
37 # Include the other configuration files
38 if test "x$enable_serveronly" = "xno" ; then
39 m4_include([configure-gl.m4])
40 m4_include([configure-al.m4])
41 m4_include([configure-wx.m4])
42 m4_include([configure-ogg.m4])
43 m4_include([configure-ft.m4])
44 m4_include([configure-fftw.m4])
45 S3D_SUBDIRS="launcher client server"
49 m4_include([configure-sdl.m4])
50 m4_include([configure-flt.m4])
51 m4_include([configure-sql.m4])
55 dnl Checks for Profiling
56 AC_MSG_CHECKING(for profiling enabled)
57 AC_ARG_ENABLE(profiling,
58 [ --enable-profiling Enable gprof code profiling],
59 , enable_profiling=no,
61 if test "x$enable_profiling" = "xyes" ; then
64 CPPFLAGS="$CPPFLAGS -pg"
65 CXXFLAGS="$CXXFLAGS -pg"
67 AC_MSG_RESULT($enable_profiling)
69 # Check for extra functions
70 AC_CHECK_FUNCS(vsnprintf snprintf vasprintf asprintf iconv)
72 # Check for extra headers
73 AC_CHECK_HEADERS(unistd.h iconv.h)
76 dnl Checking for Zlib Png Jpeg
77 if test `uname` == Darwin; then
78 LIBS="$LIBS -lexpat -lz -framework UnixImageIO"
80 LIBS="$LIBS -lexpat -lz -lpng -ljpeg"
83 # Directory setup stuff
86 AC_HELP_STRING([--with-docdir=DIR],
87 [Use DIR to store documentation files (default DATADIR)]),
88 [with_docdir=$withval])
89 if test "x$with_docdir" = "x" ; then
90 docdir='${datadir}/documentation'
96 AC_PREFIX_DEFAULT(/usr/local/games/scorched3d)
97 if test `uname` == Darwin; then
101 CFLAGS="$CFLAGS -DS3D_DOCDIR=\\\"${docdir}\\\" -DS3D_DATADIR=\\\"${datadir}\\\" -DS3D_BINDIR=\\\"${bindir}\\\""
102 CXXFLAGS="$CXXFLAGS -DS3D_DOCDIR=\\\"${docdir}\\\" -DS3D_DATADIR=\\\"${datadir}\\\" -DS3D_BINDIR=\\\"${bindir}\\\""
104 # put here at end because of sdl.m4 not defining
107 # Finally create all the generated files
111 src/launcher/Makefile
112 src/launcher/scorched/Makefile
114 src/client/scorchedc/Makefile
116 src/server/scorcheds/Makefile