Commit | Line | Data |
---|---|---|
1aef975c | 1 | # hints/aix.sh |
1aef975c | 2 | |
2463cec9 MB |
3 | # AIX 3 and AIX 4 are split off to aix_3.sh and aix_4.sh |
4 | # early Feb 2004 by H.Merijn Brand | |
5 | # please read comments in there for historic questions. | |
6 | # many now stripped here | |
7 | ||
bbc711f9 DF |
8 | # Contact dfavor@corridor.com for any of the following: |
9 | # | |
10 | # - AIX 43x and above support | |
11 | # - gcc + threads support | |
12 | # - socks support | |
13 | # | |
bbc711f9 DF |
14 | # Notes: |
15 | # | |
16 | # - shared libperl support is tricky. if ever libperl.a ends up | |
17 | # in /usr/local/lib/* it can override any subsequent builds of | |
18 | # that same perl release. to make sure you know where the shared | |
19 | # libperl.a is coming from do a 'dump -Hv perl' and check all the | |
20 | # library search paths in the loader header. | |
21 | # | |
22 | # it would be nice to warn the user if a libperl.a exists that is | |
23 | # going to override the current build, but that would be complex. | |
24 | # | |
25 | # better yet, a solid fix for this situation should be developed. | |
26 | # | |
1aef975c AD |
27 | |
28 | # Configure finds setrgid and setruid, but they're useless. The man | |
29 | # pages state: | |
30 | # setrgid: The EPERM error code is always returned. | |
31 | # setruid: The EPERM error code is always returned. Processes cannot | |
4e774c84 | 32 | # reset only their real user IDs. |
a0d0e21e LW |
33 | d_setrgid='undef' |
34 | d_setruid='undef' | |
1aef975c | 35 | |
5f3774a9 | 36 | alignbytes=8 |
a5f75d66 | 37 | |
86959918 | 38 | case "$usemymalloc" in |
2463cec9 MB |
39 | '') usemymalloc='n' ;; |
40 | esac | |
bbc711f9 | 41 | |
88567e60 | 42 | # malloc wrap works, but not in vac-5, see later |
da0b61dd | 43 | case "$usemallocwrap" in |
88567e60 MB |
44 | '') usemallocwrap='define' ;; |
45 | esac | |
da0b61dd | 46 | |
bbc711f9 DF |
47 | # Intuiting the existence of system calls under AIX is difficult, |
48 | # at best; the safest technique is to find them empirically. | |
49 | ||
2463cec9 MB |
50 | case "$usenativedlopen" in |
51 | '') usenativedlopen='true' ;; | |
52 | esac | |
cc628cc3 | 53 | |
3c321fdc | 54 | so="a" |
0d9ec2f4 JH |
55 | # AIX itself uses .o (libc.o) but we prefer compatibility |
56 | # with the rest of the world and with rest of the scripting | |
57 | # languages (Tcl, Python) and related systems (SWIG). | |
58 | # Stephanie Beals <bealzy@us.ibm.com> | |
59 | dlext="so" | |
3c321fdc | 60 | |
19e194ad JH |
61 | # Take possible hint from the environment. If 32-bit is set in the |
62 | # environment, we can override it later. If set for 64, the | |
63 | # 'sizeof' test sees a native 64-bit architecture and never looks back. | |
64 | case "$OBJECT_MODE" in | |
2463cec9 | 65 | 32) cat >&4 <<EOF |
19e194ad | 66 | |
2463cec9 | 67 | You have OBJECT_MODE=32 set in the environment. |
19e194ad JH |
68 | I take this as a hint you do not want to |
69 | build for a 64-bit address space. You will be | |
70 | given the opportunity to change this later. | |
71 | EOF | |
2463cec9 MB |
72 | ;; |
73 | 64) cat >&4 <<EOF | |
19e194ad | 74 | |
2463cec9 | 75 | You have OBJECT_MODE=64 set in the environment. |
19e194ad JH |
76 | This forces a full 64-bit build. If that is |
77 | not what you intended, please terminate this | |
78 | program, unset it and restart. | |
79 | EOF | |
2463cec9 MB |
80 | ;; |
81 | esac | |
1aef975c | 82 | |
d909c5cb MB |
83 | s=`lslpp -lc bos.adt.libm >/dev/null` |
84 | if [ $? != 0 ]; then | |
85 | echo "You cannot build perl without the bos.adt.libm package installed" >&4 | |
86 | exit | |
87 | fi | |
88 | ||
1aef975c AD |
89 | # uname -m output is too specific and not appropriate here |
90 | case "$archname" in | |
2463cec9 MB |
91 | '') archname="$osname" ;; |
92 | esac | |
1aef975c | 93 | |
bd9b35c9 JH |
94 | cc=${cc:-cc} |
95 | ||
1c00c3fe MB |
96 | ccflags="$ccflags -D_ALL_SOURCE -D_ANSI_C_SOURCE -D_POSIX_SOURCE" |
97 | case "$cc" in | |
98 | *gcc*) ;; | |
99 | *) ccflags="$ccflags -qmaxmem=-1 -qnoansialias" ;; | |
80589958 | 100 | esac |
1c00c3fe | 101 | nm_opt='-B' |
1aef975c | 102 | |
bbc711f9 DF |
103 | # These functions don't work like Perl expects them to. |
104 | d_setregid='undef' | |
105 | d_setreuid='undef' | |
106 | ||
1aef975c | 107 | # Changes for dynamic linking by Wayne Scott <wscott@ichips.intel.com> |
a0d0e21e LW |
108 | # |
109 | # Tell perl which symbols to export for dynamic linking. | |
411de0ab MB |
110 | cccdlflags='none' # All AIX code is position independent |
111 | cc_type=xlc # do not export to config.sh | |
4633a7c4 | 112 | case "$cc" in |
2463cec9 MB |
113 | *gcc*) |
114 | cc_type=gcc | |
115 | ccdlflags='-Xlinker' | |
116 | if [ "X$gccversion" = "X" ]; then | |
117 | # Done too late in Configure if hinted | |
0baa0948 | 118 | gccversion=`$cc -dumpversion` |
2463cec9 | 119 | fi |
2973cfbe | 120 | ;; |
2463cec9 | 121 | |
3c2f5eaa | 122 | *) ccversion=`lslpp -ql -Ou vac.C | grep -v '^Path' | head -1 | awk '{print $1,$2}'` |
2463cec9 MB |
123 | case "$ccversion" in |
124 | '') ccversion=`lslpp -L | grep 'IBM C and C++ Compilers LUM$'` ;; | |
125 | ||
126 | *.*.*.*.*.*.*) # Ahhrgg, more than one C compiler installed | |
127 | first_cc_path=`which ${cc:-cc}` | |
128 | case "$first_cc_path" in | |
129 | *vac*) | |
130 | cc_type=vac ;; | |
131 | ||
132 | /usr/bin/cc) # Check the symlink | |
133 | if [ -h $first_cc_path ] ; then | |
134 | ls -l $first_cc_path > reflect | |
135 | if grep -i vac reflect >/dev/null 2>&1 ; then | |
136 | cc_type=vac | |
137 | fi | |
138 | rm -f reflect | |
139 | fi | |
140 | ;; | |
141 | esac | |
142 | ccversion=`lslpp -L | grep 'C for AIX Compiler$' | grep -i $cc_type | head -1` | |
143 | ;; | |
144 | ||
145 | vac*.*.*.*) | |
146 | cc_type=vac | |
147 | ;; | |
148 | esac | |
149 | ||
150 | ccversion=`echo "$ccversion" | awk '{print $2}'` | |
151 | # Redbooks state AIX-5 only supports vac-5.0.2.0 and up | |
88567e60 MB |
152 | case "$ccversion" in |
153 | 5*) usemallocwrap='n' ;; # panic in miniperl | |
154 | esac | |
6b356c8e | 155 | ;; |
2463cec9 MB |
156 | esac |
157 | ||
5f9d9a17 ME |
158 | # the required -bE:$installarchlib/CORE/perl.exp is added by |
159 | # libperl.U (Configure) later. | |
a0d0e21e | 160 | |
411de0ab MB |
161 | # The first 3 options would not be needed if dynamic libs. could be linked |
162 | # with the compiler instead of ld. | |
163 | # -bI:$(PERL_INC)/perl.exp Read the exported symbols from the perl binary | |
164 | # -bE:$(BASEEXT).exp Export these symbols. This file contains only one | |
165 | # symbol: boot_$(EXP) can it be auto-generated? | |
142c1590 | 166 | if test $usenativedlopen = 'true' ; then |
79c530cb | 167 | lddlflags="$lddlflags -bhalt:4 -G -bI:\$(PERL_INC)/perl.exp -bE:\$(BASEEXT).exp -bnoentry -lc -lm" |
142c1590 MB |
168 | else |
169 | lddlflags="$lddlflags -bhalt:4 -bM:SRE -bI:\$(PERL_INC)/perl.exp -bE:\$(BASEEXT).exp -bnoentry -lc" | |
170 | fi | |
411de0ab | 171 | |
d002699e MB |
172 | case "$use64bitall" in |
173 | $define|true|[yY]*) use64bitint="$define" ;; | |
174 | esac | |
175 | ||
176 | case "$usemorebits" in | |
177 | $define|true|[yY]*) use64bitint="$define"; uselongdouble="$define" ;; | |
178 | esac | |
179 | ||
180 | case $cc_type in | |
181 | vac|xlc) | |
182 | case "$uselongdouble" in | |
183 | $define|true|[yY]*) | |
184 | ccflags="$ccflags -qlongdouble" | |
185 | libswanted="c128 $libswanted" | |
411de0ab | 186 | lddlflags=`echo "$lddlflags " | sed -e 's/ -lc / -lc128 -lc /'` |
d002699e MB |
187 | ;; |
188 | esac | |
2463cec9 | 189 | ;; |
d002699e MB |
190 | esac |
191 | ||
444379fb | 192 | case "$cc" in |
2463cec9 MB |
193 | *gcc*) ;; |
194 | ||
195 | cc*|xlc*) # cc should've been set by line 116 or so if empty. | |
444379fb | 196 | if test ! -x /usr/bin/$cc -a -x /usr/vac/bin/$cc; then |
2463cec9 | 197 | case ":$PATH:" in |
444379fb | 198 | *:/usr/vac/bin:*) ;; |
2463cec9 | 199 | *) if test ! -x /QOpenSys/usr/bin/$cc; then |
61074b56 JH |
200 | # The /QOpenSys/usr/bin/$cc saves us if we are |
201 | # building natively in OS/400 PASE. | |
e6604a4d | 202 | cat >&4 <<EOF |
444379fb JH |
203 | |
204 | *** | |
205 | *** You either implicitly or explicitly specified an IBM C compiler, | |
206 | *** but you do not seem to have one in /usr/bin, but you seem to have | |
207 | *** the VAC installed in /usr/vac, but you do not have the /usr/vac/bin | |
208 | *** in your PATH. I suggest adding that and retrying Configure. | |
209 | *** | |
210 | EOF | |
61074b56 | 211 | exit 1 |
2463cec9 MB |
212 | fi |
213 | ;; | |
444379fb | 214 | esac |
2463cec9 | 215 | fi |
444379fb | 216 | ;; |
2463cec9 | 217 | esac |
444379fb | 218 | |
5cf1d1f1 | 219 | case "$ldlibpthname" in |
2463cec9 | 220 | '') ldlibpthname=LIBPATH ;; |
3427abbf | 221 | esac |
52e1cb5e | 222 | |
2463cec9 | 223 | # This script UU/usethreads.cbu will get 'called-back' by Configure |
104d25b7 JH |
224 | # after it has prompted the user for whether to use threads. |
225 | cat > UU/usethreads.cbu <<'EOCBU' | |
226 | case "$usethreads" in | |
2463cec9 MB |
227 | $define|true|[yY]*) |
228 | d_drand48_r='undef' | |
229 | d_endgrent_r='undef' | |
230 | d_endpwent_r='undef' | |
231 | d_getgrent_r='undef' | |
232 | d_getpwent_r='undef' | |
233 | d_random_r='undef' | |
234 | d_setgrent_r='undef' | |
235 | d_setpwent_r='undef' | |
236 | d_srand48_r='undef' | |
4538cc61 | 237 | d_srandom_r='undef' |
2463cec9 MB |
238 | d_strerror_r='undef' |
239 | ||
4e774c84 SB |
240 | ccflags="$ccflags -DNEED_PTHREAD_INIT" |
241 | case "$cc" in | |
68224244 RT |
242 | *gcc*) |
243 | ccflags="-D_THREAD_SAFE $ccflags" | |
244 | ;; | |
245 | cc_r) | |
246 | ;; | |
247 | xlc_r) | |
248 | # for -qlonglong | |
249 | ccflags="$ccflags -qlanglvl=extended" | |
250 | ;; | |
251 | # we do not need the C++ compiler | |
252 | xlC_r) | |
253 | # for -qlonglong | |
254 | ccflags="$ccflags -qlanglvl=extended" | |
255 | cc=xlc_r | |
256 | ;; | |
257 | '') | |
258 | cc=cc_r | |
259 | ;; | |
3e50adc2 | 260 | *) |
3e50adc2 | 261 | esac |
c88be79f JH |
262 | |
263 | # Insert pthreads to libswanted, before any libc or libC. | |
15173baf | 264 | set `echo X "$libswanted "| sed -e 's/ \([cC]\) / pthreads \1 /'` |
c88be79f JH |
265 | shift |
266 | libswanted="$*" | |
267 | # Insert pthreads to lddlflags, before any libc or libC. | |
15173baf | 268 | set `echo X "$lddlflags " | sed -e 's/ \(-l[cC]\) / -lpthreads \1 /'` |
c88be79f JH |
269 | shift |
270 | lddlflags="$*" | |
104d25b7 | 271 | ;; |
68224244 RT |
272 | *) |
273 | case "$cc" in | |
274 | xlc) | |
275 | # for -qlonglong | |
276 | ccflags="$ccflags -qlanglvl=extended" | |
277 | ;; | |
278 | # we do not need the C++ compiler | |
279 | xlC) | |
280 | # for -qlonglong | |
281 | ccflags="$ccflags -qlanglvl=extended" | |
282 | cc=xlc | |
283 | ;; | |
284 | *) | |
285 | esac | |
286 | ;; | |
104d25b7 JH |
287 | esac |
288 | EOCBU | |
fa9667c9 | 289 | |
2463cec9 | 290 | # This script UU/uselargefiles.cbu will get 'called-back' by Configure |
bd9b35c9 | 291 | # after it has prompted the user for whether to use large files. |
8a647129 | 292 | cat > UU/uselargefiles.cbu <<'EOCBU' |
bd9b35c9 | 293 | case "$uselargefiles" in |
2463cec9 MB |
294 | ''|$define|true|[yY]*) |
295 | # Configure should take care of use64bitint and use64bitall being | |
296 | # defined before uselargefiles.cbu is consulted. | |
297 | if test X"$use64bitint:$quadtype" = X"$define:long" -o X"$use64bitall" = Xdefine; then | |
21c7e20c JH |
298 | # Keep these at the left margin. |
299 | ccflags_uselargefiles="`getconf XBS5_LP64_OFF64_CFLAGS 2>/dev/null`" | |
300 | ldflags_uselargefiles="`getconf XBS5_LP64_OFF64_LDFLAGS 2>/dev/null`" | |
2463cec9 | 301 | else |
9422c00b | 302 | # Keep these at the left margin. |
45c9e83b JH |
303 | ccflags_uselargefiles="`getconf XBS5_ILP32_OFFBIG_CFLAGS 2>/dev/null`" |
304 | ldflags_uselargefiles="`getconf XBS5_ILP32_OFFBIG_LDFLAGS 2>/dev/null`" | |
2463cec9 MB |
305 | fi |
306 | if test X"$use64bitint:$quadtype" = X"$define:long" -o X"$use64bitall" = Xdefine; then | |
21c7e20c | 307 | # Keep this at the left margin. |
af638b87 | 308 | libswanted_uselargefiles="`getconf XBS5_LP64_OFF64_LIBS 2>/dev/null|sed -e 's@^-l@@' -e 's@ -l@ @g'`" |
2463cec9 | 309 | else |
9422c00b | 310 | # Keep this at the left margin. |
af638b87 | 311 | libswanted_uselargefiles="`getconf XBS5_ILP32_OFFBIG_LIBS 2>/dev/null|sed -e 's@^-l@@' -e 's@ -l@ @g'`" |
2463cec9 MB |
312 | fi |
313 | ||
45c9e83b | 314 | case "$ccflags_uselargefiles$ldflags_uselargefiles$libs_uselargefiles" in |
2463cec9 MB |
315 | '') ;; |
316 | *) ccflags="$ccflags $ccflags_uselargefiles" | |
317 | ldflags="$ldflags $ldflags_uselargefiles" | |
318 | libswanted="$libswanted $libswanted_uselargefiles" | |
319 | ;; | |
320 | esac | |
6b8eaf93 | 321 | |
be7cbdf3 NE |
322 | # -bmaxdata:0x80000000 |
323 | # - This increases the size of heap memory available to perl. | |
324 | # Default is 256 MB, which sounds large but caused a software | |
325 | # vendor problems. So this sets heap to 2 GB maximum. Anything | |
326 | # higher and you'd want to consider 64 bit perl. | |
327 | # - NOTE however, that setting this in 64bit mode will limit your | |
328 | # amount of available memory to 2GB, so we set this only in | |
329 | # 32bit mode to avoid future problems a la "should be enough | |
330 | # for everyone" ... | |
331 | # | |
332 | case "$use64bitall" in | |
333 | $define|true|[yY]*) | |
334 | : | |
335 | ;; | |
336 | *) | |
337 | ldflags="$ldflags -bmaxdata:0x80000000" | |
338 | ;; | |
339 | esac | |
340 | ||
2463cec9 | 341 | case "$gccversion" in |
be7cbdf3 NE |
342 | '') # Not using gcc. |
343 | # Due to calling $cc without $cflags when linking some | |
344 | # binaries we need to hardwire $cc to the right mode. | |
345 | # The correct fix would be to have Makefile.SH not set | |
346 | # CLDFLAGS from $ldflags ... | |
347 | case "$use64bitall" in | |
348 | $define|true|[yY]*) cc="$cc -q64" ;; | |
349 | *) cc="$cc -q32" ;; | |
350 | esac | |
351 | ;; | |
2463cec9 MB |
352 | *) # Remove xlc-specific -qflags. |
353 | ccflags="`echo $ccflags | sed -e 's@ -q[^ ]*@ @g' -e 's@^-q[^ ]* @@g'`" | |
354 | ldflags="`echo $ldflags | sed -e 's@ -q[^ ]*@ @g' -e 's@^-q[^ ]* @@g'`" | |
355 | # Move xlc-specific -bflags. | |
356 | ccflags="`echo $ccflags | sed -e 's@ -b@ -Wl,-b@g'`" | |
357 | ldflags="`echo ' '$ldflags | sed -e 's@ -b@ -Wl,-b@g'`" | |
358 | lddlflags="`echo ' '$lddlflags | sed -e 's@ -b@ -Wl,-b@g'`" | |
ad5c63c6 | 359 | lddlflags="`echo ' '$lddlflags | sed -e 's@ -G @ -Wl,-G @g'`" |
be7cbdf3 NE |
360 | |
361 | # Due to calling $cc without $cflags when linking some | |
362 | # binaries we need to hardwire $cc to the right mode. | |
0c0f8223 | 363 | case "$use64bitall" in |
be7cbdf3 NE |
364 | $define|true|[yY]*) |
365 | cc="$cc -maix64" | |
366 | ld="$cc" | |
367 | ;; | |
368 | *) | |
369 | cc="$cc -maix32" | |
370 | ld="$cc" | |
371 | ;; | |
0c0f8223 | 372 | esac |
2463cec9 MB |
373 | echo >&4 "(using ccflags $ccflags)" |
374 | echo >&4 "(using ldflags $ldflags)" | |
375 | echo >&4 "(using lddlflags $lddlflags)" | |
efeaa891 JH |
376 | ;; |
377 | esac | |
2463cec9 MB |
378 | ;; |
379 | esac | |
19e194ad JH |
380 | EOCBU |
381 | ||
19e194ad | 382 | cat > UU/use64bitall.cbu <<'EOCBU' |
2463cec9 | 383 | # This script UU/use64bitall.cbu will get 'called-back' by Configure |
de6124c8 | 384 | # after it has prompted the user for whether to be maximally 64-bitty. |
19e194ad | 385 | case "$use64bitall" in |
2463cec9 MB |
386 | $define|true|[yY]*) |
387 | echo " " | |
388 | echo "Checking the CPU width of your hardware..." >&4 | |
389 | $cat >size.c <<EOCP | |
19e194ad JH |
390 | #include <stdio.h> |
391 | #include <sys/systemcfg.h> | |
392 | int main (void) | |
393 | { | |
2463cec9 MB |
394 | printf ("%d\n", _system_configuration.width); |
395 | return (0); | |
396 | } | |
19e194ad | 397 | EOCP |
2463cec9 MB |
398 | set size |
399 | if eval $compile_ok; then | |
400 | qacpuwidth=`./size` | |
401 | echo "You are running on $qacpuwidth bit hardware." | |
402 | else | |
403 | dflt="32" | |
404 | echo " " | |
405 | echo "(I can't seem to compile the test program. Guessing...)" | |
406 | rp="What is the width of your CPU (in bits)?" | |
407 | . ./myread | |
408 | qacpuwidth="$ans" | |
19e194ad | 409 | fi |
2463cec9 MB |
410 | $rm -f size.c size |
411 | ||
412 | case "$qacpuwidth" in | |
19e194ad JH |
413 | 32*) |
414 | cat >&4 <<EOM | |
415 | Bzzzt! At present, you can only perform a | |
416 | full 64-bit build on a 64-bit machine. | |
417 | EOM | |
418 | exit 1 | |
419 | ;; | |
420 | esac | |
2463cec9 MB |
421 | qacflags="`getconf XBS5_LP64_OFF64_CFLAGS 2>/dev/null`" |
422 | qaldflags="`getconf XBS5_LP64_OFF64_LDFLAGS 2>/dev/null`" | |
423 | # See jhi's comments above regarding this re-eval. I've | |
424 | # seen similar weirdness in the form of: | |
425 | # | |
19e194ad | 426 | # 1506-173 (W) Option lm is not valid. Enter xlc for list of valid options. |
2463cec9 MB |
427 | # |
428 | # error messages from 'cc -E' invocation. Again, the offending | |
429 | # string is simply not detectable by any means. Since it doesn't | |
430 | # do any harm, I didn't pursue it. -- sh | |
431 | qaldflags="`echo $qaldflags`" | |
af638b87 | 432 | qalibs="`getconf XBS5_LP64_OFF64_LIBS 2>/dev/null|sed -e 's@^-l@@' -e 's@ -l@ @g'`" |
2463cec9 MB |
433 | # -q32 and -b32 may have been set by uselargefiles or user. |
434 | # Remove them. | |
435 | ccflags="`echo $ccflags | sed -e 's@-q32@@'`" | |
436 | ldflags="`echo $ldflags | sed -e 's@-b32@@'`" | |
0c0f8223 MB |
437 | case "$cc" in |
438 | *gcc*) | |
439 | ccflags="`echo $ccflags | sed -e 's@-q64@-maix64@'`" | |
440 | ccflags_uselargefiles="`echo $ccflags_uselargefiles | sed -e 's@-q64@-maix64@'`" | |
441 | qacflags="`echo $qacflags | sed -e 's@-q64@-maix64@'`" | |
442 | ;; | |
443 | esac | |
2463cec9 MB |
444 | # Tell archiver to use large format. Unless we remove 'ar' |
445 | # from 'trylist', the Configure script will just reset it to 'ar' | |
446 | # immediately prior to writing config.sh. This took me hours | |
447 | # to figure out. | |
448 | trylist="`echo $trylist | sed -e 's@^ar @@' -e 's@ ar @ @g' -e 's@ ar$@@'`" | |
449 | ar="ar -X64" | |
450 | nm_opt="-X64 $nm_opt" | |
2463cec9 MB |
451 | case "$qacflags$qaldflags$qalibs" in |
452 | '') ;; | |
453 | *) ccflags="$ccflags $qacflags" | |
be7cbdf3 | 454 | ldflags="$ldflags" |
2463cec9 MB |
455 | lddlflags="$qaldflags $lddlflags" |
456 | libswanted="$libswanted $qalibs" | |
457 | ;; | |
19e194ad | 458 | esac |
2463cec9 | 459 | case "$ccflags" in |
19e194ad | 460 | *-DUSE_64_BIT_ALL*) ;; |
2463cec9 | 461 | *) ccflags="$ccflags -DUSE_64_BIT_ALL";; |
19e194ad | 462 | esac |
2463cec9 | 463 | case "$archname64" in |
19e194ad JH |
464 | ''|64*) archname64=64all ;; |
465 | esac | |
2463cec9 MB |
466 | longsize="8" |
467 | qacflags='' | |
468 | qaldflags='' | |
469 | qalibs='' | |
470 | qacpuwidth='' | |
471 | ;; | |
472 | esac | |
efeaa891 | 473 | EOCBU |
5b877257 | 474 | |
2463cec9 | 475 | if test $usenativedlopen = 'true' ; then |
fd90a50d | 476 | ccflags="$ccflags -DUSE_NATIVE_DLOPEN" |
142c1590 MB |
477 | # -brtl Enables a binary to use run time linking |
478 | # -bdynamic When used with -brtl, tells linker to search for | |
479 | # ".so"-suffix libraries as well as ".a" suffix | |
480 | # libraries. AIX allows both .so and .a libraries to | |
481 | # contain dynamic shared objects. | |
fd90a50d | 482 | case "$cc" in |
be7cbdf3 NE |
483 | *gcc*) ldflags="$ldflags -Wl,-brtl -Wl,-bdynamic" ;; |
484 | *) ldflags="$ldflags -brtl -bdynamic" ;; | |
9d20a131 | 485 | esac |
2463cec9 MB |
486 | elif test -f /lib/libC.a -a X"`$cc -v 2>&1 | grep gcc`" = X; then |
487 | # If the C++ libraries, libC and libC_r, are available we will | |
488 | # prefer them over the vanilla libc, because the libC contain | |
489 | # loadAndInit() and terminateAndUnload() which work correctly | |
490 | # with C++ statics while libc load() and unload() do not. See | |
491 | # ext/DynaLoader/dl_aix.xs. The C-to-C_r switch is done by | |
492 | # usethreads.cbu, if needed. | |
493 | ||
494 | # Cify libswanted. | |
495 | set `echo X "$libswanted "| sed -e 's/ c / C c /'` | |
496 | shift | |
497 | libswanted="$*" | |
498 | # Cify lddlflags. | |
499 | set `echo X "$lddlflags "| sed -e 's/ -lc / -lC -lc /'` | |
500 | shift | |
501 | lddlflags="$*" | |
502 | fi | |
4e774c84 | 503 | |
522b859a | 504 | case "$PASE" in |
2463cec9 | 505 | define) |
522b859a | 506 | case "$prefix" in |
2463cec9 MB |
507 | '') prefix=/QOpenSys/perl ;; |
508 | esac | |
522b859a JH |
509 | cat >&4 <<EOF |
510 | ||
511 | *** | |
512 | *** You seem to be compiling in AIX for the OS/400 PASE environment. | |
513 | *** I'm not going to use the AIX bind, nsl, and possible util libraries, then. | |
514 | *** I'm also not going to install perl as /usr/bin/perl. | |
515 | *** Perl will be installed under $prefix. | |
516 | *** For instructions how to install this build from AIX to PASE, | |
517 | *** see the file README.os400. Accept the "aix" for the question | |
518 | *** about "Operating system name". | |
519 | *** | |
520 | EOF | |
521 | set `echo " $libswanted " | sed -e 's@ bind @ @' -e 's@ nsl @ @' -e 's@ util @ @'` | |
522 | shift | |
523 | libswanted="$*" | |
524 | installusrbinperl="$undef" | |
abeab9d3 RGS |
525 | |
526 | # V5R1 doesn't have this (V5R2 does), without knowing | |
527 | # which one we have it's safer to be pessimistic. | |
528 | # Cwd will work fine even without fchdir(), but if | |
529 | # V5R1 tries to use code compiled assuming fchdir(), | |
530 | # lots of grief will issue forth from Cwd. | |
531 | case "$d_fchdir" in | |
2463cec9 MB |
532 | '') d_fchdir="$undef" ;; |
533 | esac | |
522b859a | 534 | ;; |
2463cec9 | 535 | esac |
522b859a | 536 | |
f67e8e0b MB |
537 | # remove libbsd.a from wanted libraries |
538 | libswanted=`echo " $libswanted " | sed -e 's/ bsd / /'` | |
539 | libswanted=`echo " $libswanted " | sed -e 's/ BSD / /'` | |
540 | d_flock='undef' | |
541 | ||
c533d96e | 542 | # remove libgdbm from wanted libraries |
d549c43d RT |
543 | # The libgdbm < 1.8.3-5 from the AIX Toolbox is not working |
544 | # because two wrong .h are present | |
545 | if [ -f "/opt/freeware/include/gdbm/dbm.h" ] || | |
546 | [ -f "/opt/freeware/include/gdbm/ndbm.h" ]; then | |
547 | echo "GDBM support disabled because your GDBM package contains extraneous headers - see README.aix." | |
548 | libswanted=`echo " $libswanted " | sed -e 's/ gdbm / /'` | |
549 | i_gdbm='undef' | |
550 | i_gdbmndbm='undef' | |
551 | fi | |
5b877257 | 552 | # EOF |