source: tags/0.6.5/configure.ac @ 580

Last change on this file since 580 was 575, checked in by Peter Johansson, 14 years ago

updating copyright statements

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