1 | ## Process this file with autoconf to produce a configure script. |
---|
2 | ## |
---|
3 | ## $Id: configure.ac 162 2006-08-19 23:01:59Z jari $ |
---|
4 | ## |
---|
5 | ## If you grabbed the source from subversion you should, at top-level, |
---|
6 | ## execute: |
---|
7 | ## ./bootstrap |
---|
8 | |
---|
9 | # Copyright (C) 2005, 2006 Jari Häkkinen, Peter Johansson |
---|
10 | # |
---|
11 | # This file is part of svndigest, http://lev.thep.lu.se/trac/svndigest |
---|
12 | # |
---|
13 | # svndigest is free software; you can redistribute it and/or modify it |
---|
14 | # under the terms of the GNU General Public License as published by |
---|
15 | # the Free Software Foundation; either version 2 of the License, or |
---|
16 | # (at your option) any later version. |
---|
17 | # |
---|
18 | # svndigest is distributed in the hope that it will be useful, but |
---|
19 | # WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
20 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
---|
21 | # General Public License for more details. |
---|
22 | # |
---|
23 | # You should have received a copy of the GNU General Public License |
---|
24 | # along with this program; if not, write to the Free Software |
---|
25 | # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA |
---|
26 | # 02111-1307, USA. |
---|
27 | |
---|
28 | AC_PREREQ(2.57) |
---|
29 | AC_INIT([[svndigest]],[pre0.5],[jari@thep.lu.se]) |
---|
30 | AC_CONFIG_SRCDIR([lib/File.h]) |
---|
31 | AC_CONFIG_AUX_DIR([autotools]) |
---|
32 | AC_PREFIX_DEFAULT([/usr/local]) |
---|
33 | test $prefix = NONE && prefix=/usr/local |
---|
34 | |
---|
35 | AM_CONFIG_HEADER([config.h]) |
---|
36 | AM_INIT_AUTOMAKE($PACKAGE_NAME,$PACKAGE_VERSION,$PACKAGE_BUGREPORT) |
---|
37 | |
---|
38 | # Checks for programs. |
---|
39 | AC_PROG_CPP |
---|
40 | AC_PROG_CXX |
---|
41 | AC_PROG_INSTALL |
---|
42 | AC_PROG_RANLIB |
---|
43 | AC_CHECK_PROG([GNUPLOT],[gnuplot],[ok]) |
---|
44 | |
---|
45 | # -Wno-long-long is needed to suppress compiler diagnostics regarding |
---|
46 | # using extension beyond the C++ standard (usage of non C++ standard |
---|
47 | # 'long long' types). |
---|
48 | CXXFLAGS="-Wall -pedantic -Wno-long-long" |
---|
49 | |
---|
50 | AC_ARG_ENABLE(debug,[ --enable-debug turn on debug options and code]) |
---|
51 | if test "${enable_debug}" = "yes" ; then |
---|
52 | CXXFLAGS="$CXXFLAGS -g -O" |
---|
53 | else |
---|
54 | CPPFLAGS="$CPPFLAGS -DNDEBUG" |
---|
55 | CXXFLAGS="$CXXFLAGS -O3" |
---|
56 | fi |
---|
57 | |
---|
58 | # Apache Portable Runtime (APR) checks |
---|
59 | AC_ARG_WITH(apr, |
---|
60 | [ --with-apr=DIR prefix for installed APR or path to APR build |
---|
61 | tree [[PREFIX]]], |
---|
62 | [ APR_PATH=$withval ], |
---|
63 | [ APR_PATH=$prefix ]) |
---|
64 | AC_SUBST(APR_PATH) |
---|
65 | # Include macros distributed within the APR project |
---|
66 | sinclude(./build_support/find_apr.m4) |
---|
67 | APR_FIND_APR(,,1) |
---|
68 | |
---|
69 | AC_ARG_WITH(svn, |
---|
70 | [ --with-svn=DIR prefix for svn developer files [[PREFIX]]], |
---|
71 | [ SVN_PATH=$withval ], |
---|
72 | [ SVN_PATH=$prefix ]) |
---|
73 | AC_SUBST(SVN_PATH) |
---|
74 | |
---|
75 | AC_CONFIG_FILES([Makefile |
---|
76 | bin/Makefile |
---|
77 | lib/Makefile |
---|
78 | test/Makefile]) |
---|
79 | |
---|
80 | AC_OUTPUT |
---|
81 | |
---|
82 | echo "" |
---|
83 | echo " Ready to compile the executables of svndiget" |
---|
84 | echo " The following compilers and flags will be used:" |
---|
85 | echo " +++++++++++++++++++++++++++++++++++++++++++++++" |
---|
86 | echo " Preprocessor flags: CPPFLAGS=\"$CPPFLAGS\"" |
---|
87 | echo " C++ flags: CXXFLAGS=\"$CXXFLAGS\"" |
---|
88 | echo " Linker flags: LDFLAGS=\"$LDFLAGS\"" |
---|
89 | echo " +++++++++++++++++++++++++++++++++++++++++++++++" |
---|
90 | echo "" |
---|
91 | |
---|
92 | test "$GNUPLOT" = "ok" || \ |
---|
93 | AC_MSG_WARN([Gnuplot was not found. svndigest will compile |
---|
94 | without gnuplot but will throw an exception at runtime. Please |
---|
95 | install gnuplot (available for a wide range of operating systems |
---|
96 | at http://www.gnuplot.info).]) |
---|
97 | |
---|
98 | if test $apr_found = "no"; then |
---|
99 | AC_MSG_WARN([APR not found. The Apache Portable Runtime (APR) |
---|
100 | library cannot be found. Please supply the appropriate --with-apr |
---|
101 | option to 'configure'.]) |
---|
102 | fi |
---|
103 | |
---|
104 | echo "" |
---|
105 | echo "If no warnings appear above it is safe to type 'make ; make check'." |
---|
106 | echo "" |
---|