File: cxref-cpp.wrap.ori

package info (click to toggle)
cxref 1.6e-5
  • links: PTS
  • area: main
  • in suites: bookworm
  • size: 3,004 kB
  • sloc: ansic: 16,598; yacc: 2,091; sh: 937; lex: 470; perl: 452; makefile: 438; lisp: 256; cpp: 188; python: 80
file content (42 lines) | stat: -rw-r--r-- 1,022 bytes parent folder | download | duplicates (11)
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
38
39
40
41
42
#!/bin/sh

set -e

DEF=/etc/cxref/cxref-cpp.defines
gcc_vers () {

    ! [ -e $DEF ] || 
    	awk '/-D__GNUC__/ {split($NF,A,"=");maj=A[2]}
  	     /-D__GNUC_MINOR__/ {split($NF,A,"=");min=A[2]}
  	     /-D__GNUC_PATCHLEVEL__/ {split($NF,A,"=");pat=A[2]}
	     END {printf("%s.%s.%s",maj,min,pat)}' $DEF
}


. /etc/cxref/config

j="$@"

GV=`gcc -v 2>&1 | grep "^gcc version" | awk '{print $3}'`
GVC=`gcc_vers`
if [ "$GV" != "$GVC" ] ; then

	echo "Warning: cxref-cpp needs to be reconfigured against your latest gcc/cpp" >&2
	echo "   $GV != $GVC" >&2
	echo "   Please run 'dpkg-reconfigure cxref' as root." >&2

	if [ "$AUTOCONF" = "true" ] ; then
	    b=`tempfile -p cxref -m 777`
	    c=`tempfile -p cxref -m 777`
	    sed -e 's,/etc,/tmp,g' -e 's,cxref/cxref,cxref,g' </usr/bin/cxref-cpp-configure >$b
	    chmod 755 $b
	    $b
	    mv /tmp/cxref-cpp.defines $c
	    j=`echo $j | sed 's,\-cxref\-cpp\-defines  *[^ ]*,,g'`
	    j="$j -cxref-cpp-defines $c"
	else
	    exit 1
	fi
fi

exec /usr/bin/cxref-cpp.upstream $j