Was supposed to be a linux distribution, now just a collection of build scripts for packages on top of (ideally) any distribution.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

51 lines
1.6 KiB

8 years ago
define_option 'cross=: Cross compile a program to run on the specified target triplet'
define_option "build=: Explicity specify the host machine's target triplet"
compile_configure() {
8 years ago
local builddir=''
local nomake=false
local noinstall=false
local olddir="$PWD"
8 years ago
local makeflags=''
local OPTIND=1
local opt
while getopts 'b:m:MI' opt; do case "$opt" in
b) local builddir="$OPTARG" ;;
m) local makeflags="$OPTARG" ;;
M) local nomake=true ;;
I) local noinstall=true ;;
esac; done
shift $((OPTIND-1))
8 years ago
[ "$1" = '--' ] && shift
if [ "$builddir" ]; then
mkdir -p "$builddir"
cd "$builddir"
fi
local cross="$(option =cross)"
[ "$cross" ] && local cross="--host=$cross"
local build="$(option =build)"
[ "$build" ] && local build="--build=$build"
"$olddir/configure" \
--prefix="/$dir_prefix" \
--sysconfdir="/$dir_sysconfdir" \
--bindir="/$dir_prefix/$dir_bindir" \
--sbindir="/$dir_prefix/$dir_sbindir" \
--libdir="/$dir_prefix/$dir_libdir" \
--libexecdir="/$dir_prefix/$dir_libexecdir" \
--datadir="/$dir_prefix/$dir_datadir" \
--mandir="/$dir_prefix/$dir_mandir" \
--docdir="/$dir_prefix/$dir_docdir/$name" \
--infodir="/$dir_prefix/$dir_infodir" \
--localedir="/$dir_prefix/$dir_localedir" \
$build $cross "$@"
[ "$nomake" = false ] && make $makeflags
[ "$nomake" = false -a "$noinstall" = false ] && make DESTDIR="$dir_install" $makeflags install
8 years ago
[ "$builddir" ] && cd "$olddir" || true
}