]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
mach: Fix passing -ffreestanding when checking for gnumach headers
authorSamuel Thibault <samuel.thibault@ens-lyon.org>
Mon, 19 Dec 2022 01:34:55 +0000 (02:34 +0100)
committerSamuel Thibault <samuel.thibault@ens-lyon.org>
Mon, 19 Dec 2022 01:34:55 +0000 (02:34 +0100)
8b8c768e3c70 ("Force use of -ffreestanding when checking for gnumach
headers") was passing -ffreestanding to CFLAGS only, but headers checks are
performed with the preprocessor, so we rather need to pass it to CPPFLAGS.

sysdeps/mach/configure
sysdeps/mach/configure.ac

index 36f556a66394dbc3a6db501875bfcb4c6f82a6c3..ba6371cd3f15f9e55f42db47d41b8e1d8a22995b 100644 (file)
@@ -127,14 +127,13 @@ fi
 config_vars="$config_vars
 MIG = $MIG"
 
+OLD_CPPFLAGS=$CPPFLAGS
 if test -n "$sysheaders"; then
-  OLD_CPPFLAGS=$CPPFLAGS
   CPPFLAGS="$CPPFLAGS $SYSINCLUDES"
 fi
 
 ### Sanity checks for Mach header installation
-old_CFLAGS=$CFLAGS
-CFLAGS="$CFLAGS -ffreestanding"
+CPPFLAGS="$CPPFLAGS -ffreestanding"
 
 
 ac_fn_c_check_header_preproc "$LINENO" "mach/mach_types.h" "ac_cv_header_mach_mach_types_h"
@@ -527,6 +526,4 @@ if test $hurd_cv_mig_retcode = yes; then
 
 fi
 
-if test -n "$sysheaders"; then
-  CPPFLAGS=$OLD_CPPFLAGS
-fi
+CPPFLAGS=$OLD_CPPFLAGS
index 5816c3d4ad45cae32fbbb4090aaa0d2c6211e4f8..900e5445c5ae3ace7a1ef7f68dc759b2ae7b6ea7 100644 (file)
@@ -6,14 +6,13 @@ if test "x$MIG" = xMISSING; then
 fi
 LIBC_CONFIG_VAR([MIG], [$MIG])
 
+OLD_CPPFLAGS=$CPPFLAGS
 if test -n "$sysheaders"; then
-  OLD_CPPFLAGS=$CPPFLAGS
   CPPFLAGS="$CPPFLAGS $SYSINCLUDES"
 fi
 
 ### Sanity checks for Mach header installation
-old_CFLAGS=$CFLAGS
-CFLAGS="$CFLAGS -ffreestanding"
+CPPFLAGS="$CPPFLAGS -ffreestanding"
 AC_CHECK_HEADER(mach/mach_types.h,,
                 [AC_MSG_ERROR([cannot find Mach headers])], -)
 CFLAGS=$old_CFLAGS
@@ -136,6 +135,4 @@ fi])
 
 hurd_MIG_RETCODE
 
-if test -n "$sysheaders"; then
-  CPPFLAGS=$OLD_CPPFLAGS
-fi
+CPPFLAGS=$OLD_CPPFLAGS