Index: buildsys.mk.in ================================================================== --- buildsys.mk.in +++ buildsys.mk.in @@ -1,10 +1,11 @@ # -# Copyright (c) 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014 -# Jonathan Schleifer +# Copyright (c) 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, +# 2017 +# Jonathan Schleifer # -# https://webkeks.org/git/?p=buildsys.git +# https://heap.zone/git/?p=buildsys.git # # Permission to use, copy, modify, and/or distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice is present in all copies. # @@ -43,10 +44,11 @@ ERLCFLAGS = @ERLCFLAGS@ OBJCFLAGS = @OBJCFLAGS@ OBJCXXFLAGS = @OBJCXXFLAGS@ LDFLAGS = @LDFLAGS@ LDFLAGS_RPATH = @LDFLAGS_RPATH@ +LDFLAGS_INSTALL_NAME = @LDFLAGS_INSTALL_NAME@ LIBS = @LIBS@ PYTHON_FLAGS = @PYTHON_FLAGS@ PROG_IMPLIB_NEEDED = @PROG_IMPLIB_NEEDED@ PROG_IMPLIB_LDFLAGS = @PROG_IMPLIB_LDFLAGS@ PROG_SUFFIX = @EXEEXT@ @@ -111,14 +113,14 @@ .SUFFIXES: .beam .c .c.dep .cc .cc.dep .class .cxx .cxx.dep .d .erl .lib.o .java .mo .m .m.dep .mm .mm.dep .o .plugin.o .po .py .pyc .rc .S .S.dep .xpm .PHONY: all subdirs subdirs-after pre-depend depend install install-extra uninstall uninstall-extra clean distclean locales ${SUBDIRS} ${SUBDIRS_AFTER} all: ${MAKE} pre-all - ${MAKE} ${MFLAGS} subdirs - ${MAKE} ${MFLAGS} depend + ${MAKE} subdirs + ${MAKE} depend ${MAKE} ${STATIC_LIB} ${STATIC_LIB_NOINST} ${STATIC_PIC_LIB} ${STATIC_PIC_LIB_NOINST} ${SHARED_LIB} ${SHARED_LIB_NOINST} ${PLUGIN} ${PLUGIN_NOINST} ${PROG} ${PROG_NOINST} ${JARFILE} locales - ${MAKE} ${MFLAGS} subdirs-after + ${MAKE} subdirs-after ${MAKE} post-all pre-all post-all: subdirs: ${SUBDIRS} @@ -125,20 +127,22 @@ subdirs-after: ${SUBDIRS_AFTER} ${SUBDIRS} ${SUBDIRS_AFTER}: for i in $@; do \ ${DIR_ENTER}; \ - ${MAKE} ${MFLAGS} || exit $$?; \ + ${MAKE} || exit $$?; \ ${DIR_LEAVE}; \ done depend: pre-depend ${SRCS} regen=0; \ deps=""; \ test -f .deps || regen=1; \ - for i in ${SRCS}; do \ + for i in "" ${SRCS}; do \ case $$i in \ + "") \ + ;; \ *.c) \ if test x"${CC_DEPENDS}" = x"yes"; then \ test $$i -nt .deps && regen=1; \ deps="$$deps $$i.dep"; \ fi; \ @@ -169,11 +173,11 @@ ;; \ esac; \ done; \ if test x"$$regen" = x"1" -a x"$$deps" != x""; then \ ${DEPEND_STATUS}; \ - if ${MAKE} ${MFLAGS} $$deps && cat $$deps >.deps; then \ + if ${MAKE} $$deps && cat $$deps >.deps; then \ rm -f $$deps; \ ${DEPEND_OK}; \ else \ :> .deps; \ touch -t 0001010000 .deps; \ @@ -257,11 +261,11 @@ for j in *.o; do \ objs="$$objs $$dir/$$j"; \ done; \ cd ..; \ done; \ - if ${LD} -o $@ $$objs ${LIB_LDFLAGS} ${LDFLAGS} ${LIBS}; then \ + if ${LD} -o $@ $$objs ${LIB_LDFLAGS} ${LDFLAGS_INSTALL_NAME} ${LDFLAGS} ${LIBS}; then \ ${LINK_OK}; \ else \ ${LINK_FAILED}; \ fi; \ for i in $$ars; do \ @@ -385,57 +389,57 @@ .c.o: ${COMPILE_STATUS} in="$<"; \ out="$@"; \ - if ${CC} ${CFLAGS} ${CPPFLAGS} -c -o $@ $<; then \ + if ${CC} ${CFLAGS} ${CPPFLAGS} ${CFLAGS_$@} -c -o $@ $<; then \ ${COMPILE_OK}; \ else \ ${COMPILE_FAILED}; \ fi .c.lib.o: ${COMPILE_LIB_STATUS} in="$<"; \ out="$@"; \ - if ${CC} ${LIB_CFLAGS} ${CFLAGS} ${CPPFLAGS} -c -o $@ $<; then \ + if ${CC} ${LIB_CFLAGS} ${CFLAGS} ${CPPFLAGS} ${CFLAGS_$@} -c -o $@ $<; then \ ${COMPILE_LIB_OK}; \ else \ ${COMPILE_LIB_FAILED}; \ fi .c.plugin.o: ${COMPILE_PLUGIN_STATUS} in="$<"; \ out="$@"; \ - if ${CC} ${PLUGIN_CFLAGS} ${CFLAGS} ${CPPFLAGS} -c -o $@ $<; then \ + if ${CC} ${PLUGIN_CFLAGS} ${CFLAGS} ${CPPFLAGS} ${CFLAGS_$@} -c -o $@ $<; then \ ${COMPILE_PLUGIN_OK}; \ else \ ${COMPILE_PLUGIN_FAILED}; \ fi .cc.o .cxx.o: ${COMPILE_STATUS} in="$<"; \ out="$@"; \ - if ${CXX} ${CXXFLAGS} ${CPPFLAGS} -c -o $@ $<; then \ + if ${CXX} ${CXXFLAGS} ${CPPFLAGS} ${CXXFLAGS_$@} -c -o $@ $<; then \ ${COMPILE_OK}; \ else \ ${COMPILE_FAILED}; \ fi .cc.lib.o .cxx.lib.o: ${COMPILE_LIB_STATUS} in="$<"; \ out="$@"; \ - if ${CXX} ${LIB_CFLAGS} ${CXXFLAGS} ${CPPFLAGS} -c -o $@ $<; then \ + if ${CXX} ${LIB_CFLAGS} ${CXXFLAGS} ${CPPFLAGS} ${CXXFLAGS_$@} -c -o $@ $<; then \ ${COMPILE_LIB_OK}; \ else \ ${COMPILE_LIB_FAILED}; \ fi .cc.plugin.o .cxx.plugin.o: ${COMPILE_PLUGIN_STATUS} in="$<"; \ out="$@"; \ - if ${CXX} ${PLUGIN_CFLAGS} ${CXXFLAGS} ${CPPFLAGS} -c -o $@ $<; then \ + if ${CXX} ${PLUGIN_CFLAGS} ${CXXFLAGS} ${CPPFLAGS} ${CXXFLAGS_$@} -c -o $@ $<; then \ ${COMPILE_PLUGIN_OK}; \ else \ ${COMPILE_PLUGIN_FAILED}; \ fi @@ -479,57 +483,57 @@ .m.o: ${COMPILE_STATUS} in="$<"; \ out="$@"; \ - if ${OBJC} ${OBJCFLAGS} ${CPPFLAGS} -c -o $@ $<; then \ + if ${OBJC} ${OBJCFLAGS} ${CPPFLAGS} ${OBJCFLAGS_$@} -c -o $@ $<; then \ ${COMPILE_OK}; \ else \ ${COMPILE_FAILED}; \ fi .m.lib.o: ${COMPILE_LIB_STATUS} in="$<"; \ out="$@"; \ - if ${OBJC} ${LIB_CFLAGS} ${OBJCFLAGS} ${CPPFLAGS} -c -o $@ $<; then \ + if ${OBJC} ${LIB_CFLAGS} ${OBJCFLAGS} ${CPPFLAGS} ${OBJCFLAGS_$@} -c -o $@ $<; then \ ${COMPILE_LIB_OK}; \ else \ ${COMPILE_LIB_FAILED}; \ fi .m.plugin.o: ${COMPILE_PLUGIN_STATUS} in="$<"; \ out="$@"; \ - if ${OBJC} ${PLUGIN_CFLAGS} ${OBJCFLAGS} ${CPPFLAGS} -c -o $@ $<; then \ + if ${OBJC} ${PLUGIN_CFLAGS} ${OBJCFLAGS} ${CPPFLAGS} ${OBJCFLAGS_$@} -c -o $@ $<; then \ ${COMPILE_PLUGIN_OK}; \ else \ ${COMPILE_PLUGIN_FAILED}; \ fi .mm.o: ${COMPILE_STATUS} in="$<"; \ out="$@"; \ - if ${OBJCXX} ${OBJCXXFLAGS} ${OBJCFLAGS} ${CXXFLAGS} ${CPPFLAGS} -c -o $@ $<; then \ + if ${OBJCXX} ${OBJCXXFLAGS} ${OBJCFLAGS} ${CXXFLAGS} ${CPPFLAGS} ${OBJCXXFLAGS_$@} -c -o $@ $<; then \ ${COMPILE_OK}; \ else \ ${COMPILE_FAILED}; \ fi .mm.lib.o: ${COMPILE_LIB_STATUS} in="$<"; \ out="$@"; \ - if ${OBJCXX} ${LIB_CFLAGS} ${OBJCXXFLAGS} ${OBJCFLAGS} ${CXXFLAGS} ${CPPFLAGS} -c -o $@ $<; then \ + if ${OBJCXX} ${LIB_CFLAGS} ${OBJCXXFLAGS} ${OBJCFLAGS} ${CXXFLAGS} ${CPPFLAGS} ${OBJCXXFLAGS_$@} -c -o $@ $<; then \ ${COMPILE_LIB_OK}; \ else \ ${COMPILE_LIB_FAILED}; \ fi .mm.plugin.o: ${COMPILE_PLUGIN_STATUS} in="$<"; \ out="$@"; \ - if ${OBJCXX} ${PLUGIN_CFLAGS} ${OBJCXXFLAGS} ${OBJCFLAGS} ${CXXFLAGS} ${CPPFLAGS} -c -o $@ $<; then \ + if ${OBJCXX} ${PLUGIN_CFLAGS} ${OBJCXXFLAGS} ${OBJCFLAGS} ${CXXFLAGS} ${CPPFLAGS} ${OBJCXXFLAGS_$@} -c -o $@ $<; then \ ${COMPILE_PLUGIN_OK}; \ else \ ${COMPILE_PLUGIN_FAILED}; \ fi @@ -565,133 +569,142 @@ .S.o: ${COMPILE_STATUS} in="$<"; \ out="$@"; \ - if ${AS} ${ASFLAGS} ${CPPFLAGS} -c -o $@ $<; then \ + if ${AS} ${ASFLAGS} ${CPPFLAGS} ${ASFLAGS_$@} -c -o $@ $<; then \ ${COMPILE_OK}; \ else \ ${COMPILE_FAILED}; \ fi .S.lib.o: ${COMPILE_LIB_STATUS} in="$<"; \ out="$@"; \ - if ${AS} ${LIB_CFLAGS} ${ASFLAGS} ${CPPFLAGS} -c -o $@ $<; then \ + if ${AS} ${LIB_CFLAGS} ${ASFLAGS} ${CPPFLAGS} ${ASFLAGS_$@} -c -o $@ $<; then \ ${COMPILE_LIB_OK}; \ else \ ${COMPILE_LIB_FAILED}; \ fi .S.plugin.o: ${COMPILE_PLUGIN_STATUS} in="$<"; \ out="$@"; \ - if ${AS} ${PLUGIN_CFLAGS} ${ASFLAGS} ${CPPFLAGS} -c -o $@ $<; then \ + if ${AS} ${PLUGIN_CFLAGS} ${ASFLAGS} ${CPPFLAGS} ${ASFLAGS_$@} -c -o $@ $<; then \ ${COMPILE_PLUGIN_OK}; \ else \ ${COMPILE_PLUGIN_FAILED}; \ fi .xpm.o: ${COMPILE_STATUS} in="$<"; \ out="$@"; \ - if ${CC} ${CFLAGS} ${CPPFLAGS} -x c -c -o $@ $<; then \ + if ${CC} ${CFLAGS} ${CPPFLAGS} ${CFLAGS_$@} -x c -c -o $@ $<; then \ ${COMPILE_OK}; \ else \ ${COMPILE_FAILED}; \ fi .xpm.lib.o: ${COMPILE_LIB_STATUS} in="$<"; \ out="$@"; \ - if ${CC} ${LIB_CFLAGS} ${CFLAGS} ${CPPFLAGS} -x c -c -o $@ $<; then \ + if ${CC} ${LIB_CFLAGS} ${CFLAGS} ${CPPFLAGS} ${CFLAGS_$@} -x c -c -o $@ $<; then \ ${COMPILE_LIB_OK}; \ else \ ${COMPILE_LIB_FAILED}; \ fi .xpm.plugin.o: ${COMPILE_PLUGIN_STATUS} in="$<"; \ out="$@"; \ - if ${CC} ${PLUGIN_CFLAGS} ${CFLAGS} ${CPPFLAGS} -x c -c -o $@ $<; then \ + if ${CC} ${PLUGIN_CFLAGS} ${CFLAGS} ${CPPFLAGS} ${CFLAGS_$@} -x c -c -o $@ $<; then \ ${COMPILE_PLUGIN_OK}; \ else \ ${COMPILE_PLUGIN_FAILED}; \ fi install: all install-extra - for i in ${SUBDIRS} ${SUBDIRS_AFTER}; do \ + for i in "" ${SUBDIRS} ${SUBDIRS_AFTER}; do \ + test x"$$i" = x"" && continue; \ ${DIR_ENTER}; \ - ${MAKE} ${MFLAGS} install || exit $$?; \ + ${MAKE} install || exit $$?; \ ${DIR_LEAVE}; \ done - for i in ${SHARED_LIB}; do \ + for i in "" ${SHARED_LIB}; do \ + test x"$$i" = x"" && continue; \ ${INSTALL_STATUS}; \ if ${MKDIR_P} ${DESTDIR}${libdir} ${INSTALL_LIB}; then \ ${INSTALL_OK}; \ else \ ${INSTALL_FAILED}; \ fi \ done - for i in ${STATIC_LIB} ${STATIC_PIC_LIB}; do \ + for i in "" ${STATIC_LIB} ${STATIC_PIC_LIB}; do \ + test x"$$i" = x"" && continue; \ ${INSTALL_STATUS}; \ if ${MKDIR_P} ${DESTDIR}${libdir} && ${INSTALL} -m 644 $$i ${DESTDIR}${libdir}/$$i; then \ ${INSTALL_OK}; \ else \ ${INSTALL_FAILED}; \ fi \ done - for i in ${PLUGIN}; do \ + for i in "" ${PLUGIN}; do \ + test x"$$i" = x"" && continue; \ ${INSTALL_STATUS}; \ if ${MKDIR_P} ${DESTDIR}${plugindir} && ${INSTALL} -m 755 $$i ${DESTDIR}${plugindir}/$$i; then \ ${INSTALL_OK}; \ else \ ${INSTALL_FAILED}; \ fi \ done - for i in ${DATA}; do \ + for i in "" ${DATA}; do \ + test x"$$i" = x"" && continue; \ ${INSTALL_STATUS}; \ if ${MKDIR_P} $$(dirname ${DESTDIR}${datadir}/${PACKAGE_NAME}/$$i) && ${INSTALL} -m 644 $$i ${DESTDIR}${datadir}/${PACKAGE_NAME}/$$i; then \ ${INSTALL_OK}; \ else \ ${INSTALL_FAILED}; \ fi \ done - for i in ${PROG}; do \ + for i in "" ${PROG}; do \ + test x"$$i" = x"" && continue; \ ${INSTALL_STATUS}; \ if ${MKDIR_P} ${DESTDIR}${bindir} && ${INSTALL} -m 755 $$i ${DESTDIR}${bindir}/$$i; then \ ${INSTALL_OK}; \ else \ ${INSTALL_FAILED}; \ fi \ done - for i in ${INCLUDES}; do \ + for i in "" ${INCLUDES}; do \ + test x"$$i" = x"" && continue; \ ${INSTALL_STATUS}; \ if ${MKDIR_P} ${DESTDIR}${includedir}/${includesubdir} && ${INSTALL} -m 644 $$i ${DESTDIR}${includedir}/${includesubdir}/$$i; then \ ${INSTALL_OK}; \ else \ ${INSTALL_FAILED}; \ fi \ done - for i in ${MO_FILES}; do \ + for i in "" ${MO_FILES}; do \ + test x"$$i" = x"" && continue; \ ${INSTALL_STATUS}; \ if ${MKDIR_P} ${DESTDIR}${localedir}/$${i%.mo}/LC_MESSAGES && ${INSTALL} -m 644 $$i ${DESTDIR}${localedir}/$${i%.mo}/LC_MESSAGES/${localename}.mo; then \ ${INSTALL_OK}; \ else \ ${INSTALL_FAILED}; \ fi \ done - for i in ${MAN}; do \ + for i in "" ${MAN}; do \ + test x"$$i" = x"" && continue; \ ${INSTALL_STATUS}; \ if ${MKDIR_P} ${DESTDIR}${mandir}/${mansubdir} && ${INSTALL} -m 644 $$i ${DESTDIR}${mandir}/${mansubdir}/$$i; then \ ${INSTALL_OK}; \ else \ ${INSTALL_FAILED}; \ @@ -699,37 +712,41 @@ done install-extra: uninstall: uninstall-extra - for i in ${SUBDIRS} ${SUBDIRS_AFTER}; do \ + for i in "" ${SUBDIRS} ${SUBDIRS_AFTER}; do \ + test x"$$i" = x"" && continue; \ ${DIR_ENTER}; \ - ${MAKE} ${MFLAGS} uninstall || exit $$?; \ + ${MAKE} uninstall || exit $$?; \ ${DIR_LEAVE}; \ done - for i in ${SHARED_LIB}; do \ + for i in "" ${SHARED_LIB}; do \ + test x"$$i" = x"" && continue; \ if test -f ${DESTDIR}${libdir}/$$i; then \ if : ${UNINSTALL_LIB}; then \ ${DELETE_OK}; \ else \ ${DELETE_FAILED}; \ fi \ fi; \ done - for i in ${STATIC_LIB} ${STATIC_PIC_LIB}; do \ + for i in "" ${STATIC_LIB} ${STATIC_PIC_LIB}; do \ + test x"$$i" = x"" && continue; \ if test -f ${DESTDIR}${libdir}/$$i; then \ if rm -f ${DESTDIR}${libdir}/$$i; then \ ${DELETE_OK}; \ else \ ${DELETE_FAILED}; \ fi \ fi \ done - for i in ${PLUGIN}; do \ + for i in "" ${PLUGIN}; do \ + test x"$$i" = x"" && continue; \ if test -f ${DESTDIR}${plugindir}/$$i; then \ if rm -f ${DESTDIR}${plugindir}/$$i; then \ ${DELETE_OK}; \ else \ ${DELETE_FAILED}; \ @@ -736,11 +753,12 @@ fi \ fi \ done -rmdir ${DESTDIR}${plugindir} >/dev/null 2>&1 - for i in ${DATA}; do \ + for i in "" ${DATA}; do \ + test x"$$i" = x"" && continue; \ if test -f ${DESTDIR}${datadir}/${PACKAGE_NAME}/$$i; then \ if rm -f ${DESTDIR}${datadir}/${PACKAGE_NAME}/$$i; then \ ${DELETE_OK}; \ else \ ${DELETE_FAILED}; \ @@ -748,21 +766,23 @@ fi; \ rmdir "$$(dirname ${DESTDIR}${datadir}/${PACKAGE_NAME}/$$i)" >/dev/null 2>&1 || true; \ done -rmdir ${DESTDIR}${datadir}/${PACKAGE_NAME} >/dev/null 2>&1 - for i in ${PROG}; do \ + for i in "" ${PROG}; do \ + test x"$$i" = x"" && continue; \ if test -f ${DESTDIR}${bindir}/$$i; then \ if rm -f ${DESTDIR}${bindir}/$$i; then \ ${DELETE_OK}; \ else \ ${DELETE_FAILED}; \ fi \ fi \ done - for i in ${INCLUDES}; do \ + for i in "" ${INCLUDES}; do \ + test x"$$i" = x"" && continue; \ if test -f ${DESTDIR}${includedir}/${includesubdir}/$$i; then \ if rm -f ${DESTDIR}${includedir}/${includesubdir}/$$i; then \ ${DELETE_OK}; \ else \ ${DELETE_FAILED}; \ @@ -769,21 +789,23 @@ fi \ fi \ done -rmdir ${DESTDIR}${includedir}/${includesubdir} >/dev/null 2>&1 - for i in ${MO_FILES}; do \ + for i in "" ${MO_FILES}; do \ + test x"$$i" = x"" && continue; \ if test -f ${DESTDIR}${localedir}/$${i%.mo}/LC_MESSAGES/${localename}.mo; then \ if rm -f ${DESTDIR}${localedir}/$${i%.mo}/LC_MESSAGES/${localename}.mo; then \ ${DELETE_OK}; \ else \ ${DELETE_FAILED}; \ fi \ fi \ done - for i in ${MAN}; do \ + for i in "" ${MAN}; do \ + test x"$$i" = x"" && continue; \ if test -f ${DESTDIR}${mandir}/${mansubdir}/$$i; then \ if rm -f ${DESTDIR}${mandir}/${mansubdir}/$$i; then \ ${DELETE_OK}; \ else \ ${DELETE_FAILED}; \ @@ -792,17 +814,19 @@ done uninstall-extra: clean: - for i in ${SUBDIRS} ${SUBDIRS_AFTER}; do \ + for i in "" ${SUBDIRS} ${SUBDIRS_AFTER}; do \ + test x"$$i" = x"" && continue; \ ${DIR_ENTER}; \ - ${MAKE} ${MFLAGS} clean || exit $$?; \ + ${MAKE} clean || exit $$?; \ ${DIR_LEAVE}; \ done - for i in ${DEPS} ${OBJS} ${OBJS_EXTRA} ${LIB_OBJS} ${LIB_OBJS_EXTRA} ${PLUGIN_OBJS} ${PROG} ${PROG_NOINST} ${SHARED_LIB} ${SHARED_LIB_NOINST} ${STATIC_LIB} ${STATIC_LIB_NOINST} ${STATIC_PIC_LIB} ${STATIC_PIC_LIB_NOINST} ${PLUGIN} ${PLUGIN_NOINST} ${CLEAN_LIB} ${MO_FILES} ${CLEAN}; do \ + for i in "" ${DEPS} ${OBJS} ${OBJS_EXTRA} ${LIB_OBJS} ${LIB_OBJS_EXTRA} ${PLUGIN_OBJS} ${PROG} ${PROG_NOINST} ${SHARED_LIB} ${SHARED_LIB_NOINST} ${STATIC_LIB} ${STATIC_LIB_NOINST} ${STATIC_PIC_LIB} ${STATIC_PIC_LIB_NOINST} ${PLUGIN} ${PLUGIN_NOINST} ${CLEAN_LIB} ${MO_FILES} ${CLEAN}; do \ + test x"$$i" = x"" && continue; \ if test -f $$i -o -d $$i; then \ if rm -fr $$i; then \ ${DELETE_OK}; \ else \ ${DELETE_FAILED}; \ @@ -809,26 +833,40 @@ fi \ fi \ done distclean: clean - for i in ${SUBDIRS} ${SUBDIRS_AFTER}; do \ + for i in "" ${SUBDIRS} ${SUBDIRS_AFTER}; do \ + test x"$$i" = x"" && continue; \ ${DIR_ENTER}; \ - ${MAKE} ${MFLAGS} distclean || exit $$?; \ + ${MAKE} distclean || exit $$?; \ ${DIR_LEAVE}; \ done - for i in ${DISTCLEAN} .deps *~; do \ + for i in "" ${DISTCLEAN} .deps *~; do \ + test x"$$i" = x"" && continue; \ if test -f $$i -o -d $$i; then \ if rm -fr $$i; then \ ${DELETE_OK}; \ else \ ${DELETE_FAILED}; \ fi \ fi \ done +print-hierarchy: + for i in "" ${SUBDIRS} ${SUBDIRS_AFTER}; do \ + test x"$$i" = x"" && continue; \ + echo ${PRINT_HIERARCHY_PREFIX}$$i; \ + cd $$i || exit $$?; \ + ${MAKE} PRINT_HIERARCHY_PREFIX=$$i/ print-hierarchy || exit $$?; \ + cd .. || exit $$?; \ + done + +print-var: + printf '%s\n' '${${VAR}}' + DIR_ENTER = printf "@TERM_EL@@TERM_SETAF6@Entering directory @TERM_BOLD@%s@TERM_SGR0@@TERM_SETAF6@.@TERM_SGR0@\n" "$$i"; cd $$i || exit $$? DIR_LEAVE = printf "@TERM_EL@@TERM_SETAF6@Leaving directory @TERM_BOLD@%s@TERM_SGR0@@TERM_SETAF6@.@TERM_SGR0@\n" "$$i"; cd .. || exit $$? DEPEND_STATUS = printf "@TERM_EL@@TERM_SETAF3@Generating dependencies...@TERM_SGR0@\r" DEPEND_OK = printf "@TERM_EL@@TERM_SETAF2@Successfully generated dependencies.@TERM_SGR0@\n" DEPEND_FAILED = err=$$?; printf "@TERM_EL@@TERM_SETAF1@Failed to generate dependencies!@TERM_SGR0@\n"; exit $$err Index: m4/buildsys.m4 ================================================================== --- m4/buildsys.m4 +++ m4/buildsys.m4 @@ -1,10 +1,10 @@ dnl -dnl Copyright (c) 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014 -dnl Jonathan Schleifer +dnl Copyright (c) 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2016, 2017 +dnl Jonathan Schleifer dnl -dnl https://webkeks.org/git/?p=buildsys.git +dnl https://heap.zone/git/?p=buildsys.git dnl dnl Permission to use, copy, modify, and/or distribute this software for any dnl purpose with or without fee is hereby granted, provided that the above dnl copyright notice and this permission notice is present in all copies. dnl @@ -98,11 +98,11 @@ AC_MSG_CHECKING(whether we need an implib) case "$host_os" in cygwin* | mingw*) AC_MSG_RESULT(yes) PROG_IMPLIB_NEEDED='yes' - PROG_IMPLIB_LDFLAGS='-Wl,-export-all-symbols,--out-implib,lib${PROG}.a' + PROG_IMPLIB_LDFLAGS='-Wl,--export-all-symbols,--out-implib,lib${PROG}.a' ;; *) AC_MSG_RESULT(no) PROG_IMPLIB_NEEDED='no' PROG_IMPLIB_LDFLAGS='' @@ -118,14 +118,15 @@ AC_MSG_CHECKING(for shared library system) case "$host_os" in darwin*) AC_MSG_RESULT(Darwin) LIB_CFLAGS='-fPIC -DPIC' - LIB_LDFLAGS='-dynamiclib -current_version ${LIB_MAJOR}.${LIB_MINOR} -compatibility_version ${LIB_MAJOR} -Wl,-install_name,${libdir}/$${out%.dylib}.${LIB_MAJOR}.dylib' + LIB_LDFLAGS='-dynamiclib -current_version ${LIB_MAJOR}.${LIB_MINOR} -compatibility_version ${LIB_MAJOR}' LIB_PREFIX='lib' LIB_SUFFIX='.dylib' LDFLAGS_RPATH='-Wl,-rpath,${libdir}' + LDFLAGS_INSTALL_NAME='-Wl,-install_name,${libdir}/$${out%.dylib}.${LIB_MAJOR}.dylib' PLUGIN_CFLAGS='-fPIC -DPIC' PLUGIN_LDFLAGS='-bundle -undefined dynamic_lookup' PLUGIN_SUFFIX='.bundle' INSTALL_LIB='&& ${INSTALL} -m 755 $$i ${DESTDIR}${libdir}/$${i%.dylib}.${LIB_MAJOR}.${LIB_MINOR}.dylib && ${LN_S} -f $${i%.dylib}.${LIB_MAJOR}.${LIB_MINOR}.dylib ${DESTDIR}${libdir}/$${i%.dylib}.${LIB_MAJOR}.dylib && ${LN_S} -f $${i%.dylib}.${LIB_MAJOR}.${LIB_MINOR}.dylib ${DESTDIR}${libdir}/$$i' UNINSTALL_LIB='&& rm -f ${DESTDIR}${libdir}/$$i ${DESTDIR}${libdir}/$${i%.dylib}.${LIB_MAJOR}.dylib ${DESTDIR}${libdir}/$${i%.dylib}.${LIB_MAJOR}.${LIB_MINOR}.dylib' @@ -132,11 +133,11 @@ CLEAN_LIB='' ;; mingw* | cygwin*) AC_MSG_RESULT(MinGW / Cygwin) LIB_CFLAGS='' - LIB_LDFLAGS='-shared -Wl,--out-implib,${SHARED_LIB}.a' + LIB_LDFLAGS='-shared -Wl,--export-all-symbols,--out-implib,${SHARED_LIB}.a' LIB_PREFIX='lib' LIB_SUFFIX='.dll' LDFLAGS_RPATH='-Wl,-rpath,${libdir}' PLUGIN_CFLAGS='' PLUGIN_LDFLAGS='-shared' @@ -171,10 +172,24 @@ PLUGIN_SUFFIX='.so' INSTALL_LIB='&& ${INSTALL} -m 755 $$i ${DESTDIR}${libdir}/$$i.${LIB_MAJOR}.${LIB_MINOR} && rm -f ${DESTDIR}${libdir}/$$i && ${LN_S} $$i.${LIB_MAJOR}.${LIB_MINOR} ${DESTDIR}${libdir}/$$i' UNINSTALL_LIB='&& rm -f ${DESTDIR}${libdir}/$$i ${DESTDIR}${libdir}/$$i.${LIB_MAJOR}.${LIB_MINOR}' CLEAN_LIB='' ;; + *-android*) + AC_MSG_RESULT(Android) + LIB_CFLAGS='-fPIC -DPIC' + LIB_LDFLAGS='-shared -Wl,-soname=${SHARED_LIB}.${LIB_MAJOR}' + LIB_PREFIX='lib' + LIB_SUFFIX='.so' + LDFLAGS_RPATH='' + PLUGIN_CFLAGS='-fPIC -DPIC' + PLUGIN_LDFLAGS='-shared' + PLUGIN_SUFFIX='.so' + INSTALL_LIB='&& ${INSTALL} -m 755 $$i ${DESTDIR}${libdir}/$$i.${LIB_MAJOR}.${LIB_MINOR}.0 && ${LN_S} -f $$i.${LIB_MAJOR}.${LIB_MINOR}.0 ${DESTDIR}${libdir}/$$i.${LIB_MAJOR} && ${LN_S} -f $$i.${LIB_MAJOR}.${LIB_MINOR}.0 ${DESTDIR}${libdir}/$$i' + UNINSTALL_LIB='&& rm -f ${DESTDIR}${libdir}/$$i ${DESTDIR}${libdir}/$$i.${LIB_MAJOR} ${DESTDIR}${libdir}/$$i.${LIB_MAJOR}.${LIB_MINOR}.0' + CLEAN_LIB='' + ;; *) AC_MSG_RESULT(ELF) LIB_CFLAGS='-fPIC -DPIC' LIB_LDFLAGS='-shared -Wl,-soname=${SHARED_LIB}.${LIB_MAJOR}' LIB_PREFIX='lib' @@ -192,12 +207,13 @@ AC_SUBST(LIB_CFLAGS) AC_SUBST(LIB_LDFLAGS) AC_SUBST(LIB_PREFIX) AC_SUBST(LIB_SUFFIX) AC_SUBST(LDFLAGS_RPATH) + AC_SUBST(LDFLAGS_INSTALL_NAME) AC_SUBST(PLUGIN_CFLAGS) AC_SUBST(PLUGIN_LDFLAGS) AC_SUBST(PLUGIN_SUFFIX) AC_SUBST(INSTALL_LIB) AC_SUBST(UNINSTALL_LIB) AC_SUBST(CLEAN_LIB) ])