Subject: [RFC/PATCH 4] autoconf: Preparing the way for autodetection

From: Jakub Narebski <[email-masked]>
Date: Sat, 8 Jul 2006 23:07:09 +0200

Prepares configure.ac to output autodetected and selected (by using
--with/--without and --enable/disable parameters to generated
./configure script) building configuration in "git style", i.e. by
appending appropriate variables to output file config.mak.autogen
(via temporary file config.mak.append).

Signed-off-by: Jakub Narebski <[email-masked]>
---
This series of patches tries to build _optional_ automatic build
and install configuration, using existing build configuration
variables, and not making changes to Makefile.

Series of patches 4-8 adds automatic detection of compilation
configuration (those which I could write easily).

 configure.ac |   19 +++++++++++++++++--
 1 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/configure.ac b/configure.ac
index 6fe5013..e68d416 100644
--- a/configure.ac
+++ b/configure.ac
@@ -7,8 +7,19 @@ AC_INIT([git], [1.4.1], [[email-masked]
 AC_CONFIG_SRCDIR([git.c])
 
 config_file=config.mak.autogen
+config_append=config.mak.append
 config_in=config.mak.in
 
+echo "# ${config_append}.  Generated by configure." > "${config_append}"
+
+
+## Definitions of macros
+# GIT_CONF_APPEND_LINE(LINE)
+# --------------------------
+# Append LINE to file ${config_append}
+AC_DEFUN([GIT_CONF_APPEND_LINE],
+[echo "$1" >> "${config_append}"])# GIT_CONF_APPEND_LINE
+
 
 ## Checks for programs.
 # Define NO_PYTHON if you want to loose all benefits of the recursive merge.
@@ -73,7 +84,7 @@ # Define NO_ACCURATE_DIFF if your diff p
 # a missing newline at the end of the file.

-## Site configuration 
+## Site configuration
 ## --with-PACKAGE[=ARG] and --without-PACKAGE
 # Define NO_SVN_TESTS if you want to skip time-consuming SVN interopability
 # tests.  These tests take up a significant amount of the total test time
@@ -121,6 +132,10 @@ #
 # Define USE_STDEV below if you want git to care about the underlying device
 # change being considered an inode change from the update-cache perspective.
 
+
 ## Output files
-AC_CONFIG_FILES(["${config_file}":"${config_in}"]) 
+AC_CONFIG_FILES(["${config_file}":"${config_in}":"${config_append}"])
 AC_OUTPUT
+
+## Cleanup
+rm -f "${config_append}"
-- 
1.4.0