summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Schleef <ds@schleef.org>2010-05-30 14:35:28 -0700
committerDavid Schleef <ds@schleef.org>2010-05-30 14:35:28 -0700
commitcdff0fb43946912b92549d4bd85c94222f4beecd (patch)
tree1591e72791d7bcc85ba50f6e6f855f8a0524d225
parent09d712f48d7fe1c3a34ce7d9eb6ad39dea90a358 (diff)
orc: Fix distcheck problems in orc.mk
Add gst-indent to common, since orc.mk uses it to clean up source files.
-rw-r--r--Makefile.am4
-rwxr-xr-xgst-indent49
-rw-r--r--orc.mk36
3 files changed, 74 insertions, 15 deletions
diff --git a/Makefile.am b/Makefile.am
index bf8303e..6a35a0d 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -16,4 +16,6 @@ EXTRA_DIST = \
coverage/coverage-report.pl \
coverage/coverage-report.xsl \
coverage/coverage-report-entry.pl \
- download-translations
+ download-translations \
+ gst-indent \
+ orc.mk
diff --git a/gst-indent b/gst-indent
new file mode 100755
index 0000000..732b2ba
--- /dev/null
+++ b/gst-indent
@@ -0,0 +1,49 @@
+#!/bin/sh
+#
+# Check that the code follows a consistant code style
+#
+
+# Check for existence of indent, and error out if not present.
+# On some *bsd systems the binary seems to be called gnunindent,
+# so check for that first.
+
+version=`gnuindent --version 2>/dev/null`
+if test "x$version" = "x"; then
+ version=`indent --version 2>/dev/null`
+ if test "x$version" = "x"; then
+ echo "GStreamer git pre-commit hook:"
+ echo "Did not find GNU indent, please install it before continuing."
+ exit 1
+ fi
+ INDENT=indent
+else
+ INDENT=gnuindent
+fi
+
+case `$INDENT --version` in
+ GNU*)
+ ;;
+ default)
+ echo "GStreamer git pre-commit hook:"
+ echo "Did not find GNU indent, please install it before continuing."
+ echo "(Found $INDENT, but it doesn't seem to be GNU indent)"
+ exit 1
+ ;;
+esac
+
+INDENT_PARAMETERS="--braces-on-if-line \
+ --case-brace-indentation0 \
+ --case-indentation2 \
+ --braces-after-struct-decl-line \
+ --line-length80 \
+ --no-tabs \
+ --cuddle-else \
+ --dont-line-up-parentheses \
+ --continuation-indentation4 \
+ --honour-newlines \
+ --tab-size8 \
+ --indent-level2 \
+ --leave-preprocessor-space"
+
+$INDENT ${INDENT_PARAMETERS} $@
+
diff --git a/orc.mk b/orc.mk
index 11176e8..8eebb37 100644
--- a/orc.mk
+++ b/orc.mk
@@ -16,28 +16,31 @@
#
#
-ORC_SOURCES = $(ORC_BASE)orc.c $(ORC_BASE)orc.h
+ORC_SOURCES = tmp-orc.c $(ORC_BASE)orc.h
-#EXTRA_DIST = $(ORC_BASE).orc $(ORC_BASE)orc.c $(ORC_BASE)orc.h
+EXTRA_DIST = $(ORC_BASE).orc
+
+# This is needed if dist-hook-orc is not used
+#EXTRA_DIST = $(ORC_BASE).orc $(ORC_BASE)orc-dist.c $(ORC_BASE)orc-dist.h
BUILT_SOURCES = $(ORC_SOURCES)
-orc-update: $(ORC_BASE)orc.c $(ORC_BASE)orc.h
- cp $(ORC_BASE)orc.c $(srcdir)/$(ORC_BASE)orc-dist.c
- $(top_srcdir)/common/gst-indent $(srcdir)/$(ORC_BASE)orc-dist.c
+orc-update: tmp-orc.c $(ORC_BASE)orc.h
+ $(top_srcdir)/common/gst-indent tmp-orc.c
+ cp tmp-orc.c $(srcdir)/$(ORC_BASE)orc-dist.c
cp $(ORC_BASE)orc.h $(srcdir)/$(ORC_BASE)orc-dist.h
if HAVE_ORC
-$(ORC_BASE)orc.c: $(srcdir)/$(ORC_BASE).orc
- $(ORCC) --implementation --include glib.h -o $(ORC_BASE)orc.c $(srcdir)/$(ORC_BASE).orc
+tmp-orc.c: $(srcdir)/$(ORC_BASE).orc
+ $(ORCC) --implementation --include glib.h -o tmp-orc.c $(srcdir)/$(ORC_BASE).orc
$(ORC_BASE)orc.h: $(srcdir)/$(ORC_BASE).orc
$(ORCC) --header --include glib.h -o $(ORC_BASE)orc.h $(srcdir)/$(ORC_BASE).orc
else
-$(ORC_BASE)orc.c: $(srcdir)/$(ORC_BASE).orc
- cp $(srcdir)/$(ORC_BASE)orc-dist.c $(ORC_BASE)orc.c
+tmp-orc.c: $(srcdir)/$(ORC_BASE).orc
+ cp $(srcdir)/$(ORC_BASE)orc-dist.c tmp-orc.c
$(ORC_BASE)orc.h: $(srcdir)/$(ORC_BASE).orc
cp $(srcdir)/$(ORC_BASE)orc-dist.h $(ORC_BASE)orc.h
@@ -47,12 +50,17 @@ endif
clean-local: clean-orc
.PHONY: clean-orc
clean-orc:
- rm -f $(ORC_BASE)orc.c $(ORC_BASE)orc.h
+ rm -f tmp-orc.c $(ORC_BASE)orc.h
dist-hook: dist-hook-orc
.PHONY: dist-hook-orc
-dist-hook-orc: $(ORC_BASE)orc.c $(ORC_BASE)orc.h
- cp $(ORC_BASE)orc.c $(srcdir)/$(ORC_BASE)orc-dist.c
- $(top_srcdir)/common/gst-indent $(srcdir)/$(ORC_BASE)orc-dist.c
- cp $(ORC_BASE)orc.h $(srcdir)/$(ORC_BASE)orc-dist.h
+dist-hook-orc: tmp-orc.c $(ORC_BASE)orc.h
+ $(top_srcdir)/common/gst-indent tmp-orc.c
+ rm -f tmp-orc.c~
+ cmp -s tmp-orc.c $(srcdir)/$(ORC_BASE)orc-dist.c || \
+ cp tmp-orc.c $(srcdir)/$(ORC_BASE)orc-dist.c
+ cmp -s $(ORC_BASE)orc.h $(srcdir)/$(ORC_BASE)orc-dist.h || \
+ cp $(ORC_BASE)orc.h $(srcdir)/$(ORC_BASE)orc-dist.h
+ cp -p $(srcdir)/$(ORC_BASE)orc-dist.c $(distdir)/
+ cp -p $(srcdir)/$(ORC_BASE)orc-dist.h $(distdir)/