-Summary: Mingw32 GNU Binary Utility Development Utilities - gcc
+%bcond_with bootstrap
+%define DASHED_SNAP %{nil}
+%define SNAP %(echo %{DASHED_SNAP} | sed -e "s#-##g")
+%define GCC_VERSION 3.4.1
+%define apiver 2.5
+%define apisrc w32api-%{apiver}
+%define runver 3.3
+%define runsrc mingw-runtime-%{runver}
+Summary: Cross Mingw32 GNU binary utility development utilities - gcc
+Summary(es): Utilitarios para desarrollo de binarios de la GNU - Mingw32 gcc
+Summary(fr): Utilitaires de développement binaire de GNU - Mingw32 gcc
+Summary(pl): Skro¶ne narzêdzia programistyczne GNU dla Mingw32 - gcc
+Summary(pt_BR): Utilitários para desenvolvimento de binários da GNU - Mingw32 gcc
+Summary(tr): GNU geliþtirme araçlarý - Mingw32 gcc
Name: crossmingw32-gcc
-# sources version is 2.95.2 but patched binaries use 2.95.3 in gcc-lib directory...
-%define gccpreversion 2.95.3
-%define gccversion 2.95.2
-%define version 990111
-Version: %{version}
-Release: 3
+Version: %{GCC_VERSION}
+Release: 1
+Epoch: 1
License: GPL
-Group: Development/Tools
-Group(pl): Programowanie/Narzêdzia
-ExclusiveArch: %{ix86}
-Source0: ftp://ftp.gnu.org/pub/gnu/gcc-%{gccversion}.tar.gz
-Patch0: gcc-info.patch
-#Patch1: gcc-libgcj-config.patch
-Patch2: gcc-pld-linux.patch
-Patch3: gcc-libstdc++.patch
-Patch4: gcc-bootstrap.patch
-Patch5: gcc-cpp-macro-doc.patch
-Patch6: gcc-default-arch.patch
-Patch7: gcc-cvs-updates.patch
-Patch8: gcc-alpha-ev5-fix.patch
-Patch9: gcc-libstdc++-out-of-mem.patch
-Patch10: gcc-libstdc++-valarray.patch
-Patch11: gcc-libstdc++-wstring.patch
-Patch12: gcc-libstdc++-wall3.patch
-Patch13: gcc-libstdc++-bastring.patch
-Patch14: gcc-manpage.patch
-Patch15: gcc-cpp-dos-newlines.patch
-Patch16: gcc-g++-is-tree.patch
-Patch17: gcc-gpc.patch
-Patch18: gcc-arm-config.patch
-Patch19: gcc-m68k-pic.patch
-Patch20: gcc-sparc32-rfi.patch
-Patch21: gcc-builtin-apply.patch
-Patch22: gcc-ppc-ice.patch
-Patch23: gcc-ppc-descriptions.patch
-Patch24: gcc-ppc-andrew-dwarf-eh.patch
-Patch25: %{name}-libio.patch
-Patch26: %{name}-includes.patch
-Patch27: %{name}-libiberty.diff
-BuildRequires: crossmingw32-platform
-BuildRequires: crossmingw32-binutils
-BuildRequires: flex
-BuildRequires: bison
+Group: Development/Languages
+Source0: ftp://gcc.gnu.org/pub/gcc/releases/gcc-%{GCC_VERSION}/gcc-%{GCC_VERSION}.tar.bz2
+# Source0-md5: 31b459062499f9f68d451db9cbf3205c
+Source1: http://dl.sourceforge.net/mingw/%{apisrc}.tar.gz
+# Source1-md5: be74d8925d1e273336ecb0d9225867f1
+Source2: http://dl.sourceforge.net/mingw/%{runsrc}.tar.gz
+# Source2-md5: 49c4a72951cb34c86b7583970dc058e9
+Patch0: gcc-nodebug.patch
+Patch1: %{name}-noioctl.patch
BuildRequires: autoconf
-Requires: crossmingw32-binutils
-Requires: crossmingw32-platform
+BuildRequires: automake
+BuildRequires: bison
+BuildRequires: crossmingw32-binutils >= 2.14.90.0.4.1-2
+BuildRequires: flex
+%if %{without bootstrap}
+BuildRequires: crossmingw32-runtime >= 3.3
+BuildRequires: crossmingw32-w32api >= 2.5
+%endif
+Requires: crossmingw32-binutils >= 2.14.90.0.4.1-2
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
-%define target i386-mingw32
-%define target_platform i386-pc-mingw32
-%define _prefix /usr
-%define arch %{_prefix}/%{target}
-%define gcclib %{_prefix}/lib/gcc-lib/%{target}/%{gccpreversion}
-%define gccarch %{_prefix}/lib/gcc-lib/%{target}
+%define no_install_post_strip 1
+
+%define target i386-mingw32
+%define target_platform i386-pc-mingw32
+%define arch %{_prefix}/%{target}
+%define gccarch %{_libdir}/gcc/%{target}
+%define gcclib %{_libdir}/gcc/%{target}/%{version}
%description
crossmingw32 is a complete cross-compiling development system for
and objc, and libstdc++, all cross targeted to i386-mingw32, along
with supporting Win32 libraries in 'coff' format from free sources.
-This package contains cross targeted gcc, g++, objc and libstdc++.
+This package contains cross targeted gcc.
-%prep
+%description -l de
+Dieses Paket enthält einen Cross-gcc, der es erlaubt, auf einem
+i386-Rechner Code für Win32 zu generieren.
+
+%description -l pl
+crossmingw32 jest kompletnym systemem do kompilacji skro¶nej,
+pozwalaj±cym budowaæ aplikacje MS Windows pod Linuksem u¿ywaj±c
+bibliotek Mingw32. System sk³ada siê z binutils, gcc z g++ i objc,
+libstdc++ - wszystkie generuj±ce kod dla platformy i386-mingw32, oraz
+z bibliotek w formacie COFF.
+
+Ten pakiet zawiera gcc generuj±ce skro¶nie kod dla Win32.
+
+%package c++
+Summary: Mingw32 binary utility development utilities - g++
+Summary(pl): Zestaw narzêdzi mingw32 - g++
+Group: Development/Languages
+Requires: %{name} = %{epoch}:%{version}
+
+%description c++
+crossmingw32 is a complete cross-compiling development system for
+building stand-alone Microsoft Windows applications under Linux using
+the Mingw32 build libraries. This includes a binutils, gcc with g++
+and objc, and libstdc++, all cross targeted to i386-mingw32, along
+with supporting Win32 libraries in 'coff' format from free sources.
+
+This package contains cross targeted g++ and (static) libstdc++.
+
+%description c++ -l pl
+crossmingw32 jest kompletnym systemem do kompilacji skro¶nej,
+pozwalaj±cym budowaæ aplikacje MS Windows pod Linuksem u¿ywaj±c
+bibliotek mingw32. System sk³ada siê z binutils, gcc z g++ i objc,
+libstdc++ - wszystkie generuj±ce kod dla platformy i386-mingw32, oraz
+z bibliotek w formacie COFF.
+
+Ten pakiet zawiera g++ generuj±ce kod pod Win32 oraz bibliotekê
+libstdc++.
+
+# does this even work?
+%package objc
+Summary: Mingw32 binary utility development utilities - objc
+Summary(pl): Zestaw narzêdzi mingw32 - objc
+Group: Development/Languages
+Requires: %{name} = %{epoch}:%{version}
+
+%description objc
+crossmingw32 is a complete cross-compiling development system for
+building stand-alone Microsoft Windows applications under Linux using
+the Mingw32 build libraries. This includes a binutils, gcc with g++
+and objc, and libstdc++, all cross targeted to i386-mingw32, along
+with supporting Win32 libraries in 'coff' format from free sources.
+
+This package contains cross targeted objc.
+
+%description objc -l pl
+crossmingw32 jest kompletnym systemem do kompilacji skro¶nej,
+pozwalaj±cym budowaæ aplikacje MS Windows pod Linuksem u¿ywaj±c
+bibliotek mingw32. System sk³ada siê z binutils, gcc z g++ i objc,
+libstdc++ - wszystkie generuj±ce kod dla platformy i386-mingw32, oraz
+z bibliotek w formacie COFF.
+
+Ten pakiet zawiera kompilator objc generuj±cy kod pod Win32.
+
+# does this even work?
+%package g77
+Summary: Mingw32 binary utility development utilities - g77
+Summary(pl): Zestaw narzêdzi mingw32 - g77
+Group: Development/Languages
+Requires: %{name} = %{epoch}:%{version}
+
+%description g77
+crossmingw32 is a complete cross-compiling development system for
+building stand-alone Microsoft Windows applications under Linux using
+the Mingw32 build libraries. This includes a binutils, gcc with g++
+and objc, and libstdc++, all cross targeted to i386-mingw32, along
+with supporting Win32 libraries in 'coff' format from free sources.
+
+This package contains cross targeted g77.
+
+%description g77 -l pl
+crossmingw32 jest kompletnym systemem do kompilacji skro¶nej,
+pozwalaj±cym budowaæ aplikacje MS Windows pod Linuksem u¿ywaj±c
+bibliotek mingw32. System sk³ada siê z binutils, gcc z g++ i objc,
+libstdc++ - wszystkie generuj±ce kod dla platformy i386-mingw32, oraz
+z bibliotek w formacie COFF.
+
+Ten pakiet zawiera g77 generuj±cy kod pod Win32.
+
+# does this even work?
+%package java
+Summary: Mingw32 binary utility development utilities - java
+Summary(pl): Zestaw narzêdzi mingw32 - java
+Group: Development/Languages
+Requires: %{name} = %{epoch}:%{version}
+
+%description java
+crossmingw32 is a complete cross-compiling development system for
+building stand-alone Microsoft Windows applications under Linux using
+the Mingw32 build libraries. This includes a binutils, gcc with g++
+and objc, and libstdc++, all cross targeted to i386-mingw32, along
+with supporting Win32 libraries in 'coff' format from free sources.
+
+This package contains cross targeted java.
+
+%description java -l pl
-%setup -q -T -c -a0
-(cd gcc-%{gccversion}
-%patch0 -p1
-#%patch1 -p1
-%patch2 -p1
-%patch3 -p1
-%patch4 -p1
-%patch5 -p0
-%patch6 -p0
-%patch7 -p1
-%patch8 -p0
-%patch9 -p0
-%patch10 -p0
-%patch11 -p0
-%patch12 -p0
-%patch13 -p0
-%patch14 -p0
-%patch15 -p0
-%patch16 -p1
-%patch17 -p1
-%patch18 -p0
-%patch19 -p0
-%patch20 -p0
-%patch21 -p0
-%patch22 -p0
-%patch23 -p0
-%patch24 -p0
-
-%patch25 -p1
-%patch26 -p1
-)
-
-# libstdc++ - libiberty patch
-(cd gcc-%{gccversion}
-%patch27 -p1
-cd libiberty
-autoconf
-)
+crossmingw32 jest kompletnym systemem do kompilacji skro¶nej,
+pozwalaj±cym budowaæ aplikacje MS Windows pod Linuksem u¿ywaj±c
+bibliotek mingw32. System sk³ada siê z binutils, gcc z g++ i objc,
+libstdc++ - wszystkie generuj±ce kod dla platformy i386-mingw32, oraz
+z bibliotek w formacie COFF.
+
+Ten pakiet zawiera kompilator Javy generuj±cy kod pod Win32.
+
+%prep
+%setup -q -c
+cd gcc-%{version}
+%if %{with bootstrap}
+mkdir winsup
+tar xzf %{SOURCE1} -C winsup
+tar xzf %{SOURCE2} -C winsup
+%endif
+%{!?debug:%patch0 -p1}
+%patch1 -p1
%build
+cd gcc-%{version}
+%if %{with bootstrap}
+for tool in as ar dlltool ld nm ranlib strip ; do
+ ln -sf %{arch}/bin/$tool winsup/bin/$tool
+done
+build_tooldir=`pwd`/winsup
+%else
+build_tooldir=%{arch}
+%endif
-(cd gcc-%{gccversion}/gcc
-autoconf
-cd ..
-rm -rf obj-%{target_platform}
-install -d obj-%{target_platform}
-cd obj-%{target_platform}
+cp /usr/share/automake/config.sub .
+cp /usr/share/automake/config.sub boehm-gc
-%{!?debug:CFLAGS="$RPM_OPT_FLAGS" CXXFLAGS="$RPM_OPT_FLAGS" LDFLAGS="-s"} \
-%{?debug:CFLAGS="-g -O" CXXFLAGS="-g -O" LDFLAGS=""} \
+rm -rf obj-%{target_platform} && install -d obj-%{target_platform} && cd obj-%{target_platform}
+
+# note: alpha's -mieee and sparc's -mtune=* are not valid for target's g++
+CFLAGS="%{rpmcflags}" \
+%ifarch alpha
+CXXFLAGS="`echo '%{rpmcflags}' | sed -e 's/ \?-mieee\>//'`" \
+%else
+%ifarch sparc sparc64 sparcv9
+CXXFLAGS="`echo '%{rpmcflags}' | sed -e 's/ \?-mtune[=0-9a-z]*//'`" \
+%else
+CXXFLAGS="%{rpmcflags}" \
+%endif
+%endif
+LDFLAGS="%{rpmldflags}" \
+TEXCONFIG=false \
../configure \
--prefix=%{_prefix} \
--infodir=%{_infodir} \
--mandir=%{_mandir} \
--bindir=%{arch}/bin \
+ --libdir=%{_libdir} \
+ --libexecdir=%{_libexecdir} \
+ --includedir=%{arch}/include \
+ --enable-languages="c,c++,f77,java,objc" \
--with-gnu-as \
--with-gnu-ld \
--with-gxx-include-dir=%{arch}/include/g++ \
+ --enable-threads \
+ --build=%{_target_platform} \
+ --host=%{_target_platform} \
--target=%{target}
-# to nie dzia³a bo kto¶ ukrad³ gthr-win32.h i nie wiem co tam wpisaæ
-# --enable-threads \
-
-touch ../gcc/c-gperf.h
+#touch ../gcc/c-gperf.h
%{__make} \
- %{!?debug:LDFLAGS_FOR_TARGET="-s"}%{?debug:LDFLAGS_FOR_TARGET=""} \
- TARGET_LIBGCC2_CFLAGS="-UCROSS_COMPILE"
+ LDFLAGS_FOR_TARGET="%{rpmldflags}" \
+ TARGET_LIBGCC2_CFLAGS="-UCROSS_COMPILE" \
+ build_tooldir="$build_tooldir" \
+ FLAGS_FOR_TARGET="-B${build_tooldir}/bin -B${build_tooldir}/lib -isystem ${build_tooldir}/include -nostdinc" \
+ CFLAGS_FOR_TARGET="-nostdinc" \
+ NM_FOR_TARGET="%{target}-nm"
# build libobjc.dll for Objective C
-# to trzeba wywo³ywaæ z katalogu obj-%{target_platform}/%{target}/libobjc
-# ale trzeba podaæ jeszcze GCC_FOR_TARGET - a mi siê nie chce.
-# BTW, ten dll jest do czego¶ potrzebny???
+# it must be called from obj-%{target_platform}/%{target}/libobjc, but
+# GCC_FOR_TARGET must be passed
#
-#make \
-# LDFLAGS="-s" \
+#make -C %{target}/libobjc \
+# LDFLAGS="%{rpmldflags}" \
# TARGET_LIBGCC2_CFLAGS="-UCROSS_COMPILE" \
# DLLTOOL="%{target}-dlltool --as=%{target}-as" libobjc.dll
# spec files for msvcrt*.dll configurations
-
cd gcc
for n in msvcrt msvcrt20 msvcrt40; do
sed "s/crtdll/$n/g" <specs | sed "s/crt1/crt2/g" >specs.$n
done
-)
%install
-
rm -rf $RPM_BUILD_ROOT
+cd gcc-%{version}
install -d $RPM_BUILD_ROOT%{_bindir}
install -d $RPM_BUILD_ROOT%{_datadir}
-(cd gcc-%{gccversion}/obj-%{target_platform}
+cd obj-%{target_platform}
%{__make} install \
- prefix=$RPM_BUILD_ROOT%{_prefix} \
- bindir=$RPM_BUILD_ROOT%{arch}/bin \
- mandir=$RPM_BUILD_ROOT%{_mandir} \
- infodir=$RPM_BUILD_ROOT%{_infodir} \
- gxx_include_dir=$RPM_BUILD_ROOT%{arch}/include/g++
+ DESTDIR=$RPM_BUILD_ROOT
cd gcc
install specs.msvcrt specs.msvcrt20 specs.msvcrt40 $RPM_BUILD_ROOT%{gcclib}
-mv -f $RPM_BUILD_ROOT%{arch}/bin/%{target}-* $RPM_BUILD_ROOT%{_bindir}
+cd ../..
-# c++filt is provided by binutils...
-rm -f $RPM_BUILD_ROOT%{_bindir}/i386-mingw32-c++filt
+mv -f $RPM_BUILD_ROOT%{arch}/bin/%{target}-* $RPM_BUILD_ROOT%{_bindir}
-# what's this there for???
+# already in arch/lib, shouldn't be here
rm -f $RPM_BUILD_ROOT%{_libdir}/libiberty.a
-)
-
-# libstdc++ is now provided by gcc...
-
-#(cd gcc-%{gccversion}/libstdc++
-#mkdir %{target}
-#cd %{target}
-#CFLAGS="$RPM_OPT_FLAGS" CXXFLAGS="$RPM_OPT_FLAGS" ../configure \
-# --prefix=%{prefix} \
-# --target=%{target} \
-# --exec-prefix=%{arch} \
-# --with-gxx-include-dir=%{arch}/include/g++
-#
-#make
-#make install gxx_include_dir=$RPM_BUILD_ROOT%{arch}/include/g++
-#)
-# check if new rpm automation handles this properly:
-#gzip -9nf $RPM_BUILD_ROOT%{_mandir}/man1/%{target}-*
-#strip $RPM_BUILD_ROOT%{_bindir}/%{target}-* || :
-#strip $RPM_BUILD_ROOT%{gcclib}/{cc1,cc1chill,cc1obj,cc1plus,cpp,f771,jc1,jvgenmain}
+%if 0%{!?debug:1}
+# strip linux binaries
+strip -R .comment -R .note \
+ `echo $RPM_BUILD_ROOT{%{_bindir}/*,%{arch}/bin/*} | grep -v gccbug` \
+ $RPM_BUILD_ROOT%{gcclib}/{cc1*,f771,jc1,jvgenmain}
-%clean
+# strip mingw32 libraries
+%{target}-strip -g \
+ $RPM_BUILD_ROOT%{gcclib}/libgcc.a \
+ $RPM_BUILD_ROOT%{arch}/lib/lib*.a
+%endif
+
+# restore hardlinks
+ln -f $RPM_BUILD_ROOT%{_bindir}/%{target}-{g++,c++}
+ln -f $RPM_BUILD_ROOT%{arch}/bin/{g++,c++}
+# the same... make hardlink
+ln -f $RPM_BUILD_ROOT%{arch}/bin/gcc $RPM_BUILD_ROOT%{_bindir}/%{target}-gcc
+
+%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(644,root,root,755)
-%attr(755,root,root) %{_bindir}/%{target}-*
-%attr(755,root,root) %{arch}/bin/*
-%{arch}/include/*
-%{arch}/lib/*
+%attr(755,root,root) %{_bindir}/%{target}-gcc*
+%attr(755,root,root) %{_bindir}/%{target}-cpp
+%attr(755,root,root) %{_bindir}/%{target}-gcov
+%attr(755,root,root) %{arch}/bin/gcc
+%{arch}/lib/libiberty.a
+
%dir %{gccarch}
%dir %{gcclib}
-%{gcclib}/include
%attr(755,root,root) %{gcclib}/cc1
-%attr(755,root,root) %{gcclib}/cc1chill
-%attr(755,root,root) %{gcclib}/cc1obj
+%{gcclib}/libgcc.a
+%{gcclib}/libgcov.a
+%{gcclib}/specs*
+%{gcclib}/include
+
+%{_mandir}/man1/%{target}-cpp.1*
+%{_mandir}/man1/%{target}-gcc.1*
+%{_mandir}/man1/%{target}-gcov.1*
+
+%files c++
+%defattr(644,root,root,755)
+%attr(755,root,root) %{_bindir}/%{target}-[cg]++
+%attr(755,root,root) %{arch}/bin/[cg]++
%attr(755,root,root) %{gcclib}/cc1plus
-%attr(755,root,root) %{gcclib}/cpp
+%{arch}/lib/libstdc++.a
+%{arch}/lib/libstdc++.la
+%{arch}/lib/libsupc++.a
+%{arch}/lib/libsupc++.la
+%{arch}/include/g++
+%{_mandir}/man1/%{target}-g++.1*
+
+%files objc
+%defattr(644,root,root,755)
+%attr(755,root,root) %{gcclib}/cc1obj
+%{arch}/lib/libobjc.a
+%{arch}/lib/libobjc.la
+
+%files g77
+%defattr(644,root,root,755)
+%attr(755,root,root) %{_bindir}/%{target}-g77
%attr(755,root,root) %{gcclib}/f771
+%{arch}/lib/libfrtbegin.a
+%{arch}/lib/libg2c.a
+%{arch}/lib/libg2c.la
+%{_mandir}/man1/%{target}-g77.1*
+
+%files java
+%defattr(644,root,root,755)
+%attr(755,root,root) %{_bindir}/%{target}-gcj
+%attr(755,root,root) %{_bindir}/%{target}-gcjh
+%attr(755,root,root) %{_bindir}/%{target}-grepjar
+%attr(755,root,root) %{_bindir}/%{target}-jar
+%attr(755,root,root) %{_bindir}/%{target}-jcf-dump
+%attr(755,root,root) %{_bindir}/%{target}-jv-scan
+#%attr(755,root,root) %{arch}/bin/grepjar
+#%attr(755,root,root) %{arch}/bin/jar
%attr(755,root,root) %{gcclib}/jc1
%attr(755,root,root) %{gcclib}/jvgenmain
-%{gcclib}/SYSCALLS.c.X
-%{gcclib}/chillrt0.o
-%{gcclib}/libchill.a
-%{gcclib}/libgcc.a
-%{gcclib}/libobjc.a
-%{gcclib}/specs*
-%{_mandir}/man1/%{target}-*
+%{_mandir}/man1/%{target}-gcj.1*
+%{_mandir}/man1/%{target}-gcjh.1*
+%{_mandir}/man1/%{target}-grepjar.1*
+%{_mandir}/man1/%{target}-jar.1*
+%{_mandir}/man1/%{target}-jcf-dump.1*
+%{_mandir}/man1/%{target}-jv-scan.1*