Tk Source Code

View Ticket
Login
Ticket UUID: 220420
Title: Improve support for AIX shared libraries.
Type: Bug Version: obsolete: 8.0.4
Submitter: welch Created on: 2000-10-31 23:27:30
Subsystem: 84. Unix Build Assigned To: nobody
Priority: 2 Severity:
Status: Closed Last Modified: 2001-04-25 07:22:08
Resolution: Fixed Closed By: dgp
    Closed on: 2001-04-25 00:22:08
Description:
OriginalBugID: 1111 Bug
Version: 8.0.4
SubmitDate: '1999-01-26'
LastModified: '1999-03-05'
Severity: SER
Status: Released
Submitter: welch
ChangedBy: stanton
OS: Other
Machine: NA
FixedDate: '1999-03-05'
FixedInVersion: 8.0.6


Name:
Paul Duffin

ReproducibleScript:
The problem is that at the moment Tcl and Tk are built as archives containing
a shared object which means that Tk in particular is not dynamically loadable
and neither is any other extension which is also a library. The solution is to
build shared libraries on AIX as shared objects and to use an export / import
file to manage the linking.

The patch can be applied directly to Tk8.1b1 although the configure file will
need regenerating.

This patch does require the related patch for Tcl to have also been applied.

Patch:
*** tk8.0/unix/.configureThu Jan 14 11:14:34 1999
--- tk8.0/unix/configureThu Jan 14 11:14:35 1999
***************
*** 2362,2374 ****
  # AIX remembers this path and will attempt to use it at run-time to look
  # up the Tcl library.

! if test "${TCL_LIB_VERSIONS_OK}" = "ok"; then
!     TK_LIB_FLAG="-ltk${VERSION}\${TK_DBGX}"
  else
!     TK_LIB_FLAG="-ltk`echo ${VERSION} | tr -d .`\${TK_DBGX}"
  fi
- TK_BUILD_LIB_SPEC="-L`pwd` ${TK_LIB_FLAG}"
- TK_LIB_SPEC="-L${exec_prefix}/lib ${TK_LIB_FLAG}"

--- 2362,2382 ----
  # AIX remembers this path and will attempt to use it at run-time to look
  # up the Tcl library.

! if test $TK_SHARED_BUILD = 0 -o $TCL_NEEDS_EXP_FILE = 0; then
!     if test "${TCL_LIB_VERSIONS_OK}" = "ok"; then
! TK_LIB_FLAG="-ltk${VERSION}\${TK_DBGX}"
!     else
! TK_LIB_FLAG="-ltk`echo ${VERSION} | tr -d .`\${TK_DBGX}"
!     fi
!     TK_BUILD_LIB_SPEC="-L`pwd` ${TK_LIB_FLAG}"
!     TK_LIB_SPEC="-L${exec_prefix}/lib/tk${VERSION} ${TK_LIB_FLAG}"
  else
!     TK_BUILD_EXP_FILE="lib.exp"
!     eval "TK_EXP_FILE=libtk${TCL_EXPORT_FILE_SUFFIX}"
!     
!     TK_BUILD_LIB_SPEC="-bI:`pwd`/${TK_BUILD_EXP_FILE}"
!     TK_LIB_SPEC="-bI:${exec_prefix}/lib/tk${VERSION}/${TK_EXP_FILE}"
  fi

***************
*** 2407,2412 ****
--- 2415,2422 ----

+ 
+ 
  trap '' 1 2 15
  cat > confcache <<\EOF
  # This file is a shell script that caches the results of configure
***************
*** 2564,2569 ****
--- 2574,2581 ----
  s%@TK_LD_SEARCH_FLAGS@%$TK_LD_SEARCH_FLAGS%g
  s%@TK_LIB_FILE@%$TK_LIB_FILE%g
  s%@TK_LIB_FLAG@%$TK_LIB_FLAG%g
+ s%@TK_BUILD_EXP_FILE@%$TK_BUILD_EXP_FILE%g
+ s%@TK_EXP_FILE@%$TK_EXP_FILE%g
  s%@TK_LIB_SPEC@%$TK_LIB_SPEC%g
  s%@TK_MAJOR_VERSION@%$TK_MAJOR_VERSION%g
  s%@TK_MINOR_VERSION@%$TK_MINOR_VERSION%g
*** tk8.0/unix/.configure.inThu Jan 14 11:14:36 1999
--- tk8.0/unix/configure.inThu Jan 14 11:14:36 1999
***************
*** 398,410 ****
  # AIX remembers this path and will attempt to use it at run-time to look
  # up the Tcl library.

! if test "${TCL_LIB_VERSIONS_OK}" = "ok"; then
!     TK_LIB_FLAG="-ltk${VERSION}\${TK_DBGX}"
  else
!     TK_LIB_FLAG="-ltk`echo ${VERSION} | tr -d .`\${TK_DBGX}"
  fi
