--- trunk/mage/usr/lib/mage/smage2.sh 2006/03/04 23:29:45 347 +++ trunk/mage/usr/lib/mage/smage2.sh 2006/03/22 17:45:49 351 @@ -4,7 +4,7 @@ # needs pkgbuild_dir (mage) # SMAGE2 -# $Header: /home/cvsd/magellan-cvs/magellan-src/mage/usr/lib/mage/smage2.sh,v 1.41 2006-03-04 23:29:45 niro Exp $ +# $Header: /home/cvsd/magellan-cvs/magellan-src/mage/usr/lib/mage/smage2.sh,v 1.42 2006-03-22 17:45:49 niro Exp $ #01.10.2004 # added ccache support @@ -14,12 +14,33 @@ PKGSUFFIX="mpk" SMAGENAME="$1" SMAGESUFFIX="smage2" -#SOURCEDIR="/bootstrap/sources" -#SMAGESCRIPTSDIR="/bootstrap/smage2-install-scripts" -#SMAGE2RSYNC="rsync://192.168.0.2/smage2-scripts" MLIBDIR=/usr/lib/mage SMAGEVERSION="$( < ${MLIBDIR}/version)" +## only for tests -> normally in /etc/rc.d/init.d/functions +COLRED="\033[1;6m\033[31m" +COLGREEN="\033[1;6m\033[32m" +COLYELLOW="\033[1;6m\033[33m" +COLBLUE="\033[1;6m\033[34m" +COLMAGENTA="\033[1;6m\033[35m" +COLWHITE="\033[1;6m\033[37m" +COLGRAY="\033[0;6m\033[37m" +COLBOLD="\033[1m" +COLDEFAULT="\033[0m" + +if [[ ${NOCOLORS} = true ]] +then + COLRED="" + COLGREEN="" + COLYELLOW="" + COLBLUE="" + COLMAGENTA="" + COLWHITE="" + COLGRAY="" + COLBOLD="" + COLDEFAULT="" +fi + # export default C locale export LC_ALL=C @@ -166,7 +187,6 @@ do my_SRC_URI_MIRROR="$(echo ${my_SRC_URI} | sed "s|mirror:/|${mirror}/sources|g")" - #echo "DEBUG: ${MY_SRC_URI}" if [[ ${FETCHING} = true ]] then echo "==> fetching ${my_SRC_URI_MIRROR}" @@ -186,7 +206,6 @@ fi done else - #echo "DEBUG: ${SRC_URI[${i}]}" if [[ ${FETCHING} = true ]] then echo "==> fetching ${my_SRC_URI}" @@ -197,13 +216,6 @@ --progress bar \ --directory-prefix="${my_SOURCEDIR}" \ "${my_SRC_URI}" -# only needed to run through a list of mirrors -# if [ "$?" == "0" ] -# then -# break -# else -# continue -# fi fi fi @@ -248,6 +260,14 @@ return 0 } +mlibdir() +{ + local libdir=lib + [[ ${ARCH} = x86_64 ]] && libdir=lib64 + + echo "${libdir}" +} + mconfigure() { if [ -x ./configure ] @@ -260,6 +280,7 @@ --datadir=/usr/share \ --sysconfdir=/etc \ --localstatedir=/var/lib \ + --libdir=/usr/$(mlibdir) \ "$@" || die "mconfigure failed" else echo "configure is not an executable ..." @@ -277,6 +298,7 @@ localstatedir=${BINDIR}/var/lib \ mandir=${BINDIR}/usr/share/man \ sysconfdir=${BINDIR}/etc \ + libdir=${BINDIR}/usr/$(mlibdir) \ "$@" install || die "minstall failed" else die "no Makefile found" @@ -398,26 +420,10 @@ if [ -x /usr/bin/distcc ] then echo "Using DistCC for compilation ..." - export PATH=/usr/lib/distcc/bin:${PATH} || die "distcc: could not export new $PATH" - - # export distcc as compiler -# export CC="distcc" -# export CXX=distcc + export PATH=/usr/$(mlibdir)/distcc/bin:${PATH} || die "distcc: could not export new $PATH" export DISTCC_DIR="${DISTCC_DIR}" || die "distcc_dir export failed" - # ccache + distcc together - if [[ ${SMAGE_USE_CCACHE} = true ]] - then - if [ -x /usr/bin/ccache ] - then - echo "Preparing DistCC to work together with CCache ..." - #export CCACHE_PREFIX="distcc" || die "distcc: could not set ccach_prefix" -# export CC="ccache distcc" -# export CXX="ccache distcc" - fi - fi - # creating distcc tempdir install -o distcc -g daemon -d ${DISTCC_DIR} chmod 1777 ${DISTCC_DIR} @@ -429,8 +435,7 @@ if [ -x /usr/bin/ccache ] then echo "Using CCache for compilation ..." - export PATH=/usr/lib/ccache/bin:${PATH} || die "ccache: could not export new $PATH" - #unset CC CXX + export PATH=/usr/$(mlibdir)/ccache/bin:${PATH} || die "ccache: could not export new $PATH" fi } @@ -541,7 +546,7 @@ > ${dest} # header - echo '# $Header: /home/cvsd/magellan-cvs/magellan-src/mage/usr/lib/mage/smage2.sh,v 1.41 2006-03-04 23:29:45 niro Exp $' >> ${dest} + echo '# $Header: /home/cvsd/magellan-cvs/magellan-src/mage/usr/lib/mage/smage2.sh,v 1.42 2006-03-22 17:45:49 niro Exp $' >> ${dest} echo >> ${dest} # pgkname and state @@ -932,7 +937,7 @@ # setup distcc -# distcc mus be setup *before* ccache, as ccache need to be before distcc in path +# setup for distcc goes *before* ccache, so ccache comes before distcc in path [[ ${SMAGE_USE_DISTCC} = true ]] && setup_distcc_environment # setup ccache @@ -941,17 +946,6 @@ # small sleep to show our settings sleep 1 -#debug -#echo "CC=${CC}" -#echo "CXX=${CXX}" -#echo "DISTCC_DIR=${DISTCC_DIR}" -#echo "PATH: ${PATH}" -#echo "--------------------------------------" -#env -#echo "--------------------------------------" -#read -#debug end - # cleans up build if a previously one exists if [ -d ${BUILDDIR} ] then @@ -1067,6 +1061,5 @@ # for sure unset NOPKGBUILD unset NOSTRIP - + xtitleclean -#echo -e "\nPackage ${PKGNAME} successfully builded.\n"