dnl Process this file with autoconf to produce a configure script. AC_INIT(thrust3d, 0.0.4, taw27@cam.ac.uk) VERSION=AC_PACKAGE_VERSION AM_CONFIG_HEADER(config.h) AM_INIT_AUTOMAKE(thrust3d, "$VERSION") AC_PROG_CC AC_PROG_AWK AC_PROG_INSTALL AC_PROG_LN_S AC_HEADER_STDC AC_CHECK_HEADERS([fcntl.h stdlib.h string.h unistd.h]) AC_C_CONST AC_FUNC_MALLOC AC_TYPE_SIGNAL AC_CHECK_FUNCS([strdup]) if test -z "$PKG_CONFIG"; then AC_PATH_PROG(PKG_CONFIG, pkg-config, no) fi if test "$PKG_CONFIG" = "no" ; then echo "*** pkg-config not found. Do you have pkg-config installed?" fi AC_MSG_CHECKING([SDL]) if $PKG_CONFIG sdl ; then LIBSDL_CFLAGS=`$PKG_CONFIG --cflags sdl` LIBSDL_LIBS=`$PKG_CONFIG --libs sdl` AC_MSG_RESULT([yes]) else AC_MSG_RESULT([not found]) AC_MSG_ERROR([*** SDL not found. Do you have 'libsdl-dev' or similar installed?]) fi AC_CHECK_LIB(GL, main, [OPENGL_CFLAGS=-I/usr/include/GL OPENGL_LIBS=-lGL], AC_MSG_ERROR([*** OpenGL not found. Do you have 'libgl-dev' or similar installed?])) AC_CHECK_LIB(GLU, main, [GLU_LIBS=-lGLU], AC_MSG_ERROR([*** GLU not found. Do you have 'libglu-dev' or similar installed?])) AC_CHECK_LIB(GLEW, main, [GLEW_LIBS=-lGLEW], AC_MSG_ERROR([*** GLEW not found. Do you have 'libglew-dev' or similar installed?])) AC_MSG_CHECKING([libpng]) if $PKG_CONFIG --atleast-version 1.2.0 libpng ; then LIBPNG_VERSION=`$PKG_CONFIG --modversion libpng` AC_MSG_RESULT($LIBPNG_VERSION) LIBPNG_CFLAGS=`$PKG_CONFIG --cflags libpng` LIBPNG_LIBS=`$PKG_CONFIG --libs libpng` else AC_MSG_RESULT([Lower than 1.2.0 or not found]) AC_MSG_ERROR([*** libPNG not found. Do you have 'libpng-dev' or similar installed?]) fi AC_MSG_CHECKING([vorbisfile]) if $PKG_CONFIG --exists vorbisfile ; then VORBISFILE_CFLAGS=`$PKG_CONFIG --cflags vorbisfile` VORBISFILE_LIBS=`$PKG_CONFIG --libs vorbisfile` AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) AC_MSG_ERROR([*** vorbisfile not found. Do you have 'libvorbis-dev' or similar installed?]) fi CFLAGS="$CFLAGS $LIBSDL_CFLAGS $OPENGL_CFLAGS $LIBPNG_CFLAGS $VORBISFILE_CFLAGS -pthread" LIBS="$LIBS -lm $LIBSDL_LIBS $OPENGL_LIBS $GLU_LIBS $GLEW_LIBS $LIBPNG_LIBS $VORBISFILE_LIBS" AC_OUTPUT(Makefile src/Makefile data/Makefile)