smalltalk
author Jan Vrany <jan.vrany@fit.cvut.cz>
Mon, 16 Oct 2017 20:18:26 +0100
branchjv
changeset 1525 0275f69b9d05
parent 1512 507674c6d84b
child 1527 c882cd8db4f7
permissions -rwxr-xr-x
UNIX: Set `LD_LIBRARY_PATH` only when running from "install tree"
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1435
9a1f18933e40 Merged code from jv-branch's 'distutils' package
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1432
diff changeset
     1
#!/bin/bash
151
c003915ba2b9 smalltalk is now a shell script
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     2
c003915ba2b9 smalltalk is now a shell script
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     3
# $Header$
c003915ba2b9 smalltalk is now a shell script
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     4
#
c003915ba2b9 smalltalk is now a shell script
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     5
#
c003915ba2b9 smalltalk is now a shell script
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     6
# startup script for smalltalk
c003915ba2b9 smalltalk is now a shell script
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     7
# actually, simply calls stx, passing all arguments.
c003915ba2b9 smalltalk is now a shell script
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     8
#
c003915ba2b9 smalltalk is now a shell script
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     9
c003915ba2b9 smalltalk is now a shell script
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    10
# In previous versions, smalltalk used to be the executable itself.
c003915ba2b9 smalltalk is now a shell script
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    11
# This lead to problems on systems, where things like LD_LIBRARY_PATH
1525
0275f69b9d05 UNIX: Set `LD_LIBRARY_PATH` only when running from "install tree"
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1512
diff changeset
    12
# should be set in advance.
151
c003915ba2b9 smalltalk is now a shell script
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    13
# Now, here is a place to do such things ...
c003915ba2b9 smalltalk is now a shell script
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    14
164
9bf3ac7b759d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 159
diff changeset
    15
#
192
d63a7455cb52 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 164
diff changeset
    16
# -x name specifies an explicit executable
277
9f56767f07b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 276
diff changeset
    17
#         to avoid executing another stx from some directory along the PATH
9f56767f07b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 276
diff changeset
    18
#         (i.e to force use: ./smalltalk -x ./stx)
192
d63a7455cb52 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 164
diff changeset
    19
#
1525
0275f69b9d05 UNIX: Set `LD_LIBRARY_PATH` only when running from "install tree"
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1512
diff changeset
    20
# -X name specifies an explicit path to the stx executable
277
9f56767f07b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 276
diff changeset
    21
#         to avoid executing another stx from some directory along the PATH
9f56767f07b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 276
diff changeset
    22
#         (i.e to force use: ./smalltalk -X .)
341
8e1e10d2f6a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 329
diff changeset
    23
#         [almost the same as above]
277
9f56767f07b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 276
diff changeset
    24
#
9f56767f07b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 276
diff changeset
    25
# -ldd    show ldd-output (to debug, which libs are loaded)
9f56767f07b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 276
diff changeset
    26
#
281
3c2e6f8ca288 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 280
diff changeset
    27
# all other args go to stx & the user classes
277
9f56767f07b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 276
diff changeset
    28
#
1525
0275f69b9d05 UNIX: Set `LD_LIBRARY_PATH` only when running from "install tree"
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1512
diff changeset
    29
STX_VERSION=6.2.6
277
9f56767f07b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 276
diff changeset
    30
1435
9a1f18933e40 Merged code from jv-branch's 'distutils' package
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1432
diff changeset
    31
STX_EXE=stx
9a1f18933e40 Merged code from jv-branch's 'distutils' package
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1432
diff changeset
    32
STX_BIN_DIR=$(dirname $0)
439
060918989239 Add option -gdb to debug.
Stefan Vogel <sv@exept.de>
parents: 435
diff changeset
    33
DEBUGGER=
060918989239 Add option -gdb to debug.
Stefan Vogel <sv@exept.de>
parents: 435
diff changeset
    34
1435
9a1f18933e40 Merged code from jv-branch's 'distutils' package
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1432
diff changeset
    35
if ! test -f "$STX_BIN_DIR/Make.proto"; then
1525
0275f69b9d05 UNIX: Set `LD_LIBRARY_PATH` only when running from "install tree"
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1512
diff changeset
    36
	# Running in Smalltalk/X jv-branch from and "installation tree"
0275f69b9d05 UNIX: Set `LD_LIBRARY_PATH` only when running from "install tree"
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1512
diff changeset
    37
    	STX_HOME="$STX_BIN_DIR/.."
0275f69b9d05 UNIX: Set `LD_LIBRARY_PATH` only when running from "install tree"
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1512
diff changeset
    38
	STX_TOPDIR="$STX_HOME/lib/smalltalkx/$STX_VERSION"
1435
9a1f18933e40 Merged code from jv-branch's 'distutils' package
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1432
diff changeset
    39
	STX_LIBDIR="$STX_TOPDIR/lib"
9a1f18933e40 Merged code from jv-branch's 'distutils' package
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1432
diff changeset
    40
	STX_PACKAGEDIR="$STX_TOPDIR%/packages"
9a1f18933e40 Merged code from jv-branch's 'distutils' package
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1432
diff changeset
    41
	STX_EXE="$STX_TOPDIR/bin/stx-bin"
1525
0275f69b9d05 UNIX: Set `LD_LIBRARY_PATH` only when running from "install tree"
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1512
diff changeset
    42
	export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$STX_LIBDIR/lib"
452
f1fc8e661543 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
    43
fi
f1fc8e661543 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
    44
476
25c3df1d5c43 ignore invalid STX_LIBDIR setting
Claus Gittinger <cg@exept.de>
parents: 454
diff changeset
    45
if [ "$STX_LIBDIR" != "" ]
25c3df1d5c43 ignore invalid STX_LIBDIR setting
Claus Gittinger <cg@exept.de>
parents: 454
diff changeset
    46
then
25c3df1d5c43 ignore invalid STX_LIBDIR setting
Claus Gittinger <cg@exept.de>
parents: 454
diff changeset
    47
    if [ ! -f $STX_LIBDIR/smalltalk.rc ]
25c3df1d5c43 ignore invalid STX_LIBDIR setting
Claus Gittinger <cg@exept.de>
parents: 454
diff changeset
    48
    then
1435
9a1f18933e40 Merged code from jv-branch's 'distutils' package
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1432
diff changeset
    49
       echo "smalltalk [warning]: ignore wrong STX_LIBDIR setting ($STX_LIBDIR)"
1326
e6197baf42c8 Initial support for systemtap.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1274
diff changeset
    50
       STX_LIBDIR=""
476
25c3df1d5c43 ignore invalid STX_LIBDIR setting
Claus Gittinger <cg@exept.de>
parents: 454
diff changeset
    51
    fi
25c3df1d5c43 ignore invalid STX_LIBDIR setting
Claus Gittinger <cg@exept.de>
parents: 454
diff changeset
    52
fi
25c3df1d5c43 ignore invalid STX_LIBDIR setting
Claus Gittinger <cg@exept.de>
parents: 454
diff changeset
    53
25c3df1d5c43 ignore invalid STX_LIBDIR setting
Claus Gittinger <cg@exept.de>
parents: 454
diff changeset
    54
383
3dfae183631c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 344
diff changeset
    55
# notice: STXLIBDIR is filled in here by install-sh script
319
ad0e533985c9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 316
diff changeset
    56
if test -z "$STX_LIBDIR"
ad0e533985c9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 316
diff changeset
    57
then
1326
e6197baf42c8 Initial support for systemtap.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1274
diff changeset
    58
    bindir=`dirname $0`
e6197baf42c8 Initial support for systemtap.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1274
diff changeset
    59
    case "$bindir" in
