In whitespace canonicalization, find a suitable make automatically
authorDavid Lichteblau <david@lichteblau.com>
Wed, 6 Jun 2012 14:23:26 +0000 (16:23 +0200)
committerDavid Lichteblau <david@lichteblau.com>
Fri, 8 Jun 2012 12:24:10 +0000 (14:24 +0200)
tools-for-build/whitespacely-canonical-filenames

index e044375..d4a5041 100755 (executable)
@@ -22,8 +22,17 @@ else
     find_opt=""
 fi
 
-for source_extension in $source_extensions; do 
-    find . \( \
+# SunOS find does not support -path.  Try to find a binary which does.
+if   [ -n "$GNUFIND" ];        then ;
+elif which gfind >/dev/null;   then GNUFIND=gfind
+elif which gnufind >/dev/null; then GNUFIND=gnufind
+else                                GNUFIND=find; fi
+if ! "$GNUFIND" /dev/null -path dummy 2>/dev/null; then
+    echo "Warning: $GNUFIND might not be GNU: use of -path fails." 1>&2
+fi
+
+for source_extension in $source_extensions; do
+    "$GNUFIND" . \( \
             -path contrib/asdf -o \
             -name _darcs -o \
             -name '{arch}' -o \