Annotation of froggix/configure.ac, revision 1.2
1.1 nick 1: # Process this file with autoconf to produce a configure script.
1.2 ! nick 2: # $Id$
! 3: AC_INIT(README)
1.1 nick 4:
1.2 ! nick 5: # Setup for automake
! 6: PROJ_NAME=froggix
! 7: PROJ_VERSION=1.0.0
! 8: AM_INIT_AUTOMAKE($PROJ_NAME, $PROJ_VERSION)
! 9:
! 10: # Detect the canonical host and target build environment
! 11: AC_CANONICAL_HOST
! 12: AC_CANONICAL_TARGET
1.1 nick 13:
1.2 ! nick 14: # Check for tools
1.1 nick 15: AC_PROG_CC
1.2 ! nick 16: AC_PROG_CXX
1.1 nick 17:
1.2 ! nick 18: # Check for compiler environment
! 19: AC_C_CONST
1.1 nick 20:
1.2 ! nick 21: # Figure out which math and OpenGL libraries to use
! 22: case "$target" in
! 23: *-*-cygwin* | *-*-mingw32*)
! 24: MATHLIB=""
! 25: SYS_GL_LIBS="-lopengl32"
! 26: ;;
! 27: *-*-beos* | *-*-darwin*)
! 28: MATHLIB=""
! 29: SYS_GL_LIBS="-lGL"
! 30: ;;
! 31: *-*-aix*)
! 32: if test x$ac_cv_prog_gcc = xyes; then
! 33: CFLAGS="-mthreads"
! 34: fi
! 35: ;;
! 36: *)
! 37: MATHLIB="-lm"
! 38: AC_PATH_X
! 39: AC_PATH_XTRA
! 40: if test x$have_x = xyes; then
! 41: CFLAGS="$CFLAGS $X_CFLAGS"
! 42: SYS_GL_LIBS="$X_LIBS -lGL"
! 43: else
! 44: SYS_GL_LIBS="-lGL"
! 45: fi
! 46: ;;
! 47: esac
! 48: AC_SUBST(MATHLIB)
! 49:
! 50: # Check for SDL
! 51: SDL_VERSION=1.1.8
! 52: AM_PATH_SDL($SDL_VERSION, :,
! 53: AC_MSG_ERROR([*** SDL version $SDL_VERSION not found!]))
! 54: CFLAGS="$CFLAGS $SDL_CFLAGS"
! 55: CXXFLAGS="$CXXFLAGS $SDL_CFLAGS"
! 56: LIBS="$LIBS $SDL_LIBS"
! 57:
! 58: # Check for OpenGL
! 59: AC_MSG_CHECKING(for OpenGL support)
! 60: HAVE_OPENGL=no
! 61: AC_TRY_COMPILE([
! 62: #include <GL/gl.h>
! 63: ],[
! 64: ],[
! 65: HAVE_OPENGL=yes
! 66: ])
! 67: AC_MSG_RESULT($HAVE_OPENGL)
! 68: if test x$HAVE_OPENGL = xyes; then
! 69: CFLAGS="$CFLAGS -DHAVE_OPENGL"
! 70: GL_LIBS="$SYS_GL_LIBS"
! 71: else
! 72: GL_LIBS=""
! 73: fi
! 74: AC_SUBST(GL_LIBS)
1.1 nick 75:
1.2 ! nick 76: # Check for standard C++ library
! 77: AC_CHECK_LIB(stdc++, main)
1.1 nick 78:
1.2 ! nick 79: # Finally create all the generated files
! 80: AC_OUTPUT(Makefile src/Makefile)
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>