#!/bin/sh source `dirname $0`/incBLD.sh function step_a() { junction -d ${wrk_mingw_mnt} junction ${wrk_mingw_mnt} ${wrk_mingw_dir} junction -d ${new_mingw_mnt} junction ${new_mingw_mnt} ${new_mingw_dir} } function step_b() { # mingw-runtime rm -rf ${wrk_wrk}/mingw-rt/r32 mkdir -p ${wrk_wrk}/mingw-rt/r32 cd ${wrk_wrk}/mingw-rt/r32 CFLAGS="${c_c_opt32}" \ CPPFLAGS="${c_c_opt32}" \ CXXFLAGS="${c_c_opt32}" \ LDFLAGS="${c_l_opt}" \ ../src/winsup/mingw/configure \ --prefix=${c_prefix} \ --libdir=${c_libdir32} \ --includedir=${c_incdir32} make all install # w32api rm -rf ${wrk_wrk}/mingw-rt/w32 mkdir -p ${wrk_wrk}/mingw-rt/w32 cd ${wrk_wrk}/mingw-rt/w32 CFLAGS="${c_c_opt32}" \ CPPFLAGS="${c_c_opt32}" \ CXXFLAGS="${c_c_opt32}" \ LDFLAGS="${c_l_opt}" \ ../src/winsup/w32api/configure \ --prefix=${c_prefix} \ --libdir=${c_libdir32} \ --includedir=${c_incdir32} make all install # Stripping debug information # strip -p --strip-debug --strip-unneeded ${c_prefix}/bin/mingwm10.dll # for i in `ls ${c_libdir32}/*.o`; do strip -p --strip-debug "$i"; done # for i in `ls ${c_libdir32}/*.a`; do strip -p --strip-debug "$i"; done # cleanup cd ${wrk_wrk} rm -rf ${wrk_wrk}/mingw-rt/r32 rm -rf ${wrk_wrk}/mingw-rt/w32 } function step_c() { rm -rf ${wrk_wrk}/gmp-4.3.1/32 mkdir -p ${wrk_wrk}/gmp-4.3.1/32 cd ${wrk_wrk}/gmp-4.3.1/32 arch_generic="pentium3-pc-mingw32" arch_k8="athlon64-pc-mingw32" arch_core2="core2-pc-mingw32" arch_amdfam10="athlon64-pc-mingw32" arch_corei7="core2-pc-mingw32" bld_for=`eval "echo \\${arch_$k_arch_alias}"` ABI="32" \ CPPFLAGS="-fexceptions" \ ../src/configure \ --prefix=${c_prefix} \ --build=${bld_for} \ --libdir=${c_libdir32} \ --includedir=${c_incdir32} \ --disable-shared \ --enable-static \ --disable-debug \ --enable-cxx make -j8 all make install mv -f ${c_prefix}/include/* ${c_incdir32} rm -rf ${c_prefix}/include # echo "Stripping ${c_libdir32}/libgmp.a" # strip -p --strip-debug ${c_libdir32}/libgmp.a # echo "Stripping ${c_libdir32}/libgmpxx.a" # strip -p --strip-debug ${c_libdir32}/libgmpxx.a # cleanup cd ${wrk_wrk} rm -rf ${wrk_wrk}/gmp-4.3.1/32 } function step_d() { rm -rf ${wrk_wrk}/mpfr-2.4.1/32 mkdir -p ${wrk_wrk}/mpfr-2.4.1/32 cd ${wrk_wrk}/mpfr-2.4.1/32 ../src/configure \ --prefix=${c_prefix} \ --build=${c_arch32} \ --with-gmp=${c_prefix}/${c_arch32} \ --libdir=${c_libdir32} \ --includedir=${c_incdir32} \ --disable-shared \ --enable-static # --enable-thread-safe make -j8 all make install # echo "Stripping ${c_libdir32}/libmpfr.a" # strip -p --strip-debug ${c_libdir32}/libmpfr.a # cleanup cd ${wrk_wrk} rm -rf ${wrk_wrk}/mpfr-2.4.1/32 } function step_dd() { rm -rf ${wrk_wrk}/mpc-0.7/32 mkdir -p ${wrk_wrk}/mpc-0.7/32 cd ${wrk_wrk}/mpc-0.7/32 ../src/configure \ --prefix=${c_prefix} \ --libdir=${c_libdir32} \ --includedir=${c_incdir32} \ --with-gmp=${c_prefix}/${c_arch32} \ --disable-shared \ --enable-static # --build=${c_arch32} \ # --enable-thread-safe make -j8 all make install # echo "Stripping ${c_libdir32}/libmpfr.a" # strip -p --strip-debug ${c_libdir32}/libmpfr.a # cleanup cd ${wrk_wrk} rm -rf ${wrk_wrk}/mpc-0.7/32 } function step_e() { rm -rf ${wrk_wrk}/ppl-0.10.2/32 mkdir -p ${wrk_wrk}/ppl-0.10.2/32 cd ${wrk_wrk}/ppl-0.10.2/32 CFLAGS="${c_c_opt32}" \ CPPFLAGS="${c_c_opt32}" \ CXXFLAGS="${c_c_opt32}" \ LDFLAGS="${c_l_opt}" \ ../src/configure \ --prefix=${c_prefix} \ --libdir=${c_libdir32} \ --includedir=${c_incdir32} \ --with-libgmp-prefix=${c_prefix}/${c_arch32} \ --with-libgmpxx-prefix=${c_prefix}/${c_arch32} \ --disable-shared \ --enable-static # --build=${c_arch32} \ # --host=${c_arch32} \ # --enable-optimization=sspeed \ # --with-gnu-ld # --disable-rpath \ # --enable-arch=${k_arch_alias} \ make -j8 all make install # echo "Stripping ${c_libdir32}/libppl.a" # strip -p --strip-debug ${c_libdir32}/libppl.a # echo "Stripping ${c_libdir32}/libppl_c.a" # strip -p --strip-debug ${c_libdir32}/libppl_c.a # cleanup cd ${wrk_wrk} rm -rf ${wrk_wrk}/ppl-0.10.2/32 } function step_f() { rm -rf ${wrk_wrk}/cloog-ppl-0.15.4/32 mkdir -p ${wrk_wrk}/cloog-ppl-0.15.4/32 cd ${wrk_wrk}/cloog-ppl-0.15.4/32 # mv -f ../src/configure.in ../src/configure.in.original # mv -f ../src/configure ../src/configure.original # sed -e "s/-lppl -lgmpxx/-lppl -lgmpxx -lstdc++/" ../src/configure.in.original > ../src/configure.in # sed -e "s/-lppl -lgmpxx/-lppl -lgmpxx -lstdc++/" ../src/configure.original > ../src/configure CFLAGS="${c_c_opt32}" \ CPPFLAGS="${c_c_opt32}" \ CXXFLAGS="${c_c_opt32}" \ LDFLAGS="${c_l_opt}" \ ../src/configure \ --prefix=${c_prefix} \ --libdir=${c_libdir32} \ --includedir=${c_incdir32} \ --with-gmp=${c_prefix}/${c_arch32} \ --with-ppl=${c_prefix}/${c_arch32} \ --disable-shared \ --enable-static # --build=${c_arch32} \ # --host=${c_arch32} \ # --with-bits=gmp make -j8 all make install # mv -f ../src/configure.in.original ../src/configure.in # mv -f ../src/configure.original ../src/configure # echo "Stripping ${c_libdir32}/libcloog.a" # strip -p --strip-debug ${c_libdir32}/libcloog.a # echo "Stripping ${c_prefix}/bin/cloog.exe" # strip -p --strip-debug --strip-unneeded ${c_prefix}/bin/cloog.exe # cleanup cd ${wrk_wrk} rm -rf ${wrk_wrk}/cloog-ppl-0.15.4/32 } #function step_f1() { # #run 4 times # ss1="mingw_new" # ss2="mingw" # ss0="s/$ss1/$ss2/" # l1="libcloog.la" # cat ${c_libdir32}/${l1} | sed -e "$ss0" >${c_libdir32}/${l1}.fix # mv -f ${c_libdir32}/${l1}.fix ${c_libdir32}/${l1} #} #function step_e1() { # #run 3 times # ss1="mingw_new" # ss2="mingw" # ss0="s/$ss1/$ss2/" # l1="libppl.la" # l2="libppl_c.la" # cat ${c_libdir32}/${l1} | sed -e "$ss0" >${c_libdir32}/${l1}.fix # mv -f ${c_libdir32}/${l1}.fix ${c_libdir32}/${l1} # cat ${c_libdir32}/${l2} | sed -e "$ss0" >${c_libdir32}/${l2}.fix # mv -f ${c_libdir32}/${l2}.fix ${c_libdir32}/${l2} #} #function step_d1() { # ss1="mingw_new" # ss2="mingw" # ss0="s/$ss1/$ss2/" # cat ${c_libdir32}/libgmp.la | sed -e "$ss0" >${c_libdir32}/libgmp.fix.la # mv -f ${c_libdir32}/libgmp.fix.la ${c_libdir32}/libgmp.la # cat ${c_libdir32}/libgmpxx.la | sed -e "$ss0" >${c_libdir32}/libgmpxx.fix.la # mv -f ${c_libdir32}/libgmpxx.fix.la ${c_libdir32}/libgmpxx.la # cat ${c_libdir32}/libmpfr.la | sed -e "$ss0" >${c_libdir32}/libmpfr.fix.la # mv -f ${c_libdir32}/libmpfr.fix.la ${c_libdir32}/libmpfr.la # cat ${c_libdir32}/libmpc.la | sed -e "$ss0" >${c_libdir32}/libmpc.fix.la # mv -f ${c_libdir32}/libmpc.fix.la ${c_libdir32}/libmpc.la #} function step_g() { cd ${wrk_wrk}/zlib-1.2.3/src make distclean rm -f ./*.exe CFLAGS="${c_c_opt32}" \ CPPFLAGS="${c_c_opt32}" \ CXXFLAGS="${c_c_opt32}" \ LDFLAGS="${c_l_opt}" \ ./configure \ --prefix=${c_prefix} \ --libdir=${c_libdir32} \ --includedir=${c_incdir32} make all install # echo "Stripping ${c_libdir32}/libz.a" # strip -p --strip-debug ${c_libdir32}/libz.a # cleanup make distclean rm -f ./*.exe cd ${wrk_wrk} } function step_g1() { cd ${wrk_wrk}/bzip2-1.0.5/src make distclean # rm -f ./*.exe CFLAGS="${c_c_opt32}" \ CPPFLAGS="${c_c_opt32}" \ CXXFLAGS="${c_c_opt32}" \ LDFLAGS="${c_l_opt}" \ ./configure \ --prefix=${c_prefix} \ --libdir=${c_libdir32} \ --includedir=${c_incdir32} make all install # echo "Stripping ${c_libdir32}/libz.a" # strip -p --strip-debug ${c_libdir32}/libz.a # cleanup make distclean # rm -f ./*.exe cd ${wrk_wrk} } function step_g2() { cd ${wrk_wrk}/pthreads/src make \ KOPT="${c_c_opt32}" \ CROSS="" \ clean GC-static cp -f libpthreadGC2.a ${c_libdir32}/ cp -f sched.h semaphore.h ${c_incdir32}/ cat pthread.h | sed -e "$ss0" >${c_incdir32}/pthread.h rm -f ./libpthreadGC2.a ./libpthreadGC2.stamp # cleanup make clean # rm -f ./*.exe cd ${wrk_wrk} } function step_h() { mkdir -p ${wrk_wrk}/binutils/32 rm -rf ${wrk_wrk}/binutils/32/* cd ${wrk_wrk}/binutils/32 CFLAGS="${c_c_opt32}" \ CPPFLAGS="${c_c_opt32}" \ CXXFLAGS="${c_c_opt32}" \ LDFLAGS="${c_l_opt}" \ # ../binutils-2.20/configure \ ../src/configure \ --prefix=${c_prefix} \ --build=${c_arch32} \ --target=${c_arch32} \ --libdir=${c_libdir32} \ --includedir=${c_incdir32} \ --with-sysroot=${c_prefix} \ --enable-targets=${c_arch32},${c_arch64} \ --enable-static \ --disable-shared \ --disable-nls \ --enable-64-bit-bfd # --with-build-sysroot=${c_prefix} \ # --disable-rpath \ # --disable-werror \ # --with-gnu-ld \ # --with-gmp=${c_prefix}/${c_arch32} \ # --with-ppl=${c_prefix}/${c_arch32} \ # --with-cloog=${c_prefix}/${c_arch32} \ # --with-host-libstdcxx='-lstdc++' \ make -j5 all make install # echo "Stripping ${c_prefix}/bin/*.exe" # strip -p --strip-debug --strip-unneeded ${c_prefix}/${c_arch32}/bin/*.exe # echo "Stripping ${c_prefix}/${c_arch32}/bin/*.exe" # strip -p --strip-debug --strip-unneeded ${c_prefix}/bin/*.exe # echo "Stripping ${c_libdir32}/libbfd.a" # strip -p --strip-debug ${c_libdir32}/libbfd.a # echo "Stripping ${c_libdir32}/libiberty.a" # strip -p --strip-debug ${c_libdir32}/libiberty.a # echo "Stripping ${c_libdir32}/libopcodes.a" # strip -p --strip-debug ${c_libdir32}/libopcodes.a # cleanup cd ${wrk_wrk} rm -rf ${wrk_wrk}/binutils/32 } function step_i_noooooooooo() { ggg="gcc-4.3.4" rm -rf ${wrk_wrk}/${ggg}/32 mkdir -p ${wrk_wrk}/${ggg}/32 cd ${wrk_wrk}/${ggg}/32 mv -f ../src/gcc/version.c ../src/gcc/version.c.original brnd="(x86.${k_arch_alias}.${k_gcc_brand})" sed -e "s/DEVPHASE REVISION/DEVPHASE \" ${brnd}\" REVISION/" ../src/gcc/version.c.original >../src/gcc/version.c c_opt="${c_c_opt32}" l_opt="${c_l_opt}" CFLAGS="${c_opt}" \ LDFLAGS="${l_opt}" \ CPPFLAGS="${c_opt}" \ CXXFLAGS="${c_opt}" \ BOOT_CFLAGS="${c_opt}" \ BOOT_LDFLAGS="${l_opt}" \ BOOT_CPPFLAGS="${c_opt}" \ BOOT_CXXFLAGS="${c_opt}" \ CFLAGS_FOR_TARGET="${c_opt}" \ LDFLAGS_FOR_TARGET="${l_opt}" \ CPPFLAGS_FOR_TARGET="${c_opt}" \ CXXFLAGS_FOR_TARGET="${c_opt}" \ ../src/configure \ --prefix=${c_prefix} \ --build=${c_arch32} \ --target=${c_arch32} \ --with-sysroot=${c_prefix} \ --with-build-sysroot=${c_prefix} \ --with-mpfr=${c_prefix}/${c_arch32} \ --with-gmp=${c_prefix}/${c_arch32} \ --with-ppl=${c_prefix}/${c_arch32} \ --with-cloog=${c_prefix}/${c_arch32} \ --with-host-libstdcxx='-lstdc++' \ --disable-shared \ --enable-static \ --enable-threads=win32 \ --enable-languages=c,c++ \ --disable-rpath \ --disable-win32-registry \ --enable-version-specific-runtime-libs \ --with-gnu-ld \ --with-gnu-as \ --with-system-zlib \ --disable-werror \ --disable-nls \ --disable-sjlj-exceptions \ --enable-decimal-float \ --disable-debug \ --enable-wchar_t \ --disable-bootstrap \ --disable-debug \ --disable-libstdcxx-debug junction -d ${new_mingw_mnt}/mingw junction ${new_mingw_mnt}/mingw ${new_mingw_mnt}/${c_arch32} # Build make ${x_make_opt1} -j3 #exit make ${x_make_opt1} install junction -d ${new_mingw_mnt}/mingw mv -f ../src/gcc/version.c.original ../src/gcc/version.c rm -f ${new_mingw_mnt}/lib/libiberty.a rm -rf ${new_mingw_mnt}/include # Stripping strip -p --strip-debug --strip-unneeded ${new_mingw_mnt}/bin/*.exe strip -p --strip-debug --strip-unneeded `find ${new_mingw_mnt}/libexec/gcc/${c_arch32} -name "*.exe"` strip -p --strip-debug `find ${new_mingw_mnt}/lib/gcc/${c_arch32} -name "*.o"` strip -p --strip-debug `find ${new_mingw_mnt}/lib/gcc/${c_arch32} -name "*.a"` # cleanup # cd ${wrk_wrk} # rm -rf ${wrk_wrk}/${ggg}/32 } function step_i1() { ggg="gcc-4.4.3" rm -rf ${wrk_wrk}/${ggg}/32 mkdir -p ${wrk_wrk}/${ggg}/32 cd ${wrk_wrk}/${ggg}/32 mv -f ../src/gcc/version.c ../src/gcc/version.c.original brnd="(x86.${k_arch_alias}.${k_gcc_brand})" sed -e "s/DEVPHASE REVISION/DEVPHASE \" ${brnd}\" REVISION/" ../src/gcc/version.c.original >../src/gcc/version.c c_opt="${c_c_opt32}" l_opt="${c_l_opt}" CFLAGS="${c_opt}" \ LDFLAGS="${l_opt}" \ CPPFLAGS="${c_opt}" \ CXXFLAGS="${c_opt}" \ BOOT_CFLAGS="${c_opt}" \ BOOT_LDFLAGS="${l_opt}" \ BOOT_CPPFLAGS="${c_opt}" \ BOOT_CXXFLAGS="${c_opt}" \ CFLAGS_FOR_TARGET="${c_opt}" \ LDFLAGS_FOR_TARGET="${l_opt}" \ CPPFLAGS_FOR_TARGET="${c_opt}" \ CXXFLAGS_FOR_TARGET="${c_opt}" \ ../src/configure \ --prefix=${c_prefix} \ --build=${c_arch32} \ --target=${c_arch32} \ --with-sysroot=${c_prefix} \ --with-build-sysroot=${c_prefix} \ --with-mpfr=${c_prefix}/${c_arch32} \ --with-gmp=${c_prefix}/${c_arch32} \ --with-ppl=${c_prefix}/${c_arch32} \ --with-cloog=${c_prefix}/${c_arch32} \ --with-mpc=${c_prefix}/${c_arch32} \ --with-host-libstdcxx='-lstdc++ -lsupc++' \ --disable-shared \ --enable-static \ --enable-threads=win32 \ --enable-languages=c,c++ \ --disable-rpath \ --disable-win32-registry \ --enable-version-specific-runtime-libs \ --with-system-zlib \ --disable-werror \ --disable-nls \ --disable-bootstrap \ --disable-debug # --with-host-libstdcxx='-lstdc++' \ # --disable-libstdcxx-debug # --enable-wchar_t \ # --disable-sjlj-exceptions \ # --enable-decimal-float \ # --with-gnu-ld \ # --with-gnu-as \ } function step_i11() { ggg="gcc-4.4.3" mkdir -p ${wrk_wrk}/${ggg}/32 cd ${wrk_wrk}/${ggg}/32 junction -d ${new_mingw_mnt}/mingw junction ${new_mingw_mnt}/mingw ${new_mingw_mnt}/${c_arch32} # Build # make #exit # make install # junction -d ${new_mingw_mnt}/mingw } function step_i2() { ggg="gcc-4.4.3" mkdir -p ${wrk_wrk}/${ggg}/32 cd ${wrk_wrk}/${ggg}/32 # junction -d ${new_mingw_mnt}/mingw # junction ${new_mingw_mnt}/mingw ${new_mingw_mnt}/${c_arch32} # Build make -j3 all-gcc make install-gcc make -j3 all-target-libgcc make install-target-libgcc make -j3 make install # junction -d ${new_mingw_mnt}/mingw } function step_i22_nooooooooooooo() { ggg="gcc-4.4.3" mkdir -p ${wrk_wrk}/${ggg}/32 cd ${wrk_wrk}/${ggg}/32 # junction -d ${new_mingw_mnt}/mingw # junction ${new_mingw_mnt}/mingw ${new_mingw_mnt}/${c_arch32} # Build # make #exit # make install junction -d ${new_mingw_mnt}/mingw mv -f ../src/gcc/version.c.original ../src/gcc/version.c # cleanup cd ${wrk_wrk} rm -rf ${wrk_wrk}/${ggg}/32 } function step_i3() { ggg="gcc-4.4.3" mkdir -p ${wrk_wrk}/${ggg}/32 cd ${wrk_wrk}/${ggg}/32 junction -d ${new_mingw_mnt}/mingw mv -f ../src/gcc/version.c.original ../src/gcc/version.c rm -f ${new_mingw_mnt}/lib/libiberty.a rm -rf ${new_mingw_mnt}/include # Stripping # strip -p --strip-debug --strip-unneeded ${new_mingw_mnt}/bin/*.exe # strip -p --strip-debug --strip-unneeded `find ${new_mingw_mnt}/libexec/gcc/${c_arch32} -name "*.exe"` # strip -p --strip-debug `find ${new_mingw_mnt}/lib/gcc/${c_arch32} -name "*.o"` # strip -p -x `find ${new_mingw_mnt}/lib/gcc/${c_arch32} -name "*.a"` # cleanup cd ${wrk_wrk} rm -rf ${wrk_wrk}/${ggg}/32 } function step_fix1() { ggg='4.4.3' ss1="mingw_new" ss2="mingw" ss0="s/$ss1/$ss2/" lib_list='libbfd.la libcloog.la libgmp.la libgmpxx.la libmpc.la libmpfr.la libopcodes.la libppl.la libppl_c.la' for ll in ${lib_list}; do cat ${c_libdir32}/${ll} | sed -e $ss0 >${c_libdir32}/${ll}.fix mv -f ${c_libdir32}/${ll}.fix ${c_libdir32}/${ll} done lib_list='libssp.la libssp_nonshared.la libstdc++.la libsupc++.la' pth=${new_mingw_mnt}/lib/gcc/${c_arch32}/${ggg}/ for ll in ${lib_list}; do cat ${pth}/${ll} | sed -e $ss0 >${pth}/${ll}.fix mv -f ${pth}/${ll}.fix ${pth}/${ll} done } function step_fix() { step_fix1 step_fix1 step_fix1 step_fix1 } for i; do step_${i} done