unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
* decrufting: libguile/version.h generation
@ 2010-07-28 13:49 Thien-Thi Nguyen
  2010-08-15 14:46 ` Ludovic Courtès
  0 siblings, 1 reply; 2+ messages in thread
From: Thien-Thi Nguyen @ 2010-07-28 13:49 UTC (permalink / raw)
  To: guile-devel

[-- Attachment #1: Type: text/plain, Size: 272 bytes --]

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?


[-- Attachment #2: 0001-build-Create-libguile-version.h-using-the-configure-.patch --]
[-- Type: text/x-diff, Size: 3967 bytes --]

From e938cce9ed8109ea3ac067cae9d863b1b2fa0412 Mon Sep 17 00:00:00 2001
From: Thien-Thi Nguyen <ttn@gnuvola.org>
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)
 
 EXTRA_libguile_@GUILE_EFFECTIVE_VERSION@_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 > $@.tmp \
-	  -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 $@.tmp $@
-
 ## 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:
 \f
 
 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 @@
 
 \f
 
-#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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: decrufting: libguile/version.h generation
  2010-07-28 13:49 decrufting: libguile/version.h generation Thien-Thi Nguyen
@ 2010-08-15 14:46 ` Ludovic Courtès
  0 siblings, 0 replies; 2+ messages in thread
From: Ludovic Courtès @ 2010-08-15 14:46 UTC (permalink / raw)
  To: guile-devel

Hi Guilers!

Thien-Thi Nguyen <ttn@gnuvola.org> writes:

> * 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’.

Fine with me, please push!

Ludo’.




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-08-15 14:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-28 13:49 decrufting: libguile/version.h generation Thien-Thi Nguyen
2010-08-15 14:46 ` Ludovic Courtès

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).