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.
LIBLTDL = @LIBLTDL@
INCLTDL = @INCLTDL@
+
+USE_SHARED_LIBS = @USE_SHARED_LIBS@
+USER_STATIC_LIBS = @USE_STATIC_LIBS@
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 \
@$(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)
# 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
#######################################################################
#