Mercurial > hg > octave-jordi > gnulib-hg
comparison build-aux/depcomp @ 11264:d492cd602d92
autoupdate
author | Karl Berry <karl@freefriends.org> |
---|---|
date | Thu, 05 Mar 2009 06:10:01 -0800 |
parents | 06ebfb5a6274 |
children | 96cc9044a702 |
comparison
equal
deleted
inserted
replaced
11263:e8c11e1b21af | 11264:d492cd602d92 |
---|---|
1 #! /bin/sh | 1 #! /bin/sh |
2 # depcomp - compile a program generating dependencies as side-effects | 2 # depcomp - compile a program generating dependencies as side-effects |
3 | 3 |
4 scriptversion=2009-03-03.11 | 4 scriptversion=2009-03-04.20 |
5 | 5 |
6 # Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009 Free | 6 # Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009 Free |
7 # Software Foundation, Inc. | 7 # Software Foundation, Inc. |
8 | 8 |
9 # This program is free software; you can redistribute it and/or modify | 9 # This program is free software; you can redistribute it and/or modify |
197 # dependency line. | 197 # dependency line. |
198 tr ' ' ' | 198 tr ' ' ' |
199 ' < "$tmpdepfile" \ | 199 ' < "$tmpdepfile" \ |
200 | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ | 200 | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ |
201 tr ' | 201 tr ' |
202 ' ' ' >> $depfile | 202 ' ' ' >> "$depfile" |
203 echo >> $depfile | 203 echo >> "$depfile" |
204 | 204 |
205 # The second pass generates a dummy entry for each header file. | 205 # The second pass generates a dummy entry for each header file. |
206 tr ' ' ' | 206 tr ' ' ' |
207 ' < "$tmpdepfile" \ | 207 ' < "$tmpdepfile" \ |
208 | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ | 208 | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ |
209 >> $depfile | 209 >> "$depfile" |
210 else | 210 else |
211 # The sourcefile does not contain any dependencies, so just | 211 # The sourcefile does not contain any dependencies, so just |
212 # store a dummy comment line, to avoid errors with the Makefile | 212 # store a dummy comment line, to avoid errors with the Makefile |
213 # "include basename.Plo" scheme. | 213 # "include basename.Plo" scheme. |
214 echo "#dummy" > "$depfile" | 214 echo "#dummy" > "$depfile" |
333 test -f "$tmpdepfile" && break | 333 test -f "$tmpdepfile" && break |
334 done | 334 done |
335 if test -f "$tmpdepfile"; then | 335 if test -f "$tmpdepfile"; then |
336 sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile" | 336 sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile" |
337 # Add `dependent.h:' lines. | 337 # Add `dependent.h:' lines. |
338 sed -ne '2,${; s/^ *//; s/ \\*$//; s/$/:/; p;}' "$tmpdepfile" >> "$depfile" | 338 sed -ne '2,${ |
339 s/^ *// | |
340 s/ \\*$// | |
341 s/$/:/ | |
342 p | |
343 }' "$tmpdepfile" >> "$depfile" | |
339 else | 344 else |
340 echo "#dummy" > "$depfile" | 345 echo "#dummy" > "$depfile" |
341 fi | 346 fi |
342 rm -f "$tmpdepfile" "$tmpdepfile2" | 347 rm -f "$tmpdepfile" "$tmpdepfile2" |
343 ;; | 348 ;; |
409 # always write the preprocessed file to stdout, regardless of -o. | 414 # always write the preprocessed file to stdout, regardless of -o. |
410 "$@" || exit $? | 415 "$@" || exit $? |
411 | 416 |
412 # Remove the call to Libtool. | 417 # Remove the call to Libtool. |
413 if test "$libtool" = yes; then | 418 if test "$libtool" = yes; then |
414 while test $1 != '--mode=compile'; do | 419 while test "X$1" != 'X--mode=compile'; do |
415 shift | 420 shift |
416 done | 421 done |
417 shift | 422 shift |
418 fi | 423 fi |
419 | 424 |
460 | 465 |
461 makedepend) | 466 makedepend) |
462 "$@" || exit $? | 467 "$@" || exit $? |
463 # Remove any Libtool call | 468 # Remove any Libtool call |
464 if test "$libtool" = yes; then | 469 if test "$libtool" = yes; then |
465 while test $1 != '--mode=compile'; do | 470 while test "X$1" != 'X--mode=compile'; do |
466 shift | 471 shift |
467 done | 472 done |
468 shift | 473 shift |
469 fi | 474 fi |
470 # X makedepend | 475 # X makedepend |
471 shift | 476 shift |
472 cleared=no | 477 cleared=no |
473 for arg in "$@"; do | 478 for arg |
479 do | |
474 case $cleared in | 480 case $cleared in |
475 no) | 481 no) |
476 set ""; shift | 482 set ""; shift |
477 cleared=yes ;; | 483 cleared=yes ;; |
478 esac | 484 esac |
485 ;; | 491 ;; |
486 *) | 492 *) |
487 set fnord "$@" "$arg"; shift ;; | 493 set fnord "$@" "$arg"; shift ;; |
488 esac | 494 esac |
489 done | 495 done |
490 obj_suffix="`echo $object | sed 's/^.*\././'`" | 496 obj_suffix=`echo "$object" | sed 's/^.*\././'` |
491 touch "$tmpdepfile" | 497 touch "$tmpdepfile" |
492 ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" | 498 ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" |
493 rm -f "$depfile" | 499 rm -f "$depfile" |
494 cat < "$tmpdepfile" > "$depfile" | 500 cat < "$tmpdepfile" > "$depfile" |
495 sed '1,2d' "$tmpdepfile" | tr ' ' ' | 501 sed '1,2d' "$tmpdepfile" | tr ' ' ' |
505 # always write the preprocessed file to stdout. | 511 # always write the preprocessed file to stdout. |
506 "$@" || exit $? | 512 "$@" || exit $? |
507 | 513 |
508 # Remove the call to Libtool. | 514 # Remove the call to Libtool. |
509 if test "$libtool" = yes; then | 515 if test "$libtool" = yes; then |
510 while test $1 != '--mode=compile'; do | 516 while test "X$1" != 'X--mode=compile'; do |
511 shift | 517 shift |
512 done | 518 done |
513 shift | 519 shift |
514 fi | 520 fi |
515 | 521 |
548 # always write the preprocessed file to stdout. | 554 # always write the preprocessed file to stdout. |
549 "$@" || exit $? | 555 "$@" || exit $? |
550 | 556 |
551 # Remove the call to Libtool. | 557 # Remove the call to Libtool. |
552 if test "$libtool" = yes; then | 558 if test "$libtool" = yes; then |
553 while test $1 != '--mode=compile'; do | 559 while test "X$1" != 'X--mode=compile'; do |
554 shift | 560 shift |
555 done | 561 done |
556 shift | 562 shift |
557 fi | 563 fi |
558 | 564 |