Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 7a9312b

Browse files
committed
Tcl fixes from Billy G. Allie
1 parent b0dfc47 commit 7a9312b

File tree

5 files changed

+94
-19
lines changed

5 files changed

+94
-19
lines changed

src/bin/pgtclsh/Makefile

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,19 @@
77
#
88
#
99
# IDENTIFICATION
10-
# $Header: /cvsroot/pgsql/src/bin/pgtclsh/Attic/Makefile,v 1.18 1998/05/12 15:42:08 momjian Exp $
10+
# $Header: /cvsroot/pgsql/src/bin/pgtclsh/Attic/Makefile,v 1.19 1998/10/12 02:40:58 momjian Exp $
1111
#
1212
#-------------------------------------------------------------------------
1313

1414
SRCDIR= ../..
1515
include ../../Makefile.global
1616

17-
CFLAGS+= $(X_CFLAGS) -I$(SRCDIR)/interfaces/libpgtcl
17+
#
18+
# Include definitions from the tclConfig.sh file
19+
#
20+
include Makefile.tcltkdefs
21+
22+
CFLAGS+= -I$(SRCDIR)/interfaces/libpgtcl
1823

1924
ifdef KRBVERS
2025
LDFLAGS+= $(KRBLIBS)
@@ -27,14 +32,17 @@ LIBPQ= -L$(LIBPQDIR) -lpq
2732

2833
all: pgtclsh pgtksh
2934

35+
Makefile.tcltkdefs:
36+
/bin/sh mkMakefile.tcltkdefs.sh
37+
3038
pgtclsh: pgtclAppInit.o
31-
$(CC) $(CFLAGS) -o $@ pgtclAppInit.o \
32-
$(LIBPGTCL) $(LIBPQ) $(TCL_LIB) -lm $(LDFLAGS)
39+
$(CC) $(CFLAGS) $(TCL_DEFS) -o $@ pgtclAppInit.o \
40+
$(LIBPGTCL) $(LIBPQ) $(TCL_LIB_SPEC) $(TCL_LIBS) $(LDFLAGS)
3341

3442
pgtksh: pgtkAppInit.o
35-
$(CC) $(CFLAGS) -o $@ pgtkAppInit.o \
36-
$(LIBPGTCL) $(LIBPQ) $(X_LIBS) $(TK_LIB) $(TCL_LIB) \
37-
$(X11_LIBS) -lm $(LDFLAGS)
43+
$(CC) $(CFLAGS) $(TK_DEFS) -o $@ pgtkAppInit.o \
44+
$(LIBPGTCL) $(LIBPQ) $(TK_LIB_SPEC) $(TK_LIBS) \
45+
$(TCL_LIB_SPEC) $(TCL_LIB) $(LDFLAGS)
3846

3947
install: pgtclsh pgtksh
4048
$(INSTALL) $(INSTL_EXE_OPTS) pgtclsh $(BINDIR)/pgtclsh

src/configure

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6118,7 +6118,7 @@ fi
61186118
if test "$USE_TCL"; then
61196119
echo $ac_n "checking for tclConfig.sh""... $ac_c" 1>&6
61206120
echo "configure:6121: checking for tclConfig.sh" >&5
6121-
library_dirs="/usr/lib $LIBRARY_DIRS"
6121+
library_dirs="$LIBRARY_DIRS /usr/lib"
61226122
TCL_CONFIG_SH=
61236123
for dir in $library_dirs; do
61246124
for tcl_dir in $tcl_dirs; do
@@ -6268,6 +6268,36 @@ fi
62686268
LDFLAGS="$ice_save_LDFLAGS"
62696269
fi
62706270

6271+
if test "$USE_TCL"; then
6272+
echo $ac_n "checking for tkConfig.sh""... $ac_c" 1>&6
6273+
echo "configure:6121: checking for tkConfig.sh" >&5
6274+
library_dirs="$LIBRARY_DIRS /usr/lib"
6275+
TK_CONFIG_SH=
6276+
for dir in $library_dirs; do
6277+
for tk_dir in $tk_dirs; do
6278+
if test -z "$TK_CONFIG_SH"; then
6279+
if test -d "$dir/$tk_dir" -a -r "$dir/$tk_dir/tkConfig.sh"; then
6280+
TK_CONFIG_SH=$dir/$tk_dir/tkConfig.sh
6281+
fi
6282+
fi
6283+
done
6284+
if test -z "$TK_CONFIG_SH"; then
6285+
if test -d "$dir" -a -r "$dir/tkConfig.sh"; then
6286+
TK_CONFIG_SH=$dir/tkConfig.sh
6287+
fi
6288+
fi
6289+
done
6290+
if test -z "$TK_CONFIG_SH"; then
6291+
echo "$ac_t""no" 1>&6
6292+
echo "configure: warning: tcl support disabled; Tk configuration script missing" 1>&2
6293+
USE_TCL=
6294+
else
6295+
echo "$ac_t""$TK_CONFIG_SH" 1>&6
6296+
6297+
fi
6298+
fi
6299+
6300+
62716301
#if test "X$USE_ODBC" = "Xtrue"
62726302
#then
62736303
# AC_CONFIG_SUBDIRS(interfaces/odbc)
@@ -6424,6 +6454,7 @@ trap 'rm -fr `echo "GNUmakefile
64246454
bin/pg_dump/Makefile
64256455
bin/pg_version/Makefile
64266456
bin/psql/Makefile
6457+
bin/pgtclsh/mkMakefile.tcltkdefs.sh
64276458
include/version.h
64286459
interfaces/libpq/Makefile
64296460
interfaces/ecpg/lib/Makefile
@@ -6532,6 +6563,7 @@ s%@X11_LIBS@%$X11_LIBS%g
65326563
s%@TCL_LIB@%$TCL_LIB%g
65336564
s%@TCL_CONFIG_SH@%$TCL_CONFIG_SH%g
65346565
s%@TK_LIB@%$TK_LIB%g
6566+
s%@TK_CONFIG_SH@%$TK_CONFIG_SH%g
65356567
65366568
CEOF
65376569
EOF
@@ -6580,6 +6612,7 @@ CONFIG_FILES=\${CONFIG_FILES-"GNUmakefile
65806612
bin/pg_dump/Makefile
65816613
bin/pg_version/Makefile
65826614
bin/psql/Makefile
6615+
bin/pgtclsh/mkMakefile.tcltkdefs.sh
65836616
include/version.h
65846617
interfaces/libpq/Makefile
65856618
interfaces/ecpg/lib/Makefile

src/configure.in

Lines changed: 31 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -801,13 +801,12 @@ if test "$USE_TCL" = "true"; then
801801
else
802802
TCL_LIB=-l$TCL_LIB
803803
fi
804-
AC_SUBST(TCL_LIB)
805804
fi
806805

807806
dnl Check for Tcl configuration script tclConfig.sh
808807
if test "$USE_TCL"; then
809808
AC_MSG_CHECKING(for tclConfig.sh)
810-
library_dirs="/usr/lib $LIBRARY_DIRS"
809+
library_dirs="$LIBRARY_DIRS /usr/lib"
811810
TCL_CONFIG_SH=
812811
for dir in $library_dirs; do
813812
for tcl_dir in $tcl_dirs; do
@@ -886,14 +885,41 @@ then
886885
TK_LIB=-l$TK_LIB
887886
fi
888887

889-
AC_SUBST(TK_LIB)
890-
891888
LIBS="$ice_save_LIBS"
892889
CFLAGS="$ice_save_CFLAGS"
893890
CPPFLAGS="$ice_save_CPPFLAGS"
894891
LDFLAGS="$ice_save_LDFLAGS"
895892
fi
896893

894+
dnl Check for Tk configuration script tkConfig.sh
895+
if test "$USE_TCL"; then
896+
AC_MSG_CHECKING(for tkConfig.sh)
897+
library_dirs="$LIBRARY_DIRS /usr/lib"
898+
TK_CONFIG_SH=
899+
for dir in $library_dirs; do
900+
for tk_dir in $tk_dirs; do
901+
if test -z "$TK_CONFIG_SH"; then
902+
if test -d "$dir/$tk_dir" -a -r "$dir/$tk_dir/tkConfig.sh"; then
903+
TK_CONFIG_SH=$dir/$tk_dir/tkConfig.sh
904+
fi
905+
fi
906+
done
907+
if test -z "$TK_CONFIG_SH"; then
908+
if test -d "$dir" -a -r "$dir/tkConfig.sh"; then
909+
TK_CONFIG_SH=$dir/tkConfig.sh
910+
fi
911+
fi
912+
done
913+
if test -z "$TK_CONFIG_SH"; then
914+
AC_MSG_RESULT(no)
915+
AC_MSG_WARN(tcl support disabled; Tk configuration script missing)
916+
USE_TCL=
917+
else
918+
AC_MSG_RESULT($TK_CONFIG_SH)
919+
AC_SUBST(TK_CONFIG_SH)
920+
fi
921+
fi
922+
897923
dnl cause configure to recurse into subdirectories with their own configure
898924
dnl Darn, setting AC_CONFIG_SUBDIRS sets a list $subdirs$ in the configure output
899925
dnl file, but then configure doesn't bother using that list. Probably a bug in
@@ -925,6 +951,7 @@ AC_OUTPUT(
925951
bin/pg_dump/Makefile
926952
bin/pg_version/Makefile
927953
bin/psql/Makefile
954+
bin/pgtclsh/mkMakefile.tcltkdefs.sh
928955
include/version.h
929956
interfaces/libpq/Makefile
930957
interfaces/ecpg/lib/Makefile

src/interfaces/libpgtcl/Makefile.in

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#
88
#
99
# IDENTIFICATION
10-
# $Header: /cvsroot/pgsql/src/interfaces/libpgtcl/Attic/Makefile.in,v 1.29 1998/10/12 01:23:23 momjian Exp $
10+
# $Header: /cvsroot/pgsql/src/interfaces/libpgtcl/Attic/Makefile.in,v 1.30 1998/10/12 02:40:59 momjian Exp $
1111
#
1212
#-------------------------------------------------------------------------
1313

@@ -146,6 +146,7 @@ install-libpgtcl: libpgtcl.a
146146
install-shlib: $(shlib)
147147
$(INSTALL) $(INSTL_SHLIB_OPTS) $(shlib) \
148148
$(LIBDIR)/$(shlib)
149+
rm -f $(LIBDIR)/libpgtcl.so
149150
$(LN_S) -f $(shlib) $(LIBDIR)/libpgtcl.so
150151

151152
.PHONY: clean

src/pl/tcl/mkMakefile.tcldefs.sh.in

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,21 @@
11

2-
if [ -f @TCL_CONFIG_SH@ ]; then
3-
. @TCL_CONFIG_SH@
4-
else
2+
if [ ! -f @TCL_CONFIG_SH@ ]; then
53
echo "@TCL_CONFIG_SH@ not found"
64
echo "I need this file! Please make a symbolic link to this file"
75
echo "and start make again."
86
exit 1
97
fi
108

11-
for v in `set | grep '^TCL' | sed -e 's/=.*//'` ; do
12-
echo $v = `eval "echo \\$$v"`
13-
done >Makefile.tcldefs
9+
. @TCL_CONFIG_SH@
10+
11+
set |
12+
egrep '^TCL_|^TK_' |
13+
sed -e 's/=[ ]*/="/' -e 's/[ ]*$/"/' |
14+
while read v
15+
do
16+
eval "$v"
17+
v1=`echo $v | sed -e 's/=.*//'`
18+
eval "echo $v1 = \"\$$v1\""
19+
done >Makefile.tcldefs
1420

1521
exit 0

0 commit comments

Comments
 (0)