html-tidy
html-tidy copied to clipboard
Alien::Tidyp's tidyp is not used if system tidyp is present
The following is a log on a freebsd 10.1 system, where the system's tidyp package is installed. Alien::Tidyp was installed earlier by answering this question:
Tidyp detected, wanna use tidyp already installed on your system? [y ]n
The log:
$ perl5.20.2 Makefile.PL
Using tidyp via Alien::Tidyp
Generating a Unix-style Makefile
Writing Makefile for HTML::Tidy
Writing MYMETA.yml and MYMETA.json
$ make
...
cc -shared -L/usr/local/lib -fstack-protector Tidy.o -o blib/arch/auto/HTML/Tidy/Tidy.so -L/usr/perl5.20.2p/lib/site_perl/5.20.2/auto/share/dist/Alien-Tidyp/v1.4.7/lib -ltidyp
$ ldd blib/arch/auto/HTML/Tidy/Tidy.so
blib/arch/auto/HTML/Tidy/Tidy.so:
libtidyp-1.04.so.0 => /usr/local/lib/libtidyp-1.04.so.0 (0x801603000)
libc.so.7 => /lib/libc.so.7 (0x80081f000)
So it seems that still the system's tidyp is used, not Alien::Tidyp.
This can be fixed by removing /usr/local/lib from the library search path:
$ cc -shared -fstack-protector Tidy.o -o blib/arch/auto/HTML/Tidy/Tidy.so -L/usr/perl5.20.2p/lib/site_perl/5.20.2/auto/share/dist/Alien-Tidyp/v1.4.7/lib -ltidyp
$ ldd blib/arch/auto/HTML/Tidy/Tidy.so
blib/arch/auto/HTML/Tidy/Tidy.so:
libc.so.7 => /lib/libc.so.7 (0x80081f000)
Alternatively don't use -L and -l, but just the path the .a file:
$ cc -shared -L/usr/local/lib -fstack-protector Tidy.o -o blib/arch/auto/HTML/Tidy/Tidy.so /usr/perl5.20.2p/lib/site_perl/5.20.2/auto/share/dist/Alien-Tidyp/v1.4.7/lib/libtidyp.a
$ ldd blib/arch/auto/HTML/Tidy/Tidy.so
blib/arch/auto/HTML/Tidy/Tidy.so:
libc.so.7 => /lib/libc.so.7 (0x80081f000)
(Why I need to use Alien::Tidyp instead of the system tidyp -> see https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=199439 . This also explains some of the test failures on freebsd systems, see http://matrix.cpantesters.org/?dist=HTML-Tidy;os=freebsd;reports=1 )