Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Samo Golež
VLC
Commits
f799f9ce
Commit
f799f9ce
authored
Apr 03, 2019
by
Hugo Beauzée-Luyssen
Browse files
configure.ac: Bump required C++ version to 14
parent
ce386056
Changes
3
Hide whitespace changes
Inline
Side-by-side
configure.ac
View file @
f799f9ce
...
...
@@ -68,7 +68,7 @@ dnl Check for compiler properties
AC_C_CONST
AC_C_INLINE
AC_C_RESTRICT
AX_CXX_COMPILE_STDCXX_1
1
([noext], [mandatory])
AX_CXX_COMPILE_STDCXX_1
4
([noext], [mandatory])
dnl Extend the --help string at the current spot.
AC_DEFUN([EXTEND_HELP_STRING], [m4_divert_once([HELP_ENABLE], [$1])])
...
...
m4/Makefile.am
View file @
f799f9ce
...
...
@@ -29,7 +29,7 @@ EXTRA_DIST = \
printf-posix.m4
\
progtest.m4
\
size_max.m4
\
stdcxx_1
1
.m4
\
stdcxx_1
4
.m4
\
stdint_h.m4
\
uintmax_t.m4
\
visibility.m4
\
...
...
m4/stdcxx_1
1
.m4
→
m4/stdcxx_1
4
.m4
View file @
f799f9ce
# ============================================================================
# http://www.gnu.org/software/autoconf-archive/ax_cxx_compile_stdcxx_11.html
#
Based on
http://www.gnu.org/software/autoconf-archive/ax_cxx_compile_stdcxx_11.html
# ============================================================================
#
# SYNOPSIS
#
# AX_CXX_COMPILE_STDCXX_1
1
([ext|noext],[mandatory|optional])
# AX_CXX_COMPILE_STDCXX_1
4
([ext|noext],[mandatory|optional])
#
# DESCRIPTION
#
# Check for baseline language coverage in the compiler for the C++1
1
# Check for baseline language coverage in the compiler for the C++1
4
# standard; if necessary, add switches to CXXFLAGS to enable support.
#
# The first argument, if specified, indicates whether you insist on an
# extended mode (e.g. -std=gnu++1
1
) or a strict conformance mode (e.g.
# -std=c++1
1
). If neither is specified, you get whatever works, with
# extended mode (e.g. -std=gnu++1
4
) or a strict conformance mode (e.g.
# -std=c++1
4
). If neither is specified, you get whatever works, with
# preference for an extended mode.
#
# The second argument, if specified 'mandatory' or if left unspecified,
# indicates that baseline C++1
1
support is required and that the macro
# indicates that baseline C++1
4
support is required and that the macro
# should error out if no mode with that support is found. If specified
# 'optional', then configuration proceeds regardless, after defining
# HAVE_CXX1
1
if and only if a supporting mode is found.
# HAVE_CXX1
4
if and only if a supporting mode is found.
#
# LICENSE
#
...
...
@@ -29,7 +29,7 @@
# Copyright (c) 2013 Roy Stogner <roystgnr@ices.utexas.edu>
# Copyright (c) 2014 Alexey Sokolov <sokolov@google.com>
# Copyright (c) 2014, 2015 Google Inc.
# Copyright (c) 2015, 201
6
VLC authors and VideoLAN
# Copyright (c) 2015, 201
9
VLC authors and VideoLAN
#
# Copying and distribution of this file, with or without modification, are
# permitted in any medium without royalty provided the copyright notice
...
...
@@ -38,7 +38,7 @@
#serial 7
m4_define([_AX_CXX_COMPILE_STDCXX_1
1
_testbody], [[
m4_define([_AX_CXX_COMPILE_STDCXX_1
4
_testbody], [[
template <typename T>
struct check
{
...
...
@@ -91,37 +91,56 @@ m4_define([_AX_CXX_COMPILE_STDCXX_11_testbody], [[
constexpr unsigned constant_lim = UINT_MAX;
const char *constant_fmt = "%" PRIu64, *constant_scn = "%" SCNu64;
constexpr size_t constant_align = alignof (std::max_align_t);
#include <memory>
namespace lambda_init_capture
{
void foo()
{
std::unique_ptr<int> ptr(new int);
auto lambda = [p = std::move(ptr)](){};
lambda();
}
}
#include <type_traits>
namespace traits_helper_types
{
static_assert( std::is_same<char, std::remove_pointer_t<char*>>::value, "plonk" );
}
]])
AC_DEFUN([AX_CXX_COMPILE_STDCXX_1
1
], [dnl
AC_DEFUN([AX_CXX_COMPILE_STDCXX_1
4
], [dnl
m4_if([$1], [], [],
[$1], [ext], [],
[$1], [noext], [],
[m4_fatal([invalid argument `$1' to AX_CXX_COMPILE_STDCXX_1
1
])])dnl
m4_if([$2], [], [ax_cxx_compile_cxx1
1
_required=true],
[$2], [mandatory], [ax_cxx_compile_cxx1
1
_required=true],
[$2], [optional], [ax_cxx_compile_cxx1
1
_required=false],
[m4_fatal([invalid second argument `$2' to AX_CXX_COMPILE_STDCXX_1
1
])])
[m4_fatal([invalid argument `$1' to AX_CXX_COMPILE_STDCXX_1
4
])])dnl
m4_if([$2], [], [ax_cxx_compile_cxx1
4
_required=true],
[$2], [mandatory], [ax_cxx_compile_cxx1
4
_required=true],
[$2], [optional], [ax_cxx_compile_cxx1
4
_required=false],
[m4_fatal([invalid second argument `$2' to AX_CXX_COMPILE_STDCXX_1
4
])])
AC_LANG_PUSH([C++])dnl
ac_success=no
AC_CACHE_CHECK(whether $CXX supports C++1
1
features by default,
ax_cv_cxx_compile_cxx1
1
,
[AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_1
1
_testbody])],
[ax_cv_cxx_compile_cxx1
1
=yes],
[ax_cv_cxx_compile_cxx1
1
=no])])
if test x$ax_cv_cxx_compile_cxx1
1
= xyes; then
AC_CACHE_CHECK(whether $CXX supports C++1
4
features by default,
ax_cv_cxx_compile_cxx1
4
,
[AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_1
4
_testbody])],
[ax_cv_cxx_compile_cxx1
4
=yes],
[ax_cv_cxx_compile_cxx1
4
=no])])
if test x$ax_cv_cxx_compile_cxx1
4
= xyes; then
ac_success=yes
fi
m4_if([$1], [noext], [], [dnl
if test x$ac_success = xno; then
for switch in -std=gnu++1
1
-std=gnu++
0x
; do
cachevar=AS_TR_SH([ax_cv_cxx_compile_cxx1
1
_$switch])
AC_CACHE_CHECK(whether $CXX supports C++1
1
features with $switch,
for switch in -std=gnu++1
4
-std=gnu++
1y
; do
cachevar=AS_TR_SH([ax_cv_cxx_compile_cxx1
4
_$switch])
AC_CACHE_CHECK(whether $CXX supports C++1
4
features with $switch,
$cachevar,
[ac_save_CXXFLAGS="$CXXFLAGS"
CXXFLAGS="$CXXFLAGS $switch"
AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_1
1
_testbody])],
AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_1
4
_testbody])],
[eval $cachevar=yes],
[eval $cachevar=no])
CXXFLAGS="$ac_save_CXXFLAGS"])
...
...
@@ -135,13 +154,13 @@ AC_DEFUN([AX_CXX_COMPILE_STDCXX_11], [dnl
m4_if([$1], [ext], [], [dnl
if test x$ac_success = xno; then
for switch in -std=c++1
1
-std=c++
0x
; do
cachevar=AS_TR_SH([ax_cv_cxx_compile_cxx1
1
_$switch])
AC_CACHE_CHECK(whether $CXX supports C++1
1
features with $switch,
for switch in -std=c++1
4
-std=c++
1y
; do
cachevar=AS_TR_SH([ax_cv_cxx_compile_cxx1
4
_$switch])
AC_CACHE_CHECK(whether $CXX supports C++1
4
features with $switch,
$cachevar,
[ac_save_CXXFLAGS="$CXXFLAGS"
CXXFLAGS="$CXXFLAGS $switch"
AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_1
1
_testbody])],
AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_1
4
_testbody])],
[eval $cachevar=yes],
[eval $cachevar=no])
CXXFLAGS="$ac_save_CXXFLAGS"])
...
...
@@ -153,20 +172,20 @@ AC_DEFUN([AX_CXX_COMPILE_STDCXX_11], [dnl
done
fi])
AC_LANG_POP([C++])
if test x$ax_cxx_compile_cxx1
1
_required = xtrue; then
if test x$ax_cxx_compile_cxx1
4
_required = xtrue; then
if test x$ac_success = xno; then
AC_MSG_ERROR([*** A compiler with support for C++1
1
language features is required.])
AC_MSG_ERROR([*** A compiler with support for C++1
4
language features is required.])
fi
else
if test x$ac_success = xno; then
HAVE_CXX1
1
=0
AC_MSG_NOTICE([No compiler with C++1
1
support was found])
HAVE_CXX1
4
=0
AC_MSG_NOTICE([No compiler with C++1
4
support was found])
else
HAVE_CXX1
1
=1
AC_DEFINE(HAVE_CXX1
1
,1,
[define if the compiler supports basic C++1
1
syntax])
HAVE_CXX1
4
=1
AC_DEFINE(HAVE_CXX1
4
,1,
[define if the compiler supports basic C++1
4
syntax])
fi
AC_SUBST(HAVE_CXX1
1
)
AC_SUBST(HAVE_CXX1
4
)
fi
])
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment