[torqueusers] patch for tclx8.4

Martin Siegert siegert at sfu.ca
Sat Mar 4 14:47:44 MST 2006


Hi,

attached is a patch intended to make torque work with tclx version 8.4
when configured with

--enable-gui --with-tclx

This has been tested on SLES 9 on powerpc64 with tclx 8.4 and on RH 7.3
on i686 with tclx 8.3.

[some of the changes in configure are just changes to white space:
in order to analyze the configure script I changed the somewhat random
indentation in configure to a more regular pattern.]

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-04 13:45:58.090855819 -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
@@ -1189,29 +1189,26 @@
 
 orig_tclx_dir="$tclx_dir"
 if test "$tclx_dir" = yes; then
-    echo $ac_n "checking Tclx library path prefix""... $ac_c" 1>&6
-echo "configure:915: checking Tclx library path prefix" >&5
-if eval "test \"`echo '$''{'pbs_cv_tclx_dir'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  
-        
-
-tclx_dir=no
-ac_LL_PATH=`echo "$PATH" | sed -e 's/:/ /g'`
-for ac_libpath in $ac_LL_PATH /__XqqFrobozz ; do
-    ac_libpath=`echo $ac_libpath | sed -e 's;/bin$;;'`
-    if test `/bin/ls ${ac_libpath}/lib$libsuff/libtclx*.* 2> /dev/null | wc -l` -gt 0; then
+  echo $ac_n "checking Tclx library path prefix""... $ac_c" 1>&6
+  echo "configure:915: checking Tclx library path prefix" >&5
+  if eval "test \"`echo '$''{'pbs_cv_tclx_dir'+set}'`\" = set"; then
+    echo $ac_n "(cached) $ac_c" 1>&6
+  else
+    tclx_dir=no
+    ac_LL_PATH=`echo "$PATH" | sed -e 's/:/ /g'`
+    for ac_libpath in $ac_LL_PATH /__XqqFrobozz ; do
+      ac_libpath=`echo $ac_libpath | sed -e 's;/bin$;;'`
+      if test `/bin/ls ${ac_libpath}/lib$libsuff/libtclx*.* 2> /dev/null | wc -l` -gt 0; then
         tclx_dir="$ac_libpath"
-	break;
-    fi
-done
+        break;
+      fi
+    done
 
-        pbs_cv_tclx_dir="$tclx_dir"
+    pbs_cv_tclx_dir="$tclx_dir"
     
-fi
+  fi
 
-echo "$ac_t""$pbs_cv_tclx_dir" 1>&6
+  echo "$ac_t""$pbs_cv_tclx_dir" 1>&6
 fi
 
 if test "$tclx_dir" != no; then
@@ -1224,143 +1221,137 @@
 test -n "$GUI" -a "$tcl_dir" = no && tcl_dir=yes
 
 if test "$tcl_dir" = yes; then
-    echo $ac_n "checking Tcl library path prefix""... $ac_c" 1>&6
-echo "configure:950: checking Tcl library path prefix" >&5
-if eval "test \"`echo '$''{'pbs_cv_tcl_dir'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  
-                
-
-tcl_dir=no
-ac_LL_PATH=`echo "$PATH" | sed -e 's/:/ /g'`
-for ac_libpath in $ac_LL_PATH /__XqqFrobozz ; do
-    ac_libpath=`echo $ac_libpath | sed -e 's;/bin$;;'`
-    if test `/bin/ls ${ac_libpath}/lib$libsuff/libtcl*.* 2> /dev/null | wc -l` -gt 0; then
+  echo $ac_n "checking Tcl library path prefix""... $ac_c" 1>&6
+  echo "configure:950: checking Tcl library path prefix" >&5
+  if eval "test \"`echo '$''{'pbs_cv_tcl_dir'+set}'`\" = set"; then
+    echo $ac_n "(cached) $ac_c" 1>&6
+  else
+    tcl_dir=no
+    ac_LL_PATH=`echo "$PATH" | sed -e 's/:/ /g'`
+    for ac_libpath in $ac_LL_PATH /__XqqFrobozz ; do
+      ac_libpath=`echo $ac_libpath | sed -e 's;/bin$;;'`
+      if test `/bin/ls ${ac_libpath}/lib$libsuff/libtcl*.* 2> /dev/null | wc -l` -gt 0; then
         tcl_dir="$ac_libpath"
