bug-make
[Top][All Lists]
Advanced

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

[PATCH] little cross-compile fix


From: Nix
Subject: [PATCH] little cross-compile fix
Date: 30 Jul 2001 08:29:14 +0100
User-agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Artificial Intelligence (candidate 3))

Make endeavours to support cross-compilation, but it doesn't because of
an infelicity in autoconf.  This fixes that; well, kludges around it in
true autoconf style...

2001-07-30  Nix  <address@hidden>

        * acinclude.m4 (NIX_FUNC_SETVBUF_REVERSED): Define a
        FUNC_SETVBUF_REVERSED with (negative) results when
        cross-compiling.
        * configure.in: Call it.

diff -durN 3.79.1/acinclude.m4 sparc-amaterasu/acinclude.m4
--- 3.79.1/acinclude.m4 Tue Jun 20 15:00:16 2000
+++ sparc-amaterasu/acinclude.m4        Mon Jul 30 07:46:09 2001
@@ -534,3 +534,32 @@
       AC_DEFINE_UNQUOTED(LOCALEDIR, "$prefix/share/locale")
     fi
   fi])
+
+# From autoconf-2.52, lightly modified to allow cross-compilation.
+# Assume we are crossing to a fairly new system.
+
+AC_DEFUN([NIX_FUNC_SETVBUF_REVERSED],
+[AC_CACHE_CHECK(whether setvbuf arguments are reversed,
+  ac_cv_func_setvbuf_reversed,
+[AC_TRY_RUN([#include <stdio.h>
+/* If setvbuf has the reversed format, exit 0. */
+int
+main ()
+{
+  /* This call has the arguments reversed.
+     A reversed system may check and see that the address of main
+     is not _IOLBF, _IONBF, or _IOFBF, and return nonzero.  */
+  if (setvbuf(stdout, _IOLBF, (char *) main, BUFSIZ) != 0)
+    exit(1);
+  putc('\r', stdout);
+  exit(0);                      /* Non-reversed systems segv here.  */
+}], ac_cv_func_setvbuf_reversed=yes, ac_cv_func_setvbuf_reversed=no, 
ac_cv_func_setvbuf_reversed=no)
+rm -f core core.* *.core])
+if test $ac_cv_func_setvbuf_reversed = yes; then
+  AC_DEFINE(SETVBUF_REVERSED, 1,
+            [Define if the `setvbuf' function takes the buffering type as
+             its second argument and the buffer pointer as the third, as on
+             System V before release 3.])
+fi
+])# AC_FUNC_SETVBUF_REVERSED
+
diff -durN 3.79.1/configure.in sparc-amaterasu/configure.in
--- 3.79.1/configure.in Fri Jun 23 17:09:41 2000
+++ sparc-amaterasu/configure.in        Mon Jul 30 07:40:11 2001
@@ -111,7 +111,7 @@
 AC_FUNC_VPRINTF
 AC_FUNC_STRCOLL
 AC_FUNC_CLOSEDIR_VOID
-AC_FUNC_SETVBUF_REVERSED
+NIX_FUNC_SETVBUF_REVERSED
 
 AC_CHECK_LIB(kstat, kstat_open) dnl _Must_ come before AC_FUNC_GETLOADAVG.
 AC_CHECK_FUNCS(pstat_getdynamic) dnl Supposedly in AC_FUNC_GETLOADAVG, but...?


-- 
`It's all about bossing computers around. Users have to say "please".
Programmers get to say "do what I want NOW or the hard disk gets it".'
                        -- Richard Heathfield on the nature of programming



reply via email to

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