new configure option: --with-static-modules=QUOTED-MODULE-LIST
authoraland <aland>
Wed, 22 Nov 2000 20:22:14 +0000 (20:22 +0000)
committeraland <aland>
Wed, 22 Nov 2000 20:22:14 +0000 (20:22 +0000)
        ./configure --with-static-modules="pam ns_mta_md5 sql"

        builds all shared libraries, BUT pam, ns_mta_md5, and sql are
        statically linked to the server.

If we have --disable-shared, then all of the successfully built
modules are linked to the server at build time, through an in-line
shell script in src/main/Makefile

Make.inc.in
configure.in
src/main/Makefile

index a6a5421..1216056 100644 (file)
@@ -50,4 +50,5 @@ LIBLTDL               = @LIBLTDL@
 INCLTDL                = @INCLTDL@
 
 USE_SHARED_LIBS        = @USE_SHARED_LIBS@
-USER_STATIC_LIBS = @USE_STATIC_LIBS@
+USE_STATIC_LIBS = @USE_STATIC_LIBS@
+STATIC_MODULES = @STATIC_MODULES@
index 822814a..18dc14d 100644 (file)
@@ -210,6 +210,18 @@ if test x"${enable_ltdl_install+set}" != xset; then
 fi
 AC_CONFIG_SUBDIRS(libltdl)
 
+dnl #
+dnl #  Allow the user to specify a list of modules to be linked
+dnl #  statically to the server.
+dnl #
+STATIC_MODULES=
+AC_ARG_WITH(static_modules,
+[  --with-static-modules=QUOTED-MODULE-LIST],[
+  for i in $withval; do
+    STATIC_MODULES="$STATIC_MODULES -dlpreopen ../modules/rlm_$i/rlm_$i.la"
+  done
+])
+
 dnl See what include-style is used by the make program.
 dnl AC_MSG_CHECKING(include style for make)
 dnl echo "include /dev/null" > testmake.$$
@@ -590,6 +602,7 @@ USE_SHARED_LIBS=$enable_shared
 AC_SUBST(USE_SHARED_LIBS)
 USE_STATIC_LIBS=$enable_static
 AC_SUBST(USE_STATIC_LIBS)
+AC_SUBST(STATIC_MODULES)
 
 AC_OUTPUT(\
        ./Make.inc \
index 3c7c955..458d99b 100644 (file)
@@ -13,7 +13,15 @@ INCLUDES     = ../include/radiusd.h ../include/conf.h ../include/autoconf.h
 CFLAGS         += -I../include
 LDFLAGS                += -L../lib
 LIBS           += -lradius 
-MODULE_LIBS    = 
+MODULE_LIBS    = $(STATIC_MODULES)
+
+#
+#  Not using shared libraries, add in ALL known static modules
+# at build time.
+#
+ifneq ($(USE_SHARED_LIBS),yes)
+MODULE_LIBS    += $(shell for x in ../modules/rlm_*/rlm_*.la;do echo -dlpreopen $$x;done)
+endif
 
 all:   radiusd radwho radzap raduse radclient