Hi Werner et al.!
*If* we bundle guile 1.8 with lilypond, I strongly prefer static
linking of the library (this is, adding `--disable-shared' to guile's
configure script, together with a proper argument to the
`--datarootdir' option to install the .scm files under a lilypond
directory).  This avoids *any* problems with different guile library
versions, and the created lilypond binary can peacefully coexist with
guile 2.0 even in the `/usr' tree.

After a loser look at the sources and the build system I think it's better
(= much easier) to stay with shared libraries.

At runtime we do need both libguile and guile itself (it is used by
 lilypond-invoke-editor), and all of our guile must be invisible to the
rest of the system.

That means:
+ there must be no entry in PATH leading to our private guile, guile-config etc.
+ there must be no entry leading to libguile etc in the system library search 
path.

All that is possible without major changes to the sources... attached find a 
bash
script as a proof of concept. The requirements described above are met.
It passes the "full make" test without problems:

knut@golem:~/sources>./mknewlily
Building GUILE 579b6041730357abcbb01e1f259e37c6e573cb7c first ...
  First we add a library search path to libguile/dynl.c
  exec ./autogen.sh in /home/knut/sources/guile ... succeeded after 14 seconds
  exec ./configure --disable-error-on-warning 
--prefix=/home/knut/sources/lilybuilt/share/lilypond in 
/home/knut/sources/guile ... succeeded after 10 seconds
  exec make -j 11 in /home/knut/sources/guile ... succeeded after 10 seconds
  exec make -j 11 install in /home/knut/sources/guile ... succeeded after 1 
seconds
Building LILYPOND 5bfd1e31928841704c5e5913290b948f6a480b09...
  exec ./autogen.sh --noconfigure in /home/knut/sources/lily ... succeeded 
after 1 seconds
  exec ../configure --prefix=/home/knut/sources/lilybuilt in 
/home/knut/sources/lily/build ... succeeded after 5 seconds
  exec make -k -j 11 CPU_COUNT=11 all in /home/knut/sources/lily/build ... 
succeeded after 92 seconds
  exec make -j 11 CPU_COUNT=11 install in /home/knut/sources/lily/build ... 
succeeded after 1 seconds
  exec make -j 11 CPU_COUNT=11 doc in /home/knut/sources/lily/build ... 
succeeded after 838 seconds
  exec make -j 11 CPU_COUNT=11 install-doc in /home/knut/sources/lily/build ... 
succeeded after 18 seconds
Total guile and lilypond build time: 990 seconds

cu,
 Knut
#!/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
_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to