File: adapt_headers.sh

package info (click to toggle)
gccxml 0.9.0%2Bcvs20100501-2
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 79,132 kB
  • ctags: 73,371
  • sloc: ansic: 751,436; cpp: 34,175; asm: 26,833; sh: 5,077; makefile: 4,696; lex: 589; awk: 566; perl: 334; yacc: 271; pascal: 86; python: 29
file content (34 lines) | stat: -rw-r--r-- 735 bytes parent folder | download | duplicates (3)
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
#!/bin/sh

cd `dirname $0`

#########################################
# Patch C++ Compiler Includes
#########################################

XLC_INCLUDES=`../find_flags "$@" | perl -ne '($a) = m|-I([/a-zA-Z0-9\._-]+)|o ; print "$a\n" if $a'`

for f in $XLC_INCLUDES/*
do
  b=`basename $f`

  sed \
  -e 's/\(extern[[:space:]]\{1,\}\)"builtin"/\1"C"/g' \
  -e 's/^\([[:space:]]\{1,\}\)??=/\1#/g' \
  -e 's/__IBMCPP__ < 400/!defined(__GCCXML__)/g' \
  -e 's/IBM VisualAge C++ v4 and later compilers/GCCXML/g' \
  -e '/#pragma[[:space:]]\{1,\}implementation/d' \
  $f > $b.tmp

  if ! cmp -s $f $b.tmp
  then
    echo "modifying $b"
    mv $b.tmp $b
  else
    rm $b.tmp
  fi

done

patch -s -i stdlib.h.patch
patch -s -i xstring.patch