2007-06-28 10:47:08 -07:00
|
|
|
# Process this file with autoconf to produce a configure script.
|
|
|
|
|
|
|
|
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])
|
|
|
|
AC_CANONICAL_TARGET
|
|
|
|
|
|
|
|
AM_INIT_AUTOMAKE
|
|
|
|
AM_MAINTAINER_MODE
|
|
|
|
|
|
|
|
# Checks for programs.
|
|
|
|
AC_PROG_CC
|
|
|
|
AC_PROG_RANLIB
|
|
|
|
AC_PROG_YACC
|
|
|
|
AC_PROG_LEX
|
|
|
|
|
|
|
|
# Checks for libraries.
|
|
|
|
|
|
|
|
# Checks for header files.
|
2006-06-21 03:46:56 -07:00
|
|
|
#AC_HEADER_DIRENT
|
|
|
|
#AC_HEADER_STDC
|
|
|
|
#AC_HEADER_STDBOOL
|
|
|
|
#AC_HEADER_TIME
|
|
|
|
#AC_CHECK_HEADERS([limits.h malloc.h memory.h stddef.h stdint.h stdlib.h string.h unistd.h])
|
2007-06-28 10:47:08 -07:00
|
|
|
|
|
|
|
# Checks for typedefs, structures, and compiler characteristics.
|
2006-06-21 03:46:56 -07:00
|
|
|
#AC_C_CONST
|
|
|
|
#AC_C_INLINE
|
|
|
|
#AC_TYPE_SIZE_T
|
|
|
|
#AC_STRUCT_TM
|
2007-06-28 10:47:08 -07:00
|
|
|
|
|
|
|
# Checks for library functions.
|
2006-06-21 03:46:56 -07:00
|
|
|
#AC_FUNC_CLOSEDIR_VOID
|
|
|
|
#AC_FUNC_MALLOC
|
|
|
|
#AC_FUNC_MEMCMP
|
|
|
|
#AC_FUNC_REALLOC
|
|
|
|
#AC_FUNC_STAT
|
|
|
|
#AC_FUNC_VPRINTF
|
|
|
|
#AC_CHECK_FUNCS([gethostname memmove memset sqrt strchr strdup strncasecmp strrchr strstr])
|
|
|
|
|
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-21 03:46:56 -07:00
|
|
|
[ make_data="${enableval}" ], [make_data=yes])
|
2006-06-22 07:30:56 -07:00
|
|
|
AC_MSG_CHECKING([whether to make data])
|
|
|
|
AM_CONDITIONAL(MAKE_DATA, [[[[ "x${make_data}" = "xyes" ]]]] )
|
|
|
|
if [[ "x${make_data}" = "xyes" ]] ; then
|
|
|
|
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-21 03:46:56 -07:00
|
|
|
if [[ "x${debug}" = "xyes" ]] ; then
|
2007-06-28 10:47:08 -07:00
|
|
|
# -O0 turns off all optimizations; this is necessary for accurate debugging
|
2006-06-21 03:46:56 -07:00
|
|
|
WZ_CFLAGS="${WZ_CFLAGS} -O0 -g3 -Wall"
|
2007-06-28 10:47:08 -07:00
|
|
|
AC_DEFINE(DEBUG, 1, [Define if you want extra debugging.])
|
|
|
|
AC_MSG_RESULT([yes])
|
|
|
|
else
|
|
|
|
AC_MSG_RESULT([no])
|
|
|
|
fi
|
|
|
|
|
|
|
|
# --without-opengl will build without opengl
|
|
|
|
AC_ARG_WITH(opengl,
|
2006-06-21 03:46:56 -07:00
|
|
|
[ --with-opengl use OpenGL to accelerate graphics [[auto]]],
|
2007-06-28 10:47:08 -07:00
|
|
|
[ opengl=$withval ], [ opengl=maybe ])
|
|
|
|
|
|
|
|
# --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=`(
|
|
|
|
test "x$prefix" = xNONE && prefix="$ac_default_prefix"
|
|
|
|
test "x$exec_prefix" = xNONE && exec_prefix="${prefix}"
|
|
|
|
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")
|
|
|
|
AC_DEFINE_UNQUOTED(DEFAULT_DATA_DIR, "$datadir", [Warzone data path])
|
2007-06-28 10:47:08 -07:00
|
|
|
|
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
|
|
|
|
AC_CHECK_LIB(jpeg, main, , [AC_MSG_ERROR([You need to install the jpeg library.])])
|
|
|
|
AC_CHECK_LIB(png, main, , [AC_MSG_ERROR([You need to install the png library.])])
|
|
|
|
|
|
|
|
|
|
|
|
# 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-22 07:30:56 -07:00
|
|
|
if [[ "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)])
|
|
|
|
if [[ "x$GL_lib" = "xno" -o "x$GLU_lib" = "xno" ]] ; then
|
|
|
|
if [[ "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-21 03:46:56 -07:00
|
|
|
elif [[ "x$GL_h" = "xno" -o "x$GLU_h" = "xno" ]] ; then
|
|
|
|
if [[ "x$opengl" = "xyes" ]] ; then
|
|
|
|
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-21 03:46:56 -07:00
|
|
|
if [[ "x$opengl" = "xyes" ]] ; then
|
|
|
|
AC_DEFINE(WZ_OPENGL, 1, [OpenGL acceleration])
|
|
|
|
WZ_LIBS="${WZ_LIBS} -l${GLLIB} -l${GLULIB}"
|
|
|
|
AC_SUBST(RENDERER, "ivis_opengl")
|
|
|
|
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_SUBST(RENDERER, "ivis02")
|
2007-06-28 10:47:08 -07:00
|
|
|
fi
|
|
|
|
|
2006-06-21 03:46:56 -07:00
|
|
|
|
|
|
|
if [[ "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)])
|
|
|
|
if [[ "x$AL_lib" = "xno" ]] ; then
|
|
|
|
if [[ "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-21 03:46:56 -07:00
|
|
|
elif [[ "x$AL_h" = "xno" ]] ; then
|
|
|
|
if [[ "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-21 03:46:56 -07:00
|
|
|
if [[ "x$openal" = "xyes" ]] ; then
|
|
|
|
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-21 03:46:56 -07:00
|
|
|
if [[ "x${ogg}" != "xno" ]] ; then
|
|
|
|
AM_PATH_OGG(have_ogg=yes, have_ogg=no)
|
|
|
|
AM_PATH_VORBIS(have_vorbis=yes, have_vorbis=no)
|
|
|
|
if [[ "x$have_ogg" = "xno" -o "x$have_vorbis" = "xno" ]] ; then
|
|
|
|
if [[ "x${ogg}" = "xyes" ]] ; then
|
|
|
|
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-21 03:46:56 -07:00
|
|
|
if [[ "x${mp3}" != "xno" ]] ; then
|
|
|
|
AC_CHECK_LIB(mad, mad_stream_init,
|
|
|
|
[AC_CHECK_HEADER(mad.h, have_mad=yes, have_mad=no)],
|
|
|
|
[have_mad=no])
|
|
|
|
if [[ "x${have_mad}" = "xno" ]] ; then
|
|
|
|
if [[ "x${mp3}" = "xyes" ]] ; then
|
|
|
|
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
|
|
|
|
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-06-21 03:46:56 -07:00
|
|
|
WZ_CFLAGS="${WZ_CFLAGS} -DYY_STATIC -m32 -fno-strict-aliasing"
|
2007-06-28 10:47:08 -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(FLEX_FLAGS, "-olex.yy.c")
|
|
|
|
|
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}"
|
|
|
|
CPPFLAGS="${CPPFLAGS} ${WZ_CPPFLAGS}"
|
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/ivis02/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
|