Index: buildsys.mk.in ================================================================== --- buildsys.mk.in +++ buildsys.mk.in @@ -1,10 +1,10 @@ # -# Copyright (c) 2007, 2008, 2009, 2010, 2011 +# Copyright (c) 2007, 2008, 2009, 2010, 2011, 2012 # Jonathan Schleifer # -# https://webkeks.org/hg/buildsys/ +# https://webkeks.org/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. # @@ -19,11 +19,12 @@ # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # POSSIBILITY OF SUCH DAMAGE. # -PACKAGE = @PACKAGE@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ AS = @AS@ CC = @CC@ CXX = @CXX@ CPP = @CPP@ DC = @DC@ @@ -57,75 +58,113 @@ PLUGIN_LDFLAGS = @PLUGIN_LDFLAGS@ PLUGIN_SUFFIX = @PLUGIN_SUFFIX@ INSTALL_LIB = @INSTALL_LIB@ UNINSTALL_LIB = @UNINSTALL_LIB@ CLEAN_LIB = @CLEAN_LIB@ +CC_DEPENDS = @CC_DEPENDS@ +CXX_DEPENDS = @CXX_DEPENDS@ +OBJC_DEPENDS = @OBJC_DEPENDS@ +OBJCXX_DEPENDS = @OBJCXX_DEPENDS@ LN_S = @LN_S@ MKDIR_P = mkdir -p INSTALL = @INSTALL@ SHELL = @SHELL@ MSGFMT = @MSGFMT@ +JAVAC = @JAVAC@ +JAVACFLAGS = @JAVACFLAGS@ +JAR = @JAR@ +WINDRES = @WINDRES@ prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ libdir = @libdir@ -plugindir ?= ${libdir}/${PACKAGE} +plugindir ?= ${libdir}/${PACKAGE_NAME} datarootdir = @datarootdir@ datadir = @datadir@ includedir = @includedir@ -includesubdir ?= ${PACKAGE} +includesubdir ?= ${PACKAGE_NAME} localedir = @localedir@ -localename ?= ${PACKAGE} +localename ?= ${PACKAGE_NAME} mandir = @mandir@ mansubdir ?= man1 OBJS1 = ${SRCS:.c=.o} OBJS2 = ${OBJS1:.cc=.o} OBJS3 = ${OBJS2:.cxx=.o} OBJS4 = ${OBJS3:.d=.o} OBJS5 = ${OBJS4:.erl=.beam} -OBJS6 = ${OBJS5:.m=.o} -OBJS7 = ${OBJS6:.mm=.o} -OBJS8 = ${OBJS7:.py=.pyc} -OBJS9 = ${OBJS8:.xpm=.o} -OBJS += ${OBJS9:.S=.o} +OBJS6 = ${OBJS5:.java=.class} +OBJS7 = ${OBJS6:.m=.o} +OBJS8 = ${OBJS7:.mm=.o} +OBJS9 = ${OBJS8:.py=.pyc} +OBJS10 = ${OBJS9:.rc=.o} +OBJS11 = ${OBJS10:.S=.o} +OBJS += ${OBJS11:.xpm=.o} LIB_OBJS = ${OBJS:.o=.lib.o} PLUGIN_OBJS = ${OBJS:.o=.plugin.o} MO_FILES = ${LOCALES:.po=.mo} .SILENT: .SUFFIXES: -.SUFFIXES: .beam .c .c.dep .cc .cc.dep .cxx .cxx.dep .d .erl .lib.o .mo .m .m.dep .mm .mm.dep .o .plugin.o .po .py .pyc .xpm .S .S.dep -.PHONY: all subdirs pre-depend depend install install-extra uninstall uninstall-extra clean distclean locales +.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 pre-depend depend install install-extra uninstall uninstall-extra clean distclean locales ${SUBDIRS} all: ${MAKE} ${MFLAGS} subdirs ${MAKE} ${MFLAGS} depend - ${MAKE} ${STATIC_LIB} ${STATIC_LIB_NOINST} ${STATIC_PIC_LIB} ${STATIC_PIC_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} ${SHARED_LIB} ${SHARED_LIB_NOINST} ${PLUGIN} ${PLUGIN_NOINST} ${PROG} ${PROG_NOINST} ${JARFILE} locales + +subdirs: ${SUBDIRS} -subdirs: - for i in ${SUBDIRS}; do \ +${SUBDIRS}: + for i in $@; do \ ${DIR_ENTER}; \ - ${MAKE} ${MFLAGS} || exit 1; \ + ${MAKE} ${MFLAGS} || exit $$?; \ ${DIR_LEAVE}; \ done depend: pre-depend ${SRCS} regen=0; \ deps=""; \ test -f .deps || regen=1; \ for i in ${SRCS}; do \ case $$i in \ - *.c | *.cc | *.cxx | *.m | *.mm | *.S) \ - test $$i -nt .deps && regen=1; \ - deps="$$deps $$i.dep"; \ + *.c) \ + if test x"${CC_DEPENDS}" = x"yes"; then \ + test $$i -nt .deps && regen=1; \ + deps="$$deps $$i.dep"; \ + fi; \ + ;; \ + *.cc | *.cxx) \ + if test x"${CXX_DEPENDS}" = x"yes"; then \ + test $$i -nt .deps && regen=1; \ + deps="$$deps $$i.dep"; \ + fi; \ + ;; \ + *.m) \ + if test x"${OBJC_DEPENDS}" = x"yes"; then \ + test $$i -nt .deps && regen=1; \ + deps="$$deps $$i.dep"; \ + fi; \ + ;; \ + *.mm) \ + if test x"${OBJCXX_DEPENDS}" = x"yes"; then \ + test $$i -nt .deps && regen=1; \ + deps="$$deps $$i.dep"; \ + fi; \ + ;; \ + *.S) \ + if test x"${AS_DEPENDS}" = x"yes"; then \ + test $$i -nt .deps && regen=1; \ + deps="$$deps $$i.dep"; \ + fi; \ ;; \ esac; \ done; \ - if test x"$$regen" = x"1" -a x"$$deps" != "x"; then \ + if test x"$$regen" = x"1" -a x"$$deps" != x""; then \ ${DEPEND_STATUS}; \ if ${MAKE} ${MFLAGS} $$deps && cat $$deps >.deps; then \ rm -f $$deps; \ ${DEPEND_OK}; \ else \ @@ -133,47 +172,174 @@ touch -t 0001010000 .deps; \ ${DEPEND_FAILED}; \ fi; \ fi -.c.c.dep .cc.cc.dep .cxx.cxx.dep .m.m.dep .mm.mm.dep .S.S.dep: - ${CPP} ${CPPFLAGS} -M $< | \ +.c.c.dep: + ${CPP} ${CPPFLAGS} ${CFLAGS} -M $< | \ + sed 's/^\([^\.]*\)\.o:/\1.o \1.lib.o \1.plugin.o:/' >$@ || \ + { rm -f $@; false; } + +.cc.cc.dep .cxx.cxx.dep: + ${CPP} ${CPPFLAGS} ${CXXFLAGS} -M $< | \ + sed 's/^\([^\.]*\)\.o:/\1.o \1.lib.o \1.plugin.o:/' >$@ || \ + { rm -f $@; false; } + +.m.m.dep: + ${CPP} ${CPPFLAGS} ${OBJCFLAGS} -M $< | \ + sed 's/^\([^\.]*\)\.o:/\1.o \1.lib.o \1.plugin.o:/' >$@ || \ + { rm -f $@; false; } + +.mm.mm.dep: + ${CPP} ${CPPFLAGS} ${OBJCPPFLAGS} -M $< | \ + sed 's/^\([^\.]*\)\.o:/\1.o \1.lib.o \1.plugin.o:/' >$@ || \ + { rm -f $@; false; } + +.S.S.dep: + ${CPP} ${CPPFLAGS} ${ASFLAGS} -M $< | \ sed 's/^\([^\.]*\)\.o:/\1.o \1.lib.o \1.plugin.o:/' >$@ || \ { rm -f $@; false; } pre-depend: -${PROG} ${PROG_NOINST}: ${EXT_DEPS} ${OBJS} +${PROG} ${PROG_NOINST}: ${EXT_DEPS} ${OBJS} ${OBJS_EXTRA} ${LINK_STATUS} - if ${LD} -o $@ ${OBJS} ${LDFLAGS} ${LIBS}; then \ + if ${LD} -o $@ ${OBJS} ${OBJS_EXTRA} ${LDFLAGS} ${LIBS}; then \ ${LINK_OK}; \ else \ ${LINK_FAILED}; \ fi -${LIB} ${LIB_NOINST}: ${EXT_DEPS} ${LIB_OBJS} +${JARFILE}: ${EXT_DEPS} ${JAR_MANIFEST} ${OBJS} ${OBJS_EXTRA} + ${LINK_STATUS} + if test x"${JAR_MANIFEST}" != x""; then \ + if ${JAR} cfm ${JARFILE} ${JAR_MANIFEST} ${OBJS} ${OBJS_EXTRA}; then \ + ${LINK_OK}; \ + else \ + ${LINK_FAILED}; \ + fi \ + else \ + if ${JAR} cf ${JARFILE} ${OBJS} ${OBJS_EXTRA}; then \ + ${LINK_OK}; \ + else \ + ${LINK_FAILED}; \ + fi \ + fi + +${SHARED_LIB} ${SHARED_LIB_NOINST}: ${EXT_DEPS} ${LIB_OBJS} ${LIB_OBJS_EXTRA} ${LINK_STATUS}; \ - if ${LD} -o $@ ${LIB_OBJS} ${LIB_LDFLAGS} ${LDFLAGS} ${LIBS}; then \ + objs=""; \ + ars=""; \ + for i in ${LIB_OBJS} ${LIB_OBJS_EXTRA}; do \ + case $$i in \ + *.a) \ + ars="$$ars $$i" \ + ;; \ + *.o) \ + objs="$$objs $$i" \ + ;; \ + esac \ + done; \ + for i in $$ars; do \ + dir=".$$(echo $$i | sed 's/\//_/g').objs"; \ + rm -fr $$dir; \ + mkdir -p $$dir; \ + cd $$dir; \ + ${AR} x ../$$i; \ + for j in *.o; do \ + objs="$$objs $$dir/$$j"; \ + done; \ + cd ..; \ + done; \ + if ${LD} -o $@ $$objs ${LIB_LDFLAGS} ${LDFLAGS} ${LIBS}; then \ ${LINK_OK}; \ else \ ${LINK_FAILED}; \ - fi \ + fi; \ + for i in $$ars; do \ + dir=".$$(echo $$i | sed 's/\//_/g').objs"; \ + rm -fr $$dir; \ + done ${PLUGIN} ${PLUGIN_NOINST}: ${EXT_DEPS} ${PLUGIN_OBJS} ${LINK_STATUS} - if ${LD} -o $@ ${PLUGIN_OBJS} ${PLUGIN_LDFLAGS} ${LDFLAGS} ${LIBS}; then \ + objs=""; \ + ars=""; \ + for i in ${PLUGIN_OBJS}; do \ + case $$i in \ + *.a) \ + ars="$$ars $$i" \ + ;; \ + *.o) \ + objs="$$objs $$i" \ + ;; \ + esac \ + done; \ + for i in $$ars; do \ + dir=".$$(echo $$i | sed 's/\//_/g').objs"; \ + rm -fr $$dir; \ + mkdir -p $$dir; \ + cd $$dir; \ + ${AR} x ../$$i; \ + for j in *.o; do \ + objs="$$objs $$dir/$$j"; \ + done; \ + cd ..; \ + done; \ + if ${LD} -o $@ $$objs ${PLUGIN_LDFLAGS} ${LDFLAGS} ${LIBS}; then \ + ${LINK_OK}; \ + else \ + ${LINK_FAILED}; \ + fi; \ + for i in $$ars; do \ + dir=".$$(echo $$i | sed 's/\//_/g').objs"; \ + rm -fr $$dir; \ + done + +${STATIC_LIB} ${STATIC_LIB_NOINST}: ${EXT_DEPS} ${OBJS} ${OBJS_EXTRA} + ${LINK_STATUS} + rm -f $@ + objs=""; \ + ars=""; \ + for i in ${OBJS} ${OBJS_EXTRA}; do \ + case $$i in \ + *.a) \ + ars="$$ars $$i" \ + ;; \ + *.o) \ + objs="$$objs $$i" \ + ;; \ + esac \ + done; \ + for i in $$ars; do \ + dir=".$$(echo $$i | sed 's/\//_/g').objs"; \ + rm -fr $$dir; \ + mkdir -p $$dir; \ + cd $$dir; \ + ${AR} x ../$$i; \ + for j in *.o; do \ + objs="$$objs $$dir/$$j"; \ + done; \ + cd ..; \ + done; \ + if ${AR} cr $@ $$objs && ${RANLIB} $@; then \ ${LINK_OK}; \ else \ ${LINK_FAILED}; \ - fi + rm -f $@; \ + fi; \ + for i in $$ars; do \ + dir=".$$(echo $$i | sed 's/\//_/g').objs"; \ + rm -fr $$dir; \ + done -${STATIC_LIB} ${STATIC_LIB_NOINST}: ${EXT_DEPS} ${OBJS} +${STATIC_PIC_LIB} ${STATIC_PIC_LIB_NOINST}: ${EXT_DEPS} ${LIB_OBJS} ${LIB_OBJS_EXTRA} ${LINK_STATUS} rm -f $@ objs=""; \ ars=""; \ - for i in ${OBJS}; do \ + for i in ${LIB_OBJS} ${LIB_OBJS_EXTRA}; do \ case $$i in \ *.a) \ ars="$$ars $$i" \ ;; \ *.o) \ @@ -184,11 +350,11 @@ for i in $$ars; do \ dir=".$$(echo $$i | sed 's/\//_/g').objs"; \ rm -fr $$dir; \ mkdir -p $$dir; \ cd $$dir; \ - ar x ../$$i; \ + ${AR} x ../$$i; \ for j in *.o; do \ objs="$$objs $$dir/$$j"; \ done; \ cd ..; \ done; \ @@ -201,19 +367,10 @@ 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} if ${CC} ${CFLAGS} ${CPPFLAGS} -c -o $@ $<; then \ @@ -279,10 +436,18 @@ if ${ERLC} ${ERLCFLAGS} -o $@ $<; then \ ${COMPILE_OK}; \ else \ ${COMPILE_FAILED}; \ fi + +.java.class: + ${COMPILE_STATUS} + if ${JAVAC} ${JAVACFLAGS} $<; then \ + ${COMPILE_OK}; \ + else \ + ${COMPILE_FAILED}; \ + fi .m.o: ${COMPILE_STATUS} if ${OBJC} ${OBJCFLAGS} ${CPPFLAGS} -c -o $@ $<; then \ ${COMPILE_OK}; \ @@ -340,31 +505,17 @@ ${COMPILE_OK}; \ else \ ${COMPILE_FAILED}; \ fi -.xpm.o: +.rc.o .rc.lib.o .rc.plugin.o: ${COMPILE_STATUS} - if ${CC} ${CFLAGS} ${CPPFLAGS} -x c -c -o $@ $<; then \ + if ${WINDRES} ${CPPFLAGS} -J rc -O coff -o $@ $<; then \ ${COMPILE_OK}; \ else \ ${COMPILE_FAILED}; \ fi -.xpm.lib.o: - ${COMPILE_LIB_STATUS} - if ${CC} ${LIB_CFLAGS} ${CFLAGS} ${CPPFLAGS} -x c -c -o $@ $<; then \ - ${COMPILE_LIB_OK}; \ - else \ - ${COMPILE_LIB_FAILED}; \ - fi -.xpm.plugin.o: - ${COMPILE_PLUGIN_STATUS} - if ${CC} ${PLUGIN_CFLAGS} ${CFLAGS} ${CPPFLAGS} -x c -c -o $@ $<; then \ - ${COMPILE_PLUGIN_OK}; \ - else \ - ${COMPILE_PLUGIN_FAILED}; \ - fi .S.o: ${COMPILE_STATUS} if ${AS} ${ASFLAGS} ${CPPFLAGS} -c -o $@ $<; then \ ${COMPILE_OK}; \ @@ -384,18 +535,40 @@ ${COMPILE_PLUGIN_OK}; \ else \ ${COMPILE_PLUGIN_FAILED}; \ fi -install: ${LIB} ${STATIC_LIB} ${STATIC_PIC_LIB} ${PLUGIN} ${PROG} install-extra +.xpm.o: + ${COMPILE_STATUS} + if ${CC} ${CFLAGS} ${CPPFLAGS} -x c -c -o $@ $<; then \ + ${COMPILE_OK}; \ + else \ + ${COMPILE_FAILED}; \ + fi +.xpm.lib.o: + ${COMPILE_LIB_STATUS} + if ${CC} ${LIB_CFLAGS} ${CFLAGS} ${CPPFLAGS} -x c -c -o $@ $<; then \ + ${COMPILE_LIB_OK}; \ + else \ + ${COMPILE_LIB_FAILED}; \ + fi +.xpm.plugin.o: + ${COMPILE_PLUGIN_STATUS} + if ${CC} ${PLUGIN_CFLAGS} ${CFLAGS} ${CPPFLAGS} -x c -c -o $@ $<; then \ + ${COMPILE_PLUGIN_OK}; \ + else \ + ${COMPILE_PLUGIN_FAILED}; \ + fi + +install: all install-extra for i in ${SUBDIRS}; do \ ${DIR_ENTER}; \ - ${MAKE} ${MFLAGS} install || exit 1; \ + ${MAKE} ${MFLAGS} install || exit $$?; \ ${DIR_LEAVE}; \ done - for i in ${LIB}; do \ + for i in ${SHARED_LIB}; do \ ${INSTALL_STATUS}; \ if ${MKDIR_P} ${DESTDIR}${libdir} ${INSTALL_LIB}; then \ ${INSTALL_OK}; \ else \ ${INSTALL_FAILED}; \ @@ -420,11 +593,11 @@ fi \ done for i in ${DATA}; do \ ${INSTALL_STATUS}; \ - if ${MKDIR_P} $$(dirname ${DESTDIR}${datadir}/${PACKAGE}/$$i) && ${INSTALL} -m 644 $$i ${DESTDIR}${datadir}/${PACKAGE}/$$i; then \ + 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 @@ -468,15 +641,15 @@ install-extra: uninstall: uninstall-extra for i in ${SUBDIRS}; do \ ${DIR_ENTER}; \ - ${MAKE} ${MFLAGS} uninstall || exit 1; \ + ${MAKE} ${MFLAGS} uninstall || exit $$?; \ ${DIR_LEAVE}; \ done - for i in ${LIB}; do \ + for i in ${SHARED_LIB}; do \ if test -f ${DESTDIR}${libdir}/$$i; then \ if : ${UNINSTALL_LIB}; then \ ${DELETE_OK}; \ else \ ${DELETE_FAILED}; \ @@ -504,20 +677,20 @@ fi \ done -rmdir ${DESTDIR}${plugindir} >/dev/null 2>&1 for i in ${DATA}; do \ - if test -f ${DESTDIR}${datadir}/${PACKAGE}/$$i; then \ - if rm -f ${DESTDIR}${datadir}/${PACKAGE}/$$i; then \ + if test -f ${DESTDIR}${datadir}/${PACKAGE_NAME}/$$i; then \ + if rm -f ${DESTDIR}${datadir}/${PACKAGE_NAME}/$$i; then \ ${DELETE_OK}; \ else \ ${DELETE_FAILED}; \ fi \ fi; \ - rmdir "$$(dirname ${DESTDIR}${datadir}/${PACKAGE}/$$i)" >/dev/null 2>&1 || true; \ + rmdir "$$(dirname ${DESTDIR}${datadir}/${PACKAGE_NAME}/$$i)" >/dev/null 2>&1 || true; \ done - -rmdir ${DESTDIR}${datadir}/${PACKAGE} >/dev/null 2>&1 + -rmdir ${DESTDIR}${datadir}/${PACKAGE_NAME} >/dev/null 2>&1 for i in ${PROG}; do \ if test -f ${DESTDIR}${bindir}/$$i; then \ if rm -f ${DESTDIR}${bindir}/$$i; then \ ${DELETE_OK}; \ @@ -561,15 +734,15 @@ uninstall-extra: clean: for i in ${SUBDIRS}; do \ ${DIR_ENTER}; \ - ${MAKE} ${MFLAGS} clean || exit 1; \ + ${MAKE} ${MFLAGS} clean || exit $$?; \ ${DIR_LEAVE}; \ done - 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 \ + 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 \ if test -f $$i -o -d $$i; then \ if rm -fr $$i; then \ ${DELETE_OK}; \ else \ ${DELETE_FAILED}; \ @@ -578,11 +751,11 @@ done distclean: clean for i in ${SUBDIRS}; do \ ${DIR_ENTER}; \ - ${MAKE} ${MFLAGS} distclean || exit 1; \ + ${MAKE} ${MFLAGS} distclean || exit $$?; \ ${DIR_LEAVE}; \ done for i in ${DISTCLEAN} .deps *~; do \ if test -f $$i -o -d $$i; then \ @@ -592,29 +765,29 @@ ${DELETE_FAILED}; \ fi \ fi \ done -DIR_ENTER = printf "@TERM_EL@@TERM_SETAF6@Entering directory @TERM_BOLD@$$i@TERM_SGR0@@TERM_SETAF6@.@TERM_SGR0@\n"; cd $$i || exit 1 -DIR_LEAVE = printf "@TERM_EL@@TERM_SETAF6@Leaving directory @TERM_BOLD@$$i@TERM_SGR0@@TERM_SETAF6@.@TERM_SGR0@\n"; cd .. || exit 1 +DIR_ENTER = printf "@TERM_EL@@TERM_SETAF6@Entering directory @TERM_BOLD@$$i@TERM_SGR0@@TERM_SETAF6@.@TERM_SGR0@\n"; cd $$i || exit $$? +DIR_LEAVE = printf "@TERM_EL@@TERM_SETAF6@Leaving directory @TERM_BOLD@$$i@TERM_SGR0@@TERM_SETAF6@.@TERM_SGR0@\n"; 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 = printf "@TERM_EL@@TERM_SETAF1@Failed to generate dependencies!@TERM_SGR0@\n"; exit 1 +DEPEND_FAILED = err=$$?; printf "@TERM_EL@@TERM_SETAF1@Failed to generate dependencies!@TERM_SGR0@\n"; exit $$err COMPILE_STATUS = printf "@TERM_EL@@TERM_SETAF3@Compiling @TERM_BOLD@$<@TERM_SGR0@@TERM_SETAF3@...@TERM_SGR0@\r" COMPILE_OK = printf "@TERM_EL@@TERM_SETAF2@Successfully compiled @TERM_BOLD@$<@TERM_SGR0@@TERM_SETAF2@.@TERM_SGR0@\n" -COMPILE_FAILED = printf "@TERM_EL@@TERM_SETAF1@Failed to compile @TERM_BOLD@$<@TERM_SGR0@@TERM_SETAF1@!@TERM_SGR0@\n"; exit 1 +COMPILE_FAILED = err=$$?; printf "@TERM_EL@@TERM_SETAF1@Failed to compile @TERM_BOLD@$<@TERM_SGR0@@TERM_SETAF1@!@TERM_SGR0@\n"; exit $$err COMPILE_LIB_STATUS = printf "@TERM_EL@@TERM_SETAF3@Compiling @TERM_BOLD@$<@TERM_SGR0@@TERM_SETAF3@ (lib)...@TERM_SGR0@\r" COMPILE_LIB_OK = printf "@TERM_EL@@TERM_SETAF2@Successfully compiled @TERM_BOLD@$<@TERM_SGR0@@TERM_SETAF2@ (lib).@TERM_SGR0@\n" -COMPILE_LIB_FAILED = printf "@TERM_EL@@TERM_SETAF1@Failed to compile @TERM_BOLD@$<@TERM_SGR0@@TERM_SETAF1@ (lib)!@TERM_SGR0@\n"; exit 1 +COMPILE_LIB_FAILED = err=$$?; printf "@TERM_EL@@TERM_SETAF1@Failed to compile @TERM_BOLD@$<@TERM_SGR0@@TERM_SETAF1@ (lib)!@TERM_SGR0@\n"; exit $$err COMPILE_PLUGIN_STATUS = printf "@TERM_EL@@TERM_SETAF3@Compiling @TERM_BOLD@$<@TERM_SGR0@@TERM_SETAF3@ (plugin)...@TERM_SGR0@\r" COMPILE_PLUGIN_OK = printf "@TERM_EL@@TERM_SETAF2@Successfully compiled @TERM_BOLD@$<@TERM_SGR0@@TERM_SETAF2@ (plugin).@TERM_SGR0@\n" -COMPILE_PLUGIN_FAILED = printf "@TERM_EL@@TERM_SETAF1@Failed to compile @TERM_BOLD@$<@TERM_SGR0@@TERM_SETAF1@ (plugin)!@TERM_SGR0@\n"; exit 1 +COMPILE_PLUGIN_FAILED = err=$$?; printf "@TERM_EL@@TERM_SETAF1@Failed to compile @TERM_BOLD@$<@TERM_SGR0@@TERM_SETAF1@ (plugin)!@TERM_SGR0@\n"; exit $$err LINK_STATUS = printf "@TERM_EL@@TERM_SETAF3@Linking @TERM_BOLD@$@@TERM_SGR0@@TERM_SETAF3@...@TERM_SGR0@\r" LINK_OK = printf "@TERM_EL@@TERM_SETAF2@Successfully linked @TERM_BOLD@$@@TERM_SGR0@@TERM_SETAF2@.@TERM_SGR0@\n" -LINK_FAILED = printf "@TERM_EL@@TERM_SETAF1@Failed to link @TERM_BOLD@$@@TERM_SGR0@@TERM_SETAF1@!@TERM_SGR0@\n"; exit 1 +LINK_FAILED = err=$$?; printf "@TERM_EL@@TERM_SETAF1@Failed to link @TERM_BOLD@$@@TERM_SGR0@@TERM_SETAF1@!@TERM_SGR0@\n"; exit $$err INSTALL_STATUS = printf "@TERM_EL@@TERM_SETAF3@Installing @TERM_BOLD@$$i@TERM_SGR0@@TERM_SETAF3@...@TERM_SGR0@\r" INSTALL_OK = printf "@TERM_EL@@TERM_SETAF2@Successfully installed @TERM_BOLD@$$i@TERM_SGR0@@TERM_SETAF2@.@TERM_SGR0@\n" -INSTALL_FAILED = printf "@TERM_EL@@TERM_SETAF1@Failed to install @TERM_BOLD@$$i@TERM_SGR0@@TERM_SETAF1@!@TERM_SGR0@\n"; exit 1 +INSTALL_FAILED = err=$$?; printf "@TERM_EL@@TERM_SETAF1@Failed to install @TERM_BOLD@$$i@TERM_SGR0@@TERM_SETAF1@!@TERM_SGR0@\n"; exit $$err DELETE_OK = printf "@TERM_EL@@TERM_SETAF4@Deleted @TERM_BOLD@$$i@TERM_SGR0@@TERM_SETAF4@.@TERM_SGR0@\n" -DELETE_FAILED = printf "@TERM_EL@@TERM_SETAF1@Failed to delete @TERM_BOLD@$$i@TERM_SGR0@@TERM_SETAF1@!@TERM_SGR0@\n"; exit 1 +DELETE_FAILED = err=$$?; printf "@TERM_EL@@TERM_SETAF1@Failed to delete @TERM_BOLD@$$i@TERM_SGR0@@TERM_SETAF1@!@TERM_SGR0@\n"; exit $$err include .deps Index: m4/buildsys.m4 ================================================================== --- m4/buildsys.m4 +++ m4/buildsys.m4 @@ -1,9 +1,10 @@ dnl -dnl Copyright (c) 2007 - 2009, Jonathan Schleifer +dnl Copyright (c) 2007, 2008, 2009, 2010, 2011, 2012 +dnl Jonathan Schleifer dnl -dnl https://webkeks.org/hg/buildsys/ +dnl https://webkeks.org/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 @@ -19,10 +20,15 @@ dnl ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE dnl POSSIBILITY OF SUCH DAMAGE. dnl AC_DEFUN([BUILDSYS_INIT], [ + AC_SUBST(CC_DEPENDS, $GCC) + AC_SUBST(CXX_DEPENDS, $GXX) + AC_SUBST(OBJC_DEPENDS, $GOBJC) + AC_SUBST(OBJCXX_DEPENDS, $GOBJCXX) + AC_PATH_PROG(TPUT, tput) AS_IF([test x"$TPUT" != x""], [ if x=$($TPUT el 2>/dev/null); then AC_SUBST(TERM_EL, "$x") @@ -98,19 +104,19 @@ LIB_PREFIX='lib' LIB_SUFFIX='.dylib' LDFLAGS_RPATH='-Wl,-rpath,${libdir}' PLUGIN_CFLAGS='-fPIC -DPIC' PLUGIN_LDFLAGS='-bundle -undefined dynamic_lookup' - PLUGIN_SUFFIX='.impl' - 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' + PLUGIN_SUFFIX='.bundle' + INSTALL_LIB='&& ${INSTALL} -m 755 $$i ${DESTDIR}${libdir}/$${i%.dylib}.${LIB_MAJOR}.${LIB_MINOR}.dylib && install_name_tool -id ${libdir}/$${i%.dylib}.${LIB_MAJOR}.dylib ${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' CLEAN_LIB='' ;; solaris*) AC_MSG_RESULT(Solaris) LIB_CFLAGS='-fPIC -DPIC' - LIB_LDFLAGS='-shared -Wl,-soname=${LIB}.${LIB_MAJOR}.${LIB_MINOR}' + LIB_LDFLAGS='-shared -Wl,-soname=${SHARED_LIB}.${LIB_MAJOR}.${LIB_MINOR}' LIB_PREFIX='lib' LIB_SUFFIX='.so' LDFLAGS_RPATH='-Wl,-rpath,${libdir}' PLUGIN_CFLAGS='-fPIC -DPIC' PLUGIN_LDFLAGS='-shared' @@ -134,25 +140,25 @@ CLEAN_LIB='' ;; cygwin* | mingw*) AC_MSG_RESULT(Win32) LIB_CFLAGS='' - LIB_LDFLAGS='-shared -Wl,--out-implib,${LIB}.a' + LIB_LDFLAGS='-shared -Wl,--out-implib,${SHARED_LIB}.a' LIB_PREFIX='lib' LIB_SUFFIX='.dll' LDFLAGS_RPATH='-Wl,-rpath,${libdir}' PLUGIN_CFLAGS='' PLUGIN_LDFLAGS='-shared' PLUGIN_SUFFIX='.dll' INSTALL_LIB='&& ${MKDIR_P} ${DESTDIR}${bindir} && ${INSTALL} -m 755 $$i ${DESTDIR}${bindir}/$$i && ${INSTALL} -m 755 $$i.a ${DESTDIR}${libdir}/$$i.a' UNINSTALL_LIB='&& rm -f ${DESTDIR}${bindir}/$$i ${DESTDIR}${libdir}/$$i.a' - CLEAN_LIB='${LIB}.a' + CLEAN_LIB='${SHARED_LIB}.a' ;; *) AC_MSG_RESULT(GNU) LIB_CFLAGS='-fPIC -DPIC' - LIB_LDFLAGS='-shared -Wl,-soname=${LIB}.${LIB_MAJOR}' + LIB_LDFLAGS='-shared -Wl,-soname=${SHARED_LIB}.${LIB_MAJOR}' LIB_PREFIX='lib' LIB_SUFFIX='.so' LDFLAGS_RPATH='-Wl,-rpath,${libdir}' PLUGIN_CFLAGS='-fPIC -DPIC' PLUGIN_LDFLAGS='-shared' Index: src/Makefile ================================================================== --- src/Makefile +++ src/Makefile @@ -1,11 +1,11 @@ include ../extra.mk -LIB = ${OBJXMPP_SHARED_LIB} +SHARED_LIB = ${OBJXMPP_SHARED_LIB} +STATIC_LIB = ${OBJXMPP_STATIC_LIB} LIB_MAJOR = 0 LIB_MINOR = 0 -STATIC_LIB = ${OBJXMPP_STATIC_LIB} SRCS = XMPPAuthenticator.m \ XMPPCallback.m \ XMPPConnection.m \ XMPPExceptions.m \