This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Ultrix hints update.
[perl5.git] / hints / aix.sh
CommitLineData
1aef975c
AD
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
JH
4# AIX 4.1 pthreading by Christopher Chan-Nui <channui@austin.ibm.com> and
5# Jarkko Hietaniemi <jhi@iki.fi>.
1aef975c
AD
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
LW
15d_setrgid='undef'
16d_setruid='undef'
1aef975c 17
a0d0e21e
LW
18alignbytes=8
19
a5f75d66
AD
20usemymalloc='n'
21
cc628cc3
KS
22# Intuiting the existence of system calls under AIX is difficult,
23# at best; the safest technique is to find them empirically.
24usenm='undef'
25
3c321fdc 26so="a"
27dlext="so"
28
1aef975c
AD
29# Make setsockopt work correctly. See man page.
30# ccflags='-D_BSD=44'
31
32# uname -m output is too specific and not appropriate here
33case "$archname" in
34'') archname="$osname" ;;
35esac
36
37case "$osvers" in
383*) d_fchmod=undef
fc2c2f48 39 ccflags="$ccflags -D_ALL_SOURCE"
1aef975c
AD
40 ;;
41*) # These hints at least work for 4.x, possibly other systems too.
fc2c2f48 42 ccflags="$ccflags -D_ALL_SOURCE -D_ANSI_C_SOURCE -D_POSIX_SOURCE"
80589958 43 case "$cc" in
44 *gcc*) ;;
fc2c2f48 45 *) ccflags="$ccflags -qmaxmem=8192" ;;
80589958 46 esac
1aef975c 47 nm_opt='-B'
1aef975c
AD
48 ;;
49esac
50
9018c6a0
KN
51# These functions don't work like Perl expects them to.
52d_setregid='undef'
53d_setreuid='undef'
54
1aef975c 55# Changes for dynamic linking by Wayne Scott <wscott@ichips.intel.com>
a0d0e21e
LW
56#
57# Tell perl which symbols to export for dynamic linking.
4633a7c4
LW
58case "$cc" in
59*gcc*) ccdlflags='-Xlinker -bE:perl.exp' ;;
60*) ccdlflags='-bE:perl.exp' ;;
61esac
a0d0e21e
LW
62
63# The first 3 options would not be needed if dynamic libs. could be linked
64# with the compiler instead of ld.
42793c05
TB
65# -bI:$(PERL_INC)/perl.exp Read the exported symbols from the perl binary
66# -bE:$(BASEEXT).exp Export these symbols. This file contains only one
67# symbol: boot_$(EXP) can it be auto-generated?
c07a80fd 68case "$osvers" in
693*)
b691c02f 70 lddlflags='-H512 -T512 -bhalt:4 -bM:SRE -bI:$(PERL_INC)/perl.exp -bE:$(BASEEXT).exp -e _nostart -lc'
c07a80fd 71 ;;
72*)
b691c02f
JH
73 lddlflags='-bhalt:4 -bM:SRE -bI:$(PERL_INC)/perl.exp -bE:$(BASEEXT).exp -b noentry -lc'
74 ;;
c07a80fd 75esac
52e1cb5e 76
104d25b7
JH
77# This script UU/usethreads.cbu will get 'called-back' by Configure
78# after it has prompted the user for whether to use threads.
79cat > UU/usethreads.cbu <<'EOCBU'
80case "$usethreads" in
81$define|true|[yY]*)
82 ccflags="$ccflags -DNEED_PTHREAD_INIT"
83 case "$cc" in
14ae4f6a 84 xlc_r) ;;
104d25b7
JH
85 cc)
86 echo >&4 "Switching cc to xlc_r because of POSIX threads."
87 cc=xlc_r
88 ;;
14ae4f6a 89 '' | cc_r)
104d25b7
JH
90 cc=xlc_r
91 ;;
92 *)
93 cat >&4 <<EOM
14ae4f6a 94For pthreads you should use the AIX C compiler xlc_r.
104d25b7
JH
95(now your compiler was '$cc')
96Cannot continue, aborting.
97EOM
98 exit 1
99 ;;
100 esac
101
102 # Add the POSIX threads library and the re-entrant libc.
103
104 lddlflags=`echo $lddlflags | sed 's/ -lc$/ -lpthreads -lc_r -lc/'`
105
106 # Add the c_r library to the list of wanted libraries.
107 # Make sure the c_r library is before the c library or
108 # make will fail.
109 set `echo X "$libswanted "| sed -e 's/ c / c_r c /'`
110 shift
111 libswanted="$*"
112 ;;
113esac
114EOCBU