summaryrefslogtreecommitdiff
path: root/m4/dpkg-compiler.m4
diff options
context:
space:
mode:
authorGuillem Jover <guillem@debian.org>2015-01-22 00:36:18 +0100
committerGuillem Jover <guillem@debian.org>2015-01-28 20:50:33 +0100
commit950be3fcbdf373d43dea6f5b18fcf3c61747fd33 (patch)
treed445171dc2e1cc75c3c277c4c321ca491184b80e /m4/dpkg-compiler.m4
parenta4938a097f33f22ccaef453ba015898f89ecd508 (diff)
downloaddpkg-950be3fcbdf373d43dea6f5b18fcf3c61747fd33.tar.gz
build: Rework DPKG_C_C99 macro to define HAVE_C_C99 just once
Use the opportunity to fix the indentation.
Diffstat (limited to 'm4/dpkg-compiler.m4')
-rw-r--r--m4/dpkg-compiler.m453
1 files changed, 30 insertions, 23 deletions
diff --git a/m4/dpkg-compiler.m4 b/m4/dpkg-compiler.m4
index 53f67c6c1..a431b2f0c 100644
--- a/m4/dpkg-compiler.m4
+++ b/m4/dpkg-compiler.m4
@@ -1,5 +1,5 @@
# Copyright © 2004 Scott James Remnant <scott@netsplit.com>
-# Copyright © 2006,2009-2011,2013-2014 Guillem Jover <guillem@debian.org>
+# Copyright © 2006,2009-2011,2013-2015 Guillem Jover <guillem@debian.org>
# DPKG_CHECK_COMPILER_FLAG
# ------------------------
@@ -158,28 +158,35 @@ AC_DEFUN([DPKG_TRY_C99],
# DPKG_C_C99
# ----------
# Check whether the compiler can do C99
-AC_DEFUN([DPKG_C_C99],
-[AC_CACHE_CHECK([whether $CC supports C99 features], [dpkg_cv_c99],
- [DPKG_TRY_C99([dpkg_cv_c99=yes], [dpkg_cv_c99=no])])
-AS_IF([test "x$dpkg_cv_c99" = "xyes"],
- [AC_DEFINE([HAVE_C99], 1, [Define to 1 if the compiler supports C99.])],
- [AC_CACHE_CHECK([for $CC option to accept C99 features],
- [dpkg_cv_c99_arg],
- [dpkg_cv_c99_arg=none
- dpkg_save_CC="$CC"
- for arg in "-std=gnu99" "-std=c99" "-c99" "-AC99" \
- "-xc99=all" "-qlanglvl=extc99"; do
- CC="$dpkg_save_CC $arg"
- DPKG_TRY_C99([dpkg_arg_worked=yes], [dpkg_arg_worked=no])
- CC="$dpkg_save_CC"
-
- AS_IF([test "x$dpkg_arg_worked" = "xyes"],
- [dpkg_cv_c99_arg="$arg"; break])
- done])
- AS_IF([test "x$dpkg_cv_c99_arg" != "xnone"],
- [CC="$CC $dpkg_cv_c99_arg"
- AC_DEFINE([HAVE_C99], 1)],
- [AC_MSG_ERROR([unsupported required C99 extensions])])])[]dnl
+AC_DEFUN([DPKG_C_C99], [
+ AC_CACHE_CHECK([whether $CC supports C99 features], [dpkg_cv_c99], [
+ DPKG_TRY_C99([dpkg_cv_c99=yes], [dpkg_cv_c99=no])
+ ])
+ AS_IF([test "x$dpkg_cv_c99" != "xyes"], [
+ AC_CACHE_CHECK([for $CC option to accept C99 features], [dpkg_cv_c99_arg], [
+ dpkg_cv_c99_arg=none
+ dpkg_save_CC="$CC"
+ for arg in "-std=gnu99" "-std=c99" "-c99" "-AC99" "-xc99=all" \
+ "-qlanglvl=extc99"; do
+ CC="$dpkg_save_CC $arg"
+ DPKG_TRY_C99([dpkg_arg_worked=yes], [dpkg_arg_worked=no])
+ CC="$dpkg_save_CC"
+
+ AS_IF([test "x$dpkg_arg_worked" = "xyes"], [
+ dpkg_cv_c99_arg="$arg"; break
+ ])
+ done
+ ])
+ AS_IF([test "x$dpkg_cv_c99_arg" != "xnone"], [
+ CC="$CC $dpkg_cv_c99_arg"
+ dpkg_cv_c99=1
+ ])
+ ])
+ AS_IF([test "x$dpkg_cv_c99" = "xyes"], [
+ AC_DEFINE([HAVE_C99], 1, [Define to 1 if the compiler supports C99.])
+ ], [
+ AC_MSG_ERROR([unsupported required C99 extensions])
+ ])
])# DPKG_C_C99
# DPKG_TRY_CXX11([ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])