[torqueusers] patch for tclx8.4

Martin Siegert siegert at sfu.ca
Sun Mar 5 15:14:06 MST 2006


On Sun, Mar 05, 2006 at 12:23:48AM -0800, Garrick Staples wrote:

> Can you submit again without the white space changes?

Here we go. I tried to minimize changes as much as possible.

Summary of changes in configure:

* search for "#define CONST84" in tclExtend.h, if search for
  TCLX_VERSION fails. If CONST84 is found, set TCLX_VER to '8.4'.
* set TKXLIB to "-ltkx${TCLX_LIB_VER}" unless $TCLX_VER=8.4 in
  which case it is left empty.
* search for libtclx.a and libtclx.so if the library was not found
  under other names. If found, set TCLX_LIB_VER to the empty string.
* change
        count=`/bin/ls $TCL_DIR/lib$libsuff/libtk${TCLX_LIB_VER}.* | wc -l`
  to
        count=`/bin/ls $TCL_DIR/lib$libsuff/libtclx${TCLX_LIB_VER}.* | wc -l`
  when searching for tclx library (line 1405 of the original configure).
  This was not included in the previous patch. Please check whether this
  is alright.
* set TCL_LIBS="$TCL_LIBS -ltclx${TCLX_LIB_VER} $TKXLIB"
* change X11LIB="-L$with_x11" to X11LIB="-L$x_libraries"
* add powerpc to 64bit platforms.

Change in src/tools/pbsTkInit.c:
* if CONST84 is defined, do not call Tkx_Init: it does not exists
  anymore (and is not needed).

Cheers,
Martin

-- 
Martin Siegert
Head, HPC at SFU
WestGrid Site Manager
Academic Computing Services                        phone: (604) 291-4691
Simon Fraser University                            fax:   (604) 291-4242
Burnaby, British Columbia                          email: siegert at sfu.ca
Canada  V5A 1S6
-------------- next part --------------
--- torque-2.0.0p8/configure.orig	2006-01-27 10:42:17.000000000 -0800
+++ torque-2.0.0p8/configure	2006-03-05 13:42:32.317369807 -0800
@@ -1034,7 +1034,7 @@
 case $host_os in
 linux-gnu*)
   case "$host_cpu" in
-  x86_64*|s390x*)
+  x86_64*|s390x*|powerpc*)
     echo '#line 819 "configure"' > conftest.$ac_ext
     echo $ac_n "checking name of lib directory""... $ac_c" 1>&6
     if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
@@ -1387,6 +1387,10 @@
            pbs_cv_ver_tclx=`sed -n \
                -e 's/.*#define.*TCLX_VERSION[^"]*"\([^"]*\).*/\1/p' \
                $tclx_h | tail -1`
+           TKXLIB="-ltkx${pbs_cv_ver_tclx}"
+        elif grep "# *define *CONST84" $tclx_h > /dev/null 2>&1; then
+           pbs_cv_ver_tclx='8.4'
+           TKXLIB=""
         else
             pbs_cv_ver_tclx=notfound
     fi
@@ -1402,15 +1406,21 @@
     count=`/bin/ls $TCL_DIR/lib$libsuff/libtclx${TCLX_LIB_VER}.* 2> /dev/null | wc -l`
     if test "$count" -lt 1; then
         TCLX_LIB_VER=`echo $TCLX_LIB_VER | sed -e 's/\.//'`
-        count=`/bin/ls $TCL_DIR/lib$libsuff/libtk${TCLX_LIB_VER}.* | wc -l`
+        test -n "$TKXLIB" && TKXLIB="-ltkx${TCLX_LIB_VER}"
+        count=`/bin/ls $TCL_DIR/lib$libsuff/libtclx${TCLX_LIB_VER}.* | wc -l`
         if test "$count" -lt 1; then
+          count=`/bin/ls $TCL_DIR/lib$libsuff/libtclx.a $TCL_DIR/lib$libsuff/libtclx.so 2> /dev/null | wc -l`
+          if test "$count" -lt 1; then
             { echo "configure: error: cannot find a TclX library for version $TCLX_VER" 1>&2; exit 1; }
+          fi
+          TCLX_LIB_VER=''
+          test -n "$TKXLIB" && TKXLIB="-ltkx"
         fi
     fi
                 TCLX_DIR="$tclx_dir"
     TCL_LIBS=$TCL_LIBS' -L$(TCLX_DIR)/lib'$libsuff
     TCL_INCS=$TCL_INCS' -I$(TCLX_DIR)/include'
-    TCL_LIBS="$TCL_LIBS -ltclx${TCLX_LIB_VER} -ltkx${TCLX_LIB_VER}"
+    TCL_LIBS="$TCL_LIBS -ltclx${TCLX_LIB_VER} $TKXLIB"
 fi
 
 if test "$TCL" -eq 1; then
@@ -1581,7 +1591,7 @@
 if test "$x_libraries" != "NONE" ; then
   count=`/bin/ls $x_libraries/libX11* 2> /dev/null | wc -l`
   if test "$count" -gt 0; then
-    X11LIB="-L$with_x11"
+    X11LIB="-L$x_libraries"
   else
     echo "configure: warning: "X11 libraries not found"" 1>&2
   fi
--- torque-2.0.0p8/src/tools/pbsTkInit.c.orig	2006-01-27 10:42:05.000000000 -0800
+++ torque-2.0.0p8/src/tools/pbsTkInit.c	2006-03-04 10:36:46.906960773 -0800
@@ -120,9 +120,11 @@
 #if	TCLX
 	if (Tclx_Init(interp) == TCL_ERROR)
 		return TCL_ERROR;
+#if !defined(CONST84)
 	if (Tkx_Init(interp) == TCL_ERROR)
 		return TCL_ERROR;
 #endif
+#endif
 
 	fullresp(0);
 	add_cmds(interp);


More information about the torqueusers mailing list