From 32da405cbd0ad3b9964c72d07d8fe921f815fb32 Mon Sep 17 00:00:00 2001 From: Benjamin Franzke Date: Tue, 6 Sep 2011 15:18:26 +0200 Subject: Use AC_PATH_PROG for protoc-c Also move PROTOC_C substution directly into src/protoc-c.sh.in instead of src/Makefile.am --- src/.gitignore | 1 + src/Makefile.am | 5 ++--- src/protoc-c.sh | 13 ------------- src/protoc-c.sh.in | 14 ++++++++++++++ 4 files changed, 17 insertions(+), 16 deletions(-) delete mode 100755 src/protoc-c.sh create mode 100644 src/protoc-c.sh.in (limited to 'src') diff --git a/src/.gitignore b/src/.gitignore index 40e0689..a4818d0 100644 --- a/src/.gitignore +++ b/src/.gitignore @@ -1,4 +1,5 @@ messages.h mumble.pb-c.c mumble.pb-c.h +protoc-c.sh cmumble diff --git a/src/Makefile.am b/src/Makefile.am index fe69d24..fb88fc6 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -15,12 +15,11 @@ AM_CFLAGS = $(GCC_FLAGS) BUILT_SOURCES = $(nodist_cmumble_SOURCES) $(nodist_noinst_HEADERS) CLEANFILES = $(BUILT_SOURCES) -EXTRA_DIST = mumble.proto messages.txt gen_messages.sed protoc-c.sh +EXTRA_DIST = mumble.proto messages.txt gen_messages.sed messages.h: $(srcdir)/messages.txt $(srcdir)/gen_messages.sed $(AM_V_GEN) LC_ALL=C $(SED) -f $(srcdir)/gen_messages.sed $< > $@ mumble.pb-c.c mumble.pb-c.h: $(srcdir)/mumble.proto - $(AM_V_GEN) PROTOC_C=$(PROTOBUF_EXECUTABLE) \ - $(srcdir)/protoc-c.sh $< $@ + $(AM_V_GEN) $(builddir)/protoc-c.sh $< $@ diff --git a/src/protoc-c.sh b/src/protoc-c.sh deleted file mode 100755 index 4147799..0000000 --- a/src/protoc-c.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/sh - -PROTOC_C=${PROTOC_C:-protoc-c} - -build_dir=".protoc-c_build_$(basename $2)/" - -mkdir -p "${build_dir}" -cp $1 "${build_dir}" -cd "${build_dir}" -eval $PROTOC_C --c_out=. $(basename $1) -cd .. -mv "${build_dir}/$(basename $2)" $2 -rm -rf "${build_dir}" diff --git a/src/protoc-c.sh.in b/src/protoc-c.sh.in new file mode 100644 index 0000000..788d743 --- /dev/null +++ b/src/protoc-c.sh.in @@ -0,0 +1,14 @@ +#!/bin/sh +# @configure_input@ + +PROTOC_C=@PROTOC_C@ + +build_dir=".protoc-c_build_$(basename $2)/" + +mkdir -p "${build_dir}" +cp $1 "${build_dir}" +cd "${build_dir}" +eval $PROTOC_C --c_out=. $(basename $1) +cd .. +mv "${build_dir}/$(basename $2)" $2 +rm -rf "${build_dir}" -- cgit