summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Heath <doogie@debian.org>2002-05-19 10:59:31 +0000
committerAdam Heath <doogie@debian.org>2002-05-19 10:59:31 +0000
commitbd91eaff54c3d63e71d752a0cc73d99126cfdd9e (patch)
treeda16cd6d54e38fca9258c4e4baf74a95ec926ffa
parentc9491d1b1ce971185d9c53a61a49f88cc157219c (diff)
downloaddpkg-bd91eaff54c3d63e71d752a0cc73d99126cfdd9e.tar.gz
Make a new macro, DPKG_C_GCC_ATTRIBUTE.
-rw-r--r--ChangeLog4
-rw-r--r--automake/dpkg.m411
-rw-r--r--configure.in30
3 files changed, 20 insertions, 25 deletions
diff --git a/ChangeLog b/ChangeLog
index 2ee661e2c..c2c519788 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+Sun May 19 06:01:31 CDT 2002 Adam Heath <doogie@debian.org>
+
+ * configure.in, automake/dpkg.m4: Make a new macro, DPKG_C_GCC_ATTRIBUTE.
+
Sun May 19 05:57:24 CDT 2002 Adam Heath <doogie@debian.org>
* automake/dpkg.m4. Gah, I hate gcc. AC_TRY_COMPILE() produces code
diff --git a/automake/dpkg.m4 b/automake/dpkg.m4
index ed5d04e1a..52edf4720 100644
--- a/automake/dpkg.m4
+++ b/automake/dpkg.m4
@@ -13,6 +13,17 @@ AC_DEFUN(DPKG_CACHED_TRY_COMPILE,[
fi
])
+dnl DPKG_C_GCC_ATTRIBUTE(<short-label>,<cachevar>,<func-params>,<attribute>,<HAVE>,<desc>,[<true-cmds>],[<false-cmds>])
+AC_DEFUN(DPKG_C_GCC_ATTRIBUTE,[
+ DPKG_CACHED_TRY_COMPILE(__attribute__(($1)),dpkg_cv_c_attribute_$2,,
+ [extern int testfunction($3) __attribute__(($4))],
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_GNUC25_$5,,$6)
+ $7,
+ AC_MSG_RESULT(no)
+ $8)
+])
+
dnl DPKG_C_GCC_TRY_WARNS(<warnings>,<cachevar>)
AC_DEFUN(DPKG_C_GCC_TRY_WARNS,[
AC_MSG_CHECKING([GCC warning flag(s) $1])
diff --git a/configure.in b/configure.in
index bf69353bf..61aa65a38 100644
--- a/configure.in
+++ b/configure.in
@@ -189,31 +189,11 @@ va_list v1,v2;
v1 = v2;
], AC_MSG_RESULT(yes),AC_MSG_ERROR(no))])
-DPKG_CACHED_TRY_COMPILE(__attribute__((,,)),dpkg_cv_c_attribute_supported,,
- [extern int testfunction(int x) __attribute__((,,))],
- AC_MSG_RESULT(yes)
- AC_DEFINE(HAVE_GNUC25_ATTRIB,,[Define if function attributes a la GCC 2.5 and higher are available.])
- DPKG_CACHED_TRY_COMPILE(__attribute__((noreturn)),dpkg_cv_c_attribute_noreturn,,
- [extern int testfunction(int x) __attribute__((noreturn))],
- AC_MSG_RESULT(yes)
- AC_DEFINE(HAVE_GNUC25_NORETURN,,[Define if nonreturning functions a la GCC 2.5 and higher are available.]),
- AC_MSG_RESULT(no))
- DPKG_CACHED_TRY_COMPILE(__attribute__((const)),dpkg_cv_c_attribute_const,,
- [extern int testfunction(int x) __attribute__((const))],
- AC_MSG_RESULT(yes)
- AC_DEFINE(HAVE_GNUC25_CONST,,[Define if constant functions a la GCC 2.5 and higher are available.]),
- AC_MSG_RESULT(no))
- DPKG_CACHED_TRY_COMPILE(__attribute__((unused)),dpkg_cv_c_attribute_unused,,
- [extern int testfunction(int x) __attribute__((unused))],
- AC_MSG_RESULT(yes)
- AC_DEFINE(HAVE_GNUC25_UNUSED,,[Define if unused variables la GCC 2.5 and higher are available.]),
- AC_MSG_RESULT(no))
- DPKG_CACHED_TRY_COMPILE(__attribute__((format...)),dpkg_cv_attribute_format,,
- [extern int testfunction(char *y, ...) __attribute__((format(printf,1,2)))],
- AC_MSG_RESULT(yes)
- AC_DEFINE(HAVE_GNUC25_PRINTFFORMAT,,[Define if printf-format argument lists a la GCC are available.]),
- AC_MSG_RESULT(no)),
- AC_MSG_RESULT(no))
+DPKG_C_GCC_ATTRIBUTE([,,],supported,[int x],[,,],ATTRIB,[Define if function attributes a la GCC 2.5 and higher are available.],
+ DPKG_C_GCC_ATTRIBUTE(noreturn,noreturn,[int x],noreturn,NORETURN,[Define if nonreturning functions a la GCC 2.5 and higher are available.])
+ DPKG_C_GCC_ATTRIBUTE(const,const,[int x],const,CONST,[Define if constant functions a la GCC 2.5 and higher are available.])
+ DPKG_C_GCC_ATTRIBUTE(unused,unused,[int x],unused,UNUSED,[Define if unused variables la GCC 2.5 and higher are available.])
+ DPKG_C_GCC_ATTRIBUTE(format...,format,[char *y, ...],[format(printf,1,2)],PRINTFFORMAT,[Define if printf-format argument lists a la GCC are available.]))
AC_MSG_CHECKING(whether to use -Werror)
AC_ARG_WITH(Werror,