From 2217b3d6f0a65d2da940afb1e52b25e3eca6f22f Mon Sep 17 00:00:00 2001 From: Tobias Boege Date: Wed, 22 May 2013 14:29:01 +0000 Subject: [PATCH] [CONFIGURATION] * BUG: Define the TRUNK_VERSION macro in gbx's Makefile.am which is less error-prone and other parts of the build process won't use it anyway. automake thinks that the $(shell ...) call shall a variable and warns but that can safely be ignored I think. git-svn-id: svn://localhost/gambas/trunk@5672 867c0c6c-44f3-4631-809d-bfa615b0a4ec --- acinclude.m4 | 10 ---------- main/gbx/Makefile.am | 3 ++- main/gbx/gbx.c | 2 +- 3 files changed, 3 insertions(+), 12 deletions(-) diff --git a/acinclude.m4 b/acinclude.m4 index 82a2adbb6..64b465f34 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -86,16 +86,6 @@ AC_DEFUN([GB_INIT_AUTOMAKE], AC_DEFINE(GAMBAS_PCODE_VERSION, 0x03050000, [Gambas bytecode version]) AC_DEFINE(GAMBAS_PCODE_VERSION_MIN, 0x03000000, [Minimum Gambas bytecode version]) - IN_REPO=$(svn info >/dev/null 2>&1 && echo yes) - if test -n "$IN_REPO"; then - ## These will go into the Makefiles. Quoting is a mess. - ## Additionally, make TRUNK_VERSION define itself statically on first - ## expansion. This executes "svn info" only once for performance. - TRUNK_VERSION='$(strip $(eval TRUNK_VERSION :=$(shell svn info 2>/dev/null | grep Revision | egrep -wo "[[0-9]]+$$"))$(TRUNK_VERSION))' - AC_SUBST(TRUNK_VERSION) - export CPPFLAGS=$CPPFLAGS\ '-DTRUNK_VERSION=$(TRUNK_VERSION)' - fi - GB_CLEAR_MESSAGES ]) diff --git a/main/gbx/Makefile.am b/main/gbx/Makefile.am index 7a3ca78a1..23908d3b9 100644 --- a/main/gbx/Makefile.am +++ b/main/gbx/Makefile.am @@ -9,7 +9,8 @@ libgbx_a_CFLAGS = -DGAMBAS_PATH="\"$(bindir)\"" $(AM_CFLAGS_OPT) gbx3_LDADD = libgbx.a @MATH_LIB@ @INTL_LIB@ @CONV_LIB@ @GETTEXT_LIB@ @DL_LIB@ @GBX_THREAD_LIB@ @FFI_LIB@ gbx3_LDFLAGS = @LD_FLAGS@ @INTL_LDFLAGS@ @CONV_LDFLAGS@ @GETTEXT_LDFLAGS@ @FFI_LDFLAGS@ -gbx3_CFLAGS = -DGAMBAS_PATH="\"$(bindir)\"" $(AM_CFLAGS) +TRUNK_VERSION = $(shell svn info 2>/dev/null | grep Revision | egrep -wo "[0-9]+$$" || echo 0) +gbx3_CFLAGS = -DGAMBAS_PATH="\"$(bindir)\"" $(AM_CFLAGS) -DTRUNK_VERSION=$(TRUNK_VERSION) gb_la_LIBADD = @MATH_LIB@ @INTL_LIB@ @CONV_LIB@ @GETTEXT_LIB@ @DL_LIB@ @GBX_THREAD_LIB@ @FFI_LIB@ gb_la_LDFLAGS = -module @LD_FLAGS@ @INTL_LDFLAGS@ @CONV_LDFLAGS@ @GETTEXT_LDFLAGS@ @FFI_LDFLAGS@ diff --git a/main/gbx/gbx.c b/main/gbx/gbx.c index e19926965..f84f015b6 100644 --- a/main/gbx/gbx.c +++ b/main/gbx/gbx.c @@ -244,7 +244,7 @@ int main(int argc, char *argv[]) { #define xstr(m) #m #define stringify(m) xstr(m) -#ifdef TRUNK_VERSION +#if TRUNK_VERSION != 0 printf(VERSION " #" stringify(TRUNK_VERSION) "\n"); #else printf(VERSION "\n");