guile-devel
[Top][All Lists]
Advanced

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

decrufting: libguile/version.h generation


From: Thien-Thi Nguyen
Subject: decrufting: libguile/version.h generation
Date: Wed, 28 Jul 2010 15:49:40 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

I think in the old days libguile/version.h generation was
more complicated (and Autoconf less sophisticated), requiring
special Makefile.am rules.  Luckily, things change...

This patch was tested from "sh autogen.sh" through "make dist"
with Autoconf 2.65.  OK to push?

>From e938cce9ed8109ea3ac067cae9d863b1b2fa0412 Mon Sep 17 00:00:00 2001
From: Thien-Thi Nguyen <address@hidden>
Date: Wed, 28 Jul 2010 14:27:42 +0200
Subject: [PATCH] [build] Create libguile/version.h using the configure script.
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit

* configure.ac (AC_CONFIG_FILES): Add libguile/version.h.

* libguile/Makefile.am (version.h): Delete target.
  (EXTRA_DIST): Remove version.h.in.
  (BUILT_SOURCES): Remove version.h.
  (MOSTLYCLEANFILES): Remove version.h, version.h.tmp.
* libguile/version.h.in (SCM_MAJOR_VERSION): Use conventional
  @VAR@ instead of @-VAR-@ for ‘GUILE_MAJOR_VERSION’.
  (SCM_MINOR_VERSION, SCM_MICRO_VERSION, SCM_EFFECTIVE_VERSION): Likewise
  for ‘GUILE_MINOR_VERSION’, ‘GUILE_MICRO_VERSION’, ‘GUILE_EFFECTIVE_VERSION’.
---
 configure.ac          |    1 +
 libguile/Makefile.am  |   15 ++-------------
 libguile/version.h.in |    8 ++++----
 3 files changed, 7 insertions(+), 17 deletions(-)

diff --git a/configure.ac b/configure.ac
index 57ba8d6..bd3f2ac 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1630,6 +1630,7 @@ AC_CONFIG_FILES([
   emacs/Makefile
   examples/Makefile
   libguile/Makefile
+  libguile/version.h
   srfi/Makefile
   guile-readline/Makefile
   test-suite/Makefile
diff --git a/libguile/Makefile.am b/libguile/Makefile.am
index a899b85..a030c21 100644
--- a/libguile/Makefile.am
+++ b/libguile/Makefile.am
@@ -416,7 +416,7 @@ DOT_I_FILES = vm-i-system.i vm-i-scheme.i vm-i-loader.i
        $(AM_V_GEN)$(GREP) '^VM_DEFINE' $< > $@
 
 BUILT_SOURCES = cpp-E.c cpp-SIG.c libpath.h \
-    version.h scmconfig.h \
+    scmconfig.h \
     $(DOT_I_FILES) $(DOT_X_FILES) $(EXTRA_DOT_X_FILES)
 
 address@hidden@_la_SOURCES = _scm.h            \
@@ -599,21 +599,11 @@ EXTRA_DIST = ChangeLog-scm ChangeLog-threads              
\
     ChangeLog-1996-1999 ChangeLog-2000 ChangeLog-2008  \
     guile-func-name-check                              \
     cpp-E.syms cpp-E.c cpp-SIG.syms cpp-SIG.c                  \
-    c-tokenize.lex version.h.in                                                
\
+    c-tokenize.lex                                             \
     scmconfig.h.top libgettext.h unidata_to_charset.pl libguile.map
 #    $(DOT_DOC_FILES) $(EXTRA_DOT_DOC_FILES) \
 #    guile-procedures.txt guile.texi
 
-## We use @-...-@ as the substitution brackets here, instead of the
-## usual @...@, so autoconf doesn't go and substitute the values
-## directly into the left-hand sides of the sed substitutions.  *sigh*
-version.h: version.h.in $(top_builddir)/config.status
-       $(AM_V_GEN)sed < $(srcdir)/version.h.in > address@hidden \
-         -e s:@-GUILE_MAJOR_VERSION-@:${GUILE_MAJOR_VERSION}: \
-         -e s:@-GUILE_MINOR_VERSION-@:${GUILE_MINOR_VERSION}: \
-         -e s:@-GUILE_MICRO_VERSION-@:${GUILE_MICRO_VERSION}: \
-         -e s:@-GUILE_EFFECTIVE_VERSION-@:${GUILE_EFFECTIVE_VERSION}: && mv 
address@hidden $@
-
 ## FIXME: Consider using timestamp file, to avoid unnecessary rebuilds.
 libpath.h: $(srcdir)/Makefile.in  $(top_builddir)/config.status
        @rm -f libpath.tmp
@@ -761,7 +751,6 @@ chknew-E chknew-SIG:

 
 MOSTLYCLEANFILES = \
-       version.h version.h.tmp \
        scmconfig.h scmconfig.h.tmp
 
 CLEANFILES = libpath.h *.x *.doc guile-procedures.txt guile-procedures.texi 
guile.texi \
diff --git a/libguile/version.h.in b/libguile/version.h.in
index 49d26c2..427afae 100644
--- a/libguile/version.h.in
+++ b/libguile/version.h.in
@@ -27,10 +27,10 @@
 

 
-#define SCM_MAJOR_VERSION @-GUILE_MAJOR_VERSION-@
-#define SCM_MINOR_VERSION @-GUILE_MINOR_VERSION-@
-#define SCM_MICRO_VERSION @-GUILE_MICRO_VERSION-@
-#define SCM_EFFECTIVE_VERSION "@-GUILE_EFFECTIVE_VERSION-@"
+#define SCM_MAJOR_VERSION @GUILE_MAJOR_VERSION@
+#define SCM_MINOR_VERSION @GUILE_MINOR_VERSION@
+#define SCM_MICRO_VERSION @GUILE_MICRO_VERSION@
+#define SCM_EFFECTIVE_VERSION "@GUILE_EFFECTIVE_VERSION@"
 
 SCM_API SCM scm_major_version (void);
 SCM_API SCM scm_minor_version (void);
-- 
1.6.3.2


reply via email to

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