GNOME Bugzilla – Bug 667293
build: Make sure AC_INCLUDES_DEFAULT is used
Last modified: 2012-06-27 20:23:18 UTC
Created attachment 204611 [details] [review] patch Without using AC_INCLUDES_DEFAULT explicitly, certain platforms will complain that the header was found, but not usable by the compiler. This happens for instance on Solaris where certain headers are needed to pull in proper defines.
An informative commit message, hooray! I was curious why AC_CHECK_HEADER doesn't just default to AC_INCLUDES_DEFAULT if the argument is not provided. Short snippet from /usr/share/autoconf/autoconf/headers.m4: # AC_CHECK_HEADER(HEADER-FILE, # [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND], # [INCLUDES]) # --------------------------------------------------------- # We are slowly moving to checking headers with the compiler instead # of the preproc, so that we actually learn about the usability of a # header instead of its mere presence. But since users are used to # the old semantics, they check for headers in random order and # without providing prerequisite headers. This macro implements the # transition phase, and should be cleaned up latter to use compilation # only. # # If INCLUDES is empty, then check both via the compiler and preproc. # If the results are different, issue a warning, but keep the preproc # result. # # If INCLUDES is `-', keep only the old semantics. # # If INCLUDES is specified and different from `-', then use the new # semantics only. This makes me wonder if there isn't a more proper way..
This comes down to getting stdlib.h in the mix together with whatever defines have been set on the command line or in the autoconf test to define X/Open standard with or without extensions. These are needed for the compiler to accept most of the header files autoconf checks for on Solaris. The downside is of course that it no longer just checks for the presence of the header file, but that the check fails if it isn't useable. I've tested this on Solaris 11 Express and Solaris 11 11/11, all with SunPro. It's also been tested on Mac OS X (10.6) with GCC 4.2 and LLVM-GCC, and on Linux (Ubuntu 10 and 11) with GCC 4.5 and 4.6. However, for all them, fairly recent versions of autoconf were used (ranging from v2.65 to v2.68 if I remember correctly). I believe the new semantics makes more sense. I realize that's a personal opinion though, and that there have been fairly heated discussions on the subject. I'd prefer to get AC_INCLUDES_DEFAULT in there to 1) get rid of the warning and 2) be prepared for the eventual switch. That is, if the switch ever happens; I think I remember seeing this distinction and switch warning already in the late 90's.
Pushed: commit 7b80441f9d4ec1efb220875795d556370b022204 Author: Idar Tollefsen <itollefs@cisco.com> Date: Sun Jan 1 16:38:08 2012 +0100 build: Make sure AC_INCLUDES_DEFAULT is used Without using AC_INCLUDES_DEFAULT explicitly, certain platforms will complain that the header was found, but not usable by the compiler. This happens for instance on Solaris where certain headers are needed to pull in proper defines. Also upgrade to newer autoconf syntax and use proper quoting. https://bugzilla.gnome.org/show_bug.cgi?id=667293 (Removed some unrelated stuff, like WIN32_LIBS/GST_PRIVATE_LIBS change)