CRUX-ARM : Home

Home :: Documentation :: Download :: Development :: Community :: Ports :: Packages :: Bugs :: Links :: About :: Donors
Fixed link to pkgadd creation in pkgrm-cross and pkginfo-cross
[pkgutils-cross.git] / pkgmk-cross
CommitLineData
04f9f193 1#!/bin/bash
f49ee185 2
04f9f193 3TOPDIR="$(cd $(dirname $(which $0)); pwd)"
04f9f193 4TMP_CONF="$(mktemp)"
f49ee185 5
c6f15699
JB
6PKGMK=$TOPDIR/pkgmk
7PKGMK_CONF=$TOPDIR/pkgmk-cross.conf
04f9f193
JB
8PKGMK_ARGS=""
9PKGMK_OPTIMIZE=""
f49ee185 10
04f9f193 11while [ "$1" ]; do
ab4e8070
JB
12 if [ "$1" != "-o" ]; then
13 PKGMK_ARGS="$PKGMK_ARGS $1"
14 else
15 shift
16 PKGMK_OPTIMIZE="$1"
17 fi
04f9f193
JB
18 shift
19done
20
21if [ ! -z "$PKGMK_OPTIMIZE" ]; then
573c30b8 22 _cflags="$(grep "^${PKGMK_OPTIMIZE}_CFLAGS=" $PKGMK_CONF | cut -d'=' -f2- | sed 's|"||g')"
04f9f193
JB
23 if [ ! -z "$_cflags" ]; then
24 sed '/_CFLAGS=/d' $PKGMK_CONF | sed "s|CFLAGS=.*|CFLAGS=\"$_cflags\"|" > $TMP_CONF
25 PKGMK_CONF="$TMP_CONF"
26 else
27 echo "Error, invalid optimization: '$PKGMK_OPTIMIZE'"
28 exit 1
29 fi
30fi
31
77b59cfe
JB
32if [ -x $PKGMK ]; then
33 $PKGMK -cf $PKGMK_CONF $PKGMK_ARGS
34else
35 chmod +x $PKGMK
36 $PKGMK -cf $PKGMK_CONF $PKGMK_ARGS
37fi
04f9f193 38
ab4e8070 39rm -f $TMP_CONF
f49ee185
JB
40
41# End of file