summaryrefslogtreecommitdiff
path: root/m4
diff options
context:
space:
mode:
authorTheophile Ranquet <ranquet@lrde.epita.fr>2012-12-10 17:01:55 +0100
committerTheophile Ranquet <ranquet@lrde.epita.fr>2012-12-10 17:01:55 +0100
commit0906b12cd56f9777fb684b8a257a0e56c090a93c (patch)
treea30ecfbd9bc592fcfd88762b9507f6ca8b7eb7da /m4
parentf3ead217b8636f623399e66bd937b1c51774d4af (diff)
parentd4fe9e88f33f622f86907feb7b2690d354d92945 (diff)
downloadbison-0906b12cd56f9777fb684b8a257a0e56c090a93c.tar.gz
Merge remote-tracking branch 'origin/maint'
* origin/maint: news: prepare for forthcoming release doc: explain how mid-rule actions are translated error: use better locations for unused midrule values doc: various minor improvements and fixes tests: ignore more useless compiler warnings tests: be robust to C being compiled with a C++11 compiler build: beware of Clang++ not supporting POSIXLY_CORRECT maint: post-release administrivia version 2.6.90 build: fix syntax-check error. cpp: simplify the Flex version checking macro news: improve the carets example and fix a typo cpp: improve the Flex version checking macro carets: improve the code maint: update news build: keep -Wmissing-declarations and -Wmissing-prototypes for modern GCCs build: drop -Wcast-qual gnulib: update Conflicts: NEWS doc/Makefile.am doc/bison.texi gnulib src/reader.c tests/actions.at tests/atlocal.in tests/input.at
Diffstat (limited to 'm4')
-rw-r--r--m4/c-working.m442
-rw-r--r--m4/cxx.m49
2 files changed, 34 insertions, 17 deletions
diff --git a/m4/c-working.m4 b/m4/c-working.m4
index ee84acf9..999c52de 100644
--- a/m4/c-working.m4
+++ b/m4/c-working.m4
@@ -24,6 +24,7 @@ AC_DEFUN([BISON_TEST_FOR_WORKING_C_COMPILER], [
int test_array[CHAR_BIT];]])],
[],
[AC_MSG_FAILURE([cannot compile a simple C program])])
+ AC_SUBST([BISON_C_WORKS], [:])
])
# BISON_CHECK_WITH_POSIXLY_CORRECT(CODE)
@@ -47,25 +48,32 @@ case $gl_had_POSIXLY_CORRECT in
esac
])
+# BISON_LANG_COMPILER_POSIXLY_CORRECT
+# -----------------------------------
+# Whether the compiler for the current language supports -g in
+# POSIXLY_CORRECT mode. clang-2.9 on OS X does not, because
+# "clang-mp-2.9 -o test -g test.c" launches "/usr/bin/dsymutil test -o
+# test.dSYM" which fails with "error: unable to open executable '-o'".
+#
+# Sets <LANG>_COMPILER_POSIXLY_CORRECT to true/false.
+AC_DEFUN([BISON_LANG_COMPILER_POSIXLY_CORRECT],
+[AC_CACHE_CHECK([whether $_AC_CC supports POSIXLY_CORRECT=1],
+ [bison_cv_[]_AC_LANG_ABBREV[]_supports_posixly_correct],
+[BISON_CHECK_WITH_POSIXLY_CORRECT(
+[AC_LINK_IFELSE([AC_LANG_PROGRAM],
+ [bison_cv_[]_AC_LANG_ABBREV[]_supports_posixly_correct=yes],
+ [bison_cv_[]_AC_LANG_ABBREV[]_supports_posixly_correct=no])])])
+case $bison_cv_[]_AC_LANG_ABBREV[]_supports_posixly_correct in
+ yes) AC_SUBST(_AC_LANG_PREFIX[_COMPILER_POSIXLY_CORRECT], [true]) ;;
+ no) AC_SUBST(_AC_LANG_PREFIX[_COMPILER_POSIXLY_CORRECT], [false]);;
+esac
+])
+
# BISON_C_COMPILER_POSIXLY_CORRECT
# --------------------------------
-# Whether the compiler supports -g in POSIXLY_CORRECT mode. clang-2.9
-# on OS X does not, because "clang-mp-2.9 -o test -g test.c" launches
-# "/usr/bin/dsymutil test -o test.dSYM" which fails with "error:
-# unable to open executable '-o'".
-#
-# Sets C_COMPILER_POSIXLY_CORRECT to true/false.
+# Whether the C compiler supports -g in POSIXLY_CORRECT mode.
AC_DEFUN([BISON_C_COMPILER_POSIXLY_CORRECT],
-[AC_CACHE_CHECK([whether $CC supports POSIXLY_CORRECT=1],
- [bison_cv_cc_supports_posixly_correct],
-[BISON_CHECK_WITH_POSIXLY_CORRECT(
[AC_LANG_PUSH([C])
-AC_LINK_IFELSE([AC_LANG_PROGRAM],
- [bison_cv_cc_supports_posixly_correct=yes],
- [bison_cv_cc_supports_posixly_correct=no])
-AC_LANG_POP([C])])])
-case $bison_cv_cc_supports_posixly_correct in
- yes) AC_SUBST([C_COMPILER_POSIXLY_CORRECT], [true]) ;;
- no) AC_SUBST([C_COMPILER_POSIXLY_CORRECT], [false]);;
-esac
+BISON_LANG_COMPILER_POSIXLY_CORRECT
+AC_LANG_POP([C])
])
diff --git a/m4/cxx.m4 b/m4/cxx.m4
index 8ef1a250..f9f06092 100644
--- a/m4/cxx.m4
+++ b/m4/cxx.m4
@@ -58,3 +58,12 @@ AC_DEFUN([BISON_TEST_FOR_WORKING_CXX_COMPILER],
AC_SUBST([BISON_CXX_WORKS])
AM_CONDITIONAL(BISON_CXX_WORKS, test $bison_cv_cxx_works = yes)
])
+
+# BISON_CXX_COMPILER_POSIXLY_CORRECT
+# ----------------------------------
+# Whether the C++ compiler supports -g in POSIXLY_CORRECT mode.
+AC_DEFUN([BISON_CXX_COMPILER_POSIXLY_CORRECT],
+[AC_LANG_PUSH([C++])
+BISON_LANG_COMPILER_POSIXLY_CORRECT
+AC_LANG_POP([C++])
+])