Re: --with-tcl build on AIX (and others) fails - Mailing list pgsql-hackers

From Tom Lane
Subject Re: --with-tcl build on AIX (and others) fails
Date
Msg-id 6566.1011567346@sss.pgh.pa.us
Whole thread Raw
In response to --with-tcl build on AIX (and others) fails  ("Zeugswetter Andreas SB SD" <ZeugswetterA@spardat.at>)
Responses Re: --with-tcl build on AIX (and others) fails  (Peter Eisentraut <peter_e@gmx.net>)
List pgsql-hackers
I tried out the patch that Andreas sent in a couple weeks ago, and find
that as-is it fails on HPUX.  The attached version works okay on both
HPUX 10.20 and RH Linux 7.2, however.  Anyone want to try it on other
platforms?  (Note this only covers Andreas' proposed changes for pltcl,
not for libpgtcl.)

            regards, tom lane

*** src/Makefile.shlib.orig    Sun Nov 11 20:45:36 2001
--- src/Makefile.shlib    Sun Jan 20 17:03:25 2002
***************
*** 400,406 ****
  clean-lib:
      rm -f lib$(NAME).a
  ifeq ($(enable_shared), yes)
!     rm -f $(shlib) lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION) lib$(NAME)$(DLSUFFIX)
  endif
  ifeq ($(PORTNAME), win)
      rm -rf $(NAME).def
--- 400,409 ----
  clean-lib:
      rm -f lib$(NAME).a
  ifeq ($(enable_shared), yes)
!     rm -f lib$(NAME)$(DLSUFFIX) lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION)
lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION)
! ifdef EXPSUFF
!     rm -f lib$(NAME)$(EXPSUFF)
! endif
  endif
  ifeq ($(PORTNAME), win)
      rm -rf $(NAME).def
*** src/pl/tcl/Makefile.orig    Sat Oct 13 00:23:50 2001
--- src/pl/tcl/Makefile    Sun Jan 20 17:20:56 2002
***************
*** 26,97 ****
  endif
  endif

!
! # Change following to how shared library that contains references to
! # libtcl must get built on your system. Since these definitions come
! # from the tclConfig.sh script, they should work if the shared build
! # of tcl was successful on this system. However, tclConfig.sh lies to
! # us a little bit (at least in versions 7.6 through 8.0.4) --- it
! # doesn't mention -lc in TCL_LIBS, but you still need it on systems
! # that want to hear about dependent libraries...

  ifneq ($(TCL_SHLIB_LD_LIBS),)
  # link command for a shared lib must mention shared libs it uses
! SHLIB_EXTRA_LIBS=$(TCL_LIBS) -lc
  else
  ifeq ($(PORTNAME), hpux)
  # link command for a shared lib must mention shared libs it uses,
  # even though Tcl doesn't think so...
! SHLIB_EXTRA_LIBS=$(TCL_LIBS) -lc
  else
  # link command for a shared lib must NOT mention shared libs it uses
! SHLIB_EXTRA_LIBS=
! endif
  endif
-
- %$(TCL_SHLIB_SUFFIX): %.o
-     $(TCL_SHLIB_LD) -o $@ $< $(TCL_LIB_SPEC) $(SHLIB_EXTRA_LIBS)
-
-
- CC = $(TCL_CC)
-
- # Since we are using Tcl's choice of C compiler, which might not be
- # the same one selected for Postgres, do NOT use CFLAGS from
- # Makefile.global. Instead use TCL's CFLAGS plus necessary -I
- # directives.
-
- # Can choose either TCL_CFLAGS_OPTIMIZE or TCL_CFLAGS_DEBUG here, as
- # needed
- override CPPFLAGS += $(TCL_DEFS)
- override CFLAGS = $(TCL_CFLAGS_OPTIMIZE) $(TCL_SHLIB_CFLAGS)
-
-
- #
- # DLOBJS is the dynamically-loaded object file.
- #
- DLOBJS= pltcl$(DLSUFFIX)
-
- INFILES= $(DLOBJS)
-
- #
- # plus exports files
- #
- ifdef EXPSUFF
- INFILES+= $(DLOBJS:.o=$(EXPSUFF))
  endif


! # Provide dummy targets for the case where we can't build the shared library.

  ifeq ($(TCL_SHARED_BUILD), 1)

! all: $(INFILES)
      $(MAKE) -C modules $@

- pltcl$(DLSUFFIX): pltcl.o
-
  install: all installdirs
!     $(INSTALL_SHLIB) $(DLOBJS) $(DESTDIR)$(pkglibdir)/$(DLOBJS)
      $(MAKE) -C modules $@

  installdirs:
--- 26,64 ----
  endif
  endif

! # Set up extra libs that must be mentioned in pltcl.so's link command.
! # Aside from libtcl.so, on many platforms we must mention the shared
! # libraries that libtcl.so depends on.  Don't forget -lc, which the
! # Tcl makefiles unaccountably exclude from $(TCL_LIBS).

  ifneq ($(TCL_SHLIB_LD_LIBS),)
  # link command for a shared lib must mention shared libs it uses
! SHLIB_LINK=$(TCL_LIB_SPEC) $(TCL_LIBS) -lc
  else
  ifeq ($(PORTNAME), hpux)
  # link command for a shared lib must mention shared libs it uses,
  # even though Tcl doesn't think so...
! SHLIB_LINK=$(TCL_LIB_SPEC) $(TCL_LIBS) -lc
  else
  # link command for a shared lib must NOT mention shared libs it uses
! SHLIB_LINK=$(TCL_LIB_SPEC)
  endif
  endif

+ NAME = pltcl
+ SO_MAJOR_VERSION = 2
+ SO_MINOR_VERSION = 0
+ OBJS = pltcl.o

! include $(top_srcdir)/src/Makefile.shlib

  ifeq ($(TCL_SHARED_BUILD), 1)

! all: all-lib
      $(MAKE) -C modules $@

  install: all installdirs
!     $(INSTALL_SHLIB) $(shlib) $(DESTDIR)$(pkglibdir)/$(NAME)$(DLSUFFIX)
      $(MAKE) -C modules $@

  installdirs:
***************
*** 99,105 ****
      $(MAKE) -C modules $@

  uninstall:
!     rm -f $(DESTDIR)$(pkglibdir)/$(DLOBJS)
      $(MAKE) -C modules $@

  else # TCL_SHARED_BUILD = 0
--- 66,72 ----
      $(MAKE) -C modules $@

  uninstall:
!     rm -f $(DESTDIR)$(pkglibdir)/$(NAME)$(DLSUFFIX)
      $(MAKE) -C modules $@

  else # TCL_SHARED_BUILD = 0
***************
*** 114,119 ****
  Makefile.tcldefs: mkMakefile.tcldefs.sh
      $(SHELL) $< '$(TCL_CONFIG_SH)' '$@'

! clean distclean maintainer-clean:
!     rm -f $(INFILES) pltcl.o Makefile.tcldefs
      $(MAKE) -C modules $@
--- 81,86 ----
  Makefile.tcldefs: mkMakefile.tcldefs.sh
      $(SHELL) $< '$(TCL_CONFIG_SH)' '$@'

! clean distclean maintainer-clean: clean-lib
!     rm -f $(OBJS) Makefile.tcldefs
      $(MAKE) -C modules $@

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: pltlc and pltlcu problems
Next
From: Brent Verner
Date:
Subject: Re: pltlc and pltlcu problems