about summary refs log tree commit diff
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2009-05-16 12:13:00 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2009-05-16 12:13:00 +0000
commit9169cd747f81bf1053e4d230ef1efdfd5aedb642 (patch)
tree042385167b79b0696dc3ac553bd9c1f63aeb691d
parent49db32f2b55d0589c60d6408db002c1ad6bbb5d8 (diff)
downloadzsh-9169cd747f81bf1053e4d230ef1efdfd5aedb642.tar.gz
zsh-9169cd747f81bf1053e4d230ef1efdfd5aedb642.tar.xz
zsh-9169cd747f81bf1053e4d230ef1efdfd5aedb642.zip
Paul Ackersviller: 26962: updated HP-UX dynamic linking
-rw-r--r--ChangeLog7
-rw-r--r--INSTALL12
-rw-r--r--MACHINES12
-rw-r--r--Src/module.c4
-rw-r--r--aczsh.m412
-rw-r--r--configure.ac13
6 files changed, 35 insertions, 25 deletions
diff --git a/ChangeLog b/ChangeLog
index 99771bbff..05ec1be24 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2009-05-16  Peter Stephenson  <p.w.stephenson@ntlworld.com>
+
+	* Paul Ackersviller: 26962: configure.ac, aczsh.m4,
+	Src/module.c, MACHINES, INSTALL: updated HP-UX dynamic linking.
+
 2009-05-13  Peter Stephenson  <pws@csr.com>
 
 	* users/14118: Functions/Prompts/prompt_special_chars: fix test
@@ -11711,5 +11716,5 @@
 
 *****************************************************
 * This is used by the shell to define $ZSH_PATCHLEVEL
-* $Revision: 1.4686 $
+* $Revision: 1.4687 $
 *****************************************************
diff --git a/INSTALL b/INSTALL
index 55c51aa3b..19d788871 100644
--- a/INSTALL
+++ b/INSTALL
@@ -325,12 +325,12 @@ shell needs to provide output to the terminal.  The most common have been
 termcap, which is now largely outmoded, and curses, which supersedes
 termcap and typically contains the same features as well as others.
 configure will search for an appropriate library; the default search order
