[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
How do I stop configure on non-compilable headers using AC_CHECK_HEADER
From: |
Jan-Joost Spanjers |
Subject: |
How do I stop configure on non-compilable headers using AC_CHECK_HEADER |
Date: |
Wed, 17 Sep 2003 16:55:07 +0200 |
Hi,
On this bug list I notice a lot of bug reports about headers that are
present but cannot be compiled. And Akim Demaille keeps answering these
bug reports nicely and with a lot of dedication (thanks for that).
Unfortunately, it appears to me that in these replies there is no good
solution to solve the bug most commonly found:
When using AC_CHECK_HEADER to check the compilability of a header file,
AC_CHECK_HEADER first checks for presence of the header file and
acceptability by the preprocessor. After this, it checks for
compilability. When this last check fails, configure continues with the
prepocessor's result, to be compatible with older versions.
Unfortunately, this is not working for programs that rely on
AC_CHECK_HEADER to not succeed when the headers are not compilable.
Is there an alternative to AC_CHECK_HEADER that will fail/not succeed when
the headers are not compilable?
To make myself a little more clear, I will give you an example:
I tried to compile gnome's control-center-2.3.4. It's configure.ac
contains a line like:
AC_CHECK_HEADERS(X11/extensions/xf86misc.h, XF86MISC_LIBS="-lXxf86misc")
When I run ./configure, this gives me the warnings:
checking X11/extensions/xf86misc.h usability... no
checking X11/extensions/xf86misc.h presence... yes
configure: WARNING: X11/extensions/xf86misc.h: present but cannot be
compiled
configure: WARNING: X11/extensions/xf86misc.h: check for missing
prerequisite headers?
configure: WARNING: X11/extensions/xf86misc.h: proceeding with the
preprocessor's result
configure: WARNING: ## ------------------------------------ ##
configure: WARNING: ## Report this to address@hidden ##
configure: WARNING: ## ------------------------------------ ##
checking for X11/extensions/xf86misc.h... yes
This is probably caused by a buggy X11/extensions/xf86misc.h, but
control-center can probably do without if detected properly.
Because AC_CHECK_HEADERS uses the preprocessor result, it executes
XF86MISC_LIBS="-lXxf86misc", while it would not if it use the usability
result (checking X11/extensions/xf86misc.h usability... no)
So my question really is, how can I make AC_CHECK_HEADERS use the
usability result instead of the preprocessor's result?
Kind regards,
J. Spanjers
- How do I stop configure on non-compilable headers using AC_CHECK_HEADER,
Jan-Joost Spanjers <=