autoconf-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

AC_CHECK_HEADER


From: Alex Zimnitsky
Subject: AC_CHECK_HEADER
Date: Tue, 04 Aug 2009 23:31:46 +0400

Hello, autoconf-patches

1. Currently the description of AC_CHECK_HEADER in the headers.m4 (where
it is defined) states that the preprocessor check result has precedence
over the compiler check result which is not true.

2. when "./configure"ing a piece of software it's wery strange to

a) see that a header is checked for presence after it has been checked
for usability (assuming the person who sees that knows nothing about
internals of AC_CHECK_HEADER and that "presence" in this context stands
for the ability to preprocess, and "usability" stands for the ability to
compile a header).

b) see that a header is usable, but not present (building apache
portable runtime on FreeBSD spits that for sys/syslimits.h)

the reason for this is the fact that sys/syslimits.h of FreeBSD's is not
ment to be included directly and this is achieved with an #error in it.
When testing sys/syslimits.h with compiler, AC_CHECK_HEADER prepends
#include <sys/syslimits.h> with AC_INCLUDE_DEFAULTS and that happens to
avoid the #error. But when testing with preprocessor, no
AC_INCLUDE_DEFAULTS is used, so the test fails.

to make it brief: if a header is protected from userland with the #error
directive we'll most probably see warning messages and schidzoid
statements about usability of an absent file.

Well, warnings are to show that something is wrong, and protecting
includes with #error is right, at least in FreeBSD realm. Perhaps it's
not a bad idea to use AC_INCLUDE_DEFAULTS or some other mechanism when
checking a header with preprocessor (at least on FreeBSD).

OK, now to the patch:

1. It changes word "preprocessor" for "compiler" in AC_CHECK_HEADER
comment.

2. places AC_PREPROC_IFELSE before AC_COMPILE_IFELSE in
_AC_CHECK_HEADER_MONGREL_BODY


as for using some prerequisites when checking a header with perprocessor
that is only an idea

best

Alex

Attachment: autoconf-ac_check_header.diff
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]