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-11-05 09:04:30 -08:00
|
|
|
AC_ARG_ENABLE(quesoglc,
|
|
|
|
AS_HELP_STRING([--disable-quesoglc], [Compile QuesoGLC [yes]]),
|
|
|
|
[ enable_quesoglc=${enableval} ], [ enable_quesoglc=yes ])
|
|
|
|
AC_MSG_CHECKING([whether to compile QuesoGLC])
|
|
|
|
AC_MSG_RESULT([${enable_quesoglc}])
|
|
|
|
if test "x$enable_quesoglc" = "xyes" ; then
|
|
|
|
if test -d "${srcdir}/3rdparty/quesoglc" ; then
|
|
|
|
AC_CONFIG_SUBDIRS([3rdparty/quesoglc])
|
|
|
|
QUESOGLC_SUBDIR=3rdparty/quesoglc
|
|
|
|
else
|
|
|
|
QUESOGLC_SUBDIR=
|
|
|
|
fi
|
2007-11-04 08:59:35 -08:00
|
|
|
else
|
|
|
|
QUESOGLC_SUBDIR=
|
|
|
|
fi
|
|
|
|
AC_SUBST([QUESOGLC_SUBDIR], [${QUESOGLC_SUBDIR}])
|
|
|
|
|
|
|
|
|
2007-06-28 10:47:08 -07:00
|
|
|
# Checks for programs.
|
2007-10-16 09:45:01 -07:00
|
|
|
AC_PROG_CC_STDC
|
2007-06-28 10:47:08 -07:00
|
|
|
AC_PROG_RANLIB
|
2006-07-04 15:21:04 -07:00
|
|
|
|
2007-10-21 11:53:24 -07:00
|
|
|
# We need a C++ compiler for build_tools/autorevision
|
|
|
|
AC_PROG_CXX
|
|
|
|
|
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-10-09 04:10:47 -07:00
|
|
|
|
|
|
|
# Check for pkg-config
|
|
|
|
PKG_PROG_PKG_CONFIG
|
|
|
|
|
|
|
|
|
|
|
|
# Enable Compiler/LibC GNU extensions
|
2007-03-31 08:34:35 -07:00
|
|
|
AC_GNU_SOURCE
|
2007-10-09 04:10:47 -07:00
|
|
|
|
|
|
|
# Check for gettext
|
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
|
2007-10-25 11:13:30 -07:00
|
|
|
case ${CC} in
|
2007-10-02 14:43:43 -07:00
|
|
|
icc)
|
|
|
|
cc_icc=yes
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
|
|
|
|
# Check for operating system
|
2007-10-25 11:13:30 -07:00
|
|
|
case ${host_os} in
|
2007-03-10 13:18:09 -08:00
|
|
|
mingw32)
|
|
|
|
host_os_mingw32=yes
|
|
|
|
AC_CHECK_TOOL([WINDRES], [windres], AC_MSG_ERROR([windres not found]))
|
2007-10-25 11:13:30 -07:00
|
|
|
WIN32_LIBS='-lintl -ldbghelp -lshfolder -lwinmm -lwsock32'
|
|
|
|
AC_SUBST([WIN32_LIBS], [${WIN32_LIBS}])
|
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-10-25 11:13:30 -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-10-25 11:13:30 -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-10-25 11:13:30 -07: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
|
2007-10-25 11:13:30 -07:00
|
|
|
AC_SUBST([docdir], [${datarootdir}/doc/${AC_PACKAGE_TARNAME}])
|
2007-02-26 12:10:51 -08:00
|
|
|
fi
|
2007-04-01 14:15:07 -07:00
|
|
|
if test "x$localedir" = "x" ; then
|
2007-10-25 11:13:30 -07:00
|
|
|
AC_SUBST([localedir], [${datadir}/locale])
|
2007-04-01 14:15:07 -07:00
|
|
|
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]]),
|
2007-10-25 11:13:30 -07:00
|
|
|
[ enable_installer=${enableval} ], [ enable_installer=no ])
|
2007-03-15 13:18:28 -07:00
|
|
|
AM_CONDITIONAL(INSTALLER, test "x$enable_installer" = "xyes")
|
|
|
|
AC_MSG_CHECKING([whether to build NSIS installer])
|
2007-10-25 11:13:30 -07:00
|
|
|
AC_MSG_RESULT([${enable_installer}])
|
2007-03-15 13:18:28 -07:00
|
|
|
|
|
|
|
|
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-10-25 11:13:30 -07: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-10-25 11:13:30 -07: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])
|
2007-10-25 11:13:30 -07:00
|
|
|
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-10-25 11:13:30 -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-10-25 11:13:30 -07:00
|
|
|
AC_MSG_RESULT([${enable_debug}])
|
2007-03-10 13:18:09 -08:00
|
|
|
if test "x$enable_debug" = "xyes" ; then
|
2007-10-02 14:43:43 -07:00
|
|
|
if test "x$cc_icc" = "xyes" ; then
|
2007-10-15 11:09:18 -07:00
|
|
|
WZ_CFLAGS="${WZ_CFLAGS} -O0 -g -DDEBUG -Wcheck -Werror"
|
2007-10-02 14:43:43 -07:00
|
|
|
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
|
|
|
# Look for PhysicsFS
|
2007-10-09 04:10:47 -07:00
|
|
|
AC_CHECK_HEADER(physfs.h, , AC_MSG_ERROR([PhysicsFS header not found.]))
|
2007-10-25 11:13:30 -07:00
|
|
|
AC_CHECK_LIB(physfs, PHYSFS_init, AC_SUBST([PHYSFS_LIBS], [-lphysfs]), 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
|
2007-10-09 04:10:47 -07:00
|
|
|
AC_CHECK_HEADER(SDL/SDL_net.h, , AC_MSG_ERROR([SDL_net header not found.]))
|
2007-11-03 15:13:35 -07:00
|
|
|
AC_CHECK_LIB(SDL_net, SDLNet_Init, AC_SUBST([SDL_NET_LIBS], [-lSDL_net]), AC_MSG_ERROR([SDL_net not found.]), [${SDL_LIBS} ${WIN32_LIBS}])
|
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, ,
|
2007-10-09 04:10:47 -07:00
|
|
|
AC_MSG_ERROR([SDL OpenGL header not found. Please install SDL with OpenGL support.]))
|
2007-09-28 06:34:23 -07:00
|
|
|
AC_CHECK_LIB(GL, main,
|
|
|
|
OPENGL_LIBS="-lGL",
|
|
|
|
AC_CHECK_LIB(opengl32, main,
|
|
|
|
OPENGL_LIBS="-lopengl32",
|
2007-10-09 04:10:47 -07:00
|
|
|
AC_MSG_ERROR([OpenGL library not found.])))
|
2007-09-28 06:34:23 -07:00
|
|
|
AC_CHECK_LIB(GLU, main,
|
|
|
|
OPENGL_LIBS="${OPENGL_LIBS} -lGLU",
|
|
|
|
AC_CHECK_LIB(glu32, main,
|
|
|
|
OPENGL_LIBS="${OPENGL_LIBS} -lglu32",
|
2007-10-09 04:10:47 -07:00
|
|
|
AC_MSG_ERROR([GLU library not found.])))
|
2007-10-25 11:13:30 -07:00
|
|
|
AC_SUBST([OPENGL_LIBS], [${OPENGL_LIBS}])
|
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-09 04:10:47 -07:00
|
|
|
AC_MSG_ERROR([OpenGLC header not found. Please 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-09 04:10:47 -07:00
|
|
|
AC_MSG_ERROR([OpenGLC library not found. Please install QuesoGLC: http://quesoglc.sourceforge.net/])))
|
2007-10-25 11:13:30 -07:00
|
|
|
AC_SUBST([OPENGLC_LIBS], [${OPENGLC_LIBS}])
|
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, ,
|
2007-10-09 04:10:47 -07:00
|
|
|
AC_MSG_ERROR([OpenAL header not found.]))
|
2007-09-28 06:34:23 -07:00
|
|
|
AC_CHECK_LIB(openal, main,
|
|
|
|
OPENAL_LIBS="-lopenal",
|
|
|
|
AC_CHECK_LIB(openal32, main,
|
|
|
|
OPENAL_LIBS="-lopenal32",
|
2007-10-09 04:10:47 -07:00
|
|
|
AC_MSG_ERROR([OpenAL library not found.])))
|
2007-10-25 11:13:30 -07:00
|
|
|
AC_SUBST([OPENAL_LIBS], [${OPENAL_LIBS}])
|
2007-06-28 10:47:08 -07:00
|
|
|
|
|
|
|
|
2007-10-09 03:19:55 -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-10-16 06:09:03 -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-25 11:13:30 -07:00
|
|
|
|
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-10-20 12:03:27 -07:00
|
|
|
doc/Makefile
|
2007-10-21 11:53:24 -07:00
|
|
|
build_tools/Makefile
|
|
|
|
build_tools/autorevision/Makefile
|
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-10-25 11:13:30 -07: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
|