Ignore:
Timestamp:
01/25/12 16:07:23 (13 years ago)
Author:
tbretz
Message:
Adapted to local version of c++0x check
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/FACT++/aclocal.m4

    r12756 r12768  
    1919If you have problems, you may need to regenerate the build system entirely.
    2020To do so, use the procedure documented by the package, typically `autoreconf'.])])
    21 
    22 # ===========================================================================
    23 #        http://autoconf-archive.cryp.to/ac_cxx_compile_stdcxx_0x.html
    24 # ===========================================================================
    25 #
    26 # SYNOPSIS
    27 #
    28 #   AC_CXX_COMPILE_STDCXX_0X
    29 #
    30 # DESCRIPTION
    31 #
    32 #   Check for baseline language coverage in the compiler for the C++0x
    33 #   standard.
    34 #
    35 # LICENSE
    36 #
    37 #   Copyright (c) 2008 Benjamin Kosnik <bkoz@redhat.com>
    38 #
    39 #   Copying and distribution of this file, with or without modification, are
    40 #   permitted in any medium without royalty provided the copyright notice
    41 #   and this notice are preserved.
    42 
    43 AC_DEFUN([AC_CXX_COMPILE_STDCXX_0X], [
    44   AC_CACHE_CHECK(if g++ supports C++0x features without additional flags,
    45   ac_cv_cxx_compile_cxx0x_native,
    46   [AC_LANG_SAVE
    47   AC_LANG_CPLUSPLUS
    48   AC_TRY_COMPILE([
    49   template <typename T>
    50     struct check
    51     {
    52       static_assert(sizeof(int) <= sizeof(T), "not big enough");
    53     };
    54 
    55     typedef check<check<bool>> right_angle_brackets;
    56 
    57     int a;
    58     decltype(a) b;
    59 
    60     typedef check<int> check_type;
    61     check_type c;
    62     check_type&& cr = c;],,
    63   ac_cv_cxx_compile_cxx0x_native=yes, ac_cv_cxx_compile_cxx0x_native=no)
    64   AC_LANG_RESTORE
    65   ])
    66 
    67   AC_CACHE_CHECK(if g++ supports C++0x features with -std=c++0x,
    68   ac_cv_cxx_compile_cxx0x_cxx,
    69   [AC_LANG_SAVE
    70   AC_LANG_CPLUSPLUS
    71   ac_save_CXXFLAGS="$CXXFLAGS"
    72   CXXFLAGS="$CXXFLAGS -std=c++0x"
    73   AC_TRY_COMPILE([
    74   template <typename T>
    75     struct check
    76     {
    77       static_assert(sizeof(int) <= sizeof(T), "not big enough");
    78     };
    79 
    80     typedef check<check<bool>> right_angle_brackets;
    81 
    82     int a;
    83     decltype(a) b;
    84 
    85     typedef check<int> check_type;
    86     check_type c;
    87     check_type&& cr = c;],,
    88   ac_cv_cxx_compile_cxx0x_cxx=yes, ac_cv_cxx_compile_cxx0x_cxx=no)
    89   CXXFLAGS="$ac_save_CXXFLAGS"
    90   AC_LANG_RESTORE
    91   ])
    92 
    93   AC_CACHE_CHECK(if g++ supports C++0x features with -std=gnu++0x,
    94   ac_cv_cxx_compile_cxx0x_gxx,
    95   [AC_LANG_SAVE
    96   AC_LANG_CPLUSPLUS
    97   ac_save_CXXFLAGS="$CXXFLAGS"
    98   CXXFLAGS="$CXXFLAGS -std=gnu++0x"
    99   AC_TRY_COMPILE([
    100   template <typename T>
    101     struct check
    102     {
    103       static_assert(sizeof(int) <= sizeof(T), "not big enough");
    104     };
    105 
    106     typedef check<check<bool>> right_angle_brackets;
    107 
    108     int a;
    109     decltype(a) b;
    110 
    111     typedef check<int> check_type;
    112     check_type c;
    113     check_type&& cr = c;],,
    114   ac_cv_cxx_compile_cxx0x_gxx=yes, ac_cv_cxx_compile_cxx0x_gxx=no)
    115   CXXFLAGS="$ac_save_CXXFLAGS"
    116   AC_LANG_RESTORE
    117   ])
    118 
    119   if test "$ac_cv_cxx_compile_cxx0x_native" = yes ||
    120      test "$ac_cv_cxx_compile_cxx0x_cxx" = yes ||
    121      test "$ac_cv_cxx_compile_cxx0x_gxx" = yes; then
    122     AC_DEFINE(HAVE_STDCXX_0X,,[Define if g++ supports C++0x features. ])
    123   fi
    124 ])
    12521
    12622# ===========================================================================
     
    31283024m4_include([.macro_dir/ac_check_readline.m4])
    31293025m4_include([.macro_dir/ac_find_motif.m4])
     3026m4_include([.macro_dir/ax_cxx_compile_stdcxx_0x.m4])
    31303027m4_include([.macro_dir/libtool.m4])
    31313028m4_include([.macro_dir/ltoptions.m4])
Note: See TracChangeset for help on using the changeset viewer.