libtool
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Got shared libraries to build with libtool on MinGW, but it was a st


From: Peter Ekberg
Subject: RE: Got shared libraries to build with libtool on MinGW, but it was a struggle
Date: Fri, 16 Sep 2005 21:16:26 +0200

* Alan W. Irwin wrote on Friday, September 16, 2005 19:22 CEST:
*snip*
> Perhaps the flags on the sed command affect the outcome for 
> MinGW?  Here is
> the full command in func_win32_libid that is failing on MinGW.
> 
> win32_nmres=`eval $NM -f posix -A $1 | \
> sed -n -e '1,100{/ I /{x;/import/!{s/^/import/;h;p;};x;};}'`
> 
> Let's take a specific example. (Note, I am working from 
> detailed notes that
> our PLplot MinGW developer gave me, but he is shy about 
> making bug reports,
> and I don't have access to a MinGW system myself.)
> 
> He reported for a specific case the following bad result from 
> the command line:
> 
> nm -f posix -A zlib.dll.a | \
> sed -n -e '1,100{/ I /{x;/import/!{s/^/import/;h;p;};x;};}'
> 
> The expected "import" output did not appear.
> 
> However, if he tries instead
> 
> nm -f posix -A zlib.dll.a | \
> sed -n -e '1,100{/ I /{x;/import/!{s/^.*/import/;h;p;};x;};}'
> import
> 
> Note the expected "import" output does appear with this 
> change to the sed
> logic.  To complete this here is the result of nm -f posix -A 
> zlib.dll.a
> without the sed filtering:
> 
> zlib.dll.a[dt.o]: .bss b 00000000
> zlib.dll.a[dt.o]: .data d 00000000
> zlib.dll.a[dt.o]: .idata$4 i 00000000
> zlib.dll.a[dt.o]: .idata$5 i 00000000
> zlib.dll.a[dt.o]: .idata$7 i 00000000
> zlib.dll.a[dt.o]: .text t 00000000
> zlib.dll.a[dt.o]: __zlib_dll_a_iname I 00000000
> zlib.dll.a[dh.o]: .bss b 00000000
> zlib.dll.a[dh.o]: .data d 00000000
> zlib.dll.a[dh.o]: .idata$2 i 00000000
> zlib.dll.a[dh.o]: .idata$4 i 00000000
> zlib.dll.a[dh.o]: .idata$5 i 00000000
> zlib.dll.a[dh.o]: .text t 00000000
> zlib.dll.a[dh.o]: __head_zlib_dll_a I 00000000
> zlib.dll.a[dh.o]: __zlib_dll_a_iname U        
> zlib.dll.a[dh.o]: fthunk i 00000004
> zlib.dll.a[dh.o]: hname i 00000004
> ...
> 
> The strings with " I " in them trigger the rest of the sed 
> script which
> is why at least the second form produces the "import" response.

I bet this is an end-of-line issue. There is probably a \r
that destroys something.

Anyway, this sed script should simler, faster, more robust
and equivalent.

sed -n -e '1,100{/ I /{s/.*/import/;p;q;};}'

However, I can't reproduce here so someone better test first...

Cheers,
Peter




reply via email to

[Prev in Thread] Current Thread [Next in Thread]