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