*** ./src/bin/pgtclsh/Makefile.orig	Fri Oct 16 17:06:30 1998
--- ./src/bin/pgtclsh/Makefile	Fri Oct 16 17:07:43 1998
***************
*** 69,75 ****
  	$(INSTALL) $(INSTL_EXE_OPTS) pgtksh $(BINDIR)/pgtksh
  
  clean:
! 	rm -f pgtclAppInit.o pgtkAppInit.o pgtclsh pgtksh
  
  dep depend:
  	$(CC) -MM $(CFLAGS) *.c > depend
--- 69,75 ----
  	$(INSTALL) $(INSTL_EXE_OPTS) pgtksh $(BINDIR)/pgtksh
  
  clean:
! 	rm -f *.o Makefile.t*defs pgtclsh pgtksh
  
  dep depend:
  	$(CC) -MM $(CFLAGS) *.c > depend
*** ./src/configure.in.orig	Fri Oct 16 17:08:41 1998
--- ./src/configure.in	Sat Oct 17 01:12:27 1998
***************
*** 134,140 ****
  fi
  
  AC_ARG_WITH(libs,
!     [  --with-libs=DIR         site library directories for tk/tcl, etc in DIR],
      [
  	case "$withval" in
  	"" | y | ye | yes | n | no)
--- 134,140 ----
  fi
  
  AC_ARG_WITH(libs,
!     [  --with-libs=DIR         also search for libraries in DIR],
      [
  	case "$withval" in
  	"" | y | ye | yes | n | no)
***************
*** 145,151 ****
      ])
  
  AC_ARG_WITH(libraries,
!     [  --with-libraries=DIR    site library directories for tk/tcl, etc in DIR],
      [
  	case "$withval" in
  	"" | y | ye | yes | n | no)
--- 145,151 ----
      ])
  
  AC_ARG_WITH(libraries,
!     [  --with-libraries=DIR    also search for libraries in DIR],
      [
  	case "$withval" in
  	"" | y | ye | yes | n | no)
***************
*** 232,237 ****
--- 232,252 ----
  export USE_TCL
  export USE_TK
  
+ dnl We see if the path to the TCL/TK configuration scripts is specified.
+ dnl This will overide the use of tclsh to find the paths to search.
+ 
+ AC_ARG_WITH(tclconfig,
+     [  --with-tclconfig=DIR    tclConfig.sh and tkConfig.sh are in DIR],
+     [
+ 	case "$withval" in
+ 	"" | y | ye | yes | n | no)
+ 	    AC_MSG_ERROR([*** You must supply an argument to the --with-tclconfig option.])
+ 	  ;;
+ 	esac
+ 	TCL_DIRS="$withval"
+     ]
+ )
+ 
  dnl We exclude perl support unless we override it with --with-perl
  AC_MSG_CHECKING(setting USE_PERL)
  AC_ARG_WITH(
***************
*** 250,256 ****
  AC_MSG_CHECKING(setting USE_ODBC)
  AC_ARG_WITH(
     odbc,
!    [  --with-odbc              build ODBC driver package ],
     [
  	case "$withval" in
  	y | ye | yes)		USE_ODBC=true; AC_MSG_RESULT(enabled) ;;
--- 265,271 ----
  AC_MSG_CHECKING(setting USE_ODBC)
  AC_ARG_WITH(
     odbc,
!    [  --with-odbc             build ODBC driver package ],
     [
  	case "$withval" in
  	y | ye | yes)		USE_ODBC=true; AC_MSG_RESULT(enabled) ;;
***************
*** 276,282 ****
     AC_MSG_CHECKING(setting ODBCINST)
     AC_ARG_WITH(
        odbcinst,
!       [  --with-odbcinst=dir    change default directory for odbcinst.ini],
        AC_DEFINE_UNQUOTED(ODBCINST, ${with_odbcinst}) AC_MSG_RESULT($with_odbcinst),
        AC_DEFINE_UNQUOTED(ODBCINST, ${ODBCINSTDIR}) AC_MSG_RESULT(${ODBCINSTDIR})
     )
--- 291,297 ----
     AC_MSG_CHECKING(setting ODBCINST)
     AC_ARG_WITH(
        odbcinst,
!       [  --with-odbcinst=dir     change default directory for odbcinst.ini],
        AC_DEFINE_UNQUOTED(ODBCINST, ${with_odbcinst}) AC_MSG_RESULT($with_odbcinst),
        AC_DEFINE_UNQUOTED(ODBCINST, ${ODBCINSTDIR}) AC_MSG_RESULT(${ODBCINSTDIR})
     )
***************
*** 754,765 ****
  
  dnl Check for Tcl configuration script tclConfig.sh
  
! AC_PATH_PROG(TCLSH, tclsh)
! 
! if test -z "$TCLSH"
  then
! 	AC_MSG_WARN(TCL/TK support disabled; tclsh is not in your path)
! 	USE_TCL=
  fi
  	
  if test "$USE_TCL" = true
--- 769,787 ----
  
  dnl Check for Tcl configuration script tclConfig.sh
  
! dnl If --with-tclconfig was given, don't check for tclsh, tcl
! if test -z "$TCL_DIRS"
  then
! 	AC_PATH_PROG(TCLSH, tclsh)
! 	if test -z "$TCLSH"
! 	then
! 		AC_PATH_PROG(TCLSH, tcl)
! 		if test -z "$TCLSH"
! 		then
! 			AC_MSG_WARN(TCL/TK support disabled; tcl shell is not in your path)
! 			USE_TCL=
! 		fi
! 	fi
  fi
  	
  if test "$USE_TCL" = true
***************
*** 766,773 ****
  then
  	AC_MSG_CHECKING(for tclConfig.sh)
  	TCL_CONFIG_SH=
! 	library_dirs=`echo 'puts $auto_path' | $TCLSH`
! 	library_dirs="$LIBRARY_DIRS $library_dirs"
  	for dir in $library_dirs; do
  		if test -d "$dir" -a -r "$dir/tclConfig.sh"; then
  			TCL_CONFIG_SH=$dir/tclConfig.sh
--- 788,799 ----
  then
  	AC_MSG_CHECKING(for tclConfig.sh)
  	TCL_CONFIG_SH=
! 	library_dirs=
! 	if test -z "$TCL_DIRS"
! 	then
! 		library_dirs=`echo 'puts $auto_path' | $TCLSH`
! 	fi
! 	library_dirs="$TCL_DIRS $library_dirs"
  	for dir in $library_dirs; do
  		if test -d "$dir" -a -r "$dir/tclConfig.sh"; then
  			TCL_CONFIG_SH=$dir/tclConfig.sh
*** ./src/GNUmakefile.in.orig	Sat Oct 17 01:17:44 1998
--- ./src/GNUmakefile.in	Sat Oct 17 01:19:25 1998
***************
*** 80,87 ****
  		backend/port/tas.s \
  		backend/port/dynloader.c \
  		backend/utils/Gen_fmgrtab.sh \
- 		bin/pgtclsh/Makefile.tcldefs \
- 		bin/pgtclsh/Makefile.tkdefs \
  \
  \
  \
--- 80,85 ----
