source: branches/0.6-stable/configure.ac @ 574

Last change on this file since 574 was 574, checked in by Peter Johansson, 13 years ago

Preparing release 0.6.5

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 7.3 KB
Line 
1## Process this file with autoconf to produce a configure script.
2##
3## $Id: configure.ac 574 2008-03-18 13:21:23Z 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
30AC_PREREQ(2.57)
31AC_INIT([svndigest],[0.6.5],[jari@thep.lu.se])
32AC_CONFIG_SRCDIR([lib/File.h])
33AC_CONFIG_AUX_DIR([autotools])
34AC_PREFIX_DEFAULT([/usr/local])
35test $prefix = NONE && prefix=/usr/local
36
37AM_CONFIG_HEADER([config.h])
38AM_INIT_AUTOMAKE([std-options check-news])
39
40# Checks for programs.
41AC_PROG_CPP
42AC_PROG_CXX
43AC_PROG_INSTALL
44AC_PROG_LIBTOOL
45AC_PROG_RANLIB
46AC_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).
51CXXFLAGS="-Wall -pedantic -Wno-long-long"
52
53AC_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
58AC_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])
61AM_CONDITIONAL(WCTESTS, test x$wctests = xtrue)
62
63# optionally prepare for building static libraries.
64AC_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])])
68if 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)
81fi
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.
94sinclude(./build_support/find_apr.m4)
95APR_FIND_APR(,,1)
96if 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")
100fi
101
102# Subversion API checks
103svn_found="yes"
104AC_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"])
107AC_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.
112AC_SEARCH_LIBS([svn_cmdline_setup_auth_baton],[svn_subr-1],,svn_found="no")
113AC_SEARCH_LIBS([svn_ra_initialize],[svn_ra-1],,svn_found="no")
114AC_SEARCH_LIBS([svn_wc_adm_open3],[svn_wc-1],,svn_found="no")
115AC_SEARCH_LIBS([svn_diff_file_options_create],[svn_diff-1],,svn_found="no")
116AC_SEARCH_LIBS([svn_client_log3],[svn_client-1],,svn_found="no")
117
118AC_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
128all_reqs_ok="true"
129
130# Non-existing APR is fatal -- sub-sequent compilation will fail.
131if (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"
136fi
137
138# Non-existing subversion API is fatal -- sub-sequent compilation will fail.
139if (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'."
143if (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."
148fi
149    AC_MSG_WARN([$svn_msg])
150    all_reqs_ok="false"
151fi
152
153if (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.])
158fi
159
160# Create output.
161AC_OUTPUT
162
163# Some more messages.
164AC_MSG_NOTICE([])
165AC_MSG_NOTICE([   Ready to compile the executables of svndiget])
166AC_MSG_NOTICE([   The following flags and libs will be used:])
167AC_MSG_NOTICE([   +++++++++++++++++++++++++++++++++++++++++++++++])
168AC_MSG_NOTICE([    Preprocessor flags: CPPFLAGS=\"$CPPFLAGS\"])
169AC_MSG_NOTICE([    C++ flags:          CXXFLAGS=\"$CXXFLAGS\"])
170AC_MSG_NOTICE([    Linker flags:       LDFLAGS=\"$LDFLAGS\"])
171AC_MSG_NOTICE([    LIBS:               LIBS=\"$LIBS\"])
172AC_MSG_NOTICE([   +++++++++++++++++++++++++++++++++++++++++++++++])
173AC_MSG_NOTICE([])
174
175if (test "$wctests") ; then
176    AC_MSG_NOTICE([WC dependent tests are enabled])
177else
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])
180fi
181AC_MSG_NOTICE([])
182
183# Failure to locate gnuplot is not considered fatal
184if (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([])
190fi
191
192if test "$enable_staticbin" = "yes"; then
193    AC_MSG_NOTICE([A statically linked 'svndigest' binary will be created.])
194else
195    AC_MSG_NOTICE([A dynamically linked 'svndigest' binary will be created.])
196fi
197    AC_MSG_NOTICE([])
198
199AC_MSG_NOTICE([Now type 'make ; make check'.])
Note: See TracBrowser for help on using the repository browser.