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)
|
2007-02-15 07:36:25 -08:00
|
|
|
AC_INIT([Warzone 2100],[TRUNK],[http://wz2100.net/],[warzone2100])
|
2006-10-30 09:15:30 -08:00
|
|
|
AM_INIT_AUTOMAKE([1.8])
|
2007-06-28 10:47:08 -07:00
|
|
|
|
2007-02-15 07:36:25 -08:00
|
|
|
AC_CONFIG_MACRO_DIR([m4])
|
2006-08-26 08:21:40 -07:00
|
|
|
AC_CONFIG_SRCDIR([lib/framework/frame.c])
|
2006-08-19 02:39:35 -07:00
|
|
|
|
2007-03-07 04:33:13 -08: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
|
|
|
|
|
2007-03-31 08:34:35 -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
|
|
|
|
2007-03-31 08:34:35 -07:00
|
|
|
AC_GNU_SOURCE
|
2007-04-03 07:04:21 -07:00
|
|
|
AM_GNU_GETTEXT([external])
|
2007-03-31 08:34:35 -07:00
|
|
|
|
2006-06-21 03:46:56 -07:00
|
|
|
|
2007-10-02 14:43:43 -07:00
|
|
|
# Check for compiler
|
|
|
|
case $CC in
|
|
|
|
icc)
|
|
|
|
cc_icc=yes
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
|
|
|
|
# Check for operating system
|
2007-03-10 13:18:09 -08:00
|
|
|
case $host_os in
|
|
|
|
mingw32)
|
|
|
|
host_os_mingw32=yes
|
|
|
|
AC_CHECK_TOOL([WINDRES], [windres], AC_MSG_ERROR([windres not found]))
|
2007-08-16 14:01:18 -07:00
|
|
|
WIN32_LIBS="-lintl -ldbghelp -lshfolder -lwinmm -lwsock32"
|
2007-03-10 13:18:09 -08:00
|
|
|
;;
|
2007-05-06 10:51:04 -07:00
|
|
|
*)
|
|
|
|
AC_DEFINE([_XOPEN_SOURCE], 600, [Enable POSIX extensions if present])
|
|
|
|
;;
|
2007-03-10 13:18:09 -08:00
|
|
|
esac
|
2007-03-15 13:18:28 -07:00
|
|
|
AM_CONDITIONAL([MINGW32], test "x$host_os_mingw32" = "xyes")
|
2006-11-06 10:35:59 -08:00
|
|
|
|
|
|
|
|
2007-02-26 12:10:51 -08:00
|
|
|
# Installation directories
|
|
|
|
|
|
|
|
AC_ARG_WITH(icondir,
|
2007-03-10 13:18:09 -08:00
|
|
|
AS_HELP_STRING([--with-icondir=DIR],[icon files [DATADIR/icons]]),
|
2007-03-15 13:18:28 -07:00
|
|
|
[ with_icondir=$withval ], [ with_icondir=$datadir/icons ])
|
2007-02-26 12:10:51 -08:00
|
|
|
|
|
|
|
|
|
|
|
AC_ARG_WITH(applicationdir,
|
2007-03-10 13:18:09 -08:00
|
|
|
AS_HELP_STRING([--with-applicationdir=DIR],[application files [DATADIR/applications]]),
|
2007-03-15 13:18:28 -07:00
|
|
|
[ with_applicationdir=$withval ], [ with_applicationdir=$datadir/applications ])
|
2007-02-26 12:10:51 -08:00
|
|
|
|
2007-02-26 12:40:11 -08:00
|
|
|
|
2007-03-10 13:18:09 -08:00
|
|
|
AC_SUBST(icondir, $with_icondir)
|
|
|
|
AC_SUBST(applicationdir, $with_applicationdir)
|
2007-02-26 12:10:51 -08:00
|
|
|
if test "x$docdir" = "x" ; then
|
|
|
|
AC_SUBST(docdir, $datarootdir/doc/$AC_PACKAGE_TARNAME)
|
|
|
|
fi
|
2007-04-01 14:15:07 -07:00
|
|
|
if test "x$localedir" = "x" ; then
|
|
|
|
AC_SUBST(localedir, $datadir/locale)
|
|
|
|
fi
|
2007-02-26 12:10:51 -08:00
|
|
|
|
|
|
|
|
2006-06-29 04:27:14 -07:00
|
|
|
# Commandline options:
|
2007-06-28 10:47:08 -07:00
|
|
|
|
2007-03-15 13:18:28 -07:00
|
|
|
AC_ARG_ENABLE([installer],
|
|
|
|
AS_HELP_STRING([--enable-installer],[Build NSIS installer [no]]),
|
|
|
|
[ enable_installer=$enableval ], [ enable_installer=no ])
|
|
|
|
AM_CONDITIONAL(INSTALLER, test "x$enable_installer" = "xyes")
|
|
|
|
AC_MSG_CHECKING([whether to build NSIS installer])
|
|
|
|
AC_MSG_RESULT([$enable_installer])
|
|
|
|
|
|
|
|
|
2006-12-27 13:44:46 -08:00
|
|
|
AC_ARG_WITH(makensis,
|
2007-03-10 13:18:09 -08:00
|
|
|
AS_HELP_STRING([--with-makensis],[Path to makensis]))
|
2006-12-27 13:44:46 -08:00
|
|
|
|
|
|
|
|
|
|
|
AC_ARG_WITH(installer_libdir,
|
2007-07-28 05:45:15 -07:00
|
|
|
AS_HELP_STRING([--with-installer-extdir],[Path to external data for NSIS script]))
|
2006-12-27 13:44:46 -08:00
|
|
|
|
|
|
|
|
|
|
|
AC_ARG_WITH(installer_version,
|
2007-03-10 13:18:09 -08:00
|
|
|
AS_HELP_STRING([--with-installer-version],[Version of the installer. i.e. 1.2.3.4]))
|
2006-12-27 13:44:46 -08:00
|
|
|
|
2007-06-28 10:47:08 -07:00
|
|
|
|
2007-03-10 13:18:09 -08:00
|
|
|
if test "x$enable_installer" = "xyes" ; then
|
|
|
|
if test "x$with_makensis" = "x" ; then
|
2006-12-27 13:44:46 -08:00
|
|
|
AC_CHECK_TOOL([MAKENSIS], [makensis], [no])
|
|
|
|
if test "x$MAKENSIS" = "xno" ; then
|
|
|
|
AC_MSG_ERROR([makensis not found])
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
AC_MSG_CHECKING([for makensis])
|
2007-03-10 13:18:09 -08:00
|
|
|
AC_MSG_RESULT([$with_makensis])
|
|
|
|
AC_SUBST(MAKENSIS, $with_makensis)
|
2006-12-27 13:44:46 -08:00
|
|
|
fi
|
2007-03-10 13:18:09 -08:00
|
|
|
if test "x$with_installer_version" = "x" ; then
|
2006-12-27 13:44:46 -08:00
|
|
|
AC_MSG_ERROR([installer version invalid])
|
|
|
|
else
|
|
|
|
AC_MSG_CHECKING([for installer version])
|
2007-03-10 13:18:09 -08:00
|
|
|
AC_MSG_RESULT([$with_installer_version])
|
|
|
|
AC_SUBST(INSTALLER_VERSION, $with_installer_version)
|
2006-12-27 13:44:46 -08:00
|
|
|
fi
|
2007-07-28 05:45:15 -07:00
|
|
|
if test "x$with_installer_extdir" = "x" ; then
|
|
|
|
AC_MSG_ERROR([installer external dir not found])
|
2006-12-27 13:44:46 -08:00
|
|
|
else
|
2007-07-28 05:45:15 -07:00
|
|
|
AC_MSG_CHECKING([for installer extdir])
|
|
|
|
AC_MSG_RESULT([$with_installer_extdir])
|
|
|
|
AC_SUBST(INSTALLER_EXTDIR, $with_installer_extdir)
|
2006-12-27 13:44:46 -08:00
|
|
|
fi
|
|
|
|
fi
|
2007-06-28 10:47:08 -07:00
|
|
|
|
2007-02-20 08:21:19 -08:00
|
|
|
|
|
|
|
# -O0 turns off all optimizations; this is necessary for accurate debugging
|
2007-04-19 11:56:13 -07:00
|
|
|
# -Wno-unused-label is necessary because flex produces unused labels that we cannot fix
|
2007-02-20 08:21:19 -08:00
|
|
|
# Add later for stricter checking: -Wextra -Wmissing-declarations -Wstrict-prototypes
|
2007-06-28 10:47:08 -07:00
|
|
|
AC_ARG_ENABLE(debug,
|
2007-04-09 12:31:29 -07:00
|
|
|
AS_HELP_STRING([--enable-debug[=yes/relaxed/no]],[Compile debug version [no]]),
|
2007-03-15 13:18:28 -07:00
|
|
|
[ enable_debug=$enableval ], [ enable_debug=no ])
|
2006-06-22 07:30:56 -07:00
|
|
|
AC_MSG_CHECKING([whether to compile in debug mode])
|
2007-03-10 13:18:09 -08:00
|
|
|
AC_MSG_RESULT([$enable_debug])
|
|
|
|
if test "x$enable_debug" = "xyes" ; then
|
2007-10-02 14:43:43 -07:00
|
|
|
if test "x$cc_icc" = "xyes" ; then
|
|
|
|
WZ_CFLAGS="${WZ_CFLAGS} -O0 -g -DDEBUG -Wall -Werror"
|
|
|
|
else
|
|
|
|
WZ_CFLAGS="${WZ_CFLAGS} -O0 -g -DDEBUG -Wall -Werror -Wno-unused-label -Wno-int-to-pointer-cast -Wno-pointer-to-int-cast"
|
|
|
|
fi
|
2007-03-10 13:18:09 -08:00
|
|
|
elif test "x$enable_debug" = "xrelaxed" ; then
|
2007-04-09 07:41:22 -07:00
|
|
|
WZ_CFLAGS="${WZ_CFLAGS} -g -DDEBUG -Wall -Wextra"
|
2007-06-28 10:47:08 -07:00
|
|
|
else
|
2007-05-25 10:21:13 -07:00
|
|
|
WZ_CFLAGS="${WZ_CFLAGS} -g -DNDEBUG -Wall"
|
2007-06-28 10:47:08 -07:00
|
|
|
fi
|
|
|
|
|
2006-12-27 13:44:46 -08:00
|
|
|
|
2007-09-28 06:34:23 -07:00
|
|
|
# Checks for modules:
|
|
|
|
|
|
|
|
PKG_CHECK_MODULES([SDL], [sdl >= 1.2])
|
|
|
|
PKG_CHECK_MODULES([PNG], [libpng >= 1.2])
|
|
|
|
PKG_CHECK_MODULES([OGGVORBIS], [ogg >= 1.1 vorbis >= 1.1 vorbisfile >= 1.1])
|
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)
|
2007-09-28 06:34:23 -07:00
|
|
|
# PhysFS needs this, since on some systems it is not properly linked:
|
2007-07-12 08:35:40 -07:00
|
|
|
AC_CHECK_LIB(z, deflate)
|
2006-06-21 03:46:56 -07:00
|
|
|
|
|
|
|
# Look for PhysicsFS
|
|
|
|
AC_CHECK_HEADER(physfs.h, , AC_MSG_ERROR([PhysicsFS header not found]))
|
2007-09-28 06:34:23 -07:00
|
|
|
AC_CHECK_LIB(physfs, PHYSFS_init, , AC_MSG_ERROR([PhysicsFS not found]))
|
2006-06-21 03:46:56 -07:00
|
|
|
|
2007-09-28 06:34:23 -07:00
|
|
|
# Look for SDL_net
|
|
|
|
AC_CHECK_HEADER(SDL/SDL_net.h, , AC_MSG_ERROR([SDL_net header not found]))
|
|
|
|
AC_CHECK_LIB(SDL_net, SDLNet_Init, , AC_MSG_ERROR([SDL_net not found]), [-lSDL ${WIN32_LIBS}])
|
2006-06-21 03:46:56 -07:00
|
|
|
|
2007-03-10 13:18:09 -08:00
|
|
|
|
2007-09-28 06:34:23 -07:00
|
|
|
# Look for OpenGL
|
|
|
|
AC_CHECK_HEADER(SDL/SDL_opengl.h, ,
|
|
|
|
AC_MSG_ERROR([You need to install SDL with OpenGL support.]))
|
|
|
|
AC_CHECK_LIB(GL, main,
|
|
|
|
OPENGL_LIBS="-lGL",
|
|
|
|
AC_CHECK_LIB(opengl32, main,
|
|
|
|
OPENGL_LIBS="-lopengl32",
|
|
|
|
AC_MSG_ERROR([You need to install OpenGL.])))
|
|
|
|
AC_CHECK_LIB(GLU, main,
|
|
|
|
OPENGL_LIBS="${OPENGL_LIBS} -lGLU",
|
|
|
|
AC_CHECK_LIB(glu32, main,
|
|
|
|
OPENGL_LIBS="${OPENGL_LIBS} -lglu32",
|
|
|
|
AC_MSG_ERROR([You need to install GLU.])))
|
2006-06-21 03:46:56 -07:00
|
|
|
|
2007-10-01 12:45:49 -07:00
|
|
|
# Look for OpenGLC
|
|
|
|
AC_CHECK_HEADER(GL/glc.h, ,
|
2007-10-04 03:14:10 -07:00
|
|
|
AC_MSG_ERROR([OpenGLC header not found. You need to install QuesoGLC: http://quesoglc.sourceforge.net/]))
|
2007-10-01 12:45:49 -07:00
|
|
|
AC_CHECK_LIB(GLC, main,
|
|
|
|
OPENGLC_LIBS="-lGLC",
|
|
|
|
AC_CHECK_LIB(glc32, main,
|
|
|
|
OPENGLC_LIBS="-lglc32",
|
2007-10-04 03:14:10 -07:00
|
|
|
AC_MSG_ERROR([You need to install QuesoGLC. http://quesoglc.sourceforge.net/])))
|
2007-10-01 12:45:49 -07:00
|
|
|
|
2007-09-28 06:34:23 -07:00
|
|
|
# Look for OpenAL
|
|
|
|
AC_CHECK_HEADER(AL/al.h, ,
|
|
|
|
AC_MSG_ERROR([You need to install OpenAL headers.]))
|
|
|
|
AC_CHECK_LIB(openal, main,
|
|
|
|
OPENAL_LIBS="-lopenal",
|
|
|
|
AC_CHECK_LIB(openal32, main,
|
|
|
|
OPENAL_LIBS="-lopenal32",
|
|
|
|
AC_MSG_ERROR([You need to install OpenAL.])))
|
2007-06-28 10:47:08 -07:00
|
|
|
|
|
|
|
|
2007-10-08 13:36:08 -07:00
|
|
|
WZ_CFLAGS="${WZ_CFLAGS} -DDATADIR=\"\${datadir}/\${PACKAGE}\""
|
|
|
|
WZ_CFLAGS="${WZ_CFLAGS} -DLOCALEDIR=\"\${localedir}\""
|
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
|
2007-09-28 06:34:23 -07:00
|
|
|
WZ_CFLAGS="${WZ_CFLAGS} -DYY_STATIC"
|
2007-04-05 10:30:39 -07:00
|
|
|
|
|
|
|
CPPFLAGS="${CPPFLAGS} -I\$(top_srcdir)"
|
2007-09-28 06:34:23 -07:00
|
|
|
CFLAGS="${SDL_CFLAGS} ${PNG_CFLAGS} ${OGGVORBIS_CFLAGS} $} ${OPENAL_CFLAGS} ${OPENGL_CFLAGS} ${CFLAGS} ${WZ_CFLAGS}"
|
2007-10-01 12:45:49 -07:00
|
|
|
LIBS="${SDL_LIBS} ${PNG_LIBS} ${OGGVORBIS_LIBS} ${OPENAL_LIBS} ${OPENGLC_LIBS} ${OPENGL_LIBS} ${LIBS} ${WIN32_LIBS}"
|
2007-06-28 10:47:08 -07:00
|
|
|
|
2007-04-03 07:04:21 -07:00
|
|
|
AC_CONFIG_HEADER([config.h])
|
2007-06-28 10:47:08 -07:00
|
|
|
AC_CONFIG_FILES([Makefile
|
2007-03-31 08:34:35 -07:00
|
|
|
po/Makefile.in
|
2007-06-07 15:51:52 -07:00
|
|
|
icons/Makefile
|
2006-12-24 17:43:01 -08:00
|
|
|
data/Makefile
|
2007-08-17 10:42:17 -07:00
|
|
|
data/mods/Makefile
|
|
|
|
data/mods/global/Makefile
|
2006-12-27 13:44:46 -08:00
|
|
|
nsis/Makefile
|
2006-11-06 10:35:59 -08:00
|
|
|
win32/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
|
|
|
|
src/Makefile])
|
2007-06-28 10:47:08 -07:00
|
|
|
AC_OUTPUT
|
|
|
|
|
2007-03-10 13:18:09 -08:00
|
|
|
if test "x$enable_debug" = xyes; then
|
2007-09-28 06:34:23 -07:00
|
|
|
echo ""
|
2007-03-10 13:18:09 -08:00
|
|
|
echo " *** Running in debug mode! ***"
|
|
|
|
echo ""
|
2007-06-28 10:47:08 -07:00
|
|
|
fi
|