aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntonio Borneo <borneo.antonio@gmail.com>2020-12-10 16:27:00 +0100
committerSteve Bennett <steveb@workware.net.au>2020-12-11 21:59:46 +1000
commita2816313da54dcadcdb8eecb3875fcc7373432ea (patch)
tree9e9232c3357e24671400db4d80d476fd9faeb62b
parentd224c9a2b7b20e8ad13a6b1406acdd156f180dff (diff)
downloadjimtcl-a2816313da54dcadcdb8eecb3875fcc7373432ea.zip
jimtcl-a2816313da54dcadcdb8eecb3875fcc7373432ea.tar.gz
jimtcl-a2816313da54dcadcdb8eecb3875fcc7373432ea.tar.bz2
autosetup: keep clean the source tree on out-of-tree build
If the build host doesn't have neither jimsh nor tclsh installed, during 'configure' the autosetup will build 'autosetup/jimsh0' inside the source tree. This happens also when out-of-tree build is used. Making dirty the source tree during out-of-tree build causes applications that use jimtcl as submodule (e.g. OpenOCD) to fail at 'make distcheck'. Modify 'autosetup-find-tclsh' to build 'jimsh0' in the current folder. For jimtcl project it would be the root of the source tree or the root of the out-of-tree build. Update 'Makefile.in' to search for 'jimsh0' in the new path during 'distclean'. Reported-by: Paul Fertser <fercerpav@gmail.com> Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
-rw-r--r--Makefile.in2
-rwxr-xr-xautosetup/autosetup-find-tclsh11
2 files changed, 6 insertions, 7 deletions
diff --git a/Makefile.in b/Makefile.in
index c12d088..1b5e00d 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -211,7 +211,7 @@ clean:
@endif
distclean: clean
- rm -f jimautoconf.h jim-config.h Makefile config.log @srcdir@/autosetup/jimsh0@EXEEXT@ build-jim-ext
+ rm -f jimautoconf.h jim-config.h Makefile config.log jimsh0@EXEEXT@ build-jim-ext
rm -f jimtcl.pc tests/Makefile examples.api/Makefile
ship: Tcl.html
diff --git a/autosetup/autosetup-find-tclsh b/autosetup/autosetup-find-tclsh
index 6309fe6..6ef8bc3 100755
--- a/autosetup/autosetup-find-tclsh
+++ b/autosetup/autosetup-find-tclsh
@@ -1,17 +1,16 @@
#!/bin/sh
# Looks for a suitable tclsh or jimsh in the PATH
-# If not found, builds a bootstrap jimsh from source
+# If not found, builds a bootstrap jimsh in current dir from source
# Prefer $autosetup_tclsh if is set in the environment
-d=`dirname "$0"`
-{ "$d/jimsh0" "$d/autosetup-test-tclsh"; } 2>/dev/null && exit 0
-PATH="$PATH:$d"; export PATH
+d="`dirname "$0"`"
+{ "./jimsh0" "$d/autosetup-test-tclsh"; } 2>/dev/null && exit 0
for tclsh in $autosetup_tclsh jimsh tclsh tclsh8.5 tclsh8.6 tclsh8.7; do
{ $tclsh "$d/autosetup-test-tclsh"; } 2>/dev/null && exit 0
done
echo 1>&2 "No installed jimsh or tclsh, building local bootstrap jimsh0"
for cc in ${CC_FOR_BUILD:-cc} gcc; do
- { $cc -o "$d/jimsh0" "$d/jimsh0.c"; } 2>/dev/null || continue
- "$d/jimsh0" "$d/autosetup-test-tclsh" && exit 0
+ { $cc -o "jimsh0" "$d/jimsh0.c"; } 2>/dev/null || continue
+ "./jimsh0" "$d/autosetup-test-tclsh" && exit 0
done
echo 1>&2 "No working C compiler found. Tried ${CC_FOR_BUILD:-cc} and gcc."
echo false