1# vim: syntax=pod 2 3If you read this file _as_is_, just ignore the funny characters you see. 4It is written in the POD format (see pod/perlpod.pod) which is specially 5designed to be readable as is. 6 7=head1 NAME 8 9perlqnx - Perl version 5 on QNX 10 11=head1 DESCRIPTION 12 13As of perl5.7.2 all tests pass under: 14 15 QNX 4.24G 16 Watcom 10.6 with Beta/970211.wcc.update.tar.F 17 socket3r.lib Nov21 1996. 18 19As of perl5.8.1 there is at least one test still failing. 20 21Some tests may complain under known circumstances. 22 23See below and hints/qnx.sh for more information. 24 25Under QNX 6.2.0 there are still a few tests which fail. 26See below and hints/qnx.sh for more information. 27 28=head2 Required Software for Compiling Perl on QNX4 29 30As with many unix ports, this one depends on a few "standard" 31unix utilities which are not necessarily standard for QNX4. 32 33=over 4 34 35=item /bin/sh 36 37This is used heavily by Configure and then by 38perl itself. QNX4's version is fine, but Configure 39will choke on the 16-bit version, so if you are 40running QNX 4.22, link /bin/sh to /bin32/ksh 41 42=item ar 43 44This is the standard unix library builder. 45We use wlib. With Watcom 10.6, when wlib is 46linked as "ar", it behaves like ar and all is 47fine. Under 9.5, a cover is required. One is 48included in ../qnx 49 50=item nm 51 52This is used (optionally) by configure to list 53the contents of libraries. I will generate 54a cover function on the fly in the UU directory. 55 56=item cpp 57 58Configure and perl need a way to invoke a C 59preprocessor. I have created a simple cover 60for cc which does the right thing. Without this, 61Configure will create its own wrapper which works, 62but it doesn't handle some of the command line arguments 63that perl will throw at it. 64 65=item make 66 67You really need GNU make to compile this. GNU make 68ships by default with QNX 4.23, but you can get it 69from quics for earlier versions. 70 71=back 72 73=head2 Outstanding Issues with Perl on QNX4 74 75There is no support for dynamically linked libraries in QNX4. 76 77If you wish to compile with the Socket extension, you need 78to have the TCP/IP toolkit, and you need to make sure that 79-lsocket locates the correct copy of socket3r.lib. Beware 80that the Watcom compiler ships with a stub version of 81socket3r.lib which has very little functionality. Also 82beware the order in which wlink searches directories for 83libraries. You may have /usr/lib/socket3r.lib pointing to 84the correct library, but wlink may pick up 85/usr/watcom/10.6/usr/lib/socket3r.lib instead. Make sure 86they both point to the correct library, that is, 87/usr/tcptk/current/usr/lib/socket3r.lib. 88 89The following tests may report errors under QNX4: 90 91dist/Cwd/Cwd.t will complain if `pwd` and cwd don't give 92the same results. cwd calls `fullpath -t`, so if you 93cd `fullpath -t` before running the test, it will 94pass. 95 96lib/File/Find/taint.t will complain if '.' is in your 97PATH. The PATH test is triggered because cwd calls 98`fullpath -t`. 99 100ext/IO/lib/IO/t/io_sock.t: Subtests 14 and 22 are skipped due to 101the fact that the functionality to read back the non-blocking 102status of a socket is not implemented in QNX's TCP/IP. This has 103been reported to QNX and it may work with later versions of 104TCP/IP. 105 106t/io/tell.t: Subtest 27 is failing. We are still investigating. 107 108=head2 QNX auxiliary files 109 110The files in the "qnx" directory are: 111 112=over 4 113 114=item qnx/ar 115 116A script that emulates the standard unix archive (aka library) 117utility. Under Watcom 10.6, ar is linked to wlib and provides the 118expected interface. With Watcom 9.5, a cover function is 119required. This one is fairly crude but has proved adequate for 120compiling perl. 121 122=item qnx/cpp 123 124A script that provides C preprocessing functionality. Configure can 125generate a similar cover, but it doesn't handle all the command-line 126options that perl throws at it. This might be reasonably placed in 127/usr/local/bin. 128 129=back 130 131=head2 Outstanding issues with perl under QNX6 132 133The following tests are still failing for Perl 5.8.1 under QNX 6.2.0: 134 135 op/sprintf.........................FAILED at test 91 136 lib/Benchmark......................FAILED at test 26 137 138This is due to a bug in the C library's printf routine. 139printf("'%e'", 0. ) produces '0.000000e+0', but ANSI requires 140'0.000000e+00'. QNX has acknowledged the bug. 141 142=head2 Cross-compilation 143 144Perl supports cross-compiling to QNX NTO through the 145Native Development Kit (NDK) for the Blackberry 10. This means that you 146can cross-compile for both ARM and x86 versions of the platform. 147 148=head3 Setting up a cross-compilation environment 149 150You can download the NDK from 151L<http://developer.blackberry.com/native/downloads/>. 152 153See 154L<http://developer.blackberry.com/native/documentation/cascades/getting_started/setting_up.html> 155for instructions to set up your device prior to attempting anything else. 156 157Once you've installed the NDK and set up your device, all that's 158left to do is setting up the device and the cross-compilation 159environment. Blackberry provides a script, C<bbndk-env.sh> (occasionally 160named something like C<bbndk-env_10_1_0_4828.sh>) which can be used 161to do this. However, there's a bit of a snag that we have to work through: 162The script modifies PATH so that 'gcc' or 'ar' point to their 163cross-compilation equivalents, which screws over the build process. 164 165So instead you'll want to do something like this: 166 167 $ orig_path=$PATH 168 $ source $location_of_bbndk/bbndk-env*.sh 169 $ export PATH="$orig_path:$PATH" 170 171Besides putting the cross-compiler and the rest of the toolchain in your 172PATH, this will also provide the QNX_TARGET variable, which 173we will pass to Configure through -Dsysroot. 174 175=head3 Preparing the target system 176 177It's quite possible that the target system doesn't have a readily 178available /tmp, so it's generally safer to do something like this: 179 180 $ ssh $TARGETUSER@$TARGETHOST 'rm -rf perl; mkdir perl; mkdir perl/tmp' 181 $ export TARGETDIR=`ssh $TARGETUSER@$TARGETHOST pwd`/perl 182 $ export TARGETENV="export TMPDIR=$TARGETDIR/tmp; " 183 184Later on, we'll pass this to Configure through -Dtargetenv 185 186=head3 Calling Configure 187 188If you are targetting an ARM device -- which currently includes the vast 189majority of phones and tablets -- you'll want to pass 190-Dcc=arm-unknown-nto-qnx8.0.0eabi-gcc to Configure. Alternatively, if you 191are targetting an x86 device, or using the simulator provided with the NDK, 192you should specify -Dcc=ntox86-gcc instead. 193 194A sample Configure invocation looks something like this: 195 196 ./Configure -des -Dusecrosscompile \ 197 -Dsysroot=$QNX_TARGET \ 198 -Dtargetdir=$TARGETDIR \ 199 -Dtargetenv="$TARGETENV" \ 200 -Dcc=ntox86-gcc \ 201 -Dtarghost=... # Usual cross-compilation options 202 203=head1 AUTHOR 204 205Norton T. Allen (allen@huarp.harvard.edu) 206 207