source: tags/0.6.6/configure.ac @ 1138

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

Preparing Release 0.6.6

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