--- trunk/mage/usr/lib/mage/smage2.sh 2012/01/13 13:17:21 1630 +++ trunk/mage/usr/lib/mage/smage2.sh 2012/01/13 13:26:43 1635 @@ -242,11 +242,28 @@ local myopts if [[ ! -z ${CTARGET} ]] then - myopts="--target=${CTARGET}" + myopts+=" --target=${CTARGET}" fi if [ -x ./configure ] then + # if requested disable-static + if [[ ! -z $(./configure --help | grep -- '--.*able-static') ]] + then + if mqueryfeature '!static' + then + myopts+=" --disable-static" + else + myopts+=" --enable-static" + fi + fi + + # always enable shared by default + if [[ ! -z $(./configure --help | grep -- '--.*able-shared') ]] + then + myopts+=" --enable-shared" + fi + ./configure \ --prefix=/usr \ --host=${CHOST} \ @@ -436,7 +453,7 @@ cat ${doc} | gzip -9c > ${BINDIR}/usr/share/doc/${PNAME}-${PVER}/$(basename ${doc}).gz || die "gzipping +installing ${doc}." chmod 0644 ${BINDIR}/usr/share/doc/${PNAME}-${PVER}/$(basename ${doc}).gz || die "fixing permissions of ${doc}." else - install -m 0644 ${SRCDIR}/${i} ${BINDIR}/usr/share/doc/${PNAME}-${PVER} || die "installing ${doc}." + install -m 0644 ${doc} ${BINDIR}/usr/share/doc/${PNAME}-${PVER} || die "installing ${doc}." fi fi done @@ -448,7 +465,7 @@ [[ -z ${stripdir} ]] && stripdir="${BINDIR}" [[ -z ${STRIP_DYN_LIB} ]] && STRIP_DYN_LIB="--strip-debug" - find ${stripdir} ! -type d | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs --no-run-if-empty strip ${STRIP_DYN_LIB} 2> /dev/null + find ${stripdir} ! -type d | xargs --no-run-if-empty file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs --no-run-if-empty strip ${STRIP_DYN_LIB} 2> /dev/null } mstripbins() @@ -457,7 +474,7 @@ [[ -z ${stripdir} ]] && stripdir="${BINDIR}" [[ -z ${STRIP_DYN_BIN} ]] && STRIP_DYN_BIN="--strip-debug" - find ${stripdir} ! -type d | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs --no-run-if-empty strip ${STRIP_DYN_BIN} 2> /dev/null + find ${stripdir} ! -type d | xargs --no-run-if-empty file | grep "executable" | grep ELF | cut -f 1 -d : | xargs --no-run-if-empty strip ${STRIP_DYN_BIN} 2> /dev/null } mstripstatic() @@ -466,7 +483,7 @@ [[ -z ${stripdir} ]] && stripdir="${BINDIR}" [[ -z ${STRIP_STATIC_LIB} ]] && STRIP_STATIC_LIB="--strip-debug" - find ${stripdir} ! -type d | xargs file | grep "ar archive" | cut -f 1 -d : | xargs --no-run-if-empty strip ${STRIP_STATIC_LIB} 2> /dev/null + find ${stripdir} ! -type d | xargs --no-run-if-empty file | grep "ar archive" | cut -f 1 -d : | xargs --no-run-if-empty strip ${STRIP_STATIC_LIB} 2> /dev/null } mstriplibtoolarchive() @@ -474,7 +491,7 @@ local stripdir="$@" [[ -z ${stripdir} ]] && stripdir="${BINDIR}" - find ${stripdir} ! -type d -name \*.la | xargs | grep "libtool library" | cut -f 1 -d : | xargs --no-run-if-empty rm -f -- 2> /dev/null + find ${stripdir} ! -type d -name \*.la | xargs --no-run-if-empty file | grep "libtool library" | cut -f 1 -d : | xargs --no-run-if-empty rm -f -- 2> /dev/null } mpurgetargets() @@ -1412,7 +1429,7 @@ # auto regen mage tree if requested regen_mage_tree -if mqueryfeature "srcpkg" +if mqueryfeature "srcpkgbuild" then if [[ -d ${SOURCEDIR}/${PNAME} ]] then @@ -1765,7 +1782,7 @@ fi # build src-pkg-tarball if requested - if mqueryfeature "srcpkg" + if mqueryfeature "srcpkgbuild" then run_resume srcpkgbuild || source_pkg_build ${SMAGENAME} resume_stamp srcpkgbuild