CRUX-ARM : Home

Home :: Documentation :: Download :: Development :: Community :: Ports :: Packages :: Bugs :: Links :: About :: Donors
Added README-cross file (contains the old README before merge from upstream)
[pkgutils-cross.git] / pkgmk-cross
... / ...
CommitLineData
1#!/bin/bash
2
3TOPDIR="$(cd $(dirname $(which $0)); pwd)"
4TMP_CONF="$(mktemp)"
5
6PKGMK=$TOPDIR/src/pkgmk
7PKGMK_CONF=$TOPDIR/src/pkgmk.conf
8PKGMK_ARGS=""
9PKGMK_OPTIMIZE=""
10
11while [ "$1" ]; do
12 if [ "$1" != "-o" ]; then
13 PKGMK_ARGS="$PKGMK_ARGS $1"
14 else
15 shift
16 PKGMK_OPTIMIZE="$1"
17 fi
18 shift
19done
20
21if [ ! -z "$PKGMK_OPTIMIZE" ]; then
22 _cflags="$(grep "^${PKGMK_OPTIMIZE}_CFLAGS=" $PKGMK_CONF | cut -d'=' -f2- | sed 's|"||g')"
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
32$PKGMK -cf $PKGMK_CONF $PKGMK_ARGS
33
34rm -f $TMP_CONF
35
36# End of file