Perl module XML::Parser + Expat build problem

Gerrit P. Haase gerrit.haase@convey.de
Wed Oct 24 09:44:00 GMT 2001


Hallo Bruce,

2001-10-24 18:26:11, du schriebst:

> I am trying to install XML::Parser using cygwin + cygwin perl,
> which relies on the expat libs, but I have been unable to get expat to
> build,
> using make and gcc from cygwin. 
> (cygwin install, version 2.78.2.9)

> I got expat from:

> http://expat.sourceforge.net/

> and others have informed me that a static lib should work with cygwin,
> and that expat-1.95.2 builds with a static lib by default.

I made a little change, now you will get dynamic libraries (if you use
the latest autotools), apply my patch and it should work then.
The patch is attached.

And you need to move the .dll in the bin dir after 'make install'
(ohoh, it is all so buggy), looks for me like this:
$ cp /usr/local/lib/libexpat-0-1-0.dll /usr/local/bin/libexpat-0-1-0.dll

Gerrit
-- 
convey Information Systems GmbH                 http://www.convey.de/
                                                Vitalisstraße 326-328
Gerrit P. Haase                                 D-50933 Köln
gerrit.haase@convey.de                          Fon: ++49 221 6903922
expat.patch
log.make
log.install
log.configure
--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

-------------- next part --------------
A non-text attachment was scrubbed...
Name: expat.patch
Type: text/x-diff
Size: 559 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin/attachments/20011024/432c55dc/attachment.bin>
-------------- next part --------------
loading cache ./config.cache
checking host system type... i686-pc-cygwin
checking build system type... i686-pc-cygwin
checking for ranlib... (cached) ranlib
checking for gcc... (cached) gcc
checking whether the C compiler (gcc  -s) works... yes
checking whether the C compiler (gcc  -s) is a cross-compiler... no
checking whether we are using GNU C... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for ld used by GCC... (cached) ld
checking if the linker (ld) is GNU ld... (cached) yes
checking for BSD-compatible nm... (cached) /usr/bin/nm -B
checking whether ln -s works... (cached) yes
checking for dlltool... (cached) dlltool
checking for as... (cached) as
checking for objdump... (cached) objdump
updating cache ./config.cache
checking for object suffix... o
checking for executable suffix... .exe
checking for gcc option to produce PIC... none
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.lo... yes
checking if gcc supports -fno-rtti -fno-exceptions ... yes
checking if gcc static flag -static works... -static
checking if the linker (ld) is GNU ld... yes
checking whether the linker (ld) supports shared libraries... yes
checking command to parse /usr/bin/nm -B output... ok
checking how to hardcode library paths into programs... immediate
checking for ld option to reload object files... -r
checking dynamic linker characteristics... Win32 ld.exe
checking if libtool supports shared libraries... yes
checking if package supports dlls... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking for objdir... .libs
creating libtool
loading cache ./config.cache
checking for gcc... (cached) gcc
checking whether the C compiler (gcc  -s) works... yes
checking whether the C compiler (gcc  -s) is a cross-compiler... no
checking whether we are using GNU C... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for a BSD compatible install... (cached) /usr/bin/install -c
checking how to run the C preprocessor... (cached) gcc -E
checking for ANSI C header files... (cached) yes
checking for fcntl.h... (cached) yes
checking for unistd.h... (cached) yes
checking whether byte ordering is bigendian... (cached) no
checking for working const... (cached) yes
checking for off_t... (cached) yes
checking for size_t... (cached) yes
checking for 8-bit clean memcmp... (cached) yes
checking for unistd.h... (cached) yes
checking for getpagesize... (cached) yes
checking for working mmap... (cached) no
checking for memmove... (cached) yes
checking for bcopy... (cached) yes
creating ./config.status
creating Makefile
creating lib/Makefile
creating lib/expat.h
creating xmlwf/Makefile
creating examples/Makefile
creating config.h
config.h is unchanged
-------------- next part --------------
for dir in lib xmlwf; do \
	(cd $dir && make install); \
done
make[1]: Entering directory `/stuff/xml/expat-1.95.2/lib'
sh ../conftools/mkinstalldirs /usr/local/lib /usr/local/include
sh ../libtool --mode=install /usr/bin/install -c libexpat.la /usr/local/lib/libexpat.la
/usr/bin/install -c .libs/libexpat-0-1-0.dll /usr/local/lib/libexpat-0-1-0.dll
(cd /usr/local/lib && rm -f libexpat.a && ln -s libexpat-0-1-0.dll libexpat.a)
/usr/bin/install -c .libs/libexpat.lai /usr/local/lib/libexpat.la
/usr/bin/install -c .libs/libexpat.a /usr/local/lib/libexpat.a
ranlib /usr/local/lib/libexpat.a
chmod 644 /usr/local/lib/libexpat.a
----------------------------------------------------------------------
Libraries have been installed in:
   /usr/local/lib

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use `-LLIBDIR'
flag during linking and do at least one of the following:
   - add LIBDIR to the `PATH' environment variable
     during execution
   - add LIBDIR to the `LD_RUN_PATH' environment variable
     during linking
   - use the `-Wl,--rpath -Wl,LIBDIR' linker flag

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
/usr/bin/install -c -m 644 expat.h /usr/local/include
make[1]: Leaving directory `/stuff/xml/expat-1.95.2/lib'
make[1]: Entering directory `/stuff/xml/expat-1.95.2/xmlwf'
/bin/sh.exe ../conftools/mkinstalldirs /usr/local/bin
/bin/sh.exe ../libtool --mode=install /usr/bin/install -c xmlwf /usr/local/bin/xmlwf
/usr/bin/install -c xmlwf /usr/local/bin/xmlwf
make[1]: Leaving directory `/stuff/xml/expat-1.95.2/xmlwf'

