GNOME Bugzilla – Bug 662143
libdl not present on various systems
Last modified: 2011-10-20 07:05:56 UTC
libdl isn't found on various system, including OpenBSD. Thus hardcoding -ldl in Makefile's: tests_python_test_load_python_library_LDADD breaks on those systems. Perhaps a configure check could be added that checks for libdl?
Sure, a patch for that would be welcome. However, is there some alternative to the dlopen(), dlerror(), and dlclose() functions on that platform? It would be nice for the test to work.
Those functions are present (dlfcn.h) but don't need libdl to work.
Created attachment 199419 [details] [review] Check of libdl instead of unconditionally linking with it.
Please push, adding a comment before AC_CHECK_LIB() saying that it is not needed on (non-Linux) platforms that don't have it.
Thanks, I've pushed it in b8693a503ac0bae9cf7d3feca3a99a8d121bacf5.
Review of attachment 199419 [details] [review]: ::: configure.ac @@ -70,2 +70,3 @@ AC_DEFINE([GETTEXT_PACKAGE], [PACKAGE_TARNAME], [Define to the gettext package name.]) +AC_CHECK_LIB([dl], [dlopen], DL_LIB="-ldl") If DL_LIB is used in a Makefile.am, it will need to be substituted for an output variable with AC_SUBST, as it is not in the list of default output variables: http://www.gnu.org/software/autoconf/manual/autoconf.html#Preset-Output-Variables
Hmm, AC_SUBST(DL_LIB) will do the trick?
(In reply to comment #7) > Hmm, AC_SUBST(DL_LIB) will do the trick? Correct. It would probably be simpler to replace the ‘DL_LIB="-ldl"’ inside the AC_CHECK_LIB with ‘AC_SUBST([DL_LIB], ["-ldl"])’.
Thanks for the auto-bat ;-) I've adjusted the script.