# # Conditional build: %bcond_with bootstrap # bootstrap build (using binary w32api/mingw) # Summary: Cross Mingw32 GNU binary utility development utilities - gcc Summary(es.UTF-8): Utilitarios para desarrollo de binarios de la GNU - Mingw32 gcc Summary(fr.UTF-8): Utilitaires de développement binaire de GNU - Mingw32 gcc Summary(pl.UTF-8): Skrośne narzędzia programistyczne GNU dla Mingw32 - gcc Summary(pt_BR.UTF-8): Utilitários para desenvolvimento de binários da GNU - Mingw32 gcc Summary(tr.UTF-8): GNU geliştirme araçları - Mingw32 gcc Name: crossmingw32-gcc Version: 4.1.1 Release: 2 Epoch: 1 License: GPL Group: Development/Languages Source0: ftp://gcc.gnu.org/pub/gcc/releases/gcc-%{version}/gcc-%{version}.tar.bz2 # Source0-md5: ad9f97a4d04982ccf4fd67cb464879f3 %define apiver 3.7 Source1: http://dl.sourceforge.net/mingw/w32api-%{apiver}.tar.gz # Source1-md5: 0b3a6d08136581c93b3a3207588acea9 %define runver 3.10 Source2: http://dl.sourceforge.net/mingw/mingw-runtime-%{runver}.tar.gz # Source2-md5: 7fa2638d23136fd84d5d627bef3b408a Patch0: gcc-nodebug.patch Patch1: %{name}-noioctl.patch BuildRequires: autoconf BuildRequires: automake BuildRequires: bison BuildRequires: crossmingw32-binutils >= 2.15.91.0.2-2 BuildRequires: flex %if !%{with bootstrap} BuildRequires: crossmingw32-runtime >= 3.5 BuildRequires: crossmingw32-w32api >= 3.1 %endif BuildRequires: mpfr-devel Requires: crossmingw32-binutils >= 2.15.91.0.2-2 Requires: gcc-dirs BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) %define target i386-mingw32 %define target_platform i386-pc-mingw32 %define arch %{_prefix}/%{target} %define gccarch %{_libdir}/gcc/%{target} %define gcclib %{gccarch}/%{version} %define _noautostrip .*/lib.*\\.a %description 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 gcc. %description -l de.UTF-8 Dieses Paket enthält einen Cross-gcc, der es erlaubt, auf einem anderem Rechner Code für Win32 zu generieren. %description -l pl.UTF-8 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.UTF-8): Zestaw narzędzi mingw32 - g++ Group: Development/Languages Requires: %{name} = %{epoch}:%{version}-%{release} %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.UTF-8 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.UTF-8): Zestaw narzędzi mingw32 - objc Group: Development/Languages Requires: %{name} = %{epoch}:%{version}-%{release} %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 compiler. %description objc -l pl.UTF-8 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 fortran Summary: Mingw32 binary utility development utilities - Fortran Summary(pl.UTF-8): Zestaw narzędzi mingw32 - Fortran Group: Development/Languages Requires: %{name} = %{epoch}:%{version}-%{release} Obsoletes: crossmingw32-gcc-g77 %description fortran 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 Fortran compiler. %description fortran -l pl.UTF-8 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 Fortranu generujący kod pod Win32. # does this even work? %package java Summary: Mingw32 binary utility development utilities - Java Summary(pl.UTF-8): Zestaw narzędzi mingw32 - Java Group: Development/Languages Requires: %{name} = %{epoch}:%{version}-%{release} %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 compiler. %description java -l pl.UTF-8 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 -n gcc-%{version} %if %{with bootstrap} mkdir winsup tar xzf %{SOURCE1} -C winsup tar xzf %{SOURCE2} -C winsup %endif #{!?debug:%patch0 -p1} %patch1 -p1 %build %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 cp /usr/share/automake/config.sub . cp /usr/share/automake/config.sub boehm-gc 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 \ --disable-shared \ --enable-threads \ --enable-languages="c,c++,fortran,java,objc" \ --enable-c99 \ --enable-long-long \ --disable-nls \ --with-gnu-as \ --with-gnu-ld \ --with-mangler-in-ld \ --with-gxx-include-dir=%{arch}/include/g++ \ --build=%{_target_platform} \ --host=%{_target_platform} \ --target=%{target} %{__make} all # spec files for msvcrt*.dll configurations cd gcc for n in msvcrt msvcrt20 msvcrt40; do sed "s/crtdll/$n/g" specs.$n done %install rm -rf $RPM_BUILD_ROOT install -d $RPM_BUILD_ROOT{%{_bindir},%{_datadir}} cd obj-%{target_platform} %{__make} install \ DESTDIR=$RPM_BUILD_ROOT cd gcc install specs.msvcrt specs.msvcrt20 specs.msvcrt40 $RPM_BUILD_ROOT%{gcclib} cd ../.. mv -f $RPM_BUILD_ROOT%{arch}/bin/%{target}-* $RPM_BUILD_ROOT%{_bindir} # already in arch/lib, shouldn't be here rm -f $RPM_BUILD_ROOT%{_libdir}/libiberty.a # include/ contains install-tools/include/* and headers that were fixed up # by fixincludes, we don't want former gccdir=$RPM_BUILD_ROOT%{gcclib} mkdir $gccdir/tmp # we have to save these however mv -f $gccdir/include/syslimits.h $gccdir/tmp rm -rf $gccdir/include mv -f $gccdir/tmp $gccdir/include cp -f $gccdir/install-tools/include/*.h $gccdir/include # but we don't want anything more from install-tools rm -rf $gccdir/install-tools %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/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}-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} %attr(755,root,root) %{gcclib}/cc1 %attr(755,root,root) %{gcclib}/collect2 %{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* %{arch}/lib/libssp.a %{arch}/lib/libssp.la %{arch}/lib/libssp_nonshared.a %{arch}/lib/libssp_nonshared.la %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 %{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 fortran %defattr(644,root,root,755) %attr(755,root,root) %{_bindir}/%{target}-gfortran %attr(755,root,root) %{arch}/bin/gfortran %attr(755,root,root) %{gcclib}/f951 %{arch}/lib/libgfortran.a %{arch}/lib/libgfortran.la %{arch}/lib/libgfortranbegin.a %{arch}/lib/libgfortranbegin.la %{_mandir}/man1/%{target}-gfortran.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}-gjnih %attr(755,root,root) %{_bindir}/%{target}-grepjar %attr(755,root,root) %{_bindir}/%{target}-fastjar %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 %{_mandir}/man1/%{target}-gcj.1* %{_mandir}/man1/%{target}-gcjh.1* %{_mandir}/man1/%{target}-gjnih.1* %{_mandir}/man1/%{target}-grepjar.1* %{_mandir}/man1/%{target}-fastjar.1* %{_mandir}/man1/%{target}-jcf-dump.1* %{_mandir}/man1/%{target}-jv-scan.1*