# Version 2.2.2_g AC_INIT(configure.in) AC_PREREQ([2.50]) CXXFLAGS=$CXXFLAGS AC_PROG_CXX AM_CONFIG_HEADER(config.h) OBJDIR=obj if test "`uname -a | grep -is cygwin`" -o "`uname -a | grep -is mingw`"; then ARCH=win32 OBJDIR=winobj CPPFLAGS="$CPPFLAGS -DUSE_WIN32" elif test "`uname -a | grep -is bsd`"; then ARCH=bsd CPPFLAGS="$CPPFLAGS -DBSD" elif test "`uname -a | grep -is beos`"; then ARCH=beos CPPFLAGS="$CPPFLAGS -DUSE_BEOS" elif test "`uname -a | grep -is darwin`"; then ARCH=macosx CPPFLAGS="$CPPFLAGS -DUSE_MAC" else ARCH=linux LDFLAGS="$LDFLAGS -lfftw3" fi if test "$ARCH" = "bsd" ; then CPPFLAGS="$CPPFLAGS -I/usr/X11R6/include -I/usr/local/include" LIBS="$LIBS -L/usr/local/lib" fi if test "$ARCH" = "macosx" ; then if test -d /usr/local/include; then CPPFLAGS="$CPPFLAGS -I/usr/local/include" fi if test -d /usr/local/lib; then LIBS="$LIBS -L/usr/local/lib" fi if test -d /sw/include; then CPPFLAGS="$CPPFLAGS -I/sw/include" fi if test -d /sw/lib; then LIBS="$LIBS -L/sw/lib" fi if test -d /opt/local/include; then CPPFLAGS="$CPPFLAGS -I/opt/local/include" fi if test -d /opt/local/lib; then LIBS="$LIBS -L/opt/local/lib" fi fi dnl --- EXTRA DIRS ------------- AC_ARG_WITH(extra-includes, [ --with-extra-includes=DIR [Location of additional include directiories]], CPPFLAGS="$CPPFLAGS -I$withval") AC_ARG_WITH(extra-libs, [ --with-extra-libs=DIR [Location of additional library directories]], LDFLAGS="$LDFLAGS -L$withval") AC_CHECK_FUNCS(strcasestr) AC_CHECK_FUNCS(strnlen) AC_ARG_ENABLE(win32, [ --enable-win32 Force win32, useful for cross-compiling (default: no)]) if test "$enable_win32" = "yes"; then ARCH=win32 OBJDIR=winobj CPPFLAGS="$CPPFLAGS -DUSE_WIN32" PATH="/usr/local/cross/bin:$PATH" fi AC_SUBST(OBJDIR) AC_ARG_ENABLE(static, [ --enable-static Compile a static binary (default: no)]) if test "$enable_static" = "yes"; then LDFLAGS="$LDFLAGS -static" fi AC_ARG_ENABLE(profile, [ --enable-profile Enable profiling support, implies --enable-debug (default: no)]) if test "$enable_profile" = "yes"; then CXXFLAGS="-pg" fi AC_ARG_ENABLE(debug, [ --enable-debug [Enable debug (default: no)]]) if test "$enable_debug" != "yes" -a "$enable_profile" != "yes"; then CXXFLAGS="$CXXFLAGS -O3 -Wall -ffast-math" else CXXFLAGS="$CXXFLAGS -O0 -g -fsigned-char -Wsign-compare -Werror -Wall" CPPFLAGS="$CPPFLAGS -DDEBUG" fi CPPFLAGS="$CPPFLAGS `$SDLCONFIG --cflags`" if test "$enable_static" != "yes"; then LDFLAGS="$LDFLAGS `$SDLCONFIG --libs`" else LDFLAGS="$LDFLAGS `$SDLCONFIG --static-libs`" fi if test "$prefix" = "NONE"; then PREFIX=/usr/local else PREFIX="$prefix" fi AC_SUBST(PREFIX) if test "$ARCH" = "win32"; then if test "`uname -a | grep -is cygwin`"; then LDFLAGS="$LDFLAGS -lwsock32 -lws2_32" else LDFLAGS="$LDFLAGS -lwsock32 -lws2_32 -lmingwex -lgmon" fi fi AC_SUBST(CPPFLAGS) AC_SUBST(CXXFLAGS) AC_SUBST(LDFLAGS) if test "$ARCH" = "win32"; then if ! test -f Rules.make; then echo "include Rules.make.WIN32" >Rules.make else # touch it for dependency reasons touch Rules.make fi AC_CONFIG_FILES(Rules.make.WIN32:Rules.make.in) else AC_CONFIG_FILES(Rules.make) fi AC_OUTPUT # EOF #