]> git.donarmstrong.com Git - lilypond.git/blobdiff - stepmake/aclocal.m4
Merge branch 'jneeman' of git+ssh://jneem@git.sv.gnu.org/srv/git/lilypond into jneeman
[lilypond.git] / stepmake / aclocal.m4
index 19b9200a40d4b696cb16f319afe7f18710209d7a..25a0f5426b65915f87b8c4e0831102b947db6a1f 100644 (file)
@@ -26,14 +26,16 @@ AC_DEFUN(STEPMAKE_GET_VERSION, [
     ## -V: Workaround for python
 
     changequote(<<, >>)#dnl
+
     ## Assume and hunt for dotted version multiplet.
     ## use eval trickery, because we cannot use multi-level $() instead of ``
     ## for compatibility reasons.
-    ## FIXME: what systems still do not have $() in /bin/sh?
-    eval _ver=\"\`("$1" --version || "$1" -V) 2>&1 | grep '[0-9]\.[0-9]' \
+    
+    ## grab the first version number in  --version output.
+    eval _ver=\"\`("$1" --version || "$1" -V) 2>&1 | grep '\(^\| \)[0-9][0-9]*\.[0-9]' \
         | head -n 1 \
-        | sed -e 's/\([0-9][0-9]*\.[0-9][.0-9]*\).*/\1/' \
-         -e 's/\([^0-9]*\|^\) //' -e 's/[^0-9]*$//'\`\"
+       | tr ' ' '\n' | sed 's/\([0-9][0-9]*\.[0-9][0-9]*\).*/\1/g' | grep '\(^\| \)[0-9][0-9]*\.[0-9]' | head -n 1\`\"
+
     if test -z "$_ver"; then
         ## If empty, try date [fontforge]
         eval _ver=\"\`("$1" --version || "$1" -V) 2>&1 | grep '[0-9]\{6,8\}' \
@@ -286,7 +288,7 @@ AC_DEFUN(STEPMAKE_DATADIR, [
     build_package_datadir=$ugh_ugh_autoconf250_builddir/out$CONFIGSUFFIX/share/$package
     
     DATADIR=`echo ${datadir} | sed "s!\\\${datarootdir}!${prefix}/share!"`
-    DATADIR=`echo ${datadir} | sed "s!\\\${prefix}!$presome!"`
+    DATADIR=`echo ${DATADIR} | sed "s!\\\${prefix}!$presome!"`
     BUILD_PACKAGE_DATADIR=`echo ${build_package_datadir} | sed "s!\\\${prefix}!$presome!"`
     
     AC_SUBST(datadir)
@@ -666,7 +668,11 @@ AC_DEFUN(STEPMAKE_INIT, [
 
        AC_MSG_CHECKING(builddir)
        ugh_ugh_autoconf250_builddir="`pwd`"
-       if test "$srcdir" = "."; then
+
+       here_dir=$(cd . && pwd)
+       full_src_dir=$(cd $srcdir && pwd)
+
+       if test "$full_src_dir" = "$here_dir"; then
            srcdir_build=yes
        else
            srcdir_build=no