e6197baf42c8 Initial support for systemtap.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1274
diff changeset
    60
        /* )
e6197baf42c8 Initial support for systemtap.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1274
diff changeset
    61
        ;;
e6197baf42c8 Initial support for systemtap.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1274
diff changeset
    62
        .* )
e6197baf42c8 Initial support for systemtap.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1274
diff changeset
    63
        bindir=`( cd $bindir; pwd ) 2> /dev/null`
e6197baf42c8 Initial support for systemtap.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1274
diff changeset
    64
        ;;
e6197baf42c8 Initial support for systemtap.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1274
diff changeset
    65
    esac
e6197baf42c8 Initial support for systemtap.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1274
diff changeset
    66
    if [ -d ${bindir}/../lib ]
e6197baf42c8 Initial support for systemtap.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1274
diff changeset
    67
    then
e6197baf42c8 Initial support for systemtap.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1274
diff changeset
    68
        STX_LIBDIR=`cd ${bindir}/../lib ; pwd`
e6197baf42c8 Initial support for systemtap.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1274
diff changeset
    69
    fi
319
ad0e533985c9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 316
diff changeset
    70
fi
452
f1fc8e661543 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
    71
476
25c3df1d5c43 ignore invalid STX_LIBDIR setting
Claus Gittinger <cg@exept.de>
parents: 454
diff changeset
    72
if [ -z "$STX_LIBDIR" ]
25c3df1d5c43 ignore invalid STX_LIBDIR setting
Claus Gittinger <cg@exept.de>
parents: 454
diff changeset
    73
then
25c3df1d5c43 ignore invalid STX_LIBDIR setting
Claus Gittinger <cg@exept.de>
parents: 454
diff changeset
    74
    if [ -d ../lib ]
25c3df1d5c43 ignore invalid STX_LIBDIR setting
Claus Gittinger <cg@exept.de>
parents: 454
diff changeset
    75
    then
1326
e6197baf42c8 Initial support for systemtap.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1274
diff changeset
    76
        STX_LIBDIR=`cd ../lib ; pwd`
476
25c3df1d5c43 ignore invalid STX_LIBDIR setting
Claus Gittinger <cg@exept.de>
parents: 454
diff changeset
    77
    fi
25c3df1d5c43 ignore invalid STX_LIBDIR setting
Claus Gittinger <cg@exept.de>
parents: 454
diff changeset
    78
fi
435
3d751dfb900a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 434
diff changeset
    79
if [ ! -d "$STX_LIBDIR" ]
383
3dfae183631c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 344
diff changeset
    80
then
3dfae183631c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 344
diff changeset
    81
    if [ -d ../lib ]
3dfae183631c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 344
diff changeset
    82
    then
1326
e6197baf42c8 Initial support for systemtap.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1274
diff changeset
    83
        STX_LIBDIR=`cd ../lib ; pwd`
383
3dfae183631c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 344
diff changeset
    84
    fi
3dfae183631c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 344
diff changeset
    85
fi
452
f1fc8e661543 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
    86
401
64a83b800ff7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 399
diff changeset
    87
if test -z "$STX_TOPDIR"
64a83b800ff7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 399
diff changeset
    88
then
64a83b800ff7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 399
diff changeset
    89
    if [ -f ../lib/smalltalk.rc ]
64a83b800ff7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 399
diff changeset
    90
    then
1326
e6197baf42c8 Initial support for systemtap.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1274
diff changeset
    91
        STX_TOPDIR=`cd .. ; pwd`
434
f073cdbe422f oops - LIBDIR/TOPDIR & PACKAGEDIR detection failed,
Claus Gittinger <cg@exept.de>
parents: 401
diff changeset
    92
    else
1326
e6197baf42c8 Initial support for systemtap.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1274
diff changeset
    93
       if [ -f $STX_LIBDIR/../lib/smalltalk.rc ]
e6197baf42c8 Initial support for systemtap.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1274
diff changeset
    94
       then
e6197baf42c8 Initial support for systemtap.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1274
diff changeset
    95
           STX_TOPDIR=`cd $STX_LIBDIR/.. ; pwd`
e6197baf42c8 Initial support for systemtap.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1274
diff changeset
    96
       else
1435
9a1f18933e40 Merged code from jv-branch's 'distutils' package
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1432
diff changeset
    97
           if [ -f $STX_BIN_DIR/smalltalk.rc ]
1326
e6197baf42c8 Initial support for systemtap.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1274
diff changeset
    98
           then
1435
9a1f18933e40 Merged code from jv-branch's 'distutils' package
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1432
diff changeset
    99
              STX_TOPDIR=`cd $STX_BIN_DIR/../.. ; pwd`
1326
e6197baf42c8 Initial support for systemtap.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1274
diff changeset
   100
           fi
e6197baf42c8 Initial support for systemtap.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1274
diff changeset
   101
       fi
401
64a83b800ff7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 399
diff changeset
   102
    fi
64a83b800ff7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 399
diff changeset
   103
fi
383
3dfae183631c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 344
diff changeset
   104
434
f073cdbe422f oops - LIBDIR/TOPDIR & PACKAGEDIR detection failed,
Claus Gittinger <cg@exept.de>
parents: 401
diff changeset
   105
# echo STX_LIBDIR is $STX_LIBDIR
f073cdbe422f oops - LIBDIR/TOPDIR & PACKAGEDIR detection failed,
Claus Gittinger <cg@exept.de>
parents: 401
diff changeset
   106
# echo STX_TOPDIR is $STX_TOPDIR
f073cdbe422f oops - LIBDIR/TOPDIR & PACKAGEDIR detection failed,
Claus Gittinger <cg@exept.de>
parents: 401
diff changeset
   107
1445
88a4f36a6912 Issue #98: Removed use of STX_PACKAGEDIR from startup scripts
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1435
diff changeset
   108
export STX_LIBDIR STX_TOPDIR
452
f1fc8e661543 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
   109
1435
9a1f18933e40 Merged code from jv-branch's 'distutils' package
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1432
diff changeset
   110
# echo STX is $STX_EXE
277
9f56767f07b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 276
diff changeset
   111
1326
e6197baf42c8 Initial support for systemtap.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1274
diff changeset
   112
e6197baf42c8 Initial support for systemtap.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1274
diff changeset
   113
if [ "$1" = "--help" ]
1525
0275f69b9d05 UNIX: Set `LD_LIBRARY_PATH` only when running from "install tree"
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1512
diff changeset
   114
then
1326
e6197baf42c8 Initial support for systemtap.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1274
diff changeset
   115
    echo "
1525
0275f69b9d05 UNIX: Set `LD_LIBRARY_PATH` only when running from "install tree"
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1512
diff changeset
   116
usage: $(basename $0) [-x prog] [-X dir] [--ldd] [--gdb]
1326
e6197baf42c8 Initial support for systemtap.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1274
diff changeset
   117
e6197baf42c8 Initial support for systemtap.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1274
diff changeset
   118
args to startup script:
e6197baf42c8 Initial support for systemtap.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1274
diff changeset
   119
   -x prog ................ use prog instead of stx as executable
e6197baf42c8 Initial support for systemtap.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1274
diff changeset
   120
   -X dir ................. use stx from dir instead of default (PATH)
e6197baf42c8 Initial support for systemtap.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1274
diff changeset
   121
   --ldd .................. show which shared libraries are used
e6197baf42c8 Initial support for systemtap.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1274
diff changeset
   122
   --gdb .................. run with gdb-Debugger (type r in debugger to start)
1512
507674c6d84b UNIX: Added new option `--vdb` to run under Visual / VM Debugger.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1450
diff changeset
   123
   --gdb .................. run with Visual / VM Debugger
1326
e6197baf42c8 Initial support for systemtap.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1274
diff changeset
   124
   --cgdb ................. run with cgdb-Debugger (type r in debugger to start)
1432
1e235b190ee3 Added --callgrind-startup option
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1326
diff changeset
   125
   --callgrind ............ run under callgrind profiler tool with profiling off -
1e235b190ee3 Added --callgrind-startup option
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1326
diff changeset
   126
                            use this to profile some benchmark
1e235b190ee3 Added --callgrind-startup option
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1326
diff changeset
   127
   --callgrind-startup .... run under callgrind profiler tool with profiling on
1e235b190ee3 Added --callgrind-startup option
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1326
diff changeset
   128
                            - use this to profile VM startup
1525
0275f69b9d05 UNIX: Set `LD_LIBRARY_PATH` only when running from "install tree"
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1512
diff changeset
   129
   --stap SCRIPT .......... run given systemtap script, passing stx command as
1326
e6197baf42c8 Initial support for systemtap.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1274
diff changeset
   130
                            stap -c 'stx ...' Systemtap may not be compiled in.
e6197baf42c8 Initial support for systemtap.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1274
diff changeset
   131
"
e6197baf42c8 Initial support for systemtap.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1274
diff changeset
   132
fi
e6197baf42c8 Initial support for systemtap.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1274
diff changeset
   133
193
e38e9ee3b219 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 192
diff changeset
   134
if [ "$1" = "-x" ]
192
d63a7455cb52 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 164
diff changeset
   135
then
d63a7455cb52 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 164
diff changeset
   136
    shift
1435
9a1f18933e40 Merged code from jv-branch's 'distutils' package
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1432
diff changeset
   137
    STX_EXE=$1
192
d63a7455cb52 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 164
diff changeset
   138
    shift
277
9f56767f07b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 276
diff changeset
   139
fi
9f56767f07b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 276
diff changeset
   140
9f56767f07b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 276
diff changeset
   141
if [ "$1" = "-X" ]
9f56767f07b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 276
diff changeset
   142
then
9f56767f07b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 276
diff changeset
   143
    shift
1435
9a1f18933e40 Merged code from jv-branch's 'distutils' package
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1432
diff changeset
   144
    STX_EXE=$1/stx
277
9f56767f07b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 276
diff changeset
   145
    shift
192
d63a7455cb52 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 164
diff changeset
   146
fi
d63a7455cb52 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 164
diff changeset
   147
482
94e7d89d7844 Flags are --ldd and --gdb
Stefan Vogel <sv@exept.de>
parents: 476
diff changeset
   148
if [ "$1" = "--gdb" ]
439
060918989239 Add option -gdb to debug.
Stefan Vogel <sv@exept.de>
parents: 435
diff changeset
   149
then
060918989239 Add option -gdb to debug.
Stefan Vogel <sv@exept.de>
parents: 435
diff changeset
   150
    shift
1432
1e235b190ee3 Added --callgrind-startup option
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1326
diff changeset
   151
    DEBUGGER="gdb --args"
439
060918989239 Add option -gdb to debug.
Stefan Vogel <sv@exept.de>
parents: 435
diff changeset
   152
fi
060918989239 Add option -gdb to debug.
Stefan Vogel <sv@exept.de>
parents: 435
diff changeset
   153
1512
507674c6d84b UNIX: Added new option `--vdb` to run under Visual / VM Debugger.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1450
diff changeset
   154
if [ "$1" = "--vdb" ]
507674c6d84b UNIX: Added new option `--vdb` to run under Visual / VM Debugger.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1450
diff changeset
   155
then
507674c6d84b UNIX: Added new option `--vdb` to run under Visual / VM Debugger.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1450
diff changeset
   156
    if which "vdb"; then
507674c6d84b UNIX: Added new option `--vdb` to run under Visual / VM Debugger.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1450
diff changeset
   157
        VDB=vdb
507674c6d84b UNIX: Added new option `--vdb` to run under Visual / VM Debugger.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1450
diff changeset
   158
    elif [ -x "$STX_BIN_DIR/../../../jv/vdb/application/vdb" ]; then
507674c6d84b UNIX: Added new option `--vdb` to run under Visual / VM Debugger.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1450
diff changeset
   159
        VDB="$STX_BIN_DIR/../../../jv/vdb/application/vdb"
507674c6d84b UNIX: Added new option `--vdb` to run under Visual / VM Debugger.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1450
diff changeset
   160
    else
507674c6d84b UNIX: Added new option `--vdb` to run under Visual / VM Debugger.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1450
diff changeset
   161
        echo "$0: could not find Visual / VM Debugger (vdb)"
507674c6d84b UNIX: Added new option `--vdb` to run under Visual / VM Debugger.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1450
diff changeset
   162
        exit 1
507674c6d84b UNIX: Added new option `--vdb` to run under Visual / VM Debugger.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1450
diff changeset
   163
    fi
507674c6d84b UNIX: Added new option `--vdb` to run under Visual / VM Debugger.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1450
diff changeset
   164
    shift
507674c6d84b UNIX: Added new option `--vdb` to run under Visual / VM Debugger.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1450
diff changeset
   165
    DEBUGGER="$VDB"
507674c6d84b UNIX: Added new option `--vdb` to run under Visual / VM Debugger.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1450
diff changeset
   166
fi
507674c6d84b UNIX: Added new option `--vdb` to run under Visual / VM Debugger.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1450
diff changeset
   167
1133
c4e732341636 Added --cgdb option to run St/X under CGDB
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 482
diff changeset
   168
if [ "$1" = "--cgdb" ]
c4e732341636 Added --cgdb option to run St/X under CGDB
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 482
diff changeset
   169
then
c4e732341636 Added --cgdb option to run St/X under CGDB
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 482
diff changeset
   170
    shift
1432
1e235b190ee3 Added --callgrind-startup option
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1326
diff changeset
   171
    DEBUGGER="cgdb --args"
1133
c4e732341636 Added --cgdb option to run St/X under CGDB
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 482
diff changeset
   172
fi
c4e732341636 Added --cgdb option to run St/X under CGDB
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 482
diff changeset
   173
1274
d087caa28ae3 Added --callgrind option to run under callgrind profiler
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1133
diff changeset
   174
if [ "$1" = "--callgrind" ]
d087caa28ae3 Added --callgrind option to run under callgrind profiler
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1133
diff changeset
   175
then
d087caa28ae3 Added --callgrind option to run under callgrind profiler
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1133
diff changeset
   176
    shift
d087caa28ae3 Added --callgrind option to run under callgrind profiler
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1133
diff changeset
   177
    DEBUGGER="valgrind --tool=callgrind --instr-atstart=no"
d087caa28ae3 Added --callgrind option to run under callgrind profiler
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1133
diff changeset
   178
fi
d087caa28ae3 Added --callgrind option to run under callgrind profiler
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1133
diff changeset
   179
1432
1e235b190ee3 Added --callgrind-startup option
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1326
diff changeset
   180
if [ "$1" = "--callgrind-startup" ]
1e235b190ee3 Added --callgrind-startup option
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1326
diff changeset
   181
then
1e235b190ee3 Added --callgrind-startup option
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1326
diff changeset
   182
    shift
1e235b190ee3 Added --callgrind-startup option
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1326
diff changeset
   183
    DEBUGGER="valgrind --tool=callgrind"
1e235b190ee3 Added --callgrind-startup option
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1326
diff changeset
   184
fi
1e235b190ee3 Added --callgrind-startup option
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1326
diff changeset
   185
1e235b190ee3 Added --callgrind-startup option
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1326
diff changeset
   186
1326
e6197baf42c8 Initial support for systemtap.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1274
diff changeset
   187
if [ "$1" = "--stap" ]
e6197baf42c8 Initial support for systemtap.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1274
diff changeset
   188
then
e6197baf42c8 Initial support for systemtap.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1274
diff changeset
   189
    shift
1525
0275f69b9d05 UNIX: Set `LD_LIBRARY_PATH` only when running from "install tree"
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1512
diff changeset
   190
    if [ -z "$1" ]; then
1326
e6197baf42c8 Initial support for systemtap.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1274
diff changeset
   191
        echo "--stap requires systemtap script to run"
e6197baf42c8 Initial support for systemtap.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1274
diff changeset
   192
        exit 1
e6197baf42c8 Initial support for systemtap.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1274
diff changeset
   193
    fi
e6197baf42c8 Initial support for systemtap.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1274
diff changeset
   194
    if [ ! -r "$1" ]; then
e6197baf42c8 Initial support for systemtap.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1274
diff changeset
   195
        echo "$1 is not a readable systemtap script"
e6197baf42c8 Initial support for systemtap.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1274
diff changeset
   196
        echo "--stap requires systemtap script to run"
e6197baf42c8 Initial support for systemtap.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1274
diff changeset
   197
        exit 1
e6197baf42c8 Initial support for systemtap.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1274
diff changeset
   198
    fi
e6197baf42c8 Initial support for systemtap.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1274
diff changeset
   199
    STAPSCRIPT=$1
e6197baf42c8 Initial support for systemtap.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1274
diff changeset
   200
    shift
e6197baf42c8 Initial support for systemtap.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1274
diff changeset
   201
fi
1274
d087caa28ae3 Added --callgrind option to run under callgrind profiler
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1133
diff changeset
   202
1133
c4e732341636 Added --cgdb option to run St/X under CGDB
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 482
diff changeset
   203
482
94e7d89d7844 Flags are --ldd and --gdb
Stefan Vogel <sv@exept.de>
parents: 476
diff changeset
   204
if [ "$1" = "--ldd" ]
262
e846b6cafcde *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 247
diff changeset
   205
then
e846b6cafcde *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 247
diff changeset
   206
    shift
341
8e1e10d2f6a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 329
diff changeset
   207
    DEBUGLIB=yes
262
e846b6cafcde *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 247
diff changeset
   208
fi
e846b6cafcde *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 247
diff changeset
   209
192
d63a7455cb52 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 164
diff changeset
   210
#
d63a7455cb52 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 164
diff changeset
   211
#
164
9bf3ac7b759d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 159
diff changeset
   212
# some have Xlibs in /usr/openwin/lib ...
9bf3ac7b759d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 159
diff changeset
   213
#
157
c6a5496ad063 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 155
diff changeset
   214
if [ -d /usr/openwin/lib ]
c6a5496ad063 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 155
diff changeset
   215
then
234
861d75db3bec do not clobber existing LD_LIBRARY_PATH
Claus Gittinger <cg@exept.de>
parents: 193
diff changeset
   216
    if [ "$LD_LIBRARY_PATH" != "" ]
861d75db3bec do not clobber existing LD_LIBRARY_PATH
Claus Gittinger <cg@exept.de>
parents: 193
diff changeset
   217
    then
1326
e6197baf42c8 Initial support for systemtap.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1274
diff changeset
   218
    LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/openwin/lib:/usr/local/lib/smalltalk/lib
234
861d75db3bec do not clobber existing LD_LIBRARY_PATH
Claus Gittinger <cg@exept.de>
parents: 193
diff changeset
   219
    else
1326
e6197baf42c8 Initial support for systemtap.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1274
diff changeset
   220
    LD_LIBRARY_PATH=/usr/openwin/lib:/usr/local/lib/smalltalk/lib
234
861d75db3bec do not clobber existing LD_LIBRARY_PATH
Claus Gittinger <cg@exept.de>
parents: 193
diff changeset
   221
    fi
315
b6c451745fb6 LD_LIB_PATH for HP (sigh)
Claus Gittinger <cg@exept.de>
parents: 314
diff changeset
   222
    if [ "$SHLIB_PATH" != "" ]
b6c451745fb6 LD_LIB_PATH for HP (sigh)
Claus Gittinger <cg@exept.de>
parents: 314
diff changeset
   223
    then
1326
e6197baf42c8 Initial support for systemtap.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1274
diff changeset
   224
    SHLIB_PATH=$SHLIB_PATH:/usr/openwin/lib:/usr/local/lib/smalltalk/lib
315
b6c451745fb6 LD_LIB_PATH for HP (sigh)
Claus Gittinger <cg@exept.de>
parents: 314
diff changeset
   225
    else
1326
e6197baf42c8 Initial support for systemtap.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1274
diff changeset
   226
    SHLIB_PATH=/usr/openwin/lib:/usr/local/lib/smalltalk/lib
315
b6c451745fb6 LD_LIB_PATH for HP (sigh)
Claus Gittinger <cg@exept.de>
parents: 314
diff changeset
   227
    fi
157
c6a5496ad063 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 155
diff changeset
   228
else
234
861d75db3bec do not clobber existing LD_LIBRARY_PATH
Claus Gittinger <cg@exept.de>
parents: 193
diff changeset
   229
    if [ "$LD_LIBRARY_PATH" != "" ]
861d75db3bec do not clobber existing LD_LIBRARY_PATH
Claus Gittinger <cg@exept.de>
parents: 193
diff changeset
   230
    then
1326
e6197baf42c8 Initial support for systemtap.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1274
diff changeset
   231
    LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib/smalltalk/lib
234
861d75db3bec do not clobber existing LD_LIBRARY_PATH
Claus Gittinger <cg@exept.de>
parents: 193
diff changeset
   232
    else
1326
e6197baf42c8 Initial support for systemtap.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1274
diff changeset
   233
    LD_LIBRARY_PATH=/usr/local/lib/smalltalk/lib
234
861d75db3bec do not clobber existing LD_LIBRARY_PATH
Claus Gittinger <cg@exept.de>
parents: 193
diff changeset
   234
    fi
315
b6c451745fb6 LD_LIB_PATH for HP (sigh)
Claus Gittinger <cg@exept.de>
parents: 314
diff changeset
   235
    if [ "$SHLIB_PATH" != "" ]
b6c451745fb6 LD_LIB_PATH for HP (sigh)
Claus Gittinger <cg@exept.de>
parents: 314
diff changeset
   236
    then
1326
e6197baf42c8 Initial support for systemtap.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1274
diff changeset
   237
    SHLIB_PATH=$SHLIB_PATH:/usr/local/lib/smalltalk/lib
315
b6c451745fb6 LD_LIB_PATH for HP (sigh)
Claus Gittinger <cg@exept.de>
parents: 314
diff changeset
   238
    else
1326
e6197baf42c8 Initial support for systemtap.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1274
diff changeset
   239
    SHLIB_PATH=/usr/local/lib/smalltalk/lib
315
b6c451745fb6 LD_LIB_PATH for HP (sigh)
Claus Gittinger <cg@exept.de>
parents: 314
diff changeset
   240
    fi
157
c6a5496ad063 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 155
diff changeset
   241
fi
164
9bf3ac7b759d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 159
diff changeset
   242
9bf3ac7b759d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 159
diff changeset
   243
#
1525
0275f69b9d05 UNIX: Set `LD_LIBRARY_PATH` only when running from "install tree"
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1512
diff changeset
   244
# if started via ./smalltalk, prepend . to the PATH
314
7fbaf542c38c prepend . to the path, if command was executed as ./xxxx
Claus Gittinger <cg@exept.de>
parents: 286
diff changeset
   245
# (to allow test of ./stx even when stx is found along the PATH)
7fbaf542c38c prepend . to the path, if command was executed as ./xxxx
Claus Gittinger <cg@exept.de>
parents: 286
diff changeset
   246
#
7fbaf542c38c prepend . to the path, if command was executed as ./xxxx
Claus Gittinger <cg@exept.de>
parents: 286
diff changeset
   247
case $0 in
7fbaf542c38c prepend . to the path, if command was executed as ./xxxx
Claus Gittinger <cg@exept.de>
parents: 286
diff changeset
   248
    ./*)
1326
e6197baf42c8 Initial support for systemtap.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1274
diff changeset
   249
    PATH=.:$PATH
e6197baf42c8 Initial support for systemtap.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1274
diff changeset
   250
    export PATH
e6197baf42c8 Initial support for systemtap.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1274
diff changeset
   251
    ;;
314
7fbaf542c38c prepend . to the path, if command was executed as ./xxxx
Claus Gittinger <cg@exept.de>
parents: 286
diff changeset
   252
esac
7fbaf542c38c prepend . to the path, if command was executed as ./xxxx
Claus Gittinger <cg@exept.de>
parents: 286
diff changeset
   253
7fbaf542c38c prepend . to the path, if command was executed as ./xxxx
Claus Gittinger <cg@exept.de>
parents: 286
diff changeset
   254
#
280
f267c84f06ac *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 278
diff changeset
   255
# debugging which stx & shared libs are used ...
247
207a28eb1f54 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   256
#
344
102ba332a144 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 343
diff changeset
   257
whichOne=`/bin/sh -c "type $STX"`
1435
9a1f18933e40 Merged code from jv-branch's 'distutils' package
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1432
diff changeset
   258
if [ "$STX_EXE" = "stx" ]
341
8e1e10d2f6a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 329
diff changeset
   259
then
8e1e10d2f6a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 329
diff changeset
   260
  if [ -f stx ]
8e1e10d2f6a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 329
diff changeset
   261
  then
8e1e10d2f6a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 329
diff changeset
   262
    whichOne=`/bin/sh -c "type stx"`
8e1e10d2f6a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 329
diff changeset
   263
    if [ "$whichOne" != "stx is ./stx" ]
8e1e10d2f6a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 329
diff changeset
   264
    then
8e1e10d2f6a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 329
diff changeset
   265
      echo "************* WARNING the executed" $whichOne
8e1e10d2f6a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 329
diff changeset
   266
      echo "************* (may not be appropriate for used shared libs)"
8e1e10d2f6a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 329
diff changeset
   267
      echo "************* Try './smalltalk -ldd' for more details"
8e1e10d2f6a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 329
diff changeset
   268
      echo "************* or force the local stx to be used with"
8e1e10d2f6a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 329
diff changeset
   269
      echo "************* './smalltalk -x ./stx'"
8e1e10d2f6a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 329
diff changeset
   270
      echo
8e1e10d2f6a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 329
diff changeset
   271
    fi
8e1e10d2f6a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 329
diff changeset
   272
  fi
8e1e10d2f6a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 329
diff changeset
   273
fi
8e1e10d2f6a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 329
diff changeset
   274
280
f267c84f06ac *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 278
diff changeset
   275
if [ "$DEBUGLIB" = "yes" ]
277
9f56767f07b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 276
diff changeset
   276
then
344
102ba332a144 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 343
diff changeset
   277
  echo "used " $whichOne
341
8e1e10d2f6a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 329
diff changeset
   278
  echo "used LD_LIBRARY_PATH is " $LD_LIBRARY_PATH
8e1e10d2f6a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 329
diff changeset
   279
  echo "used SHLIB_PATH is " $SHLIB_PATH
8e1e10d2f6a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 329
diff changeset
   280
  echo "used STX_LIBDIR is " $STX_LIBDIR
8e1e10d2f6a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 329
diff changeset
   281
  case `uname` in
8e1e10d2f6a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 329
diff changeset
   282
    HP-UX*)
8e1e10d2f6a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 329
diff changeset
   283
      chatr $STX
8e1e10d2f6a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 329
diff changeset
   284
      ;;
277
9f56767f07b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 276
diff changeset
   285
341
8e1e10d2f6a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 329
diff changeset
   286
    *)
8e1e10d2f6a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 329
diff changeset
   287
      ldd -r $STX
8e1e10d2f6a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 329
diff changeset
   288
      ;;
8e1e10d2f6a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 329
diff changeset
   289
  esac
262
e846b6cafcde *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 247
diff changeset
   290
fi
247
207a28eb1f54 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   291
316
2c70d0958d5a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 315
diff changeset
   292
#
2c70d0958d5a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 315
diff changeset
   293
# how did HP mess up things so badly ?
2c70d0958d5a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 315
diff changeset
   294
# It takes a veeeery long time for stx to start
1525
0275f69b9d05 UNIX: Set `LD_LIBRARY_PATH` only when running from "install tree"
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1512
diff changeset
   295
# (the spinning wheel is shown when stx's main
316
2c70d0958d5a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 315
diff changeset
   296
#  starts to run - all the time in between is
2c70d0958d5a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 315
diff changeset
   297
#  spent in the systems loader ...)
2c70d0958d5a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 315
diff changeset
   298
#
449
a9f1afb0ae1b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 439
diff changeset
   299
# if [ "`uname`" = "HP-UX" ]
a9f1afb0ae1b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 439
diff changeset
   300
# then
a9f1afb0ae1b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 439
diff changeset
   301
#     echo "Please be patient - hp systems are very slow."
a9f1afb0ae1b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 439
diff changeset
   302
# fi
316
2c70d0958d5a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 315
diff changeset
   303
1435
9a1f18933e40 Merged code from jv-branch's 'distutils' package
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1432
diff changeset
   304
PATH=$PATH:$STX_BIN_DIR
269
f7593dfc2706 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   305
export PATH
452
f1fc8e661543 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
   306
# echo PATH is $PATH
f1fc8e661543 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
   307
# echo DISPLAY is $DISPLAY
1326
e6197baf42c8 Initial support for systemtap.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1274
diff changeset
   308
e6197baf42c8 Initial support for systemtap.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1274
diff changeset
   309
e6197baf42c8 Initial support for systemtap.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1274
diff changeset
   310
e6197baf42c8 Initial support for systemtap.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1274
diff changeset
   311
if [ ! -z "$STAPSCRIPT" ]; then
e6197baf42c8 Initial support for systemtap.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1274
diff changeset
   312
    echo "$STX_TOPDIR/stx/hacking/tapset"
1435
9a1f18933e40 Merged code from jv-branch's 'distutils' package
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1432
diff changeset
   313
    CMD="$STX_EXE $@"
1326
e6197baf42c8 Initial support for systemtap.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1274
diff changeset
   314
    echo "$CMD"
e6197baf42c8 Initial support for systemtap.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1274
diff changeset
   315
    exec stap --unprivileged $STAPSCRIPT -I "$STX_TOPDIR/hacking/tapset" -c "$CMD"
e6197baf42c8 Initial support for systemtap.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1274
diff changeset
   316
fi
e6197baf42c8 Initial support for systemtap.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1274
diff changeset
   317
e6197baf42c8 Initial support for systemtap.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1274
diff changeset
   318
e6197baf42c8 Initial support for systemtap.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1274
diff changeset
   319
1435
9a1f18933e40 Merged code from jv-branch's 'distutils' package
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1432
diff changeset
   320
exec $DEBUGGER $STX_EXE ${1+"$@"}