Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 8999f660be1a434be354885a69e1f6fb479e9849
Ticket: 218926ffffffffffffffffffffffffffffffffff
Need to improve configuration support for AIX
User & Date: nobody on 2000-10-26 01:07:59
Changes

  1. assignee changed to: "nobody"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    OriginalBugID: 2798 Bug
    Version: 8.2
    SubmitDate: '1999-09-16'
    LastModified: '2000-02-09'
    Severity: MED
    Status: Released
    Submitter: techsupp
    ChangedBy: hobbs
    RelatedBugIDs: 3365
    OS: AIX
    OSVersion: 4.3.2
    Machine: RS6000
    FixedDate: '2000-02-09'
    FixedInVersion: 8.3
    ClosedDate: '2000-10-25'
    
    
    Name:
    Nick Kisseberth
    
    Comments:
    I know, the patches need to be made to .m4 files. I'll leave that to
        someone
        who can actually test that.
    
           This is the largest patch and fixes the following items:
                * Allows GCC to be used to build Tcl under AIX
                * Use re-entrant versions of libc and libm when
                  building with threads enabled. (under AIX 4.3
                  libc and libc_r actually point to the same library,
                  perhaps this wasn't true on earlier versions?)
                * Use re-entrant aware compiler (cc_r or xlc_r)
                  when using system compiler, or add -D_THREAD_SAFE
                  to gcc when building with threads enabled.
                * Do not use libbsd.a under AIX 4.x
                * Do not use libdl.a under AIX 4.3
                * Build proper shared libraries 
                  (libtcl8.2.a, with shared object shr.o as a member)
                * Seperate configuration entries for AIX 3, AIX 4.1/4.2
                  and AIX 4.3. Tweaked just a bit for each version.
                * Doesn't use export files other than when creating
                  the shared library. Not sure
                  why it was using the export file method before, its
                  unnecessary and a little messy.
                * Build-time library path not included in final binary
                * Optimization flags for system compiler changed to
                  -O2 -qmaxmem=32768. -O2 == -O on newer compilers,
                  but we may as well be explicit for older compilers.
                  Change only made for AIX 4.3. Not sure how far
                  back -qmaxmem goes compiler version-wise. -qmaxmem gets
                  rid of various informational messages by allowing
                  more memory to be used to compute optimizations.
    
        THIS PATCH IS A WORK IN PROGRESS. IT SEEMS TO WORK UNDER AIX 4.3.x QUITE
        WELL. NEEDS INPUT FROM OTHER USERS. SEE
        http://www.itg.uiuc.edu/people/nkissebe/tcltk for the latest version
        of all my AIX patches as well as more commentary.
    
    ObservedBehavior:
    Tcl does not generate proper traditional AIX shared libraries.
        Nor support gcc under AIX
        Nor use thread enabled compiler under AIX
        Nor use re-entrant library versions under AIX
    
    Patch:
    *** tcl8.2.0/unix/configure     Fri Aug 13 17:02:47 1999
    --- tcl8.2.0-AIX/unix/configure Sat Sep 11 23:15:50 1999
    ***************
    *** 2519,2525 ****
          # by comparing the localtime result on a known GMT value.
          #
    
    !     if test "`uname -s`" = "AIX" ; then
            echo $ac_n "checking for gettimeofday in -lbsd""... $ac_c" 1>&6
      echo "configure:2525: checking for gettimeofday in -lbsd" >&5
      ac_lib_var=`echo bsd'_'gettimeofday | sed 'y%./+-%__p_%'`
    --- 2519,2530 ----
          # by comparing the localtime result on a known GMT value.
          #
    
    !     #
    !     # AIX 4.x should not use libbsd.a at all
    !     # if it were needed, must use libbsd_r.a in a threaded build
    !     #
    !
    !     if test "`uname -s`" = "AIX" -a "`uname -v`" = "3" ; then
            echo $ac_n "checking for gettimeofday in -lbsd""... $ac_c" 1>&6
      echo "configure:2525: checking for gettimeofday in -lbsd" >&5
      ac_lib_var=`echo bsd'_'gettimeofday | sed 'y%./+-%__p_%'`
    ***************
    *** 4109,4116 ****
    --- 4114,4125 ----
        MATH_LIBS=""
      else
        echo "$ac_t""no" 1>&6
    + if test "${TCL_THREADS}" = "1" -a -f "/usr/lib/libm_r.a" ; then
    + MATH_LIBS="-lm_r"
    + else
      MATH_LIBS="-lm"
      fi
    + fi
    
          echo $ac_n "checking for main in -lieee""... $ac_c" 1>&6
      echo "configure:4117: checking for main in -lieee" >&5
    ***************
    *** 4157,4164 ****
          # This library also supplies gettimeofday.
          #--------------------------------------------------------------------
    
          libbsd=no
    !     if test "`uname -s`" = "AIX" ; then
            echo $ac_n "checking for gettimeofday in -lbsd""... $ac_c" 1>&6
      echo "configure:4164: checking for gettimeofday in -lbsd" >&5
      ac_lib_var=`echo bsd'_'gettimeofday | sed 'y%./+-%__p_%'`
    --- 4166,4178 ----
          # This library also supplies gettimeofday.
          #--------------------------------------------------------------------
    
    +     #
    +     # AIX 4.x should not use libbsd.a at all
    +     # if it were needed, must use libbsd_r.a in a threaded build
    +     #
    +
          libbsd=no
    !     if test "`uname -s`" = "AIX" -a "`uname -v`" = "3" ; then
            echo $ac_n "checking for gettimeofday in -lbsd""... $ac_c" 1>&6
      echo "configure:4164: checking for gettimeofday in -lbsd" >&5
      ac_lib_var=`echo bsd'_'gettimeofday | sed 'y%./+-%__p_%'`
    ***************
    *** 4658,4679 ****
          TCL_EXP_FILE=""
          STLIB_LD="ar cr"
          case $system in
    !       AIX-4.[2-9])
                SHLIB_CFLAGS=""
    !           SHLIB_LD="$fullSrcDir/ldAix /bin/ld -bhalt:4 -bM:SRE -bE:lib.exp -H5
    12 -T512 -bnoentry"
    !           SHLIB_LD_LIBS='${LIBS}'
                SHLIB_SUFFIX=".so"
                DL_OBJS="tclLoadDl.o"
                DL_LIBS="-ldl"
                LDFLAGS=""
                LD_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}'
    !           TCL_NEEDS_EXP_FILE=1
                TCL_EXPORT_FILE_SUFFIX='${VERSION}\$\{DBGX\}.exp'
                ;;
            AIX-*)
                SHLIB_CFLAGS=""
                SHLIB_LD="$fullSrcDir/ldAix /bin/ld -bhalt:4 -bM:SRE -bE:lib.exp -H5
    12 -T512"
    !           SHLIB_LD_LIBS='${LIBS}'
                SHLIB_SUFFIX=".so"
                DL_OBJS="tclLoadDl.o"
                LIBOBJS="$LIBOBJS tclLoadAix.o"
    --- 4672,4753 ----
          TCL_EXP_FILE=""
          STLIB_LD="ar cr"
          case $system in
    !       AIX-4.[3-9])
    !       #
    !       # AIX 4.3.x and beyond
    !       # Use threadsafe C compiler configuration if using IBM compilers
    !       # Use threadsafe libraries
    !       # Define _THREAD_SAFE to get correct headers with gcc
    !         # Remove build directory from shared library search path
    !       #
    !           if test "${TCL_THREADS}" = "1"  ; then
    !               if test "${CC}" = "cc" -o "${CC}" = "xlc" ; then
    !                   CC=${CC}_r
    !                 fi
    !                 LIBS="-lc_r ${LIBS}"
    !               SHLIB_LD_LIBS="\${LIBS}"
    !             else
    !               SHLIB_LD_LIBS="-lc \${LIBS}"
    !           fi
                SHLIB_CFLAGS=""
    !           SHLIB_LD="$fullSrcDir/ldAix /bin/ld -bM:SRE -bE:lib.exp -bnoentry"
                SHLIB_SUFFIX=".so"
                DL_OBJS="tclLoadDl.o"
    +           DL_LIBS=""
    +           if test "$CC" = "gcc" -o `$CC -v 2>&1 | grep -c gcc` != "0" ; then
    +                 if test "${TCL_THREADS}" = "1" ; then
    +                     EXTRA_CFLAGS=-D_THREAD_SAFE
    +                 fi
    +               LDFLAGS=""
    +               LD_SEARCH_FLAGS='-Wl,-blibpath:/usr/lib:/lib:${LIB_RUNTIME_DIR}'
    +           else
    +                 CFLAGS_OPTIMIZE="-O2 -qmaxmem=32768"
    +               LDFLAGS=""
    +               LD_SEARCH_FLAGS='-blibpath:/usr/lib:/lib:${LIB_RUNTIME_DIR}'
    +             fi
    +           SHARED_LIB_SUFFIX='${VERSION}\$\{DBGX\}.a'
    +           ;;
    +       AIX-4.[1-2])
    +       #
    +       # AIX 4.1.x and 4.2.x
    +       # Use threadsafe C compiler configuration if using IBM compilers
    +       # Use threadsafe libraries
    +       # Define _THREAD_SAFE to get correct headers with gcc
    +       #
    +           if test "${TCL_THREADS}" = "1"  ; then
    +               if test "${CC}" = "cc" -o "${CC}" = "xlc" ; then
    +                   CC=${CC}_r
    +                 fi
    +                 LIBS="-lc_r ${LIBS}"
    +               SHLIB_LD_LIBS="\${LIBS}"
    +             else
    +               SHLIB_LD_LIBS="-lc \${LIBS}"
    +           fi
    +           SHLIB_CFLAGS=""
    +           SHLIB_LD="$fullSrcDir/ldAix /bin/ld -bhalt:4 -bM:SRE -bE:lib.exp -bn
    oentry"
    +           SHLIB_SUFFIX=".so"
    +           DL_OBJS="tclLoadDl.o"
                DL_LIBS="-ldl"
    +           if test "${TCL_THREADS}" = "1" ; then
    +               if test "$CC" = "gcc" -o `$CC -v 2>&1 | grep -c gcc` != "0" ; th
    en
    +                     EXTRA_CFLAGS=-D_THREAD_SAFE
    +               fi
    +           fi
                LDFLAGS=""
                LD_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}'
    !           TCL_NEEDS_EXP_FILE=0
                TCL_EXPORT_FILE_SUFFIX='${VERSION}\$\{DBGX\}.exp'
    +           SHARED_LIB_SUFFIX='${VERSION}\$\{DBGX\}.a'
                ;;
            AIX-*)
    +       #
    +       # AIX 3.x
    +       # Might still work, though pthreads probably not compatible.
    +       # Comments anyone? ([email protected])
    +       #
                SHLIB_CFLAGS=""
                SHLIB_LD="$fullSrcDir/ldAix /bin/ld -bhalt:4 -bM:SRE -bE:lib.exp -H5
    12 -T512"
    !           SHLIB_LD_LIBS="-lc \${LIBS}"
                SHLIB_SUFFIX=".so"
                DL_OBJS="tclLoadDl.o"
                LIBOBJS="$LIBOBJS tclLoadAix.o"
    ***************
    *** 4680,4687 ****
                DL_LIBS="-lld"
                LDFLAGS=""
                LD_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}'
    !           TCL_NEEDS_EXP_FILE=1
                TCL_EXPORT_FILE_SUFFIX='${VERSION}\$\{DBGX\}.exp'
                ;;
            BSD/OS-2.1*|BSD/OS-3*)
                SHLIB_CFLAGS=""
    --- 4754,4762 ----
                DL_LIBS="-lld"
                LDFLAGS=""
                LD_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}'
    !           TCL_NEEDS_EXP_FILE=0
                TCL_EXPORT_FILE_SUFFIX='${VERSION}\$\{DBGX\}.exp'
    +           SHARED_LIB_SUFFIX='${VERSION}\$\{DBGX\}.a'
                ;;
            BSD/OS-2.1*|BSD/OS-3*)
                SHLIB_CFLAGS=""
    
    PatchFiles:
    unix/configure
    
    
    
    Several of these items are in 8.2.1.  gcc still support is
    still needed, as well as checks for the reentrant stuff.
    2798 points out that on AIX the lib is pthreads (with an 's'). 
    -- 09/28/1999 hobbs
    The gcc config was fully corrected for 8.3.0.  All done for above. 
    -- 02/09/2000 hobbs
    
  4. foundin changed to: "obsolete: 8.2"
  5. priority changed to: "5 Medium"
  6. resolution changed to: "None"
  7. status changed to: "Open"
  8. submitter changed to: "nobody"
  9. subsystem changed to: "75. Tutorial"
  10. title changed to: "Need to improve configuration support for AIX"
  11. type changed to: "Bug"