summaryrefslogtreecommitdiff
path: root/m4/ax_cxx_compile_stdcxx_0x.m4
diff options
context:
space:
mode:
authorJoshua Judson Rosen <jrosen@harvestai.com>2015-12-02 16:46:05 -0500
committerPeter Simons <simons@cryp.to>2016-02-29 11:41:21 +0100
commit9e5ef8a7fa6f32dce37a9a340cef793254d2396b (patch)
treef5ee7f83c763343a4a85c7057575967dcf1659bc /m4/ax_cxx_compile_stdcxx_0x.m4
parent401d6b8cefcc5bf3c1f6c35d76c589bb6b7387b0 (diff)
downloadautoconf-archive-9e5ef8a7fa6f32dce37a9a340cef793254d2396b.tar.gz
AX_CXX_COMPILE_STDCXX: don't break "make CXXFLAGS=..."
Make C++ std-selection macros modify $(CXX), not $(CXXFLAGS). Using $(CXXFLAGS) prevents users from being able to rebuild with different CXXFLAGS (e.g.: to try out different optimisations or to change debug levels) unless they re-run ./configure with their CFLAGS. This is more like what the mainline Autoconf macros do (e.g.: AC_PROG_CC_C99, AC_PROG_CC_STD, etc. modify $(CC), not $(CCFLAGS)), presmuably for much the same reasons: if you need to specify a standard to the compiler, it doesn't really make sense to separate that from $(CC)/$(CXX) since $(CC)/$(CXX) aren't usable without it.
Diffstat (limited to 'm4/ax_cxx_compile_stdcxx_0x.m4')
-rw-r--r--m4/ax_cxx_compile_stdcxx_0x.m414
1 files changed, 7 insertions, 7 deletions
diff --git a/m4/ax_cxx_compile_stdcxx_0x.m4 b/m4/ax_cxx_compile_stdcxx_0x.m4
index a49f430..52c3984 100644
--- a/m4/ax_cxx_compile_stdcxx_0x.m4
+++ b/m4/ax_cxx_compile_stdcxx_0x.m4
@@ -23,7 +23,7 @@
# and this notice are preserved. This file is offered as-is, without any
# warranty.
-#serial 9
+#serial 10
AU_ALIAS([AC_CXX_COMPILE_STDCXX_0X], [AX_CXX_COMPILE_STDCXX_0X])
AC_DEFUN([AX_CXX_COMPILE_STDCXX_0X], [
@@ -55,8 +55,8 @@ AC_DEFUN([AX_CXX_COMPILE_STDCXX_0X], [
ax_cv_cxx_compile_cxx0x_cxx,
[AC_LANG_SAVE
AC_LANG_CPLUSPLUS
- ac_save_CXXFLAGS="$CXXFLAGS"
- CXXFLAGS="$CXXFLAGS -std=c++0x"
+ ac_save_CXX="$CXX"
+ CXX="$CXX -std=c++0x"
AC_TRY_COMPILE([
template <typename T>
struct check
@@ -73,7 +73,7 @@ AC_DEFUN([AX_CXX_COMPILE_STDCXX_0X], [
check_type c;
check_type&& cr = static_cast<check_type&&>(c);],,
ax_cv_cxx_compile_cxx0x_cxx=yes, ax_cv_cxx_compile_cxx0x_cxx=no)
- CXXFLAGS="$ac_save_CXXFLAGS"
+ CXX="$ac_save_CXX"
AC_LANG_RESTORE
])
@@ -81,8 +81,8 @@ AC_DEFUN([AX_CXX_COMPILE_STDCXX_0X], [
ax_cv_cxx_compile_cxx0x_gxx,
[AC_LANG_SAVE
AC_LANG_CPLUSPLUS
- ac_save_CXXFLAGS="$CXXFLAGS"
- CXXFLAGS="$CXXFLAGS -std=gnu++0x"
+ ac_save_CXX="$CXX"
+ CXX="$CXX -std=gnu++0x"
AC_TRY_COMPILE([
template <typename T>
struct check
@@ -99,7 +99,7 @@ AC_DEFUN([AX_CXX_COMPILE_STDCXX_0X], [
check_type c;
check_type&& cr = static_cast<check_type&&>(c);],,
ax_cv_cxx_compile_cxx0x_gxx=yes, ax_cv_cxx_compile_cxx0x_gxx=no)
- CXXFLAGS="$ac_save_CXXFLAGS"
+ CXX="$ac_save_CXX"
AC_LANG_RESTORE
])