COIN-OR::LEMON - Graph Library

source: lemon-1.2/configure.ac @ 678:d1e1cd94bf49

Last change on this file since 678:d1e1cd94bf49 was 678:d1e1cd94bf49, checked in by Akos Ladanyi <ladanyi@…>, 10 years ago

Put the version string into config.h

Also make it possible to set the version using the LEMON_VERSION environment
variable, and use the hg revision as version string in case this variable is
unset.

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