]> git.donarmstrong.com Git - lilypond.git/blobdiff - stepmake/aclocal.m4
* Documentation/windows/zlily-profile.sh:
[lilypond.git] / stepmake / aclocal.m4
index cf2176ed43c98f550145abd95d35086654e0813a..b63198794a9abc035b6b9fb951ade8e0056e43a7 100644 (file)
@@ -6,7 +6,12 @@ dnl StepMake subroutines for configure.in
 
 # Get full path of executable ($1)
 AC_DEFUN(STEPMAKE_GET_EXECUTABLE, [
-    type -p "$1" 2>&1 | awk '{print $NF}'
+    ## which doesn't work in ash, if /usr/bin/which isn't installed
+    ## type -p doesn't work in ash
+    ## command -v doesn't work in zsh
+    ## command -v "$1" 2>&1
+    ## this test should work in ash, bash, pdksh (ksh), zsh
+    type -p "$1" 2>/dev/null | tail -1 | awk '{print $NF}'
 ])
 
 
@@ -55,11 +60,11 @@ AC_DEFUN(STEPMAKE_OPTIONAL_REQUIRED, [
 # Return if tested proram ($1) was found (true) or not (false).
 AC_DEFUN(STEPMAKE_CHECK_SEARCH_RESULT, [
     r="`eval echo '$'"$1"`"
-    if test -n "$r" -a "$r" != "error" -a "$r" != "no" && ! expr '`eval echo '$'"$1"`' : '.*\(echo\)' > /dev/null; then
+    if test -n "$r" -a "$r" != "error" -a "$r" != "no" && expr '`eval echo '$'"$1"`' : '.*\(echo\)' > /dev/null; then
+       true
+    else
        ##STEPMAKE_WARN(cannot find $2. $3)
        false
-    else
-       true
     fi
 ])
 
@@ -70,6 +75,7 @@ AC_DEFUN(STEPMAKE_CHECK_SEARCH_RESULT, [
 AC_DEFUN(STEPMAKE_CHECK_VERSION, [
     r="`eval echo '$'"$1"`"
     AC_MSG_CHECKING("$r version")
+    #exe=`STEPMAKE_GET_EXECUTABLE($r)`
     exe=`STEPMAKE_GET_EXECUTABLE($r)`
     ver=`STEPMAKE_GET_VERSION($exe)`
     num=`STEPMAKE_NUMERIC_VERSION($ver)`
@@ -219,7 +225,7 @@ AC_DEFUN(STEPMAKE_CXXTEMPLATE, [
 
 AC_DEFUN(STEPMAKE_DATADIR, [
     if test "$datadir" = "\${prefix}/share"; then
-           datadir='${prefix}/share/'$package
+           datadir='${prefix}/share/'$package/$FULL_VERSION
     fi
     DIR_DATADIR=${datadir}
     presome=${prefix}
@@ -230,12 +236,9 @@ AC_DEFUN(STEPMAKE_DATADIR, [
 
     AC_SUBST(datadir)
     AC_SUBST(DIR_DATADIR)
-    
-    dnl yeah, so fuck me gently with a cactus: this doesnt belong here
-    dnl Please take the person responsible for inventing shell-scripts out
-    dnl and shoot him. On behalf of the sane world, thank you.
-    dnl DIR_SHAREDSTATEDIR="foobar"
-    dnl AC_SUBST(DIR_SHAREDSTATEDIR)
+
+    # we used to set DIR_SHAREDSTATEDIR here,
+    # but apparently that broke something
     
     AC_DEFINE_UNQUOTED(DIR_DATADIR, "${DIR_DATADIR}")
 ])
@@ -596,8 +599,9 @@ AC_DEFUN(STEPMAKE_INIT, [
     AC_SUBST(INSTALL)
     AC_DEFINE_UNQUOTED(DIRSEP, '${DIRSEP}')
     AC_DEFINE_UNQUOTED(PATHSEP, '${PATHSEP}')
-    AC_SUBST(PATHSEP)
     AC_SUBST(DIRSEP)
+    AC_SUBST(PATHSEP)
+    AC_SUBST(ROOTSEP)
   
     STEPMAKE_DATADIR
 ])