Changeset 3588


Ignore:
Timestamp:
Jan 19, 2017, 3:02:04 PM (5 years ago)
Author:
Peter
Message:

refs #878

Modify macro YAT_CHECK_HEADER so it adds -DYAT_WITHOUT_CXX11 if
needed. It first tries compiling against yat/utility/Vector.h; it it
fails, it retries with -DYAT_WITHOUT_CXX11. If that works, it means
yat was built with c++11 support but the current compiler does not
support, so we turn it off by adding -DYAT_WITHOUT_CXX11 to
$YAT_CPPFLAGS.

Fixing two tests.

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/m4/yat.m4

    r3054 r3588  
    11## $Id$
    22#
    3 # serial 9  (yat 0.11)
     3# serial 10  (yat 0.15)
    44#
    55# see http://www.gnu.org/software/automake/manual/automake.html#Serials
     
    216216    AC_LANG_ASSERT([C++])
    217217    # checking for Vector, which uses both GSL and Boost
    218     AC_CHECK_HEADER([yat/utility/Vector.h],
    219                     [ac_yat_ok="yes"],
    220                     [ac_yat_ok="no"])
     218    AC_MSG_CHECKING([for yat/utility/Vector.h])
     219    _YAT_CHECK_HEADER([yat/utility/Vector.h], [
     220      AC_MSG_RESULT([yes])
     221      ac_yat_ok="yes"
     222    ], [
     223      AC_MSG_RESULT([no])
     224      AC_MSG_CHECKING([for yat/utility/Vector.h with -DYAT_WITHOUT_CXX11])
     225      CPPFLAGS="$CPPFLAGS -DYAT_WITHOUT_CXX11"
     226      _YAT_CHECK_HEADER([yat/utility/Vector.h], [
     227        YAT_CPPFLAGS="$YAT_CPPFLAGS -DYAT_WITHOUT_CXX11"
     228        ac_yat_ok="yes"
     229        AC_MSG_RESULT([yes])
     230      ], [
     231        ac_yat_ok="no"
     232        AC_MSG_RESULT([no])
     233      ])
     234    ])
    221235
    222236    # checking that version in yat-config and version.h agree
     
    364378
    365379
     380# _YAT_CHECK_HEADER(header, [ACTION-IF_FOUND], [ACTION-IF-NOT-FOUND])
     381#
     382AC_DEFUN([_YAT_CHECK_HEADER],
     383[
     384    AC_COMPILE_IFELSE([AC_LANG_PROGRAM([@%:@include <$1>], [])],
     385                      [$2], [$3])
     386])
     387
     388
    366389# _YAT_CHECK_LIB_YAT([ACTION-IF_FOUND], [ACTION-IF-NOT-FOUND])
    367390#
  • trunk/test/yat_m4_with_bam_test.sh

    r3417 r3588  
    2727cat >> configure.ac <<EOF
    2828YAT_CHECK_HEADER([], [AC_MSG_ERROR])
     29CPPFLAGS="\$YAT_CPPFLAGS"
    2930LDFLAGS="\$LDFLAGS \`\$yat_config --ldflags\`"
    3031LIBS="\$LIBS \`\$yat_config --link-libtool\`"
  • trunk/test/yat_pc_test.sh

    r3582 r3588  
    5757}
    5858
     59PATH="$abs_top_builddir/build_support:$PATH"
     60export PATH
    5961
    6062# add PATH so pkg-config find yat.pc in build tree first
Note: See TracChangeset for help on using the changeset viewer.