This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perl -Dt doesnt output newlines
[perl5.git] / hints / qnx.sh
1 #----------------------------------------------------------------
2 # QNX hints
3 #
4 # Most of the hints in this file are for QNX4, which needed
5 # more help. The QNX6 hints are located toward the bottom.
6 #
7 # perl-5.7.2 passes all tests under QNX4.24G
8 #  Watcom 10.6 with Beta/970211.wcc.update.tar.F
9 #  socket3r.lib Nov21 1996.
10 # perl-5.7.2 fails 4 known tests under QNX6.1.0
11 #
12 # As with many unix ports, this one depends on a few "standard"
13 # unix utilities which are not necessarily standard for QNX4.
14 #
15 # /bin/sh  This is used heavily by Configure and then by
16 #          perl itself. QNX4's version is fine, but Configure
17 #          will choke on the 16-bit version, so if you are
18 #          running QNX 4.22, link /bin/sh to /bin32/ksh
19 # ar       This is the standard unix library builder.
20 #          We use wlib. With Watcom 10.6, when wlib is
21 #          linked as "ar", it behaves like ar and all is
22 #          fine. Under 9.5, a cover is required. One is
23 #          included in ../qnx
24 # nm       This is used (optionally) by configure to list
25 #          the contents of libraries. I will generate
26 #          a cover function on the fly in the UU directory.
27 # cpp      Configure and perl need a way to invoke a C
28 #          preprocessor. I have created a simple cover
29 #          for cc which does the right thing. Without this,
30 #          Configure will create its own wrapper which works,
31 #          but it doesn't handle some of the command line arguments
32 #          that perl will throw at it.
33 # make     You really need GNU make to compile this. GNU make
34 #          ships by default with QNX 4.23, but you can get it
35 #          from quics for earlier versions.
36 #----------------------------------------------------------------
37 # Outstanding Issues for QNX4:
38 #   There is no support for dynamically linked libraries in
39 #   QNX4.
40
41 #   ext/Cwd/Cwd.t will complain if `pwd` and cwd don't give
42 #   the same results. cwd calls `fullpath -t`, so if you
43 #   cd `fullpath -t` before running the test, it will
44 #   pass.
45 #
46 #   lib/File/Find/taint.t will complain if '.' is in your
47 #   PATH. The PATH test is triggered because cwd calls
48 #   `fullpath -t`.
49 #
50 #   ext/IO/lib/IO/t/io_sock.t: Subtest 14 is skipped due to
51 #   the fact that the functionality to read back the non-blocking
52 #   status of a socket is not implemented in QNX's TCP/IP. This
53 #   has been reported to QNX and it may work with later versions
54 #   of TCP/IP.
55 #
56 # Older issues:
57 #   lib/posix.t test failed on test 17 because acos(1) != 0.
58 #      Resolved in 970211 Beta
59 #   lib/io_udp.t test hangs because of a bug in getsockname().
60 #      Fixed in latest BETA socket3r.lib
61 #----------------------------------------------------------------
62 # Outstanding Issues for QNX6:
63 #  The following tests are still failing as of 5.7.1:
64 #
65 #   op/sprintf.........................FAILED at test 91
66 #   lib/1_compile......................FAILED at test 33
67 #   ext/IO/lib/IO/t/io_sock............FAILED at test 12
68 #   ext/IO/lib/IO/t/io_udp.............FAILED at test 4
69 #
70 #----------------------------------------------------------------
71 # These hints were submitted by:
72 #   Norton T. Allen
73 #   Harvard University Atmospheric Research Project
74 #   allen@huarp.harvard.edu
75 #
76 # If you have suggestions or changes, please let me know.
77 #----------------------------------------------------------------
78
79 echo ""
80 echo "Some tests may fail. Please read the hints/qnx.sh file."
81 echo ""
82
83 #----------------------------------------------------------------
84 # At present, all QNX4 systems are equivalent architectures,
85 # so it is reasonable to call archname=x86-qnx rather than
86 # making an unnecessary distinction between AT-qnx and PCI-qnx,
87 # for example. I will use uname's architecture for Neutrino.
88 #----------------------------------------------------------------
89 set X `uname -a`
90 shift
91 [ "$1" != "QNX" ] && echo "uname doesn't look like QNX!"
92 case $4 in
93   42[2-9]) archname='x86-qnx';;
94   *) osname='nto'
95          osvers=$3
96      archname="$5-nto";;
97 esac
98
99 if [ "$osname" = "qnx" ]; then
100   #----------------------------------------------------------------
101   # QNX doesn't come with a csh and the ports of tcsh I've used
102   # don't work reliably:
103   #----------------------------------------------------------------
104   csh=''
105   d_csh='undef'
106   full_csh=''
107
108   #----------------------------------------------------------------
109   # setuid scripts are secure under QNX.
110   #  (Basically, the same race conditions apply, but assuming
111   #  the scripts are located in a secure directory, the methods
112   #  for exploiting the race condition are defeated because
113   #  the loader expands the script name fully before executing
114   #  the interpreter.)
115   #----------------------------------------------------------------
116   d_suidsafe='define'
117
118   #----------------------------------------------------------------
119   # difftime is implemented as a preprocessor macro, so it doesn't show
120   # up in the libraries:
121   #----------------------------------------------------------------
122   d_difftime='define'
123
124   #----------------------------------------------------------------
125   # strtod is in the math library, but we can't tell Configure
126   # about the math library or it will confuse the linker
127   #----------------------------------------------------------------
128   d_strtod='define'
129
130   lib_ext='3r.lib'
131   libc='/usr/lib/clib3r.lib'
132
133   #----------------------------------------------------------------
134   # ccflags:
135   # I like to turn the warnings up high, but a few common
136   # constructs make a lot of noise, so I turn those warnings off.
137   # A few still remain...
138   #
139   # unix.h is required as a general rule for unixy applications.
140   #----------------------------------------------------------------
141   ccflags='-mf -w4 -Wc,-wcd=202 -Wc,-wcd=203 -Wc,-wcd=302 -Wc,-fi=unix.h'
142
143   #----------------------------------------------------------------
144   # ldflags:
145   # If you want debugging information, you must specify -g on the
146   # link as well as the compile. If optimize != -g, you should
147   # remove this.
148   #----------------------------------------------------------------
149   ldflags="-g -N1M"
150
151   so='none'
152   selecttype='fd_set *'
153
154   #----------------------------------------------------------------
155   # Add -lunix to list of libs. This is needed mainly so the nm
156   # search will find funcs in the unix lib. Including unix.h should
157   # automatically include the library without -l.
158   #----------------------------------------------------------------
159   libswanted="$libswanted unix"
160
161   if [ -z "`which ar 2>/dev/null`" ]; then
162         cat <<-'EOF' >&4
163           I don't see an 'ar', so I'm guessing you are running
164           Watcom 9.5 or earlier. You may want to install the ar
165           cover found in the qnx subdirectory of this distribution.
166           It might reasonably be placed in /usr/local/bin.
167
168         EOF
169   fi
170   #----------------------------------------------------------------
171   # Here is a nm script which fixes up wlib's output to look
172   # something like nm's, at least enough so that Configure can
173   # use it.
174   #----------------------------------------------------------------
175   if [ -z "`which nm 2>/dev/null`" ]; then
176         cat <<-EOF
177           Creating a quick-and-dirty nm cover for       Configure to use:
178
179         EOF
180         cat >./UU/nm <<-'EOF'
181           #! /bin/sh
182           #__USAGE
183           #%C   <lib> [<lib> ...]
184           #     Designed to mimic Unix's nm utility to list
185           #     defined symbols in a library
186           unset WLIB
187           for i in $*; do wlib $i; done |
188                 awk '
189                   /^  / {
190                         for (i = 1; i <= NF; i++) {
191                           sub("_$", "", $i)
192                           print "000000  T " $i
193                         }
194                   }'
195         EOF
196         chmod +x ./UU/nm
197   fi
198
199   cppstdin=`which cpp 2>/dev/null`
200   if [ -n "$cppstdin" ]; then
201         cat <<-EOF >&4
202           I found a cpp at $cppstdin and will assume it is a good
203           thing to use. If this proves to be false, there is a
204           thin cover for cpp in the qnx subdirectory of this
205           distribution which you could move into your path.
206         EOF
207         cpprun="$cppstdin"
208   else
209         cat <<-EOF >&4
210         
211           There is a cpp cover in the qnx subdirectory of this
212           distribution which works a little better than the
213           Configure default. You may wish to copy it to
214           /usr/local/bin or some other suitable location.
215         EOF
216   fi
217 else
218   # $^O eq nto
219
220   ccflags='-DDLOPEN_WONT_DO_RELATIVE_PATHS'
221
222   # Options required to get dynamic linking to work
223   lddlflags='-shared'
224   ccdlflags='-Wl,-E'
225
226   # Somewhere in the build, something tries to throw a gcc
227   # option to $cc if it knows it invokes gcc. Our cc doesn't
228   # recognize that option, so we're better off setting cc=gcc.
229   cc='gcc'
230
231   # If we use perl's malloc, it dies with an invalid sbrk.
232   # This is probably worth tracking down someday.
233   usemymalloc='false'
234 fi