Hello, I've received report about build failure and found that when dictd is built with dbi plugin it fails to install with the following error:
if test _2 != _; then \
mkdir -p /home/local/libexec && \
if test " dictdplugin_dbi.la"; then \
libtool --mode=install /usr/bin/install -c -m 644 dictdplugin_dbi.la /home/local/libexec; else true; fi fi
libtool: install: error: cannot install `dictdplugin_dbi.la' to a directory not ending in /home/local/libexec/
make: *** [install.plugins] Error 1
The problem is that Makefile.in defines
PLUGIN_DIR=${libexecdir}/
and this value is written by libtool into dictdplugin_dbi.la:
libdir='/home/local/libexec/'
At install time libtool checks that libdir path and path passed during --mode=install are the same (libtool code is the following):
inst_prefix_dir=`$echo "$destdir" | $SED "s%$libdir\$%%"`
if test -n "$inst_prefix_dir"; then
<echo error message about directory not ending>
One possible solution is in attachment. Another is to add // (yes twice, as libtool seems to eat one of them) at the end of install path. But I think solution I present is better.
Patch also adds two switches to configure.in --with-dbi and --with-judy. The allow to disable plugin even if support library is installed in system. In Gentoo this is policy to disable such automatic dependencies and generally such modification does no harm (by default everything works as it was supposed initially) and helps people to avoid plugins if they want to.
Thank you for you time.
Eh, I was a bit too fast and forgot remove libmaa from $prefix. So a bit more changes required.
This patch to the said above changes modifies configure.in to save thing required for maa in MAALIB and MAACPPFLAGS. At least MAALIB is necessary to avoid pollution of LDFLAGS with -lmaa and avoid the following error during installation:
libtool --mode=install /usr/bin/install -c -m 644 dictdplugin_judy.la dictdplugin_dbi.la /var/tmp/portage/app-text/dictd-1.10.11-r2/image//usr/libexec; else true; fi fi
libtool: install: warning: relinking `dictdplugin_judy.la'
(cd /var/tmp/portage/app-text/dictd-1.10.11-r2/work/dictd-1.10.11; /bin/sh /usr/bin/libtool --tag=CC --mode=relink i686-pc-linux-gnu-gcc -o dictdplugin_judy.la -module data.lo str.lo heap.lo dictdplugin_judy.lo plugins_common.lo wcrtomb.lo wctomb.lo mbrlen.lo mbrtowc.lo mbstowcs.lo mbtowc.lo iswspace.lo iswalnum.lo towlower.lo strlcpy.lo strlcat.lo -rpath /usr/libexec -Wl,--as-needed,-O1,--hash-style=gnu,--sort-common -Llibmaa -lmaa -ldl -lJudy -inst-prefix-dir /var/tmp/portage/app-text/dictd-1.10.11-r2/image/)
i686-pc-linux-gnu-gcc -shared .libs/data.o .libs/str.o .libs/heap.o .libs/dictdplugin_judy.o .libs/plugins_common.o .libs/wcrtomb.o .libs/wctomb.o .libs/mbrlen.o .libs/mbrtowc.o .libs/mbstowcs.o .libs/mbtowc.o .libs/iswspace.o .libs/iswalnum.o .libs/towlower.o .libs/strlcpy.o .libs/strlcat.o -L/var/tmp/portage/app-text/dictd-1.10.11-r2/work/dictd-1.10.11/libmaa -L/var/tmp/portage/app-text/dictd-1.10.11-r2/image//usr/lib -L/usr/lib -lmaa -ldl -lJudy -Wl,--as-needed -Wl,-O1 -Wl,--hash-style=gnu -Wl,--sort-common -Wl,-soname -Wl,dictdplugin_judy.so.0 -o .libs/dictdplugin_judy.so.0.0.0
/usr/lib/gcc/i686-pc-linux-gnu/4.3.2/../../../../i686-pc-linux-gnu/bin/ld: cannot find -lmaa
collect2: ld returned 1 exit status
libtool: install: error: relink `dictdplugin_judy.la' with the above command before installing it
make: *** [install.plugins] Error 1
With the attached patch dictd builds and installs fine.
File Added: dictd-1.10.11-automatic-plugins_build-failure.patch
File Added: dictd-1.11.0-avoid-libs-in-LDFLAGS.patch
dictd-1.11.0-avoid-libs-in-LDFLAGS.patch
dictd-1.11.0-automagic-plugins.patch
File Added: dictd-1.11.0-automagic-plugins.patch
dictd-1.11.0-plugins-install-fix-and-cleanup.patch
File Added: dictd-1.11.0-plugins-install-fix-and-cleanup.patch
Well, I've updated patch for dictd-1.11 and splitted into three parts to ease review:
dictd-1.11.0-avoid-libs-in-LDFLAGS.patch - make libmaa library be passed through LIBMAA variable and cleans code from local libmaa traces.
dictd-1.11.0-automagic-plugins.patch - adds configure options for plugins. Useful if you have that libraries installed but don't want to build/install plugins.
dictd-1.11.0-plugins-install-fix-and-cleanup.patch - small cleanup in configure.in and fixed path which was passed into libdir='/home/local/libexec/' as initial comments tells here.
Please, apply :)
plugins-install-fix-and-cleanup - fixed. Thanks.
Fixed differently.
If you want to recheck, get the latest sources.
Now configure has two new options --with-plugin-dbi and --with-plugin-judy,
just like you suggested but with different names and implementations.
Thank you for your report.