2002-05-20 04:49:54 +00:00
|
|
|
dnl $Id$
|
|
|
|
dnl Process this file with autoconf to produce a configure script.
|
|
|
|
|
2002-07-04 00:50:09 +00:00
|
|
|
dnl stick the revision info into the resulting configure script
|
|
|
|
AC_REVISION($Revision$) dnl
|
2002-04-02 05:47:23 +00:00
|
|
|
AC_PREREQ(2.50)
|
2002-07-04 00:50:09 +00:00
|
|
|
|
2002-09-19 06:04:37 +00:00
|
|
|
AC_INIT(quake2, 0.1, quake2-devel@lists.quakeforge.net)
|
|
|
|
AC_CONFIG_SRCDIR(src/main.c)
|
2002-04-02 06:23:02 +00:00
|
|
|
AM_CONFIG_HEADER(config.h)
|
2002-04-02 05:47:23 +00:00
|
|
|
|
2002-05-20 04:49:54 +00:00
|
|
|
dnl get the build and target hosts
|
2002-04-10 06:57:39 +00:00
|
|
|
AC_CANONICAL_SYSTEM
|
|
|
|
|
2002-09-19 06:04:37 +00:00
|
|
|
AM_INIT_AUTOMAKE([1.6 foreign])
|
2002-04-05 00:24:29 +00:00
|
|
|
|
2002-05-20 04:49:54 +00:00
|
|
|
dnl configure --enable-maintainer-mode gets some extra targets
|
|
|
|
AM_MAINTAINER_MODE
|
|
|
|
|
2002-09-19 06:04:37 +00:00
|
|
|
dnl set some macros
|
|
|
|
AC_DEFINE_UNQUOTED(BUILDHOST, "${target_cpu}-${target_os}",
|
|
|
|
[Set to the canonical name of the target machine])
|
|
|
|
AC_SUBST(PROGRAM)
|
|
|
|
AC_SUBST(VERSION)
|
|
|
|
|
2002-05-20 04:49:54 +00:00
|
|
|
dnl -------------------
|
|
|
|
dnl Checks for programs
|
|
|
|
dnl -------------------
|
2002-04-05 00:24:29 +00:00
|
|
|
|
2002-04-02 05:47:23 +00:00
|
|
|
AC_PROG_CC
|
2002-07-04 00:50:09 +00:00
|
|
|
|
|
|
|
dnl libtool is evil
|
|
|
|
AC_PROG_LIBTOOL
|
2002-04-02 05:47:23 +00:00
|
|
|
|
2002-04-10 06:57:39 +00:00
|
|
|
HAVE_MASM=""
|
|
|
|
AC_SUBST(HAVE_MASM)
|
|
|
|
|
|
|
|
AS="$CC"
|
|
|
|
ASFLAGS="\$(DEFS) \$(CFLAGS) \$(CPPFLAGS) \$(DEFAULT_INCLUDES) \$(INCLUDES)"
|
2002-05-03 03:53:38 +00:00
|
|
|
CCAS="$AS"
|
|
|
|
CCASFLAGS="$ASFLAGS"
|
2002-04-10 06:57:39 +00:00
|
|
|
AC_SUBST(AS)
|
|
|
|
AC_SUBST(ASFLAGS)
|
2002-05-03 03:53:38 +00:00
|
|
|
AC_SUBST(CCAS)
|
|
|
|
AC_SUBST(CCASFLAGS)
|
2002-04-10 06:57:39 +00:00
|
|
|
|
2002-05-20 04:49:54 +00:00
|
|
|
dnl --------------------
|
|
|
|
dnl Checks for libraries
|
|
|
|
dnl --------------------
|
2002-04-10 06:57:39 +00:00
|
|
|
|
2002-11-24 05:14:29 +00:00
|
|
|
AC_PATH_PROG(unamepath, uname)
|
|
|
|
if test "_$unamepath" = _; then
|
|
|
|
system="unknown"
|
|
|
|
else
|
|
|
|
AC_MSG_CHECKING(system type)
|
|
|
|
system=`$unamepath -s`
|
|
|
|
AC_MSG_RESULT($system)
|
|
|
|
if test "$system" = "SunOS"; then
|
|
|
|
SYSTEM_LIBS="$SYSTEM_LIBS -lsocket -lnsl"
|
|
|
|
else
|
|
|
|
SYSTEM_LIBS=""
|
|
|
|
fi
|
|
|
|
AC_SUBST(SYSTEM_LIBS)
|
|
|
|
fi
|
|
|
|
|
2002-07-04 14:17:24 +00:00
|
|
|
dnl Check for ossaudio on NetBSD
|
|
|
|
OSS_LIBS=""
|
|
|
|
AC_CHECK_LIB([ossaudio], [_oss_ioctl], [OSS_LIBS="-lossaudio"])
|
|
|
|
AC_SUBST(OSS_LIBS)
|
|
|
|
|
|
|
|
dnl Check for POSIX threads
|
|
|
|
ACX_PTHREAD(,AC_MSG_ERROR(["POSIX threads required!"]))
|
|
|
|
|
2002-07-01 04:53:50 +00:00
|
|
|
dnl Check for SVGAlib
|
|
|
|
AC_ARG_WITH(svgalib,
|
2002-07-17 16:33:54 +00:00
|
|
|
[ --with-svgalib=DIR use SVGAlib found in DIR ],
|
2002-07-01 04:53:50 +00:00
|
|
|
HAVE_SVGALIB=$withval, HAVE_SVGALIB=auto)
|
|
|
|
if test "x$HAVE_SVGALIB" != xno; then
|
|
|
|
if test "x$HAVE_SVGALIB" != xauto; then
|
|
|
|
SVGALIB_CFLAGS="$SVGALIB_CFLAGS -I$withval/include"
|
|
|
|
SVGALIB_LIBS="$SVGALIB_LIBS -L$withval/lib"
|
|
|
|
dnl The default system location is /usr/include or
|
|
|
|
dnl /usr/local/include and we don't need to set CFLAGS
|
|
|
|
dnl for that
|
|
|
|
fi
|
|
|
|
save_CPPFLAGS="$CPPFLAGS"
|
|
|
|
CPPFLAGS="$CPPFLAGS $SVGALIB_CFLAGS"
|
|
|
|
AC_CHECK_HEADER(vga.h, HAVE_SVGALIB=yes, HAVE_SVGALIB=no)
|
|
|
|
CPPFLAGS="$save_CPPFLAGS"
|
|
|
|
dnl make sure -lvga works
|
|
|
|
if test "x$HAVE_SVGALIB" = xyes; then
|
|
|
|
AC_CHECK_LIB(vga, vga_getmousetype,
|
|
|
|
SVGALIB_LIBS="$SVGALIB_LIBS -lvga"
|
|
|
|
HAVE_SVGALIB=yes,
|
|
|
|
HAVE_SVGALIB=no,
|
|
|
|
[$SVGALIB_LIBS]
|
|
|
|
)
|
|
|
|
fi
|
|
|
|
if test "x$HAVE_SVGALIB" != xyes; then
|
|
|
|
SVGALIB_CFLAGS="" SVGALIB_LIBS=""
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
AC_SUBST(HAVE_SVGALIB)
|
|
|
|
AC_SUBST(SVGALIB_CFLAGS)
|
|
|
|
AC_SUBST(SVGALIB_LIBS)
|
|
|
|
|
|
|
|
dnl Check for X11
|
|
|
|
AC_PATH_XTRA
|
|
|
|
if test "x$no_x" = x; then
|
|
|
|
HAVE_X=yes
|
2002-11-24 05:14:29 +00:00
|
|
|
HAVE_XF86_VIDMODE=yes
|
|
|
|
HAVE_XF86_DGA=yes
|
2002-07-01 04:53:50 +00:00
|
|
|
XTRA_LIBS="-lX11"
|
|
|
|
AC_CHECK_LIB(Xext, XShmQueryExtension,
|
|
|
|
XTRA_LIBS="$XTRA_LIBS -lXext",
|
|
|
|
HAVE_X=no,
|
|
|
|
[ $X_LIBS $XTRA_LIBS $X_EXTRA_LIBS ]
|
|
|
|
)
|
|
|
|
if test "x$HAVE_X" = xyes; then
|
|
|
|
save_CPPFLAGS="$CPPFLAGS"
|
|
|
|
CPPFLAGS="$CPPFLAGS $X_CFLAGS"
|
|
|
|
AC_CHECK_HEADER(X11/extensions/xf86vmode.h,
|
|
|
|
dnl Make sure the library works
|
|
|
|
AC_CHECK_LIB(Xxf86vm, XF86VidModeSwitchToMode,
|
2002-11-24 05:14:29 +00:00
|
|
|
XTRA_LIBS="$XTRA_LIBS -lXxf86vm"
|
|
|
|
AC_DEFINE(HAVE_XF86_VIDMODE, 1, [Define this if you have the xf86vmode extension and its Xxf86vm library.]),
|
|
|
|
HAVE_XF86_VIDMODE=no,
|
2002-07-01 04:53:50 +00:00
|
|
|
[$X_LIBS $XTRA_LIBS $X_EXTRA_LIBS]
|
|
|
|
),
|
2002-11-24 05:14:29 +00:00
|
|
|
HAVE_XF86_VIDMODE=no,
|
2002-07-01 04:53:50 +00:00
|
|
|
[#include <X11/Xlib.h>]
|
|
|
|
)
|
|
|
|
CPPFLAGS="$save_CPPFLAGS"
|
|
|
|
fi
|
|
|
|
if test "x$HAVE_X" = xyes; then
|
|
|
|
save_CPPFLAGS="$CPPFLAGS"
|
|
|
|
CPPFLAGS="$CPPFLAGS $X_CFLAGS"
|
|
|
|
AC_CHECK_HEADER(X11/extensions/xf86dga.h,
|
|
|
|
AC_CHECK_LIB(Xxf86dga, XF86DGAQueryVersion,
|
2002-11-24 05:14:29 +00:00
|
|
|
XTRA_LIBS="$XTRA_LIBS -lXxf86dga"
|
|
|
|
AC_DEFINE(HAVE_XF86_DGA, 1, [Define this if you have the xf86dga extension and its Xxf86dga library.]),
|
|
|
|
HAVE_XF86_DGA=no,
|
2002-07-01 04:53:50 +00:00
|
|
|
[$X_LIBS $XTRA_LIBS $X_EXTRA_LIBS]
|
|
|
|
),
|
2002-11-24 05:14:29 +00:00
|
|
|
HAVE_XF86_DGA=no,
|
2002-07-01 04:53:50 +00:00
|
|
|
[#include <X11/Xlib.h>]
|
|
|
|
)
|
|
|
|
CPPFLAGS="$save_CPPFLAGS"
|
|
|
|
fi
|
|
|
|
if test "x$HAVE_X" != xyes; then
|
|
|
|
XTRA_LIBS=""
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
AC_SUBST(HAVE_X)
|
2002-11-24 05:14:29 +00:00
|
|
|
AC_SUBST(HAVE_XF86_VIDMODE)
|
|
|
|
AC_SUBST(HAVE_XF86_DGA)
|
2002-07-01 04:53:50 +00:00
|
|
|
AC_SUBST(XTRA_LIBS)
|
|
|
|
|
|
|
|
dnl Check for OpenGL
|
2002-09-25 12:45:21 +00:00
|
|
|
AC_ARG_WITH(opengl,
|
2002-07-01 04:53:50 +00:00
|
|
|
[ --with-opengl=DIR use OpenGL in DIR ],
|
|
|
|
HAVE_OPENGL=$withval,
|
|
|
|
HAVE_OPENGL=auto)
|
|
|
|
if test "x$HAVE_OPENGL" != xno; then
|
|
|
|
if test "x$HAVE_OPENGL" != xauto; then
|
|
|
|
OPENGL_CFLAGS="$OPENGL_CFLAGS -I$withval/include"
|
|
|
|
OPENGL_LIBS="$OPENGL_LIBS -L$withval/lib"
|
|
|
|
fi
|
|
|
|
save_CPPFLAGS="$CPPFLAGS"
|
|
|
|
CPPFLAGS="$CPPFLAGS $OPENGL_CFLAGS"
|
|
|
|
AC_CHECK_HEADER(GL/gl.h, HAVE_OPENGL=yes, HAVE_OPENGL=no)
|
|
|
|
CPPFLAGS="$save_CPPFLAGS"
|
|
|
|
if test "x$HAVE_OPENGL" = xyes; then
|
|
|
|
AC_CHECK_LIB(GL, glBegin,
|
|
|
|
OPENGL_LIBS="$OPENGL_LIBS -lGL"
|
|
|
|
HAVE_OPENGL=yes,
|
2002-10-14 21:36:35 +00:00
|
|
|
dnl add -lX11 and -lXext if the first test failed
|
|
|
|
dnl (for, e.g. FreeBSD)
|
2002-10-14 20:52:28 +00:00
|
|
|
unset ac_cv_lib_GL_glBegin
|
2002-10-09 21:15:53 +00:00
|
|
|
AC_CHECK_LIB(GL, glBegin,
|
|
|
|
OPENGL_LIBS="$OPENGL_LIBS -lX11 -lXext"
|
|
|
|
HAVE_OPENGL=yes,
|
|
|
|
HAVE_OPENGL=no,
|
2002-10-15 22:22:53 +00:00
|
|
|
[$OPENGL_LIBS -lX11 -lXext]
|
2002-10-09 21:15:53 +00:00
|
|
|
),
|
2002-07-01 04:53:50 +00:00
|
|
|
[$OPENGL_LIBS]
|
|
|
|
)
|
|
|
|
fi
|
2002-11-24 05:14:29 +00:00
|
|
|
if test "x$HAVE_OPENGL" = xyes; then
|
|
|
|
AC_CHECK_HEADER(GL/glext.h, HAVE_OPENGL_GLEXT=yes
|
|
|
|
AC_DEFINE(HAVE_OPENGL_GLEXT, 1, [Define this if you have GL/glext.h]),
|
|
|
|
HAVE_OPENGL_GLEXT=no,
|
|
|
|
[#include <GL/gl.h>])
|
|
|
|
fi
|
2002-07-01 04:53:50 +00:00
|
|
|
if test "x$HAVE_OPENGL" != xyes; then
|
|
|
|
OPENGL_CFLAGS=""
|
|
|
|
OPENGL_LIBS=""
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
AC_SUBST(HAVE_OPENGL)
|
|
|
|
AC_SUBST(OPENGL_LIBS)
|
|
|
|
AC_SUBST(OPENGL_CFLAGS)
|
|
|
|
|
|
|
|
dnl Check for SDL
|
|
|
|
AC_ARG_ENABLE(sdl,
|
2002-07-17 16:33:54 +00:00
|
|
|
[ --disable-sdl disable checking for SDL ],
|
2002-07-01 04:53:50 +00:00
|
|
|
)
|
|
|
|
if test "x$enable_sdl" != xno; then
|
|
|
|
AM_PATH_SDL(1.2.0,
|
|
|
|
HAVE_SDL=yes,
|
|
|
|
HAVE_SDL=no)
|
|
|
|
AC_SUBST(HAVE_SDL)
|
|
|
|
fi
|
|
|
|
|
2002-04-06 05:56:23 +00:00
|
|
|
#AC_CHECK_LIB(GL, glBegin)
|
2002-04-02 05:47:23 +00:00
|
|
|
# FIXME: Replace `main' with a function in `-lX11':
|
2002-04-03 00:27:05 +00:00
|
|
|
#AC_CHECK_LIB(X11, [main])
|
2002-04-02 05:47:23 +00:00
|
|
|
# FIXME: Replace `main' with a function in `-lXext':
|
2002-04-03 00:27:05 +00:00
|
|
|
#AC_CHECK_LIB([Xext], [main])
|
2002-04-02 05:47:23 +00:00
|
|
|
# FIXME: Replace `main' with a function in `-lXxf86dga':
|
2002-04-03 00:27:05 +00:00
|
|
|
#AC_CHECK_LIB([Xxf86dga], [main])
|
2002-04-02 05:47:23 +00:00
|
|
|
# FIXME: Replace `main' with a function in `-lXxf86vm':
|
2002-04-03 00:27:05 +00:00
|
|
|
#AC_CHECK_LIB([Xxf86vm], [main])
|
2002-04-02 05:47:23 +00:00
|
|
|
|
2002-05-20 04:49:54 +00:00
|
|
|
dnl -----------------------
|
|
|
|
dnl Checks for header files
|
|
|
|
dnl -----------------------
|
2002-04-10 06:57:39 +00:00
|
|
|
|
2002-04-10 01:41:52 +00:00
|
|
|
#AC_PATH_X
|
|
|
|
#AC_HEADER_DIRENT
|
|
|
|
#AC_HEADER_STDC
|
2002-04-09 02:01:36 +00:00
|
|
|
dnl AC_HEADER_SYS_WAIT
|
2002-04-10 01:23:13 +00:00
|
|
|
AC_CHECK_HEADERS([ sys/soundcard.h ])
|
2002-04-02 05:47:23 +00:00
|
|
|
|
2002-05-20 04:49:54 +00:00
|
|
|
dnl -------------------------------------------------------------
|
|
|
|
dnl Checks for typedefs, structures, and compiler characteristics
|
|
|
|
dnl -------------------------------------------------------------
|
2002-04-10 06:57:39 +00:00
|
|
|
|
2002-04-02 05:47:23 +00:00
|
|
|
AC_C_CONST
|
|
|
|
AC_C_INLINE
|
|
|
|
AC_TYPE_SIZE_T
|
|
|
|
AC_HEADER_TIME
|
|
|
|
AC_STRUCT_TM
|
|
|
|
AC_TYPE_UID_T
|
2002-05-02 15:45:55 +00:00
|
|
|
AC_TYPE_VA_LIST
|
2002-04-02 05:47:23 +00:00
|
|
|
|
2002-04-10 06:57:39 +00:00
|
|
|
AC_MSG_CHECKING(for underscore prefix in names)
|
|
|
|
AC_TRY_LINK(
|
|
|
|
[asm(".long _bar");
|
|
|
|
int bar;],
|
|
|
|
[],
|
|
|
|
AC_DEFINE(HAVE_SYM_PREFIX_UNDERSCORE, 1, [Define this if C symbols are prefixed with an underscore]) AC_MSG_RESULT(yes),
|
|
|
|
AC_MSG_RESULT(no)
|
|
|
|
)
|
|
|
|
|
2002-04-11 00:38:25 +00:00
|
|
|
if test "x$ac_cv_header_sys_soundcard_h" = "xyes"; then
|
|
|
|
AC_MSG_CHECKING(for AFMT_S16_NE in sys/soundcard.h)
|
|
|
|
AC_EGREP_CPP([QF_maGiC_VALUE],
|
2002-11-04 13:11:40 +00:00
|
|
|
[ #include <sys/soundcard.h>
|
|
|
|
#ifdef AFMT_S16_NE
|
|
|
|
QF_maGiC_VALUE
|
|
|
|
#endif ],
|
2002-04-11 00:38:25 +00:00
|
|
|
HAVE_AFMT_S16_NE=yes
|
|
|
|
AC_MSG_RESULT(yes)
|
|
|
|
,
|
|
|
|
AC_MSG_RESULT(no)
|
|
|
|
)
|
2002-11-04 13:11:40 +00:00
|
|
|
else if test "x$ac_cv_header_soundcard_h" = "xyes"; then
|
|
|
|
AC_MSG_CHECKING(for AFMT_S16_NE in soundcard.h)
|
|
|
|
AC_EGREP_CPP([QF_maGiC_VALUE],
|
|
|
|
[ #include <soundcard.h>
|
|
|
|
#ifdef AFMT_S16_NE
|
|
|
|
QF_maGiC_VALUE
|
|
|
|
#endif ],
|
|
|
|
HAVE_AFMT_S16_NE=yes
|
|
|
|
AC_MSG_RESULT(yes)
|
|
|
|
,
|
|
|
|
AC_MSG_RESULT(no)
|
|
|
|
)
|
|
|
|
fi
|
2002-04-11 00:38:25 +00:00
|
|
|
fi
|
|
|
|
AC_SUBST(HAVE_AFMT_S16_NE)
|
|
|
|
|
2002-04-10 01:18:41 +00:00
|
|
|
dnl -----------------------------
|
|
|
|
dnl Checks for library functions.
|
|
|
|
dnl -----------------------------
|
|
|
|
|
|
|
|
#AC_FUNC_ERROR_AT_LINE
|
|
|
|
#AC_PROG_GCC_TRADITIONAL
|
2002-04-10 01:41:52 +00:00
|
|
|
#AC_FUNC_MALLOC
|
|
|
|
#AC_FUNC_MEMCMP
|
|
|
|
#AC_FUNC_MMAP
|
|
|
|
#AC_TYPE_SIGNAL
|
|
|
|
#AC_FUNC_STAT
|
|
|
|
#AC_FUNC_VPRINTF
|
2002-04-10 01:18:41 +00:00
|
|
|
#AC_CHECK_FUNCS([bzero floor getcwd gethostbyname getmntent getpagesize gettimeofday memmove memset mkdir munmap pow putenv select socket sqrt strcasecmp strchr strdup strerror strrchr strstr])
|
2002-05-02 15:45:55 +00:00
|
|
|
AC_FUNC_VA_COPY
|
|
|
|
AC_FUNC__VA_COPY
|
2002-04-10 01:18:41 +00:00
|
|
|
|
2002-07-04 00:50:09 +00:00
|
|
|
dnl Check for dynamic loader -- needed for the GL refreshers
|
|
|
|
AC_CHECK_FUNCS(dlopen)
|
2002-04-10 01:18:41 +00:00
|
|
|
DL_LIBS=""
|
|
|
|
if test "x$ac_cv_func_dlopen" != "xyes"; then
|
|
|
|
AC_CHECK_LIB(dl,
|
2002-07-05 00:28:04 +00:00
|
|
|
dlopen,
|
|
|
|
AC_DEFINE(HAVE_DLOPEN, 1, [Define if you have the dlopen function.]) DL_LIBS="-ldl"
|
2002-04-10 01:18:41 +00:00
|
|
|
)
|
|
|
|
fi
|
|
|
|
AC_SUBST(DL_LIBS)
|
2002-04-02 05:47:23 +00:00
|
|
|
|
2002-07-01 04:53:50 +00:00
|
|
|
#SDL_FLAGS=`sdl-config --libs`
|
|
|
|
#AC_SUBST(SDL_FLAGS)
|
2002-04-08 05:42:08 +00:00
|
|
|
|
2002-10-13 13:18:03 +00:00
|
|
|
dnl --------------------
|
|
|
|
dnl Input device support
|
|
|
|
dnl --------------------
|
|
|
|
|
|
|
|
AC_MSG_CHECKING(whether to enable joystick support)
|
|
|
|
AC_ARG_ENABLE(joystick,
|
|
|
|
[ --disable-joystick disable joystick support ],
|
|
|
|
AC_MSG_RESULT(no),
|
|
|
|
AC_MSG_RESULT(yes)
|
2002-11-24 05:14:29 +00:00
|
|
|
HAVE_JOYSTICK=yes
|
2002-10-13 13:18:03 +00:00
|
|
|
)
|
2002-11-24 05:14:29 +00:00
|
|
|
if test "x$HAVE_JOYSTICK" = "xyes";then
|
|
|
|
AC_CHECK_HEADER(linux/joystick.h, HAVE_JOYSTICK=yes
|
|
|
|
AC_DEFINE(HAVE_JOYSTICK, 1, [Define this if you want joystick support to be built])
|
|
|
|
, HAVE_JOYSTICK=no)
|
|
|
|
fi
|
2002-10-13 13:18:03 +00:00
|
|
|
|
2002-07-17 06:41:16 +00:00
|
|
|
dnl -------------------------
|
|
|
|
dnl Optimising compiler flags
|
|
|
|
dnl -------------------------
|
|
|
|
|
|
|
|
OPT_CFLAGS=""
|
|
|
|
USE_OPT=""
|
|
|
|
AC_MSG_CHECKING(whether to allow compiler optimisations)
|
|
|
|
AC_ARG_ENABLE(opt,
|
|
|
|
[ --disable-opt disable compiler optimisations ],
|
2002-10-13 13:18:03 +00:00
|
|
|
AC_MSG_RESULT(no),
|
|
|
|
AC_MSG_RESULT(yes)
|
2002-07-17 06:41:16 +00:00
|
|
|
USE_OPT="yes"
|
|
|
|
OPT_CFLAGS="$OPT_CFLAGS -O2 -ffast-math -funroll-loops -fomit-frame-pointer -fexpensive-optimizations"
|
|
|
|
)
|
|
|
|
if test "x$USE_OPT" = "xyes"; then
|
|
|
|
case "${host}" in
|
|
|
|
i?86-*-*)
|
2002-07-18 19:33:01 +00:00
|
|
|
AC_MSG_CHECKING(whether -falign-functions works)
|
|
|
|
save_CFLAGS="$CFLAGS"
|
|
|
|
CFLAGS="-falign-functions"
|
|
|
|
AC_TRY_COMPILE(
|
|
|
|
[],
|
|
|
|
[],
|
|
|
|
OPT_CFLAGS="$OPT_CFLAGS -falign-loops=2 -falign-jumps=2 -falign-functions=2"
|
|
|
|
AC_MSG_RESULT(yes),
|
|
|
|
OPT_CFLAGS="$OPT_CFLAGS -malign-loops=2 -malign-jumps=2 -malign-functions=2"
|
|
|
|
AC_MSG_RESULT(no),
|
|
|
|
)
|
2002-07-18 19:51:10 +00:00
|
|
|
CFLAGS="$save_CFLAGS"
|
2002-07-17 06:41:16 +00:00
|
|
|
;;
|
|
|
|
*)
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
fi
|
|
|
|
AC_SUBST(OPT_CFLAGS)
|
|
|
|
|
2002-12-23 14:04:34 +00:00
|
|
|
dnl -----------------
|
|
|
|
dnl Compiler warnings
|
|
|
|
dnl -----------------
|
|
|
|
|
|
|
|
WARN_CFLAGS=""
|
|
|
|
dnl USE_WARN=""
|
|
|
|
AC_MSG_CHECKING(whether to enable compiler warnings)
|
|
|
|
AC_ARG_ENABLE(warn,
|
|
|
|
[ --disable-warn disable compiler warnings ],
|
|
|
|
AC_MSG_RESULT(no),
|
|
|
|
AC_MSG_RESULT(yes)
|
|
|
|
dnl USE_WARN="yes"
|
|
|
|
WARN_CFLAGS="$WARN_CFLAGS -Wall -Werror"
|
|
|
|
)
|
|
|
|
AC_SUBST(WARN_CFLAGS)
|
|
|
|
|
2002-04-10 06:57:39 +00:00
|
|
|
dnl -------------------
|
|
|
|
dnl Checks for asm junk
|
|
|
|
dnl -------------------
|
|
|
|
|
2002-07-01 04:53:50 +00:00
|
|
|
AC_MSG_CHECKING(if assembler can be used)
|
2002-04-10 06:57:39 +00:00
|
|
|
case "${host}" in
|
|
|
|
i?86-*-*)
|
|
|
|
AC_MSG_RESULT(yes)
|
2002-07-01 04:53:50 +00:00
|
|
|
AC_MSG_CHECKING(if asm is disabled)
|
2002-04-10 06:57:39 +00:00
|
|
|
AC_ARG_ENABLE(asm,
|
2002-07-05 00:28:04 +00:00
|
|
|
[ --disable-asm disable assembler optimisation ],
|
|
|
|
AC_MSG_RESULT(asm disabled),
|
|
|
|
AC_DEFINE(USE_ASM, 1, [Define this if you want to use assembler optimised code])
|
|
|
|
ASM_ARCH=yes
|
|
|
|
AC_MSG_RESULT(asm enabled)
|
2002-04-10 06:57:39 +00:00
|
|
|
)
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
AC_MSG_RESULT(no)
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
AM_CONDITIONAL(ASM_ARCH, test "$ASM_ARCH" = "yes")
|
|
|
|
|
2002-11-24 05:14:29 +00:00
|
|
|
dnl -------------------
|
|
|
|
dnl Checks for SDL-only platforms
|
|
|
|
dnl -------------------
|
|
|
|
|
|
|
|
AC_MSG_CHECKING(if SDL sound can be used instead of native drivers)
|
|
|
|
case "${host}" in
|
|
|
|
*-sun-solaris*)
|
|
|
|
AC_MSG_RESULT(yes)
|
|
|
|
AC_MSG_WARN(Defaulting to SDL sound under Solaris due to temporary lack of native support.)
|
|
|
|
BUILD_SDLQUAKE2=yes
|
|
|
|
AC_DEFINE(BUILD_SDLQUAKE2, 1, [Define this if you want SDL sound instead of native drivers])
|
|
|
|
;;
|
|
|
|
i?86-*-*)
|
|
|
|
AC_MSG_RESULT(yes)
|
|
|
|
AC_MSG_CHECKING(if SDL sound will be used)
|
|
|
|
AC_ARG_ENABLE(sdlsound,
|
|
|
|
[ --enable-sdlsound enable SDL sound instead of native drivers ],
|
2002-12-06 15:03:15 +00:00
|
|
|
AC_MSG_RESULT(yes)
|
2002-11-24 05:14:29 +00:00
|
|
|
AC_DEFINE(BUILD_SDLQUAKE2, 1, [Define this if you want SDL sound instead of native drivers])
|
|
|
|
BUILD_SDLQUAKE2=yes,
|
2002-12-06 15:03:15 +00:00
|
|
|
AC_MSG_RESULT(no)
|
2002-11-24 05:14:29 +00:00
|
|
|
)
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
AC_MSG_RESULT(no)
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
AM_CONDITIONAL(BUILD_SDLQUAKE2, test "x$BUILD_SDLQUAKE2" = "xyes")
|
|
|
|
|
2002-05-20 04:49:54 +00:00
|
|
|
dnl ---------------------------------------------------
|
|
|
|
dnl Check if the xatrix and rogue sources are available
|
|
|
|
dnl ---------------------------------------------------
|
|
|
|
|
2002-07-01 04:53:50 +00:00
|
|
|
AC_MSG_CHECKING(if Xatrix missionpack source is available)
|
2002-05-20 04:49:54 +00:00
|
|
|
if test -f src/xatrix/g_main.c; then
|
|
|
|
AC_MSG_RESULT(yes)
|
2002-05-20 05:12:04 +00:00
|
|
|
DO_XATRIX=yes
|
2002-05-20 05:01:40 +00:00
|
|
|
else
|
|
|
|
AC_MSG_RESULT(no)
|
2002-05-20 04:49:54 +00:00
|
|
|
fi
|
|
|
|
|
2002-07-01 04:53:50 +00:00
|
|
|
AC_MSG_CHECKING(if Rogue missionpack source is available)
|
2002-05-20 04:49:54 +00:00
|
|
|
if test -f src/rogue/g_main.c; then
|
|
|
|
AC_MSG_RESULT(yes)
|
2002-05-20 05:12:04 +00:00
|
|
|
DO_ROGUE=yes
|
2002-05-20 05:01:40 +00:00
|
|
|
else
|
|
|
|
AC_MSG_RESULT(no)
|
2002-05-20 04:49:54 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
AM_CONDITIONAL(DO_XATRIX, test "$DO_XATRIX" = "yes")
|
|
|
|
AM_CONDITIONAL(DO_ROGUE, test "$DO_ROGUE" = "yes")
|
|
|
|
|
2002-07-04 00:50:09 +00:00
|
|
|
dnl ----------------------
|
|
|
|
dnl Fill in path variables
|
|
|
|
dnl ----------------------
|
|
|
|
|
|
|
|
dnl $libdir usually gets set to ${exec_prefix}/lib,
|
2002-07-17 05:10:09 +00:00
|
|
|
dnl $prefix and $exec_prefix is likely to be "NONE"
|
2002-07-04 00:50:09 +00:00
|
|
|
dnl Autoconf usually sets pkglibdir correctly in the Makefile, but not in
|
|
|
|
dnl the configure script :(
|
2002-07-17 05:45:57 +00:00
|
|
|
test "$prefix" = "NONE" && prefix=/usr/local
|
|
|
|
test "$exec_prefix" = "NONE" && exec_prefix=$prefix
|
2002-07-17 05:10:09 +00:00
|
|
|
|
|
|
|
eval PKGLIBDIR="$libdir/$PACKAGE"
|
2002-07-04 00:50:09 +00:00
|
|
|
AC_DEFINE_UNQUOTED(PKGLIBDIR, "$PKGLIBDIR", [Define this to the path containing the dynamic modules (\${exec-prefix}/lib/quake2/)])
|
|
|
|
|
|
|
|
eval PKGDATADIR="$datadir/$PACKAGE"
|
2002-07-22 02:03:47 +00:00
|
|
|
AC_DEFINE_UNQUOTED(PKGDATADIR, "$PKGDATADIR", [Define this to the path containing the game data (\${prefix}/share/quake2/)])
|
2002-07-04 00:50:09 +00:00
|
|
|
|
2002-07-01 04:53:50 +00:00
|
|
|
dnl ---------------------------------
|
|
|
|
dnl Work out what refreshers to build
|
|
|
|
dnl ---------------------------------
|
|
|
|
|
|
|
|
VID_REFS=""
|
|
|
|
|
|
|
|
if test "x$HAVE_SVGALIB" = xyes; then
|
2002-07-04 00:50:09 +00:00
|
|
|
VID_REFS="$VID_REFS ref_soft.la"
|
2002-07-01 04:53:50 +00:00
|
|
|
BUILD_SOFT="yes"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if test "x$HAVE_X" = xyes; then
|
2002-07-04 00:50:09 +00:00
|
|
|
VID_REFS="$VID_REFS ref_softx.la"
|
2002-07-01 04:53:50 +00:00
|
|
|
BUILD_SOFTX="yes"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if test "x$HAVE_SDL" = xyes; then
|
2002-07-04 00:50:09 +00:00
|
|
|
VID_REFS="$VID_REFS ref_softsdl.la"
|
2002-07-01 04:53:50 +00:00
|
|
|
BUILD_SOFTSDL="yes"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if test "x$HAVE_X" = xyes -a "x$HAVE_OPENGL" = xyes; then
|
2002-07-04 00:50:09 +00:00
|
|
|
VID_REFS="$VID_REFS ref_glx.la"
|
2002-07-01 04:53:50 +00:00
|
|
|
BUILD_GLX="yes"
|
|
|
|
fi
|
|
|
|
|
2002-07-20 04:30:46 +00:00
|
|
|
if test "x$HAVE_X" = xyes -a "x$HAVE_OPENGL" = xyes -a "x$HAVE_SVGALIB" = xyes; then
|
2002-07-04 00:50:09 +00:00
|
|
|
VID_REFS="$VID_REFS ref_tdfx.la"
|
|
|
|
BUILD_TDFX="yes"
|
2002-07-01 04:53:50 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
if test "x$HAVE_X" = xyes -a "x$HAVE_OPENGL" = xyes -a "x$HAVE_SDL" = xyes; then
|
2002-07-04 00:50:09 +00:00
|
|
|
VID_REFS="$VID_REFS ref_sdlgl.la"
|
2002-07-01 04:53:50 +00:00
|
|
|
BUILD_SDLGL="yes"
|
|
|
|
fi
|
|
|
|
|
|
|
|
AM_CONDITIONAL(BUILD_SOFT, test "x$BUILD_SOFT" = xyes)
|
|
|
|
AM_CONDITIONAL(BUILD_SOFTX, test "x$BUILD_SOFTX" = xyes)
|
|
|
|
AM_CONDITIONAL(BUILD_SOFTSDL, test "x$BUILD_SOFTSDL" = xyes)
|
|
|
|
AM_CONDITIONAL(BUILD_GLX, test "x$BUILD_GLX" = xyes)
|
2002-07-04 00:50:09 +00:00
|
|
|
AM_CONDITIONAL(BUILD_TDFX, test "x$BUILD_TDFX" = xyes)
|
2002-07-01 04:53:50 +00:00
|
|
|
AM_CONDITIONAL(BUILD_SDLGL, test "x$BUILD_SDLGL" = xyes)
|
|
|
|
|
|
|
|
AC_SUBST(VID_REFS)
|
|
|
|
|
2002-04-10 06:57:39 +00:00
|
|
|
dnl -----------
|
|
|
|
dnl Dump it out
|
|
|
|
dnl -----------
|
2002-04-08 06:17:02 +00:00
|
|
|
|
2002-07-01 04:53:50 +00:00
|
|
|
AC_CONFIG_FILES([
|
|
|
|
Makefile
|
|
|
|
src/Makefile
|
|
|
|
src/baseq2/Makefile
|
|
|
|
src/ctf/Makefile
|
|
|
|
src/xatrix/Makefile
|
|
|
|
src/rogue/Makefile
|
2002-09-16 14:02:04 +00:00
|
|
|
data/Makefile
|
2002-09-16 23:47:30 +00:00
|
|
|
data/pixmaps/Makefile
|
2002-09-16 14:02:04 +00:00
|
|
|
data/baseq2/Makefile
|
2002-07-01 04:53:50 +00:00
|
|
|
])
|
2002-04-02 05:47:23 +00:00
|
|
|
AC_OUTPUT
|
2002-07-01 04:53:50 +00:00
|
|
|
|
2002-07-04 00:50:09 +00:00
|
|
|
VID_REFS=`echo $VID_REFS | sed -e 's/ref_//g' -e 's/\.la//g'`
|
2002-07-01 04:53:50 +00:00
|
|
|
AC_MSG_RESULT([
|
2002-07-04 00:50:09 +00:00
|
|
|
Video refreshers: ${VID_REFS- none}
|
2002-11-24 05:14:29 +00:00
|
|
|
Platform: ${host}
|
2002-07-01 04:53:50 +00:00
|
|
|
])
|