#!/bin/bash # # Build lilypond and guile 1.8 in a way that # -> guile is installed under PREFIX/share/lilypond # -> guile does not need to be in PATH # -> libguile does not need to be in the systems library search path # RED='\033[0;31m' NOCOLOR='\033[0m' STARTTIME=`date +"%s"` #======================================================= # Adapt the next three lines to your needs! # LILYSOURCE is the local lilypond git repository # GUILESOURCE is the local guile git repository # LILYROOT is the install destination root directory #======================================================= LILYSOURCE=/home/knut/sources/lily GUILESOURCE=/home/knut/sources/guile LILYROOT=/home/knut/sources/lilybuilt #======================================================= # derived from the defintions above, there should be # no need to change these: #======================================================= BUILDLOG=$LILYROOT/lilypond_buildlog GUILEROOT=$LILYROOT/share/lilypond GUILELIBDIR=$GUILEROOT/lib64 GUILEBINDIR=$GUILEROOT/bin LILYLIBDIR=$LILYROOT/lib64/lilypond LILYBINDIR=$LILYROOT/bin #======================================================= # options for make #======================================================= LILYMAKEPAR="-j 11 CPU_COUNT=11" GUILEMAKEPAR="-j 11" function doit { AT=`date +"%s"` echo -en " exec $RED$1$NOCOLOR in `pwd` ..." $1 &>> $BUILDLOG if [ $? -ne 0 ]; then echo -n " failed";cat $BUILDLOG;exit 1;else echo -n " succeeded";fi BT=`date +"%s"` let "CT = $BT - $AT" echo " after $CT seconds" } # # ensure that our LILYROOT directory exists! mkdir -p $LILYROOT cd $GUILESOURCE git checkout branch_release-1-8 &>> $BUILDLOG git reset --hard &>> $BUILDLOG git clean -dfx &>> $BUILDLOG echo Building GUILE `git rev-parse HEAD` first ... # # We do not want our guile to be visible to other applications, so we # need to tell our hidden libguile where it has to look for module libraries! # echo " First we add a library search path to libguile/dynl.c" sed -i "s|lt_dlinit ();|lt_dlinit (); lt_dlsetsearchpath (\"$GUILELIBDIR\");|" libguile/dynl.c doit "./autogen.sh" doit "./configure --disable-error-on-warning --prefix=$GUILEROOT" doit "make $GUILEMAKEPAR" doit "make $GUILEMAKEPAR install" #======================================================= # As our guile is hidden, our binaries need to know where # guile and libguile is located ... during build we need # guile-config etc to be in PATH. #======================================================= PATH=$GUILEBINDIR:$PATH export LDFLAGS="-Wl,-rpath,$GUILELIBDIR" cd $LILYSOURCE echo Building LILYPOND `git rev-parse HEAD`... git reset --hard &>> $BUILDLOG git clean -dfx &>> $BUILDLOG doit "./autogen.sh --noconfigure" mkdir -p build cd build doit "../configure --prefix=$LILYROOT" doit "make -k $LILYMAKEPAR all" doit "make $LILYMAKEPAR install" doit "make $LILYMAKEPAR doc" doit "make $LILYMAKEPAR install-doc" ENDTIME=`date +"%s"` let "TOTALTIME = $ENDTIME - $STARTTIME" echo "Total guile and lilypond build time: $TOTALTIME seconds" exit 0