head 1.6; access; symbols snapshots-20031203-import:1.1.1.1 snapshots:1.1.1; locks; strict; comment @# @; 1.6 date 2006.03.04.22.32.52; author fxkuehl; state Exp; branches; next 1.5; 1.5 date 2006.03.01.01.13.01; author fxkuehl; state Exp; branches; next 1.4; 1.4 date 2006.02.27.00.15.27; author fxkuehl; state Exp; branches; next 1.3; 1.3 date 2004.10.03.22.41.05; author fxkuehl; state dead; branches; next 1.2; 1.2 date 2004.02.12.17.36.55; author fxkuehl; state Exp; branches; next 1.1; 1.1 date 2003.12.03.15.37.55; author fxkuehl; state Exp; branches 1.1.1.1; next ; 1.1.1.1 date 2003.12.03.15.37.55; author fxkuehl; state Exp; branches; next ; desc @@ 1.6 log @Package and install libshadow.so in the common snapshots. Needed by the latest i810/i915 drivers. Cleanup inst/ after packaging. @ text @#!/bin/sh # # This script builds DRI binary snapshots from modular Xorg, Mesa and # DRM. Packaging is done by dripkg.sh. # # Felix Kuehling # # Remember the top-level directory TOP=`pwd` # Try to get rid of the locale unset LANG unset LANGUAGE unset LC_ALL # Debugging # This is a command, "true" means noop, set to "set -x" for debug trace. DEBUG_CHECKOUT="true" DEBUG_PREPARE="true" DEBUG_BUILD="true" DEBUG_PACKAGE="true" DEBUG_UPLOAD="true" #DEBUG_CHECKOUT="set -x" #DEBUG_PREPARE="set -x" #DEBUG_BUILD="set -x" #DEBUG_PACKAGE="set -x" #DEBUG_UPLOAD="set -x" # List of stages to be skipped for easier debugging SKIP_STAGES="" # # Configuration # . ./config.sh DATE=`date +%Y%m%d` OS=linux MACHINE=i386 # # Source code checkout and update # doCheckout() { root=$1 module=$2 branch=$3 $DEBUG_CHECKOUT mkdir -p $module if [ -d $module/CVS ]; then echo "Updating existing working copy of $module from branch $branch." ( cd $module; cvs -q -z3 update -r $branch -dPC ) || false else echo "Checking out new working copy of $module from branch $branch." cvs -q -z3 -d$root checkout -r $branch $module fi } checkoutComponent() { component=$1 root=$2 modules="$3" branch=$4 $DEBUG_CHECKOUT mkdir -p $component/$branch cd $component/$branch for module in $modules; do doCheckout $root $module $branch done cd ../.. } checkoutAll() { ( set -e $DEBUG_CHECKOUT mkdir -p cvs cd cvs for branch in $DRM_BRANCHES; do checkoutComponent drm $DRM_ROOT "$DRM_MODULE" $branch done for branch in $XORG_BRANCHES; do checkoutComponent xorg $XORG_ROOT "$XORG_MODULES" $branch done for branch in $MESA_BRANCHES; do checkoutComponent mesa $MESA_ROOT "$MESA_MODULE" $branch done ) > $TOP/log/checkout 2>&1 } # # Build tree preparation # symlinkSource() { config=$1 component=$2 branch=$3 $DEBUG_PREPARE echo "Symlinking build tree for $config/$component from branch $branch." cd build/$config rm -rf $component mkdir -p $component $TOP/lndir.sh -silent ../../../cvs/$component/$branch $component cd ../.. } prepareMesa() { config=$1 mesa_branch=$2 drm_branch=$3 dri_drivers=$4 flags=$5 $DEBUG_PREPARE echo "Patching Mesa build tree." cd build/$config/mesa/$MESA_MODULE # Patch configs/linux-dri-x86 for a minimal build rm -f configs/linux-dri-x86 cp -p ../../../../cvs/mesa/$mesa_branch/$MESA_MODULE/configs/linux-dri-x86 configs/linux-dri-x86 echo >> configs/linux-dri-x86 echo "DRM_SOURCE_PATH=$TOP/cvs/drm/$drm_branch/$DRM_MODULE" >> configs/linux-dri-x86 echo "LIBDRM_LIB = \`pkg-config --libs libdrm\`" >> configs/linux-dri-x86 echo "X11_INCLUDES = -I$TOP/inst/$config/include -I$XORG_PREFIX/include" >> configs/linux-dri-x86 echo "OPT_FLAGS = $flags" >> configs/linux-dri-x86 echo "SRC_DIRS = glx/x11 mesa" >> configs/linux-dri-x86 echo "DRI_DIRS = $dri_drivers" >> configs/linux-dri-x86 echo "DRI_LIB_DEPS = \$(EXTRA_LIB_PATH) -lm -lpthread /usr/lib/libexpat.a -ldl \$(LIBDRM_LIB)" >> configs/linux-dri-x86 echo "GL_LIB_DEPS = \$(EXTRA_LIB_PATH) -lX11 -lXext -lXxf86vm -lm -lpthread -ldl /usr/lib/libexpat.a \$(LIBDRM_LIB)" >> configs/linux-dri-x86 echo "MKDEP = $XORG_PREFIX/bin/makedepend" >> configs/linux-dri-x86 # Patch mklib for static linking (because of expat) rm -f bin/mklib cp -p ../../../../cvs/mesa/$mesa_branch/$MESA_MODULE/bin/mklib bin/mklib patch -d bin < $TOP/patches/mklib.diff cd ../../../.. } prepareAll() { config=$1 ( $DEBUG_PREPARE set -e eval branches=\$CONFIG_${config} eval dri_drivers=\$CONFIG_${config}_DRI_DRIVERS eval flags=\$CONFIG_${config}_FLAGS drm_branch=${branches%% *}; branches=${branches#* } xorg_branch=${branches%% *}; branches=${branches#* } mesa_branch=${branches} rm -rf build/$config mkdir -p build/$config rm -rf inst/$config mkdir -p inst/$config symlinkSource $config drm $drm_branch symlinkSource $config xorg $xorg_branch symlinkSource $config mesa $mesa_branch prepareMesa $config $mesa_branch $drm_branch "$dri_drivers" "$flags" ) > $TOP/log/$config.prepare 2>&1 } # # Build # buildDRM () { config=$1 flags="$2" $DEBUG_BUILD echo "Building DRM." cd build/$config/drm/$DRM_MODULE CFLAGS="$flags" ./autogen.sh -prefix $TOP/inst/$config \ --disable-shared --enable-static make make install cd ../../../.. } buildXorg () { config=$1 flags="$2" mesa_branch=$3 $DEBUG_BUILD server_opts="--with-mesa-source=$TOP/cvs/mesa/$mesa_branch/$MESA_MODULE \ --disable-dmx --disable-xvfb --disable-xnest --disable-xprint" cd build/$config/xorg for module in $XORG_MODULES; do echo "Building Xorg module $module." ( cd $module if [ $module = "xserver/xorg" ]; then opts=$server_opts else opts="" fi CFLAGS="$flags" ./autogen.sh --prefix $TOP/inst/$config \ $opts make make install ) || false done cd ../../.. } buildMesa () { config=$1 flags="$2" $DEBUG_BUILD echo "Building Mesa." make -C build/$config/mesa/$MESA_MODULE linux-dri-x86 } buildAll () { config=$1 ( set -e $DEBUG_BUILD eval branches=\$CONFIG_${config} eval flags=\$CONFIG_${config}_FLAGS mesa_branch=${branches##* } PKG_CONFIG_PATH=$TOP/inst/$config/lib/pkgconfig$PKG_CONFIG_PATH_POSTFIX export PKG_CONFIG_PATH if [ -n "$ACLOCAL_LOCALDIR" ]; then ACLOCAL="aclocal -I ${ACLOCAL_LOCALDIR}" export ACLOCAL fi buildDRM $config "$flags" > $TOP/log/$config-drm.build 2>&1 buildXorg $config "$flags" $mesa_branch > $TOP/log/$config-xorg.build 2>&1 buildMesa $config "$flags" > $TOP/log/$config-mesa.build 2>&1 ) } # # Package # packageAll () { config=$1 build=$2 eval branches=\$CONFIG_${config} eval drivers=\$CONFIG_${config}_DRIVERS eval extras=\$CONFIG_${config}_EXTRAS drm_branch=${branches%% *} ( set -e $DEBUG_PACKAGE error=0 for driver in $drivers; do ./dripkg.sh $build build/$config inst/$config \ cvs/drm/$drm_branch/$DRM_MODULE \ $driver "$extras" || error=1 done > log/$config.package 2>&1 [ $error -eq 0 ] ) } # # Cleanup # cleanupAll () { config=$1 rm -rf build/$config inst/$config > log/cleanup.log 2>&1 } # # Upload # uploadAll () { config=$1 build=$2 ( set -e if [ "$config" = "HEAD" ]; then destdir=${SNAPSHOTS} else destdir=${SNAPSHOTS}bleeding-edge/ fi error=0 if [ -d $destdir ]; then # For a local "upload" we use a simple mv instead of scp. echo "Moving build $build to $destdir." mv -v *-$build.tar.bz2 $destdir || error=1 else echo "Uploading build $build to $destdir." scp -qp *-$build.tar.bz2 $destdir || error=1 rm -f *-$build.tar.bz2 fi > log/$config.upload 2>&1 [ $error -eq 0 ] ) } # # Stage wrapper with error handling # matchList () { str="$1" lst="$2" for item in $lst; do if [ "`eval echo -n ${str#\$item}`" != "$str" ]; then return 0 fi done return 1 } runStage () { cmd="$1" msg="$2" echo -n "$msg ..." if matchList "$cmd" "$SKIP_STAGES"; then echo " skipped." return 0 fi $cmd if [ $? -eq 0 ]; then echo " done." return 0 else echo " failed." return 1 fi } # # Main # mkdir -p log rm -rf log/* runStage checkoutAll "Updating sources from CVS" [ $? -eq 0 ] || exit 1 for config in $CONFIGS; do if [ $config = "HEAD" ]; then build="$DATE-$OS.$MACHINE" else build="$config-$DATE-$OS.$MACHINE" fi runStage "prepareAll $config" "$config: Preparing build trees" [ $? -eq 0 ] || continue runStage "buildAll $config" "$config: Building" [ $? -eq 0 ] || continue runStage "packageAll $config $build" "$config: Packaging" [ $? -eq 0 ] || continue runStage "cleanupAll $config" "$config: Cleanup" [ $? -eq 0 ] || continue runStage "uploadAll $config $build" "$config: Uploading" [ $? -eq 0 ] || continue done @ 1.5 log @Don't build unnecessary Xservers (Xdmx, Xvfb, Xnest, Xprt). @ text @d313 1 a313 1 rm -rf build/$config > log/cleanup.log 2>&1 @ 1.4 log @* Major re-write of the snapshot build system. It now uses the modular Xorg tree for the core components and DDX drivers. This requires that a modular Xorg is installed somewhere on the build system. The installation location can be specified in config.sh. * There are also some modifications to CVS download and snapshot upload to support the new fd.o server names. * Fixed a problem when generating shared-core/drm_pciids.h. It used the old drm_pciids.txt from shared. * An older previously uncommitted change to build with -fno-strice-aliasing to prevent clipping problems in the mach64 driver. @ text @d217 3 d226 5 d232 1 a232 1 --with-mesa-source=$TOP/cvs/mesa/$mesa_branch/$MESA_MODULE @ 1.3 log @Major reorganization of snapshot builds. Now uses Xorg CVS instead of a XFree86 tarball + DRI CVS. Copes better with multiple CVS repositories providing different parts of the source. Moves all branch-specific knowledge from the scripts to config.sh. Adds a new abstraction called "configuration" that defines which branch from each repository is combined into a set of snapshots. Drivers to build and package and compiler options are selected per-configuration in config.sh. Right now there is only one configuration "HEAD". @ text @d1 1 a1 2 #!/bin/bash # snapshot.sh - build drivers snapshots from a branch d3 35 a37 1 set -e d41 130 a170 2 BRANCH=$1 BUILD=$2 d172 3 a174 20 if test -z $BUILD then #DATE=`date +%Y%m%d-%H%M` DATE=`date +%Y%m%d` #OS=`uname -o` OS=linux #MACHINE=`uname -m` MACHINE=i386 case $BRANCH in config-*-*-*-branch) BUILD="config-$DATE-$OS.$MACHINE" ;; driinterface-*-*-*-branch) BUILD="driinterface-$DATE-$OS.$MACHINE" ;; *) BUILD="$DATE-$OS.$MACHINE" esac fi d176 33 d210 35 a244 5 mkdir -p log #rm -f `find log -ctime +7 -type f -name "*.log"` #LOG=log/${BRANCH}${BUILD:+-${BUILD}} LOG=log/$BRANCH rm -f $LOG.* d246 3 d250 2 a251 2 stage() { local STAGE d253 1 a253 3 STAGE="$1" BRANCH="$2" shift d255 2 a256 1 COMMAND=./$STAGE.sh d258 3 a260 4 if ! $COMMAND "$@@" 2>&1 > $LOG.$STAGE then echo "The $STAGE stage of the $BRANCH branch failed. See \"$LOG.$STAGE\" log for more details." 2>&1 return 1 d262 44 a305 1 return 0 d308 16 d325 10 d336 3 a338 1 EXIT=0 d340 13 a352 1 stage checkout $BRANCH d354 2 a355 1 stage extract $BRANCH d357 9 a365 1 stage build $BRANCH d367 9 a375 1 stage package $BRANCH $BUILD || EXIT=1 d377 3 a379 3 if test -z $DEBUG then stage clean $BRANCH || EXIT = 1 d381 2 a382 2 stage upload $BRANCH $BUILD || EXIT=1 fi d384 2 a385 1 exit $EXIT d387 22 @ 1.2 log @Build a snapshot of R200 from the driinterface-0-0-3-branch. @ text @@ 1.1 log @Initial revision @ text @d24 3 @ 1.1.1.1 log @Imported snapshot build scripts. @ text @@