Add a pg_dump option --lock-wait-timeout to allow failing the dump if unable
[PostgreSQL.git] / config / tcl.m4
blob76f440a4f7a8b86b5731b4f5aed77e844700b165
1 # $PostgreSQL$
3 # Autoconf macros to check for Tcl related things
6 AC_DEFUN([PGAC_PATH_TCLSH],
7          [AC_PATH_PROGS(TCLSH, [tclsh tcl])])
10 # PGAC_PATH_TCLCONFIGSH([SEARCH-PATH])
11 # ------------------------------------
12 AC_DEFUN([PGAC_PATH_TCLCONFIGSH],
13 [AC_REQUIRE([PGAC_PATH_TCLSH])[]dnl
14 AC_BEFORE([$0], [PGAC_PATH_TKCONFIGSH])[]dnl
15 AC_MSG_CHECKING([for tclConfig.sh])
16 # Let user override test
17 if test -z "$TCL_CONFIG_SH"; then
18     pgac_test_dirs="$1"
20     set X $pgac_test_dirs; shift
21     if test $[#] -eq 0; then
22         test -z "$TCLSH" && AC_MSG_ERROR([unable to locate tclConfig.sh because no Tcl shell was found])
23         set X `echo 'puts $auto_path' | $TCLSH`; shift
24     fi
26     for pgac_dir do
27         if test -r "$pgac_dir/tclConfig.sh"; then
28             TCL_CONFIG_SH=$pgac_dir/tclConfig.sh
29             break
30         fi
31     done
34 if test -z "$TCL_CONFIG_SH"; then
35     AC_MSG_RESULT(no)
36     AC_MSG_ERROR([file 'tclConfig.sh' is required for Tcl])
37 else
38     AC_MSG_RESULT([$TCL_CONFIG_SH])
41 AC_SUBST([TCL_CONFIG_SH])
42 ])# PGAC_PATH_TCLCONFIGSH
45 # PGAC_PATH_TKCONFIGSH([SEARCH-PATH])
46 # ------------------------------------
47 AC_DEFUN([PGAC_PATH_TKCONFIGSH],
48 [AC_REQUIRE([PGAC_PATH_TCLSH])[]dnl
49 AC_MSG_CHECKING([for tkConfig.sh])
50 # Let user override test
51 if test -z "$TK_CONFIG_SH"; then
52     pgac_test_dirs="$1"
54     set X $pgac_test_dirs; shift
55     if test $[#] -eq 0; then
56         test -z "$TCLSH" && AC_MSG_ERROR([unable to locate tkConfig.sh because no Tcl shell was found])
57         set X `echo 'puts $auto_path' | $TCLSH`; shift
58     fi
60     for pgac_dir do
61         if test -r "$pgac_dir/tkConfig.sh"; then
62             TK_CONFIG_SH=$pgac_dir/tkConfig.sh
63             break
64         fi
65     done
68 if test -z "$TK_CONFIG_SH"; then
69     AC_MSG_RESULT(no)
70     AC_MSG_ERROR([file 'tkConfig.sh' is required for Tk])
71 else
72     AC_MSG_RESULT([$TK_CONFIG_SH])
75 AC_SUBST([TK_CONFIG_SH])
76 ])# PGAC_PATH_TKCONFIGSH
79 # PGAC_EVAL_TCLCONFIGSH(FILE, WANTED-VARS)
80 # ----------------------------------------
81 # Assigns variables listed in WANTED-VARS by reading FILE and
82 # evaluating it according to the quoting scheme of tclConfig.sh and
83 # tkConfig.sh.  Calls AC_SUBST for each variable.
85 AC_DEFUN([PGAC_EVAL_TCLCONFIGSH],
86 [. "$1"
87 m4_foreach([pgac_item], [$2],
88 [eval pgac_item=\"[$]pgac_item\"
89 AC_SUBST(pgac_item)])])