Changeset 887 for trunk


Ignore:
Timestamp:
Nov 25, 2009, 4:20:36 AM (12 years ago)
Author:
Peter Johansson
Message:

refs #401

splitting LIBS *FLAGS into prefixes APR_ SVN_ and DEFAULT_
and modified configure end output to use these flags.

Location:
trunk
Files:
1 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/bin/Makefile.am

    r858 r887  
    2929
    3030LDADD = $(top_builddir)/lib/libsvndigest.a \
    31   $(top_builddir)/lib/yat/libyat.a $(SVNDIGEST_LIBS)
    32 AM_LDFLAGS = $(SVNDIGEST_LDFLAGS) $(PLPLOT_LDFLAGS)
     31  $(top_builddir)/lib/yat/libyat.a $(SVN_LIBS) $(APR_LIBS)
     32AM_LDFLAGS = $(APR_LDFLAGS) $(SVN_LDFLAGS) $(PLPLOT_LDFLAGS)
    3333
    34 AM_CPPFLAGS = -I$(top_srcdir)/lib $(SVNDIGEST_CPPFLAGS)
    35 AM_CXXFLAGS = $(SVNDIGEST_CXXFLAGS)
    36 
     34AM_CPPFLAGS  = -I$(top_srcdir)/lib $(DEFAULT_CPPFLAGS) \
     35  $(APR_CPPFLAGS) $(SVN_CPPFLAGS)
     36AM_CXXFLAGS = $(DEFAULT_CXXFLAGS)
    3737
    3838clean-local:
  • trunk/configure.ac

    r880 r887  
    8686
    8787# Save FLAGS
    88 SAVE_CPPFLAGS="$CPPFLAGS"
    89 SAVE_CXXFLAGS="$CXXFLAGS"
    90 SAVE_LDFLAGS="$LDFLAGS"
    91 SAVE_LIBS="$LIBS"
     88APR_SAVE_THE_ENVIRONMENT(CPPFLAGS)
     89APR_SAVE_THE_ENVIRONMENT(CXXFLAGS)
    9290
    9391# -Wno-long-long is needed to suppress compiler diagnostics regarding
    9492# using extension beyond the C++ standard (usage of non C++ standard
    9593# 'long long' types).
    96 YAT_CXX_ADD_FLAG([SD_CXXFLAGS],[-pedantic -Wno-long-long])
     94YAT_CXX_ADD_FLAG([CXXFLAGS],[-pedantic -Wno-long-long])
    9795AC_TYPE_LONG_LONG_INT
    9896AS_IF([test x$ac_cv_type_long_long_int = xno],
     
    104102
    105103AS_IF([test x$enable_debug = xyes],
    106   [YAT_CXX_ADD_FLAG([SD_CXXFLAGS],[-g -O])],
    107   [YAT_CPP_ADD_FLAG([SD_CPPFLAGS],[-DNDEBUG])
    108    YAT_CXX_ADD_FLAG([SD_CXXFLAGS],[-O3])])
     104  [YAT_CXX_ADD_FLAG([CXXFLAGS],[-g -O])],
     105  [YAT_CPP_ADD_FLAG([CPPFLAGS],[-DNDEBUG])
     106   YAT_CXX_ADD_FLAG([CXXFLAGS],[-O3])])
    109107
    110108# Apache Portable Runtime (APR) API checks
    111 APR_FIND_APR(,,1,[1 0])
     109APR_FIND_APR(,,[1],[1 0])
    112110AS_IF([test "${with_apr+set}" = set],
    113111    [DISTCHECK_CONFIGURE_FLAGS="$DISTCHECK_CONFIGURE_FLAGS --with-apr=$with_apr"]
    114112)
    115113if test "$apr_found" = "yes" ; then
    116     SD_LIBS="`$apr_config --libs` $SD_LIBS"
    117     apr_link_ld=`$apr_config --link-ld`
     114    APR_LIBS="`$apr_config --libs`"
     115    apr_link_ld="`$apr_config --link-ld`"
    118116    for i in $apr_link_ld; do
    119       AS_IF([test ${i:0:2} = "-l"],[SD_LIBS="$i $SD_LIBS"],
    120             [YAT_LD_ADD_FLAG([SD_LDFLAGS], [$i])])
     117      AS_IF([test ${i:0:2} = "-l"],[APR_LIBS="$i $APR_LIBS"],
     118            [YAT_LD_ADD_FLAG([APR_LDFLAGS], [$i])])
    121119    done
    122     YAT_CPP_ADD_FLAG([SD_CPPFLAGS],[`$apr_config --includes --cppflags`])
    123 fi
     120    YAT_CPP_ADD_FLAG([APR_CPPFLAGS],[`$apr_config --includes --cppflags`])
     121    save_CPPFLAGS=$CPPFLAGS
     122    CPPFLAGS="$APR_CPPFLAGS $CPPFLAGS"
     123    AC_CHECK_HEADER([apr_allocator.h],,[apr_found="no"])
     124    CPPFLAGS=$save_CPPFLAGS
     125fi
     126AC_SUBST([APR_CPPFLAGS])
     127AC_SUBST([APR_LDFLAGS])
     128AC_SUBST([APR_LIBS])
    124129
    125130# Subversion API checks
    126131svn_found="yes"
    127 AC_ARG_WITH(svn,
     132AC_ARG_WITH([svn],
    128133  [AS_HELP_STRING([--with-svn=DIR],[prefix for svn developer files [[PREFIX]]])],
    129134  [ DISTCHECK_CONFIGURE_FLAGS="$DISTCHECK_CONFIGURE_FLAGS --with-svn=$withval"
    130     YAT_LD_ADD_FLAG([SD_LDFLAGS], [-L$withval/lib])
    131     YAT_CPP_ADD_FLAG([SD_CPPFLAGS], [-I$withval/include])
     135    YAT_LD_ADD_FLAG([SVN_LDFLAGS], [-L$withval/lib])
     136    YAT_CPP_ADD_FLAG([SVN_CPPFLAGS], [-I$withval/include])
    132137  ])
    133 
    134 
    135 
    136 # Use SD_*FLAGS in tests
    137 CPPFLAGS="$SD_CPPFLAGS $CPPFLAGS"
    138 CXXFLAGS="$SD_CXXFLAGS $CXXFLAGS"
    139 LDFLAGS="$SD_LDFLAGS $LDFLAGS"
    140 LIBS="$SD_LIBS $LIBS"
    141 
    142 AC_CHECK_HEADER([apr_allocator.h],,apr_found="no")
    143 AC_CHECK_HEADER([subversion-1/svn_types.h],,svn_found="no")
     138# svn needs needs apr headers
     139save_CPPFLAGS=$CPPFLAGS
     140CPPFLAGS="$APR_CPPFLAGS $SVN_CPPFLAGS $CPPFLAGS"
     141AC_CHECK_HEADER([subversion-1/svn_types.h],,[svn_found="no"])
     142CPPFLAGS=$save_CPPFLAGS
     143
     144save_LDFLAGS=$LDFLAGS
     145save_LIBS=$LIBS
     146tmp_LIBS="$APR_LIBS $save_LIBS"
     147LIBS=""
     148LDFLAGS="$SVN_LDFLAGS $APR_LDFLAGS"
    144149AC_SEARCH_LIBS([svn_cmdline_setup_auth_baton],[svn_subr-1],
    145                [SD_LIBS="-lsvn_subr-1 $SD_LIBS"],svn_found="no")
    146 AC_SEARCH_LIBS([svn_ra_initialize],[svn_ra-1],
    147                [SD_LIBS="-lsvn_ra-1 $SD_LIBS"],svn_found="no")
    148 AC_SEARCH_LIBS([svn_wc_adm_open3],[svn_wc-1],
    149                [SD_LIBS="-lsvn_wc-1 $SD_LIBS"],svn_found="no")
    150 AC_SEARCH_LIBS([svn_diff_file_options_create],[svn_diff-1],
    151                [SD_LIBS="-lsvn_diff-1 $SD_LIBS"],svn_found="no")
    152 AC_SEARCH_LIBS([svn_client_log3],[svn_client-1],
    153                [SD_LIBS="-lsvn_client-1 $SD_LIBS"],svn_found="no")
    154 
    155 # Export flags
    156 AC_SUBST([SVNDIGEST_CPPFLAGS], $SD_CPPFLAGS)
    157 AC_SUBST([SVNDIGEST_CXXFLAGS], $SD_CXXFLAGS)
    158 AC_SUBST([SVNDIGEST_LDFLAGS], $SD_LDFLAGS)
    159 AC_SUBST([SVNDIGEST_LIBS], $SD_LIBS)
    160 
    161 # Reset FLAGS
    162 CPPFLAGS="$SAVE_CPPFLAGS"
    163 CXXFLAGS="$SAVE_CXXFLAGS"
    164 LDFLAGS="$SAVE_LDFLAGS"
    165 LIBS="$SAVE_LIBS"
     150               [], [svn_found="no"], [$tmp_LIBS])
     151AC_SEARCH_LIBS([svn_ra_initialize],[svn_ra-1], [], [svn_found="no"],[$tmp_LIBS])
     152AC_SEARCH_LIBS([svn_wc_adm_open3],[svn_wc-1], [], [svn_found="no"], [$tmp_LIBS])
     153AC_SEARCH_LIBS([svn_diff_file_options_create],[svn_diff-1],[],
     154               [svn_found="no"], [$tmp_LIBS])
     155AC_SEARCH_LIBS([svn_client_log3],[svn_client-1],,[svn_found="no"], [$tmp_LIBS])
     156SVN_LIBS=$LIBS
     157LIBS=$save_LIBS
     158LDFLAGS=$save_LDFLAGS
     159AC_SUBST([SVN_CPPFLAGS])
     160AC_SUBST([SVN_LDFLAGS])
     161AC_SUBST([SVN_LIBS])
     162
    166163
    167164# check if svnversion is installed
     
    184181AM_CONDITIONAL([HAVE_SVN_WC], [test "$wc_found" = "yes"])
    185182AC_SUBST([wc_found])
     183
     184# Reset FLAGS
     185APR_RESTORE_THE_ENVIRONMENT([CPPFLAGS], [DEFAULT_])
     186APR_RESTORE_THE_ENVIRONMENT([CXXFLAGS], [DEFAULT_])
    186187
    187188# checking if we have test repo
     
    299300
    300301# Some more messages.
    301 AC_MSG_NOTICE([])
    302 AC_MSG_NOTICE([   Ready to compile the executables of svndigest $VERSION])
    303 AC_MSG_NOTICE([   The following flags and libs will be used:])
    304 AC_MSG_NOTICE([   +++++++++++++++++++++++++++++++++++++++++++++++])
    305 AC_MSG_NOTICE([    Compiler:           $CXX])
    306 AC_MSG_NOTICE([    Preprocessor flags: $SD_CPPFLAGS $CPPFLAGS])
    307 AC_MSG_NOTICE([    C++ flags:          $SD_CXXFLAGS $CXXFLAGS])
    308 AC_MSG_NOTICE([    Linker flags:       $SD_LDFLAGS $LDFLAGS])
    309 AC_MSG_NOTICE([    LIBS:               $SD_LIBS $LIBS])
    310 AC_MSG_NOTICE([    PLPLOT_LDFLAGS:     $PLPLOT_LDFLAGS])
    311 AC_MSG_NOTICE([   +++++++++++++++++++++++++++++++++++++++++++++++])
    312 AC_MSG_NOTICE([])
     302AC_MSG_NOTICE([
     303Ready to compile the executables of svndigest $VERSION
     304The following flags and libs will be used:
     305+++++++++++++++++++++++++++++++++++++++++++++++
     306  Compiler:           $CXX
     307  Preprocessor flags: $SD_CPPFLAGS $CPPFLAGS
     308    CPPFLAGS:         $CPPFLAGS
     309    DEFAULT_CPPFLAGS: $DEFAULT_CPPFLAGS
     310    APR_CPPFLAGS:     $APR_CPPFLAGS
     311    SVN_CPPFLAGS:     $SVN_CPPFLAGS
     312  C++ flags:
     313    CXXFLAGS:         $CXXFLAGS
     314    DEFAULT_CXXFLAGS: $DEFAULT_CXXFLAGS
     315  Linker flags:
     316    LDFLAGS:          $LDFLAGS
     317    APR_LDFLAGS:      $APR_LDFLAGS
     318    SVN_LDFLAGS:      $SVN_LDFLAGS
     319    PLPLOT_LDFLAGS:   $PLPLOT_LDFLAGS
     320  Libraries:         
     321    LIBS              $LIBS
     322    APR_LIBS          $APR_LIBS
     323    SVN_LIBS          $SVN_LIBS
     324+++++++++++++++++++++++++++++++++++++++++++++++]dnl
     325)
    313326
    314327AC_MSG_NOTICE([Now type 'make all check'.])
  • trunk/lib/Makefile.am

    r874 r887  
    2626SUBDIRS = yat .
    2727
    28 AM_CPPFLAGS = $(SVNDIGEST_CPPFLAGS)
    29 AM_CXXFLAGS = $(SVNDIGEST_CXXFLAGS)
     28AM_CPPFLAGS = $(DEFAULT_CPPFLAGS) $(APR_CPPFLAGS) $(SVN_CPPFLAGS)
     29AM_CXXFLAGS = $(DEFAULT_CXXFLAGS)
    3030
    3131noinst_LIBRARIES = libsvndigest.a
  • trunk/lib/yat/Makefile.am

    r795 r887  
    2222MOVE_IF_CHANGE = $(SHELL) $(abs_top_srcdir)/build_support/move-if-change
    2323
    24 AM_CPPFLAGS = $(SVNDIGEST_CPPFLAGS)
    25 AM_CXXFLAGS = $(SVNDIGEST_CXXFLAGS)
     24AM_CPPFLAGS = $(DEFAULT_CPPFLAGS)
     25AM_CXXFLAGS = $(DEFAULT_CXXFLAGS)
    2626
    2727noinst_LIBRARIES = libyat.a
  • trunk/test/Makefile.am

    r858 r887  
    3939  $(top_builddir)/lib/libsvndigest.a \
    4040  $(top_builddir)/lib/yat/libyat.a \
    41   $(SVNDIGEST_LIBS)
     41  $(SVN_LIBS) $(APR_LIBS)
    4242AM_LDFLAGS = $(SVNDIGEST_LDFLAGS) $(PLPLOT_LDFLAGS)
    4343
    44 AM_CPPFLAGS = -I$(top_srcdir)/lib $(SVNDIGEST_CPPFLAGS)
    45 AM_CXXFLAGS = $(SVNDIGEST_CXXFLAGS)
     44AM_CPPFLAGS = -I$(top_srcdir)/lib $(APR_CPPFLAGS) $(SVN_CPPFLAGS) \
     45  $(DEFAULT_CPPFLAGS)
     46AM_CXXFLAGS = $(DEFAULT_CXXFLAGS)
    4647
    4748libsvndigesttest_a_SOURCES = Suite.cc
Note: See TracChangeset for help on using the changeset viewer.