2000-11-05 20:40:48 +00:00
|
|
|
#
|
|
|
|
# Autoconf support for XQF
|
|
|
|
# Initially written by Markus Fischer <mfischer@josefine.ben.tuwien.ac.at>
|
|
|
|
#
|
|
|
|
|
2014-10-26 15:12:37 +01:00
|
|
|
AC_INIT([XQF],[1.0.6.1],[xqf-developer@lists.sourceforge.net], [xqf])
|
2002-12-08 18:05:29 +00:00
|
|
|
AC_CONFIG_SRCDIR([src/xqf.c])
|
2003-10-25 11:13:38 +00:00
|
|
|
AC_PREREQ(2.52)
|
2000-11-05 20:40:48 +00:00
|
|
|
|
2002-12-08 18:05:29 +00:00
|
|
|
AM_INIT_AUTOMAKE
|
2001-07-02 04:38:44 +00:00
|
|
|
dnl AM_CONFIG_HEADER(src/gnuconfig.h:src/gnuconfig.h.in)
|
|
|
|
AM_CONFIG_HEADER(src/gnuconfig.h)
|
2000-11-05 20:40:48 +00:00
|
|
|
|
2013-10-25 00:08:33 +02:00
|
|
|
AM_GLIB_GNU_GETTEXT
|
|
|
|
IT_PROG_INTLTOOL([0.40.0])
|
|
|
|
|
2004-02-02 17:01:38 +00:00
|
|
|
GETTEXT_PACKAGE=xqf
|
|
|
|
AC_SUBST(GETTEXT_PACKAGE)
|
2013-10-25 00:08:33 +02:00
|
|
|
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [Gettext domain name.])
|
2004-02-02 17:01:38 +00:00
|
|
|
|
2001-07-02 04:38:44 +00:00
|
|
|
dnl Checks for programs.
|
2000-11-05 20:40:48 +00:00
|
|
|
AC_PROG_CC
|
|
|
|
AC_ISC_POSIX
|
2005-09-13 16:20:02 +00:00
|
|
|
AC_PROG_LN_S
|
|
|
|
AC_PROG_RANLIB
|
2001-07-02 04:38:44 +00:00
|
|
|
|
|
|
|
dnl Checks for header files.
|
2000-11-05 20:40:48 +00:00
|
|
|
AC_HEADER_STDC
|
|
|
|
|
2002-10-15 20:50:58 +00:00
|
|
|
#The Release stuff for the spec file.
|
|
|
|
RELEASE="1"
|
|
|
|
AC_ARG_WITH(rpm_release,[ --with-rpm-release=VAL RPM Release (e.g. 1mdk)])
|
|
|
|
if test "x$with_rpm_release" != "x" ; then
|
|
|
|
RELEASE="$with_rpm_release"
|
|
|
|
fi
|
|
|
|
AC_SUBST(RELEASE)
|
|
|
|
|
2014-10-03 00:21:36 +02:00
|
|
|
dnl GTK2 support
|
|
|
|
OLD_GTK_SUPPORT="-DGTK_ENABLE_BROKEN=1"
|
2014-10-10 02:13:32 +02:00
|
|
|
AC_SUBST(OLD_GTK_SUPPORT)
|
2014-10-03 00:21:36 +02:00
|
|
|
|
|
|
|
pkg_modules="gtk+-2.0 >= 2.0.0 gdk-pixbuf-xlib-2.0 x11"
|
|
|
|
PKG_CHECK_MODULES(PACKAGE, [$pkg_modules])
|
|
|
|
AC_SUBST(PACKAGE_CFLAGS)
|
2014-10-10 02:13:32 +02:00
|
|
|
AC_SUBST(PACKAGE_LIBS)
|
2003-01-19 23:35:39 +00:00
|
|
|
|
2000-11-05 20:40:48 +00:00
|
|
|
dnl check for qstat
|
|
|
|
AC_ARG_WITH(qstat,[ --with-qstat=CMD use CMD to run qstat])
|
|
|
|
|
|
|
|
AC_MSG_CHECKING(qstat version)
|
|
|
|
|
2001-12-13 22:15:04 +00:00
|
|
|
QSTATEXEC="qstat"
|
|
|
|
|
2000-11-05 20:40:48 +00:00
|
|
|
if test "x$with_qstat" != "x" ; then
|
|
|
|
QSTATEXEC="$with_qstat"
|
|
|
|
fi
|
|
|
|
|
2001-12-13 22:15:04 +00:00
|
|
|
qstat_version=`$QSTATEXEC 2>/dev/null | grep version | cut -d' ' -f 3`
|
|
|
|
|
2000-11-05 20:40:48 +00:00
|
|
|
if test "x$qstat_version" = "x" ; then
|
|
|
|
AC_MSG_RESULT(qstat not found)
|
2001-12-13 22:15:04 +00:00
|
|
|
qstat_is=notfound
|
2000-11-05 20:40:48 +00:00
|
|
|
else
|
|
|
|
AC_MSG_RESULT($qstat_version)
|
|
|
|
fi
|
|
|
|
|
|
|
|
AC_SUBST(QSTATEXEC)
|
|
|
|
|
2002-12-19 13:44:03 +00:00
|
|
|
AC_CHECK_HEADER(zlib.h,,[AC_MSG_ERROR([zlib.h not found, please install zlib development files])])
|
2005-01-21 21:21:46 +00:00
|
|
|
AC_CHECK_LIB(z, crc32,[AC_DEFINE([HAVE_LIBZ],[],[Whether libz is installed])],[AC_MSG_ERROR([libz not found])])
|
2002-12-07 18:38:23 +00:00
|
|
|
|
2002-09-07 10:55:52 +00:00
|
|
|
dnl determine if we should include readline support...
|
|
|
|
dnl ripped from physfs package
|
2002-09-16 19:33:09 +00:00
|
|
|
dnl AC_ARG_ENABLE(readline,
|
|
|
|
dnl AC_HELP_STRING([--enable-externalrcon],[compile external rcon program (default=yes)])
|
|
|
|
dnl , ,enable_rcon=yes)
|
2005-01-21 21:21:46 +00:00
|
|
|
XQFRCON_LIBS=
|
2002-12-19 22:01:46 +00:00
|
|
|
AC_ARG_ENABLE(externalrcon,[ --enable-externalrcon compile external rcon program (default=no)])
|
|
|
|
if test x$enable_externalrcon = xyes; then
|
2002-09-07 10:55:52 +00:00
|
|
|
AC_CHECK_HEADER(readline/readline.h, have_readline_hdr=yes)
|
2013-10-25 00:04:08 +02:00
|
|
|
AC_CHECK_LIB(readline, readline, have_readline_lib=yes)
|
2002-09-07 10:55:52 +00:00
|
|
|
AC_CHECK_HEADER(readline/history.h, have_history_hdr=yes)
|
2013-10-25 00:04:08 +02:00
|
|
|
AC_CHECK_LIB(readline, add_history, have_history_lib=yes)
|
2002-09-07 10:55:52 +00:00
|
|
|
if test x$have_readline_hdr = xyes -a x$have_readline_lib = xyes; then
|
|
|
|
if test x$have_history_hdr = xyes -a x$have_history_lib = xyes; then
|
2013-10-25 00:04:08 +02:00
|
|
|
XQFRCON_LIBS="-lreadline"
|
2002-09-07 10:55:52 +00:00
|
|
|
AC_SUBST(XQFRCON_LIBS)
|
|
|
|
else
|
2002-12-19 13:44:03 +00:00
|
|
|
AC_MSG_WARN([libreadline not found, rcon program disabled])
|
2002-09-07 10:55:52 +00:00
|
|
|
fi
|
|
|
|
else
|
2002-12-19 13:44:03 +00:00
|
|
|
AC_MSG_WARN([libreadline not found, rcon program disabled])
|
2002-09-07 10:55:52 +00:00
|
|
|
fi
|
|
|
|
fi
|
2005-01-21 21:21:46 +00:00
|
|
|
AM_CONDITIONAL(BUILD_XQFRCON, test "x$XQFRCON_LIBS" != x)
|
2002-09-07 10:55:52 +00:00
|
|
|
|
2003-06-19 10:48:05 +00:00
|
|
|
dnl determine whether GeoIP should be used
|
|
|
|
AC_CHECK_HEADER(GeoIP.h,have_geoip_hdr=yes,have_geoip_hdr=no)
|
|
|
|
AC_MSG_CHECKING([whether GeoIP should be used])
|
2003-10-25 11:13:38 +00:00
|
|
|
AC_ARG_ENABLE(geoip,[ --enable-geoip use GeoIP (default=auto)],USE_GEOIP=$enableval, USE_GEOIP=yes)
|
2003-06-19 10:48:05 +00:00
|
|
|
AC_MSG_RESULT([$USE_GEOIP])
|
|
|
|
|
2005-01-21 21:21:46 +00:00
|
|
|
# --enable-geoip-dummy=/usr/lib/libGeoIP.so
|
|
|
|
AC_MSG_CHECKING([whether a GeoIP dummy library should be used])
|
|
|
|
AC_ARG_ENABLE(geoip_dummy,
|
|
|
|
[ --enable-geoip-dummy=FILE use dummy GeoIP lib based on FILE (default=no)],
|
|
|
|
use_geoip_dummy="$enableval", use_geoip_dummy=no)
|
|
|
|
AC_MSG_RESULT([$use_geoip_dummy])
|
|
|
|
|
2003-06-19 10:48:05 +00:00
|
|
|
if test "x$USE_GEOIP" != "xno"; then
|
|
|
|
if test "x$have_geoip_hdr" = "xyes";then
|
|
|
|
AC_DEFINE_UNQUOTED(USE_GEOIP,1,Define if we should use GeoIP)
|
|
|
|
if test "x$USE_GEOIP" = "xyes"; then
|
2005-01-21 21:21:46 +00:00
|
|
|
if test "x$use_geoip_dummy" != "xno"; then
|
|
|
|
DUMMY_LIBGEOIP_SONAME=`objdump -p "$use_geoip_dummy"|awk '$1 == "SONAME" {print $2}'`
|
|
|
|
if test "x$DUMMY_LIBGEOIP_SONAME" != x; then
|
|
|
|
DUMMY_LIBGEOIP_ORIG="$use_geoip_dummy"
|
2005-09-13 16:20:02 +00:00
|
|
|
GEOIP_LIB='-L$(top_builddir)/src -lxqf_dummy_GeoIP'
|
2005-01-21 21:21:46 +00:00
|
|
|
|
|
|
|
AC_SUBST(DUMMY_LIBGEOIP_SONAME)
|
|
|
|
AC_SUBST(DUMMY_LIBGEOIP_ORIG)
|
|
|
|
else
|
|
|
|
AC_MSG_ERROR([$use_geoip_dummy is no valid GeoIP library])
|
|
|
|
fi
|
|
|
|
else
|
2003-06-19 10:48:05 +00:00
|
|
|
GEOIP_LIB="-lGeoIP"
|
2005-01-21 21:21:46 +00:00
|
|
|
fi
|
2003-06-19 10:48:05 +00:00
|
|
|
else
|
|
|
|
GEOIP_LIB="$USE_GEOIP"
|
|
|
|
fi
|
|
|
|
AC_SUBST(GEOIP_LIB)
|
|
|
|
|
|
|
|
else
|
|
|
|
AC_MSG_WARN([GeoIP.h not found, GeoIP feature disabled])
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2005-01-21 21:21:46 +00:00
|
|
|
AM_CONDITIONAL(DUMMY_LIBGEOIP, test x$DUMMY_LIBGEOIP_SONAME != x)
|
|
|
|
|
|
|
|
# --enable-geoip-dummy=/usr/lib/libGeoIP.so
|
|
|
|
AC_MSG_CHECKING([whether a GDK-Pixbuf dummy library should be used])
|
|
|
|
AC_ARG_ENABLE(pixbuf_dummy,
|
|
|
|
[ --enable-pixbuf-dummy=FILE use dummy gdk-pixbuf lib based on FILE (default=no)],
|
|
|
|
use_pixbuf_dummy="$enableval", use_pixbuf_dummy=no)
|
|
|
|
AC_MSG_RESULT([$use_pixbuf_dummy])
|
|
|
|
if test "x$use_pixbuf_dummy" != "xno"; then
|
|
|
|
DUMMY_LIBGDKPIXBUF_SONAME=`objdump -p "$use_pixbuf_dummy"|awk '$1 == "SONAME" {print $2}'`
|
|
|
|
if test "x$DUMMY_LIBGDKPIXBUF_SONAME" != x; then
|
|
|
|
DUMMY_LIBGDKPIXBUF_ORIG="$use_pixbuf_dummy"
|
2007-10-25 08:44:56 +00:00
|
|
|
GDK_PIXBUF_LIBS='-L$(top_builddir)/src -lxqf_dummy_gdk_pixbuf'
|
2005-01-21 21:21:46 +00:00
|
|
|
|
|
|
|
AC_SUBST(DUMMY_LIBGDKPIXBUF_SONAME)
|
|
|
|
AC_SUBST(DUMMY_LIBGDKPIXBUF_ORIG)
|
|
|
|
else
|
|
|
|
AC_MSG_ERROR([$use_pixbuf_dummy is no valid library])
|
|
|
|
fi
|
|
|
|
AC_SUBST(GDK_PIXBUF_LIBS)
|
|
|
|
fi
|
|
|
|
AM_CONDITIONAL(DUMMY_LIBGDKPIXBUF, test x$DUMMY_LIBGDKPIXBUF_SONAME != x)
|
|
|
|
|
2000-11-05 20:40:48 +00:00
|
|
|
dnl check if user wants bzip2 compression instead of gzip
|
|
|
|
COMPRESSION="-DCOMPRESSOR_GZIP"
|
2004-08-17 20:09:16 +00:00
|
|
|
AC_ARG_ENABLE(bzip2,[ --enable-bzip2 use bzip2 for data compression])
|
|
|
|
if test x$enable_bzip2 = xyes; then
|
|
|
|
COMPRESSION="-DCOMPRESSOR_BZIP2"
|
|
|
|
fi
|
2000-11-05 20:40:48 +00:00
|
|
|
AC_SUBST(COMPRESSION)
|
|
|
|
|
|
|
|
dnl check if user wants debug
|
2004-08-17 20:09:16 +00:00
|
|
|
AC_ARG_ENABLE(debug,[ --enable-debug turn on debugging ])
|
|
|
|
if test x$enable_debug = xyes; then
|
|
|
|
DEBUG="-DDEBUG"
|
|
|
|
CFLAGS="-g -O0"
|
|
|
|
else
|
|
|
|
DEBUG=""
|
|
|
|
fi
|
2000-11-05 20:40:48 +00:00
|
|
|
AC_SUBST(DEBUG)
|
|
|
|
|
2001-07-02 04:38:44 +00:00
|
|
|
AC_SUBST(VERSION)
|
|
|
|
AC_SUBST(QSTATEXEC)
|
|
|
|
|
|
|
|
AC_DEFINE_UNQUOTED(XQF_VERSION, "$VERSION", XQF Version number)
|
|
|
|
AC_DEFINE_UNQUOTED(QSTAT_EXEC, "$QSTATEXEC", QSTAT executable path)
|
2000-11-05 20:40:48 +00:00
|
|
|
|
2001-09-05 00:00:04 +00:00
|
|
|
# workaround for intl/ which requires config.h
|
2002-09-18 20:20:05 +00:00
|
|
|
echo "configure: creating link config.h -> src/gnuconfig.h"
|
2001-09-05 00:00:04 +00:00
|
|
|
test -e config.h -a ! -L config.h && rm config.h
|
|
|
|
test ! -e config.h && ln -s src/gnuconfig.h config.h
|
|
|
|
|
|
|
|
rm -f intl/libintl.h
|
|
|
|
# damn gettext should do that itself!
|
|
|
|
if test "$USE_INCLUDED_LIBINTL" = "yes"; then
|
2002-09-18 20:20:05 +00:00
|
|
|
echo "configure: creating link intl/libintl.h -> libgnuintl.h"
|
2001-09-05 00:00:04 +00:00
|
|
|
ln -s libgnuintl.h intl/libintl.h
|
|
|
|
fi
|
|
|
|
|
2003-01-19 23:35:39 +00:00
|
|
|
dnl Use -Wall if we have gcc.
|
|
|
|
changequote(,)dnl
|
|
|
|
if test "x$GCC" = "xyes"; then
|
|
|
|
case " $CFLAGS " in
|
|
|
|
*[\ \ ]-Wall[\ \ ]*) ;;
|
|
|
|
*) CFLAGS="$CFLAGS -Wall" ;;
|
|
|
|
esac
|
2001-10-05 18:43:31 +00:00
|
|
|
fi
|
2003-01-19 23:35:39 +00:00
|
|
|
changequote([,])dnl
|
2001-10-05 18:43:31 +00:00
|
|
|
|
2004-08-17 20:09:16 +00:00
|
|
|
AC_ARG_ENABLE(profiling,[ --enable-profiling compile with profiling (default=no)])
|
2002-10-27 21:43:28 +00:00
|
|
|
AC_MSG_CHECKING(whether profiling is requested)
|
2004-08-17 20:09:16 +00:00
|
|
|
if test x$enable_profiling = xyes; then
|
2002-10-27 21:43:28 +00:00
|
|
|
CFLAGS="$CFLAGS -pg"
|
|
|
|
AC_MSG_RESULT([yes])
|
|
|
|
else
|
|
|
|
AC_MSG_RESULT([no])
|
|
|
|
fi
|
|
|
|
|
2002-12-08 18:05:29 +00:00
|
|
|
AC_CONFIG_FILES([
|
2003-10-25 11:13:38 +00:00
|
|
|
Makefile
|
|
|
|
src/Makefile
|
|
|
|
src/xpm/Makefile
|
|
|
|
src/zip/Makefile
|
2004-08-14 15:06:02 +00:00
|
|
|
src/tga/Makefile
|
2003-10-25 11:13:38 +00:00
|
|
|
docs/Makefile
|
2003-10-26 14:41:17 +00:00
|
|
|
pixmaps/Makefile
|
|
|
|
pixmaps/flags/Makefile
|
2004-06-19 18:24:07 +00:00
|
|
|
pixmaps/trayicon/Makefile
|
2003-10-25 11:13:38 +00:00
|
|
|
xqf.spec
|
|
|
|
po/Makefile.in
|
2002-05-29 03:22:08 +00:00
|
|
|
])
|
2002-12-08 18:05:29 +00:00
|
|
|
AC_OUTPUT
|
2001-12-13 22:15:04 +00:00
|
|
|
|
|
|
|
if test "x$qstat_is" = "xnotfound" ; then
|
|
|
|
AC_MSG_RESULT([
|
|
|
|
*** QStat is *required* to run XQF
|
|
|
|
*** Get it from http://qstat.org/
|
|
|
|
*** and put it in your path
|
|
|
|
])
|
|
|
|
fi
|