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) ISODATE=$(date +%Y-%m-%d) AC_SUBST(ISODATE) AC_LANG_C dnl Checks for programs. AC_PROG_INSTALL AC_PROG_CC AC_PROG_CPP AC_PROG_YACC AM_PROG_LEX set $CC if test "$1" = gcc; then shift args="$*" AC_MSG_CHECKING(for broken gcc) if test $(gcc --version) = 2.96; then AC_MSG_RESULT(yes. You poor sod, hope you have egcs) CC="egcs $args" set $CPP shift CPP="egcs $*" else AC_MSG_RESULT(no. good.) fi fi dnl We want warnings, lots of warnings... if test "x$GCC" = xyes; then CFLAGS="$CFLAGS -Wall -Werror" # CFLAGS="$CFLAGS -Wall -pedantic" fi dnl Checks for libraries. dnl Checks for header files. AC_HEADER_STDC AC_CHECK_HEADERS(unistd.h) dnl Checks for typedefs, structures, and compiler characteristics. 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 CFLAGS="$(echo $CFLAGS | sed -e 's/-fomit-frame-pointer//g') -pg" LDFLAGS="$LDFLAGS -pg" else CFLAGS="$CFLAGS -p" fi fi dnl Checks for library functions. AC_MSG_CHECKING(for timeGetTime in -lwinmm) save_LIBS="$LIBS" LIBS="$LIBS -lwinmm" AC_TRY_COMPILE( [#include ], [timeGetTime ();], AC_MSG_RESULT(yes), LIBS="$save_LIBS" AC_MSG_RESULT(no) ) AC_ARG_WITH(qf, [ --with-qf=DIR location of QF libs and headers (prefix)], if test "x$withval" != xyes ; then LIBS="$LIBS -L${withval}/lib" INCLUDES="$INCLUDES -I${withval}/include" fi , HAVE_QF=auto ) AC_CHECK_HEADER(QF/qtypes.h, :, HAVE_QF=no) if test "x$HAVE_QF" != xno; then AC_CHECK_LIB(QFutil, Hash_NewTable, :, HAVE_QF=no, [] ) fi AC_ARG_ENABLE(new-parser, [ --enable-new-parser enable the new parser. not yet fully functional]) if test "x$enable_new_parser" = "xyes"; then AC_DEFINE(NEW_PARSER) fi AM_CONDITIONAL(NEW_PARSER, test "x$enable_new_parser" = "xyes") if test "x$HAVE_QF" = xno; then echo '***' echo '*** You seem to not have the QuakeForge libs & headers installed' echo '***' exit 1 fi AC_OUTPUT( include/Makefile source/Makefile Makefile qfcc.lsm )