Gobligine/configure.in

290 lines
7.4 KiB
Text
Raw Normal View History

2003-05-14 09:35:26 -06:00
AC_INIT(configure.in)
AC_PREREQ([2.50])
2004-04-16 14:27:03 -06:00
CPPFLAGS="$CPPFLAGS -I/usr/local/include -L/usr/local/lib -I/sw/include -L/sw/lib"
2003-05-14 11:02:46 -06:00
2003-05-14 14:59:11 -06:00
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))
2003-05-14 10:39:15 -06:00
EXE=
2003-07-03 09:35:45 -06:00
OUTFILE="\$(TOPDIR)/stratagus\$(EXE)"
2003-05-14 10:39:15 -06:00
OE=o
OBJDIR=obj
2003-05-14 10:18:06 -06:00
if test "`uname -a | grep -is cygwin`" -o "`uname -a | grep -is mingw`"; then
WIN32=1
2003-05-14 09:46:53 -06:00
EXE=.exe
2003-07-03 09:35:45 -06:00
OUTFILE="\$(TOPDIR)/stratagus\$(EXE)"
2003-05-14 09:46:53 -06:00
ARCH=win32
OBJDIR=winobj
2003-05-14 10:39:15 -06:00
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"
2004-04-13 16:40:20 -06:00
elif test "`uname -a | grep -is darwin`"; then
ARCH=macosx
2003-05-14 09:46:53 -06:00
else
ARCH=linux
fi
2003-05-14 14:59:11 -06:00
2004-04-13 18:46:57 -06:00
if test "$ARCH" = "macosx" ; then
2004-04-13 16:40:20 -06:00
EXTRA_CFLAGS=-I/sw/include
EXTRA_LIBS=-L/sw/lib
CPPFLAGS+=-I/sw/include
fi
AC_SUBST(EXTRA_CFLAGS)
AC_SUBST(EXTRA_LIBS)
2003-05-25 22:29:03 -06:00
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 ----------------------------
2003-05-14 14:59:11 -06:00
AC_ARG_ENABLE(win32,
2003-05-20 22:53:05 -06:00
[ --enable-win32 Force win32, useful for cross-compiling (default: no)])
2003-05-14 14:59:11 -06:00
if test "$enable_win32" = "yes"; then
WIN32=1
EXE=.exe
2003-07-03 09:35:45 -06:00
OUTFILE="\$(TOPDIR)/stratagus\$(EXE)"
2003-05-14 14:59:11 -06:00
ARCH=win32
OBJDIR=winobj
PLATFORM="-DUSE_WIN32"
PATH="/usr/local/cross/bin:$PATH"
fi
2003-05-14 09:46:53 -06:00
AC_SUBST(EXE)
AC_SUBST(OUTFILE)
AC_SUBST(ARCH)
AC_SUBST(OE)
AC_SUBST(OBJDIR)
2003-05-14 10:39:15 -06:00
AC_SUBST(PLATFORM)
2003-05-14 09:35:26 -06:00
AC_ARG_ENABLE(static,
[ --enable-static Compile a static binary (default: no)])
2003-05-14 10:20:17 -06:00
if test "$enable_static" != "yes"; then
STATIC_LDFLAGS=
2003-05-14 12:45:37 -06:00
else
STATIC_LDFLAGS="-static"
2003-05-14 10:20:17 -06:00
fi
AC_SUBST(STATIC_LDFLAGS)
2003-05-14 09:35:26 -06:00
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)]])
2003-05-14 13:11:51 -06:00
if test "$enable_debug" != "yes" -a "$enable_profile" != "yes"; then
DEBUG_CFLAGS="-O2 -pipe -fsigned-char -fomit-frame-pointer -fexpensive-optimizations -ffast-math"
2003-05-14 09:35:26 -06:00
else
DEBUG_CFLAGS="-g -O1 -fsigned-char -Wsign-compare"
if test "$enable_debug" == "yes"; then
DEBUG_CFLAGS="$DEBUG_CFLAGS -Werror -Wall -DDEBUG"
fi
2003-05-14 09:35:26 -06:00
fi
AC_SUBST(DEBUG_CFLAGS)
dnl AC_ARG_ENABLE(optimization,
dnl [ --enable-optimization [Enable detection of optimization flags (default: no)]])
dnl FIXME: todo
2004-01-15 10:44:04 -07:00
AC_CHECK_PROGS(SDLCONFIG, sdl-config)
2004-04-07 19:17:07 -06:00
if test "x$SDLCONFIG" = "x"; then
2004-03-06 01:36:58 -07:00
AC_CHECK_PROGS(SDLCONFIG, sdl11-config)
fi
2004-04-07 19:17:07 -06:00
if test "x$SDLCONFIG" = "x"; then
echo "*** sdl-config not found";
exit 1;
fi
2004-03-06 01:36:58 -07:00
VIDEO_CFLAGS="-DUSE_SDL -DUSE_SDLA `$SDLCONFIG --cflags`"
2003-10-16 10:03:01 -06:00
if test "$enable_static" != "yes"; then
2004-01-15 10:44:04 -07:00
VIDEO_LIBS="`$SDLCONFIG --libs`"
2003-05-14 09:35:26 -06:00
else
2004-01-15 10:44:04 -07:00
VIDEO_LIBS="`$SDLCONFIG --static-libs`"
2003-10-16 10:03:01 -06:00
fi
if test "$WIN32" = "1"; then
if test "`uname -a | grep -is cygwin`"; then
VIDEO_LIBS="$VIDEO_LIBS -lwsock32 -lws2_32"
2003-05-14 09:35:26 -06:00
else
2003-10-16 10:03:01 -06:00
VIDEO_LIBS="$VIDEO_LIBS -lwsock32 -lws2_32 -lmingwex -lgmon"
2003-05-14 11:32:42 -06:00
fi
2003-05-14 09:35:26 -06:00
fi
2004-04-07 19:17:07 -06:00
if test "$ARCH" = "bsd"; then
2004-03-06 01:36:58 -07:00
VIDEO_LIBS="$VIDEO_LIBS -lc"
fi
2003-05-14 09:35:26 -06:00
AC_SUBST(VIDEO_CFLAGS)
AC_SUBST(VIDEO_LIBS)
AC_SUBST(THREAD_LIBS)
2004-01-15 10:03:44 -07:00
dnl --- OPENGL support ---------
AC_ARG_WITH(opengl,
[ --with-opengl [Use opengl (default: no)]],, with_opengl="no")
if test "$with_opengl" != "no"; then
2004-01-15 10:44:04 -07:00
VIDEO_CFLAGS="$VIDEO_CFLAGS -DUSE_OPENGL"
2004-01-15 11:02:50 -07:00
if test "`uname -a | grep -is cygwin`" -o "`uname -a | grep -is mingw`"; then
VIDEO_LIBS="$VIDEO_LIBS -lopengl32"
else
AC_PATH_X
AC_PATH_XTRA
2004-04-07 19:17:07 -06:00
if test "x$have_x" = "xyes"; then
2004-01-15 11:02:50 -07:00
VIDEO_CFLAGS="$VIDEO_CFLAGS $X_CFLAGS"
VIDEO_LIBS="$VIDEO_LIBS $X_LIBS -lGL"
else
VIDEO_LIBS="$VIDEO_LIBS -lGL"
fi
fi
2004-01-15 10:03:44 -07:00
fi
AC_SUBST(VIDEO_CFLAGS)
AC_SUBST(VIDEO_LIBS)
dnl ----------------------------
2003-05-14 09:35:26 -06:00
dnl --- CHECK FOR BZIP2 --------
AC_ARG_WITH(bzip2,
2003-08-22 05:19:24 -06:00
[ --with-bzip2 [Use bzip2 (default: yes)]],, with_bzip2="yes")
2003-08-22 05:13:10 -06:00
if test "$with_bzip2" != "no"; then
AC_CHECK_LIB(bz2, main,
[BZ2_CFLAGS="-DUSE_BZ2LIB"
BZ2_LIBS="-lbz2"],
[BZ2_CFLAGS=""
BZ2_LIBS=""])
2003-05-14 09:35:26 -06:00
else
BZ2_CFLAGS=""
BZ2_LIBS=""
fi
AC_SUBST(BZ2_CFLAGS)
AC_SUBST(BZ2_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
2003-05-14 11:11:10 -06:00
OGG="yes"
2003-05-14 11:37:18 -06:00
AC_CHECK_HEADERS(ogg/ogg.h,, OGG=no)
AC_CHECK_HEADERS(vorbis/vorbisfile.h,, OGG=no)
2003-05-14 09:35:26 -06:00
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,
2003-12-23 10:26:16 -07:00
[ --with-mad [Use mad mp3 (default: no)]], MAD="$with_mad")
2003-05-14 09:35:26 -06:00
MAD_CFLAGS=
MAD_LIBS=
2003-12-23 10:26:16 -07:00
if test "$MAD" != "yes"; then
MAD_CFLAGS=""
MAD_LIBS=""
else
MAD_CFLAGS="-DUSE_MAD"
MAD_LIBS="-lmad"
2003-05-14 09:35:26 -06:00
fi
AC_SUBST(MAD_CFLAGS)
AC_SUBST(MAD_LIBS)
dnl ----------------------------
dnl --- CHECK FOR FLAC LIB -----
AC_ARG_WITH(flac,
2003-12-23 10:26:16 -07:00
[ --with-flac [Use FLAC (default: no)]], FLAC="$with_flac")
if test "$FLAC" != "yes"; then
FLAC_CFLAGS=
FLAC_LIBS=
else
FLAC_CFLAGS="-DUSE_FLAC"
FLAC_LIBS="-lFLAC"
2003-05-14 09:35:26 -06:00
fi
AC_SUBST(FLAC_CFLAGS)
AC_SUBST(FLAC_LIBS)
dnl ----------------------------
dnl --- CHECK FOR CDAUDIO ------
AC_ARG_WITH(cdaudio,
[ --with-cdaudio=libcda,sdlcd,cdda,no
2003-12-23 10:26:16 -07:00
[Enable CD Audio support (default: no)]], CDAUDIO="$with_cdaudio")
2003-05-14 09:35:26 -06:00
if test "$CDAUDIO" = "sdl"; then
2004-03-06 01:36:58 -07:00
CDAUDIO_CFLAGS="`$SDLCONFIG --cflags`"
2003-11-10 19:04:59 -07:00
CDAUDIO_LIBS=""
2003-05-14 09:35:26 -06:00
elif test "$CDAUDIO" = "cdda"; then
CDAUDIO_CFLAGS="-DUSE_CDDA"
CDAUDIO_LIBS=""
2003-12-23 10:26:16 -07:00
elif test "$CDAUDIO" = "libcda"; then
2003-05-14 09:35:26 -06:00
CDAUDIO_CFLAGS="-DUSE_LIBCDA"
CDAUDIO_LIBS=""
2003-12-23 10:26:16 -07:00
else
CDAUDIO_CFLAGS=""
CDAUDIO_LIBS=""
2003-05-14 09:35:26 -06:00
fi
AC_SUBST(CDAUDIO_CFLAGS)
AC_SUBST(CDAUDIO_LIBS)
dnl ----------------------------
2004-02-16 18:17:04 -07:00
dnl ---- CHECK FOR LUA ---------
AC_ARG_WITH(lua,
2004-04-09 11:50:55 -06:00
[ --with-lua=prefix [Prefix where Lua is installed]], LUAPFX="$with_lua")
2004-04-07 19:17:07 -06:00
if test "x$LUAPFX" != "x"; then
LUA_CFLAGS="-I$LUAPFX/include"
LUA_LIBS="-L$LUAPFX/lib"
fi
2004-02-16 18:53:55 -07:00
AC_CHECK_PROGS(LUACONFIG, [lua-config lua-config50 luaconfig5.0], "")
2004-04-07 19:17:07 -06:00
if test "x$LUACONFIG" != "x"; then
LUA_CFLAGS="$LUA_CFLAGS `[$LUACONFIG --include]`"
LUA_LIBS="$LUA_LIBS `[$LUACONFIG --libs]`"
else
LUA_CFLAGS="$CFLAGS"
LUA_LIBS="$LIBS"
2004-04-07 19:17:07 -06:00
if test "$ARCH" = "linux"; then
LUA_LIBS="$LUA_LIBS -ldl"
fi
AC_CHECK_LIB(lua, lua_getfenv, LUA_LIBS="$LUA_LIBS -llua",
AC_CHECK_LIB(lua50, lua_setfenv, LUA_LIBS="$LUA_LIBS -llua50",
AC_CHECK_LIB(lua5.0, lua_setfenv, LUA_LIBS="$LUA_LIBS -llua5.0",
[AC_MSG_ERROR(Lua5 is required)], -lm), -lm), -lm)
AC_CHECK_LIB(lualib, luaopen_base, LUA_LIBS="$LUA_LIBS -llualib",
AC_CHECK_LIB(lualib50, luaopen_base, LUA_LIBS="$LUA_LIBS -llualib50",
AC_CHECK_LIB(lualib5.0, luaopen_base, LUA_LIBS="$LUA_LIBS -llualib5.0",
[AC_MSG_ERROR(Lualib5 is required)], $LUA_LIBS -lm), $LUA_LIBS -lm),$LUA_LIBS -lm)
2004-02-21 15:19:49 -07:00
fi
2004-02-16 18:53:55 -07:00
2004-01-15 10:26:39 -07:00
LUA_LIBS="$LUA_LIBS -lm"
AC_SUBST(LUA_CFLAGS)
AC_SUBST(LUA_LIBS)
dnl ---- end of lua check ------
2004-04-18 12:35:03 -06:00
if test "$prefix" = "NONE"; then
2003-05-14 09:35:26 -06:00
PREFIX=/usr/local
else
PREFIX="$prefix"
fi
AC_SUBST(PREFIX)
2003-05-14 10:18:06 -06:00
if test "$WIN32" = "1"; then
2003-05-14 11:35:36 -06:00
touch Rules.make
2003-05-14 10:18:06 -06:00
AC_CONFIG_FILES(Rules.make.WIN32:Rules.make.in)
else
AC_CONFIG_FILES(Rules.make)
fi
AC_OUTPUT
2003-08-02 06:38:45 -06:00
# EOF #