This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
AIX patch (including Configure support for {sched,pthread}_yield,
[perl5.git] / hints / aix.sh
index 6a9e545..8869a23 100644 (file)
@@ -1,6 +1,8 @@
 # hints/aix.sh
 # AIX 3.x.x hints thanks to Wayne Scott <wscott@ichips.intel.com>
 # AIX 4.1 hints thanks to Christopher Chan-Nui <channui@austin.ibm.com>.
+# AIX 4.1 pthreading by Christopher Chan-Nui <channui@austin.ibm.com> and
+#         Jarkko Hietaniemi <jhi@iki.fi>.
 # Merged on Mon Feb  6 10:22:35 EST 1995 by
 #   Andy Dougherty  <doughera@lafcol.lafayette.edu>
 
@@ -17,6 +19,9 @@ alignbytes=8
 
 usemymalloc='n'
 
+so="a"
+dlext="so"
+
 # Make setsockopt work correctly.  See man page.
 # ccflags='-D_BSD=44'
 
@@ -71,3 +76,32 @@ lddlflags='-H512 -T512 -bhalt:4 -bM:SRE -bI:$(PERL_INC)/perl.exp -bE:$(BASEEXT).
 
 ;;
 esac
+
+if [ "X$usethreads" != "X" ]; then
+    ccflags="-DUSE_THREADS $ccflags"
+    cppflags="-DUSE_THREADS $cppflags"
+    case "$cc" in
+    xlc_r)
+       ;;
+    cc | '') 
+       cc=xlc_r
+        ;;
+    *)
+       case "$cc" in
+       gcc)
+           echo >&4 "You cannot use POSIX threads from GNU cc in AIX."
+           ;;
+       *)
+           echo >&4 "Unknown C compiler."
+           ;;
+       esac
+       echo >&4 "You should use the AIX C compiler called xlc_r."
+       echo >&4 "Cannot continue, aborting."
+       exit 1
+       ;;
+    esac
+
+    # Add the POSIX threads library and use the re-entrant libc.
+
+    lddlflags=`echo $lddlflags | sed 's/ -lc$/ -lpthreads -lc_r/'`
+fi