From: Thien-Thi Nguyen <ttn@gnuvola.org>
To: guile-devel@gnu.org
Subject: decrufting: libguile/version.h generation
Date: Wed, 28 Jul 2010 15:49:40 +0200 [thread overview]
Message-ID: <8739v3soln.fsf@ambire.localdomain> (raw)
[-- 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
next reply other threads:[~2010-07-28 13:49 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-07-28 13:49 Thien-Thi Nguyen [this message]
2010-08-15 14:46 ` decrufting: libguile/version.h generation Ludovic Courtès
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/guile/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8739v3soln.fsf@ambire.localdomain \
--to=ttn@gnuvola.org \
--cc=guile-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).