You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by rh...@apache.org on 2012/03/21 06:11:12 UTC

svn commit: r1303285 - in /qpid/proton/trunk/proton-c: CMakeLists.txt Makefile pn_config.h.in proton.i src/engine/engine.c src/message/message.c src/proton.c src/proton.i src/sasl/sasl.c src/types/array.c src/types/decode.c src/types/value.c

Author: rhs
Date: Wed Mar 21 05:11:12 2012
New Revision: 1303285

URL: http://svn.apache.org/viewvc?rev=1303285&view=rev
Log:
switched to cmake

Added:
    qpid/proton/trunk/proton-c/CMakeLists.txt
    qpid/proton/trunk/proton-c/pn_config.h.in
    qpid/proton/trunk/proton-c/proton.i
      - copied unchanged from r1303136, qpid/proton/trunk/proton-c/src/proton.i
Removed:
    qpid/proton/trunk/proton-c/Makefile
    qpid/proton/trunk/proton-c/src/proton.i
Modified:
    qpid/proton/trunk/proton-c/src/engine/engine.c
    qpid/proton/trunk/proton-c/src/message/message.c
    qpid/proton/trunk/proton-c/src/proton.c
    qpid/proton/trunk/proton-c/src/sasl/sasl.c
    qpid/proton/trunk/proton-c/src/types/array.c
    qpid/proton/trunk/proton-c/src/types/decode.c
    qpid/proton/trunk/proton-c/src/types/value.c

Added: qpid/proton/trunk/proton-c/CMakeLists.txt
URL: http://svn.apache.org/viewvc/qpid/proton/trunk/proton-c/CMakeLists.txt?rev=1303285&view=auto
==============================================================================
--- qpid/proton/trunk/proton-c/CMakeLists.txt (added)
+++ qpid/proton/trunk/proton-c/CMakeLists.txt Wed Mar 21 05:11:12 2012
@@ -0,0 +1,78 @@
+cmake_minimum_required (VERSION 2.6)
+
+project (Proton)
+
+set (PN_VERSION_MAJOR 0)
+set (PN_VERSION_MINOR 1)
+
+configure_file (
+  "${PROJECT_SOURCE_DIR}/pn_config.h.in"
+  "${PROJECT_BINARY_DIR}/pn_config.h"
+)
+
+include_directories ("${PROJECT_BINARY_DIR}")
+include_directories ("${PROJECT_SOURCE_DIR}/include")
+
+add_custom_command (
+  OUTPUT ${PROJECT_BINARY_DIR}/encodings.h
+  COMMAND PYTHONPATH=${PROJECT_SOURCE_DIR} python ${PROJECT_SOURCE_DIR}/src/codec/encodings.h.py > ${PROJECT_BINARY_DIR}/encodings.h
+  DEPENDS ${PROJECT_SOURCE_DIR}/src/codec/encodings.h.py
+)
+
+add_custom_command (
+  OUTPUT ${PROJECT_BINARY_DIR}/protocol.h
+  COMMAND PYTHONPATH=${PROJECT_SOURCE_DIR} python ${PROJECT_SOURCE_DIR}/src/protocol.h.py > ${PROJECT_BINARY_DIR}/protocol.h
+  DEPENDS ${PROJECT_SOURCE_DIR}/src/protocol.h.py
+)
+
+add_library (
+  qpidproton SHARED
+
+  src/util.c
+  src/driver.c
+
+  src/framing/framing.c
+
+  src/codec/codec.c
+
+  src/types/decode.c
+  src/types/value.c
+  src/types/binary.c
+  src/types/string.c
+  src/types/list.c
+  src/types/array.c
+  src/types/symbol.c
+  src/types/map.c
+
+  src/dispatcher/dispatcher.c
+  src/engine/engine.c
+  src/message/message.c
+  src/sasl/sasl.c
+
+  ${PROJECT_BINARY_DIR}/encodings.h
+  ${PROJECT_BINARY_DIR}/protocol.h
+)
+
+find_package (SWIG REQUIRED)
+include (${SWIG_USE_FILE})
+
+find_package (PythonLibs)
+
+include_directories (${PYTHON_INCLUDE_PATH})
+include_directories (${PROJECT_SOURCE_DIR})
+
+swig_add_module(proton python proton.i)
+swig_link_libraries(proton qpidproton ${PYTHON_LIBRARIES})
+
+add_executable (proton src/proton.c)
+target_link_libraries (proton qpidproton)
+
+set_target_properties (
+  qpidproton proton
+  PROPERTIES
+  COMPILE_FLAGS "-Wall -Werror -pedantic-errors -std=c99 -g -Iinclude -fPIC"
+)
+
+install (TARGETS proton qpidproton
+         RUNTIME DESTINATION bin
+         LIBRARY DESTINATION lib)

Added: qpid/proton/trunk/proton-c/pn_config.h.in
URL: http://svn.apache.org/viewvc/qpid/proton/trunk/proton-c/pn_config.h.in?rev=1303285&view=auto
==============================================================================
--- qpid/proton/trunk/proton-c/pn_config.h.in (added)
+++ qpid/proton/trunk/proton-c/pn_config.h.in Wed Mar 21 05:11:12 2012
@@ -0,0 +1,28 @@
+#ifndef _PROTON_CONFIG_H
+#define _PROTON_CONFIG_H 1
+
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+#define PN_VERSION_MAJOR @PN_VERSION_MAJOR@
+#define PN_VERSION_MINOR @PN_VERSION_MINOR@
+
+#endif /* pn_config.h */

