open-plc-utils: new package
[buildroot-gz.git] / package / ola / 0001-Fix-finding-ola_protoc_plugin-when-cross-compiling.patch
blob79c02bd7af9d8dcd96c3bed49d9f3de53d93297b
1 From 0b0797af43c78f199e3f2782873dad3c37d323dd Mon Sep 17 00:00:00 2001
2 From: Simon Marchi <simon.marchi@polymtl.ca>
3 Date: Wed, 28 Jan 2015 22:23:32 -0500
4 Subject: [PATCH] Fix finding ola_protoc_plugin when cross-compiling
6 It seems like the recent changes concerning ola_protoc did not take into
7 account cross-compiling.
8 ---
9 common/rpc/RpcService.h | 2 +-
10 config/ola.m4 | 18 +++++++++---------
11 protoc/Makefile.mk | 10 +++++-----
12 3 files changed, 15 insertions(+), 15 deletions(-)
14 diff --git a/common/rpc/RpcService.h b/common/rpc/RpcService.h
15 index f5d428b..3e20dbc 100644
16 --- a/common/rpc/RpcService.h
17 +++ b/common/rpc/RpcService.h
18 @@ -17,7 +17,7 @@
19 * Interface for the RpcService.
20 * Copyright (C) 2013 Simon Newton
22 - * All Services generated by ola_protoc inherit from this one.
23 + * All Services generated by the ola protoc plugin inherit from this one.
26 #ifndef COMMON_RPC_RPCSERVICE_H_
27 diff --git a/config/ola.m4 b/config/ola.m4
28 index 845c4af..ec77585 100644
29 --- a/config/ola.m4
30 +++ b/config/ola.m4
31 @@ -71,17 +71,17 @@ elif test -n "$1" ; then
35 -AC_ARG_WITH([ola-protoc],
36 - [AS_HELP_STRING([--with-ola-protoc=COMMAND],
37 - [use the given ola_protoc command instead of building one (useful for cross-compiling)])],
38 - [],[with_ola_protoc=no])
39 +AC_ARG_WITH([ola-protoc-plugin],
40 + [AS_HELP_STRING([--with-ola-protoc-plugin=COMMAND],
41 + [use the given ola_protoc_plugin instead of building one (useful for cross-compiling)])],
42 + [],[with_ola_protoc_plugin=no])
44 -OLA_PROTOC="\$(PROTOC) --plugin=protoc-gen-cppservice=\$(top_builddir)/protoc/ola_protoc_plugin${EXEEXT}";
46 -if test "$with_ola_protoc" != "no"; then
47 - OLA_PROTOC=$with_ola_protoc;
48 - echo "set ola_protoc to $with_ola_protoc"
49 +if test "$with_ola_protoc_plugin" != "no"; then
50 + OLA_PROTOC="\$(PROTOC) --plugin=protoc-gen-cppservice=${with_ola_protoc_plugin}${EXEEXT}";
51 + echo "set ola_protoc to $with_ola_protoc_plugin"
52 else
53 + OLA_PROTOC="\$(PROTOC) --plugin=protoc-gen-cppservice=\$(top_builddir)/protoc/ola_protoc_plugin${EXEEXT}";
54 AC_CHECK_HEADER(
55 [google/protobuf/compiler/command_line_interface.h],
56 [],
57 @@ -96,7 +96,7 @@ else
58 LIBS=$SAVED_LIBS
60 AC_SUBST([OLA_PROTOC])
61 -AM_CONDITIONAL(BUILD_OLA_PROTOC, test "${with_ola_protoc}" == "no")
62 +AM_CONDITIONAL(BUILD_OLA_PROTOC_PLUGIN, test "${with_ola_protoc_plugin}" == "no")
66 diff --git a/protoc/Makefile.mk b/protoc/Makefile.mk
67 index e5d0167..47adc47 100644
68 --- a/protoc/Makefile.mk
69 +++ b/protoc/Makefile.mk
70 @@ -1,6 +1,6 @@
71 # Programs
72 #########################
73 -if BUILD_OLA_PROTOC
74 +if BUILD_OLA_PROTOC_PLUGIN
75 noinst_PROGRAMS += protoc/ola_protoc_plugin
77 protoc_ola_protoc_plugin_SOURCES = \
78 @@ -19,9 +19,9 @@ protoc_ola_protoc_plugin_LDADD = $(libprotobuf_LIBS) -lprotoc
80 else
82 -# If we're using a different ola_protoc, we need to provide a rule to create
83 -# this file since the generated service configs depend on it.
84 -protoc/ola_protoc$(EXEEXT):
85 - touch protoc/ola_protoc$(EXEEXT)
86 +# If we're using a different ola_protoc_plugin, we need to provide a rule to
87 +# create this file since the generated service configs depend on it.
88 +protoc/ola_protoc_plugin$(EXEEXT):
89 + touch protoc/ola_protoc_plugin$(EXEEXT)
91 endif
92 --
93 2.2.2