123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- #!/bin/bash
- [% c("var/set_default_env") -%]
- distdir=/var/tmp/dist/[% project %]
- mkdir /var/tmp/build
- mkdir /var/tmp/dist
- cd /var/tmp/dist
- tar xf $rootdir/[% c('input_files_by_name/binutils') %]
- mv binutils $distdir
- export PATH="$distdir/bin:$PATH"
- cd /var/tmp/build
- tar xf $rootdir/[% project %]-[% c("version") %].tar.gz
- mkdir -p builddir/mingw-w64/mingw-w64-headers32
- cd builddir/mingw-w64/mingw-w64-headers32
- /var/tmp/build/[% project %]-[% c("version") %]/mingw-w64-headers/configure \
- --prefix=$distdir/[% c("arch") %]-w64-mingw32 --host=[% c("arch") %]-w64-mingw32 \
- --enable-sdk=all --enable-secure-api --enable-idl
- make install
- cd /var/tmp/build
- mkdir gcc
- cd gcc
- tar xJf $rootdir/gcc-[% c("var/gcc_version") %].tar.xz
- # We don't want to link against msvcrt.dll due to bug 9084.
- [% c("arch") %]-w64-mingw32-g++ -dumpspecs > $distdir/msvcr100.spec
- sed 's/msvcrt/msvcr100/' -i $distdir/msvcr100.spec
- # Linking libgcc against msvcrt is hard-coded...
- sed 's/msvcrt/msvcr100/' -i gcc-[% c("var/gcc_version") %]/gcc/config/i386/t-mingw-w32
- # LDFLAGS_FOR_TARGET does not work for some reason. Thus, we take
- # CFLAGS_FOR_TARGET.
- export CFLAGS_FOR_TARGET="-specs=$distdir/msvcr100.spec -Wl,--nxcompat -Wl,--dynamicbase"
- gcc-[% c("var/gcc_version") %]/configure --prefix=$distdir --target=[% c("arch") %]-w64-mingw32 --disable-multilib --enable-languages=c,c++
- make -j[% c("buildconf/num_procs") %] all-gcc
- make install-gcc
- mkdir -p /var/tmp/build/builddir/mingw-w64/mingw-w64-crt32
- cd /var/tmp/build/builddir/mingw-w64/mingw-w64-crt32
- /var/tmp/build/[% project %]-[% c("version") %]/mingw-w64-crt/configure \
- --host=[% c("arch") %]-w64-mingw32 --prefix=$distdir/[% c("arch") %]-w64-mingw32
- make -j[% c("buildconf/num_procs") %]
- make install
- mkdir -p /var/tmp/build/builddir/mingw-w64/widl32
- cd /var/tmp/build/builddir/mingw-w64/widl32
- /var/tmp/build/[% project %]-[% c("version") %]/mingw-w64-tools/widl/configure \
- --prefix=$distdir --target=[% c("arch") %]-w64-mingw32
- make -j[% c("buildconf/num_procs") %]
- make install
- cd /var/tmp/build/gcc
- make -j[% c("buildconf/num_procs") %]
- make install
- mkdir -p $distdir/gcclibs
- cp [% c("arch") %]-w64-mingw32/libssp/.libs/libssp-0.dll $distdir/gcclibs
- cp [% c("arch") %]-w64-mingw32/libgcc/shlib/[% c("var/libgcc_dll") %] $distdir/gcclibs
- cd /var/tmp/dist
- [% c('tar', {
- tar_src => [ project ],
- tar_args => '-czf ' _ dest_dir _ '/' _ c('filename'),
- }) %]
|