File: find_flags_common

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 (42 lines) | stat: -rw-r--r-- 1,456 bytes parent folder | download | duplicates (2)
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
#=============================================================================
#
#  Program:   GCC-XML
#  Module:    $RCSfile: find_flags_common,v $
#  Language:  C++
#  Date:      $Date: 2009-06-09 18:18:01 $
#  Version:   $Revision: 1.1 $
#
#  Copyright (c) 2002 Kitware, Inc., Insight Consortium.  All rights reserved.
#  See Copyright.txt for details.
#
#     This software is distributed WITHOUT ANY WARRANTY; without even 
#     the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
#     PURPOSE.  See the above copyright notices for more information.
#
#=============================================================================

GCCXML_PID="$$"
cat > "/tmp/gccxml_identify_compiler_args$GCCXML_PID.cc" <<!
#include <>
!

# Find the macro definition options.
MACROS=`${CXX} ${CXXFLAGS} /tmp/gccxml_identify_compiler_args$GCCXML_PID.cc -E -xdumpmacros=defs 2>&1 |
       awk '{ if ($1 ~ /#define/) printf("-D%s=%s %s %s ",$2,$3,$4,$5) }'` 
MACROS="-D__cplusplus=199711L -D__STDC__ -D_REENTRANT $MACROS"

# Find the include path options.
INCLUDES="`echo '' | ${CXX} -v -E ${CXXFLAGS} ~ 2>&1 | perl -ne 'print m|(-I/[/a-zA-Z0-9\._-]+\s*)|og'`"
INCLUDES="$INCLUDES -I/usr/include"

# Use hacked headers
if [ -d "$CXX_SUPPORT_DIR" ]; then
  INCLUDES="-iwrapper\"$CXX_SUPPORT_DIR\" $INCLUDES"
fi

# Cleanup
rm -rf "/tmp/gccxml_identify_compiler_args$GCCXML_PID.cc"
 
# Format the options.
OPTIONS="$MACROS $INCLUDES $SPECIAL"