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