File: cxref-cpp-configure.in

package info (click to toggle)
cxref 1.6a-1.1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 2,124 kB
  • ctags: 1,502
  • sloc: ansic: 18,209; yacc: 2,086; sh: 917; lex: 460; perl: 452; makefile: 418; lisp: 256; cpp: 188; python: 80
file content (101 lines) | stat: -rwxr-xr-x 2,253 bytes parent folder | download | duplicates (4)
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
#!/bin/sh
#
# $Header: /home/amb/cxref/cpp/RCS/cxref-cpp-configure.in 1.2 2004/06/19 18:16:37 amb Exp $
#
# C Cross Referencing & Documentation tool. Version 1.6.
#
# A script to generate the runtime configuration information for
# cxref-cpp so that it can imitate gcc.
#
# Written by Andrew M. Bishop
#
# This file Copyright 2004 Andrew M. Bishop
# It may be distributed under the GNU Public License, version 2, or
# any higher version.  See section COPYING of the GNU Public license
# for conditions under which this file may be redistributed.
#

# Programs and paths
# (Default to the ones from the configure script).

EGREP="@EGREP@"

prefix="@prefix@"
cxref_cpp_defines="@datadir@/cxref/cxref-cpp.defines"

# Chose the C compiler and output file to use if not specified.
# (Defaults to compiler found by configure script).

while [ ! $# = 0 ]; do

    case $1 in
        -o)
            shift
            cxref_cpp_defines=$1
            ;;
        *)
            CC=$1
            ;;
    esac
    shift

done

if [ "$CC" = "" ]; then
    CC=@CC@
fi

# Check if this is gcc or not.
# (Defaults to check made by configure script)

GCC=@GCC@

if [ "$GCC" = "" ]; then

    echo ""
    echo "cxref-cpp-configure"
    echo ""
    echo "You are not using gcc, it is not possible to create the configuration file."
    echo "Read the README file and create $cxref_cpp_defines manually."
    echo ""

    exit 0

fi

# Get the predefines.

PREDEFINES=`$CC -E -v - < /dev/null 2>&1 | $EGREP -e -D__GNUC | tr ' ' '\012' | $EGREP -e '^-[AD]' | tr '\012' ' '`

# Get the paths.

INCLUDES=`$CC -E -v - < /dev/null 2>&1 | awk '/include <.+> search/,/End of search/ {print $1}'`

# Get the defines.

DEFINES=`$CC -E -dM - < /dev/null 2>/dev/null | sort | tr '\012' '\015'`

# Create the output file.

echo "// cxref-cpp runtime configuration file" > $cxref_cpp_defines

# Write the predefines to the file.

for define in $PREDEFINES; do
    echo "// $define" >> $cxref_cpp_defines
done

# Write the include paths to the file.

for include in $INCLUDES; do
    test -d $include && echo "// -I$include" >> $cxref_cpp_defines
done

# Write the built-in #defines to the file.

IFS=
export IFS

for define in $DEFINES; do
    echo $define >> $cxref_cpp_defines
done