And there was much rejoicing.
This commit does little more than change WITHOUT_LIBLTDL for WITH_LIBLTDL.
Previously, you had to specifically request WITHOUT_LIBLTDL.
Now you have to specifically request LIBLTDL.
# Don't use libtool or libltdl.
# They are a blight upon the face of the earth.
LIBLTDL :=
-INCLTDL := -DWITH_DLOPEN
-CFLAGS += -DWITHOUT_LIBLTDL
+INCLTDL :=
+CFLAGS +=
LIBTOOL := JLIBTOOL
LTDL_SUBDIRS :=
#include <freeradius-devel/radiusd.h>
#include <freeradius-devel/modules.h>
-/*
- * Using the native dlopen() API means that we don't want to use libltdl.
- */
-#ifdef WITH_DLOPEN
-#define WITHOUT_LIBLTDL
-#endif
-
-#ifndef WITHOUT_LIBLTDL
+#ifdef WITH_LIBLTDL
#ifdef WITH_SYSTEM_LTDL
#include <ltdl.h>
#else
#include "libltdl/ltdl.h"
#endif
+
+#else
+#ifndef HAVE_DLFCN_H
+#error FreeRADIUS needs either libltdl, or a working dlopen()
#endif
+#endif /* WITH_LIBLTDL */
#ifdef __cplusplus
extern "C" {
#endif
-#ifdef WITHOUT_LIBLTDL
+#ifndef WITH_LIBLTDL
typedef void *lt_dlhandle;
int lt_dlinit(void);
};
-#ifdef WITHOUT_LIBLTDL
-#ifdef WITH_DLOPEN
+#ifndef WITH_LIBLTDL
+#ifdef HAVE_DLFCN_H
#include <dlfcn.h>
#ifndef RTLD_NOW
return "Unspecified error";
}
-#endif /* WITH_DLOPEN */
-#else /* WITHOUT_LIBLTDL */
+#endif /* HAVE_DLFCN_H */
+#else /* WIT_LIBLTDL */
/*
* Solve the issues of libraries linking to other libraries
return handle;
}
#endif /* HAVE_LT_DLADVISE_INIT */
-#endif /* WITHOUT_LIBLTDL */
+#endif /* WITH_LIBLTDL */
static int virtual_server_idx(const char *name)
{
p = strrchr(module_struct, '-');
if (p) *p = '\0';
-#if defined(WITHOUT_LIBLTDL) && defined (WITH_DLOPEN) && defined(RTLD_SELF)
+#if !defined(WITH_LIBLTDL) && defined(HAVE_DLFCN_H) && defined(RTLD_SELF)
module = lt_dlsym(RTLD_SELF, module_struct);
if (module) goto open_self;
#endif
return NULL;
}
-#if defined(WITHOUT_LIBLTDL) && defined (WITH_DLOPEN) && defined(RTLD_SELF)
+#if !defined(WIT_LIBLTDL) && defined (HAVE_DLFCN_H) && defined(RTLD_SELF)
open_self:
#endif
/*
node->typename = eaptype_name;
node->type_data = NULL;
-#ifdef WITHOUT_LIBLTDL
-#ifdef WITH_DLOPEN
-#include <dlfcn.h>
-
-#ifdef RTLD_SELF
+#if !defined(WITH_LIBLTDL) && defined(HAVE_DLFCN_H) && defined(RTLD_SELF)
node->type = (EAP_TYPE *)lt_dlsym(RTLD_SELF, buffer);
if (node->type) goto open_self;
-#endif
-#endif
#endif
/* Link the loaded EAP-Type */
return -1;
}
-#if defined(WITHOUT_LIBLTDL) && defined (WITH_DLOPEN) && defined(RTLD_SELF)
+#if !defined(WITH_LIBLTDL) && defined(HAVE_DLFCN_H) && defined(RTLD_SELF)
open_self:
#endif
cf_log_module(cs, "Linked to sub-module %s", buffer);