2008-04-20 16:56:40 -07:00
|
|
|
AC_PREREQ([2.56])
|
2010-10-30 17:47:36 -07:00
|
|
|
AC_INIT([Warzone 2100],[master],[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])
|
2010-12-05 14:41:55 -08:00
|
|
|
AC_CONFIG_SRCDIR([lib/framework/frame.cpp])
|
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}"
|
2011-01-18 10:47:52 -08:00
|
|
|
CXXFLAGS="${CXXFLAGS}"
|
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
|
2011-05-27 18:00:51 -07:00
|
|
|
AC_CHECK_PROG(CCOMPILER, ${CC}, ccompiler)
|
|
|
|
test -z "${CCOMPILER}" && AC_MSG_ERROR(No C compiler found!)
|
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
|
|
|
AC_PROG_CXX
|
2011-05-27 18:00:51 -07:00
|
|
|
AC_CHECK_PROG(CXXCOMPILER, ${CXX}, cxxcompiler)
|
|
|
|
test -z "${CXXCOMPILER}" && AC_MSG_ERROR(No C++ compiler found!)
|
2007-10-21 11:53:24 -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
|
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!)
|
2010-08-29 07:27:45 -07:00
|
|
|
# --filesync was added in zip 3.0, older versions need -u
|
|
|
|
ZIP_UPDATE="-u"
|
|
|
|
zip -q --filesync filesynctest.zip $srcdir/ChangeLog 2> /dev/null && export ZIP_UPDATE="--filesync"
|
|
|
|
rm -f filesynctest.zip
|
|
|
|
AC_SUBST([ZIP_UPDATE], [${ZIP_UPDATE}])
|
2010-04-15 07:06:33 -07:00
|
|
|
|
2011-05-08 06:40:16 -07:00
|
|
|
AC_CHECK_PROG(A2X, a2x, a2x)
|
|
|
|
AC_CHECK_PROG(WKHTMLTOPDF, wkhtmltopdf, wkhtmltopdf)
|
2011-05-14 09:29:15 -07:00
|
|
|
AM_CONDITIONAL([A2X_AVAILABLE], test -n "$A2X")
|
|
|
|
AM_CONDITIONAL([WKHTMLTOPDF_AVAILABLE], test -n "$WKHTMLTOPDF")
|
2011-05-08 06:40:16 -07:00
|
|
|
|
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])
|
2010-05-15 20:06:23 -07:00
|
|
|
AM_GNU_GETTEXT_VERSION([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
|
|
|
|
2010-05-15 18:36:21 -07:00
|
|
|
# Check for Qt
|
2011-01-23 13:30:57 -08:00
|
|
|
PKG_CHECK_MODULES(QT4, QtCore QtGui QtOpenGL QtNetwork QtScript,,[:])
|
2010-05-15 18:36:21 -07:00
|
|
|
if test "$pkg_failed" = "yes" ; then
|
|
|
|
AC_MSG_ERROR([Qt not found - required!])
|
|
|
|
fi
|
|
|
|
QT4_INCLUDES=$QT4_FRONTEND_CFLAGS
|
|
|
|
QT4_LDFLAGS=$QT4_FRONTEND_LIBS
|
|
|
|
QT4_LIB=$QT4_FRONTEND_LIBS
|
|
|
|
QT4_VERSION=`$PKG_CONFIG --modversion QtCore`
|
|
|
|
AC_SUBST(QT4_VERSION)
|
|
|
|
AC_PATH_PROGS(MOC4, [moc-qt4 moc])
|
|
|
|
AC_PATH_PROGS(UIC4, [uic-qt4 uic])
|
|
|
|
AC_PATH_PROGS(RCC4, [rcc-qt4 rcc])
|
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]))
|
2011-04-25 16:46:39 -07:00
|
|
|
WIN32_LIBS='-ldbghelp -lshfolder -lshlwapi -lpsapi -lshell32 -lwinmm -lws2_32 -liphlpapi'
|
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],
|
2010-08-14 05:31:30 -07:00
|
|
|
AS_HELP_STRING([--enable-debug[=yes/relaxed/profile/debugprofile/optimised/no]],[Compile debug version [[yes]]]),
|
2008-04-20 16:56:40 -07:00
|
|
|
[ 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")
|
2010-05-15 18:36:21 -07:00
|
|
|
# Only needed for CXX, actually.
|
|
|
|
WZ_CPPFLAGS="${WZ_CPPFLAGS} -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS"
|
2010-04-16 10:25:37 -07:00
|
|
|
|
2010-07-21 09:28:41 -07:00
|
|
|
# zlib
|
|
|
|
LDFLAGS="-lz ${LDFLAGS}"
|
|
|
|
|
2010-08-15 05:26:36 -07:00
|
|
|
if test "x$enable_warnings" = "xyes" ; then
|
|
|
|
# Only disable -Werror for the warning.
|
|
|
|
WZ_Wno_="-Wno-error="
|
|
|
|
else
|
|
|
|
# Disable warning completely.
|
|
|
|
WZ_Wno_="-Wno-"
|
|
|
|
fi
|
|
|
|
|
2010-09-04 14:32:59 -07:00
|
|
|
WZ_WARNINGS_GCC="-Wall -Wextra ${WZ_Wno_}unused-parameter ${WZ_Wno_}sign-compare -Wcast-align -Wwrite-strings -Wpointer-arith ${WZ_Wno_}format-security"
|
2011-04-25 02:46:19 -07:00
|
|
|
WZ_WARNINGS_GCC_C="${WZ_WARNINGS_GCC} -Wstrict-prototypes -Wdeclaration-after-statement ${CFLAGS_IGNORE_WARNINGS}"
|
2010-12-05 14:41:55 -08:00
|
|
|
WZ_WARNINGS_GCC_CXX="${WZ_Wno_}enum-compare ${WZ_WARNINGS_GCC}"
|
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"
|
2010-07-16 09:01:22 -07:00
|
|
|
WZ_CXXFLAGS="${WZ_CXXFLAGS} -O0 -g -Wcheck -Werror"
|
2008-04-20 16:56:40 -07:00
|
|
|
WZ_CPPFLAGS="${WZ_CPPFLAGS} -DDEBUG"
|
|
|
|
else
|
2010-08-15 03:03:38 -07:00
|
|
|
WZ_CFLAGS="${WZ_CFLAGS} -O0 -g -Werror ${WZ_WARNINGS_GCC_C}"
|
|
|
|
WZ_CXXFLAGS="${WZ_CXXFLAGS} -O0 -g -Werror ${WZ_WARNINGS_GCC_CXX}"
|
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
|
2010-08-14 05:31:30 -07:00
|
|
|
elif test "x$enable_debug" = "xoptimised" ; then
|
2010-08-15 03:03:38 -07:00
|
|
|
WZ_CFLAGS="${WZ_CFLAGS} -O2 -g -Werror ${WZ_WARNINGS_GCC_C}"
|
|
|
|
WZ_CXXFLAGS="${WZ_CXXFLAGS} -O2 -g -Werror ${WZ_WARNINGS_GCC_CXX}"
|
2010-08-14 05:31:30 -07:00
|
|
|
WZ_C99FLAGS="${WZ_C99FLAGS} -Wno-declaration-after-statement"
|
|
|
|
WZ_CPPFLAGS="${WZ_CPPFLAGS} -DDEBUG"
|
2008-04-20 16:56:40 -07:00
|
|
|
elif test "x$enable_debug" = "xrelaxed" ; then
|
2010-08-15 03:03:38 -07:00
|
|
|
WZ_CFLAGS="${WZ_CFLAGS} -g -O0 ${WZ_WARNINGS_GCC_C}"
|
|
|
|
WZ_CXXFLAGS="${WZ_CXXFLAGS} -g -O0 ${WZ_WARNINGS_GCC_CXX}"
|
2008-04-20 16:56:40 -07:00
|
|
|
WZ_CPPFLAGS="${WZ_CPPFLAGS} -DDEBUG"
|
|
|
|
elif test "x$enable_debug" = "xdebugprofile" ; then
|
2010-08-15 03:03:38 -07:00
|
|
|
WZ_CFLAGS="${WZ_CFLAGS} -g -O0 -pg ${WZ_WARNINGS_GCC_C}"
|
|
|
|
WZ_CXXFLAGS="${WZ_CXXFLAGS} -g -O0 -pg ${WZ_WARNINGS_GCC_CXX}"
|
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
|
2010-08-15 03:03:38 -07:00
|
|
|
WZ_CFLAGS="${WZ_CFLAGS} -g -Os -pg ${WZ_WARNINGS_GCC_C}"
|
|
|
|
WZ_CXXFLAGS="${WZ_CXXFLAGS} -g -Os -pg ${WZ_WARNINGS_GCC_CXX}"
|
2008-04-20 16:56:40 -07:00
|
|
|
WZ_CPPFLAGS="${WZ_CPPFLAGS} -DNDEBUG"
|
2009-10-04 11:40:57 -07:00
|
|
|
LDFLAGS="-pg ${LDFLAGS}"
|
2007-12-12 10:34:30 -08:00
|
|
|
else
|
2010-08-15 03:03:38 -07:00
|
|
|
WZ_CFLAGS="${WZ_CFLAGS} -g ${WZ_WARNINGS_GCC_C}"
|
|
|
|
WZ_CXXFLAGS="${WZ_CXXFLAGS} -g ${WZ_WARNINGS_GCC_CXX}"
|
2008-04-20 16:56:40 -07:00
|
|
|
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([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])
|
|
|
|
])
|
|
|
|
|
2011-04-02 01:19:08 -07:00
|
|
|
PKG_CHECK_MODULES([GLEW], [glew >= 1.5.2])
|
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
|
|
|
|
|
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
|
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
|
|
|
|
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.]))
|
2011-03-04 09:43:00 -08:00
|
|
|
AC_CHECK_LIB(bfd, bfd_openr, AC_SUBST([BFD_LIBS], [-lbfd]), AC_MSG_ERROR([BFD not found.]), [${WIN32_LIBS}])
|
2008-04-20 16:56:40 -07:00
|
|
|
|
2011-03-04 09:43:00 -08:00
|
|
|
WIN32_LIBS="${BFD_LIBS} ${WIN32_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
|
|
|
|
2011-05-21 19:10:04 -07:00
|
|
|
# 3rdparty libs
|
|
|
|
WZ_CPPFLAGS="${WZ_CPPFLAGS} -I\$(top_srcdir)/3rdparty"
|
|
|
|
|
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-07-13 12:04:32 -07:00
|
|
|
AC_SUBST([WZ_CXXFLAGS], [${WZ_CXXFLAGS}])
|
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-06-07 15:51:52 -07:00
|
|
|
icons/Makefile
|
2006-12-24 17:43:01 -08:00
|
|
|
data/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/nsis/Makefile
|
2006-11-06 10:35:59 -08:00
|
|
|
win32/Makefile
|
2009-02-26 11:41:25 -08:00
|
|
|
tests/Makefile
|
2011-05-21 19:10:04 -07:00
|
|
|
3rdparty/miniupnpc/Makefile
|
2006-11-06 10:35:59 -08:00
|
|
|
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
|
|
|
|
lib/ivis_opengl/Makefile
|
|
|
|
lib/netplay/Makefile
|
|
|
|
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
|
|
|
])
|
2011-05-08 06:40:16 -07:00
|
|
|
|
|
|
|
AS_IF([test -z "$A2X" -o -z "$WKHTMLTOPDF"],[
|
2011-05-14 09:29:15 -07:00
|
|
|
AC_MSG_NOTICE()
|
|
|
|
AC_MSG_WARN([a2x or wkhtmltopdf not found, can't convert documentation. This doesn't affect building the game,
|
|
|
|
but means that things like "make dist" and building a Windows installer will fail.])
|
2011-05-08 06:40:16 -07:00
|
|
|
])
|
|
|
|
|