smalltalk
author Claus Gittinger <cg@exept.de>
Sat, 09 Feb 2019 16:58:53 +0100
changeset 1588 2727a9f4ac36
parent 1326 e6197baf42c8
child 1432 1e235b190ee3
permissions -rwxr-xr-x
*** empty log message ***
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
151
c003915ba2b9 smalltalk is now a shell script
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     1
#!/bin/sh
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
c003915ba2b9 smalltalk is now a shell script
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    12
# should be set in advance. 
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
#
277
9f56767f07b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 276
diff changeset
    20
# -X name specifies an explicit path to the stx executable 
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
#
9f56767f07b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 276
diff changeset
    29
9f56767f07b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 276
diff changeset
    30
STX=stx
452
f1fc8e661543 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
    31
STX_BINDIR=.
439
060918989239 Add option -gdb to debug.
Stefan Vogel <sv@exept.de>
parents: 435
diff changeset
    32
DEBUGGER=
060918989239 Add option -gdb to debug.
Stefan Vogel <sv@exept.de>
parents: 435
diff changeset
    33
1326
e6197baf42c8 Initial support for systemtap.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1274
diff changeset
    34
452
f1fc8e661543 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
    35
if test -x `dirname $0`/stx; then
f1fc8e661543 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
    36
    STX_BINDIR=`dirname $0`
454
e8676bb3d081 Don't do a cd to projects/smalltalk if called with absolute pathname
Stefan Vogel <sv@exept.de>
parents: 452
diff changeset
    37
    STX=$STX_BINDIR/stx
e8676bb3d081 Don't do a cd to projects/smalltalk if called with absolute pathname
Stefan Vogel <sv@exept.de>
parents: 452
diff changeset
    38
#    cd $STX_BINDIR
452
f1fc8e661543 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
    39
fi
f1fc8e661543 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
    40
476
25c3df1d5c43 ignore invalid STX_LIBDIR setting
Claus Gittinger <cg@exept.de>
parents: 454
diff changeset
    41
if [ "$STX_LIBDIR" != "" ]
25c3df1d5c43 ignore invalid STX_LIBDIR setting
Claus Gittinger <cg@exept.de>
parents: 454
diff changeset
    42
then
25c3df1d5c43 ignore invalid STX_LIBDIR setting
Claus Gittinger <cg@exept.de>
parents: 454
diff changeset
    43
    if [ ! -f $STX_LIBDIR/smalltalk.rc ]
25c3df1d5c43 ignore invalid STX_LIBDIR setting
Claus Gittinger <cg@exept.de>
parents: 454
diff changeset
    44
    then
1326
e6197baf42c8 Initial support for systemtap.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1274
diff changeset
    45
       echo "smalltalk [warning]: ignore wrong STX_LIBDIR setting"
e6197baf42c8 Initial support for systemtap.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1274
diff changeset
    46
       STX_LIBDIR=""
476
25c3df1d5c43 ignore invalid STX_LIBDIR setting
Claus Gittinger <cg@exept.de>
parents: 454
diff changeset
    47
    fi
25c3df1d5c43 ignore invalid STX_LIBDIR setting
Claus Gittinger <cg@exept.de>
parents: 454
diff changeset
    48
fi
25c3df1d5c43 ignore invalid STX_LIBDIR setting
Claus Gittinger <cg@exept.de>
parents: 454
diff changeset
    49
25c3df1d5c43 ignore invalid STX_LIBDIR setting
Claus Gittinger <cg@exept.de>
parents: 454
diff changeset
    50
383
3dfae183631c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 344
diff changeset
    51
# notice: STXLIBDIR is filled in here by install-sh script
319
ad0e533985c9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 316
diff changeset
    52
if test -z "$STX_LIBDIR"
ad0e533985c9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 316
diff changeset
    53
then
1326
e6197baf42c8 Initial support for systemtap.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1274
diff changeset
    54
    bindir=`dirname $0`
e6197baf42c8 Initial support for systemtap.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1274
diff changeset
    55
    case "$bindir" in
