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

user/2715: src/usr.sbin/dhcp build improvement



>Number:         2715
>Category:       user
>Synopsis:       src/usr.sbin/dhcp build improvement
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Mon Jun 03 00:20:01 MDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     Gregory Steuck
>Release:        3.1
>Organization:
net
>Environment:
	System      : OpenBSD 3.1
	Architecture: OpenBSD.i386
	Machine     : i386
>Description:
  Build process of dhcp suite can be improved by creating a library
 and linking all utilities against it. Currently all file from common
 are recompiled 3 times: for dhclient, server, and relay. Application
 of the patch below halves the compilation time. In my testing it
 didn't break anything. I only use client and server.

>How-To-Repeat:

>Fix:
Index: Makefile
===================================================================
RCS file: /cvs/src/usr.sbin/dhcp/Makefile,v
retrieving revision 1.4
diff -u -r1.4 Makefile
--- Makefile	1998/09/12 08:55:10	1.4
+++ Makefile	2002/06/03 05:54:54
@@ -30,6 +30,6 @@
 # OF THE POSSIBILITY OF SUCH DAMAGE.
 #
 
-SUBDIR=	server dhclient relay common
+SUBDIR=	common server dhclient relay
 
 .include <bsd.subdir.mk>
Index: Makefile.inc
===================================================================
RCS file: /cvs/src/usr.sbin/dhcp/Makefile.inc,v
retrieving revision 1.6
diff -u -r1.6 Makefile.inc
--- Makefile.inc	2001/10/08 18:25:27	1.6
+++ Makefile.inc	2002/06/03 05:54:54
@@ -32,16 +32,18 @@
 
 .include <bsd.obj.mk>
 
-.PATH:	${.CURDIR}/../common
-
 CLIENT_PATH = '"PATH=/usr/bin:/usr/sbin:/bin:/sbin"'
 
-SRCS += alloc.c dispatch.c hash.c memory.c print.c bpf.c icmp.c options.c \
-	tree.c conflex.c errwarn.c inet.c packet.c socket.c convert.c \
-	ethernet.c tables.c parse.c
-
 CPPFLAGS+= -I${.CURDIR}/.. -I${.CURDIR}/../includes \
 	-DCLIENT_PATH=${CLIENT_PATH} -Wall -Werror
+
+.if exists(${.CURDIR}/../common/${__objdir})
+LDADD+=		-L${.CURDIR}/../common/${__objdir} -ldhcommon
+DPADD+=		${.CURDIR}/../common/${__objdir}/libdhcommon.a
+.else
+LDADD+=		-L${.CURDIR}/../common -ldhcommon
+DPADD+=		${.CURDIR}/../common/libdhcommon.a
+.endif
 
 .if exists(${.CURDIR}/../../Makefile.inc)
 .include "${.CURDIR}/../../Makefile.inc"
Index: common/Makefile
===================================================================
RCS file: /cvs/src/usr.sbin/dhcp/common/Makefile,v
retrieving revision 1.2
diff -u -r1.2 Makefile
--- common/Makefile	1998/08/18 15:44:41	1.2
+++ common/Makefile	2002/06/03 05:54:54
@@ -29,7 +29,18 @@
 # OF THE POSSIBILITY OF SUCH DAMAGE.
 #
 
-NOPROG=
+LIB	= dhcommon
+NOPROFILE= yes
+NOPIC=	yes
+
+SRCS=   alloc.c dispatch.c hash.c memory.c print.c bpf.c icmp.c options.c \
+	tree.c conflex.c errwarn.c inet.c packet.c socket.c convert.c \
+	ethernet.c tables.c parse.c
+
 MAN    = dhcp-options.5
+
+install:
+	@echo -n
+
+.include <bsd.lib.mk>
 
-.include <bsd.prog.mk>

>Release-Note:
>Audit-Trail:
>Unformatted: