1 | # Process this file with autoconf to produce a configure script. |
---|
2 | # |
---|
3 | # $Id: configure.ac 1055 2009-05-06 22:43:30Z jari $ |
---|
4 | # |
---|
5 | # Copyright (C) 2005, 2006 Jari Häkkinen, Peter Johansson |
---|
6 | # Copyright (C) 2007 Peter Johansson |
---|
7 | # Copyright (C) 2008, 2009 Jari Häkkinen, Peter Johansson |
---|
8 | # |
---|
9 | # This file is part of the Normalizers plug-in package for BASE |
---|
10 | # (net.sf.based.normalizers). The package is available at |
---|
11 | # http://baseplugins.thep.lu.se/ BASE main site is |
---|
12 | # http://base.thep.lu.se/ |
---|
13 | # |
---|
14 | # This is free software; you can redistribute it and/or modify it |
---|
15 | # under the terms of the GNU General Public License as published by |
---|
16 | # the Free Software Foundation; either version 3 of the License, or |
---|
17 | # (at your option) any later version. |
---|
18 | # |
---|
19 | # The software is distributed in the hope that it will be useful, |
---|
20 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
21 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
---|
22 | # General Public License for more details. |
---|
23 | # |
---|
24 | # You should have received a copy of the GNU General Public License |
---|
25 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
---|
26 | # |
---|
27 | # If you grabbed the source from subversion you should, at top-level, |
---|
28 | # execute: |
---|
29 | # ./bootstrap |
---|
30 | # |
---|
31 | |
---|
32 | AC_INIT([qqn],[@PKGVERSION@],[jari.hakkinen@med.lu.se]) |
---|
33 | AC_PREREQ(2.61) |
---|
34 | AC_CONFIG_SRCDIR([bin/qQN.cc]) |
---|
35 | AC_CONFIG_AUX_DIR([autotools]) |
---|
36 | AC_PREFIX_DEFAULT([/usr/local]) |
---|
37 | AC_CONFIG_MACRO_DIR([m4]) |
---|
38 | |
---|
39 | AM_CONFIG_HEADER([config.h]) |
---|
40 | AM_INIT_AUTOMAKE([1.10 std-options]) |
---|
41 | |
---|
42 | # Set default programming language |
---|
43 | AC_LANG(C++) |
---|
44 | |
---|
45 | # Let user overide default CXXFLAGS |
---|
46 | if (test "${CXXFLAGS+set}" != set) ; then |
---|
47 | # Setting CXXFLAGS here to prevent expansion in AC_PROG_CXX |
---|
48 | CXXFLAGS="-Wall -pedantic -O3" |
---|
49 | fi |
---|
50 | |
---|
51 | # Checks for programs. |
---|
52 | AC_PROG_CXXCPP |
---|
53 | AC_PROG_CXX |
---|
54 | AC_PROG_INSTALL |
---|
55 | |
---|
56 | AC_ARG_ENABLE(libcheck, |
---|
57 | [AS_HELP_STRING([--enable-libcheck], |
---|
58 | [Check for dependency libs (default is yes)])], |
---|
59 | if (test "$enableval" = "no") ; then |
---|
60 | libcheck=no |
---|
61 | fi |
---|
62 | ) |
---|
63 | |
---|
64 | # checking for dependency libs may be disabled, normally used to |
---|
65 | # create a source distribuion on a machine wihtout required APIs like |
---|
66 | # yat. |
---|
67 | if (test "${libcheck}" = "no") ; then |
---|
68 | yat_found="not checked" |
---|
69 | else |
---|
70 | yat_found="no" |
---|
71 | yat_version="0.5.3" |
---|
72 | YAT_CHECK_YAT([${yat_version}],[yat_found="yes"]) |
---|
73 | if (test "${yat_found}" = "yes") ; then |
---|
74 | AM_CPPFLAGS="$YAT_CPPFLAGS $AM_CPPFLAGS" |
---|
75 | AM_CXXFLAGS="$YAT_CXXFLAGS $AM_CXXFLAGS" |
---|
76 | AM_LDFLAGS="$YAT_LDFLAGS $AM_LDFLAGS" |
---|
77 | LIBS="$YAT_LIBS $LIBS" |
---|
78 | fi |
---|
79 | AC_SUBST(AM_CPPFLAGS) |
---|
80 | AC_SUBST(AM_CXXFLAGS) |
---|
81 | AC_SUBST(AM_LDFLAGS) |
---|
82 | fi |
---|
83 | |
---|
84 | AC_CONFIG_FILES([Makefile |
---|
85 | bin/Makefile]) |
---|
86 | |
---|
87 | # Non-existing or too old yat is fatal -- sub-sequent compilation will fail. |
---|
88 | if (test "${yat_found}" = "no") ; then |
---|
89 | AC_CHECK_HEADER( |
---|
90 | [yat/utility/utility.h], |
---|
91 | AC_MSG_FAILURE([ |
---|
92 | yat found but not the required version. |
---|
93 | Please upgrade to yat version ${yat_version} or later]), |
---|
94 | AC_MSG_FAILURE([ |
---|
95 | yat not found. The yat library cannot be found. |
---|
96 | Please make sure yat is installed.]) |
---|
97 | ) |
---|
98 | fi |
---|
99 | |
---|
100 | AC_OUTPUT |
---|
101 | |
---|
102 | # Some more messages. |
---|
103 | AC_MSG_NOTICE([]) |
---|
104 | AC_MSG_NOTICE([Ready to build qQN]) |
---|
105 | AC_MSG_NOTICE([]) |
---|
106 | AC_MSG_NOTICE([qQN will be installed in]) |
---|
107 | AC_MSG_NOTICE([ $bindir ]) |
---|
108 | AC_MSG_NOTICE([]) |
---|
109 | AC_MSG_NOTICE([The following libs and flags will be used:]) |
---|
110 | AC_MSG_NOTICE([+++++++++++++++++++++++++++++++++++++++++++++++]) |
---|
111 | AC_MSG_NOTICE([ CPPFLAGS = $CPPFLAGS $AM_CPPFLAGS]) |
---|
112 | AC_MSG_NOTICE([ CXXFLAGS = $CXXFLAGS $AM_CXXFLAGS]) |
---|
113 | AC_MSG_NOTICE([ LDFLAGS = $LDFLAGS $AM_LDFLAGS]) |
---|
114 | AC_MSG_NOTICE([ LIBS = $LIBS]) |
---|
115 | AC_MSG_NOTICE([+++++++++++++++++++++++++++++++++++++++++++++++]) |
---|
116 | AC_MSG_NOTICE([]) |
---|
117 | AC_MSG_NOTICE([ Now type 'make && make install'.]) |
---|
118 | if (test "${libcheck}" = "no") ; then |
---|
119 | AC_MSG_NOTICE([]) |
---|
120 | AC_MSG_NOTICE([Checks for dependency libs disabled, make will probably fail.]) |
---|
121 | fi |
---|