summaryrefslogtreecommitdiff
path: root/mingw-w64-crt/Pkgfile
blob: dc56edc4432e787fc80a9d8fcc44cdd5e02ca145 (plain)
    1 # Description: C runtime (crt) for mingw-w64 toolchain
    2 # URL: http://mingw-w64.org/
    3 # Maintainer: Matt Housh, jaeger at crux dot ninja
    4 
    5 name=mingw-w64-crt
    6 version=8.0.0
    7 release=1
    8 source=(https://sourceforge.net/projects/mingw-w64/files/mingw-w64/mingw-w64-release/mingw-w64-v$version.tar.bz2 \
    9 	http://ftpmirror.gnu.org/gnu/binutils/binutils-2.35.1.tar.xz \
   10 	http://gcc.gnu.org/pub/gcc/releases/gcc-10.2.0/gcc-10.2.0.tar.xz)
   11 
   12 build() {
   13 
   14 	# build a stub sysroot gcc if mingw-w64-gcc isn't already installed; if it is, that will be used instead
   15 	if [ ! -x /usr/bin/x86_64-w64-mingw32-gcc ]; then
   16 
   17 		export SYSROOT="--with-sysroot=$SRC/sysroot"
   18 
   19 		for T in {i686,x86_64}-w64-mingw32; do
   20 			mkdir build-binutils-$T
   21 			cd build-binutils-$T
   22 			../binutils-2.35.1/configure --target=$T --disable-multilib --prefix=$SRC/sysroot $SYSROOT
   23 			make
   24 			make install
   25 			cd ..
   26 		done
   27 
   28 		export PATH=$SRC/sysroot/bin:$PATH
   29 
   30 		for T in {i686,x86_64}-w64-mingw32; do
   31 			mkdir build-headers-$T
   32 			cd build-headers-$T
   33 			../mingw-w64-v$version/mingw-w64-headers/configure --host=$T --prefix=$SRC/sysroot/$T
   34 			make install
   35 			if [ "$T" = "x86_64-w64-mingw32" ]; then
   36 				ln -sv $SRC/sysroot/$T $SRC/sysroot/mingw
   37 				ln -sv $SRC/sysroot/$T/lib $SRC/sysroot/$T/lib64
   38 			fi
   39 			cd ..
   40 		done
   41 
   42 		for T in {i686,x86_64}-w64-mingw32; do
   43 			mkdir build-gcc-$T
   44 			cd build-gcc-$T
   45 			../gcc-10.2.0/configure --target=$T --disable-multilib --disable-nls --enable-threads=posix --prefix=$SRC/sysroot $SYSROOT
   46 			make all-gcc
   47 			make install-gcc
   48 			cd ..
   49 		done
   50 	fi
   51 
   52 	# now build the crt
   53 	for T in {x86_64,i686}-w64-mingw32; do
   54 		mkdir build-$T
   55 		cd build-$T
   56 		[[ "$T" = "x86_64-w64-mingw32" ]] && OPTS="--enable-lib64 --disable-lib32" || OPTS="--enable-lib32 --disable-lib64"
   57 		../mingw-w64-v$version/mingw-w64-crt/configure --prefix=/usr/$T --host=$T $OPTS --enable-wildcard $SYSROOT
   58 		make
   59 		make DESTDIR=$PKG install
   60 		cd ..
   61 	done
   62 }

Generated by cgit