Merge heads
[fedora-mingw.git] / gcc / mingw-gcc.spec
1 %define __os_install_post /usr/lib/rpm/brp-compress %{nil}
2
3 Name:           mingw-gcc
4 Version:        4.3.2
5 Release:        4%{?dist}
6 Summary:        MinGW Windows cross-compiler (GCC) for C
7
8 License:        GPLv2+
9 Group:          Development/Languages
10 URL:            http://www.mingw.org/
11 Source0:        ftp://ftp.gnu.org/gnu/gcc/gcc-%{version}/gcc-core-%{version}.tar.bz2
12 Source1:        ftp://ftp.gnu.org/gnu/gcc/gcc-%{version}/gcc-g++-%{version}.tar.bz2
13 Patch1:         %{name}-build.patch
14 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
15
16 BuildRequires:  texinfo
17 BuildRequires:  mingw-filesystem >= 2
18 BuildRequires:  mingw-binutils
19 BuildRequires:  mingw-runtime
20 BuildRequires:  mingw-w32api
21 BuildRequires:  gmp-devel
22 BuildRequires:  mpfr-devel
23 BuildRequires:  libgomp
24
25 Requires:       mingw-filesystem >= 2
26 Requires:       mingw-binutils
27 Requires:       mingw-runtime
28 Requires:       mingw-w32api
29 Requires:       mingw-cpp
30
31
32 %description
33 MinGW Windows cross-compiler (GCC) for C
34
35
36 %package -n mingw-cpp
37 Summary: MinGW Windows cross-C Preprocessor.
38 Group: Development/Languages
39
40 %description -n mingw-cpp
41 MinGW Windows cross-C Preprocessor
42
43
44 %package c++
45 Summary: MinGW Windows cross-compiler for C++
46 Group: Development/Languages
47
48 %description c++
49 MinGW Windows cross-compiler for C++
50
51
52 %prep
53 %setup -q -c
54 %setup -q -D -T -a1
55 %patch1 -p1
56
57 %build
58 cd gcc-%{version}
59
60 mkdir -p build
61 cd build
62
63 languages="c,c++"
64
65 CC="%{__cc} ${RPM_OPT_FLAGS}" \
66 ../configure \
67   --prefix=%{_prefix} \
68   --bindir=%{_bindir} \
69   --includedir=%{_includedir} \
70   --libdir=%{_libdir} \
71   --mandir=%{_mandir} \
72   --infodir=%{_infodir} \
73   --datadir=%{_datadir} \
74   --build=%_build --host=%_host \
75   --target=%{_mingw_target} \
76   --with-gnu-as --with-gnu-ld --verbose \
77   --without-newlib \
78   --disable-multilib \
79   --with-system-zlib \
80   --disable-nls --without-included-gettext \
81   --disable-win32-registry \
82   --enable-version-specific-runtime-libs \
83   --with-sysroot=%{_mingw_sysroot} \
84   --enable-languages="$languages" $optargs
85
86 make all
87
88
89 %install
90 rm -rf $RPM_BUILD_ROOT
91
92 cd gcc-%{version}
93 cd build
94 make DESTDIR=$RPM_BUILD_ROOT install
95
96 # These files conflict with existing installed files.
97 rm -rf $RPM_BUILD_ROOT%{_infodir}
98 rm -f $RPM_BUILD_ROOT%{_libdir}/libiberty*
99 rm -f $RPM_BUILD_ROOT%{_mandir}/man7/*
100
101 mkdir -p $RPM_BUILD_ROOT/lib
102 ln -sf ..%{_prefix}/bin/i686-pc-mingw-cpp \
103   $RPM_BUILD_ROOT/lib/i686-pc-mingw32-cpp
104
105 %clean
106 rm -rf $RPM_BUILD_ROOT
107
108
109 %files
110 %defattr(-,root,root)
111 %{_bindir}/i686-pc-mingw32-gcc
112 %{_bindir}/i686-pc-mingw32-gcc-%{version}
113 %{_bindir}/i686-pc-mingw32-gccbug
114 %{_bindir}/i686-pc-mingw32-gcov
115 %{_prefix}/i686-pc-mingw32/lib/libiberty.a
116 %dir %{_libdir}/gcc/i686-pc-mingw32
117 %dir %{_libdir}/gcc/i686-pc-mingw32/%{version}
118 %{_libdir}/gcc/i686-pc-mingw32/%{version}/crtbegin.o
119 %{_libdir}/gcc/i686-pc-mingw32/%{version}/crtend.o
120 %{_libdir}/gcc/i686-pc-mingw32/%{version}/crtfastmath.o
121 %{_libdir}/gcc/i686-pc-mingw32/%{version}/libgcc.a
122 %{_libdir}/gcc/i686-pc-mingw32/%{version}/libgcov.a
123 %{_libdir}/gcc/i686-pc-mingw32/%{version}/libssp.a
124 %{_libdir}/gcc/i686-pc-mingw32/%{version}/libssp.la
125 %{_libdir}/gcc/i686-pc-mingw32/%{version}/libssp_nonshared.a
126 %{_libdir}/gcc/i686-pc-mingw32/%{version}/libssp_nonshared.la
127 %dir %{_libdir}/gcc/i686-pc-mingw32/%{version}/include
128 %dir %{_libdir}/gcc/i686-pc-mingw32/%{version}/include-fixed
129 %dir %{_libdir}/gcc/i686-pc-mingw32/%{version}/include/ssp
130 %{_libdir}/gcc/i686-pc-mingw32/%{version}/include-fixed/README
131 %{_libdir}/gcc/i686-pc-mingw32/%{version}/include-fixed/*.h
132 %{_libdir}/gcc/i686-pc-mingw32/%{version}/include/*.h
133 %{_libdir}/gcc/i686-pc-mingw32/%{version}/include/ssp/*.h
134 %dir %{_libdir}/gcc/i686-pc-mingw32/%{version}/install-tools
135 %{_libdir}/gcc/i686-pc-mingw32/%{version}/install-tools/*
136 %dir %{_libexecdir}/gcc/i686-pc-mingw32/%{version}/install-tools
137 %{_libexecdir}/gcc/i686-pc-mingw32/%{version}/install-tools/*
138 %{_mandir}/man1/i686-pc-mingw32-gcc.1*
139 %{_mandir}/man1/i686-pc-mingw32-gcov.1*
140
141
142 %files -n mingw-cpp
143 %defattr(-,root,root)
144 /lib/i686-pc-mingw32-cpp
145 %{_bindir}/i686-pc-mingw32-cpp
146 %{_mandir}/man1/i686-pc-mingw32-cpp.1*
147 %dir %{_libdir}/gcc/i686-pc-mingw32
148 %dir %{_libdir}/gcc/i686-pc-mingw32/%{version}
149 %{_libexecdir}/gcc/i686-pc-mingw32/%{version}/cc1
150
151
152 %files c++
153 %defattr(-,root,root)
154 %{_bindir}/i686-pc-mingw32-g++
155 %{_bindir}/i686-pc-mingw32-c++
156 %{_mandir}/man1/i686-pc-mingw32-g++.1*
157 %{_libdir}/gcc/i686-pc-mingw32/%{version}/include/c++/
158 %{_libdir}/gcc/i686-pc-mingw32/%{version}/libstdc++.a
159 %{_libdir}/gcc/i686-pc-mingw32/%{version}/libstdc++.la
160 %{_libdir}/gcc/i686-pc-mingw32/%{version}/libsupc++.a
161 %{_libdir}/gcc/i686-pc-mingw32/%{version}/libsupc++.la
162 %{_libexecdir}/gcc/i686-pc-mingw32/%{version}/cc1plus
163 %{_libexecdir}/gcc/i686-pc-mingw32/%{version}/collect2
164
165
166 %changelog
167 * Thu Sep  4 2008 Richard W.M. Jones <rjones@redhat.com> - 4.3.1-4
168 - Use RPM macros from mingw-filesystem.
169
170 * Mon Jul  7 2008 Richard W.M. Jones <rjones@redhat.com> - 4.3.1-3
171 - Initial RPM release, largely based on earlier work from several sources.