e6197baf42c8 Initial support for systemtap.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1274
diff changeset
    56
        /* )
e6197baf42c8 Initial support for systemtap.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1274
diff changeset
    57
        ;;
e6197baf42c8 Initial support for systemtap.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1274
diff changeset
    58
        .* )
e6197baf42c8 Initial support for systemtap.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1274
diff changeset
    59
        bindir=`( cd $bindir; pwd ) 2> /dev/null`
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
    esac
e6197baf42c8 Initial support for systemtap.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1274
diff changeset
    62
    if [ -d ${bindir}/../lib ]
e6197baf42c8 Initial support for systemtap.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1274
diff changeset
    63
    then
e6197baf42c8 Initial support for systemtap.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1274
diff changeset
    64
        STX_LIBDIR=`cd ${bindir}/../lib ; pwd`
e6197baf42c8 Initial support for systemtap.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1274
diff changeset
    65
    fi
319
ad0e533985c9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 316
diff changeset
    66
fi
452
f1fc8e661543 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
    67
476
25c3df1d5c43 ignore invalid STX_LIBDIR setting
Claus Gittinger <cg@exept.de>
parents: 454
diff changeset
    68
if [ -z "$STX_LIBDIR" ]
25c3df1d5c43 ignore invalid STX_LIBDIR setting
Claus Gittinger <cg@exept.de>
parents: 454
diff changeset
    69
then
25c3df1d5c43 ignore invalid STX_LIBDIR setting
Claus Gittinger <cg@exept.de>
parents: 454
diff changeset
    70
    if [ -d ../lib ]
25c3df1d5c43 ignore invalid STX_LIBDIR setting
Claus Gittinger <cg@exept.de>
parents: 454
diff changeset
    71
    then
1326
e6197baf42c8 Initial support for systemtap.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1274
diff changeset
    72
        STX_LIBDIR=`cd ../lib ; pwd`
476
25c3df1d5c43 ignore invalid STX_LIBDIR setting
Claus Gittinger <cg@exept.de>
parents: 454
diff changeset
    73
    fi
25c3df1d5c43 ignore invalid STX_LIBDIR setting
Claus Gittinger <cg@exept.de>
parents: 454
diff changeset
    74
fi
435
3d751dfb900a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 434
diff changeset
    75
if [ ! -d "$STX_LIBDIR" ]
383
3dfae183631c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 344
diff changeset
    76
then
3dfae183631c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 344
diff changeset
    77
    if [ -d ../lib ]
3dfae183631c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 344
diff changeset
    78
    then
1326
e6197baf42c8 Initial support for systemtap.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1274
diff changeset
    79
        STX_LIBDIR=`cd ../lib ; pwd`
383
3dfae183631c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 344
diff changeset
    80
    fi
3dfae183631c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 344
diff changeset
    81
fi
452
f1fc8e661543 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
    82
399
5a842f5d7196 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 398
diff changeset
    83
if test -z "$STX_PACKAGEDIR"
5a842f5d7196 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 398
diff changeset
    84
then
5a842f5d7196 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 398
diff changeset
    85
    if [ -d ../packages ]
5a842f5d7196 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 398
diff changeset
    86
    then
1326
e6197baf42c8 Initial support for systemtap.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1274
diff changeset
    87
        STX_PACKAGEDIR=`cd .. ; pwd`
434
f073cdbe422f oops - LIBDIR/TOPDIR & PACKAGEDIR detection failed,
Claus Gittinger <cg@exept.de>
parents: 401
diff changeset
    88
    else
1326
e6197baf42c8 Initial support for systemtap.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1274
diff changeset
    89
        if [ -d $STX_LIBDIR/../packages ]
e6197baf42c8 Initial support for systemtap.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1274
diff changeset
    90
        then
e6197baf42c8 Initial support for systemtap.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1274
diff changeset
    91
            STX_PACKAGEDIR=`cd $STX_LIBDIR/../packages ; pwd`
e6197baf42c8 Initial support for systemtap.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1274
diff changeset
    92
        else
e6197baf42c8 Initial support for systemtap.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1274
diff changeset
    93
            if [ -f $STX_BINDIR/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_PACKAGEDIR=`cd $STX_BINDIR/../../.. ; pwd`
e6197baf42c8 Initial support for systemtap.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1274
diff changeset
    96
            fi
e6197baf42c8 Initial support for systemtap.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1274
diff changeset
    97
        fi
399
5a842f5d7196 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 398
diff changeset
    98
    fi
5a842f5d7196 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 398
diff changeset
    99
fi
452
f1fc8e661543 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
   100
1326
e6197baf42c8 Initial support for systemtap.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1274
diff changeset
   101
e6197baf42c8 Initial support for systemtap.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1274
diff changeset
   102
401
64a83b800ff7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 399
diff changeset
   103
if test -z "$STX_TOPDIR"
64a83b800ff7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 399
diff changeset
   104
then
64a83b800ff7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 399
diff changeset
   105
    if [ -f ../lib/smalltalk.rc ]
64a83b800ff7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 399
diff changeset
   106
    then
1326
e6197baf42c8 Initial support for systemtap.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1274
diff changeset
   107
        STX_TOPDIR=`cd .. ; pwd`
434
f073cdbe422f oops - LIBDIR/TOPDIR & PACKAGEDIR detection failed,
Claus Gittinger <cg@exept.de>
parents: 401
diff changeset
   108
    else
1326
e6197baf42c8 Initial support for systemtap.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1274
diff changeset
   109
       if [ -f $STX_LIBDIR/../lib/smalltalk.rc ]
e6197baf42c8 Initial support for systemtap.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1274
diff changeset
   110
       then
e6197baf42c8 Initial support for systemtap.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1274
diff changeset
   111
           STX_TOPDIR=`cd $STX_LIBDIR/.. ; pwd`
e6197baf42c8 Initial support for systemtap.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1274
diff changeset
   112
       else
e6197baf42c8 Initial support for systemtap.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1274
diff changeset
   113
           if [ -f $STX_BINDIR/smalltalk.rc ]
e6197baf42c8 Initial support for systemtap.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1274
diff changeset
   114
           then
e6197baf42c8 Initial support for systemtap.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1274
diff changeset
   115
              STX_TOPDIR=`cd $STX_BINDIR/../.. ; pwd`
e6197baf42c8 Initial support for systemtap.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1274
diff changeset
   116
           fi
e6197baf42c8 Initial support for systemtap.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1274
diff changeset
   117
       fi
401
64a83b800ff7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 399
diff changeset
   118
    fi
64a83b800ff7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 399
diff changeset
   119
fi
383
3dfae183631c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 344
diff changeset
   120
434
f073cdbe422f oops - LIBDIR/TOPDIR & PACKAGEDIR detection failed,
Claus Gittinger <cg@exept.de>
parents: 401
diff changeset
   121
# echo STX_LIBDIR is $STX_LIBDIR
f073cdbe422f oops - LIBDIR/TOPDIR & PACKAGEDIR detection failed,
Claus Gittinger <cg@exept.de>
parents: 401
diff changeset
   122
# echo STX_TOPDIR is $STX_TOPDIR
f073cdbe422f oops - LIBDIR/TOPDIR & PACKAGEDIR detection failed,
Claus Gittinger <cg@exept.de>
parents: 401
diff changeset
   123
# echo STX_PACKAGEDIR is $STX_PACKAGEDIR
f073cdbe422f oops - LIBDIR/TOPDIR & PACKAGEDIR detection failed,
Claus Gittinger <cg@exept.de>
parents: 401
diff changeset
   124
401
64a83b800ff7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 399
diff changeset
   125
export STX_LIBDIR STX_PACKAGEDIR STX_TOPDIR
452
f1fc8e661543 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
   126
f1fc8e661543 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
   127
# echo STX is $STX
277
9f56767f07b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 276
diff changeset
   128
1326
e6197baf42c8 Initial support for systemtap.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1274
diff changeset
   129
e6197baf42c8 Initial support for systemtap.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1274
diff changeset
   130
if [ "$1" = "--help" ]
e6197baf42c8 Initial support for systemtap.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1274
diff changeset
   131
then    
e6197baf42c8 Initial support for systemtap.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1274
diff changeset
   132
    echo "
e6197baf42c8 Initial support for systemtap.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1274
diff changeset
   133
usage: smalltalk [-x prog] [-X dir] [--ldd] [--gdb] 
e6197baf42c8 Initial support for systemtap.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1274
diff changeset
   134
e6197baf42c8 Initial support for systemtap.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1274
diff changeset
   135
args to startup script:
e6197baf42c8 Initial support for systemtap.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1274
diff changeset
   136
   -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
   137
   -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
   138
   --ldd .................. show which shared libraries are used
e6197baf42c8 Initial support for systemtap.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1274
diff changeset
   139
   --gdb .................. run with gdb-Debugger (type r in debugger to start)
e6197baf42c8 Initial support for systemtap.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1274
diff changeset
   140
   --cgdb ................. run with cgdb-Debugger (type r in debugger to start)
e6197baf42c8 Initial support for systemtap.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1274
diff changeset
   141
   --callgrind ............ run under callgrind profiler tool
e6197baf42c8 Initial support for systemtap.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1274
diff changeset
   142
   --stap SCRIPT .......... run given systemtap script, passing stx command as 
e6197baf42c8 Initial support for systemtap.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1274
diff changeset
   143
                            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
   144
"
e6197baf42c8 Initial support for systemtap.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1274
diff changeset
   145
    exec $STX --help
e6197baf42c8 Initial support for systemtap.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1274
diff changeset
   146
    exit 0
e6197baf42c8 Initial support for systemtap.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1274
diff changeset
   147
fi
e6197baf42c8 Initial support for systemtap.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1274
diff changeset
   148
193
e38e9ee3b219 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 192
diff changeset
   149
if [ "$1" = "-x" ]
192
d63a7455cb52 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 164
diff changeset
   150
then
d63a7455cb52 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 164
diff changeset
   151
    shift
d63a7455cb52 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 164
diff changeset
   152
    STX=$1
d63a7455cb52 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 164
diff changeset
   153
    shift
277
9f56767f07b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 276
diff changeset
   154
fi
9f56767f07b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 276
diff changeset
   155
9f56767f07b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 276
diff changeset
   156
if [ "$1" = "-X" ]
9f56767f07b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 276
diff changeset
   157
then
9f56767f07b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 276
diff changeset
   158
    shift
9f56767f07b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 276
diff changeset
   159
    STX=$1/stx
9f56767f07b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 276
diff changeset
   160
    shift
192
d63a7455cb52 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 164
diff changeset
   161
fi
d63a7455cb52 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 164
diff changeset
   162
482
94e7d89d7844 Flags are --ldd and --gdb
Stefan Vogel <sv@exept.de>
parents: 476
diff changeset
   163
if [ "$1" = "--gdb" ]
439
060918989239 Add option -gdb to debug.
Stefan Vogel <sv@exept.de>
parents: 435
diff changeset
   164
then
060918989239 Add option -gdb to debug.
Stefan Vogel <sv@exept.de>
parents: 435
diff changeset
   165
    shift
060918989239 Add option -gdb to debug.
Stefan Vogel <sv@exept.de>
parents: 435
diff changeset
   166
    DEBUGGER=gdb
060918989239 Add option -gdb to debug.
Stefan Vogel <sv@exept.de>
parents: 435
diff changeset
   167
fi
060918989239 Add option -gdb to debug.
Stefan Vogel <sv@exept.de>
parents: 435
diff changeset
   168
1133
c4e732341636 Added --cgdb option to run St/X under CGDB
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 482
diff changeset
   169
if [ "$1" = "--cgdb" ]
c4e732341636 Added --cgdb option to run St/X under CGDB
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 482
diff changeset
   170
then
c4e732341636 Added --cgdb option to run St/X under CGDB
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 482
diff changeset
   171
    shift
c4e732341636 Added --cgdb option to run St/X under CGDB
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 482
diff changeset
   172
    DEBUGGER=cgdb
c4e732341636 Added --cgdb option to run St/X under CGDB
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 482
diff changeset
   173
fi
c4e732341636 Added --cgdb option to run St/X under CGDB
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 482
diff changeset
   174
1274
d087caa28ae3 Added --callgrind option to run under callgrind profiler
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1133
diff changeset
   175
if [ "$1" = "--callgrind" ]
d087caa28ae3 Added --callgrind option to run under callgrind profiler
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1133
diff changeset
   176
then
d087caa28ae3 Added --callgrind option to run under callgrind profiler
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1133
diff changeset
   177
    shift
d087caa28ae3 Added --callgrind option to run under callgrind profiler
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1133
diff changeset
   178
    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
   179
fi
d087caa28ae3 Added --callgrind option to run under callgrind profiler
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1133
diff changeset
   180
1326
e6197baf42c8 Initial support for systemtap.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1274
diff changeset
   181
if [ "$1" = "--stap" ]
e6197baf42c8 Initial support for systemtap.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1274
diff changeset
   182
then
e6197baf42c8 Initial support for systemtap.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1274
diff changeset
   183
    shift
e6197baf42c8 Initial support for systemtap.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1274
diff changeset
   184
    if [ -z "$1" ]; then 
e6197baf42c8 Initial support for systemtap.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1274
diff changeset
   185
        echo "--stap requires systemtap script to run"
e6197baf42c8 Initial support for systemtap.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1274
diff changeset
   186
        exit 1
e6197baf42c8 Initial support for systemtap.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1274
diff changeset
   187
    fi
e6197baf42c8 Initial support for systemtap.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1274
diff changeset
   188
    if [ ! -r "$1" ]; then
e6197baf42c8 Initial support for systemtap.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1274
diff changeset
   189
        echo "$1 is not a readable systemtap script"
e6197baf42c8 Initial support for systemtap.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1274
diff changeset
   190
        echo "--stap requires systemtap script to run"
e6197baf42c8 Initial support for systemtap.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1274
diff changeset
   191
        exit 1
e6197baf42c8 Initial support for systemtap.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1274
diff changeset
   192
    fi
e6197baf42c8 Initial support for systemtap.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1274
diff changeset
   193
    STAPSCRIPT=$1
e6197baf42c8 Initial support for systemtap.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1274
diff changeset
   194
    shift
e6197baf42c8 Initial support for systemtap.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1274
diff changeset
   195
fi
1274
d087caa28ae3 Added --callgrind option to run under callgrind profiler
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1133
diff changeset
   196
1133
c4e732341636 Added --cgdb option to run St/X under CGDB
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 482
diff changeset
   197
482
94e7d89d7844 Flags are --ldd and --gdb
Stefan Vogel <sv@exept.de>
parents: 476
diff changeset
   198
if [ "$1" = "--ldd" ]
262
e846b6cafcde *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 247
diff changeset
   199
then
e846b6cafcde *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 247
diff changeset
   200
    shift
341
8e1e10d2f6a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 329
diff changeset
   201
    DEBUGLIB=yes
262
e846b6cafcde *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 247
diff changeset
   202
fi
e846b6cafcde *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 247
diff changeset
   203
192
d63a7455cb52 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 164
diff changeset
   204
#
d63a7455cb52 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 164
diff changeset
   205
#
164
9bf3ac7b759d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 159
diff changeset
   206
# some have Xlibs in /usr/openwin/lib ...
9bf3ac7b759d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 159
diff changeset
   207
#
157
c6a5496ad063 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 155
diff changeset
   208
if [ -d /usr/openwin/lib ]
c6a5496ad063 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 155
diff changeset
   209
then
234
861d75db3bec do not clobber existing LD_LIBRARY_PATH
Claus Gittinger <cg@exept.de>
parents: 193
diff changeset
   210
    if [ "$LD_LIBRARY_PATH" != "" ]
861d75db3bec do not clobber existing LD_LIBRARY_PATH
Claus Gittinger <cg@exept.de>
parents: 193
diff changeset
   211
    then
1326
e6197baf42c8 Initial support for systemtap.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1274
diff changeset
   212
    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
   213
    else
1326
e6197baf42c8 Initial support for systemtap.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1274
diff changeset
   214
    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
   215
    fi
315
b6c451745fb6 LD_LIB_PATH for HP (sigh)
Claus Gittinger <cg@exept.de>
parents: 314
diff changeset
   216
    if [ "$SHLIB_PATH" != "" ]
b6c451745fb6 LD_LIB_PATH for HP (sigh)
Claus Gittinger <cg@exept.de>
parents: 314
diff changeset
   217
    then
1326
e6197baf42c8 Initial support for systemtap.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1274
diff changeset
   218
    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
   219
    else
1326
e6197baf42c8 Initial support for systemtap.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1274
diff changeset
   220
    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
   221
    fi
157
c6a5496ad063 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 155
diff changeset
   222
else
234
861d75db3bec do not clobber existing LD_LIBRARY_PATH
Claus Gittinger <cg@exept.de>
parents: 193
diff changeset
   223
    if [ "$LD_LIBRARY_PATH" != "" ]
861d75db3bec do not clobber existing LD_LIBRARY_PATH
Claus Gittinger <cg@exept.de>
parents: 193
diff changeset
   224
    then
1326
e6197baf42c8 Initial support for systemtap.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1274
diff changeset
   225
    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
   226
    else
1326
e6197baf42c8 Initial support for systemtap.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1274
diff changeset
   227
    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
   228
    fi
315
b6c451745fb6 LD_LIB_PATH for HP (sigh)
Claus Gittinger <cg@exept.de>
parents: 314
diff changeset
   229
    if [ "$SHLIB_PATH" != "" ]
b6c451745fb6 LD_LIB_PATH for HP (sigh)
Claus Gittinger <cg@exept.de>
parents: 314
diff changeset
   230
    then
1326
e6197baf42c8 Initial support for systemtap.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1274
diff changeset
   231
    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
   232
    else
1326
e6197baf42c8 Initial support for systemtap.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1274
diff changeset
   233
    SHLIB_PATH=/usr/local/lib/smalltalk/lib
315
b6c451745fb6 LD_LIB_PATH for HP (sigh)
Claus Gittinger <cg@exept.de>
parents: 314
diff changeset
   234
    fi
157
c6a5496ad063 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 155
diff changeset
   235
fi
164
9bf3ac7b759d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 159
diff changeset
   236
9bf3ac7b759d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 159
diff changeset
   237
#
9bf3ac7b759d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 159
diff changeset
   238
# my own libs may be found in STX_LIBDIR/lib
247
207a28eb1f54 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   239
# STX_LIBDIR is to be set to the top of the smalltalk installation
207a28eb1f54 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   240
# (i.e. where all the .rc files are located)
164
9bf3ac7b759d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 159
diff changeset
   241
#
242
f6879378b04d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 234
diff changeset
   242
164
9bf3ac7b759d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 159
diff changeset
   243
if [ "$STX_LIBDIR" != "" ]
9bf3ac7b759d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 159
diff changeset
   244
then
243
fd831eff53e0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 242
diff changeset
   245
    if [ "$STX_LIBDIR" != "/usr/local/smalltalk" ]
fd831eff53e0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 242
diff changeset
   246
    then
1326
e6197baf42c8 Initial support for systemtap.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1274
diff changeset
   247
    LD_LIBRARY_PATH=$STX_LIBDIR:$STX_LIBDIR/lib:$LD_LIBRARY_PATH
e6197baf42c8 Initial support for systemtap.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1274
diff changeset
   248
    SHLIB_PATH=$STX_LIBDIR:$STX_LIBDIR/lib:$SHLIB_PATH
243
fd831eff53e0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 242
diff changeset
   249
    fi
452
f1fc8e661543 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
   250
else
f1fc8e661543 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
   251
    STX_LIBDIR=$STX_BINDIR
f1fc8e661543 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
   252
fi
f1fc8e661543 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
   253
f1fc8e661543 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
   254
#
f1fc8e661543 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
   255
# and in STX_BINDIR
f1fc8e661543 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
   256
#
f1fc8e661543 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
   257
f1fc8e661543 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
   258
if [ "$STX_BINDIR" != "" ]
f1fc8e661543 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
   259
then
f1fc8e661543 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
   260
    if [ "$STX_BINDIR" != "/usr/local/bin" ]
f1fc8e661543 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
   261
    then
1326
e6197baf42c8 Initial support for systemtap.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1274
diff changeset
   262
    LD_LIBRARY_PATH=$STX_BINDIR:$LD_LIBRARY_PATH
e6197baf42c8 Initial support for systemtap.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1274
diff changeset
   263
    SHLIB_PATH=$STX_BINDIR:$SHLIB_PATH
452
f1fc8e661543 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
   264
    fi
164
9bf3ac7b759d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 159
diff changeset
   265
fi
9bf3ac7b759d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 159
diff changeset
   266
276
e8b19dc2d388 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 274
diff changeset
   267
LD_LIBRARY_PATH=.:./lib:$LD_LIBRARY_PATH
315
b6c451745fb6 LD_LIB_PATH for HP (sigh)
Claus Gittinger <cg@exept.de>
parents: 314
diff changeset
   268
SHLIB_PATH=.:./lib:$SHLIB_PATH
155
c42953f0172d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 151
diff changeset
   269
export LD_LIBRARY_PATH
315
b6c451745fb6 LD_LIB_PATH for HP (sigh)
Claus Gittinger <cg@exept.de>
parents: 314
diff changeset
   270
export SHLIB_PATH
247
207a28eb1f54 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   271
207a28eb1f54 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   272
#
314
7fbaf542c38c prepend . to the path, if command was executed as ./xxxx
Claus Gittinger <cg@exept.de>
parents: 286
diff changeset
   273
# if started via ./smalltalk, prepend . to the PATH 
7fbaf542c38c prepend . to the path, if command was executed as ./xxxx
Claus Gittinger <cg@exept.de>
parents: 286
diff changeset
   274
# (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
   275
#
7fbaf542c38c prepend . to the path, if command was executed as ./xxxx
Claus Gittinger <cg@exept.de>
parents: 286
diff changeset
   276
case $0 in
7fbaf542c38c prepend . to the path, if command was executed as ./xxxx
Claus Gittinger <cg@exept.de>
parents: 286
diff changeset
   277
    ./*)
1326
e6197baf42c8 Initial support for systemtap.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1274
diff changeset
   278
    PATH=.:$PATH
e6197baf42c8 Initial support for systemtap.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1274
diff changeset
   279
    export PATH
e6197baf42c8 Initial support for systemtap.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1274
diff changeset
   280
    ;;
314
7fbaf542c38c prepend . to the path, if command was executed as ./xxxx
Claus Gittinger <cg@exept.de>
parents: 286
diff changeset
   281
esac
7fbaf542c38c prepend . to the path, if command was executed as ./xxxx
Claus Gittinger <cg@exept.de>
parents: 286
diff changeset
   282
7fbaf542c38c prepend . to the path, if command was executed as ./xxxx
Claus Gittinger <cg@exept.de>
parents: 286
diff changeset
   283
#
280
f267c84f06ac *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 278
diff changeset
   284
# debugging which stx & shared libs are used ...
247
207a28eb1f54 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   285
#
344
102ba332a144 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 343
diff changeset
   286
whichOne=`/bin/sh -c "type $STX"`
341
8e1e10d2f6a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 329
diff changeset
   287
if [ "$STX" = "stx" ]
8e1e10d2f6a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 329
diff changeset
   288
then
8e1e10d2f6a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 329
diff changeset
   289
  if [ -f stx ]
8e1e10d2f6a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 329
diff changeset
   290
  then
8e1e10d2f6a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 329
diff changeset
   291
    whichOne=`/bin/sh -c "type stx"`
8e1e10d2f6a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 329
diff changeset
   292
    if [ "$whichOne" != "stx is ./stx" ]
8e1e10d2f6a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 329
diff changeset
   293
    then
8e1e10d2f6a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 329
diff changeset
   294
      echo "************* WARNING the executed" $whichOne
8e1e10d2f6a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 329
diff changeset
   295
      echo "************* (may not be appropriate for used shared libs)"
8e1e10d2f6a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 329
diff changeset
   296
      echo "************* Try './smalltalk -ldd' for more details"
8e1e10d2f6a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 329
diff changeset
   297
      echo "************* or force the local stx to be used with"
8e1e10d2f6a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 329
diff changeset
   298
      echo "************* './smalltalk -x ./stx'"
8e1e10d2f6a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 329
diff changeset
   299
      echo
8e1e10d2f6a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 329
diff changeset
   300
    fi
8e1e10d2f6a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 329
diff changeset
   301
  fi
8e1e10d2f6a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 329
diff changeset
   302
fi
8e1e10d2f6a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 329
diff changeset
   303
280
f267c84f06ac *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 278
diff changeset
   304
if [ "$DEBUGLIB" = "yes" ]
277
9f56767f07b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 276
diff changeset
   305
then
344
102ba332a144 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 343
diff changeset
   306
  echo "used " $whichOne
341
8e1e10d2f6a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 329
diff changeset
   307
  echo "used LD_LIBRARY_PATH is " $LD_LIBRARY_PATH
8e1e10d2f6a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 329
diff changeset
   308
  echo "used SHLIB_PATH is " $SHLIB_PATH
8e1e10d2f6a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 329
diff changeset
   309
  echo "used STX_LIBDIR is " $STX_LIBDIR
8e1e10d2f6a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 329
diff changeset
   310
  case `uname` in
8e1e10d2f6a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 329
diff changeset
   311
    HP-UX*)
8e1e10d2f6a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 329
diff changeset
   312
      chatr $STX
8e1e10d2f6a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 329
diff changeset
   313
      ;;
277
9f56767f07b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 276
diff changeset
   314
341
8e1e10d2f6a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 329
diff changeset
   315
    *)
8e1e10d2f6a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 329
diff changeset
   316
      ldd -r $STX
8e1e10d2f6a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 329
diff changeset
   317
      ;;
8e1e10d2f6a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 329
diff changeset
   318
  esac
262
e846b6cafcde *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 247
diff changeset
   319
fi
247
207a28eb1f54 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   320
316
2c70d0958d5a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 315
diff changeset
   321
#
2c70d0958d5a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 315
diff changeset
   322
# how did HP mess up things so badly ?
2c70d0958d5a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 315
diff changeset
   323
# It takes a veeeery long time for stx to start
2c70d0958d5a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 315
diff changeset
   324
# (the spinning wheel is shown when stx's main 
2c70d0958d5a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 315
diff changeset
   325
#  starts to run - all the time in between is
2c70d0958d5a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 315
diff changeset
   326
#  spent in the systems loader ...)
2c70d0958d5a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 315
diff changeset
   327
#
449
a9f1afb0ae1b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 439
diff changeset
   328
# if [ "`uname`" = "HP-UX" ]
a9f1afb0ae1b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 439
diff changeset
   329
# then
a9f1afb0ae1b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 439
diff changeset
   330
#     echo "Please be patient - hp systems are very slow."
a9f1afb0ae1b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 439
diff changeset
   331
# fi
316
2c70d0958d5a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 315
diff changeset
   332
452
f1fc8e661543 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
   333
PATH=$PATH:$STX_BINDIR
269
f7593dfc2706 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   334
export PATH
452
f1fc8e661543 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
   335
# echo PATH is $PATH
f1fc8e661543 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
   336
# echo DISPLAY is $DISPLAY
1326
e6197baf42c8 Initial support for systemtap.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1274
diff changeset
   337
e6197baf42c8 Initial support for systemtap.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1274
diff changeset
   338
e6197baf42c8 Initial support for systemtap.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1274
diff changeset
   339
e6197baf42c8 Initial support for systemtap.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1274
diff changeset
   340
if [ ! -z "$STAPSCRIPT" ]; then
e6197baf42c8 Initial support for systemtap.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1274
diff changeset
   341
    echo "$STX_TOPDIR/stx/hacking/tapset"
e6197baf42c8 Initial support for systemtap.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1274
diff changeset
   342
    CMD="$STX $@"
e6197baf42c8 Initial support for systemtap.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1274
diff changeset
   343
    echo "$CMD"
e6197baf42c8 Initial support for systemtap.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1274
diff changeset
   344
    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
   345
fi
e6197baf42c8 Initial support for systemtap.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1274
diff changeset
   346
e6197baf42c8 Initial support for systemtap.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1274
diff changeset
   347
e6197baf42c8 Initial support for systemtap.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1274
diff changeset
   348
439
060918989239 Add option -gdb to debug.
Stefan Vogel <sv@exept.de>
parents: 435
diff changeset
   349
exec $DEBUGGER $STX ${1+"$@"}