Changeset 164


Ignore:
Timestamp:
Aug 24, 2006, 12:51:01 AM (13 years ago)
Author:
Jari Häkkinen
Message:

Fixes #33. Added configure checks for APR and subversion APIs.

Location:
trunk
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/ChangeLog

    r162 r164  
    2424
    2525version pre0.5:
    26   - 'configure' now checks for APR libraries.
     26  - 'configure' now checks for APR and subversion APIs.
    2727  - Added a --enable-debug option to autoconf. The project is
    2828    compiled without debug code by default. Use './configure
  • trunk/bin/Makefile.am

    r148 r164  
    2828noinst_HEADERS = Parameter.h
    2929
    30 LDADD = @top_srcdir@/lib/libsvndigest.a -L$(APR_PATH)/lib -L$(SVN_PATH)/lib \
    31   -lsvn_client-1 -lsvn_diff-1 -lsvn_wc-1 -lsvn_ra-1 -lsvn_subr-1 -lapr-0
     30LDADD = @top_srcdir@/lib/libsvndigest.a
    3231
    33 INCLUDES = -I@top_srcdir@/lib \
    34   -I$(SVN_PATH)/include/subversion-1 -I$(APR_PATH)/include/apr-0
     32INCLUDES = -I@top_srcdir@/lib
    3533
    3634clean-local:
  • trunk/configure.ac

    r162 r164  
    5050AC_ARG_ENABLE(debug,[  --enable-debug          turn on debug options and code])
    5151if test "${enable_debug}" = "yes" ; then
    52   CXXFLAGS="$CXXFLAGS -g -O"
     52    CXXFLAGS="$CXXFLAGS -g -O"
    5353else
    54   CPPFLAGS="$CPPFLAGS -DNDEBUG"
    55   CXXFLAGS="$CXXFLAGS -O3"
     54    CPPFLAGS="$CPPFLAGS -DNDEBUG"
     55    CXXFLAGS="$CXXFLAGS -O3"
    5656fi
    5757
    58 # Apache Portable Runtime (APR) checks
     58# Apache Portable Runtime (APR) API checks
    5959AC_ARG_WITH(apr,
    6060  [  --with-apr=DIR          prefix for installed APR or path to APR build
    61                           tree [[PREFIX]]],
    62   [ APR_PATH=$withval ],
    63   [ APR_PATH=$prefix ])
    64 AC_SUBST(APR_PATH)
    65 # Include macros distributed within the APR project
     61                          tree [[PREFIX]]])
     62# Include APR_FIND_APR macro distributed within the APR project. If
     63# the usage of the APR macro is to be omitted then the construct for
     64# setting the CXXFLAGS (header file location) and LDFLAGS (linking
     65# informaion) for APR must be changed. The latter can be achieved with
     66# AC_SEARCH_LIBS([apr_allocator_create],[apr-0],,apr_found="no") but
     67# apr-0 must be prior knowledge.
    6668sinclude(./build_support/find_apr.m4)
    6769APR_FIND_APR(,,1)
     70if test "$apr_found" = "yes" ; then
     71    LDFLAGS="$LDFLAGS `$apr_config --link-ld`"
     72    CPPFLAGS="$CPPFLAGS `$apr_config --includes`"
     73    AC_CHECK_HEADER([apr_allocator.h],,apr_found="no")
     74fi
    6875
     76# Subversion API checks
     77svn_found="yes"
    6978AC_ARG_WITH(svn,
    7079  [  --with-svn=DIR          prefix for svn developer files [[PREFIX]]],
    71   [ SVN_PATH=$withval ],
    72   [ SVN_PATH=$prefix ])
    73 AC_SUBST(SVN_PATH)
     80  [ LDFLAGS="$LDFLAGS -L$withval/lib" CPPFLAGS="$CPPFLAGS -I$withval/include"])
     81AC_CHECK_HEADER([subversion-1/svn_types.h],,svn_found="no")
     82AC_SEARCH_LIBS([svn_cmdline_setup_auth_baton],[svn_subr-1],,svn_found="no")
     83AC_SEARCH_LIBS([svn_ra_initialize],[svn_ra-1],,svn_found="no")
     84AC_SEARCH_LIBS([svn_wc_adm_open3],[svn_wc-1],,svn_found="no")
     85AC_SEARCH_LIBS([svn_diff_file_options_create],[svn_diff-1],,svn_found="no")
     86AC_SEARCH_LIBS([svn_client_log3],[svn_client-1],,svn_found="no")
    7487
    7588AC_CONFIG_FILES([Makefile
     
    7891                test/Makefile])
    7992
     93# Print failure status information about selected items, and exit if
     94# fatal errors were encountered. No output will be created if
     95# configure is halted prematurely.
     96
     97# used to trigger exit before creation of output
     98all_reqs_ok="true"
     99
     100# Non-existing APR is fatal -- sub-sequent compilation will fail.
     101if (test "$apr_found" = "no") ; then
     102    AC_MSG_WARN([APR not found. The Apache Portable Runtime
     103    (APR) library cannot be found. Please make sure APR is installed
     104    and supply the appropriate --with-apr option to 'configure'.])
     105    all_reqs_ok="false"
     106fi
     107
     108# Non-existing subversion API is fatal -- sub-sequent compilation will fail.
     109if (test "$svn_found" = "no") ; then
     110    AC_MSG_WARN([Subversion API not found. Subversion API libraries
     111    cannot be found. Make sure the APIs are installed and supply the
     112    appropriate --with-svn option to 'configure'.])
     113    all_reqs_ok="false"
     114fi
     115
     116if (test "$all_reqs_ok" = "false") ; then
     117    AC_MSG_ERROR([Some pre-requisites were not fulfilled, aborting
     118    configure. Please consult the 'README' file for more information
     119    about what is needed to compile svndigest and refer to above
     120    warning messages. Needed output files were NOT created.])
     121fi
     122
     123# Create output.
    80124AC_OUTPUT
    81125
    82 echo ""
    83 echo "   Ready to compile the executables of svndiget"
    84 echo "   The following compilers and flags will be used:"
    85 echo "   +++++++++++++++++++++++++++++++++++++++++++++++"
    86 echo "    Preprocessor flags: CPPFLAGS=\"$CPPFLAGS\""
    87 echo "    C++ flags:          CXXFLAGS=\"$CXXFLAGS\""
    88 echo "    Linker flags:       LDFLAGS=\"$LDFLAGS\""
    89 echo "   +++++++++++++++++++++++++++++++++++++++++++++++"
    90 echo ""
     126# Some more messages.
     127AC_MSG_NOTICE([])
     128AC_MSG_NOTICE([   Ready to compile the executables of svndiget])
     129AC_MSG_NOTICE([   The following compilers and flags will be used:])
     130AC_MSG_NOTICE([   +++++++++++++++++++++++++++++++++++++++++++++++])
     131AC_MSG_NOTICE([    Preprocessor flags: CPPFLAGS=\"$CPPFLAGS\"])
     132AC_MSG_NOTICE([    C++ flags:          CXXFLAGS=\"$CXXFLAGS\"])
     133AC_MSG_NOTICE([    Linker flags:       LDFLAGS=\"$LDFLAGS\"])
     134AC_MSG_NOTICE([    LIBS:               LIBS=\"$LIBS\"])
     135AC_MSG_NOTICE([   +++++++++++++++++++++++++++++++++++++++++++++++])
     136AC_MSG_NOTICE([])
    91137
    92 test "$GNUPLOT" = "ok" || \
    93      AC_MSG_WARN([Gnuplot was not found. svndigest will compile
    94      without gnuplot but will throw an exception at runtime. Please
    95      install gnuplot (available for a wide range of operating systems
    96      at http://www.gnuplot.info).])
    97 
    98 if test $apr_found = "no"; then
    99     AC_MSG_WARN([APR not found. The Apache Portable Runtime (APR)
    100     library cannot be found. Please supply the appropriate --with-apr
    101     option to 'configure'.])
     138# Failure to locate gnuplot is not considered fatal
     139if (test "$GNUPLOT" != "ok") ; then
     140    AC_MSG_WARN([Gnuplot was not found. svndigest will compile
     141    without gnuplot but will throw an exception at runtime. Please
     142    install gnuplot (available for a wide range of operating systems
     143    at http://www.gnuplot.info).])
     144    AC_MSG_NOTICE([])
    102145fi
    103146
    104 echo ""
    105 echo "If no warnings appear above it is safe to type 'make ; make check'."
    106 echo ""
     147AC_MSG_NOTICE([Now type 'make ; make check'.])
  • trunk/lib/Makefile.am

    r149 r164  
    3232  SVNinfo.cc utility.cc
    3333
    34 INCLUDES = -I$(SVN_PATH)/include/subversion-1 -I$(APR_PATH)/include/apr-0
    35 
    3634clean-local:
    3735  rm -rf *~
  • trunk/lib/SVN.cc

    r149 r164  
    2828#include <apr_allocator.h>
    2929#include <apr_hash.h>
    30 #include <svn_client.h>
    31 #include <svn_cmdline.h>
    32 #include <svn_path.h>
    33 #include <svn_pools.h>
    34 #include <svn_wc.h>
     30#include <subversion-1/svn_client.h>
     31#include <subversion-1/svn_cmdline.h>
     32#include <subversion-1/svn_path.h>
     33#include <subversion-1/svn_pools.h>
     34#include <subversion-1/svn_wc.h>
    3535
    3636namespace theplu {
  • trunk/lib/SVN.h

    r149 r164  
    2929#include <vector>
    3030
    31 #include <svn_client.h>
    32 #include <svn_types.h>
     31#include <subversion-1/svn_client.h>
     32#include <subversion-1/svn_types.h>
    3333
    3434namespace theplu {
  • trunk/lib/SVNblame.h

    r149 r164  
    2828#include <vector>
    2929
    30 #include <svn_client.h>
     30#include <subversion-1/svn_client.h>
    3131
    3232namespace theplu {
  • trunk/lib/SVNinfo.h

    r149 r164  
    2727#include <string>
    2828
    29 #include <svn_client.h>
     29#include <subversion-1/svn_client.h>
    3030
    3131namespace theplu {
  • trunk/lib/Stats.h

    r149 r164  
    2828#include "Parser.h"
    2929
    30 #include <svn_types.h>
     30#include <subversion-1/svn_types.h>
    3131
    3232#include <map>
Note: See TracChangeset for help on using the changeset viewer.