-	break;
-    fi
-done
+        break;
+      fi
+    done
 
-        pbs_cv_tcl_dir="$tcl_dir"
-    
-fi
+    pbs_cv_tcl_dir="$tcl_dir"
+  fi
 
-echo "$ac_t""$pbs_cv_tcl_dir" 1>&6
-    
+  echo "$ac_t""$pbs_cv_tcl_dir" 1>&6
 
-tcl_dir=no
-ac_LL_PATH=`echo "$PATH" | sed -e 's/:/ /g'`
-for ac_libpath in $ac_LL_PATH /__XqqFrobozz ; do
+  tcl_dir=no
+  ac_LL_PATH=`echo "$PATH" | sed -e 's/:/ /g'`
+  for ac_libpath in $ac_LL_PATH /__XqqFrobozz ; do
     ac_libpath=`echo $ac_libpath | sed -e 's;/bin$;;'`
     if test `/bin/ls ${ac_libpath}/lib$libsuff/libtcl*.* 2> /dev/null | wc -l` -gt 0; then
-        tcl_dir="$ac_libpath"
-	break;
+      tcl_dir="$ac_libpath"
+      break;
     fi
-done
+  done
 
 fi
 
 if test "$tcl_dir" != no; then
-    TCL=1
-    TCL_DIR="$tcl_dir"
+  TCL=1
+  TCL_DIR="$tcl_dir"
 
-                    count=`/bin/ls ${tcl_dir}/lib$libsuff/libtk* 2> /dev/null | wc -l`
-    if test "$count" -gt 0 -a -n "$GUI"; then
-	TK=1
-    fi
+  count=`/bin/ls ${tcl_dir}/lib$libsuff/libtk* 2> /dev/null | wc -l`
+  if test "$count" -gt 0 -a -n "$GUI"; then
+    TK=1
+  fi
 fi
 
 if test -n "$GUI" -a "$TK" -ne 1; then
-    echo "configure: warning: cannot build GUI without Tk library, GUI disabled" 1>&2
-    GUI=""
+  echo "configure: warning: cannot build GUI without Tk library, GUI disabled" 1>&2
+  GUI=""
 fi
 
 TCL_VER=""; TK_VER=""
 
 if test "$TCL" -eq 1; then
-    tcl_h=/dev/null
+  tcl_h=/dev/null
 
-    #
-    # if we did not find tcl.h in include then look for a subdirectory
-    # (for example TCL_DIR/include/tcl8.0/tcl.h)
-    #
-    for i in $TCL_DIR/include/tcl.h \
-      `/bin/ls -d $TCL_DIR/include/tcl*/tcl.h 2> /dev/null`; do
-        test -r $i && { tcl_h="$i"; break; }
-    done
+  #
+  # if we did not find tcl.h in include then look for a subdirectory
+  # (for example TCL_DIR/include/tcl8.0/tcl.h)
+  #
+  for i in $TCL_DIR/include/tcl.h \
+    `/bin/ls -d $TCL_DIR/include/tcl*/tcl.h 2> /dev/null`; do
+      test -r $i && { tcl_h="$i"; break; }
+  done
 
-    echo $ac_n "checking Tcl version""... $ac_c" 1>&6
-echo "configure:1016: checking Tcl version" >&5
-if eval "test \"`echo '$''{'pbs_cv_ver_tcl'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  
-        if grep "[ \	]TCL_VERSION[ \	]" $tcl_h > /dev/null 2>&1; then
-           pbs_cv_ver_tcl=`sed -n \
-               -e 's/.*#define.*TCL_VERSION[^"]*"\([^"]*\).*/\1/p' \
-               $tcl_h | tail -1`
-        else
-            pbs_cv_ver_tcl=notfound
+  echo $ac_n "checking Tcl version""... $ac_c" 1>&6
+  echo "configure:1016: checking Tcl version" >&5
+  if eval "test \"`echo '$''{'pbs_cv_ver_tcl'+set}'`\" = set"; then
+    echo $ac_n "(cached) $ac_c" 1>&6
+  else
+    if grep "[ \	]TCL_VERSION[ \	]" $tcl_h > /dev/null 2>&1; then
+      pbs_cv_ver_tcl=`sed -n \
+          -e 's/.*#define.*TCL_VERSION[^"]*"\([^"]*\).*/\1/p' \
+          $tcl_h | tail -1`
+    else
+      pbs_cv_ver_tcl=notfound
     fi
