You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by as...@apache.org on 2016/02/15 21:12:38 UTC

[5/5] qpid-proton git commit: PROTON-250: Adjust proton-dump to keep on compiling: - It uses proton-c internals so some files from proton are compiled explicitly with proton-dump. Perhaps making a static proton would be a better solution. - Do the tr

PROTON-250: Adjust proton-dump to keep on compiling:
- It uses proton-c internals so some files from proton are compiled
  explicitly with proton-dump. Perhaps making a static proton would
  be a better solution.
- Do the trivial arglist scanning manually instead of using getopt
- Fix a change in include path missed in the test tools.


Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/ca433506
Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/ca433506
Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/ca433506

Branch: refs/heads/master
Commit: ca433506c346f088077bb786d5544e419b210cf7
Parents: 874d85b
Author: Andrew Stitcher <as...@apache.org>
Authored: Mon Feb 15 14:33:14 2016 -0500
Committer: Andrew Stitcher <as...@apache.org>
Committed: Mon Feb 15 15:05:06 2016 -0500

----------------------------------------------------------------------
 proton-c/CMakeLists.txt           | 14 +++++++++-----
 proton-c/src/proton-dump.c        | 16 ++++------------
 tests/tools/apps/c/CMakeLists.txt |  2 +-
 3 files changed, 14 insertions(+), 18 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/ca433506/proton-c/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/proton-c/CMakeLists.txt b/proton-c/CMakeLists.txt
index acc876e..862a520 100644
--- a/proton-c/CMakeLists.txt
+++ b/proton-c/CMakeLists.txt
@@ -92,10 +92,6 @@ include_directories ("${CMAKE_CURRENT_BINARY_DIR}/include")
 include_directories ("${CMAKE_CURRENT_SOURCE_DIR}/src")
 include_directories ("${CMAKE_CURRENT_SOURCE_DIR}/include")
 
-# TODO: This is only needed because the proton executable can use getopt on windows
-# if/when this executable gets sorted out remove
-include_directories ("${CMAKE_SOURCE_DIR}/examples/c/include")
-
 set (env_py ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/env.py)
 
 add_custom_command (
@@ -428,13 +424,21 @@ if (MSVC)
   include(WindowsC99CheckDef)
 endif(MSVC)
 
-add_executable (proton-dump src/proton-dump.c)
+add_executable (
+  proton-dump
+  src/proton-dump.c
+  # Internal dependencies
+  src/buffer.c
+  src/util.c
+  src/framing/framing.c
+  )
 target_link_libraries (proton-dump qpid-proton)
 
 set_target_properties (
   proton-dump
   PROPERTIES
   COMPILE_FLAGS "${COMPILE_WARNING_FLAGS} ${COMPILE_PLATFORM_FLAGS}"
+  LINK_FLAGS "${LTO}"
   )
 
 macro(pn_c_files)

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/ca433506/proton-c/src/proton-dump.c
----------------------------------------------------------------------
diff --git a/proton-c/src/proton-dump.c b/proton-c/src/proton-dump.c
index 1ce577d..0da65eb 100644
--- a/proton-c/src/proton-dump.c
+++ b/proton-c/src/proton-dump.c
@@ -19,8 +19,6 @@
  *
  */
 
-#include "pncompat/misc_funcs.inc"
-
 #include <stdio.h>
 #include <proton/codec.h>
 #include <proton/error.h>
@@ -128,16 +126,10 @@ int main(int argc, char **argv)
     return 0;
   }
 
-  int c;
-
-  while ( (c = getopt(argc, argv, "h")) != -1 ) {
-    switch(c) {
-    case 'h':
-      usage(argv[0]);
-      return 0;
-      break;
-
-    case '?':
+  // There are no actual options for proton-dump so just scan for anything
+  // starting with '-' and print the usage message if we find something.
+  for (int c = 1; c < argc; c++) {
+    if (*argv[c]=='-') {
       usage(argv[0]);
       return 1;
     }

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/ca433506/tests/tools/apps/c/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/tests/tools/apps/c/CMakeLists.txt b/tests/tools/apps/c/CMakeLists.txt
index 9507c1f..2c801c4 100644
--- a/tests/tools/apps/c/CMakeLists.txt
+++ b/tests/tools/apps/c/CMakeLists.txt
@@ -19,7 +19,7 @@
 
 include(CheckIncludeFiles)
 
-include_directories(${CMAKE_SOURCE_DIR}/examples/include)
+include_directories(${CMAKE_SOURCE_DIR}/examples/c/include)
 
 CHECK_INCLUDE_FILES("inttypes.h" INTTYPES_AVAILABLE)
 if (INTTYPES_AVAILABLE)


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org