diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt index 63260fe..f66c0d9 100644 --- a/python/CMakeLists.txt +++ b/python/CMakeLists.txt @@ -16,18 +16,20 @@ # ######################################################################## -# Setup python install +# Include python install macros ######################################################################## include(GrPython) +if(NOT PYTHONINTERP_FOUND) + return() +endif() -list(APPEND python_sources - __init__.py -) - +######################################################################## +# Install python sources +######################################################################## GR_PYTHON_INSTALL( - FILES ${python_sources} - DESTINATION ${GR_PYTHON_DIR}/gnuradio/ieee802_11 - COMPONENT "ieee802_11_python" + FILES + __init__.py + DESTINATION ${GR_PYTHON_DIR}/ieee802_11 ) ######################################################################## @@ -35,6 +37,6 @@ GR_PYTHON_INSTALL( ######################################################################## include(GrTest) -#set(GR_TEST_TARGET_DEPS gnuradio-ieee802-15-4) -#set(GR_TEST_PYTHON_DIRS ${CMAKE_BINARY_DIR}/swig) +set(GR_TEST_TARGET_DEPS gnuradio-ieee802-11) +set(GR_TEST_PYTHON_DIRS ${CMAKE_BINARY_DIR}/swig) #GR_ADD_TEST(qa_howto ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/qa_howto.py) diff --git a/python/__init__.py b/python/__init__.py index da303af..6d4bcb4 100644 --- a/python/__init__.py +++ b/python/__init__.py @@ -15,5 +15,33 @@ # along with this program. If not, see . # +# ---------------------------------------------------------------- +# Temporary workaround for ticket:181 (swig+python problem) +import sys +_RTLD_GLOBAL = 0 +try: + from dl import RTLD_GLOBAL as _RTLD_GLOBAL +except ImportError: + try: + from DLFCN import RTLD_GLOBAL as _RTLD_GLOBAL + except ImportError: + pass + +if _RTLD_GLOBAL != 0: + _dlopenflags = sys.getdlopenflags() + sys.setdlopenflags(_dlopenflags|_RTLD_GLOBAL) +# ---------------------------------------------------------------- + + +# import swig generated symbols into the test namespace from ieee802_11_swig import * +# import any pure python here +# + +# ---------------------------------------------------------------- +# Tail of workaround +if _RTLD_GLOBAL != 0: + sys.setdlopenflags(_dlopenflags) # Restore original flags +# ---------------------------------------------------------------- +