2001-02-24 06:58:54 +00:00
|
|
|
dnl Process this file with autoconf to produce a configure script.
|
|
|
|
|
|
|
|
AC_PREREQ(2.13)
|
|
|
|
AC_INIT(source/qfcc.c)
|
|
|
|
AC_REVISION($Revision$) dnl
|
|
|
|
AM_CONFIG_HEADER(include/config.h)
|
|
|
|
AC_CANONICAL_SYSTEM
|
|
|
|
|
|
|
|
dnl Every other copy of the package version number gets its value from here
|
|
|
|
AM_INIT_AUTOMAKE(qfcc, 0.1.0)
|
|
|
|
|
|
|
|
AC_SUBST(VERSION)
|
|
|
|
|
2001-07-05 21:15:08 +00:00
|
|
|
ISODATE=`date +%Y-%m-%d`
|
2001-02-24 06:58:54 +00:00
|
|
|
AC_SUBST(ISODATE)
|
|
|
|
|
|
|
|
AC_LANG_C
|
|
|
|
|
|
|
|
dnl Checks for programs.
|
|
|
|
AC_PROG_INSTALL
|
|
|
|
AC_PROG_CC
|
|
|
|
AC_PROG_CPP
|
2001-06-12 21:06:28 +00:00
|
|
|
AC_PROG_YACC
|
|
|
|
AM_PROG_LEX
|
2001-02-24 06:58:54 +00:00
|
|
|
|
2001-07-17 05:02:34 +00:00
|
|
|
CPP_NAME=$ac_cv_prog_CPP
|
|
|
|
AC_DEFINE_UNQUOTED(CPP_NAME, "$CPP_NAME")
|
|
|
|
|
2001-03-28 17:17:56 +00:00
|
|
|
dnl We want warnings, lots of warnings...
|
|
|
|
if test "x$GCC" = xyes; then
|
|
|
|
CFLAGS="$CFLAGS -Wall -Werror"
|
|
|
|
# CFLAGS="$CFLAGS -Wall -pedantic"
|
|
|
|
fi
|
|
|
|
|
2001-02-24 06:58:54 +00:00
|
|
|
dnl Checks for libraries.
|
2001-11-12 23:49:08 +00:00
|
|
|
AC_CHECK_LIB(z, gztell,,
|
|
|
|
)
|
2001-02-24 06:58:54 +00:00
|
|
|
|
|
|
|
dnl Checks for header files.
|
|
|
|
AC_HEADER_STDC
|
2002-01-05 18:46:59 +00:00
|
|
|
AC_CHECK_HEADERS(process.h string.h strings.h fcntl.h sys/stat.h sys/types.h sys/wait.h unistd.h)
|
2001-02-24 06:58:54 +00:00
|
|
|
|
|
|
|
dnl Checks for typedefs, structures, and compiler characteristics.
|
2001-04-03 16:50:31 +00:00
|
|
|
AC_ARG_ENABLE(profile,
|
|
|
|
[ --enable-profile compile with profiling (for development)],
|
|
|
|
profile=$enable_profile
|
|
|
|
)
|
|
|
|
if test "x$profile" = xyes; then
|
|
|
|
BUILD_TYPE="$BUILD_TYPE Profile"
|
|
|
|
if test "x$GCC" = xyes; then
|
2001-07-05 21:15:08 +00:00
|
|
|
CFLAGS="`echo $CFLAGS | sed -e 's/-fomit-frame-pointer//g'` -pg"
|
2001-04-03 16:50:31 +00:00
|
|
|
LDFLAGS="$LDFLAGS -pg"
|
|
|
|
else
|
|
|
|
CFLAGS="$CFLAGS -p"
|
|
|
|
fi
|
|
|
|
fi
|
2001-02-24 06:58:54 +00:00
|
|
|
|
2001-07-17 05:02:34 +00:00
|
|
|
AC_DEFINE_UNQUOTED(PATH_SEPARATOR, '/')
|
|
|
|
|
2001-02-24 06:58:54 +00:00
|
|
|
dnl Checks for library functions.
|
|
|
|
|
2001-11-15 03:54:35 +00:00
|
|
|
AC_CHECK_FUNCS(snprintf _snprintf vsnprintf _vsnprintf)
|
|
|
|
|
2001-06-16 05:16:02 +00:00
|
|
|
AC_MSG_CHECKING(for timeGetTime in -lwinmm)
|
|
|
|
save_LIBS="$LIBS"
|
|
|
|
LIBS="$LIBS -lwinmm"
|
|
|
|
AC_TRY_COMPILE(
|
|
|
|
[#include <windows.h>],
|
|
|
|
[timeGetTime ();],
|
|
|
|
AC_MSG_RESULT(yes),
|
|
|
|
LIBS="$save_LIBS"
|
|
|
|
AC_MSG_RESULT(no)
|
|
|
|
)
|
|
|
|
|
2001-06-10 13:07:30 +00:00
|
|
|
AC_ARG_WITH(qf,
|
2001-06-29 00:12:11 +00:00
|
|
|
[ --with-qf=DIR location of QF libs and headers (prefix)],
|
2001-06-10 13:07:30 +00:00
|
|
|
if test "x$withval" != xyes ; then
|
2001-09-24 03:23:44 +00:00
|
|
|
LDFLAGS="$LDFLAGS -L${withval}/lib"
|
|
|
|
CFLAGS="$CFLAGS -I${withval}/include"
|
2001-06-10 13:07:30 +00:00
|
|
|
fi
|
|
|
|
,
|
|
|
|
HAVE_QF=auto
|
|
|
|
)
|
2001-09-24 03:23:44 +00:00
|
|
|
AC_MSG_CHECKING(for QF/qtypes.h)
|
|
|
|
AC_TRY_COMPILE(
|
|
|
|
[#include "QF/qtypes.h"],
|
|
|
|
[qboolean foo = false;
|
|
|
|
foo = true;],
|
|
|
|
AC_MSG_RESULT(yes),
|
|
|
|
AC_MSG_RESULT(no)
|
|
|
|
HAVE_QF=no
|
|
|
|
)
|
2001-06-10 13:07:30 +00:00
|
|
|
if test "x$HAVE_QF" != xno; then
|
2001-06-16 05:16:02 +00:00
|
|
|
AC_CHECK_LIB(QFutil, Hash_NewTable,
|
2001-06-10 13:07:30 +00:00
|
|
|
:, HAVE_QF=no,
|
2001-09-24 02:48:09 +00:00
|
|
|
[]
|
2001-03-29 21:26:56 +00:00
|
|
|
)
|
|
|
|
fi
|
2001-07-14 02:34:16 +00:00
|
|
|
if test "x$HAVE_QF" != xno; then
|
|
|
|
AC_CHECK_LIB(QFgamecode, PR_Opcode,
|
|
|
|
:, HAVE_QF=no,
|
2001-09-24 03:23:44 +00:00
|
|
|
[-lQFutil]
|
2001-07-14 02:34:16 +00:00
|
|
|
)
|
|
|
|
fi
|
2001-06-10 13:07:30 +00:00
|
|
|
|
2001-07-17 05:02:34 +00:00
|
|
|
AC_ARG_ENABLE(cpp,
|
2001-07-19 03:00:08 +00:00
|
|
|
[ --enable-cpp Enable use of the C preprocessor.],
|
2001-07-17 05:02:34 +00:00
|
|
|
AC_DEFINE(USE_CPP)
|
2001-07-19 03:00:08 +00:00
|
|
|
)
|
2001-07-17 05:02:34 +00:00
|
|
|
|
2001-06-10 13:07:30 +00:00
|
|
|
if test "x$HAVE_QF" = xno; then
|
2001-03-29 21:26:56 +00:00
|
|
|
echo '***'
|
|
|
|
echo '*** You seem to not have the QuakeForge libs & headers installed'
|
|
|
|
echo '***'
|
|
|
|
exit 1
|
2001-03-27 21:13:18 +00:00
|
|
|
fi
|
|
|
|
|
2001-02-24 06:58:54 +00:00
|
|
|
AC_OUTPUT(
|
2002-01-05 18:46:59 +00:00
|
|
|
doc/man/Makefile
|
|
|
|
doc/Makefile
|
2001-02-24 06:58:54 +00:00
|
|
|
include/Makefile
|
|
|
|
source/Makefile
|
|
|
|
Makefile
|
|
|
|
qfcc.lsm
|
|
|
|
)
|