autoconf-patches
[Top][All Lists]
Advanced

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

Re: Possible patch for autoconf?


From: Akim Demaille
Subject: Re: Possible patch for autoconf?
Date: 25 Apr 2001 19:32:36 +0200
User-agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.1 (Cuyahoga Valley)

>>>>> "Akim" == Akim Demaille <address@hidden> writes:

Akim> I also submit this patch.

Quite unreadable huh?

---------------------------------------- Before:

# _AC_PROG_PREPROC_WORKS
# ----------------------
# Check if $ac_cpp is a working preprocessor that can flag absent
# includes either by the exit status or by warnings
# Set ac_cpp_err to a non-empty value if the preprocessor failed
# This macro is for all languages, not only C
AC_DEFUN([_AC_PROG_PREPROC_WORKS],
[# Use a header file that comes with gcc, so configuring glibc
# with a fresh cross-compiler works.
# On the NeXT, cc -E runs the code through the compiler's parser,
# not just through cpp. "Syntax error" is here to catch this case.
ac_[]_AC_LANG_ABBREV[]_preproc_warn_flag=maybe
_AC_PREPROC_IFELSE([AC_LANG_SOURCE(address@hidden:@include <assert.h>
Syntax error]])],
[# Now check whether non-existent headers can be detected and how
# Skip if ac_cpp_err is not empty - ac_cpp is broken
if test -z "$ac_cpp_err"; then
  _AC_PREPROC_IFELSE([AC_LANG_SOURCE(address@hidden:@include 
<ac_nonexistent.h>]])],
  [# cannot detect missing includes at all
ac_cpp_err=yes],
  [if test "x$ac_cpp_err" = xmaybe; then
      ac_[]_AC_LANG_ABBREV[]_preproc_warn_flag=yes
    else
      ac_[]_AC_LANG_ABBREV[]_preproc_warn_flag=
    fi
    ac_cpp_err=])
fi])])# _AC_PROG_PREPROC_WORKS

---------------------------------------- After:

# _AC_PROG_PREPROC_WORKS_IFELSE(IF-WORKS, IF-NOT)
# -----------------------------------------------
# Check if $ac_cpp is a working preprocessor that can flag absent
# includes either by the exit status or by warnings.
# Set ac_cpp_err to a non-empty value if the preprocessor failed.
# This macro is for all languages, not only C.
AC_DEFUN([_AC_PROG_PREPROC_WORKS_IFELSE],
[# We don't know yet if stderr is the criterion (vs exit status).
ac_[]_AC_LANG_ABBREV[]_preproc_warn_flag=maybe

# Use a header file that comes with gcc, so configuring glibc
# with a fresh cross-compiler works.
# On the NeXT, cc -E runs the code through the compiler's parser,
# not just through cpp. "Syntax error" is here to catch this case.
_AC_PREPROC_IFELSE([AC_LANG_SOURCE(address@hidden:@include <assert.h>
Syntax error]])],
[# OK, works on sane cases.  Now check whether non-existent headers can
# be detected and how.
_AC_PREPROC_IFELSE([AC_LANG_SOURCE(address@hidden:@include 
<ac_nonexistent.h>]])],
[# Broken: cannot detect missing includes.
m4_default([$2], :)],
[# OK, detects failures.  How?
if test "x$ac_cpp_err" = xmaybe; then
   ac_[]_AC_LANG_ABBREV[]_preproc_warn_flag=yes
else
   ac_[]_AC_LANG_ABBREV[]_preproc_warn_flag=
fi
$1])],
                  [# Broken: cannot fail on valid input.
m4_default([$2], :)])])# _AC_PROG_PREPROC_WORKS_IFELSE



reply via email to

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