define USE_SHARED_LIBS and USE_STATIC_LIBS in the top-level
authoraland <aland>
Wed, 22 Nov 2000 17:12:15 +0000 (17:12 +0000)
committeraland <aland>
Wed, 22 Nov 2000 17:12:15 +0000 (17:12 +0000)
Make.inc file.  Update 'configure.in' to substitute them,
from the 'configure' --enable-shared and --enable-static defaults.

Update the modules rules so that the static/dynamic rules only
apply of the top-level 'USE_FOO_LIBS' is defined to 'yes'.

We still don't know how to pick up libltdl knowledge about the
*ability* to build static/dynamic objects... but that's for later,
I guess.

Make.inc.in
configure.in
src/modules/Makefile
src/modules/rules.mak

index af1f0fe..a6a5421 100644 (file)
@@ -48,3 +48,6 @@ RADIR         = @radacctdir@
 
 LIBLTDL                = @LIBLTDL@
 INCLTDL                = @INCLTDL@
+
+USE_SHARED_LIBS        = @USE_SHARED_LIBS@
+USER_STATIC_LIBS = @USE_STATIC_LIBS@
index 5d0398a..822814a 100644 (file)
@@ -586,6 +586,11 @@ dnl #  Substitute whatever libraries we found to be necessary
 dnl #
 AC_SUBST(LIBS)
 
+USE_SHARED_LIBS=$enable_shared
+AC_SUBST(USE_SHARED_LIBS)
+USE_STATIC_LIBS=$enable_static
+AC_SUBST(USE_STATIC_LIBS)
+
 AC_OUTPUT(\
        ./Make.inc \
        ./src/include/build-radpaths-h \
index 4a23fd2..fe934c8 100644 (file)
@@ -18,10 +18,10 @@ all:
        @$(MAKE) $(MFLAGS) WHAT_TO_MAKE=$@ common
 
 static:
-       @$(MAKE) $(MFLAGS) WHAT_TO_MAKE=$@ common
+       @[$$USE_STATIC_LIBS = "yes" ] && $(MAKE) $(MFLAGS) WHAT_TO_MAKE=$@ common
 
 dynamic:
-       @$(MAKE) $(MFLAGS) WHAT_TO_MAKE=$@ common
+       @[$$USE_SHARED_LIBS = "yes" ] && $(MAKE) $(MFLAGS) WHAT_TO_MAKE=$@ common
 
 install:
        $(INSTALL) -d -m 755 $(libdir)
index 472c580..3c7c053 100644 (file)
@@ -85,11 +85,19 @@ $(TARGET).la: $(DYNAMIC_OBJS)
 # a level, to the 'src/modules' directory, for general consumption.
 #
 #######################################################################
+ifeq ($(USE_STATIC_LIBS),yes)
 static: $(TARGET).a
        @cp $< ../lib
+else
+static:
+endif
 
+ifeq ($(USE_SHARED_LIBS),yes)
 dynamic: $(TARGET).la
        @cp $< ../lib
+else
+dynamic:
+endif
 
 #######################################################################
 #