dnl dnl Main authors: dnl Guido Tack dnl dnl Copyright: dnl Guido Tack, 2004, 2005 dnl dnl Last modified: dnl $Date: 2008-08-23 16:22:57 +0200 (Sat, 23 Aug 2008) $ dnl by $Author: tack $ dnl $Revision: 7694 $ dnl dnl This file is part of Gecode, the generic constraint dnl development environment: dnl http://www.gecode.org dnl dnl Permission is hereby granted, free of charge, to any person obtaining dnl a copy of this software and associated documentation files (the dnl "Software"), to deal in the Software without restriction, including dnl without limitation the rights to use, copy, modify, merge, publish, dnl distribute, sublicense, and/or sell copies of the Software, and to dnl permit persons to whom the Software is furnished to do so, subject to dnl the following conditions: dnl dnl The above copyright notice and this permission notice shall be dnl included in all copies or substantial portions of the Software. dnl dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, dnl EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND dnl NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE dnl LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION dnl OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION dnl WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. dnl dnl AC_REVISION([$Id: configure.ac.in 7694 2008-08-23 14:22:57Z tack $]) AC_PREREQ(2.53) AC_INIT(GECODE, 2.2.0, users@gecode.org) AC_CONFIG_HEADERS([gecode/support/config.icc]) AC_CONFIG_SRCDIR(gecode/kernel.hh) ac_gecode_soversion=13 AC_SUBST(GECODE_SOVERSION, ${ac_gecode_soversion}) # checks for programs : ${CXXFLAGS=""} dnl we do not want autoconf's default : ${CFLAGS=""} dnl we do not want autoconf's default : ${DLLFLAGS=""} dnl we do not want autoconf's default : ${GLDFLAGS=""} dnl we do not want autoconf's default dnl include Gecode specific macros m4_include([gecode.m4]) dnl determine the operating system AC_GECODE_GET_OS if test "${CXX}x" = "x" -a "${CC}x" = "x" -a "${host_os}" = "windows"; then CC=cl CXX=cl fi AC_PROG_CXX AC_PROG_CC AC_LANG(C++) AC_PROG_RANLIB dnl check whether we have pkgconfig and should generate config files for it AC_GECODE_PKGCONFIG dnl check whether we have certain programs we need AC_CHECK_PROG(PROG_DIFF, diff, [ok]) if test "${PROG_DIFF}x" = "x"; then AC_MSG_ERROR([In order to compile Gecode, you need the diff tool.]) fi AC_CHECK_PROG(PROG_TAR, tar, [ok]) if test "${PROG_TAR}x" = "x"; then AC_MSG_ERROR([In order to compile Gecode, you need the tar tool.]) fi AC_CHECK_PROG(PROG_MAKE, make, [ok]) if test "${PROG_MAKE}x" = "x"; then AC_MSG_ERROR([In order to compile Gecode, you need the make tool.]) fi AC_CHECK_PROG(PROG_SED, sed, [ok]) if test "${PROG_SED}x" = "x"; then AC_MSG_ERROR([In order to compile Gecode, you need the sed tool.]) fi AC_CHECK_PROG(PROG_PERL, perl, [ok]) if test "${PROG_PERL}x" = "x"; then AC_MSG_ERROR([In order to compile Gecode, you need perl.]) fi dnl determine which compiler we are using AC_CXX_COMPILER_VENDOR(ac_gecode_compiler_vendor) dnl check for user-supplied prefix and suffix AC_GECODE_USER_SUFFIX dnl check whether we want to build universal binaries on Mac OS X AC_GECODE_UNIVERSAL dnl check whether we want to build static libraries AC_GECODE_STATICLIBS dnl check whether we want to build a framework bundle on Mac OS X AC_GECODE_FRAMEWORK dnl check whether we want to have assertions and debugging options AC_GECODE_DEBUG dnl check whether we want to have support for finding memory leaks AC_GECODE_LEAK_DEBUG dnl check whether we want audit code in our build AC_GECODE_AUDIT dnl check whether we want to use visibility attributes with gcc AC_GECODE_GCC_VISIBILITY dnl check whether we want to produce code suitable for profiling AC_GECODE_PROFILE dnl check whether we want to produce code instrumented for gcov AC_GECODE_GCOV dnl check platform specific behaviour of arithmetic AC_GECODE_CHECK_ARITH dnl check whether we compile with boost support AC_GECODE_BOOST case $ac_gecode_compiler_vendor in gnu) dnl general compiler flags AC_GECODE_UNIX_PATHS AC_GECODE_GCC_GENERAL_SWITCHES if test "${enable_debug:-no}" = "no" -a "${enable_gcov:-no}" = "no"; then dnl compiler flags for an optimized build AC_GECODE_GCC_OPTIMIZED_SWITCHES AC_GECODE_CHECK_COMPILERFLAG([-finline-limit=3000]) AC_GECODE_CHECK_COMPILERFLAG([-ffast-math]) AC_GECODE_CHECK_COMPILERFLAG([-mthreads]) else if test "${enable_debug:-no}" = "yes"; then dnl compiler flags for a debug build AC_GECODE_GCC_DEBUG_SWITCHES fi fi ;; intel) dnl flags for creating dlls case $host_os in windows*) AC_GECODE_MSVC_SWITCHES ;; *) dnl general compiler flags AC_GECODE_UNIX_PATHS AC_GECODE_GCC_GENERAL_SWITCHES if test "${enable_debug:-no}" = "no"; then dnl compiler flags for an optimized build AC_GECODE_GCC_OPTIMIZED_SWITCHES else dnl compiler flags for a debug build AC_GECODE_GCC_DEBUG_SWITCHES fi ;; esac ;; microsoft) AC_GECODE_MSVC_SWITCHES ;; *) AC_MSG_ERROR(Gecode currently only supports the GNU and Microsoft compilers.) ;; esac dnl find out what parts the user wants to build AC_GECODE_DOC_SWITCHES dnl ------------------------------------------------------------------ dnl Enabling of non-variable contribs dnl @CONTRIBS@ dnl ------------------------------------------------------------------ dnl Definition of variable types dnl Include contributor's vtis dnl @VTIS@ AC_GECODE_VTI(set, [finite set library (implies --enable-int-vars)], yes, [enable_int_vars="yes"; AC_SUBST(LINKSET,[${LINKLIBDIR}${LINKPREFIX}${SET}${USERSUFFIX}${LINKSUFFIX}]) ], [ AC_SUBST(LINKSET,[]) ] ) if test "${enable_set_vars}" != "yes"; then enable_cpltset_vars="no" fi AC_GECODE_VTI(cpltset, finite set library using complete domain representation (can only be used with --enable-set-vars), yes, [ AC_SUBST(LINKCPLTSET,[${LINKLIBDIR}${LINKPREFIX}${CPLTSET}${USERSUFFIX}${LINKSUFFIX}]) ], [ AC_SUBST(LINKCPLSET,[]) ]) AC_GECODE_VTI(int, finite domain library, yes, [ AC_SUBST(LINKINT,[${LINKLIBDIR}${LINKPREFIX}${INT}${USERSUFFIX}${LINKSUFFIX}]) ], [ AC_SUBST(LINKINT,[]) ]) dnl End of definition of variable types dnl ------------------------------------------------------------------ AC_GECODE_GIST AC_GECODE_QT AC_GECODE_ENABLE_MODULE(examples, yes, [build examples for the enabled variable types], [enable_search="yes"; if test ${enable_int_vars:-yes} = "yes"; then enable_minimodel="yes"; fi; ]) AC_GECODE_ENABLE_MODULE(minimodel, yes, [build modeling support library for the enabled variable types]) AC_GECODE_ENABLE_MODULE(serialization, yes, [build serialization library], [AC_DEFINE(GECODE_HAS_SERIALIZATION)]) AC_GECODE_ENABLE_MODULE(search, yes, [build search engines]) dnl Configure contributions AC_CONFIG_SUBDIRS() dnl @SUBDIRS@ AC_SUBST(PKG_CONFIG_CXXFLAGS, ${ac_gecode_pkg_cxxflags}) AC_SUBST(VERSION, ${PACKAGE_VERSION}) AC_SUBST(DLLFLAGS, ${DLLFLAGS}) AC_SUBST(GLDFLAGS, ${GLDFLAGS}) AC_CONFIG_FILES([Makefile]) AC_CONFIG_FILES([doxygen.conf:doxygen/doxygen.conf.in]) AC_CONFIG_FILES([doxygen.hh:doxygen/doxygen.hh.in]) AC_CONFIG_FILES([misc/gecode.pc]) AC_CONFIG_FILES([misc/gecode-search.pc]) AC_CONFIG_FILES([misc/gecode-serialization.pc]) AC_CONFIG_FILES([misc/gecode-minimodel.pc]) AC_CONFIG_FILES([misc/gecode-gist.pc]) AC_OUTPUT