After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 667293 - build: Make sure AC_INCLUDES_DEFAULT is used
build: Make sure AC_INCLUDES_DEFAULT is used
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
git master
Other All
: Normal normal
: 0.10.37
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2012-01-04 19:58 UTC by Håvard Graff (hgr)
Modified: 2012-06-27 20:23 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch (5.22 KB, patch)
2012-01-04 19:58 UTC, Håvard Graff (hgr)
none Details | Review

Description Håvard Graff (hgr) 2012-01-04 19:58:37 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.
Comment 1 Tim-Philipp Müller 2012-01-05 00:47:51 UTC
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..
Comment 2 Idar Tollefsen 2012-03-21 12:55:40 UTC
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.
Comment 3 Tim-Philipp Müller 2012-06-27 20:23:18 UTC
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)