* AC_C_ATTRIBUTE: check for __attribute__ (required at least by mipspro)
authortwisti <none@none>
Wed, 13 Jul 2005 00:34:56 +0000 (00:34 +0000)
committertwisti <none@none>
Wed, 13 Jul 2005 00:34:56 +0000 (00:34 +0000)
autogen.sh
configure.in
m4/acinclude.m4 [new file with mode: 0644]

index 63a6cf6f61b5b76a9f829650ed14f6e44379f332..943a8dd0d697148b3cc65595229aad3cd47096dc 100755 (executable)
@@ -2,10 +2,9 @@
 
 libtoolize --automake
 if test `uname` = 'FreeBSD'; then
-    echo "FreeBSD -- only tested with 5.3-RELEASE though"
-    aclocal -I . -I src/classpath/m4 -I /usr/local/share/aclocal -I /usr/local/share/aclocal19
+    aclocal -I m4 -I src/classpath/m4 -I /usr/local/share/aclocal -I /usr/local/share/aclocal19
 else
-    aclocal -I . -I src/classpath/m4
+    aclocal -I m4 -I src/classpath/m4
 fi
 autoheader
 automake --add-missing
index a3f28faa37b17fb0ed98438779df82dd57d92045..6a6f3af2f2b391a5a8c8ab59a6507b093e1a4947 100644 (file)
@@ -125,6 +125,7 @@ AC_CHECK_HEADERS([sys/ioctl.h])
 dnl Checks for typedefs, structures, and compiler characteristics.
 AC_C_CONST
 AC_C_INLINE
+AC_C_ATTRIBUTE
 AC_TYPE_OFF_T
 AC_TYPE_SIZE_T
 AC_HEADER_TIME
diff --git a/m4/acinclude.m4 b/m4/acinclude.m4
new file mode 100644 (file)
index 0000000..f7a7202
--- /dev/null
@@ -0,0 +1,29 @@
+dnl modified AC_C_INLINE from autoconf/c.m4 by TWISTI
+
+AN_IDENTIFIER([attribute], [AC_C_ATTRIBUTE])
+AC_DEFUN([AC_C_ATTRIBUTE],
+[AC_CACHE_CHECK([for __attribute__], ac_cv_c_attribute,
+[
+AC_COMPILE_IFELSE([AC_LANG_SOURCE(
+[void foo(void) __attribute__ ((__noreturn__));]
+)],
+[ac_cv_c_attribute=yes],
+[ac_cv_c_attribute=no]
+)
+])
+AH_VERBATIM([attribute],
+[/* Define to `__attribute__' to nothing if it's not supported.  */
+#ifndef __cplusplus
+#undef __attribute__
+#endif])
+case $ac_cv_c_attribute in
+  yes) ;;
+  no)
+    cat >>confdefs.h <<_ACEOF
+#ifndef __cplusplus
+#define __attribute__(x)    /* nothing */
+#endif
+_ACEOF
+    ;;
+esac
+])# AC_C_ATTRIBUTE