From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.4 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FROM,HTML_MESSAGE,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 4863 invoked from network); 16 Nov 2020 15:01:19 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 16 Nov 2020 15:01:19 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20200801; t=1605538879; b=ZsKShjRL55thGgi1kHaEMn6nav3RwhTKR7V897wVpd+MnicLLjhit0tUA5QkrBP4tgbsN5jV78 bbgZBTv7r8+zzrFtE2DrQBUyUsI96XxYxhbyVsaTG+o2VBZxqb+/WMVqrbhl/ccVlZzZ+pXLC0 3qPK5QhpaCu8I2QUrgf7yV1Ou6Z877os4SAu3wVEoibj/dKbs3fu5sJQRas3/GGn15AisX8kGi 0aU8WO5axxb2ieG5ZpEovG1aFofVBAUs5mgtzCe5BjKp5crKzdrKERtbj5g2UuAnYBdVUepxPF UwMtrWsU04X11Ie6CZnou9MNd3oM7Ophh64G7VrH5bTr8w==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-wr1-f52.google.com) smtp.remote-ip=209.85.221.52; dkim=pass header.d=gmail.com header.s=20161025 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20200801; t=1605538879; bh=AuZWBD8ZFMJRnaF8/OAis9OKpLCG1z2yx1yPNW7nEwc=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:To:Date:Message-ID:Subject:MIME-Version:Content-Type:From: DKIM-Signature:DKIM-Signature; b=ARrwvlVx08XcQyCcSu+4MFPxA5kBtVfIlZvCT2xJOyTyBxvgyuJsm+c3q6DZD9dj3sy+isqfhG hLKCmaMnC5VTCKssH0aLe+vjnHuBUrMCoMro/GrPAayEbEuNmktCXwRsOmhjvU83UtStLbRhu3 j6BN4ukgvdpbZVzFLnHFE0/hRaNY13P6KsnLvZWNSk7taL3dcbhiz8hUjAwItd/p8SMD/LFfiE AwWr5RIM6Dxo4dIM9QHVcDMASb8oV6GH7oIAXDLviap+m8dGl1BWPsuwmkiTQ7baQARtoAasDt pY8hgfym2PK4hK4X65bFzXsZ4JKV6W5m5TTGNs4n/i4uAg==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20200801; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:To:Date:Message-Id:Subject: Mime-Version:Content-Type:From:Reply-To:Cc:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References; bh=ZG9QUBoRpmfhveHtwniTKJOPUU5dvg9ec3EmtlsDjAw=; b=dllASp7JZ0q5fCwOWTkt8C0Roy vBySN9v2jHgwEglTCOXwNo8PuYta/D7hzN/dMfszKpY4ZngrY2+0d7xBPRPHakTDYtklS6kiijYvL wpam2WPm4LXmMDqPyvcoWeuh2dLv7D63QrVYbPSON6v+cRMH4sIdkdi9uMKOGn7G2waZ+zqy4oPag 6uKjMbhcmuIvqUasbtpEZQEcs1TtJ4B04rUdNllw9fmKHfJmgqI/nqfs6zKT8PAsPm91hWxLsRqN2 YyxHfJCRBur95a5a5BBaK13zJ0UfGFP++/H/gEVxynOnaR9w9MT7FI/pcd7WZxqGmR816WEW41smy CHdXDNFQ==; Received: from authenticated user by zero.zsh.org with local id 1keg0I-0004ah-4R; Mon, 16 Nov 2020 15:01:14 +0000 Authentication-Results: zsh.org; iprev=pass (mail-wr1-f52.google.com) smtp.remote-ip=209.85.221.52; dkim=pass header.d=gmail.com header.s=20161025 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none Received: from mail-wr1-f52.google.com ([209.85.221.52]:42160) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1kefzi-0004DL-Kt; Mon, 16 Nov 2020 15:00:39 +0000 Received: by mail-wr1-f52.google.com with SMTP id l1so19000672wrb.9 for ; Mon, 16 Nov 2020 07:00:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:mime-version:subject:message-id:date:to; bh=ZG9QUBoRpmfhveHtwniTKJOPUU5dvg9ec3EmtlsDjAw=; b=g6hJc7Gkt2pBjvM1kPYuWwD7WyQwU+IpGXdfX9WF6+8ZW5OStmp3Z2qMw8bxVB2Oge IOnB+RSwOAs0gLE9F6TnrQ1qz+aw7ZkiAEivOPNKyo7wtlwMB/FsLi931IWadt8zlIJ3 ahKHDYAbuIGpm+ZYdDTn8pk0vxiZYG4PPJkAQbhZLjEwfYCTw504Z/L0iz7zJ+zZ2PRD DQ8sLieYmc71QJM5SdoDrpdVgoEnwlLPOQ2+u5UzVYLa2Mn3M+Qm8CvsX7LXg4YBMxdo X8+Mp0QxjUotkcrts4qB7iH3krJtwJ9YadAAfv4UbTgkj0IlNO2+db5JsgE9szvkBqGW p7XA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:mime-version:subject:message-id:date:to; bh=ZG9QUBoRpmfhveHtwniTKJOPUU5dvg9ec3EmtlsDjAw=; b=EeioNF1p1AQxOATPr33gyK8zcPEfGXlM/YttFX0gv9KAYoNKOqpapCDYAKCZI/nJet pqMxptBA7Lfmpte5iRuJN66zx/U0Mt4aNoJrWbrSElETNJ4bi/4itPkgXHnoueTpE5rb ig2EK1rJrGjgAZQFI9VUuFU0Ka9JTqcrby8hcqIQU35rrBisOck3ISvLT83fzjN3CShL KB6AjPBsA5R3phijUuXBMGe/zt6Y35qXoa121kVsPBj8ce7kljgvwowRQutRc9nwe9wC /PwCKVNDO7lJEFOhknhspqcLwW53vgl5E6dDro5sj7XX1lDe+05u4ZrRPzsSBOe0w809 L8qQ== X-Gm-Message-State: AOAM533Ij/TvI0B9mxkqsIyJK4KqPWujF3c9lJGc2cAQURw5uhKBFSen v3kdyZx8WAaaSQ+iJ2D3o3ltcaj54jw= X-Google-Smtp-Source: ABdhPJwJmb/UCt2fje8zRP3w8QcyJoSYcwmnmu2NZ/Rl/Yd+uP23+WDB3ETVMdkGY1pqRbgHBMacNw== X-Received: by 2002:adf:ffc9:: with SMTP id x9mr11390332wrs.148.1605538837598; Mon, 16 Nov 2020 07:00:37 -0800 (PST) Received: from imac.fritz.box (port-92-196-84-68.dynamic.as20676.net. [92.196.84.68]) by smtp.gmail.com with ESMTPSA id b8sm24922330wrv.57.2020.11.16.07.00.36 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 16 Nov 2020 07:00:36 -0800 (PST) From: Dominik Reichardt Content-Type: multipart/alternative; boundary="Apple-Mail=_F95CDBD0-7BCD-4D06-857D-0A8823B346A4" Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.20.0.2.21\)) Subject: Apple bash to zsh script problems with error control and bash emulation Message-Id: <1EFC2452-32D1-411C-B239-0031131FA197@gmail.com> Date: Mon, 16 Nov 2020 16:00:36 +0100 To: zsh-users@zsh.org X-Mailer: Apple Mail (2.3654.20.0.2.21) X-Seq: 26169 Archived-At: X-Loop: zsh-users@zsh.org Errors-To: zsh-users-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-users-request@zsh.org X-no-archive: yes List-Id: List-Help: List-Subscribe: List-Unsubscribe: List-Post: List-Owner: List-Archive: Archived-At: --Apple-Mail=_F95CDBD0-7BCD-4D06-857D-0A8823B346A4 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Hi all, I=E2=80=99ve recently moved to zsh as Apple is pressuring us :) My problem is that I have built a little bash script thing to work as a = buildbot for some projects I=E2=80=99m building snapshots for. My two problems are that my error control is no longer working in a way = that it stops (exit 1) after encountering an error when in bash = emulation mode, and that if I deactivate the bash emulation stuff = doesn=E2=80=99t work. My scripts can be found at https://github.com/DominusExult/buildbot = , as an example I=E2=80=99ve = shortened in this email my exult snapshot.sh and my functions script = functions.sh. Something goes wrong in the error(), pipestatus() and teelog() = functions, I guess. But I can=E2=80=99t quite tell and I=E2=80=99ve = built that script 5 years ago and am a bit rusty to what each of those = function do exactly. What I expect is that when the script runs into an error it stops, even = if the error happens in one of the functions but currently the script = goes on and on. This used to work before in bash. If I get rid of the =E2=80=94emulate sh, my variables don=E2=80=99t get = passed on correctly (the error I get in the shorted version of my script = is "configure: error: unrecognized option: `-q --disable-data = --with-macosx-static-lib-path=3D/opt/i386/lib=E2=80=99=E2=80=9D I hope you can help me figure this out. I=E2=80=99ve tried researching = this on my own but the biggest hurdle was that search results pointed me = at bash stuff and not zsh. Thank you, Dom The scripts: exultsnasphot.sh: #!/bin/zsh --emulate sh #functions . ./functions.sh headermain EXULT cd ~/code/snapshots/exult /usr/bin/git pull --rebase=3Dtrue 2> >(teelog >&2) || error Git pull #i386 ARCH=3Di386 SDK=3D10.11 DEPLOYMENT=3D10.7 flags gcc CONF_ARGS=3D"-q --disable-data = --with-macosx-static-lib-path=3D/opt/$ARCH/lib" autogen build 2>&1 | teelog -a ; pipestatus || return deploy { #make fat exult binary lipo -create -arch arm64 exult_arm64 -arch x86_64 exult_x86_64 = -arch i386 exult_i386 -output exult || error lipo } 2>&1 | teelog -a ; pipestatus || return functions.sh: #-------------headers------------- headermain() { if [ "$1" !=3D "" ]; then TARGET=3D$1 #lowercase of $TARGET target=3D"$(echo $TARGET | tr '[A-Z]' '[a-z]')" #logfile LOGFILE=3D~/.local/logs/${target}built.txt else error headermain function fi } alias deploy=3D'echo -e "$(tput setab 4)$(tput bold)$(tput setaf = 3)\tdeployment\t$(tput sgr 0)"' #-------------Error handling------------- alias lockfile=3D'rm -f ~/.local/"$TARGET"build1.lockfile' error () { if [ "$?" !=3D "0" ]; then if [ "$2" !=3D "" ]; then local i2=3D" $2" fi if [ "$3" !=3D "" ]; then local i3=3D" $3" fi echo -e "$(tput setab 1)$(tput bold)$(tput setaf = 7)\t${1:-"Unknown Error"}${i2}${i3} failed!\t\t$(tput sgr 0)" 1>&2 lockfile exit 1 fi } pipestatus() { local S=3D("${PIPESTATUS[@]}") if test -n "$*" then test "$*" =3D "${S[*]}" else ! [[ "${S[@]}" =3D~ [^0\ ] ]] fi } teelog() { tee $1 $LOGFILE } #-------------compiler & flags------------- flags() { SYSARCH=3D$(uname -m) if [ "$ARCH" =3D "" ] && [ "$SYSARCH" =3D "arm64" ]; then ARCH=3Darm64 SDK=3D11.0 DEPLOYMENT=3D11.0 elif [ "$ARCH" =3D "" ] && [ "$SYSARCH" =3D "x86_64" ]; then ARCH=3Dx86_64 SDK=3D10.14 DEPLOYMENT=3D10.11 fi export PKG_CONFIG_PATH=3D/opt/$ARCH/lib/pkgconfig export PKG_CONFIG=3D/opt/$SYSARCH/bin/pkg-config if [ "$ARCH" =3D "i386" ]; then OPTARCH=3D'-arch i386 -m32 -msse -msse2 -O2 ' elif [ "$ARCH" =3D "ppc" ]; then OPTARCH=3D'-arch ppc -m32 -O2 ' export PKG_CONFIG=3D/opt/x86_64/bin/pkg-config elif [ "$ARCH" =3D "x86_64" ]; then OPTARCH=3D'-m64 -msse -msse2 -O2 ' elif [ "$ARCH" =3D "arm64" ]; then OPTARCH=3D'-O2 ' fi OPT=3D' -w -force_cpusubtype_ALL '$OPTARCH SDK=3D' -isysroot /opt/SDKs/MacOSX'$SDK'.sdk = -mmacosx-version-min=3D'$DEPLOYMENT' ' export MACOSX_DEPLOYMENT_TARGET=3D$DEPLOYMENT export CPPFLAGS=3D'-I/opt/'$ARCH'/include'$SDK export CFLAGS=3D'-I/opt/'$ARCH'/include'$SDK' '$OPT export CXXFLAGS=3D'-I/opt/'$ARCH'/include '$SDK' '$OPT export LDFLAGS=3D'-L/opt/'$ARCH'/lib'$SDK' '$OPT export LIBTOOLFLAGS=3D--silent } gcc() { if [ "$ARCH" !=3D "" ]; then export = PATH=3D/opt/$ARCH/bin/:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin export LD=3D"/usr/bin/ld" export RANLIB=3D"~/code/sh/tools/ranlib" if [ "$1" =3D "legacy" ]; then export = PATH=3D/opt/$ARCH/bin/:/opt/xcode3/usr/bin:/opt/xcode3/usr/sbin:/usr/bin:/= bin:/usr/sbin:/sbin:/usr/local/bin export CC=3D'/opt/xcode3/usr/bin/llvm-gcc-4.2 = -arch '$ARCH export CXX=3D'/opt/xcode3/usr/bin/llvm-g++-4.2 = -arch '$ARCH export LD=3D"/opt/xcode3/usr/bin/ld" export RANLIB=3D"/opt/xcode3/usr/bin/ranlib.old" elif [ "$1" =3D "oldgcc" ]; then export = PATH=3D/opt/$ARCH/bin/:/opt/xcode3/usr/bin:/opt/xcode3/usr/sbin:/usr/bin:/= bin:/usr/sbin:/sbin:/usr/local/bin export CC=3D'/opt/xcode3/usr/bin/gcc-4.2 -arch = '$ARCH export CXX=3D'/opt/xcode3/usr/bin/g++-4.2 -arch = '$ARCH export LD=3D"/opt/xcode3/usr/bin/ld" export RANLIB=3D"/opt/xcode3/usr/bin/ranlib.old" else export CC=3D'/usr/bin/clang -arch '$ARCH export CXX=3D'/usr/bin/clang++ -arch '$ARCH fi else error gcc function fi } #-------------command shortcuts------------- alias autogen=3D'./autogen.sh > /dev/null 2>&1' alias makes=3D'make clean > /dev/null ; make -j9 -s = AR=3D"~/code/sh/tools/ar" > /dev/null || error $HEADER make' config() { if [ "$CONF_OPT" !=3D "" ]; then c1=3D$CONF_OPT fi if [ "$CONF_ARGS" !=3D "" ]; then c2=3D$CONF_ARGS fi =09 if [ "$ARCH" =3D "ppc" ]; then ./configure --host=3Dpowerpc-apple-darwin $CONF_OPT = $CONF_ARGS || error $ARCH configure elif [ "$ARCH" =3D "i386" ]; then ./configure --host=3Di386-apple-darwin $CONF_OPT = $CONF_ARGS || error $ARCH configure elif [[ "$ARCH" =3D "arm64" ]] && [[ "$SYSARCH" !=3D "arm64" ]]; = then ./configure --host=3Darm-apple-darwin $CONF_OPT = $CONF_ARGS || error $ARCH configure elif [[ "$ARCH" =3D "x86_64" ]] && [[ "$SYSARCH" !=3D "x86_64" = ]]; then ./configure --host=3Dx86_64-apple-darwin $CONF_OPT = $CONF_ARGS || error $ARCH configure else [ "$?" !=3D "0" ] ./configure $CONF_OPT $CONF_ARGS || error $ARCH = configure fi } stripp() { if [ "$ARCH" !=3D "" ]; then strip $1 -o $1_$ARCH || error $HEADER strip else strip $1 -o $1 || error $1 strip fi } build() { config makes stripp $target =09 } --Apple-Mail=_F95CDBD0-7BCD-4D06-857D-0A8823B346A4 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8 Hi = all,

