Compare commits
10 Commits
main
...
cross-buil
Author | SHA1 | Date | |
---|---|---|---|
![]() |
74355b39d5 | ||
![]() |
05e2a0370e | ||
![]() |
e4d542950b | ||
![]() |
a51c889314 | ||
![]() |
8508cec612 | ||
![]() |
8a38bdd545 | ||
![]() |
b044128dad | ||
![]() |
89835de93f | ||
![]() |
24022b3c82 | ||
![]() |
ba7cf16e67 |
2
Makefile
2
Makefile
@ -6,7 +6,6 @@ prefix ?= /usr
|
||||
bindir ?= $(prefix)/bin
|
||||
sysconfdir ?= /etc
|
||||
datadir ?= $(prefix)/share/$(PACKAGE)
|
||||
abuildrepo ?= ~/.cache/abuild
|
||||
|
||||
SCRIPTS := abuild abuild-keygen abuild-sign newapkbuild \
|
||||
abump apkgrel buildlab apkbuild-cpan checkapk \
|
||||
@ -35,7 +34,6 @@ SED_REPLACE := -e 's:@VERSION@:$(FULL_VERSION):g' \
|
||||
-e 's:@prefix@:$(prefix):g' \
|
||||
-e 's:@sysconfdir@:$(sysconfdir):g' \
|
||||
-e 's:@datadir@:$(datadir):g' \
|
||||
-e 's:@abuildrepo@:$(abuildrepo):g'
|
||||
|
||||
SSL_CFLAGS ?= $(shell pkg-config --cflags openssl)
|
||||
SSL_LDFLAGS ?= $(shell pkg-config --cflags openssl)
|
||||
|
470
abuild.in
470
abuild.in
@ -2,13 +2,13 @@
|
||||
|
||||
# abuild - build apk packages (light version of makepkg)
|
||||
# Copyright (c) 2008-2015 Natanael Copa <ncopa@alpinelinux.org>
|
||||
# Copyright (c) 2016 Timo Teräs <timo.teras@iki.fi>
|
||||
#
|
||||
# Distributed under GPL-2
|
||||
#
|
||||
|
||||
program_version=@VERSION@
|
||||
sysconfdir=@sysconfdir@
|
||||
abuildrepo_base=@abuildrepo@
|
||||
datadir=@datadir@
|
||||
|
||||
abuild_path=$(readlink -f $0)
|
||||
@ -79,12 +79,7 @@ cleanup() {
|
||||
deps)
|
||||
if [ -z "$install_after" ] && [ -n "$uninstall_after" ]; then
|
||||
msg "Uninstalling dependencies..."
|
||||
$SUDO_APK del --quiet $apk_opt_wait $uninstall_after
|
||||
if cross_compiling; then
|
||||
$SUDO_APK del --root "$CBUILDROOT" \
|
||||
--no-scripts --quiet $apk_opt_wait \
|
||||
$uninstall_after
|
||||
fi
|
||||
undeps
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
@ -132,13 +127,6 @@ default_sanitycheck() {
|
||||
esac
|
||||
done
|
||||
|
||||
# check if CARCH, CBUILD, CHOST and CTARGET is set
|
||||
[ -z "$CHOST" ] && die "Please set CHOST in /etc/abuild.conf"
|
||||
|
||||
if [ -z "$CARCH" ]; then
|
||||
die "Please fix CHOST, or set CARCH in abuild.conf"
|
||||
fi
|
||||
|
||||
for i in $install; do
|
||||
local n=${i%.*}
|
||||
local suff=${i##*.}
|
||||
@ -441,25 +429,39 @@ cleancache() {
|
||||
done
|
||||
}
|
||||
|
||||
listpkgnames() {
|
||||
local i
|
||||
for i in $pkgname $subpackages; do
|
||||
echo ${i%%:*}
|
||||
done
|
||||
for i in $linguas; do
|
||||
echo $pkgname-lang-$i
|
||||
done
|
||||
subpkg_unset() {
|
||||
unset subpkgname subpkgsplit subpkgarch
|
||||
}
|
||||
|
||||
subpkg_set() {
|
||||
subpkgname=${1%%:*}
|
||||
|
||||
local _splitarch=${1#*:}
|
||||
[ "$_splitarch" = "$1" ] && _splitarch=""
|
||||
|
||||
subpkgsplit=${_splitarch%%:*}
|
||||
[ -z "$subpkgsplit" ] && subpkgsplit="${subpkgname##*-}"
|
||||
|
||||
subpkgarch=${_splitarch#*:}
|
||||
if [ "$subpkgarch" = "$_splitarch" -o -z "$subpkgarch" ]; then
|
||||
case "$subpkgname" in
|
||||
*-doc | *-lang | *-lang-*) subpkgarch="noarch" ;;
|
||||
*) subpkgarch="$pkgarch" ;;
|
||||
esac
|
||||
fi
|
||||
}
|
||||
|
||||
cleanpkg() {
|
||||
local i
|
||||
getpkgver || return 1
|
||||
msg "Cleaning built packages..."
|
||||
for i in $(listpkgnames); do
|
||||
local p="${i%%:*}-$pkgver-r$pkgrel"
|
||||
rm -f "$PKGDEST/$p.apk" "$PKGDEST/$p.src.tar.gz" \
|
||||
"$abuildrepo"/$p.apk "$abuildrepo"/*/$p.apk
|
||||
rm -f "$REPODEST/$repo/src/$pkgname-$pkgver-r$pkgrel.src.tar.gz"
|
||||
for i in $allpackages; do
|
||||
subpkg_set "$i"
|
||||
rm -f "$REPODEST/$repo/$subpkgarch/$subpkgname-$pkgver-r$pkgrel.apk"
|
||||
done
|
||||
subpkg_unset
|
||||
|
||||
# remove given packages from index
|
||||
update_abuildrepo_index
|
||||
}
|
||||
@ -469,14 +471,15 @@ cleanoldpkg() {
|
||||
local i j
|
||||
getpkgver || return 1
|
||||
msg "Cleaning all packages except $pkgver-r$pkgrel..."
|
||||
for i in $(listpkgnames); do
|
||||
local pn=${i%%:*}
|
||||
for j in "$PKGDEST"/$pn-[0-9]*.apk ; do
|
||||
[ "$j" = "$PKGDEST/$pn-$pkgver-r$pkgrel.apk" ] \
|
||||
for i in $allpackages; do
|
||||
subpkg_set "$i"
|
||||
for j in "$REPODEST"/$repo/*/$subpkgname-[0-9]*.apk ; do
|
||||
[ "${j##*/}" = "$subpkgname-$pkgver-r$pkgrel.apk" ] \
|
||||
&& continue
|
||||
rm -f "$j" "$abuildrepo"/*/${j##*/}
|
||||
rm -f "$j"
|
||||
done
|
||||
done
|
||||
subpkg_unset
|
||||
update_abuildrepo_index
|
||||
return 0
|
||||
}
|
||||
@ -571,20 +574,8 @@ build() {
|
||||
# generate a simple tar.gz package of pkgdir
|
||||
targz() {
|
||||
cd "$pkgdir" || return 1
|
||||
mkdir -p "$PKGDEST"
|
||||
tar -czf "$PKGDEST"/$pkgname-$pkgver-r$pkgrel.tar.gz *
|
||||
}
|
||||
|
||||
get_split_func() {
|
||||
# get the 'func' from "sub-pkg:func:arch"
|
||||
local _splitarch=${1#*:}
|
||||
[ "$_splitarch" = "$1" ] && _splitarch=""
|
||||
local _split=${_splitarch%:*}
|
||||
if [ -z "$_split" ]; then
|
||||
local _name=${1%%:*}
|
||||
_split="${_name##*-}"
|
||||
fi
|
||||
echo $_split
|
||||
mkdir -p "$REPODEST"/src
|
||||
tar -czf "$REPODEST"/src/$pkgname-$pkgver-r$pkgrel.tar.gz *
|
||||
}
|
||||
|
||||
postcheck() {
|
||||
@ -678,20 +669,17 @@ pre_split() {
|
||||
# the subpackages should not inherit those form main package
|
||||
provides=""
|
||||
install_if=""
|
||||
apkbuild_arch="$arch"
|
||||
}
|
||||
|
||||
prepare_subpackages() {
|
||||
local i
|
||||
cd "$startdir"
|
||||
for i in $subpackages; do
|
||||
local func=$(get_split_func $i)
|
||||
# call abuild recursively, setting subpkg{dir,name}
|
||||
msg "Running split function $func..."
|
||||
local dir="$pkgbasedir/${i%%:*}" name="${i%%:*}"
|
||||
( subpkgdir="$dir" subpkgname="$name" \
|
||||
$0 pre_split $func prepare_package \
|
||||
&& postcheck "$dir" "$name" ) || return 1
|
||||
( subpkg_set "$i"; msg "Running split function $subpkgsplit..."; \
|
||||
subpkgdir="$pkgbasedir/$subpkgname" subpkgname="$subpkgname" subpkgarch="$subpkgarch" \
|
||||
$0 pre_split $subpkgsplit prepare_package \
|
||||
&& postcheck "$pkgbasedir/$subpkgname" "$subpkgname" ) || return 1
|
||||
done
|
||||
postcheck "$pkgdir" "$pkgname" || return 1
|
||||
# post check for /usr/share/locale
|
||||
@ -704,7 +692,7 @@ prepare_subpackages() {
|
||||
default_lang() {
|
||||
pkgdesc="Languages for package $pkgname"
|
||||
install_if="$pkgname=$pkgver-r$pkgrel lang"
|
||||
arch="noarch"
|
||||
|
||||
local dir
|
||||
for dir in ${langdir:-/usr/share/locale}; do
|
||||
mkdir -p "$subpkgdir"/${dir%/*}
|
||||
@ -722,8 +710,8 @@ default_lang_subpkg() {
|
||||
return 1
|
||||
fi
|
||||
pkgdesc="$pkgname language pack for $lang"
|
||||
arch="noarch"
|
||||
install_if="$pkgname=$pkgver-r$pkgrel lang-$lang"
|
||||
|
||||
local dir
|
||||
for dir in ${langdir:-/usr/share/locale}; do
|
||||
mkdir -p "$subpkgdir"/$dir
|
||||
@ -738,6 +726,7 @@ lang_subpkg() {
|
||||
}
|
||||
|
||||
prepare_language_packs() {
|
||||
local lang
|
||||
for lang in $linguas; do
|
||||
lang="$lang" \
|
||||
subpkgname="$pkgname-lang-$lang" \
|
||||
@ -787,8 +776,8 @@ check_depends_dev() {
|
||||
fi
|
||||
local i
|
||||
for i in $pkgname $subpackages; do
|
||||
case "$i" in
|
||||
*-dev) return 0 ;;
|
||||
case "${i%%:*}" in
|
||||
*-dev) return 0 ;;
|
||||
esac
|
||||
done
|
||||
return 1
|
||||
@ -808,16 +797,12 @@ prepare_metafiles() {
|
||||
mkdir -p "$controldir"
|
||||
local builddate=$(date -u "+%s")
|
||||
local size=$(du -sk | awk '{print $1 * 1024}')
|
||||
local parch="$CARCH"
|
||||
|
||||
# we need to wait with setting noarch til our build infra can handle it
|
||||
# if [ "$arch" = "noarch" ]; then
|
||||
# parch="noarch"
|
||||
# fi
|
||||
|
||||
# save arch incase subpackages set it different than main pkg
|
||||
if [ "${apkbuild_arch:-$arch}" != "$arch" ]; then
|
||||
echo "$arch" > "$controldir"/.arch
|
||||
if [ "$arch" != "$apkbuild_arch" ]; then
|
||||
local msg="Split function set arch=\"$arch\" for $name, use subpackages=pkg:split:arch format instead"
|
||||
[ "$arch" != "noarch" ] && die "$msg"
|
||||
warning "$msg"
|
||||
subpkgarch="$arch"
|
||||
fi
|
||||
|
||||
echo "# Generated by $(basename $0) $program_version" >"$pkginfo"
|
||||
@ -833,7 +818,7 @@ url = $url
|
||||
builddate = $builddate
|
||||
packager = ${PACKAGER:-"Unknown"}
|
||||
size = $size
|
||||
arch = $parch
|
||||
arch = ${subpkgarch:-$pkgarch}
|
||||
origin = $pkgname
|
||||
EOF
|
||||
local i deps
|
||||
@ -904,7 +889,7 @@ EOF
|
||||
prepare_trace_rpaths() {
|
||||
local dir=${subpkgdir:-$pkgdir}
|
||||
local etype= soname= file= sover=
|
||||
[ "$arch" = "noarch" ] && return 0
|
||||
[ "${subpkgarch:-$pkgarch}" = "noarch" ] && return 0
|
||||
options_has "!tracedeps" && return 0
|
||||
# lets tell all the places we should look for .so files - all rpaths
|
||||
scanelf --quiet --recursive --rpath "$dir" \
|
||||
@ -974,10 +959,10 @@ is_doc_pkg() {
|
||||
archcheck() {
|
||||
options_has "!archcheck" && return 0
|
||||
if dir_has_arch_binaries "${subpkgdir:-$pkgdir}"; then
|
||||
[ "$arch" != "noarch" ] && return 0
|
||||
[ "${subpkgarch:-$pkgarch}" != "noarch" ] && return 0
|
||||
error "Arch specific binaries found so arch must not be set to \"noarch\""
|
||||
return 1
|
||||
elif [ "$arch" != "noarch" ] && ! is_dev_pkg; then
|
||||
elif [ "${subpkgarch:-$pkgarch}" != "noarch" ] && ! is_dev_pkg; then
|
||||
# we dont want -dev package go to noarch
|
||||
warning "No arch specific binaries found so arch should probably be set to \"noarch\""
|
||||
fi
|
||||
@ -1041,7 +1026,15 @@ subpkg_provides_pc() {
|
||||
trace_apk_deps() {
|
||||
local name="$1"
|
||||
local dir="$2"
|
||||
local parch="$3"
|
||||
local i= found= autodeps= deppkgs= missing=
|
||||
local apkroot=
|
||||
|
||||
case "$parch" in
|
||||
$CBUILD_ARCH) ;;
|
||||
$CARCH | $CTARGET_ARCH) apkroot="--root $CBUILDROOT" ;;
|
||||
esac
|
||||
|
||||
msg "Tracing dependencies..."
|
||||
# add pkgconfig if usr/lib/pkgconfig is found
|
||||
if [ -d "$pkgbasedir"/$name/usr/lib/pkgconfig ] \
|
||||
@ -1063,8 +1056,8 @@ trace_apk_deps() {
|
||||
|
||||
if subpkg_provides_prefixed_so "$i"; then
|
||||
autodeps="$autodeps so:$sonameprefix$i"
|
||||
elif subpkg_provides_so "$i" || cross_compiling \
|
||||
|| $APK info --quiet --installed "so:$i"; then
|
||||
elif subpkg_provides_so "$i" \
|
||||
|| $APK $apkroot info --quiet --installed "so:$i"; then
|
||||
autodeps="$autodeps so:$i"
|
||||
else
|
||||
missing="$missing $i"
|
||||
@ -1075,7 +1068,7 @@ trace_apk_deps() {
|
||||
if [ -f "$dir"/.rpaths ]; then
|
||||
local so_files=$(find_so_files "$dir"/.rpaths $missing) \
|
||||
|| return 1
|
||||
deppkgs=$($APK info --quiet --who-owns $so_files) || return 1
|
||||
deppkgs=$($APK $apkroot info --quiet --who-owns $so_files) || return 1
|
||||
fi
|
||||
|
||||
for found in $deppkgs; do
|
||||
@ -1093,9 +1086,9 @@ trace_apk_deps() {
|
||||
|
||||
# pkg-config depends
|
||||
for i in $(sort -u "$dir"/.needs-pc 2>/dev/null); do
|
||||
if subpkg_provides_pc "$i" || cross_compiling \
|
||||
|| $APK info --quiet --installed "pc:$i"; then
|
||||
local provider=$(apk search --quiet "pc:$i")
|
||||
if subpkg_provides_pc "$i" \
|
||||
|| $APK $apkroot info --quiet --installed "pc:$i"; then
|
||||
local provider=$(apk $apkroot search --quiet "pc:$i")
|
||||
if list_has "$provider" $depends_dev; then
|
||||
warning "$provider should be removed from depends_dev"
|
||||
fi
|
||||
@ -1104,7 +1097,7 @@ trace_apk_deps() {
|
||||
warning "Could not find any provider for pc:$i"
|
||||
local pcfile=/usr/lib/pkgconfig/"${i%%[<>=]*}".pc
|
||||
if [ -e "$pcfile" ]; then
|
||||
local owner=$($APK info --quiet --who-owns $pcfile)
|
||||
local owner=$($APK $apkroot info --quiet --who-owns $pcfile)
|
||||
warning "${owner:-package providing $pcfile} needs to be rebuilt"
|
||||
fi
|
||||
fi
|
||||
@ -1153,7 +1146,7 @@ scan_shared_objects() {
|
||||
local name="$1" controldir="$2" datadir="$3"
|
||||
local opt= i=
|
||||
|
||||
if [ "$arch" = "noarch" ] && ! [ -e "$controldir"/.arch ]; then
|
||||
if [ "${subpkgarch:-$pkgarch}" = "noarch" ]; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
@ -1300,7 +1293,6 @@ human_size() {
|
||||
create_apks() {
|
||||
local file= dir= name= ver= apk= datadir= size=
|
||||
getpkgver || return 1
|
||||
mkdir -p "$PKGDEST"
|
||||
if ! options_has "!tracedeps"; then
|
||||
for file in "$pkgbasedir"/.control.*/.PKGINFO; do
|
||||
dir="${file%/.PKGINFO}"
|
||||
@ -1316,15 +1308,16 @@ create_apks() {
|
||||
fi
|
||||
|
||||
for file in "$pkgbasedir"/.control.*/.PKGINFO; do
|
||||
dir="${file%/.PKGINFO}"
|
||||
name=$(pkginfo_val pkgname $file)
|
||||
ver=$(pkginfo_val pkgver $file)
|
||||
size=$(pkginfo_val size $file | human_size)
|
||||
apk=$name-$ver.apk
|
||||
datadir="$pkgbasedir"/$name
|
||||
subpkgname=$name
|
||||
local dir="${file%/.PKGINFO}"
|
||||
local name=$(pkginfo_val pkgname $file)
|
||||
local ver=$(pkginfo_val pkgver $file)
|
||||
local size=$(pkginfo_val size $file | human_size)
|
||||
local apk=$name-$ver.apk
|
||||
local datadir="$pkgbasedir"/$name
|
||||
local subpkgname=$name
|
||||
local subpkgarch=$(pkginfo_val arch $file)
|
||||
|
||||
trace_apk_deps "$name" "$dir" || return 1
|
||||
trace_apk_deps "$name" "$dir" "$subpkgarch" || return 1
|
||||
msg "Package size: ${size}"
|
||||
msg "Compressing data..."
|
||||
(
|
||||
@ -1349,40 +1342,10 @@ create_apks() {
|
||||
abuild-sign -q control.tar.gz || exit 1
|
||||
|
||||
msg "Create $apk"
|
||||
# create the final apk
|
||||
cat control.tar.gz data.tar.gz > "$PKGDEST"/$apk
|
||||
mkdir -p "$REPODEST"/$repo/${subpkgarch/noarch/$CARCH}
|
||||
cat control.tar.gz data.tar.gz > "$REPODEST"/$repo/${subpkgarch/noarch/$CARCH}/$apk
|
||||
)
|
||||
done
|
||||
subpkgname=
|
||||
}
|
||||
|
||||
clean_abuildrepo() {
|
||||
local apk
|
||||
cd "$abuildrepo" || return 1
|
||||
|
||||
# remove compat symlink
|
||||
for d in "$abuildrepo/$CARCH"; do
|
||||
[ -L "$d" ] && rm "$d"
|
||||
done
|
||||
|
||||
# remove broken links from abuildrepo
|
||||
for apk in *.apk */*.apk; do
|
||||
if [ -L "$apk" ] && [ ! -f "$apk" ]; then
|
||||
rm -f "$apk"
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
mklinks_abuildrepo() {
|
||||
[ -n "$REPODEST" ] && return 0
|
||||
local apk
|
||||
mkdir -p "$abuildrepo"/$CARCH
|
||||
cd "$abuildrepo" || return 1
|
||||
# create links for this package
|
||||
for apk in $(listpkg); do
|
||||
[ -f "$PKGDEST"/$apk ] || continue
|
||||
ln -sf "$PKGDEST"/$apk "$abuildrepo"/$CARCH/$apk
|
||||
done
|
||||
}
|
||||
|
||||
build_abuildrepo() {
|
||||
@ -1394,7 +1357,7 @@ build_abuildrepo() {
|
||||
if ! apk_up2date || [ -n "$force" ]; then
|
||||
# check early if we have abuild key
|
||||
abuild-sign --installed || return 1
|
||||
logcmd "building ${abuildrepo##*/}/$pkgname-$pkgver-r$pkgrel"
|
||||
logcmd "building $repo/$pkgname-$pkgver-r$pkgrel"
|
||||
sanitycheck && builddeps && clean && fetch && unpack \
|
||||
&& prepare && mkusers && $_build && rootpkg \
|
||||
&& cleanup $CLEANUP \
|
||||
@ -1404,33 +1367,44 @@ build_abuildrepo() {
|
||||
}
|
||||
|
||||
update_abuildrepo_index() {
|
||||
clean_abuildrepo
|
||||
mklinks_abuildrepo
|
||||
local i allarch=""
|
||||
for i in $allpackages; do
|
||||
subpkg_set "$i"
|
||||
##NOARCH: These packages are really in $CARCH and do not need their
|
||||
# own repository. --rewrite-arch is used below to make sure the index
|
||||
# thinks they are for $CARCH and apk-tools will fetch them from
|
||||
# correct URL path. Remainder of the script uses ${subpkgarch/noarch/$CARCH}
|
||||
# when expanding to the target repository path.
|
||||
[ "$subpkgarch" = "noarch" ] && subpkgarch="$CARCH"
|
||||
list_has "$subpkgarch" "$allarch" || allarch="$allarch $subpkgarch"
|
||||
done
|
||||
subpkg_unset
|
||||
|
||||
cd "$abuildrepo"
|
||||
local index=$CARCH/APKINDEX.tar.gz
|
||||
for i in $allarch; do
|
||||
cd "$REPODEST/$repo/$i"
|
||||
local index=$i/APKINDEX.tar.gz
|
||||
|
||||
msg "Updating the cached abuild repository index..."
|
||||
local sign=".SIGN.RSA.${SIGN_PUBLIC_KEY##*/}"
|
||||
local oldindex=
|
||||
if [ -f "$index" ]; then
|
||||
oldindex="--index $index"
|
||||
fi
|
||||
$APK index --quiet $oldindex --output "$index".unsigned \
|
||||
--description "$repo $(cd $startdir && git describe)" \
|
||||
--rewrite-arch $CARCH \
|
||||
$CARCH/*.apk || exit 1
|
||||
msg "Signing the index..."
|
||||
abuild-sign -q "$index".unsigned || exit 1
|
||||
mv "$index".unsigned "$index"
|
||||
chmod 644 "$index"
|
||||
msg "Updating the $repo/$i repository index..."
|
||||
local sign=".SIGN.RSA.${SIGN_PUBLIC_KEY##*/}"
|
||||
local oldindex=
|
||||
if [ -f APKINDEX.tar.gz ]; then
|
||||
oldindex="--index APKINDEX.tar.gz"
|
||||
fi
|
||||
( $APK index --quiet $oldindex --output APKINDEX.tar.gz.$$ \
|
||||
--description "$repo $(cd $startdir && git describe)" \
|
||||
--rewrite-arch $i *.apk && \
|
||||
msg "Signing the index..." && \
|
||||
abuild-sign -q APKINDEX.tar.gz.$$ && \
|
||||
chmod 644 APKINDEX.tar.gz.$$ && \
|
||||
mv APKINDEX.tar.gz.$$ APKINDEX.tar.gz \
|
||||
) || (rm -f APKINDEX.tar.gz.$$ ; die "Failed to create index")
|
||||
done
|
||||
}
|
||||
|
||||
# predefined splitfunc doc
|
||||
default_doc() {
|
||||
depends="$depends_doc"
|
||||
pkgdesc="$pkgdesc (documentation)"
|
||||
arch=${arch_doc:-"noarch"}
|
||||
install_if="docs $pkgname=$pkgver-r$pkgrel"
|
||||
|
||||
local i
|
||||
@ -1499,10 +1473,10 @@ default_dbg() {
|
||||
mkdir -p $dstdir
|
||||
fi
|
||||
cd $srcdir
|
||||
objcopy --only-keep-debug $srcfile $dstfile
|
||||
objcopy --add-gnu-debuglink=$dstfile $srcdir/$srcfile
|
||||
${CROSS_COMPILE}objcopy --only-keep-debug $srcfile $dstfile
|
||||
${CROSS_COMPILE}objcopy --add-gnu-debuglink=$dstfile $srcdir/$srcfile
|
||||
mv $dstfile $dstdir
|
||||
strip $srcfile
|
||||
${CROSS_COMPILE}strip $srcfile
|
||||
done
|
||||
return 0
|
||||
}
|
||||
@ -1624,9 +1598,9 @@ srcpkg() {
|
||||
files="$files $prefix/$f"
|
||||
done
|
||||
|
||||
mkdir -p "$PKGDEST"
|
||||
mkdir -p "$REPODEST/src"
|
||||
msg "Creating source package $p.src.tar.gz..."
|
||||
(cd .. && tar -zcf "$PKGDEST/$p.src.tar.gz" $files)
|
||||
(cd .. && tar -zcf "$REPODEST/src/$p.src.tar.gz" $files)
|
||||
}
|
||||
|
||||
# return true if arch is supported or noarch
|
||||
@ -1651,22 +1625,26 @@ check_libc() {
|
||||
# check if package is up to date
|
||||
apk_up2date() {
|
||||
getpkgver || return 1
|
||||
local pkg="$PKGDEST/$pkgname-$pkgver-r$pkgrel.apk"
|
||||
|
||||
local i s
|
||||
cd "$startdir"
|
||||
for i in $pkgname $subpackages; do
|
||||
[ -f "$PKGDEST/${i%%:*}-$pkgver-r$pkgrel.apk" ] || return 1
|
||||
for i in $allpackages; do
|
||||
subpkg_set "$i"
|
||||
if [ ! -f "$REPODEST/$repo/${subpkgarch/noarch/$CARCH}/$subpkgname-$pkgver-r$pkgrel.apk" ]; then
|
||||
subpkg_unset
|
||||
return 1
|
||||
fi
|
||||
done
|
||||
subpkg_unset
|
||||
[ -n "$keep" ] && return 0
|
||||
|
||||
cd "$startdir"
|
||||
for i in $source APKBUILD; do
|
||||
local s
|
||||
if is_remote "$i"; then
|
||||
s="$SRCDEST/$(filename_from_uri $i)"
|
||||
else
|
||||
s="$startdir/${i##*/}"
|
||||
fi
|
||||
if [ "$s" -nt "$pkg" ]; then
|
||||
if [ "$s" -nt "$REPODEST/$repo/$pkgarch/$pkgname-$pkgver-r$pkgrel.apk" ]; then
|
||||
return 1
|
||||
fi
|
||||
done
|
||||
@ -1676,19 +1654,21 @@ apk_up2date() {
|
||||
abuildindex_up2date() {
|
||||
local i
|
||||
getpkgver || return 1
|
||||
local dir="$abuildrepo"/$CARCH
|
||||
local apk="${pkgname%%:*}-$pkgver-r$pkgrel.apk"
|
||||
local idx="$dir"/APKINDEX.tar.gz
|
||||
local file="$dir"/$apk
|
||||
|
||||
# check if index is missing
|
||||
[ -f "$idx" ] || return 1
|
||||
for i in $allpackages; do
|
||||
subpkg_set "$i"
|
||||
local dir="$REPODEST"/$repo/${subpkgarch/noarch/$CARCH}
|
||||
local idx="$dir"/APKINDEX.tar.gz
|
||||
local file="$dir"/$subpkgname-$pkgver-r$pkgrel.apk
|
||||
|
||||
# if link or file is missing, then we need update abuildrepo index
|
||||
[ -f "$file" ] || return 1
|
||||
|
||||
# if file exists and is newer than index, then we need update index
|
||||
[ "$file" -nt "$idx" ] && return 1
|
||||
# if any file is missing or .apk is newer then index
|
||||
# the index needs to be updated
|
||||
if [ ! -f "$idx" -o ! -f "$file" -o "$file" -nt "$idx" ]; then
|
||||
subpkg_unset
|
||||
return 1
|
||||
fi
|
||||
done
|
||||
subpkg_unset
|
||||
|
||||
return 0
|
||||
}
|
||||
@ -1780,33 +1760,41 @@ trace_makedepends() {
|
||||
'
|
||||
}
|
||||
|
||||
# build and install dependencies
|
||||
builddeps() {
|
||||
local pkg= i= missing=
|
||||
local hostdeps= builddeps= installed_hostdeps= installed_builddeps=
|
||||
[ -n "$nodeps" ] && return 0
|
||||
msg "Analyzing dependencies..."
|
||||
calcdeps() {
|
||||
builddeps=
|
||||
hostdeps=
|
||||
|
||||
# add depends unless it is a subpackage or package itself
|
||||
if cross_compiling && [ -n "$makedepends_build" -o -n "$makedepends_host" ]; then
|
||||
builddeps="$makedepends_build"
|
||||
for i in $BUILD_BASE; do
|
||||
[ "$pkgname" = "${i%%[<>=]*}" ] && continue
|
||||
subpackages_has ${i%%[<>=]*} || builddeps="$builddeps $i"
|
||||
for i in $1 $makedepends_build; do
|
||||
list_has $i $hostdeps && continue
|
||||
builddeps="$builddeps $i"
|
||||
done
|
||||
for i in $depends $makedepends_host; do
|
||||
[ "$pkgname" = "${i%%[<>=]*}" ] && continue
|
||||
list_has $i $hostdeps && continue
|
||||
subpackages_has ${i%%[<>=]*} || hostdeps="$hostdeps $i"
|
||||
done
|
||||
else
|
||||
for i in $BUILD_BASE $depends $makedepends; do
|
||||
[ -z "$makedepends" ] && makedepends="$makedepends_build $makedepends_host"
|
||||
for i in $1 $depends $makedepends; do
|
||||
[ "$pkgname" = "${i%%[<>=]*}" ] && continue
|
||||
list_has $i $builddeps && continue
|
||||
subpackages_has ${i%%[<>=]*} || builddeps="$builddeps $i"
|
||||
done
|
||||
fi
|
||||
}
|
||||
|
||||
# build and install dependencies
|
||||
builddeps() {
|
||||
local pkg= i= missing=
|
||||
local installed_hostdeps= installed_builddeps=
|
||||
[ -n "$nodeps" ] && return 0
|
||||
|
||||
msg "Analyzing dependencies..."
|
||||
calcdeps "$BUILD_BASE"
|
||||
|
||||
installed_builddeps=$($APK info --installed $builddeps)
|
||||
[ -n "$hostdeps" ] && installed_hostdeps=$($APK info --root "$CBUILDROOT" --installed $hostdeps)
|
||||
[ -n "$CBUILDROOT" -a -n "$hostdeps" ] && installed_hostdeps=$($APK info --root "$CBUILDROOT" --installed $hostdeps)
|
||||
|
||||
# find which deps are missing
|
||||
for i in $builddeps; do
|
||||
@ -1841,28 +1829,21 @@ builddeps() {
|
||||
if [ -n "$install_deps" ] && [ -z "$recursive" ]; then
|
||||
# make a --simulate run first to detect missing deps
|
||||
# apk-tools --virtual is no goot at reporting those.
|
||||
$SUDO_APK add --repository "$abuildrepo" $apk_opt_wait \
|
||||
--simulate --quiet $builddeps || return 1
|
||||
$SUDO_APK add --repository "$abuildrepo" $apk_opt_wait \
|
||||
--virtual .makedepends-$pkgname $builddeps || return 1
|
||||
if cross_compiling; then
|
||||
$SUDO_APK add --root "$CBUILDROOT" --repository "$abuildrepo" $apk_opt_wait \
|
||||
--simulate --quiet $hostdeps || return 1
|
||||
$SUDO_APK add --root "$CBUILDROOT" --repository "$abuildrepo" $apk_opt_wait \
|
||||
--no-scripts --virtual .makedepends-$pkgname $hostdeps || return 1
|
||||
fi
|
||||
deps "--quiet --simulate" || return 1
|
||||
deps || return 1
|
||||
return 0
|
||||
fi
|
||||
|
||||
[ -z "$recursive" ] && return 1
|
||||
|
||||
if [ -n "$CBUILDROOT" ]; then
|
||||
error "Recursive rebuilding is not supported when cross compiling."
|
||||
error "Recursive rebuilding (-R) is not supported when cross compiling."
|
||||
return 1
|
||||
fi
|
||||
[ -z "$recursive" ] && return 1
|
||||
|
||||
# find dependencies that are installed but missing in repo.
|
||||
for i in $builddeps; do
|
||||
local m=$($APK search --repository "$abuildrepo" ${i%%[<>=]*})
|
||||
local m=$($APK search --repository "$REPODEST/$repo" ${i%%[<>=]*})
|
||||
if [ -z "$m" ]; then
|
||||
missing="$missing $i"
|
||||
fi
|
||||
@ -1890,7 +1871,7 @@ builddeps() {
|
||||
cd "$dir" && $0 $forceroot $keep $quiet $install_deps \
|
||||
$recursive $upgrade $color_opt abuildindex || return 1
|
||||
done
|
||||
$SUDO_APK add --upgrade --repository "$abuildrepo" \
|
||||
$SUDO_APK add --upgrade --repository "$REPODEST/$repo" \
|
||||
$apk_opt_wait \
|
||||
--virtual .makedepends-$pkgname $builddeps
|
||||
}
|
||||
@ -1927,16 +1908,24 @@ checksum() {
|
||||
|
||||
stripbin() {
|
||||
local bin
|
||||
if options_has "!strip" || [ "$arch" = "noarch" ]; then
|
||||
if options_has "!strip" || [ "${subpkgarch:-$pkgarch}" = "noarch" ]; then
|
||||
return 0
|
||||
fi
|
||||
cd "${subpkgdir:-$pkgdir}" || return 1
|
||||
|
||||
local stripcmd=strip
|
||||
case "${subpkgarch:-$pkgarch}" in
|
||||
$CBUILD_ARCH) stripcmd="strip" ;;
|
||||
$CARCH) stripcmd="${CHOST}-strip" ;;
|
||||
$CTARGET_ARCH) stripcmd="${CTARGET}-strip" ;;
|
||||
esac
|
||||
|
||||
msg "Stripping binaries"
|
||||
scanelf --recursive --nobanner --etype "ET_DYN,ET_EXEC" . \
|
||||
| sed -e 's:^ET_DYN ::' -e 's:^ET_EXEC ::' \
|
||||
| while read filename; do
|
||||
XATTR=$(getfattr --match="" --dump "${filename}")
|
||||
${CROSS_COMPILE}strip "${filename}"
|
||||
"${stripcmd}" "${filename}"
|
||||
[ -n "$XATTR" ] && (echo "$XATTR" | setfattr --restore=-)
|
||||
done
|
||||
}
|
||||
@ -1945,9 +1934,11 @@ stripbin() {
|
||||
listpkg() {
|
||||
local name
|
||||
getpkgver || return 1
|
||||
for name in $(listpkgnames) ; do
|
||||
echo "$name-$pkgver-r$pkgrel.apk"
|
||||
for name in $allpackages ; do
|
||||
subpkg_set $name
|
||||
echo "$subpkgname-$pkgver-r$pkgrel.apk"
|
||||
done
|
||||
subpkg_unset
|
||||
}
|
||||
|
||||
source_has() {
|
||||
@ -2020,42 +2011,29 @@ install_has() {
|
||||
list_has "$1" $install
|
||||
}
|
||||
|
||||
# install package after build
|
||||
post_add() {
|
||||
getpkgver || return 1
|
||||
local pkgf="$PKGDEST/$1-$pkgver-r$pkgrel.apk"
|
||||
local deps i
|
||||
if ! subpackages_has $1 && [ "$1" != "$pkgname" ]; then
|
||||
die "$1 is not built by this APKBUILD"
|
||||
fi
|
||||
# recursively install dependencies that are provided by this APKBUILD
|
||||
deps=$($APK index "$pkgf" 2>/dev/null | awk -F: '$1=="D" { print $2 }')
|
||||
for i in $deps; do
|
||||
if subpackages_has $i || [ "$i" = "$pkgname" ]; then
|
||||
post_add $i || return 1
|
||||
fi
|
||||
done
|
||||
$SUDO_APK add $apk_opt_wait --upgrade "$pkgf" \
|
||||
|| die "Failed to install $1"
|
||||
}
|
||||
|
||||
deps() {
|
||||
local builddeps= i
|
||||
for i in $depends $makedepends; do
|
||||
[ "$pkgname" = "${i%%[<>=]*}" ] && continue
|
||||
subpackages_has ${i%%[<>=]*} || builddeps="$builddeps $i"
|
||||
done
|
||||
$SUDO_APK add $apk_opt_wait --repository "$abuildrepo" \
|
||||
[ -z "$hostdeps" -a -z "$builddeps" ] && calcdeps
|
||||
|
||||
local _quiet="$1"
|
||||
[ -z "$_quiet" ] && msg "Installing for build:$builddeps"
|
||||
$SUDO_APK add $_quiet $apk_opt_wait --repository "$REPODEST/$repo" \
|
||||
--virtual .makedepends-$pkgname \
|
||||
$builddeps
|
||||
if [ -n "$CBUILDROOT" ]; then
|
||||
[ -z "$_quiet" ] && msg "Installing for host:$hostdeps"
|
||||
$SUDO_APK add $_quiet --root "$CBUILDROOT" --repository "$REPODEST/$repo" $apk_opt_wait \
|
||||
--no-scripts --virtual .makedepends-$pkgname $hostdeps || return 1
|
||||
fi
|
||||
}
|
||||
|
||||
undeps (){
|
||||
$SUDO_APK del $apk_opt_wait .makedepends-$pkgname
|
||||
if cross_compiling; then
|
||||
$SUDO_APK del --root "$CBUILDROOT" $apk_opt_wait \
|
||||
undeps() {
|
||||
local _quiet="$@"
|
||||
$SUDO_APK del $_quiet $apk_opt_wait .makedepends-$pkgname
|
||||
if [ -n "$CBUILDROOT" ]; then
|
||||
$SUDO_APK del $_quiet --root "$CBUILDROOT" $apk_opt_wait \
|
||||
--no-scripts .makedepends-$pkgname
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
|
||||
# compat
|
||||
@ -2139,8 +2117,7 @@ snapshot() {
|
||||
usage() {
|
||||
echo "$program $program_version"
|
||||
cat << EOF
|
||||
usage: $program [options] [-i PKG] [-P REPODEST] [-p PKGDEST]
|
||||
[-s SRCDEST] [cmd] ...
|
||||
usage: $program [options] [-P REPODEST] [-s SRCDEST] [cmd] ...
|
||||
$program [-c] -n PKGNAME[-PKGVER]
|
||||
Options:
|
||||
-A Print CARCH and exit
|
||||
@ -2153,8 +2130,7 @@ Options:
|
||||
-k Keep built packages, even if APKBUILD or sources are newer
|
||||
-K Keep buildtime temp dirs and files (srcdir/pkgdir/deps)
|
||||
-m Disable colors (monochrome)
|
||||
-p Set package destination directory
|
||||
-P Set PKGDEST to REPODEST/<repo>/\$CARCH, where repo is the parents dir name
|
||||
-P Set REPODEST as the repository location for created packages
|
||||
-q Quiet
|
||||
-r Install missing dependencies from system repository (using sudo)
|
||||
-R Recursively build and install missing dependencies (using sudo)
|
||||
@ -2170,9 +2146,9 @@ Commands:
|
||||
cleanpkg Remove already built binary and source package
|
||||
deps Install packages listed in makedepends and depends
|
||||
fetch Fetch sources to \$SRCDEST and verify checksums
|
||||
index Regenerate the APKINDEX for abuildrepo
|
||||
index Regenerate indexes in \$REPODEST
|
||||
listpkg List target packages
|
||||
package Create package in \$PKGDEST
|
||||
package Create package in \$REPODEST
|
||||
prepare Apply patches
|
||||
rootpkg Run 'package', the split functions and create apks as fakeroot
|
||||
sanitycheck Basic sanity check of APKBUILD
|
||||
@ -2184,6 +2160,10 @@ Commands:
|
||||
up2date Compare target and sources dates
|
||||
verify Verify checksums
|
||||
|
||||
To activate cross compilation specify in environment:
|
||||
CHOST Arch or hostspec of machine to generate packages for
|
||||
CTARGET Arch or hostspec of machine to generate compiler for
|
||||
|
||||
EOF
|
||||
exit 0
|
||||
}
|
||||
@ -2191,7 +2171,7 @@ EOF
|
||||
APKBUILD="${APKBUILD:-./APKBUILD}"
|
||||
unset force
|
||||
unset recursive
|
||||
while getopts "AcdfFhi:kKimnp:P:qrRs:u" opt; do
|
||||
while getopts "AcdfFhkKimnp:P:qrRs:u" opt; do
|
||||
case $opt in
|
||||
'A') echo "$CARCH"; exit 0;;
|
||||
'c') enable_colors
|
||||
@ -2200,13 +2180,11 @@ while getopts "AcdfFhi:kKimnp:P:qrRs:u" opt; do
|
||||
'f') force="-f";;
|
||||
'F') forceroot="-F";;
|
||||
'h') usage;;
|
||||
'i') install_after="$install_after $OPTARG";;
|
||||
'k') keep="-k";;
|
||||
'K') CLEANUP="" ERROR_CLEANUP="" ;;
|
||||
'm') disable_colors
|
||||
color_opt="-m";;
|
||||
'n') die "Use newapkbuild to create new aports";;
|
||||
'p') PKGDEST=$OPTARG;;
|
||||
'P') REPODEST=$OPTARG;;
|
||||
'q') quiet="-q";;
|
||||
'r') install_deps="-r";;
|
||||
@ -2236,7 +2214,6 @@ repo=${startdir%/*}
|
||||
repo=${repo##*/}
|
||||
|
||||
SRCDEST=${SRCDEST:-$startdir}
|
||||
PKGDEST=${PKGDEST:-$startdir}
|
||||
|
||||
# set a default CC
|
||||
: ${CC:=gcc}
|
||||
@ -2246,15 +2223,15 @@ cd "$startdir" || die
|
||||
. "$APKBUILD"
|
||||
|
||||
# If REPODEST is set then it will override the PKGDEST
|
||||
if [ -n "$REPODEST" ]; then
|
||||
PKGDEST="$REPODEST/$repo/$CARCH"
|
||||
# for recursive action
|
||||
export REPODEST
|
||||
abuildrepo="$REPODEST"/$repo
|
||||
else
|
||||
abuildrepo="$abuildrepo_base"/$repo
|
||||
if [ -z "$REPODEST" ]; then
|
||||
warning "REPODEST is not set and is now required. Defaulting to ~/packages"
|
||||
[ -n "$PKGDEST" ] && die "PKGDEST is no longer supported."
|
||||
REPODEST="~/packages"
|
||||
fi
|
||||
|
||||
# for recursive action
|
||||
export REPODEST
|
||||
|
||||
# if we want build debug package
|
||||
if [ -n "$DEBUG" ] || subpackage_types_has "dbg"; then
|
||||
CFLAGS="$CFLAGS -g"
|
||||
@ -2262,16 +2239,27 @@ if [ -n "$DEBUG" ] || subpackage_types_has "dbg"; then
|
||||
options="$options !strip"
|
||||
fi
|
||||
|
||||
# If we are handling a sub package then reset subpackages and install
|
||||
if [ -n "$subpkgname" ]; then
|
||||
# If we are handling a sub package then reset subpackages and install
|
||||
origsubpackages="$subpackages"
|
||||
subpackages=
|
||||
else
|
||||
local i
|
||||
allpackages="$pkgname $subpackages"
|
||||
for i in $linguas; do
|
||||
allpackages="$allpackages $pkgname-lang-$i::noarch"
|
||||
done
|
||||
fi
|
||||
apkbuild_arch="$arch"
|
||||
pkgdir="$pkgbasedir/$pkgname"
|
||||
if [ -z "$pkgarch" ]; then
|
||||
pkgarch=$CARCH
|
||||
list_has noarch $arch && pkgarch=noarch
|
||||
fi
|
||||
controldir="$pkgbasedir"/.control.${subpkgname:-$pkgname}
|
||||
|
||||
trap 'die "Aborted by user"' INT
|
||||
[ -z "$subpkgdir" ] && set_xterm_title "abuild: $pkgname"
|
||||
[ -z "$subpkgdir" ] && set_xterm_title "abuild${CROSS_COMPILE+-$CARCH}: $pkgname"
|
||||
|
||||
if [ -z "$1" ]; then
|
||||
set all
|
||||
@ -2282,8 +2270,4 @@ while [ $# -gt 0 ]; do
|
||||
shift
|
||||
done
|
||||
|
||||
for i in $install_after; do
|
||||
post_add $i
|
||||
done
|
||||
|
||||
cleanup
|
||||
|
@ -3,6 +3,18 @@
|
||||
sysconfdir=@sysconfdir@
|
||||
program=${0##*/}
|
||||
|
||||
arch_to_hostspec() {
|
||||
case "$1" in
|
||||
aarch64) echo "aarch64-alpine-linux-musl" ;;
|
||||
armhf) echo "armhf-alpine-linux-muslgnueabihf" ;;
|
||||
armv7) echo "armv7-alpine-linux-musleabihf" ;;
|
||||
s390x) echo "s390x-alpine-linux-musl" ;;
|
||||
x86) echo "i586-alpine-linux-musl" ;;
|
||||
x86_64) echo "x86_64-alpine-linux-musl" ;;
|
||||
*) echo "unknown" ;;
|
||||
esac
|
||||
}
|
||||
|
||||
hostspec_to_arch() {
|
||||
case "$1" in
|
||||
aarch64*-*-*-*) echo "aarch64" ;;
|
||||
@ -10,6 +22,7 @@ hostspec_to_arch() {
|
||||
armv6*-*-*-*eabihf) echo "armhf" ;;
|
||||
armv7*-*-*-*eabihf) echo "armv7" ;;
|
||||
i[0-9]86-*-*-*) echo "x86" ;;
|
||||
s390x-*-*-*) echo "s390x" ;;
|
||||
x86_64-*-*-*) echo "x86_64" ;;
|
||||
*) echo "unknown" ;;
|
||||
esac
|
||||
@ -89,11 +102,40 @@ readconfig() {
|
||||
[ -z "$CBUILD" ] && CBUILD="$(gcc -dumpmachine)"
|
||||
[ -z "$CHOST" ] && CHOST="$CBUILD"
|
||||
[ -z "$CTARGET" ] && CTARGET="$CHOST"
|
||||
[ "$(arch_to_hostspec $CBUILD)" != "unknown" ] && CBUILD="$(arch_to_hostspec $CBUILD)"
|
||||
[ "$(arch_to_hostspec $CHOST)" != "unknown" ] && CHOST="$(arch_to_hostspec $CHOST)"
|
||||
[ "$(arch_to_hostspec $CTARGET)" != "unknown" ] && CTARGET="$(arch_to_hostspec $CTARGET)"
|
||||
|
||||
[ -z "$CARCH" ] && CARCH="$(hostspec_to_arch $CHOST)"
|
||||
[ -z "$CLIBC" ] && CLIBC="$(hostspec_to_libc $CHOST)"
|
||||
[ -z "$CBUILD_ARCH" ] && CBUILD_ARCH="$(hostspec_to_arch $CBUILD)"
|
||||
[ -z "$CTARGET_ARCH" ] && CTARGET_ARCH="$(hostspec_to_arch $CTARGET)"
|
||||
[ -z "$CTARGET_LIBC" ] && CTARGET_LIBC="$(hostspec_to_libc $CTARGET)"
|
||||
|
||||
if [ "$CHOST" != "$CTARGET" ]; then
|
||||
# setup environment for creating cross compiler
|
||||
[ -z "$CBUILDROOT" ] && export CBUILDROOT="$HOME/sysroot-$CTARGET_ARCH/"
|
||||
elif [ "$CBUILD" != "$CHOST" ]; then
|
||||
# setup build root
|
||||
[ -z "$CBUILDROOT" ] && export CBUILDROOT="$HOME/sysroot-$CTARGET_ARCH/"
|
||||
# prepare pkg-config for cross building
|
||||
[ -z "$PKG_CONFIG_PATH" ] && export PKG_CONFIG_PATH="${CBUILDROOT}/usr/lib/pkgconfig/"
|
||||
[ -z "$PKG_CONFIG_SYSROOT_DIR" ] && export PKG_CONFIG_SYSROOT_DIR="${CBUILDROOT}"
|
||||
# libtool bug workaround for extra rpaths
|
||||
[ -z "$lt_cv_sys_lib_dlsearch_path_spec" ] && \
|
||||
export lt_cv_sys_lib_dlsearch_path_spec="${CBUILDROOT}/lib ${CBUILDROOT}/usr/lib /usr/lib /lib /usr/local/lib"
|
||||
# setup cross-compiler
|
||||
if [ -z "$CROSS_COMPILE" ]; then
|
||||
export CROSS_COMPILE="${CHOST}-"
|
||||
export CC=${CROSS_COMPILE}gcc
|
||||
export CXX=${CROSS_COMPILE}g++
|
||||
export LD=${CROSS_COMPILE}ld
|
||||
export CPPFLAGS="--sysroot=${CBUILDROOT} $CPPFLAGS"
|
||||
export CXXFLAGS="--sysroot=${CBUILDROOT} $CXXFLAGS"
|
||||
export CFLAGS="--sysroot=${CBUILDROOT} $CFLAGS"
|
||||
export LDFLAGS="--sysroot=${CBUILDROOT} $LDFLAGS"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
readconfig
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user