]> git.pld-linux.org Git - packages/crossmingw32-bzip2.git/commitdiff
- adjusted patch instead of spec hacking auto/th/crossmingw32-bzip2-1.0.6-2
authorJakub Bogusz <qboosh@pld-linux.org>
Sun, 23 Jun 2013 14:00:58 +0000 (16:00 +0200)
committerJakub Bogusz <qboosh@pld-linux.org>
Sun, 23 Jun 2013 14:00:58 +0000 (16:00 +0200)
- store both WINAPI-style and stdcall symbols, so that simple configure checks work

crossmingw32-bzip2.patch
crossmingw32-bzip2.spec

index f224f61fcf15bd534a535b18d017ad95d448fd22..21c67979f08e2e0cdafb3c204512f2196ef447bb 100644 (file)
@@ -65,9 +65,9 @@ diff -uNr bzip2-1.0.1/libbz2.def bzip2-1.0.1.good/libbz2.def
 +      BZ2_bzflush@4\r
 +      BZ2_bzclose@4\r
 +      BZ2_bzerror@8\r
---- 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
index b78f5f1271060a35ac1b9ef18873da57d4446fb5..d9a97d637561f6365a25e98dd2ccc35089df2ef8 100644 (file)
@@ -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}}
This page took 0.045304 seconds and 4 git commands to generate.