--- trunk/mage/usr/lib/mage/smage2.sh 2012/01/09 20:13:34 1617 +++ trunk/mage/usr/lib/mage/smage2.sh 2012/01/13 13:24:44 1634 @@ -177,6 +177,8 @@ fi echo -e "${COLBLUE}==>${COLGREEN} fetching ${uri}${COLDEFAULT}" + # always use verbose mode for source downloads + FVERBOSE=off msetfeature "verbose" # do not die here, mchecksum catches download errors mdownload --uri "${uri}" --dir "${outputdir}" @@ -240,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} \ @@ -434,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 @@ -446,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() @@ -455,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() @@ -464,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() @@ -472,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() @@ -1146,14 +1165,15 @@ resume_stamp() { local step="$1" - touch ${BUILDDIR}/.smage-${PKGNAME}-${step} + [[ ! -d ${BUILDDIR}/.stamps ]] && install -d ${BUILDDIR}/.stamps + touch ${BUILDDIR}/.stamps/smage-${PKGNAME}-${step} } run_resume() { local step="$1" - if mqueryfeature "resume" && [[ -f ${BUILDDIR}/.smage-${PKGNAME}-${step} ]] + if mqueryfeature "resume" && [[ -f ${BUILDDIR}/.stamps/smage-${PKGNAME}-${step} ]] then echo -e "${COLMAGENTA}${step} already processed; doing nothing${COLDEFAULT}" return 0 @@ -1486,6 +1506,12 @@ rm -rf ${BUILDDIR}/${PKGNAME} fi + # clean up stamps dir + if [ -d ${BUILDDIR}/.stamps ] + then + rm -rf ${BUILDDIR}/.stamps + fi + # setup build logging [[ ! -d /var/log/smage ]] && install -d /var/log/smage echo -e "### Build started on $(date) ###\n" > /var/log/smage/${PKGNAME}.log @@ -1758,7 +1784,7 @@ # build src-pkg-tarball if requested if mqueryfeature "srcpkg" then - resume_stamp srcpkgbuild || source_pkg_build ${SMAGENAME} + run_resume srcpkgbuild || source_pkg_build ${SMAGENAME} resume_stamp srcpkgbuild fi fi