From jhein@timing.com  Tue Sep 10 17:15:49 2002
Return-Path: <jhein@timing.com>
Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP
	id ADB9B37B400; Tue, 10 Sep 2002 17:15:49 -0700 (PDT)
Received: from Daffy.timing.com (daffy.timing.com [206.168.13.218])
	by mx1.FreeBSD.org (Postfix) with ESMTP
	id 00C2443E42; Tue, 10 Sep 2002 17:15:49 -0700 (PDT)
	(envelope-from jhein@timing.com)
Received: from brain.timing.com (brain.timing.com [206.168.13.195])
	by Daffy.timing.com (8.11.3/8.11.3) with ESMTP id g8B0FmK45178;
	Tue, 10 Sep 2002 18:15:48 -0600 (MDT)
	(envelope-from jhein@timing.com)
Received: from brain.timing.com (localhost [127.0.0.1])
	by brain.timing.com (8.12.2/8.12.2) with ESMTP id g8B0Fmcq003872;
	Tue, 10 Sep 2002 18:15:48 -0600 (MDT)
	(envelope-from jhein@brain.timing.com)
Received: (from jhein@localhost)
	by brain.timing.com (8.12.2/8.12.2/Submit) id g8B0FlGe003871;
	Tue, 10 Sep 2002 18:15:47 -0600 (MDT)
	(envelope-from jhein)
Message-Id: <200209110015.g8B0FlGe003871@brain.timing.com>
Date: Tue, 10 Sep 2002 18:15:47 -0600 (MDT)
From: jhein@timing.com
Reply-To: jhein@timing.com
To: FreeBSD-gnats-submit@freebsd.org
Cc: marcel@freebsd.org
Subject: linux_kdump port for source dirs != /usr/src
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         42649
>Category:       ports
>Synopsis:       linux_kdump port for source dirs != /usr/src
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    marcel
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Tue Sep 10 17:20:01 PDT 2002
>Closed-Date:    Sat Feb 14 00:00:03 PST 2004
>Last-Modified:  Sat Feb 14 00:00:03 PST 2004
>Originator:     
>Release:        FreeBSD 4.x or 5.x i386
>Organization:
>Environment:
System: FreeBSD


>Description:
I keep various source trees around, and they can't all be in /usr/src ;)

So here's a patch that "unbreaks" the linux_kdump port requirement
 that the source be in /usr/src.  All you have to do is specify
 'make SRCDIR=/some/where/else'.  It defaults to /usr/src.
 Feel free to change the var names if there are better names.

>How-To-Repeat:
	'cd ports/devel/linux_kdump ; make' with source tree somewhere
	other than /usr/src
>Fix:

for the port Makefile...

Index: Makefile
===================================================================
RCS file: /base/FreeBSD-CVS/ports/devel/linux_kdump/Makefile,v
retrieving revision 1.17
diff -u -r1.17 Makefile
--- Makefile	2000/08/11 00:46:13	1.17
+++ Makefile	2002/09/10 11:30:51
@@ -20,11 +20,14 @@
 
 .include <bsd.port.pre.mk>
 
-.if !exists(/sys/i386/linux/syscalls.master)
-BROKEN=		"requires kernel source present in /sys"
+SRCDIR?=	/usr/src
+SYSDIR?=	${SRCDIR}/sys
+
+.if !exists(${SYSDIR}/i386/linux/syscalls.master)
+BROKEN=		"requires kernel source present in ${SYSDIR}"
 .endif
-.if !exists(/usr/src/usr.bin/ktrace/subr.c)
-BROKEN=		"requires ktrace source present in /usr/src/usr.bin/ktrace"
+.if !exists(${SRCDIR}/usr.bin/ktrace/subr.c)
+BROKEN=		"requires ktrace source present in ${SRCDIR}/usr.bin/ktrace"
 .endif
 
 .include <bsd.port.post.mk>


and for the Makefile down in the work dir...


--- work/linux_kdump-1.4/Makefile.orig	Tue Mar 23 04:46:00 1999
+++ work/linux_kdump-1.4/Makefile	Tue Sep 10 05:22:54 2002
@@ -4,15 +4,17 @@
 BINDIR=	/bin
 MANDIR=	/man/man
 PROG=	linux_kdump
-CFLAGS+=-I/usr/src/usr.bin/ktrace -I/
+SRCDIR?=/usr/src
+SYSDIR?=${SRCDIR}/sys
+CFLAGS+=-I${SRCDIR}/usr.bin/ktrace -I/
 SRCS=	kdump.c linux_ioctl.c subr.c syscallnames.c
-.PATH:	/usr/src/usr.bin/ktrace
+.PATH:	${SRCDIR}/usr.bin/ktrace
 CLEANFILES+=linux_ioctl.c syscallnames.c
 
 default:	depend all
 
 syscallnames.c:
-	/bin/sh /sys/kern/makesyscalls.sh /sys/i386/linux/syscalls.master linux_syscallnames.conf
+	/bin/sh ${SYSDIR}/kern/makesyscalls.sh ${SYSDIR}/i386/linux/syscalls.master linux_syscallnames.conf
 	echo "int nsyscalls = sizeof (syscallnames) / sizeof (syscallnames[0]);" >> syscallnames.c
 
 linux_ioctl.c: mkioctls.linux
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports->marcel 
Responsible-Changed-By: lioux 
Responsible-Changed-When: Fri Oct 11 19:29:22 PDT 2002 
Responsible-Changed-Why:  
Over to maintainer(s) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=42649 
State-Changed-From-To: open->closed 
State-Changed-By: marcel 
State-Changed-When: Fri Feb 13 23:59:17 PST 2004 
State-Changed-Why:  
Patch committed. New port version is 1.5. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=42649 
>Unformatted:
