Index: buildsys.mk.in ================================================================== --- buildsys.mk.in +++ buildsys.mk.in @@ -43,10 +43,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@ @@ -257,11 +258,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 +386,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 +480,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,57 +566,57 @@ .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 @@ -825,10 +826,21 @@ ${DELETE_FAILED}; \ fi \ fi \ done +print-hierarchy: + for i in ${SUBDIRS} ${SUBDIRS_AFTER}; do \ + echo ${PRINT_HIERARCHY_PREFIX}$$i; \ + cd $$i || exit $$?; \ + ${MAKE} ${MFLAGS} 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 @@ -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' @@ -192,12 +193,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) ])