2008-04-20 16:56:40 -07:00
|
|
|
AC_PREREQ([2.56])
|
2007-02-15 07:36:25 -08:00
|
|
|
AC_INIT([Warzone 2100],[TRUNK],[http://wz2100.net/],[warzone2100])
|
2008-09-18 09:08:37 -07:00
|
|
|
|
2010-01-14 11:23:42 -08:00
|
|
|
AM_INIT_AUTOMAKE([1.10 tar-ustar])
|
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
|
|
|
|
2008-03-11 04:25:20 -07:00
|
|
|
# HACK
|
|
|
|
# Workaround stupid autoconf CFLAGS default
|
|
|
|
# (Bash considers set but empty variables different from null for the ${VAR:+alt} operator)
|
2008-04-20 16:56:40 -07:00
|
|
|
CFLAGS="${CFLAGS}"
|
2008-03-11 04:25:20 -07:00
|
|
|
|
|
|
|
|
2008-09-18 09:08:37 -07:00
|
|
|
# Make cross compilation options available in --help
|
|
|
|
AC_CANONICAL_HOST
|
|
|
|
|
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
|
2008-09-28 06:23:01 -07:00
|
|
|
AC_PROG_VERSION_CHECK([bison], [1.31])
|
2006-07-04 15:21:04 -07:00
|
|
|
|
2007-03-31 08:34:35 -07:00
|
|
|
AC_PROG_LEX
|
2009-05-24 12:46:07 -07:00
|
|
|
AC_PROG_VERSION_CHECK([${LEX}], [2.5.33], [2.5.34])
|
2007-06-28 10:47:08 -07:00
|
|
|
|
2008-11-16 11:19:08 -08:00
|
|
|
AX_WITH_PROG([PERL], [perl])
|
2008-11-25 16:25:08 -08:00
|
|
|
AX_PROG_PERL_VERSION([5.10], [], [ PERL="" ])
|
|
|
|
AC_SUBST([PERL])
|
2008-11-19 02:03:07 -08:00
|
|
|
AM_CONDITIONAL([PERL_AVAILABLE], test -n "$PERL")
|
2008-11-16 11:13:39 -08:00
|
|
|
|
2010-04-15 07:06:33 -07:00
|
|
|
AC_CHECK_PROG(ZIP, zip, zip)
|
|
|
|
test -z "${ZIP}" && AC_MSG_ERROR(Zip not found!)
|
|
|
|
AC_CHECK_PROG(UNZIP, unzip, unzip)
|
|
|
|
test -z "${UNZIP}" && AC_MSG_ERROR(Unzip not found!)
|
|
|
|
|
2007-10-09 04:10:47 -07:00
|
|
|
# Enable Compiler/LibC GNU extensions
|
2007-03-31 08:34:35 -07:00
|
|
|
AC_GNU_SOURCE
|
2007-10-09 04:10:47 -07:00
|
|
|
|
2009-01-24 10:15:19 -08:00
|
|
|
# Check for the strlcpy and strlcat functions
|
|
|
|
AX_CHECK_STRLCPY
|
|
|
|
AX_CHECK_STRLCAT
|
|
|
|
|
2010-02-21 07:00:28 -08:00
|
|
|
# Use -fstack-protector if possible
|
|
|
|
AX_STACK_PROTECT_CC
|
|
|
|
AX_STACK_PROTECT_CXX
|
|
|
|
|
2009-09-13 08:47:15 -07:00
|
|
|
AC_CHECK_HEADERS(alloca.h)
|
|
|
|
|
2007-10-09 04:10:47 -07:00
|
|
|
# Check for gettext
|
2007-04-03 07:04:21 -07:00
|
|
|
AM_GNU_GETTEXT([external])
|
2008-09-28 10:35:56 -07:00
|
|
|
AC_PROG_VERSION_CHECK([msgfmt xgettext], [0.15])
|
2007-03-31 08:34:35 -07:00
|
|
|
|
2008-04-20 16:56:40 -07:00
|
|
|
# Check for pkg-config
|
|
|
|
PKG_PROG_PKG_CONFIG
|
2008-09-28 10:35:56 -07:00
|
|
|
AC_PROG_VERSION_CHECK([pkg-config], [0.9])
|
2008-04-20 16:56:40 -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-12-01 15:59:19 -08:00
|
|
|
*mingw32*)
|
2007-03-10 13:18:09 -08:00
|
|
|
host_os_mingw32=yes
|
|
|
|
AC_CHECK_TOOL([WINDRES], [windres], AC_MSG_ERROR([windres not found]))
|
2010-04-10 13:44:20 -07:00
|
|
|
WIN32_LIBS='-ldbghelp -lshfolder -lshlwapi -lpsapi -lshell32 -lwinmm -lws2_32'
|
2007-10-25 11:13:30 -07:00
|
|
|
AC_SUBST([WIN32_LIBS], [${WIN32_LIBS}])
|
2007-03-10 13:18:09 -08:00
|
|
|
;;
|
2009-08-14 13:57:50 -07:00
|
|
|
*openbsd*)
|
|
|
|
AC_DEFINE([_XOPEN_SOURCE], 600, [Enable POSIX extensions if present])
|
|
|
|
# Make sure that backtrace_symbols_fd (GNU raw back trace extension) has some symbols to work with
|
|
|
|
LDFLAGS="-Wl,-export-dynamic ${LDFLAGS}"
|
|
|
|
;;
|
2007-05-06 10:51:04 -07:00
|
|
|
*)
|
2009-05-24 14:24:36 -07:00
|
|
|
# Some platforms don't need _XOPEN_SOURCE
|
|
|
|
case ${host_os} in
|
|
|
|
*freebsd*) ;;
|
|
|
|
*)
|
|
|
|
AC_DEFINE([_XOPEN_SOURCE], 600, [Enable POSIX extensions if present])
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
2008-07-26 11:50:29 -07:00
|
|
|
# Make sure that backtrace_symbols_fd (GNU raw back trace extension) has some symbols to work with
|
|
|
|
LDFLAGS="-rdynamic ${LDFLAGS}"
|
2007-05-06 10:51:04 -07:00
|
|
|
;;
|
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
|
|
|
|
2008-04-20 16:56:40 -07:00
|
|
|
|
2007-12-07 13:51:52 -08:00
|
|
|
# Set compilers to use when building for the build system in a cross compile build
|
2008-04-20 16:56:40 -07:00
|
|
|
# Fallback to the system compilers
|
2008-11-19 02:03:07 -08:00
|
|
|
AC_ARG_VAR([CXX_FOR_BUILD], [C++ compiler that produces binaries that will run
|
|
|
|
on the build system])
|
|
|
|
AS_IF([test -z "$CXX_FOR_BUILD"],[
|
|
|
|
AC_SUBST([CXX_FOR_BUILD], [${CXX}])
|
|
|
|
])
|
2007-12-07 13:51:52 -08:00
|
|
|
|
2008-11-19 02:03:07 -08:00
|
|
|
AC_ARG_VAR([CC_FOR_BUILD], [C compiler that produces binaries that will run on
|
|
|
|
the build system])
|
|
|
|
AS_IF([test -z "$CC_FOR_BUILD"],[
|
|
|
|
AC_SUBST([CC_FOR_BUILD], [${CC}])
|
|
|
|
])
|
2006-11-06 10:35:59 -08:00
|
|
|
|
2009-05-03 08:00:18 -07:00
|
|
|
AC_ARG_VAR([CFLAGS_FOR_BUILD], [Flags to use for the C
|
|
|
|
compiler that produces binaries for the build system])
|
|
|
|
AS_IF([test -z "$CFLAGS_FOR_BUILD"],[
|
|
|
|
AC_SUBST([CFLAGS_FOR_BUILD], [${CFLAGS}])
|
|
|
|
])
|
|
|
|
|
|
|
|
AC_ARG_VAR([CXXFLAGS_FOR_BUILD], [Flags to use for the C++
|
|
|
|
compiler that produces binaries for the build system])
|
|
|
|
AS_IF([test -z "$CXXFLAGS_FOR_BUILD"],[
|
|
|
|
AC_SUBST([CXXFLAGS_FOR_BUILD], [${CXXFLAGS}])
|
|
|
|
])
|
|
|
|
|
2008-11-19 02:03:07 -08:00
|
|
|
AC_ARG_VAR([CPPFLAGS_FOR_BUILD], [Preprocessor flags to use for the C and C++
|
|
|
|
compilers that produce binaries for the build system])
|
|
|
|
AS_IF([test -z "$CPPFLAGS_FOR_BUILD"],[
|
|
|
|
AC_SUBST([CPPFLAGS_FOR_BUILD], [${CPPFLAGS}])
|
|
|
|
])
|
2007-02-26 12:10:51 -08:00
|
|
|
|
|
|
|
|
2008-04-20 16:56:40 -07:00
|
|
|
# pkg-config hooks:
|
2007-02-26 12:10:51 -08:00
|
|
|
|
2008-11-19 02:03:07 -08:00
|
|
|
AC_ARG_VAR([PKGCONFIG_PREFIX], [Prefix path to look in for pkg-config templates])
|
|
|
|
AS_IF([test -n "$PKGCONFIG_PREFIX"],[
|
2008-04-20 16:56:40 -07:00
|
|
|
PKG_CONFIG="${PKG_CONFIG} --define-variable=prefix=${PKGCONFIG_PREFIX}"
|
2008-11-19 02:03:07 -08:00
|
|
|
])
|
2007-02-26 12:10:51 -08:00
|
|
|
|
2009-12-21 18:26:29 -08:00
|
|
|
AC_ARG_VAR([PKGCONFIG_DEFAULT_PREFIX], [Prefix path to look in for pkg-config templates])
|
|
|
|
AS_IF([test -n "$PKGCONFIG_DEFAULT_PREFIX"],[
|
|
|
|
PKG_CONFIG="${PKG_CONFIG} --define-variable=__PREFIX__=${PKGCONFIG_DEFAULT_PREFIX}"
|
|
|
|
])
|
2007-02-26 12:40:11 -08:00
|
|
|
|
2008-04-20 16:56:40 -07:00
|
|
|
# Variable fixes for older autoconf versions:
|
|
|
|
|
2008-11-19 02:03:07 -08:00
|
|
|
AS_IF([test -z "$docdir"],[
|
2007-10-25 11:13:30 -07:00
|
|
|
AC_SUBST([docdir], [${datarootdir}/doc/${AC_PACKAGE_TARNAME}])
|
2008-11-19 02:03:07 -08:00
|
|
|
])
|
|
|
|
AS_IF([test -z "$localedir"],[
|
2007-10-25 11:13:30 -07:00
|
|
|
AC_SUBST([localedir], [${datadir}/locale])
|
2008-11-19 02:03:07 -08:00
|
|
|
])
|
2007-02-26 12:10:51 -08:00
|
|
|
|
|
|
|
|
2008-04-20 16:56:40 -07:00
|
|
|
# Installation directories
|
|
|
|
|
|
|
|
AC_ARG_WITH(icondir,
|
|
|
|
AS_HELP_STRING([--with-icondir=DIR],[icon files [DATADIR/icons]]),
|
|
|
|
[ with_icondir=${withval} ], [ with_icondir=${datadir}/icons ])
|
|
|
|
AC_SUBST([icondir], [${with_icondir}])
|
|
|
|
|
|
|
|
AC_ARG_WITH(applicationdir,
|
|
|
|
AS_HELP_STRING([--with-applicationdir=DIR],[application files [DATADIR/applications]]),
|
|
|
|
[ with_applicationdir=${withval} ], [ with_applicationdir=${datadir}/applications ])
|
|
|
|
AC_SUBST([applicationdir], [${with_applicationdir}])
|
|
|
|
|
|
|
|
|
|
|
|
# Commandline options - enable:
|
2007-06-28 10:47:08 -07:00
|
|
|
|
2007-03-15 13:18:28 -07:00
|
|
|
AC_ARG_ENABLE([installer],
|
2008-04-20 16:56:40 -07:00
|
|
|
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
|
|
|
|
2008-04-13 16:42:04 -07:00
|
|
|
AC_ARG_ENABLE([static],
|
|
|
|
AS_HELP_STRING([--enable-static], [Link statically [no]]),
|
|
|
|
[ enable_static=${enableval} ], [ enable_static=no ])
|
|
|
|
if test "x$enable_static" = "xyes" ; then
|
2008-04-20 16:56:40 -07:00
|
|
|
# Add libs where even pkg-config cannot help statically linking them,
|
|
|
|
# where one would otherwise have to provide them via commandline
|
|
|
|
WIN32_LIBS="${WIN32_LIBS} -lz -lintl -liconv"
|
|
|
|
# Tell pkg-config to link against static libraries, incl. all dependencies
|
|
|
|
PKG_CONFIG="${PKG_CONFIG} --static"
|
2008-04-13 16:42:04 -07:00
|
|
|
fi
|
2007-03-15 13:18:28 -07:00
|
|
|
|
2008-06-21 11:34:51 -07:00
|
|
|
AC_ARG_ENABLE([sound],
|
|
|
|
AS_HELP_STRING([--disable-sound], [Disable sound [no]]),
|
|
|
|
[ enable_sound="${enableval}" ], [ enable_sound="yes" ])
|
2009-01-11 06:34:38 -08:00
|
|
|
AS_IF([test "x$enable_sound" != "xyes"],[
|
2008-06-21 11:34:51 -07:00
|
|
|
AC_DEFINE([WZ_NOSOUND], [], [Causes sound to be disabled])
|
2009-01-11 06:34:38 -08:00
|
|
|
])
|
2008-06-21 11:34:51 -07:00
|
|
|
|
2008-04-20 16:56:40 -07:00
|
|
|
# -O0 turns off all optimizations; this is necessary for accurate debugging
|
|
|
|
# -Wno-unused-label is necessary because flex produces unused labels that we cannot fix
|
|
|
|
# Add later for stricter checking: -Wextra -Wmissing-declarations -Wstrict-prototypes
|
|
|
|
AC_ARG_ENABLE([debug],
|
|
|
|
AS_HELP_STRING([--enable-debug[=yes/relaxed/profile/debugprofile/no]],[Compile debug version [yes]]),
|
|
|
|
[ enable_debug=${enableval} ], [ enable_debug=yes ])
|
|
|
|
AC_MSG_CHECKING([whether to compile in debug mode])
|
|
|
|
AC_MSG_RESULT([${enable_debug}])
|
|
|
|
|
2010-04-16 10:25:37 -07:00
|
|
|
# gcc 4.5 added some warnings to -Wall that weren't even valid in previous
|
|
|
|
# versions. The -Werror is necessary since otherwise gcc prints a warning that
|
|
|
|
# the option is only valid for c++/objc++, but the test succeeds. The order is
|
|
|
|
# also important, it doesn't work if -Werror comes last.
|
|
|
|
AX_C_CHECK_FLAG([-Werror -Wno-switch], , , CFLAGS_IGNORE_WARNINGS="${CFLAGS_IGNORE_WARNINGS} -Wno-switch")
|
|
|
|
AX_C_CHECK_FLAG([-Werror -Wno-enum-compare], , , CFLAGS_IGNORE_WARNINGS="${CFLAGS_IGNORE_WARNINGS} -Wno-enum-compare")
|
|
|
|
|
2008-04-20 16:56:40 -07:00
|
|
|
if test "x$enable_debug" = "xyes" ; then
|
|
|
|
if test "x$cc_icc" = "xyes" ; then
|
|
|
|
WZ_CFLAGS="${WZ_CFLAGS} -O0 -g -Wcheck -Werror"
|
|
|
|
WZ_CPPFLAGS="${WZ_CPPFLAGS} -DDEBUG"
|
|
|
|
else
|
2008-04-20 16:56:51 -07:00
|
|
|
WZ_CFLAGS="${WZ_CFLAGS} -O0 -g -Wall -Werror -Wno-unused-label -Wno-pointer-to-int-cast -Wmissing-field-initializers -Wcast-align -Wwrite-strings"
|
2010-01-06 16:10:54 -08:00
|
|
|
WZ_CFLAGS="${WZ_CFLAGS} -Wmissing-declarations -Wstrict-prototypes -Wpointer-arith -Wno-format-security -Wdeclaration-after-statement"
|
2010-04-16 10:25:37 -07:00
|
|
|
WZ_CFLAGS="${WZ_CFLAGS} ${CFLAGS_IGNORE_WARNINGS}"
|
2010-01-23 18:49:47 -08:00
|
|
|
WZ_C99FLAGS="${WZ_C99FLAGS} -Wno-declaration-after-statement"
|
2008-04-20 16:56:40 -07:00
|
|
|
WZ_CPPFLAGS="${WZ_CPPFLAGS} -DDEBUG"
|
|
|
|
fi
|
|
|
|
elif test "x$enable_debug" = "xrelaxed" ; then
|
2008-05-17 03:48:26 -07:00
|
|
|
WZ_CFLAGS="${WZ_CFLAGS} -g -O0 -Wall -Wextra -Wwrite-strings"
|
2008-04-20 16:56:40 -07:00
|
|
|
WZ_CPPFLAGS="${WZ_CPPFLAGS} -DDEBUG"
|
|
|
|
elif test "x$enable_debug" = "xdebugprofile" ; then
|
2008-09-07 03:08:52 -07:00
|
|
|
WZ_CFLAGS="${WZ_CFLAGS} -g -O0 -pg -Wall -Wwrite-strings"
|
2008-04-20 16:56:40 -07:00
|
|
|
WZ_CPPFLAGS="${WZ_CPPFLAGS} -DDEBUG"
|
2009-10-04 11:40:57 -07:00
|
|
|
LDFLAGS="-pg ${LDFLAGS}"
|
2008-04-20 16:56:40 -07:00
|
|
|
elif test "x$enable_debug" = "xprofile" ; then
|
2008-09-07 03:08:52 -07:00
|
|
|
WZ_CFLAGS="${WZ_CFLAGS} -g -Os -pg -Wall -Wwrite-strings"
|
2008-04-20 16:56:40 -07:00
|
|
|
WZ_CPPFLAGS="${WZ_CPPFLAGS} -DNDEBUG"
|
2009-10-04 11:40:57 -07:00
|
|
|
LDFLAGS="-pg ${LDFLAGS}"
|
2009-03-29 13:51:04 -07:00
|
|
|
elif test "x$enable_debug" = "xg++" ; then
|
|
|
|
WZ_CFLAGS="${WZ_CFLAGS} -g -O2 -Wall -fpermissive"
|
|
|
|
WZ_CPPFLAGS="${WZ_CPPFLAGS} -DDEBUG"
|
|
|
|
CC="g++"
|
2007-12-12 10:34:30 -08:00
|
|
|
else
|
2008-04-20 16:56:40 -07:00
|
|
|
WZ_CFLAGS="${WZ_CFLAGS} -g -Wall -Wwrite-strings"
|
|
|
|
WZ_CPPFLAGS="${WZ_CPPFLAGS} -DNDEBUG"
|
2007-12-12 10:34:30 -08:00
|
|
|
fi
|
|
|
|
|
|
|
|
|
2008-04-20 16:56:40 -07:00
|
|
|
# Commandline options - with:
|
2008-04-17 07:32:48 -07:00
|
|
|
|
2008-04-20 16:56:40 -07:00
|
|
|
AC_ARG_WITH([distributor],
|
|
|
|
AS_HELP_STRING([--with-distributor], [Name of distributor compiling this package]),
|
2008-06-04 08:20:03 -07:00
|
|
|
[ with_distributor=${withval} ], [ with_distributor="UNKNOWN" ])
|
2008-04-20 16:56:40 -07:00
|
|
|
AC_DEFINE_UNQUOTED([PACKAGE_DISTRIBUTOR], ["${with_distributor}"], [Name of distributor compiling this package])
|
2006-12-27 13:44:46 -08:00
|
|
|
|
2008-04-20 16:56:40 -07:00
|
|
|
AC_ARG_WITH([makensis],
|
|
|
|
AS_HELP_STRING([--with-makensis], [Path to makensis]))
|
2006-12-27 13:44:46 -08:00
|
|
|
|
2008-04-20 16:56:40 -07:00
|
|
|
AC_ARG_WITH([installer_compression],
|
|
|
|
AS_HELP_STRING([--with-installer-compression], [Compression method to use when building NSIS [lzma]]),
|
|
|
|
[ with_installer_compression=${withval} ], [ with_installer_compression="lzma" ])
|
|
|
|
AC_SUBST([INSTALLER_COMPRESSION], [${with_installer_compression}])
|
2006-12-27 13:44:46 -08:00
|
|
|
|
2008-04-20 16:56:40 -07:00
|
|
|
AC_ARG_WITH([installer_extdir],
|
|
|
|
AS_HELP_STRING([--with-installer-extdir], [Path to external data for NSIS script]))
|
2006-12-27 13:44:46 -08:00
|
|
|
|
2008-04-20 16:56:40 -07:00
|
|
|
AC_ARG_WITH([installer_version],
|
|
|
|
AS_HELP_STRING([--with-installer-version], [4-tuble version of the installer. i.e. 1.2.3.4]))
|
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
|
2008-04-20 16:56:40 -07:00
|
|
|
# Doing that check here, because without enable-installer it is not an error
|
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
|
2008-04-20 16:56:40 -07:00
|
|
|
# Doing that check here, because without enable-installer it is not an error
|
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
|
|
|
|
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])
|
2009-09-12 10:42:43 -07:00
|
|
|
PKG_CHECK_MODULES([THEORA], [theora >= 1.0])
|
2007-06-28 10:47:08 -07:00
|
|
|
|
2009-01-11 06:34:38 -08:00
|
|
|
AS_IF([test "x$enable_sound" = "xyes"],[
|
|
|
|
PKG_CHECK_MODULES([OPENAL], [openal >= 0.0.8])
|
|
|
|
PKG_CHECK_MODULES([OGGVORBIS], [vorbisfile >= 1.1])
|
|
|
|
])
|
|
|
|
|
2008-04-20 16:56:40 -07:00
|
|
|
if test "x$enable_static" = "xyes" ; then
|
|
|
|
# If linking statically, make sure to include the direct dependencies of
|
|
|
|
# QuesoGLC as well, because it does not have a pkg-config file.
|
|
|
|
# FIXME Remove this whenever QuesoGLC has a pkg-config file
|
|
|
|
PKG_CHECK_MODULES([FONTCONFIG], [fontconfig])
|
|
|
|
PKG_CHECK_MODULES([FREETYPE], [freetype2])
|
|
|
|
fi
|
|
|
|
|
2010-04-12 12:09:51 -07:00
|
|
|
system_glee=false
|
|
|
|
if test "x$host_os_mingw32" != "xyes" ; then
|
2010-04-12 13:41:17 -07:00
|
|
|
PKG_CHECK_MODULES([GLee], [glee >= 5.4.0], [system_glee=true], [system_glee=false])
|
2010-03-14 10:14:33 -07:00
|
|
|
fi
|
2010-04-12 12:09:51 -07:00
|
|
|
AM_CONDITIONAL([SYSTEM_GLEE], [test "x$system_glee" = "xtrue"])
|
|
|
|
if test "x$system_glee" = "xfalse" ; then
|
2010-02-26 13:50:37 -08:00
|
|
|
AC_MSG_NOTICE([Using integrated GLee])
|
|
|
|
AC_SUBST([GLee_CFLAGS], ['-I$(top_srcdir)/lib/ivis_opengl'])
|
|
|
|
fi
|
2006-06-21 03:46:56 -07:00
|
|
|
|
2006-06-29 04:27:14 -07:00
|
|
|
# Checks for libraries:
|
|
|
|
|
2009-10-30 16:19:38 -07:00
|
|
|
# check for nearbyint()
|
|
|
|
AC_CHECK_LIB(m, nearbyint, [MATH_LIB=""], AC_MSG_ERROR([nearbyint not found.]))
|
|
|
|
|
2010-03-07 00:29:13 -08:00
|
|
|
# When (cross-)compiling for Windows (MinGW) we need to link in iberty for the Dr. MinGW derived exception handler.
|
2009-12-21 14:22:23 -08:00
|
|
|
if test "x$host_os_mingw32" = "xyes" ; then
|
|
|
|
AC_CHECK_LIB(iberty, main, AC_SUBST([IBERTY_LIBS], [-liberty]), AC_MSG_ERROR([libiberty not found.]))
|
|
|
|
|
|
|
|
WIN32_LIBS="${WIN32_LIBS} ${IBERTY_LIBS}"
|
|
|
|
fi
|
|
|
|
|
2010-02-22 05:07:07 -08:00
|
|
|
# Look for X11 if required
|
|
|
|
AC_TRY_COMPILE(, [
|
|
|
|
#if (defined(__OS2__) && !defined(__EMX__))
|
|
|
|
# error Running OS2, not a Unix system.
|
|
|
|
#elif (!defined(SAG_COM) && (defined(WIN32) || defined(WIN64) || defined(_WIN32) || defined(_WIN64) || defined(__WIN32__) || defined(__WIN64__) || defined(__NT__))) || (defined(__MWERKS__) && defined(__INTEL__))
|
|
|
|
# error Running on Windows, not a Unix system.
|
|
|
|
#endif
|
|
|
|
],[
|
|
|
|
AC_CHECK_LIB(X11, XSetSelectionOwner, AC_SUBST([X11_LIBS], [-lX11]),
|
|
|
|
AC_MSG_ERROR([X11 library not found]))
|
|
|
|
])
|
|
|
|
|
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.]))
|
2008-04-13 17:02:36 -07:00
|
|
|
AC_CHECK_LIB(physfs, PHYSFS_init, AC_SUBST([PHYSFS_LIBS], [-lphysfs]), AC_MSG_ERROR([PhysicsFS not found.]), [${WIN32_LIBS}])
|
2006-06-21 03:46:56 -07: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-12-31 07:42:59 -08:00
|
|
|
AC_CHECK_LIB(GL, main,
|
|
|
|
OPENGL_LIBS="-lGL",
|
|
|
|
AC_CHECK_LIB(opengl32, main,
|
|
|
|
OPENGL_LIBS="-lopengl32",
|
|
|
|
AC_MSG_ERROR([OpenGL library not found.])))
|
|
|
|
AC_CHECK_LIB(GLU, main,
|
|
|
|
OPENGL_LIBS="${OPENGL_LIBS} -lGLU",
|
|
|
|
AC_CHECK_LIB(glu32, main,
|
|
|
|
OPENGL_LIBS="${OPENGL_LIBS} -lglu32",
|
2009-10-30 16:19:38 -07:00
|
|
|
AC_MSG_ERROR([GLU library not found.]),
|
|
|
|
[${OPENGL_LIBS} -lm]), [${OPENGL_LIBS} -lm])
|
2007-12-31 07:42:59 -08: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/])))
|
2008-04-20 16:56:40 -07:00
|
|
|
if test "x$enable_static" = "xyes" ; then
|
|
|
|
# If linking statically, make sure to link against the direct dependencies, too.
|
|
|
|
# FIXME Remove this whenever QuesoGLC has a pkg-config file
|
|
|
|
OPENGLC_LIBS="${OPENGLC_LIBS} ${FONTCONFIG_LIBS} ${FREETYPE_LIBS}"
|
|
|
|
fi
|
2007-10-25 11:13:30 -07:00
|
|
|
AC_SUBST([OPENGLC_LIBS], [${OPENGLC_LIBS}])
|
2007-10-01 12:45:49 -07:00
|
|
|
|
2009-12-21 14:22:23 -08:00
|
|
|
# When (cross-)compiling for Windows (MinGW) we need to link in BFD for the Dr.
|
|
|
|
# MinGW derived exception handler.
|
2008-04-20 16:56:40 -07:00
|
|
|
if test "x$host_os_mingw32" = "xyes" ; then
|
|
|
|
AC_CHECK_HEADER(bfd.h, , AC_MSG_ERROR([BFD header not found.]))
|
|
|
|
AC_CHECK_LIB(bfd, bfd_openr, AC_SUBST([BFD_LIBS], [-lbfd]), AC_MSG_ERROR([BFD not found.]), [${IBERTY_LIBS}])
|
|
|
|
|
2009-12-21 18:29:18 -08:00
|
|
|
WIN32_LIBS="${WIN32_LIBS} ${BFD_LIBS} ${IBERTY_LIBS} -lstdc++"
|
2008-04-20 16:56:40 -07:00
|
|
|
fi
|
|
|
|
|
2009-11-26 10:36:47 -08:00
|
|
|
WZ_CPPFLAGS="${WZ_CPPFLAGS} -DWZ_DATADIR=\"\\\"\${datadir}/\${PACKAGE}\\\"\""
|
2008-01-27 08:56:05 -08:00
|
|
|
WZ_CPPFLAGS="${WZ_CPPFLAGS} -DLOCALEDIR=\"\\\"\${localedir}\\\"\""
|
2008-03-09 13:08:42 -07:00
|
|
|
WZ_CPPFLAGS="${WZ_CPPFLAGS} -I\$(top_srcdir)"
|
2007-10-16 06:09:03 -07:00
|
|
|
|
2007-04-05 10:30:39 -07:00
|
|
|
|
2008-03-09 19:01:46 -07:00
|
|
|
AC_SUBST([WZ_CPPFLAGS], [${WZ_CPPFLAGS}])
|
|
|
|
AC_SUBST([WZ_CFLAGS], [${WZ_CFLAGS}])
|
2010-01-23 18:49:47 -08:00
|
|
|
AC_SUBST([WZ_C99FLAGS], [${WZ_C99FLAGS}])
|
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
|
2008-09-11 02:12:38 -07:00
|
|
|
data/mods/multiplay/Makefile
|
Trunk is currently broken when playing music and switching between the "base" and "mp" mods, see ticket:57.
This revision fixes ticket:57. We (Buginator, EvilGuru and Giel) decided to use the fix suggested in ticket:57 for now and to use [wiki:Proposal:ModMounting] on a later date. I.e. fix the problem now (however dirty the solution may be), and implement a properly designed one later on, instead of letting trunk remain broken until said proposal is worked out in enough detail.
This revision fixes bug #11847, bug #11875, bug #11898, bug #11976, bug #11989, bug #12017, bug #12250 and bug #12280.
Patch by Buginator and myself
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6028 4a71c877-e1ca-e34f-864e-861f7616d084
2008-09-14 13:36:50 -07:00
|
|
|
data/music/Makefile
|
2008-03-15 10:03:58 -07:00
|
|
|
pkg/Makefile
|
|
|
|
pkg/nsis/Makefile
|
2006-11-06 10:35:59 -08:00
|
|
|
win32/Makefile
|
2009-02-26 11:41:25 -08:00
|
|
|
tests/Makefile
|
2006-11-06 10:35:59 -08:00
|
|
|
lib/Makefile
|
|
|
|
lib/framework/Makefile
|
2008-04-05 08:11:43 -07:00
|
|
|
lib/exceptionhandler/Makefile
|
2006-11-06 10:35:59 -08:00
|
|
|
lib/gamelib/Makefile
|
2009-07-26 07:57:03 -07:00
|
|
|
lib/iniparser/Makefile
|
2006-11-06 10:35:59 -08:00
|
|
|
lib/ivis_opengl/Makefile
|
|
|
|
lib/ivis_common/Makefile
|
|
|
|
lib/netplay/Makefile
|
2009-11-21 11:04:16 -08:00
|
|
|
lib/netplay/miniupnpc/Makefile
|
2006-11-06 10:35:59 -08:00
|
|
|
lib/script/Makefile
|
|
|
|
lib/sequence/Makefile
|
|
|
|
lib/sound/Makefile
|
|
|
|
lib/widget/Makefile
|
2008-05-24 05:48:26 -07:00
|
|
|
src/Makefile])
|
2007-06-28 10:47:08 -07:00
|
|
|
AC_OUTPUT
|
|
|
|
|
2008-11-19 02:03:07 -08:00
|
|
|
AS_IF([test "x$enable_debug" = "xyes"],[
|
2007-12-12 10:34:30 -08:00
|
|
|
AC_MSG_NOTICE()
|
|
|
|
AC_MSG_NOTICE([*** Running in debug mode! ***])
|
2008-11-19 02:03:07 -08:00
|
|
|
])
|
2007-12-12 10:34:30 -08:00
|
|
|
|
2008-11-19 02:03:07 -08:00
|
|
|
AS_IF([test "x$with_distributor" = "xUNKNOWN"],[
|
2007-12-12 10:34:30 -08:00
|
|
|
AC_MSG_NOTICE()
|
2007-12-23 13:14:02 -08:00
|
|
|
AC_MSG_WARN([Distributor unknown!])
|
|
|
|
AC_MSG_NOTICE([Use --with-distributor when compiling package for distribution])
|
2008-11-19 02:03:07 -08:00
|
|
|
])
|
2008-09-14 06:40:28 -07:00
|
|
|
|
2008-11-19 02:03:07 -08:00
|
|
|
AS_IF([test -z "$PERL"],[
|
2008-11-16 11:13:39 -08:00
|
|
|
AC_MSG_NOTICE()
|
2009-01-11 06:38:25 -08:00
|
|
|
AC_MSG_WARN([Perl >= 5.10 isn't installed, autogeneration of some sources will not work.])
|
2008-11-19 02:03:07 -08:00
|
|
|
])
|