COIN-OR::LEMON - Graph Library

source: lemon/configure.ac @ 879:25804ef35064

Last change on this file since 879:25804ef35064 was 840:7c0ad6bd6a63, checked in by Akos Ladanyi <ladanyi@…>, 15 years ago

Optionally use valgrind when running tests + other build system fixes

File size: 4.9 KB
RevLine 
[1]1dnl Process this file with autoconf to produce a configure script.
2
3dnl Version information.
[273]4m4_define([lemon_version_number],
[727]5          [m4_normalize(esyscmd([echo ${LEMON_VERSION}]))])
[273]6dnl m4_define([lemon_version_number], [])
7m4_define([lemon_hg_path], [m4_normalize(esyscmd([./scripts/chg-len.py]))])
[727]8m4_define([lemon_hg_revision], [m4_normalize(esyscmd([hg id -i 2> /dev/null]))])
[273]9m4_define([lemon_version], [ifelse(lemon_version_number(),
[727]10                           [],
11                           [ifelse(lemon_hg_revision(),
12                           [],
13                           [hg-tip],
14                           [lemon_hg_path().lemon_hg_revision()])],
15                           [lemon_version_number()])])
[1]16
17AC_PREREQ([2.59])
[236]18AC_INIT([LEMON], [lemon_version()], [lemon-user@lemon.cs.elte.hu], [lemon])
[1]19AC_CONFIG_AUX_DIR([build-aux])
20AC_CONFIG_MACRO_DIR([m4])
[64]21AM_INIT_AUTOMAKE([-Wall -Werror foreign subdir-objects nostdinc])
[1]22AC_CONFIG_SRCDIR([lemon/list_graph.h])
23AC_CONFIG_HEADERS([config.h lemon/config.h])
24
[725]25AC_DEFINE([LEMON_VERSION], [lemon_version()], [The version string])
26
[296]27dnl Do compilation tests using the C++ compiler.
28AC_LANG([C++])
29
[515]30dnl Check the existence of long long type.
31AC_CHECK_TYPE(long long, [long_long_found=yes], [long_long_found=no])
32if test x"$long_long_found" = x"yes"; then
[540]33  AC_DEFINE([LEMON_HAVE_LONG_LONG], [1], [Define to 1 if you have long long.])
[515]34fi
35
[1]36dnl Checks for programs.
37AC_PROG_CXX
38AC_PROG_CXXCPP
39AC_PROG_INSTALL
40AC_DISABLE_SHARED
41AC_PROG_LIBTOOL
42
[60]43AC_CHECK_PROG([doxygen_found],[doxygen],[yes],[no])
[791]44AC_CHECK_PROG([python_found],[python],[yes],[no])
[153]45AC_CHECK_PROG([gs_found],[gs],[yes],[no])
[60]46
[296]47dnl Detect Intel compiler.
48AC_MSG_CHECKING([whether we are using the Intel C++ compiler])
49AC_COMPILE_IFELSE([#ifndef __INTEL_COMPILER
50choke me
51#endif], [ICC=[yes]], [ICC=[no]])
52if test x"$ICC" = x"yes"; then
53  AC_MSG_RESULT([yes])
54else
55  AC_MSG_RESULT([no])
56fi
57
[225]58dnl Set custom compiler flags when using g++.
[375]59if test "$GXX" = yes -a "$ICC" = no; then
60  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"
[1]61fi
[375]62AC_SUBST([WARNINGCXXFLAGS])
[1]63
64dnl Checks for libraries.
[481]65LX_CHECK_GLPK
66LX_CHECK_CPLEX
67LX_CHECK_SOPLEX
[615]68LX_CHECK_COIN
[1]69
[480]70AM_CONDITIONAL([HAVE_LP], [test x"$lx_lp_found" = x"yes"])
71AM_CONDITIONAL([HAVE_MIP], [test x"$lx_mip_found" = x"yes"])
[1]72
[225]73dnl Disable/enable building the binary tools.
[1]74AC_ARG_ENABLE([tools],
75AS_HELP_STRING([--enable-tools], [build additional tools @<:@default@:>@])
76AS_HELP_STRING([--disable-tools], [do not build additional tools]),
77              [], [enable_tools=yes])
78AC_MSG_CHECKING([whether to build the additional tools])
79if test x"$enable_tools" != x"no"; then
80  AC_MSG_RESULT([yes])
81else
82  AC_MSG_RESULT([no])
83fi
84AM_CONDITIONAL([WANT_TOOLS], [test x"$enable_tools" != x"no"])
85
[840]86dnl Support for running test cases using valgrind.
87use_valgrind=no
88AC_ARG_ENABLE([valgrind],
89AS_HELP_STRING([--enable-valgrind], [use valgrind when running tests]),
90              [use_valgrind=yes])
91
92if [[ "$use_valgrind" = "yes" ]]; then
93  AC_CHECK_PROG(HAVE_VALGRIND, valgrind, yes, no)
94
95  if [[ "$HAVE_VALGRIND" = "no" ]]; then
96    AC_MSG_ERROR([Valgrind not found in PATH.])
97  fi
98fi
99AM_CONDITIONAL(USE_VALGRIND, [test "$use_valgrind" = "yes"])
100
[1]101dnl Checks for header files.
102AC_CHECK_HEADERS(limits.h sys/time.h sys/times.h unistd.h)
103
104dnl Checks for typedefs, structures, and compiler characteristics.
105AC_C_CONST
106AC_C_INLINE
107AC_TYPE_SIZE_T
108AC_HEADER_TIME
109AC_STRUCT_TM
110
111dnl Checks for library functions.
112AC_HEADER_STDC
113AC_CHECK_FUNCS(gettimeofday times ctime_r)
114
[219]115dnl Add dependencies on files generated by configure.
116AC_SUBST([CONFIG_STATUS_DEPENDENCIES],
[503]117  ['$(top_srcdir)/doc/Doxyfile.in $(top_srcdir)/lemon/lemon.pc.in $(top_srcdir)/cmake/version.cmake.in'])
[219]118
[1]119AC_CONFIG_FILES([
120Makefile
[611]121demo/Makefile
[503]122cmake/version.cmake
[1]123doc/Doxyfile
124lemon/lemon.pc
125])
126
127AC_OUTPUT
128
129echo
130echo '****************************** SUMMARY ******************************'
131echo
132echo Package version............... : $PACKAGE-$VERSION
133echo
134echo C++ compiler.................. : $CXX
[375]135echo C++ compiles flags............ : $WARNINGCXXFLAGS $CXXFLAGS
[1]136echo
[515]137echo Compiler supports long long... : $long_long_found
138echo
[481]139echo GLPK support.................. : $lx_glpk_found
140echo CPLEX support................. : $lx_cplex_found
141echo SOPLEX support................ : $lx_soplex_found
[482]142echo CLP support................... : $lx_clp_found
[614]143echo CBC support................... : $lx_cbc_found
[481]144echo
[55]145echo Build additional tools........ : $enable_tools
[840]146echo Use valgrind for tests........ : $use_valgrind
[1]147echo
148echo The packace will be installed in
149echo -n '  '
150echo $prefix.
151echo
152echo '*********************************************************************'
153
154echo
[55]155echo Configure complete, now type \'make\' and then \'make install\'.
[1]156echo
Note: See TracBrowser for help on using the repository browser.