summaryrefslogtreecommitdiff
path: root/src/bin/pgtclsh/mkMakefile.tcldefs.sh.in
diff options
context:
space:
mode:
Diffstat (limited to 'src/bin/pgtclsh/mkMakefile.tcldefs.sh.in')
-rw-r--r--src/bin/pgtclsh/mkMakefile.tcldefs.sh.in15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/bin/pgtclsh/mkMakefile.tcldefs.sh.in b/src/bin/pgtclsh/mkMakefile.tcldefs.sh.in
index a8c2cc374d..79e456b3b5 100644
--- a/src/bin/pgtclsh/mkMakefile.tcldefs.sh.in
+++ b/src/bin/pgtclsh/mkMakefile.tcldefs.sh.in
@@ -1,16 +1,23 @@
+#! /bin/sh
-if [ ! -f @TCL_CONFIG_SH@ ]; then
+if [ ! -r @TCL_CONFIG_SH@ ]; then
echo "@TCL_CONFIG_SH@ not found"
echo "I need this file! Please make a symbolic link to this file"
echo "and start make again."
exit 1
fi
+# Source the file to obtain the correctly expanded variable definitions
+. @TCL_CONFIG_SH@
+
+# Read the file a second time as an easy way of getting the list of variable
+# definitions to output.
cat @TCL_CONFIG_SH@ |
- egrep '^TCL_' |
- while read inp
+ egrep '^TCL_|^TK_' |
+ sed 's/^\([^=]*\)=.*$/\1/' |
+ while read var
do
- eval eval echo $inp
+ eval echo "\"$var = \$$var\""
done >Makefile.tcldefs
exit 0