1 | ## Process this file with autoconf to produce a configure script. |
---|
2 | ## |
---|
3 | ## $Id: configure.ac 491 2007-10-14 00:09:13Z peter $ |
---|
4 | ## |
---|
5 | ## If you grabbed the source from subversion you should, at top-level, |
---|
6 | ## execute: |
---|
7 | ## ./bootstrap |
---|
8 | |
---|
9 | # Copyright (C) 2005 Jari Häkkinen, Peter Johansson |
---|
10 | # Copyright (C) 2006 Jari Häkkinen |
---|
11 | # Copyright (C) 2007 Jari Häkkinen, Peter Johansson |
---|
12 | # |
---|
13 | # This file is part of svndigest, http://trac.thep.lu.se/trac/svndigest |
---|
14 | # |
---|
15 | # svndigest is free software; you can redistribute it and/or modify it |
---|
16 | # under the terms of the GNU General Public License as published by |
---|
17 | # the Free Software Foundation; either version 2 of the License, or |
---|
18 | # (at your option) any later version. |
---|
19 | # |
---|
20 | # svndigest is distributed in the hope that it will be useful, but |
---|
21 | # WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
22 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
---|
23 | # General Public License for more details. |
---|
24 | # |
---|
25 | # You should have received a copy of the GNU General Public License |
---|
26 | # along with this program; if not, write to the Free Software |
---|
27 | # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA |
---|
28 | # 02111-1307, USA. |
---|
29 | |
---|
30 | AC_PREREQ(2.57) |
---|
31 | AC_INIT([svndigest],[pre0.6.5],[jari@thep.lu.se]) |
---|
32 | AC_CONFIG_SRCDIR([lib/File.h]) |
---|
33 | AC_CONFIG_AUX_DIR([autotools]) |
---|
34 | AC_PREFIX_DEFAULT([/usr/local]) |
---|
35 | test $prefix = NONE && prefix=/usr/local |
---|
36 | |
---|
37 | AM_CONFIG_HEADER([config.h]) |
---|
38 | AM_INIT_AUTOMAKE([std-options check-news]) |
---|
39 | |
---|
40 | # Checks for programs. |
---|
41 | AC_PROG_CPP |
---|
42 | AC_PROG_CXX |
---|
43 | AC_PROG_INSTALL |
---|
44 | AC_PROG_LIBTOOL |
---|
45 | AC_PROG_RANLIB |
---|
46 | AC_CHECK_PROG([GNUPLOT],[gnuplot],[ok]) |
---|
47 | |
---|
48 | # -Wno-long-long is needed to suppress compiler diagnostics regarding |
---|
49 | # using extension beyond the C++ standard (usage of non C++ standard |
---|
50 | # 'long long' types). |
---|
51 | CXXFLAGS="-Wall -pedantic -Wno-long-long" |
---|
52 | |
---|
53 | AC_ARG_ENABLE(debug, |
---|
54 | [AS_HELP_STRING([--enable-debug],[turn on debug options and code])], |
---|
55 | [CXXFLAGS="$CXXFLAGS -g -O"], |
---|
56 | [CPPFLAGS="$CPPFLAGS -DNDEBUG" CXXFLAGS="$CXXFLAGS -O3"]) |
---|
57 | |
---|
58 | AC_ARG_ENABLE(wctests, |
---|
59 | [AS_HELP_STRING([--enable-wctests],[turn on all tests, tests |
---|
60 | requiring a subversion WC are disabled by default])], [wctests=true]) |
---|
61 | AM_CONDITIONAL(WCTESTS, test x$wctests = xtrue) |
---|
62 | |
---|
63 | # optionally prepare for building static libraries. |
---|
64 | AC_ARG_ENABLE(staticbin, |
---|
65 | [AS_HELP_STRING([--enable-staticbin], [create a static binary, |
---|
66 | at least as static as the available underlying libraries |
---|
67 | allows])]) |
---|
68 | if test "$enable_staticbin" = "yes"; then |
---|
69 | case $host in |
---|
70 | *-apple-darwin*) |
---|
71 | # At the time of creating this libsvn_subr uses |
---|
72 | # Keychain on Mac OSX. In consequence the below |
---|
73 | # frameworks are needed for succesful static builds. |
---|
74 | LIBS="$LIBS -framework Security" |
---|
75 | LIBS="$LIBS -framework CoreFoundation" |
---|
76 | LIBS="$LIBS -framework CoreServices" |
---|
77 | ;; |
---|
78 | esac |
---|
79 | STATICFLAG=-static |
---|
80 | AC_SUBST(STATICFLAG) |
---|
81 | fi |
---|
82 | |
---|
83 | # Apache Portable Runtime (APR) API checks |
---|
84 | # The next three lines are not needed as long as APR_FIND_APR is used. |
---|
85 | # AC_ARG_WITH(apr, |
---|
86 | # [ --with-apr=DIR prefix for installed APR or path to APR build |
---|
87 | # tree [[PREFIX]]]) |
---|
88 | # Include APR_FIND_APR macro distributed within the APR project. If |
---|
89 | # the usage of the APR macro is to be omitted then the construct for |
---|
90 | # setting the CXXFLAGS (header file location) and LDFLAGS (linking |
---|
91 | # informaion) for APR must be changed. The latter can be achieved with |
---|
92 | # AC_SEARCH_LIBS([apr_allocator_create],[apr-0],,apr_found="no") but |
---|
93 | # apr-0 must be prior knowledge. |
---|
94 | sinclude(./build_support/find_apr.m4) |
---|
95 | APR_FIND_APR(,,1) |
---|
96 | if test "$apr_found" = "yes" ; then |
---|
97 | LDFLAGS="`$apr_config --link-ld` $LDFLAGS" |
---|
98 | CPPFLAGS="`$apr_config --includes` $CPPFLAGS" |
---|
99 | AC_CHECK_HEADER([apr_allocator.h],,apr_found="no") |
---|
100 | fi |
---|
101 | |
---|
102 | # Subversion API checks |
---|
103 | svn_found="yes" |
---|
104 | AC_ARG_WITH(svn, |
---|
105 | [AS_HELP_STRING([--with-svn=DIR],[prefix for svn developer files [[PREFIX]]])], |
---|
106 | [ LDFLAGS="-L$withval/lib $LDFLAGS" CPPFLAGS="-I$withval/include $CPPFLAGS"]) |
---|
107 | AC_CHECK_HEADER([subversion-1/svn_types.h],,svn_found="no") |
---|
108 | # The library checks below may match shared libs even when |
---|
109 | # --enable-staticbin is given to configure. This should probably not |
---|
110 | # pose any problems since in a properly installed system the shared |
---|
111 | # and static libraries should be the same. |
---|
112 | AC_SEARCH_LIBS([svn_cmdline_setup_auth_baton],[svn_subr-1],,svn_found="no") |
---|
113 | AC_SEARCH_LIBS([svn_ra_initialize],[svn_ra-1],,svn_found="no") |
---|
114 | AC_SEARCH_LIBS([svn_wc_adm_open3],[svn_wc-1],,svn_found="no") |
---|
115 | AC_SEARCH_LIBS([svn_diff_file_options_create],[svn_diff-1],,svn_found="no") |
---|
116 | AC_SEARCH_LIBS([svn_client_log3],[svn_client-1],,svn_found="no") |
---|
117 | |
---|
118 | AC_CONFIG_FILES([Makefile |
---|
119 | bin/Makefile |
---|
120 | lib/Makefile |
---|
121 | test/Makefile]) |
---|
122 | |
---|
123 | # Print failure status information about selected items, and exit if |
---|
124 | # fatal errors were encountered. No output will be created if |
---|
125 | # configure is halted prematurely. |
---|
126 | |
---|
127 | # used to trigger exit before creation of output |
---|
128 | all_reqs_ok="true" |
---|
129 | |
---|
130 | # Non-existing APR is fatal -- sub-sequent compilation will fail. |
---|
131 | if (test "$apr_found" = "no") ; then |
---|
132 | AC_MSG_WARN([APR not found. The Apache Portable Runtime |
---|
133 | (APR) library cannot be found. Please make sure APR is installed |
---|
134 | and supply the appropriate --with-apr option to 'configure'.]) |
---|
135 | all_reqs_ok="false" |
---|
136 | fi |
---|
137 | |
---|
138 | # Non-existing subversion API is fatal -- sub-sequent compilation will fail. |
---|
139 | if (test "$svn_found" = "no") ; then |
---|
140 | svn_msg="Subversion API not found. Subversion API libraries cannot |
---|
141 | be found. Make sure the APIs are installed and supply the |
---|
142 | appropriate --with-svn option to 'configure'." |
---|
143 | if (test "$apr_found" = "no") ; then |
---|
144 | svn_msg="$svn_msg |
---|
145 | Note, APR was not found. Failure to locate APR affects the |
---|
146 | location of the subversion API. Please fix the APR problem before |
---|
147 | trying to resolve the subversion related issues." |
---|
148 | fi |
---|
149 | AC_MSG_WARN([$svn_msg]) |
---|
150 | all_reqs_ok="false" |
---|
151 | fi |
---|
152 | |
---|
153 | if (test "$all_reqs_ok" = "false") ; then |
---|
154 | AC_MSG_ERROR([Some pre-requisites were not fulfilled, aborting |
---|
155 | configure. Please consult the 'README' file for more information |
---|
156 | about what is needed to compile svndigest and refer to above |
---|
157 | warning messages. Needed files were NOT created.]) |
---|
158 | fi |
---|
159 | |
---|
160 | # Create output. |
---|
161 | AC_OUTPUT |
---|
162 | |
---|
163 | # Some more messages. |
---|
164 | AC_MSG_NOTICE([]) |
---|
165 | AC_MSG_NOTICE([ Ready to compile the executables of svndiget]) |
---|
166 | AC_MSG_NOTICE([ The following flags and libs will be used:]) |
---|
167 | AC_MSG_NOTICE([ +++++++++++++++++++++++++++++++++++++++++++++++]) |
---|
168 | AC_MSG_NOTICE([ Preprocessor flags: CPPFLAGS=\"$CPPFLAGS\"]) |
---|
169 | AC_MSG_NOTICE([ C++ flags: CXXFLAGS=\"$CXXFLAGS\"]) |
---|
170 | AC_MSG_NOTICE([ Linker flags: LDFLAGS=\"$LDFLAGS\"]) |
---|
171 | AC_MSG_NOTICE([ LIBS: LIBS=\"$LIBS\"]) |
---|
172 | AC_MSG_NOTICE([ +++++++++++++++++++++++++++++++++++++++++++++++]) |
---|
173 | AC_MSG_NOTICE([]) |
---|
174 | |
---|
175 | if (test "$wctests") ; then |
---|
176 | AC_MSG_NOTICE([WC dependent tests are enabled]) |
---|
177 | else |
---|
178 | AC_MSG_NOTICE([WC dependent tests are disabled ... okay for most users]) |
---|
179 | AC_MSG_NOTICE([Developers, use --enable-wctests to enable WC tests]) |
---|
180 | fi |
---|
181 | AC_MSG_NOTICE([]) |
---|
182 | |
---|
183 | # Failure to locate gnuplot is not considered fatal |
---|
184 | if (test "$GNUPLOT" != "ok") ; then |
---|
185 | AC_MSG_WARN([Gnuplot was not found. svndigest will compile |
---|
186 | without gnuplot but will throw an exception at run-time. Please |
---|
187 | install gnuplot (available for a wide range of operating systems |
---|
188 | at http://www.gnuplot.info).]) |
---|
189 | AC_MSG_NOTICE([]) |
---|
190 | fi |
---|
191 | |
---|
192 | if test "$enable_staticbin" = "yes"; then |
---|
193 | AC_MSG_NOTICE([A statically linked 'svndigest' binary will be created.]) |
---|
194 | else |
---|
195 | AC_MSG_NOTICE([A dynamically linked 'svndigest' binary will be created.]) |
---|
196 | fi |
---|
197 | AC_MSG_NOTICE([]) |
---|
198 | |
---|
199 | AC_MSG_NOTICE([Now type 'make ; make check'.]) |
---|