summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Franzke <benjaminfranzke@googlemail.com>2011-09-06 15:18:26 +0200
committerBenjamin Franzke <benjaminfranzke@googlemail.com>2011-09-07 15:35:56 +0200
commit32da405cbd0ad3b9964c72d07d8fe921f815fb32 (patch)
tree1c29a12bdb766e5413263ae84c414abc988e562f
parent03da3083dc111e005da4d57c499966983d3fa7c8 (diff)
downloadcmumble-32da405cbd0ad3b9964c72d07d8fe921f815fb32.tar.gz
cmumble-32da405cbd0ad3b9964c72d07d8fe921f815fb32.tar.bz2
cmumble-32da405cbd0ad3b9964c72d07d8fe921f815fb32.zip
Use AC_PATH_PROG for protoc-c
Also move PROTOC_C substution directly into src/protoc-c.sh.in instead of src/Makefile.am
-rw-r--r--configure.ac12
-rw-r--r--src/.gitignore1
-rw-r--r--src/Makefile.am5
-rw-r--r--[-rwxr-xr-x]src/protoc-c.sh.in (renamed from src/protoc-c.sh)3
4 files changed, 9 insertions, 12 deletions
diff --git a/configure.ac b/configure.ac
index 6aa8568..34d399e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -13,9 +13,12 @@ AM_INIT_AUTOMAKE([foreign dist-bzip2])
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
+AC_ARG_VAR([PROTOC_C], [path to protoc-c utility])
+
# Check for programs
AC_PROG_CC
AC_PROG_SED
+AC_PATH_PROG([PROTOC_C], [protoc-c], [false])
PKG_PROG_PKG_CONFIG()
PKG_CHECK_MODULES(PROTOBUF, [libprotobuf-c],[], [
@@ -36,14 +39,6 @@ do
AC_MSG_ERROR([gstreamer element $element not found]))
done
-PROTOBUF_EXECUTABLE=`pkg-config --variable=exec_prefix libprotobuf-c`
-if test "x$PROTOBUF_EXECUTABLE" == "x"; then
- PROTOBUF_EXECUTABLE=protoc-c
-else
- PROTOBUF_EXECUTABLE="${PROTOBUF_EXECUTABLE}/bin/protoc-c"
-fi
-AC_SUBST([PROTOBUF_EXECUTABLE])
-
if test "x$GCC" = "xyes"; then
GCC_CFLAGS="-Wall -g -Wstrict-prototypes -Wmissing-prototypes -fvisibility=hidden"
fi
@@ -51,4 +46,5 @@ AC_SUBST([GCC_CFLAGS])
AC_CONFIG_FILES([Makefile
src/Makefile])
+AC_CONFIG_FILES([src/protoc-c.sh], [chmod +x src/protoc-c.sh])
AC_OUTPUT
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.in
index 4147799..788d743 100755..100644
--- a/src/protoc-c.sh
+++ b/src/protoc-c.sh.in
@@ -1,6 +1,7 @@
#!/bin/sh
+# @configure_input@
-PROTOC_C=${PROTOC_C:-protoc-c}
+PROTOC_C=@PROTOC_C@
build_dir=".protoc-c_build_$(basename $2)/"