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 13RAND=/$HPACCOUNT/$HPGROUP/libcrand 14 15echo "Creating $RAND.sl...\n" 16 17TEMP=perlmpe.$$ 18 19rm -f $TEMP $RAND.a $RAND.sl 20 21/bin/cat - >$TEMP <<EOF 22buildrl $RAND.a 23copyrl from=/lib/libc.a;to=$RAND.a;module=rand 24revealrl rl=$RAND.a;all 25buildxl $RAND.sl;limit=1 26addxl from=$RAND.a;to=$RAND.sl;share 27listxl xl=$RAND.sl 28EOF 29 30callci "xeq LINKEDIT.PUB.SYS <$TEMP" 31 32rm -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 38echo "Creating the perl executable NMPRG..." 39 40gcc -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 47echo "Modifying the perl executable NMPRG XL list...\n" 48 49callci "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'" 50