aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README1
-rw-r--r--mk/lib.mk12
2 files changed, 11 insertions, 2 deletions
diff --git a/README b/README
index 646174e7..238af5fd 100644
--- a/README
+++ b/README
@@ -14,6 +14,7 @@ MKPAM=pam
MKPKGCONFIG=no
MKRCSYS=prefix
MKSELINUX=yes
+MKSTATICLIBS=no
MKTERMCAP=ncurses
MKTERMCAP=termcap
PKG_PREFIX=/usr/pkg
diff --git a/mk/lib.mk b/mk/lib.mk
index c7bd1aae..1cf006c4 100644
--- a/mk/lib.mk
+++ b/mk/lib.mk
@@ -8,9 +8,15 @@ SHLIB_NAME= lib${LIB}.so.${SHLIB_MAJOR}
SHLIB_LINK= lib${LIB}.so
SONAME?= ${SHLIB_NAME}
+SOBJS+= ${SRCS:.c=.So}
+
+MKSTATICLIBS?= yes
+ifeq (${MKSTATICLIBS},yes)
OBJS+= ${SRCS:.c=.o}
-SOBJS+= ${OBJS:.o=.So}
-_LIBS= lib${LIB}.a ${SHLIB_NAME}
+_LIBS+= lib${LIB}.a
+endif
+
+_LIBS+= ${SHLIB_NAME}
CLEANFILES+= ${OBJS} ${SOBJS} ${_LIBS} ${SHLIB_LINK}
@@ -39,8 +45,10 @@ ${SHLIB_NAME}: ${SOBJS}
${SOBJS} ${LDADD}
install: all
+ifeq (${MKSTATICLIBS},yes)
${INSTALL} -d ${DESTDIR}${LIBDIR}
${INSTALL} -m ${LIBMODE} lib${LIB}.a ${DESTDIR}${LIBDIR}
+endif
${INSTALL} -d ${DESTDIR}${SHLIBDIR}
${INSTALL} -m ${LIBMODE} ${SHLIB_NAME} ${DESTDIR}${SHLIBDIR}
ln -fs ${SHLIB_NAME} ${DESTDIR}${SHLIBDIR}/${SHLIB_LINK}