Adjust build glue for dhcpcd-7

This commit is contained in:
roy 2017-03-31 21:02:08 +00:00
parent e07358adc1
commit 933b609212
7 changed files with 102 additions and 44 deletions

View File

@ -1,5 +1,5 @@
# $NetBSD: Makefile,v 1.1 2008/07/27 19:31:03 joerg Exp $
# $NetBSD: Makefile,v 1.2 2017/03/31 21:02:08 roy Exp $
SUBDIR= sbin
SUBDIR= sbin libexec
.include <bsd.subdir.mk>

15
external/bsd/dhcpcd/Makefile.inc vendored Normal file
View File

@ -0,0 +1,15 @@
# $NetBSD: Makefile.inc,v 1.1 2017/03/31 21:02:08 roy Exp $
SRCDIR= ${NETBSDSRCDIR}/external/bsd/dhcpcd
DIST= ${SRCDIR}/dist
SED_SYS= -e 's:@SYSCONFDIR@:/etc:g' \
-e 's:@DBDIR@:/var/db:g' \
-e 's:@LIBDIR@:/lib:g' \
-e 's:@RUNDIR@:/var/run:g' \
-e 's:@HOOKDIR@:/libexec/dhcpcd-hooks:g' \
-e 's:@SCRIPT@:/libexec/dhcpcd-run-hooks:g' \
-e 's:@SERVICEEXISTS@::g' \
-e 's:@SERVICECMD@::g' \
-e 's:@SERVICESTATUS@::g' \
-e 's:@STATUSARG@::g'

19
external/bsd/dhcpcd/include/config.h vendored Normal file
View File

@ -0,0 +1,19 @@
/* netbsd */
#define SYSCONFDIR "/etc"
#define SBINDIR "/sbin"
#define LIBDIR "/lib"
#define LIBEXECDIR "/libexec"
#define DBDIR "/var/db/dhcpcd"
#define RUNDIR "/var/run"
#define HAVE_IFAM_PID
#define HAVE_IFAM_ADDRFLAGS
#define HAVE_IFADDRS_ADDRFLAGS
#define HAVE_UTIL_H
#define HAVE_SYS_QUEUE_H
#define HAVE_SPAWN_H
#define HAVE_REALLOCARRAY
#define HAVE_KQUEUE
#define HAVE_KQUEUE1
#define HAVE_SYS_BITOPS_H
#define HAVE_MD5_H
#define SHA2_H <sha2.h>

6
external/bsd/dhcpcd/libexec/Makefile vendored Normal file
View File

@ -0,0 +1,6 @@
# $NetBSD: Makefile,v 1.1 2017/03/31 21:02:09 roy Exp $
SUBDIR= dhcpcd-hooks
SUBDIR= dhcpcd-run-hooks
.include <bsd.subdir.mk>

View File

@ -0,0 +1,27 @@
# $NetBSD: Makefile,v 1.1 2017/03/31 21:02:09 roy Exp $
#
.include <bsd.own.mk>
.include "../../Makefile.inc"
HOOKSRC= ${DIST}/hooks
.PATH: ${HOOKSRC}
HOOKS= 01-test 02-dump 20-resolv.conf 30-hostname
HOOKS+= 50-ntp.conf
FILES= ${HOOKS:C,^,${HOOKSRC}/,}
FILESDIR= /libexec/dhcpcd-hooks
EGHOOKS= 10-wpa_supplicant 15-timezone 29-lookup-hostname
EGHOOKS+= 50-ypbind
.if ${MKSHARE} != "no"
EGFILES= ${EGHOOKS:C,^,${HOOKSRC}/,}
FILES+= ${EGFILES}
.for f in ${EGFILES}
FILESDIR_${f}= /usr/share/examples/dhcpcd/hooks
.endfor
.endif
.include <bsd.prog.mk>

View File

@ -0,0 +1,22 @@
# $NetBSD: Makefile,v 1.1 2017/03/31 21:02:09 roy Exp $
#
.include <bsd.own.mk>
.include "../../Makefile.inc"
HOOKSRC= ${DIST}/hooks
.PATH: ${HOOKSRC}
SCRIPTS= dhcpcd-run-hooks
SCRIPTSDIR= /libexec
MAN= dhcpcd-run-hooks.8
CLEANFILES= dhcpcd-run-hooks dhcpcd-run-hooks.8
.for f in ${SCRIPTS} ${MAN}
${f}: ../../Makefile.inc ${f}.in
${TOOL_SED} ${SED_SYS} ${HOOKSRC}/${f}.in > $@
.endfor
.include <bsd.prog.mk>

