more Compiler patches from Vishal Bhatia <vishalb@my-dejanews.com>
[p5sagit/p5-mst-13.2.git] / hints / aix.sh
CommitLineData
1aef975c 1# hints/aix.sh
2# AIX 3.x.x hints thanks to Wayne Scott <wscott@ichips.intel.com>
3# AIX 4.1 hints thanks to Christopher Chan-Nui <channui@austin.ibm.com>.
52e1cb5e 4# AIX 4.1 pthreading by Christopher Chan-Nui <channui@austin.ibm.com> and
5# Jarkko Hietaniemi <jhi@iki.fi>.
1aef975c 6# Merged on Mon Feb 6 10:22:35 EST 1995 by
7# Andy Dougherty <doughera@lafcol.lafayette.edu>
8
9
10# Configure finds setrgid and setruid, but they're useless. The man
11# pages state:
12# setrgid: The EPERM error code is always returned.
13# setruid: The EPERM error code is always returned. Processes cannot
14# reset only their real user IDs.
a0d0e21e 15d_setrgid='undef'
16d_setruid='undef'
1aef975c 17
5f3774a9 18# Neither do these functions work like Perl expects them to.
19d_setregid='undef'
20d_setreuid='undef'
a0d0e21e 21
5f3774a9 22alignbytes=8
a5f75d66 23
295c4836 24# Intuiting the existence of system calls under AIX is difficult, at best;
25# the safest (and slowest...) technique is to find them empirically.
cc628cc3 26usenm='undef'
27
3c321fdc 28so="a"
29dlext="so"
30
1aef975c 31# Make setsockopt work correctly. See man page.
32# ccflags='-D_BSD=44'
33
34# uname -m output is too specific and not appropriate here
35case "$archname" in
36'') archname="$osname" ;;
37esac
38
39case "$osvers" in
403*) d_fchmod=undef
fc2c2f48 41 ccflags="$ccflags -D_ALL_SOURCE"
1aef975c 42 ;;
43*) # These hints at least work for 4.x, possibly other systems too.
fc2c2f48 44 ccflags="$ccflags -D_ALL_SOURCE -D_ANSI_C_SOURCE -D_POSIX_SOURCE"
80589958 45 case "$cc" in
46 *gcc*) ;;
fc2c2f48 47 *) ccflags="$ccflags -qmaxmem=8192" ;;
80589958 48 esac
1aef975c 49 nm_opt='-B'
1aef975c 50 ;;
51esac
52
53# Changes for dynamic linking by Wayne Scott <wscott@ichips.intel.com>
a0d0e21e 54#
55# Tell perl which symbols to export for dynamic linking.
4633a7c4 56case "$cc" in
5f3774a9 57*gcc*) ccdlflags="$ccdlflags -Xlinker" ;;
4633a7c4 58esac
5f3774a9 59ccdlflags="$ccdlflags -bE:perl.exp"
a0d0e21e 60
61# The first 3 options would not be needed if dynamic libs. could be linked
62# with the compiler instead of ld.
42793c05 63# -bI:$(PERL_INC)/perl.exp Read the exported symbols from the perl binary
64# -bE:$(BASEEXT).exp Export these symbols. This file contains only one
65# symbol: boot_$(EXP) can it be auto-generated?
c07a80fd 66case "$osvers" in
673*)
5f3774a9 68 lddlflags="$lddlflags -H512 -T512 -bhalt:4 -bM:SRE -bI:$(PERL_INC)/perl.exp -bE:$(BASEEXT).exp -e _nostart -lc"
c07a80fd 69 ;;
70*)
5f3774a9 71 lddlflags="$lddlflags -bhalt:4 -bM:SRE -bI:$(PERL_INC)/perl.exp -bE:$(BASEEXT).exp -b noentry -lc"
b691c02f 72 ;;
c07a80fd 73esac
52e1cb5e 74
104d25b7 75# This script UU/usethreads.cbu will get 'called-back' by Configure
76# after it has prompted the user for whether to use threads.
77cat > UU/usethreads.cbu <<'EOCBU'
78case "$usethreads" in
79$define|true|[yY]*)
80 ccflags="$ccflags -DNEED_PTHREAD_INIT"
81 case "$cc" in
14ae4f6a 82 xlc_r) ;;
104d25b7 83 cc)
84 echo >&4 "Switching cc to xlc_r because of POSIX threads."
85 cc=xlc_r
86 ;;
5f3774a9 87 '' | cc_r)
104d25b7 88 cc=xlc_r
89 ;;
90 *)
91 cat >&4 <<EOM
14ae4f6a 92For pthreads you should use the AIX C compiler xlc_r.
104d25b7 93(now your compiler was '$cc')
94Cannot continue, aborting.
95EOM
96 exit 1
97 ;;
98 esac
99
100 # Add the POSIX threads library and the re-entrant libc.
101
102 lddlflags=`echo $lddlflags | sed 's/ -lc$/ -lpthreads -lc_r -lc/'`
103
104 # Add the c_r library to the list of wanted libraries.
105 # Make sure the c_r library is before the c library or
106 # make will fail.
107 set `echo X "$libswanted "| sed -e 's/ c / c_r c /'`
108 shift
109 libswanted="$*"
5f3774a9 110
111 # Perl's malloc doesn't survive threaded AIX.
112 case "$usemymalloc" in
113 '') usemymalloc='n' ;;
114 esac
115
104d25b7 116 ;;
117esac
118EOCBU