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() { local builddir='' local nomake=false local noinstall=false local olddir="$PWD" 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 $(expr $OPTIND - 1) [ "$1" = '--' ] && shift || true if [ "$builddir" ]; then mkdir -p "$builddir" cd "$builddir" fi local cross="$(option =cross)" [ "$cross" ] && local cross="--host=$cross" || true local build="$(option =build)" [ "$build" ] && local build="--build=$build" || true "$olddir/configure" \ --prefix="/$dir_prefix" \ --bindir="/$dir_prefix/$dir_bindir" \ --sbindir="/$dir_prefix/$dir_sbindir" \ --libexecdir="/$dir_prefix/$dir_libexecdir" \ --sysconfdir="/$dir_prefix/$dir_sysconfdir" \ --libdir="/$dir_prefix/$dir_libdir" \ --includedir="/$dir_prefix/$dir_includedir" \ --datadir="/$dir_prefix/$dir_datadir" \ --infodir="/$dir_prefix/$dir_infodir" \ --localedir="/$dir_prefix/$dir_localedir" \ --mandir="/$dir_prefix/$dir_mandir" \ --docdir="/$dir_prefix/$dir_docdir/$name" \ $build $cross "$@" if [ "$nomake" = false ]; then make $makeflags if [ "$noinstall" = false ]; then make DESTDIR="$dir_install" $makeflags install fi fi if [ "$builddir" ]; then cd "$olddir" fi }