From 9052b52dfc69d9567e2e664b0f096bfae535bcad Mon Sep 17 00:00:00 2001 From: Paul Smith Date: Fri, 10 May 2002 03:15:07 +0000 Subject: Fix Debian bug #144306: pass target-specific variables into the environment properly. Fix configure: allow cross-compilation; fix getloadavg (still needs _lots_ of work!) Let $(call ...) functions to be self-referencing. Lets us do transitive closures, for example. --- acinclude.m4 | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) (limited to 'acinclude.m4') diff --git a/acinclude.m4 b/acinclude.m4 index 59a9359..cd2b903 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -111,3 +111,54 @@ AC_DEFUN(AC_STRUCT_ST_MTIM_NSEC, fi ] ) + + +dnl --------------------------------------------------------------------------- +dnl This will be in the next version of autoconf; take this out then! + +# make_FUNC_SETVBUF_REVERSED +# ------------------------ +AC_DEFUN([make_FUNC_SETVBUF_REVERSED], +[AC_REQUIRE([AC_C_PROTOTYPES])dnl +AC_CACHE_CHECK(whether setvbuf arguments are reversed, + ac_cv_func_setvbuf_reversed, + [ac_cv_func_setvbuf_reversed=no + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[#include +# if PROTOTYPES + int (setvbuf) (FILE *, int, char *, size_t); +# endif]], + [[char buf; return setvbuf (stdout, _IOLBF, &buf, 1);]])], + [AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[#include +# if PROTOTYPES + int (setvbuf) (FILE *, int, char *, size_t); +# endif]], + [[char buf; return setvbuf (stdout, &buf, _IOLBF, 1);]])], + [# It compiles and links either way, so it must not be declared + # with a prototype and most likely this is a K&R C compiler. + # Try running it. + AC_RUN_IFELSE( + [AC_LANG_PROGRAM( + [[#include ]], + [[/* This call has the arguments reversed. + A reversed system may check and see that the address of buf + is not _IOLBF, _IONBF, or _IOFBF, and return nonzero. */ + char buf; + if (setvbuf (stdout, _IOLBF, &buf, 1) != 0) + exit (1); + putchar ('\r'); + exit (0); /* Non-reversed systems SEGV here. */]])], + ac_cv_func_setvbuf_reversed=yes, + rm -f core core.* *.core, + [[: # Assume setvbuf is not reversed when cross-compiling.]])] + ac_cv_func_setvbuf_reversed=yes)])]) +if test $ac_cv_func_setvbuf_reversed = yes; then + AC_DEFINE(SETVBUF_REVERSED, 1, + [Define to 1 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 +])# make_FUNC_SETVBUF_REVERSED -- cgit v1.2.3