source: trunk/configure.ac @ 941

Last change on this file since 941 was 941, checked in by Peter, 14 years ago

shaping up configure.ac. Replaced AC_CHECK_LIB with AC_SEARCH_LIBS when possible. AC_SEARCH_LIBS does not work checking for main. Removed several variables such as MATH_LIB that is not used. Default behavior of ac macros make sense in most cases.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 4.0 KB
Line 
1## Process this file with autoconf to produce a configure script.
2##
3## $Id: configure.ac 941 2007-10-07 18:49:16Z 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
30AC_PREREQ(2.57)
31AC_INIT([[yat]],[0.4pre],[jari@thep.lu.se])
32AC_CONFIG_SRCDIR([yat/utility/matrix.h])
33AC_CONFIG_AUX_DIR([autotools])
34AC_PREFIX_DEFAULT([/usr/local])
35
36AM_CONFIG_HEADER([config.h])
37AM_INIT_AUTOMAKE($PACKAGE_NAME,$PACKAGE_VERSION,$PACKAGE_BUGREPORT)
38
39# Checks for programs.
40AC_PROG_CXX
41AC_PROG_INSTALL
42
43# Checks for libraries.
44AC_CHECK_LIB(m,main)
45AC_SEARCH_LIBS(ATL_ctrsv,atlas,,
46  AC_SEARCH_LIBS(cblas_sdsdot,gslcblas))
47AC_CHECK_LIB(gsl,main)
48
49# Set default programming language
50AC_LANG(C++)
51
52# Checks for header files.
53AC_CHECK_HEADERS([unistd.h])
54
55# Checks for typedefs, structures, and compiler characteristics.
56AC_HEADER_STDBOOL
57AC_C_CONST
58AC_C_INLINE
59AC_TYPE_SIZE_T
60
61# Checks for library functions.
62AC_PROG_LIBTOOL
63AC_FUNC_ERROR_AT_LINE
64AC_HEADER_STDC
65AC_CHECK_FUNCS([pow sqrt])
66
67CXXFLAGS="-Wall -pedantic"
68CPPFLAGS="-DHAVE_INLINE=1"
69AC_ARG_ENABLE(debug,
70  [AS_HELP_STRING([--enable-debug],[turn on debug options and code])])
71if test "${enable_debug}" = "yes" ; then
72  CXXFLAGS="$CXXFLAGS -g -O"
73  CPPFLAGS="$CPPFLAGS -DYAT_DEBUG=1"
74else
75  CXXFLAGS="$CXXFLAGS -O3"
76  CPPFLAGS="$CPPFLAGS -DNDEBUG -DGSL_RANGE_CHECK_OFF"
77fi
78
79# check for quiet_NaN support in OS
80# At compile time, but this may not work if quiet_NaN exists and returns
81# an incorrect value
82AC_MSG_CHECKING([for std::numeric_limits<>::quiet_NaN()])
83AC_COMPILE_IFELSE(
84  [AC_LANG_PROGRAM(
85    [#include <limits>
86     extern void f(double);],
87    [f(std::numeric_limits<double>::quiet_NaN())])],
88  [quiet_nan=yes],
89  [quiet_nan=no])
90AC_MSG_RESULT($quiet_nan)
91if test "${quiet_nan}" = "no" ; then
92  AC_MSG_FAILURE([
93    Support for quiet NAN required.
94    Yat will not work on this system!])
95fi
96# At run-time, but this has the disadvantage that yat cannot be built 
97# for cross-compilation
98AC_MSG_CHECKING([if std::numeric_limits<>::has_quiet_NaN is true])
99AC_RUN_IFELSE(
100  [AC_LANG_PROGRAM(
101    [#include <limits>],
102    [return !std::numeric_limits<double>::has_quiet_NaN])],
103  [quiet_nan=yes],
104  [quiet_nan=no])
105AC_MSG_RESULT($quiet_nan)
106if test "${quiet_nan}" = "no" ; then
107  AC_MSG_FAILURE([
108    Support for quiet NAN required.
109    Yat will not work on this system!])
110fi
111
112# yat specific settings
113YAT_LIB="libyat.la"
114YAT_LIB_LOCATION="yat"
115AC_SUBST(YAT_LIB)
116AC_SUBST(YAT_LIB_LOCATION)
117
118AC_CONFIG_FILES([Makefile
119     doc/Makefile
120     test/Makefile
121     test/data/Makefile
122     yat/Makefile
123     yat/classifier/Makefile
124     yat/random/Makefile
125     yat/regression/Makefile
126     yat/statistics/Makefile
127     yat/utility/Makefile])
128
129AC_OUTPUT
130
131# Some more messages.
132AC_MSG_NOTICE([])
133AC_MSG_NOTICE([ Ready to compile the yat library])
134AC_MSG_NOTICE([ The following compilers and flags will be used:])
135AC_MSG_NOTICE([ +++++++++++++++++++++++++++++++++++++++++++++++])
136AC_MSG_NOTICE([  CPPFLAGS=\"$CPPFLAGS\"])
137AC_MSG_NOTICE([  CXXFLAGS=\"$CXXFLAGS\"])
138AC_MSG_NOTICE([  LIBS=\"$LIBS\"])
139AC_MSG_NOTICE([ +++++++++++++++++++++++++++++++++++++++++++++++])
140AC_MSG_NOTICE([])
141AC_MSG_NOTICE([ Now type 'make ; make check'.])
Note: See TracBrowser for help on using the repository browser.