diff options
author | Adam Heath <doogie@debian.org> | 2001-04-20 23:45:56 +0000 |
---|---|---|
committer | Adam Heath <doogie@debian.org> | 2001-04-20 23:45:56 +0000 |
commit | f1688a162282541f0407a56f6c5d4e001d187c94 (patch) | |
tree | 09d0ebbe534977f43aee0ca51f1fe36f7eae9041 | |
parent | 16d832086ad1cd69883974648f981c59a4f0439b (diff) | |
download | dpkg-f1688a162282541f0407a56f6c5d4e001d187c94.tar.gz |
Add support for gcc attributes, printfformat, etc. Be sure to run
aclocal -I automake, and autoconf.
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | automake/dpkg.m4 | 14 | ||||
-rw-r--r-- | configure.in | 20 |
3 files changed, 39 insertions, 0 deletions
@@ -1,3 +1,8 @@ +Fri Apr 20 18:21:45 CDT 2001 Adam Heath <doogie@debian.org> + + * automake/dpkg.m4, configure.in: Add support for gcc attributes, + printfformat, etc. + Fri Apr 20 18:18:20 CDT 2001 Adam Heath <doogie@debian.org> * lib/database.c: initialize otherpriority with 0, not an int. diff --git a/automake/dpkg.m4 b/automake/dpkg.m4 index f5146449d..fc5eb128f 100644 --- a/automake/dpkg.m4 +++ b/automake/dpkg.m4 @@ -42,3 +42,17 @@ AC_DEFUN(DPKG_C_GCC_TRY_WARNS,[ AC_MSG_RESULT(no, not using GCC) fi ]) +dnl DPKG_CACHED_TRY_COMPILE(<description>,<cachevar>,<include>,<program>,<ifyes>,<ifno>) +define(DPKG_CACHED_TRY_COMPILE,[ + AC_MSG_CHECKING($1) + AC_CACHE_VAL($2,[ + AC_TRY_COMPILE([$3],[$4],[$2=yes],[$2=no]) + ]) + if test "x$$2" = xyes; then + true + $5 + else + true + $6 + fi +]) diff --git a/configure.in b/configure.in index 7127c6760..6649772fe 100644 --- a/configure.in +++ b/configure.in @@ -157,6 +157,26 @@ AC_TRY_COMPILE([ AC_TRY_COMPILE(,[ } inline int foo (int x) {], AC_DEFINE(HAVE_INLINE)) +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) + 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), + 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), + 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), + AC_MSG_RESULT(no)), + AC_MSG_RESULT(no)) DPKG_C_GCC_TRY_WARNS(-Wall -Wno-implicit, dpkg_cv_c_gcc_warn_all) DPKG_C_GCC_TRY_WARNS(-Wwrite-strings, dpkg_cv_c_gcc_warn_writestrings) |