Commit 7de128a8 authored by Niels Möller's avatar Niels Möller
Browse files

Use LSH_GCC_ATTRIBUTES.

Rev: src/argp/configure.ac:1.12
Rev: src/nettle/configure.ac:1.19
Rev: src/sftp/configure.ac:1.16
Rev: src/spki/configure.ac:1.7
parent ecaaf7ea
......@@ -33,6 +33,8 @@ AC_C_CONST
AC_C_INLINE
AC_TYPE_SIZE_T
LSH_GCC_ATTRIBUTES
# Checks for library functions.
AC_FUNC_ALLOCA
AC_FUNC_VPRINTF
......
......@@ -129,41 +129,7 @@ AC_C_BIGENDIAN
AC_REPLACE_FUNCS(memxor)
# Check for gcc's __attribute__ construction
AC_CACHE_CHECK(for __attribute__,
lsh_cv_c_attribute,
[ AC_TRY_COMPILE([
#include <stdlib.h>
],
[
static void foo(void) __attribute__ ((noreturn));
static void __attribute__ ((noreturn))
foo(void)
{
exit(1);
}
],
lsh_cv_c_attribute=yes,
lsh_cv_c_attribute=no)])
AH_TEMPLATE([HAVE_GCC_ATTRIBUTE],
[Define if the compiler understands __attribute__])
if test "x$lsh_cv_c_attribute" = "xyes"; then
AC_DEFINE(HAVE_GCC_ATTRIBUTE)
fi
AH_BOTTOM(
[#if __GNUC__ && HAVE_GCC_ATTRIBUTE
# define NORETURN __attribute__ ((__noreturn__))
# define PRINTF_STYLE(f, a) __attribute__ ((__format__ (__printf__, f, a)))
# define UNUSED __attribute__ ((__unused__))
#else
# define NORETURN
# define PRINTF_STYLE(f, a)
# define UNUSED
#endif
])
LSH_GCC_ATTRIBUTES
# Checks for libraries
AC_CHECK_LIB(gmp, __gmpz_getlimbn,,
......
......@@ -153,30 +153,7 @@ AC_CHECK_SIZEOF(off_t, 8,
case $target_os in *cygwin* ) using_cygwin=yes; AC_DEFINE_UNQUOTED(USING_CYGWIN, 1, Are we using CygWin?) ;; * ) using_cygwin=no;;
esac
dnl Check for gcc's __attribute__ construction
AC_CACHE_CHECK(for __attribute__,
lsh_cv_c_attribute,
[ AC_TRY_COMPILE([
#include <stdlib.h>
],
[
static void foo(void) __attribute__ ((noreturn));
static void __attribute__ ((noreturn))
foo(void)
{
exit(1);
}
],
lsh_cv_c_attribute=yes,
lsh_cv_c_attribute=no)])
if test "x$lsh_cv_c_attribute" = "xyes"; then
AC_DEFINE([HAVE_GCC_ATTRIBUTE], 1,
[Define if the compiler understands __attribute__.])
fi
LSH_GCC_ATTRIBUTES
dnl Checks for library functions.
AC_CHECK_FUNCS(pread pwrite)
......
......@@ -49,41 +49,7 @@ AC_HEADER_TIME
# Needed by the supplied memcmp.c
AC_C_BIGENDIAN
# Check for gcc's __attribute__ construction
AC_CACHE_CHECK(for __attribute__,
lsh_cv_c_attribute,
[ AC_TRY_COMPILE([
#include <stdlib.h>
],
[
static void foo(void) __attribute__ ((noreturn));
static void __attribute__ ((noreturn))
foo(void)
{
exit(1);
}
],
lsh_cv_c_attribute=yes,
lsh_cv_c_attribute=no)])
AH_TEMPLATE([HAVE_GCC_ATTRIBUTE],
[Define if the compiler understands __attribute__])
if test "x$lsh_cv_c_attribute" = "xyes"; then
AC_DEFINE(HAVE_GCC_ATTRIBUTE)
fi
AH_BOTTOM(
[#if __GNUC__ && HAVE_GCC_ATTRIBUTE
# define NORETURN __attribute__ ((__noreturn__))
# define PRINTF_STYLE(f, a) __attribute__ ((__format__ (__printf__, f, a)))
# define UNUSED __attribute__ ((__unused__))
#else
# define NORETURN
# define PRINTF_STYLE(f, a)
# define UNUSED
#endif
])
LSH_GCC_ATTRIBUTES
# Checks for libraries
AC_CHECK_LIB(gmp, __gmpz_getlimbn,,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment