Module Name:    src
Committed By:   christos
Date:           Thu Mar 28 15:04:42 UTC 2019

Modified Files:
        src/distrib/utils/libhack: Makefile Makefile.inc

Log Message:
Dedup and add the small jemalloc implementation so our install media has
a chance to fit again.


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/distrib/utils/libhack/Makefile
cvs rdiff -u -r1.27 -r1.28 src/distrib/utils/libhack/Makefile.inc

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/distrib/utils/libhack/Makefile
diff -u src/distrib/utils/libhack/Makefile:1.25 src/distrib/utils/libhack/Makefile:1.26
--- src/distrib/utils/libhack/Makefile:1.25	Sat Jun 17 23:56:39 2017
+++ src/distrib/utils/libhack/Makefile	Thu Mar 28 11:04:41 2019
@@ -1,32 +1,23 @@
-# $NetBSD: Makefile,v 1.25 2017/06/18 03:56:39 manu Exp $
+# $NetBSD: Makefile,v 1.26 2019/03/28 15:04:41 christos Exp $
 #
 # Stubs to kill off some things from libc:
 # This save space on a boot system.
 # (See Makefile.inc also.)
 
-.PATH.c: ${.CURDIR}/../../../lib/libc/gen ${.CURDIR}/../../../lib/libc/locale
-
-HACKSRC?=${.CURDIR}
-HACKOBJ?=${.OBJDIR}
-
-CPPFLAGS+=	-DSMALL
-CPPFLAGS+=	-DLIBHACK
-CPPFLAGS.runetable.c+=	-I${HACKSRC}/../../../lib/libc/citrus \
-			-DALL_80_TO_FF_SW1
-CPPFLAGS.syslog.c+=	-I${HACKSRC}/../../../lib/libc/include
-CPPFLAGS.gethost.c+=	-I${HACKSRC}/../../../lib/libc/net
-
-LIB=		hack
-SRCS=		getcap.c getgrent.c getnet.c getnetgr.c getpwent.c \
-		localeconv.c multibyte.c perror.c runetable.c setlocale.c \
-		strerror.c strsignal.c syslog.c utmp.c yplib.c gethost.c
-
+LIB=	hack
 WARNS=		1
 NOLINKLIB=	# defined
 NOLINT= 	# defined
 NOPIC=		# defined
 NOPROFILE=	# defined
 
+HACKSRC?=${.CURDIR}
+HACKOBJ?=${.OBJDIR}
+
+.include "Makefile.inc"
+
+OBJS=		${HACKOBJS}
+
 realall: libhack.o
 
 libhack.o: libhack.a

Index: src/distrib/utils/libhack/Makefile.inc
diff -u src/distrib/utils/libhack/Makefile.inc:1.27 src/distrib/utils/libhack/Makefile.inc:1.28
--- src/distrib/utils/libhack/Makefile.inc:1.27	Sat Jun 17 23:56:39 2017
+++ src/distrib/utils/libhack/Makefile.inc	Thu Mar 28 11:04:41 2019
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.inc,v 1.27 2017/06/18 03:56:39 manu Exp $
+# $NetBSD: Makefile.inc,v 1.28 2019/03/28 15:04:41 christos Exp $
 #
 # Include this fragment to build libhack.o
 # It is .o and not .a to make sure these are the
@@ -18,7 +18,7 @@
 
 CPPFLAGS+=	-DSMALL
 CPPFLAGS+=	-DLIBHACK
-HACKOBJS+=	getcap.o getgrent.o getnet.o getnetgr.o getpwent.o \
+HACKOBJS+=	getcap.o getgrent.o getnet.o getnetgr.o getpwent.o jemalloc.o \
 		localeconv.o multibyte.o perror.o runetable.o setlocale.o \
 		strerror.o strsignal.o syslog.o utmp.o yplib.o
 
@@ -26,14 +26,20 @@ CPPFLAGS.runetable.c+= -I${HACKSRC}/../.
 			-DALL_80_TO_FF_SW1
 
 CPPFLAGS.syslog.c+= -I${HACKSRC}/../../../lib/libc/include
+CPPFLAGS.jemalloc.c+= -I${HACKSRC}/../../../lib/libc/include
 CPPFLAGS.gethost.c+= -I${HACKSRC}/../../../lib/libc/net
 
+.if !defined(LIB)
 libhack.o: ${HACKOBJS}
 	${LD} -r -o $@ ${.ALLSRC}
-
+.endif
 
 .if 1
-.PATH.c: ${HACKSRC} ${HACKSRC}/../../../lib/libc/gen ${HACKSRC}/../../../lib/libc/locale
+.PATH.c: \
+	${HACKSRC} \
+	${HACKSRC}/../../../lib/libc/gen \
+	${HACKSRC}/../../../lib/libc/locale \
+	${HACKSRC}/../../../lib/libc/stdlib
 .else
 # XXX .PATH won't work here, because of crunchgen used by various builds
 getcap.o:	${HACKSRC}/../../../lib/libc/gen/getcap.c
@@ -45,6 +51,7 @@ getpwent.o:	${HACKSRC}/getpwent.c
 localeconv.o:	${HACKSRC}/localeconv.c
 multibyte.o:	${HACKSRC}/multibyte.c
 perror.o:	${HACKSRC}/perror.c
+jemalloc.o:	${HACKSRC}/../../../lib/libc/stdlib/jemalloc.c
 runetable.o:	${HACKSRC}/../../../lib/libc/locale/runetable.c
 setlocale.o:	${HACKSRC}/setlocale.c
 strerror.o:	${HACKSRC}/strerror.c

Reply via email to