kwo pushed a commit to branch master.

http://git.enlightenment.org/e16/e16.git/commit/?id=b42aa483047baa09a7565757683de2068f619397

commit b42aa483047baa09a7565757683de2068f619397
Author: Kim Woelders <k...@woelders.dk>
Date:   Fri Aug 9 08:31:57 2013 +0200

    Autofoo macro cleanups.
    
    - Eliminate use of obsolete AC_TRY_COMPILE.
    - Changes names AC_/ac_ to EC_/ec_ to stay out of autoconf namespace.
---
 configure.ac                            |  8 ++++----
 m4/{ac_attribute.m4 => ec_attribute.m4} | 25 +++++++++++++++++--------
 m4/{ac_func.m4 => ec_func.m4}           | 16 ++++++++--------
 m4/{ac_warnflags.m4 => ec_warnflags.m4} | 10 +++++-----
 4 files changed, 34 insertions(+), 25 deletions(-)

diff --git a/configure.ac b/configure.ac
index 42171e5..60ced42 100644
--- a/configure.ac
+++ b/configure.ac
@@ -44,8 +44,8 @@ AC_CHECK_HEADERS(alloca.h locale.h stdarg.h wctype.h)
 AC_C_BIGENDIAN
 AC_C_CONST
 AC_C_INLINE
-AC_C___ATTRIBUTE__
-AC_C___FUNC__
+EC_C___ATTRIBUTE__
+EC_C___FUNC__
 AC_CHECK_SIZEOF(int, 4)
 AC_CHECK_SIZEOF(long, 4)
 AC_CHECK_SIZEOF(wchar_t, 4)
