[packages/crossmingw32-bzip2] - adjusted patch instead of spec hacking - store both WINAPI-style and stdcall symbols, so that simp

qboosh qboosh at pld-linux.org
Sun Jun 23 16:01:21 CEST 2013


commit 142c4a2fecc507f3257a45a351c6a5e6f99443ad
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Sun Jun 23 16:00:58 2013 +0200

    - adjusted patch instead of spec hacking
    - store both WINAPI-style and stdcall symbols, so that simple configure checks work

 crossmingw32-bzip2.patch | 14 +++++++-------
 crossmingw32-bzip2.spec  | 19 +++++--------------
 2 files changed, 12 insertions(+), 21 deletions(-)
---
diff --git a/crossmingw32-bzip2.spec b/crossmingw32-bzip2.spec
index b78f5f1..d9a97d6 100644
--- a/crossmingw32-bzip2.spec
+++ b/crossmingw32-bzip2.spec
@@ -35,6 +35,9 @@ BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 # arch-specific flags (like alpha's -mieee) are not valid for i386 gcc
 %define		optflags	-O2
 %endif
+# -z options are invalid for mingw linker, most of -f options are Linux-specific
+%define		filterout_ld	-Wl,-z,.*
+%define		filterout_c	-f[-a-z0-9=]*
 
 %description
 Bzip2 compresses files using the Burrows-Wheeler block-sorting text
@@ -115,24 +118,12 @@ Group:		Applications/Emulators
 %patch0 -p1
 
 %build
-AR=%{target}-ar
-RANLIB=%{target}-ranlib
-
 %{__make} \
-	AR="$AR" \
-	RANLIB="$RANLIB" \
+	AR="%{target}-ar" \
+	RANLIB="%{target}-ranlib" \
 	CC="%{__cc}" \
 	CFLAGS="%{rpmcflags} -Wall \$(BIGFILES)"
 
-# makefile made libbz2.a as DLL import library...
-# recreate libbz2.dll.a as import library and libbz2.a as static
-%{__rm} libbz2.a libbz2.dll
-
-OBJS="blocksort.o huffman.o crctable.o randtable.o compress.o decompress.o bzlib.o"
-$AR cru libbz2.a $OBJS
-$RANLIB libbz2.a
-%{target}-dllwrap --def libbz2.def --implib libbz2.dll.a -o bzip2.dll $OBJS
-
 %install
 rm -rf $RPM_BUILD_ROOT
 install -d $RPM_BUILD_ROOT{%{_libdir},%{_includedir},%{_dlldir}}
diff --git a/crossmingw32-bzip2.patch b/crossmingw32-bzip2.patch
index f224f61..21c6797 100644
--- a/crossmingw32-bzip2.patch
+++ b/crossmingw32-bzip2.patch
@@ -65,9 +65,9 @@ diff -uNr bzip2-1.0.1/libbz2.def bzip2-1.0.1.good/libbz2.def
 +	BZ2_bzflush at 4
 +	BZ2_bzclose at 4
 +	BZ2_bzerror at 8
---- bzip2-1.0.2/Makefile.orig	2002-01-26 00:34:53.000000000 +0100
-+++ bzip2-1.0.2/Makefile	2003-12-01 23:22:57.502761240 +0100
-@@ -23,7 +23,7 @@
+--- bzip2-1.0.6/Makefile.orig	2010-09-11 00:46:02.000000000 +0200
++++ bzip2-1.0.6/Makefile	2013-06-23 09:39:59.263591821 +0200
+@@ -35,7 +35,7 @@
        decompress.o \
        bzlib.o
  
@@ -76,17 +76,17 @@ diff -uNr bzip2-1.0.1/libbz2.def bzip2-1.0.1.good/libbz2.def
  
  bzip2: libbz2.a bzip2.o
  	$(CC) $(CFLAGS) $(LDFLAGS) -o bzip2 bzip2.o -L. -lbz2
-@@ -33,12 +33,7 @@
- 
+@@ -46,11 +46,8 @@
  libbz2.a: $(OBJS)
  	rm -f libbz2.a
--	$(AR) cq libbz2.a $(OBJS)
+ 	$(AR) cq libbz2.a $(OBJS)
 -	@if ( test -f $(RANLIB) -o -f /usr/bin/ranlib -o \
 -		-f /bin/ranlib -o -f /usr/ccs/bin/ranlib ) ; then \
 -		echo $(RANLIB) libbz2.a ; \
 -		$(RANLIB) libbz2.a ; \
 -	fi
-+	i386-mingw32-dllwrap --def libbz2.def --implib libbz2.a -o libbz2.dll $(OBJS)
++	$(RANLIB) libbz2.a
++	$(CC) -shared $(LDFLAGS) -Wl,--enable-auto-image-base -Wl,--add-stdcall-alias -Wl,--out-implib,libbz2.dll.a -o bzip2.dll libbz2.def $(OBJS)
  
  check: test
  test: bzip2
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/crossmingw32-bzip2.git/commitdiff/142c4a2fecc507f3257a45a351c6a5e6f99443ad



More information about the pld-cvs-commit mailing list