2003-01-17 21:18:53 +00:00
|
|
|
# Process this file with autoconf to produce a configure script.
|
2003-03-10 00:51:34 +00:00
|
|
|
AC_INIT(tenebrae, cvs)
|
2003-01-17 21:18:53 +00:00
|
|
|
|
2003-03-05 02:27:25 +00:00
|
|
|
# =================================================================
|
2003-01-17 21:18:53 +00:00
|
|
|
# Detect the canonical target build environment
|
|
|
|
AC_CANONICAL_HOST
|
|
|
|
AC_CANONICAL_TARGET
|
|
|
|
|
|
|
|
AM_INIT_AUTOMAKE
|
|
|
|
|
2003-03-05 02:27:25 +00:00
|
|
|
# =================================================================
|
2003-01-17 21:18:53 +00:00
|
|
|
# Checks for sources
|
|
|
|
AC_CONFIG_SRCDIR([../sys_sdl.c])
|
|
|
|
AM_CONFIG_HEADER([config.h])
|
|
|
|
|
2003-03-05 02:27:25 +00:00
|
|
|
# =================================================================
|
2003-03-10 00:51:34 +00:00
|
|
|
# Checks for programs : cc, c++, yacc, install, make, ar
|
2003-01-17 21:18:53 +00:00
|
|
|
AC_PROG_CC
|
2003-03-05 02:27:25 +00:00
|
|
|
AC_PROG_CXX
|
|
|
|
AC_PROG_YACC
|
2003-01-17 21:18:53 +00:00
|
|
|
AC_PROG_INSTALL
|
|
|
|
AC_PROG_MAKE_SET
|
2003-03-10 00:51:34 +00:00
|
|
|
AC_PROG_RANLIB
|
2003-01-17 21:18:53 +00:00
|
|
|
|
2003-03-05 02:27:25 +00:00
|
|
|
# =================================================================
|
2003-01-17 21:18:53 +00:00
|
|
|
# autoconf 2.53 doesn't check that
|
|
|
|
# AM_PROG_AS
|
|
|
|
CCAS="$CC"
|
2004-01-09 15:37:51 +00:00
|
|
|
CCASFLAGS="$CFLAGS -x assembler-with-cpp -DELF"
|
2003-01-17 21:18:53 +00:00
|
|
|
AC_SUBST(CCAS)
|
|
|
|
AC_SUBST(CCASFLAGS)
|
|
|
|
|
|
|
|
|
2003-03-05 02:27:25 +00:00
|
|
|
# =================================================================
|
|
|
|
# arch compilation tuning
|
|
|
|
|
2003-01-17 21:18:53 +00:00
|
|
|
# The alpha architecture needs special flags for binary portability
|
|
|
|
|
|
|
|
case "$target" in
|
|
|
|
i686-*-linux*)
|
|
|
|
#CFLAGS="-g -mpentiumpro -O6 -ffast-math -funroll-loops -fomit-frame-pointer -fexpensive-optimizations"
|
|
|
|
#CFLAGS="-g -mpentiumpro -O6 -ffast-math -funroll-loops -fexpensive-optimizations"
|
|
|
|
;;
|
|
|
|
alpha*-*-linux*)
|
|
|
|
#CFLAGS="$CFLAGS -mcpu=ev4 -Wa,-mall"
|
2003-03-05 02:27:25 +00:00
|
|
|
CFLAGS="$CFLAGS -Wa,-mall"
|
2003-01-17 21:18:53 +00:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
2003-03-05 02:27:25 +00:00
|
|
|
# =================================================================
|
2003-01-17 21:18:53 +00:00
|
|
|
# Checks for libraries.
|
|
|
|
|
|
|
|
# Figure out which math and networking libraries to use
|
|
|
|
case "$target" in
|
|
|
|
*-*-mingw32*)
|
|
|
|
MATHLIB=""
|
|
|
|
INETLIB="-lwsock32"
|
|
|
|
OPENGLLIBS="-lopengl32 -lglu32"
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
MATHLIB="-lm"
|
|
|
|
INETLIB=""
|
|
|
|
OPENGLLIBS="-lGL -lGLU"
|
|
|
|
;;
|
|
|
|
esac
|
2003-03-05 02:27:25 +00:00
|
|
|
|
2003-01-17 21:18:53 +00:00
|
|
|
AC_SUBST(MATHLIB)
|
|
|
|
AC_SUBST(INETLIB)
|
|
|
|
AC_SUBST(OPENGLLIBS)
|
|
|
|
|
2003-03-05 02:27:25 +00:00
|
|
|
# =================================================================
|
|
|
|
# Check for lex/flex
|
2003-01-17 21:18:53 +00:00
|
|
|
|
|
|
|
AM_PROG_LEX
|
|
|
|
if test "$LEX" != flex; then
|
|
|
|
LEX="$SHELL $missing_dir/missing flex"
|
|
|
|
AC_SUBST(LEX_OUTPUT_ROOT, lex.yy)
|
|
|
|
AC_SUBST(LEXLIB, '')
|
|
|
|
fi
|
|
|
|
|
2003-03-05 02:27:25 +00:00
|
|
|
# =================================================================
|
|
|
|
# Check for PNG
|
2003-01-17 21:18:53 +00:00
|
|
|
# FIX-ME : the png version isn't checked for now (don't know if useful though)
|
|
|
|
PNG_VERSION=1.2.0
|
|
|
|
|
|
|
|
# AC_CHECK_LIB (library, function, [action-if-found], [action-if-not-found], [other-libraries])
|
|
|
|
|
|
|
|
# AC_CHECK_PROG (variable, prog-to-check-for, value-if-found, [value-if-not-found], [path], [reject])
|
|
|
|
|
2003-02-13 19:46:54 +00:00
|
|
|
AC_CHECK_PROG(PNG_LIBS,libpng-config,`libpng-config --libs`, )
|
2003-01-17 21:18:53 +00:00
|
|
|
|
2003-02-13 19:46:54 +00:00
|
|
|
if test x"$PNG_LIBS" = x; then
|
2003-01-17 21:18:53 +00:00
|
|
|
AC_MSG_ERROR([*** libpng not found!])
|
2003-02-13 19:46:54 +00:00
|
|
|
else
|
|
|
|
AC_CHECK_PROG(PNG_CFLAGS,libpng-config,`libpng-config --cflags`, )
|
2003-01-17 21:18:53 +00:00
|
|
|
fi
|
|
|
|
|
2003-02-13 19:46:54 +00:00
|
|
|
AC_SUBST(PNG_CFLAGS)
|
|
|
|
AC_SUBST(PNG_LIBS)
|
2003-01-17 21:18:53 +00:00
|
|
|
|
2003-03-05 02:27:25 +00:00
|
|
|
# =================================================================
|
|
|
|
# Check for XML2
|
|
|
|
|
2003-02-13 19:46:54 +00:00
|
|
|
AC_CHECK_PROG(XML_LIBS,xml2-config,`xml2-config --libs`, )
|
2003-01-17 21:18:53 +00:00
|
|
|
|
2003-02-13 19:46:54 +00:00
|
|
|
if test x"$XML_LIBS" = x; then
|
|
|
|
AC_MSG_ERROR([*** libxml2 not found!])
|
|
|
|
else
|
|
|
|
AC_CHECK_PROG(XML_CFLAGS,xml2-config,`xml2-config --cflags`, )
|
|
|
|
fi
|
|
|
|
|
|
|
|
AC_SUBST(XML_LIBS)
|
|
|
|
AC_SUBST(XML_CFLAGS)
|
|
|
|
|
2003-03-05 02:27:25 +00:00
|
|
|
CFLAGS="$CFLAGS $PNG_CFLAGS $XML_CFLAGS"
|
|
|
|
LIBS="$LIBS $PNG_LIBS $XML_LIBS"
|
|
|
|
|
2003-03-10 00:51:34 +00:00
|
|
|
# =================================================================
|
|
|
|
# Check for X11
|
|
|
|
# FIXME : DGA extension necessary -> add a check
|
|
|
|
# FIXME : at this point, only Xfree is supported, so check for it
|
|
|
|
|
|
|
|
X11_LIBS="-L/usr/X11R6/lib -lpthread -lX11 -lXext -lXxf86dga -lXxf86vm"
|
|
|
|
X11_CFLAGS=""
|
|
|
|
|
|
|
|
#AC_PATH_XTRA
|
|
|
|
|
|
|
|
#X11_CFLAGS="$X_FLAGS"
|
|
|
|
#X11_LIBS="$X_PRE_LIBS $X_LIBS $X_EXTRA_LIBS -lXext -lXxf86dga -lXxf86vm"
|
|
|
|
|
|
|
|
|
|
|
|
AC_SUBST(X11_CFLAGS)
|
|
|
|
AC_SUBST(X11_LIBS)
|
|
|
|
|
|
|
|
AM_CONDITIONAL(HAVE_GLX, test x$X_DISPLAY_MISSING = x )
|
|
|
|
|
|
|
|
|
|
|
|
# =================================================================
|
|
|
|
# Check for SDL
|
|
|
|
|
|
|
|
SDL_VERSION=1.2.0
|
|
|
|
|
|
|
|
AC_ARG_ENABLE(sdl,
|
|
|
|
[ AC_HELP_STRING([--disable-sdl], [disable sdl build [default=no]]) ],
|
|
|
|
[ sdl_enabled=no ],
|
|
|
|
[ sdl_enabled=yes ]
|
|
|
|
)
|
|
|
|
|
|
|
|
AM_PATH_SDL($SDL_VERSION,
|
|
|
|
[ have_sdl=yes ]
|
|
|
|
)
|
|
|
|
|
|
|
|
AM_CONDITIONAL(HAVE_SDL, test x$have_sdl = xyes && test x$sdl_enabled = xyes )
|
|
|
|
|
|
|
|
|
2003-01-17 21:18:53 +00:00
|
|
|
|
2003-03-05 02:27:25 +00:00
|
|
|
# =================================================================
|
2003-01-17 21:18:53 +00:00
|
|
|
# Game data
|
|
|
|
|
|
|
|
AC_ARG_VAR(GAMEDIR,
|
|
|
|
[GAMEDIR defines the quake data subdir [default=${datadir}/games/quake]])
|
|
|
|
|
|
|
|
if test x$GAMEDIR = x; then
|
|
|
|
GAMEDIR=${datadir}/games/quake
|
|
|
|
fi
|
|
|
|
|
|
|
|
AC_SUBST(GAMEDIR)
|
|
|
|
|
2003-03-05 02:27:25 +00:00
|
|
|
# =================================================================
|
2003-01-17 21:18:53 +00:00
|
|
|
# Enable/disable the i686 asm
|
|
|
|
|
|
|
|
AC_ARG_ENABLE(asm,
|
|
|
|
[ --enable-asm enable i686 assembly routines [default=no]],
|
2003-03-05 12:59:02 +00:00
|
|
|
,
|
|
|
|
[enable_asm=no])
|
2003-01-17 21:18:53 +00:00
|
|
|
if test x$enable_asm = xyes; then
|
|
|
|
CFLAGS="$CFLAGS -DUSE_ASM"
|
|
|
|
fi
|
|
|
|
|
2003-03-05 02:27:25 +00:00
|
|
|
# =================================================================
|
2003-01-17 21:18:53 +00:00
|
|
|
# Enable/disable user prefs
|
|
|
|
|
|
|
|
AC_ARG_ENABLE(userpref,
|
|
|
|
[ --enable-userpref enable user preference directory [default=yes]],
|
2003-03-05 12:59:02 +00:00
|
|
|
,
|
|
|
|
[enable_userpref=yes])
|
2003-01-17 21:18:53 +00:00
|
|
|
if test x$enable_userpref = xyes; then
|
|
|
|
CFLAGS="$CFLAGS -DUSERPREF_DIR"
|
|
|
|
fi
|
|
|
|
|
|
|
|
CFLAGS="$CFLAGS -DELF"
|
|
|
|
|
2003-03-05 02:27:25 +00:00
|
|
|
# =================================================================
|
2003-01-17 21:18:53 +00:00
|
|
|
# Checks for header files.
|
2003-03-10 00:51:34 +00:00
|
|
|
|
2003-01-17 21:18:53 +00:00
|
|
|
AC_HEADER_STDC
|
|
|
|
AC_HEADER_SYS_WAIT
|
|
|
|
AC_CHECK_HEADERS([arpa/inet.h fcntl.h limits.h netdb.h netinet/in.h stddef.h stdlib.h string.h sys/file.h sys/ioctl.h sys/param.h sys/socket.h sys/time.h termios.h unistd.h])
|
|
|
|
|
2003-03-05 02:27:25 +00:00
|
|
|
# =================================================================
|
2003-01-17 21:18:53 +00:00
|
|
|
# Checks for typedefs, structures, and compiler characteristics.
|
|
|
|
AC_C_CONST
|
|
|
|
AC_C_INLINE
|
|
|
|
AC_TYPE_SIZE_T
|
|
|
|
AC_HEADER_TIME
|
|
|
|
AC_STRUCT_TM
|
|
|
|
|
2003-03-05 02:27:25 +00:00
|
|
|
# =================================================================
|
2003-01-17 21:18:53 +00:00
|
|
|
# Checks for library functions.
|
|
|
|
AC_FUNC_ALLOCA
|
|
|
|
AC_PROG_GCC_TRADITIONAL
|
|
|
|
AC_FUNC_MALLOC
|
|
|
|
AC_FUNC_MEMCMP
|
|
|
|
AC_FUNC_MMAP
|
|
|
|
AC_TYPE_SIGNAL
|
|
|
|
AC_FUNC_STAT
|
|
|
|
AC_FUNC_VPRINTF
|
|
|
|
AC_CHECK_FUNCS([atexit floor gethostbyaddr gethostbyname gethostname gethrtime getpagesize gettimeofday getwd inet_ntoa memset mkdir munmap pow select socket sqrt strcasecmp strchr strerror strstr])
|
|
|
|
|
2003-03-05 02:27:25 +00:00
|
|
|
# =================================================================
|
|
|
|
# Generate build files
|
|
|
|
|
2003-01-17 21:18:53 +00:00
|
|
|
AC_CONFIG_FILES([Makefile])
|
|
|
|
AC_OUTPUT
|