File: cmp-autoconf-regular.sh

package info (click to toggle)
ace 6.4.5%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 48,640 kB
  • ctags: 41,204
  • sloc: cpp: 336,448; perl: 33,068; ansic: 20,676; sh: 3,735; exp: 787; python: 635; yacc: 511; xml: 330; lex: 158; lisp: 116; makefile: 80; csh: 20; 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