File: cmp-autoconf-regular.sh

package info (click to toggle)
ace 6.0.3%2Bdfsg-0.1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 49,368 kB
  • sloc: cpp: 341,826; perl: 30,850; ansic: 20,952; makefile: 10,144; sh: 4,744; python: 828; exp: 787; yacc: 511; xml: 330; lex: 158; lisp: 116; csh: 48; tcl: 5
file content (37 lines) | stat: -rwxr-xr-x 744 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/sh

usage() {
	cat >&2 << EOF
usage: $0 <first> <second>
compares ACE config.h files (using cpp)
e.g.: $0 ACE_wrappers/ace/config-linux.h objdir/ace/config.h
EOF
}

report_to() {
    g++ -E -DACE_HAS_LINUX_NPTL -dM -I"$ACE_ROOT" $1 | \
      grep '^#define ACE' | grep -v '^#define ACE_CONFIG' | \
      sed -e 's/^#define \+\([A-Z0-9_]\+\) *$/#define \1 1/g' | \
      sort >> $2
}

if test "a$ACE_ROOT" = "a"; then
    echo "$0: please define ACE_ROOT" >&2
    exit 1
fi

if test "$#" -ne 2; then
    usage
    exit 2
fi

ONE_TMP=`mktemp -t ace_cmp_one.XXXXXXXXXX` || exit 1
TWO_TMP=`mktemp -t ace_cmp_two.XXXXXXXXXX` || exit 1

trap "rm $ONE_TMP $TWO_TMP" EXIT

report_to $1 $ONE_TMP
report_to $2 $TWO_TMP

diff -u $ONE_TMP $TWO_TMP