use another m4 macro for __atribute__
authorcaro <caro@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Thu, 29 Sep 2011 06:26:03 +0000 (06:26 +0000)
committercaro <caro@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Thu, 29 Sep 2011 06:26:03 +0000 (06:26 +0000)
 add check of gcc vector extension, requested by cedric

git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/evas@63652 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

configure.ac
m4/ac_attribute.m4 [deleted file]
m4/efl_attribute.m4 [new file with mode: 0644]

index 4cb4775..4768bd6 100644 (file)
@@ -77,7 +77,7 @@ AC_CANONICAL_BUILD
 AC_CANONICAL_HOST
 
 case "$host_os" in
-   mingw32ce* | cegcc*)
+   mingw32ce*)
       MODULE_ARCH="$host_os-$host_cpu"
       ;;
    *)
@@ -130,7 +130,7 @@ want_evas_image_loader_generic="yes"
 want_evas_font_loader_eet="yes"
 
 case "$host_os" in
-   mingw32ce* | cegcc*)
+   mingw32ce*)
       want_fontconfig="no"
       want_evas_engine_software_16_wince="yes"
       want_evas_image_loader_edb="no"
@@ -224,7 +224,7 @@ EFL_CHECK_DOXYGEN([build_doc="yes"], [build_doc="no"])
 # Evil library for compilation on Windows CE
 
 case "$host_os" in
-   mingw* | cegcc*)
+   mingw*)
       PKG_CHECK_MODULES([EVIL], [evil])
       AC_DEFINE(HAVE_EVIL, 1, [Set to 1 if evil package is installed])
       requirement_evas="evil ${requirement_evas}"
@@ -437,12 +437,13 @@ AC_CHECK_TYPES([struct sigaction], [], [],
 ### Checks for compiler characteristics
 AC_C_CONST
 AC_C_BIGENDIAN
-AC_C___ATTRIBUTE__
 AM_PROG_CC_STDC
+EFL_ATTRIBUTE_UNUSED
+EFL_ATTRIBUTE_VECTOR
 
 WIN32_CPPFLAGS=""
 case "$host_os" in
-   mingw32ce* | cegcc*)
+   mingw32ce*)
       WIN32_CPPFLAGS="-D_WIN32_WCE=0x0420"
       ;;
    mingw*)
@@ -452,18 +453,13 @@ esac
 AC_SUBST(WIN32_CPPFLAGS)
 
 WIN32_CFLAGS=""
-case "${host_os}" in
-   cegcc*)
-      WIN32_CFLAGS="-mwin32"
-   ;;
-esac
 AC_SUBST(WIN32_CFLAGS)
 
 
 ### Checks for linker characteristics
 lt_enable_auto_import=""
 case "${host_os}" in
-   mingw* | cegcc*)
+   mingw*)
       AC_DEFINE(EFL_EVAS_BUILD, 1, [Define to mention that evas is built])
       lt_enable_auto_import="-Wl,--enable-auto-import"
    ;;
@@ -485,7 +481,7 @@ EFL_CHECK_FNMATCH([], [AC_MSG_ERROR([Cannot find fnmatch()])])
 # dlopen
 dlopen_libs=""
 case "$host_os" in
-  mingw32ce* | cegcc*)
+  mingw32ce*)
 # managed by evil
     AC_DEFINE(HAVE_DLADDR)
   ;;
@@ -944,7 +940,7 @@ dnl Windows has no sigsetjmp function, nor equivalent.
 dnl So we disable the jpeg saver.
 dnl TODO: must find a workaround
 case "$host_os" in
-   mingw* | cegcc*)
+   mingw*)
       ;;
    *)
       if test "x${have_evas_image_loader_jpeg}" = "xyes" ; then
diff --git a/m4/ac_attribute.m4 b/m4/ac_attribute.m4
deleted file mode 100644 (file)
index 23479a9..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-dnl Copyright (C) 2004-2008 Kim Woelders
-dnl Copyright (C) 2008 Vincent Torri <vtorri at univ-evry dot fr>
-dnl That code is public domain and can be freely used or copied.
-dnl Originally snatched from somewhere...
-
-dnl Macro for checking if the compiler supports __attribute__
-
-dnl Usage: AC_C___ATTRIBUTE__
-dnl call AC_DEFINE for HAVE___ATTRIBUTE__ and __UNUSED__
-dnl if the compiler supports __attribute__, HAVE___ATTRIBUTE__ is
-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_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"]
-    )])
-
-AC_MSG_RESULT($ac_cv___attribute__)
-
-if test "x${ac_cv___attribute__}" = "xyes" ; 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
-
-])
-
-dnl End of ac_attribute.m4
diff --git a/m4/efl_attribute.m4 b/m4/efl_attribute.m4
new file mode 100644 (file)
index 0000000..d03db53
--- /dev/null
@@ -0,0 +1,54 @@
+dnl Copyright (C) 2011 Vincent Torri <vtorri at univ-evry dot fr>
+dnl That code is public domain and can be freely used or copied.
+
+dnl Macros for checking if the compiler supports some __attribute__ uses
+
+dnl Usage: EFL_ATTRIBUTE_UNUSED
+dnl call AC_DEFINE for __UNUSED__ if __attribute__((unused)) is available
+
+AC_DEFUN([EFL_ATTRIBUTE_UNUSED],
+[
+AC_MSG_CHECKING([for __attribute__ ((unused))])
+AC_COMPILE_IFELSE(
+   [AC_LANG_PROGRAM(
+       [[
+       ]],
+       [[
+void foo(int x __attribute__ ((unused))) {}
+       ]])],
+   [have_attribute_unused="yes"],
+   [have_attribute_unused="no"])
+AC_MSG_RESULT([${have_attribute_unused}])
+
+if test "x${have_attribute_unused}" = "xyes" ; then
+   AC_DEFINE([__UNUSED__], [__attribute__ ((unused))], [Macro declaring a function argument to be unused.])
+fi
+])
+
+dnl Usage: EFL_ATTRIBUTE_VECTOR
+dnl call AC_DEFINE for HAVE_GCC_ATTRIBUTE_VECTOR if __attribute__((vector)) is available
+
+AC_DEFUN([EFL_ATTRIBUTE_VECTOR],
+[
+AC_MSG_CHECKING([for __attribute__ ((vector))])
+AC_COMPILE_IFELSE(
+   [AC_LANG_PROGRAM(
+       [[
+typedef int v4si __attribute__ ((vector_size (16)));
+       ]],
+       [[
+if (sizeof(v4si) == 16)
+  return 0;
+else
+  return -1;
+       ]])],
+   [have_attribute_vector="yes"],
+   [have_attribute_vector="no"])
+AC_MSG_RESULT([${have_attribute_vector}])
+
+if test "x${have_attribute_vector}" = "xyes" ; then
+   AC_DEFINE([HAVE_GCC_ATTRIBUTE_VECTOR], [1], [Define to 1 if your compiler supports __attribute__ ((vector)).])
+fi
+])
+
+dnl End of efl_attribute.m4