Subject: [PATCH 13] autoconf: Append '-include config.mak.autogen' to config.mak if it is not present

From: Jakub Narebski <[email-masked]>
Date: Fri, 30 Jun 2006 17:11:39 +0200

Signed-off-by: Jakub Narebski <[email-masked]>
---
Andreas Ericsson wrote:
> Jakub Narebski wrote:
>>
>> The idea was to use ./configure to _generate_ config.mak, which the user can
>> then edit.
>
> This is bad, since it forces users to do one thing first and then do
> what they're used to. Better to have the script add
>
> -include config.mak.autogen
>
> LAST in config.mak, unless it's already in the file and generate
> config.mak.autogen with configure, e.g. with
>
> grep -q autogen config.mak || \
>         echo "-include config.mak.autogen" >> config.mak
>
> Since Make does things bottoms-up (much like swedish students and
> midsummer celebrators), the previous hand-edited defaults in config.mak
> will beat the ones in config.mak.autogen (a good thing).
>
> I wouldn't want my long-standing, functioning config.mak overwritten,
> but I *might* be interested in trying some of the options provided by
> ./configure.

Done, with small changes.

Can anyone tell me if frep use is portable enough?

 configure.ac |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/configure.ac b/configure.ac
index 1ead656..2904077 100644
--- a/configure.ac
+++ b/configure.ac
@@ -54,3 +54,6 @@ AC_CONFIG_FILES(["${config_file}":"${con
 AC_OUTPUT
 
 rm -f "${config_append}"
+
+grep -q -s -F "-include ${config_file}" config.mak || \
+        echo  "-include ${config_file}" >> config.mak
-- 
1.4.0