Changeset 3581


Ignore:
Timestamp:
Jan 19, 2017, 2:46:51 AM (5 years ago)
Author:
Peter
Message:

refs #878

Make configure try to turn on compiler switches (such as -std=c++11),
so it supports rvalues. If found, #define YAT_HAVE_RVALUE, which can
be used both in source files and in header files. For header files,
<yat/utility/config_public.h> must be #included.

As detailed in README users can turn off cxx11 support when at
configure time of yat, or at compile time of user's package with
preprocessor definition YAT_WITHOUT_CXX.

Location:
trunk
Files:
1 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/README

    r3550 r3581  
    152152  #> ./configure LDFLAGS="-L/usr/lib64/atlas"
    153153
     154=== Rvalues ===
     155
     156The configure script tries to find a modern compiler that understands
     157rvalues and move semantics, and turns on switches such as '-std=c++11'
     158if needed. This search can be turned off by invoking
     159
     160  #> ./configure --without-cxx11
     161
     162If a compiler with rvalue support is found, macro YAT_HAVE_RVALUE is
     163#defined in 'config.h' and move constructors and move assignments is
     164available for certain classes plus that moves are used internally. If
     165yat is built with rvalue support, yat's header are not compatible with
     166a compiler that lack the support. Packages that use autoconf you can
     167use macro YAT_CXX_RVALUE, defined in 'm4/yat_cxx_rvalue', to turn on
     168the compiler switch in the same fashion as yat's
     169configure. Alternatively, yat's choice of compiler with needed
     170switches can be accessed via `yat-config --cxx`. If necessary, you can
     171turn off rvalue support completely by compiling your program with the
     172preprocessor definition YAT_WITHOUT_CXX11.
     173
    154174=== Doxygen ===
    155175
  • trunk/configure.ac

    r3562 r3581  
    8686m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
    8787AC_PROG_CXX
     88
     89AC_ARG_WITH([cxx11],
     90            [AS_HELP_STRING([--without-cxx11],
     91                            [build with no disable C++11 support])],
     92            [],
     93            [with_cxx11=yes])
     94
     95# if CXX11 is wanted look for rvalue support
     96yat_have_rvalue=no
     97AS_VAR_IF([with_cxx11], [no], [], [
     98  YAT_CXX_RVALUE([yat_have_rvalue=yes
     99                  AC_DEFINE([YAT_HAVE_RVALUE], [1],
     100                            [Define if compiler support rvalues])])
     101])
     102
    88103AC_PROG_SED
    89104AC_PROG_LIBTOOL
     
    639654  Build Documentation:  $doxygen_message
    640655  With Bam Support:     $with_htslib
     656  With Rvalue Support:  $yat_have_rvalue
    641657
    642658Options used to compile and link:
  • trunk/doc/build_tool.doxygen

    r3133 r3581  
    4141OBJECTS=$(SRC:.cc=.o)
    4242
     43CXX=`yat-config --cxx`
    4344CPPFLAGS+=`yat-config --cppflags`
    4445CXXFLAGS+=`yat-config --cxxflags`
  • trunk/m4/Makefile.am

    r3330 r3581  
    2525aclocal_DATA += m4/yat_add_flag.m4
    2626aclocal_DATA += m4/yat_am_macros.m4
     27aclocal_DATA += m4/yat_cxx_rvalue.m4
    2728aclocal_DATA += m4/yat_cblas.m4
    2829aclocal_DATA += m4/yat_check_libbam.m4
  • trunk/yat/utility/config_public.h.in

    r3439 r3581  
    5656#undef YAT_HAVE_BOOST_CONCEPT_WITH_CONSTRUCTOR
    5757
     58/// Don't turn on cxx11 features if user explicitely turned off cxx11.
     59#ifndef YAT_WITHOUT_CXX11
     60/// Define if compiler support rvalues */
     61#undef YAT_HAVE_RVALUE
     62#endif
     63
    5864/// Define to 1 if boost::exception_ptr works
    5965#undef YAT_HAVE_WORKING_BOOST_EXCEPTION_PTR
Note: See TracChangeset for help on using the changeset viewer.