aboutsummaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authortaw27 <taw27@84d2e878-0bd5-11dd-ad15-13eda11d74c5>2008-04-16 16:57:56 +0000
committertaw27 <taw27@84d2e878-0bd5-11dd-ad15-13eda11d74c5>2008-04-16 16:57:56 +0000
commitf0a0118393a3d121bcb83047b5b9ac95eb0621ba (patch)
treecfc4f3f7955b4829317fa9b7865e328ccabfb129 /configure.ac
Initial import
git-svn-id: svn://cook.msm.cam.ac.uk:745/thrust3d/thrust3d@1 84d2e878-0bd5-11dd-ad15-13eda11d74c5
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac62
1 files changed, 62 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
new file mode 100644
index 0000000..6e69b59
--- /dev/null
+++ b/configure.ac
@@ -0,0 +1,62 @@
+dnl Process this file with autoconf to produce a configure script.
+
+AC_INIT(thrust3d, 0.0.1, 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_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
+
+CFLAGS="$CFLAGS $LIBSDL_CFLAGS $OPENGL_CFLAGS $LIBPNG_CFLAGS"
+LIBS="$LIBS $LIBSDL_LIBS $OPENGL_LIBS $GLU_LIBS $LIBPNG_LIBS"
+
+AC_OUTPUT(Makefile src/Makefile data/Makefile)
+