Revise Tcl/Tk configuration. Make missing Tcl after --with-tcl an error,

add --without-tk option to disable Tk.  We don't need the AC_PATH_XTRA
test because tkConfig.sh already contains all the information about how to
compile and link with X.  Also make sure that libpq is up to date for
libpgtcl.  Remove executable bits from pgaccess.sh, but add it to pgaccess.
This commit is contained in:
Peter Eisentraut 2000-09-25 22:23:01 +00:00
parent e353e73768
commit f428d053ce
12 changed files with 613 additions and 1553 deletions

3
aclocal.m4 vendored
View File

@ -1,4 +1,4 @@
dnl $Header: /cvsroot/pgsql/aclocal.m4,v 1.8 2000/09/21 20:17:41 petere Exp $ dnl $Header: /cvsroot/pgsql/aclocal.m4,v 1.9 2000/09/25 22:22:52 petere Exp $
builtin([include], [config/ac_func_accept_argtypes.m4]) builtin([include], [config/ac_func_accept_argtypes.m4])
builtin([include], [config/c-compiler.m4]) builtin([include], [config/c-compiler.m4])
builtin([include], [config/c-library.m4]) builtin([include], [config/c-library.m4])
@ -6,3 +6,4 @@ builtin([include], [config/cxx.m4])
builtin([include], [config/general.m4]) builtin([include], [config/general.m4])
builtin([include], [config/programs.m4]) builtin([include], [config/programs.m4])
builtin([include], [config/python.m4]) builtin([include], [config/python.m4])
builtin([include], [config/tcl.m4])

76
config/tcl.m4 Normal file
View File

