source: trunk/configure.ac @ 530

Last change on this file since 530 was 519, checked in by Jari Häkkinen, 14 years ago

trac moved to new location.

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