- TK_BUILD_LIB_SPEC="-L`pwd` ${TK_LIB_FLAG}"
- TK_LIB_SPEC="-L${exec_prefix}/lib ${TK_LIB_FLAG}"

  AC_SUBST(CFLAGS_DEBUG)
  AC_SUBST(CFLAGS_DEFAULT)
--- 398,418 ----
  # AIX remembers this path and will attempt to use it at run-time to look
  # up the Tcl library.

! if test $TK_SHARED_BUILD = 0 -o $TCL_NEEDS_EXP_FILE = 0; then
!     if test "${TCL_LIB_VERSIONS_OK}" = "ok"; then
! TK_LIB_FLAG="-ltk${VERSION}\${TK_DBGX}"
!     else
! TK_LIB_FLAG="-ltk`echo ${VERSION} | tr -d .`\${TK_DBGX}"
!     fi
!     TK_BUILD_LIB_SPEC="-L`pwd` ${TK_LIB_FLAG}"
!     TK_LIB_SPEC="-L${exec_prefix}/lib/tk${VERSION} ${TK_LIB_FLAG}"
  else
!     TK_BUILD_EXP_FILE="lib.exp"
!     eval "TK_EXP_FILE=libtk${TCL_EXPORT_FILE_SUFFIX}"
!     
!     TK_BUILD_LIB_SPEC="-bI:`pwd`/${TK_BUILD_EXP_FILE}"
!     TK_LIB_SPEC="-bI:${exec_prefix}/lib/tk${VERSION}/${TK_EXP_FILE}"
  fi

  AC_SUBST(CFLAGS_DEBUG)
  AC_SUBST(CFLAGS_DEFAULT)
***************
*** 432,437 ****
--- 440,447 ----
  AC_SUBST(TK_LD_SEARCH_FLAGS)
  AC_SUBST(TK_LIB_FILE)
  AC_SUBST(TK_LIB_FLAG)
+ AC_SUBST(TK_BUILD_EXP_FILE)
+ AC_SUBST(TK_EXP_FILE)
  AC_SUBST(TK_LIB_SPEC)
  AC_SUBST(TK_MAJOR_VERSION)
  AC_SUBST(TK_MINOR_VERSION)
*** tk8.0/unix/.Makefile.inThu Jan 14 11:14:38 1999
--- tk8.0/unix/Makefile.inThu Jan 14 11:14:38 1999
***************
*** 166,173 ****
  TK_LIB_FLAG = @TK_LIB_FLAG@
  #TK_LIB_FLAG = -ltk

! TCL_LIB_FLAG = @TCL_LIB_FLAG@
! #TCL_LIB_FLAG = -ltcl

  # The symbol below provides support for dynamic loading and shared
  # libraries.  See configure.in for a description of what it means.
--- 166,173 ----
  TK_LIB_FLAG = @TK_LIB_FLAG@
  #TK_LIB_FLAG = -ltk

! TK_EXP_FILE = @TK_EXP_FILE@
! TK_BUILD_EXP_FILE = @TK_BUILD_EXP_FILE@

  # The symbol below provides support for dynamic loading and shared
  # libraries.  See configure.in for a description of what it means.
***************
*** 365,371 ****
  # some ranlibs write to current directory, and this might not always be
  # possible (e.g. if installing as root).

! install-binaries: $(TK_LIB_FILE) wish
  @for i in $(LIB_INSTALL_DIR) $(BIN_INSTALL_DIR) ;  do  if [ ! -d $$i ] ; then  --- 365,371 ----
  # some ranlibs write to current directory, and this might not always be
  # possible (e.g. if installing as root).

! install-binaries: $(TK_LIB_FILE) $(TK_BUILD_EXP_FILE) wish
  @for i in $(LIB_INSTALL_DIR) $(BIN_INSTALL_DIR) ;  do  if [ ! -d $$i ] ; then  ***************
*** 379,384 ****
--- 379,389 ----
  @$(INSTALL_DATA) $(TK_LIB_FILE) $(LIB_INSTALL_DIR)/$(TK_LIB_FILE)
  @(cd $(LIB_INSTALL_DIR); $(RANLIB) $(TK_LIB_FILE))
  @chmod 555 $(LIB_INSTALL_DIR)/$(TK_LIB_FILE)
+ @if test "$(TK_BUILD_EXP_FILE)" != ""; then  +     echo "Installing $(TK_EXP_FILE)";  +     $(INSTALL_DATA) $(TK_BUILD_EXP_FILE)  + $(LIB_INSTALL_DIR)/$(TK_EXP_FILE);  +     fi
  @echo "Installing wish"
  @$(INSTALL_PROGRAM) wish $(BIN_INSTALL_DIR)/wish$(VERSION)
  @echo "Installing tkConfig.sh"

PatchFiles:
tk8.0/unix/configure
tk8.0/unix/configure.in
tk8.0/unix/Makefile.in



03/02/1999 17:20 - pat -duplicate of bug 1110
03/05/1999 16:23 - stanton - This is not a duplicate.  The patch applies to Tk instead of Tcl.