Ignore:
Timestamp:
Apr 9, 2009, 10:18:54 PM (12 years ago)
Author:
Jari Häkkinen
Message:

Merged trunk changes r645:782 to replacing_gnuplot branch.

Location:
branches/replacing_gnuplot
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/replacing_gnuplot

    • Property svn:ignore
      •  

        old new  
        88autom4te.cache
        99INSTALL
        10 COPYING
        1110aclocal.m4
        1211Makefile
  • branches/replacing_gnuplot/configure.ac

    r646 r784  
    1313# Copyright (C) 2006 Jari Häkkinen
    1414# Copyright (C) 2007, 2008 Jari Häkkinen, Peter Johansson
     15# Copyright (C) 2009 Peter Johansson
    1516#
    16 # This file is part of svndigest, http://trac.thep.lu.se/svndigest
     17# This file is part of svndigest, http://dev.thep.lu.se/svndigest
    1718#
    1819# svndigest is free software; you can redistribute it and/or modify it
    1920# 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# the Free Software Foundation; either version 3 of the License, or
    2122# (at your option) any later version.
    2223#
     
    2728#
    2829# 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 
    33 AC_PREREQ(2.60)
    34 
    35 
    36 m4_include([./build_support/version.m4])
     30# along with svndigest. If not, see <http://www.gnu.org/licenses/>.
     31
     32AC_PREREQ(2.61)
     33
     34m4_include([m4/version.m4])
    3735AC_INIT([svndigest],[SVNDIGEST_VERSION],[jari@thep.lu.se])
    3836AC_CONFIG_SRCDIR([lib/File.h])
    3937AC_CONFIG_AUX_DIR([autotools])
     38dnl arg below should be the same as in Makefile.am
     39AC_CONFIG_MACRO_DIR([m4])
    4040AC_PREFIX_DEFAULT([/usr/local])
    41 test $prefix = NONE && prefix=/usr/local
    4241
    4342AC_SUBST([SVNDIGEST_MAJOR_VERSION], [MAJOR_VERSION])
     
    4645
    4746AC_DEFINE([DEV_BUILD],[SVNDIGEST_DEV_BUILD],
    48           [true if dev build (version starts with pre)])
    49 AC_DEFINE([VERSION_MAJOR], [SVNDIGEST_MAJOR_VERSION],
     47          [true if dev build (version ends with pre)])
     48AC_DEFINE([SVNDIGEST_MAJOR_VERSION], [MAJOR_VERSION],
    5049                    [Define to the svndigest major version])
    51 AC_DEFINE([VERSION_MINOR], [SVNDIGEST_MINOR_VERSION],
     50AC_DEFINE([SVNDIGEST_MINOR_VERSION], [MINOR_VERSION],
    5251                    [Define to the svndigest minor version])
    53 AC_DEFINE([VERSION_PATCH], [SVNDIGEST_PATCH_VERSION],
     52AC_DEFINE([SVNDIGEST_PATCH_VERSION], [PATCH_VERSION],
    5453                    [Define to the svndigest patch version])
    5554
    5655AC_CONFIG_HEADER([config.h])
    57 AM_INIT_AUTOMAKE([std-options check-news])
    58 
    59 # seems like these variables are not set with older autoconf(?)
    60 AC_SUBST([abs_srcdir], ["`cd $srcdir && pwd`"])
    61 AC_SUBST([abs_builddir], ["`pwd`"])
     56AM_INIT_AUTOMAKE([1.10 std-options check-news])
    6257
    6358# Set default programming language
    6459AC_LANG(C++)
     60
     61# propagate selected configure variables to DISTCHECK_CONFIGURE_FLAGS
     62for var in CPPFLAGS CXX CXXFLAGS CXXCPP LDFLAGS LIBS; do
     63  eval isset=\${$var+set}
     64  if test "$isset" = 'set' ; then
     65    eval val=$`echo $var`
     66    DISTCHECK_CONFIGURE_FLAGS="${DISTCHECK_CONFIGURE_FLAGS}'${var}=${val}' "
     67  fi
     68done
     69AC_SUBST(DISTCHECK_CONFIGURE_FLAGS)
    6570
    6671# Let user overide default CXXFLAGS
     
    6873  CXXFLAGS=""  # Setting CXXFLAGS here to prevent expansion in AC_PROG_CXX
    6974fi
     75
    7076# Checks for programs.
    7177AC_PROG_CXXCPP
    7278AC_PROG_CXX
    7379AC_PROG_INSTALL
    74 AC_PROG_LIBTOOL
     80AC_PROG_RANLIB
    7581AC_PROG_SED
    76 AC_CHECK_PROG([GNUPLOT],[gnuplot],[ok])
     82AC_PATH_PROG([HELP2MAN], [help2man], [no])
     83AM_CONDITIONAL([HAVE_HELP2MAN], [test x$HELP2MAN != xno])
     84AC_PATH_PROG([GNUPLOT],[gnuplot],[no])
     85AC_DEFINE_UNQUOTED([GNUPLOT_PATH], ["$GNUPLOT"],
     86                   [defined to gnuplot path (or no if gnuplot was not found)])
    7787
    7888# Save FLAGS
     
    8595# using extension beyond the C++ standard (usage of non C++ standard
    8696# 'long long' types).
    87 SD_CXXFLAGS="$SD_CXXFLAGS-Wall -pedantic -Wno-long-long"
    88 AC_TYPE_LONG_LONG_INT()
    89 
    90 AC_ARG_ENABLE(debug,
     97YAT_CXX_ADD_FLAG([SD_CXXFLAGS],[-pedantic -Wno-long-long])
     98AC_TYPE_LONG_LONG_INT
     99AS_IF([test x$ac_cv_type_long_long_int = xno],
     100      [AC_MSG_ERROR([compiler does not support long long int])]
     101     )
     102
     103AC_ARG_ENABLE([debug],
    91104  [AS_HELP_STRING([--enable-debug],[turn on debug options and code])],
    92   [SD_CXXFLAGS="$SD_CXXFLAGS -g -O"],
    93   [SD_CPPFLAGS="-DNDEBUG" SD_CXXFLAGS="$SD_CXXFLAGS -O3"])
    94 
    95 # optionally prepare for building static libraries.
    96 AC_ARG_ENABLE(staticbin,
    97   [AS_HELP_STRING([--enable-staticbin], [create a static binary,
    98   at least as static as the available underlying libraries
    99   allows])])
    100 if test "$enable_staticbin" = "yes"; then
    101   case $host in
    102   *-apple-darwin*)
    103     # At the time of creating this libsvn_subr uses
    104     # Keychain on Mac OSX. In consequence the below
    105     # frameworks are needed for succesful static builds.
    106     SD_LIBS="$SD_LIBS -framework Security"
    107     SD_LIBS="$SD_LIBS -framework CoreFoundation"
    108     SD_LIBS="$SD_LIBS -framework CoreServices"
    109     ;;
    110   esac
    111   STATICFLAG=-static
    112   AC_SUBST(STATICFLAG)
    113 fi
     105  [YAT_CXX_ADD_FLAG([SD_CXXFLAGS],[-g -O])],
     106  [YAT_CPP_ADD_FLAG([SD_CPPFLAGS],[-DNDEBUG])
     107   YAT_CXX_ADD_FLAG([SD_CXXFLAGS],[-O3])])
     108
     109# enable svn-support
     110AC_ARG_ENABLE([svn-support],
     111              [AS_HELP_STRING([--enable-svn-support],
     112                              [enable svn support - used by maintainer])])
     113
     114AS_IF([test "x$enable_svn-support" = xyes],
     115      [AC_CHECK_FILE([$srcdir/.svn],,
     116                     [AC_MSG_ERROR([svn support cannot be enabled: `$srcdir' is not an svn wc.])])])
     117AM_CONDITIONAL([ENABLE_SVN_SUPPORT], [test "x$enable_svn-support" = "xyes"])
    114118
    115119# Apache Portable Runtime (APR) API checks
    116 # The next three lines are not needed as long as APR_FIND_APR is used.
    117 # AC_ARG_WITH(apr,
    118 #  [  --with-apr=DIR          prefix for installed APR or path to APR build
    119 #                          tree [[PREFIX]]])
    120 # Include APR_FIND_APR macro distributed within the APR project. If
    121 # the usage of the APR macro is to be omitted then the construct for
    122 # setting the CXXFLAGS (header file location) and LDFLAGS (linking
    123 # informaion) for APR must be changed. The latter can be achieved with
    124 # AC_SEARCH_LIBS([apr_allocator_create],[apr-0],,apr_found="no") but
    125 # apr-0 must be prior knowledge.
    126 m4_sinclude(./build_support/find_apr.m4)
    127120APR_FIND_APR(,,1,[1 0])
     121AS_IF([test "${with_apr+set}" = set],
     122    [DISTCHECK_CONFIGURE_FLAGS="$DISTCHECK_CONFIGURE_FLAGS --with-apr=$with_apr"]
     123)
    128124if test "$apr_found" = "yes" ; then
    129     SD_LDFLAGS="`$apr_config --link-ld` $SD_LDFLAGS"
    130     SD_CPPFLAGS="`$apr_config --includes --cppflags` $SD_CPPFLAGS"
     125    SD_LIBS="`$apr_config --libs` $SD_LIBS"
     126    apr_link_ld=`$apr_config --link-ld`
     127    for i in $apr_link_ld; do
     128      AS_IF([test ${i:0:2} = "-l"],[SD_LIBS="$i $SD_LIBS"],
     129            [YAT_LD_ADD_FLAG([SD_LDFLAGS], [$i])])
     130    done
     131    YAT_CPP_ADD_FLAG([SD_CPPFLAGS],[`$apr_config --includes --cppflags`])
    131132fi
    132133
     
    135136AC_ARG_WITH(svn,
    136137  [AS_HELP_STRING([--with-svn=DIR],[prefix for svn developer files [[PREFIX]]])],
    137   [ SD_LDFLAGS="-L$withval/lib $SD_LDFLAGS"
    138     SD_CPPFLAGS="-I$withval/include $SD_CPPFLAGS"])
     138  [ DISTCHECK_CONFIGURE_FLAGS="$DISTCHECK_CONFIGURE_FLAGS --with-svn=$withval"
     139    YAT_LD_ADD_FLAG([SD_LDFLAGS], [-L$withval/lib])
     140    YAT_CPP_ADD_FLAG([SD_CPPFLAGS], [-L$withval/include])
     141  ])
     142
    139143
    140144
     
    147151AC_CHECK_HEADER([apr_allocator.h],,apr_found="no")
    148152AC_CHECK_HEADER([subversion-1/svn_types.h],,svn_found="no")
    149 # The library checks below may match shared libs even when
    150 # --enable-staticbin is given to configure. This should probably not
    151 # pose any problems since in a properly installed system the shared
    152 # and static libraries should be the same.
    153153AC_SEARCH_LIBS([svn_cmdline_setup_auth_baton],[svn_subr-1],
    154154               [SD_LIBS="-lsvn_subr-1 $SD_LIBS"],svn_found="no")
     
    175175
    176176# check if svnversion is installed
    177 have_svnversion="yes"
    178 AC_PATH_PROG(SVNVERSION, svnversion, have_svnversion="no")
     177AC_PATH_PROG([SVNVERSION], [svnversion], [no])
    179178
    180179# checking if we build in a subversion WC
    181 wc_found="no";
    182 if (test $have_svnversion != "no" &&
    183     test `$SVNVERSION -n $srcdir` != "exported");
    184 then
    185    wc_found="yes";
    186 fi
    187 AC_CHECK_FILE("$srcdir/lib/subversion_info.cc",info_found="yes",info_found="no")
    188 
    189 # checking that DEV_BUILD is set to false at time of release
    190 # Failure should be captured by distcheck
    191 if (test "$wc_found" = "no" && test "$SVNDIGEST_DEV_BUILD" = "true") ; then
    192   AC_MSG_ERROR([Incorrect version:
    193                [SVNDIGEST_DEV_BUILD] is set to SVNDIGEST_DEV_BUILD.
    194          [SVNDIGEST_DEV_BUILD] should be set to false at time of release.
    195                Please, update version.m4.])
    196 fi
    197 
    198 
    199 # devel version should have svn WC and SVNVERSION installed
    200 AM_CONDITIONAL(HAVE_SVN_WC, test "$wc_found" = "yes" )
     180AC_CHECK_FILE([$srcdir/.svn], [wc_found="yes"], [wc_found="no"])
     181AM_CONDITIONAL([HAVE_SVN_WC], [test "$wc_found" = "yes"])
     182AC_SUBST([wc_found])
     183
     184# checking if we have test repo
     185test_repo_filename=$srcdir/test/repo;
     186AC_CHECK_FILE([$test_repo_filename],
     187              [AC_DEFINE([HAVE_TEST_REPO],[1],[define if test repo is available])
     188               test_repo_found="yes"],
     189              [test_repo_found="no"])
     190AC_SUBST([test_repo_found])
     191AS_IF([test "x$test_repo_found" = xyes],
     192      [abs_test_repo=`cd $test_repo_filename && pwd`;
     193       AC_SUBST(abs_test_repo)]
     194     )
     195AC_CONFIG_FILES([test/test_repo.sh], [chmod +x test/test_repo.sh])
     196AC_CONFIG_FILES([test/svn_update.sh], [chmod +x test/svn_update.sh])
     197AC_CONFIG_FILES([test/check_repo_status.sh],
     198                [chmod +x test/check_repo_status.sh])   
    201199
    202200
     
    204202                bin/Makefile
    205203                lib/Makefile
     204                man/Makefile
    206205                test/environment.h
    207206                test/Makefile])
     
    214213all_reqs_ok="true"
    215214
    216 if (test "$wc_found" != "yes") ; then
    217 if (test "$info_found" = "no") ; then
    218    AC_MSG_WARN([Cannot find sources (lib/subversion_info.cc).])
    219    if (test "$svnversion" = "no") ; then
    220      AC_MSG_WARN([If you grabbed the source from the subversion repository,
    221      the file will be generated automatically. However, svnversion cannot
    222      be found and therefore the file cannot be generated. Please install
    223      svnversion and make sure it is in your search path.])
    224    else
    225      AC_MSG_WARN([If you grabbed the source from the subversion repository,
    226      the file will be generated automatically. However, the output from
    227      svnversion was incorrect. Either your installation of svnversion is
    228      is not healthy or there is something wrong with the repository.])
    229    fi
    230    all_reqs_ok="false"
    231 else
    232    dnl test repo is not distributed
    233    AC_CONFIG_FILES([test/test_repo.sh
    234                     test/check_repo_status.sh],
    235                    [chmod +x test/test_repo.sh;
    236                     chmod +x test/check_repo_status.sh])
    237    
    238 fi
     215if (test "$wc_found" = "yes"); then
     216   if test x$HELP2MAN = xno; then
     217     AC_MSG_WARN(m4_text_wrap(m4_normalize([
     218       `help2man' is missing on your system.  You will not be
     219       able to create the man page. A sound man page should be
     220       included in a distribution, and since you will not able
     221       to create a complete distribution `make dist' will fail.
     222       ]),[                   ],
     223          [                             ], 79))
     224   fi
     225   # svnversion is required when building from svn wc
     226   if (test "$svnversion" = "no"); then
     227      all_reqs_ok="false";
     228      AC_MSG_WARN([dnl
     229Cannot find svnversion, which is required when building from a
     230subversion working copy. Please install svnversion and make sure it is
     231in your search path.]);
     232   fi
     233   if (test "$test_repo_found" = "no"); then
     234      all_reqs_ok="false";
     235      AC_MSG_WARN([dnl
     236Cannot find test repository (test_repo_filename), which should be
     237available when building from a subversion working copy. Try svn
     238update in top directory.]);
     239   fi
    239240fi
    240241
    241242# Non-existing APR is fatal -- sub-sequent compilation will fail.
    242243if (test "$apr_found" = "no") ; then
    243     AC_MSG_WARN([APR not found. The Apache Portable Runtime
    244     (APR) library cannot be found. Please make sure APR is installed
    245     and supply the appropriate --with-apr option to 'configure'.])
    246     all_reqs_ok="false"
     244  AC_MSG_WARN([APR not found. The Apache Portable Runtime
     245  (APR) library cannot be found. Please make sure APR is installed
     246  and supply the appropriate --with-apr option to 'configure'.])
     247  all_reqs_ok="false"
    247248fi
    248249
    249250# Non-existing subversion API is fatal -- sub-sequent compilation will fail.
    250251if (test "$svn_found" = "no") ; then
    251     svn_msg="Subversion API not found. Subversion API libraries cannot
    252     be found. Make sure the APIs are installed and supply the
    253     appropriate --with-svn option to 'configure'."
    254 if (test "$apr_found" = "no") ; then
     252  svn_msg="Subversion API not found. Subversion API libraries cannot
     253  be found. Make sure the APIs are installed and supply the
     254  appropriate --with-svn option to 'configure'."
     255  if (test "$apr_found" = "no") ; then
    255256    svn_msg="$svn_msg
    256257    Note, APR was not found. Failure to locate APR affects the search
    257258    of the subversion API. Please fix the APR problem before trying
    258259    to resolve the subversion related issues."
    259 fi
    260     AC_MSG_WARN([$svn_msg])
    261     all_reqs_ok="false"
     260  fi
     261  AC_MSG_WARN([$svn_msg])
     262  all_reqs_ok="false"
    262263fi
    263264
    264265if test $ac_cv_type_long_long_int != yes ; then
    265    AC_MSG_WARN([Compiler $CXX does not support `long long'.
    266           svndigest must be compiled with a compiler that supports `long long'.])
    267    all_reqs_ok="false"
     266  AC_MSG_WARN([Compiler $CXX does not support `long long'.
     267  svndigest must be compiled with a compiler that supports `long long'.])
     268  all_reqs_ok="false"
    268269fi
    269270
    270271if (test "$all_reqs_ok" = "false") ; then
    271     AC_MSG_ERROR([Some pre-requisites were not fulfilled, aborting
    272     configure. Please consult the 'README' file for more information
    273     about what is needed to compile svndigest and refer to above
    274     warning messages. Needed files were NOT created.])
     272  AC_MSG_ERROR([Some pre-requisites were not fulfilled, aborting
     273  configure. Please consult the 'README' file for more information
     274  about what is needed to compile svndigest and refer to above
     275  warning messages. Needed files were NOT created.])
    275276fi
    276277
     
    292293
    293294# Failure to locate gnuplot is not considered fatal
    294 if (test "$GNUPLOT" != "ok") ; then
    295     AC_MSG_WARN([Gnuplot was not found. svndigest will compile
    296     without gnuplot but will throw an exception at run-time. Please
    297     install gnuplot (available for a wide range of operating systems
    298     at http://www.gnuplot.info).])
    299     AC_MSG_NOTICE([])
    300 fi
    301 
    302 if test "$enable_staticbin" = "yes"; then
    303     AC_MSG_NOTICE([A statically linked 'svndigest' binary will be created.])
    304 else
    305     AC_MSG_NOTICE([A dynamically linked 'svndigest' binary will be created.])
    306 fi
    307     AC_MSG_NOTICE([])
    308 
    309 AC_MSG_NOTICE([Now type 'make ; make check'.])
    310 
     295if (test "x$GNUPLOT" = "xno") ; then
     296  AC_MSG_WARN([Gnuplot was not found. svndigest will compile
     297  without gnuplot but will throw an exception at run-time. Please
     298  install gnuplot (available for a wide range of operating systems
     299  at http://www.gnuplot.info).])
     300  AC_MSG_NOTICE([])
     301fi
     302
     303AC_MSG_NOTICE([Now type 'make && make check'.])
Note: See TracChangeset for help on using the changeset viewer.