From 931cfd8280dcedc4e916153e4a6844c55f9a4722 Mon Sep 17 00:00:00 2001 From: Matt Turner Date: Wed, 10 Oct 2012 18:05:38 -0700 Subject: Initial import --- configure.ac | 100 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 100 insertions(+) create mode 100644 configure.ac (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac new file mode 100644 index 0000000..adc4ee2 --- /dev/null +++ b/configure.ac @@ -0,0 +1,100 @@ +# -*- Autoconf -*- +# Process this file with autoconf to produce a configure script. + +AC_PREREQ(2.61) +AC_INIT(ellipse, 2012Q4.1, idr@freedesktop.org, complex-plane-points) +AC_CONFIG_SRCDIR([Makefile.am]) +AM_CONFIG_HEADER([config.h]) + +AM_INIT_AUTOMAKE + +AM_MAINTAINER_MODE + +# Checks for programs. +AC_PROG_CXX +AC_PROG_CC +AC_PROG_MAKE_SET +AC_PROG_RANLIB + +# Checks for libraries. + +# Checks for header files. +AC_CHECK_HEADERS([fcntl.h unistd.h]) + +# Checks for typedefs, structures, and compiler characteristics. +AC_TYPE_SIZE_T +AC_TYPE_SSIZE_T +AC_TYPE_UINT8_T + +# Checks for library functions. +AC_HEADER_STDC + + +# SDL is required for this application. Find its header files and +# libraries. Make sure they exist. + +CPPFLAGS="$CPPFLAGS `sdl-config --cflags`" +LIBS="$LIBS `sdl-config --libs`" + +AC_CHECK_HEADER(SDL.h, [], [exit 1]) + + +# OpenGL is required for this application. Find its header files and +# libraries. Make sure they exist. + +AC_CHECK_HEADER(GL/gl.h, [], [exit 1]) +AC_CHECK_LIB([GL], [glVertexPointer], [], [exit 1]) + + +# GLEW is required for this application. Find its header files and +# libraries. Make sure they exist. + +AC_CHECK_HEADER(GL/glew.h, [], [exit 1]) +AC_CHECK_LIB([GLEW], [glewInit], [], [exit 1], [-lGL]) + + +AC_LANG_CPLUSPLUS + +PKG_CHECK_MODULES([GLU3], [glu3]) +AC_SUBST(GLU3_CFLAGS) +AC_SUBST(GLU3_LIBS) + +AC_ARG_ENABLE([debug], + [AS_HELP_STRING([--enable-debug], + [use debug compiler flags and macros @<:@default=disabled@:>@])], + [enable_debug="$enableval"], + [enable_debug=no] +) +if test "x$enable_debug" = xyes; then + DEFINES="$DEFINES -DDEBUG" + if test "x$GCC" = xyes; then + # Remove any -g flags from the command line + CFLAGS=[`echo $CFLAGS | sed 's/-g[^ \t]*[ \t]*//g'`] + CFLAGS="$CFLAGS -ggdb3 -fstack-protector -D_FORTIFY_SOURCE=2" + fi + if test "x$GXX" = xyes; then + # Remove any -g flags from the command line + CXXFLAGS=[`echo $CXXFLAGS | sed 's/-g[^ \t]*[ \t]*//g'`] + CXXFLAGS="$CXXFLAGS -ggdb3 -fstack-protector -D_FORTIFY_SOURCE=2" + fi +fi + + +if test "x$GCC" = xyes ; then + WARN="-Wall -Wextra -Wunsafe-loop-optimizations -Wstack-protector" +else + WARN="" +fi + +if test "x$GXX" = xyes ; then + WARN="-Wall -Wextra -Wunsafe-loop-optimizations -Wstack-protector" +else + WARN="" +fi + +CFLAGS="$CFLAGS $WARN" +CXXFLAGS="$CXXFLAGS $WARN" + +AC_OUTPUT([Makefile + src/Makefile]) + -- cgit v1.2.3