blob: 82eb6e4076ed4488cb96ee65a3f6b451aa7dffea (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
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
|