dnl Process this file with autoconf to produce a configure script. AC_INIT(Makefile.am) AM_CONFIG_HEADER(config.h) AM_INIT_AUTOMAKE(lgeneral,1.1.1) dnl Checks for programs. AC_PROG_CC AC_PROG_RANLIB dnl various CFLAGS CFLAGS="-g" CFLAGS="$CFLAGS -Wall" dnl Checks for libraries. AC_CHECK_LIB(m, main,, AC_MSG_ERROR(maths library is needed)) AC_CHECK_LIB(dl, main,, AC_MSG_ERROR(dl library is needed)) dnl check SDL version AM_PATH_SDL(1.1.4,, AC_MSG_ERROR(lib SDL >=1.1.4 is needed)) CFLAGS="$CFLAGS $SDL_CFLAGS" LIBS="$LIBS $SDL_LIBS" dnl check sound sound_flag="-DWITH_SOUND" mixer_flag="-lSDL_mixer" AC_ARG_ENABLE( sound, [ --disable-sound Disables sound], sound_flag=""; mixer_flag="") dnl check if SDL_mixer's installed dnl if not: clear sound_flag and mixer_flag AC_CHECK_LIB(SDL_mixer, main, AC_MSG_RESULT("SDL_Mixer found"), AC_MSG_RESULT("SDL_Mixer NOT found \(get it at http://libsdl.org\): Audio disabled"); sound_flag=""; mixer_flag="") AC_SUBST(sound_flag) AC_SUBST(mixer_flag) dnl check use of dynamic libraries dl_flag="-DUSE_DL" export_flag="-Wl,-export-dynamic" AC_ARG_ENABLE( dl, [ --disable-dl Disable use of dynamic AI modules], dl_flag=""; export_flag="") AC_SUBST(dl_flag) AC_SUBST(export_flag) dnl installation path inst_dir=$datadir/games/lgeneral inst_flag="-DSRC_DIR=\\\"$inst_dir\\\"" dis_flag="" AC_ARG_ENABLE( install, [ --disable-install No installation. Played from the source directory.], inst_dir=. inst_flag="-DSRC_DIR=\\\".\\\"" dis_flag="-DDISABLE_INSTALL") AC_SUBST(inst_flag) AC_SUBST(inst_dir) AC_SUBST(dis_flag) AC_OUTPUT(Makefile src/Makefile src/nations/Makefile src/scenarios/Makefile src/units/Makefile src/sounds/Makefile src/music/Makefile src/maps/Makefile src/gfx/Makefile src/gfx/flags/Makefile src/gfx/terrain/Makefile src/gfx/units/Makefile src/ai_modules/Makefile src/campaigns/Makefile src/gfx/Makefile src/themes/Makefile src/themes/default/Makefile)