English Portuguese (Brazil)
Win64 specific macros:
# Win64
%package -n mingw64-example
Summary: MinGW compiled example library for the Win64 target
# Win64
%files -n mingw64-example -f mingw64-example.lang
Win32 specific macros:
# Win32
%package -n mingw32-example
Summary: MinGW compiled example library for the Win32 target
# Win32
%files -n mingw32-example -f mingw32-example.lang
where `+foo.dll+` is the name of the DLL. The name must be converted to lowercase because Windows binaries contain case insensitive dependencies. The form 'mingw32(foo.dll)' should be used for Win32 binaries and the form 'mingw64(foo.dll)' for Win64 binaries.
When a package can only be built for either one of these targets this can be indicated by setting one of these:
`+/usr/i686-w64-mingw32+` + `+/usr/x86_64-w64-mingw32+` + `+  |+` + `+  +- bin  - Binutils toolchain binaries for the target+` + `+  |   |+` + `+  |   +- ar+` + `+  |   +- as+` + `+  |   +- dlltool+` + `+  |   +- ld+` + `+  |   +- ... etc ...+` + `+  |+` + `+  +- lib  - Binutils toolchain support libraries / files for the target+` + `+  |+` + `+  +- sys-root  - root for cross compiled MinGW binaries+` + `+      |+` + `+      +- mingw+` + `+          |+` + `+          +- bin     - cross-compiled MinGW binaries & runtime DLL parts+` + `+          +- etc     - configuration files+` + `+          +- include - include files for cross compiled MinGW libs+` + `+          +- lib     - cross-compiled static MinGW libraries & linktime DLL parts+` + `+          |   |+` + `+          |   +- pkgconfig  - pkg-config definitions for libraries+` + `+          |+` + `+          +- share+` + `+              |+` + `+              +- man+`
unless they contain Fedora native executables.
Track Fedora native package versions
Toolchain macros
To install the package the command `+make install DESTDIR=$RPM_BUILD_ROOT+` was used in almost all cases. This can be rewritten to `+%mingw_make install DESTDIR=$RPM_BUILD_ROOT+` to install the package for all configured targets The environment variable MINGW_BUILDDIR_SUFFIX can also be used here
This means that a spec file must contains %package and %files sections for all the targets.
This can be rewritten to something like this:
These macros use out of source compilation to build binaries for all the targets. Almost all packages support out of source compilation or require slight patching. The only known exceptions to date are zlib and openssl. Packages which don't support out of source compilation may require a different approach like performing everything in the %install phase. If you happen to stumble across a package which requires a different approach feel free to contact us on the Fedora MinGW mailing list
The same binaries are present in `+%{_prefix}/i686-w64-mingw32/bin+` without any prefix in the name, i.e.,
The same also applies for the x86_64 target. This target uses 'x86_64-w64-mingw32' as prefix instead of 'i686-w64-mingw32'
The root filesystem contains Windows executables and DLLs and any other Windows-only files. It is necessary both because we need to store Windows libraries in order to link further libraries which depend on them, and also because MinGW requires a root filesystem location.
The reason for this is that libtool is very fragile and will give up on building a DLL very easily. Therefore we force the name of the DLL to be listed explicitly in the `+%files+` section in order to catch this during RPM builds.