-is "ncursesw tinfo termcap ncurses curses" except on HP-UX and Solaris
-where it is "Hcurses ncursesw ncurses curses termcap".  Note that even
-though termcap is searched before traditional forms of curses zsh tries to
-make features from curses available and if the curses library contains both
-curses and termcap features, as is normal, the curses variant is used.
-ncurses is a newer version of curses and tinfo is related to it.
+is "ncursesw tinfo termcap ncurses curses" except on HP-UX ("Hcurses ncursesw
+ncurses curses termcap") and Solaris ("ncursesw ncurses curses termcap").
+Note that even though termcap is searched before traditional forms of curses
+zsh tries to make features from curses available and if the curses library
+contains both curses and termcap features, as is normal, the curses variant
+is used.  ncurses is a newer version of curses and tinfo is related to it.
 
 The library ncursesw is a variant of ncurses that supports wide characters.
 zsh attempts to use this to provide functions needed by the zsh/curses
diff --git a/MACHINES b/MACHINES
index 81d26b888..8f3abee38 100644
--- a/MACHINES
+++ b/MACHINES
@@ -94,11 +94,13 @@ HP: HP-UX 9, 10.20, 11.x (PA-RISC, Itanium)
 	  have been found to stop functioning.  One suggested fix is
 	  to alter the way the curses library is linked in the Makefile.
 	  Replacing `-lcurses' with `-lHcurses -lcurses' in the libraries
-	  is reported to fix.  An attempt to fix this in configure
-	  is apparently ineffective; more information would be appreciated
-	  as the maintainers do not have access to an HP-UX system.
-	  Recent reports indicated this is not necessary on recent versions
-	  of HP-UX 11.
+	  is reported to fix this on 11.0, but is no longer necessary on
+	  more recent versions of HP-UX 11, i.e. 11.11+.
+
+	  Typical gcc installations on HP-UX use HP's linker rather than
+	  the GNU one.  Configure will fail to set up dynamic linking in
+	  this situation.  The following should allow building of modules:
+	    DLLD=/usr/ccs/bin/ld DLLDFLAGS=-b DLCFLAGS=-fpic ./configure ...
 
 	  Compiling with gcc 2.7.1 is known to fail with header file
 	  conflicts.  Use the HP ANSI C compiler.
diff --git a/Src/module.c b/Src/module.c
index 8e5586e6d..4f71153b7 100644
--- a/Src/module.c
+++ b/Src/module.c
@@ -1480,7 +1480,7 @@ load_and_bind(const char *fn)
 #else
 
 #ifdef HAVE_DLFCN_H
-# if defined(HAVE_DL_H) && defined(HPUXDYNAMIC)
+# if defined(HAVE_DL_H) && defined(HPUX10DYNAMIC)
 #  include <dl.h>
 # else
 #  include <dlfcn.h>
@@ -1498,7 +1498,7 @@ load_and_bind(const char *fn)
 #endif
 
 /**/
-#ifdef HPUXDYNAMIC
+#ifdef HPUX10DYNAMIC
 # define dlopen(file,mode) (void *)shl_load((file), (mode), (long) 0)
 # define dlclose(handle) shl_unload((shl_t)(handle))
 
diff --git a/aczsh.m4 b/aczsh.m4
index c36276131..0219ae2fb 100644
--- a/aczsh.m4
+++ b/aczsh.m4
@@ -118,7 +118,7 @@ AC_TRY_COMMAND($DLLD -o conftest1.$DL_EXT $LDFLAGS $DLLDFLAGS conftest1.o $LIBS
 AC_TRY_COMMAND($CC -c $CFLAGS $CPPFLAGS $DLCFLAGS conftest2.c 1>&AC_FD_CC) &&
 AC_TRY_COMMAND($DLLD -o conftest2.$DL_EXT $LDFLAGS $DLLDFLAGS conftest2.o $LIBS 1>&AC_FD_CC); then
     AC_TRY_RUN([
-#ifdef HPUXDYNAMIC
+#ifdef HPUX10DYNAMIC
 #include <dl.h>
 #define RTLD_LAZY BIND_DEFERRED
 #define RTLD_GLOBAL DYNAMIC_PATH
@@ -199,7 +199,7 @@ AC_TRY_COMMAND($DLLD -o conftest1.$DL_EXT $LDFLAGS $DLLDFLAGS conftest1.o $LIBS
 AC_TRY_COMMAND($CC -c $CFLAGS $CPPFLAGS $DLCFLAGS conftest2.c 1>&AC_FD_CC) &&
 AC_TRY_COMMAND($DLLD -o conftest2.$DL_EXT $LDFLAGS $DLLDFLAGS conftest2.o $LIBS 1>&AC_FD_CC); then
     AC_TRY_RUN([
-#ifdef HPUXDYNAMIC
+#ifdef HPUX10DYNAMIC
 #include <dl.h>
 #define RTLD_LAZY BIND_DEFERRED
 #define RTLD_GLOBAL DYNAMIC_PATH
@@ -274,7 +274,7 @@ AC_TRY_COMMAND($DLLD -o conftest1.$DL_EXT $LDFLAGS $DLLDFLAGS conftest1.o $LIBS
 AC_TRY_COMMAND($CC -c $CFLAGS $CPPFLAGS $DLCFLAGS conftest2.c 1>&AC_FD_CC) &&
 AC_TRY_COMMAND($DLLD -o conftest2.$DL_EXT $LDFLAGS $DLLDFLAGS conftest2.o $LIBS 1>&AC_FD_CC); then
     AC_TRY_RUN([
-#ifdef HPUXDYNAMIC
+#ifdef HPUX10DYNAMIC
 #include <dl.h>
 #define RTLD_LAZY BIND_DEFERRED
 #define RTLD_GLOBAL DYNAMIC_PATH
@@ -343,7 +343,7 @@ AC_TRY_COMMAND($DLLD -o conftest1.$DL_EXT $LDFLAGS $DLLDFLAGS conftest1.o $LIBS
     save_ldflags=$LDFLAGS
     LDFLAGS="$LDFLAGS $EXTRA_LDFLAGS"
     AC_TRY_RUN([
-#ifdef HPUXDYNAMIC
+#ifdef HPUX10DYNAMIC
 #include <dl.h>
 #define RTLD_LAZY BIND_DEFERRED
 #define RTLD_GLOBAL DYNAMIC_PATH
@@ -416,7 +416,7 @@ elif
     save_ldflags=$LDFLAGS
     LDFLAGS="$LDFLAGS $EXTRA_LDFLAGS -s"
     AC_TRY_RUN([
-#ifdef HPUXDYNAMIC
+#ifdef HPUX10DYNAMIC
 #include <dl.h>
 #define RTLD_LAZY BIND_DEFERRED
 #define RTLD_GLOBAL DYNAMIC_PATH
@@ -483,7 +483,7 @@ echo 'int fred () { return 42; }' > conftest1.c
 if AC_TRY_COMMAND($CC -c $CFLAGS $CPPFLAGS $DLCFLAGS conftest1.c 1>&AC_FD_CC) &&
 AC_TRY_COMMAND($DLLD -o conftest1.$DL_EXT $LDFLAGS $DLLDFLAGS -s conftest1.o $LIBS 1>&AC_FD_CC); then
     AC_TRY_RUN([
-#ifdef HPUXDYNAMIC
+#ifdef HPUX10DYNAMIC
 #include <dl.h>
 #define RTLD_LAZY BIND_DEFERRED
 #define RTLD_GLOBAL DYNAMIC_PATH
diff --git a/configure.ac b/configure.ac
index b238cfa12..b22205dcc 100644
--- a/configure.ac
+++ b/configure.ac
@@ -669,7 +669,7 @@ dnl Prefer BSD termcap library to SysV curses library, except on certain
 dnl SYSV-derived systems.  However, if we find terminfo and termcap
 dnl stuff in the same library we will use that; typically this
 dnl is ncurses or curses.
-dnl On HPUX, Hcurses is reported to work better than curses.
+dnl On pre-11.11 HPUX, Hcurses is reported to work better than curses.
 dnl Prefer ncurses to curses on all systems.  tinfo isn't very common now.
 AC_ARG_WITH(term-lib,
 AC_HELP_STRING([--with-term-lib=LIBS], [search space-separated LIBS for terminal handling]),
@@ -680,7 +680,10 @@ else
   termcap_curses_order="$ncursesw_test tinfo termcap $ncurses_test curses"
 fi],
 [case "$host_os" in
-  hpux10.*|hpux11.*|solaris*)
+  solaris*)
+   termcap_curses_order="$ncursesw_test $ncurses_test curses termcap" ;;
+  hpux10.*|hpux11.*)
+   DL_EXT="${DL_EXT=sl}"
    termcap_curses_order="Hcurses $ncursesw_test $ncurses_test curses termcap" ;;
   *)
    termcap_curses_order="$ncursesw_test tinfo termcap $ncurses_test curses" ;;
@@ -2434,7 +2437,7 @@ fi
 dnl ---------------
 dnl dynamic loading
 dnl ---------------
-AH_TEMPLATE([HPUXDYNAMIC],
+AH_TEMPLATE([HPUX10DYNAMIC],
 [Define to 1 if you want to use dynamically loaded modules on HPUX 10.])
 L=N
 INSTLIB="install.bin-\$(L)"
@@ -2467,7 +2470,7 @@ elif test "$ac_cv_func_dlopen"  != yes ||
     dnl going into a header, and we can't undefine anything, so
     dnl just define this anyway and rely on the later tests to
     dnl define DYNAMIC or not.
-    AC_DEFINE(HPUXDYNAMIC)dnl
+    AC_DEFINE(HPUX10DYNAMIC)dnl
   fi
 fi
 
@@ -2677,7 +2680,7 @@ EOM
     AC_TRY_COMMAND($DLLD $LDFLAGS $DLLDFLAGS -o conftest.$DL_EXT conftest.o 1>&AC_FD_CC) &&
     AC_TRY_RUN([
 #include <stdio.h>
-#ifdef HPUXDYNAMIC
+#ifdef HPUX10DYNAMIC
 #include <dl.h>
 #define RTLD_LAZY BIND_DEFERRED
 #define RTLD_GLOBAL DYNAMIC_PATH