]> git.donarmstrong.com Git - lilypond.git/blobdiff - aclocal.m4
patch::: 1.3.37.jcn2
[lilypond.git] / aclocal.m4
index 92908e0e0a65cf53911b0af367a8929ec61fd007..53d9704aedf2c95f716acd0bf651cba0e619f396 100644 (file)
@@ -1,9 +1,3 @@
-dnl WARNING WARNING WARNING WARNING
-dnl do not edit! this is aclocal.m4, generated from stepmake/aclocal.m4
-dnl WARNING WARNING WARNING WARNING
-dnl do not edit! this is aclocal.m4, generated from stepmake/aclocal.m4
-dnl WARNING WARNING WARNING WARNING
-dnl do not edit! this is aclocal.m4, generated from stepmake/aclocal.m4
 dnl aclocal.m4   -*-shell-script-*-
 dnl StepMake subroutines for configure.in
 
@@ -138,9 +132,14 @@ AC_DEFUN(AC_STEPMAKE_DATADIR, [
 AC_DEFUN(AC_STEPMAKE_END, [
     AC_OUTPUT($CONFIGFILE.make:config.make.in)
 
-    rm -f GNUmakefile
-    cp make/toplevel.make.in ./GNUmakefile
-    chmod 444 GNUmakefile
+    rm -f $srcdir/GNUmakefile
+    cp $srcdir/make/toplevel.make.in $srcdir/GNUmakefile
+    chmod 444 $srcdir/GNUmakefile
+    if test "$builddir" != "."; then
+        rm -f GNUmakefile
+       cp $srcdir/make/srcdir.make.in GNUmakefile
+       chmod 444 GNUmakefile
+    fi
 ])
 
 AC_DEFUN(AC_STEPMAKE_GXX, [
@@ -192,19 +191,43 @@ AC_DEFUN(AC_STEPMAKE_INIT, [
     AC_MSG_CHECKING(Package)
     if test "x$PACKAGE" = "xSTEPMAKE"; then
        AC_MSG_RESULT(Stepmake package!)
-       (cd stepmake; rm -f stepmake; ln -s ../stepmake .)
-       (cd stepmake; rm -f bin; ln -s ../bin .)
+
+       #if test "x$builddir" != "x"; then
+       #    builddir="../$builddir"
+       #else
+       #    builddir=..
+       #fi
+       if test "$srcdir" != "."; then
+           absolute_builddir="`pwd`"
+           package_absolute_builddir="`dirname $absolute_builddir`"
+           package_srcdir="`dirname  $srcdir`"
+           builddir="`dirname $package_srcdir`/`basename $package_absolute_builddir`/`basename $absolute_builddir`"
+       else
+           builddir=.
+       fi
+
+       (cd stepmake 2>/dev/null || mkdir stepmake)
+       (cd stepmake; rm -f stepmake; ln -s ../$srcdir/stepmake .)
+       (cd stepmake; rm -f bin; ln -s ../$srcdir/bin .)
        AC_CONFIG_AUX_DIR(bin)
        stepmake=stepmake
     else
         AC_MSG_RESULT($PACKAGE)
+
+       if test "$srcdir" != "."; then
+           absolute_builddir="`pwd`"
+           builddir="`dirname  $srcdir`/`basename $absolute_builddir`"
+       else
+           builddir=.
+       fi
+
        AC_MSG_CHECKING(for stepmake)
        # Check for installed stepmake
        if test -d $stepmake; then
            AC_MSG_RESULT($stepmake)
        else
-           stepmake='$(depth)'/stepmake
-           AC_MSG_RESULT(./stepmake  ($datadir/stepmake not found))
+           stepmake='$(depth)'/$srcdir/stepmake
+           AC_MSG_RESULT($srcdir/stepmake  ($datadir/stepmake not found))
        fi
        AC_CONFIG_AUX_DIR(\
          $HOME/usr/local/share/stepmake/bin\
@@ -216,9 +239,11 @@ AC_DEFUN(AC_STEPMAKE_INIT, [
          /usr/share/stepmake/bin\
          /usr/lib/stepmake/bin\
          stepmake/bin\
+         $srcdir/stepmake/bin\
        )
     fi
 
+    AC_SUBST(builddir)
     AC_SUBST(stepmake)
     AC_SUBST(package)
     AC_SUBST(PACKAGE)
@@ -236,8 +261,6 @@ AC_DEFUN(AC_STEPMAKE_INIT, [
 
     AUTOGENERATE="This file was automatically generated by configure"
     AC_SUBST(AUTOGENERATE)
-    absolute_builddir="`pwd`"
-    AC_SUBST(absolute_builddir)
 
     STATE_VECTOR=`ls make/STATE-VECTOR 2>/dev/null`
     if test "x$STATE_VECTOR" != "x"; then
@@ -248,13 +271,9 @@ AC_DEFUN(AC_STEPMAKE_INIT, [
     CONFIGSUFFIX=
     AC_ARG_ENABLE(config,
     [  enable-config=FILE      put configure settings in config-FILE.make],
-    [CONFIGSUFFIX=$enableval])
+    [CONFIGSUFFIX=-$enableval])
 
-    if test "$CONFIGSUFFIX" != "" ; then
-       CONFIGFILE=config-$CONFIGSUFFIX
-    else
-       CONFIGFILE=config
-    fi
+    CONFIGFILE=config$CONFIGSUFFIX
     AC_SUBST(CONFIGSUFFIX)
      
     AC_CANONICAL_HOST