-fi
-
-echo "$ac_t""$pbs_cv_ver_tcl" 1>&6
+  fi
 
-    TCL_VER="$pbs_cv_ver_tcl"
-    test "$TCL_VER" = notfound && \
-	{ echo "configure: error: cannot find Tcl version in $tcl_h" 1>&2; exit 1; };
+  echo "$ac_t""$pbs_cv_ver_tcl" 1>&6
 
-                        TCL_LIB_VER="$TCL_VER"
-    count=`/bin/ls -d $TCL_DIR/lib$libsuff/libtcl${TCL_LIB_VER}.* 2> /dev/null | wc -l`
+  TCL_VER="$pbs_cv_ver_tcl"
+  test "$TCL_VER" = notfound && \
+    { echo "configure: error: cannot find Tcl version in $tcl_h" 1>&2; exit 1; };
+
+  TCL_LIB_VER="$TCL_VER"
+  count=`/bin/ls -d $TCL_DIR/lib$libsuff/libtcl${TCL_LIB_VER}.* 2> /dev/null | wc -l`
+  if test "$count" -lt 1; then
+    TCL_LIB_VER=`echo $TCL_LIB_VER | sed -e 's/\.//'`
+    count=`/bin/ls $TCL_DIR/lib$libsuff/libtcl${TCL_LIB_VER}.* | wc -l`
     if test "$count" -lt 1; then
-        TCL_LIB_VER=`echo $TCL_LIB_VER | sed -e 's/\.//'`
-        count=`/bin/ls $TCL_DIR/lib$libsuff/libtcl${TCL_LIB_VER}.* | wc -l`
-        if test "$count" -lt 1; then
-            { echo "configure: error: cannot find a Tcl library for version $TCL_VER" 1>&2; exit 1; }
-        fi
+      { echo "configure: error: cannot find a Tcl library for version $TCL_VER" 1>&2; exit 1; }
     fi
+  fi
 fi
 
 
 if test "$TK" -eq 1; then
 
-                    tk_h=/dev/null
-    for i in $TCL_DIR/include/tk.h \
-      `/bin/ls -d $TCL_DIR/include/tk*/tk.h 2> /dev/null`; do
-        test -r $i && { tk_h="$i"; break; }
-    done
+  tk_h=/dev/null
+  for i in $TCL_DIR/include/tk.h \
+    `/bin/ls -d $TCL_DIR/include/tk*/tk.h 2> /dev/null`; do
+    test -r $i && { tk_h="$i"; break; }
+  done
 
-    echo $ac_n "checking Tk version""... $ac_c" 1>&6
-echo "configure:1057: checking Tk version" >&5
-if eval "test \"`echo '$''{'pbs_cv_ver_tk'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
+  echo $ac_n "checking Tk version""... $ac_c" 1>&6
+  echo "configure:1057: checking Tk version" >&5
+  if eval "test \"`echo '$''{'pbs_cv_ver_tk'+set}'`\" = set"; then
+    echo $ac_n "(cached) $ac_c" 1>&6
+  else
   
-        if grep "[ \	]TK_VERSION[ \	]" $tk_h > /dev/null 2>&1; then
-           pbs_cv_ver_tk=`sed -n \
-               -e 's/.*#define.*TK_VERSION[^"]*"\([^"]*\).*/\1/p' \
-               $tk_h | tail -1`
-        else
-            pbs_cv_ver_tk=notfound
+    if grep "[ \	]TK_VERSION[ \	]" $tk_h > /dev/null 2>&1; then
+      pbs_cv_ver_tk=`sed -n \
+          -e 's/.*#define.*TK_VERSION[^"]*"\([^"]*\).*/\1/p' \
+          $tk_h | tail -1`
+    else
+      pbs_cv_ver_tk=notfound
     fi
-fi
-
-echo "$ac_t""$pbs_cv_ver_tk" 1>&6
+  fi
 
-    TK_VER="$pbs_cv_ver_tk"
-    test "$TK_VER" = notfound && \
-	{ echo "configure: error: cannot find Tk version in $tk_h" 1>&2; exit 1; };
+  echo "$ac_t""$pbs_cv_ver_tk" 1>&6
 
