----- Original Message -----
From: LRN <lrn1986@gmail.com>
To: mingw-users@lists.sourceforge.net
Cc:
Sent: Wednesday, July 25, 2012 2:11 PM
Subject: Re: [Mingw-users] trouble building libxslt from xmlsoft

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 25.07.2012 23:47, Mark Mikofski wrote:
> Problem: libxslt always looks for libiconv in /usr/lib instead of
> /mingw/lib
>
> Overview: I am trying to build libxslt for win32 with mingw (gcc
> 4.7) and using the native mingw libraries for libxml2, zlib and
> iconv. I can download precomiled binaries fro xmlsoft, but libxslt
> from xmlsoft doesn't find libiconv.dll on $PATH
> (.:/usr/local/bin:/mingw/bin:/bin) maybe because in /mingw/bin it's
> named libiconv-2.dll and in /bin it's named msys-iconv-2.dll. So
> you can download their iconv, xml2, xmlsec, zlib, etc, - that's
> what I did as a workaround, and put it in /opt which I can add to
> $PATH. But I would rather just rebuild xslt.
>
> Methods: 1. edit configure to add -f to RM since it throws an
> error, "can't delete libtoolT" on lines containing "RM $(ofile)T"
> 2. from msys shell ./configure --without-python --without-crypto 3.
> make libtool: link: returns the error, "/usr/lib/libiconv.la is not
> a valid archive"
>
> I tried various ways of overriding the library
> --with-libxml-libs-prefix='-L/usr/lib -lxml2 -L/mingw/lib -liconv'
> LIBXML_LIBS='-L/usr/lib -lxml2 -L/mingw/lib -liconv' I also tried
> LDFLAGS, but no matter what it always looks for libiconv.la in
> /usr/bin.
>
Tried --with-iconv-prefix or --with-libiconv-prefix ?

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQEcBAEBAgAGBQJQEGEFAAoJEOs4Jb6SI2CwNN0IAIWkiHJ/ttTU5nh9kA3tN/65
r4R4npTk+oK5Ju8+6//RFzyb7jA/iHAonn+seUmMipnwo9C2lu/NuWNercwepjrC
NE7zTCbTbKEM+rfiXPetrohqSPvdQKf083kvzjflFUPBEVUVJDAXZnZwgveuptK5
Tv2Fk8IoiVXX3fjIrTCLiiWCKXYtvqwWEDGyXUjHoXrb309C6sCmbPDb4OPGjFdV
jkJ+u9ryxlS6B+GoPzsBRdF9mscvtcXbTugmigmMHzCSTm+407t9gSs0TXS6pt3m
rR5RZh65bvc1WVjBnxNbi9B4MdWOxxCadWtSv+jUhKhIsNF3oQ9dIIDUz/v+TUU=
=epXO
-----END PGP SIGNATURE-----

Thanks LRN.

I checked the configure file and there is no explicit option --with-iconv-prefix or --with-libiconv-prefix, or any variant, although there is a generic --with-PACKAGE=[args] option.

Nevertheless, I tried --with-* options you suggested and configure states "unrecognized options" and still has the variables LIBXML_LIBS, etc. set to look for libz, libiconv and libm in /usr/lib, and not /mingw/lib.

Although you gave me an idea; I tried:

$ ./configure --without-python --without-crypto --with-libxml-libs-prefix=/mingw/lib --with-libxml-include-prefix=/mingw/include

which added -L/mingw/lib to the the libtool --mode=link command during make, but I **still** get the exact same error:

libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I.. -I.. -I../libxslt -I/mingw/inclu
de -I/usr/include/libxml2 -g -O2 -Wall -MT security.lo -MD -MP -MF .deps/securit
y.Tpo -c security.c -o security.o >/dev/null 2>&1
mv -f .deps/security.Tpo .deps/security.Plo
/bin/sh ../libtool --tag=CC   --mode=link gcc  -g -O2 -Wall -no-undefined -Wl,--
version-script=./libxslt.syms -version-info 2:26:1  -o libxslt.la -rpath /usr/lo
cal/lib attrvt.lo xslt.lo xsltlocale.lo xsltutils.lo pattern.lo templates.lo var
iables.lo keys.lo numbers.lo extensions.lo extra.lo functions.lo namespaces.lo i
mports.lo attributes.lo documents.lo preproc.lo transform.lo security.lo -L/ming
w/lib -L/usr/lib -lxml2 -L/usr/lib -lz -liconv -lm
/bin/grep: /usr/lib/libiconv.la: No such file or directory
/bin/sed: can't read /usr/lib/libiconv.la: No such file or directory
libtool: link: `/usr/lib/libiconv.la' is not a valid libtool archive
make[2]: *** [libxslt.la] Error 1
make[2]: Leaving directory `/home/mmikofski/development/xmlsoft/libxslt-1.1.26/l
ibxslt'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/mmikofski/development/xmlsoft/libxslt-1.1.26'
make: *** [all] Error 2

Thanks for your help anyway.

--Mark