quakeforge/tools/qfcc/configure.in
Bill Currie bd6dcafdc8 Replace system defines/includes with qfcc's
Right now, it probably works only with modern gcc.
2020-02-19 02:35:09 +09:00

144 lines
3 KiB
Text

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
AC_ARG_WITH(cpp,
[ --with-cpp=CPP how qfcc should invoke cpp],
cpp_name="$withval", cpp_name=auto
)
if test "x$cpp_name" != xauto; then
CPP_NAME="$cpp_name"
else
CPP_NAME="cpp %u %d %s -o %o %i"
case "$target_os" in
*bsd*)
touch conftest.c
CPP_NAME="`(f=\`$CC -v -E -Dfoo conftest.c -o conftest.i 2>&1 | grep -e -Dfoo\`; set $f; echo "$1")` %d %i %o"
rm -f conftest.[ci]
;;
esac
fi
AC_DEFINE_UNQUOTED(CPP_NAME, "$CPP_NAME", [Define this to the command line for the C preprocessor])
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.
AC_CHECK_LIB(z, gztell,,
)
dnl Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS(process.h string.h strings.h fcntl.h sys/stat.h sys/types.h sys/wait.h 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
AC_DEFINE_UNQUOTED(PATH_SEPARATOR, '/',
[Define this to your operating system's path separator character])
dnl Checks for library functions.
AC_CHECK_FUNCS(snprintf _snprintf vsnprintf _vsnprintf)
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)
)
AC_ARG_WITH(qf,
[ --with-qf=DIR location of QF libs and headers (prefix)],
if test "x$withval" != xyes ; then
LDFLAGS="$LDFLAGS -L${withval}/lib"
CFLAGS="$CFLAGS -I${withval}/include"
fi
,
HAVE_QF=auto
)
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
)
if test "x$HAVE_QF" != xno; then
AC_CHECK_LIB(QFutil, Hash_NewTable,
:, HAVE_QF=no,
[]
)
fi
if test "x$HAVE_QF" != xno; then
AC_CHECK_LIB(QFgamecode, PR_Opcode,
:, HAVE_QF=no,
[-lQFutil]
)
fi
QFCC_LIBS="-lQFgamecode -lQFutil"
QFCC_DEPS=""
QFCC_INCS=""
if test "x$HAVE_QF" = xno; then
echo '***'
echo '*** You seem to not have the QuakeForge libs & headers installed'
echo '***'
exit 1
fi
AC_SUBST(QFCC_LIBS)
AC_SUBST(QFCC_DEPS)
AC_SUBST(QFCC_INCS)
AC_OUTPUT(
doc/Makefile
doc/man/Makefile
include/Makefile
source/Makefile
Makefile
qfcc.lsm
)