From 7f936c04a9b2d1c16363329272fb405faa6637e9 Mon Sep 17 00:00:00 2001 From: jay Date: Tue, 3 Jul 2007 23:00:34 +0000 Subject: [PATCH] Fix Savannah bug #20310: If we are cross compiling, assume sort -z does not work on the target --- ChangeLog | 4 +++ NEWS | 4 +++ m4/nullsort.m4 | 79 +++++++++++++++++++++++++++++++++------------------------- 3 files changed, 53 insertions(+), 34 deletions(-) rewrite m4/nullsort.m4 (74%) diff --git a/ChangeLog b/ChangeLog index 80cb149..0ca50aa 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2007-07-03 James Youngman + Fix Savannah bug #20310. + * m4/nullsort.m4: If we are cross compiling, assume "sort -z" does + not work on the target. + Manpage improvements. * find/find.1: More consistent use of quotation marks. * locate/locate.1 (HISTORY): New section. diff --git a/NEWS b/NEWS index aa74235..56b3fa3 100644 --- a/NEWS +++ b/NEWS @@ -7,6 +7,10 @@ Findutils version 4.3.9 is released under version 3 of the GNU General Public License. ** Bug Fixes +#20310: configure uses hosts's support status for "sort -z" when +generating athe updfatedb script for use on the target. This is not a +reliable strategy, so assume no support for -z when cross compiling. + #20263: Compilation fix for DEC Alpha OSF/1 cc, which forbids the ordering comparison of function pointers. diff --git a/m4/nullsort.m4 b/m4/nullsort.m4 dissimilarity index 74% index 8173448..e34627b 100644 --- a/m4/nullsort.m4 +++ b/m4/nullsort.m4 @@ -1,34 +1,45 @@ -AC_DEFUN([jy_SORTZ], - [AC_PATH_PROG([SORT], [sort], [sort]) - AC_MSG_CHECKING([if $SORT supports the -z option]) -# find out if the sort command has a working -z option. -if $SORT -z -c < "${srcdir:-.}/m4/order-good.bin" 2>/dev/null >/dev/null -then - # sort has a -z option, but we have not yet established that - # sort thinks there is more than one input line there. We have - # to make sort -c do its thing with the input lines in the wrong - # order to determine that (we can't do it in one shot because - # if sort returns nonzero we cant tell that it wasn't just - # complaining about this unknown -z option. - if $SORT -z -c < "${srcdir:-.}/m4/order-bad.bin" 2>/dev/null >/dev/null - then - # sort likes -z but it doesn't seem to make \0 - # a delimiter. - ac_sort_has_z=false - else - ac_sort_has_z=true - fi -else - # Doesn't like the z option. - ac_sort_has_z=false -fi -if $ac_sort_has_z -then - AC_MSG_RESULT([yes]) - AC_SUBST(SORT_SUPPORTS_Z,[true]) -else - AC_MSG_RESULT([no]) - AC_SUBST(SORT_SUPPORTS_Z,[false]) -fi -]) - +AC_DEFUN([jy_SORTZ], + [AC_PATH_PROG([SORT], [sort], [sort]) + AC_MSG_CHECKING([if $SORT supports the -z option]) +if test "x$cross_compiling" = xyes +then + # We are cross-compiling, so cannot test the target's "sort". + ac_sort_has_z=false +else + # find out if the sort command has a working -z option. + if $SORT -z -c < "${srcdir:-.}/m4/order-good.bin" 2>/dev/null >/dev/null + then + # sort has a -z option, but we have not yet established that + # sort thinks there is more than one input line there. We have + # to make sort -c do its thing with the input lines in the wrong + # order to determine that (we can't do it in one shot because + # if sort returns nonzero we cant tell that it wasn't just + # complaining about this unknown -z option. + if $SORT -z -c < "${srcdir:-.}/m4/order-bad.bin" 2>/dev/null >/dev/null + then + # sort likes -z but it doesn't seem to make \0 + # a delimiter. + ac_sort_has_z=false + else + ac_sort_has_z=true + fi + else + # Doesn't like the z option. + ac_sort_has_z=false + fi +fi + +if test "x$cross_compiling" = xyes +then + AC_MSG_RESULT([assume no, since we are cross compiling]) + AC_SUBST(SORT_SUPPORTS_Z,[false]) +elif $ac_sort_has_z +then + AC_MSG_RESULT([yes]) + AC_SUBST(SORT_SUPPORTS_Z,[true]) +else + AC_MSG_RESULT([no]) + AC_SUBST(SORT_SUPPORTS_Z,[false]) +fi +]) + -- 2.11.4.GIT