0001-Fix-finding-ola_protoc_plugin-when-cross-compiling.patch 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  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
  5. It seems like the recent changes concerning ola_protoc did not take into
  6. account cross-compiling.
  7. ---
  8. common/rpc/RpcService.h | 2 +-
  9. config/ola.m4 | 18 +++++++++---------
  10. protoc/Makefile.mk | 10 +++++-----
  11. 3 files changed, 15 insertions(+), 15 deletions(-)
  12. diff --git a/common/rpc/RpcService.h b/common/rpc/RpcService.h
  13. index f5d428b..3e20dbc 100644
  14. --- a/common/rpc/RpcService.h
  15. +++ b/common/rpc/RpcService.h
  16. @@ -17,7 +17,7 @@
  17. * Interface for the RpcService.
  18. * Copyright (C) 2013 Simon Newton
  19. *
  20. - * All Services generated by ola_protoc inherit from this one.
  21. + * All Services generated by the ola protoc plugin inherit from this one.
  22. */
  23. #ifndef COMMON_RPC_RPCSERVICE_H_
  24. diff --git a/config/ola.m4 b/config/ola.m4
  25. index 845c4af..ec77585 100644
  26. --- a/config/ola.m4
  27. +++ b/config/ola.m4
  28. @@ -71,17 +71,17 @@ elif test -n "$1" ; then
  29. fi
  30. fi
  31. -AC_ARG_WITH([ola-protoc],
  32. - [AS_HELP_STRING([--with-ola-protoc=COMMAND],
  33. - [use the given ola_protoc command instead of building one (useful for cross-compiling)])],
  34. - [],[with_ola_protoc=no])
  35. +AC_ARG_WITH([ola-protoc-plugin],
  36. + [AS_HELP_STRING([--with-ola-protoc-plugin=COMMAND],
  37. + [use the given ola_protoc_plugin instead of building one (useful for cross-compiling)])],
  38. + [],[with_ola_protoc_plugin=no])
  39. -OLA_PROTOC="\$(PROTOC) --plugin=protoc-gen-cppservice=\$(top_builddir)/protoc/ola_protoc_plugin${EXEEXT}";
  40. -if test "$with_ola_protoc" != "no"; then
  41. - OLA_PROTOC=$with_ola_protoc;
  42. - echo "set ola_protoc to $with_ola_protoc"
  43. +if test "$with_ola_protoc_plugin" != "no"; then
  44. + OLA_PROTOC="\$(PROTOC) --plugin=protoc-gen-cppservice=${with_ola_protoc_plugin}${EXEEXT}";
  45. + echo "set ola_protoc to $with_ola_protoc_plugin"
  46. else
  47. + OLA_PROTOC="\$(PROTOC) --plugin=protoc-gen-cppservice=\$(top_builddir)/protoc/ola_protoc_plugin${EXEEXT}";
  48. AC_CHECK_HEADER(
  49. [google/protobuf/compiler/command_line_interface.h],
  50. [],
  51. @@ -96,7 +96,7 @@ else
  52. LIBS=$SAVED_LIBS
  53. fi
  54. AC_SUBST([OLA_PROTOC])
  55. -AM_CONDITIONAL(BUILD_OLA_PROTOC, test "${with_ola_protoc}" == "no")
  56. +AM_CONDITIONAL(BUILD_OLA_PROTOC_PLUGIN, test "${with_ola_protoc_plugin}" == "no")
  57. ])
  58. diff --git a/protoc/Makefile.mk b/protoc/Makefile.mk
  59. index e5d0167..47adc47 100644
  60. --- a/protoc/Makefile.mk
  61. +++ b/protoc/Makefile.mk
  62. @@ -1,6 +1,6 @@
  63. # Programs
  64. #########################
  65. -if BUILD_OLA_PROTOC
  66. +if BUILD_OLA_PROTOC_PLUGIN
  67. noinst_PROGRAMS += protoc/ola_protoc_plugin
  68. protoc_ola_protoc_plugin_SOURCES = \
  69. @@ -19,9 +19,9 @@ protoc_ola_protoc_plugin_LDADD = $(libprotobuf_LIBS) -lprotoc
  70. else
  71. -# If we're using a different ola_protoc, we need to provide a rule to create
  72. -# this file since the generated service configs depend on it.
  73. -protoc/ola_protoc$(EXEEXT):
  74. - touch protoc/ola_protoc$(EXEEXT)
  75. +# If we're using a different ola_protoc_plugin, we need to provide a rule to
  76. +# create this file since the generated service configs depend on it.
  77. +protoc/ola_protoc_plugin$(EXEEXT):
  78. + touch protoc/ola_protoc_plugin$(EXEEXT)
  79. endif
  80. --
  81. 2.2.2