doc: Fix incorrect version list for Windows SDK
[pgsql.git] / config / tcl.m4
blob9de31a5715648fa43180d332aac477a924997525
1 # config/tcl.m4
3 # Autoconf macros to check for Tcl related things
6 AC_DEFUN([PGAC_PATH_TCLSH],
7 [PGAC_PATH_PROGS(TCLSH, [tclsh tcl tclsh8.6 tclsh86 tclsh8.5 tclsh85 tclsh8.4 tclsh84])
8 AC_ARG_VAR(TCLSH, [Tcl interpreter program (tclsh)])dnl
9 if test x"$TCLSH" = x""; then
10   AC_MSG_ERROR([Tcl shell not found])
15 # PGAC_PATH_TCLCONFIGSH([SEARCH-PATH])
16 # ------------------------------------
17 # If the user doesn't specify $TCL_CONFIG_SH directly, search for it in
18 # the list of directories passed as parameter (from --with-tclconfig).
19 # If no list is given, try the Tcl shell's $auto_path.
21 AC_DEFUN([PGAC_PATH_TCLCONFIGSH],
22 [AC_REQUIRE([PGAC_PATH_TCLSH])[]dnl
23 AC_BEFORE([$0], [PGAC_PATH_TKCONFIGSH])[]dnl
24 AC_MSG_CHECKING([for tclConfig.sh])
25 # Let user override test
26 if test -z "$TCL_CONFIG_SH"; then
27     pgac_test_dirs="$1"
29     set X $pgac_test_dirs; shift
30     if test $[#] -eq 0; then
31         test -z "$TCLSH" && AC_MSG_ERROR([unable to locate tclConfig.sh because no Tcl shell was found])
32         pgac_test_dirs=`echo 'puts $auto_path' | $TCLSH`
33         # On newer macOS, $auto_path frequently doesn't include the place
34         # where tclConfig.sh actually lives.  Append that to the end, so as not
35         # to break cases where a non-default Tcl installation is being used.
36         if test -d "$PG_SYSROOT/System/Library/Frameworks/Tcl.framework" ; then
37             pgac_test_dirs="$pgac_test_dirs $PG_SYSROOT/System/Library/Frameworks/Tcl.framework"
38         fi
39         set X $pgac_test_dirs; shift
40     fi
42     for pgac_dir do
43         if test -r "$pgac_dir/tclConfig.sh"; then
44             TCL_CONFIG_SH=$pgac_dir/tclConfig.sh
45             break
46         fi
47     done
50 if test -z "$TCL_CONFIG_SH"; then
51     AC_MSG_RESULT(no)
52     AC_MSG_ERROR([file 'tclConfig.sh' is required for Tcl])
53 else
54     AC_MSG_RESULT([$TCL_CONFIG_SH])
57 AC_SUBST([TCL_CONFIG_SH])
58 ])# PGAC_PATH_TCLCONFIGSH
61 # PGAC_PATH_TKCONFIGSH([SEARCH-PATH])
62 # ------------------------------------
63 AC_DEFUN([PGAC_PATH_TKCONFIGSH],
64 [AC_REQUIRE([PGAC_PATH_TCLSH])[]dnl
65 AC_MSG_CHECKING([for tkConfig.sh])
66 # Let user override test
67 if test -z "$TK_CONFIG_SH"; then
68     pgac_test_dirs="$1"
70     set X $pgac_test_dirs; shift
71     if test $[#] -eq 0; then
72         test -z "$TCLSH" && AC_MSG_ERROR([unable to locate tkConfig.sh because no Tcl shell was found])
73         set X `echo 'puts $auto_path' | $TCLSH`; shift
74     fi
76     for pgac_dir do
77         if test -r "$pgac_dir/tkConfig.sh"; then
78             TK_CONFIG_SH=$pgac_dir/tkConfig.sh
79             break
80         fi
81     done
84 if test -z "$TK_CONFIG_SH"; then
85     AC_MSG_RESULT(no)
86     AC_MSG_ERROR([file 'tkConfig.sh' is required for Tk])
87 else
88     AC_MSG_RESULT([$TK_CONFIG_SH])
91 AC_SUBST([TK_CONFIG_SH])
92 ])# PGAC_PATH_TKCONFIGSH
95 # PGAC_EVAL_TCLCONFIGSH(FILE, WANTED-VARS)
96 # ----------------------------------------
97 # Assigns variables listed in WANTED-VARS by reading FILE and
98 # evaluating it according to the quoting scheme of tclConfig.sh and
99 # tkConfig.sh.  Calls AC_SUBST for each variable.
101 AC_DEFUN([PGAC_EVAL_TCLCONFIGSH],
102 [. "$1"
103 m4_foreach([pgac_item], [$2],
104 [eval pgac_item=\"[$]pgac_item\"
105 AC_SUBST(pgac_item)])])