* scripts/cpp: Test the exit status from 'type', not 'awk'.
[platform/upstream/glibc.git] / scripts / cpp
1 #! /bin/sh
2 cpp=`which cpp 2>/dev/null`
3 if test $? -ne 0; then
4   if type cpp 2>/dev/null >/dev/null; then
5     cpp=`type cpp 2>/dev/null | awk '{ print $NF }'`
6   else
7     cpp=`gcc -print-file-name=cpp 2>/dev/null`
8     if test $? -ne 0; then
9       if test -x /lib/cpp; then
10         cpp=/lib/cpp
11       else
12         echo "cpp not found" 1>&2
13         exit 1
14       fi
15     fi
16   fi
17 fi
18
19 exec $cpp $*
20 Local Variables:
21 mode: sh
22 End: