Changeset 3088 for trunk/configure.ac


Ignore:
Timestamp:
Sep 26, 2013, 8:38:17 AM (8 years ago)
Author:
Peter
Message:

avoid repetetive code and add tests for boost libs. refs #737

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/configure.ac

    r3087 r3088  
    198198APR_SAVE_THE_ENVIRONMENT(LDFLAGS)
    199199APR_SAVE_THE_ENVIRONMENT(LIBS)
     200user_LIBS=$LIBS
    200201
    201202AS_CASE([$host_os], [darwin*], [
     
    215216# 737 for discussion.
    216217YAT_STATIC_LIBS=
    217 AC_MSG_CHECKING([if libtool archive can be created with $LIBM])
    218 YAT_LT_LINK_LA_IFELSE([
     218YAT_CHECK_LA_LIBS([
    219219  double cos(double x);
    220220  double foo(double x) { return cos(x); }
    221 ], [
    222   AC_MSG_RESULT([yes])
    223 ], [
    224   AC_MSG_RESULT([no])
    225   YAT_STATIC_LIBS="$YAT_STATIC_LIBS $LIBM"
    226 ])
     221], [$LIBS], [$LIBM], [YAT_STATIC_LIBS])
    227222
    228223# find library implementing BLAS C API, or use gslcblas
     
    239234])
    240235
    241 AC_MSG_CHECKING([if libtool archive can be created with -lgsl])
    242 YAT_LT_LINK_LA_IFELSE([
     236YAT_CHECK_LA_LIBS([
    243237  double gsl_cdf_hypergeometric_P(const unsigned int k, const unsigned int n1,
    244238                                  const unsigned int n2, const unsigned int t);
    245239  double yat_foo(void) { return gsl_cdf_hypergeometric_P(1,2,3,10); }
    246 ], [
    247   AC_MSG_RESULT([yes])
    248 ], [
    249   AC_MSG_RESULT([no])
    250   YAT_STATIC_LIBS="$YAT_STATIC_LIBS -lgsl"
    251 ])
     240], [$LIBS], [-lgsl], [YAT_STATIC_LIBS])
    252241
    253242# Boost http://www.boost.org
     
    274263                  AC_MSG_FAILURE([Boost thread library not found.])
    275264                 ])
     265  # Check if $BOOST_THREAD_LIB is appropriate for libyat.la
     266  YAT_CHECK_LA_LIBS([
     267    @%:@include <boost/thread.hpp>
     268    int my_func(void)
     269    { boost::mutex mutex_; return 0; }
     270  ], [$BOOST_THREAD_LIB $user_LIBS], [$BOOST_THREAD_LIB], [YAT_STATIC_LIBS])
     271  # Check if $BOOST_SYSTEM_LIB is appropriate for libyat.la
     272  YAT_CHECK_LA_LIBS([
     273    @%:@include <boost/system/error_code.hpp>
     274    int my_func(void)
     275    { boost::system::system_category; return 0; }
     276  ], [$BOOST_SYSTEM_LIB $user_LIBS], [$BOOST_SYSTEM_LIB], [YAT_STATIC_LIBS])
    276277])
    277278
Note: See TracChangeset for help on using the changeset viewer.