TOPDIR="$(cd $(dirname $(which $0)); pwd)"
TMP_CONF="$(mktemp)"
-PKGMK=$TOPDIR/src/pkgmk
-PKGMK_CONF=$TOPDIR/src/pkgmk.conf
+PKGMK=$TOPDIR/pkgmk
+PKGMK_CONF=$TOPDIR/pkgmk-cross.conf
PKGMK_ARGS=""
PKGMK_OPTIMIZE=""
done
if [ ! -z "$PKGMK_OPTIMIZE" ]; then
- _cflags="$(grep "^${PKGMK_OPTIMIZE}_CFLAGS=" $PKGMK_CONF | cut -d'=' -f2- | sed 's|"||g')"
+ _cflags="$(grep "^${PKGMK_OPTIMIZE}_CFLAGS=" $PKGMK_CONF | cut -d'=' -f2- | sed 's|"||g')"
if [ ! -z "$_cflags" ]; then
sed '/_CFLAGS=/d' $PKGMK_CONF | sed "s|CFLAGS=.*|CFLAGS=\"$_cflags\"|" > $TMP_CONF
PKGMK_CONF="$TMP_CONF"
fi
fi
+if [ ! -x $PKGMK ]; then
+ chmod +x $PKGMK
+fi
+
$PKGMK -cf $PKGMK_CONF $PKGMK_ARGS
+exit_code=$?
rm -f $TMP_CONF
+# Pass along the exit code of pkgmk.
+exit $exit_code
+
# End of file