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
|
|
|
|
2006-11-06 10:35:59 -08:00
|
|
|
# Check for Windows.
|
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-04-11 07:21:45 -07:00
|
|
|
WIN32_LIBS="-lintl -lshfolder -lwinmm -lwsock32 -L\$(srcdir) -ldbghelp"
|
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-03-10 13:18:09 -08:00
|
|
|
AS_HELP_STRING([--with-installer-libdir],[Path to libraries 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-03-10 13:18:09 -08:00
|
|
|
if test "x$with_installer_libdir" = "x" ; then
|
2006-12-27 13:44:46 -08:00
|
|
|
AC_MSG_ERROR([installer libdir not found])
|
|
|
|
else
|
|
|
|
AC_MSG_CHECKING([for installer libdir])
|
2007-03-10 13:18:09 -08:00
|
|
|
AC_MSG_RESULT([$with_installer_libdir])
|
|
|
|
AC_SUBST(INSTALLER_LIBDIR, $with_installer_libdir)
|
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-04-10 05:44:50 -07:00
|
|
|
WZ_CFLAGS="${WZ_CFLAGS} -O0 -g -DDEBUG -Wall -Wno-nonnull -Wno-unused-label -Werror"
|
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
|
|
|
|
2006-08-23 06:53:47 -07:00
|
|
|
# --disable-ogg will build without Ogg Vorbis support
|
|
|
|
AC_ARG_ENABLE(ogg,
|
2007-03-10 13:18:09 -08:00
|
|
|
AS_HELP_STRING([--disable-ogg],[Do not built support for Ogg files]))
|
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)
|
|
|
|
|
|
|
|
# Look for image libs
|
2006-07-06 14:45:04 -07:00
|
|
|
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],[
|
2007-03-10 13:18:09 -08:00
|
|
|
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([
|
2007-03-10 13:18:09 -08:00
|
|
|
WZ_CFLAGS="${WZ_CFLAGS} ${SDLNETINC}" WZ_LIBS="${WZ_LIBS} ${SDLNETLIB}"],
|
|
|
|
AC_MSG_ERROR([SDL_net is not installed]))
|
|
|
|
|
|
|
|
|
|
|
|
if test "x$enable_opengl" != "xno" ; then
|
|
|
|
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
|
|
|
|
|
|
|
|
if test "x$GL_lib" = "xno" -o "x$GLU_lib" = "xno" ; then
|
|
|
|
if test "x$enable_opengl" = "xyes" ; then
|
|
|
|
AC_MSG_ERROR([You need to install OpenGL and GLU.])
|
|
|
|
else
|
|
|
|
enable_opengl=no
|
|
|
|
fi
|
|
|
|
elif test "x$GL_h" = "xno" -o "x$GLU_h" = "xno" ; then
|
|
|
|
if test "x$enable_opengl" = "xyes" ; then
|
|
|
|
AC_MSG_ERROR([You need to install OpenGL and GLU header files (usually a -dev package).])
|
|
|
|
else
|
|
|
|
enable_opengl=no
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
enable_opengl=yes
|
|
|
|
fi
|
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
|
|
|
AC_MSG_CHECKING([OpenGL])
|
2007-03-10 13:18:09 -08:00
|
|
|
if test "x$enable_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-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
|
|
|
|
|
2007-03-15 13:18:28 -07:00
|
|
|
|
2007-03-10 13:18:09 -08:00
|
|
|
if test "x$enable_openal" != "xno" ; then
|
|
|
|
if test "x$AL_lib" != "xyes" ; then
|
|
|
|
AC_CHECK_HEADER(AL/al.h, AL_h=yes,
|
|
|
|
[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
|
|
|
|
|
|
|
|
if test "x$AL_lib" = "xno" ; then
|
|
|
|
if test "x$enable_openal" = "xyes" ; then
|
|
|
|
AC_MSG_ERROR([You need to install OpenAL.])
|
|
|
|
else
|
|
|
|
enable_openal=no
|
|
|
|
fi
|
|
|
|
elif test "x$AL_h" = "xno" ; then
|
|
|
|
if test "x$enable_openal" = "xyes" ; then
|
|
|
|
AC_MSG_ERROR([You need to install OpenAL header files (usually a -dev package).])
|
|
|
|
else
|
|
|
|
enable_openal=no
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
enable_openal=yes
|
|
|
|
fi
|
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
|
|
|
AC_MSG_CHECKING([OpenAL])
|
2007-03-10 13:18:09 -08:00
|
|
|
if test "x$enable_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
|
|
|
|
|
|
|
|
|
2007-03-10 13:18:09 -08:00
|
|
|
if test "x$enable_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 test "x$enable_ogg" = "xyes" ; then
|
|
|
|
AC_MSG_ERROR([You need to install OGG/Vorbis.])
|
|
|
|
else
|
|
|
|
enable_ogg=no
|
|
|
|
AC_DEFINE(WZ_NOOGG, 1, [Disable ogg/vorbis support])
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
enable_ogg=yes
|
|
|
|
WZ_LIBS="${WZ_LIBS} -lvorbisfile -lvorbis -logg"
|
|
|
|
fi
|
2006-06-21 03:46:56 -07:00
|
|
|
else
|
2007-03-10 13:18:09 -08:00
|
|
|
AC_DEFINE(WZ_NOOGG, 1, [Disable ogg/vorbis support])
|
2006-06-21 03:46:56 -07:00
|
|
|
fi
|
|
|
|
|
2007-06-28 10:47:08 -07:00
|
|
|
|
|
|
|
# add some required C flags here
|
|
|
|
# -DYY_STATIC is required by flex
|
2007-04-05 10:30:39 -07:00
|
|
|
WZ_CFLAGS="${WZ_CFLAGS} -DYY_STATIC -DLOCALEDIR=\\\"${localedir}\\\" -DDATADIR=\\\"${datadir}/${PACKAGE}\\\""
|
|
|
|
|
|
|
|
CPPFLAGS="${CPPFLAGS} -I\$(top_srcdir)"
|
2007-04-02 10:21:05 -07:00
|
|
|
CFLAGS="${CFLAGS} ${WZ_CFLAGS}"
|
2007-02-27 12:58:27 -08:00
|
|
|
LIBS="${LIBS} ${WZ_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
|
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
|
|
|
|
|
|
|
|
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 ""
|
2007-03-10 13:18:09 -08:00
|
|
|
echo " OpenGL acceleration: $enable_opengl"
|
|
|
|
echo " OpenAL sound system: $enable_openal"
|
|
|
|
echo " OGG music support: $enable_ogg"
|
2007-06-28 10:47:08 -07:00
|
|
|
echo ""
|
|
|
|
|
2007-03-10 13:18:09 -08:00
|
|
|
if test "x$enable_debug" = xyes; then
|
|
|
|
echo " *** Running in debug mode! ***"
|
|
|
|
echo ""
|
2007-06-28 10:47:08 -07:00
|
|
|
fi
|