summaryrefslogtreecommitdiff
path: root/cpp/bindings/qmf
diff options
context:
space:
mode:
authorKim van der Riet <kpvdr@apache.org>2013-02-28 16:14:30 +0000
committerKim van der Riet <kpvdr@apache.org>2013-02-28 16:14:30 +0000
commit9c73ef7a5ac10acd6a50d5d52bd721fc2faa5919 (patch)
tree2a890e1df09e5b896a9b4168a7b22648f559a1f2 /cpp/bindings/qmf
parent172d9b2a16cfb817bbe632d050acba7e31401cd2 (diff)
downloadqpid-python-asyncstore.tar.gz
Update from trunk r1375509 through r1450773asyncstore
git-svn-id: https://svn.apache.org/repos/asf/qpid/branches/asyncstore@1451244 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/bindings/qmf')
-rw-r--r--cpp/bindings/qmf/CMakeLists.txt37
-rw-r--r--cpp/bindings/qmf/Makefile.am1
-rw-r--r--cpp/bindings/qmf/python/CMakeLists.txt29
-rw-r--r--cpp/bindings/qmf/python/Makefile.am2
-rw-r--r--cpp/bindings/qmf/python/python.i2
-rw-r--r--cpp/bindings/qmf/qmfengine.i59
-rw-r--r--cpp/bindings/qmf/ruby/CMakeLists.txt6
-rw-r--r--cpp/bindings/qmf/ruby/Makefile.am2
-rw-r--r--cpp/bindings/qmf/ruby/qmf.rb14
-rw-r--r--cpp/bindings/qmf/ruby/ruby.i2
10 files changed, 23 insertions, 131 deletions
diff --git a/cpp/bindings/qmf/CMakeLists.txt b/cpp/bindings/qmf/CMakeLists.txt
deleted file mode 100644
index 5e40539e80..0000000000
--- a/cpp/bindings/qmf/CMakeLists.txt
+++ /dev/null
@@ -1,37 +0,0 @@
-#
-# 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.
-#
-
-
-include(FindSWIG)
-include(UseSWIG)
-include(FindRuby)
-include(FindPythonLibs)
-include(FindPerlLibs)
-
-if (SWIG_FOUND)
- set(CMAKE_SWIG_FLAGS "-w362,401")
-
- if (PYTHONLIBS_FOUND)
- add_subdirectory(python)
- endif (PYTHONLIBS_FOUND)
-
- if (RUBY_FOUND)
- add_subdirectory(ruby)
- endif (RUBY_FOUND)
-endif (SWIG_FOUND)
diff --git a/cpp/bindings/qmf/Makefile.am b/cpp/bindings/qmf/Makefile.am
index dd77ab080c..ee4ff1d3c1 100644
--- a/cpp/bindings/qmf/Makefile.am
+++ b/cpp/bindings/qmf/Makefile.am
@@ -19,7 +19,6 @@
if HAVE_SWIG
-EXTRA_DIST = CMakeLists.txt qmfengine.i
SUBDIRS = tests
if HAVE_RUBY_DEVEL
diff --git a/cpp/bindings/qmf/python/CMakeLists.txt b/cpp/bindings/qmf/python/CMakeLists.txt
index 9bc6b2e878..1768df7f85 100644
--- a/cpp/bindings/qmf/python/CMakeLists.txt
+++ b/cpp/bindings/qmf/python/CMakeLists.txt
@@ -21,7 +21,7 @@
## Use Swig to generate a literal binding to the C++ API
##------------------------------------------------------
set_source_files_properties(${CMAKE_CURRENT_SOURCE_DIR}/python.i PROPERTIES CPLUSPLUS ON)
-set_source_files_properties(${CMAKE_CURRENT_SOURCE_DIR}/python.i PROPERTIES SWIG_FLAGS "-I${qpid-cpp_SOURCE_DIR}/include")
+set_source_files_properties(${CMAKE_CURRENT_SOURCE_DIR}/python.i PROPERTIES SWIG_FLAGS "-I${qpid-cpp_SOURCE_DIR}/include;-I${qpid-cpp_SOURCE_DIR}/bindings")
swig_add_module(qmfengine_python python ${CMAKE_CURRENT_SOURCE_DIR}/python.i)
swig_link_libraries(qmfengine_python qmf qmfconsole ${PYTHON_LIBRARIES})
@@ -31,28 +31,23 @@ set_source_files_properties(${swig_generated_file_fullname} PROPERTIES COMPILE_F
##------------------------------------
## Install the complete Python binding
##------------------------------------
-execute_process(COMMAND ${PYTHON_EXECUTABLE} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()" OUTPUT_VARIABLE PYTHON_SITE_PACKAGES OUTPUT_STRIP_TRAILING_WHITESPACE)
-install(CODE "execute_process(COMMAND ${PYTHON_EXECUTABLE} -m py_compile qmfengine.py
- WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})")
-install(CODE "execute_process(COMMAND ${PYTHON_EXECUTABLE} -O -m py_compile qmfengine.py
- WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})")
-file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/qmf.py DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
-install(CODE "execute_process(COMMAND ${PYTHON_EXECUTABLE} -m py_compile qmf.py
- WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})")
-install(CODE "execute_process(COMMAND ${PYTHON_EXECUTABLE} -O -m py_compile qmf.py
- WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})")
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/qmfengine.py
- ${CMAKE_CURRENT_BINARY_DIR}/qmfengine.pyc
- ${CMAKE_CURRENT_BINARY_DIR}/qmfengine.pyo
${CMAKE_CURRENT_SOURCE_DIR}/qmf.py
- ${CMAKE_CURRENT_BINARY_DIR}/qmf.pyc
- ${CMAKE_CURRENT_BINARY_DIR}/qmf.pyo
- DESTINATION ${PYTHON_SITE_PACKAGES}
+ DESTINATION ${PYTHON_SITEARCH_PACKAGES}
COMPONENT ${QPID_COMPONENT_CLIENT}
)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/_qmfengine_python.so
RENAME _qmfengine.so
- DESTINATION ${PYTHON_SITE_PACKAGES}
+ DESTINATION ${PYTHON_SITEARCH_PACKAGES}
COMPONENT ${QPID_COMPONENT_CLIENT}
)
+# Python compile the installed modules
+install(CODE "execute_process(COMMAND ${PYTHON_EXECUTABLE} -m py_compile qmfengine.py
+ WORKING_DIRECTORY ${PYTHON_SITEARCH_PACKAGES})")
+install(CODE "execute_process(COMMAND ${PYTHON_EXECUTABLE} -O -m py_compile qmfengine.py
+ WORKING_DIRECTORY ${PYTHON_SITEARCH_PACKAGES})")
+install(CODE "execute_process(COMMAND ${PYTHON_EXECUTABLE} -m py_compile qmf.py
+ WORKING_DIRECTORY ${PYTHON_SITEARCH_PACKAGES})")
+install(CODE "execute_process(COMMAND ${PYTHON_EXECUTABLE} -O -m py_compile qmf.py
+ WORKING_DIRECTORY ${PYTHON_SITEARCH_PACKAGES})")
diff --git a/cpp/bindings/qmf/python/Makefile.am b/cpp/bindings/qmf/python/Makefile.am
index bcef8c6b53..07f3c1072b 100644
--- a/cpp/bindings/qmf/python/Makefile.am
+++ b/cpp/bindings/qmf/python/Makefile.am
@@ -29,7 +29,7 @@ EXTRA_DIST = CMakeLists.txt python.i
BUILT_SOURCES = $(generated_file_list)
SWIG_FLAGS = -w362,401
-$(generated_file_list): $(srcdir)/python.i $(srcdir)/../qmfengine.i
+$(generated_file_list): $(srcdir)/python.i
$(SWIG) -c++ -python $(SWIG_FLAGS) $(INCLUDES) $(QPID_CXXFLAGS) -I$(top_srcdir)/src/qmf -I/usr/include -o qmfengine.cpp $(srcdir)/python.i
pylibdir = $(pyexecdir)
diff --git a/cpp/bindings/qmf/python/python.i b/cpp/bindings/qmf/python/python.i
index 5e25d155f9..118d0d3dbd 100644
--- a/cpp/bindings/qmf/python/python.i
+++ b/cpp/bindings/qmf/python/python.i
@@ -139,5 +139,5 @@
-%include "../qmfengine.i"
+%include "qmf/qmfengine.i"
diff --git a/cpp/bindings/qmf/qmfengine.i b/cpp/bindings/qmf/qmfengine.i
deleted file mode 100644
index eb350115a3..0000000000
--- a/cpp/bindings/qmf/qmfengine.i
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * 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.
- */
-
-%{
-
-#include "qmf/engine/Agent.h"
-#include "qmf/engine/Console.h"
-#include "qmf/engine/ResilientConnection.h"
-
-%}
-
-%include <qmf/engine/QmfEngineImportExport.h>
-%include <qmf/engine/Query.h>
-%include <qmf/engine/Message.h>
-%include <qmf/engine/Agent.h>
-%include <qmf/engine/Console.h>
-%include <qmf/engine/ConnectionSettings.h>
-%include <qmf/engine/ResilientConnection.h>
-%include <qmf/engine/Typecode.h>
-%include <qmf/engine/Schema.h>
-%include <qmf/engine/Value.h>
-%include <qmf/engine/ObjectId.h>
-%include <qmf/engine/Object.h>
-%include <qmf/engine/Event.h>
-
-
-%inline {
-
-using namespace std;
-using namespace qmf::engine;
-
-namespace qmf {
-namespace engine {
-
-}
-}
-}
-
-
-%{
-
-%};
-
diff --git a/cpp/bindings/qmf/ruby/CMakeLists.txt b/cpp/bindings/qmf/ruby/CMakeLists.txt
index 702606139b..1fb2542e46 100644
--- a/cpp/bindings/qmf/ruby/CMakeLists.txt
+++ b/cpp/bindings/qmf/ruby/CMakeLists.txt
@@ -22,7 +22,9 @@
##------------------------------------------------------
set_source_files_properties(${CMAKE_CURRENT_SOURCE_DIR}/ruby.i PROPERTIES CPLUSPLUS ON)
-include_directories(${RUBY_INCLUDE_DIRS} ${qpid-cpp_SOURCE_DIR}/include)
+include_directories(${RUBY_INCLUDE_DIRS}
+ ${qpid-cpp_SOURCE_DIR}/include
+ ${qpid-cpp_SOURCE_DIR}/bindings)
swig_add_module(qmfengine_ruby ruby ${CMAKE_CURRENT_SOURCE_DIR}/ruby.i)
swig_link_libraries(qmfengine_ruby qmf qmfconsole ${RUBY_LIBRARY})
@@ -32,6 +34,6 @@ swig_link_libraries(qmfengine_ruby qmf qmfconsole ${RUBY_LIBRARY})
##----------------------------------
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libqmfengine_ruby.so
RENAME qmfengine.so
- DESTINATION ${RUBY_ARCH_DIR}
+ DESTINATION ${RUBY_PFX_ARCH_DIR}
COMPONENT ${QPID_COMPONENT_CLIENT}
)
diff --git a/cpp/bindings/qmf/ruby/Makefile.am b/cpp/bindings/qmf/ruby/Makefile.am
index 1c7f67edb3..33393aeda0 100644
--- a/cpp/bindings/qmf/ruby/Makefile.am
+++ b/cpp/bindings/qmf/ruby/Makefile.am
@@ -29,7 +29,7 @@ rubylibdir = $(RUBY_LIB)
dist_rubylib_DATA = qmf.rb
-qmfengine.cpp: $(srcdir)/ruby.i $(srcdir)/../qmfengine.i
+qmfengine.cpp: $(srcdir)/ruby.i
$(SWIG) -ruby -c++ $(SWIG_FLAGS) $(INCLUDES) $(QPID_CXXFLAGS) -I/usr/include -o qmfengine.cpp $(srcdir)/ruby.i
rubylibarchdir = $(RUBY_LIB_ARCH)
diff --git a/cpp/bindings/qmf/ruby/qmf.rb b/cpp/bindings/qmf/ruby/qmf.rb
index 9fbd50cbf6..d05127db4b 100644
--- a/cpp/bindings/qmf/ruby/qmf.rb
+++ b/cpp/bindings/qmf/ruby/qmf.rb
@@ -319,9 +319,7 @@ module Qmf
eventImpl.sessionContext.handler.sess_event_recv(eventImpl.sessionContext, eventImpl.message)
end
rescue Exception => ex
- puts "Event Exception: #{ex}"
if bt_count < 2
- puts ex.backtrace
bt_count += 1
end
end
@@ -1251,9 +1249,7 @@ module Qmf
when Qmfengine::ConsoleEvent::METHOD_RESPONSE
end
rescue Exception => ex
- puts "Exception caught in callback: #{ex}"
if @bt_count < 2
- puts ex.backtrace
@bt_count += 1
end
end
@@ -1381,14 +1377,13 @@ module Qmf
end
def conn_event_connected()
- puts "Console Connection Established..."
@session = Session.new(@conn, "qmfc-%s.%d" % [Socket.gethostname, Process::pid], self)
@impl.sessionOpened(@session.handle)
do_events
end
def conn_event_disconnected(error)
- puts "Console Connection Lost"
+
end
def conn_event_visit
@@ -1396,12 +1391,10 @@ module Qmf
end
def sess_event_session_closed(context, error)
- puts "Console Session Lost"
@impl.sessionClosed()
end
def sess_event_recv(context, message)
- puts "Unexpected RECV Event" if not @operational
@impl.handleRcvMessage(message)
do_events
end
@@ -1510,14 +1503,13 @@ module Qmf
end
def conn_event_connected()
- puts "Agent Connection Established..."
@session = Session.new(@conn, "qmfa-%s.%d" % [Socket.gethostname, Process::pid], self)
@impl.newSession
do_events
end
def conn_event_disconnected(error)
- puts "Agent Connection Lost"
+
end
def conn_event_visit
@@ -1525,7 +1517,7 @@ module Qmf
end
def sess_event_session_closed(context, error)
- puts "Agent Session Lost"
+
end
def sess_event_recv(context, message)
diff --git a/cpp/bindings/qmf/ruby/ruby.i b/cpp/bindings/qmf/ruby/ruby.i
index 0101861100..2854aa0c7e 100644
--- a/cpp/bindings/qmf/ruby/ruby.i
+++ b/cpp/bindings/qmf/ruby/ruby.i
@@ -102,5 +102,5 @@
}
-%include "../qmfengine.i"
+%include "qmf/qmfengine.i"