summaryrefslogtreecommitdiff
path: root/sys/lib
diff options
context:
space:
mode:
authorperry <perry@NetBSD.org>1998-07-31 23:44:41 +0000
committerperry <perry@NetBSD.org>1998-07-31 23:44:41 +0000
commit2b8a659f6823f7c1910f7bf541ceff98e8f65349 (patch)
tree1590fd622dc1b29991c59e034f44214289a7773e /sys/lib
parent730baa7431c0126017a416a10a39ed193e5882d6 (diff)
make libkern build memmove() properly
Diffstat (limited to 'sys/lib')
-rw-r--r--sys/lib/libkern/Makefile29
-rw-r--r--sys/lib/libkern/libkern.h3
2 files changed, 30 insertions, 2 deletions
diff --git a/sys/lib/libkern/Makefile b/sys/lib/libkern/Makefile
index b9d7b55a961..9e301228eb5 100644
--- a/sys/lib/libkern/Makefile
+++ b/sys/lib/libkern/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.43 1998/07/19 18:35:16 drochner Exp $
+# $NetBSD: Makefile,v 1.44 1998/07/31 23:44:41 perry Exp $
LIB= kern
NOPIC=
@@ -60,6 +60,33 @@ memcpy.ln: bcopy.c
${.ALLSRC}
.endif
+# if no machine specific memcpy(3), build one out of bcopy(3).
+.if empty(SRCS:Mmemmove.S)
+OBJS+= memmove.o
+memmove.o: bcopy.c
+ @echo ${COMPILE.c:Q} -DMEMMOVE ${.ALLSRC} -o ${.TARGET}
+ @${COMPILE.c} -DMEMMOVE ${.ALLSRC} -o ${.TARGET}.o
+ @${LD} -x -r ${.TARGET}.o -o ${.TARGET}
+ @rm -f ${.TARGET}.o
+
+memmove.po: bcopy.c
+ @echo ${COMPILE.c:Q} -DMEMMOVE -pg ${.ALLSRC} -o ${.TARGET}
+ @${COMPILE.c} -DMEMMOVE -pg ${.ALLSRC} -o ${.TARGET}.o
+ @${LD} -X -r ${.TARGET}.o -o ${.TARGET}
+ @rm -f ${.TARGET}.o
+
+memmove.so: bcopy.c
+ @echo ${COMPILE.c:Q} -DMEMMOVE ${CPICFLAGS} ${.ALLSRC} -o ${.TARGET}
+ @${COMPILE.c} -DMEMMOVE ${CPICFLAGS} ${.ALLSRC} -o ${.TARGET}.o
+ @${LD} -x -r ${.TARGET}.o -o ${.TARGET}
+ @rm -f ${.TARGET}.o
+
+LOBJS+= memmove.ln
+memmove.ln: bcopy.c
+ ${LINT} -DMEMMOVE ${LINTFLAGS} ${CPPFLAGS:M-[IDU]*} -i -o ${.TARGET} \
+ ${.ALLSRC}
+.endif
+
# if no machine specific strchr(3), build one out of index(3).
.if empty(SRCS:Mstrchr.S)
OBJS+= strchr.o
diff --git a/sys/lib/libkern/libkern.h b/sys/lib/libkern/libkern.h
index 620b4e1cb61..44a6f468ac4 100644
--- a/sys/lib/libkern/libkern.h
+++ b/sys/lib/libkern/libkern.h
@@ -1,4 +1,4 @@
-/* $NetBSD: libkern.h,v 1.22 1998/06/21 18:43:35 christos Exp $ */
+/* $NetBSD: libkern.h,v 1.23 1998/07/31 23:44:41 perry Exp $ */
/*-
* Copyright (c) 1992, 1993
@@ -156,6 +156,7 @@ void bzero __P((void *, size_t));
int ffs __P((int));
void *memchr __P((const void *, int, size_t));
void *memcpy __P((void *, const void *, size_t));
+void *memmove __P((void *, const void *, size_t));
void *memset __P((void *, int, size_t));
int pmatch __P((const char *, const char *, const char **));
u_long random __P((void));