From 40b9cae6283568ba442d485eefa41a30879d4d36 Mon Sep 17 00:00:00 2001 From: Michael Jeanson Date: Thu, 18 Mar 2021 16:37:40 -0400 Subject: [PATCH] Use a single macro to configure CXX This is part of an effort to standardise our autotools setup across project to simplify maintenance. Change-Id: I3667b0e61d44fd2e2ff36ac6935888e6a895ce73 Signed-off-by: Michael Jeanson Signed-off-by: Mathieu Desnoyers --- configure.ac | 6 ++--- m4/rw_prog_cxx_works.m4 | 50 ----------------------------------------- 2 files changed, 2 insertions(+), 54 deletions(-) delete mode 100644 m4/rw_prog_cxx_works.m4 diff --git a/configure.ac b/configure.ac index d46f8f5f..9b6a3f1c 100644 --- a/configure.ac +++ b/configure.ac @@ -55,10 +55,8 @@ AC_SYS_LARGEFILE AC_PROG_CC # AC_PROG_CC_STDC was merged in AC_PROG_CC in autoconf 2.70 m4_version_prereq([2.70], [], [AC_PROG_CC_STDC]) -AC_PROG_CXX -AX_CXX_COMPILE_STDCXX([11]) -RW_PROG_CXX_WORKS -AM_CONDITIONAL([HAVE_CXX], [test "x$rw_cv_prog_cxx_works" = "xyes"]) +AX_CXX_COMPILE_STDCXX([11], [noext], [optional]) +AM_CONDITIONAL([HAVE_CXX], [test "$HAVE_CXX11" = "1"]) # Check if the compiler support weak symbols AX_SYS_WEAK_ALIAS diff --git a/m4/rw_prog_cxx_works.m4 b/m4/rw_prog_cxx_works.m4 deleted file mode 100644 index f3d6bde6..00000000 --- a/m4/rw_prog_cxx_works.m4 +++ /dev/null @@ -1,50 +0,0 @@ -# SYNOPSIS -# -# RW_PROG_CXX_WORKS -# -# DESCRIPTION -# -# RW_PROG_CXX_WORKS checks whether the C++ compiler works. -# -# There's a bit of oversight in autoconf that will set the C++ compiler to -# g++ if no compiler is found, even if g++ is not present! So we need an -# extra test to make sure that the compiler works. -# -# LICENSE -# -# Copying and distribution of this file, with or without modification, are -# permitted in any medium without royalty provided the copyright notice -# and this notice are preserved. This file is offered as-is, without any -# warranty. - -#serial 1 - -AC_DEFUN([RW_PROG_CXX_WORKS], [ -AC_REQUIRE([AC_PROG_CXX]) -AC_CACHE_CHECK([whether the C++ compiler works], - [rw_cv_prog_cxx_works], - [AC_LANG_PUSH([C++]) - - AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])], [ - check_cxx_designated_initializers=yes - ], [ - rw_cv_prog_cxx_works=no - ]) - - AS_IF([test "x$check_cxx_designated_initializers" = "xyes"], [ - AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ - struct foo { int a; int b; }; - void fct(void) - { - struct foo f = { .a = 0, .b = 1 }; - } - ]])], [ - rw_cv_prog_cxx_works=yes - ], [ - rw_cv_prog_cxx_works=no - ]) - ]) - - AC_LANG_POP([C++]) -]) -]) -- 2.34.1