]> Savannah Git Hosting - gnulib.git/commitdiff
fseeko-tests, ftello-tests: Avoid "guessing no" when cross-compiling.
authorBruno Haible <bruno@clisp.org>
Sat, 5 May 2012 09:48:16 +0000 (11:48 +0200)
committerBruno Haible <bruno@clisp.org>
Sat, 5 May 2012 09:48:16 +0000 (11:48 +0200)
* m4/ungetc.m4 (gl_FUNC_UNGETC_WORKS): Require AC_CANONICAL_HOST. When
cross-compiling to a glibc platform, set gl_cv_func_ungetc_works to
"guessing yes".

ChangeLog
m4/ungetc.m4

index 7e2af4107ad01f67b2e791bdfb87ca8a237d86e7..de58612bfa06142cc78f27c513ed5da5c449f79a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2012-05-05  Bruno Haible  <bruno@clisp.org>
+
+       fseeko-tests, ftello-tests: Avoid "guessing no" when cross-compiling.
+       * m4/ungetc.m4 (gl_FUNC_UNGETC_WORKS): Require AC_CANONICAL_HOST. When
+       cross-compiling to a glibc platform, set gl_cv_func_ungetc_works to
+       "guessing yes".
+
 2012-05-05  Bruno Haible  <bruno@clisp.org>
 
        signbit: Avoid "guessing no" when cross-compiling to glibc systems.
index 95bb3eb3b0dce741b4598a81b5ecdbbb5beb1b4e..9bc1ce76353d5173727f8ee26ae1369bdca12e09 100644 (file)
@@ -1,4 +1,4 @@
-# ungetc.m4 serial 2
+# ungetc.m4 serial 3
 dnl Copyright (C) 2009-2012 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -7,6 +7,7 @@ dnl with or without modifications, as long as this notice is preserved.
 AC_DEFUN_ONCE([gl_FUNC_UNGETC_WORKS],
 [
   AC_REQUIRE([AC_PROG_CC])
+  AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
 
   AC_CACHE_CHECK([whether ungetc works on arbitrary bytes],
     [gl_cv_func_ungetc_works],
@@ -27,10 +28,19 @@ AC_DEFUN_ONCE([gl_FUNC_UNGETC_WORKS],
            if (fgetc (f) != 'c') return 11;
            fclose (f); remove ("conftest.tmp");])],
         [gl_cv_func_ungetc_works=yes], [gl_cv_func_ungetc_works=no],
-        [gl_cv_func_ungetc_works='guessing no'])
+        [case "$host_os" in
+                   # Guess yes on glibc systems.
+           *-gnu*) gl_cv_func_ungetc_works="guessing yes" ;;
+                   # If we don't know, assume the worst.
+           *)      gl_cv_func_ungetc_works="guessing no" ;;
+         esac
+        ])
     ])
-  if test "$gl_cv_func_ungetc_works" != yes; then
-    AC_DEFINE([FUNC_UNGETC_BROKEN], [1],
-      [Define to 1 if ungetc is broken when used on arbitrary bytes.])
-  fi
+  case "$gl_cv_func_ungetc_works" in
+    *yes) ;;
+    *)
+      AC_DEFINE([FUNC_UNGETC_BROKEN], [1],
+        [Define to 1 if ungetc is broken when used on arbitrary bytes.])
+      ;;
+  esac
 ])