summary refs log tree commit diff
path: root/scripts/cpp
blob: 24112c663c01d909486d837b5c605be4ddf7d6bf (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#! /bin/sh
cpp=`which cpp 2>/dev/null`
if test $? -ne 0; then
  if type cpp 2>/dev/null >/dev/null; then
    cpp=`type cpp 2>/dev/null | awk '{ print $NF }'`
  else
    cpp=`gcc -print-file-name=cpp 2>/dev/null`
    if test $? -ne 0; then
      if test -x /lib/cpp; then
        cpp=/lib/cpp
      else
        echo "cpp not found" 1>&2
        exit 1
      fi
    fi
  fi
fi

exec $cpp $*
Local Variables:
mode: sh
End: