]> granicus.if.org Git - postgresql/commitdiff
Tcl fixes from Billy G. Allie
authorBruce Momjian <bruce@momjian.us>
Mon, 12 Oct 1998 02:41:01 +0000 (02:41 +0000)
committerBruce Momjian <bruce@momjian.us>
Mon, 12 Oct 1998 02:41:01 +0000 (02:41 +0000)
src/bin/pgtclsh/Makefile
src/configure
src/configure.in
src/interfaces/libpgtcl/Makefile.in
src/pl/tcl/mkMakefile.tcldefs.sh.in

index b0e474508e962430e61b5e965d3d89a7e4994835..0bf1952dbb9c8bb8f84a1a6f522706310fc60612 100644 (file)
@@ -7,14 +7,19 @@
 #
 #
 # IDENTIFICATION
-#    $Header: /cvsroot/pgsql/src/bin/pgtclsh/Attic/Makefile,v 1.18 1998/05/12 15:42:08 momjian Exp $
+#    $Header: /cvsroot/pgsql/src/bin/pgtclsh/Attic/Makefile,v 1.19 1998/10/12 02:40:58 momjian Exp $
 #
 #-------------------------------------------------------------------------
 
 SRCDIR= ../..
 include ../../Makefile.global
 
-CFLAGS+=  $(X_CFLAGS) -I$(SRCDIR)/interfaces/libpgtcl
+#
+# Include definitions from the tclConfig.sh file
+#
+include Makefile.tcltkdefs
+
+CFLAGS+=  -I$(SRCDIR)/interfaces/libpgtcl 
 
 ifdef KRBVERS
 LDFLAGS+= $(KRBLIBS)
@@ -27,14 +32,17 @@ LIBPQ= -L$(LIBPQDIR) -lpq
 
 all: pgtclsh pgtksh
 
+Makefile.tcltkdefs:
+       /bin/sh mkMakefile.tcltkdefs.sh
+
 pgtclsh: pgtclAppInit.o
-       $(CC) $(CFLAGS) -o $@ pgtclAppInit.o \
-         $(LIBPGTCL) $(LIBPQ) $(TCL_LIB) -lm $(LDFLAGS)
+       $(CC) $(CFLAGS) $(TCL_DEFS) -o $@ pgtclAppInit.o \
+         $(LIBPGTCL) $(LIBPQ) $(TCL_LIB_SPEC) $(TCL_LIBS) $(LDFLAGS)
 
 pgtksh: pgtkAppInit.o
-       $(CC) $(CFLAGS) -o $@ pgtkAppInit.o \
-         $(LIBPGTCL) $(LIBPQ) $(X_LIBS) $(TK_LIB) $(TCL_LIB) \
-         $(X11_LIBS) -lm $(LDFLAGS)
+       $(CC) $(CFLAGS) $(TK_DEFS) -o $@ pgtkAppInit.o \
+         $(LIBPGTCL) $(LIBPQ) $(TK_LIB_SPEC) $(TK_LIBS) \
+         $(TCL_LIB_SPEC) $(TCL_LIB) $(LDFLAGS)
 
 install: pgtclsh pgtksh
        $(INSTALL) $(INSTL_EXE_OPTS) pgtclsh $(BINDIR)/pgtclsh
index 187e7c71b6ec3d9537169163c05e7fef032f5933..ace665d689741e1b5bdaab0170b1163b4f75bbb4 100755 (executable)
@@ -6118,7 +6118,7 @@ fi
 if test "$USE_TCL"; then
        echo $ac_n "checking for tclConfig.sh""... $ac_c" 1>&6
 echo "configure:6121: checking for tclConfig.sh" >&5
-       library_dirs="/usr/lib $LIBRARY_DIRS"
+       library_dirs="$LIBRARY_DIRS /usr/lib"
        TCL_CONFIG_SH=
        for dir in $library_dirs; do
                for tcl_dir in $tcl_dirs; do
@@ -6268,6 +6268,36 @@ fi
        LDFLAGS="$ice_save_LDFLAGS"
 fi
 
