summaryrefslogtreecommitdiff
path: root/libast.m4
diff options
context:
space:
mode:
authorMichael Jennings <mej@lbl.gov>2013-03-05 12:58:01 -0800
committerMichael Jennings <mej@lbl.gov>2013-03-05 12:58:01 -0800
commit9d0be7b7d259415771e22565fe29bafe52df3606 (patch)
tree0c8a29bffa425b0fbd8264bc91074740f8a45f1a /libast.m4
parent0527261a853b728c76b22cd11f6cbaf80d2a486f (diff)
downloadlibast-9d0be7b7d259415771e22565fe29bafe52df3606.tar.gz
Updated the autotools stuff some. Bumped version to 0.8.
Reformatted some macros in libast.h. Fixed the sprintf() methods of the str, ustr, and mbuff classes. Added check for compiler support of compound statement expressions. Fixed a spec file bug.
Diffstat (limited to 'libast.m4')
-rw-r--r--libast.m435
1 files changed, 31 insertions, 4 deletions
diff --git a/libast.m4 b/libast.m4
index 521dec1..6a96332 100644
--- a/libast.m4
+++ b/libast.m4
@@ -253,13 +253,10 @@ AC_DEFUN([AST_STD_CHECKS], [
dnl# These must be run after AC_PROG_CC but before any other macros that use
dnl# the C compiler
- AC_AIX
AC_ISC_POSIX
- AC_MINIX
dnl# At least make the attempt to support CygWin32
AC_CYGWIN
- AC_ARG_PROGRAM
AM_PROG_LIBTOOL
@@ -342,6 +339,36 @@ AC_DEFUN([AST_TYPE_CHECKS], [
])
dnl#
+dnl# LibAST Compiler Checks
+dnl#
+AC_DEFUN([AST_COMPILER_CHECKS], [
+ AC_MSG_CHECKING([for ({...}) compiler support])
+ AC_CACHE_VAL(ast_compiler_compound_statement_expr, [
+ AC_TRY_COMPILE(
+ changequote(<<, >>)dnl
+<<
+int main(void)
+{
+ int a = 1, b = 2, c = 3, d;
+
+ d = ({ b *= c; a += b - c; a + b + c; });
+ return 0;
+} >>
+ changequote([, ])
+ , ast_compiler_compound_statement_expr=0, ast_compiler_compound_statement_expr=1, ast_compiler_compound_statement_expr=2)
+ ])
+ if test $ast_compiler_compound_statement_expr -eq 0; then
+ AC_MSG_RESULT([yes])
+ AC_DEFINE([LIBAST_SUPPORT_MACRO_CSE], [1], [Defined if compiler supports compound statement expressions.])
+ elif test $ast_compiler_compound_statement_expr -eq 1; then
+ AC_MSG_RESULT([no])
+ else
+ AC_MSG_RESULT([unknown, assuming none])
+ fi
+])
+
+
+dnl#
dnl# LibAST argument macros
dnl# - arg 1 is the name of the env var to use
dnl#
@@ -462,7 +489,7 @@ exit(0);
])
if test $dps_cv_snprintf_bug -eq 0; then
AC_MSG_RESULT([no, snprintf is ok])
- elif test $dps_cv_snprint_bug -eq 1; then
+ elif test $dps_cv_snprintf_bug -eq 1; then
AC_MSG_RESULT([yes, snprintf is broken])
AC_DEFINE([HAVE_SNPRINTF_BUG], [1], [Defined if libc snprintf is buggy.])
else