From 9cc8a20d34d20ff4ed607c241d2e6bb263890e3d Mon Sep 17 00:00:00 2001 From: Lucas De Marchi Date: Tue, 10 Mar 2015 15:17:03 -0300 Subject: [PATCH] build: sync dolt with upstream --- Makefile.am | 3 +++ m4/dolt.m4 | 55 ++++++++++++++++++++++++++++------------------------- 2 files changed, 32 insertions(+), 26 deletions(-) diff --git a/Makefile.am b/Makefile.am index caf18b6c..94576553 100644 --- a/Makefile.am +++ b/Makefile.am @@ -7,6 +7,7 @@ endif DISTCLEAN_LOCAL_HOOKS = EXTRA_DIST = CLEANFILES = $(BUILT_FILES) +DISTCLEANFILES = BUILT_FILES = ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS} AM_MAKEFLAGS = --no-print-directory @@ -381,6 +382,8 @@ distclean-local: $(DISTCLEAN_LOCAL_HOOKS) buildtest-TESTS: $(MAKE) $(AM_MAKEFLAGS) $(check_LTLIBRARIES) $(check_PROGRAMS) +DISTCLEANFILES += $(DOLT_CLEANFILES) + # ------------------------------------------------------------------------------ # coverage # ------------------------------------------------------------------------------ diff --git a/m4/dolt.m4 b/m4/dolt.m4 index af76e9d3..775a5725 100644 --- a/m4/dolt.m4 +++ b/m4/dolt.m4 @@ -12,32 +12,24 @@ AC_DEFUN([DOLT], [ AC_REQUIRE([AC_CANONICAL_HOST]) # dolt, a replacement for libtool # Josh Triplett -AC_PATH_PROG(DOLT_BASH, bash) +AC_PATH_PROG([DOLT_BASH], [bash]) AC_MSG_CHECKING([if dolt supports this host]) dolt_supported=yes -if test x$DOLT_BASH = x; then - dolt_supported=no -fi -if test x$GCC != xyes; then - dolt_supported=no -fi -case $host in -*-*-linux* \ -|amd64-*-freebsd*|i?86-*-freebsd*|ia64-*-freebsd*) - pic_options='-fPIC' - ;; -i?86-apple-darwin*) - pic_options='-fno-common' - ;; -*) - dolt_supported=no - ;; -esac -if test x$dolt_supported = xno ; then +AS_IF([test x$DOLT_BASH = x], [dolt_supported=no]) +AS_IF([test x$GCC != xyes], [dolt_supported=no]) + +AS_CASE([$host], + [*-*-linux*|*-*-freebsd*], [pic_options='-fPIC'], + [*-apple-darwin*], [pic_options='-fno-common'], + [*mingw*|*nacl*], [pic_options=''] + [*], [dolt_supported=no] +) +AS_IF([test x$dolt_supported = xno], [ AC_MSG_RESULT([no, falling back to libtool]) - LTCOMPILE='$(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(COMPILE)' - LTCXXCOMPILE='$(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXXCOMPILE)' -else + LTCOMPILE='$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(COMPILE)' + LTCXXCOMPILE='$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXXCOMPILE)' + m4_pattern_allow([AM_V_lt]) +], [ AC_MSG_RESULT([yes, replacing libtool]) dnl Start writing out doltcompile. @@ -81,7 +73,13 @@ pic_object="$libobjdir/$objbase.o" args@<:@$objarg@:>@="$pic_object" __DOLTCOMPILE__EOF__ cat <<__DOLTCOMPILE__EOF__ >>doltcompile -"\${args@<:@@@:>@}" $pic_options -DPIC || exit \$? + pic_options="$pic_options" + if test x\$passthrough = xtrue; then + pic_options="" + fi +__DOLTCOMPILE__EOF__ + cat <<'__DOLTCOMPILE__EOF__' >>doltcompile +"${args@<:@@@:>@}" $pic_options -DPIC || exit $? __DOLTCOMPILE__EOF__ fi @@ -155,9 +153,11 @@ modeok=false tagok=false for arg in "$[]@"; do case "$arg" in - --silent) : ;; --mode=compile) modeok=true ;; --tag=CC|--tag=CXX) tagok=true ;; + --tag=disable-static) tagok=true ;; + --tag=ASM|--tag=YASM) tagok=true; passthrough=true;; + --silent|--quiet) ;; *) args@<:@${#args[@]}@:>@="$arg" ;; esac done @@ -171,7 +171,10 @@ __DOLTLIBTOOL__EOF__ dnl Done writing out doltlibtool; substitute it for libtool. chmod +x doltlibtool LIBTOOL='$(top_builddir)/doltlibtool' -fi + +DOLT_CLEANFILES="doltlibtool doltcompile" +AC_SUBST(DOLT_CLEANFILES) +]) AC_SUBST(LTCOMPILE) AC_SUBST(LTCXXCOMPILE) # end dolt -- 2.47.2