Mesa (master): configure: use AC_CHECK_HEADERS to check for endian.h

Emil Velikov evelikov at kemper.freedesktop.org
Fri Mar 23 18:13:20 UTC 2018


Module: Mesa
Branch: master
Commit: 5a75019ad0270a974788a9b8648ba98ff4203768
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=5a75019ad0270a974788a9b8648ba98ff4203768

Author: Emil Velikov <emil.velikov at collabora.co.uk>
Date:   Fri Mar 23 17:37:39 2018 +0000

configure: use AC_CHECK_HEADERS to check for endian.h

The currently we use the singular CHECK_HEADER combined with explicit
append to the DEFINES variable. That is a legacy misnomer, since it
requires us to add $DEFINES to every piece that we build.

Using the plural version of the helper sets the HAVE_ macro for us, plus
ensures it's passed to the compiler - if config.h is available in there
(not in the case of mesa) otherwise on the command line.

In hindsight, we should replace all the AC_CHECK_{FUNC,HEADER} instances
with the plural version (or even the _ONCE suffixed version) and drop
the DEFINES hacks.

Fixes: cbee1bfb342 ("meson/configure: detect endian.h instead of trying
to guess when it's available")
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=105717
Signed-off-by: Emil Velikov <emil.velikov at collabora.com>
Acked-by: Eric Engestrom <eric.engestrom at imgtec.com>
Tested-by: Clayton Craft <clayton.a.craft at intel.com>

---

 configure.ac | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index 36c56da787..99805e0f2b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -865,7 +865,7 @@ fi
 AC_HEADER_MAJOR
 AC_CHECK_HEADER([xlocale.h], [DEFINES="$DEFINES -DHAVE_XLOCALE_H"])
 AC_CHECK_HEADER([sys/sysctl.h], [DEFINES="$DEFINES -DHAVE_SYS_SYSCTL_H"])
-AC_CHECK_HEADER([endian.h], [DEFINES="$DEFINES -DHAVE_ENDIAN_H"])
+AC_CHECK_HEADERS([endian.h])
 AC_CHECK_FUNC([strtof], [DEFINES="$DEFINES -DHAVE_STRTOF"])
 AC_CHECK_FUNC([mkostemp], [DEFINES="$DEFINES -DHAVE_MKOSTEMP"])
 AC_CHECK_FUNC([timespec_get], [DEFINES="$DEFINES -DHAVE_TIMESPEC_GET"])




More information about the mesa-commit mailing list