2002-08-30 Roland McGrath <roland@redhat.com>
authorroland <roland>
Fri, 30 Aug 2002 10:36:11 +0000 (10:36 +0000)
committerroland <roland>
Fri, 30 Aug 2002 10:36:11 +0000 (10:36 +0000)
* sunrpc/Makefile (rpcgen-cmd): Pass CPP in rpcgen's environment.
* scripts/cpp: Just use the environment variable.

scripts/cpp
sunrpc/Makefile

index 24112c6..65f273e 100755 (executable)
@@ -1,22 +1,6 @@
 #! /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:
+# This script is used solely by rpcgen when run by sunrpc/Makefile,
+# which passes CPP in the environment to tell us what to run.
+
+exec ${CPP} "$@"
index b3e71ad..f2c31c7 100644 (file)
@@ -132,7 +132,7 @@ $(objpfx)rpcgen: $(addprefix $(objpfx),$(rpcgen-objs)) \
        $(+link)
 
 # Tell rpcgen where to find the C preprocessor.
-rpcgen-cmd = $(built-program-cmd) -Y ../scripts
+rpcgen-cmd = CPP='$(CC) -E -x c-header' $(built-program-cmd) -Y ../scripts
 
 # Install the rpc data base file.
 $(inst_sysconfdir)/rpc: etc.rpc $(+force)