dnl dnl Filename : configure.ac dnl Description : Run this file through autoconf to produce `configure' dnl Author(s) : SBML Team dnl Created : 2003-02-13 dnl Revision : $Id: configure.ac 9711 2009-07-05 07:34:14Z ajouraku $ dnl $URL: https://sbml.svn.sourceforge.net/svnroot/sbml/trunk/libsbml/configure.ac $ dnl dnl */ dnl --------------------------------------------------------------------------- dnl Autoconf initialization. dnl dnl Bug reports are sent to sbml-team@cds.caltech.edu dnl --------------------------------------------------------------------------- m4_define(LIBSBML_VERSION, m4_esyscmd(cat VERSION.txt | sed 's/\-.*$//' | tr -d '\n\r')) AC_INIT([libSBML], LIBSBML_VERSION, [libsbml-team@caltech.edu], [libsbml]) AC_CONFIG_AUX_DIR(config) AC_REVISION($Revision: 9711 $) AC_PREREQ(2.57) AC_CONFIG_SRCDIR(src/Makefile.in) AC_CONFIG_HEADERS(src/common/libsbml-config-unix.h) AC_CONFIG_HEADERS(src/common/libsbml-package.h) LIBSBML_VERSION_NUMERIC=m4_esyscmd(cat VERSION.txt |\ awk -F'.' '{ printf("%d%02d%02d\n", $1, $2, $3) }') AC_SUBST(LIBSBML_VERSION_NUMERIC) LIBSBML_MAJOR_VERSION=m4_esyscmd(cat VERSION.txt |\ awk -F'.' '{ printf("%d\n", $1) }') AC_SUBST(LIBSBML_MAJOR_VERSION) LIBSBML_MINOR_VERSION=m4_esyscmd(cat VERSION.txt |\ awk -F'.' '{ printf("%d\n", $2) }') AC_SUBST(LIBSBML_MINOR_VERSION) dnl --------------------------------------------------------------------------- dnl Command-line options dnl --------------------------------------------------------------------------- dnl [2007-06-25] This is not currently functioning and may never be again. dnl AC_ARG_ENABLE([memory-tracing], dnl AC_HELP_STRING([--enable-memory-tracing], dnl [Enable memory tracing (default: disabled)]), dnl [enable_tracing=$withval], dnl [enable_tracing=no]) dnl if test "$enable_tracing" != no; then dnl AC_DEFINE([TRACE_MEMORY], 1, dnl [Define to 1 to enable primitive memory tracing.]) dnl fi AC_ARG_ENABLE([layout], AC_HELP_STRING([--enable-layout=[ARG]], [Build the SBML layout extension (default=no)]), [enable_layout=$enableval], [enable_layout=no]) if test "$enable_layout" != no; then AC_DEFINE([USE_LAYOUT], 1, [Define to 1 to build the SBML layout extension.]) AC_SUBST(USE_LAYOUT, 1) fi AC_ARG_ENABLE([compression], AC_HELP_STRING([--enable-compression=[ARG]], [Enable zlib/bzip2 compression if required libs detected, otherwise disabled (default=yes)]), [enable_compression=$enableval], [enable_compression=yes]) if test "$enable_compression" != no; then AC_DEFINE([USE_COMPRESSION], 1, [Define to 1 to enable zlib/bzip2 compression.]) AC_SUBST(USE_COMPRESSION, 1) fi dnl Other cmd-line options are defined in the individual .m4 files in the dnl config/ subdirectory. dnl --------------------------------------------------------------------------- dnl Check host operating system. dnl --------------------------------------------------------------------------- AC_CANONICAL_HOST case $host_os in *linux*) CPPFLAGS="-DLINUX $CPPFLAGS" HOST_TYPE="linux" SHAREDLIBEXT="so" ;; *solaris*) CPPFLAGS="-DSOLARIS $CPPFLAGS" HOST_TYPE="solaris" SHAREDLIBEXT="so" ;; *cygwin*) CPPFLAGS="-DWIN32 -DCYGWIN -DLIBSBML_EXPORTS $CPPFLAGS" HOST_TYPE="cygwin" SHAREDLIBEXT="dll" ;; *darwin*) CPPFLAGS="-DMACOSX $CPPFLAGS" HOST_TYPE="darwin" SHAREDLIBEXT="dylib" ;; *aix*) CPPFLAGS="-DAIX $CPPFLAGS" HOST_TYPE="aix" SHAREDLIBEXT="a" ;; *freebsd*) CPPFLAGS="-DFREEBSD $CPPFLAGS" HOST_TYPE="freebsd" SHAREDLIBEXT="so" ;; esac AC_SUBST(HOST_TYPE) AC_SUBST(SHAREDLIBEXT) dnl Provide dynamic library path settings. CONFIG_LDPATH dnl --------------------------------------------------------------------------- dnl Checks for various programs and packages. dnl --------------------------------------------------------------------------- AC_PROG_CXX AC_PROG_CC AC_PROG_CPP AC_PROG_RANLIB AC_PROG_INSTALL AC_PROG_MAKE_SET AC_PATH_PROG([AUTOCONF],[autoconf],[autoconf]) AC_PATH_PROG([ACLOCAL],[aclocal],[aclocal]) AC_PATH_PROG([AR],[ar],[ar]) # The Lisp language binding has been removed for the time being, because it # no longer works in recent versions of libSBML. CONFIG_PROG_SWIG(1.3.33) CONFIG_PROG_PYTHON CONFIG_PROG_PERL CONFIG_PROG_JAVA(1.5.0) CONFIG_PROG_MATLAB CONFIG_PROG_OCTAVE(2.9.7,2.9.7) CONFIG_PROG_RUBY CONFIG_PROG_CSHARP # Make sure to test doxygen *after* java, because there's a dependency on # in CONFIG_PROG_DOXYGEN on whether --with-java was also given. CONFIG_PROG_DOXYGEN(1.5.8) dnl AC_LIBTOOL_WIN32_DLL dnl AC_PROG_LIBTOOL dnl --------------------------------------------------------------------------- dnl Checks for libraries. dnl --------------------------------------------------------------------------- AC_LANG(C) AC_CHECK_LIB(m, isnan) dnl Make sure to test libxml *last*, because libxml is the default and the dnl config macro needs to know whether any other XML libraries have been dnl chosen instead of it. CONFIG_LIB_EXPAT(1.95.8) CONFIG_LIB_XERCES CONFIG_LIB_LIBXML(2.6.16) CONFIG_LIB_LIBCHECK(0.9.2) CONFIG_LIB_ZLIB CONFIG_LIB_BZ2 CONFIG_LIB_UNIVBINARY dnl --------------------------------------------------------------------------- dnl Checks for header files. dnl --------------------------------------------------------------------------- AC_HEADER_STDC AC_CHECK_HEADERS(errno.h) AC_CHECK_HEADERS(math.h) AC_CHECK_HEADERS(ieeefp.h) dnl --------------------------------------------------------------------------- dnl Checks for typedefs, structures, and compiler characteristics. dnl --------------------------------------------------------------------------- AC_C_BIGENDIAN AC_C_CONST AC_TYPE_SIZE_T AC_EXEEXT AC_OBJEXT dnl --------------------------------------------------------------------------- dnl Checks for Sun cc. dnl --------------------------------------------------------------------------- if ($CXX -V 2>&1 | grep 'Sun C++') >/dev/null 2>/dev/null; then AC_SUBST(USE_SUN_CC, 1) fi dnl --------------------------------------------------------------------------- dnl Miscellaneous dnl --------------------------------------------------------------------------- # Root directory # Translate path for native Windows compilers for use with 'make check' ROOT_DIR=`pwd` case $host in *-*-cygwin* | *-*-mingw*) if (cygpath --mixed $ROOT_DIR) >/dev/null 2>/dev/null; then ROOT_DIR=`cygpath --mixed $ROOT_DIR` fi # Extra files generated by some Windows compilers EXTRA_CLEAN="*.stackdump *.exp *.lib" ;; esac dnl In order to allow certain Makefile tests, we define a variable that dnl stores a list of options available to configure. This variable is dnl added to by the configure options defined in config/ .m4 files. AC_DEFINE(LIBSBML_OPTIONS) AC_SUBST(LIBSBML_OPTIONS) dnl --------------------------------------------------------------------------- dnl Output dnl --------------------------------------------------------------------------- AC_CONFIG_FILES([config/makefile-common-vars.mk]) AC_CONFIG_FILES([./Makefile]) AC_CONFIG_FILES([libsbml.spec]) AC_CONFIG_FILES([src/Makefile]) AC_CONFIG_FILES([src/common/Makefile]) AC_CONFIG_FILES([src/common/libsbml-version.h]) AC_CONFIG_FILES([src/bindings/Makefile]) AC_CONFIG_FILES([src/bindings/python/Makefile]) AC_CONFIG_FILES([src/bindings/python/setup.py]) AC_CONFIG_FILES([src/bindings/perl/Makefile]) AC_CONFIG_FILES([src/bindings/perl/Makefile.PL]) AC_CONFIG_FILES([src/bindings/matlab/Makefile]) AC_CONFIG_FILES([src/bindings/matlab/test/Makefile]) AC_CONFIG_FILES([src/bindings/octave/Makefile]) AC_CONFIG_FILES([src/bindings/octave/test/Makefile]) AC_CONFIG_FILES([src/bindings/java/Makefile]) # The Lisp language binding has been removed for the time being, because it # no longer works in recent versions of libSBML. # AC_CONFIG_FILES([src/bindings/java/Makefile]) AC_CONFIG_FILES([src/bindings/ruby/Makefile]) AC_CONFIG_FILES([src/bindings/csharp/Makefile]) AC_CONFIG_FILES([src/annotation/Makefile]) AC_CONFIG_FILES([src/annotation/test/Makefile]) AC_CONFIG_FILES([src/math/Makefile]) AC_CONFIG_FILES([src/math/test/Makefile]) AC_CONFIG_FILES([src/units/Makefile]) AC_CONFIG_FILES([src/units/test/Makefile]) AC_CONFIG_FILES([src/sbml/Makefile]) AC_CONFIG_FILES([src/sbml/test/Makefile]) AC_CONFIG_FILES([src/sbml/layout/Makefile]) AC_CONFIG_FILES([src/sbml/layout/test/Makefile]) AC_CONFIG_FILES([src/util/Makefile]) AC_CONFIG_FILES([src/util/test/Makefile]) AC_CONFIG_FILES([src/validator/Makefile]) AC_CONFIG_FILES([src/validator/constraints/Makefile]) AC_CONFIG_FILES([src/validator/test/Makefile]) AC_CONFIG_FILES([src/xml/Makefile]) AC_CONFIG_FILES([src/xml/test/Makefile]) AC_CONFIG_FILES([src/compress/Makefile]) AC_CONFIG_FILES([docs/Makefile]) AC_CONFIG_FILES([docs/src/doxygen-config-c.txt]) AC_CONFIG_FILES([docs/src/doxygen-config-cpp.txt]) AC_CONFIG_FILES([docs/src/doxygen-config-python.txt]) AC_CONFIG_FILES([docs/src/doxygen-config-perl.txt]) AC_CONFIG_FILES([docs/src/Makefile]) AC_CONFIG_FILES([win32/Makefile]) AC_CONFIG_FILES([win32/MSVC7/Makefile]) AC_CONFIG_FILES([win32/MSVC8/Makefile]) AC_CONFIG_FILES([win32/MSVC9/Makefile]) AC_CONFIG_FILES([examples/c/Makefile]) AC_CONFIG_FILES([examples/c++/Makefile]) AC_CONFIG_FILES([examples/java/Makefile]) AC_CONFIG_FILES([examples/csharp/Makefile]) if test "$enable_layout" != "no" ; then AC_CONFIG_FILES([examples/layout/Makefile]) fi AC_CONFIG_FILES([macosx/Makefile]) AC_CONFIG_FILES([macosx/build.sh], [chmod a+x macosx/build.sh]) AC_CONFIG_FILES([macosx/libSBML.pkg/Contents/Info.plist]) AC_CONFIG_FILES([macosx/libSBML.pkg/Contents/Resources/package_version]) AC_OUTPUT dnl --------------------------------------------------------------------------- dnl Inform users of settings dnl --------------------------------------------------------------------------- dnl Gather up the values of the flags into one set of variables for easier dnl printing below. if test $with_expat != no; then xml_library="Expat" xml_cppflags=$EXPAT_CPPFLAGS xml_ldflags=$EXPAT_LDFLAGS xml_libs=$EXPAT_LIBS elif test $with_libxml != no; then xml_library="libxml2" xml_cppflags=$LIBXML_CPPFLAGS xml_ldflags=$LIBXML_LDFLAGS xml_libs=$LIBXML_LIBS else xml_library="Xerces-C++" xml_cppflags=$XERCES_CPPFLAGS xml_ldflags=$XERCES_LDFLAGS xml_libs=$XERCES_LIBS fi dnl Simple helper functions used below. print_whitespace() { i=$1 if test -n "$i"; then while expr $i \> 0 > /dev/null do i=`expr $i - 1`; printf ' ' done fi } print_flag() { if test -n "$2" -a "$2" != "no"; then i=`expr 13 - ${#1}` printf " Using $1 with path " print_whitespace $i if test -n "$4"; then /bin/echo -n "= $3" else echo "= $3" fi fi dnl dnl If there's a 4th arg, print it after everything else on the line. dnl if test -n "$4"; then echo " ($4)" fi } echo "" echo "----------------------------------------------------------------------" echo "${PACKAGE_NAME} version ${PACKAGE_VERSION}" echo "----------------------------------------------------------------------" echo "" echo "More information and the latest version are available online at" echo "http://sbml.org/Software/libSBML" echo "" echo "Please report problems using the issue tracker at" echo "http://sbml.org/software/libsbml/issue-tracker" echo "" echo "To contact the developers directly, email libsbml-team@caltech.edu" echo "" echo "Configured on host \"`hostname`\"" echo " host type = $HOST_TYPE" echo " host vendor = $host_vendor" echo " host operating system = $host_os" echo " host CPU architecture = $host_cpu" echo "" echo "General build flags:" echo " CC = $CC" echo " CXX = $CXX" echo " CFLAGS = $CFLAGS" echo " CXXFLAGS = $CXXFLAGS" echo " CPPFLAGS = $CPPFLAGS $ZLIB_CPPFLAGS $BZ2_CPPFLAGS" echo " LDFLAGS = $LDFLAGS $ZLIB_LDFLAGS $BZ2_LDFLAGS" echo " LIBS = $LIBS $ZLIB_LIBS $BZ2_LIBS" echo "" echo "XML parser library configuration:" echo " XML library = $xml_library" echo " CPPFLAGS for XML = $xml_cppflags" echo " LDFLAGS for XML = $xml_ldflags" echo " LIBS for XML = $xml_libs" echo "" echo "Other ${PACKAGE_NAME} configuration settings:" echo " Installation \$prefix = $prefix" print_flag "libcheck" $with_libcheck $with_check print_flag "SWIG" $with_swig $SWIG print_flag "doxygen" $with_doxygen $with_doxygen print_flag "Java" $with_java $JAVA print_flag "Python" $with_python $PYTHON print_flag "Perl" $with_perl $PERL print_flag "MATLAB" $with_matlab $MATLAB print_flag "Octave" $with_octave $OCTAVE print_flag "Asdf" $EXT_ASDF $ASDF print_flag "UFFI" $EXT_UFFI $UFFI print_flag "Ruby" $with_ruby $RUBY print_flag "CSharp" $with_csharp $CSHARP_CILINTERPRETER print_flag "zlib" $with_zlib $with_zlib print_flag "bzip2" $with_bzip2 $with_bzip2 if test "$enable_layout" != "no" ; then echo " Using layout extension = yes" fi echo "" echo "Other potentially important settings:" if test "$enable_univbinary" != "no"; then echo " Building libSBML as MacSO universal binary." fi if test "$with_zlib" != no; then /bin/echo -n " Compression support enabled for .zip" if test "$with_bzip2" != no; then echo ", .gz and .bz2 files" else echo " and .gz files" fi elif test "$with_bzip2" != no; then echo " Compression support enabled for .bz2 files" fi if test "$HOST_TYPE" = "darwin"; then echo " Value of \$DYLD_LIBRARY_PATH = $DYLD_LIBRARY_PATH" else echo " Value of \$LD_LIBRARY_PATH = $LD_LIBRARY_PATH" fi if test -n "$with_java" -a "$with_java" != "no"; then echo " Value of \$CLASSPATH for Java = $CLASSPATH" fi if test -n "$with_csharp" -a "$with_csharp" != "no"; then echo " Using CSharp compiler = $CSHARP_COMPILER" fi dnl Print these warnings at the end so they're less likely to be overlooked. if test "$with_zlib" = no && test "$with_bzip2" = no; then echo "" echo "Warning: reading/writing compressed SBML in this copy of libSBML" echo "is not supported or has not been enabled. If this was not your" echo "intention, please check the --with-zlib, -with-bzip2, and/or" echo "--enable-compression options." echo "" elif test "$with_zlib" = no; then echo "" echo "Warning: reading/writing compressed SBML in .gz and .zip format" echo "in this copy of libSBML is not supported or has been disabled." echo "If this was not your intention, please check the --with-zlib" echo "option." echo "" elif test "$with_bzip2" = no; then echo "" echo "Warning: reading/writing compressed SBML in .bz2 format in" echo "this copy of libSBML is not supported or has been disabled." echo "If this was not your intention, please check the --with-bzip2" echo "option." echo "" fi dnl Temporarily unavailable anyway, so skip this for now: dnl echo " enable memory tracing? = $enable_tracing" echo "----------------------------------------------------------------------" echo ""