Wrapper around cpp to locate the appropriate binary.
authordrepper <drepper>
Fri, 2 Nov 2001 02:07:18 +0000 (02:07 +0000)
committerdrepper <drepper>
Fri, 2 Nov 2001 02:07:18 +0000 (02:07 +0000)
scripts/cpp [new file with mode: 0755]

diff --git a/scripts/cpp b/scripts/cpp
new file mode 100755 (executable)
index 0000000..4a62f1e
--- /dev/null
@@ -0,0 +1,21 @@
+#! /bin/sh
+cpp=`which cpp 2>/dev/null`
+if test $? -ne 0; then
+  cpp=`type cpp 2>/dev/null | awk '{ print $NF }'`
+  if test $? -ne 0; then
+    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: