1 | ## Process this file with autoconf to produce a configure script. |
---|
2 | ## |
---|
3 | ## $Id: configure.ac 944 2007-10-07 21:10:51Z peter $ |
---|
4 | |
---|
5 | # Copyright (C) 2003 Daniel Dalevi, Jari Häkkinen |
---|
6 | # Copyright (C) 2004 Jari Häkkinen |
---|
7 | # Copyright (C) 2005, 2006, 2007 Jari Häkkinen, Peter Johansson |
---|
8 | # |
---|
9 | # This file is part of the yat library, http://trac.thep.lu.se/trac/yat |
---|
10 | # |
---|
11 | # The yat library is free software; you can redistribute it |
---|
12 | # and/or modify it under the terms of the GNU General Public License as |
---|
13 | # published by the Free Software Foundation; either version 2 of the |
---|
14 | # License, or (at your option) any later version. |
---|
15 | # |
---|
16 | # The yat library is distributed in the hope that it will be useful, |
---|
17 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
18 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
---|
19 | # General Public License for more details. |
---|
20 | # |
---|
21 | # You should have received a copy of the GNU General Public License |
---|
22 | # along with this program; if not, write to the Free Software |
---|
23 | # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA |
---|
24 | # 02111-1307, USA. |
---|
25 | # |
---|
26 | # If you grabbed the source from the subversion repository you should, |
---|
27 | # at top-level, execute: |
---|
28 | # ./bootstrap |
---|
29 | |
---|
30 | AC_PREREQ(2.57) |
---|
31 | AC_INIT([[yat]],[0.4pre],[jari@thep.lu.se]) |
---|
32 | AC_CONFIG_SRCDIR([yat/utility/matrix.h]) |
---|
33 | AC_CONFIG_AUX_DIR([autotools]) |
---|
34 | AC_PREFIX_DEFAULT([/usr/local]) |
---|
35 | |
---|
36 | AM_CONFIG_HEADER([config.h]) |
---|
37 | AM_INIT_AUTOMAKE() |
---|
38 | |
---|
39 | # Checks for programs. |
---|
40 | AC_PROG_CXX |
---|
41 | AC_PROG_INSTALL |
---|
42 | AC_CHECK_PROG([DOXYGEN], [doxygen], [yes], [no]) |
---|
43 | AC_CHECK_PROG([DVIPDFM], [dvipdfm], [yes], [no]) |
---|
44 | AC_CHECK_PROG([LATEX], [latex], [yes], [no]) |
---|
45 | AC_CHECK_PROG([LATEX2HTML], [latex2html], [yes], [no]) |
---|
46 | |
---|
47 | # Checks for libraries. |
---|
48 | AC_CHECK_LIB(m,main) |
---|
49 | AC_SEARCH_LIBS(ATL_ctrsv,atlas,, |
---|
50 | AC_SEARCH_LIBS(cblas_sdsdot,gslcblas)) |
---|
51 | AC_CHECK_LIB(gsl,main) |
---|
52 | |
---|
53 | AM_PATH_GSL(1.6,,[AC_MSG_ERROR(could not find required version of GSL)]) |
---|
54 | |
---|
55 | # Set default programming language |
---|
56 | AC_LANG(C++) |
---|
57 | |
---|
58 | # Checks for header files. |
---|
59 | AC_CHECK_HEADERS([unistd.h]) |
---|
60 | |
---|
61 | # Checks for typedefs, structures, and compiler characteristics. |
---|
62 | AC_HEADER_STDBOOL |
---|
63 | AC_C_CONST |
---|
64 | AC_C_INLINE |
---|
65 | AC_TYPE_SIZE_T |
---|
66 | |
---|
67 | # Checks for library functions. |
---|
68 | AC_PROG_LIBTOOL |
---|
69 | AC_FUNC_ERROR_AT_LINE |
---|
70 | AC_HEADER_STDC |
---|
71 | AC_CHECK_FUNCS([pow sqrt]) |
---|
72 | |
---|
73 | CXXFLAGS="-Wall -pedantic" |
---|
74 | CPPFLAGS="-DHAVE_INLINE=1" |
---|
75 | AC_ARG_ENABLE(debug, |
---|
76 | [AS_HELP_STRING([--enable-debug],[turn on debug options and code])]) |
---|
77 | if test "${enable_debug}" = "yes" ; then |
---|
78 | CXXFLAGS="$CXXFLAGS -g -O" |
---|
79 | CPPFLAGS="$CPPFLAGS -DYAT_DEBUG=1" |
---|
80 | else |
---|
81 | CXXFLAGS="$CXXFLAGS -O3" |
---|
82 | CPPFLAGS="$CPPFLAGS -DNDEBUG -DGSL_RANGE_CHECK_OFF" |
---|
83 | fi |
---|
84 | |
---|
85 | # check for quiet_NaN support in OS |
---|
86 | # At compile time, but this may not work if quiet_NaN exists and returns |
---|
87 | # an incorrect value |
---|
88 | AC_MSG_CHECKING([for std::numeric_limits<>::quiet_NaN()]) |
---|
89 | AC_COMPILE_IFELSE( |
---|
90 | [AC_LANG_PROGRAM( |
---|
91 | [#include <limits> |
---|
92 | extern void f(double);], |
---|
93 | [f(std::numeric_limits<double>::quiet_NaN())])], |
---|
94 | [quiet_nan=yes], |
---|
95 | [quiet_nan=no]) |
---|
96 | AC_MSG_RESULT($quiet_nan) |
---|
97 | if test "${quiet_nan}" = "no" ; then |
---|
98 | AC_MSG_FAILURE([ |
---|
99 | Support for quiet NAN required. |
---|
100 | Yat will not work on this system!]) |
---|
101 | fi |
---|
102 | # At run-time, but this has the disadvantage that yat cannot be built |
---|
103 | # for cross-compilation |
---|
104 | AC_MSG_CHECKING([if std::numeric_limits<>::has_quiet_NaN is true]) |
---|
105 | AC_RUN_IFELSE( |
---|
106 | [AC_LANG_PROGRAM( |
---|
107 | [#include <limits>], |
---|
108 | [return !std::numeric_limits<double>::has_quiet_NaN])], |
---|
109 | [quiet_nan=yes], |
---|
110 | [quiet_nan=no]) |
---|
111 | AC_MSG_RESULT($quiet_nan) |
---|
112 | if test "${quiet_nan}" = "no" ; then |
---|
113 | AC_MSG_FAILURE([ |
---|
114 | Support for quiet NAN required. |
---|
115 | Yat will not work on this system!]) |
---|
116 | fi |
---|
117 | |
---|
118 | # yat specific settings |
---|
119 | YAT_LIB="libyat.la" |
---|
120 | YAT_LIB_LOCATION="yat" |
---|
121 | AC_SUBST(YAT_LIB) |
---|
122 | AC_SUBST(YAT_LIB_LOCATION) |
---|
123 | |
---|
124 | # Only warning about missing programs (needed for docs generation) |
---|
125 | # when in debug mode |
---|
126 | if (test "$enable_debug" == "yes"); then |
---|
127 | if (test "$DOXYGEN" != "yes") ; then |
---|
128 | AC_MSG_WARN([Doxygen was not found. Yat will compile and work |
---|
129 | without doxygen. However, in order to enable generation of |
---|
130 | documentation, please install doxygen available at |
---|
131 | http://www.doxygen.org/]) |
---|
132 | fi |
---|
133 | if (test "$LATEX" != "yes") ; then |
---|
134 | AC_MSG_WARN([latex was not found. Yat will compile and work |
---|
135 | without latex. However, supporting documentation on statistics |
---|
136 | used in yat cannot be generated without latex.]) |
---|
137 | fi |
---|
138 | if (test "$DVIPFDM" != "yes") ; then |
---|
139 | AC_MSG_WARN([dvipdfm was not found. Yat will compile and work |
---|
140 | without dvipdfm. However, pdf document on statistics used in yat |
---|
141 | cannot be generated without dvipdfm.]) |
---|
142 | fi |
---|
143 | if (test "$LATEX2HTML" != "yes") ; then |
---|
144 | AC_MSG_WARN([latex2html was not found. Yat will compile and work |
---|
145 | without Latex. However, html document on statistics used in yat |
---|
146 | cannot be generated without latex.]) |
---|
147 | fi |
---|
148 | fi |
---|
149 | |
---|
150 | AC_CONFIG_FILES([Makefile |
---|
151 | doc/Makefile |
---|
152 | test/Makefile |
---|
153 | test/data/Makefile |
---|
154 | yat/Makefile |
---|
155 | yat/classifier/Makefile |
---|
156 | yat/random/Makefile |
---|
157 | yat/regression/Makefile |
---|
158 | yat/statistics/Makefile |
---|
159 | yat/utility/Makefile]) |
---|
160 | |
---|
161 | AC_OUTPUT |
---|
162 | |
---|
163 | # Some more messages. |
---|
164 | AC_MSG_NOTICE([]) |
---|
165 | AC_MSG_NOTICE([ Ready to compile the yat library]) |
---|
166 | AC_MSG_NOTICE([ The following flags and libraries will be used:]) |
---|
167 | AC_MSG_NOTICE([ +++++++++++++++++++++++++++++++++++++++++++++++]) |
---|
168 | AC_MSG_NOTICE([ CPPFLAGS=\"$CPPFLAGS\"]) |
---|
169 | AC_MSG_NOTICE([ CXXFLAGS=\"$CXXFLAGS\"]) |
---|
170 | AC_MSG_NOTICE([ LIBS=\"$LIBS\"]) |
---|
171 | AC_MSG_NOTICE([ +++++++++++++++++++++++++++++++++++++++++++++++]) |
---|
172 | AC_MSG_NOTICE([]) |
---|
173 | AC_MSG_NOTICE([ Now type 'make ; make check'.]) |
---|