-                        TK_LIB_VER="$TK_VER"
-    count=`/bin/ls $TCL_DIR/lib$libsuff/libtk${TK_LIB_VER}.* 2> /dev/null | wc -l`
+  TK_VER="$pbs_cv_ver_tk"
+  test "$TK_VER" = notfound && \
+    { echo "configure: error: cannot find Tk version in $tk_h" 1>&2; exit 1; };
+
+  TK_LIB_VER="$TK_VER"
+  count=`/bin/ls $TCL_DIR/lib$libsuff/libtk${TK_LIB_VER}.* 2> /dev/null | wc -l`
+  if test "$count" -lt 1; then
+    TK_LIB_VER=`echo $TK_LIB_VER | sed -e 's/\.//'`
+    count=`/bin/ls $TCL_DIR/lib$libsuff/libtk${TK_LIB_VER}.* | wc -l`
     if test "$count" -lt 1; then
-        TK_LIB_VER=`echo $TK_LIB_VER | sed -e 's/\.//'`
-        count=`/bin/ls $TCL_DIR/lib$libsuff/libtk${TK_LIB_VER}.* | wc -l`
-        if test "$count" -lt 1; then
-            { echo "configure: error: cannot find a Tk library for version $TK_VER" 1>&2; exit 1; }
-        fi
+      { echo "configure: error: cannot find a Tk library for version $TK_VER" 1>&2; exit 1; }
     fi
+  fi
 fi
 
 
@@ -1369,80 +1360,92 @@
 
 TCLX_VER=""
 if test "$TCLX" -eq 1; then
+  tclx_h=/dev/null
+  for i in $TCL_DIR/include/tclExtend.h \
+    `/bin/ls -d $TCL_DIR/include/tcl*/tclExtend.h 2> /dev/null`; do
+    test -r $i && { tclx_h="$i"; break; }
+  done
 
-
-                    tclx_h=/dev/null
-    for i in $TCL_DIR/include/tclExtend.h \
-      `/bin/ls -d $TCL_DIR/include/tcl*/tclExtend.h 2> /dev/null`; do
-        test -r $i && { tclx_h="$i"; break; }
-    done
-
-    echo $ac_n "checking TclX version""... $ac_c" 1>&6
-echo "configure:1057: checking TclX version" >&5
-if eval "test \"`echo '$''{'pbs_cv_ver_tclx'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
+  echo $ac_n "checking TclX version""... $ac_c" 1>&6
+  echo "configure:1057: checking TclX version" >&5
+  if eval "test \"`echo '$''{'pbs_cv_ver_tclx'+set}'`\" = set"; then
+    echo $ac_n "(cached) $ac_c" 1>&6
+  else
   
-        if grep "[ \	]TCLX_VERSION[ \	]" $tclx_h > /dev/null 2>&1; then
-           pbs_cv_ver_tclx=`sed -n \
-               -e 's/.*#define.*TCLX_VERSION[^"]*"\([^"]*\).*/\1/p' \
-               $tclx_h | tail -1`
-        else
-            pbs_cv_ver_tclx=notfound
+    if grep "[ \	]TCLX_VERSION[ \	]" $tclx_h > /dev/null 2>&1; then
+      pbs_cv_ver_tclx=`sed -n \
+          -e 's/.*#define.*TCLX_VERSION[^"]*"\([^"]*\).*/\1/p' \
+          $tclx_h | tail -1`
+      TKXLIB="-ltkx${pbs_cv_ver_tclx}"
+    else
+      pbs_cv_ver_tclx=notfound
     fi
-fi
+  fi
 
-echo "$ac_t""$pbs_cv_ver_tclx" 1>&6
+  if test "$pbs_cv_ver_tclx" = notfound; then
+    TCLX_VERSION=`grep "# *define *CONST84" $tclx_h 2> /dev/null`
+    if [ -n "$TCLX_VERSION" ]; then
+      pbs_cv_ver_tclx='8.4'
+      TKXLIB=""
+    else
+      echo "$ac_t""$pbs_cv_ver_tclx" 1>&6
+      echo "configure: error: cannot find TclX version in $tclx_h" 1>&2
+      exit 1
+    fi
+  fi
 
