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.
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.
13 RAND=/$HPACCOUNT/$HPGROUP/libcrand
15 echo "Creating $RAND.sl...\n"
19 rm -f $TEMP $RAND.a $RAND.sl
21 /bin/cat - >$TEMP <<EOF
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
30 callci "xeq LINKEDIT.PUB.SYS <$TEMP"
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.
38 echo "Creating the perl executable NMPRG..."
40 gcc -o perl perlmain.o \
41 lib/auto/DynaLoader/DynaLoader.a \
44 -L/BINDFW/CURRENT/lib -lbind \
45 -L/SYSLOG/PUB -lsyslog
47 echo "Modifying the perl executable NMPRG XL list...\n"
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'"