| 1 | #!/bin/sh
|
|---|
| 2 |
|
|---|
| 3 | # The MPE POSIX libc archive library contains rand(), but this function has
|
|---|
| 4 | # been omitted from the libc shared library on the mistaken assumption that
|
|---|
| 5 | # the rand() function in the kernel library /SYS/PUB/XL could be used instead.
|
|---|
| 6 | # However, rand() in /SYS/PUB/XL is a Fortran function with different semantics
|
|---|
| 7 | # from the C version that we expect.
|
|---|
| 8 |
|
|---|
| 9 | # So in order to get the correct rand() function and to make it available to
|
|---|
| 10 | # the dynamically loaded perl extensions, we will build our own mini rand()
|
|---|
| 11 | # shared library and add this to the perl NMPRG's XL list.
|
|---|
| 12 |
|
|---|
| 13 | RAND=/$HPACCOUNT/$HPGROUP/libcrand
|
|---|
| 14 |
|
|---|
| 15 | echo "Creating $RAND.sl...\n"
|
|---|
| 16 |
|
|---|
| 17 | TEMP=perlmpe.$$
|
|---|
| 18 |
|
|---|
| 19 | rm -f $TEMP $RAND.a $RAND.sl
|
|---|
| 20 |
|
|---|
| 21 | /bin/cat - >$TEMP <<EOF
|
|---|
| 22 | buildrl $RAND.a
|
|---|
| 23 | copyrl from=/lib/libc.a;to=$RAND.a;module=rand
|
|---|
| 24 | revealrl rl=$RAND.a;all
|
|---|
| 25 | buildxl $RAND.sl;limit=1
|
|---|
| 26 | addxl from=$RAND.a;to=$RAND.sl;share
|
|---|
| 27 | listxl xl=$RAND.sl
|
|---|
| 28 | EOF
|
|---|
| 29 |
|
|---|
| 30 | callci "xeq LINKEDIT.PUB.SYS <$TEMP"
|
|---|
| 31 |
|
|---|
| 32 | rm -f $TEMP $RAND.a
|
|---|
| 33 |
|
|---|
| 34 | # MPE/iX as of 5.5 does not yet properly support linking against dynamic
|
|---|
| 35 | # libraries via gcc or ld. For now, re-run gcc without the external library
|
|---|
| 36 | # list, and then run the native linker with the list of dynamic libraries.
|
|---|
| 37 |
|
|---|
| 38 | echo "Creating the perl executable NMPRG..."
|
|---|
| 39 |
|
|---|
| 40 | gcc -o perl perlmain.o \
|
|---|
| 41 | lib/auto/DynaLoader/DynaLoader.a \
|
|---|
| 42 | libperl.a \
|
|---|
| 43 | `cat ext.libs` \
|
|---|
| 44 | -L/BINDFW/CURRENT/lib -lbind \
|
|---|
| 45 | -L/SYSLOG/PUB -lsyslog
|
|---|
| 46 |
|
|---|
| 47 | echo "Modifying the perl executable NMPRG XL list...\n"
|
|---|
| 48 |
|
|---|
| 49 | callci "xeq LINKEDIT.PUB.SYS 'altprog ./perl;xl=/usr/lib/libcurses.sl,/lib/libsvipc.sl,/usr/lib/libsocket.sl,/usr/lib/libstr.sl,/lib/libm.sl,$RAND.sl,/lib/libc.sl'"
|
|---|