bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

cross-compilation guesses (12)


From: Bruno Haible
Subject: cross-compilation guesses (12)
Date: Sat, 05 May 2012 11:56:18 +0200
User-agent: KMail/4.7.4 (Linux/3.1.10-1.9-desktop; KDE/4.7.4; x86_64; ; )

This cross-compilation guess is also suboptimal:

  checking for d_ino member in directory struct... no

since d_ino is known to work on glibc/Linux since ever:
glibc/sysdeps/unix/sysv/linux/bits/dirent.h is essentially unchanged since
1997.


2012-05-05  Bruno Haible  <address@hidden>

        d-ino: Avoid guessing "no" when cross-compiling to glibc/Linux systems.
        * m4/d-ino.m4 (gl_CHECK_TYPE_STRUCT_DIRENT_D_INO): Require
        AC_CANONICAL_HOST. When cross-compiling to a glibc/Linux platform,
        set gl_cv_struct_dirent_d_ino to "guessing yes".

--- m4/d-ino.m4.orig    Sat May  5 11:52:19 2012
+++ m4/d-ino.m4 Sat May  5 09:00:12 2012
@@ -1,4 +1,4 @@
-# serial 12
+# serial 13
 
 dnl From Jim Meyering.
 dnl
@@ -13,7 +13,8 @@
 # with or without modifications, as long as this notice is preserved.
 
 AC_DEFUN([gl_CHECK_TYPE_STRUCT_DIRENT_D_INO],
-  [AC_CACHE_CHECK([for d_ino member in directory struct],
+  [AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+   AC_CACHE_CHECK([for d_ino member in directory struct],
                   gl_cv_struct_dirent_d_ino,
      [AC_RUN_IFELSE(
         [AC_LANG_PROGRAM(
@@ -37,10 +38,18 @@
            ]])],
            [gl_cv_struct_dirent_d_ino=yes],
            [gl_cv_struct_dirent_d_ino=no],
-           [gl_cv_struct_dirent_d_ino=no])])
-   if test $gl_cv_struct_dirent_d_ino = yes; then
-     AC_DEFINE([D_INO_IN_DIRENT], [1],
-       [Define if struct dirent has a member d_ino that actually works.])
-   fi
+           [case "$host_os" in
+                           # Guess yes on glibc systems with Linux kernel.
+              linux*-gnu*) gl_cv_struct_dirent_d_ino="guessing yes" ;;
+                           # If we don't know, assume the worst.
+              *)           gl_cv_struct_dirent_d_ino="guessing no" ;;
+            esac
+           ])])
+   case "$gl_cv_struct_dirent_d_ino" in
+     *yes)
+       AC_DEFINE([D_INO_IN_DIRENT], [1],
+         [Define if struct dirent has a member d_ino that actually works.])
+       ;;
+   esac
   ]
 )




reply via email to

[Prev in Thread] Current Thread [Next in Thread]