From 554fd8c5195424bdbcabf5de30fdc183aba391bd Mon Sep 17 00:00:00 2001 From: upstream source tree Date: Sun, 15 Mar 2015 20:14:05 -0400 Subject: obtained gcc-4.6.4.tar.bz2 from upstream website; verified gcc-4.6.4.tar.bz2.sig; imported gcc-4.6.4 source tree from verified upstream tarball. downloading a git-generated archive based on the 'upstream' tag should provide you with a source tree that is binary identical to the one extracted from the above tarball. if you have obtained the source via the command 'git clone', however, do note that line-endings of files in your working directory might differ from line-endings of the respective files in the upstream repository. --- libjava/classpath/m4/gcc_attribute.m4 | 133 ++++++++++++++++++++++++++++++++++ 1 file changed, 133 insertions(+) create mode 100644 libjava/classpath/m4/gcc_attribute.m4 (limited to 'libjava/classpath/m4/gcc_attribute.m4') diff --git a/libjava/classpath/m4/gcc_attribute.m4 b/libjava/classpath/m4/gcc_attribute.m4 new file mode 100644 index 000000000..f332d21a6 --- /dev/null +++ b/libjava/classpath/m4/gcc_attribute.m4 @@ -0,0 +1,133 @@ +dnl CACHED_TRY_COMPILE(,,,,,) +AC_DEFUN([CACHED_TRY_COMPILE],[ + AC_MSG_CHECKING($1) + AC_CACHE_VAL($2,[ + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[$3]], [[$4]])],[$2=yes],[$2=no]) + ]) + if test "x$$2" = xyes; then + true + $5 + else + true + $6 + fi +]) + +dnl GCC_ATTRIBUTE(,,,,,,[],[]) +AC_DEFUN([GCC_ATTRIBUTE],[ + CACHED_TRY_COMPILE(__attribute__(($1)),gcc_cv_c_gcc_attribute_$2,, + [extern int testfunction($3) __attribute__(($4))], + AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_GNUC25_$5,,$6) + $7, + AC_MSG_RESULT(no) + $8) +]) + + +AC_DEFUN([GCC_ATTRIBUTE_SUPPORTED],[ + GCC_ATTRIBUTE([,,],supported,[int x],[,,],ATTRIB,[Define if function attributes a la GCC 2.5 and higher are available.]) + AH_BOTTOM([/* GNU C attributes. */ +#ifndef FUNCATTR +#ifdef HAVE_GNUC25_ATTRIB +#define FUNCATTR(x) __attribute__(x) +#else +#define FUNCATTR(x) +#endif +#endif]) + +]) +AC_DEFUN([GCC_ATTRIBUTE_CONST],[ + AC_REQUIRE([GCC_ATTRIBUTE_SUPPORTED]) + GCC_ATTRIBUTE(const,const,[int x],const,CONST,[Define if constant functions a la GCC 2.5 and higher are available.]) + AH_BOTTOM([/* GNU C constant functions, or null. */ +#ifndef ATTRCONST +#ifdef HAVE_GNUC25_CONST +#define ATTRCONST const +#else +#define ATTRCONST +#endif +#endif +#ifndef CONSTANT +#define CONSTANT FUNCATTR((ATTRCONST)) +#endif]) +]) +AC_DEFUN([GCC_ATTRIBUTE_NORETURN],[ + AC_REQUIRE([GCC_ATTRIBUTE_SUPPORTED]) + GCC_ATTRIBUTE(noreturn,noreturn,[int x],noreturn,NORETURN,[Define if nonreturning functions a la GCC 2.5 and higher are available.]) + AH_BOTTOM([/* GNU C nonreturning functions, or null. */ +#ifndef ATTRNORETURN +#ifdef HAVE_GNUC25_NORETURN +#define ATTRNORETURN noreturn +#else /* ! HAVE_GNUC25_NORETURN */ +#define ATTRNORETURN +#endif /* HAVE_GNUC25_NORETURN */ +#endif /* ATTRNORETURN */ +#ifndef NONRETURNING +#define NONRETURNING FUNCATTR((ATTRNORETURN)) +#endif /* NONRETURNING */]) +]) +AC_DEFUN([GCC_ATTRIBUTE_UNUSED],[ + AC_REQUIRE([GCC_ATTRIBUTE_SUPPORTED]) + GCC_ATTRIBUTE(unused,unused,[int x],unused,UNUSED,[Define if unused variables la GCC 2.5 and higher are available.]) + AH_BOTTOM([/* GNU C unused functions, or null. */ +#ifndef ATTRUNUSED +#ifdef HAVE_GNUC25_UNUSED +#define ATTRUNUSED unused +#else +#define ATTRUNUSED +#endif +#endif +#ifndef UNUSED +#define UNUSED FUNCATTR((ATTRUNUSED)) +#endif]) +]) +AC_DEFUN([GCC_ATTRIBUTE_FORMAT],[ + AC_REQUIRE([GCC_ATTRIBUTE_SUPPORTED]) + GCC_ATTRIBUTE(format...,format,[char *y, ...],[format(printf,1,2)],PRINTFFORMAT,[Define if printf-format argument lists a la GCC are available.]) + AH_BOTTOM([/* GNU C printf formats, or null. */ +#ifndef ATTRPRINTF +#ifdef HAVE_GNUC25_PRINTFFORMAT +#define ATTRPRINTF(si,tc) format(printf,si,tc) +#else +#define ATTRPRINTF(si,tc) +#endif +#endif +#ifndef PRINTFFORMAT +#define PRINTFFORMAT(si,tc) FUNCATTR((ATTRPRINTF(si,tc))) +#endif + +#ifndef NONRETURNPRINTFFORMAT +#define NONRETURNPRINTFFORMAT(si,tc) FUNCATTR((ATTRPRINTF(si,tc),ATTRNORETURN)) +#endif]) +]) +AC_DEFUN([GCC_ATTRIBUTE_ALWAYS_INLINE],[ + AC_REQUIRE([GCC_ATTRIBUTE_SUPPORTED]) + GCC_ATTRIBUTE(always_inline,always_inline,[int x],always_inline,ALWAYS_INLINE,[Define if unconditional inlining of functions a la GCC 3.1 and higher are available.]) + AH_BOTTOM([/* GNU C constant functions, or null. */ +#ifndef ATTRALWAYS_INLINE +#ifdef HAVE_GNUC25_ALWAYS_INLINE +#define ATTRALWAYS_INLINE always_inline +#else +#define ATTRALWAYS_INLINE +#endif +#endif +#ifndef ALWAYS_INLINE +#define ALWAYS_INLINE FUNCATTR((ATTRALWAYS_INLINE)) +#endif]) +]) +AC_DEFUN([GCC_ATTRIBUTE_PACKED],[ + AC_REQUIRE([GCC_ATTRIBUTE_SUPPORTED]) + GCC_ATTRIBUTE(packed,packed,[int x],packed,PACKED,[Define if packing of struct members a la GCC 2.5 and higher is available.]) + AH_BOTTOM([/* GNU C constant functions, or null. */ +#ifndef ATTRPACKED +#ifdef HAVE_GNUC25_PACKED +#define ATTRPACKED packed +#else +#define ATTRPACKED +#endif +#endif +#ifndef PACKED +#define PACKED FUNCATTR((ATTRPACKED)) +#endif]) +]) -- cgit v1.2.3