]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
Quick hack for ticket #1300 to workaround dlopen can't find library
authorreed <reed@new-host.(none)>
Thu, 13 Oct 2011 13:19:13 +0000 (08:19 -0500)
committerreed <reed@new-host.(none)>
Thu, 13 Oct 2011 13:19:13 +0000 (08:19 -0500)
This was from jinmei.

The real fix will be done in #1292.

src/bin/bind10/Makefile.am
src/bin/bind10/bind10_src.py.in

index 5ec0c9f4a6da2900f8174d0d985a9e4c2a4eab18..69ea256157604b18cf743b97c3dd37e6cb933916 100644 (file)
@@ -33,6 +33,7 @@ $(PYTHON_LOGMSGPKG_DIR)/work/bind10_messages.py : bind10_messages.mes
 # this is done here since configure.ac AC_OUTPUT doesn't expand exec_prefix
 bind10: bind10_src.py $(PYTHON_LOGMSGPKG_DIR)/work/bind10_messages.py
        $(SED) -e "s|@@PYTHONPATH@@|@pyexecdir@|" \
+              -e "s|@@LIBDIR@@|$(libdir)|" \
               -e "s|@@LIBEXECDIR@@|$(pkglibexecdir)|" bind10_src.py >$@
        chmod a+x $@
 
index 1687cb1655c6fdcbd3ddb3b365249a41ba7826a9..299509a90fec21c3c38bd599dc8af9f2a74a57a6 100755 (executable)
@@ -579,6 +579,22 @@ class BoB:
         self.start_simple("b10-xfrout", c_channel_env)
 
     def start_xfrin(self, c_channel_env):
+        # XXX: a quick-hack workaround.  xfrin will implicitly use dynamically
+        # loadable data source modules, which will be installed in $(libdir).
+        # On some OSes (including MacOS X and *BSDs) the main process (python)
+        # cannot find the modules unless they are located in a common shared
+        # object path or a path in the (DY)LD_LIBRARY_PATH.  We should seek
+        # a cleaner solution, but for a short term workaround we specify the
+        # path here, unconditionally, and without even bothering which
+        # environment varialbe should be used.
+        if not "B10_FROM_SOURCE" in os.environ:
+            cur_path = os.getenv('DYLD_LIBRARY_PATH')
+            cur_path = '' if cur_path is None else ':' + cur_path
+            c_channel_env['DYLD_LIBRARY_PATH'] = "@@LIBDIR@@" + cur_path
+
+            cur_path = os.getenv('LD_LIBRARY_PATH')
+            cur_path = '' if cur_path is None else ':' + cur_path
+            c_channel_env['LD_LIBRARY_PATH'] = "@@LIBDIR@@" + cur_path
         self.start_simple("b10-xfrin", c_channel_env)
 
     def start_zonemgr(self, c_channel_env):