[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] Dispatch on AC_LANG_CONFTEST
From: |
Paolo Bonzini |
Subject: |
[PATCH] Dispatch on AC_LANG_CONFTEST |
Date: |
Mon, 3 Nov 2008 10:25:23 +0100 |
Just by avoiding needless complications, we can save a fork per
test. I might be missing something, but this time it really
seems like very low-hanging fruit...
Ok?
Paolo
* lib/autoconf/c.m4 (AC_LANG_CONFTEST(C)): Define instead of
AC_LANG_SOURCE(C).
* lib/autoconf/general.m4 (_AC_INIT_PREPARE): Add a comment at the
top of confdefs.h, which also works around cpp deficiencies.
* lib/autoconf/lang.m4 (AC_LANG_DEFINE): Define AC_LANG_CONFTEST(xyz)
(AC_LANG_CONFTEST): Dispatch based on _AC_LANG.
(AC_LANG_CONFTEST()): New.
---
lib/autoconf/c.m4 | 11 +++++------
lib/autoconf/general.m4 | 3 ++-
lib/autoconf/lang.m4 | 10 +++++++++-
3 files changed, 16 insertions(+), 8 deletions(-)
diff --git a/lib/autoconf/c.m4 b/lib/autoconf/c.m4
index 2260879..b728d80 100644
--- a/lib/autoconf/c.m4
+++ b/lib/autoconf/c.m4
@@ -99,18 +99,17 @@ AU_DEFUN([AC_LANG_C], [AC_LANG(C)])
# ------------------------ #
-# AC_LANG_SOURCE(C)(BODY)
+# AC_LANG_CONFTEST(C)(BODY)
# -----------------------
# We can't use '#line $LINENO "configure"' here, since
# Sun c89 (Sun WorkShop 6 update 2 C 5.3 Patch 111679-08 2002/05/09)
# rejects $LINENO greater than 32767, and some configure scripts
# are longer than 32767 lines.
-m4_define([AC_LANG_SOURCE(C)],
-[/* confdefs.h. */
-_ACEOF
-cat confdefs.h - <<_ACEOF >>conftest.$ac_ext
+m4_define([AC_LANG_CONFTEST(C)],
+[cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-$1])
+$1
+_ACEOF])
# AC_LANG_PROGRAM(C)([PROLOGUE], [BODY])
diff --git a/lib/autoconf/general.m4 b/lib/autoconf/general.m4
index c990c05..834c4b9 100644
--- a/lib/autoconf/general.m4
+++ b/lib/autoconf/general.m4
@@ -1324,9 +1324,10 @@ ac_signal=0
# confdefs.h avoids OS command line length limits that DEFS can exceed.
rm -f -r conftest* confdefs.h
+
dnl AIX cpp loses on an empty file, NextStep 3.3 (patch 3) loses on a file
dnl containing less than 14 bytes (including the newline).
-dnl But the defines below solve this problem.
+AS_ECHO(["/* confdefs.h */"]) > confdefs.h
# Predefined preprocessor variables.
AC_DEFINE_UNQUOTED([PACKAGE_NAME], ["$PACKAGE_NAME"],
diff --git a/lib/autoconf/lang.m4 b/lib/autoconf/lang.m4
index 563c381..7f99ce5 100644
--- a/lib/autoconf/lang.m4
+++ b/lib/autoconf/lang.m4
@@ -188,6 +188,7 @@ m4_define([AC_LANG_DEFINE],
[m4_define([AC_LANG($1)], [$5])]
[m4_define([_AC_LANG_ABBREV($1)], [$2])]
[m4_define([_AC_LANG_PREFIX($1)], [$3])]
+[m4_copy([AC_LANG_CONFTEST($4)], [AC_LANG_CONFTEST($1)])]
[m4_copy([AC_LANG_SOURCE($4)], [AC_LANG_SOURCE($1)])]
[m4_ifval([$4],
[m4_copy([AC_LANG_PROGRAM($4)], [AC_LANG_PROGRAM($1)])]
@@ -205,7 +206,14 @@ m4_define([AC_LANG_DEFINE],
# ----------------------
# Save the BODY in `conftest.$ac_ext'. Add a trailing new line.
AC_DEFUN([AC_LANG_CONFTEST],
-[cat >conftest.$ac_ext <<_ACEOF
+[_AC_LANG_DISPATCH([$0], _AC_LANG, $@)])
+
+
+# AC_LANG_CONFTEST()(BODY)
+# ------------------------
+# Default implementation of AC_LANG_CONFTEST.
+m4_define([AC_LANG_CONFTEST()],
+[cat > conftest.$ac_ext <<_ACEOF
$1
_ACEOF])
--
1.5.6.5
- [PATCH] Dispatch on AC_LANG_CONFTEST,
Paolo Bonzini <=