source: trunk/configure.ac @ 219

Last change on this file since 219 was 219, checked in by Jari Häkkinen, 17 years ago

Addresses #85. Problem resolved for dist packages but developers cannot run all tests.

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