Index: buildsys.mk.in ================================================================== --- buildsys.mk.in +++ buildsys.mk.in @@ -100,11 +100,11 @@ .PHONY: all subdirs pre-depend depend install install-extra uninstall uninstall-extra clean distclean locales all: ${MAKE} ${MFLAGS} subdirs ${MAKE} ${MFLAGS} depend - ${MAKE} ${STATIC_LIB} ${STATIC_LIB_NOINST} ${LIB} ${LIB_NOINST} ${PLUGIN} ${PLUGIN_NOINST} ${PROG} ${PROG_NOINST} locales + ${MAKE} ${STATIC_LIB} ${STATIC_LIB_NOINST} ${STATIC_PIC_LIB} ${STATIC_PIC_LIB_NOINST} ${LIB} ${LIB_NOINST} ${PLUGIN} ${PLUGIN_NOINST} ${PROG} ${PROG_NOINST} locales subdirs: for i in ${SUBDIRS}; do \ ${DIR_ENTER}; \ ${MAKE} ${MFLAGS} || exit 1; \ @@ -149,23 +149,16 @@ else \ ${LINK_FAILED}; \ fi ${LIB} ${LIB_NOINST}: ${EXT_DEPS} ${LIB_OBJS} - case $@ in \ - *.a) \ - ${MAKE} ${MFLAGS} STATIC_LIB=${LIB} LIB= $@ || exit 1 \ - ;; \ - *) \ - ${LINK_STATUS}; \ - if ${LD} -o $@ ${LIB_OBJS} ${LIB_LDFLAGS} ${LDFLAGS} ${LIBS}; then \ - ${LINK_OK}; \ - else \ - ${LINK_FAILED}; \ - fi \ - ;; \ - esac + ${LINK_STATUS}; \ + if ${LD} -o $@ ${LIB_OBJS} ${LIB_LDFLAGS} ${LDFLAGS} ${LIBS}; then \ + ${LINK_OK}; \ + else \ + ${LINK_FAILED}; \ + fi \ ${PLUGIN} ${PLUGIN_NOINST}: ${EXT_DEPS} ${PLUGIN_OBJS} ${LINK_STATUS} if ${LD} -o $@ ${PLUGIN_OBJS} ${PLUGIN_LDFLAGS} ${LDFLAGS} ${LIBS}; then \ ${LINK_OK}; \ @@ -207,10 +200,19 @@ fi; \ for i in $$ars; do \ dir=".$$(echo $$i | sed 's/\//_/g').objs"; \ rm -fr $$dir; \ done + +${STATIC_PIC_LIB} ${STATIC_PIC_LIB_NOINST}: ${EXT_DEPS} ${LIB_OBJS} + ${LINK_STATUS} + if ${AR} cr $@ ${LIB_OBJS} && ${RANLIB} $@; then \ + ${LINK_OK}; \ + else \ + ${LINK_FAILED}; \ + rm -f $@; \ + fi locales: ${MO_FILES} .c.o: ${COMPILE_STATUS} @@ -382,11 +384,11 @@ ${COMPILE_PLUGIN_OK}; \ else \ ${COMPILE_PLUGIN_FAILED}; \ fi -install: ${LIB} ${STATIC_LIB} ${PLUGIN} ${PROG} install-extra +install: ${LIB} ${STATIC_LIB} ${STATIC_PIC_LIB} ${PLUGIN} ${PROG} install-extra for i in ${SUBDIRS}; do \ ${DIR_ENTER}; \ ${MAKE} ${MFLAGS} install || exit 1; \ ${DIR_LEAVE}; \ done @@ -398,11 +400,11 @@ else \ ${INSTALL_FAILED}; \ fi \ done - for i in ${STATIC_LIB}; do \ + for i in ${STATIC_LIB} ${STATIC_PIC_LIB}; do \ ${INSTALL_STATUS}; \ if ${MKDIR_P} ${DESTDIR}${libdir} && ${INSTALL} -m 644 $$i ${DESTDIR}${libdir}/$$i; then \ ${INSTALL_OK}; \ else \ ${INSTALL_FAILED}; \ @@ -480,11 +482,11 @@ ${DELETE_FAILED}; \ fi \ fi; \ done - for i in ${STATIC_LIB}; do \ + for i in ${STATIC_LIB} ${STATIC_PIC_LIB}; do \ if test -f ${DESTDIR}${libdir}/$$i; then \ if rm -f ${DESTDIR}${libdir}/$$i; then \ ${DELETE_OK}; \ else \ ${DELETE_FAILED}; \ @@ -563,11 +565,11 @@ ${DIR_ENTER}; \ ${MAKE} ${MFLAGS} clean || exit 1; \ ${DIR_LEAVE}; \ done - for i in ${DEPS} ${OBJS} ${LIB_OBJS} ${PLUGIN_OBJS} ${PROG} ${PROG_NOINST} ${LIB} ${LIB_NOINST} ${STATIC_LIB} ${STATIC_LIB_NOINST} ${PLUGIN} ${PLUGIN_NOINST} ${CLEAN_LIB} ${MO_FILES} ${CLEAN}; do \ + for i in ${DEPS} ${OBJS} ${LIB_OBJS} ${PLUGIN_OBJS} ${PROG} ${PROG_NOINST} ${LIB} ${LIB_NOINST} ${STATIC_LIB} ${STATIC_LIB_NOINST} ${STATIC_PIC_LIB} ${STATIC_PIC_LIB_NOINST} ${PLUGIN} ${PLUGIN_NOINST} ${CLEAN_LIB} ${MO_FILES} ${CLEAN}; do \ if test -f $$i -o -d $$i; then \ if rm -fr $$i; then \ ${DELETE_OK}; \ else \ ${DELETE_FAILED}; \