I=E2=80=99ve = recently moved to zsh as Apple is pressuring us :)

My problem is that I = have built a little bash script thing to work as a buildbot for some = projects I=E2=80=99m building snapshots for.

My two problems are that my error = control is no longer working in a way that it stops (exit 1) after = encountering an error when in bash emulation mode, and that if I = deactivate the bash emulation stuff doesn=E2=80=99t work.

My scripts can be found = at https://github.com/DominusExult/buildbot, as an example = I=E2=80=99ve shortened in this email my exult snapshot.sh and my = functions script functions.sh.
Something goes wrong = in the error(), pipestatus() and teelog() functions, I guess. But I = can=E2=80=99t quite tell and I=E2=80=99ve built that script 5 years ago = and am a bit rusty to what each of those function do exactly.

What I expect is that = when the script runs into an error it stops, even if the error happens = in one of the functions but currently the script goes on and on. This = used to work before in bash.
If I get rid of the = =E2=80=94emulate sh, my variables don=E2=80=99t get passed on correctly = (the error I get in the shorted version of my script is "configure: = error: unrecognized option: `-q --disable-data = --with-macosx-static-lib-path=3D/opt/i386/lib=E2=80=99=E2=80=9D

I hope you can help me = figure this out. I=E2=80=99ve tried researching this on my own but the = biggest hurdle was that search results pointed me at bash stuff and not = zsh.

Thank = you,
Dom

The scripts:

exultsnasphot.sh:
#!/bin/zsh --emulate sh
#functions
. ./functions.sh

headermain = EXULT

cd = ~/code/snapshots/exult
/usr/bin/git pull = --rebase=3Dtrue 2> >(teelog >&2) || error Git = pull

#i386
ARCH=3Di386
SDK=3D10.11
DEPLOYMENT=3D10.7
flags
gcc
CONF_ARGS=3D"-q --disable-data = --with-macosx-static-lib-path=3D/opt/$ARCH/lib"
autogen
build 2>&1 | teelog -a ; = pipestatus || return

deploy
{
#make fat = exult binary
lipo -create -arch arm64 = exult_arm64 -arch x86_64 exult_x86_64 -arch i386 exult_i386 -output = exult || error lipo
} 2>&1 | teelog -a ; = pipestatus || return


functions.sh:
#-------------headers-------------
headermain() {
if [ "$1" = !=3D "" ]; then
TARGET=3D$1
= #lowercase of $TARGET
= target=3D"$(echo $TARGET | tr '[A-Z]' '[a-z]')"
= #logfile
= LOGFILE=3D~/.local/logs/${target}built.txt
= else
error headermain = function
fi
}

alias deploy=3D'echo -e = "$(tput setab 4)$(tput bold)$(tput setaf 3)\tdeployment\t$(tput sgr = 0)"'

#-------------Error handling-------------
alias lockfile=3D'rm -f = ~/.local/"$TARGET"build1.lockfile'

error () {
if [ "$?" = !=3D "0" ]; then
if [ "$2" !=3D "" ]; = then
local i2=3D" = $2"
fi
= if [ "$3" !=3D "" ]; then
= local i3=3D" $3"
= fi
echo -e "$(tput setab = 1)$(tput bold)$(tput setaf 7)\t${1:-"Unknown Error"}${i2}${i3} = failed!\t\t$(tput sgr 0)" 1>&2
= lockfile
exit 1
= fi
}

pipestatus() {
local = S=3D("${PIPESTATUS[@]}")
if test = -n "$*"
then test "$*" =3D = "${S[*]}"
else ! [[ "${S[@]}" =3D~ [^0\ ] = ]]
fi
}

teelog() {
= tee $1 $LOGFILE
}

#-------------compiler & = flags-------------
flags() {
= SYSARCH=3D$(uname -m)
if =  [ "$ARCH" =3D "" ] && [ "$SYSARCH" =3D "arm64" ]; = then
ARCH=3Darm64
= SDK=3D11.0
DEPLOYMENT=3D11.0
= elif [ "$ARCH" =3D "" ] && [ "$SYSARCH" =3D "x86_64" ]; = then
ARCH=3Dx86_64
= SDK=3D10.14
= DEPLOYMENT=3D10.11
= fi

export = PKG_CONFIG_PATH=3D/opt/$ARCH/lib/pkgconfig
export = PKG_CONFIG=3D/opt/$SYSARCH/bin/pkg-config

if [ "$ARCH" =3D "i386" ]; = then
OPTARCH=3D'-arch i386 = -m32 -msse -msse2 -O2 '
elif [ = "$ARCH" =3D "ppc" ]; then
= OPTARCH=3D'-arch ppc -m32 -O2 '
= export PKG_CONFIG=3D/opt/x86_64/bin/pkg-config
= elif  [ "$ARCH" =3D "x86_64" ]; then
= OPTARCH=3D'-m64 -msse -msse2 -O2 '
elif =  [ "$ARCH" =3D "arm64" ]; then
= OPTARCH=3D'-O2 '
= fi
OPT=3D' -w -force_cpusubtype_ALL = '$OPTARCH
SDK=3D' -isysroot = /opt/SDKs/MacOSX'$SDK'.sdk -mmacosx-version-min=3D'$DEPLOYMENT' = '
export = MACOSX_DEPLOYMENT_TARGET=3D$DEPLOYMENT
export = CPPFLAGS=3D'-I/opt/'$ARCH'/include'$SDK
export = CFLAGS=3D'-I/opt/'$ARCH'/include'$SDK' '$OPT
export = CXXFLAGS=3D'-I/opt/'$ARCH'/include '$SDK' '$OPT
export = LDFLAGS=3D'-L/opt/'$ARCH'/lib'$SDK' '$OPT
export = LIBTOOLFLAGS=3D--silent
}

gcc() {
if [ = "$ARCH" !=3D "" ]; then
= export = PATH=3D/opt/$ARCH/bin/:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin
<= div class=3D""> = export LD=3D"/usr/bin/ld"
= export RANLIB=3D"~/code/sh/tools/ranlib"
= if [ "$1" =3D "legacy" ]; then
= export = PATH=3D/opt/$ARCH/bin/:/opt/xcode3/usr/bin:/opt/xcode3/usr/sbin:/usr/bin:/= bin:/usr/sbin:/sbin:/usr/local/bin
= export CC=3D'/opt/xcode3/usr/bin/llvm-gcc-4.2 -arch = '$ARCH
export = CXX=3D'/opt/xcode3/usr/bin/llvm-g++-4.2 -arch '$ARCH
= export LD=3D"/opt/xcode3/usr/bin/ld"
= export RANLIB=3D"/opt/xcode3/usr/bin/ranlib.old"
= elif [ "$1" =3D "oldgcc" ]; then
= export = PATH=3D/opt/$ARCH/bin/:/opt/xcode3/usr/bin:/opt/xcode3/usr/sbin:/usr/bin:/= bin:/usr/sbin:/sbin:/usr/local/bin
= export CC=3D'/opt/xcode3/usr/bin/gcc-4.2 -arch '$ARCH
= export CXX=3D'/opt/xcode3/usr/bin/g++-4.2 -arch = '$ARCH
export = LD=3D"/opt/xcode3/usr/bin/ld"
= export RANLIB=3D"/opt/xcode3/usr/bin/ranlib.old"
= else
export = CC=3D'/usr/bin/clang -arch '$ARCH
= export CXX=3D'/usr/bin/clang++ -arch '$ARCH
= fi
else
= error gcc function
= fi
}

#-------------command = shortcuts-------------
alias autogen=3D'./autogen.sh = > /dev/null 2>&1'

alias makes=3D'make clean  > /dev/null ; make -j9 -s = AR=3D"~/code/sh/tools/ar" > /dev/null || error $HEADER = make'


config() {
if [ = "$CONF_OPT" !=3D "" ]; then
= c1=3D$CONF_OPT
fi
if [ = "$CONF_ARGS" !=3D "" ]; then
= c2=3D$CONF_ARGS
fi
=
if [ "$ARCH" =3D "ppc" ]; = then
./configure = --host=3Dpowerpc-apple-darwin $CONF_OPT $CONF_ARGS || error $ARCH = configure

elif [ = "$ARCH" =3D "i386" ]; then
= ./configure --host=3Di386-apple-darwin $CONF_OPT $CONF_ARGS || = error $ARCH configure

= elif [[ "$ARCH" =3D "arm64" ]] && [[ "$SYSARCH" !=3D = "arm64" ]]; then
./configure = --host=3Darm-apple-darwin $CONF_OPT $CONF_ARGS || error $ARCH = configure

elif [[ = "$ARCH" =3D "x86_64" ]] && [[ "$SYSARCH" !=3D "x86_64" ]]; = then
./configure = --host=3Dx86_64-apple-darwin $CONF_OPT $CONF_ARGS || error $ARCH = configure

else [ = "$?" !=3D "0" ]
./configure $CONF_OPT = $CONF_ARGS || error $ARCH configure
= fi
}

stripp() {
if [ = "$ARCH" !=3D "" ]; then
= strip $1 -o $1_$ARCH || error $HEADER strip
= else
strip $1 -o $1 || error = $1 strip
fi
}

build() {
= config
makes
stripp = $target
}



= --Apple-Mail=_F95CDBD0-7BCD-4D06-857D-0A8823B346A4--