CORE_DEPS="$CORE_DEPS $OPENSSL/.openssl/include/openssl/ssl.h"
CORE_LIBS="$CORE_LIBS $OPENSSL/.openssl/lib/libssl.a"
CORE_LIBS="$CORE_LIBS $OPENSSL/.openssl/lib/libcrypto.a"
- CORE_LIBS="$CORE_LIBS $NGX_LIBDL"
if [ "$NGX_PLATFORM" = win32 ]; then
CORE_LIBS="$CORE_LIBS -lgdi32 -lcrypt32 -lws2_32"
if [ $ngx_found = yes ]; then
have=NGX_SSL . auto/have
CORE_INCS="$CORE_INCS $ngx_feature_path"
- CORE_LIBS="$CORE_LIBS $ngx_feature_libs $NGX_LIBDL"
+ CORE_LIBS="$CORE_LIBS $ngx_feature_libs"
OPENSSL=YES
fi
fi
src/os/unix/ngx_socket.h \
src/os/unix/ngx_os.h \
src/os/unix/ngx_user.h \
+ src/os/unix/ngx_dlopen.h \
src/os/unix/ngx_process_cycle.h"
# add to UNIX_DEPS
src/os/unix/ngx_setproctitle.c \
src/os/unix/ngx_posix_init.c \
src/os/unix/ngx_user.c \
+ src/os/unix/ngx_dlopen.c \
src/os/unix/ngx_process_cycle.c"
POSIX_DEPS=src/os/unix/ngx_posix_config.h
src/os/win32/ngx_socket.h \
src/os/win32/ngx_os.h \
src/os/win32/ngx_user.h \
+ src/os/win32/ngx_dlopen.h \
src/os/win32/ngx_process_cycle.h"
WIN32_CONFIG=src/os/win32/ngx_win32_config.h
src/os/win32/ngx_wsasend_chain.c \
src/os/win32/ngx_win32_init.c \
src/os/win32/ngx_user.c \
+ src/os/win32/ngx_dlopen.c \
src/os/win32/ngx_event_log.c \
src/os/win32/ngx_process_cycle.c \
src/event/ngx_event_acceptex.c"
ngx_feature="dlopen()"
-ngx_feature_name=
+ngx_feature_name="NGX_HAVE_DLOPEN"
ngx_feature_run=no
ngx_feature_incs="#include <dlfcn.h>"
ngx_feature_path=
. auto/feature
if [ $ngx_found = yes ]; then
- NGX_LIBDL="-ldl"
+ CORE_LIBS="$CORE_LIBS -ldl"
fi
fi
#include <ngx_shmem.h>
#include <ngx_process.h>
#include <ngx_user.h>
+#include <ngx_dlopen.h>
#include <ngx_parse.h>
#include <ngx_parse_time.h>
#include <ngx_log.h>
#include <sys/sysctl.h>
#include <xlocale.h>
+#include <dlfcn.h>
+
#ifndef IOV_MAX
#define IOV_MAX 64
--- /dev/null
+
+/*
+ * Copyright (C) Maxim Dounin
+ * Copyright (C) Nginx, Inc.
+ */
+
+
+#include <ngx_config.h>
+#include <ngx_core.h>
+
+
+#if (NGX_HAVE_DLOPEN)
+
+char *
+ngx_dlerror(void)
+{
+ char *err;
+
+ err = (char *) dlerror();
+
+ if (err == NULL) {
+ return "";
+ }
+
+ return err;
+}
+
+#endif
--- /dev/null
+
+/*
+ * Copyright (C) Maxim Dounin
+ * Copyright (C) Nginx, Inc.
+ */
+
+
+#ifndef _NGX_DLOPEN_H_INCLUDED_
+#define _NGX_DLOPEN_H_INCLUDED_
+
+
+#include <ngx_config.h>
+#include <ngx_core.h>
+
+
+#define ngx_dlopen(path) dlopen((char *) path, RTLD_NOW | RTLD_GLOBAL)
+#define ngx_dlopen_n "dlopen()"
+
+#define ngx_dlsym(handle, symbol) dlsym(handle, symbol)
+#define ngx_dlsym_n "dlsym()"
+
+#define ngx_dlclose(handle) dlclose(handle)
+#define ngx_dlclose_n "dlclose()"
+
+
+#if (NGX_HAVE_DLOPEN)
+char *ngx_dlerror(void);
+#endif
+
+
+#endif /* _NGX_DLOPEN_H_INCLUDED_ */
#include <osreldate.h>
#include <sys/sysctl.h>
+#include <dlfcn.h>
+
#if __FreeBSD_version < 400017
#include <crypt.h>
#include <sys/utsname.h> /* uname() */
+#include <dlfcn.h>
+
#include <ngx_auto_config.h>
#include <ngx_auto_config.h>
+#if (NGX_HAVE_DLOPEN)
+#include <dlfcn.h>
+#endif
+
+
#if (NGX_HAVE_POSIX_SEM)
#include <semaphore.h>
#endif
#include <inttypes.h>
#include <crypt.h>
+#include <dlfcn.h>
+
#define NGX_ALIGNMENT _MAX_ALIGNMENT
#include <ngx_auto_config.h>
--- /dev/null
+
+/*
+ * Copyright (C) Maxim Dounin
+ * Copyright (C) Nginx, Inc.
+ */
+
+
+#include <ngx_config.h>
+#include <ngx_core.h>
+
+
+char *
+ngx_dlerror(void)
+{
+ u_char *p;
+ static u_char errstr[NGX_MAX_ERROR_STR];
+
+ p = ngx_strerror(ngx_errno, errstr, NGX_MAX_ERROR_STR);
+ *p = '\0';
+
+ return (char *) errstr;
+}
--- /dev/null
+
+/*
+ * Copyright (C) Maxim Dounin
+ * Copyright (C) Nginx, Inc.
+ */
+
+
+#ifndef _NGX_DLOPEN_H_INCLUDED_
+#define _NGX_DLOPEN_H_INCLUDED_
+
+
+#include <ngx_config.h>
+#include <ngx_core.h>
+
+
+#define NGX_HAVE_DLOPEN 1
+
+
+#define ngx_dlopen(path) LoadLibrary((char *) path)
+#define ngx_dlopen_n "LoadLibrary()"
+
+#define ngx_dlsym(handle, symbol) (void *) GetProcAddress(handle, symbol)
+#define ngx_dlsym_n "GetProcAddress()"
+
+#define ngx_dlclose(handle) (FreeLibrary(handle) ? 0 : -1)
+#define ngx_dlclose_n "FreeLibrary()"
+
+
+char *ngx_dlerror(void);
+
+
+#endif /* _NGX_DLOPEN_H_INCLUDED_ */