AC_INIT(src/flyhard.cpp) AM_INIT_AUTOMAKE(flyhard,0.3) AM_CONFIG_HEADER(config.h) AC_PROG_CXX AC_LANG_CPLUSPLUS AC_ARG_ENABLE(local-data-files, [--enable-local-data-files Look for data files in the current directory], AC_DEFINE([LOCAL_DATA_FILES], [1], [Define to 1 to make flyhard look for data files in the current directory])) #libpng AC_CHECK_LIB(png, png_create_read_struct, ,[AC_MSG_ERROR([libpng not found, it is needed. Get it from http://www.libpng.org])]) AC_CHECK_HEADER(png.h, ,[AC_MSG_ERROR([png.h not found, although libpng was found. Need to install libpng-devel?])]) #SDL #evaulate sdl-config --libs in this file, because automake will spazz horribly if we try to use it as a LDFLAG #(but first, make sure we give a comprehensible error if it is not there) AC_CHECK_PROG(SDL_CONFIG, sdl-config, yes, no) if test "$SDL_CONFIG" = "no"; then AC_MSG_ERROR([sdl-config not found; it is either not in your path or not anywhere. This probably means you don't have libSDL (or you have binary SDL libs but don't have SDL development libs). Get whatever is missing from http://www.libsdl.org]) fi FH_SDL_LIBS=`sdl-config --libs` AC_SUBST([FH_SDL_LIBS]) #Alas, we can't do this, because we don't want the side-effect of adding -lSDL to LDFLAGS, #because we're using sdl-config --libs for that #AC_CHECK_LIB(SDL, SDL_Init, ,[AC_MSG_ERROR([libSDL not found, it is needed. Get it from http://www.libsdl.org])]) #SDL_mixer AC_CHECK_LIB(SDL_mixer, Mix_OpenAudio, ,[AC_MSG_ERROR([libSDL_mixer not found, it is needed. Get it from http://www.libsdl.org/projects/SDL_mixer])]) #find SDL headers, which may or may not be in include/SDL directory. Geez... AC_CHECK_HEADERS(SDL/SDL.h SDL.h SDL/SDL_mixer.h SDL_mixer.h [], []) AC_CHECK_HEADER(SDL.h, [], [AC_CHECK_HEADER(SDL/SDL.h, [], [AC_MSG_ERROR([SDL.h not found, although libSDL was found. Need to install SDL development libs?])])]) AC_CHECK_HEADER(SDL_mixer.h, [], [AC_CHECK_HEADER(SDL/SDL_mixer.h, [], [AC_MSG_ERROR([SDL_mixer.h not found, although libSDL_mixer was found. Need to install SDL_mixer development libs?])])]) AC_OUTPUT(Makefile src/Makefile src/images/Makefile src/sounds/Makefile)