SPECS: crossmingw64-gcc.spec - build'n'install crt.

pluto pluto at pld-linux.org
Thu Jul 3 13:02:58 CEST 2008


Author: pluto                        Date: Thu Jul  3 11:02:58 2008 GMT
Module: SPECS                         Tag: HEAD
---- Log message:
- build'n'install crt.

---- Files affected:
SPECS:
   crossmingw64-gcc.spec (1.3 -> 1.4) 

---- Diffs:

================================================================
Index: SPECS/crossmingw64-gcc.spec
diff -u SPECS/crossmingw64-gcc.spec:1.3 SPECS/crossmingw64-gcc.spec:1.4
--- SPECS/crossmingw64-gcc.spec:1.3	Wed Jul  2 16:47:10 2008
+++ SPECS/crossmingw64-gcc.spec	Thu Jul  3 13:02:52 2008
@@ -60,14 +60,13 @@
 This package contains cross targeted g++ and (static) libstdc++.
 
 %prep
-%setup -q -n gcc-%{version}
+%setup -q -n gcc-%{version} -a 1
 %patch0 -p1
-mkdir winsup
-tar -xjf %{SOURCE1} -C winsup
-ln -s mingw-w64-headers winsup/trunk/mingw
+mkdir -p winsup/mingw
+cp -ar trunk/mingw-w64-headers/include winsup/mingw
 
 %build
-build_sysroot=`pwd`/winsup/trunk
+build_sysroot=`pwd`/winsup
 
 rm -rf BUILDDIR && install -d BUILDDIR && cd BUILDDIR
 
@@ -102,15 +101,40 @@
 	--disable-libssp \
 	--with-pkgversion="PLD-Linux" \
 	--with-bugurl="http://bugs.pld-linux.org" \
+	--build=%{_target_platform} \
+	--host=%{_target_platform} \
 	--target=%{target}
 
-%{__make} all
+%{__make} all-gcc -j2
+%{__make} all-target-libgcc
+
+cd ..
+
+cat <<EOF >cross-gcc
+#!/bin/sh
+p=`pwd`/BUILDDIR/gcc
+\${p}/xgcc -B\${p} \$@
+EOF
+chmod 755 cross-gcc
+
+export CC=`pwd`/cross-gcc
+
+cd trunk/mingw-w64-crt
+
+./configure \
+	--host=%{target} \
+	--prefix=%{_prefix} \
+	--with-sysroot=$build_sysroot \
+
+%{__make}
+
+cd -
 
 %install
-build_sysroot=`pwd`/winsup/trunk
+build_sysroot=`pwd`/winsup
 
 rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT{%{_bindir},%{_datadir},%{arch}/mingw}
+install -d $RPM_BUILD_ROOT{%{_bindir},%{_datadir},%{arch}/mingw/include}
 
 cd BUILDDIR
 
@@ -121,20 +145,26 @@
 
 cd ..
 
-rm $RPM_BUILD_ROOT%{_libdir}/libiberty.a
-
 gccdir=$RPM_BUILD_ROOT%{gcclib}
 mv $gccdir/include-fixed/{limits,syslimits}.h $gccdir/include
 rm -r $gccdir/include-fixed
 rm -r $gccdir/install-tools
 
+
+cp -ar $build_sysroot/mingw/include $RPM_BUILD_ROOT%{arch}
+
+make -C trunk/mingw-w64-crt install \
+	DESTDIR=$RPM_BUILD_ROOT
+
+mv $RPM_BUILD_ROOT%{_prefix}/x86_64-pc-mingw32/lib \
+	$RPM_BUILD_ROOT%{arch}
+
 %if 0%{!?debug:1}
 %{target}-strip -g -R.note -R.comment $RPM_BUILD_ROOT%{gcclib}/libgcc.a
 %{target}-strip -g -R.note -R.comment $RPM_BUILD_ROOT%{gcclib}/libgcov.a
+%{target}-strip -g -R.note -R.comment $RPM_BUILD_ROOT%{arch}/lib/*.{a,o}
 %endif
 
-cp -ar $build_sysroot/mingw-w64-headers/include $RPM_BUILD_ROOT%{arch}/mingw
-
 %clean
 rm -rf $RPM_BUILD_ROOT
 
@@ -178,6 +208,9 @@
 %{_mandir}/man1/%{target}-cpp.1*
 %{_mandir}/man1/%{target}-gcc.1*
 %{_mandir}/man1/%{target}-gcov.1*
+%{arch}/include
+%{arch}/lib/*.a
+%{arch}/lib/*.o
 %dir %{arch}/mingw
 %{arch}/mingw/include
 
@@ -201,6 +234,9 @@
 All persons listed below can be reached at <cvs_login>@pld-linux.org
 
 $Log$
+Revision 1.4  2008/07/03 11:02:52  pluto
+- build'n'install crt.
+
 Revision 1.3  2008/07/02 14:47:10  pluto
 - install mingw includes, cleanups.
 
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/SPECS/crossmingw64-gcc.spec?r1=1.3&r2=1.4&f=u



More information about the pld-cvs-commit mailing list