]> git.ipfire.org Git - thirdparty/kmod.git/commitdiff
build: sync dolt with upstream
authorLucas De Marchi <lucas.demarchi@intel.com>
Tue, 10 Mar 2015 18:17:03 +0000 (15:17 -0300)
committerLucas De Marchi <lucas.demarchi@intel.com>
Tue, 10 Mar 2015 18:17:03 +0000 (15:17 -0300)
Makefile.am
m4/dolt.m4

index caf18b6cb73ab9c19943465895a3f945abc43d31..94576553b012cc7de1b1b8a12bc4f0c92041dd9c 100644 (file)
@@ -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
 # ------------------------------------------------------------------------------
index af76e9d3c99e6f171b55a7036bef57c9e146995a..775a572521b85c23628800648e35ee7f7dd386e9 100644 (file)
@@ -12,32 +12,24 @@ AC_DEFUN([DOLT], [
 AC_REQUIRE([AC_CANONICAL_HOST])
 # dolt, a replacement for libtool
 # Josh Triplett <josh@freedesktop.org>
-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