Return-Path: Delivered-To: apache-cvs-archive@hyperreal.org Received: (qmail 22005 invoked by uid 6000); 12 Apr 1998 15:49:31 -0000 Received: (qmail 21998 invoked by alias); 12 Apr 1998 15:49:29 -0000 Delivered-To: apache-1.3-cvs@hyperreal.org Received: (qmail 21996 invoked by uid 168); 12 Apr 1998 15:49:29 -0000 Date: 12 Apr 1998 15:49:29 -0000 Message-ID: <19980412154929.21995.qmail@hyperreal.org> From: rse@hyperreal.org To: apache-1.3-cvs@hyperreal.org Subject: cvs commit: apache-1.3/src/os/unix os.c os.h Sender: apache-cvs-owner@apache.org Precedence: bulk Reply-To: new-httpd@apache.org rse 98/04/12 08:49:28 Modified: . STATUS src CHANGES Configuration.tmpl Configure src/os/unix os.c os.h Log: Although I though we have no chance under HP/UX for using shared objects I today figured out that their proprietary shl_xxx system calls are very close to the dlopen-style interface. And because our os/unix/ stuff already provides an abstraction layer we now can provide DSO support for HP/UX by emulating the dlopen-style interface while not changing anything inside mod_so ;-) Revision Changes Path 1.293 +1 -0 apache-1.3/STATUS Index: STATUS =================================================================== RCS file: /export/home/cvs/apache-1.3/STATUS,v retrieving revision 1.292 retrieving revision 1.293 diff -u -r1.292 -r1.293 --- STATUS 1998/04/11 15:46:29 1.292 +++ STATUS 1998/04/12 15:49:24 1.293 @@ -178,6 +178,7 @@ * Ralf's and Martin's DSO support for all SVR4-derivate Unix platforms * THE BIG SYMBOL RENAMING * Ralf's DSO configuration updates for the UnixWare platform + * Ralf's DSO support for the HP/UX platform by emulating dlopen Available Patches: 1.767 +4 -0 apache-1.3/src/CHANGES Index: CHANGES =================================================================== RCS file: /export/home/cvs/apache-1.3/src/CHANGES,v retrieving revision 1.766 retrieving revision 1.767 diff -u -r1.766 -r1.767 --- CHANGES 1998/04/11 15:22:03 1.766 +++ CHANGES 1998/04/12 15:49:25 1.767 @@ -1,5 +1,9 @@ Changes with Apache 1.3b6 + *) Adding DSO support for the HP/UX platform by emulating the dlopen-style + interface via the similar but proprietary HP/UX shl_xxx-style system + calls. [Ralf S. Engelschall] + *) PORT: Updated UnixWare 2.0.x and 2.1.x entries for DSO support and made APACI Makefile.tmpl "install" target more robust for sensible UnixWare Make. [Ralf S. Engelschall] 1.99 +3 -3 apache-1.3/src/Configuration.tmpl Index: Configuration.tmpl =================================================================== RCS file: /export/home/cvs/apache-1.3/src/Configuration.tmpl,v retrieving revision 1.98 retrieving revision 1.99 diff -u -r1.98 -r1.99 --- Configuration.tmpl 1998/04/10 10:34:32 1.98 +++ Configuration.tmpl 1998/04/12 15:49:26 1.99 @@ -62,11 +62,11 @@ # heavily platform-dependent. The current state is this: # # Out-of-the-box supported platforms: -# Linux, FreeBSD, Solaris, SunOS, -# IRIX, OSF1, UnixWare, SINIX, SVR4 +# Linux, FreeBSD, Solaris, SunOS, OSF1 +# IRIX, HP/UX, UnixWare, SINIX, SVR4 # # Explicitly unsupported platforms: -# HP/UX, AIX, Ultrix +# AIX, Ultrix # # For other platforms where you want to use the DSO mechanism you # first have to make sure it supports the pragmatic dlopen() 1.237 +16 -0 apache-1.3/src/Configure Index: Configure =================================================================== RCS file: /export/home/cvs/apache-1.3/src/Configure,v retrieving revision 1.236 retrieving revision 1.237 diff -u -r1.236 -r1.237 --- Configure 1998/04/11 15:22:04 1.236 +++ Configure 1998/04/12 15:49:26 1.237 @@ -858,6 +858,22 @@ LDFLAGS_SHLIB_EXPORT="" DEF_SHARED_CORE=yes ;; + *-hp-hpux9.*) + case $CC in + */gcc|gcc ) CFLAGS_SHLIB="-fpic" ;; + */cc|cc ) CFLAGS_SHLIB="+z" ;; + esac + LDFLAGS_SHLIB="-b" + LDFLAGS_SHLIB_EXPORT="-Wl,-E -Wl,-B,deferred" + ;; + *-hp-hpux10.*) + case $CC in + */gcc|gcc ) CFLAGS_SHLIB="-fpic" ;; + */cc|cc ) CFLAGS_SHLIB="+z" ;; + esac + LDFLAGS_SHLIB="-b" + LDFLAGS_SHLIB_EXPORT="-Wl,-E -Wl,-B,deferred" + ;; *) ## ok, no known explict support for shared objects ## on this platform, but we give not up immediately. 1.7 +43 -0 apache-1.3/src/os/unix/os.c Index: os.c =================================================================== RCS file: /export/home/cvs/apache-1.3/src/os/unix/os.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- os.c 1998/03/17 07:54:27 1.6 +++ os.c 1998/04/12 15:49:28 1.7 @@ -12,3 +12,46 @@ */ extern void os_is_not_here(void); void os_is_not_here(void) {} + + +#if defined(HPUX) || defined(HPUX10) + +/* + * HPUX dlopen interface-emulation + */ + +#include +#include + +void *os_dl_load(char *path) +{ + shl_t handle; + handle = shl_load(path, BIND_IMMEDIATE|BIND_VERBOSE|BIND_NOSTART, 0L); + return (void *)handle; +} + +void os_dl_unload(void *handle) +{ + shl_unload((shl_t)handle); + return; +} + +void *os_dl_sym(void *handle, char *symname) +{ + void *symaddr = NULL; + int status; + + errno = 0; + status = shl_findsym((shl_t *)&handle, symname, TYPE_PROCEDURE, &symaddr); + if (status == -1 && errno == 0) /* try TYPE_DATA instead */ + status = shl_findsym((shl_t *)&handle, symname, TYPE_DATA, &symaddr); + return (status == -1 ? NULL : symaddr); +} + +char *os_dl_error(void) +{ + return strerror(errno); +} + +#endif /* HPUX dlopen interface-emulation */ + 1.19 +9 -0 apache-1.3/src/os/unix/os.h Index: os.h =================================================================== RCS file: /export/home/cvs/apache-1.3/src/os/unix/os.h,v retrieving revision 1.18 retrieving revision 1.19 diff -u -r1.18 -r1.19 --- os.h 1998/04/11 12:01:05 1.18 +++ os.h 1998/04/12 15:49:28 1.19 @@ -116,10 +116,19 @@ # define RTLD_NOW 1 #endif +#if defined(HPUX) || defined(HPUX10) +#include #define os_dl_module_handle_type void * +void *os_dl_load(char *path); +void os_dl_unload(void *handle); +void *os_dl_sym(void *handle, char *symname); +char *os_dl_error(void); +#else +#define os_dl_module_handle_type void * #define os_dl_load(l) dlopen(l, RTLD_NOW) #define os_dl_unload(l) dlclose(l) #define os_dl_sym(h,s) dlsym(h,s) #define os_dl_error() dlerror() +#endif #endif /* !APACHE_OS_H */