From kchowksey@hss.hns.com Tue Dec 1 20:27:00 1998 Received: from tapti.hss.hns.com (tapti.hss.hns.com [139.85.242.19]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id UAA04036 for ; Tue, 1 Dec 1998 20:26:30 -0800 (PST) (envelope-from kchowksey@hss.hns.com) Received: from tarang.hss.hns.com (tarang.hss.hns.com [139.85.242.33]) by tapti.hss.hns.com (8.8.8/8.8.8) with ESMTP id KAA10003 for ; Wed, 2 Dec 1998 10:42:10 +0530 (IST) Received: (from kchowksey@localhost) by tarang.hss.hns.com (8.8.2/8.7.3) id KAA22764; Wed, 2 Dec 1998 10:41:01 +0530 (IST) Message-Id: <199812020511.KAA22764@tarang.hss.hns.com> Date: Wed, 2 Dec 1998 10:41:01 +0530 (IST) From: Kapil Chowksey Reply-To: kchowksey@hss.hns.com To: FreeBSD-gnats-submit@freebsd.org Subject: [patch] Adding -d flag to xlint X-Send-Pr-Version: 3.2 >Number: 8930 >Category: bin >Synopsis: Adding -d flag to xlint >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: closed >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Tue Dec 1 20:30:00 PST 1998 >Closed-Date: Wed Dec 2 08:26:19 PST 1998 >Last-Modified: Wed Dec 2 08:28:31 PST 1998 >Originator: Kapil Chowksey >Release: FreeBSD 3.0-CURRENT i386 >Organization: disorganised >Environment: FreeBSD elbereth.hss.hns.com 3.0-CURRENT FreeBSD 3.0-CURRENT #0: Fri Nov 20 22:18:39 IST 1998 >Description: Included is a patch that adds -d flag to xlint. This flag takes an argument as the directory name to use for standard include files. Ie. xlint -d /cross/usr/include invokes cc -E -nostdinc -idirafter /cross/usr/include This is in support of cross-builds of the freebsd tree. The flag is compatible with NetBSD's lint. >How-To-Repeat: Any 3.0-current system >Fix: Index: xlint/lint.1 =================================================================== RCS file: /cvs/src/usr.bin/xlint/xlint/lint.1,v retrieving revision 1.5 diff -c -r1.5 lint.1 *** lint.1 1998/03/23 07:48:03 1.5 --- lint.1 1998/11/26 13:56:06 *************** *** 42,47 **** --- 42,48 ---- .Op Fl i Ns | Ns Fl nu .Op Fl D Ns Ar name Ns Op =def .Op Fl U Ns Ar name + .Op Fl d Ns Ar directory .Op Fl I Ns Ar directory .Op Fl L Ns Ar directory .Op Fl l Ns Ar library *************** *** 52,57 **** --- 53,59 ---- .Op Fl s Ns | Ns Fl t .Fl C Ns Ar library .Op Fl D Ns Ar name Ns Op =def + .Op Fl d Ns Ar directory .Op Fl I Ns Ar directory .Op Fl U Ns Ar name .Ar *************** *** 280,285 **** --- 282,291 ---- directive. If no definition is given, .Ar name is defined as 1. + .It Fl d Ns Ar directory + Use + .Ar directory + as the path containing the standard include files. .It Fl I Ns Ar directory Add .Ar directory Index: xlint/xlint.c =================================================================== RCS file: /cvs/src/usr.bin/xlint/xlint/xlint.c,v retrieving revision 1.4 diff -c -r1.4 xlint.c *** xlint.c 1997/03/11 14:49:51 1.4 --- xlint.c 1998/11/26 13:56:11 *************** *** 92,98 **** static char **libsrchpath; /* flags */ ! static int iflag, oflag, Cflag, sflag, tflag, Fflag; /* print the commands executed to run the stages of compilation */ static int Vflag; --- 92,98 ---- static char **libsrchpath; /* flags */ ! static int iflag, oflag, Cflag, sflag, tflag, Fflag, dflag; /* print the commands executed to run the stages of compilation */ static int Vflag; *************** *** 365,371 **** argv += optind; optind = 0; ! c = getopt(argc, argv, "abceghil:no:prstuvxzC:D:FHI:L:U:V"); switch (c) { --- 365,371 ---- argv += optind; optind = 0; ! c = getopt(argc, argv, "abcd:eghil:no:prstuvxzC:D:FHI:L:U:V"); switch (c) { *************** *** 451,456 **** --- 451,465 ---- freelst(&deflibs); break; + case 'd': + if (dflag) + usage(); + dflag = 1; + appcstrg(&cppflags, "-nostdinc"); + appcstrg(&cppflags, "-idirafter"); + appcstrg(&cppflags, optarg); + break; + case 'D': case 'I': case 'U': Index: bsd.prog.mk =================================================================== RCS file: /cvs/src/share/mk/bsd.prog.mk,v retrieving revision 1.79 diff -c -r1.79 bsd.prog.mk *** bsd.prog.mk 1998/10/18 09:35:17 1.79 --- bsd.prog.mk 1998/12/02 04:16:30 *************** *** 17,22 **** --- 17,23 ---- .if defined(DESTDIR) CFLAGS+= -I${DESTDIR}/usr/include CXXINCLUDES+= -I${DESTDIR}/usr/include/g++ + LINTFLAGS+= -d${DESTDIR}/usr/include .endif .if !defined(DEBUG_FLAGS) >Release-Note: >Audit-Trail: State-Changed-From-To: open->closed State-Changed-By: bde State-Changed-When: Wed Dec 2 08:26:19 PST 1998 State-Changed-Why: The submitter agrees with me that lint should use the same rules for include paths as cc; thus it should get the rules from CFLAGS. >Unformatted: