libtool-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

libtool 1.3.5 patches for AIX -- ltconfig.in.patch


From: mcnichol
Subject: libtool 1.3.5 patches for AIX -- ltconfig.in.patch
Date: Wed, 13 Dec 2000 15:19:52 -0600

--- ltconfig.in.orig    Mon Oct 30 17:25:09 2000
+++ ltconfig.in Wed Dec  6 16:03:56 2000
@@ -703,9 +703,14 @@
 else
   # PORTME Check for PIC flags for the system compiler.
   case "$host_os" in
-  aix3* | aix4*)
+  aix3* | aix4* | aix5*)
     # All AIX code is PIC.
-    link_static_flag='-bnso -bI:/lib/syscalls.exp'
+    if test "$host_cpu" = ia64; then
+      # AIX 5 now supports IA64 processor
+      link_static_flag='-Bstatic'
+    else
+      link_static_flag='-bnso -bI:/lib/syscalls.exp'
+    fi
     ;;
 
   hpux9* | hpux10* | hpux11*)
@@ -1122,8 +1127,9 @@
 
   # See if GNU ld supports shared libraries.
   case "$host_os" in
-  aix3* | aix4*)
+  aix3* | aix4* | aix5*)
     # On AIX, the GNU linker is very broken
+    # Note:Check GNU linker on AIX 5-IA64 when/if it becomes available.
     ld_shlibs=no
     cat <<EOF 1>&2
 
@@ -1283,38 +1289,77 @@
     fi
     ;;
 
-  aix4*)
-    hardcode_libdir_flag_spec='${wl}-b ${wl}nolibpath ${wl}-b 
${wl}libpath:$libdir:/usr/lib:/lib'
+  aix4* | aix5*)
     hardcode_libdir_separator=':'
     if test "$with_gcc" = yes; then
       collect2name=`${CC} -print-prog-name=collect2`
       if test -f "$collect2name" && \
-        strings "$collect2name" | grep resolve_lib_name >/dev/null
+        strings "$collect2name" | grep resolve_lib_name >/dev/null
       then
-       # We have reworked collect2
-       hardcode_direct=yes
+        # We have reworked collect2
+        hardcode_direct=yes
       else
-       # We have old collect2
-       hardcode_direct=unsupported
-       # It fails to find uninstalled libraries when the uninstalled
-       # path is not listed in the libpath.  Setting hardcode_minus_L
-       # to unsupported forces relinking
-       hardcode_minus_L=yes
-       hardcode_libdir_flag_spec='-L$libdir'
-       hardcode_libdir_separator=
+        # We have old collect2
+        hardcode_direct=unsupported
+        # It fails to find uninstalled libraries when the uninstalled
+        # path is not listed in the libpath.  Setting hardcode_minus_L
+        # to unsupported forces relinking
+        hardcode_minus_L=yes
+        hardcode_libdir_flag_spec='-L$libdir'
+        hardcode_libdir_separator=
       fi
       shared_flag='-shared'
     else
-      shared_flag='${wl}-bM:SRE'
+      if test "$host_cpu" = ia64; then
+        shared_flag='${wl}-G'
+      else
+        shared_flag='${wl}-bM:SRE'
+      fi
       hardcode_direct=yes
     fi
-    allow_undefined_flag=' ${wl}-berok'
-    archive_cmds="\$CC $shared_flag"' -o $objdir/$soname $libobjs $deplibs 
$linkopts ${wl}-bexpall ${wl}-bnoentry${allow_undefined_flag}'
-    archive_expsym_cmds="\$CC $shared_flag"' -o $objdir/$soname $libobjs 
$deplibs $linkopts ${wl}-bE:$export_symbols 
${wl}-bnoentry${allow_undefined_flag}'
-    case "$host_os" in aix4.[01]|aix4.[01].*)
-      # According to Greg Wooledge, -bexpall is only supported from AIX 4.2 on
-      always_export_symbols=yes ;;
-    esac
+
+    if test "$host_cpu" = ia64; then
+      # On IA64, the linker does run time linking by default, so we don't
+      # have to do anything special.
+      aix_use_runtimelinking=no
+      exp_sym_flag='-Bexport'
+      no_entry_flag=""
+    else
+      # Test if we are trying to use run time linking, or normal AIX style 
linking.
+      # If -brtl is somewhere in LDFLAGS, we need to do run time linking.
+      aix_use_runtimelinking=no
+      for ld_flag in $LDFLAGS; do
+        if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl" ); then
+          aix_use_runtimelinking=yes
+          break
+        fi
+      done
+      exp_sym_flag='-bexport'
+      no_entry_flag='${wl}-bnoentry'
+    fi
+    # It seems that -bexpall can do strange things, so it is better to
+    # generate a list of symbols to export.
+    always_export_symbols=yes
+    hardcode_libdir_flag_spec='${wl}-bnolibpath 
${wl}-blibpath:$libdir:/usr/lib:/lib'
+    if test "$aix_use_runtimelinking" = yes; then
+      hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:/usr/lib:/lib'
+      allow_undefined_flag=' -Wl,-G'
+      archive_expsym_cmds="\$CC $shared_flag"' -o $objdir/$soname $libobjs 
$deplibs $linkopts ${allow_undefined_flag} $no_entry_flag 
'"\${wl}$exp_sym_flag:\$export_symbols"
+    else
+      if test "$host_cpu" = ia64; then
+        hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
+        allow_undefined_flag="-z nodefs"
+        archive_expsym_cmds="\$CC $shared_flag"' -o $objdir/$soname $libobjs 
$deplibs $linkopts ${wl}${allow_undefined_flag} $no_entry_flag 
'"\${wl}$exp_sym_flag:\$export_symbols"
+      else
+        hardcode_libdir_flag_spec='${wl}-bnolibpath 
${wl}-blibpath:$libdir:/usr/lib:/lib'
+        # Warning - without using the other run time loading flags, -berok will
+        #           link without error, but may produce a broken library.
+        allow_undefined_flag="-berok"
+        # This is a bit strange, but is similar to how AIX traditionally builds
+        # it's shared libraries.
+        archive_expsym_cmds="\$CC $shared_flag"' -o $objdir/shr$versuffix.o 
$libobjs $deplibs $linkopts ${wl}${allow_undefined_flag} $no_entry_flag 
'"\${wl}$exp_sym_flag:\$export_symbols"' ~$AR -crlo $objdir/$soname 
$objdir/shr$versuffix.o'
+      fi
+    fi
    ;;
 
   amigaos*)
@@ -1829,16 +1874,30 @@
   soname_spec='${libname}${release}.so$major'
   ;;
 
-aix4*)
+aix4* | aix5*)
   version_type=linux
-  # AIX has no versioning support, so currently we can not hardcode correct
+  if test "$host_cpu" = ia64; then
+    # AIX 5 supports IA64
+    library_names_spec='${libname}${release}.so$versuffix 
${libname}${release}.so$major $libname.so'
+    shlibpath_var=LD_LIBRARY_PATH
+  else
+  # AIX (on Power*) has no versioning support, so currently we can not 
hardcode correct
   # soname into executable. Probably we can add versioning support to
   # collect2, so additional links can be useful in future.
   # We preserve .a as extension for shared libraries though AIX4.2
   # and later linker supports .so
-  library_names_spec='${libname}${release}.so$versuffix 
${libname}${release}.so$major $libname.a'
-  shlibpath_var=LIBPATH
-  deplibs_check_method=pass_all
+    if test "$aix_use_runtimelinking" = yes; then
+      # If using run time linking (on AIX 4.2 or later) use lib<name>.so 
instead of
+      # lib<name>.a to let people know that these are not typical AIX shared 
libraries.
+      library_names_spec='${libname}${release}.so$versuffix 
${libname}${release}.so$major $libname.so'
+    else
+      # We preserve .a as extension for shared libraries though AIX4.2
+      # and later when we are not doing run time linking.
+      library_names_spec='$libname.a'
+    fi
+    shlibpath_var=LIBPATH
+    deplibs_check_method=pass_all
+  fi
   ;;
 
 amigaos*)
@@ -2216,7 +2275,7 @@
   fi
   ;;
 
-aix4*)
+aix4* | aix5*)
   test "$enable_shared" = yes && enable_static=no
   ;;
 esac



reply via email to

[Prev in Thread] Current Thread [Next in Thread]