dnl Process this file with autoconf to produce a configure script. AC_INIT(Makefile.am) AM_CONFIG_HEADER(config.h) AM_INIT_AUTOMAKE(lbreakout,010315) dnl Checks for programs. AC_PROG_CC AC_PROG_CXX AC_PROG_RANLIB dnl Checks for libraries. AC_CHECK_LIB(m, main,, AC_MSG_ERROR(lib math is needed)) dnl check SDL version sdl_flag="" AM_PATH_SDL(1.0.0,, AC_MSG_ERROR(lib SDL is needed)) CFLAGS="$CFLAGS $SDL_CFLAGS" CXXFLAGS="$CXXFLAGS $SDL_CFLAGS" LIBS="$LIBS $SDL_LIBS" AM_PATH_SDL(1.1.5, sdl_flag="-DSDL_1_1_5",) dnl AM_PATH_SDL(1.1.7, sdl_flag="",) CFLAGS="$CFLAGS $sdl_flag" dnl check for pthread ac_save_LIBS="$LIBS" thread_flag="" dnl first look for -pthread LIBS="$LIBS -pthread" AC_TRY_LINK( [#include ], [ pthread_create((pthread_t*) 0,(pthread_attr_t*) 0, 0, 0); ], AC_MSG_RESULT("-pthread used...") thread_flag="-pthread", dnl now look for -lpthread AC_MSG_RESULT("checking for -lpthread...") LIBS="$ac_save_LIBS" AC_CHECK_LIB( pthread, pthread_create, thread_flag="-lpthread" AC_MSG_RESULT(yes), AC_MSG_ERROR([lib pthread is needed]) ) ) LIBS="$ac_save_LIBS" AC_SUBST(thread_flag) dnl check sound sound_flag="-DSOUND" AC_ARG_ENABLE( sound, [ --disable-sound Disables sound], sound_flag="") AC_SUBST(sound_flag) dnl installation path sdir=$datadir/games/lbreakout hdir=/var/lib/games inst_flag="-DSRC_DIR=\\\"$sdir/\\\"" hi_inst_flag="-DHI_DIR=\\\"$hdir/\\\"" AC_ARG_ENABLE( install, [ --disable-install No installation. Played from the source directory.], sdir=./ hdir=./ inst_flag="-DSRC_DIR=\\\"./\\\"" hi_inst_flag="-DHI_DIR=\\\"./\\\"") AC_SUBST(inst_flag) AC_SUBST(hi_inst_flag) AC_SUBST(sdir) AC_SUBST(hdir) AC_OUTPUT(Makefile lbreakout/Makefile)