comparison gnulib-tool @ 7737:19ff03763d73

Use "sed --posix" instead of "sed" when possible.
author Bruno Haible <bruno@clisp.org>
date Fri, 22 Dec 2006 12:49:38 +0000
parents 504e81510ee5
children fc2ff707c74b
comparison
equal deleted inserted replaced
7736:8e5aece0be22 7737:19ff03763d73
20 # This program is meant for authors or maintainers which want to import 20 # This program is meant for authors or maintainers which want to import
21 # modules from gnulib into their packages. 21 # modules from gnulib into their packages.
22 22
23 progname=$0 23 progname=$0
24 package=gnulib 24 package=gnulib
25 cvsdatestamp='$Date: 2006-12-11 18:19:59 $' 25 cvsdatestamp='$Date: 2006-12-22 12:49:38 $'
26 last_checkin_date=`echo "$cvsdatestamp" | sed -e 's,^\$[D]ate: ,,'` 26 last_checkin_date=`echo "$cvsdatestamp" | sed -e 's,^\$[D]ate: ,,'`
27 version=`echo "$last_checkin_date" | sed -e 's/ .*$//' -e 's,/,-,g'` 27 version=`echo "$last_checkin_date" | sed -e 's/ .*$//' -e 's,/,-,g'`
28 nl=' 28 nl='
29 ' 29 '
30 30
68 68
69 # GNU sort is needed. Set SORT to its location (not needed if it's called 69 # GNU sort is needed. Set SORT to its location (not needed if it's called
70 # 'sort' and already in the PATH). 70 # 'sort' and already in the PATH).
71 if test -z "$SORT"; then 71 if test -z "$SORT"; then
72 SORT=sort 72 SORT=sort
73 fi
74
75 # A sed program is needed. When using GNU sed, turn off a maximum of GNU
76 # extensions, to minimize the risk of accidentally using non-portable features
77 # of GNU sed.
78 if test -z "$SED"; then
79 SED=sed
80 fi
81 if echo | $SED --posix d >/dev/null 2>&1; then
82 SED="$SED --posix"
73 fi 83 fi
74 84
75 # func_usage 85 # func_usage
76 # outputs to stdout the --help usage message. 86 # outputs to stdout the --help usage message.
77 func_usage () 87 func_usage ()
167 177
168 # func_version 178 # func_version
169 # outputs to stdout the --version message. 179 # outputs to stdout the --version message.
170 func_version () 180 func_version ()
171 { 181 {
172 year=`echo "$last_checkin_date" | sed -e 's,/.*$,,'` 182 year=`echo "$last_checkin_date" | $SED -e 's,/.*$,,'`
173 echo "\ 183 echo "\
174 $progname (GNU $package) $version 184 $progname (GNU $package) $version
175 Copyright (C) $year Free Software Foundation, Inc. 185 Copyright (C) $year Free Software Foundation, Inc.
176 This is free software; see the source for copying conditions. There is NO 186 This is free software; see the source for copying conditions. There is NO
177 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 187 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
267 else 277 else
268 func_readlink () 278 func_readlink ()
269 { 279 {
270 # Use two sed invocations. A single sed -n -e 's,^.* -> \(.*\)$,\1,p' 280 # Use two sed invocations. A single sed -n -e 's,^.* -> \(.*\)$,\1,p'
271 # would do the wrong thing if the link target contains " -> ". 281 # would do the wrong thing if the link target contains " -> ".
272 LC_ALL=C ls -l "$1" | sed -e 's, -> ,#%%#,' | sed -n -e 's,^.*#%%#\(.*\)$,\1,p' 282 LC_ALL=C ls -l "$1" | $SED -e 's, -> ,#%%#,' | $SED -n -e 's,^.*#%%#\(.*\)$,\1,p'
273 } 283 }
274 fi 284 fi
275 285
276 # func_relativize DIR1 DIR2 286 # func_relativize DIR1 DIR2
277 # computes a relative pathname RELDIR such that DIR1/RELDIR = DIR2. 287 # computes a relative pathname RELDIR such that DIR1/RELDIR = DIR2.
288 sed_first='s,^\([^/]*\)/.*$,\1,' 298 sed_first='s,^\([^/]*\)/.*$,\1,'
289 sed_rest='s,^[^/]*/*,,' 299 sed_rest='s,^[^/]*/*,,'
290 sed_last='s,^.*/\([^/]*\)$,\1,' 300 sed_last='s,^.*/\([^/]*\)$,\1,'
291 sed_butlast='s,/*[^/]*$,,' 301 sed_butlast='s,/*[^/]*$,,'
292 while test -n "$dir1"; do 302 while test -n "$dir1"; do
293 first=`echo "$dir1" | sed -e "$sed_first"` 303 first=`echo "$dir1" | $SED -e "$sed_first"`
294 if test "$first" != "."; then 304 if test "$first" != "."; then
295 if test "$first" = ".."; then 305 if test "$first" = ".."; then
296 dir2=`echo "$dir0" | sed -e "$sed_last"`/"$dir2" 306 dir2=`echo "$dir0" | $SED -e "$sed_last"`/"$dir2"
297 dir0=`echo "$dir0" | sed -e "$sed_butlast"` 307 dir0=`echo "$dir0" | $SED -e "$sed_butlast"`
298 else 308 else
299 first2=`echo "$dir2" | sed -e "$sed_first"` 309 first2=`echo "$dir2" | $SED -e "$sed_first"`
300 if test "$first2" = "$first"; then 310 if test "$first2" = "$first"; then
301 dir2=`echo "$dir2" | sed -e "$sed_rest"` 311 dir2=`echo "$dir2" | $SED -e "$sed_rest"`
302 else 312 else
303 dir2="../$dir2" 313 dir2="../$dir2"
304 fi 314 fi
305 dir0="$dir0"/"$first" 315 dir0="$dir0"/"$first"
306 fi 316 fi
307 fi 317 fi
308 dir1=`echo "$dir1" | sed -e "$sed_rest"` 318 dir1=`echo "$dir1" | $SED -e "$sed_rest"`
309 done 319 done
310 reldir="$dir2" 320 reldir="$dir2"
311 } 321 }
312 322
313 # func_relconcat DIR1 DIR2 323 # func_relconcat DIR1 DIR2
324 sed_first='s,^\([^/]*\)/.*$,\1,' 334 sed_first='s,^\([^/]*\)/.*$,\1,'
325 sed_rest='s,^[^/]*/*,,' 335 sed_rest='s,^[^/]*/*,,'
326 sed_last='s,^.*/\([^/]*\)$,\1,' 336 sed_last='s,^.*/\([^/]*\)$,\1,'
327 sed_butlast='s,/*[^/]*$,,' 337 sed_butlast='s,/*[^/]*$,,'
328 while true; do 338 while true; do
329 first=`echo "$dir2" | sed -e "$sed_first"` 339 first=`echo "$dir2" | $SED -e "$sed_first"`
330 if test "$first" = "."; then 340 if test "$first" = "."; then
331 dir2=`echo "$dir2" | sed -e "$sed_rest"` 341 dir2=`echo "$dir2" | $SED -e "$sed_rest"`
332 if test -z "$dir2"; then 342 if test -z "$dir2"; then
333 relconcat="$dir1" 343 relconcat="$dir1"
334 break 344 break
335 fi 345 fi
336 else 346 else
337 last=`echo "$dir1" | sed -e "$sed_last"` 347 last=`echo "$dir1" | $SED -e "$sed_last"`
338 while test "$last" = "."; do 348 while test "$last" = "."; do
339 dir1=`echo "$dir1" | sed -e "$sed_butlast"` 349 dir1=`echo "$dir1" | $SED -e "$sed_butlast"`
340 last=`echo "$dir1" | sed -e "$sed_last"` 350 last=`echo "$dir1" | $SED -e "$sed_last"`
341 done 351 done
342 if test -z "$dir1"; then 352 if test -z "$dir1"; then
343 relconcat="$dir2" 353 relconcat="$dir2"
344 break 354 break
345 fi 355 fi
346 if test "$first" = ".."; then 356 if test "$first" = ".."; then
347 if test "$last" = ".."; then 357 if test "$last" = ".."; then
348 relconcat="$dir1/$dir2" 358 relconcat="$dir1/$dir2"
349 break 359 break
350 fi 360 fi
351 dir1=`echo "$dir1" | sed -e "$sed_butlast"` 361 dir1=`echo "$dir1" | $SED -e "$sed_butlast"`
352 dir2=`echo "$dir2" | sed -e "$sed_rest"` 362 dir2=`echo "$dir2" | $SED -e "$sed_rest"`
353 if test -z "$dir1"; then 363 if test -z "$dir1"; then
354 relconcat="$dir2" 364 relconcat="$dir2"
355 break 365 break
356 fi 366 fi
357 if test -z "$dir2"; then 367 if test -z "$dir2"; then
377 *) # SRC is relative. 387 *) # SRC is relative.
378 case "$2" in 388 case "$2" in
379 /*) 389 /*)
380 ln -s "`pwd`/$1" "$2" ;; 390 ln -s "`pwd`/$1" "$2" ;;
381 *) # DEST is relative too. 391 *) # DEST is relative too.
382 ln_destdir=`echo "$2" | sed -e 's,[^/]*$,,'` 392 ln_destdir=`echo "$2" | $SED -e 's,[^/]*$,,'`
383 test -n "$ln_destdir" || ln_destdir="." 393 test -n "$ln_destdir" || ln_destdir="."
384 func_relativize "$ln_destdir" "$1" 394 func_relativize "$ln_destdir" "$1"
385 ln -s "$reldir" "$2" 395 ln -s "$reldir" "$2"
386 ;; 396 ;;
387 esac 397 esac
474 shift ;; 484 shift ;;
475 --megatest | --megates | --megate | --megat | --mega | --meg | --me | --m ) 485 --megatest | --megates | --megate | --megat | --mega | --meg | --me | --m )
476 mode=megatest 486 mode=megatest
477 shift ;; 487 shift ;;
478 --extract-* ) 488 --extract-* )
479 mode=`echo "X$1" | sed -e 's/^X--//'` 489 mode=`echo "X$1" | $SED -e 's/^X--//'`
480 shift ;; 490 shift ;;
481 --dir ) 491 --dir )
482 shift 492 shift
483 if test $# = 0; then 493 if test $# = 0; then
484 func_fatal_error "missing argument for --dir" 494 func_fatal_error "missing argument for --dir"
485 fi 495 fi
486 destdir=$1 496 destdir=$1
487 shift ;; 497 shift ;;
488 --dir=* ) 498 --dir=* )
489 destdir=`echo "X$1" | sed -e 's/^X--dir=//'` 499 destdir=`echo "X$1" | $SED -e 's/^X--dir=//'`
490 shift ;; 500 shift ;;
491 --local-dir ) 501 --local-dir )
492 shift 502 shift
493 if test $# = 0; then 503 if test $# = 0; then
494 func_fatal_error "missing argument for --local-dir" 504 func_fatal_error "missing argument for --local-dir"
495 fi 505 fi
496 local_gnulib_dir=$1 506 local_gnulib_dir=$1
497 shift ;; 507 shift ;;
498 --local-dir=* ) 508 --local-dir=* )
499 local_gnulib_dir=`echo "X$1" | sed -e 's/^X--local-dir=//'` 509 local_gnulib_dir=`echo "X$1" | $SED -e 's/^X--local-dir=//'`
500 shift ;; 510 shift ;;
501 --lib ) 511 --lib )
502 shift 512 shift
503 if test $# = 0; then 513 if test $# = 0; then
504 func_fatal_error "missing argument for --lib" 514 func_fatal_error "missing argument for --lib"
505 fi 515 fi
506 libname=$1 516 libname=$1
507 supplied_libname=true 517 supplied_libname=true
508 shift ;; 518 shift ;;
509 --lib=* ) 519 --lib=* )
510 libname=`echo "X$1" | sed -e 's/^X--lib=//'` 520 libname=`echo "X$1" | $SED -e 's/^X--lib=//'`
511 supplied_libname=true 521 supplied_libname=true
512 shift ;; 522 shift ;;
513 --source-base ) 523 --source-base )
514 shift 524 shift
515 if test $# = 0; then 525 if test $# = 0; then
516 func_fatal_error "missing argument for --source-base" 526 func_fatal_error "missing argument for --source-base"
517 fi 527 fi
518 sourcebase=$1 528 sourcebase=$1
519 shift ;; 529 shift ;;
520 --source-base=* ) 530 --source-base=* )
521 sourcebase=`echo "X$1" | sed -e 's/^X--source-base=//'` 531 sourcebase=`echo "X$1" | $SED -e 's/^X--source-base=//'`
522 shift ;; 532 shift ;;
523 --m4-base ) 533 --m4-base )
524 shift 534 shift
525 if test $# = 0; then 535 if test $# = 0; then
526 func_fatal_error "missing argument for --m4-base" 536 func_fatal_error "missing argument for --m4-base"
527 fi 537 fi
528 m4base=$1 538 m4base=$1
529 shift ;; 539 shift ;;
530 --m4-base=* ) 540 --m4-base=* )
531 m4base=`echo "X$1" | sed -e 's/^X--m4-base=//'` 541 m4base=`echo "X$1" | $SED -e 's/^X--m4-base=//'`
532 shift ;; 542 shift ;;
533 --doc-base ) 543 --doc-base )
534 shift 544 shift
535 if test $# = 0; then 545 if test $# = 0; then
536 func_fatal_error "missing argument for --doc-base" 546 func_fatal_error "missing argument for --doc-base"
537 fi 547 fi
538 docbase=$1 548 docbase=$1
539 shift ;; 549 shift ;;
540 --doc-base=* ) 550 --doc-base=* )
541 docbase=`echo "X$1" | sed -e 's/^X--doc-base=//'` 551 docbase=`echo "X$1" | $SED -e 's/^X--doc-base=//'`
542 shift ;; 552 shift ;;
543 --tests-base ) 553 --tests-base )
544 shift 554 shift
545 if test $# = 0; then 555 if test $# = 0; then
546 func_fatal_error "missing argument for --tests-base" 556 func_fatal_error "missing argument for --tests-base"
547 fi 557 fi
548 testsbase=$1 558 testsbase=$1
549 shift ;; 559 shift ;;
550 --tests-base=* ) 560 --tests-base=* )
551 testsbase=`echo "X$1" | sed -e 's/^X--tests-base=//'` 561 testsbase=`echo "X$1" | $SED -e 's/^X--tests-base=//'`
552 shift ;; 562 shift ;;
553 --aux-dir ) 563 --aux-dir )
554 shift 564 shift
555 if test $# = 0; then 565 if test $# = 0; then
556 func_fatal_error "missing argument for --aux-dir" 566 func_fatal_error "missing argument for --aux-dir"
557 fi 567 fi
558 auxdir=$1 568 auxdir=$1
559 shift ;; 569 shift ;;
560 --aux-dir=* ) 570 --aux-dir=* )
561 auxdir=`echo "X$1" | sed -e 's/^X--aux-dir=//'` 571 auxdir=`echo "X$1" | $SED -e 's/^X--aux-dir=//'`
562 shift ;; 572 shift ;;
563 --with-tests ) 573 --with-tests )
564 inctests=true 574 inctests=true
565 shift ;; 575 shift ;;
566 --avoid ) 576 --avoid )
569 func_fatal_error "missing argument for --avoid" 579 func_fatal_error "missing argument for --avoid"
570 fi 580 fi
571 func_append avoidlist " $1" 581 func_append avoidlist " $1"
572 shift ;; 582 shift ;;
573 --avoid=* ) 583 --avoid=* )
574 arg=`echo "X$1" | sed -e 's/^X--avoid=//'` 584 arg=`echo "X$1" | $SED -e 's/^X--avoid=//'`
575 func_append avoidlist " $arg" 585 func_append avoidlist " $arg"
576 shift ;; 586 shift ;;
577 --lgpl ) 587 --lgpl )
578 lgpl=true 588 lgpl=true
579 shift ;; 589 shift ;;
583 func_fatal_error "missing argument for --makefile-name" 593 func_fatal_error "missing argument for --makefile-name"
584 fi 594 fi
585 makefile_name="$1" 595 makefile_name="$1"
586 shift ;; 596 shift ;;
587 --makefile-name=* ) 597 --makefile-name=* )
588 makefile_name=`echo "X$1" | sed -e 's/^X--makefile-name=//'` 598 makefile_name=`echo "X$1" | $SED -e 's/^X--makefile-name=//'`
589 shift ;; 599 shift ;;
590 --libtool ) 600 --libtool )
591 libtool=true 601 libtool=true
592 shift ;; 602 shift ;;
593 --no-libtool ) 603 --no-libtool )
599 func_fatal_error "missing argument for --macro-prefix" 609 func_fatal_error "missing argument for --macro-prefix"
600 fi 610 fi
601 macro_prefix="$1" 611 macro_prefix="$1"
602 shift ;; 612 shift ;;
603 --macro-prefix=* ) 613 --macro-prefix=* )
604 macro_prefix=`echo "X$1" | sed -e 's/^X--macro-prefix=//'` 614 macro_prefix=`echo "X$1" | $SED -e 's/^X--macro-prefix=//'`
605 shift ;; 615 shift ;;
606 --no-changelog | --no-changelo | --no-changel | --no-change | --no-chang | --no-chan | --no-cha | --no-ch | --no-c ) 616 --no-changelog | --no-changelo | --no-changel | --no-change | --no-chang | --no-chan | --no-cha | --no-ch | --no-c )
607 do_changelog=false 617 do_changelog=false
608 shift ;; 618 shift ;;
609 --dry-run ) 619 --dry-run )
690 s,^dnl .*$,, 700 s,^dnl .*$,,
691 s, dnl .*$,, 701 s, dnl .*$,,
692 /AC_PREREQ/ { 702 /AC_PREREQ/ {
693 s,^.*AC_PREREQ([[ ]*\([^])]*\).*$,prereqs="$prereqs \1",p 703 s,^.*AC_PREREQ([[ ]*\([^])]*\).*$,prereqs="$prereqs \1",p
694 }' 704 }'
695 eval `sed -n -e "$my_sed_traces" < "$configure_ac"` 705 eval `$SED -n -e "$my_sed_traces" < "$configure_ac"`
696 if test -n "$prereqs"; then 706 if test -n "$prereqs"; then
697 autoconf_minversion=`for version in $prereqs; do echo $version; done | $SORT -g -u | tail -1` 707 autoconf_minversion=`for version in $prereqs; do echo $version; done | $SORT -g -u | tail -1`
698 fi 708 fi
699 fi 709 fi
700 if test -z "$autoconf_minversion"; then 710 if test -z "$autoconf_minversion"; then
707 717
708 # Remove trailing slashes from the directory names. This is necessary for 718 # Remove trailing slashes from the directory names. This is necessary for
709 # m4base (to avoid an error in func_import) and optional for the others. 719 # m4base (to avoid an error in func_import) and optional for the others.
710 sed_trimtrailingslashes='s,\([^/]\)//*$,\1,' 720 sed_trimtrailingslashes='s,\([^/]\)//*$,\1,'
711 case "$local_gnulib_dir" in 721 case "$local_gnulib_dir" in
712 */ ) local_gnulib_dir=`echo "$local_gnulib_dir" | sed -e "$sed_trimtrailingslashes"` ;; 722 */ ) local_gnulib_dir=`echo "$local_gnulib_dir" | $SED -e "$sed_trimtrailingslashes"` ;;
713 esac 723 esac
714 case "$sourcebase" in 724 case "$sourcebase" in
715 */ ) sourcebase=`echo "$sourcebase" | sed -e "$sed_trimtrailingslashes"` ;; 725 */ ) sourcebase=`echo "$sourcebase" | $SED -e "$sed_trimtrailingslashes"` ;;
716 esac 726 esac
717 case "$m4base" in 727 case "$m4base" in
718 */ ) m4base=`echo "$m4base" | sed -e "$sed_trimtrailingslashes"` ;; 728 */ ) m4base=`echo "$m4base" | $SED -e "$sed_trimtrailingslashes"` ;;
719 esac 729 esac
720 case "$docbase" in 730 case "$docbase" in
721 */ ) docbase=`echo "$docbase" | sed -e "$sed_trimtrailingslashes"` ;; 731 */ ) docbase=`echo "$docbase" | $SED -e "$sed_trimtrailingslashes"` ;;
722 esac 732 esac
723 case "$testsbase" in 733 case "$testsbase" in
724 */ ) testsbase=`echo "$testsbase" | sed -e "$sed_trimtrailingslashes"` ;; 734 */ ) testsbase=`echo "$testsbase" | $SED -e "$sed_trimtrailingslashes"` ;;
725 esac 735 esac
726 case "$auxdir" in 736 case "$auxdir" in
727 */ ) auxdir=`echo "$auxdir" | sed -e "$sed_trimtrailingslashes"` ;; 737 */ ) auxdir=`echo "$auxdir" | $SED -e "$sed_trimtrailingslashes"` ;;
728 esac 738 esac
729 } 739 }
730 740
731 case "$0" in 741 case "$0" in
732 /*) self_abspathname="$0" ;; 742 /*) self_abspathname="$0" ;;
733 */*) self_abspathname=`pwd`/"$0" ;; 743 */*) self_abspathname=`pwd`/"$0" ;;
734 *) for d in `echo ":$PATH:" | sed -e 's/:::*/:.:/g' | sed -e 's/:/ /g'`; do 744 *) for d in `echo ":$PATH:" | $SED -e 's/:::*/:.:/g' | $SED -e 's/:/ /g'`; do
735 if test -x "$d/$0" && test ! -d "$d/$0"; then 745 if test -x "$d/$0" && test ! -d "$d/$0"; then
736 self_abspathname="$d/$0" 746 self_abspathname="$d/$0"
737 break 747 break
738 fi 748 fi
739 done 749 done
746 # Resolve symbolic link. 756 # Resolve symbolic link.
747 linkval=`func_readlink "$self_abspathname"` 757 linkval=`func_readlink "$self_abspathname"`
748 test -n "$linkval" || break 758 test -n "$linkval" || break
749 case "$linkval" in 759 case "$linkval" in
750 /* ) self_abspathname="$linkval" ;; 760 /* ) self_abspathname="$linkval" ;;
751 * ) self_abspathname=`echo "$self_abspathname" | sed -e 's,/[^/]*$,,'`/"$linkval" ;; 761 * ) self_abspathname=`echo "$self_abspathname" | $SED -e 's,/[^/]*$,,'`/"$linkval" ;;
752 esac 762 esac
753 done 763 done
754 gnulib_dir=`echo "$self_abspathname" | sed -e 's,/[^/]*$,,'` 764 gnulib_dir=`echo "$self_abspathname" | $SED -e 's,/[^/]*$,,'`
755 765
756 func_tmpdir 766 func_tmpdir
757 trap 'exit_status=$? 767 trap 'exit_status=$?
758 if test "$signal" != 0; then 768 if test "$signal" != 0; then
759 echo "caught signal $signal" >&2 769 echo "caught signal $signal" >&2
780 lookedup_file="$local_gnulib_dir/$lkfile" 790 lookedup_file="$local_gnulib_dir/$lkfile"
781 lookedup_tmp= 791 lookedup_tmp=
782 else 792 else
783 if test -f "$gnulib_dir/$lkfile"; then 793 if test -f "$gnulib_dir/$lkfile"; then
784 if test -n "$local_gnulib_dir" && test -f "$local_gnulib_dir/$lkfile.diff"; then 794 if test -n "$local_gnulib_dir" && test -f "$local_gnulib_dir/$lkfile.diff"; then
785 lkbase=`echo "$lkfile" | sed -e 's,^.*/,,'` 795 lkbase=`echo "$lkfile" | $SED -e 's,^.*/,,'`
786 rm -f "$tmp/$lkbase" 796 rm -f "$tmp/$lkbase"
787 cp "$gnulib_dir/$lkfile" "$tmp/$lkbase" 797 cp "$gnulib_dir/$lkfile" "$tmp/$lkbase"
788 patch -s "$tmp/$lkbase" < "$local_gnulib_dir/$lkfile.diff" \ 798 patch -s "$tmp/$lkbase" < "$local_gnulib_dir/$lkfile.diff" \
789 || func_fatal_error "patch file $local_gnulib_dir/$lkfile.diff didn't apply cleanly" 799 || func_fatal_error "patch file $local_gnulib_dir/$lkfile.diff didn't apply cleanly"
790 lookedup_file="$tmp/$lkbase" 800 lookedup_file="$tmp/$lkbase"
808 # Filter out unit test modules; they can be retrieved through 818 # Filter out unit test modules; they can be retrieved through
809 # --extract-tests-module if desired. 819 # --extract-tests-module if desired.
810 { 820 {
811 (cd "$gnulib_dir/modules" && ls -1) 821 (cd "$gnulib_dir/modules" && ls -1)
812 if test -n "$local_gnulib_dir" && test -d "$local_gnulib_dir/modules"; then 822 if test -n "$local_gnulib_dir" && test -d "$local_gnulib_dir/modules"; then
813 (cd "$local_gnulib_dir/modules" && ls -1 | sed -e 's,\.diff$,,') 823 (cd "$local_gnulib_dir/modules" && ls -1 | $SED -e 's,\.diff$,,')
814 fi 824 fi
815 } \ 825 } \
816 | sed -e '/^CVS$/d' -e '/^ChangeLog$/d' -e '/^COPYING$/d' -e '/^README$/d' -e '/^TEMPLATE$/d' -e '/^TEMPLATE-TESTS$/d' -e '/~$/d' \ 826 | $SED -e '/^CVS$/d' -e '/^ChangeLog$/d' -e '/^COPYING$/d' -e '/^README$/d' -e '/^TEMPLATE$/d' -e '/^TEMPLATE-TESTS$/d' -e '/~$/d' \
817 | sed -e '/-tests$/d' \ 827 | $SED -e '/-tests$/d' \
818 | LC_ALL=C sort -u 828 | LC_ALL=C sort -u
819 } 829 }
820 830
821 # func_verify_module 831 # func_verify_module
822 # verifies a module name 832 # verifies a module name
890 # Input: 900 # Input:
891 # - local_gnulib_dir from --local-dir 901 # - local_gnulib_dir from --local-dir
892 func_get_description () 902 func_get_description ()
893 { 903 {
894 func_lookup_file "modules/$1" 904 func_lookup_file "modules/$1"
895 sed -n -e "/^Description$sed_extract_prog" < "$lookedup_file" 905 $SED -n -e "/^Description$sed_extract_prog" < "$lookedup_file"
896 } 906 }
897 907
898 # func_get_filelist module 908 # func_get_filelist module
899 # Input: 909 # Input:
900 # - local_gnulib_dir from --local-dir 910 # - local_gnulib_dir from --local-dir
901 func_get_filelist () 911 func_get_filelist ()
902 { 912 {
903 func_lookup_file "modules/$1" 913 func_lookup_file "modules/$1"
904 sed -n -e "/^Files$sed_extract_prog" < "$lookedup_file" 914 $SED -n -e "/^Files$sed_extract_prog" < "$lookedup_file"
905 case "$autoconf_minversion" in 915 case "$autoconf_minversion" in
906 2.59) 916 2.59)
907 #echo m4/onceonly.m4 917 #echo m4/onceonly.m4
908 echo m4/onceonly_2_57.m4 918 echo m4/onceonly_2_57.m4
909 ;; 919 ;;
914 # Input: 924 # Input:
915 # - local_gnulib_dir from --local-dir 925 # - local_gnulib_dir from --local-dir
916 func_get_dependencies () 926 func_get_dependencies ()
917 { 927 {
918 # ${module}-tests always implicitly depends on ${module}. 928 # ${module}-tests always implicitly depends on ${module}.
919 echo "$1" | sed -n -e 's/-tests//p' 929 echo "$1" | $SED -n -e 's/-tests//p'
920 # Then the explicit dependencies listed in the module description. 930 # Then the explicit dependencies listed in the module description.
921 func_lookup_file "modules/$1" 931 func_lookup_file "modules/$1"
922 sed -n -e "/^Depends-on$sed_extract_prog" < "$lookedup_file" 932 $SED -n -e "/^Depends-on$sed_extract_prog" < "$lookedup_file"
923 } 933 }
924 934
925 # func_get_autoconf_snippet module 935 # func_get_autoconf_snippet module
926 # Input: 936 # Input:
927 # - local_gnulib_dir from --local-dir 937 # - local_gnulib_dir from --local-dir
928 func_get_autoconf_snippet () 938 func_get_autoconf_snippet ()
929 { 939 {
930 func_lookup_file "modules/$1" 940 func_lookup_file "modules/$1"
931 sed -n -e "/^configure\.ac$sed_extract_prog" < "$lookedup_file" 941 $SED -n -e "/^configure\.ac$sed_extract_prog" < "$lookedup_file"
932 } 942 }
933 943
934 # func_get_automake_snippet module 944 # func_get_automake_snippet module
935 # Input: 945 # Input:
936 # - local_gnulib_dir from --local-dir 946 # - local_gnulib_dir from --local-dir
937 func_get_automake_snippet () 947 func_get_automake_snippet ()
938 { 948 {
939 func_lookup_file "modules/$1" 949 func_lookup_file "modules/$1"
940 sed -n -e "/^Makefile\.am$sed_extract_prog" < "$lookedup_file" 950 $SED -n -e "/^Makefile\.am$sed_extract_prog" < "$lookedup_file"
941 case "$1" in 951 case "$1" in
942 *-tests) 952 *-tests)
943 # *-tests module live in tests/, not lib/. 953 # *-tests module live in tests/, not lib/.
944 ;; 954 ;;
945 *) 955 *)
951 s/\\$/\\/ 961 s/\\$/\\/
952 ta 962 ta
953 }' 963 }'
954 sed_extract_mentioned_files='s/^lib_SOURCES[ ]*+=[ ]*//p' 964 sed_extract_mentioned_files='s/^lib_SOURCES[ ]*+=[ ]*//p'
955 already_mentioned_files=` \ 965 already_mentioned_files=` \
956 sed -n -e "/^Makefile\.am$sed_extract_prog" < "$lookedup_file" \ 966 $SED -n -e "/^Makefile\.am$sed_extract_prog" < "$lookedup_file" \
957 | sed -e "$sed_combine_lines" \ 967 | $SED -e "$sed_combine_lines" \
958 | sed -n -e "$sed_extract_mentioned_files" | sed -e 's/#.*//'` 968 | $SED -n -e "$sed_extract_mentioned_files" | $SED -e 's/#.*//'`
959 all_files=`func_get_filelist $1` 969 all_files=`func_get_filelist $1`
960 lib_files=`for f in $all_files; do \ 970 lib_files=`for f in $all_files; do \
961 case $f in \ 971 case $f in \
962 lib/*) echo $f ;; \ 972 lib/*) echo $f ;; \
963 esac; \ 973 esac; \
964 done | sed -e 's,^lib/,,'` 974 done | $SED -e 's,^lib/,,'`
965 # Remove $already_mentioned_files from $lib_files. 975 # Remove $already_mentioned_files from $lib_files.
966 echo "$lib_files" | LC_ALL=C sort -u > "$tmp"/lib-files 976 echo "$lib_files" | LC_ALL=C sort -u > "$tmp"/lib-files
967 extra_files=`for f in $already_mentioned_files; do echo $f; done \ 977 extra_files=`for f in $already_mentioned_files; do echo $f; done \
968 | LC_ALL=C sort -u | LC_ALL=C join -v 2 - "$tmp"/lib-files` 978 | LC_ALL=C sort -u | LC_ALL=C join -v 2 - "$tmp"/lib-files`
969 if test -n "$extra_files"; then 979 if test -n "$extra_files"; then
980 # But it's simpler and more robust to do it here, based on the file list. 990 # But it's simpler and more robust to do it here, based on the file list.
981 # If some .c file exists and is not used with AC_LIBOBJ - for example, 991 # If some .c file exists and is not used with AC_LIBOBJ - for example,
982 # a .c file is preprocessed into another .c file for BUILT_SOURCES -, 992 # a .c file is preprocessed into another .c file for BUILT_SOURCES -,
983 # automake will generate a useless dependency; this is harmless. 993 # automake will generate a useless dependency; this is harmless.
984 sed_extract_c_files='/\.c$/p' 994 sed_extract_c_files='/\.c$/p'
985 extra_files=`echo "$extra_files" | sed -n -e "$sed_extract_c_files"` 995 extra_files=`echo "$extra_files" | $SED -n -e "$sed_extract_c_files"`
986 if test -n "$extra_files"; then 996 if test -n "$extra_files"; then
987 echo "EXTRA_lib_SOURCES +=" $extra_files 997 echo "EXTRA_lib_SOURCES +=" $extra_files
988 echo 998 echo
989 fi 999 fi
990 ;; 1000 ;;
995 # Input: 1005 # Input:
996 # - local_gnulib_dir from --local-dir 1006 # - local_gnulib_dir from --local-dir
997 func_get_include_directive () 1007 func_get_include_directive ()
998 { 1008 {
999 func_lookup_file "modules/$1" 1009 func_lookup_file "modules/$1"
1000 sed -n -e "/^Include$sed_extract_prog" < "$lookedup_file" | \ 1010 $SED -n -e "/^Include$sed_extract_prog" < "$lookedup_file" | \
1001 sed -e 's/^\(["<]\)/#include \1/' 1011 $SED -e 's/^\(["<]\)/#include \1/'
1002 } 1012 }
1003 1013
1004 # func_get_license module 1014 # func_get_license module
1005 # Input: 1015 # Input:
1006 # - local_gnulib_dir from --local-dir 1016 # - local_gnulib_dir from --local-dir
1007 func_get_license () 1017 func_get_license ()
1008 { 1018 {
1009 func_lookup_file "modules/$1" 1019 func_lookup_file "modules/$1"
1010 sed -n -e "/^License$sed_extract_prog" < "$lookedup_file" 1020 $SED -n -e "/^License$sed_extract_prog" < "$lookedup_file"
1011 } 1021 }
1012 1022
1013 # func_get_maintainer module 1023 # func_get_maintainer module
1014 # Input: 1024 # Input:
1015 # - local_gnulib_dir from --local-dir 1025 # - local_gnulib_dir from --local-dir
1016 func_get_maintainer () 1026 func_get_maintainer ()
1017 { 1027 {
1018 func_lookup_file "modules/$1" 1028 func_lookup_file "modules/$1"
1019 sed -n -e "/^Maintainer$sed_extract_prog" < "$lookedup_file" 1029 $SED -n -e "/^Maintainer$sed_extract_prog" < "$lookedup_file"
1020 } 1030 }
1021 1031
1022 # func_get_tests_module module 1032 # func_get_tests_module module
1023 # Input: 1033 # Input:
1024 # - local_gnulib_dir from --local-dir 1034 # - local_gnulib_dir from --local-dir
1116 }' 1126 }'
1117 for module in $modules; do 1127 for module in $modules; do
1118 func_verify_nontests_module 1128 func_verify_nontests_module
1119 if test -n "$module"; then 1129 if test -n "$module"; then
1120 # Extract the value of "lib_SOURCES += ...". 1130 # Extract the value of "lib_SOURCES += ...".
1121 for file in `func_get_automake_snippet "$module" | sed -e "$sed_remove_backslash_newline" | sed -n -e 's,^lib_SOURCES[ ]*+=\([^#]*\).*$,\1,p'`; do 1131 for file in `func_get_automake_snippet "$module" | $SED -e "$sed_remove_backslash_newline" | $SED -n -e 's,^lib_SOURCES[ ]*+=\([^#]*\).*$,\1,p'`; do
1122 # Ignore .h files since they are not compiled. 1132 # Ignore .h files since they are not compiled.
1123 case "$file" in 1133 case "$file" in
1124 *.h) ;; 1134 *.h) ;;
1125 *) have_lib_SOURCES=yes ;; 1135 *) have_lib_SOURCES=yes ;;
1126 esac 1136 esac
1195 for module in $modules; do 1205 for module in $modules; do
1196 func_verify_nontests_module 1206 func_verify_nontests_module
1197 if test -n "$module"; then 1207 if test -n "$module"; then
1198 { 1208 {
1199 func_get_automake_snippet "$module" | 1209 func_get_automake_snippet "$module" |
1200 sed -e 's,lib_LIBRARIES,lib%_LIBRARIES,g' \ 1210 $SED -e 's,lib_LIBRARIES,lib%_LIBRARIES,g' \
1201 -e 's,lib_LTLIBRARIES,lib%_LTLIBRARIES,g' | 1211 -e 's,lib_LTLIBRARIES,lib%_LTLIBRARIES,g' |
1202 sed -e "$sed_eliminate_LDFLAGS" | 1212 $SED -e "$sed_eliminate_LDFLAGS" |
1203 sed -e 's,lib_\([A-Z][A-Z]*\),'"${libname}_${libext}"'_\1,g' | 1213 $SED -e 's,lib_\([A-Z][A-Z]*\),'"${libname}_${libext}"'_\1,g' |
1204 sed -e 's,lib%_LIBRARIES,lib_LIBRARIES,g' \ 1214 $SED -e 's,lib%_LIBRARIES,lib_LIBRARIES,g' \
1205 -e 's,lib%_LTLIBRARIES,lib_LTLIBRARIES,g' 1215 -e 's,lib%_LTLIBRARIES,lib_LTLIBRARIES,g'
1206 if test "$module" = 'alloca'; then 1216 if test "$module" = 'alloca'; then
1207 echo "${libname}_${libext}_LIBADD += @${perhapsLT}ALLOCA@" 1217 echo "${libname}_${libext}_LIBADD += @${perhapsLT}ALLOCA@"
1208 echo "${libname}_${libext}_DEPENDENCIES += @${perhapsLT}ALLOCA@" 1218 echo "${libname}_${libext}_DEPENDENCIES += @${perhapsLT}ALLOCA@"
1209 fi 1219 fi
1210 } > amsnippet.tmp 1220 } > amsnippet.tmp
1277 if test "$libtool" = true; then 1287 if test "$libtool" = true; then
1278 echo "${libname}_${libext}_LDFLAGS = \$(AM_LDFLAGS)" 1288 echo "${libname}_${libext}_LDFLAGS = \$(AM_LDFLAGS)"
1279 fi 1289 fi
1280 echo 1290 echo
1281 cat allsnippets.tmp \ 1291 cat allsnippets.tmp \
1282 | sed -e 's|\$(top_srcdir)/build-aux/|$(top_srcdir)/'"$auxdir"'/|g' 1292 | $SED -e 's|\$(top_srcdir)/build-aux/|$(top_srcdir)/'"$auxdir"'/|g'
1283 echo 1293 echo
1284 echo "mostlyclean-local: mostlyclean-generic" 1294 echo "mostlyclean-local: mostlyclean-generic"
1285 echo " @for dir in '' \$(MOSTLYCLEANDIRS); do \\" 1295 echo " @for dir in '' \$(MOSTLYCLEANDIRS); do \\"
1286 echo " if test -n \"\$\$dir\" && test -d \$\$dir; then \\" 1296 echo " if test -n \"\$\$dir\" && test -d \$\$dir; then \\"
1287 echo " echo \"rmdir \$\$dir\"; rmdir \$\$dir; \\" 1297 echo " echo \"rmdir \$\$dir\"; rmdir \$\$dir; \\"
1313 sed_eliminate_LDFLAGS= 1323 sed_eliminate_LDFLAGS=
1314 else 1324 else
1315 libext=a 1325 libext=a
1316 sed_eliminate_LDFLAGS='/^lib_LDFLAGS[ ]*+=/d' 1326 sed_eliminate_LDFLAGS='/^lib_LDFLAGS[ ]*+=/d'
1317 fi 1327 fi
1318 testsbase_inverse=`echo "$testsbase" | sed -e 's,/$,,' | sed -e 's,[^/][^/]*,..,g'` 1328 testsbase_inverse=`echo "$testsbase" | $SED -e 's,/$,,' | $SED -e 's,[^/][^/]*,..,g'`
1319 echo "## DO NOT EDIT! GENERATED AUTOMATICALLY!" 1329 echo "## DO NOT EDIT! GENERATED AUTOMATICALLY!"
1320 echo "## Process this file with automake to produce Makefile.in." 1330 echo "## Process this file with automake to produce Makefile.in."
1321 func_emit_copyright_notice 1331 func_emit_copyright_notice
1322 echo 1332 echo
1323 # Generate dependencies here, since it eases the debugging of test failures. 1333 # Generate dependencies here, since it eases the debugging of test failures.
1329 for module in $modules; do 1339 for module in $modules; do
1330 func_verify_tests_module 1340 func_verify_tests_module
1331 if test -n "$module"; then 1341 if test -n "$module"; then
1332 { 1342 {
1333 func_get_automake_snippet "$module" | 1343 func_get_automake_snippet "$module" |
1334 sed -e 's,lib_LIBRARIES,lib%_LIBRARIES,g' \ 1344 $SED -e 's,lib_LIBRARIES,lib%_LIBRARIES,g' \
1335 -e 's,lib_LTLIBRARIES,lib%_LTLIBRARIES,g' | 1345 -e 's,lib_LTLIBRARIES,lib%_LTLIBRARIES,g' |
1336 sed -e "$sed_eliminate_LDFLAGS" | 1346 $SED -e "$sed_eliminate_LDFLAGS" |
1337 sed -e 's,lib_\([A-Z][A-Z]*\),'"${libname}_${libext}"'_\1,g' | 1347 $SED -e 's,lib_\([A-Z][A-Z]*\),'"${libname}_${libext}"'_\1,g' |
1338 sed -e 's,lib%_LIBRARIES,lib_LIBRARIES,g' \ 1348 $SED -e 's,lib%_LIBRARIES,lib_LIBRARIES,g' \
1339 -e 's,lib%_LTLIBRARIES,lib_LTLIBRARIES,g' 1349 -e 's,lib%_LTLIBRARIES,lib_LTLIBRARIES,g'
1340 } > amsnippet.tmp 1350 } > amsnippet.tmp
1341 # Skip the contents if its entirely empty. 1351 # Skip the contents if its entirely empty.
1342 if grep '[^ ]' amsnippet.tmp > /dev/null ; then 1352 if grep '[^ ]' amsnippet.tmp > /dev/null ; then
1343 echo "## begin gnulib module $module" 1353 echo "## begin gnulib module $module"
1344 echo 1354 echo
1427 echo " ${macro_prefix}_libobjs=" 1437 echo " ${macro_prefix}_libobjs="
1428 echo " ${macro_prefix}_ltlibobjs=" 1438 echo " ${macro_prefix}_ltlibobjs="
1429 echo " if test -n \"\$${macro_prefix}_LIBOBJS\"; then" 1439 echo " if test -n \"\$${macro_prefix}_LIBOBJS\"; then"
1430 echo " # Remove the extension." 1440 echo " # Remove the extension."
1431 echo " sed_drop_objext='s/\\.o\$//;s/\\.obj\$//'" 1441 echo " sed_drop_objext='s/\\.o\$//;s/\\.obj\$//'"
1432 echo " for i in \`for i in \$${macro_prefix}_LIBOBJS; do echo \"\$i\"; done | sed \"\$sed_drop_objext\" | sort | uniq\`; do" 1442 echo " for i in \`for i in \$${macro_prefix}_LIBOBJS; do echo \"\$i\"; done | $SED \"\$sed_drop_objext\" | sort | uniq\`; do"
1433 echo " ${macro_prefix}_libobjs=\"\$${macro_prefix}_libobjs \$i.\$ac_objext\"" 1443 echo " ${macro_prefix}_libobjs=\"\$${macro_prefix}_libobjs \$i.\$ac_objext\""
1434 echo " ${macro_prefix}_ltlibobjs=\"\$${macro_prefix}_ltlibobjs \$i.lo\"" 1444 echo " ${macro_prefix}_ltlibobjs=\"\$${macro_prefix}_ltlibobjs \$i.lo\""
1435 echo " done" 1445 echo " done"
1436 echo " fi" 1446 echo " fi"
1437 echo " AC_SUBST([${macro_prefix}_LIBOBJS], [\$${macro_prefix}_libobjs])" 1447 echo " AC_SUBST([${macro_prefix}_LIBOBJS], [\$${macro_prefix}_libobjs])"
1540 s,^.*$,cached_libtool=true,p 1550 s,^.*$,cached_libtool=true,p
1541 } 1551 }
1542 /gl_MACRO_PREFIX(/ { 1552 /gl_MACRO_PREFIX(/ {
1543 s,^.*gl_MACRO_PREFIX([[ ]*\([^])]*\).*$,cached_macro_prefix="\1",p 1553 s,^.*gl_MACRO_PREFIX([[ ]*\([^])]*\).*$,cached_macro_prefix="\1",p
1544 }' 1554 }'
1545 eval `sed -n -e "$my_sed_traces" < "$destdir"/$m4base/gnulib-cache.m4` 1555 eval `$SED -n -e "$my_sed_traces" < "$destdir"/$m4base/gnulib-cache.m4`
1546 if test -f "$destdir"/$m4base/gnulib-comp.m4; then 1556 if test -f "$destdir"/$m4base/gnulib-comp.m4; then
1547 my_sed_traces=' 1557 my_sed_traces='
1548 s,#.*$,, 1558 s,#.*$,,
1549 s,^dnl .*$,, 1559 s,^dnl .*$,,
1550 s, dnl .*$,, 1560 s, dnl .*$,,
1559 n 1569 n
1560 ba 1570 ba
1561 :b 1571 :b
1562 p 1572 p
1563 }' 1573 }'
1564 eval `sed -n -e "$my_sed_traces" < "$destdir"/$m4base/gnulib-comp.m4` 1574 eval `$SED -n -e "$my_sed_traces" < "$destdir"/$m4base/gnulib-comp.m4`
1565 fi 1575 fi
1566 fi 1576 fi
1567 1577
1568 # Merge the cached settings with the specified ones. 1578 # Merge the cached settings with the specified ones.
1569 # The m4base must be the same as expected from the pathname. 1579 # The m4base must be the same as expected from the pathname.
1651 1661
1652 # Determine final module list. 1662 # Determine final module list.
1653 modules="$specified_modules" 1663 modules="$specified_modules"
1654 func_modules_transitive_closure 1664 func_modules_transitive_closure
1655 echo "Module list with included dependencies:" 1665 echo "Module list with included dependencies:"
1656 echo "$modules" | sed -e 's/^/ /' 1666 echo "$modules" | $SED -e 's/^/ /'
1657 1667
1658 # Add the dummy module if needed. 1668 # Add the dummy module if needed.
1659 func_modules_add_dummy 1669 func_modules_add_dummy
1660 1670
1661 # If --lgpl, verify that the licenses of modules are compatible. 1671 # If --lgpl, verify that the licenses of modules are compatible.
1690 fi 1700 fi
1691 1701
1692 # Determine final file list. 1702 # Determine final file list.
1693 func_modules_to_filelist 1703 func_modules_to_filelist
1694 echo "File list:" 1704 echo "File list:"
1695 echo "$files" | sed -e 's/^/ /' 1705 echo "$files" | $SED -e 's/^/ /'
1696 1706
1697 test -n "$files" \ 1707 test -n "$files" \
1698 || func_fatal_error "refusing to do nothing" 1708 || func_fatal_error "refusing to do nothing"
1699 1709
1700 # Add m4/gnulib-tool.m4 to the file list. It is not part of any module. 1710 # Add m4/gnulib-tool.m4 to the file list. It is not part of any module.
1718 s,^tests/,$testsbase/," 1728 s,^tests/,$testsbase/,"
1719 1729
1720 # Create directories. 1730 # Create directories.
1721 { echo "$sourcebase" 1731 { echo "$sourcebase"
1722 echo "$m4base" 1732 echo "$m4base"
1723 docfiles=`echo "$files" | sed -n -e 's,^doc/,,p'` 1733 docfiles=`echo "$files" | $SED -n -e 's,^doc/,,p'`
1724 if test -n "$docfiles"; then 1734 if test -n "$docfiles"; then
1725 echo "$docbase" 1735 echo "$docbase"
1726 fi 1736 fi
1727 if test -n "$inctests"; then 1737 if test -n "$inctests"; then
1728 echo "$testsbase" 1738 echo "$testsbase"
1729 fi 1739 fi
1730 echo "$auxdir" 1740 echo "$auxdir"
1731 for f in $files; do echo $f; done \ 1741 for f in $files; do echo $f; done \
1732 | sed -e "$sed_rewrite_new_files" \ 1742 | $SED -e "$sed_rewrite_new_files" \
1733 | sed -n -e 's,^\(.*\)/[^/]*,\1,p' \ 1743 | $SED -n -e 's,^\(.*\)/[^/]*,\1,p' \
1734 | LC_ALL=C sort -u 1744 | LC_ALL=C sort -u
1735 } > "$tmp"/dirs 1745 } > "$tmp"/dirs
1736 { # Rearrange file descriptors. Needed because "while ... done < ..." 1746 { # Rearrange file descriptors. Needed because "while ... done < ..."
1737 # constructs are executed in a subshell e.g. by Solaris 10 /bin/sh. 1747 # constructs are executed in a subshell e.g. by Solaris 10 /bin/sh.
1738 exec 5<&0 < "$tmp"/dirs 1748 exec 5<&0 < "$tmp"/dirs
1769 # Copy files or make symbolic links. Remove obsolete files. 1779 # Copy files or make symbolic links. Remove obsolete files.
1770 delimiter=' ' 1780 delimiter=' '
1771 # Construct a table with 2 columns: rewritten-file-name original-file-name, 1781 # Construct a table with 2 columns: rewritten-file-name original-file-name,
1772 # representing the files according to the last gnulib-tool invocation. 1782 # representing the files according to the last gnulib-tool invocation.
1773 for f in $old_files; do echo $f; done \ 1783 for f in $old_files; do echo $f; done \
1774 | sed -e "s,^.*\$,&$delimiter&," -e "$sed_rewrite_old_files" \ 1784 | $SED -e "s,^.*\$,&$delimiter&," -e "$sed_rewrite_old_files" \
1775 | LC_ALL=C sort \ 1785 | LC_ALL=C sort \
1776 > "$tmp"/old-files 1786 > "$tmp"/old-files
1777 # Construct a table with 2 columns: rewritten-file-name original-file-name, 1787 # Construct a table with 2 columns: rewritten-file-name original-file-name,
1778 # representing the files after this gnulib-tool invocation. 1788 # representing the files after this gnulib-tool invocation.
1779 for f in $new_files; do echo $f; done \ 1789 for f in $new_files; do echo $f; done \
1780 | sed -e "s,^.*\$,&$delimiter&," -e "$sed_rewrite_new_files" \ 1790 | $SED -e "s,^.*\$,&$delimiter&," -e "$sed_rewrite_new_files" \
1781 | LC_ALL=C sort \ 1791 | LC_ALL=C sort \
1782 > "$tmp"/new-files 1792 > "$tmp"/new-files
1783 # First the files that are in old-files, but not in new-files: 1793 # First the files that are in old-files, but not in new-files:
1784 sed_take_first_column='s,'"$delimiter"'.*,,' 1794 sed_take_first_column='s,'"$delimiter"'.*,,'
1785 for g in `LC_ALL=C join -t"$delimiter" -v1 "$tmp"/old-files "$tmp"/new-files | sed -e "$sed_take_first_column"`; do 1795 for g in `LC_ALL=C join -t"$delimiter" -v1 "$tmp"/old-files "$tmp"/new-files | $SED -e "$sed_take_first_column"`; do
1786 # Remove the file. Do nothing if the user already removed it. 1796 # Remove the file. Do nothing if the user already removed it.
1787 if test -f "$destdir/$g"; then 1797 if test -f "$destdir/$g"; then
1788 if $doit; then 1798 if $doit; then
1789 echo "Removing file $g (backup in ${g}~)" 1799 echo "Removing file $g (backup in ${g}~)"
1790 mv -f "$destdir/$g" "$destdir/${g}~" || func_fatal_error "failed" 1800 mv -f "$destdir/$g" "$destdir/${g}~" || func_fatal_error "failed"
1804 func_lookup_file "$f" 1814 func_lookup_file "$f"
1805 cp "$lookedup_file" "$tmpfile" || func_fatal_error "failed" 1815 cp "$lookedup_file" "$tmpfile" || func_fatal_error "failed"
1806 if test -n "$sed_transform_lib_file"; then 1816 if test -n "$sed_transform_lib_file"; then
1807 case "$f" in 1817 case "$f" in
1808 lib/*) 1818 lib/*)
1809 sed -e "$sed_transform_lib_file" \ 1819 $SED -e "$sed_transform_lib_file" \
1810 < "$lookedup_file" > "$tmpfile" || func_fatal_error "failed" 1820 < "$lookedup_file" > "$tmpfile" || func_fatal_error "failed"
1811 ;; 1821 ;;
1812 esac 1822 esac
1813 fi 1823 fi
1814 if test -f "$destdir/$g"; then 1824 if test -f "$destdir/$g"; then
1864 } 1874 }
1865 # Then the files that are in new-files, but not in old-files: 1875 # Then the files that are in new-files, but not in old-files:
1866 sed_take_last_column='s,^.*'"$delimiter"',,' 1876 sed_take_last_column='s,^.*'"$delimiter"',,'
1867 already_present= 1877 already_present=
1868 LC_ALL=C join -t"$delimiter" -v2 "$tmp"/old-files "$tmp"/new-files \ 1878 LC_ALL=C join -t"$delimiter" -v2 "$tmp"/old-files "$tmp"/new-files \
1869 | sed -e "$sed_take_last_column" \ 1879 | $SED -e "$sed_take_last_column" \
1870 | sed -e "s,^.*\$,&$delimiter&," -e "$sed_rewrite_new_files" > "$tmp"/added-files 1880 | $SED -e "s,^.*\$,&$delimiter&," -e "$sed_rewrite_new_files" > "$tmp"/added-files
1871 { # Rearrange file descriptors. Needed because "while ... done < ..." 1881 { # Rearrange file descriptors. Needed because "while ... done < ..."
1872 # constructs are executed in a subshell e.g. by Solaris 10 /bin/sh. 1882 # constructs are executed in a subshell e.g. by Solaris 10 /bin/sh.
1873 exec 5<&0 < "$tmp"/added-files 1883 exec 5<&0 < "$tmp"/added-files
1874 while read g f; do 1884 while read g f; do
1875 func_add_or_update 1885 func_add_or_update
1877 exec 0<&5 5<&- 1887 exec 0<&5 5<&-
1878 } 1888 }
1879 # Then the files that are in new-files and in old-files: 1889 # Then the files that are in new-files and in old-files:
1880 already_present=true 1890 already_present=true
1881 LC_ALL=C join -t"$delimiter" "$tmp"/old-files "$tmp"/new-files \ 1891 LC_ALL=C join -t"$delimiter" "$tmp"/old-files "$tmp"/new-files \
1882 | sed -e "$sed_take_last_column" \ 1892 | $SED -e "$sed_take_last_column" \
1883 | sed -e "s,^.*\$,&$delimiter&," -e "$sed_rewrite_new_files" > "$tmp"/kept-files 1893 | $SED -e "s,^.*\$,&$delimiter&," -e "$sed_rewrite_new_files" > "$tmp"/kept-files
1884 { # Rearrange file descriptors. Needed because "while ... done < ..." 1894 { # Rearrange file descriptors. Needed because "while ... done < ..."
1885 # constructs are executed in a subshell e.g. by Solaris 10 /bin/sh. 1895 # constructs are executed in a subshell e.g. by Solaris 10 /bin/sh.
1886 exec 5<&0 < "$tmp"/kept-files 1896 exec 5<&0 < "$tmp"/kept-files
1887 while read g f; do 1897 while read g f; do
1888 func_add_or_update 1898 func_add_or_update
2079 :a 2089 :a
2080 /AC_CONFIG_FILES(.*:build-aux\/.*)/{ 2090 /AC_CONFIG_FILES(.*:build-aux\/.*)/{
2081 s|AC_CONFIG_FILES(\(.*\):build-aux/\(.*\))|AC_CONFIG_FILES(\1:'"$auxdir"'/\2)| 2091 s|AC_CONFIG_FILES(\(.*\):build-aux/\(.*\))|AC_CONFIG_FILES(\1:'"$auxdir"'/\2)|
2082 ba 2092 ba
2083 }' 2093 }'
2084 sed_replace_build_aux=`echo "$sed_replace_build_aux" | sed -e 1d -e 's/^ *//'` 2094 sed_replace_build_aux=`echo "$sed_replace_build_aux" | $SED -e 1d -e 's/^ *//'`
2085 else 2095 else
2086 sed_replace_build_aux= 2096 sed_replace_build_aux=
2087 fi 2097 fi
2088 for module in $modules; do 2098 for module in $modules; do
2089 func_verify_module 2099 func_verify_module
2090 if test -n "$module"; then 2100 if test -n "$module"; then
2091 func_get_autoconf_snippet "$module" \ 2101 func_get_autoconf_snippet "$module" \
2092 | sed -e '/^$/d;' -e 's/^/ /' \ 2102 | $SED -e '/^$/d;' -e 's/^/ /' \
2093 -e 's/AM_GNU_GETTEXT(\[external\])/dnl you must add AM_GNU_GETTEXT([external]) or similar to configure.ac./' \ 2103 -e 's/AM_GNU_GETTEXT(\[external\])/dnl you must add AM_GNU_GETTEXT([external]) or similar to configure.ac./' \
2094 -e "$sed_replace_build_aux" 2104 -e "$sed_replace_build_aux"
2095 if test "$module" = 'alloca' && test "$libtool" = true; then 2105 if test "$module" = 'alloca' && test "$libtool" = true; then
2096 echo 'changequote(,)dnl' 2106 echo 'changequote(,)dnl'
2097 echo 'LTALLOCA=`echo "$ALLOCA" | sed '"'"'s/\.[^.]* /.lo /g;s/\.[^.]*$/.lo/'"'"'`' 2107 echo 'LTALLOCA=`echo "$ALLOCA" | $SED '"'"'s/\.[^.]* /.lo /g;s/\.[^.]*$/.lo/'"'"'`'
2098 echo 'changequote([, ])dnl' 2108 echo 'changequote([, ])dnl'
2099 echo 'AC_SUBST([LTALLOCA])' 2109 echo 'AC_SUBST([LTALLOCA])'
2100 fi 2110 fi
2101 fi 2111 fi
2102 done 2112 done
2114 func_emit_initmacro_done 2124 func_emit_initmacro_done
2115 echo 2125 echo
2116 echo "# This macro records the list of files which have been installed by" 2126 echo "# This macro records the list of files which have been installed by"
2117 echo "# gnulib-tool and may be removed by future gnulib-tool invocations." 2127 echo "# gnulib-tool and may be removed by future gnulib-tool invocations."
2118 echo "AC_DEFUN([${macro_prefix}_FILE_LIST], [" 2128 echo "AC_DEFUN([${macro_prefix}_FILE_LIST], ["
2119 echo "$files" | sed -e 's,^, ,' 2129 echo "$files" | $SED -e 's,^, ,'
2120 echo "])" 2130 echo "])"
2121 ) > "$tmpfile" 2131 ) > "$tmpfile"
2122 if test -f "$destdir"/$m4base/gnulib-comp.m4; then 2132 if test -f "$destdir"/$m4base/gnulib-comp.m4; then
2123 if cmp "$destdir"/$m4base/gnulib-comp.m4 "$tmpfile" > /dev/null; then 2133 if cmp "$destdir"/$m4base/gnulib-comp.m4 "$tmpfile" > /dev/null; then
2124 rm -f "$tmpfile" 2134 rm -f "$tmpfile"
2203 done 5> "$tmp"/include-if 6> "$tmp"/include-angles 7> "$tmp"/include-quotes 2213 done 5> "$tmp"/include-if 6> "$tmp"/include-angles 7> "$tmp"/include-quotes
2204 ( 2214 (
2205 LC_ALL=C sort -u "$tmp"/include-angles 2215 LC_ALL=C sort -u "$tmp"/include-angles
2206 LC_ALL=C sort -u "$tmp"/include-quotes 2216 LC_ALL=C sort -u "$tmp"/include-quotes
2207 cat "$tmp"/include-if 2217 cat "$tmp"/include-if
2208 ) | sed -e '/^$/d' -e 's/^/ /' 2218 ) | $SED -e '/^$/d' -e 's/^/ /'
2209 rm -f "$tmp"/include-angles "$tmp"/include-quotes "$tmp"/include-if 2219 rm -f "$tmp"/include-angles "$tmp"/include-quotes "$tmp"/include-if
2210 2220
2211 echo 2221 echo
2212 echo "Don't forget to" 2222 echo "Don't forget to"
2213 if test "$makefile_am" = Makefile.am; then 2223 if test "$makefile_am" = Makefile.am; then
2221 else 2231 else
2222 echo " - \"include $makefile_name\" from within \"$testsbase/Makefile.am\"," 2232 echo " - \"include $makefile_name\" from within \"$testsbase/Makefile.am\","
2223 fi 2233 fi
2224 fi 2234 fi
2225 if test "$makefile_am" = Makefile.am; then 2235 if test "$makefile_am" = Makefile.am; then
2226 sourcebase_dir=`echo "$sourcebase" | sed -n -e 's,/[^/]*$,/,p'` 2236 sourcebase_dir=`echo "$sourcebase" | $SED -n -e 's,/[^/]*$,/,p'`
2227 sourcebase_base=`basename "$sourcebase"` 2237 sourcebase_base=`basename "$sourcebase"`
2228 echo " - mention \"${sourcebase_base}\" in SUBDIRS in ${sourcebase_dir}Makefile.am," 2238 echo " - mention \"${sourcebase_base}\" in SUBDIRS in ${sourcebase_dir}Makefile.am,"
2229 fi 2239 fi
2230 if test -n "$inctests"; then 2240 if test -n "$inctests"; then
2231 if test "$makefile_am" = Makefile.am; then 2241 if test "$makefile_am" = Makefile.am; then
2232 testsbase_dir=`echo "$testsbase" | sed -n -e 's,/[^/]*$,/,p'` 2242 testsbase_dir=`echo "$testsbase" | $SED -n -e 's,/[^/]*$,/,p'`
2233 testsbase_base=`basename "$testsbase"` 2243 testsbase_base=`basename "$testsbase"`
2234 echo " - mention \"${testsbase_base}\" in SUBDIRS in ${testsbase_dir}Makefile.am," 2244 echo " - mention \"${testsbase_base}\" in SUBDIRS in ${testsbase_dir}Makefile.am,"
2235 fi 2245 fi
2236 fi 2246 fi
2237 echo " - mention \"-I ${m4base}\" in ACLOCAL_AMFLAGS in Makefile.am," 2247 echo " - mention \"-I ${m4base}\" in ACLOCAL_AMFLAGS in Makefile.am,"
2289 macro_prefix=gl 2299 macro_prefix=gl
2290 2300
2291 # Determine final module list. 2301 # Determine final module list.
2292 func_modules_transitive_closure 2302 func_modules_transitive_closure
2293 echo "Module list with included dependencies:" 2303 echo "Module list with included dependencies:"
2294 echo "$modules" | sed -e 's/^/ /' 2304 echo "$modules" | $SED -e 's/^/ /'
2295 2305
2296 # Add the dummy module if needed. 2306 # Add the dummy module if needed.
2297 func_modules_add_dummy 2307 func_modules_add_dummy
2298 2308
2299 # Determine final file list. 2309 # Determine final file list.
2300 func_modules_to_filelist 2310 func_modules_to_filelist
2301 echo "File list:" 2311 echo "File list:"
2302 echo "$files" | sed -e 's/^/ /' 2312 echo "$files" | $SED -e 's/^/ /'
2303 2313
2304 sed_rewrite_files="\ 2314 sed_rewrite_files="\
2305 s,^build-aux/,$auxdir/, 2315 s,^build-aux/,$auxdir/,
2306 s,^doc/,$docbase/, 2316 s,^doc/,$docbase/,
2307 s,^lib/,$sourcebase/, 2317 s,^lib/,$sourcebase/,
2308 s,^m4/,$m4base/, 2318 s,^m4/,$m4base/,
2309 s,^tests/,$testsbase/," 2319 s,^tests/,$testsbase/,"
2310 2320
2311 # Create directories. 2321 # Create directories.
2312 for f in $files; do echo $f; done \ 2322 for f in $files; do echo $f; done \
2313 | sed -e "$sed_rewrite_files" \ 2323 | $SED -e "$sed_rewrite_files" \
2314 | sed -n -e 's,^\(.*\)/[^/]*,\1,p' \ 2324 | $SED -n -e 's,^\(.*\)/[^/]*,\1,p' \
2315 | LC_ALL=C sort -u \ 2325 | LC_ALL=C sort -u \
2316 > "$tmp"/dirs 2326 > "$tmp"/dirs
2317 { # Rearrange file descriptors. Needed because "while ... done < ..." 2327 { # Rearrange file descriptors. Needed because "while ... done < ..."
2318 # constructs are executed in a subshell e.g. by Solaris 10 /bin/sh. 2328 # constructs are executed in a subshell e.g. by Solaris 10 /bin/sh.
2319 exec 5<&0 < "$tmp"/dirs 2329 exec 5<&0 < "$tmp"/dirs
2324 } 2334 }
2325 2335
2326 # Copy files or make symbolic links. 2336 # Copy files or make symbolic links.
2327 delimiter=' ' 2337 delimiter=' '
2328 for f in $files; do echo $f; done \ 2338 for f in $files; do echo $f; done \
2329 | sed -e "s,^.*\$,&$delimiter&," -e "$sed_rewrite_files" \ 2339 | $SED -e "s,^.*\$,&$delimiter&," -e "$sed_rewrite_files" \
2330 | LC_ALL=C sort \ 2340 | LC_ALL=C sort \
2331 > "$tmp"/files 2341 > "$tmp"/files
2332 { # Rearrange file descriptors. Needed because "while ... done < ..." 2342 { # Rearrange file descriptors. Needed because "while ... done < ..."
2333 # constructs are executed in a subshell e.g. by Solaris 10 /bin/sh. 2343 # constructs are executed in a subshell e.g. by Solaris 10 /bin/sh.
2334 exec 5<&0 < "$tmp"/files 2344 exec 5<&0 < "$tmp"/files
2360 echo 2370 echo
2361 echo "EXTRA_DIST =" 2371 echo "EXTRA_DIST ="
2362 for f in $files; do 2372 for f in $files; do
2363 case "$f" in 2373 case "$f" in
2364 m4/* ) 2374 m4/* )
2365 echo "EXTRA_DIST += "`echo "$f" | sed -e 's,^m4/,,'` ;; 2375 echo "EXTRA_DIST += "`echo "$f" | $SED -e 's,^m4/,,'` ;;
2366 esac 2376 esac
2367 done 2377 done
2368 ) > "$testdir/$m4base/Makefile.am" 2378 ) > "$testdir/$m4base/Makefile.am"
2369 2379
2370 subdirs="$sourcebase $m4base" 2380 subdirs="$sourcebase $m4base"
2427 echo "AC_DEFUN([gl_INIT], [" 2437 echo "AC_DEFUN([gl_INIT], ["
2428 func_emit_initmacro_start 2438 func_emit_initmacro_start
2429 sed_replace_build_aux=' 2439 sed_replace_build_aux='
2430 :a 2440 :a
2431 /AC_CONFIG_FILES(.*:build-aux\/.*)/{ 2441 /AC_CONFIG_FILES(.*:build-aux\/.*)/{
2432 s|AC_CONFIG_FILES(\(.*\):build-aux/\(.*\))|AC_CONFIG_FILES(\1:../'"$auxdir"'/\2)| 2442 s|AC_CONFIG_FILES(\(.*\):build-aux/\(.*\))|AC_CONFIG_FILES(\1:../'"$auxdir"'/\2)|
2433 ba 2443 ba
2434 }' 2444 }'
2435 sed_replace_build_aux=`echo "$sed_replace_build_aux" | sed -e 1d -e 's/^ *//'` 2445 sed_replace_build_aux=`echo "$sed_replace_build_aux" | $SED -e 1d -e 's/^ *//'`
2436 # We don't have explicit ordering constraints between the various 2446 # We don't have explicit ordering constraints between the various
2437 # autoconf snippets. It's cleanest to put those of the library before 2447 # autoconf snippets. It's cleanest to put those of the library before
2438 # those of the tests. 2448 # those of the tests.
2439 echo "gl_source_base='../$sourcebase'" 2449 echo "gl_source_base='../$sourcebase'"
2440 for module in $modules; do 2450 for module in $modules; do
2441 func_verify_nontests_module 2451 func_verify_nontests_module
2442 if test -n "$module"; then 2452 if test -n "$module"; then
2443 func_get_autoconf_snippet "$module" \ 2453 func_get_autoconf_snippet "$module" \
2444 | sed -e "$sed_replace_build_aux" 2454 | $SED -e "$sed_replace_build_aux"
2445 fi 2455 fi
2446 done 2456 done
2447 echo "gl_source_base='.'" 2457 echo "gl_source_base='.'"
2448 for module in $modules; do 2458 for module in $modules; do
2449 func_verify_tests_module 2459 func_verify_tests_module
2450 if test -n "$module"; then 2460 if test -n "$module"; then
2451 func_get_autoconf_snippet "$module" \ 2461 func_get_autoconf_snippet "$module" \
2452 | sed -e "$sed_replace_build_aux" 2462 | $SED -e "$sed_replace_build_aux"
2453 fi 2463 fi
2454 done 2464 done
2455 # _LIBDEPS and _LTLIBDEPS variables are not needed if this library is 2465 # _LIBDEPS and _LTLIBDEPS variables are not needed if this library is
2456 # created using libtool, because libtool already handles the dependencies. 2466 # created using libtool, because libtool already handles the dependencies.
2457 if test "$libtool" != true; then 2467 if test "$libtool" != true; then
2548 :a 2558 :a
2549 /AC_CONFIG_FILES(.*:build-aux\/.*)/{ 2559 /AC_CONFIG_FILES(.*:build-aux\/.*)/{
2550 s|AC_CONFIG_FILES(\(.*\):build-aux/\(.*\))|AC_CONFIG_FILES(\1:'"$auxdir"'/\2)| 2560 s|AC_CONFIG_FILES(\(.*\):build-aux/\(.*\))|AC_CONFIG_FILES(\1:'"$auxdir"'/\2)|
2551 ba 2561 ba
2552 }' 2562 }'
2553 sed_replace_build_aux=`echo "$sed_replace_build_aux" | sed -e 1d -e 's/^ *//'` 2563 sed_replace_build_aux=`echo "$sed_replace_build_aux" | $SED -e 1d -e 's/^ *//'`
2554 else 2564 else
2555 sed_replace_build_aux= 2565 sed_replace_build_aux=
2556 fi 2566 fi
2557 for module in $modules; do 2567 for module in $modules; do
2558 func_verify_nontests_module 2568 func_verify_nontests_module
2559 if test -n "$module"; then 2569 if test -n "$module"; then
2560 func_get_autoconf_snippet "$module" \ 2570 func_get_autoconf_snippet "$module" \
2561 | sed -e "$sed_replace_build_aux" 2571 | $SED -e "$sed_replace_build_aux"
2562 fi 2572 fi
2563 done 2573 done
2564 # _LIBDEPS and _LTLIBDEPS variables are not needed if this library is 2574 # _LIBDEPS and _LTLIBDEPS variables are not needed if this library is
2565 # created using libtool, because libtool already handles the dependencies. 2575 # created using libtool, because libtool already handles the dependencies.
2566 if test "$libtool" != true; then 2576 if test "$libtool" != true; then
2597 # autopoint, which brings in older versions of some of our .m4 files. 2607 # autopoint, which brings in older versions of some of our .m4 files.
2598 if test -f $m4base/gettext.m4; then 2608 if test -f $m4base/gettext.m4; then
2599 echo "executing ${AUTOPOINT} --force" 2609 echo "executing ${AUTOPOINT} --force"
2600 ${AUTOPOINT} --force || func_exit 1 2610 ${AUTOPOINT} --force || func_exit 1
2601 for f in $m4base/*.m4~; do 2611 for f in $m4base/*.m4~; do
2602 mv -f $f `echo $f | sed -e 's,~$,,'` || func_exit 1 2612 mv -f $f `echo $f | $SED -e 's,~$,,'` || func_exit 1
2603 done 2613 done
2604 fi 2614 fi
2605 echo "executing ${ACLOCAL} -I $m4base" 2615 echo "executing ${ACLOCAL} -I $m4base"
2606 ${ACLOCAL} -I $m4base || func_exit 1 2616 ${ACLOCAL} -I $m4base || func_exit 1
2607 if ! test -d build-aux; then 2617 if ! test -d build-aux; then
2622 # autopoint, which brings in older versions of some of our .m4 files. 2632 # autopoint, which brings in older versions of some of our .m4 files.
2623 if test -f ../$m4base/gettext.m4; then 2633 if test -f ../$m4base/gettext.m4; then
2624 echo "executing ${AUTOPOINT} --force" 2634 echo "executing ${AUTOPOINT} --force"
2625 ${AUTOPOINT} --force || func_exit 1 2635 ${AUTOPOINT} --force || func_exit 1
2626 for f in ../$m4base/*.m4~; do 2636 for f in ../$m4base/*.m4~; do
2627 mv -f $f `echo $f | sed -e 's,~$,,'` || func_exit 1 2637 mv -f $f `echo $f | $SED -e 's,~$,,'` || func_exit 1
2628 done 2638 done
2629 fi 2639 fi
2630 echo "executing ${ACLOCAL} -I ../$m4base" 2640 echo "executing ${ACLOCAL} -I ../$m4base"
2631 ${ACLOCAL} -I ../$m4base || func_exit 1 2641 ${ACLOCAL} -I ../$m4base || func_exit 1
2632 if ! test -d ../build-aux; then 2642 if ! test -d ../build-aux; then
2755 s,^.*AC_CONFIG_AUX_DIR([[ ]*\([^])]*\).*$,guessed_auxdir="\1",p 2765 s,^.*AC_CONFIG_AUX_DIR([[ ]*\([^])]*\).*$,guessed_auxdir="\1",p
2756 } 2766 }
2757 /A[CM]_PROG_LIBTOOL/ { 2767 /A[CM]_PROG_LIBTOOL/ {
2758 s,^.*$,guessed_libtool=true,p 2768 s,^.*$,guessed_libtool=true,p
2759 }' 2769 }'
2760 eval `sed -n -e "$my_sed_traces" < "$configure_ac"` 2770 eval `$SED -n -e "$my_sed_traces" < "$configure_ac"`
2761 2771
2762 if test -z "$auxdir"; then 2772 if test -z "$auxdir"; then
2763 auxdir="$guessed_auxdir" 2773 auxdir="$guessed_auxdir"
2764 fi 2774 fi
2765 2775
2782 # configure, because it may be omitted from CVS. Also, don't run 2792 # configure, because it may be omitted from CVS. Also, don't run
2783 # "find $destdir -name gnulib-cache.m4", as it might be too expensive.) 2793 # "find $destdir -name gnulib-cache.m4", as it might be too expensive.)
2784 m4dirs= 2794 m4dirs=
2785 m4dirs_count=0 2795 m4dirs_count=0
2786 if test -f "$destdir"/Makefile.am; then 2796 if test -f "$destdir"/Makefile.am; then
2787 aclocal_amflags=`grep '^ACLOCAL_AMFLAGS[ ]*=' "$destdir"/Makefile.am | sed -e 's/^ACLOCAL_AMFLAGS[ ]*=\(.*\)$/\1/'` 2797 aclocal_amflags=`grep '^ACLOCAL_AMFLAGS[ ]*=' "$destdir"/Makefile.am | $SED -e 's/^ACLOCAL_AMFLAGS[ ]*=\(.*\)$/\1/'`
2788 m4dir_is_next= 2798 m4dir_is_next=
2789 for arg in $aclocal_amflags; do 2799 for arg in $aclocal_amflags; do
2790 if test -n "$m4dir_is_next"; then 2800 if test -n "$m4dir_is_next"; then
2791 # Ignore absolute directory pathnames, like /usr/local/share/aclocal. 2801 # Ignore absolute directory pathnames, like /usr/local/share/aclocal.
2792 case "$arg" in 2802 case "$arg" in
2810 # No Makefile.am! Oh well. Look at the last generated aclocal.m4. 2820 # No Makefile.am! Oh well. Look at the last generated aclocal.m4.
2811 if test -f "$destdir"/aclocal.m4; then 2821 if test -f "$destdir"/aclocal.m4; then
2812 sedexpr1='s,^m4_include(\[\(.*\)])$,\1,p' 2822 sedexpr1='s,^m4_include(\[\(.*\)])$,\1,p'
2813 sedexpr2='s,^[^/]*$,.,' 2823 sedexpr2='s,^[^/]*$,.,'
2814 sedexpr3='s,/[^/]*$,,' 2824 sedexpr3='s,/[^/]*$,,'
2815 m4dirs=`sed -n -e "$sedexpr1" aclocal.m4 | sed -e "$sedexpr2" -e "$sedexpr3" | LC_ALL=C sort -u` 2825 m4dirs=`$SED -n -e "$sedexpr1" aclocal.m4 | $SED -e "$sedexpr2" -e "$sedexpr3" | LC_ALL=C sort -u`
2816 m4dirs_count=`echo "$m4dirs" | wc -l` 2826 m4dirs_count=`echo "$m4dirs" | wc -l`
2817 fi 2827 fi
2818 fi 2828 fi
2819 if test $m4dirs_count = 0; then 2829 if test $m4dirs_count = 0; then
2820 # First use of gnulib in a package. 2830 # First use of gnulib in a package.