+if test "$USE_TCL"; then
+       echo $ac_n "checking for tkConfig.sh""... $ac_c" 1>&6
+echo "configure:6121: checking for tkConfig.sh" >&5
+       library_dirs="$LIBRARY_DIRS /usr/lib"
+       TK_CONFIG_SH=
+       for dir in $library_dirs; do
+               for tk_dir in $tk_dirs; do
+                       if test -z "$TK_CONFIG_SH"; then
+                               if test -d "$dir/$tk_dir" -a -r "$dir/$tk_dir/tkConfig.sh"; then
+                                       TK_CONFIG_SH=$dir/$tk_dir/tkConfig.sh
+                               fi
+                       fi
+               done
+               if test -z "$TK_CONFIG_SH"; then
+                       if test -d "$dir" -a -r "$dir/tkConfig.sh"; then
+                               TK_CONFIG_SH=$dir/tkConfig.sh
+                       fi
+               fi
+       done
+       if test -z "$TK_CONFIG_SH"; then
+               echo "$ac_t""no" 1>&6
+               echo "configure: warning: tcl support disabled; Tk configuration script missing" 1>&2
+               USE_TCL=
+       else
+               echo "$ac_t""$TK_CONFIG_SH" 1>&6
+               
+       fi
+fi
+
+
 #if test "X$USE_ODBC" = "Xtrue"
 #then
 #      AC_CONFIG_SUBDIRS(interfaces/odbc)
@@ -6424,6 +6454,7 @@ trap 'rm -fr `echo "GNUmakefile
        bin/pg_dump/Makefile
        bin/pg_version/Makefile
        bin/psql/Makefile
+       bin/pgtclsh/mkMakefile.tcltkdefs.sh
        include/version.h
        interfaces/libpq/Makefile
        interfaces/ecpg/lib/Makefile
@@ -6532,6 +6563,7 @@ s%@X11_LIBS@%$X11_LIBS%g
 s%@TCL_LIB@%$TCL_LIB%g
 s%@TCL_CONFIG_SH@%$TCL_CONFIG_SH%g
 s%@TK_LIB@%$TK_LIB%g
+s%@TK_CONFIG_SH@%$TK_CONFIG_SH%g
 
 CEOF
 EOF