@@ -437,9 +437,9 @@ AC_ARG_ENABLE(gcc-cpp,
 if test "x$enable_gcc_cpp" = "xyes"; then
   CC="g++"
   CPPFLAGS="$CPPFLAGS -x c++"
-  AC_C_WARNFLAGS([cpp])
+  EC_C_WARNINGS([cpp])
 else
-  AC_C_WARNFLAGS()
+  EC_C_WARNINGS()
 fi
 
 AC_DEFINE(_GNU_SOURCE, 1, [Enable extensions])
diff --git a/m4/ac_attribute.m4 b/m4/ec_attribute.m4
similarity index 66%
rename from m4/ac_attribute.m4
rename to m4/ec_attribute.m4
index df59aa3..74d5976 100644
--- a/m4/ac_attribute.m4
+++ b/m4/ec_attribute.m4
@@ -4,7 +4,7 @@ dnl Originally snatched from somewhere...
 
 dnl Macro for checking if the compiler supports __attribute__
 
-dnl Usage: AC_C___ATTRIBUTE__
+dnl Usage: EC_C___ATTRIBUTE__
 
 dnl Call AC_DEFINE for HAVE___ATTRIBUTE__ and __UNUSED__.
 dnl If the compiler supports __attribute__, HAVE___ATTRIBUTE__ is
@@ -12,18 +12,27 @@ dnl defined to 1 and __UNUSED__ is defined to 
__attribute__((unused))
 dnl otherwise, HAVE___ATTRIBUTE__ is not defined and __UNUSED__ is
 dnl defined to nothing.
 
-AC_DEFUN([AC_C___ATTRIBUTE__],
+AC_DEFUN([EC_C___ATTRIBUTE__],
 [
   AC_MSG_CHECKING(for __attribute__)
-  AC_CACHE_VAL(ac_cv___attribute__, [
-  AC_TRY_COMPILE([#include <stdlib.h>],
-  [int func(int x); int foo(int x __attribute__ ((unused))) { exit(1); }],
-  ac_cv___attribute__=yes, ac_cv___attribute__=no)])
-  if test "$ac_cv___attribute__" = "yes"; then
+  AC_CACHE_VAL(ec_cv___attribute__, [
+    AC_COMPILE_IFELSE([
+      AC_LANG_PROGRAM(
+      [[
+#include <stdlib.h>
+      ]], [[
+int foo(int x __attribute__ ((unused))) { exit(1); }
+      ]])
+    ],
+    ec_cv___attribute__=yes,
+    ec_cv___attribute__=no)
+  ])
+
+  if test "$ec_cv___attribute__" = "yes"; then
     AC_DEFINE(HAVE___ATTRIBUTE__, 1, [Define to 1 if your compiler has 
__attribute__])
     AC_DEFINE(__UNUSED__, __attribute__((unused)), [Macro declaring a function 
argument to be unused])
   else
     AC_DEFINE(__UNUSED__, , [Macro declaring a function argument to be unused])
   fi
-  AC_MSG_RESULT($ac_cv___attribute__)
+  AC_MSG_RESULT($ec_cv___attribute__)
 ])
diff --git a/m4/ac_func.m4 b/m4/ec_func.m4
similarity index 73%
rename from m4/ac_func.m4
rename to m4/ec_func.m4
index 6c0b579..e0a1c09 100644
--- a/m4/ac_func.m4
+++ b/m4/ec_func.m4
@@ -3,33 +3,33 @@ dnl This code is public domain and can be freely used or 
copied.
 
 dnl Macro for defining __func__ if not already defined
 
-dnl Usage: AC_C___FUNC__
+dnl Usage: EC_C___FUNC__
 
 dnl If __func__ is not defined and __FUNCTION__ is, __func__ is defined
 dnl to __FUNCTION__. If __FUNCTION__ isn't defined either, __func__ is
 dnl defined to "FUNC".
 
-AC_DEFUN([AC_C___FUNC__],
+AC_DEFUN([EC_C___FUNC__],
 [
-  AC_CACHE_CHECK([for __func__], ac_cv___func__, [
+  AC_CACHE_CHECK([for __func__], ec_cv___func__, [
     AC_COMPILE_IFELSE([
       AC_LANG_PROGRAM([], [[const char *s = __func__;]])
     ], [
-      ac_cv___func__=yes
+      ec_cv___func__=yes
     ], [
       AC_COMPILE_IFELSE([
         AC_LANG_PROGRAM([], [[const char *s = __FUNCTION__;]])
       ], [
-        ac_cv___func__=function
+        ec_cv___func__=function
       ], [
-        ac_cv___func__=no
+        ec_cv___func__=no
       ])
     ])
   ])
 
-  if test $ac_cv___func__ = function; then
+  if test $ec_cv___func__ = function; then
     AC_DEFINE(__func__, __FUNCTION__, [Define __func__ appropriately if 
missing])
-  elif test $ac_cv___func__ = no; then
+  elif test $ec_cv___func__ = no; then
     AC_DEFINE(__func__, "FUNC", [Define __func__ appropriately if missing])
   fi
 ])
diff --git a/m4/ac_warnflags.m4 b/m4/ec_warnflags.m4
similarity index 77%
rename from m4/ac_warnflags.m4
rename to m4/ec_warnflags.m4
index e7e12d0..813bf15 100644
--- a/m4/ac_warnflags.m4
+++ b/m4/ec_warnflags.m4
@@ -1,15 +1,15 @@
 dnl Copyright (C) 2008 Kim Woelders
 dnl This code is public domain and can be freely used or copied.
 
-dnl Macro to set compiler warning flags
+dnl Macro to set compiler warning flags in CWARNFLAGS
 
 dnl Provides configure argument --enable-werror to stop compilation on warnings
 
-dnl Usage: AC_C_WARNFLAGS([LANG])
+dnl Usage: EC_C_WARNINGS([LANG])
 dnl Set LANG to 'cpp' when compiling for C++
 
-AC_DEFUN([AC_C_WARNFLAGS], [
-  define(ac_c_compile_cpp, ifelse([$1], [cpp], [yes], [no]))
+AC_DEFUN([EC_C_WARNINGS], [
+  define(ec_c_compile_cpp, ifelse([$1], [cpp], [yes], [no]))
 
   AC_ARG_ENABLE(werror,
     [  --enable-werror         treat compiler warnings as errors 
@<:@default=no@:>@],,
@@ -17,7 +17,7 @@ AC_DEFUN([AC_C_WARNFLAGS], [
 
   if test "x$GCC" = "xyes"; then
     CWARNFLAGS="-W -Wall -Waggregate-return -Wcast-align -Wpointer-arith 
-Wshadow -Wwrite-strings"
-    ifelse(ac_c_compile_cpp, no, [
+    ifelse(ec_c_compile_cpp, no, [
       CWARNFLAGS="$CWARNFLAGS -Wmissing-prototypes -Wmissing-declarations 
-Wstrict-prototypes"
     ],)
 

-- 


Reply via email to