summaryrefslogtreecommitdiff
path: root/cpp/src
diff options
context:
space:
mode:
authorStephen D. Huston <shuston@apache.org>2009-10-21 01:36:16 +0000
committerStephen D. Huston <shuston@apache.org>2009-10-21 01:36:16 +0000
commit466f1af9eb0e745fe26851cb0b381e4b533a420c (patch)
tree541ed86a6c4ed70478ecfca9c70411354a8640b0 /cpp/src
parent8645f9099e7da2267f2eb0c94cd2e419db815435 (diff)
downloadqpid-python-466f1af9eb0e745fe26851cb0b381e4b533a420c.tar.gz
Add ability to load modules from something other than a .so file; allows loading .dll files on Windows, for example. The proper suffix is gleaned from cmake; if on autoconf assume .so.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@827865 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src')
-rw-r--r--cpp/src/config.h.cmake2
-rw-r--r--cpp/src/qpid/Modules.cpp10
2 files changed, 11 insertions, 1 deletions
diff --git a/cpp/src/config.h.cmake b/cpp/src/config.h.cmake
index 7a1873aafd..b3d0450822 100644
--- a/cpp/src/config.h.cmake
+++ b/cpp/src/config.h.cmake
@@ -37,6 +37,8 @@
#cmakedefine QPIDC_MODULE_DIR "${QPIDC_MODULE_DIR}"
#cmakedefine QPIDD_MODULE_DIR "${QPIDD_MODULE_DIR}"
+#define QPID_MODULE_SUFFIX "${CMAKE_SHARED_LIBRARY_SUFFIX}"
+
#cmakedefine QPID_HAS_CLOCK_GETTIME
#cmakedefine QPID_HAS_SASL
diff --git a/cpp/src/qpid/Modules.cpp b/cpp/src/qpid/Modules.cpp
index 78afbb23ad..7230630818 100644
--- a/cpp/src/qpid/Modules.cpp
+++ b/cpp/src/qpid/Modules.cpp
@@ -19,6 +19,7 @@
*
*/
+#include "config.h"
#include "qpid/Modules.h"
#include "qpid/Exception.h"
#include "qpid/log/Statement.h"
@@ -67,10 +68,17 @@ void loadModuleDir (std::string dirname, bool isDefault)
}
fs::directory_iterator endItr;
+ // CMake sets QPID_MODULE_SUFFIX; Autoconf doesn't, so assume Linux .so
+#if defined (QPID_MODULE_SUFFIX)
+ std::string suffix(QPID_MODULE_SUFFIX);
+#else
+ std::string suffix(".so");
+#endif
for (fs::directory_iterator itr (dirPath); itr != endItr; ++itr)
{
if (!fs::is_directory(*itr) &&
- itr->string().find (".so") == itr->string().length() - 3)
+ itr->string().find (suffix) ==
+ itr->string().length() - suffix.length())
tryShlib (itr->string().data(), true);
}
}