1 | ## Process this file with autoconf to produce a configure script. |
---|
2 | ## |
---|
3 | ## $Id: configure.ac 164 2006-08-23 22:51:01Z 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) API checks |
---|
59 | AC_ARG_WITH(apr, |
---|
60 | [ --with-apr=DIR prefix for installed APR or path to APR build |
---|
61 | tree [[PREFIX]]]) |
---|
62 | # Include APR_FIND_APR macro distributed within the APR project. If |
---|
63 | # the usage of the APR macro is to be omitted then the construct for |
---|
64 | # setting the CXXFLAGS (header file location) and LDFLAGS (linking |
---|
65 | # informaion) for APR must be changed. The latter can be achieved with |
---|
66 | # AC_SEARCH_LIBS([apr_allocator_create],[apr-0],,apr_found="no") but |
---|
67 | # apr-0 must be prior knowledge. |
---|
68 | sinclude(./build_support/find_apr.m4) |
---|
69 | APR_FIND_APR(,,1) |
---|
70 | if test "$apr_found" = "yes" ; then |
---|
71 | LDFLAGS="$LDFLAGS `$apr_config --link-ld`" |
---|
72 | CPPFLAGS="$CPPFLAGS `$apr_config --includes`" |
---|
73 | AC_CHECK_HEADER([apr_allocator.h],,apr_found="no") |
---|
74 | fi |
---|
75 | |
---|
76 | # Subversion API checks |
---|
77 | svn_found="yes" |
---|
78 | AC_ARG_WITH(svn, |
---|
79 | [ --with-svn=DIR prefix for svn developer files [[PREFIX]]], |
---|
80 | [ LDFLAGS="$LDFLAGS -L$withval/lib" CPPFLAGS="$CPPFLAGS -I$withval/include"]) |
---|
81 | AC_CHECK_HEADER([subversion-1/svn_types.h],,svn_found="no") |
---|
82 | AC_SEARCH_LIBS([svn_cmdline_setup_auth_baton],[svn_subr-1],,svn_found="no") |
---|
83 | AC_SEARCH_LIBS([svn_ra_initialize],[svn_ra-1],,svn_found="no") |
---|
84 | AC_SEARCH_LIBS([svn_wc_adm_open3],[svn_wc-1],,svn_found="no") |
---|
85 | AC_SEARCH_LIBS([svn_diff_file_options_create],[svn_diff-1],,svn_found="no") |
---|
86 | AC_SEARCH_LIBS([svn_client_log3],[svn_client-1],,svn_found="no") |
---|
87 | |
---|
88 | AC_CONFIG_FILES([Makefile |
---|
89 | bin/Makefile |
---|
90 | lib/Makefile |
---|
91 | test/Makefile]) |
---|
92 | |
---|
93 | # Print failure status information about selected items, and exit if |
---|
94 | # fatal errors were encountered. No output will be created if |
---|
95 | # configure is halted prematurely. |
---|
96 | |
---|
97 | # used to trigger exit before creation of output |
---|
98 | all_reqs_ok="true" |
---|
99 | |
---|
100 | # Non-existing APR is fatal -- sub-sequent compilation will fail. |
---|
101 | if (test "$apr_found" = "no") ; then |
---|
102 | AC_MSG_WARN([APR not found. The Apache Portable Runtime |
---|
103 | (APR) library cannot be found. Please make sure APR is installed |
---|
104 | and supply the appropriate --with-apr option to 'configure'.]) |
---|
105 | all_reqs_ok="false" |
---|
106 | fi |
---|
107 | |
---|
108 | # Non-existing subversion API is fatal -- sub-sequent compilation will fail. |
---|
109 | if (test "$svn_found" = "no") ; then |
---|
110 | AC_MSG_WARN([Subversion API not found. Subversion API libraries |
---|
111 | cannot be found. Make sure the APIs are installed and supply the |
---|
112 | appropriate --with-svn option to 'configure'.]) |
---|
113 | all_reqs_ok="false" |
---|
114 | fi |
---|
115 | |
---|
116 | if (test "$all_reqs_ok" = "false") ; then |
---|
117 | AC_MSG_ERROR([Some pre-requisites were not fulfilled, aborting |
---|
118 | configure. Please consult the 'README' file for more information |
---|
119 | about what is needed to compile svndigest and refer to above |
---|
120 | warning messages. Needed output files were NOT created.]) |
---|
121 | fi |
---|
122 | |
---|
123 | # Create output. |
---|
124 | AC_OUTPUT |
---|
125 | |
---|
126 | # Some more messages. |
---|
127 | AC_MSG_NOTICE([]) |
---|
128 | AC_MSG_NOTICE([ Ready to compile the executables of svndiget]) |
---|
129 | AC_MSG_NOTICE([ The following compilers and flags will be used:]) |
---|
130 | AC_MSG_NOTICE([ +++++++++++++++++++++++++++++++++++++++++++++++]) |
---|
131 | AC_MSG_NOTICE([ Preprocessor flags: CPPFLAGS=\"$CPPFLAGS\"]) |
---|
132 | AC_MSG_NOTICE([ C++ flags: CXXFLAGS=\"$CXXFLAGS\"]) |
---|
133 | AC_MSG_NOTICE([ Linker flags: LDFLAGS=\"$LDFLAGS\"]) |
---|
134 | AC_MSG_NOTICE([ LIBS: LIBS=\"$LIBS\"]) |
---|
135 | AC_MSG_NOTICE([ +++++++++++++++++++++++++++++++++++++++++++++++]) |
---|
136 | AC_MSG_NOTICE([]) |
---|
137 | |
---|
138 | # Failure to locate gnuplot is not considered fatal |
---|
139 | if (test "$GNUPLOT" != "ok") ; then |
---|
140 | AC_MSG_WARN([Gnuplot was not found. svndigest will compile |
---|
141 | without gnuplot but will throw an exception at runtime. Please |
---|
142 | install gnuplot (available for a wide range of operating systems |
---|
143 | at http://www.gnuplot.info).]) |
---|
144 | AC_MSG_NOTICE([]) |
---|
145 | fi |
---|
146 | |
---|
147 | AC_MSG_NOTICE([Now type 'make ; make check'.]) |
---|