2007-06-28 10:47:08 -07:00
|
|
|
# Process this file with autoconf to produce a configure script.
|
|
|
|
|
2006-06-30 08:37:31 -07:00
|
|
|
AC_PREREQ(2.56)
|
2006-06-21 03:46:56 -07:00
|
|
|
AC_INIT([warzone],[2.0.3],[http://gna.org/projects/warzone])
|
2007-06-28 10:47:08 -07:00
|
|
|
AC_CONFIG_SRCDIR([lib/gamelib/anim.h])
|
|
|
|
AC_CONFIG_HEADER([config.h])
|
|
|
|
|
|
|
|
AM_INIT_AUTOMAKE
|
|
|
|
|
|
|
|
# Checks for programs.
|
|
|
|
AC_PROG_CC
|
|
|
|
AC_PROG_RANLIB
|
2006-07-04 15:21:04 -07:00
|
|
|
|
2007-06-28 10:47:08 -07:00
|
|
|
AC_PROG_YACC
|
2006-07-04 15:21:04 -07:00
|
|
|
if test "x$YACC" != "xbison -y" ; then
|
|
|
|
AC_MSG_ERROR([Bison is not installed])
|
|
|
|
fi
|
|
|
|
|
2007-06-28 10:47:08 -07:00
|
|
|
AC_PROG_LEX
|
2006-07-05 13:39:13 -07:00
|
|
|
if test "x$LEX" != "xflex" ; then
|
2006-07-04 15:21:04 -07:00
|
|
|
AC_MSG_ERROR([Flex is not installed])
|
|
|
|
fi
|
2007-06-28 10:47:08 -07:00
|
|
|
|
2006-06-21 03:46:56 -07:00
|
|
|
|
2006-06-29 04:27:14 -07:00
|
|
|
# Commandline options:
|
2007-06-28 10:47:08 -07:00
|
|
|
|
|
|
|
AC_ARG_ENABLE(make_data,
|
|
|
|
[ --disable-make-data do not recurse make into data directories
|
|
|
|
(ok to disable unless you will 'make install')],
|
2006-06-29 04:27:14 -07:00
|
|
|
[ make_data="$enableval" ], [make_data=yes])
|
2006-06-22 07:30:56 -07:00
|
|
|
AC_MSG_CHECKING([whether to make data])
|
2006-06-29 04:27:14 -07:00
|
|
|
AM_CONDITIONAL(MAKE_DATA, test "x$make_data" = "xyes" )
|
|
|
|
if test "x$make_data" = "xyes" ; then
|
2006-06-22 07:30:56 -07:00
|
|
|
AC_MSG_RESULT([yes])
|
|
|
|
else
|
|
|
|
AC_MSG_RESULT([no])
|
|
|
|
fi
|
2007-06-28 10:47:08 -07:00
|
|
|
|
|
|
|
|
|
|
|
AC_ARG_ENABLE(debug,
|
|
|
|
[ --enable-debug run in debug mode],
|
|
|
|
[ debug=$enableval ], [ debug=no ])
|
2006-06-22 07:30:56 -07:00
|
|
|
AC_MSG_CHECKING([whether to compile in debug mode])
|
2006-06-29 04:27:14 -07:00
|
|
|
if test "x$debug" = "xyes" ; then
|
2007-06-28 10:47:08 -07:00
|
|
|
# -O0 turns off all optimizations; this is necessary for accurate debugging
|
2006-07-19 14:51:44 -07:00
|
|
|
WZ_CFLAGS="${WZ_CFLAGS} -g3 -O0 -Wall -DDEBUG"
|
2007-06-28 10:47:08 -07:00
|
|
|
AC_MSG_RESULT([yes])
|
|
|
|
else
|
|
|
|
AC_MSG_RESULT([no])
|
|
|
|
fi
|
|
|
|
|
|
|
|
# --without-opengl will build without opengl
|
2006-07-06 14:45:04 -07:00
|
|
|
# OpenGL is not anymore an option
|
|
|
|
# At least till we got a working software renderer
|
|
|
|
#AC_ARG_WITH(opengl,
|
|
|
|
#[ --with-opengl use OpenGL to accelerate graphics [[auto]]],
|
|
|
|
#[ opengl=$withval ], [ opengl=maybe ])
|
2007-06-28 10:47:08 -07:00
|
|
|
|
|
|
|
# --without-openal will build without OpenAL
|
|
|
|
# Commented out as OpenAL is not curently an option,
|
|
|
|
# but it will need to become optional someday.
|
|
|
|
#AC_ARG_WITH(openal,
|
2006-06-21 03:46:56 -07:00
|
|
|
#[ --with-openal use OpenAL for sound [[auto]]],
|
|
|
|
#[ openal=$withval ], [ openal=maybe ])
|
2007-06-28 10:47:08 -07:00
|
|
|
|
|
|
|
# --without-ogg will build without Ogg vorbis support
|
|
|
|
AC_ARG_WITH(ogg,
|
2006-06-21 03:46:56 -07:00
|
|
|
[ --with-ogg built support for Ogg files [[auto]]],
|
|
|
|
[ ogg=$withval ], [ ogg=maybe ])
|
2007-06-28 10:47:08 -07:00
|
|
|
|
|
|
|
# --without-mp3 will build without MP3 support
|
|
|
|
AC_ARG_WITH(mp3,
|
2006-06-21 03:46:56 -07:00
|
|
|
[ --with-mp3 built support for Mp3 files [[auto]]],
|
|
|
|
[ mp3=$withval ], [ mp3=maybe ])
|
2007-06-28 10:47:08 -07:00
|
|
|
|
|
|
|
# windows conditional
|
|
|
|
case $host_os in
|
2006-06-21 03:46:56 -07:00
|
|
|
*mingw32* )
|
|
|
|
AC_DEFINE(WIN32, 1, [Windows build])
|
|
|
|
WZ_LIBS="${WZ_LIBS} -lmingw32"
|
|
|
|
;;
|
|
|
|
* )
|
|
|
|
;;
|
2007-06-28 10:47:08 -07:00
|
|
|
esac
|
|
|
|
|
|
|
|
dnl WZ_EXPAND_DIR(VARNAME, DIR)
|
|
|
|
dnl expands occurrences of ${prefix} and ${exec_prefix} in the given DIR,
|
|
|
|
dnl and assigns the resulting string to VARNAME
|
|
|
|
dnl example: WZ_EXPAND_DIR(LOCALEDIR, "$datadir/locale")
|
|
|
|
dnl eg, then: AC_DEFINE_UNQUOTED(LOCALEDIR, "$LOCALEDIR")
|
|
|
|
dnl by Alexandre Oliva
|
|
|
|
dnl from http://www.cygnus.com/ml/automake/1998-Aug/0040.html
|
|
|
|
AC_DEFUN([WZ_EXPAND_DIR], [
|
|
|
|
$1=$2
|
|
|
|
$1=`(
|
2006-07-06 14:45:04 -07:00
|
|
|
test "x$prefix" = "xNONE" && prefix="${ac_default_prefix}"
|
|
|
|
test "x$exec_prefix" = "xNONE" && exec_prefix="${prefix}"
|
2007-06-28 10:47:08 -07:00
|
|
|
eval echo \""[$]$1"\"
|
|
|
|
)`
|
|
|
|
])
|
|
|
|
dnl export where the datadir is going to be installed; we will look for
|
|
|
|
dnl $datadir/warzone/warzone.wz
|
2006-01-15 03:40:43 -08:00
|
|
|
WZ_EXPAND_DIR(datadir, "$datadir/warzone")
|
2006-07-06 14:45:04 -07:00
|
|
|
WZ_CFLAGS="${WZ_CFLAGS} -DDEFAULT_DATADIR=\\\"${datadir}\\\""
|
2007-06-28 10:47:08 -07:00
|
|
|
|
2006-06-21 03:46:56 -07:00
|
|
|
|
2006-06-29 04:27:14 -07:00
|
|
|
# Checks for libraries:
|
|
|
|
|
2006-06-21 03:46:56 -07:00
|
|
|
AC_CHECK_LIB(m, pow)
|
|
|
|
|
|
|
|
AC_CHECK_LIB(z, gzgets, , AC_MSG_ERROR([zlib not found.]))
|
|
|
|
AC_CHECK_HEADER(zlib.h, , AC_MSG_ERROR([zlib header not found.]))
|
|
|
|
|
|
|
|
|
|
|
|
# Look for image libs
|
2006-07-06 14:45:04 -07:00
|
|
|
AC_CHECK_LIB(jpeg, main, , AC_MSG_ERROR([libjpeg not found.]))
|
|
|
|
AC_CHECK_HEADER(jpeglib.h, , AC_MSG_ERROR([jpeg header not found.]))
|
|
|
|
AC_CHECK_LIB(png, main, , AC_MSG_ERROR([libpng not found.]))
|
|
|
|
AC_CHECK_HEADER(png.h, , AC_MSG_ERROR([png header not found.]))
|
2006-06-21 03:46:56 -07:00
|
|
|
|
|
|
|
|
|
|
|
# Look for PhysicsFS
|
|
|
|
AC_CHECK_LIB(physfs, PHYSFS_init, , AC_MSG_ERROR([PhysicsFS not found]))
|
|
|
|
AC_CHECK_HEADER(physfs.h, , AC_MSG_ERROR([PhysicsFS header not found]))
|
|
|
|
|
|
|
|
|
|
|
|
AM_PATH_SDL([1.1.4],[
|
|
|
|
WZ_CFLAGS="${WZ_CFLAGS} ${SDL_CFLAGS}" WZ_LIBS="${WZ_LIBS} ${SDL_LIBS}"],
|
|
|
|
AC_MSG_ERROR([SDL is not installed]))
|
2007-06-28 10:47:08 -07:00
|
|
|
|
|
|
|
AC_PATH_SDLNET([
|
2006-06-21 03:46:56 -07:00
|
|
|
WZ_CFLAGS="${WZ_CFLAGS} ${SDLNETINC}" WZ_LIBS="${WZ_LIBS} ${SDLNETLIB}"],
|
|
|
|
AC_MSG_ERROR([SDL_net is not installed]))
|
|
|
|
|
2007-06-28 10:47:08 -07:00
|
|
|
|
2006-06-29 04:27:14 -07:00
|
|
|
if test "x$opengl" != "xno" ; then
|
2007-06-28 10:47:08 -07:00
|
|
|
AC_CHECK_HEADER(GL/gl.h, GL_h=yes, GL_h=no)
|
2005-11-29 08:20:35 -08:00
|
|
|
AC_CHECK_HEADER(GL/glu.h, GLU_h=yes, GLU_h=no)
|
2006-06-21 03:46:56 -07:00
|
|
|
AC_CHECK_LIB(GL, main, GLLIB=GL GL_lib=yes,
|
|
|
|
[AC_CHECK_LIB(opengl32, main, GLLIB=opengl32 GL_lib=yes, GL_lib=no)])
|
|
|
|
AC_CHECK_LIB(GLU, main, GLULIB=GLU GLU_lib=yes,
|
|
|
|
[AC_CHECK_LIB(glu32, main, GLULIB=glu32 GLU_lib=yes, GLU_lib=no)])
|
2006-06-29 04:27:14 -07:00
|
|
|
if test "x$GL_lib" = "xno" -o "x$GLU_lib" = "xno" ; then
|
|
|
|
if test "x$opengl" = "xyes" ; then
|
2005-11-29 08:20:35 -08:00
|
|
|
AC_MSG_ERROR([You need to install OpenGL and GLU.])
|
2007-06-28 10:47:08 -07:00
|
|
|
else
|
|
|
|
opengl=no
|
|
|
|
fi
|
2006-06-29 04:27:14 -07:00
|
|
|
elif test "x$GL_h" = "xno" -o "x$GLU_h" = "xno" ; then
|
|
|
|
if test "x$opengl" = "xyes" ; then
|
2006-06-21 03:46:56 -07:00
|
|
|
AC_MSG_ERROR([You need to install OpenGL and GLU header files (usually a -dev package).])
|
2007-06-28 10:47:08 -07:00
|
|
|
else
|
2006-06-21 03:46:56 -07:00
|
|
|
opengl=no
|
2007-06-28 10:47:08 -07:00
|
|
|
fi
|
2006-06-21 03:46:56 -07:00
|
|
|
else
|
|
|
|
opengl=yes
|
2007-06-28 10:47:08 -07:00
|
|
|
fi
|
|
|
|
fi
|
2006-06-21 03:46:56 -07:00
|
|
|
|
2007-06-28 10:47:08 -07:00
|
|
|
AC_MSG_CHECKING([OpenGL])
|
2006-06-29 04:27:14 -07:00
|
|
|
if test "x$opengl" = "xyes" ; then
|
2006-06-21 03:46:56 -07:00
|
|
|
AC_DEFINE(WZ_OPENGL, 1, [OpenGL acceleration])
|
|
|
|
WZ_LIBS="${WZ_LIBS} -l${GLLIB} -l${GLULIB}"
|
|
|
|
AC_MSG_RESULT([yes])
|
2007-06-28 10:47:08 -07:00
|
|
|
else
|
2006-06-21 03:46:56 -07:00
|
|
|
AC_MSG_RESULT([no])
|
2006-07-06 14:45:04 -07:00
|
|
|
AC_MSG_ERROR([OpenGL is currently mandatory])
|
2007-06-28 10:47:08 -07:00
|
|
|
fi
|
|
|
|
|
2006-06-21 03:46:56 -07:00
|
|
|
|
2006-06-29 04:27:14 -07:00
|
|
|
if test "x$openal" != "xno" ; then
|
2007-06-28 10:47:08 -07:00
|
|
|
AC_CHECK_HEADER(AL/al.h, AL_h=yes, AL_h=no)
|
2006-06-21 03:46:56 -07:00
|
|
|
AC_CHECK_LIB(openal, main, ALLIB=openal AL_lib=yes,
|
|
|
|
[AC_CHECK_LIB(openal32, main, ALLIB=openal32 AL_lib=yes, AL_lib=no)])
|
2006-06-29 04:27:14 -07:00
|
|
|
if test "x$AL_lib" = "xno" ; then
|
|
|
|
if test "x$openal" = "xyes" ; then
|
2007-06-28 10:47:08 -07:00
|
|
|
AC_MSG_ERROR([You need to install OpenAL.])
|
|
|
|
else
|
|
|
|
openal=no
|
|
|
|
fi
|
2006-06-29 04:27:14 -07:00
|
|
|
elif test "x$AL_h" = "xno" ; then
|
|
|
|
if test "x$openal" = "xyes" ; then
|
2007-06-28 10:47:08 -07:00
|
|
|
AC_MSG_ERROR([You need to install OpenAL header files (usually a -dev package).])
|
|
|
|
else
|
|
|
|
openal=no
|
|
|
|
fi
|
2006-06-21 03:46:56 -07:00
|
|
|
else
|
|
|
|
openal=yes
|
2007-06-28 10:47:08 -07:00
|
|
|
fi
|
|
|
|
fi
|
2006-06-21 03:46:56 -07:00
|
|
|
|
2007-06-28 10:47:08 -07:00
|
|
|
AC_MSG_CHECKING([OpenAL])
|
2006-06-29 04:27:14 -07:00
|
|
|
if test "x$openal" = "xyes" ; then
|
2006-06-21 03:46:56 -07:00
|
|
|
AC_DEFINE(WZ_OPENAL, 1, [OpenAL support])
|
|
|
|
WZ_LIBS="${WZ_LIBS} -l${ALLIB}"
|
|
|
|
AC_MSG_RESULT([yes])
|
2007-06-28 10:47:08 -07:00
|
|
|
else
|
2006-06-21 03:46:56 -07:00
|
|
|
AC_MSG_RESULT([no])
|
|
|
|
AC_MSG_ERROR([OpenAL is currently mandatory])
|
2007-06-28 10:47:08 -07:00
|
|
|
fi
|
|
|
|
|
|
|
|
|
2006-06-29 04:27:14 -07:00
|
|
|
if test "x$ogg" != "xno" ; then
|
|
|
|
XIPH_PATH_OGG(have_ogg=yes, have_ogg=no)
|
|
|
|
XIPH_PATH_VORBIS(have_vorbis=yes, have_vorbis=no)
|
|
|
|
if test "x$have_ogg" = "xno" -o "x$have_vorbis" = "xno" ; then
|
|
|
|
if "x$ogg" = "xyes" ; then
|
2006-06-21 03:46:56 -07:00
|
|
|
AC_MSG_ERROR([You need to install OGG/Vorbis.])
|
2007-06-28 10:47:08 -07:00
|
|
|
else
|
2006-06-21 03:46:56 -07:00
|
|
|
ogg=no
|
|
|
|
AC_DEFINE(WZ_NOOGG, 1, [Disable ogg/vorbis support])
|
2007-06-28 10:47:08 -07:00
|
|
|
fi
|
|
|
|
else
|
2006-06-21 03:46:56 -07:00
|
|
|
ogg=yes
|
|
|
|
WZ_LIBS="${WZ_LIBS} -lvorbisfile -lvorbis -logg"
|
2007-06-28 10:47:08 -07:00
|
|
|
fi
|
2006-06-21 03:46:56 -07:00
|
|
|
else
|
|
|
|
AC_DEFINE(WZ_NOOGG, 1, [Disable ogg/vorbis support])
|
|
|
|
fi
|
|
|
|
|
2007-06-28 10:47:08 -07:00
|
|
|
|
2006-06-29 04:27:14 -07:00
|
|
|
if test "x$mp3" != "xno" ; then
|
2006-06-21 03:46:56 -07:00
|
|
|
AC_CHECK_LIB(mad, mad_stream_init,
|
|
|
|
[AC_CHECK_HEADER(mad.h, have_mad=yes, have_mad=no)],
|
|
|
|
[have_mad=no])
|
2006-06-29 04:27:14 -07:00
|
|
|
if test "x$have_mad" = "xno" ; then
|
|
|
|
if test "x$mp3" = "xyes" ; then
|
2006-06-21 03:46:56 -07:00
|
|
|
AC_MSG_ERROR([You need to install libMAD.])
|
|
|
|
else
|
|
|
|
mp3=no
|
|
|
|
AC_DEFINE(WZ_NOMP3, 1, [Disable mp3 support])
|
|
|
|
fi
|
2007-06-28 10:47:08 -07:00
|
|
|
else
|
2006-06-21 03:46:56 -07:00
|
|
|
mp3=yes
|
|
|
|
WZ_LIBS="${WZ_LIBS} -lmad"
|
2007-06-28 10:47:08 -07:00
|
|
|
fi
|
2006-06-21 03:46:56 -07:00
|
|
|
else
|
|
|
|
AC_DEFINE(WZ_NOMP3, 1, [Disable mp3 support])
|
2007-06-28 10:47:08 -07:00
|
|
|
fi
|
|
|
|
|
2006-06-21 03:46:56 -07:00
|
|
|
|
2006-07-06 14:45:04 -07:00
|
|
|
# Set flex flags. The -olex.yy.c kludge is to ensure that flex
|
|
|
|
# generates the kind of filename that automake expects.
|
|
|
|
AC_SUBST(LFLAGS, "-olex.yy.c")
|
|
|
|
|
|
|
|
# Set bison flags. The -oy.tab.c kludge is to ensure that bison
|
|
|
|
# generates the kind of filename that automake expects.
|
|
|
|
AC_SUBST(YFLAGS, "-oy.tab.c")
|
|
|
|
|
2006-07-17 13:04:27 -07:00
|
|
|
# Set revision to be used by src/Makefile.am
|
2006-07-19 14:51:44 -07:00
|
|
|
AC_SUBST(REVISION, [`svnversion -n .`])
|
2006-07-17 13:04:27 -07:00
|
|
|
|
2007-06-28 10:47:08 -07:00
|
|
|
# add some required C flags here
|
|
|
|
# -DYY_STATIC is required by flex
|
|
|
|
# -m32 forces 32-bit compile, since code is not clean enough for 64-bit yet
|
2006-07-19 14:51:44 -07:00
|
|
|
WZ_CFLAGS="${WZ_CFLAGS} -DYY_STATIC -m32"
|
2007-06-28 10:47:08 -07:00
|
|
|
|
2006-06-21 03:46:56 -07:00
|
|
|
# only now set the LIBS/CFLAGS/CPPFLAGS lines, if set earlier it will give
|
2007-06-28 10:47:08 -07:00
|
|
|
# strange error messages when something is wrong
|
2006-06-21 03:46:56 -07:00
|
|
|
LIBS="${LIBS} ${WZ_LIBS}"
|
|
|
|
CFLAGS="${CFLAGS} ${WZ_CFLAGS}"
|
2007-06-28 10:47:08 -07:00
|
|
|
|
|
|
|
AC_CONFIG_FILES([Makefile
|
|
|
|
lib/Makefile
|
|
|
|
lib/framework/Makefile
|
|
|
|
lib/gamelib/Makefile
|
|
|
|
lib/ivis_opengl/Makefile
|
|
|
|
lib/ivis_common/Makefile
|
|
|
|
lib/netplay/Makefile
|
|
|
|
lib/script/Makefile
|
|
|
|
lib/sequence/Makefile
|
|
|
|
lib/sound/Makefile
|
|
|
|
lib/widget/Makefile
|
|
|
|
data/Makefile
|
2006-04-23 04:02:58 -07:00
|
|
|
src/Makefile])
|
2007-06-28 10:47:08 -07:00
|
|
|
AC_OUTPUT
|
|
|
|
|
|
|
|
echo ""
|
|
|
|
echo "Warzone will compile with the following components:"
|
|
|
|
echo ""
|
|
|
|
echo " OpenGL acceleration: $opengl"
|
|
|
|
echo " OpenAL sound system: $openal"
|
2006-06-21 03:46:56 -07:00
|
|
|
echo " MP3 music support: $mp3"
|
|
|
|
echo " OGG music support: $ogg"
|
2007-06-28 10:47:08 -07:00
|
|
|
echo ""
|
|
|
|
|
|
|
|
if test "x$debug" = xyes; then
|
|
|
|
echo " *** Running in debug mode! ***"
|
|
|
|
echo ""
|
|
|
|
fi
|