1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237
|
#
# Autoconf support for XQF
# Initially written by Markus Fischer <mfischer@josefine.ben.tuwien.ac.at>
#
AC_INIT([XQF],[1.0.6],[xqf-developer@lists.sourceforge.net], [xqf])
AC_CONFIG_SRCDIR([src/xqf.c])
AC_PREREQ(2.52)
AM_INIT_AUTOMAKE
dnl AM_CONFIG_HEADER(src/gnuconfig.h:src/gnuconfig.h.in)
AM_CONFIG_HEADER(src/gnuconfig.h)
AM_GLIB_GNU_GETTEXT
IT_PROG_INTLTOOL([0.40.0])
GETTEXT_PACKAGE=xqf
AC_SUBST(GETTEXT_PACKAGE)
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [Gettext domain name.])
dnl Checks for programs.
AC_PROG_CC
AC_ISC_POSIX
AC_PROG_LN_S
AC_PROG_RANLIB
dnl Checks for header files.
AC_HEADER_STDC
#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)
dnl GTK2 support
OLD_GTK_SUPPORT="-DGTK_ENABLE_BROKEN=1"
AC_SUBST(OLD_GTK_SUPPORT)
pkg_modules="gtk+-2.0 >= 2.0.0 gdk-pixbuf-xlib-2.0 x11"
PKG_CHECK_MODULES(PACKAGE, [$pkg_modules])
AC_SUBST(PACKAGE_CFLAGS)
AC_SUBST(PACKAGE_LIBS)
dnl check for qstat
AC_ARG_WITH(qstat,[ --with-qstat=CMD use CMD to run qstat])
AC_MSG_CHECKING(qstat version)
QSTATEXEC="qstat"
if test "x$with_qstat" != "x" ; then
QSTATEXEC="$with_qstat"
fi
qstat_version=`$QSTATEXEC 2>/dev/null | grep version | cut -d' ' -f 3`
if test "x$qstat_version" = "x" ; then
AC_MSG_RESULT(qstat not found)
qstat_is=notfound
else
AC_MSG_RESULT($qstat_version)
fi
AC_SUBST(QSTATEXEC)
AC_CHECK_HEADER(zlib.h,,[AC_MSG_ERROR([zlib.h not found, please install zlib development files])])
AC_CHECK_LIB(z, crc32,[AC_DEFINE([HAVE_LIBZ],[],[Whether libz is installed])],[AC_MSG_ERROR([libz not found])])
dnl determine if we should include readline support...
dnl ripped from physfs package
dnl AC_ARG_ENABLE(readline,
dnl AC_HELP_STRING([--enable-externalrcon],[compile external rcon program (default=yes)])
dnl , ,enable_rcon=yes)
XQFRCON_LIBS=
AC_ARG_ENABLE(externalrcon,[ --enable-externalrcon compile external rcon program (default=no)])
if test x$enable_externalrcon = xyes; then
AC_CHECK_HEADER(readline/readline.h, have_readline_hdr=yes)
AC_CHECK_LIB(readline, readline, have_readline_lib=yes)
AC_CHECK_HEADER(readline/history.h, have_history_hdr=yes)
AC_CHECK_LIB(readline, add_history, have_history_lib=yes)
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
XQFRCON_LIBS="-lreadline"
AC_SUBST(XQFRCON_LIBS)
else
AC_MSG_WARN([libreadline not found, rcon program disabled])
fi
else
AC_MSG_WARN([libreadline not found, rcon program disabled])
fi
fi
AM_CONDITIONAL(BUILD_XQFRCON, test "x$XQFRCON_LIBS" != x)
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])
AC_ARG_ENABLE(geoip,[ --enable-geoip use GeoIP (default=auto)],USE_GEOIP=$enableval, USE_GEOIP=yes)
AC_MSG_RESULT([$USE_GEOIP])
# --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])
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
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"
GEOIP_LIB='-L$(top_builddir)/src -lxqf_dummy_GeoIP'
AC_SUBST(DUMMY_LIBGEOIP_SONAME)
AC_SUBST(DUMMY_LIBGEOIP_ORIG)
else
AC_MSG_ERROR([$use_geoip_dummy is no valid GeoIP library])
fi
else
GEOIP_LIB="-lGeoIP"
fi
else
GEOIP_LIB="$USE_GEOIP"
fi
AC_SUBST(GEOIP_LIB)
else
AC_MSG_WARN([GeoIP.h not found, GeoIP feature disabled])
fi
fi
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"
GDK_PIXBUF_LIBS='-L$(top_builddir)/src -lxqf_dummy_gdk_pixbuf'
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)
dnl check if user wants bzip2 compression instead of gzip
COMPRESSION="-DCOMPRESSOR_GZIP"
AC_ARG_ENABLE(bzip2,[ --enable-bzip2 use bzip2 for data compression])
if test x$enable_bzip2 = xyes; then
COMPRESSION="-DCOMPRESSOR_BZIP2"
fi
AC_SUBST(COMPRESSION)
dnl check if user wants debug
AC_ARG_ENABLE(debug,[ --enable-debug turn on debugging ])
if test x$enable_debug = xyes; then
DEBUG="-DDEBUG"
CFLAGS="-g -O0"
else
DEBUG=""
fi
AC_SUBST(DEBUG)
AC_SUBST(VERSION)
AC_SUBST(QSTATEXEC)
AC_DEFINE_UNQUOTED(XQF_VERSION, "$VERSION", XQF Version number)
AC_DEFINE_UNQUOTED(QSTAT_EXEC, "$QSTATEXEC", QSTAT executable path)
# workaround for intl/ which requires config.h
echo "configure: creating link config.h -> src/gnuconfig.h"
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
echo "configure: creating link intl/libintl.h -> libgnuintl.h"
ln -s libgnuintl.h intl/libintl.h
fi
dnl Use -Wall if we have gcc.
changequote(,)dnl
if test "x$GCC" = "xyes"; then
case " $CFLAGS " in
*[\ \ ]-Wall[\ \ ]*) ;;
*) CFLAGS="$CFLAGS -Wall" ;;
esac
fi
changequote([,])dnl
AC_ARG_ENABLE(profiling,[ --enable-profiling compile with profiling (default=no)])
AC_MSG_CHECKING(whether profiling is requested)
if test x$enable_profiling = xyes; then
CFLAGS="$CFLAGS -pg"
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
fi
AC_CONFIG_FILES([
Makefile
src/Makefile
src/xpm/Makefile
src/zip/Makefile
src/tga/Makefile
docs/Makefile
pixmaps/Makefile
pixmaps/flags/Makefile
pixmaps/trayicon/Makefile
xqf.spec
po/Makefile.in
])
AC_OUTPUT
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
|