From 7e898ae2ac1120902c7230c054a38b38f2820a56 Mon Sep 17 00:00:00 2001 From: Jonathan Schleifer Date: Sat, 29 Feb 2020 23:06:38 +0000 Subject: [PATCH] cross.fish: Add mingw32 --- fish/functions/cross.fish | 26 +++++++++++++++++++++----- zshrc | 2 +- 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/fish/functions/cross.fish b/fish/functions/cross.fish index 91dc4c2..b5acb80 100644 --- a/fish/functions/cross.fish +++ b/fish/functions/cross.fish @@ -17,11 +17,6 @@ function cross --description 'Set up cross-compilation environment' set -g cross_host arm-none-eabi set -g objfw_configure_flags --with-$argv[1] case amiga - if test (count $argv) != 2 - echo 'Usage: cross amiga m68k|ppc' - return 1 - end - switch $argv[2] case m68k if test -z "$amiga_gcc_path" @@ -87,6 +82,27 @@ function cross --description 'Set up cross-compilation environment' set -gx OBJCPPXX $CXXPP set -gx IPHONEOS_DEPLOYMENT_TARGET 10.0 set -g cross_host $archs[1]-apple-darwin + case mingw32 + set -l pkg + switch $argv[2] + case i686 x86_64 + set pkg mingw-w64-$argv[2]-gcc + set -g cross_host $argv[2]-w64-mingw32 + end + + if test (count $argv) != 2 -o -z "$cross_host" + echo 'Usage: cross mingw i686|x86_64' + return 1 + end + + set -l prefix (pkg_info -qp $pkg | awk '/^@cwd/ { print $2; exit }') + + if test -z "$prefix" + echo 'Please install $pkg from pkgsrc!' + return 1 + end + + set PATH $prefix/cross/$cross_host/bin $PATH case morphos set -l prefix (pkg_info -qp ppc-morphos-gcc-9 | awk '/^@cwd/ { print $2; exit }') diff --git a/zshrc b/zshrc index 12c89a1..c64b5cc 100644 --- a/zshrc +++ b/zshrc @@ -116,7 +116,7 @@ case $TERM in unset_title() { precmd() { - print -Pn "\e]0;%m:%c\a" + print -Pn "\e]0;%c ยท %m\a" __precmd } }