@@ -6580,6 +6612,7 @@ CONFIG_FILES=\${CONFIG_FILES-"GNUmakefile
        bin/pg_dump/Makefile
        bin/pg_version/Makefile
        bin/psql/Makefile
+       bin/pgtclsh/mkMakefile.tcltkdefs.sh
        include/version.h
        interfaces/libpq/Makefile
        interfaces/ecpg/lib/Makefile
index 4c61151739725283595cccd91817bc926bf87a3e..910a2fa74b788a2c3170a879f422eaae0c27d973 100644 (file)
@@ -801,13 +801,12 @@ if test "$USE_TCL" = "true"; then
        else
                TCL_LIB=-l$TCL_LIB
        fi
-       AC_SUBST(TCL_LIB)
 fi
 
 dnl Check for Tcl configuration script tclConfig.sh
 if test "$USE_TCL"; then
        AC_MSG_CHECKING(for tclConfig.sh)
-       library_dirs="/usr/lib $LIBRARY_DIRS"
+       library_dirs="$LIBRARY_DIRS /usr/lib"
        TCL_CONFIG_SH=
        for dir in $library_dirs; do
                for tcl_dir in $tcl_dirs; do
@@ -886,14 +885,41 @@ then
                TK_LIB=-l$TK_LIB
        fi
 
-       AC_SUBST(TK_LIB)
-
        LIBS="$ice_save_LIBS"
        CFLAGS="$ice_save_CFLAGS"
        CPPFLAGS="$ice_save_CPPFLAGS"
        LDFLAGS="$ice_save_LDFLAGS"
 fi
 
+dnl Check for Tk configuration script tkConfig.sh
+if test "$USE_TCL"; then
+       AC_MSG_CHECKING(for tkConfig.sh)
+       library_dirs="$LIBRARY_DIRS /usr/lib"
+       TK_CONFIG_SH=
+       for dir in $library_dirs; do
+               for tk_dir in $tk_dirs; do
+                       if test -z "$TK_CONFIG_SH"; then
+                               if test -d "$dir/$tk_dir" -a -r "$dir/$tk_dir/tkConfig.sh"; then
+                                       TK_CONFIG_SH=$dir/$tk_dir/tkConfig.sh
+                               fi
+                       fi
+               done
+               if test -z "$TK_CONFIG_SH"; then
+                       if test -d "$dir" -a -r "$dir/tkConfig.sh"; then
+                               TK_CONFIG_SH=$dir/tkConfig.sh
+                       fi
+               fi
+       done
+       if test -z "$TK_CONFIG_SH"; then
+               AC_MSG_RESULT(no)
+               AC_MSG_WARN(tcl support disabled; Tk configuration script missing)
+               USE_TCL=
+       else
+               AC_MSG_RESULT($TK_CONFIG_SH)
+               AC_SUBST(TK_CONFIG_SH)
+       fi
+fi
+
 dnl cause configure to recurse into subdirectories with their own configure
 dnl Darn, setting AC_CONFIG_SUBDIRS sets a list $subdirs$ in the configure output
 dnl  file, but then configure doesn't bother using that list. Probably a bug in
@@ -925,6 +951,7 @@ AC_OUTPUT(
        bin/pg_dump/Makefile
        bin/pg_version/Makefile
        bin/psql/Makefile
+       bin/pgtclsh/mkMakefile.tcltkdefs.sh
        include/version.h
        interfaces/libpq/Makefile
        interfaces/ecpg/lib/Makefile
index 27a8fc44b7f768c6767c92289f1c9d2ce7fead15..ec663a961010f92fcbb9fae55aa97cc59a43bd97 100644 (file)
@@ -7,7 +7,7 @@
 #
 #
 # IDENTIFICATION
-#    $Header: /cvsroot/pgsql/src/interfaces/libpgtcl/Attic/Makefile.in,v 1.29 1998/10/12 01:23:23 momjian Exp $
+#    $Header: /cvsroot/pgsql/src/interfaces/libpgtcl/Attic/Makefile.in,v 1.30 1998/10/12 02:40:59 momjian Exp $
 #
 #-------------------------------------------------------------------------
 
@@ -146,6 +146,7 @@ install-libpgtcl: libpgtcl.a
 install-shlib: $(shlib)
        $(INSTALL) $(INSTL_SHLIB_OPTS) $(shlib) \
                $(LIBDIR)/$(shlib)
+       rm -f $(LIBDIR)/libpgtcl.so
        $(LN_S) -f $(shlib) $(LIBDIR)/libpgtcl.so
 
 .PHONY: clean
index c3981dd3102b246bfe39843e494e79ee56f73f27..940eb04928ce31c16ff66557cc3611c59d9fe35c 100644 (file)
@@ -1,15 +1,21 @@
 
-if [ -f @TCL_CONFIG_SH@ ]; then
-    . @TCL_CONFIG_SH@
-else
+if [ ! -f @TCL_CONFIG_SH@ ]; then
     echo "@TCL_CONFIG_SH@ not found"
     echo "I need this file! Please make a symbolic link to this file"
     echo "and start make again."
     exit 1
 fi
 
-for v in `set | grep '^TCL' | sed -e 's/=.*//'` ; do
-    echo $v = `eval "echo \\$$v"`
-done >Makefile.tcldefs
+. @TCL_CONFIG_SH@
+
+set                                                                                            | 
+    egrep '^TCL_|^TK_'                                                 |
+    sed -e 's/=[       ]*/="/' -e 's/[         ]*$/"/' |
+    while read v
+    do
+               eval "$v"
+               v1=`echo $v | sed -e 's/=.*//'`
+               eval "echo $v1 = \"\$$v1\""
+    done >Makefile.tcldefs
 
 exit 0