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