~ubuntu-branches/ubuntu/quantal/gclcvs/quantal

« back to all changes in this revision

Viewing changes to xbin/strip-ifdef

  • Committer: Bazaar Package Importer
  • Author(s): Camm Maguire
  • Date: 2004-06-24 15:13:46 UTC
  • Revision ID: james.westby@ubuntu.com-20040624151346-xh0xaaktyyp7aorc
Tags: 2.7.0-26
C_GC_OFFSET is 2 on m68k-linux

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh
 
2
 
 
3
# Sample usage strip-ifdef foo.c -Dmips -DATT
 
4
# will select only code in those ifdefs which are selected by mips and ATT.
 
5
# includes, and defines will be left intact, as will comments
 
6
 
 
7
cat $1 | sed -e "s:^#include:XX#include:g" -e "s:^#define:XX#define:g"  > /tmp/tmpx.c
 
8
shift 1
 
9
 
 
10
gcc -E -C /tmp/tmpx.c $@ | sed -e "/^#/d" -e "s:XX#:#:g" -e "/^$/d" | cb