Follow-up Comment #8, patch #7017 (project grep):

I believe the configure.ac test is correct. Here is the code:

# support for dlopen
AC_ARG_WITH(dl,
        AC_HELP_STRING([--without-dl], [Don't try to use libdl]))
if test "$with_dl" != "no"; then
    AC_CHECK_LIB([dl], [dlopen])
    AC_C_TYPEOF
fi
AM_CONDITIONAL(USING_LIBDL, [test x$ac_cv_lib_dl_dlopen = xyes])

Here, USING_LIBDL is only set if ac_cv_lib_dl_dlopen is set to yes, which
itself can only happen if --without-dl is not passed to configure AND libdl is
found. Is there something wrong with this logic?

As for dlopening the library, is there a simple way to find out which library
is picked up by a link? I suppose I can compile a test, link against the file,
then ldd it to get the SONAME?

I am tempted, in any case, to do something simpler: dlopen("libpcre.so"), but
allow the soname to be specified by a configure-time parameter.

The two stools I am trying to balance between here are on the one hand you
(reasonably) want me to provide something that works on any system, while
Paolo says I can't use libltdl (which would otherwise simplify matters, I
think). I want to avoid reimplementing any significant functionality which I
would otherwise get from libtool, libltdl, or similar.

The reason I think my suggestion is reasonable is that there are, I think,
two main classes of users I'm trying to cater to:

1. Those who build grep on their own systems. They will have the development
sources of PCRE installed, so a default of libpcre.so will work. Those on
systems with different naming conventions can give a --with-pcre-soname=
argument.

2. Those who are packaging grep. They won't mind giving the --configure
argument.

Of course, if there's a really simple way portably to obtain the correct
soname, I'm all for it.

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/patch/?7017>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/



Reply via email to