COIN-OR::LEMON - Graph Library

source: lemon-main/configure.ac @ 309:e57e10a8ea1b

Last change on this file since 309:e57e10a8ea1b was 296:9768e60aa4e1, checked in by Akos Ladanyi <ladanyi@…>, 16 years ago

Properly detect the Intel C++ compiler (ticket #154).

File size: 4.6 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
22lx_cmdline_cxxflags_set=${CXXFLAGS+set}
23
24dnl Do compilation tests using the C++ compiler.
25AC_LANG([C++])
26
27dnl Checks for programs.
28AC_PROG_CXX
29AC_PROG_CXXCPP
30AC_PROG_INSTALL
31AC_DISABLE_SHARED
32AC_PROG_LIBTOOL
33
34AC_CHECK_PROG([doxygen_found],[doxygen],[yes],[no])
35AC_CHECK_PROG([gs_found],[gs],[yes],[no])
36
37dnl Detect Intel compiler.
38AC_MSG_CHECKING([whether we are using the Intel C++ compiler])
39AC_COMPILE_IFELSE([#ifndef __INTEL_COMPILER
40choke me
41#endif], [ICC=[yes]], [ICC=[no]])
42if test x"$ICC" = x"yes"; then
43  AC_MSG_RESULT([yes])
44else
45  AC_MSG_RESULT([no])
46fi
47
48dnl Set custom compiler flags when using g++.
49if test x"$lx_cmdline_cxxflags_set" != x"set" -a "$GXX" = yes -a "$ICC" = no; then
50  CXXFLAGS="$CXXFLAGS -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 -Woverloaded-virtual -ansi -fno-strict-aliasing -Wold-style-cast -Wno-unknown-pragmas"
51fi
52
53dnl Checks for libraries.
54#LX_CHECK_GLPK
55#LX_CHECK_CPLEX
56#LX_CHECK_SOPLEX
57
58dnl Disable/enable building the demo programs.
59AC_ARG_ENABLE([demo],
60AS_HELP_STRING([--enable-demo], [build the demo programs])
61AS_HELP_STRING([--disable-demo], [do not build the demo programs @<:@default@:>@]),
62              [], [enable_demo=no])
63AC_MSG_CHECKING([whether to build the demo programs])
64if test x"$enable_demo" != x"no"; then
65  AC_MSG_RESULT([yes])
66else
67  AC_MSG_RESULT([no])
68fi
69AM_CONDITIONAL([WANT_DEMO], [test x"$enable_demo" != x"no"])
70
71dnl Disable/enable building the binary tools.
72AC_ARG_ENABLE([tools],
73AS_HELP_STRING([--enable-tools], [build additional tools @<:@default@:>@])
74AS_HELP_STRING([--disable-tools], [do not build additional tools]),
75              [], [enable_tools=yes])
76AC_MSG_CHECKING([whether to build the additional tools])
77if test x"$enable_tools" != x"no"; then
78  AC_MSG_RESULT([yes])
79else
80  AC_MSG_RESULT([no])
81fi
82AM_CONDITIONAL([WANT_TOOLS], [test x"$enable_tools" != x"no"])
83
84dnl Disable/enable building the benchmarks.
85AC_ARG_ENABLE([benchmark],
86AS_HELP_STRING([--enable-benchmark], [build the benchmarks])
87AS_HELP_STRING([--disable-benchmark], [do not build the benchmarks @<:@default@:>@]),
88              [], [enable_benchmark=no])
89AC_MSG_CHECKING([whether to build the benchmarks])
90if test x"$enable_benchmark" != x"no"; then
91  AC_MSG_RESULT([yes])
92else
93  AC_MSG_RESULT([no])
94fi
95AM_CONDITIONAL([WANT_BENCHMARK], [test x"$enable_benchmark" != x"no"])
96
97dnl Checks for header files.
98AC_CHECK_HEADERS(limits.h sys/time.h sys/times.h unistd.h)
99
100dnl Checks for typedefs, structures, and compiler characteristics.
101AC_C_CONST
102AC_C_INLINE
103AC_TYPE_SIZE_T
104AC_HEADER_TIME
105AC_STRUCT_TM
106
107dnl Checks for library functions.
108AC_HEADER_STDC
109AC_CHECK_FUNCS(gettimeofday times ctime_r)
110
111dnl Add dependencies on files generated by configure.
112AC_SUBST([CONFIG_STATUS_DEPENDENCIES],
113  ['$(top_srcdir)/doc/Doxyfile.in $(top_srcdir)/lemon/lemon.pc.in'])
114
115AC_CONFIG_FILES([
116Makefile
117doc/Doxyfile
118lemon/lemon.pc
119])
120
121AC_OUTPUT
122
123echo
124echo '****************************** SUMMARY ******************************'
125echo
126echo Package version............... : $PACKAGE-$VERSION
127echo
128echo C++ compiler.................. : $CXX
129echo C++ compiles flags............ : $CXXFLAGS
130echo
131#echo GLPK support.................. : $lx_glpk_found
132#echo CPLEX support................. : $lx_cplex_found
133#echo SOPLEX support................ : $lx_soplex_found
134#echo
135echo Build benchmarks.............. : $enable_benchmark
136echo Build demo programs........... : $enable_demo
137echo Build additional tools........ : $enable_tools
138echo
139echo The packace will be installed in
140echo -n '  '
141echo $prefix.
142echo
143echo '*********************************************************************'
144
145echo
146echo Configure complete, now type \'make\' and then \'make install\'.
147echo
Note: See TracBrowser for help on using the repository browser.