dnl $Id$ dnl Process this file with Autoconf to create configure dnl ----------------------------------------------- dnl Initialization macros. dnl ----------------------------------------------- AC_INIT(fov/fov.h) AM_CONFIG_HEADER(fov/config.h) AC_REVISION([$Revision$]) AC_CANONICAL_SYSTEM dnl ----------------------------------------------- dnl Package name and version number. dnl ----------------------------------------------- # This is just a nice name for the package as a whole. PACKAGE=libfov # This should be the xxx in -lxxx linker options. LIBFOV_LIBRARY_NAME=fov # Release versioning. This is a straight -version-info libtool library # (no -release). LIBFOV_RELEASE=1.0.2 # x.y.z where release procedure is: # - Increment z. # - If interfaces have changed destroying backwards compatibility, # increment y and set z to 0. # - If the library seems quite different now, increment x and set y # and z to 0. (subjective / marketing version number) # Shared library versioning (must conform to libtool's versioning scheme) LIBFOV_LTVERSION=1:1:0 # | | | # +------+ | +---+ # | | | # current:revision:age # | | | # | | +- increment if interfaces have been added # | | set to zero if interfaces have been removed or changed # | +- increment if source code has changed # | set to zero if current is incremented # +- increment if interfaces have been added, removed or changed AC_SUBST(LIBFOV_RELEASE) AC_SUBST(LIBFOV_LTVERSION) AC_SUBST(PACKAGE) AC_SUBST(LIBFOV_LIBRARY_NAME) AM_INIT_AUTOMAKE($PACKAGE, $LIBFOV_RELEASE) dnl ----------------------------------------------- dnl Checks for programs. dnl ----------------------------------------------- AC_PROG_CC AC_PROG_CXX AM_PROG_LIBTOOL AC_LANG_CPLUSPLUS CFLAGS="-Wall -ansi -O2" debug=no AC_ARG_ENABLE(debug, [ --enable-debug Enable debugging information [default=no]], debug=yes) if test x$debug = xyes; then AC_DEFINE(DEBUG, 1, [Define if we enabled debugging]) CFLAGS="-Wall -pedantic -ansi -g -O0" fi profiling=no AC_ARG_ENABLE(profiling, [ --enable-profiling Enable profiling information [default=no]], profiling=yes) if test x$profiling = xyes; then AC_CHECK_PROG(gprof, gprof, yes, no) AC_CHECK_PROG(prof, prof, prof) if test x$gprof = xyes; then CFLAGS="$CFLAGS -pg" elif test x$prof = xyes; then CFLAGS="$CFLAGS -p" else AC_MSG_WARN([Could not enable profiling, neither gprof or prof were found.]) fi fi AC_CHECK_PROG(doxygen, doxygen, yes, no) AM_CONDITIONAL(HAVE_DOXYGEN, test x$doxygen = xyes) AM_CONDITIONAL(HAVE_GPROF, test x$gprof = xyes) AM_CONDITIONAL(HAVE_PROF, test x$prof = xyes) dnl ----------------------------------------------- dnl Checks for libraries. dnl ----------------------------------------------- SDL_VERSION=1.0.8 AM_PATH_SDL($SDL_VERSION, \ [ AM_CONDITIONAL(HAVE_SDL, test "1" = "1") ], [ AM_CONDITIONAL(HAVE_SDL, test "1" = "0") ]) AC_CHECK_LIB(curses, initscr, \ [ AM_CONDITIONAL(HAVE_CURSES, test "1" = "1") ], [ AM_CONDITIONAL(HAVE_CURSES, test "1" = "0") ]) dnl ----------------------------------------------- dnl Checks for header files. dnl ----------------------------------------------- AC_HEADER_STDC AC_CHECK_HEADERS(string.h limits.h stdbool.h) dnl ----------------------------------------------- dnl Generates Makefiles. dnl ----------------------------------------------- AC_OUTPUT(Makefile \ libfov.pc \ fov/Makefile \ tests/Makefile \ examples/Makefile \ docs/Makefile \ ) AC_MSG_RESULT([Debugging : $debug]) AC_MSG_RESULT([Profiling : $profiling]) AC_MSG_RESULT([Documentation : $doxygen])