dnl Process this file with autoconf to produce a configure script.
m4_define([lemon_version_number],
[m4_normalize(esyscmd([echo ${LEMON_VERSION}]))])
dnl m4_define([lemon_version_number], [])
m4_define([lemon_hg_path], [m4_normalize(esyscmd([./scripts/chg-len.py]))])
m4_define([lemon_hg_revision], [m4_normalize(esyscmd([hg id -i]))])
m4_define([lemon_version], [ifelse(lemon_version_number(),
[lemon_hg_path().lemon_hg_revision()],
[lemon_version_number()])])
AC_INIT([LEMON], [lemon_version()], [lemon-user@lemon.cs.elte.hu], [lemon])
AC_CONFIG_AUX_DIR([build-aux])
AC_CONFIG_MACRO_DIR([m4])
AM_INIT_AUTOMAKE([-Wall -Werror foreign subdir-objects nostdinc])
AC_CONFIG_SRCDIR([lemon/list_graph.h])
AC_CONFIG_HEADERS([config.h lemon/config.h])
dnl Do compilation tests using the C++ compiler.
AC_CHECK_PROG([doxygen_found],[doxygen],[yes],[no])
AC_CHECK_PROG([gs_found],[gs],[yes],[no])
dnl Detect Intel compiler.
AC_MSG_CHECKING([whether we are using the Intel C++ compiler])
AC_COMPILE_IFELSE([#ifndef __INTEL_COMPILER
#endif], [ICC=[yes]], [ICC=[no]])
if test x"$ICC" = x"yes"; then
dnl Set custom compiler flags when using g++.
if test "$GXX" = yes -a "$ICC" = no; then
WARNINGCXXFLAGS="-Wall -W -Wall -W -Wunused -Wformat=2 -Wctor-dtor-privacy -Wnon-virtual-dtor -Wno-char-subscripts -Wwrite-strings -Wno-char-subscripts -Wreturn-type -Wcast-qual -Wcast-align -Wsign-promo -Woverloaded-virtual -ansi -fno-strict-aliasing -Wold-style-cast -Wno-unknown-pragmas"
AC_SUBST([WARNINGCXXFLAGS])
dnl Checks for libraries.
AM_CONDITIONAL([HAVE_LP], [test x"$lx_lp_found" = x"yes"])
AM_CONDITIONAL([HAVE_MIP], [test x"$lx_mip_found" = x"yes"])
dnl Disable/enable building the demo programs.
AS_HELP_STRING([--enable-demo], [build the demo programs])
AS_HELP_STRING([--disable-demo], [do not build the demo programs @<:@default@:>@]),
AC_MSG_CHECKING([whether to build the demo programs])
if test x"$enable_demo" != x"no"; then
AM_CONDITIONAL([WANT_DEMO], [test x"$enable_demo" != x"no"])
dnl Disable/enable building the binary tools.
AS_HELP_STRING([--enable-tools], [build additional tools @<:@default@:>@])
AS_HELP_STRING([--disable-tools], [do not build additional tools]),
AC_MSG_CHECKING([whether to build the additional tools])
if test x"$enable_tools" != x"no"; then
AM_CONDITIONAL([WANT_TOOLS], [test x"$enable_tools" != x"no"])
dnl Checks for header files.
AC_CHECK_HEADERS(limits.h sys/time.h sys/times.h unistd.h)
dnl Checks for typedefs, structures, and compiler characteristics.
dnl Checks for library functions.
AC_CHECK_FUNCS(gettimeofday times ctime_r)
dnl Add dependencies on files generated by configure.
AC_SUBST([CONFIG_STATUS_DEPENDENCIES],
['$(top_srcdir)/doc/Doxyfile.in $(top_srcdir)/lemon/lemon.pc.in'])
echo '****************************** SUMMARY ******************************'
echo Package version............... : $PACKAGE-$VERSION
echo C++ compiler.................. : $CXX
echo C++ compiles flags............ : $WARNINGCXXFLAGS $CXXFLAGS
#echo GLPK support.................. : $lx_glpk_found
#echo CPLEX support................. : $lx_cplex_found
#echo SOPLEX support................ : $lx_soplex_found
echo Build demo programs........... : $enable_demo
echo Build additional tools........ : $enable_tools
echo The packace will be installed in
echo '*********************************************************************'
echo Configure complete, now type \'make\' and then \'make install\'.