summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans Ulrich Niedermann <hun@n-dimensional.de>2007-11-14 19:13:46 +0100
committerHans Ulrich Niedermann <hun@n-dimensional.de>2007-11-14 19:13:46 +0100
commitdcb174a351c63441f39669145f2032fec51b7b27 (patch)
treec23d7c234023485d5022dca0a4dce3b21eb5f744
parent22a4b67d5f3b99a5ee3d9df9022922b4fbe8eccc (diff)
downloadndim-git-utils-dcb174a351c63441f39669145f2032fec51b7b27.tar.gz
ndim-git-utils-dcb174a351c63441f39669145f2032fec51b7b27.tar.xz
ndim-git-utils-dcb174a351c63441f39669145f2032fec51b7b27.zip
Still messing with dist tarball detection
-rw-r--r--Makefile.am2
-rw-r--r--configure.ac2
-rw-r--r--git-buildmsg/Makefile-files9
-rw-r--r--git-buildmsg/git-buildmsg.in12
-rw-r--r--git-buildmsg/print-buildmsg.c3
5 files changed, 19 insertions, 9 deletions
diff --git a/Makefile.am b/Makefile.am
index e77ad76..7487af9 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -12,6 +12,8 @@ check_SCRIPTS =
TESTS =
AM_INSTALLCHECK_STD_OPTIONS_EXEMPT =
+AM_CPPFLAGS = -I${top_builddir}/include
+
ACLOCAL_AMFLAGS = -I m4 --install
include Makefile-files
diff --git a/configure.ac b/configure.ac
index e6a82e7..cfabc06 100644
--- a/configure.ac
+++ b/configure.ac
@@ -6,7 +6,7 @@ AC_INIT([ndims git utilities],
[hun@n-dimensional.de],
[ndim-git-utils])
AC_CONFIG_AUX_DIR([auto-aux])
-dnl AC_CONFIG_HEADER([include/config.h])
+AC_CONFIG_HEADER([include/config.h])
AC_CONFIG_SRCDIR([git-amb/git-amb.in])
AC_CONFIG_MACRO_DIR([m4])
AM_INIT_AUTOMAKE([-Wall -Werror foreign 1.10 dist-bzip2
diff --git a/git-buildmsg/Makefile-files b/git-buildmsg/Makefile-files
index e639d56..de5a1be 100644
--- a/git-buildmsg/Makefile-files
+++ b/git-buildmsg/Makefile-files
@@ -21,7 +21,7 @@ GIT_BUILDMSG_CMD = $(SHELL) "git-buildmsg/git-buildmsg" --error-if-no-git
GIT_BUILDMSG_H = git-buildmsg.h
CLEANFILES += $(GIT_BUILDMSG_H)
git-buildmsg.stamp: git-buildmsg/git-buildmsg
- if env GIT_DIR="$(top_srcdir)/.git" $(GIT_BUILDMSG_CMD) -s "$(top_srcdir)" -o "$(GIT_BUILDMSG_H)"; then \
+ @if env GIT_DIR="$(top_srcdir)/.git" $(GIT_BUILDMSG_CMD) -s "$(top_srcdir)" -o "$(GIT_BUILDMSG_H)"; then \
if test -s "$(srcdir)/$(GIT_BUILDMSG_H)"; then \
if diff "$(srcdir)/$(GIT_BUILDMSG_H)" "$(GIT_BUILDMSG_H)"; then \
echo "New $(GIT_BUILDMSG_H) does not differ from $(srcdir)/$(GIT_BUILDMSG_H)"; \
@@ -48,11 +48,10 @@ TESTS += print-buildmsg
bin_PROGRAMS += print-buildmsg
check_PROGRAMS += print-buildmsg
print_buildmsg_SOURCES = git-buildmsg/print-buildmsg.c
-print_buildmsg_SOURCES += $(GIT_BUILDMSG_H)
+nodist_print_buildmsg_SOURCES = $(GIT_BUILDMSG_H)
-dist-hook:
+dist-hook: git-buildmsg.stamp
if test -e "$(GIT_BUILDMSG_H)"; then \
$(SED) -e 's|^#undef GIT_IS_DIST.*|#define GIT_IS_DIST 1|' \
- "$(GIT_BUILDMSG_H)" > "$(GIT_BUILDMSG_H).new"; \
- mv -f "$(GIT_BUILDMSG_H).new" "$(GIT_BUILDMSG_H)"; \
+ "$(GIT_BUILDMSG_H)" > "$(distdir)/$(GIT_BUILDMSG_H)"; \
fi
diff --git a/git-buildmsg/git-buildmsg.in b/git-buildmsg/git-buildmsg.in
index 1f7d5ea..4ba0b70 100644
--- a/git-buildmsg/git-buildmsg.in
+++ b/git-buildmsg/git-buildmsg.in
@@ -37,6 +37,8 @@
#
# Ideas:
# * Output for languages other than C (Erlang, Python, Perl, sh, ...)
+# * Recognize difference between being built from "non-git" sources and
+# a dist tarball generated from git rev XYZ.
# The caller may have found these programs for us
SED="${SED-sed}"
@@ -223,8 +225,10 @@ cat<<EOF
#ifdef GIT_IS_DIST
# define GIT_DIST_MSG "dist of "
+# define GIT_DIST_MSG_2 " (possibly modified)"
#else
# define GIT_DIST_MSG ""
+# define GIT_DIST_MSG_2 ""
#endif
#ifdef GIT_IS_GIT_WORKTREE
@@ -238,10 +242,10 @@ cat<<EOF
# define GIT_MESSAGE \\
GIT_DIST_MSG \\
"git branch " GIT_BRANCH ", " \\
- "commit " GIT_COMMIT_ID GIT_CHANGE_MSG
+ "commit " GIT_COMMIT_ID GIT_CHANGE_MSG GIT_DIST_MSG_2
#else
-# define GIT_MESSAGE GIT_DIST_MSG "non-git sources"
+# define GIT_MESSAGE GIT_DIST_MSG "non-git sources" GIT_DIST_MSG_2
#endif /* GIT_IS_GIT_WORKTREE */
#endif /* ${ifndef_symbol} */
@@ -256,6 +260,10 @@ then
#include <stdio.h>
#include <string.h>
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
int main(int argc, char *argv[])
{
const char *const idx = strrchr(argv[0], '/');
diff --git a/git-buildmsg/print-buildmsg.c b/git-buildmsg/print-buildmsg.c
index c5f4e84..9291b3d 100644
--- a/git-buildmsg/print-buildmsg.c
+++ b/git-buildmsg/print-buildmsg.c
@@ -1,11 +1,12 @@
#include <stdio.h>
#include <string.h>
+#include "config.h"
#include "git-buildmsg.h"
int main(int argc, char *argv[])
{
const char *const lastslash = strrchr(argv[0], '/');
const char *const self = (lastslash)?(lastslash+1):(argv[0]);
- printf("%s: %s\n", self, GIT_MESSAGE);
+ printf("%s: v%s, %s\n", self, PACKAGE_VERSION, GIT_MESSAGE);
return 0;
}