On Sun, 30 Nov 2025 at 20:28, Bruno Haible <[email protected]> wrote: > Hi Reuben, > > > My patch is incomplete: it unconditionally uses libdl.m4, meaning libdl > > will always be linked on systems that have it. I appreciate this is what > > we're trying to avoid! I'm unclear what the best way to fix this is. > Should > > I move the test for which code to use (i.e. Windows, libdl or /proc) to > > configure.ac, and introduce an automake conditional to guard the > addition > > of libdl to the LIBS variable? > > I think you are on the right track. What I would do: > - Keep the invocation of gl_LIBDL, but don't use the value of $(LIBDL) > in lib_LDFLAGS. > - Define _GL_USE_DLADDR only if $(LIBDL) is empty. > - Use the value $(LIBDL) to decide this, in the configure.ac section of > the > module. I don't know whether that will require an Automake conditional.
Thanks very much for the quick reply and hints. I see a problem here: we want to use _GL_USE_DLADDR on non-Linux, non-Windows systems that have dladdr in libdl, i.e. where otherwise there's no other way to make the code work. So I think I need a more complex test than "is LIBDL empty?", I need to test "are we on a Linux system using glibc of the right version or uClibc?". Does that sound right? -- Web: rrt.sc3d.org