@ -0,0 +1,76 @@
# $Header: /cvsroot/pgsql/config/tcl.m4,v 1.1 2000/09/25 22:22:53 petere Exp $
# Autoconf macros to check for Tcl related things
AC_DEFUN([PGAC_PATH_TCLSH],
[AC_PATH_PROGS(TCLSH, [tclsh tcl])])
# PGAC_PATH_TCLCONFIGSH([SEARCH-PATH])
# ------------------------------------
AC_DEFUN([PGAC_PATH_TCLCONFIGSH],
[AC_REQUIRE([PGAC_PATH_TCLSH])[]dnl
AC_BEFORE([$0], [PGAC_PATH_TKCONFIGSH])[]dnl
AC_MSG_CHECKING([for tclConfig.sh])
# Let user override test
if test -z "$TCL_CONFIG_SH"; then
pgac_test_dirs="$1"
set X $pgac_test_dirs; shift
if test $[#] -eq 0; then
test -z "$TCLSH" && AC_MSG_ERROR([unable to locate tclConfig.sh because no Tcl shell was found])
set X `echo 'puts $auto_path' | $TCLSH`; shift
fi
for pgac_dir; do
if test -r "$pgac_dir/tclConfig.sh"; then
TCL_CONFIG_SH=$pgac_dir/tclConfig.sh
break
fi
done
fi
if test -z "$TCL_CONFIG_SH"; then
AC_MSG_RESULT(no)
AC_MSG_ERROR([file \`tclConfig.sh' is required for Tcl])
else
AC_MSG_RESULT([$TCL_CONFIG_SH])
fi
AC_SUBST([TCL_CONFIG_SH])
])# PGAC_PATH_TCLCONFIGSH
# PGAC_PATH_TKCONFIGSH([SEARCH-PATH])
# ------------------------------------
AC_DEFUN([PGAC_PATH_TKCONFIGSH],
[AC_REQUIRE([PGAC_PATH_TCLSH])[]dnl
AC_MSG_CHECKING([for tkConfig.sh])
# Let user override test
if test -z "$TK_CONFIG_SH"; then
pgac_test_dirs="$1"
set X $pgac_test_dirs; shift
if test $[#] -eq 0; then
test -z "$TCLSH" && AC_MSG_ERROR([unable to locate tkConfig.sh because no Tcl shell was found])
set X `echo 'puts $auto_path' | $TCLSH`; shift
fi
for pgac_dir; do
if test -r "$pgac_dir/tkConfig.sh"; then
TK_CONFIG_SH=$pgac_dir/tkConfig.sh
break
fi
done
fi
if test -z "$TK_CONFIG_SH"; then
AC_MSG_RESULT(no)
AC_MSG_ERROR([file \`tkConfig.sh' is required for Tk])
else
AC_MSG_RESULT([$TK_CONFIG_SH])
fi
AC_SUBST([TK_CONFIG_SH])
])# PGAC_PATH_TKCONFIGSH

1856
configure vendored

File diff suppressed because it is too large Load Diff

View File

@ -317,28 +317,34 @@ done
IFS=$ac_save_IFS IFS=$ac_save_IFS
#
# Tcl/Tk
#
AC_MSG_CHECKING([whether to build with Tcl])
PGAC_ARG_BOOL(with, tcl, no, [ --with-tcl build Tcl and Tk interfaces])
AC_MSG_RESULT([$with_tcl])
AC_SUBST([with_tcl])
# We exclude tcl support unless user says --with-tcl # If Tcl is enabled (above) then Tk is also, unless the user disables it using --without-tk
AC_MSG_CHECKING(setting USE_TCL) AC_MSG_CHECKING([whether to build with Tk])
PGAC_ARG_BOOL(with, tcl, no, [ --with-tcl build Tcl interfaces and pgtclsh], if test "$with_tcl" = yes; then
[USE_TCL=true; USE_TK=true; AC_MSG_RESULT(enabled)], PGAC_ARG_BOOL(with, tk, yes, [ --without-tk do not build Tk interfaces if Tcl is enabled])
[USE_TCL=; USE_TK=; AC_MSG_RESULT(disabled)]) else
AC_SUBST(USE_TCL) with_tk=no
AC_SUBST(USE_TK) fi
AC_MSG_RESULT([$with_tk])
AC_SUBST([with_tk])
# We see if the path to the TCL/TK configuration scripts is specified. # We see if the path to the TCL/TK configuration scripts is specified.
# This will override the use of tclsh to find the paths to search. # This will override the use of tclsh to find the paths to search.
PGAC_ARG_REQ(with, tclconfig, [ --with-tclconfig=DIR tclConfig.sh and tkConfig.sh are in DIR], PGAC_ARG_REQ(with, tclconfig, [ --with-tclconfig=DIR tclConfig.sh and tkConfig.sh are in DIR])
[TCL_DIRS=$withval])
# We see if the path to the TK configuration scripts is specified. # We see if the path to the TK configuration scripts is specified.
# This will override the use of tclsh to find the paths to search. # This will override the use of tclsh to find the paths to search.
PGAC_ARG_REQ(with, tkconfig, [ --with-tkconfig=DIR tkConfig.sh is in DIR], PGAC_ARG_REQ(with, tkconfig, [ --with-tkconfig=DIR tkConfig.sh is in DIR])
[TK_DIRS=$withval])
# #
@ -443,7 +449,7 @@ AC_SUBST(KRB_LIBS)
# Kerberos configuration parameters # Kerberos configuration parameters
# #
PGAC_ARG_REQ(with, krb-srvnam, PGAC_ARG_REQ(with, krb-srvnam,
[ --with-krb-srvnam=NAME name of the PostgreSQL service principal in Kerberos], [ --with-krb-srvnam=NAME name of the PostgreSQL service principal in Kerberos [postgres]],
[], [],
[with_krb_srvnam="postgres"]) [with_krb_srvnam="postgres"])
AC_DEFINE_UNQUOTED([PG_KRB_SRVNAM], ["$with_krb_srvnam"], AC_DEFINE_UNQUOTED([PG_KRB_SRVNAM], ["$with_krb_srvnam"],
@ -591,6 +597,10 @@ AC_PATH_PROG(tar, tar)
AC_CHECK_PROGS(PERL, perl,) AC_CHECK_PROGS(PERL, perl,)
AC_PROG_YACC AC_PROG_YACC
AC_SUBST(YFLAGS) AC_SUBST(YFLAGS)
if test "$with_tk" = yes; then
AC_PATH_PROG(WISH, wish)
test -z "$WISH" && AC_MSG_ERROR([\`wish' is required for Tk support])
fi
## ##
@ -1007,120 +1017,18 @@ AC_DEFINE_UNQUOTED(MAXIMUM_ALIGNOF, $MAX_ALIGNOF, [Define as the maximum alignme
PGAC_FUNC_POSIX_SIGNALS PGAC_FUNC_POSIX_SIGNALS
dnl Check for Tcl configuration script tclConfig.sh # Check for Tcl configuration script tclConfig.sh
if test "$with_tcl" = yes; then
dnl If --with-tclconfig was given, don't check for tclsh, tcl PGAC_PATH_TCLCONFIGSH([$with_tclconfig])
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 fi
if test "$USE_TCL" = true # Check for Tk configuration script tkConfig.sh
then if test "$with_tk" = yes; then
AC_MSG_CHECKING(for tclConfig.sh) PGAC_PATH_TKCONFIGSH([$with_tkconfig $with_tclconfig])
TCL_CONFIG_SH=
library_dirs=
if test -z "$TCL_DIRS"
then
library_dirs=`echo 'puts $auto_path' | $TCLSH`
fi
library_dirs="$TCL_DIRS $TK_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
break
fi
done
if test -z "$TCL_CONFIG_SH"; then
AC_MSG_RESULT(no)
AC_MSG_WARN(TCL/TK support disabled; Tcl configuration script missing)
USE_TCL=
else
AC_MSG_RESULT($TCL_CONFIG_SH)
AC_SUBST(TCL_CONFIG_SH)
fi
fi fi
USE_TK=$USE_TCL # If TCL is disabled, disable TK
dnl Check for Tk configuration script tkConfig.sh # Finally ready to produce output files ...
if test "$USE_TK" = true
then
AC_MSG_CHECKING(for tkConfig.sh)
TK_CONFIG_SH=
# library_dirs are set in the check for TCL
for dir in $library_dirs
do
if test -d "$dir" -a -r "$dir/tkConfig.sh"
then
TK_CONFIG_SH=$dir/tkConfig.sh
break
fi
done
if test -z "$TK_CONFIG_SH"
then
AC_MSG_RESULT(no)
AC_MSG_WARN(TK support disabled; Tk configuration script missing)
USE_TK=
else
AC_MSG_RESULT($TK_CONFIG_SH)
AC_SUBST(TK_CONFIG_SH)
AC_PATH_PROG(WISH, wish)
fi
fi
AC_SUBST(WISH)
USE_X=$USE_TK
dnl Check for X libraries
if test "$USE_X" = true; then
ice_save_LIBS="$LIBS"
ice_save_CFLAGS="$CFLAGS"
ice_save_CPPFLAGS="$CPPFLAGS"
ice_save_LDFLAGS="$LDFLAGS"
AC_PATH_XTRA
LIBS="$LIBS $X_EXTRA_LIBS"
CFLAGS="$CFLAGS $X_CFLAGS"
CPPFLAGS="$CPPFLAGS $X_CFLAGS"
LDFLAGS="$LDFLAGS $X_LIBS"
dnl Check for X library
X11_LIBS=""
AC_CHECK_LIB(X11, XOpenDisplay, X11_LIBS="-lX11",,${X_PRE_LIBS})
if test "$X11_LIBS" = ""; then
dnl Not having X is bad news for pgtksh. Let the user fix this.
AC_MSG_WARN([The X11 library '-lX11' could not be found,
so TK support will be disabled. To enable TK support,
please use the configure options '--x-includes=DIR'
and '--x-libraries=DIR' to specify the X location.
See the file 'config.log' for further diagnostics.])
USE_TK=
fi
AC_SUBST(X_LIBS)
AC_SUBST(X11_LIBS)
AC_SUBST(X_PRE_LIBS)
LIBS="$ice_save_LIBS"
CFLAGS="$ice_save_CFLAGS"
CPPFLAGS="$ice_save_CPPFLAGS"
LDFLAGS="$ice_save_LDFLAGS"
fi
dnl Finally ready to produce output files ...
AC_OUTPUT( AC_OUTPUT(
[ [
@ -1129,5 +1037,5 @@ AC_OUTPUT(
src/Makefile.global src/Makefile.global
src/backend/port/Makefile src/backend/port/Makefile
], ],
[echo timestamp > src/include/stamp-h] [echo "timestamp file" > src/include/stamp-h]
) )

View File

@ -1,4 +1,4 @@
# $Header: /cvsroot/pgsql/src/Makefile.global.in,v 1.94 2000/09/21 20:17:43 petere Exp $ # $Header: /cvsroot/pgsql/src/Makefile.global.in,v 1.95 2000/09/25 22:22:54 petere Exp $
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# All PostgreSQL makefiles include this file and use the variables it sets, # All PostgreSQL makefiles include this file and use the variables it sets,
@ -97,19 +97,13 @@ python_moduledir = @python_moduledir@
krb_srvtab = @krb_srvtab@ krb_srvtab = @krb_srvtab@
# with_tcl = @with_tcl@
# Please do not edit USE_TCL and USE_TK by hand. with_tk = @with_tk@
#
USE_TCL= @USE_TCL@
USE_TK= @USE_TK@
WISH= @WISH@ WISH= @WISH@
TCL_CONFIG_SH = @TCL_CONFIG_SH@ TCL_CONFIG_SH = @TCL_CONFIG_SH@
TK_CONFIG_SH = @TK_CONFIG_SH@ TK_CONFIG_SH = @TK_CONFIG_SH@
X_CFLAGS= @X_CFLAGS@
X_LIBS= @X_LIBS@
X11_LIBS= -lX11 @X_EXTRA_LIBS@
# flag whether multibyte is on/off # flag whether multibyte is on/off
MULTIBYTE=@MULTIBYTE@ MULTIBYTE=@MULTIBYTE@

View File

@ -4,7 +4,7 @@
# #
# Copyright (c) 1994, Regents of the University of California # Copyright (c) 1994, Regents of the University of California
# #
# $Header: /cvsroot/pgsql/src/bin/Makefile,v 1.31 2000/08/31 16:11:03 petere Exp $ # $Header: /cvsroot/pgsql/src/bin/Makefile,v 1.32 2000/09/25 22:22:54 petere Exp $
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
@ -19,9 +19,8 @@ ifdef MULTIBYTE
DIRS += pg_encoding DIRS += pg_encoding
endif endif
# TCL/TK programs ifeq ($(with_tcl), yes)
ifeq ($(USE_TCL), true) ifeq ($(with_tk), yes)
ifeq ($(USE_TK), true)
DIRS += pgaccess DIRS += pgaccess
endif endif
DIRS += pgtclsh DIRS += pgtclsh

View File

@ -4,7 +4,7 @@
# #
# Copyright (c) 1994, Regents of the University of California # Copyright (c) 1994, Regents of the University of California
# #
# $Header: /cvsroot/pgsql/src/bin/pgaccess/Attic/Makefile,v 1.12 2000/09/17 13:02:41 petere Exp $ # $Header: /cvsroot/pgsql/src/bin/pgaccess/Attic/Makefile,v 1.13 2000/09/25 22:22:56 petere Exp $
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
@ -16,8 +16,11 @@ pgaccessdir = $(datadir)/pgaccess
all: pgaccess all: pgaccess
pgaccess: pgaccess.sh pgaccess: pgaccess.sh $(top_builddir)/src/Makefile.global
sed -e 's,__wish__,$(WISH),' -e 's,__PGACCESSHOME__,$(pgaccessdir),' < $< > $@ sed -e 's,@WISH@,$(WISH),g' \
-e 's,@PGACCESSHOME@,$(pgaccessdir),g' \
$< >$@
chmod a+x $@
install: all installdirs install: all installdirs
$(INSTALL_SCRIPT) pgaccess $(DESTDIR)$(bindir)/pgaccess $(INSTALL_SCRIPT) pgaccess $(DESTDIR)$(bindir)/pgaccess

View File

@ -1,9 +1,9 @@
#! /bin/sh #! /bin/sh
PATH_TO_WISH=__wish__ PATH_TO_WISH='@WISH@'
PGACCESS_HOME=__PGACCESSHOME__ PGACCESS_HOME='@PGACCESSHOME@'
export PATH_TO_WISH export PATH_TO_WISH
export PGACCESS_HOME export PGACCESS_HOME
exec ${PATH_TO_WISH} ${PGACCESS_HOME}/main.tcl "$@" exec "${PATH_TO_WISH}" "${PGACCESS_HOME}/main.tcl" "$@"

View File

@ -5,7 +5,7 @@
# #
# Copyright (c) 1994, Regents of the University of California # Copyright (c) 1994, Regents of the University of California
# #
# $Header: /cvsroot/pgsql/src/bin/pgtclsh/Attic/Makefile,v 1.32 2000/09/17 13:02:42 petere Exp $ # $Header: /cvsroot/pgsql/src/bin/pgtclsh/Attic/Makefile,v 1.33 2000/09/25 22:22:58 petere Exp $
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
@ -17,7 +17,7 @@ include $(top_builddir)/src/Makefile.global
# Include definitions from the tclConfig.sh file # Include definitions from the tclConfig.sh file
# #
-include Makefile.tcldefs -include Makefile.tcldefs
ifeq ($(USE_TK), true) ifeq ($(with_tk), yes)
-include Makefile.tkdefs -include Makefile.tkdefs
endif endif
@ -25,27 +25,24 @@ libpgtcl_srcdir = $(top_srcdir)/src/interfaces/libpgtcl
libpgtcl_builddir = $(top_builddir)/src/interfaces/libpgtcl libpgtcl_builddir = $(top_builddir)/src/interfaces/libpgtcl
libpgtcl = -L$(libpgtcl_builddir) -lpgtcl libpgtcl = -L$(libpgtcl_builddir) -lpgtcl
CFLAGS+= $(X_CFLAGS) -I$(libpgtcl_srcdir) CPPFLAGS += -I$(libpgtcl_srcdir) $(TK_XINCLUDES)
# If we are here then TCL is available # If we are here then Tcl is available
PROGRAMS = pgtclsh PROGRAMS = pgtclsh
# Add TK targets if TK is available # Add Tk targets if Tk is available
ifeq ($(USE_TK), true) ifeq ($(with_tk), yes)
PROGRAMS += pgtksh PROGRAMS += pgtksh
endif endif
all: submake $(PROGRAMS) all: submake $(PROGRAMS)
pgtclsh: pgtclAppInit.o pgtclsh: pgtclAppInit.o
$(CC) $(CFLAGS) $(TCL_DEFS) -o $@ $< \ $(CC) $(CFLAGS) -o $@ $< $(libpgtcl) $(libpq) $(TCL_LIB_SPEC) $(TCL_LIBS) $(LDFLAGS)
$(libpgtcl) $(libpq) $(TCL_LIB_SPEC) $(TCL_LIBS) $(LDFLAGS)
pgtksh: pgtkAppInit.o pgtksh: pgtkAppInit.o
$(CC) $(CFLAGS) $(TK_DEFS) -o $@ $< \ $(CC) $(CFLAGS) -o $@ $< $(libpgtcl) $(libpq) $(TK_LIB_SPEC) $(TK_LIBS) $(TCL_LIB_SPEC) $(LDFLAGS)
$(libpgtcl) $(libpq) $(X_LIBS) $(TK_LIB_SPEC) $(TK_LIBS) \
$(TCL_LIB_SPEC) $(X11_LIBS) $(LDFLAGS)
.PHONY: submake .PHONY: submake
submake: submake:
@ -53,7 +50,7 @@ submake:
install: all installdirs install: all installdirs
$(INSTALL_PROGRAM) pgtclsh $(DESTDIR)$(bindir)/pgtclsh $(INSTALL_PROGRAM) pgtclsh $(DESTDIR)$(bindir)/pgtclsh
ifeq ($(USE_TK), true) ifeq ($(with_tk), yes)
$(INSTALL_PROGRAM) pgtksh $(DESTDIR)$(bindir)/pgtksh $(INSTALL_PROGRAM) pgtksh $(DESTDIR)$(bindir)/pgtksh
endif endif
@ -70,7 +67,7 @@ Makefile.tkdefs: mkMakefile.tkdefs.sh
$(SHELL) $< '$(TK_CONFIG_SH)' '$@' $(SHELL) $< '$(TK_CONFIG_SH)' '$@'
clean distclean maintainer-clean: clean distclean maintainer-clean:
rm -f *.o Makefile.tcldefs Makefile.tkdefs pgtclsh pgtksh rm -f pgtclAppInit.o pgtkAppInit.o Makefile.tcldefs Makefile.tkdefs pgtclsh pgtksh
dep depend: dep depend:
$(CC) -MM $(CFLAGS) *.c > depend $(CC) -MM $(CFLAGS) *.c > depend

View File

@ -4,7 +4,7 @@
# #
# Copyright (c) 1994, Regents of the University of California # Copyright (c) 1994, Regents of the University of California
# #
# $Header: /cvsroot/pgsql/src/interfaces/Makefile,v 1.42 2000/08/31 16:11:30 petere Exp $ # $Header: /cvsroot/pgsql/src/interfaces/Makefile,v 1.43 2000/09/25 22:23:00 petere Exp $
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
@ -24,7 +24,7 @@ ifeq ($(with_CXX), yes)
DIRS += libpq++ DIRS += libpq++
endif endif
ifeq ($(USE_TCL), true) ifeq ($(with_tcl), yes)
DIRS += libpgtcl DIRS += libpgtcl
endif endif

View File

@ -4,7 +4,7 @@
# #
# Copyright (c) 1994, Regents of the University of California # Copyright (c) 1994, Regents of the University of California
# #
# $Header: /cvsroot/pgsql/src/interfaces/libpgtcl/Attic/Makefile,v 1.21 2000/09/17 13:02:49 petere Exp $ # $Header: /cvsroot/pgsql/src/interfaces/libpgtcl/Attic/Makefile,v 1.22 2000/09/25 22:23:00 petere Exp $
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
@ -27,7 +27,11 @@ SHLIB_LINK+= $(libpq)
# braindead; users of libpq should not need to know what it depends on.) # braindead; users of libpq should not need to know what it depends on.)
SHLIB_LINK+= $(findstring -lcrypt,$(LIBS)) SHLIB_LINK+= $(findstring -lcrypt,$(LIBS))
all: all-lib all: submake all-lib
.PHONY: submake
submake:
$(MAKE) -C $(libpq_builddir) all
# Shared library stuff # Shared library stuff
include $(top_srcdir)/src/Makefile.shlib include $(top_srcdir)/src/Makefile.shlib

View File

@ -4,7 +4,7 @@
# #
# Copyright (c) 1994, Regents of the University of California # Copyright (c) 1994, Regents of the University of California
# #
# $Header: /cvsroot/pgsql/src/pl/Makefile,v 1.14 2000/09/25 12:43:24 momjian Exp $ # $Header: /cvsroot/pgsql/src/pl/Makefile,v 1.15 2000/09/25 22:23:01 petere Exp $
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
@ -14,7 +14,7 @@ include $(top_builddir)/src/Makefile.global
DIRS := plpgsql DIRS := plpgsql
ifeq ($(USE_TCL), true) ifeq ($(with_tcl), yes)
DIRS += tcl DIRS += tcl
endif endif