DON'T FORGET TO MOVE THE DLL INTO A DIRECTORY IN YOUR PATH!!!

gph
-------------- next part --------------
cd lib && make
make[1]: Entering directory `/stuff/xml/expat-1.95.2/lib'
sh ../libtool --mode=compile gcc -DHAVE_CONFIG_H -DPACKAGE='"expat"' -DVERSION='"expat_1.95.2"' -I. -I. -I..  -Wall -Wmissing-prototypes -Wstrict-prototypes -fexceptions -c xmlparse.c
rm -f .libs/xmlparse.lo
gcc -DHAVE_CONFIG_H -DPACKAGE=\"expat\" -DVERSION=\"expat_1.95.2\" -I. -I. -I.. -Wall -Wmissing-prototypes -Wstrict-prototypes -fexceptions -c xmlparse.c  -DPIC -o .libs/xmlparse.lo
mv -f .libs/xmlparse.lo xmlparse.o
(cd . && ln -s xmlparse.o xmlparse.lo)
sh ../libtool --mode=link  gcc -no-undefined -version-info 1:0:1 -Wall -Wmissing-prototypes -Wstrict-prototypes -fexceptions -s -o libexpat.la -rpath /usr/local/lib -s xmlparse.lo xmltok.lo xmlrole.lo
rm -fr .libs/libexpat.la .libs/libexpat.* .libs/libexpat.*
generating symbol list for `libexpat.la'
test -f .libs/libexpat-0-1-0.dll-ltdll.c || sed -e "/^# \/\* ltdll\.c starts here \*\//,/^# \/\* ltdll.c ends here \*\// { s/^# //; p; }" -e d < ../libtool > .libs/libexpat-0-1-0.dll-ltdll.c
 test -f .libs/libexpat-0-1-0.dll-ltdll.o || (cd .libs && gcc -c libexpat-0-1-0.dll-ltdll.c)
 dlltool --export-all --exclude-symbols DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12 --output-def .libs/libexpat-0-1-0.dll-def .libs/libexpat-0-1-0.dll-ltdll.o  xmlparse.o xmltok.o xmlrole.o  
 sed -e "1,/EXPORTS/d" -e "s/ @ [0-9]*//" -e "s/ *;.*$//" < .libs/libexpat-0-1-0.dll-def > .libs/libexpat.exp
echo EXPORTS > .libs/libexpat-0-1-0.dll-def
 _lt_hint=1; cat .libs/libexpat.exp | while read symbol; do set dummy $symbol; case $# in 2) echo " $2 @ $_lt_hint ; " >> .libs/libexpat-0-1-0.dll-def;; *) echo " $2 @ $_lt_hint $3 ; " >> .libs/libexpat-0-1-0.dll-def;; esac; _lt_hint=`expr 1 + $_lt_hint`; done
 test -f .libs/libexpat-0-1-0.dll-ltdll.c || sed -e "/^# \/\* ltdll\.c starts here \*\//,/^# \/\* ltdll.c ends here \*\// { s/^# //; p; }" -e d < ../libtool > .libs/libexpat-0-1-0.dll-ltdll.c
 test -f .libs/libexpat-0-1-0.dll-ltdll.o || (cd .libs && gcc -c libexpat-0-1-0.dll-ltdll.c)
 gcc -Wl,--base-file,.libs/libexpat-0-1-0.dll-base -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o .libs/libexpat-0-1-0.dll .libs/libexpat-0-1-0.dll-ltdll.o  xmlparse.o xmltok.o xmlrole.o   
 dlltool --as=as --dllname libexpat-0-1-0.dll --exclude-symbols DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12 --def .libs/libexpat-0-1-0.dll-def --base-file .libs/libexpat-0-1-0.dll-base --output-exp .libs/libexpat-0-1-0.dll-exp
 gcc -Wl,--base-file,.libs/libexpat-0-1-0.dll-base .libs/libexpat-0-1-0.dll-exp -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o .libs/libexpat-0-1-0.dll .libs/libexpat-0-1-0.dll-ltdll.o  xmlparse.o xmltok.o xmlrole.o   
 dlltool --as=as --dllname libexpat-0-1-0.dll --exclude-symbols DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12 --def .libs/libexpat-0-1-0.dll-def --base-file .libs/libexpat-0-1-0.dll-base --output-exp .libs/libexpat-0-1-0.dll-exp
 gcc .libs/libexpat-0-1-0.dll-exp -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o .libs/libexpat-0-1-0.dll .libs/libexpat-0-1-0.dll-ltdll.o  xmlparse.o xmltok.o xmlrole.o   
(cd .libs && rm -f libexpat.a && ln -s libexpat-0-1-0.dll libexpat.a)
dlltool --as=as --dllname libexpat-0-1-0.dll --def .libs/libexpat-0-1-0.dll-def --output-lib .libs/libexpat.a
creating libexpat.la
(cd .libs && rm -f libexpat.la && ln -s ../libexpat.la libexpat.la)
make[1]: Leaving directory `/stuff/xml/expat-1.95.2/lib'
cd xmlwf && make
make[1]: Entering directory `/stuff/xml/expat-1.95.2/xmlwf'
gcc -o xmlwf -s -static xmlwf.o xmlfile.o codepage.o unixfilemap.o -L../lib/.libs -lexpat
make[1]: Leaving directory `/stuff/xml/expat-1.95.2/xmlwf'


More information about the Cygwin mailing list