Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src If /usr/bin/cpp is not executable and RPCGEN_CPP was not set...



details:   https://anonhg.NetBSD.org/src/rev/8468c60eb5ce
branches:  trunk
changeset: 787183:8468c60eb5ce
user:      joerg <joerg%NetBSD.org@localhost>
date:      Wed Jun 05 13:54:26 2013 +0000

description:
If /usr/bin/cpp is not executable and RPCGEN_CPP was not set, try
/usr/bin/clang-cpp. This allows rpcgen to work in a clang-only release
build. Document hack to be resolved when the final decision about
/usr/bin/cpp and friends is made.

diffstat:

 doc/HACKS                 |  13 ++++++++++++-
 usr.bin/rpcgen/rpc_main.c |   9 ++++++---
 2 files changed, 18 insertions(+), 4 deletions(-)

diffs (55 lines):

diff -r d056df8e6fbf -r 8468c60eb5ce doc/HACKS
--- a/doc/HACKS Wed Jun 05 09:06:21 2013 +0000
+++ b/doc/HACKS Wed Jun 05 13:54:26 2013 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: HACKS,v 1.129 2013/06/03 23:02:43 christos Exp $
+# $NetBSD: HACKS,v 1.130 2013/06/05 13:54:26 joerg Exp $
 #
 # This file is intended to document workarounds for currently unsolved
 # (mostly) compiler bugs.
@@ -790,3 +790,14 @@
                workaround for:
                internal compiler error: in cselib_record_set, at cselib.c:1999
        kcah
+
+hack   fallback to /usr/bin/clang-cpp in rpcgen
+cdate  Wed Jun  5 15:49:27 CEST 2013
+who    joerg
+file   src/usr.bin/rpcgen/rpc_main.c
+descr
+       It is undecided which compiler owns /usr/bin/cpp whether it should
+       exist in a MKGCC=no world. To allow rpcgen to work out-of-the-box,
+       if either gcc or clang is installed, use /usr/bin/clang-cpp as fallback.
+       This applies only if RPCGEN_CPP is not set and /usr/bin/cpp is not executable.
+kcah
diff -r d056df8e6fbf -r 8468c60eb5ce usr.bin/rpcgen/rpc_main.c
--- a/usr.bin/rpcgen/rpc_main.c Wed Jun 05 09:06:21 2013 +0000
+++ b/usr.bin/rpcgen/rpc_main.c Wed Jun 05 13:54:26 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rpc_main.c,v 1.34 2011/08/31 16:24:58 plunky Exp $     */
+/*     $NetBSD: rpc_main.c,v 1.35 2013/06/05 13:54:26 joerg Exp $      */
 
 /*
  * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
@@ -39,7 +39,7 @@
 #if 0
 static char sccsid[] = "@(#)rpc_main.c 1.30 89/03/30 (C) 1987 SMI";
 #else
-__RCSID("$NetBSD: rpc_main.c,v 1.34 2011/08/31 16:24:58 plunky Exp $");
+__RCSID("$NetBSD: rpc_main.c,v 1.35 2013/06/05 13:54:26 joerg Exp $");
 #endif
 #endif
 
@@ -164,8 +164,11 @@
        struct commandline cmd;
 
        setprogname(argv[0]);
-       if (!(CPP = getenv("RPCGEN_CPP")))
+       if ((CPP = getenv("RPCGEN_CPP")) == NULL) {
                CPP = "/usr/bin/cpp";
+               if (access(CPP, X_OK))
+                       CPP = "/usr/bin/clang-cpp";
+       }
 
        (void) memset((char *) &cmd, 0, sizeof(struct commandline));
        clear_args();



Home | Main Index | Thread Index | Old Index