Clone of mesa.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

confdiff.sh 799B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. #!/bin/bash -e
  2. usage()
  3. {
  4. echo "Usage: $0 <target1> <target2>"
  5. echo "Highlight differences between Mesa configs"
  6. echo "Example:"
  7. echo " $0 linux linux-x86"
  8. }
  9. die()
  10. {
  11. echo "$@" >&2
  12. return 1
  13. }
  14. case "$1" in
  15. -h|--help) usage; exit 0;;
  16. esac
  17. [ $# -lt 2 ] && die 2 targets needed. See $0 --help
  18. target1=$1
  19. target2=$2
  20. topdir=$(cd "`dirname $0`"/..; pwd)
  21. cd "$topdir"
  22. [ -f "./configs/$target1" ] || die Missing configs/$target1
  23. [ -f "./configs/$target2" ] || die Missing configs/$target2
  24. trap 'rm -f "$t1" "$t2"' 0
  25. t1=$(mktemp)
  26. t2=$(mktemp)
  27. make -f- -n -p <<EOF | sed '/^# Not a target/,/^$/d' > $t1
  28. TOP = .
  29. include \$(TOP)/configs/$target1
  30. default:
  31. EOF
  32. make -f- -n -p <<EOF | sed '/^# Not a target/,/^$/d' > $t2
  33. TOP = .
  34. include \$(TOP)/configs/$target2
  35. default:
  36. EOF
  37. diff -pu -I'^#' $t1 $t2