1 | ## Process this file with autoconf to produce a configure script. |
---|
2 | ## |
---|
3 | ## $Id: configure.ac 383 2007-06-24 22:04:58Z 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.6],[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([std-options check-news]) |
---|
37 | |
---|
38 | # Checks for programs. |
---|
39 | AC_PROG_CPP |
---|
40 | AC_PROG_CXX |
---|
41 | AC_PROG_INSTALL |
---|
42 | AC_PROG_LIBTOOL |
---|
43 | AC_PROG_RANLIB |
---|
44 | AC_CHECK_PROG([GNUPLOT],[gnuplot],[ok]) |
---|
45 | |
---|
46 | # -Wno-long-long is needed to suppress compiler diagnostics regarding |
---|
47 | # using extension beyond the C++ standard (usage of non C++ standard |
---|
48 | # 'long long' types). |
---|
49 | CXXFLAGS="-Wall -pedantic -Wno-long-long" |
---|
50 | |
---|
51 | AC_ARG_ENABLE(debug, |
---|
52 | [AS_HELP_STRING([--enable-debug],[turn on debug options and code])], |
---|
53 | [CXXFLAGS="$CXXFLAGS -g -O"], |
---|
54 | [CPPFLAGS="$CPPFLAGS -DNDEBUG" CXXFLAGS="$CXXFLAGS -O3"]) |
---|
55 | |
---|
56 | AC_ARG_ENABLE(wctests, |
---|
57 | [AS_HELP_STRING([--enable-wctests],[turn on all tests, tests |
---|
58 | requiring a subversion WC are disabled by default])], [wctests=true]) |
---|
59 | AM_CONDITIONAL(WCTESTS, test x$wctests = xtrue) |
---|
60 | |
---|
61 | # optionally prepare for building static libraries. |
---|
62 | AC_ARG_ENABLE(staticbin, |
---|
63 | [AS_HELP_STRING([--enable-staticbin], [create a static binary, |
---|
64 | at least as static as the available underlying libraries |
---|
65 | allows])]) |
---|
66 | if test "$enable_staticbin" = "yes"; then |
---|
67 | case $host in |
---|
68 | *-apple-darwin*) |
---|
69 | # At the time of creating this libsvn_subr uses |
---|
70 | # Keychain on Mac OSX. In consequence the below |
---|
71 | # frameworks are needed for succesful static builds. |
---|
72 | LIBS="$LIBS -framework Security" |
---|
73 | LIBS="$LIBS -framework CoreFoundation" |
---|
74 | LIBS="$LIBS -framework CoreServices" |
---|
75 | ;; |
---|
76 | esac |
---|
77 | STATICFLAG=-static |
---|
78 | AC_SUBST(STATICFLAG) |
---|
79 | fi |
---|
80 | |
---|
81 | # Apache Portable Runtime (APR) API checks |
---|
82 | # The next three lines are not needed as long as APR_FIND_APR is used. |
---|
83 | # AC_ARG_WITH(apr, |
---|
84 | # [ --with-apr=DIR prefix for installed APR or path to APR build |
---|
85 | # tree [[PREFIX]]]) |
---|
86 | # Include APR_FIND_APR macro distributed within the APR project. If |
---|
87 | # the usage of the APR macro is to be omitted then the construct for |
---|
88 | # setting the CXXFLAGS (header file location) and LDFLAGS (linking |
---|
89 | # informaion) for APR must be changed. The latter can be achieved with |
---|
90 | # AC_SEARCH_LIBS([apr_allocator_create],[apr-0],,apr_found="no") but |
---|
91 | # apr-0 must be prior knowledge. |
---|
92 | sinclude(./build_support/find_apr.m4) |
---|
93 | APR_FIND_APR(,,1) |
---|
94 | if test "$apr_found" = "yes" ; then |
---|
95 | LDFLAGS="`$apr_config --link-ld` $LDFLAGS" |
---|
96 | CPPFLAGS="`$apr_config --includes` $CPPFLAGS" |
---|
97 | AC_CHECK_HEADER([apr_allocator.h],,apr_found="no") |
---|
98 | fi |
---|
99 | |
---|
100 | # Subversion API checks |
---|
101 | svn_found="yes" |
---|
102 | AC_ARG_WITH(svn, |
---|
103 | [AS_HELP_STRING([--with-svn=DIR],[prefix for svn developer files [[PREFIX]]])], |
---|
104 | [ LDFLAGS="-L$withval/lib $LDFLAGS" CPPFLAGS="-I$withval/include $CPPFLAGS"]) |
---|
105 | AC_CHECK_HEADER([subversion-1/svn_types.h],,svn_found="no") |
---|
106 | # The library checks below may match shared libs even when |
---|
107 | # --enable-staticbin is given to configure. This should probably not |
---|
108 | # pose any problems since in a properly installed system the shared |
---|
109 | # and static libraries should be the same. |
---|
110 | AC_SEARCH_LIBS([svn_cmdline_setup_auth_baton],[svn_subr-1],,svn_found="no") |
---|
111 | AC_SEARCH_LIBS([svn_ra_initialize],[svn_ra-1],,svn_found="no") |
---|
112 | AC_SEARCH_LIBS([svn_wc_adm_open3],[svn_wc-1],,svn_found="no") |
---|
113 | AC_SEARCH_LIBS([svn_diff_file_options_create],[svn_diff-1],,svn_found="no") |
---|
114 | AC_SEARCH_LIBS([svn_client_log3],[svn_client-1],,svn_found="no") |
---|
115 | |
---|
116 | AC_CONFIG_FILES([Makefile |
---|
117 | bin/Makefile |
---|
118 | lib/Makefile |
---|
119 | test/Makefile]) |
---|
120 | |
---|
121 | # Print failure status information about selected items, and exit if |
---|
122 | # fatal errors were encountered. No output will be created if |
---|
123 | # configure is halted prematurely. |
---|
124 | |
---|
125 | # used to trigger exit before creation of output |
---|
126 | all_reqs_ok="true" |
---|
127 | |
---|
128 | # Non-existing APR is fatal -- sub-sequent compilation will fail. |
---|
129 | if (test "$apr_found" = "no") ; then |
---|
130 | AC_MSG_WARN([APR not found. The Apache Portable Runtime |
---|
131 | (APR) library cannot be found. Please make sure APR is installed |
---|
132 | and supply the appropriate --with-apr option to 'configure'.]) |
---|
133 | all_reqs_ok="false" |
---|
134 | fi |
---|
135 | |
---|
136 | # Non-existing subversion API is fatal -- sub-sequent compilation will fail. |
---|
137 | if (test "$svn_found" = "no") ; then |
---|
138 | svn_msg="Subversion API not found. Subversion API libraries cannot |
---|
139 | be found. Make sure the APIs are installed and supply the |
---|
140 | appropriate --with-svn option to 'configure'." |
---|
141 | if (test "$apr_found" = "no") ; then |
---|
142 | svn_msg="$svn_msg |
---|
143 | Note, APR was not found. Failure to locate APR affects the |
---|
144 | location of the subversion API. Please fix the APR problem before |
---|
145 | trying to resolve the subversion related issues." |
---|
146 | fi |
---|
147 | AC_MSG_WARN([$svn_msg]) |
---|
148 | all_reqs_ok="false" |
---|
149 | fi |
---|
150 | |
---|
151 | if (test "$all_reqs_ok" = "false") ; then |
---|
152 | AC_MSG_ERROR([Some pre-requisites were not fulfilled, aborting |
---|
153 | configure. Please consult the 'README' file for more information |
---|
154 | about what is needed to compile svndigest and refer to above |
---|
155 | warning messages. Needed files were NOT created.]) |
---|
156 | fi |
---|
157 | |
---|
158 | # Create output. |
---|
159 | AC_OUTPUT |
---|
160 | |
---|
161 | # Some more messages. |
---|
162 | AC_MSG_NOTICE([]) |
---|
163 | AC_MSG_NOTICE([ Ready to compile the executables of svndiget]) |
---|
164 | AC_MSG_NOTICE([ The following flags and libs will be used:]) |
---|
165 | AC_MSG_NOTICE([ +++++++++++++++++++++++++++++++++++++++++++++++]) |
---|
166 | AC_MSG_NOTICE([ Preprocessor flags: CPPFLAGS=\"$CPPFLAGS\"]) |
---|
167 | AC_MSG_NOTICE([ C++ flags: CXXFLAGS=\"$CXXFLAGS\"]) |
---|
168 | AC_MSG_NOTICE([ Linker flags: LDFLAGS=\"$LDFLAGS\"]) |
---|
169 | AC_MSG_NOTICE([ LIBS: LIBS=\"$LIBS\"]) |
---|
170 | AC_MSG_NOTICE([ +++++++++++++++++++++++++++++++++++++++++++++++]) |
---|
171 | AC_MSG_NOTICE([]) |
---|
172 | |
---|
173 | if (test "$wctests") ; then |
---|
174 | AC_MSG_NOTICE([WC dependent tests are enabled]) |
---|
175 | else |
---|
176 | AC_MSG_NOTICE([WC dependent tests are disabled ... okay for most users]) |
---|
177 | AC_MSG_NOTICE([Developers, use --enable-wctests to enable WC tests]) |
---|
178 | fi |
---|
179 | AC_MSG_NOTICE([]) |
---|
180 | |
---|
181 | # Failure to locate gnuplot is not considered fatal |
---|
182 | if (test "$GNUPLOT" != "ok") ; then |
---|
183 | AC_MSG_WARN([Gnuplot was not found. svndigest will compile |
---|
184 | without gnuplot but will throw an exception at run-time. Please |
---|
185 | install gnuplot (available for a wide range of operating systems |
---|
186 | at http://www.gnuplot.info).]) |
---|
187 | AC_MSG_NOTICE([]) |
---|
188 | fi |
---|
189 | |
---|
190 | AC_MSG_NOTICE([Now type 'make ; make check'.]) |
---|