-    TCLX_VER="$pbs_cv_ver_tclx"
-    test "$TCLX_VER" = notfound && \
-	{ echo "configure: error: cannot find TclX version in $tclx_h" 1>&2; exit 1; };
+  echo "$ac_t""$pbs_cv_ver_tclx" 1>&6
 
-                        TCLX_LIB_VER="$TCLX_VER"
-    count=`/bin/ls $TCL_DIR/lib$libsuff/libtclx${TCLX_LIB_VER}.* 2> /dev/null | wc -l`
+  TCLX_VER="$pbs_cv_ver_tclx"
+  TCLX_LIB_VER="$TCLX_VER"
+  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`
     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`
-        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=''
+      TKXLIB='-ltkx'
+      count=`/bin/ls $TCL_DIR/lib$libsuff/libtclx.so* $TCL_DIR/lib$libsuff/libtclx.a 2> /dev/null`
+      test "$count" -lt 1 && \
+        { echo "configure: error: cannot find a TclX library for version $TCLX_VER" 1>&2; exit 1; }
     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}"
+  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} $TKXLIB"
 fi
 
 if test "$TCL" -eq 1; then
-    TCL_DIR="$tcl_dir"
+  TCL_DIR="$tcl_dir"
 
-                        if test "$tcl_dir" != "$tclx_dir"; then
-        TCL_LIBS=$TCL_LIBS' -L$(TCL_DIR)/lib'$libsuff
-    fi
+  if test "$tcl_dir" != "$tclx_dir"; then
+    TCL_LIBS=$TCL_LIBS' -L$(TCL_DIR)/lib'$libsuff
+  fi
 
-                        count=`/bin/ls -d ${tcl_dir}/include/tcl${TCL_VER} 2> /dev/null | wc -l`
-    if test "$count" -gt 0; then
-        TCL_INCS=$TCL_INCS' -I$(TCL_DIR)/include/tcl$(TCL_VER)'
-    fi
+  count=`/bin/ls -d ${tcl_dir}/include/tcl${TCL_VER} 2> /dev/null | wc -l`
+  if test "$count" -gt 0; then
+    TCL_INCS=$TCL_INCS' -I$(TCL_DIR)/include/tcl$(TCL_VER)'
+  fi
 
-                    count=`/bin/ls -d ${tcl_dir}/include/tk${TK_VER} 2> /dev/null | wc -l`
-    if test "$count" -gt 0; then
-        TCL_INCS=$TCL_INCS' -I$(TCL_DIR)/include/tk$(TK_VER)'
-    fi
+  count=`/bin/ls -d ${tcl_dir}/include/tk${TK_VER} 2> /dev/null | wc -l`
+  if test "$count" -gt 0; then
+    TCL_INCS=$TCL_INCS' -I$(TCL_DIR)/include/tk$(TK_VER)'
+  fi
 
-                    count=`/bin/ls -d ${tcl_dir}/include/tcl.h ${tcl_dir}/include/tk.h 2> /dev/null | wc -l`
-    if test "$count" -gt 0; then
-        TCL_INCS=$TCL_INCS' -I$(TCL_DIR)/include'
-    fi
+  count=`/bin/ls -d ${tcl_dir}/include/tcl.h ${tcl_dir}/include/tk.h 2> /dev/null | wc -l`
+  if test "$count" -gt 0; then
+    TCL_INCS=$TCL_INCS' -I$(TCL_DIR)/include'
+  fi
 
-                    if test "$TK" -eq 1; then
-        TCL_INCS=$TCL_INCS' $(X11INC)'
-        TCL_LIBS=$TCL_LIBS' $(LIBTK)'
-    fi
-    TCL_LIBS=$TCL_LIBS' $(LIBTCL)'
-    if test "$TK" -eq 1; then
-        TCL_LIBS=$TCL_LIBS' $(X11LIB) -lX11'
-    fi
+  if test "$TK" -eq 1; then
+    TCL_INCS=$TCL_INCS' $(X11INC)'
+    TCL_LIBS=$TCL_LIBS' $(LIBTK)'
+  fi
+  TCL_LIBS=$TCL_LIBS' $(LIBTCL)'
+  if test "$TK" -eq 1; then
+    TCL_LIBS=$TCL_LIBS' $(X11LIB) -lX11'
+  fi
 fi
 
 test "$tclx_dir" = no -a "$orig_tclx_dir" != no &&
@@ -1581,7 +1584,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