# Paths.
%_mingw64_sysroot %{_prefix}/%{_mingw64_target}/sys-root
%_mingw64_prefix %{_mingw64_sysroot}
-%_mingw64_exec_prefix %{_mingw64_prefix}/%{_mingw64_target}
+%_mingw64_exec_prefix %{_mingw64_prefix}
%_mingw64_bindir %{_mingw64_exec_prefix}/bin
%_mingw64_sbindir %{_mingw64_exec_prefix}/sbin
%_mingw64_libexecdir %{_mingw64_exec_prefix}/libexec
%_mingw64_sysconfdir %{_mingw64_prefix}/etc
%_mingw64_sharedstatedir %{_mingw64_prefix}/com
%_mingw64_localstatedir %{_mingw64_prefix}/var
-
-# XXX Not sure which of these is correct ...
-#%_mingw64_includedir %{_mingw64_prefix}/include
-%_mingw64_includedir %{_mingw64_exec_prefix}/include
+%_mingw64_includedir %{_mingw64_prefix}/include
# Build macros.
%_mingw64_host %{_mingw64_target}
%define debug_package %{nil}
Name: mingw64-filesystem
-Version: 6
+Version: 10
Release: 1%{?dist}
Summary: MinGW base filesystem and environment
mkdir -p $RPM_BUILD_ROOT%{_prefix}/x86_64-pc-mingw32
-# GCC requires these directories, even though they contain links
-# to binaries which are also installed in /usr/bin etc. These
-# contain Fedora native binaries.
+# These directories are used by GCC for cross-compilation.
+# NOTE different contents from mingw32.
mkdir -p $RPM_BUILD_ROOT%{_prefix}/x86_64-pc-mingw32/bin
mkdir -p $RPM_BUILD_ROOT%{_prefix}/x86_64-pc-mingw32/lib
# The system root which will contain Windows native binaries
# and Windows-specific header files, pkgconfig, etc.
# NOTE different from mingw32.
-mkdir -p $RPM_BUILD_ROOT%{_prefix}/x86_64-pc-mingw32/sys-root/x86_64-pc-mingw32
-mkdir -p $RPM_BUILD_ROOT%{_prefix}/x86_64-pc-mingw32/sys-root/x86_64-pc-mingw32/bin
-mkdir -p $RPM_BUILD_ROOT%{_prefix}/x86_64-pc-mingw32/sys-root/x86_64-pc-mingw32/include
-mkdir -p $RPM_BUILD_ROOT%{_prefix}/x86_64-pc-mingw32/sys-root/x86_64-pc-mingw32/include/sys
-mkdir -p $RPM_BUILD_ROOT%{_prefix}/x86_64-pc-mingw32/sys-root/x86_64-pc-mingw32/lib
-mkdir -p $RPM_BUILD_ROOT%{_prefix}/x86_64-pc-mingw32/sys-root/x86_64-pc-mingw32/lib/pkgconfig
+mkdir -p $RPM_BUILD_ROOT%{_prefix}/x86_64-pc-mingw32/sys-root
+mkdir -p $RPM_BUILD_ROOT%{_prefix}/x86_64-pc-mingw32/sys-root/bin
+mkdir -p $RPM_BUILD_ROOT%{_prefix}/x86_64-pc-mingw32/sys-root/include
+mkdir -p $RPM_BUILD_ROOT%{_prefix}/x86_64-pc-mingw32/sys-root/include/sys
+mkdir -p $RPM_BUILD_ROOT%{_prefix}/x86_64-pc-mingw32/sys-root/lib
+mkdir -p $RPM_BUILD_ROOT%{_prefix}/x86_64-pc-mingw32/sys-root/lib/pkgconfig
+
+# GCC wants to look in include64/ directory for some reason.
+pushd $RPM_BUILD_ROOT%{_prefix}/x86_64-pc-mingw32/sys-root
+ln -s include include64
+popd
# We don't normally package manual pages and info files, except
# where those are not supplied by a Fedora native package. So we
mkdir -p $RPM_BUILD_ROOT%{_prefix}/x86_64-pc-mingw32/sys-root/share/man/man{1,2,3,4,5,6,7,8,l,n}
mkdir -p $RPM_BUILD_ROOT%{_prefix}/x86_64-pc-mingw32/sys-root/share/aclocal
-
-# This is needed because of some problems with upstream gcc and
-# bad mingw32 patches.
pushd $RPM_BUILD_ROOT%{_prefix}/x86_64-pc-mingw32/sys-root
-ln -s x86_64-pc-mingw32 mingw
+ln -s . mingw
popd
+
# NB. NOT _libdir
mkdir -p $RPM_BUILD_ROOT/usr/lib/rpm
install -m 0755 mingw64-find-requires.sh $RPM_BUILD_ROOT/usr/lib/rpm
%changelog
-* Wed Feb 11 2009 Richard W.M. Jones <rjones@redhat.com> - 6-1
+* Wed Feb 11 2009 Richard W.M. Jones <rjones@redhat.com> - 10-1
- Start mingw64 development.
* Sun Feb 1 2009 Richard W.M. Jones <rjones@redhat.com> - 46-1
Name: mingw64-gcc
Version: 4.4.0
-Release: 0.20090206.6%{?dist}
+Release: 0.20090206.7%{?dist}
Summary: MinGW Windows cross-compiler (GCC) for C
License: GPLv2+
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: texinfo
-BuildRequires: mingw64-filesystem >= 6
+BuildRequires: mingw64-filesystem >= 10
BuildRequires: mingw64-binutils
BuildRequires: mingw64-headers
BuildRequires: mingw64-runtime
BuildRequires: libgomp
# NB: Explicit mingw64-filesystem dependency is REQUIRED here.
-Requires: mingw64-filesystem >= 6
+Requires: mingw64-filesystem >= 10
Requires: mingw64-binutils
Requires: mingw64-headers
Requires: mingw64-runtime
cd gcc-%{upstream_version}
mkdir -p build
-cd build
+pushd build
languages="c,c++"
CC="%{__cc} ${RPM_OPT_FLAGS}" \
-MINGW64_CFLAGS="%{_mingw64_cflags} -L%{_mingw64_libdir}" \
../configure \
--prefix=%{_prefix} \
--bindir=%{_bindir} \
--enable-languages="$languages" $optargs
make %{?_smp_mflags} all
+popd
%install
ln -sf ..%{_prefix}/bin/x86_64-pc-mingw32-cpp \
$RPM_BUILD_ROOT/lib/x86_64-pc-mingw32-cpp
+# This DLL should definitely not be in /usr/bin ...
+mkdir -p $RPM_BUILD_ROOT%{_mingw64_bindir}
+mv $RPM_BUILD_ROOT%{_bindir}/libgcc_s_sjlj-1.dll \
+ $RPM_BUILD_ROOT%{_mingw64_bindir}
+
+
%clean
rm -rf $RPM_BUILD_ROOT
%{_prefix}/x86_64-pc-mingw32/lib/libiberty.a
%dir %{_libdir}/gcc/x86_64-pc-mingw32
%dir %{_libdir}/gcc/x86_64-pc-mingw32/%{version}
-%{_libdir}/gcc/x86_64-pc-mingw32/%{version}/crtbegin.o
-%{_libdir}/gcc/x86_64-pc-mingw32/%{version}/crtend.o
%{_libdir}/gcc/x86_64-pc-mingw32/%{version}/crtfastmath.o
%{_libdir}/gcc/x86_64-pc-mingw32/%{version}/libgcc.a
+%{_libdir}/gcc/x86_64-pc-mingw32/%{version}/libgcc_eh.a
+%{_libdir}/gcc/x86_64-pc-mingw32/%{version}/libgcc_s.a
%{_libdir}/gcc/x86_64-pc-mingw32/%{version}/libgcov.a
%{_libdir}/gcc/x86_64-pc-mingw32/%{version}/libssp.a
+%{_libdir}/gcc/x86_64-pc-mingw32/%{version}/libssp.dll.a
%{_libdir}/gcc/x86_64-pc-mingw32/%{version}/libssp.la
%{_libdir}/gcc/x86_64-pc-mingw32/%{version}/libssp_nonshared.a
%{_libdir}/gcc/x86_64-pc-mingw32/%{version}/libssp_nonshared.la
%{_libdir}/gcc/x86_64-pc-mingw32/%{version}/include/ssp/*.h
%dir %{_libdir}/gcc/x86_64-pc-mingw32/%{version}/install-tools
%{_libdir}/gcc/x86_64-pc-mingw32/%{version}/install-tools/*
+%{_libdir}/gcc/x86_64-pc-mingw32/bin/libssp-0.dll
%dir %{_libexecdir}/gcc/x86_64-pc-mingw32/%{version}/install-tools
%{_libexecdir}/gcc/x86_64-pc-mingw32/%{version}/install-tools/*
%{_mandir}/man1/x86_64-pc-mingw32-gcc.1*
%{_mandir}/man1/x86_64-pc-mingw32-gcov.1*
+%{_mingw64_bindir}/libgcc_s_sjlj-1.dll
%files -n mingw64-cpp
%changelog
-* Wed Feb 11 2009 Richard W.M. Jones <rjones@redhat.com> - 4.4.0-0.20090206.6
+* Wed Feb 11 2009 Richard W.M. Jones <rjones@redhat.com> - 4.4.0-0.20090206.7
- Started mingw64 development.
* Mon Nov 24 2008 Richard W.M. Jones <rjones@redhat.com> - 4.3.2-12
%define svn_revision 607
Name: mingw64-headers
-Version: 0.1
-Release: 0.svn%{svn_revision}.6%{?dist}
+Version: 0.1
+Release: 0.svn%{svn_revision}.10%{?dist}
Summary: Win32 header files and stubs
License: Public Domain and LGPLv2+
BuildArch: noarch
-BuildRequires: mingw64-filesystem >= 6
+BuildRequires: mingw64-filesystem >= 10
-Requires: mingw64-filesystem >= 6
+Requires: mingw64-filesystem >= 10
%description
%install
rm -rf $RPM_BUILD_ROOT
-mkdir -p $RPM_BUILD_ROOT%{_mingw64_includedir}
+# This is different from mingw32. By default GCC 4.4 searches for
+# headers in these two directories:
+# /usr/x86_64-pc-mingw32/include
+# /usr/x86_64-pc-mingw32/sys-root/mingw/include64 (symlink to ./include)
-cp -a trunk/mingw-w64-headers/include/* $RPM_BUILD_ROOT%{_mingw64_includedir}/
-cp -a trunk/mingw-w64-headers/direct-x/include/* $RPM_BUILD_ROOT%{_mingw64_includedir}/
+mkdir -p $RPM_BUILD_ROOT%{_mingw64_includedir}
-# XXX We don't know why this is required, but gcc/cc1 fails
-# to find the header files without it.
-pushd $RPM_BUILD_ROOT%{_mingw64_exec_prefix}
-ln -s include include64
-popd
+cp -a trunk/mingw-w64-headers/include/* $RPM_BUILD_ROOT%{_mingw64_includedir}
+cp -a trunk/mingw-w64-headers/direct-x/include/* $RPM_BUILD_ROOT%{_mingw64_includedir}
%clean
%files
%defattr(-,root,root)
%{_mingw64_includedir}/*
-%{_mingw64_exec_prefix}/include64
%changelog
-* Wed Feb 11 2009 Richard W.M. Jones <rjones@redhat.com> - 0.1-0.svn607.6
+* Wed Feb 11 2009 Richard W.M. Jones <rjones@redhat.com> - 0.1-0.svn607.10
- Started mingw64 development.
* Mon Dec 15 2008 Richard W.M. Jones <rjones@redhat.com> - 3.13-1
Name: mingw64-runtime
Version: 0.1
-Release: 0.svn%{svn_revision}.1%{?dist}
+Release: 0.svn%{svn_revision}.3%{?dist}
Summary: MinGW Windows cross-compiler runtime
License: Public Domain
BuildArch: noarch
-BuildRequires: mingw64-filesystem >= 3
+BuildRequires: mingw64-filesystem >= 10
BuildRequires: mingw64-binutils
BuildRequires: mingw64-headers
BuildRequires: mingw64-gcc-bootstrap
%build
pushd trunk/mingw-w64-crt
-%{_mingw64_configure} --with-sysroot=%{_mingw64_prefix}
+%{_mingw64_configure} --with-sysroot=%{_mingw64_sysroot}
make %{?_smp_mflags}
popd
make DESTDIR=$RPM_BUILD_ROOT install
popd
+# The above installs in /usr/x86_64-pc-mingw32/sys-root/x86_64-pc-mingw32/lib
+# which is the wrong location. Move it to %{_mingw64_libdir}.
+mv $RPM_BUILD_ROOT%{_mingw64_sysroot}/%{_mingw64_target}/lib \
+ $RPM_BUILD_ROOT%{_mingw64_libdir}
+
+# However GCC when building looks in /usr/x86_64-pc-mingw32/lib for
+# libraries. Make symlinks so that this works.
+# XXX Hack - why is this needed?
+mkdir -p $RPM_BUILD_ROOT%{_prefix}/%{_mingw64_target}/lib
+pushd $RPM_BUILD_ROOT%{_prefix}/%{_mingw64_target}/lib
+for f in ../sys-root/lib/*.[ao]; do
+ ln -s $f
+done
+popd
+
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root)
%{_mingw64_libdir}/*
+%{_prefix}/%{_mingw64_target}/lib/*
%changelog
-* Wed Feb 11 2009 Richard W.M. Jones <rjones@redhat.com> - 0.1-0.svn607.1
+* Wed Feb 11 2009 Richard W.M. Jones <rjones@redhat.com> - 0.1-0.svn607.3
- Started mingw64 development.
* Tue Feb 10 2009 Richard W.M. Jones <rjones@redhat.com> - 3.15.2-1