Index: buildsys.mk.in ================================================================== --- buildsys.mk.in +++ buildsys.mk.in @@ -1,7 +1,7 @@ # -# Copyright (c) 2007, 2008, 2009, 2010, 2011, 2012 +# Copyright (c) 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014 # Jonathan Schleifer # # https://webkeks.org/git/?p=buildsys.git # # Permission to use, copy, modify, and/or distribute this software for any @@ -107,20 +107,26 @@ MO_FILES = ${LOCALES:.po=.mo} .SILENT: .SUFFIXES: .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} +.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} ${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} post-all + +pre-all post-all: subdirs: ${SUBDIRS} +subdirs-after: ${SUBDIRS_AFTER} -${SUBDIRS}: +${SUBDIRS} ${SUBDIRS_AFTER}: for i in $@; do \ ${DIR_ENTER}; \ ${MAKE} ${MFLAGS} || exit $$?; \ ${DIR_LEAVE}; \ done @@ -202,10 +208,11 @@ pre-depend: ${PROG} ${PROG_NOINST}: ${EXT_DEPS} ${OBJS} ${OBJS_EXTRA} ${LINK_STATUS} + out="$@"; \ if ${LD} -o $@ ${OBJS} ${OBJS_EXTRA} ${LDFLAGS} ${LIBS}; then \ ${LINK_OK}; \ else \ ${LINK_FAILED}; \ fi @@ -225,11 +232,12 @@ ${LINK_FAILED}; \ fi \ fi ${SHARED_LIB} ${SHARED_LIB_NOINST}: ${EXT_DEPS} ${LIB_OBJS} ${LIB_OBJS_EXTRA} - ${LINK_STATUS}; \ + ${LINK_STATUS} + out="$@"; \ objs=""; \ ars=""; \ for i in ${LIB_OBJS} ${LIB_OBJS_EXTRA}; do \ case $$i in \ *.a) \ @@ -261,10 +269,11 @@ rm -fr $$dir; \ done ${PLUGIN} ${PLUGIN_NOINST}: ${EXT_DEPS} ${PLUGIN_OBJS} ${LINK_STATUS} + out="$@"; \ objs=""; \ ars=""; \ for i in ${PLUGIN_OBJS}; do \ case $$i in \ *.a) \ @@ -297,10 +306,11 @@ done ${STATIC_LIB} ${STATIC_LIB_NOINST}: ${EXT_DEPS} ${OBJS} ${OBJS_EXTRA} ${LINK_STATUS} rm -f $@ + out="$@"; \ objs=""; \ ars=""; \ for i in ${OBJS} ${OBJS_EXTRA}; do \ case $$i in \ *.a) \ @@ -334,10 +344,11 @@ done ${STATIC_PIC_LIB} ${STATIC_PIC_LIB_NOINST}: ${EXT_DEPS} ${LIB_OBJS} ${LIB_OBJS_EXTRA} ${LINK_STATUS} rm -f $@ + out="$@"; \ objs=""; \ ars=""; \ for i in ${LIB_OBJS} ${LIB_OBJS_EXTRA}; do \ case $$i in \ *.a) \ @@ -372,54 +383,68 @@ locales: ${MO_FILES} .c.o: ${COMPILE_STATUS} + in="$<"; \ + out="$@"; \ if ${CC} ${CFLAGS} ${CPPFLAGS} -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 \ ${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 \ ${COMPILE_PLUGIN_OK}; \ else \ ${COMPILE_PLUGIN_FAILED}; \ fi .cc.o .cxx.o: ${COMPILE_STATUS} + in="$<"; \ + out="$@"; \ if ${CXX} ${CXXFLAGS} ${CPPFLAGS} -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 \ ${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 \ ${COMPILE_PLUGIN_OK}; \ else \ ${COMPILE_PLUGIN_FAILED}; \ fi .d.o: ${COMPILE_STATUS} + in="$<"; \ + out="$@"; \ if test x"$(basename ${DC})" = x"dmd"; then \ if ${DC} ${DFLAGS} -c -of$@ $<; then \ ${COMPILE_OK}; \ else \ ${COMPILE_FAILED}; \ @@ -432,138 +457,172 @@ fi \ fi .erl.beam: ${COMPILE_STATUS} + in="$<"; \ + out="$@"; \ if ${ERLC} ${ERLCFLAGS} -o $@ $<; then \ ${COMPILE_OK}; \ else \ ${COMPILE_FAILED}; \ fi .java.class: ${COMPILE_STATUS} + in="$<"; \ + out="$@"; \ if ${JAVAC} ${JAVACFLAGS} $<; then \ ${COMPILE_OK}; \ else \ ${COMPILE_FAILED}; \ fi .m.o: ${COMPILE_STATUS} + in="$<"; \ + out="$@"; \ if ${OBJC} ${OBJCFLAGS} ${CPPFLAGS} -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 \ ${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 \ ${COMPILE_PLUGIN_OK}; \ else \ ${COMPILE_PLUGIN_FAILED}; \ fi .mm.o: ${COMPILE_STATUS} + in="$<"; \ + out="$@"; \ if ${OBJCXX} ${OBJCXXFLAGS} ${OBJCFLAGS} ${CXXFLAGS} ${CPPFLAGS} -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 \ ${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 \ ${COMPILE_PLUGIN_OK}; \ else \ ${COMPILE_PLUGIN_FAILED}; \ fi .po.mo: ${COMPILE_STATUS} + in="$<"; \ + out="$@"; \ if ${MSGFMT} -c -o $@ $<; then \ ${COMPILE_OK}; \ else \ ${COMPILE_FAILED}; \ fi .py.pyc: ${COMPILE_STATUS} + in="$<"; \ + out="$@"; \ if ${PYTHON} ${PYTHON_FLAGS} -c "import py_compile; py_compile.compile('$<')"; then \ ${COMPILE_OK}; \ else \ ${COMPILE_FAILED}; \ fi .rc.o .rc.lib.o .rc.plugin.o: ${COMPILE_STATUS} + in="$<"; \ + out="$@"; \ if ${WINDRES} ${CPPFLAGS} -J rc -O coff -o $@ $<; then \ ${COMPILE_OK}; \ else \ ${COMPILE_FAILED}; \ fi .S.o: ${COMPILE_STATUS} + in="$<"; \ + out="$@"; \ if ${AS} ${ASFLAGS} ${CPPFLAGS} -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 \ ${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 \ ${COMPILE_PLUGIN_OK}; \ else \ ${COMPILE_PLUGIN_FAILED}; \ fi .xpm.o: ${COMPILE_STATUS} + in="$<"; \ + out="$@"; \ if ${CC} ${CFLAGS} ${CPPFLAGS} -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 \ ${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 \ ${COMPILE_PLUGIN_OK}; \ else \ ${COMPILE_PLUGIN_FAILED}; \ fi install: all install-extra - for i in ${SUBDIRS}; do \ + for i in ${SUBDIRS} ${SUBDIRS_AFTER}; do \ ${DIR_ENTER}; \ ${MAKE} ${MFLAGS} install || exit $$?; \ ${DIR_LEAVE}; \ done @@ -640,11 +699,11 @@ done install-extra: uninstall: uninstall-extra - for i in ${SUBDIRS}; do \ + for i in ${SUBDIRS} ${SUBDIRS_AFTER}; do \ ${DIR_ENTER}; \ ${MAKE} ${MFLAGS} uninstall || exit $$?; \ ${DIR_LEAVE}; \ done @@ -733,11 +792,11 @@ done uninstall-extra: clean: - for i in ${SUBDIRS}; do \ + for i in ${SUBDIRS} ${SUBDIRS_AFTER}; do \ ${DIR_ENTER}; \ ${MAKE} ${MFLAGS} clean || exit $$?; \ ${DIR_LEAVE}; \ done @@ -750,11 +809,11 @@ fi \ fi \ done distclean: clean - for i in ${SUBDIRS}; do \ + for i in ${SUBDIRS} ${SUBDIRS_AFTER}; do \ ${DIR_ENTER}; \ ${MAKE} ${MFLAGS} distclean || exit $$?; \ ${DIR_LEAVE}; \ done @@ -766,29 +825,30 @@ ${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 $$? -DIR_LEAVE = printf "@TERM_EL@@TERM_SETAF6@Leaving directory @TERM_BOLD@$$i@TERM_SGR0@@TERM_SETAF6@.@TERM_SGR0@\n"; cd .. || exit $$? +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 -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 = 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 = 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 = err=$$?; printf "@TERM_EL@@TERM_SETAF1@Failed to compile @TERM_BOLD@$<@TERM_SGR0@@TERM_SETAF1@ (plugin)!@TERM_SGR0@\n"; exit $$err +COMPILE_STATUS = printf "@TERM_EL@@TERM_SETAF3@Compiling @TERM_BOLD@%s@TERM_SGR0@@TERM_SETAF3@...@TERM_SGR0@\r" "$<" +COMPILE_OK = printf "@TERM_EL@@TERM_SETAF2@Successfully compiled @TERM_BOLD@%s@TERM_SGR0@@TERM_SETAF2@.@TERM_SGR0@\n" "$<" +COMPILE_FAILED = err=$$?; printf "@TERM_EL@@TERM_SETAF1@Failed to compile @TERM_BOLD@%s@TERM_SGR0@@TERM_SETAF1@!@TERM_SGR0@\n" "$<"; exit $$err +COMPILE_LIB_STATUS = printf "@TERM_EL@@TERM_SETAF3@Compiling @TERM_BOLD@%s@TERM_SGR0@@TERM_SETAF3@ (lib)...@TERM_SGR0@\r" "$<" +COMPILE_LIB_OK = printf "@TERM_EL@@TERM_SETAF2@Successfully compiled @TERM_BOLD@%s@TERM_SGR0@@TERM_SETAF2@ (lib).@TERM_SGR0@\n" "$<" +COMPILE_LIB_FAILED = err=$$?; printf "@TERM_EL@@TERM_SETAF1@Failed to compile @TERM_BOLD@%s@TERM_SGR0@@TERM_SETAF1@ (lib)!@TERM_SGR0@\n" "$<"; exit $$err +COMPILE_PLUGIN_STATUS = printf "@TERM_EL@@TERM_SETAF3@Compiling @TERM_BOLD@%s@TERM_SGR0@@TERM_SETAF3@ (plugin)...@TERM_SGR0@\r" "$<" +COMPILE_PLUGIN_OK = printf "@TERM_EL@@TERM_SETAF2@Successfully compiled @TERM_BOLD@%s@TERM_SGR0@@TERM_SETAF2@ (plugin).@TERM_SGR0@\n" "$<" +COMPILE_PLUGIN_FAILED = err=$$?; printf "@TERM_EL@@TERM_SETAF1@Failed to compile @TERM_BOLD@%s@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 = 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 = 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 = err=$$?; printf "@TERM_EL@@TERM_SETAF1@Failed to delete @TERM_BOLD@$$i@TERM_SGR0@@TERM_SETAF1@!@TERM_SGR0@\n"; exit $$err +INSTALL_STATUS = printf "@TERM_EL@@TERM_SETAF3@Installing @TERM_BOLD@%s@TERM_SGR0@@TERM_SETAF3@...@TERM_SGR0@\r" "$$i" +INSTALL_OK = printf "@TERM_EL@@TERM_SETAF2@Successfully installed @TERM_BOLD@%s@TERM_SGR0@@TERM_SETAF2@.@TERM_SGR0@\n" "$$i" +INSTALL_FAILED = err=$$?; printf "@TERM_EL@@TERM_SETAF1@Failed to install @TERM_BOLD@%s@TERM_SGR0@@TERM_SETAF1@!@TERM_SGR0@\n" "$$i"; exit $$err +DELETE_OK = printf "@TERM_EL@@TERM_SETAF4@Deleted @TERM_BOLD@%s@TERM_SGR0@@TERM_SETAF4@.@TERM_SGR0@\n" "$$i" +DELETE_FAILED = err=$$?; printf "@TERM_EL@@TERM_SETAF1@Failed to delete @TERM_BOLD@%s@TERM_SGR0@@TERM_SETAF1@!@TERM_SGR0@\n" "$$i"; exit $$err -include .deps +.CURDIR ?= . +include ${.CURDIR}/.deps Index: configure.ac ================================================================== --- configure.ac +++ configure.ac @@ -1,6 +1,7 @@ AC_INIT(ObjXMPP, 0.1, js@webkeks.org) +BUILDSYS_INIT AC_CONFIG_SRCDIR(src) AC_CHECK_TOOL(OBJFW_CONFIG, objfw-config) AS_IF([test x"$OBJFW_CONFIG" = x""], [ AC_MSG_ERROR(You need ObjFW and objfw-config installed!) @@ -87,11 +88,11 @@ PKG_CHECK_MODULES(libidn, [libidn >= 0.25], [ CPPFLAGS="$CPPFLAGS $libidn_CFLAGS" LIBS="$LIBS $libidn_LIBS" ], [ - AC_MSG_ERROR(You need at least libidn 2.5 installed!) + AC_MSG_ERROR(You need libidn >= 2.5 installed!) ]) AS_IF([test x"$GOBJC" = x"yes"], [ OBJCFLAGS="$OBJCFLAGS -Wwrite-strings -Wpointer-arith" dnl We need -Wno-deprecated-declarations as OpenSSL is deprecated on Index: m4/buildsys.m4 ================================================================== --- m4/buildsys.m4 +++ m4/buildsys.m4 @@ -1,7 +1,7 @@ dnl -dnl Copyright (c) 2007, 2008, 2009, 2010, 2011, 2012 +dnl Copyright (c) 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014 dnl Jonathan Schleifer dnl dnl https://webkeks.org/git/?p=buildsys.git dnl dnl Permission to use, copy, modify, and/or distribute this software for any @@ -19,69 +19,80 @@ dnl CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) dnl ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE dnl POSSIBILITY OF SUCH DAMAGE. dnl -AC_CONFIG_COMMANDS_PRE([ - 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") - else - AC_SUBST(TERM_EL, "$($TPUT ce 2>/dev/null)") - fi - - if x=$($TPUT sgr0 2>/dev/null); then - AC_SUBST(TERM_SGR0, "$x") - else - AC_SUBST(TERM_SGR0, "$($TPUT me 2>/dev/null)") - fi - - if x=$($TPUT bold 2>/dev/null); then - AC_SUBST(TERM_BOLD, "$x") - else - AC_SUBST(TERM_BOLD, "$($TPUT md 2>/dev/null)") - fi - - if x=$($TPUT setaf 1 2>/dev/null); then - AC_SUBST(TERM_SETAF1, "$x") - AC_SUBST(TERM_SETAF2, "$($TPUT setaf 2 2>/dev/null)") - AC_SUBST(TERM_SETAF3, "$($TPUT setaf 3 2>/dev/null)") - AC_SUBST(TERM_SETAF4, "$($TPUT setaf 4 2>/dev/null)") - AC_SUBST(TERM_SETAF6, "$($TPUT setaf 6 2>/dev/null)") - else - AC_SUBST(TERM_SETAF1, "$($TPUT AF 1 2>/dev/null)") - AC_SUBST(TERM_SETAF2, "$($TPUT AF 2 2>/dev/null)") - AC_SUBST(TERM_SETAF3, "$($TPUT AF 3 2>/dev/null)") - AC_SUBST(TERM_SETAF4, "$($TPUT AF 4 2>/dev/null)") - AC_SUBST(TERM_SETAF6, "$($TPUT AF 6 2>/dev/null)") - fi - ], [ - AC_SUBST(TERM_EL, '\033\133K') - AC_SUBST(TERM_SGR0, '\033\133m') - AC_SUBST(TERM_BOLD, '\033\1331m') - AC_SUBST(TERM_SETAF1, '\033\13331m') - AC_SUBST(TERM_SETAF2, '\033\13332m') - AC_SUBST(TERM_SETAF3, '\033\13333m') - AC_SUBST(TERM_SETAF4, '\033\13334m') - AC_SUBST(TERM_SETAF6, '\033\13336m') - ]) -]) - -AC_CONFIG_COMMANDS_POST([ - ${as_echo:="echo"} ${as_me:="configure"}": touching .deps files" - for i in $(find . -name Makefile); do - DEPSFILE="$(dirname $i)/.deps" - test -f "$DEPSFILE" && rm "$DEPSFILE" - touch -t 0001010000 "$DEPSFILE" - done +AC_DEFUN([BUILDSYS_INIT], [ + AC_CONFIG_COMMANDS_PRE([ + 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") + else + AC_SUBST(TERM_EL, "$($TPUT ce 2>/dev/null)") + fi + + if x=$($TPUT sgr0 2>/dev/null); then + AC_SUBST(TERM_SGR0, "$x") + else + AC_SUBST(TERM_SGR0, "$($TPUT me 2>/dev/null)") + fi + + if x=$($TPUT bold 2>/dev/null); then + AC_SUBST(TERM_BOLD, "$x") + else + AC_SUBST(TERM_BOLD, "$($TPUT md 2>/dev/null)") + fi + + if x=$($TPUT setaf 1 2>/dev/null); then + AC_SUBST(TERM_SETAF1, "$x") + AC_SUBST(TERM_SETAF2, + "$($TPUT setaf 2 2>/dev/null)") + AC_SUBST(TERM_SETAF3, + "$($TPUT setaf 3 2>/dev/null)") + AC_SUBST(TERM_SETAF4, + "$($TPUT setaf 4 2>/dev/null)") + AC_SUBST(TERM_SETAF6, + "$($TPUT setaf 6 2>/dev/null)") + else + AC_SUBST(TERM_SETAF1, + "$($TPUT AF 1 2>/dev/null)") + AC_SUBST(TERM_SETAF2, + "$($TPUT AF 2 2>/dev/null)") + AC_SUBST(TERM_SETAF3, + "$($TPUT AF 3 2>/dev/null)") + AC_SUBST(TERM_SETAF4, + "$($TPUT AF 4 2>/dev/null)") + AC_SUBST(TERM_SETAF6, + "$($TPUT AF 6 2>/dev/null)") + fi + ], [ + AC_SUBST(TERM_EL, '\033\133K') + AC_SUBST(TERM_SGR0, '\033\133m') + AC_SUBST(TERM_BOLD, '\033\1331m') + AC_SUBST(TERM_SETAF1, '\033\13331m') + AC_SUBST(TERM_SETAF2, '\033\13332m') + AC_SUBST(TERM_SETAF3, '\033\13333m') + AC_SUBST(TERM_SETAF4, '\033\13334m') + AC_SUBST(TERM_SETAF6, '\033\13336m') + ]) + ]) + + AC_CONFIG_COMMANDS_POST([ + ${as_echo:="echo"} ${as_me:="configure"}": touching .deps files" + for i in $(find . -name Makefile); do + DEPSFILE="$(dirname $i)/.deps" + test -f "$DEPSFILE" && rm "$DEPSFILE" + touch -t 0001010000 "$DEPSFILE" + done + ]) ]) AC_DEFUN([BUILDSYS_PROG_IMPLIB], [ AC_REQUIRE([AC_CANONICAL_HOST]) AC_MSG_CHECKING(whether we need an implib) @@ -107,20 +118,48 @@ 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}' + LIB_LDFLAGS='-dynamiclib -current_version ${LIB_MAJOR}.${LIB_MINOR} -compatibility_version ${LIB_MAJOR} -Wl,-install_name,${libdir}/$${out%.dylib}.${LIB_MAJOR}.dylib' LIB_PREFIX='lib' LIB_SUFFIX='.dylib' LDFLAGS_RPATH='-Wl,-rpath,${libdir}' 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 && 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' + 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' CLEAN_LIB='' + ;; + mingw* | cygwin*) + AC_MSG_RESULT(MinGW / Cygwin) + LIB_CFLAGS='' + 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='${SHARED_LIB}.a' + ;; + openbsd* | mirbsd*) + AC_MSG_RESULT(OpenBSD) + LIB_CFLAGS='-fPIC -DPIC' + LIB_LDFLAGS='-shared' + LIB_PREFIX='lib' + LIB_SUFFIX='.so.${LIB_MAJOR}.${LIB_MINOR}' + LDFLAGS_RPATH='-Wl,-rpath,${libdir}' + PLUGIN_CFLAGS='-fPIC -DPIC' + PLUGIN_LDFLAGS='-shared' + PLUGIN_SUFFIX='.so' + INSTALL_LIB='&& ${INSTALL} -m 755 $$i ${DESTDIR}${libdir}/$$i' + UNINSTALL_LIB='&& rm -f ${DESTDIR}${libdir}/$$i' + CLEAN_LIB='' ;; solaris*) AC_MSG_RESULT(Solaris) LIB_CFLAGS='-fPIC -DPIC' LIB_LDFLAGS='-shared -Wl,-soname=${SHARED_LIB}.${LIB_MAJOR}.${LIB_MINOR}' @@ -132,40 +171,12 @@ 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='' ;; - openbsd* | mirbsd*) - AC_MSG_RESULT(OpenBSD) - LIB_CFLAGS='-fPIC -DPIC' - LIB_LDFLAGS='-shared' - LIB_PREFIX='lib' - LIB_SUFFIX='.so.${LIB_MAJOR}.${LIB_MINOR}' - LDFLAGS_RPATH='-Wl,-rpath,${libdir}' - PLUGIN_CFLAGS='-fPIC -DPIC' - PLUGIN_LDFLAGS='-shared' - PLUGIN_SUFFIX='.so' - INSTALL_LIB='&& ${INSTALL} -m 755 $$i ${DESTDIR}${libdir}/$$i' - UNINSTALL_LIB='&& rm -f ${DESTDIR}${libdir}/$$i' - CLEAN_LIB='' - ;; - cygwin* | mingw*) - AC_MSG_RESULT(Win32) - LIB_CFLAGS='' - 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='${SHARED_LIB}.a' - ;; *) - AC_MSG_RESULT(GNU) + AC_MSG_RESULT(ELF) LIB_CFLAGS='-fPIC -DPIC' LIB_LDFLAGS='-shared -Wl,-soname=${SHARED_LIB}.${LIB_MAJOR}' LIB_PREFIX='lib' LIB_SUFFIX='.so' LDFLAGS_RPATH='-Wl,-rpath,${libdir}'