summaryrefslogtreecommitdiff
path: root/src/bin/pgtclsh/mkMakefile.tcldefs.sh
blob: f9faef2fdca2bcc563c29c68681138c2fa1382e2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#! /bin/sh

# $1 = path to tclConfig.sh ; $2 = output file

if test x"$1" = x ; then
   echo "$0: No tclConfig.sh file specified. Did you use \`configure --with-tcl'?" 1>&2
   exit 1
fi

# Source the file to obtain the correctly expanded variable definitions
. "$1"

# Read the file a second time as an easy way of getting the list of variable
# definitions to output.
cat "$1" |
    egrep '^TCL_|^TK_' |
    sed 's/^\([^=]*\)=.*$/\1/' |
    while read var
    do
	eval echo "\"$var = \$$var\""
    done > "$2"

exit 0