AC_INIT(configure.in) AC_PREREQ([2.50]) CPPFLAGS="$CPPFLAGS -I/usr/local/include" AC_CHECK_HEADERS(zlib.h,, AC_MSG_ERROR(could not find zlib.h)) AC_CHECK_HEADERS(png.h,, AC_MSG_ERROR(could not find png.h)) EXE= OUTFILE="\$(TOPDIR)/stratagus\$(EXE)" OE=o OBJDIR=obj if test "`uname -a | grep -is cygwin`" -o "`uname -a | grep -is mingw`"; then WIN32=1 EXE=.exe OUTFILE="\$(TOPDIR)/stratagus\$(EXE)" ARCH=win32 OBJDIR=winobj PLATFORM="-DUSE_WIN32" elif test "`uname -a | grep -is bsd`"; then ARCH=bsd PLATFORM="-DBSD" elif test "`uname -a | grep -is beos`"; then ARCH=beos PLATFORM="-DUSE_BEOS" else ARCH=linux fi dnl --- CHECK FOR GUILE --- AC_ARG_WITH([guile], AC_HELP_STRING([--with-guile], [Enable Guile Support (default: no)]),, with_guile="no") if test "x$with_guile" = "xyes"; then dnl AC_DEFINE(USE_GUILE,, [Use Guile instead of SIOD]) AC_CHECK_LIB(guile, main, [AC_SUBST(GUILE_CFLAGS, "-DUSE_GUILE") AC_SUBST(GUILE_LIBS, "-lguile")], [ echo "Guile support not available, fallback to SIOD" AC_SUBST(GUILE_CFLAGS, "") AC_SUBST(GUILE_LIBS, "")]) fi dnl ----------------------- dnl --- NEW_UI --- AC_ARG_WITH([new-ui], AC_HELP_STRING([--with-new-ui], [Enable New User Interface (default: no)]),, with_new_ui="no") NEWUI_CFLAGS= if test "x$with_new_ui" = "xyes"; then NEWUI_CFLAGS="-DNEW_UI" fi AC_SUBST(NEWUI_CFLAGS) dnl ----------------------- dnl --- CHECK FOR WITH SOUND --- AC_ARG_ENABLE(sound, [ --enable-sound [Use sound (default: yes)]], SOUND="$with_sound") SOUND_CFLAGS= if test "$SOUND" != "no"; then SOUND_CFLAGS="-DWITH_SOUND" fi AC_SUBST(SOUND_CFLAGS) dnl ---------------------------- AC_ARG_ENABLE(win32, [ --enable-win32 Force win32, useful for cross-compiling (default: no)]) if test "$enable_win32" = "yes"; then WIN32=1 EXE=.exe OUTFILE="\$(TOPDIR)/stratagus\$(EXE)" ARCH=win32 OBJDIR=winobj PLATFORM="-DUSE_WIN32" PATH="/usr/local/cross/bin:$PATH" fi AC_SUBST(EXE) AC_SUBST(OUTFILE) AC_SUBST(ARCH) AC_SUBST(OE) AC_SUBST(OBJDIR) AC_SUBST(PLATFORM) AC_ARG_ENABLE(static, [ --enable-static Compile a static binary (default: no)]) if test "$enable_static" != "yes"; then STATIC_LDFLAGS= else STATIC_LDFLAGS="-static" fi AC_SUBST(STATIC_LDFLAGS) AC_ARG_ENABLE(profile, [ --enable-profile Enable profiling support, implies --enable-debug (default: no)]) if test "$enable_profile" != "yes"; then PROFILE_CFLAGS="" else PROFILE_CFLAGS="-pg" fi AC_SUBST(PROFILE_CFLAGS) AC_ARG_ENABLE(debug, [ --enable-debug [Enable debug, implies --disable-optimization (default: no)]]) if test "$enable_debug" != "yes" -a "$enable_profile" != "yes"; then DEBUG_CFLAGS="-O2 -pipe -fsigned-char -fomit-frame-pointer -fconserve-space -fexpensive-optimizations -ffast-math" else DEBUG_CFLAGS="-g -O1 -fsigned-char -Wall -Werror -DDEBUG" fi AC_SUBST(DEBUG_CFLAGS) dnl AC_ARG_ENABLE(optimization, dnl [ --enable-optimization [Enable detection of optimization flags (default: no)]]) dnl FIXME: todo AC_ARG_WITH(client, [ --with-client=sdl,x11,svgalib [Select which client (default: sdl)]]) THREAD_LIBS= if test "$with_client" = "x11"; then AC_CHECK_HEADERS(X11/Xlib.h,, AC_MSG_ERROR(could not find X11/Xlib.h)) VIDEO_CFLAGS="-DUSE_X11" VIDEO_LIBS="-lXext -lX11 -L/usr/X11R6/lib -I/usr/X11R6/include" if test "$PLATFORM" = "-DBSD"; then THREAD_LIBS="-pthread" else THREAD_LIBS="-lpthread" fi elif test "$with_client" = "svgalib"; then VIDEO_CFLAGS="-DUSE_SVGALIB" VIDEO_LIBS="-lvga" else AC_CHECK_HEADERS(SDL/SDL.h,, AC_MSG_ERROR(could not find SDL/SDL.h)) VIDEO_CFLAGS="-DUSE_SDL -DUSE_SDLA `sdl-config --cflags`" if test "$enable_static" != "yes"; then VIDEO_LIBS="`sdl-config --libs`" else VIDEO_LIBS="`sdl-config --static-libs`" fi if test "$WIN32" = "1"; then if test "`uname -a | grep -is cygwin`"; then VIDEO_LIBS="$VIDEO_LIBS -lwsock32 -lws2_32" else VIDEO_LIBS="$VIDEO_LIBS -lwsock32 -lws2_32 -lmingwex -lgmon" fi fi fi AC_SUBST(VIDEO_CFLAGS) AC_SUBST(VIDEO_LIBS) AC_SUBST(THREAD_LIBS) dnl --- CHECK FOR BZIP2 -------- AC_ARG_WITH(bzip2, [ --with-bzip2 [Use bzip2 (default: yes)]],, with_bzip2="yes") if test "$with_bzip2" != "no"; then AC_CHECK_LIB(bz2, main, [BZ2_CFLAGS="-DUSE_BZ2LIB" BZ2_LIBS="-lbz2"], [BZ2_CFLAGS="" BZ2_LIBS=""]) else BZ2_CFLAGS="" BZ2_LIBS="" fi AC_SUBST(BZ2_CFLAGS) AC_SUBST(BZ2_LIBS) dnl ---------------------------- dnl --- CHECK FOR ZZIPLIB ------ AC_ARG_WITH(zziplib, [ --with-zziplib [Use zziplib (default: autodetect)]],, with_zziplib="yes") if test "$ZZIPLIB" != "no"; then AC_CHECK_LIB(zziplib, main, [ZZIPLIB_CFLAGS="-DUSE_ZZIPLIB" ZZIPLIB_LIBS="-lzzip"], [ZZIPLIB_CFLAGS="" ZZIPLIB_LIBS=""]) else ZZIPLIB_CFLAGS="" ZZIPLIB_LIBS="" fi AC_SUBST(ZZIPLIB_CFLAGS) AC_SUBST(ZZIPLIB_LIBS) dnl ---------------------------- dnl --- CHECK FOR OGG VORBIS --- AC_ARG_WITH(ogg, [ --with-ogg [Use ogg (default: autodetect)]], OGG="$with_ogg") OGG_CFLAGS= OGG_LIBS= if test "$OGG" != "no"; then OGG="yes" AC_CHECK_HEADERS(ogg/ogg.h,, OGG=no) AC_CHECK_HEADERS(vorbis/vorbisfile.h,, OGG=no) if test "$OGG" != "no"; then OGG_CFLAGS="-DUSE_OGG" OGG_LIBS="-lvorbisfile -lvorbis -logg" fi fi AC_SUBST(OGG_CFLAGS) AC_SUBST(OGG_LIBS) dnl ---------------------------- dnl --- CHECK FOR MAD LIB ------ AC_ARG_WITH(mad, [ --with-mad [Use mad mp3 (default: autodetect)]], MAD="$with_mad") MAD_CFLAGS= MAD_LIBS= if test "$MAD" != "no"; then AC_CHECK_HEADERS(mad.h, MAD=yes, MAD=no) if test "$MAD" != "no"; then MAD_CFLAGS="-DUSE_MAD" MAD_LIBS="-lmad" fi fi AC_SUBST(MAD_CFLAGS) AC_SUBST(MAD_LIBS) dnl ---------------------------- dnl --- CHECK FOR FLAC LIB ----- AC_ARG_WITH(flac, [ --with-flac [Use FLAC (default: autodetect)]], FLAC="$with_flac") FLAC_CFLAGS= FLAC_LIBS= if test "$FLAC" != "no"; then AC_CHECK_HEADERS(FLAC/all.h, FLAC=yes, FLAC=no) if test "$FLAC" != "no"; then FLAC_CFLAGS="-DUSE_FLAC" FLAC_LIBS="-lFLAC" fi fi AC_SUBST(FLAC_CFLAGS) AC_SUBST(FLAC_LIBS) dnl ---------------------------- dnl --- CHECK FOR CDAUDIO ------ AC_ARG_WITH(cdaudio, [ --with-cdaudio=libcda,sdlcd,cdda,no [Enable CD Audio support (default: platform-dependant)]], CDAUDIO="$with_cdaudio") if test "$CDAUDIO" = "sdl"; then CDAUDIO_CFLAGS="`sdl-config --cflags`" if test "$enable_static" != "yes"; then CDAUDIO_LIBS="`sdl-config --libs`" else CDAUDIO_LIBS="`sdl-config --static-libs`" fi elif test "$CDAUDIO" = "no" -o "$PLATFORM" = "-DBSD"; then CDAUDIO_CFLAGS="" CDAUDIO_LIBS="" elif test "$CDAUDIO" = "cdda"; then CDAUDIO_CFLAGS="-DUSE_CDDA" CDAUDIO_LIBS="" else CDAUDIO_CFLAGS="-DUSE_LIBCDA" CDAUDIO_LIBS="" fi AC_SUBST(CDAUDIO_CFLAGS) AC_SUBST(CDAUDIO_LIBS) dnl ---------------------------- if test "$prefix" = "NONE"; then PREFIX=/usr/local else PREFIX="$prefix" fi AC_SUBST(PREFIX) if test "$WIN32" = "1"; then touch Rules.make AC_CONFIG_FILES(Rules.make.WIN32:Rules.make.in) else AC_CONFIG_FILES(Rules.make) fi AC_OUTPUT # EOF #