diff --git a/tools/qfcc/configure.in b/tools/qfcc/configure.in index 789b30993..21934d623 100644 --- a/tools/qfcc/configure.in +++ b/tools/qfcc/configure.in @@ -23,9 +23,23 @@ AC_PROG_CPP AC_PROG_YACC AM_PROG_LEX -CPP_NAME=$ac_cv_prog_CPP -AC_DEFINE_UNQUOTED(CPP_NAME, "$CPP_NAME", - [Define this to the command line for the C preprocessor]) +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 %d -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