]> git.cworth.org Git - notmuch/commitdiff
configure: calculate NOTMUCH_BUILDDIR, write to Makefile.config
authorDavid Bremner <david@tethera.net>
Thu, 23 Dec 2021 01:44:45 +0000 (21:44 -0400)
committerDavid Bremner <david@tethera.net>
Wed, 29 Dec 2021 18:12:03 +0000 (14:12 -0400)
This will correct the current use of an undefined variable when
setting LD_LIBRARY_PATH in doc/Makefile.local

It is tempting to try to replace the use of test/export-dirs.sh, but
this is not as simple as it looks, as NOTMUCH_BUILDDIR is used to
locate sh.config, so probably cannot also sensibly be used to define
it.

configure

index 6c3a38f1098ace4d563f5962d9470013e898175a..9b692b3e0f0bb45eb0e97ec5029e95c3c31ca4bf 100755 (executable)
--- a/configure
+++ b/configure
@@ -55,6 +55,8 @@ subdirs="${subdirs} bindings"
 # the directory structure and copy Makefiles.
 if [ "$srcdir" != "." ]; then
 
+    NOTMUCH_BUILDDIR=$PWD
+
     for dir in . ${subdirs}; do
        mkdir -p "$dir"
        cp "$srcdir"/"$dir"/Makefile.local "$dir"
@@ -78,6 +80,8 @@ if [ "$srcdir" != "." ]; then
        "$srcdir"/bindings/python-cffi/notmuch2 \
        "$srcdir"/bindings/python-cffi/setup.py \
        bindings/python-cffi/
+else
+    NOTMUCH_BUILDDIR=$NOTMUCH_SRCDIR
 fi
 
 # Set several defaults (optionally specified by the user in
@@ -1245,6 +1249,7 @@ cat > Makefile.config <<EOF
 # directory (the current directory at the time configure was run).
 srcdir = ${srcdir}
 NOTMUCH_SRCDIR = ${NOTMUCH_SRCDIR}
+NOTMUCH_BUILDDIR = ${NOTMUCH_BUILDDIR}
 
 # subdirectories to build
 subdirs = ${subdirs}