View File

@ -1,14 +1,15 @@
# $NetBSD: Makefile,v 1.34 2016/12/02 02:41:54 riastradh Exp $
# $NetBSD: Makefile,v 1.35 2017/03/31 21:02:09 roy Exp $
#
WARNS?= 6
USE_FORT?= yes # network client (local server)
.include <bsd.init.mk>
.include "../../Makefile.inc"
PROG= dhcpcd
SRCS= common.c control.c dhcpcd.c duid.c eloop.c
SRCS+= if.c if-options.c script.c
SRCS+= if.c if-options.c route.c sa.c script.c
SRCS+= dhcp-common.c dhcpcd-embedded.c
SRCS+= if-bsd.c
@ -26,8 +27,8 @@ SRCS+= auth.c hmac_md5.c
.endif
.if (${USE_INET} != "no")
CPPFLAGS+= -DINET
SRCS+= arp.c dhcp.c ipv4.c
CPPFLAGS+= -DARP -DINET
SRCS+= arp.c bpf.c dhcp.c ipv4.c
.if !defined(SMALLPROG)
CPPFLAGS+= -DIPV4LL
SRCS+= ipv4ll.c
@ -43,42 +44,19 @@ CPPFLAGS+= -DDHCP6
SRCS+= dhcp6.c
.endif
DIST= ${NETBSDSRCDIR}/external/bsd/dhcpcd/dist
CPPFLAGS+= -I${DIST} -I${.OBJDIR}
CPPFLAGS+= -I${SRCDIR}/include -I${DIST}/src -I${.OBJDIR}
DPADD+= ${LIBUTIL}
LDADD+= -lutil
.PATH: ${DIST} ${DIST}/crypt ${LIBC_NET}
SCRIPTS= dhcpcd-run-hooks
SCRIPTSDIR_dhcpcd-run-hooks= /libexec
.PATH: ${DIST}/src ${DIST}/src/crypt ${LIBC_NET}
CONFIGFILES= dhcpcd.conf
FILESDIR_dhcpcd.conf= /etc
FILESMODE_dhcpcd.conf= 644 # -rw-r--r--
HOOKS= 01-test 02-dump 20-resolv.conf 30-hostname
HOOKS+= 50-ntp.conf
FILES= ${HOOKS:C,^,${DIST}/dhcpcd-hooks/,}
FILESDIR= /libexec/dhcpcd-hooks
EGHOOKS= 10-wpa_supplicant 15-timezone 29-lookup-hostname
EGHOOKS+= 50-ypbind
.if ${MKSHARE} != "no"
EGFILES= ${EGHOOKS:C,^,${DIST}/dhcpcd-hooks/,}
FILES+= ${EGFILES}
.for f in ${EGFILES}
FILESDIR_${f}= /usr/share/examples/dhcpcd/hooks
.endfor
.endif
MAN= dhcpcd.conf.5 dhcpcd.8 dhcpcd-run-hooks.8
CLEANFILES= dhcpcd.conf.5 dhcpcd.8 \
dhcpcd-run-hooks dhcpcd-run-hooks.8
MAN= dhcpcd.conf.5 dhcpcd.8
CLEANFILES= dhcpcd.conf.5 dhcpcd.8
dhcpcd-embedded.h: genembedh ${DHCPCD_DEFS} dhcpcd-embedded.h.in
${HOST_SH} ${.ALLSRC} $^ > $@
@ -90,18 +68,9 @@ if-options.c: dhcpcd-embedded.h
CLEANFILES+= dhcpcd-embedded.c dhcpcd-embedded.h
.for f in dhcpcd-run-hooks dhcpcd.conf.5 dhcpcd.8 dhcpcd-run-hooks.8
.for f in dhcpcd.conf.5 dhcpcd.8
${f}: ${f}.in
${TOOL_SED} -e 's:@SYSCONFDIR@:/etc:g' -e 's:@DBDIR@:/var/db:g' \
-e 's:@LIBDIR@:/lib:g' \
-e 's:@RUNDIR@:/var/run:g' \
-e 's:@HOOKDIR@:/libexec/dhcpcd-hooks:g' \
-e 's:@SCRIPT@:/libexec/dhcpcd-run-hooks:g' \
-e 's:@SERVICEEXISTS@::g' \
-e 's:@SERVICECMD@::g' \
-e 's:@SERVICESTATUS@::g' \
-e 's:@STATUSARG@::g' \
${DIST}/${f}.in > $@
${TOOL_SED} ${SED_SYS} ${DIST}/src/${f}.in > $@
.endfor
# XXXGCC5