Use ACX_PROG_CMP_IGNORE_INITIAL in gas
authorAlan Modra <amodra@gmail.com>
Mon, 21 Nov 2016 09:48:41 +0000 (20:18 +1030)
committerAlan Modra <amodra@gmail.com>
Mon, 21 Nov 2016 10:42:37 +0000 (21:12 +1030)
* configure.ac: Invoke ACX_PROG_CMP_IGNORE_INITIAL.
* Makefile.am (comparison): Rewrite using do_compare.
* configure: Regenerate.
* Makefile.in: Regenerate.
* doc/Makefile.in: Regenerate.

gas/ChangeLog
gas/Makefile.am
gas/Makefile.in
gas/configure
gas/configure.ac
gas/doc/Makefile.in

index c95decc6bf9c5c5bf68a606080b8ecde19f96531..589c986c9099d91b024148eab597f69414b98462 100644 (file)
@@ -1,3 +1,11 @@
+2016-11-21  Alan Modra  <amodra@gmail.com>
+
+       * configure.ac: Invoke ACX_PROG_CMP_IGNORE_INITIAL.
+       * Makefile.am (comparison): Rewrite using do_compare.
+       * configure: Regenerate.
+       * Makefile.in: Regenerate.
+       * doc/Makefile.in: Regenerate.
+
 2016-11-18  Claudiu Zissulescu  <claziss@synopsys.com>
 
        * testsuite/gas/arc/cl-warn.s: New file.
index cdaf9f5a16c1bb1fd7c3076b7a5033e538cf6f69..cac7c7f8fdc67d79f9fc1e3537089076ec0a99e4 100644 (file)
@@ -667,21 +667,15 @@ stage3:
 
 against=stage2
 
-# This rule is derived from corresponding code in the Makefile.in for gcc.
-# The "tail +16c" is to bypass headers which may include timestamps or
-# temporary assembly file names.
 comparison:
        x=0 ; \
        for file in *.@OBJEXT@ ; do \
-         tail +16c ./$$file > tmp-foo1; \
-         if tail +16c ${against}/$$file > tmp-foo2 2>/dev/null ; then \
-           if cmp tmp-foo1 tmp-foo2 ; then \
-             true ; \
-           else \
-             echo $$file differs ; \
-             x=1 ; \
-           fi ; \
-         else true; fi ; \
+         f1=./$$file; f2=${against}/$$file; \
+         $(do_compare) > /dev/null 2>&1; \
+         if test $$? -ne 0; then \
+           echo $$file differs ; \
+           x=1 ; \
+         fi ; \
        done ; \
        exit $$x
        -rm -f tmp-foo*
index 84f746dd1edd3fb5e2f343d226348397f55e66c7..70578ad72fb4eab6010cb65c3718e7b1aa063c8d 100644 (file)
@@ -282,6 +282,7 @@ builddir = @builddir@
 cgen_cpu_prefix = @cgen_cpu_prefix@
 datadir = @datadir@
 datarootdir = @datarootdir@
+do_compare = @do_compare@
 docdir = @docdir@
 dvidir = @dvidir@
 exec_prefix = @exec_prefix@
@@ -2745,21 +2746,15 @@ stage3:
        -mv $(STAGESTUFF) stage3
        if [ -f stage3/as-new$(EXEEXT) -a ! -f stage3/as$(EXEEXT) ] ; then (cd stage3 ; ln -s as-new as$(EXEEXT)) ; fi
 
-# This rule is derived from corresponding code in the Makefile.in for gcc.
-# The "tail +16c" is to bypass headers which may include timestamps or
-# temporary assembly file names.
 comparison:
        x=0 ; \
        for file in *.@OBJEXT@ ; do \
-         tail +16c ./$$file > tmp-foo1; \
-         if tail +16c ${against}/$$file > tmp-foo2 2>/dev/null ; then \
-           if cmp tmp-foo1 tmp-foo2 ; then \
-             true ; \
-           else \
-             echo $$file differs ; \
-             x=1 ; \
-           fi ; \
-         else true; fi ; \
+         f1=./$$file; f2=${against}/$$file; \
+         $(do_compare) > /dev/null 2>&1; \
+         if test $$? -ne 0; then \
+           echo $$file differs ; \
+           x=1 ; \
+         fi ; \
        done ; \
        exit $$x
        -rm -f tmp-foo*
index 08d4ed0dcb1df536728798b88483c2e6b66efe8f..dbd986a2c5b05934d8745d6cd76fde8e3099c159 100755 (executable)
@@ -644,6 +644,7 @@ WARN_WRITE_STRINGS
 NO_WERROR
 WARN_CFLAGS_FOR_BUILD
 WARN_CFLAGS
+do_compare
 OTOOL64
 OTOOL
 LIPO
@@ -10986,7 +10987,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 10989 "configure"
+#line 10990 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11092,7 +11093,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11095 "configure"
+#line 11096 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11653,6 +11654,36 @@ rm -rf conftest*
 fi
 
 
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to compare bootstrapped objects" >&5
+$as_echo_n "checking how to compare bootstrapped objects... " >&6; }
+if test "${gcc_cv_prog_cmp_skip+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+   echo abfoo >t1
+  echo cdfoo >t2
+  gcc_cv_prog_cmp_skip='tail +16c $$f1 > tmp-foo1; tail +16c $$f2 > tmp-foo2; cmp tmp-foo1 tmp-foo2'
+  if cmp t1 t2 2 2 > /dev/null 2>&1; then
+    if cmp t1 t2 1 1 > /dev/null 2>&1; then
+      :
+    else
+      gcc_cv_prog_cmp_skip='cmp $$f1 $$f2 16 16'
+    fi
+  fi
+  if cmp --ignore-initial=2 t1 t2 > /dev/null 2>&1; then
+    if cmp --ignore-initial=1 t1 t2 > /dev/null 2>&1; then
+      :
+    else
+      gcc_cv_prog_cmp_skip='cmp --ignore-initial=16 $$f1 $$f2'
+    fi
+  fi
+  rm t1 t2
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_prog_cmp_skip" >&5
+$as_echo "$gcc_cv_prog_cmp_skip" >&6; }
+do_compare="$gcc_cv_prog_cmp_skip"
+
+
 
 # Check whether --enable-targets was given.
 if test "${enable_targets+set}" = set; then :
index c0d59897c824715be64bfa3a30333e18efb82563..b830d9e43c394aad79377a2b2d8f3e6de1379f2a 100644 (file)
@@ -40,6 +40,7 @@ AC_USE_SYSTEM_EXTENSIONS
 
 LT_INIT
 ACX_LARGEFILE
+ACX_PROG_CMP_IGNORE_INITIAL
 
 AC_ARG_ENABLE(targets,
 [  --enable-targets        alternative target configurations besides the primary],
index 474bd481cd52fbc1acd36cfb7877e1e10770e22f..71101928e27b83e10a3b4bb0894719d35df15711 100644 (file)
@@ -257,6 +257,7 @@ builddir = @builddir@
 cgen_cpu_prefix = @cgen_cpu_prefix@
 datadir = @datadir@
 datarootdir = @datarootdir@
+do_compare = @do_compare@
 docdir = @docdir@
 dvidir = @dvidir@
 exec_prefix = @exec_prefix@