summaryrefslogtreecommitdiffstats
path: root/contrib/cygwin/i686-pc-cygwin-gcc.spec.in
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/cygwin/i686-pc-cygwin-gcc.spec.in')
-rw-r--r--contrib/cygwin/i686-pc-cygwin-gcc.spec.in126
1 files changed, 126 insertions, 0 deletions
diff --git a/contrib/cygwin/i686-pc-cygwin-gcc.spec.in b/contrib/cygwin/i686-pc-cygwin-gcc.spec.in
new file mode 100644
index 0000000000..82eb6e4076
--- /dev/null
+++ b/contrib/cygwin/i686-pc-cygwin-gcc.spec.in
@@ -0,0 +1,126 @@
+#
+# spec file for building gcc for cygwin
+#
+
+%define gcc_pkgvers @GCC_VERS@
+%define gcc_version %{expand:%%(echo "@GCC_VERS@" | sed -e 's,-.*,,')}
+%define gcc_rpmvers %{expand:%%(echo "@GCC_VERS@" | tr - _ )}
+
+# RH's brp-strip* scripts are not able to handle foreign binaries
+# Switch of all stripping
+%define __os_install_post /usr/lib/rpm/redhat/brp-compress
+
+Distribution: Linux
+Name: i686-pc-cygwin-gcc
+Summary: i686-pc-cygwin gcc.
+
+Group: Cygwin
+Release: @GCC_RPMREL@
+License: GPL
+Version: %gcc_rpmvers
+
+Source0: ftp://cygwin.com/pub/cygwin/release/gcc/gcc-core/gcc-core-%{gcc_pkgvers}-src.tar.bz2
+Source1: ftp://cygwin.com/pub/cygwin/release/gcc/gcc-g++/gcc-g++-%{gcc_pkgvers}-src.tar.bz2
+Source2: ftp://cygwin.com/pub/cygwin/release/gcc/gcc-ada/gcc-ada-%{gcc_pkgvers}-src.tar.bz2
+NoSource: 0
+NoSource: 1
+NoSource: 2
+
+BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
+
+BuildRequires: i686-pc-cygwin-binutils
+BuildRequires: i686-pc-cygwin-libs
+BuildRequires: i686-pc-cygwin-w32api-libs
+BuildRequires: zlib-devel
+
+Requires: i686-pc-cygwin-binutils
+Requires: i686-pc-cygwin-libs
+Requires: i686-pc-cygwin-w32api-libs
+
+Provides: i686-pc-cygwin-c++
+
+%description
+Cross gcc for target cygwin
+
+%prep
+# untar the sources inside i686-pc-cygwin-gcc
+%setup -c -n %{name} -a 0 -a 1 -a 2
+# Cygwin's packaging sucks ;)
+ tar xjvf gcc-core-%{gcc_version}.tar.bz2
+ tar xjvf gcc-g++-%{gcc_version}.tar.bz2
+ tar xjvf gcc-ada-%{gcc_version}.tar.bz2
+ pushd gcc-%{gcc_version} > /dev/null
+ patch -p1 -f < ../gcc-%{gcc_pkgvers}.patch || true
+ popd > /dev/null
+ test -d build || mkdir build
+
+%build
+# touch gcc-%{gcc_version}/gcc/ada/treeprs.ads
+# touch gcc-%{gcc_version}/gcc/ada/[es]info.h
+# touch gcc-%{gcc_version}/gcc/ada/nmake.ad[bs]
+
+ pushd build > /dev/null
+
+ ../gcc-%{gcc_version}/configure --target=i686-pc-cygwin \
+ --with-gnu-as --with-gnu-ld --verbose \
+ --with-system-zlib \
+ --disable-nls --without-included-gettext \
+ --disable-win32-registry \
+ --enable-version-specific-runtime-libs \
+ --enable-languages=c,c++ \
+ --prefix=%{_prefix} --mandir=%{_mandir} --infodir=%{_infodir} \
+ --bindir=%{_bindir} --libdir=%{_libdir} --includedir=%{_includedir} \
+ --datadir=%{_datadir}
+
+# This would require write access to %{_prefix}/i686-pc-cygwin
+# --with-headers=%{_prefix}/i686-pc-cygwin/sys-root/usr/include \
+# --with-libs=%{_prefix}/i686-pc-cygwin/sys-root/usr/lib
+
+# Doesn't work with gcc-3.3.1-1
+# --with-sysroot=%{_prefix}/i686-pc-cygwin/sys-root
+
+ make all
+
+# Building with an external libc -> the nominal way to building gnat works!
+# make -C gcc cross-gnattools
+# make -C gcc ada.all.cross
+# make -C gcc gnatlib
+ popd > /dev/null
+
+%install
+ rm -rf $RPM_BUILD_ROOT
+
+ pushd build > /dev/null
+ make DESTDIR=$RPM_BUILD_ROOT install
+ # cd back to build/
+ popd > /dev/null
+
+ # We don't want info files
+ rm -rf $RPM_BUILD_ROOT%{_infodir}
+
+ # libiberty comes from cygwin-libs
+ rm -f $RPM_BUILD_ROOT%{_prefix}/i686-pc-cygwin/lib/libiberty.a
+ rm -f $RPM_BUILD_ROOT%{_prefix}/lib/libiberty.a
+
+ # GCC ships broken *.la's
+ find $RPM_BUILD_ROOT%{_prefix} -name '*.la' -exec rm -f {} \;
+
+ # Not required for cygwin
+ rm -rf $RPM_BUILD_ROOT%{_prefix}/lib/gcc-lib/i686-pc-cygwin/*/install-tools
+
+ # These conflict with the native gcc's man pages
+ rm -rf $RPM_BUILD_ROOT%{_mandir}/man7
+ rm -f $RPM_BUILD_ROOT%{_mandir}/man1/cpp.*
+ rm -f $RPM_BUILD_ROOT%{_mandir}/man1/gcov.*
+
+%clean
+ rm -rf $RPM_BUILD_ROOT
+
+%files
+%defattr(-,root,root,-)
+%{_bindir}/*
+%{_prefix}/lib/gcc-lib
+%{_mandir}/man1/i686-pc-cygwin*.1*
+
+# Conflicts with native gcc
+# %{_datadir}/locale/*/LC_MESSAGES/*.mo