Annotation of froggix/configure.ac, revision 1.3

1.1       nick        1: # Process this file with autoconf to produce a configure script.
1.3     ! nick        2: # $Id: configure.ac,v 1.2 2009-03-28 03:59:07 nick Exp $
1.2       nick        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: 
1.3     ! nick       58: # Check for SDL_image library
        !            59: AC_CHECK_LIB(SDL_image, IMG_LoadPNG_RW, , AC_MSG_ERROR([
        !            60: *** Unable to find SDL_image libary with PNG support
        !            61: (http://www.libsdl.org/projects/SDL_image/)
        !            62: ]))
        !            63: 
        !            64: # Check for SDL_image library
        !            65: AC_CHECK_LIB(SDL_ttf, TTF_OpenFont, , AC_MSG_ERROR([
        !            66: *** Unable to find SDL_ttf libary 
        !            67: (http://www.libsdl.org/projects/SDL_image/)
        !            68: ]))
        !            69: 
        !            70: 
        !            71: ### No need for OpenGL right now
1.2       nick       72: # Check for OpenGL
1.3     ! nick       73: #AC_MSG_CHECKING(for OpenGL support)
        !            74: #HAVE_OPENGL=no
        !            75: #AC_TRY_COMPILE([
1.2       nick       76:  #include <GL/gl.h>
1.3     ! nick       77: #],[
        !            78: #],[
        !            79: #HAVE_OPENGL=yes
        !            80: #])
        !            81: #AC_MSG_RESULT($HAVE_OPENGL)
        !            82: #if test x$HAVE_OPENGL = xyes; then
        !            83: #    CFLAGS="$CFLAGS -DHAVE_OPENGL"
        !            84: #    GL_LIBS="$SYS_GL_LIBS"
        !            85: #else
        !            86: #    GL_LIBS=""
        !            87: #fi
        !            88: #AC_SUBST(GL_LIBS)
        !            89: ### End of OpenGL
1.1       nick       90: 
1.2       nick       91: # Check for standard C++ library
                     92: AC_CHECK_LIB(stdc++, main)
1.1       nick       93: 
1.2       nick       94: # Finally create all the generated files
                     95: AC_OUTPUT(Makefile src/Makefile)

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>