diff options
author | rbb <rbb@13f79535-47bb-0310-9956-ffa450edef68> | 2000-06-01 01:01:16 +0000 |
---|---|---|
committer | rbb <rbb@13f79535-47bb-0310-9956-ffa450edef68> | 2000-06-01 01:01:16 +0000 |
commit | aa2b9e1841aab6335673d80292423b1971149243 (patch) | |
tree | f1f17de04ca92795060b4165adbd69d4b48cc5fa | |
parent | 4ae6295dae9e35054f9ff1745d6850d7612a3c71 (diff) | |
download | libapr-aa2b9e1841aab6335673d80292423b1971149243.tar.gz |
Fix building with DSO support. If any module is configured to be
compiled for shared support then APR_HAS_DSO is enabled and -ldl is
added to the LIBS variable. -ldl may need to be modified based on
platform. If no modules are designated as shared then APR_HAS_DSO is
disabled and nothing is added to LIBS. In basic testing this compiled
without errors or warnings.
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@60122 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | configure.in | 16 | ||||
-rw-r--r-- | dso/aix/dso.c | 4 | ||||
-rw-r--r-- | dso/aix/dso.h | 5 | ||||
-rw-r--r-- | dso/beos/dso.c | 3 | ||||
-rw-r--r-- | dso/beos/dso.h | 5 | ||||
-rw-r--r-- | dso/os2/dso.c | 4 | ||||
-rw-r--r-- | dso/os2/dso.h | 5 | ||||
-rw-r--r-- | dso/unix/dso.c | 4 | ||||
-rw-r--r-- | dso/unix/dso.h | 5 | ||||
-rw-r--r-- | dso/win32/dso.c | 4 | ||||
-rw-r--r-- | dso/win32/dso.h | 5 | ||||
-rw-r--r-- | include/apr.h.in | 1 | ||||
-rw-r--r-- | include/arch/aix/dso.h | 5 | ||||
-rw-r--r-- | include/arch/beos/dso.h | 5 | ||||
-rw-r--r-- | include/arch/os2/dso.h | 5 | ||||
-rw-r--r-- | include/arch/unix/dso.h | 5 | ||||
-rw-r--r-- | include/arch/win32/dso.h | 5 | ||||
-rw-r--r-- | misc/unix/errorcodes.c | 4 |
18 files changed, 89 insertions, 1 deletions
diff --git a/configure.in b/configure.in index 3c5119343..58123a7bd 100644 --- a/configure.in +++ b/configure.in @@ -317,6 +317,22 @@ AC_SUBST(ssize_t_value) AC_SUBST(ssize_t_fmt) AC_SUBST(off_t_fmt) +dnl #----------------------------- Checking for DSO support +echo $ac_n "${nl}Checking for DSO...${nl}" +AC_CACHE_CHECK([for DSO support], ac_cv_enable_dso, + [ AC_ARG_ENABLE(dso, + [ --enable-dso Enable reliable child processes ], + [ ac_cv_enable_dso=$enableval], + [ aprdso="1" ] ) ] ) + +if test "$ac_cv_enable_dso" = "no"; then + aprdso="0" +else + aprdso="1" +fi + +AC_SUBST(aprdso) + dnl #----------------------------- Checking for Threads echo $ac_n "${nl}Checking for Threads...${nl}" AC_CACHE_CHECK([for threads], ac_cv_enable_threads, diff --git a/dso/aix/dso.c b/dso/aix/dso.c index d43c8fdd9..e433985f8 100644 --- a/dso/aix/dso.c +++ b/dso/aix/dso.c @@ -87,6 +87,8 @@ #include <a.out.h> #include "dso.h" +#if APR_HAS_DSO + #undef FREAD #undef FWRITE #include <ldfcn.h> @@ -704,3 +706,5 @@ static void *findMain(void) free(buf); return ret; } + +#endif diff --git a/dso/aix/dso.h b/dso/aix/dso.h index 392a92015..ae89f9ee5 100644 --- a/dso/aix/dso.h +++ b/dso/aix/dso.h @@ -59,6 +59,9 @@ #include "apr_general.h" #include "apr_pools.h" #include "apr_dso.h" +#include "apr.h" + +#if APR_HAS_DSO void *dlopen(const char *path, int mode); void *dlsym(void *handle, const char *symbol); @@ -71,3 +74,5 @@ struct ap_dso_handle_t { }; #endif + +#endif diff --git a/dso/beos/dso.c b/dso/beos/dso.c index c63102739..acb05b58f 100644 --- a/dso/beos/dso.c +++ b/dso/beos/dso.c @@ -54,6 +54,7 @@ #include "dso.h" +#if APR_HAS_DSO ap_status_t ap_dso_init(void){ return APR_SUCCESS; @@ -97,3 +98,5 @@ ap_status_t ap_dso_sym(ap_dso_handle_sym_t *ressym, ap_dso_handle_t *handle, return APR_SUCCESS; } + +#endif diff --git a/dso/beos/dso.h b/dso/beos/dso.h index 2666d779a..27e35f87e 100644 --- a/dso/beos/dso.h +++ b/dso/beos/dso.h @@ -60,11 +60,16 @@ #include "apr_pools.h" #include "apr_errno.h" #include "apr_dso.h" +#include "apr.h" #include <kernel/image.h> +#if APR_HAS_DSO + struct ap_dso_handle_t { image_id handle; /* Handle to the DSO loaded */ ap_pool_t *cont; }; #endif + +#endif diff --git a/dso/os2/dso.c b/dso/os2/dso.c index 4f4f71d62..b95c86801 100644 --- a/dso/os2/dso.c +++ b/dso/os2/dso.c @@ -58,6 +58,8 @@ #include <stdio.h> #include <string.h> +#if APR_HAS_DSO + ap_status_t ap_dso_init() { return APR_SUCCESS; @@ -141,3 +143,5 @@ char *ap_dso_error(ap_dso_handle_t *dso, char *buffer, ap_size_t buflen) ap_cpystrn(buffer, message, buflen); return buffer; } + +#endif diff --git a/dso/os2/dso.h b/dso/os2/dso.h index 86d82f22a..b37e1a54c 100644 --- a/dso/os2/dso.h +++ b/dso/os2/dso.h @@ -62,6 +62,9 @@ #include "apr_general.h" #include "apr_pools.h" #include "apr_dso.h" +#include "apr.h" + +#if APR_HAS_DSO struct ap_dso_handle_t { ap_pool_t *cont; /* Context for returning error strings */ @@ -71,3 +74,5 @@ struct ap_dso_handle_t { }; #endif + +#endif diff --git a/dso/unix/dso.c b/dso/unix/dso.c index a62bd92f5..2ed08958a 100644 --- a/dso/unix/dso.c +++ b/dso/unix/dso.c @@ -54,6 +54,8 @@ #include "dso.h" +#if APR_HAS_DSO + ap_status_t ap_dso_init(void){ return APR_SUCCESS; } @@ -144,3 +146,5 @@ char *ap_dso_error(ap_dso_handle_t *dso, char *buffer, ap_size_t buflen) return dso->errormsg; return "No Error"; } + +#endif diff --git a/dso/unix/dso.h b/dso/unix/dso.h index 548b2121d..55e7e3246 100644 --- a/dso/unix/dso.h +++ b/dso/unix/dso.h @@ -59,6 +59,9 @@ #include "apr_general.h" #include "apr_pools.h" #include "apr_dso.h" +#include "apr.h" + +#if APR_HAS_DSO #ifdef HAVE_DLFCN_H #include <dlfcn.h> @@ -89,3 +92,5 @@ struct ap_dso_handle_t { }; #endif + +#endif diff --git a/dso/win32/dso.c b/dso/win32/dso.c index d04b6a054..33ad2717f 100644 --- a/dso/win32/dso.c +++ b/dso/win32/dso.c @@ -54,6 +54,8 @@ #include "dso.h" +#if APR_HAS_DSO + ap_status_t ap_dso_init(void){ return APR_SUCCESS; } @@ -101,3 +103,5 @@ char *ap_dso_error(ap_dso_handle_t *dso, char *buf, ap_size_t bufsize) { return ap_strerror(dso->load_error, buf, bufsize); } + +#endif diff --git a/dso/win32/dso.h b/dso/win32/dso.h index d4e0df905..73ab8b1ed 100644 --- a/dso/win32/dso.h +++ b/dso/win32/dso.h @@ -59,6 +59,9 @@ #include "apr_general.h" #include "apr_pools.h" #include "apr_dso.h" +#include "apr.h" + +#if APR_HAS_DSO struct ap_dso_handle_t { ap_pool_t *cont; @@ -67,3 +70,5 @@ struct ap_dso_handle_t { }; #endif + +#endif diff --git a/include/apr.h.in b/include/apr.h.in index e3c6dde3d..1252a0524 100644 --- a/include/apr.h.in +++ b/include/apr.h.in @@ -65,6 +65,7 @@ #define APR_HAS_RANDOM @rand@ #define APR_HAS_XLATE @iconv@ #define APR_HAS_OTHER_CHILD @oc@ +#define APR_HAS_DSO @aprdso@ /* This macro tells APR that it is safe to make a file masquerade as a * socket. This is necessary, because some platforms support poll'ing diff --git a/include/arch/aix/dso.h b/include/arch/aix/dso.h index 392a92015..ae89f9ee5 100644 --- a/include/arch/aix/dso.h +++ b/include/arch/aix/dso.h @@ -59,6 +59,9 @@ #include "apr_general.h" #include "apr_pools.h" #include "apr_dso.h" +#include "apr.h" + +#if APR_HAS_DSO void *dlopen(const char *path, int mode); void *dlsym(void *handle, const char *symbol); @@ -71,3 +74,5 @@ struct ap_dso_handle_t { }; #endif + +#endif diff --git a/include/arch/beos/dso.h b/include/arch/beos/dso.h index 2666d779a..27e35f87e 100644 --- a/include/arch/beos/dso.h +++ b/include/arch/beos/dso.h @@ -60,11 +60,16 @@ #include "apr_pools.h" #include "apr_errno.h" #include "apr_dso.h" +#include "apr.h" #include <kernel/image.h> +#if APR_HAS_DSO + struct ap_dso_handle_t { image_id handle; /* Handle to the DSO loaded */ ap_pool_t *cont; }; #endif + +#endif diff --git a/include/arch/os2/dso.h b/include/arch/os2/dso.h index 86d82f22a..b37e1a54c 100644 --- a/include/arch/os2/dso.h +++ b/include/arch/os2/dso.h @@ -62,6 +62,9 @@ #include "apr_general.h" #include "apr_pools.h" #include "apr_dso.h" +#include "apr.h" + +#if APR_HAS_DSO struct ap_dso_handle_t { ap_pool_t *cont; /* Context for returning error strings */ @@ -71,3 +74,5 @@ struct ap_dso_handle_t { }; #endif + +#endif diff --git a/include/arch/unix/dso.h b/include/arch/unix/dso.h index 548b2121d..55e7e3246 100644 --- a/include/arch/unix/dso.h +++ b/include/arch/unix/dso.h @@ -59,6 +59,9 @@ #include "apr_general.h" #include "apr_pools.h" #include "apr_dso.h" +#include "apr.h" + +#if APR_HAS_DSO #ifdef HAVE_DLFCN_H #include <dlfcn.h> @@ -89,3 +92,5 @@ struct ap_dso_handle_t { }; #endif + +#endif diff --git a/include/arch/win32/dso.h b/include/arch/win32/dso.h index d4e0df905..73ab8b1ed 100644 --- a/include/arch/win32/dso.h +++ b/include/arch/win32/dso.h @@ -59,6 +59,9 @@ #include "apr_general.h" #include "apr_pools.h" #include "apr_dso.h" +#include "apr.h" + +#if APR_HAS_DSO struct ap_dso_handle_t { ap_pool_t *cont; @@ -67,3 +70,5 @@ struct ap_dso_handle_t { }; #endif + +#endif diff --git a/misc/unix/errorcodes.c b/misc/unix/errorcodes.c index bea9264be..3af1bc56a 100644 --- a/misc/unix/errorcodes.c +++ b/misc/unix/errorcodes.c @@ -101,12 +101,14 @@ static char *apr_error_string(ap_status_t statcode) return "No thread key structure was provided and one was required."; case APR_ENOSHMAVAIL: return "No shared memory is currently available"; +#if APR_HAS_DSO case APR_EDSOOPEN: #ifdef HAVE_LIBDL return dlerror(); #else return "DSO load failed"; -#endif +#endif /* HAVE_LIBDL */ +#endif /* APR_HAS_DSO */ case APR_INCHILD: return "Your code just forked, and you are currently executing in the " |