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-10-09 14:50:50 -07:00
|
|
|
AC_INIT([Warzone 2100],[2.0.5_rc1],[http://wz2100.net/])
|
2006-10-30 09:15:30 -08:00
|
|
|
AM_INIT_AUTOMAKE([1.8])
|
2007-06-28 10:47:08 -07:00
|
|
|
|
2006-08-26 08:21:40 -07:00
|
|
|
AC_CONFIG_SRCDIR([lib/framework/frame.c])
|
|
|
|
AC_CONFIG_HEADER([lib/framework/config.h])
|
2006-08-19 02:39:35 -07:00
|
|
|
|
2007-06-28 10:47:08 -07:00
|
|
|
# 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
|
|
|
|
|
2006-08-12 03:45:49 -07:00
|
|
|
AM_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-09-16 08:56:26 -07:00
|
|
|
WZ_CFLAGS="${WZ_CFLAGS} -g3 -O0 -Wall -Wextra -Wwrite-strings -Wcast-qual -Wmissing-declarations -Wstrict-prototypes -Wold-style-definition -DDEBUG"
|
2007-06-28 10:47:08 -07:00
|
|
|
AC_MSG_RESULT([yes])
|
|
|
|
else
|
2006-08-19 15:24:07 -07:00
|
|
|
WZ_CFLAGS="${WZ_CFLAGS} -DNDEBUG"
|
2007-06-28 10:47:08 -07:00
|
|
|
AC_MSG_RESULT([no])
|
|
|
|
fi
|
|
|
|
|
2006-08-23 06:53:47 -07:00
|
|
|
# --disable-ogg will build without Ogg Vorbis support
|
|
|
|
AC_ARG_ENABLE(ogg,
|
2006-10-30 09:15:30 -08:00
|
|
|
[AS_HELP_STRING([--disable-ogg],[Do not built support for Ogg files])],
|
2006-08-23 06:53:47 -07:00
|
|
|
[ ogg=$enableval ], [ ogg=maybe ])
|
2007-06-28 10:47:08 -07:00
|
|
|
|
2006-08-23 06:53:47 -07:00
|
|
|
# --disable-mp3 will build without Mp3 support
|
|
|
|
AC_ARG_ENABLE(mp3,
|
2006-10-30 09:15:30 -08:00
|
|
|
[AS_HELP_STRING([--disable-mp3],[Do not built support for Mp3 files])],
|
2006-08-23 06:53:47 -07:00
|
|
|
[ mp3=$enableval ], [ mp3=maybe ])
|
2007-06-28 10:47:08 -07:00
|
|
|
|
|
|
|
# windows conditional
|
|
|
|
case $host_os in
|
2006-10-30 09:15:30 -08:00
|
|
|
*mingw32* )
|
|
|
|
AC_DEFINE(WIN32, 1, [Windows build])
|
|
|
|
WZ_LIBS="${WZ_LIBS} -lmingw32"
|
|
|
|
;;
|
|
|
|
* )
|
|
|
|
;;
|
2007-06-28 10:47:08 -07:00
|
|
|
esac
|
|
|
|
|
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
|
2006-08-12 03:45:49 -07:00
|
|
|
if test `uname` = "Darwin"; then
|
2006-08-23 08:51:33 -07:00
|
|
|
AC_MSG_CHECKING([for OpenGL framework])
|
|
|
|
wz_ac_check_opengl_save_LIBS=$LIBS
|
|
|
|
LIBS="-framework OpenGL $LIBS"
|
|
|
|
AC_LINK_IFELSE([main() { }],[GL_h=mac ; GLU_h=mac ; GL_lib=yes ; GLU_lib=yes ; GLLIB="-framework OpenGL" ; GLULIB="" ; AC_MSG_RESULT([yes])],LIBS=$wz_ac_check_opengl_save_LIBS ; [AC_MSG_RESULT([no])])
|
2006-08-12 03:45:49 -07:00
|
|
|
fi
|
2006-08-23 08:51:33 -07:00
|
|
|
|
|
|
|
if test "x$GL_lib" != "xyes" ; then
|
|
|
|
AC_CHECK_HEADER(SDL/SDL_opengl.h, GL_h=yes, GL_h=no)
|
|
|
|
AC_CHECK_LIB(GL, main, GLLIB=-lGL GL_lib=yes,
|
|
|
|
[AC_CHECK_LIB(opengl32, main, GLLIB=-lopengl32 GL_lib=yes, GL_lib=no)])
|
|
|
|
AC_CHECK_LIB(GLU, main, GLULIB=-lGLU GLU_lib=yes,
|
|
|
|
[AC_CHECK_LIB(glu32, main, GLULIB=-lglu32 GLU_lib=yes, GLU_lib=no)])
|
|
|
|
fi
|
|
|
|
|
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])
|
2006-08-12 03:45:49 -07:00
|
|
|
WZ_LIBS="${WZ_LIBS} ${GLLIB} ${GLULIB}"
|
2006-07-22 16:32:49 -07:00
|
|
|
AC_SUBST(RENDERER, "ivis_opengl")
|
2006-06-21 03:46:56 -07:00
|
|
|
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-29 04:27:14 -07:00
|
|
|
if test "x$openal" != "xno" ; then
|
2006-08-12 03:45:49 -07:00
|
|
|
if test `uname` = "Darwin"; then
|
2006-08-23 08:51:33 -07:00
|
|
|
AC_MSG_CHECKING([for OpenAL framework])
|
|
|
|
wz_ac_check_openal_save_LIBS=$LIBS
|
|
|
|
LIBS="-framework OpenAL $LIBS"
|
|
|
|
AC_LINK_IFELSE([main() { }],[AL_h=mac ; AL_lib=yes ; ALLIB="-framework OpenAL" ; AC_MSG_RESULT([yes])],[LIBS=$wz_ac_check_openal_save_LIBS ; AC_MSG_RESULT([no])])
|
2006-08-12 03:45:49 -07:00
|
|
|
fi
|
2006-08-23 08:51:33 -07:00
|
|
|
|
|
|
|
if test "x$AL_lib" != "xyes" ; then
|
|
|
|
AC_CHECK_HEADER(AL/al.h, AL_h=standard,
|
|
|
|
[AC_CHECK_HEADER(openal/al.h, AL_h=mac, AL_h=no)])
|
|
|
|
AC_CHECK_LIB(openal, main, ALLIB=-lopenal AL_lib=yes,
|
|
|
|
[AC_CHECK_LIB(openal32, main, ALLIB=-lopenal32 AL_lib=yes, AL_lib=no)])
|
|
|
|
fi
|
|
|
|
|
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])
|
2006-08-12 03:45:49 -07:00
|
|
|
WZ_LIBS="${WZ_LIBS} ${ALLIB}"
|
2006-06-21 03:46:56 -07:00
|
|
|
AC_MSG_RESULT([yes])
|
2006-08-12 03:45:49 -07:00
|
|
|
if test "x$AL_h" = "xmac"; then
|
|
|
|
AC_DEFINE(WZ_OPENAL_MAC_H, 1, [OpenAL MacOSX header support])
|
|
|
|
fi
|
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
|
2006-08-22 04:24:49 -07:00
|
|
|
if test "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")
|
|
|
|
|
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-10-30 09:15:30 -08:00
|
|
|
WZ_CFLAGS="${WZ_CFLAGS} -m32 -DYY_STATIC -DDEFAULT_DATADIR=\\\"${datadir}/warzone2100\\\""
|
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 ""
|
2006-08-23 10:48:47 -07:00
|
|
|
echo "Warzone 2100 will compile with the following components:"
|
2007-06-28 10:47:08 -07:00
|
|
|
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
|