From 87ec198137fff15748f499a67d9148f998a4ad40 Mon Sep 17 00:00:00 2001 From: aland Date: Thu, 14 Oct 1999 20:47:46 +0000 Subject: [PATCH] moved HAVE_LIBDL definition to HAVE_DLOPEN. The substitution of LIBDL in Make.inc should take care of linking in '-ldl', if it's necessary for the system. --- Makefile | 6 +++--- acconfig.h | 4 ++-- configure.in | 24 ++++++++++++------------ src/include/autoconf.h.in | 4 ++-- src/main/modules.c | 20 ++++++++++---------- 5 files changed, 29 insertions(+), 29 deletions(-) diff --git a/Makefile b/Makefile index 1c85631..a5e5742 100644 --- a/Makefile +++ b/Makefile @@ -12,12 +12,12 @@ include Make.inc SUBDIRS = src raddb doc scripts WHAT_TO_MAKE = all -all: +all: config.status @$(MAKE) $(MFLAGS) WHAT_TO_MAKE=$@ common clean: @$(MAKE) $(MFLAGS) WHAT_TO_MAKE=$@ common - @rm -f *~ stamp* + @rm -f *~ install: @$(MAKE) $(MFLAGS) WHAT_TO_MAKE=$@ common @@ -46,7 +46,7 @@ configure: configure.in # autoheader might not change autoconf.h.in, so touch a stamp file src/include/autoconf.h.in: src/include/stamp-h.in -src/include/stamp-h.in: configure.in +src/include/stamp-h.in: configure.in acconfig.h autoheader echo timestamp > src/include/stamp-h.in diff --git a/acconfig.h b/acconfig.h index 047eae3..cacdfd3 100644 --- a/acconfig.h +++ b/acconfig.h @@ -17,8 +17,8 @@ config.h - created by autoconf; contains defines generated by autoconf /* Do we have socklen_t? */ #undef HAVE_SOCKLEN_T -/* Do we have libdl support? */ -#undef HAVE_LIBDL +/* Define if you have the DLOPEN function. */ +#undef HAVE_DLOPEN /* Do we want to compile in DBM support? */ #undef WITH_DBM diff --git a/configure.in b/configure.in index d0a630a..739e370 100644 --- a/configure.in +++ b/configure.in @@ -194,18 +194,6 @@ dnl AC_MSG_RESULT(" $INCLUDE") dnl AC_SUBST(INCLUDE) dnl AC_SUBST(IQUOTE) -dnl Check for libdl -dnl We use dlopen(3) which may be in libc (eg FreeBSD), or in libdl (Linux) -AC_CHECK_LIB(dl, dlopen, - LIBDL="-ldl" -) -AC_SUBST(LIBDL) -if test "$LIBDL" != ""; then - AC_DEFINE(HAVE_LIBDL) -else - AC_CHECK_FUNC(dlopen) -fi - dnl See if this is OS/2 AC_MSG_CHECKING(type of OS) OS=`uname -s` @@ -274,6 +262,18 @@ else fi CFLAGS="$OFLAGS" +dnl Check for libdl +dnl We use dlopen(3) which may be in libc (eg FreeBSD), or in libdl (Linux) +AC_CHECK_LIB(dl, dlopen, + LIBDL="-ldl" +) +AC_SUBST(LIBDL) +if test "$LIBDL" != ""; then + AC_DEFINE(HAVE_DLOPEN) +else + AC_CHECK_FUNC(dlopen) +fi + dnl Check for libcrypt dnl We use crypt(3) which may be in libc, or in libcrypt (eg FreeBSD) AC_CHECK_LIB(crypt, crypt, diff --git a/src/include/autoconf.h.in b/src/include/autoconf.h.in index 8034784..3efeb21 100644 --- a/src/include/autoconf.h.in +++ b/src/include/autoconf.h.in @@ -17,8 +17,8 @@ config.h - created by autoconf; contains defines generated by autoconf /* Do we have socklen_t? */ #undef HAVE_SOCKLEN_T -/* Do we have libdl support? */ -#undef HAVE_LIBDL +/* Define if you have the DLOPEN function. */ +#undef HAVE_DLOPEN /* Do we want to compile in DBM support? */ #undef WITH_DBM diff --git a/src/main/modules.c b/src/main/modules.c index ba93f9c..a6f1fd5 100644 --- a/src/main/modules.c +++ b/src/main/modules.c @@ -22,7 +22,7 @@ static const char rcsid[] = "$Id$"; #include "radiusd.h" #include "modules.h" -#ifndef HAVE_LIBDL +#ifndef HAVE_DLOPEN #include "modules_static.h" #endif @@ -38,7 +38,7 @@ typedef struct module_list_t { int auth_type; int flags; /* doing what, exactly? */ module_t *module; -#ifdef HAVE_LIBDL +#ifdef HAVE_DLOPEN void *handle; #endif struct module_list_t *next; @@ -75,7 +75,7 @@ static void module_list_free(void) ml = module_list; while (ml) { next = ml->next; -#ifdef HAVE_LIBDL +#ifdef HAVE_DLOPEN dlclose(ml->handle); /* ignore any errors */ #endif if (ml->module->detach) @@ -186,7 +186,7 @@ int read_modules_file(char *filename) char library[256]; char module_name[256]; int lineno = 0; -#ifdef HAVE_LIBDL +#ifdef HAVE_DLOPEN char libraryfile[1024]; void *handle; char *error; @@ -196,7 +196,7 @@ int read_modules_file(char *filename) int argc; /* for calling the modules */ char *argv[32]; -#ifndef HAVE_LIBDL +#ifndef HAVE_DLOPEN sm = NULL; #endif this = NULL; /* Shut up stupid gcc */ @@ -232,7 +232,7 @@ int read_modules_file(char *filename) this = find_module(module_list, library); if (this == NULL) { -#ifdef HAVE_LIBDL +#ifdef HAVE_DLOPEN /* * Keep the handle around so we can dlclose() it. * Also ensure that any further dependencies are exported, @@ -254,7 +254,7 @@ int read_modules_file(char *filename) filename, lineno, dlerror()); exit(1); /* FIXME */ } -#else /* HAVE_LIBDL */ +#else /* HAVE_DLOPEN */ /* * Find the module in the static module list. */ @@ -267,7 +267,7 @@ int read_modules_file(char *filename) filename, lineno); exit(1); /* FIXME */ } -#endif /* HAVE_LIBDL */ +#endif /* HAVE_DLOPEN */ /* make room for the module type */ this = (module_list_t *) malloc(sizeof(module_list_t)); @@ -279,7 +279,7 @@ int read_modules_file(char *filename) /* fill in the module structure */ this->next = NULL; -#ifdef HAVE_LIBDL +#ifdef HAVE_DLOPEN this->handle = handle; #endif strNcpy(this->filename, library, sizeof(this->filename)); @@ -293,7 +293,7 @@ int read_modules_file(char *filename) p = strchr(module_name, '.'); *p = '\0'; -#ifdef HAVE_LIBDL +#ifdef HAVE_DLOPEN this->module = dlsym(this->handle, module_name); error = dlerror(); if (!this->module || error) { -- 2.1.4