1dnl Process this file with autoconf to produce a configure script.
2AC_INIT([Open BEAGLE], 3.0.3,[cgagne@gmail.com],[beagle])
3AC_CONFIG_SRCDIR([beagle/src/Allocator.cpp])
4AC_CONFIG_AUX_DIR([config])
5AC_REVISION([$Revision: 1.33.2.7 $])
6AM_INIT_AUTOMAKE
7AM_CONFIG_HEADER([config/config-h:config/config-h.in])
8AX_PREFIX_CONFIG_H([beagle/include/beagle/config.hpp],[BEAGLE],[config/config-h])
9
10dnl Checks for programs.
11AC_PROG_AWK
12AC_PROG_CXX
13AC_PROG_CXXCPP
14AC_PROG_INSTALL
15AC_PROG_LN_S
16AC_PROG_LIBTOOL
17
18dnl Set language.
19AC_LANG([C++])
20
21dnl Open BEAGLE optimization mode option.
22AC_ARG_ENABLE(optimization,
23  [  --enable-optimization    enable optimization mode [default=no]],
24  [case $enableval in
25  yes) enable_optimization=yes;;
26  no) enable_optimization=no;;
27  *) enable_optimization=no;; esac],
28  enable_optimization=no)
29if test "$enable_optimization" = yes; then
30  AC_DEFINE(NDEBUG,,[define if some debug code is disabled])
31fi
32
33dnl Open BEAGLE full debug mode option.
34AC_ARG_ENABLE(full-debug,
35  [  --enable-full-debug      enable full debug mode [default=no]],
36  [case $enableval in
37  yes) enable_full_debug=yes;;
38  no) enable_full_debug=no;;
39  *) enable_full_debug=no;; esac],
40  enable_full_debug=no)
41if test "$enable_full_debug" = yes; then
42  AC_DEFINE(FULL_DEBUG,,[define if full debug mode is active])
43fi
44
45dnl Open BEAGLE fast compilation mode option.
46AC_ARG_ENABLE(fast-compilation,
47  [  --enable-fast-compilation [=no/yes] enable fast compilation mode [default=yes]],, enable_fast_compilation="yes")
48if test "$enable_fast_compilation" = "yes"; then
49  AC_DEFINE(FAST_COMPILATION,,[define if fast compilation mode is active])
50fi
51AM_CONDITIONAL(FAST_COMPILATION, test "$enable_fast_compilation" = "yes")
52
53dnl Open BEAGLE tests compilation mode option.
54AC_ARG_ENABLE(tests,
55  [  --enable-tests [=no/yes] enable compilation of tests [default=no]],, enable_tests="no")
56if test "$enable_tests" = "yes"; then
57  AC_DEFINE(COMPILE_TESTS,,[define if compilation of tests is active])
58fi
59AM_CONDITIONAL(COMPILE_TESTS, test "$enable_tests" = "yes")
60
61dnl Checks for libraries.
62AC_HEADER_STDC
63
64dnl Checks for typedefs, structures, and compiler characteristics.
65AC_CXX_BOOL
66OB_CXX_LONG_LONG
67OB_CXX_HAVE_ISFINITE
68AC_CXX_TEMPLATES
69AC_CXX_TYPENAME
70AC_CXX_TEMPLATE_SCOPED_ARGUMENT_MATCHING
71AC_CXX_DEFAULT_TEMPLATE_PARAMETERS
72AC_CXX_TEMPLATE_QUALIFIED_BASE_CLASS
73AC_CXX_TEMPLATE_QUALIFIED_RETURN_TYPE
74AC_CXX_CONST_CAST
75AC_CXX_REINTERPRET_CAST
76AC_CXX_STATIC_CAST
77AC_CXX_DYNAMIC_CAST
78AC_CXX_EXCEPTIONS
79AC_CXX_EXPLICIT
80AC_CXX_NAMESPACES
81AC_CXX_RTTI
82AC_CXX_HAVE_STD
83AC_CXX_HAVE_STL
84AC_CXX_HAVE_NUMERIC_LIMITS
85AC_CXX_HAVE_SSTREAM
86
87dnl Checks for hash_map and hash_set
88AC_ARG_ENABLE(hashset,
89  [  --enable-hashset [=no/yes] enable hash_set STL extension [default=no]],, enable_hashset="no")
90if test "$enable_hashset" = "yes"; then
91  AC_CXX_STD_HASHSET
92  AC_CXX_GNUCXX_HASHSET
93  AC_CXX_STDEXT_HASHSET
94fi
95AC_ARG_ENABLE(hashmap,
96  [  --enable-hashmap [=no/yes] enable hash_map STL extension [default=no]],, enable_hashmap="no")
97if test "$enable_hashmap" = "yes"; then
98  AC_CXX_STD_HASHMAP
99  AC_CXX_GNUCXX_HASHMAP
100  AC_CXX_STDEXT_HASHMAP
101fi
102
103dnl Check for file /dev/urandom
104AC_CHECK_FILE([/dev/urandom],[AC_DEFINE([HAVE_DEV_URANDOM],[],[define if file /dev/urandom exists.])])
105
106dnl Check for POSIX threads support.
107ACX_PTHREAD
108LIBS="$PTHREAD_LIBS $LIBS"
109CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
110CXXFLAGS="$CXXFLAGS $PTHREAD_CFLAGS"
111
112dnl Check for zlib support.
113CHECK_ZLIB
114
115dnl Stop configure process if some C++ essentials are not present.
116if test "$ac_cv_cxx_templates" = no; then
117  AC_MSG_ERROR([["sorry, templates support needed"]])
118fi
119if test "$ac_cv_cxx_template_scoped_argument_matching" = no; then
120  AC_MSG_ERROR([["sorry, template scoped argument matching support needed"]])
121fi
122if test "$ac_cv_cxx_default_template_parameters" = no; then
123  AC_MSG_ERROR([["sorry, default template parameters support needed"]])
124fi
125if test "$ac_cv_cxx_typename" = no; then
126  AC_MSG_ERROR([["sorry, typename qualifier needed"]])
127fi
128if test "$ac_cv_cxx_exceptions" = no; then
129  AC_MSG_ERROR([["sorry, support for exception handling needed"]])
130fi
131if test "$ac_cv_cxx_namespaces" = no; then
132  AC_MSG_ERROR([["sorry, namespaces support needed"]])
133fi
134if test "$ac_cv_cxx_have_std" = no; then
135  AC_MSG_ERROR([["sorry, namespace std needed"]])
136fi
137if test "$ac_cv_cxx_have_stl" = no; then
138  AC_MSG_ERROR([["sorry, no standard template library found"]])
139fi
140if test "$ac_cv_cxx_have_sstream" = no; then
141  AC_MSG_ERROR([["sorry, no sstream found. If you are using gcc less or equal to 2.95.2, see http://gcc.gnu.org/faq.html#2.95sstream to patch your compiler"]])
142fi
143
144dnl Specific variables definition for PACC
145PACC_VERSION='1.3.1b'
146AC_SUBST(PACC_VERSION)
147if test "$zlib_cv_libz" = yes; then
148  CPPFLAGS="$CPPFLAGS -DPACC_ZLIB"
149fi
150
151dnl Create makefiles.
152AC_CONFIG_FILES([Makefile
153                 PACC/Makefile
154                 PACC/Math/Makefile
155                 PACC/SVG/Makefile
156                 PACC/Socket/Makefile
157                 PACC/Threading/Makefile
158                 PACC/Util/Makefile
159                 PACC/XML/Makefile
160                 beagle/Makefile
161                 beagle/include/Makefile
162                 beagle/include/beagle/Makefile
163                 beagle/src/Makefile
164                 beagle/GA/Makefile
165                 beagle/GA/include/Makefile
166                 beagle/GA/include/beagle/Makefile
167                 beagle/GA/include/beagle/GA/Makefile
168                 beagle/GA/src/Makefile
169                 beagle/GP/Makefile
170                 beagle/GP/include/Makefile
171                 beagle/GP/include/beagle/Makefile
172                 beagle/GP/include/beagle/GP/Makefile
173                 beagle/GP/src/Makefile
174                 beagle/Coev/Makefile
175                 beagle/Coev/include/Makefile
176                 beagle/Coev/include/beagle/Makefile
177                 beagle/Coev/include/beagle/Coev/Makefile
178                 beagle/Coev/src/Makefile
179                 tests/Makefile
180                 tests/Common/Makefile
181                 tests/Exception/Makefile
182                 tests/GA/Makefile
183                 tests/GA/optfct/Makefile
184                 tests/GP/Makefile
185                 tests/GP/FitnessTestGPIndividual/Makefile
186                 tests/GP/ReadGPIndividual/Makefile
187                 tests/GP/WriteRandomGPIndividual/Makefile
188                 tests/LinGP/Makefile
189                 tests/LinGP/include/Makefile
190                 tests/LinGP/include/beagle/Makefile
191                 tests/LinGP/include/beagle/LinGP/Makefile
192                 tests/LinGP/src/Makefile
193                 tests/Roulette/Makefile
194                 tests/Thread/Makefile
195                 tests/TransportTCPIPOp/Makefile
196])
197AC_OUTPUT
198