configure.ac

Code
Comments
Other
Rev Date Author Line
84 13 Mar 06 jari 1 ## Process this file with autoconf to produce a configure script.
84 13 Mar 06 jari 2 ##
84 13 Mar 06 jari 3 ## $Id$
84 13 Mar 06 jari 4 ##
84 13 Mar 06 jari 5 ## If you grabbed the source from subversion you should, at top-level,
84 13 Mar 06 jari 6 ## execute:
84 13 Mar 06 jari 7 ##          ./bootstrap
480 09 Oct 07 jari 8 ## To push subsequent changes of this file into the build scripts you
480 09 Oct 07 jari 9 ## must issue:
480 09 Oct 07 jari 10 ##          autoreconf
84 13 Mar 06 jari 11
978 12 Dec 09 peter 12 # Copyright (C) 2005 Jari Häkkinen, Peter Johansson
978 12 Dec 09 peter 13 # Copyright (C) 2006 Jari Häkkinen
1635 30 Mar 23 peter 14 # Copyright (C) 2007, 2008, 2009 Jari Häkkinen, Peter Johansson
1635 30 Mar 23 peter 15 # Copyright (C) 2010, 2011, 2012 Peter Johansson
1635 30 Mar 23 peter 16 # Copyright (C) 2015 Jari Häkkinen
1635 30 Mar 23 peter 17 # Copyright (C) 2023 Peter Johansson
2 20 Dec 05 jari 18 #
687 04 Aug 08 peter 19 # This file is part of svndigest, http://dev.thep.lu.se/svndigest
2 20 Dec 05 jari 20 #
149 12 Aug 06 jari 21 # svndigest is free software; you can redistribute it and/or modify it
84 13 Mar 06 jari 22 # under the terms of the GNU General Public License as published by
693 11 Sep 08 jari 23 # the Free Software Foundation; either version 3 of the License, or
84 13 Mar 06 jari 24 # (at your option) any later version.
2 20 Dec 05 jari 25 #
149 12 Aug 06 jari 26 # svndigest is distributed in the hope that it will be useful, but
84 13 Mar 06 jari 27 # WITHOUT ANY WARRANTY; without even the implied warranty of
149 12 Aug 06 jari 28 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
84 13 Mar 06 jari 29 # General Public License for more details.
2 20 Dec 05 jari 30 #
84 13 Mar 06 jari 31 # You should have received a copy of the GNU General Public License
693 11 Sep 08 jari 32 # along with svndigest. If not, see <http://www.gnu.org/licenses/>.
2 20 Dec 05 jari 33
907 29 Nov 09 peter 34 AC_PREREQ([2.63])
547 07 Jan 08 peter 35
775 09 Feb 09 peter 36 m4_include([m4/version.m4])
1475 22 Apr 12 peter 37 AC_INIT([svndigest], m4_defn([my_VERSION]),
1182 25 Aug 10 peter 38         [svndigest-users@lists.sourceforge.net],,
1652 14 Jun 23 peter 39         [https://dev.thep.lu.se/svndigest])
5 29 Dec 05 peter 40 AC_CONFIG_SRCDIR([lib/File.h])
2 20 Dec 05 jari 41 AC_CONFIG_AUX_DIR([autotools])
720 03 Dec 08 peter 42 dnl arg below should be the same as in Makefile.am
775 09 Feb 09 peter 43 AC_CONFIG_MACRO_DIR([m4])
2 20 Dec 05 jari 44 AC_PREFIX_DEFAULT([/usr/local])
2 20 Dec 05 jari 45
892 26 Nov 09 peter 46 dnl FIXME remove when we assume autoconf 2.64
1486 07 Aug 12 peter 47 m4_ifndef([AC_PACKAGE_URL],
1652 14 Jun 23 peter 48           [AC_DEFINE([PACKAGE_URL], ["https://dev.thep.lu.se/svndigest"],
907 29 Nov 09 peter 49                      [Define to home page for this package])
1652 14 Jun 23 peter 50            AC_SUBST([PACKAGE_URL], ["https://dev.thep.lu.se/svndigest"])])
892 26 Nov 09 peter 51
1475 22 Apr 12 peter 52 MY_VERSION
993 24 Dec 09 peter 53 AC_CONFIG_HEADERS([config.h])
1525 01 Oct 12 peter 54 AM_INIT_AUTOMAKE([1.11 color-tests std-options parallel-tests
1525 01 Oct 12 peter 55                   silent-rules subdir-objects])
2 20 Dec 05 jari 56
480 09 Oct 07 jari 57 # Set default programming language
880 24 Nov 09 peter 58 AC_LANG([C++])
480 09 Oct 07 jari 59
741 19 Dec 08 peter 60 # propagate selected configure variables to DISTCHECK_CONFIGURE_FLAGS
741 19 Dec 08 peter 61 for var in CPPFLAGS CXX CXXFLAGS CXXCPP LDFLAGS LIBS; do
741 19 Dec 08 peter 62   eval isset=\${$var+set}
741 19 Dec 08 peter 63   if test "$isset" = 'set' ; then
741 19 Dec 08 peter 64     eval val=$`echo $var`
741 19 Dec 08 peter 65     DISTCHECK_CONFIGURE_FLAGS="${DISTCHECK_CONFIGURE_FLAGS}'${var}=${val}' "
741 19 Dec 08 peter 66   fi
741 19 Dec 08 peter 67 done
1486 07 Aug 12 peter 68 AC_SUBST(DISTCHECK_CONFIGURE_FLAGS)
741 19 Dec 08 peter 69
1514 23 Sep 12 peter 70 # record if CXXFLAGS was set by user for further use below
1514 23 Sep 12 peter 71 AS_IF([test "${CXXFLAGS+set}" = set], [
1514 23 Sep 12 peter 72   CXXFLAGS_set_by_user=yes
1514 23 Sep 12 peter 73 ],[
1514 23 Sep 12 peter 74   CXXFLAGS_set_by_user=no
1514 23 Sep 12 peter 75   # set CXXFLAGS to avoid expansion in AC_PROG_CXX
1514 23 Sep 12 peter 76   CXXFLAGS=
1514 23 Sep 12 peter 77 ])
687 04 Aug 08 peter 78
2 20 Dec 05 jari 79 # Checks for programs.
566 07 Mar 08 peter 80 AC_PROG_CXXCPP
2 20 Dec 05 jari 81 AC_PROG_CXX
668 03 Jul 08 jari 82 AC_PROG_RANLIB
586 11 Apr 08 jari 83 AC_PROG_SED
1613 15 Feb 23 peter 84
1613 15 Feb 23 peter 85 AC_ARG_VAR([HELP2MAN], [help2man])
1613 15 Feb 23 peter 86 AC_CHECK_PROG([HELP2MAN], [help2man], [help2man], [false])
1613 15 Feb 23 peter 87
880 24 Nov 09 peter 88 # look for pkg-config
880 24 Nov 09 peter 89 PKG_PROG_PKG_CONFIG([0.23])
2 20 Dec 05 jari 90
640 31 May 08 peter 91 # Save FLAGS
887 25 Nov 09 peter 92 APR_SAVE_THE_ENVIRONMENT(CPPFLAGS)
887 25 Nov 09 peter 93 APR_SAVE_THE_ENVIRONMENT(CXXFLAGS)
640 31 May 08 peter 94
1652 14 Jun 23 peter 95 YAT_CXX11([yes], [], [AC_MSG_FAILURE([$CXX is not a C++11 compiler])])
769 31 Jan 09 peter 96 AC_TYPE_LONG_LONG_INT
782 19 Feb 09 peter 97 AS_IF([test x$ac_cv_type_long_long_int = xno],
782 19 Feb 09 peter 98       [AC_MSG_ERROR([compiler does not support long long int])]
782 19 Feb 09 peter 99      )
2 20 Dec 05 jari 100
782 19 Feb 09 peter 101 AC_ARG_ENABLE([debug],
1514 23 Sep 12 peter 102   [AS_HELP_STRING([--enable-debug],[turn on debug options and code])],
1514 23 Sep 12 peter 103   [], [enable_debug=no])
843 12 Nov 09 peter 104
1514 23 Sep 12 peter 105 # Set CXXFLAGS depending on whether CXXFLAGS was provided by user and
1514 23 Sep 12 peter 106 # whether we are in debug mode
1514 23 Sep 12 peter 107 AS_IF([test x$enable_debug = xyes], [
1514 23 Sep 12 peter 108   # in debug we alsways add flags below i.e. we turn on warnings,
1514 23 Sep 12 peter 109   # debug symbols, and low level of optimisation.
160 19 Aug 06 jari 110
1514 23 Sep 12 peter 111   # -Wno-long-long is needed to suppress compiler diagnostics regarding
1514 23 Sep 12 peter 112   # using extension beyond the C++ standard (usage of non C++ standard
1514 23 Sep 12 peter 113   # 'long long' types).
1652 14 Jun 23 peter 114   YAT_CXX_ADD_FLAG([CXXFLAGS],[-pedantic -Wall -g -O])
1514 23 Sep 12 peter 115 ],[
1514 23 Sep 12 peter 116   # in standard mode we set to CXXFLAGS default to '-O3', but only if
1514 23 Sep 12 peter 117   # CXXFLAGS was not proved by user. If user provided a VALUE FOR
1514 23 Sep 12 peter 118   # CXXFLAGS we listen to that and leave as is.
1514 23 Sep 12 peter 119   AS_IF([test x$CXXFLAGS_set_by_user != xyes], [
1514 23 Sep 12 peter 120     YAT_CXX_ADD_FLAG([CXXFLAGS],[-O3])
1514 23 Sep 12 peter 121   ])
1514 23 Sep 12 peter 122 ])
1514 23 Sep 12 peter 123
1514 23 Sep 12 peter 124 AC_ARG_ENABLE([assert],
1514 23 Sep 12 peter 125   [AS_HELP_STRING([--enable-assert], [turn on assertions])])
1514 23 Sep 12 peter 126
1514 23 Sep 12 peter 127 # if assert not enabled/disabled explicitly, default behaviour is to
1514 23 Sep 12 peter 128 # enable assert in debug mode and disable otherwise
1514 23 Sep 12 peter 129 test "${enable_assert+set}" = set || enable_assert=$enable_debug
1514 23 Sep 12 peter 130
1514 23 Sep 12 peter 131 # FIXME perhaps we should AC_DEFINE NDEBUG instead but then we need to
1514 23 Sep 12 peter 132 # include config.h in all source files.
1514 23 Sep 12 peter 133 #
1514 23 Sep 12 peter 134 # propagate enable_assert to CPPFLAGS
1514 23 Sep 12 peter 135 AS_IF([test x$enable_assert != xyes],[YAT_CPP_ADD_FLAG([CPPFLAGS],[-DNDEBUG])])
1514 23 Sep 12 peter 136
1192 02 Oct 10 peter 137 AC_MSG_CHECKING([g++ deprecation attribute])
1192 02 Oct 10 peter 138 AC_COMPILE_IFELSE(
1486 07 Aug 12 peter 139   [AC_LANG_PROGRAM([[void f() __attribute__ ((deprecated));]],)],
1486 07 Aug 12 peter 140   [AC_DEFINE([YAT_HAVE_GCC_DEPRECATED], [1],
1192 02 Oct 10 peter 141              [Define if compiler supports deprecated attribute, as in g++ 4.0])
1192 02 Oct 10 peter 142    AC_MSG_RESULT([yes])],
1192 02 Oct 10 peter 143   [AC_MSG_RESULT([no])] )
1192 02 Oct 10 peter 144
164 23 Aug 06 jari 145 # Apache Portable Runtime (APR) API checks
887 25 Nov 09 peter 146 APR_FIND_APR(,,[1],[1 0])
773 01 Feb 09 peter 147 AS_IF([test "${with_apr+set}" = set],
773 01 Feb 09 peter 148     [DISTCHECK_CONFIGURE_FLAGS="$DISTCHECK_CONFIGURE_FLAGS --with-apr=$with_apr"]
773 01 Feb 09 peter 149 )
164 23 Aug 06 jari 150 if test "$apr_found" = "yes" ; then
1415 24 Oct 11 peter 151   APR_LIBS="`$apr_config --libs`"
1415 24 Oct 11 peter 152   apr_link_ld="`$apr_config --link-ld`"
1415 24 Oct 11 peter 153   for i in $apr_link_ld; do
1415 24 Oct 11 peter 154     AS_IF([AS_ECHO([$i]) | grep '^-l' > /dev/null],
1415 24 Oct 11 peter 155           [APR_LIBS="$i $APR_LIBS"],
1415 24 Oct 11 peter 156           [YAT_LD_ADD_FLAG([LDFLAGS], [$i])])
1415 24 Oct 11 peter 157   done
1415 24 Oct 11 peter 158   YAT_CPP_ADD_FLAG([CPPFLAGS],[`$apr_config --includes --cppflags`])
1415 24 Oct 11 peter 159   AC_CHECK_HEADER([apr_allocator.h],,[apr_found="no"])
164 23 Aug 06 jari 160 fi
887 25 Nov 09 peter 161 AC_SUBST([APR_LIBS])
96 28 Mar 06 jari 162
164 23 Aug 06 jari 163 # Subversion API checks
164 23 Aug 06 jari 164 svn_found="yes"
887 25 Nov 09 peter 165 AC_ARG_WITH([svn],
1415 24 Oct 11 peter 166   [AS_HELP_STRING([--with-svn=DIR],
1487 07 Aug 12 peter 167                   [prefix for svn developer files])],
905 27 Nov 09 peter 168   [ AS_CASE([$withval], [yes|no],
905 27 Nov 09 peter 169             [AC_MSG_ERROR([--with-svn requires a directory to be provided])])
1486 07 Aug 12 peter 170     AS_IF([test -d $with_svn], [],
973 11 Dec 09 peter 171           [AC_MSG_ERROR([$with_svn: no such directory])])
973 11 Dec 09 peter 172     # transform argument to absolute path
973 11 Dec 09 peter 173     with_svn=`cd $with_svn && pwd`
973 11 Dec 09 peter 174     DISTCHECK_CONFIGURE_FLAGS="$DISTCHECK_CONFIGURE_FLAGS --with-svn=$with_svn"
1182 25 Aug 10 peter 175     YAT_LD_ADD_FLAG([LDFLAGS], [-L$with_svn/lib])
1182 25 Aug 10 peter 176     YAT_CPP_ADD_FLAG([CPPFLAGS], [-I$with_svn/include])
774 01 Feb 09 peter 177   ])
887 25 Nov 09 peter 178 # svn needs needs apr headers
887 25 Nov 09 peter 179 AC_CHECK_HEADER([subversion-1/svn_types.h],,[svn_found="no"])
640 31 May 08 peter 180
1416 24 Oct 11 peter 181 # In some versions, such as 1.7, of Subversion header file `svn_wc.h'
1416 24 Oct 11 peter 182 # does not conform to C++98 and therefore compiling with -pedantic
1416 24 Oct 11 peter 183 # fails. As -pedantic is automatically turned on in --enable-debug
1416 24 Oct 11 peter 184 # mode we need to turn it off -pedantic to allow building with
1416 24 Oct 11 peter 185 # --enable-debug (see ticket #506)
1416 24 Oct 11 peter 186 AS_IF([test x$enable_debug = xyes],
1486 07 Aug 12 peter 187   [AC_MSG_CHECKING([subversion-1/svn_wc.h usability with -pedantic])
1416 24 Oct 11 peter 188    AC_COMPILE_IFELSE(
1416 24 Oct 11 peter 189     [AC_LANG_PROGRAM([@%:@include <subversion-1/svn_wc.h>])],
1416 24 Oct 11 peter 190     [AC_MSG_RESULT([yes])],
1416 24 Oct 11 peter 191     [AC_MSG_RESULT([no])
1416 24 Oct 11 peter 192      CXXFLAGS=`AS_ECHO(["$CXXFLAGS"]) | $SED 's|-pedantic||'`
1416 24 Oct 11 peter 193      AC_MSG_NOTICE([remove -pedantic from \$CXXFLAGS])
1416 24 Oct 11 peter 194     ]
1416 24 Oct 11 peter 195    )
1416 24 Oct 11 peter 196   ])
1416 24 Oct 11 peter 197
887 25 Nov 09 peter 198 save_LIBS=$LIBS
887 25 Nov 09 peter 199 tmp_LIBS="$APR_LIBS $save_LIBS"
887 25 Nov 09 peter 200 LIBS=""
640 31 May 08 peter 201 AC_SEARCH_LIBS([svn_cmdline_setup_auth_baton],[svn_subr-1],
887 25 Nov 09 peter 202                [], [svn_found="no"], [$tmp_LIBS])
887 25 Nov 09 peter 203 AC_SEARCH_LIBS([svn_ra_initialize],[svn_ra-1], [], [svn_found="no"],[$tmp_LIBS])
887 25 Nov 09 peter 204 AC_SEARCH_LIBS([svn_wc_adm_open3],[svn_wc-1], [], [svn_found="no"], [$tmp_LIBS])
1486 07 Aug 12 peter 205 AC_SEARCH_LIBS([svn_diff_file_options_create],[svn_diff-1],[],
887 25 Nov 09 peter 206                [svn_found="no"], [$tmp_LIBS])
887 25 Nov 09 peter 207 AC_SEARCH_LIBS([svn_client_log3],[svn_client-1],,[svn_found="no"], [$tmp_LIBS])
887 25 Nov 09 peter 208 SVN_LIBS=$LIBS
887 25 Nov 09 peter 209 LIBS=$save_LIBS
887 25 Nov 09 peter 210 AC_SUBST([SVN_LIBS])
96 28 Mar 06 jari 211
1676 29 Aug 23 peter 212 YAT_CHECK_YAT([0.12], [], [AC_MSG_ERROR([yat not found])])
1673 26 Aug 23 peter 213 YAT_CPP_ADD_FLAG([CPPFLAGS], [$YAT_CPPFLAGS])
1673 26 Aug 23 peter 214 YAT_CXX_ADD_FLAG([CXXFLAGS], [$YAT_CXXFLAGS])
1673 26 Aug 23 peter 215 YAT_LD_ADD_FLAG([LDFLAGS], [$YAT_LDFLAGS])
1673 26 Aug 23 peter 216
858 19 Nov 09 jari 217 # PLplot API checks
901 27 Nov 09 peter 218 # plplot_found can get values: skip, noheader, old, or nolib if an
901 27 Nov 09 peter 219 # error is detected.
858 19 Nov 09 jari 220 plplot_found="yes"
1573 06 Feb 15 jari 221 plplot_version=5.10.0
888 25 Nov 09 peter 222 save_PKG_CONFIG_PATH=$PKG_CONFIG_PATH
888 25 Nov 09 peter 223 AC_ARG_WITH([plplot],
888 25 Nov 09 peter 224   [AS_HELP_STRING([--with-plplot=DIR],[prefix for plplot developer files])],
888 25 Nov 09 peter 225   [DISTCHECK_CONFIGURE_FLAGS="$DISTCHECK_CONFIGURE_FLAGS --with-plplot=$withval"
901 27 Nov 09 peter 226    AS_IF([test "x$withval" = "xno"], [ dnl
901 27 Nov 09 peter 227      plplot_found=skip;
901 27 Nov 09 peter 228    ], [ dnl
973 11 Dec 09 peter 229      AS_IF([test -d $with_plplot], [],
973 11 Dec 09 peter 230            [AC_MSG_ERROR([$with_plplot: no such directory])])
1486 07 Aug 12 peter 231      with_plplot=`cd $with_plplot && pwd`
901 27 Nov 09 peter 232      # help pkg-config find .pc file
973 11 Dec 09 peter 233      PKG_CONFIG_PATH=$with_plplot/lib/pkgconfig$PATH_SEPARATOR$PKG_CONFIG_PATH
1486 07 Aug 12 peter 234      export PKG_CONFIG_PATH
901 27 Nov 09 peter 235    ])
888 25 Nov 09 peter 236   ])
858 19 Nov 09 jari 237
1598 26 Aug 15 jari 238 # PLPLOT_USE_D is set to character 'd' for plplot versions prior to
1598 26 Aug 15 jari 239 # 5.11 since library names changed in plplot 5.11, i.e., the 'd' to
1598 26 Aug 15 jari 240 # indicate double floating number precision was removed from library
1598 26 Aug 15 jari 241 # names.
1598 26 Aug 15 jari 242 PLPLOT_USE_D=
901 27 Nov 09 peter 243 use_plplot_pc="no"
901 27 Nov 09 peter 244 AS_IF([test "x$plplot_found" = "xyes" && test -n "$PKG_CONFIG"], [
1598 26 Aug 15 jari 245   # check for plplot 5.11 or later first
1598 26 Aug 15 jari 246   AC_MSG_CHECKING([for plplot-c++.pc])
1598 26 Aug 15 jari 247   AS_IF([$PKG_CONFIG --exists plplot-c++], [
901 27 Nov 09 peter 248     AC_MSG_RESULT([yes])
901 27 Nov 09 peter 249     use_plplot_pc="yes"
901 27 Nov 09 peter 250   ],[
1598 26 Aug 15 jari 251     # fall back to check for plplot prior to version 5.11
1598 26 Aug 15 jari 252     AC_MSG_CHECKING([for plplotd-c++.pc])
1598 26 Aug 15 jari 253     AS_IF([$PKG_CONFIG --exists plplotd-c++], [
1598 26 Aug 15 jari 254       AC_MSG_RESULT([yes])
1598 26 Aug 15 jari 255       use_plplot_pc="yes"
1598 26 Aug 15 jari 256       # plplot prior to 5.11 found, use 'd'
1598 26 Aug 15 jari 257       PLPLOT_USE_D=d
1598 26 Aug 15 jari 258     ],[
1598 26 Aug 15 jari 259       AC_MSG_RESULT([no])
1598 26 Aug 15 jari 260       AC_MSG_WARN([cannot find plplotd-c++ nor plplot-c++;
1598 26 Aug 15 jari 261         please use --with-plplot with appropriate argument to get more accurate
1598 26 Aug 15 jari 262         configuration.])
1598 26 Aug 15 jari 263     ])
901 27 Nov 09 peter 264   ])
888 25 Nov 09 peter 265 ])
901 27 Nov 09 peter 266
901 27 Nov 09 peter 267 AS_IF([test "x$plplot_found" = "xyes"], [
901 27 Nov 09 peter 268   # copy flags if we have found pc file
901 27 Nov 09 peter 269   AS_IF([test "$use_plplot_pc" = "yes"], [
1346 06 Mar 11 peter 270     # plplot typically returns <prefix>/include/plplot because plplot
1346 06 Mar 11 peter 271     # people assumes users include header files as <foo.h>. We prefer
1346 06 Mar 11 peter 272     # including files as <plplot/foo.h> and therefore need to trim off
1346 06 Mar 11 peter 273     # trailing '/plplot'. Space is included in sed expression to avoid
1346 06 Mar 11 peter 274     # substituting potential '/plplot' in PREFIX.
1486 07 Aug 12 peter 275     YAT_CPP_ADD_FLAG([CPPFLAGS],
1598 26 Aug 15 jari 276              [`$PKG_CONFIG plplot$PLPLOT_USE_D-c++ --cflags-only-I | sed 's|/plplot | |g'`])
1598 26 Aug 15 jari 277     YAT_LD_ADD_FLAG([LDFLAGS], [`$PKG_CONFIG plplot$PLPLOT_USE_D-c++ --libs-only-L`])
1598 26 Aug 15 jari 278     PLPLOT_LIBS="`$PKG_CONFIG plplot$PLPLOT_USE_D-c++ --libs-only-l --libs-only-other`"
901 27 Nov 09 peter 279   ],[
901 27 Nov 09 peter 280     # otherwise guess
1598 26 Aug 15 jari 281     PLPLOT_LIBS="-lplplotcxx -lplplot";
901 27 Nov 09 peter 282     AS_IF([test -n "$with_plplot" && test "x$with_plplot" != "xyes"], [
1182 25 Aug 10 peter 283       YAT_LD_ADD_FLAG([LDFLAGS], [-L$with_plplot/lib])
1346 06 Mar 11 peter 284       YAT_CPP_ADD_FLAG([CPPFLAGS], [-I$with_plplot/include])
901 27 Nov 09 peter 285     ])
901 27 Nov 09 peter 286   ])
901 27 Nov 09 peter 287 ])
1486 07 Aug 12 peter 288
888 25 Nov 09 peter 289 AS_IF([test "x$plplot_found" = "xyes"], [
888 25 Nov 09 peter 290   AC_CHECK_HEADER([plplot/plstream.h], [], [plplot_found="noheader"])
888 25 Nov 09 peter 291 ])
888 25 Nov 09 peter 292
901 27 Nov 09 peter 293 AS_IF([test "x$plplot_found" = "xyes" && test -n "$PKG_CONFIG"], [
901 27 Nov 09 peter 294   AC_MSG_CHECKING([plplot version >= $plplot_version])
1598 26 Aug 15 jari 295   AS_IF([$PKG_CONFIG --atleast-version=$plplot_version plplot$PLPLOT_USE_D-c++], [
901 27 Nov 09 peter 296     AC_MSG_RESULT([yes])
901 27 Nov 09 peter 297   ],[
1598 26 Aug 15 jari 298     have_plplot_version=`$PKG_CONFIG --modversion plplot$PLPLOT_USE_D-c++`
1182 25 Aug 10 peter 299     AC_MSG_RESULT([$have_plplot_version])
901 27 Nov 09 peter 300     plplot_found="old"
888 25 Nov 09 peter 301   ])
888 25 Nov 09 peter 302 ])
901 27 Nov 09 peter 303
904 27 Nov 09 peter 304 AS_IF([test "x$plplot_found" = "xyes"], [
901 27 Nov 09 peter 305   save_LIBS=$LIBS
901 27 Nov 09 peter 306   LIBS="$PLPLOT_LIBS $LIBS"
901 27 Nov 09 peter 307   AC_MSG_CHECKING([for library containing plstream])
901 27 Nov 09 peter 308   AC_LINK_IFELSE([AC_LANG_PROGRAM([@%:@include <plplot/plstream.h>],
1029 14 Feb 10 peter 309                                   [plstream pls(1,1,"svg", "conftest.svg");
1029 14 Feb 10 peter 310                                    pls.scolbga(255, 255, 255, 0);
1486 07 Aug 12 peter 311                                   ])],
901 27 Nov 09 peter 312                  [AC_MSG_RESULT([yes]);
1486 07 Aug 12 peter 313                   AC_DEFINE([HAVE_PLPLOT], [1],
1486 07 Aug 12 peter 314                             [Define to 1 if you have plplot])],
901 27 Nov 09 peter 315                  [AC_MSG_RESULT([no])
901 27 Nov 09 peter 316                   plplot_found=nolib;])
989 14 Dec 09 jari 317   LIBS=$save_LIBS
901 27 Nov 09 peter 318 ])
888 25 Nov 09 peter 319 # restore variable
888 25 Nov 09 peter 320 export PKG_CONFIG_PATH=$save_PKG_CONFIG_PATH
888 25 Nov 09 peter 321 AC_SUBST(PLPLOT_LIBS)
888 25 Nov 09 peter 322
730 15 Dec 08 peter 323 # checking if we have test repo
730 15 Dec 08 peter 324 test_repo_filename=$srcdir/test/repo;
1486 07 Aug 12 peter 325 AS_IF([test -r $test_repo_filename],
744 08 Jan 09 peter 326               [AC_DEFINE([HAVE_TEST_REPO],[1],[define if test repo is available])
744 08 Jan 09 peter 327                test_repo_found="yes"],
730 15 Dec 08 peter 328               [test_repo_found="no"])
748 09 Jan 09 peter 329 AC_SUBST([test_repo_found])
772 01 Feb 09 peter 330 AS_IF([test "x$test_repo_found" = xyes],
772 01 Feb 09 peter 331       [abs_test_repo=`cd $test_repo_filename && pwd`;
772 01 Feb 09 peter 332        AC_SUBST(abs_test_repo)]
772 01 Feb 09 peter 333      )
952 06 Dec 09 peter 334 AC_CONFIG_FILES([test/init.sh])
772 01 Feb 09 peter 335 AC_CONFIG_FILES([test/svn_update.sh], [chmod +x test/svn_update.sh])
540 29 Dec 07 peter 336
1628 16 Mar 23 peter 337 # prefer in-tree versions rather than installed (detected in
1628 16 Mar 23 peter 338 # YAT_SVN_RELEASE below
1628 16 Mar 23 peter 339 : ${SVNDIGEST_COPY_CACHE=bin/svndigest-copy-cache}
1628 16 Mar 23 peter 340 : ${SVNCOPYRIGHT=bin/svncopyright}
1628 16 Mar 23 peter 341
1618 12 Mar 23 peter 342 YAT_AM_LOCAL
1618 12 Mar 23 peter 343 YAT_SVN_REVISION
1618 12 Mar 23 peter 344 YAT_REVISION_HEADER
1618 12 Mar 23 peter 345 YAT_SVN_RELEASE_YEAR
1618 12 Mar 23 peter 346 YAT_SVN_TIMESTAMP
1618 12 Mar 23 peter 347
1670 05 Jul 23 peter 348 # look for git program needed while doing a release
1670 05 Jul 23 peter 349 AC_CHECK_PROG([GIT], [git], [git], [false])
1670 05 Jul 23 peter 350 AC_ARG_VAR([GIT], [git command])
1670 05 Jul 23 peter 351
1337 12 Feb 11 peter 352 dnl maintainer make rules from yat project
1618 12 Mar 23 peter 353 YAT_SVN_RELEASE([],
1616 21 Feb 23 peter 354   [$(SVNDIGEST_MAJOR_VERSION).$(SVNDIGEST_MINOR_VERSION)],
1674 26 Aug 23 peter 355   [svndigest@frs.sourceforge.net:/home/frs/project/s/sv/svndigest],
1616 21 Feb 23 peter 356   [https://sourceforge.net/projects/svndigest/files/$(distdir).tar.gz/files],
1616 21 Feb 23 peter 357   [https://dev.thep.lu.se/svndigest/browser/tags/$(VERSION)/NEWS])
1616 21 Feb 23 peter 358
901 27 Nov 09 peter 359 # Restore FLAGS
1182 25 Aug 10 peter 360 APR_RESTORE_THE_ENVIRONMENT([CPPFLAGS], [SVNDIGEST_])
1182 25 Aug 10 peter 361 APR_RESTORE_THE_ENVIRONMENT([CXXFLAGS], [SVNDIGEST_])
1182 25 Aug 10 peter 362 APR_RESTORE_THE_ENVIRONMENT([LDFLAGS], [SVNDIGEST_])
901 27 Nov 09 peter 363
1525 01 Oct 12 peter 364 AC_CONFIG_FILES([Makefile test/environment.h])
2 20 Dec 05 jari 365
1495 27 Aug 12 peter 366 AC_CONFIG_FILES([build_support/tag_and_release.sh],
1495 27 Aug 12 peter 367                 [chmod +x-w build_support/tag_and_release.sh])
1613 15 Feb 23 peter 368 AC_CONFIG_FILES([build_support/dummy_help2man.sh],
1613 15 Feb 23 peter 369                 [chmod +x-w build_support/dummy_help2man.sh])
1495 27 Aug 12 peter 370
164 23 Aug 06 jari 371 # Print failure status information about selected items, and exit if
164 23 Aug 06 jari 372 # fatal errors were encountered. No output will be created if
164 23 Aug 06 jari 373 # configure is halted prematurely.
156 14 Aug 06 jari 374
164 23 Aug 06 jari 375 # used to trigger exit before creation of output
164 23 Aug 06 jari 376 all_reqs_ok="true"
160 19 Aug 06 jari 377
1598 26 Aug 15 jari 378 # checking for help2man, missing help2man is non-fatal but subsequent
1598 26 Aug 15 jari 379 # use of `make dist` and `make distcheck` is constructed to fail.
1613 15 Feb 23 peter 380 AC_MSG_CHECKING([whether to use help2man])
1613 15 Feb 23 peter 381 # avoid running help2man when cross-compiling (as it involves invoking binaries)
1613 15 Feb 23 peter 382 AS_IF([test x$cross_compiling = x"yes"], [have_help2man=cross_compiling],
1613 15 Feb 23 peter 383       [test x"$HELP2MAN" = x"false"], [have_help2man=no],
1613 15 Feb 23 peter 384       [have_help2man=yes])
1598 26 Aug 15 jari 385 AM_CONDITIONAL([HAVE_HELP2MAN], [test "x$have_help2man" = "xyes"])
1598 26 Aug 15 jari 386 AC_MSG_RESULT([$have_help2man])
1598 26 Aug 15 jari 387
1598 26 Aug 15 jari 388 # if we work in an svn wc we should have a test repository and warn if
1598 26 Aug 15 jari 389 # help2man missing
1337 12 Feb 11 peter 390 AS_VAR_IF([have_svn_wc], [yes], [
730 15 Dec 08 peter 391    if (test "$test_repo_found" = "no"); then
730 15 Dec 08 peter 392       all_reqs_ok="false";
1598 26 Aug 15 jari 393       AC_MSG_WARN(m4_text_wrap(m4_normalize([
1598 26 Aug 15 jari 394          Cannot find test repository (test/repo), which should be
1598 26 Aug 15 jari 395    available when building from a subversion working copy.
1598 26 Aug 15 jari 396    Try svn update in top directory.
1598 26 Aug 15 jari 397    ]),
1598 26 Aug 15 jari 398    [                   ],[                             ],79))
730 15 Dec 08 peter 399    fi
1598 26 Aug 15 jari 400    if (test "$have_help2man" = "no"); then
1598 26 Aug 15 jari 401        # non-fatal, only issue warning
1598 26 Aug 15 jari 402        AC_MSG_WARN(m4_text_wrap(m4_normalize([
1598 26 Aug 15 jari 403           `help2man' is missing on your system. You will not be
1598 26 Aug 15 jari 404     able to create the man page. A sound man page should be
1598 26 Aug 15 jari 405     included in a distribution, and since you will not able
1598 26 Aug 15 jari 406     to create a complete distribution `make dist' will fail.
1613 15 Feb 23 peter 407     You may want to install the GNU Help2man package:
1613 15 Feb 23 peter 408     <https://www.gnu.org/software/help2man/>
1598 26 Aug 15 jari 409     ]),
1598 26 Aug 15 jari 410     [                   ],[                             ],79))
1598 26 Aug 15 jari 411    fi
1337 12 Feb 11 peter 412 ])
540 29 Dec 07 peter 413
164 23 Aug 06 jari 414 # Non-existing APR is fatal -- sub-sequent compilation will fail.
164 23 Aug 06 jari 415 if (test "$apr_found" = "no") ; then
670 04 Jul 08 jari 416   AC_MSG_WARN([APR not found. The Apache Portable Runtime
670 04 Jul 08 jari 417   (APR) library cannot be found. Please make sure APR is installed
670 04 Jul 08 jari 418   and supply the appropriate --with-apr option to 'configure'.])
670 04 Jul 08 jari 419   all_reqs_ok="false"
164 23 Aug 06 jari 420 fi
160 19 Aug 06 jari 421
164 23 Aug 06 jari 422 # Non-existing subversion API is fatal -- sub-sequent compilation will fail.
164 23 Aug 06 jari 423 if (test "$svn_found" = "no") ; then
670 04 Jul 08 jari 424   svn_msg="Subversion API not found. Subversion API libraries cannot
670 04 Jul 08 jari 425   be found. Make sure the APIs are installed and supply the
670 04 Jul 08 jari 426   appropriate --with-svn option to 'configure'."
670 04 Jul 08 jari 427   if (test "$apr_found" = "no") ; then
383 24 Jun 07 jari 428     svn_msg="$svn_msg
557 05 Feb 08 jari 429     Note, APR was not found. Failure to locate APR affects the search
557 05 Feb 08 jari 430     of the subversion API. Please fix the APR problem before trying
557 05 Feb 08 jari 431     to resolve the subversion related issues."
670 04 Jul 08 jari 432   fi
670 04 Jul 08 jari 433   AC_MSG_WARN([$svn_msg])
670 04 Jul 08 jari 434   all_reqs_ok="false"
383 24 Jun 07 jari 435 fi
162 19 Aug 06 jari 436
858 19 Nov 09 jari 437 # Non-existing PLplot API is fatal -- sub-sequent compilation will fail.
1486 07 Aug 12 peter 438 AS_CASE([$plplot_found],
901 27 Nov 09 peter 439   [noheader],
901 27 Nov 09 peter 440     [AC_MSG_WARN([
901 27 Nov 09 peter 441     PLplot developer files cannot be found. Make sure PLplot is installed.])
901 27 Nov 09 peter 442     all_reqs_ok="false"],
901 27 Nov 09 peter 443   [old],
901 27 Nov 09 peter 444     [AC_MSG_WARN([
901 27 Nov 09 peter 445     PLplot developer files found but not required API version.
901 27 Nov 09 peter 446     Version at least $plplot_version is required. Please upgrade PLplot.])
901 27 Nov 09 peter 447     all_reqs_ok="false"],
901 27 Nov 09 peter 448   [nolib],
901 27 Nov 09 peter 449     [AC_MSG_WARN([
901 27 Nov 09 peter 450     PLplot developer files found but linking against plplot library failed.])
901 27 Nov 09 peter 451     all_reqs_ok="false"])
858 19 Nov 09 jari 452
567 07 Mar 08 peter 453 if test $ac_cv_type_long_long_int != yes ; then
670 04 Jul 08 jari 454   AC_MSG_WARN([Compiler $CXX does not support `long long'.
670 04 Jul 08 jari 455   svndigest must be compiled with a compiler that supports `long long'.])
670 04 Jul 08 jari 456   all_reqs_ok="false"
564 07 Mar 08 peter 457 fi
564 07 Mar 08 peter 458
164 23 Aug 06 jari 459 if (test "$all_reqs_ok" = "false") ; then
670 04 Jul 08 jari 460   AC_MSG_ERROR([Some pre-requisites were not fulfilled, aborting
670 04 Jul 08 jari 461   configure. Please consult the 'README' file for more information
670 04 Jul 08 jari 462   about what is needed to compile svndigest and refer to above
670 04 Jul 08 jari 463   warning messages. Needed files were NOT created.])
164 23 Aug 06 jari 464 fi
164 23 Aug 06 jari 465
164 23 Aug 06 jari 466 # Create output.
164 23 Aug 06 jari 467 AC_OUTPUT
164 23 Aug 06 jari 468
164 23 Aug 06 jari 469 # Some more messages.
887 25 Nov 09 peter 470 AC_MSG_NOTICE([
887 25 Nov 09 peter 471 Ready to compile the executables of svndigest $VERSION
887 25 Nov 09 peter 472 The following flags and libs will be used:
887 25 Nov 09 peter 473 +++++++++++++++++++++++++++++++++++++++++++++++
887 25 Nov 09 peter 474   Compiler:           $CXX
1182 25 Aug 10 peter 475   Preprocessor flags:
1182 25 Aug 10 peter 476     CPPFLAGS:           $CPPFLAGS
1182 25 Aug 10 peter 477     SVNDIGEST_CPPFLAGS: $SVNDIGEST_CPPFLAGS
887 25 Nov 09 peter 478   C++ flags:
1182 25 Aug 10 peter 479     CXXFLAGS:           $CXXFLAGS
1182 25 Aug 10 peter 480     SVNDIGEST_CXXFLAGS: $SVNDIGEST_CXXFLAGS
887 25 Nov 09 peter 481   Linker flags:
1182 25 Aug 10 peter 482     LDFLAGS:            $LDFLAGS
1182 25 Aug 10 peter 483     SVNDIGEST_LDFLAGS:  $SVNDIGEST_LDFLAGS
1486 07 Aug 12 peter 484   Libraries:
1182 25 Aug 10 peter 485     LIBS                $LIBS
1182 25 Aug 10 peter 486     APR_LIBS            $APR_LIBS
1182 25 Aug 10 peter 487     SVN_LIBS            $SVN_LIBS
1182 25 Aug 10 peter 488     PLPLOT_LIBS         $PLPLOT_LIBS
887 25 Nov 09 peter 489 +++++++++++++++++++++++++++++++++++++++++++++++]dnl
887 25 Nov 09 peter 490 )
164 23 Aug 06 jari 491
880 24 Nov 09 peter 492 AC_MSG_NOTICE([Now type 'make all check'.])