summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xconfigure25
-rw-r--r--configure.in10
-rw-r--r--include/sysconf.h.in3
-rw-r--r--lang/Makefile2
-rw-r--r--src/modules.c55
5 files changed, 22 insertions, 73 deletions
diff --git a/configure b/configure
index 5fbf7cafe..77ffd2b01 100755
--- a/configure
+++ b/configure
@@ -4191,8 +4191,6 @@ fi
-DIS_MODULES="Modules: Yes"
-
@@ -4345,23 +4343,11 @@ if test $ac_cv_lib_dl_dlopen = yes; then
ANOPELIBS="$ANOPELIBS -ldl"
-cat >>confdefs.h <<\_ACEOF
-#define USE_MODULES 1
-_ACEOF
-
- USE_MODULES="yes"
- DIS_MODULES="Modules: Yes"
-
else
-{ echo "$as_me:$LINENO: WARNING: Dynamic linking is not enabled because dlopen was not found" >&5
-echo "$as_me: WARNING: Dynamic linking is not enabled because dlopen was not found" >&2;}
-
-cat >>confdefs.h <<\_ACEOF
-#define STATIC_LINKING "NO_MODULES"
-_ACEOF
-
- DIS_MODULES="Modules: No"
+ { { echo "$as_me:$LINENO: error: \"dlopen() is required for Anope to be compiled and used. Sorry.\"" >&5
+echo "$as_me: error: \"dlopen() is required for Anope to be compiled and used. Sorry.\"" >&2;}
+ { (exit 1); exit 1; }; }
fi
@@ -4509,11 +4495,6 @@ fi
MODULEFLAGS=$ac_cv_pic
-cat >>confdefs.h <<\_ACEOF
-#define USE_MODULES 1
-_ACEOF
-
-
{ echo "$as_me:$LINENO: checking for short" >&5
echo $ECHO_N "checking for short... $ECHO_C" >&6; }
if test "${ac_cv_type_short+set}" = set; then
diff --git a/configure.in b/configure.in
index a5af8ea68..d5bce4b87 100644
--- a/configure.in
+++ b/configure.in
@@ -147,21 +147,14 @@ AC_SUBST(LDFLAGS)
AC_CHECK_HEADER(sys/types.h,AC_DEFINE(HAS_SYS_TYPES_H,1,"Has sys/types.h"))
-DIS_MODULES="Modules: Yes"
-
dnl module checking based on Unreal's module checking code
AC_DEFUN(AC_ENABLE_DYN,
[
AC_CHECK_FUNC(dlopen,, AC_CHECK_LIB(dl,dlopen,[
ANOPELIBS="$ANOPELIBS -ldl"
- AC_DEFINE(USE_MODULES,1,"Modules are available")
- USE_MODULES="yes"
- DIS_MODULES="Modules: Yes"
],
[
-AC_MSG_WARN(Dynamic linking is not enabled because dlopen was not found)
-AC_DEFINE(STATIC_LINKING,"NO_MODULES","modules not available")
- DIS_MODULES="Modules: No"
+ AC_ERROR("dlopen() is required for Anope to be compiled and used. Sorry.")
]))
hold_cflags=$CFLAGS
@@ -230,7 +223,6 @@ fi
MODULEFLAGS=$ac_cv_pic
AC_SUBST(MODULEFLAGS)
-AC_DEFINE(USE_MODULES,1,"Modules available")
])
AC_ENABLE_DYN
diff --git a/include/sysconf.h.in b/include/sysconf.h.in
index 59f900433..3086d4250 100644
--- a/include/sysconf.h.in
+++ b/include/sysconf.h.in
@@ -138,9 +138,6 @@
/* Define to 1 if you have the ANSI C header files. */
#undef STDC_HEADERS
-/* "Modules available" */
-#undef USE_MODULES
-
/* "Use Mysql" */
#undef USE_MYSQL
diff --git a/lang/Makefile b/lang/Makefile
index 9f7a9a7e0..2c6a66c89 100644
--- a/lang/Makefile
+++ b/lang/Makefile
@@ -4,7 +4,7 @@ MAKEARGS = 'CFLAGS=${CFLAGS}' 'CC=${CC}' 'ANOPELIBS=${ANOPELIBS}' \
'LDFLAGS=${LDFLAGS}' 'BINDEST=${BINDEST}' 'INSTALL=${INSTALL}' \
'INCLUDEDIR=${INCLUDEDIR}' 'RM=${RM}' 'CP=${CP}' \
'TOUCH=${TOUCH}' 'SHELL=${SHELL}' 'DATDEST=${DATDEST}' \
- 'RUNGROUP=${RUNGROUP}' 'USE_MODULES=${USE_MODULES}'
+ 'RUNGROUP=${RUNGROUP}'
LANGOBJS = cat de en_us es fr gr hun it nl pl pt ru tr
LANGSRCS = cat.l de.l en_us.l es.l fr.l gr.l hun.l it.l nl.l pl.l pt.l ru.l tr.l
diff --git a/src/modules.c b/src/modules.c
index 18bfacc57..dd1563bd9 100644
--- a/src/modules.c
+++ b/src/modules.c
@@ -16,25 +16,23 @@
#include "language.h"
#include "version.h"
-#if defined(USE_MODULES) && !defined(_WIN32)
-#include <dlfcn.h>
-/* Define these for systems without them */
-#ifndef RTLD_NOW
-#define RTLD_NOW 0
-#endif
-#ifndef RTLD_LAZY
-#define RTLD_LAZY RTLD_NOW
-#endif
-#ifndef RTLD_GLOBAL
-#define RTLD_GLOBAL 0
-#endif
-#ifndef RTLD_LOCAL
-#define RTLD_LOCAL 0
-#endif
-#endif
-
-#ifdef _WIN32
-const char *ano_moderr(void);
+#if !defined(_WIN32)
+ #include <dlfcn.h>
+ /* Define these for systems without them */
+ #ifndef RTLD_NOW
+ #define RTLD_NOW 0
+ #endif
+ #ifndef RTLD_LAZY
+ #define RTLD_LAZY RTLD_NOW
+ #endif
+ #ifndef RTLD_GLOBAL
+ #define RTLD_GLOBAL 0
+ #endif
+ #ifndef RTLD_LOCAL
+ #define RTLD_LOCAL 0
+ #endif
+#else
+ const char *ano_moderr(void);
#endif
/**
@@ -91,7 +89,6 @@ char *ModuleGetErrStr(int status)
*/
void modules_init(void)
{
-#ifdef USE_MODULES
int idx;
int ret;
Module *m;
@@ -115,7 +112,6 @@ void modules_init(void)
mod_current_user = NULL;
}
}
-#endif
}
/**
@@ -219,7 +215,6 @@ int protocol_module_init(void)
*/
void modules_delayed_init(void)
{
-#ifdef USE_MODULES
int idx;
int ret;
Module *m;
@@ -243,7 +238,6 @@ void modules_delayed_init(void)
destroyModule(m);
}
}
-#endif
}
/**
@@ -258,7 +252,6 @@ void modules_delayed_init(void)
*/
void modules_unload_all(bool fini, bool unload_proto)
{
-#ifdef USE_MODULES
int idx;
ModuleHash *mh, *next;
void (*func) (void);
@@ -293,7 +286,6 @@ void modules_unload_all(bool fini, bool unload_proto)
mh = next;
}
}
-#endif
}
/**
@@ -510,7 +502,6 @@ int encryptionModuleLoaded()
*/
int moduleCopyFile(char *name, char *output)
{
-#ifdef USE_MODULES
int ch;
FILE *source, *target;
int srcfp;
@@ -558,7 +549,6 @@ int moduleCopyFile(char *name, char *output)
if (fclose(target) != 0) {
return MOD_ERR_FILE_IO;
}
-#endif
return MOD_ERR_OK;
}
@@ -570,7 +560,6 @@ int moduleCopyFile(char *name, char *output)
*/
int loadModule(Module * m, User * u)
{
-#ifdef USE_MODULES
char buf[4096];
int len;
const char *err;
@@ -687,10 +676,6 @@ int loadModule(Module * m, User * u)
}
addModule(m);
return MOD_ERR_OK;
-
-#else
- return MOD_ERR_NOLOAD;
-#endif
}
/**
@@ -701,7 +686,6 @@ int loadModule(Module * m, User * u)
*/
int unloadModule(Module * m, User * u)
{
-#ifdef USE_MODULES
void (*func) (void);
if (!m || !m->handle) {
@@ -749,9 +733,6 @@ int unloadModule(Module * m, User * u)
delModule(m);
return MOD_ERR_OK;
}
-#else
- return MOD_ERR_NOUNLOAD;
-#endif
}
/**
@@ -2081,7 +2062,6 @@ void moduleSetHelpHelp(void (*func) (User * u))
**/
void moduleDisplayHelp(int service, User * u)
{
-#ifdef USE_MODULES
int idx;
ModuleHash *current = NULL;
Module *calling_module = mod_current_module;
@@ -2112,7 +2092,6 @@ void moduleDisplayHelp(int service, User * u)
mod_current_module = calling_module;
mod_current_module_name = calling_module_name;
-#endif
}
/**