mirror of
https://git.code.sf.net/p/quake/newtree
synced 2024-11-10 06:42:26 +00:00
753 lines
20 KiB
Text
753 lines
20 KiB
Text
dnl Process this file with autoconf to produce a configure script.
|
|
AC_PREREQ(2.13)
|
|
AC_INIT(source/sv_main.c)
|
|
AC_REVISION($Revision$) dnl
|
|
AM_CONFIG_HEADER(include/config.h)
|
|
AC_CANONICAL_SYSTEM
|
|
|
|
dnl This is the only place where the package version appears
|
|
AM_INIT_AUTOMAKE(quakeforge, 0.1.99pre2)
|
|
|
|
dnl Define the proper name for package
|
|
AC_DEFINE(PROGRAM, "QuakeForge")
|
|
|
|
QW_VERSION=2.40
|
|
QSG_VERSION=1.0
|
|
|
|
AC_DEFINE_UNQUOTED(QW_VERSION, "$QW_VERSION")
|
|
AC_DEFINE_UNQUOTED(QSG_VERSION, "$QSG_VERSION")
|
|
AC_SUBST(QW_VERSION)
|
|
AC_SUBST(QSG_VERSION)
|
|
|
|
dnl Start TARGETS out at "qf-server"
|
|
TARGETS="qf-server\$(EXEEXT)"
|
|
|
|
dnl Set to yes for releases
|
|
RELEASE=no
|
|
|
|
dnl Set this to no for Id defaults
|
|
NEWSTYLE=yes
|
|
|
|
ISODATE=`date +%Y-%m-%d`
|
|
AC_SUBST(ISODATE)
|
|
|
|
AC_LANG_C
|
|
|
|
|
|
dnl ==================================================================
|
|
dnl Checks for programs.
|
|
dnl ==================================================================
|
|
|
|
AC_PROG_AWK
|
|
AC_PROG_CC
|
|
AC_PROG_CPP
|
|
AC_PROG_RANLIB
|
|
AC_PROG_INSTALL
|
|
AC_PROG_LN_S
|
|
|
|
|
|
dnl ==================================================================
|
|
dnl Checks for system services
|
|
dnl ==================================================================
|
|
|
|
AC_SYS_LONG_FILE_NAMES
|
|
AC_EXEEXT
|
|
AC_OBJEXT
|
|
|
|
|
|
dnl ==================================================================
|
|
dnl Checks for header files.
|
|
dnl ==================================================================
|
|
|
|
AC_HEADER_DIRENT
|
|
AC_HEADER_STDC
|
|
AC_HEADER_MAJOR
|
|
AC_HEADER_SYS_WAIT
|
|
AC_CHECK_HEADERS(
|
|
unistd.h fcntl.h dlfcn.h windows.h sys/ioctl.h sys/mman.h \
|
|
sys/io.h asm/io.h \
|
|
sys/param.h sys/stat.h sys/time.h sys/timeb.h \
|
|
sys/socket.h netinet/in.h netdb.h arpa/inet.h sys/filio.h \
|
|
sys/soundcard.h linux/soundcard.h machine/soundcard.h sys/audioio.h \
|
|
dsound.h mmsystem.h initguid.h mme/mmsystem.h mme/mme_public.h \
|
|
sys/asoundlib.h string.h strings.h memory.h malloc.h \
|
|
errno.h sys/dir.h fnmatch.h \
|
|
mgraph.h
|
|
)
|
|
|
|
|
|
dnl ==================================================================
|
|
dnl Checks for typedefs, structures, and compiler characteristics
|
|
dnl ==================================================================
|
|
|
|
AC_C_CONST
|
|
AC_C_INLINE
|
|
AC_TYPE_SIZE_T
|
|
AC_STRUCT_ST_BLKSIZE
|
|
AC_HEADER_TIME
|
|
AC_STRUCT_TM
|
|
|
|
AC_TRY_COMPILE(
|
|
[#include <sys/types.h>],
|
|
[ socklen_t x = 0;],
|
|
AC_DEFINE(HAVE_SOCKLEN_T)
|
|
dnl FreeBSD 4.0 has it in sys/socket.h
|
|
AC_MSG_CHECKING(for socklen_t in sys/socket.h)
|
|
AC_TRY_COMPILE(
|
|
[#include <sys/types.h>
|
|
#include <sys/socket.h>],
|
|
[ socklen_t x = 0;],
|
|
AC_DEFINE(HAVE_SOCKLEN_T) AC_MSG_RESULT(yes),
|
|
AC_MSG_RESULT(no)
|
|
)
|
|
)
|
|
|
|
AC_MSG_CHECKING(for underscore prefix in names)
|
|
AC_TRY_LINK(
|
|
[asm(".long _bar");
|
|
int bar;],
|
|
[],
|
|
AC_DEFINE(HAVE_SYM_PREFIX_UNDERSCORE) AC_MSG_RESULT(yes),
|
|
AC_MSG_RESULT(no)
|
|
)
|
|
|
|
AC_MSG_CHECKING(for size_t in sys/types.h)
|
|
AC_TRY_COMPILE(
|
|
[#include <sys/types.h>],
|
|
[ size_t x = 0;],
|
|
AC_DEFINE(HAVE_SIZE_T) AC_MSG_RESULT(yes),
|
|
AC_MSG_RESULT(no)
|
|
)
|
|
|
|
dnl maybe these two (at least the 2nd) should only be checked if ipv6 is enabled?
|
|
AC_MSG_CHECKING(for ss_len in struct sockaddr_storage)
|
|
AC_TRY_COMPILE(
|
|
[#include <sys/types.h>
|
|
#include <sys/socket.h>],
|
|
[ void f(void) { struct sockaddr_storage ss; ss.ss_len=0; }],
|
|
AC_DEFINE(HAVE_SS_LEN) AC_MSG_RESULT(yes),
|
|
AC_MSG_RESULT(no)
|
|
)
|
|
|
|
AC_MSG_CHECKING(for sin6_len in struct sockaddr_in6)
|
|
AC_TRY_COMPILE(
|
|
[#include <sys/types.h>
|
|
#include <netinet/in.h>],
|
|
[ void f(void) { struct sockaddr_in6 s6; s6.sin6_len=0; }],
|
|
AC_DEFINE(HAVE_SIN6_LEN) AC_MSG_RESULT(yes),
|
|
AC_MSG_RESULT(no)
|
|
)
|
|
|
|
AC_MSG_CHECKING(for sa_len in struct sockaddr)
|
|
AC_TRY_COMPILE(
|
|
[#include <sys/types.h>
|
|
#include <netinet/in.h>],
|
|
[ void f(void) { struct sockaddr sa; sa.sa_len=0; }],
|
|
AC_DEFINE(HAVE_SA_LEN) AC_MSG_RESULT(yes),
|
|
AC_MSG_RESULT(no)
|
|
)
|
|
|
|
|
|
dnl ==================================================================
|
|
dnl Checks for library functions.
|
|
dnl ==================================================================
|
|
|
|
AC_FUNC_ALLOCA
|
|
AC_FUNC_MEMCMP
|
|
AC_FUNC_MMAP
|
|
AC_TYPE_SIGNAL
|
|
AC_FUNC_VPRINTF
|
|
AC_CHECK_FUNCS(
|
|
gethostname gethostbyname connect gettimeofday getwd mkdir \
|
|
ftime _ftime fcntl stat putenv select socket strerror strstr \
|
|
snprintf _snprintf vsnprintf _vsnprintf strsep dlopen getaddrinfo \
|
|
getnameinfo
|
|
)
|
|
|
|
dnl Checks for stricmp/strcasecmp
|
|
AC_CHECK_FUNC(stricmp,,
|
|
AC_CHECK_FUNC(strcasecmp, AC_DEFINE(stricmp,strcasecmp)))
|
|
|
|
dnl Check for vsnprintf
|
|
if test "x$ac_cv_func_vsnprintf" = "xno" -a \
|
|
"x$ac_cv_func__vsnprintf" = "xno"; then
|
|
dnl libdb may have this
|
|
AC_CHECK_LIB(db,vsnprintf)
|
|
fi
|
|
|
|
dnl Checks for working -lm
|
|
AC_CHECK_LIB(m, pow,, AC_MSG_ERROR([math library (-lm) appears broken]))
|
|
|
|
dnl Checks for MGL support
|
|
AC_ARG_WITH(mgl,
|
|
[ --with-mgl[=DIR] use MGL found in DIR],
|
|
HAVE_MGL=$withval, HAVE_MGL=auto)
|
|
if test "x$HAVE_MGL" != xno; then
|
|
if test "x$ac_cv_header_windows_h" != "xyes"; then
|
|
HAVE_MGL=no
|
|
else
|
|
if test "x$HAVE_MGL" != xauto; then
|
|
MGL_CFLAGS="$MGL_CFLAGS -I$withval/include"
|
|
MGL_LIBS="$MGL_LIBS -L$withval/lib"
|
|
fi
|
|
save_CPPFLAGS="$CPPFLAGS"
|
|
CPPFLAGS="$CPPFLAGS $MGL_CFLAGS"
|
|
AC_CHECK_HEADER(mgraph.h, HAVE_MGL=yes, HAVE_MGL=no)
|
|
CPPFLAGS="$save_CPPFLAGS"
|
|
|
|
dnl Make sure -lmgllt or -lmglfx works
|
|
if test "x$HAVE_MGL" = xyes; then
|
|
for lib in mglfx mgllt; do
|
|
MGL_LIBS="$MGL_LIBS -lgdi32 -lwinmm -ldinput -lddraw"
|
|
AC_CHECK_LIB($lib,MGL_registerDriver,
|
|
MGL_LIBS="-l$lib $MGL_LIBS"
|
|
HAVE_MGL=yes
|
|
break, HAVE_MGL=no, [$MGL_LIBS])
|
|
done
|
|
fi
|
|
fi
|
|
if test "x$HAVE_MGL" != xyes; then
|
|
MGL_CFLAGS="" MGL_LIBS=""
|
|
fi
|
|
fi
|
|
AC_SUBST(HAVE_MGL)
|
|
AC_SUBST(MGL_CFLAGS)
|
|
AC_SUBST(MGL_LIBS)
|
|
|
|
dnl Checks for LibGGI support
|
|
AC_ARG_WITH(ggi,
|
|
[ --with-ggi[=DIR] use LibGGI found in DIR],
|
|
HAVE_GGI=$withval, HAVE_GGI=auto)
|
|
if test "x$HAVE_GGI" != xno; then
|
|
if test "x$HAVE_GGI" != xauto; then
|
|
GGI_CFLAGS="$GGI_CFLAGS= -I$withval/include"
|
|
GGI_LIBS="$GGI_LIBS -L$withval/lib"
|
|
dnl The default system location is /usr/include or /usr/local/include
|
|
dnl and we (obviously) do not need to set CFLAGS for that
|
|
fi
|
|
save_CPPFLAGS="$CPPFLAGS"
|
|
CPPFLAGS="$CPPFLAGS $GGI_CFLAGS"
|
|
AC_CHECK_HEADER(ggi/ggi.h, HAVE_GGI=yes, HAVE_GGI=no)
|
|
CPPFLAGS="$save_CPPFLAGS"
|
|
|
|
dnl Make sure -lggi works
|
|
if test "x$HAVE_GGI" = xyes; then
|
|
AC_CHECK_LIB(ggi, ggiEventsQueued, GGI_LIBS="$GGI_LIBS -lggi"
|
|
HAVE_GGI=yes, HAVE_GGI=no, [$GGI_LIBS]
|
|
)
|
|
fi
|
|
if test "x$HAVE_GGI" != xyes; then
|
|
GGI_CFLAGS="" GGI_LIBS=""
|
|
fi
|
|
fi
|
|
AC_SUBST(HAVE_GGI)
|
|
AC_SUBST(GGI_CFLAGS)
|
|
AC_SUBST(GGI_LIBS)
|
|
|
|
dnl Checks for SVGALib support
|
|
AC_ARG_WITH(svga,
|
|
[ --with-svga[=DIR] use SVGALib found in DIR],
|
|
HAVE_SVGA=$withval, HAVE_SVGA=auto)
|
|
if test "x$HAVE_SVGA" != xno; then
|
|
if test "x$HAVE_SVGA" != xauto; then
|
|
SVGA_CFLAGS="$SVGA_CFLAGS= -I$withval/include"
|
|
SVGA_LIBS="$SVGA_LIBS -L$withval/lib"
|
|
dnl The default system location is /usr/include or /usr/local/include
|
|
dnl and we (obviously) do not need to set CFLAGS for that
|
|
fi
|
|
save_CPPFLAGS="$CPPFLAGS"
|
|
CPPFLAGS="$CPPFLAGS $SVGA_CFLAGS"
|
|
AC_CHECK_HEADER(vga.h, HAVE_SVGA=yes, HAVE_SVGA=no)
|
|
CPPFLAGS="$save_CPPFLAGS"
|
|
|
|
dnl Make sure -lvga works
|
|
if test "x$HAVE_SVGA" = xyes; then
|
|
AC_CHECK_LIB(vga, vga_getmousetype, SVGA_LIBS="$SVGA_LIBS -lvga"
|
|
HAVE_SVGA=yes, HAVE_SVGA=no, [$SVGA_LIBS]
|
|
)
|
|
fi
|
|
if test "x$HAVE_SVGA" != xyes; then
|
|
SVGA_CFLAGS="" SVGA_LIBS=""
|
|
fi
|
|
fi
|
|
AC_SUBST(HAVE_SVGA)
|
|
AC_SUBST(SVGA_CFLAGS)
|
|
AC_SUBST(SVGA_LIBS)
|
|
|
|
dnl Checks for X11 and XShm
|
|
AC_PATH_XTRA
|
|
if test "x$no_x" = x; then
|
|
HAVE_X=yes
|
|
AC_CHECK_LIB(Xext, XShmQueryExtension,
|
|
X_SHM_LIB=-lXext,
|
|
HAVE_X=no,
|
|
[ $X_LIBS -lX11 $X_EXTRA_LIBS ]
|
|
)
|
|
fi
|
|
AC_SUBST(X_SHM_LIB)
|
|
|
|
dnl Check for VIDMODE support
|
|
AC_ARG_ENABLE(VIDMODE,
|
|
[ --enable-VIDMODE use XFree86 VIDMODE extension, if available],
|
|
HAVE_VIDMODE=$enable_VIDMODE, HAVE_VIDMODE=auto)
|
|
if test "x$HAVE_VIDMODE" != xno; then
|
|
save_CPPFLAGS="$CPPFLAGS"
|
|
CPPFLAGS="$X_CFLAGS $CPPFLAGS"
|
|
AC_CHECK_HEADER(X11/extensions/xf86vmode.h, HAVE_VIDMODE=yes, HAVE_VIDMODE=no)
|
|
CPPFLAGS="$save_CPPFLAGS"
|
|
fi
|
|
|
|
dnl Checks for GLX support
|
|
AC_ARG_WITH(glx,
|
|
[ --with-glx[=DIR] use GLX with libraries found in DIR],
|
|
glx_libraries=$withval, glx_libraries=auto
|
|
)
|
|
AC_ARG_WITH(glx-includes,
|
|
[ --with-glx-includes[=DIR]
|
|
use GLX with header files found in DIR],
|
|
glx_includes=$withval, glx_includes=auto
|
|
)
|
|
if test "x$glx_includes" = xno; then
|
|
glx_libraries=""
|
|
fi
|
|
if test "x$glx_librariesS" = xno; then
|
|
glx_includes=""
|
|
fi
|
|
|
|
dnl Checks for GLX headers. lib[Mesa]GL should be either in a standard
|
|
dnl include directory or the X include directory. Either way, we
|
|
dnl use X_CFLAGS.
|
|
if test "x$glx_includes" != xauto -a "x$glx_includes" != x; then
|
|
save_CPPFLAGS="$CPPFLAGS"
|
|
CPPFLAGS="$CPPFLAGS -I$glx_includes"
|
|
AC_CHECK_HEADER($glx_includes/GL/gl.h, HAVE_GLX=yes, HAVE_GLX=no )
|
|
CPPFLAGS="$save_CPPFLAGS"
|
|
else
|
|
save_CPPFLAGS="$CPPFLAGS"
|
|
CPPFLAGS="$CPPFLAGS $X_CFLAGS"
|
|
AC_CHECK_HEADER(GL/gl.h, HAVE_GLX=yes, HAVE_GLX=no)
|
|
CPPFLAGS="$save_CPPFLAGS"
|
|
fi
|
|
|
|
save_CPPFLAGS="$CPPFLAGS"
|
|
CPPFLAGS="$CPPFLAGS $X_CFLAGS"
|
|
dnl Checks for OpenGL features in headers
|
|
if test "x$HAVE_GLX" != xno; then
|
|
AC_MSG_CHECKING(for GL_COLOR_INDEX8_EXT in GL/gl.h)
|
|
AC_TRY_COMPILE([#include "GL/gl.h"],
|
|
[ int x = (int) GL_COLOR_INDEX8_EXT;],
|
|
AC_DEFINE(HAVE_GL_COLOR_INDEX8_EXT) AC_MSG_RESULT(yes),
|
|
AC_MSG_RESULT(no)
|
|
)
|
|
AC_MSG_CHECKING(for GLAPIENTRY in GL/gl.h)
|
|
AC_TRY_COMPILE(
|
|
[#include "GL/gl.h"],
|
|
[ int x = GLAPIENTRY printf("");],
|
|
AC_MSG_RESULT(yes)
|
|
,
|
|
AC_MSG_RESULT(no)
|
|
AC_MSG_CHECKING(for APIENTRY in GL/gl.h)
|
|
AC_TRY_COMPILE(
|
|
[#include "GL/gl.h"],
|
|
[ int x = APIENTRY printf("");],
|
|
AC_DEFINE(GLAPIENTRY, APIENTRY) AC_MSG_RESULT(yes),
|
|
AC_DEFINE(GLAPIENTRY, ) AC_MSG_RESULT(no)
|
|
)
|
|
)
|
|
fi
|
|
CPPFLAGS="$save_CPPFLAGS"
|
|
|
|
|
|
dnl Make sure -lGL or -lMesaGL works
|
|
if test "x$glx_libraries" != xauto -a "x$glx_libraries" != xno -a "x$glx_libraries" != x; then
|
|
if test "x$HAVE_GLX" = xyes; then
|
|
HAVE_GLX=no
|
|
AC_CHECK_LIB(GL, glColor4f,
|
|
HAVE_GLX=yes
|
|
GLX_NAME=GL,,
|
|
[ -L$glx_libraries ]
|
|
)
|
|
if test "x$HAVE_GLX" != xyes; then
|
|
AC_CHECK_LIB(MesaGL, glColor4f,
|
|
HAVE_GLX=yes
|
|
GLX_NAME=MesaGL,,
|
|
[ -L$glx_libraries ]
|
|
)
|
|
fi
|
|
if test "x$HAVE_GLX" = xyes -a "x$have_dynload" != xyes; then
|
|
AC_CHECK_LIB($GLX_NAME, XMesaSetFXmode,
|
|
AC_DEFINE(HAVE_XMESA),,
|
|
[ -L$glx_libraries ]
|
|
)
|
|
fi
|
|
fi
|
|
else
|
|
if test "x$glx_libraries" != xauto \
|
|
-o "x$glx_libraries" != xno \
|
|
-o "x$glx_libraries" != x; then
|
|
glx_libraries=""
|
|
fi
|
|
|
|
if test "x$HAVE_GLX" = xyes; then
|
|
HAVE_GLX=no
|
|
AC_CHECK_LIB(GL, glColor4f,
|
|
HAVE_GLX=yes
|
|
GLX_NAME=GL,,
|
|
[ $X_LIBS ]
|
|
)
|
|
if test "x$HAVE_GLX" != xyes; then
|
|
AC_CHECK_LIB(MesaGL, glColor4f,
|
|
HAVE_GLX=yes
|
|
GLX_NAME=MesaGL,,
|
|
[ $X_LIBS ]
|
|
)
|
|
fi
|
|
if test "x$HAVE_GLX" = xyes -a "x$have_dynload" != xyes; then
|
|
AC_CHECK_LIB($GLX_NAME, XMesaSetFXmode,
|
|
AC_DEFINE(HAVE_XMESA),,
|
|
[ $X_LIBS ]
|
|
)
|
|
fi
|
|
fi
|
|
fi
|
|
|
|
if test "x$HAVE_GLX" = xyes; then
|
|
test "x$GLX_CFLAGS" != x && GLX_CFLAGS="-I$GLX_CFLAGS"
|
|
test "x$glx_libraries" != x && GLX_LIBS="-L$glx_libraries"
|
|
GLX_LIBS="$GLX_LIBS -l$GLX_NAME"
|
|
AC_DEFINE(HAVE_GLX)
|
|
else
|
|
GLX_CFLAGS=""
|
|
GLX_LIBS=""
|
|
fi
|
|
AC_SUBST(GLX_CFLAGS)
|
|
AC_SUBST(GLX_LIBS)
|
|
|
|
dnl Make sure VIDMODE works
|
|
if test "x$HAVE_VIDMODE" = xyes; then
|
|
AC_CHECK_LIB(Xxf86vm, XF86VidModeSwitchToMode,qwfoo=qwfoo,
|
|
HAVE_VIDMODE=no HAVE_DGA=no, [$X_LIBS -lXext -lX11 $X_EXTRA_LIBS])
|
|
fi
|
|
if test "x$HAVE_VIDMODE" != xyes; then
|
|
VIDMODE_LIBS=""
|
|
else
|
|
AC_DEFINE(HAVE_VIDMODE)
|
|
VIDMODE_LIBS="-lXxf86vm"
|
|
fi
|
|
AC_SUBST(VIDMODE_LIBS)
|
|
|
|
dnl ==================================================================
|
|
dnl Checks for system type
|
|
dnl ==================================================================
|
|
|
|
dnl Checks for which system driver to use
|
|
AC_MSG_CHECKING(for system driver)
|
|
case "${host}" in
|
|
i?86-*-mingw32*)
|
|
SYSTYPE=WIN32
|
|
AC_MSG_RESULT([Win32 driver])
|
|
;;
|
|
*)
|
|
SYSTYPE=POSIX
|
|
AC_MSG_RESULT([default POSIX driver])
|
|
;;
|
|
esac
|
|
AM_CONDITIONAL(SYSTYPE_WIN32, test "$SYSTYPE" = "WIN32")
|
|
|
|
dnl Check for ia32
|
|
AC_MSG_CHECKING(for an ia32 machine)
|
|
case "${host}" in
|
|
i?86-*-*)
|
|
AC_MSG_RESULT(yes)
|
|
AC_MSG_CHECKING(to see if we should disable asm optimizations)
|
|
AC_ARG_ENABLE(asmopt,
|
|
[ --disable-asmopt disable assembler optimization],
|
|
ASM_ARCH=none
|
|
AC_MSG_RESULT(yes),
|
|
AC_DEFINE(USE_INTEL_ASM)
|
|
AC_MSG_RESULT(no)
|
|
)
|
|
;;
|
|
*) AC_MSG_RESULT(no)
|
|
esac
|
|
AC_SUBST(ASM_ARCH)
|
|
|
|
dnl ==================================================================
|
|
dnl Checks for sound
|
|
dnl ==================================================================
|
|
|
|
dnl MME
|
|
AC_CHECK_LIB(mme,waveOutOpen,HAVE_LIBMME=yes)
|
|
if test -z "$SNDTYPE" -a "x$ac_cv_header_mme_mmsystem_h" = "xyes" -a \
|
|
"x$HAVE_LIBMME" = "xyes"; then
|
|
AC_EGREP_CPP([QF_maGiC_VALUE],[
|
|
#include <mme/mmsystem.h>
|
|
#ifdef WAVE_OPEN_SHAREABLE
|
|
QF_maGiC_VALUE
|
|
#endif
|
|
], SNDTYPE="MME"
|
|
SOUND_LIBS="-lmme")
|
|
fi
|
|
|
|
dnl OSS
|
|
if test -z "$SNDTYPE" -a "x$ac_cv_header_sys_soundcard_h" = "xyes"; then
|
|
AC_EGREP_CPP([QF_maGiC_VALUE],[
|
|
#include <sys/soundcard.h>
|
|
#ifdef SNDCTL_DSP_SETTRIGGER
|
|
QF_maGiC_VALUE
|
|
#endif
|
|
], SNDTYPE="OSS")
|
|
fi
|
|
if test -z "$SNDTYPE" -a "x$ac_cv_header_linux_soundcard_h" = "xyes"; then
|
|
AC_EGREP_CPP([QF_maGiC_VALUE],[
|
|
#include <linux/soundcard.h>
|
|
#ifdef SNDCTL_DSP_SETTRIGGER
|
|
QF_maGiC_VALUE
|
|
#endif
|
|
], SNDTYPE="OSS")
|
|
fi
|
|
if test -z "$SNDTYPE" -a "x$ac_cv_header_machine_soundcard_h" = "xyes"; then
|
|
AC_EGREP_CPP([QF_maGiC_VALUE],[
|
|
#include <machine/soundcard.h>
|
|
#ifdef SNDCTL_DSP_SETTRIGGER
|
|
QF_maGiC_VALUE
|
|
#endif
|
|
], SNDTYPE="OSS")
|
|
fi
|
|
|
|
dnl Win32
|
|
if test -z "$SNDTYPE" -a "x$ac_cv_header_windows_h" = "xyes" -a \
|
|
"x$ac_cv_header_mmsystem_h" = "xyes"; then
|
|
AC_EGREP_CPP([QF_maGiC_VALUE],[
|
|
#include <windows.h>
|
|
#include <mmsystem.h>
|
|
#ifdef GMEM_MOVEABLE
|
|
#ifdef WAVE_FORMAT_PCM
|
|
QF_maGiC_VALUE
|
|
#endif
|
|
#endif
|
|
], SNDTYPE="WIN32"
|
|
SOUND_LIBS="-lwinmm")
|
|
fi
|
|
|
|
AC_SUBST(SOUND_LIBS)
|
|
AM_CONDITIONAL(SNDTYPE_MME, test "$SNDTYPE" = "MME")
|
|
AM_CONDITIONAL(SNDTYPE_OSS, test "$SNDTYPE" = "OSS")
|
|
AM_CONDITIONAL(SNDTYPE_WIN32, test "$SNDTYPE" = "WIN32")
|
|
|
|
|
|
dnl ==================================================================
|
|
dnl Checks for CD-ROM
|
|
dnl ==================================================================
|
|
|
|
dnl Linux/BSD
|
|
AC_EGREP_CPP([QF_maGiC_VALUE],[
|
|
#include <linux/cdrom.h>
|
|
#ifdef CDROMREADTOCENTRY
|
|
QF_maGiC_VALUE
|
|
#endif
|
|
],
|
|
AC_DEFINE(USE_LINUX_CD)
|
|
CDTYPE=LINUX
|
|
,
|
|
AC_EGREP_CPP([QF_maGiC_VALUE],[
|
|
#include <sys/cdio.h>
|
|
#if defined (CDIOREADTOCENTRY) || defined (CDIOREADTOCENTRYS)
|
|
QF_maGiC_VALUE
|
|
#endif
|
|
], AC_DEFINE(USE_BSD_CD))
|
|
)
|
|
AC_HAVE_STRUCT_FIELD(struct ioc_read_toc_single_entry, entry,[
|
|
#include <sys/cdio.h>
|
|
])
|
|
|
|
dnl Win32
|
|
if test -z "$CDTYPE" -a "$SYSTYPE" = "WIN32"; then
|
|
CDTYPE="WIN32"
|
|
fi
|
|
|
|
AM_CONDITIONAL(CDTYPE_WIN32, test "$CDTYPE" = "WIN32")
|
|
AM_CONDITIONAL(CDTYPE_LINUX, test "$CDTYPE" = "LINUX")
|
|
|
|
|
|
dnl ==================================================================
|
|
dnl Checks for networking
|
|
dnl ==================================================================
|
|
|
|
NET_LIBS=""
|
|
if test "x$ac_cv_func_connect" != "xyes"; then
|
|
AC_MSG_CHECKING([for connect in -lwsock32])
|
|
SAVELIBS="$LIBS"
|
|
LIBS="$LIBS -lwsock32"
|
|
AC_TRY_LINK([
|
|
#include <winsock.h>
|
|
],[
|
|
connect(0, NULL, 42);
|
|
],
|
|
NET_LIBS="$NET_LIBS -lwsock32 -lwinmm"
|
|
AC_MSG_RESULT(yes),
|
|
AC_MSG_RESULT(no))
|
|
LIBS="$SAVELIBS"
|
|
fi
|
|
AC_SUBST(NET_LIBS)
|
|
|
|
|
|
dnl ==================================================================
|
|
dnl Misc checks
|
|
dnl ==================================================================
|
|
|
|
dnl Set $prefix and $exec_prefix to $ac_default_prefix if they are not set
|
|
test "x$prefix" = xNONE && prefix=$ac_default_prefix
|
|
test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
|
|
|
|
AC_ARG_ENABLE(experimental,
|
|
[ --enable-experimental compile with experimental code. Use at your
|
|
own risk])
|
|
if test "x$enable_experimental" = xyes; then
|
|
AC_DEFINE(_EXPERIMENTAL_)
|
|
fi
|
|
|
|
AC_ARG_WITH(gamename,
|
|
[ --with-newstyle compile with defaults a bit different than those
|
|
used by Id Software (does not affect gameplay)],
|
|
NEWSTYLE=$enable_newstyle
|
|
)
|
|
if test "x$NEWSTYLE" = xyes; then
|
|
AC_DEFINE(NEWSTYLE)
|
|
AC_DEFINE(BASEGAME, "base")
|
|
else
|
|
AC_DEFINE(BASEGAME, "id1")
|
|
fi
|
|
|
|
AC_ARG_WITH(global-cfg,
|
|
[ --with-global-cfg=FILE If set will change the name and location of the
|
|
global config file used by QuakeForge. Defaults to
|
|
\${sysconfdir}/quakeforge.conf],
|
|
globalconf="$withval", globalconf="auto")
|
|
if test "x$globalconf" = "xauto" || test "x$globalconf" = "xyes" || \
|
|
test "x$globalconf" = "xno"; then dnl yes/no sanity checks
|
|
eval foo="$sysconfdir"
|
|
AC_DEFINE_UNQUOTED(FS_GLOBALCFG, "$foo/quakeforge.conf")
|
|
else
|
|
AC_DEFINE_UNQUOTED(FS_GLOBALCFG, $globalconf)
|
|
fi
|
|
|
|
AC_ARG_WITH(sharepath,
|
|
[ --with-sharepath=DIR Use DIR for shared game data, defaults to
|
|
\${datadir}/games/quakeforge],
|
|
SHAREPATH=$withval, SHAREPATH="auto")
|
|
if test "x$SHAREPATH" = "xauto" -o "x$SHAREPATH" = "xyes" -o "x$SHAREPATH" = "x"; then
|
|
eval foo="$datadir"
|
|
AC_DEFINE_UNQUOTED(FS_SHAREPATH, "$foo/games/quakeforge")
|
|
elif test "x$SHAREPATH" = xno; then
|
|
AC_DEFINE_UNQUOTED(FS_SHAREPATH, ".")
|
|
else
|
|
AC_DEFINE_UNQUOTED(FS_SHAREPATH, "$SHAREPATH")
|
|
fi
|
|
|
|
AC_ARG_WITH(userpath,
|
|
[ --with-userpath=DIR Use DIR for unshared game data, defaults to
|
|
\${HOME}/.quakeforge],
|
|
USERPATH=$withval, USERPATH="auto")
|
|
if test "x$USERPATH" = "xauto" -o "x$USERPATH" = "xyes" -o "x$USERPATH" = "x"; then
|
|
AC_DEFINE_UNQUOTED(FS_USERPATH, "~/.quakeforge")
|
|
elif test "x$USERPATH" = xno; then
|
|
AC_DEFINE_UNQUOTED(FS_USERPATH, ".")
|
|
else
|
|
AC_DEFINE_UNQUOTED(FS_USERPATH, "$USERPATH")
|
|
fi
|
|
|
|
dnl CFLAGS for release and devel versions
|
|
AC_ARG_ENABLE(release,
|
|
[ --enable-release compile release (with optimizations)],
|
|
RELEASE=$enable_release
|
|
)
|
|
if test "x$RELEASE" = xyes; then
|
|
CFLAGS="-O6 -ffast-math -funroll-loops -fomit-frame-pointer -fexpensive-optimizations"
|
|
if test "x$GCC" = xyes; then
|
|
AC_MSG_CHECKING(for special release compiler settings)
|
|
case "${host}" in
|
|
i?86-*-*)
|
|
MORE_CFLAGS="-malign-loops=4 -malign-jumps=4 -malign-functions=4"
|
|
;;
|
|
*)
|
|
MORE_CFLAGS=""
|
|
;;
|
|
esac
|
|
if test "x$MORE_CFLAGS" = x; then
|
|
AC_MSG_RESULT(no)
|
|
else
|
|
AC_MSG_RESULT(yes)
|
|
CFLAGS="$CFLAGS $MORE_CFLAGS"
|
|
fi
|
|
else
|
|
CFLAGS=-O2
|
|
fi
|
|
fi
|
|
|
|
dnl QuakeForge uses lots of BCPL-style (//) comments, which can cause problems
|
|
dnl with many compilers that don't support the latest ISO standards. Well,
|
|
dnl that is our cover story -- the reality is that we like them and don't want
|
|
dnl to give them up. :)
|
|
dnl Make the compiler swallow its pride...
|
|
if test "x$GCC" != xyes; then
|
|
AC_MSG_CHECKING(for how to deal with BCPL-style comments)
|
|
case "${host}" in
|
|
*-aix*)
|
|
CFLAGS="$CFLAGS -qcpluscmt"
|
|
AC_MSG_RESULT([-qcpluscmt])
|
|
;;
|
|
*-irix6*)
|
|
CFLAGS="$CFLAGS -Xcpluscomm"
|
|
AC_MSG_RESULT([-Xcpluscomm])
|
|
;;
|
|
*-solaris*)
|
|
CFLAGS="$CFLAGS -xCC"
|
|
AC_MSG_RESULT([-xCC])
|
|
;;
|
|
*)
|
|
AC_MSG_RESULT(nothing needed or no switch known)
|
|
;;
|
|
esac
|
|
fi
|
|
|
|
dnl We want warnings, lots of warnings...
|
|
if test "x$GCC" = xyes; then
|
|
CFLAGS="$CFLAGS -Wall -Werror"
|
|
# CFLAGS="$CFLAGS -Wall -pedantic"
|
|
fi
|
|
|
|
dnl ==================================================================
|
|
dnl Find out what to build and finish
|
|
dnl ==================================================================
|
|
|
|
test "x$HAVE_MGL" = xyes && TARGETS="$TARGETS qf-client-mgl\$(EXEEXT)"
|
|
test "x$HAVE_GGI" = xyes && TARGETS="$TARGETS qf-client-ggi\$(EXEEXT)"
|
|
test "x$HAVE_SDL" = xyes && TARGETS="$TARGETS qf-client-sdl\$(EXEEXT)"
|
|
test "x$HAVE_SVGA" = xyes && TARGETS="$TARGETS qf-client-svga\$(EXEEXT)"
|
|
if test "x$HAVE_X" = xyes; then
|
|
TARGETS="$TARGETS qf-client-x11\$(EXEEXT)"
|
|
if test "x$HAVE_GLX" = xyes; then
|
|
TARGETS="$TARGETS qf-client-glx\$(EXEEXT)"
|
|
fi
|
|
fi
|
|
AC_SUBST(TARGETS)
|
|
|
|
dnl Output files
|
|
AC_OUTPUT(
|
|
include/Makefile
|
|
source/Makefile
|
|
doc/Makefile
|
|
doc/man/Makefile
|
|
doc/texinfo/Makefile
|
|
Makefile
|
|
RPM/quakeforge.spec
|
|
RPM/build_rpm
|
|
quakeforge.lsm,
|
|
chmod +x RPM/build_rpm
|
|
)
|
|
AC_MSG_RESULT([
|
|
The following targets have been configured:
|
|
|
|
$TARGETS]
|
|
)
|