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>.
4 # AIX 4.1 pthreading by Christopher Chan-Nui <channui@austin.ibm.com> and
5 # Jarkko Hietaniemi <jhi@iki.fi>.
6 # Merged on Mon Feb 6 10:22:35 EST 1995 by
7 # Andy Dougherty <doughera@lafcol.lafayette.edu>
10 # Contact dfavor@corridor.com for any of the following:
12 # - AIX 43x and above support
13 # - gcc + threads support
18 # - use nm in AIX 43x and above
19 # - gcc + threads now builds
20 # [(added support for socks) Jul 99 SOCKS support rewritten]
24 # - shared libperl support is tricky. if ever libperl.a ends up
25 # in /usr/local/lib/* it can override any subsequent builds of
26 # that same perl release. to make sure you know where the shared
27 # libperl.a is coming from do a 'dump -Hv perl' and check all the
28 # library search paths in the loader header.
30 # it would be nice to warn the user if a libperl.a exists that is
31 # going to override the current build, but that would be complex.
33 # better yet, a solid fix for this situation should be developed.
36 # Configure finds setrgid and setruid, but they're useless. The man
38 # setrgid: The EPERM error code is always returned.
39 # setruid: The EPERM error code is always returned. Processes cannot
40 # reset only their real user IDs.
46 case "$usemymalloc" in
47 '') usemymalloc='n' ;;
50 # Intuiting the existence of system calls under AIX is difficult,
51 # at best; the safest technique is to find them empirically.
53 # AIX 4.3.* and above default to using nm for symbol extraction
64 # AIX itself uses .o (libc.o) but we prefer compatibility
65 # with the rest of the world and with rest of the scripting
66 # languages (Tcl, Python) and related systems (SWIG).
67 # Stephanie Beals <bealzy@us.ibm.com>
70 # Trying to set this breaks the POSIX.c compilation
72 # Make setsockopt work correctly. See man page.
75 # uname -m output is too specific and not appropriate here
77 '') archname="$osname" ;;
82 ccflags="$ccflags -D_ALL_SOURCE"
84 *) # These hints at least work for 4.x, possibly other systems too.
85 ccflags="$ccflags -D_ALL_SOURCE -D_ANSI_C_SOURCE -D_POSIX_SOURCE"
88 *) ccflags="$ccflags -qmaxmem=16384" ;;
94 # These functions don't work like Perl expects them to.
98 # Changes for dynamic linking by Wayne Scott <wscott@ichips.intel.com>
100 # Tell perl which symbols to export for dynamic linking.
102 *gcc*) ccdlflags='-Xlinker' ;;
104 # the required -bE:$installarchlib/CORE/perl.exp is added by
105 # libperl.U (Configure) later.
107 case "$ldlibpthname" in
108 '') ldlibpthname=LIBPATH ;;
111 # The first 3 options would not be needed if dynamic libs. could be linked
112 # with the compiler instead of ld.
113 # -bI:$(PERL_INC)/perl.exp Read the exported symbols from the perl binary
114 # -bE:$(BASEEXT).exp Export these symbols. This file contains only one
115 # symbol: boot_$(EXP) can it be auto-generated?
118 lddlflags="$lddlflags -H512 -T512 -bhalt:4 -bM:SRE -bI:$(PERL_INC)/perl.exp -bE:$(BASEEXT).exp -e _nostart -lc"
121 lddlflags="$lddlflags -bhalt:4 -bM:SRE -bI:$(PERL_INC)/perl.exp -bE:$(BASEEXT).exp -b noentry -lc"
125 # This script UU/usethreads.cbu will get 'called-back' by Configure
126 # after it has prompted the user for whether to use threads.
127 cat > UU/usethreads.cbu <<'EOCBU'
128 case "$usethreads" in
130 ccflags="$ccflags -DNEED_PTHREAD_INIT"
135 echo >&4 "Switching cc to cc_r because of POSIX threads."
136 # xlc_r has been known to produce buggy code in AIX 4.3.2.
137 # (e.g. pragma/overload core dumps) Let's suspect xlC_r, too.
140 if test ! -e /bin/cc_r; then
142 For pthreads you should use the AIX C compiler cc_r.
143 But I cannot find it as /bin/cc_r.
144 Cannot continue, aborting.
153 For pthreads you should use the AIX C compiler cc_r.
154 (now your compiler was set to '$cc')
155 Cannot continue, aborting.
162 set `echo X "$libswanted "| sed -e 's/ \([cC]\) / \1_r /g'`
166 set `echo X "$lddlflags "| sed -e 's/ \(-l[cC]\) / \1_r /g'`
170 # Insert pthreads to libswanted, before any libc or libC.
171 set `echo X "$libswanted "| sed -e 's/ \([cC]\) / pthreads \1 /'`
174 # Insert pthreads to lddlflags, before any libc or libC.
175 set `echo X "$lddlflags " | sed -e 's/ \(-l[cC]\) / -lpthreads \1 /'`
183 # This script UU/use64bits.cbu will get 'called-back' by Configure
184 # after it has prompted the user for whether to use 64 bits.
185 cat > UU/use64bits.cbu <<'EOCBU'
191 AIX `oslevel` does not support 64-bit interfaces.
192 You should upgrade to at least AIX 4.2.
197 ccflags="$ccflags -DUSE_LONG_LONG"
198 ccflags="$ccflags `getconf XBS5_ILP32_OFFBIG_CFLAGS 2>/dev/null`"
200 ldflags="$ldflags `getconf XBS5_ILP32_OFFBIG_LDFLAGS 2>/dev/null`"
201 # _Somehow_ in AIX 4.3.1.0 the above getconf call manages to
202 # insert(?) *something* to $ldflags so that later (in Configure) evaluating
203 # $ldflags causes a newline after the '-b64' (the result of the getconf).
204 # (nothing strange shows up in $ldflags even in hexdump;
205 # so it may be something in the shell, instead?)
206 # Try it out: just uncomment the below line and rerun Configure:
207 # echo >&4 "AIX 4.3.1.0 $ldflags mystery" ; exit 1
208 # Just don't ask me how AIX does it.
209 # Therefore the line re-evaluating ldflags: it seems to bypass
210 # the whatever it was that AIX managed to break. --jhi
211 ldflags="`echo $ldflags`"
213 libswanted="$libswanted `getconf XBS5_ILP32_OFFBIG_LIBS 2>/dev/null|sed -e 's@^-l@@' -e 's@ -l@ @g'`"
214 # When a 64-bit cc becomes available $archname64
215 # may need setting so that $archname gets it attached.
220 # This script UU/uselongdouble.cbu will get 'called-back' by Configure
221 # after it has prompted the user for whether to use long doubles.
222 cat > UU/uselongdouble.cbu <<'EOCBU'
223 case "$uselongdouble" in
225 ccflags="$ccflags -qlongdouble"
226 # The explicit cc128, xlc128, xlC128 are not needed,
227 # the -qlongdouble should do the trick. --jhi
232 # If the C++ libraries, libC and libC_r, are available we will prefer them
233 # over the vanilla libc, because the libC contain loadAndInit() and
234 # terminateAndUnload() which work correctly with C++ statics while libc
235 # load() and unload() do not. See ext/DynaLoader/dl_aix.xs.
236 # The C-to-C_r switch is done by usethreads.cbu, if needed.
237 if test -f /lib/libC.a -a X"`$cc -v 2>&1 | grep gcc`" = X; then
239 set `echo X "$libswanted "| sed -e 's/ c / C c /'`
243 set `echo X "$lddlflags "| sed -e 's/ -lc / -lC -lc /'`