# Process this file with autoconf to produce a configure script. AC_INIT(src/enigma.cc) AC_CANONICAL_TARGET AM_INIT_AUTOMAKE(enigma, 0.78-cvs) AM_CONFIG_HEADER(src/config.h) dnl AC_CANONICAL_HOST dnl ====================================================================== dnl Check for programs dnl ====================================================================== AC_PROG_CC AC_PROG_CXX AC_PROG_CPP AC_PROG_RANLIB AC_MINGW32 AM_CONDITIONAL(MINGW32, test x$MINGW32 = xyes) AC_SUBST(WINDRES) dnl ====================================================================== dnl Check for libraries dnl ====================================================================== AM_PATH_SDL(1.2.0) AC_SUBST(SDL_LIBS) AC_SUBST(SDL_CFLAGS) dnl LIBS="$LIBS $SDL_LIBS" dnl CXXFLAGS="$CXXFLAGS $SDL_CFLAGS" dnl Below we check for some additional header files from the "SDL family". dnl Since AC_CHECK_HEADER uses the preprocessor to check for header dnl files, add the necessary preprocessor flags. dnl CPPFLAGS="$CPPFLAGS $SDL_CFLAGS" dnl ---------------------------------------- dnl Check for SDL image library dnl Check for SDL mixer library dnl ---------------------------------------- AC_CHECK_LIB(SDL_image,main,,[AC_MSG_ERROR([SDL_image is required to compile Enigma])]) AC_CHECK_LIB(SDL_mixer,main,,[AC_MSG_ERROR([SDL_mixer is required to compile Enigma])]) SDL_LIBS="$SDL_LIBS -lSDL_image -lSDL_mixer" AC_CHECK_LIB(SDL_mixer, Mix_QuickLoad_RAW, have_mix_quickload="yes", have_mix_quickload="no") if test "$have_mix_quickload" = no; then AC_DEFINE(HAVE_MIX_QUICKLOAD, 1, [Define if version of SDL_Mixer >= 1.5]) fi dnl ---------------------------------------- dnl Check for SDL_ttf library dnl --------------------------------------- AC_CHECK_LIB(SDL_ttf,main,have_sdlttf="yes", have_sdlttf="no") AM_CONDITIONAL(BUILDTTF2BMF, [test "$have_sdlttf" = yes]) dnl ---------------------------------------- dnl Check for Lua dnl ---------------------------------------- dnl AC_CHECK_LIB(lua, lua_newuserdatabox, have_newlua=yes, have_newlua=no) dnl if test "$have_newlua" = no; then dnl AC_MSG_CHECKING(for Lua 4.0) dnl AC_CHECK_LIB(lua, lua_open, have_lua="yes", have_lua="no") dnl if test "$have_lua" = no; then dnl AC_MSG_ERROR([You must have Lua installed to compile Enigma.]) dnl fi dnl else dnl AC_DEFINE(HAVE_NEWLUA, 1, [Define if Lua version is > 4.0]) dnl fi dnl ---------------------------------------- dnl Check for ToLua dnl ---------------------------------------- dnl AC_ARG_VAR(TOLUA, "Path to 'tolua' program") dnl AC_PATH_PROG(TOLUA, tolua, tolua, $PATH:./) dnl ---------------------------------------- dnl Check for libtolua dnl ---------------------------------------- dnl AC_MSG_CHECKING([for local libtolua dnl LIBTOLUAFLAGS='-I$(top_srcdir)/lib-src/libtolua' dnl AC_SUBST(LIBTOLUAFLAGS) dnl dnl Activatate optimizations when profiling, to get rid of dnl inlineable functions. dnl AC_MSG_CHECKING(whether to include profiling information) AC_ARG_ENABLE(profile, [ --enable-profile compile with profiling information], , enable_profile=no ) if test "x$enable_profile" = xyes; then CXXFLAGS="$CXXFLAGS -pg -O2" AC_MSG_RESULT(yes) else AC_MSG_RESULT(no) fi dnl ---------------------------------------- dnl Check for optimizations dnl ---------------------------------------- AC_MSG_CHECKING(whether to optimize the game) AC_ARG_ENABLE(optimize, [ --enable-optimize compile with optimizations], , enable_optimize=no ) if test "x$enable_optimize" = xyes; then CXXFLAGS="$CXXFLAGS -O2" AC_MSG_RESULT(yes) else CXXFLAGS="$CXXFLAGS -g" AC_MSG_RESULT(no) fi dnl ---------------------------------------- dnl Check for gdb debugging dnl ---------------------------------------- AC_MSG_CHECKING(whether to debug the game with gdb) AC_ARG_ENABLE(debug-gdb, [ --enable-debug-gdb compile with special debugging options for gdb ], , enable_debug_gdb=no ) if test "x$enable_debug_gdb" = xyes; then CXXFLAGS="$CXXFLAGS -ggdb3 -fno-inline -fno-default-inline -fno-omit-frame-pointer -fno-optimize-sibling-calls" AC_MSG_RESULT(yes) else CXXFLAGS="$CXXFLAGS" AC_MSG_RESULT(no) fi dnl ---------------------------------------------------------- dnl Check whether compiler warnings should be emitted dnl ---------------------------------------------------------- AC_MSG_CHECKING(whether to enable warnings) AC_ARG_ENABLE(warnings, [ --enable-warnings enable most compiler warnings ], , enable_warnings=no ) if test "x$enable_warnings" = xyes; then CXXFLAGS="$CXXFLAGS -O2 -Wall -W" CXXFLAGS="$CXXFLAGS -Wundef -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align" CXXFLAGS="$CXXFLAGS -Wwrite-strings -Wconversion -Wsign-compare" CXXFLAGS="$CXXFLAGS -Winline -Wdisabled-optimization -Wno-system-headers" AC_MSG_RESULT(yes) else CXXFLAGS="$CXXFLAGS" AC_MSG_RESULT(no) fi dnl Setup default search path for game data FC_EXPAND_DIR(ENIGMA_DATADIR, "$datadir/enigma") AC_DEFINE_UNQUOTED(DEFAULT_DATA_PATH, "./data:~/.enigma:$ENIGMA_DATADIR", [Default data dir]) AC_CONFIG_SUBDIRS(lib-src/zipios++) AC_OUTPUT([Makefile data/Makefile data/gfx/Makefile data/levels/Makefile data/levels/Sokoban/Makefile data/fonts/Makefile data/sound/Makefile doc/Makefile etc/Makefile lib-src/Makefile lib-src/oxydlib/Makefile lib-src/lua/Makefile src/Makefile src/px/Makefile ]) echo echo "Enigma is now configured:" echo echo " C++ compiler: $CXX" echo " C++ options: $CXXFLAGS" echo " Libraries: $LIBS" echo " Linker options: $LDFLAGS" echo echo "If these values seem to make sense, you can now run make." echo