Modified: qpid/proton/trunk/proton-c/src/engine/engine.c
URL: http://svn.apache.org/viewvc/qpid/proton/trunk/proton-c/src/engine/engine.c?rev=1303285&r1=1303284&r2=1303285&view=diff
==============================================================================
--- qpid/proton/trunk/proton-c/src/engine/engine.c (original)
+++ qpid/proton/trunk/proton-c/src/engine/engine.c Wed Mar 21 05:11:12 2012
@@ -24,7 +24,7 @@
 #include <string.h>
 #include <proton/framing.h>
 #include <proton/value.h>
-#include "../protocol.h"
+#include "protocol.h"
 #include <wchar.h>
 #include <inttypes.h>
 

Modified: qpid/proton/trunk/proton-c/src/message/message.c
URL: http://svn.apache.org/viewvc/qpid/proton/trunk/proton-c/src/message/message.c?rev=1303285&r1=1303284&r2=1303285&view=diff
==============================================================================
--- qpid/proton/trunk/proton-c/src/message/message.c (original)
+++ qpid/proton/trunk/proton-c/src/message/message.c Wed Mar 21 05:11:12 2012
@@ -21,7 +21,7 @@
 
 #include <proton/message.h>
 #include <proton/codec.h>
-#include "../protocol.h"
+#include "protocol.h"
 
 ssize_t pn_message_data(char *dst, size_t available, char *src, size_t size)
 {

Modified: qpid/proton/trunk/proton-c/src/proton.c
URL: http://svn.apache.org/viewvc/qpid/proton/trunk/proton-c/src/proton.c?rev=1303285&r1=1303284&r2=1303285&view=diff
==============================================================================
--- qpid/proton/trunk/proton-c/src/proton.c (original)
+++ qpid/proton/trunk/proton-c/src/proton.c Wed Mar 21 05:11:12 2012
@@ -29,6 +29,7 @@
 #include <proton/util.h>
 #include <unistd.h>
 #include "util.h"
+#include "pn_config.h"
 
 void print(pn_value_t value)
 {
@@ -368,7 +369,7 @@ int main(int argc, char **argv)
   char *mechanism = "ANONYMOUS";
 
   int opt;
-  while ((opt = getopt(argc, argv, "c:a:m:hX")) != -1)
+  while ((opt = getopt(argc, argv, "c:a:m:hVX")) != -1)
   {
     switch (opt) {
     case 'c':
@@ -381,6 +382,9 @@ int main(int argc, char **argv)
     case 'm':
       mechanism = optarg;
       break;
+    case 'V':
+      printf("proton version %i.%i\n", PN_VERSION_MAJOR, PN_VERSION_MINOR);
+      exit(EXIT_SUCCESS);
     case 'X':
       value(argc, argv);
       exit(EXIT_SUCCESS);

Modified: qpid/proton/trunk/proton-c/src/sasl/sasl.c
URL: http://svn.apache.org/viewvc/qpid/proton/trunk/proton-c/src/sasl/sasl.c?rev=1303285&r1=1303284&r2=1303285&view=diff
==============================================================================
--- qpid/proton/trunk/proton-c/src/sasl/sasl.c (original)
+++ qpid/proton/trunk/proton-c/src/sasl/sasl.c Wed Mar 21 05:11:12 2012
@@ -26,7 +26,7 @@
 #include <proton/value.h>
 #include <proton/engine.h> // XXX: just needed for PN_EOS
 #include "sasl-internal.h"
-#include "../protocol.h"
+#include "protocol.h"
 #include "../util.h"
 
 void pn_do_init(pn_dispatcher_t *disp);

Modified: qpid/proton/trunk/proton-c/src/types/array.c
URL: http://svn.apache.org/viewvc/qpid/proton/trunk/proton-c/src/types/array.c?rev=1303285&r1=1303284&r2=1303285&view=diff
==============================================================================
--- qpid/proton/trunk/proton-c/src/types/array.c (original)
+++ qpid/proton/trunk/proton-c/src/types/array.c Wed Mar 21 05:11:12 2012
@@ -22,7 +22,7 @@
 #include <proton/util.h>
 #include <arpa/inet.h>
 #include <stdlib.h>
-#include "../codec/encodings.h"
+#include "encodings.h"
 #include "value-internal.h"
 
 static char type_to_code(enum TYPE type)

Modified: qpid/proton/trunk/proton-c/src/types/decode.c
URL: http://svn.apache.org/viewvc/qpid/proton/trunk/proton-c/src/types/decode.c?rev=1303285&r1=1303284&r2=1303285&view=diff
==============================================================================
--- qpid/proton/trunk/proton-c/src/types/decode.c (original)
+++ qpid/proton/trunk/proton-c/src/types/decode.c Wed Mar 21 05:11:12 2012
@@ -24,7 +24,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <wchar.h>
-#include "../codec/encodings.h"
+#include "encodings.h"
 #include "value-internal.h"
 
 static enum TYPE amqp_code_to_type(uint8_t code)

Modified: qpid/proton/trunk/proton-c/src/types/value.c
URL: http://svn.apache.org/viewvc/qpid/proton/trunk/proton-c/src/types/value.c?rev=1303285&r1=1303284&r2=1303285&view=diff
==============================================================================
--- qpid/proton/trunk/proton-c/src/types/value.c (original)
+++ qpid/proton/trunk/proton-c/src/types/value.c Wed Mar 21 05:11:12 2012
@@ -29,7 +29,7 @@
 #include <stdlib.h>
 #include <iconv.h>
 #include <arpa/inet.h>
-#include "../codec/encodings.h"
+#include "encodings.h"
 #include "value-internal.h"
 
 int pn_compare_value(pn_value_t a, pn_value_t b)



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