AC_INIT(game/main.cpp) dnl Setup for automake AM_INIT_AUTOMAKE("Shaaft",0.5.0) AM_CONFIG_HEADER(defines.h) AC_EXEEXT dnl Checks for programs. AC_PROG_CC AC_PROG_CXX AC_PROG_RANLIB dnl Checks for libraries. dnl Checks for header files. dnl Checks for typedefs, structures, and compiler characteristics. AC_C_CONST dnl Checks for library functions. CFLAGS="" CXXFLAGS="" if test "x$GCC" = xyes; then CFLAGS="$CFLAGS -W -Wall" CXXFLAGS="$CXXFLAGS -W -Wall -fno-exceptions" fi AC_ARG_ENABLE(debug, [ --enable-debug Enable debugging [default=off]], enable_debug=$enableval, enable_debug=off) if test "x$enable_debug" = xyes; then CFLAGS="$CFLAGS -g" CXXFLAGS="$CXXFLAGS -g" fi AC_ARG_ENABLE(optimize, [ --enable-optimize=[level] Enable optimization [default=2]], enable_optmize=$enableval, enable_optimize=2) if test "x$enable_optimize" != "xno" ; then CFLAGS="$CFLAGS -O$enable_optimize" CXXFLAGS="$CXXFLAGS -O$enable_optimize" fi AC_ARG_ENABLE(trace, [ --enable-trace Enable tracing [default=off]], enable_trace=$enableval, enable_trace=off) if test "x$enable_trace" = xyes; then CFLAGS="$CFLAGS -DTRACE" CXXFLAGS="$CXXFLAGS -DTRACE" fi AC_ARG_ENABLE(dyngl, [ --enable-dyngl Load GL library dynamically [default=off]], enable_dyngl=$enableval, enable_dyngl=off) if test "x$enable_dyngl" = xyes; then CFLAGS="$CFLAGS -DDYNAMIC_GL" CXXFLAGS="$CXXFLAGS -DDYNAMIC_GL" fi AC_CHECK_LIB(SDL, main, LIBS="$LIBS `sdl-config --libs`" ; \ CFLAGS="$CFLAGS `sdl-config --cflags`" ; \ CXXFLAGS="$CXXFLAGS `sdl-config --cflags`" ; \ HAVE_SDL=1, AC_MSG_ERROR(SDL is needed), `sdl-config --libs`) AC_CHECK_LIB(SDL_image, main, LIBS="$LIBS -lSDL_image", AC_MSG_ERROR(SDL_image is needed)) AC_CHECK_LIB(SDL_mixer, main, LIBS="$LIBS -lSDL_mixer", AC_MSG_ERROR(SDL_mixer is needed)) AC_MINGW32 if test "x$MINGW32" = xyes; then AM_CONDITIONAL(WIN32,test x = x) AC_MSG_RESULT(Adding special ingredients for mingw32) LIBS="$LIBS -lopengl32 -lpng -lz -ljpeg -lstdc++" dnl CFLAGS="$CFLAGS `sdl-config --cflags`" ; \ dnl CXXFLAGS="$CXXFLAGS `sdl-config --cflags`" ; \ else AM_CONDITIONAL(WIN32,test x = y) LIBS="-L/usr/local/lib -L/usr/X11R6/lib $LIBS" CFLAGS="$CFLAGS -I/usr/X11R6/include" ; \ CXXFLAGS="$CXXFLAGS -I/usr/X11R6/include" AC_CHECK_LIB(png12, main,, AC_MSG_ERROR(libpng12 is needed)) AC_CHECK_LIB(z, main,, AC_MSG_ERROR(libz is needed)) if test "x$enable_dyngl" = xoff; then AC_CHECK_LIB(GL, glBegin,, AC_MSG_ERROR(OpenGL is needed)) fi fi AC_CHECK_LIB(m, sin,, AC_MSG_ERROR(libm is needed)) AC_OUTPUT(Makefile utils/Makefile utilssdl/Makefile utilsgl/Makefile game/Makefile tools/Makefile)