-# $OpenBSD: Makefile,v 1.10 1997/02/06 02:56:44 downsj Exp $
+# $OpenBSD: Makefile,v 1.11 1997/02/06 06:46:57 mickey Exp $
# $NetBSD: Makefile,v 1.13 1996/10/02 16:19:51 ws Exp $
LIB= sa
# stand routines
SRCS+= alloc.c memcpy.c exit.c exec.c getfile.c gets.c globals.c \
- printf.c strerror.c strcmp.c memset.c memcmp.c strncpy.c
+ printf.c strerror.c strcmp.c memset.c memcmp.c strncpy.c strncmp.c
+
+# math from libkern
+SRCS+= divdi3.c qdivrem.c
+.PATH: ${DIR}/../../lib/libkern
# io routines
SRCS+= close.c closeall.c dev.c disklabel.c dkcksum.c ioctl.c \
lseek.c open.c nullfs.c read.c stat.c fstat.c write.c
+
+# boot filesystems
+SRCS+= ufs.c cd9660.c fat.c
+
.if defined(SA_ZLIB)
SRCS+= cread.c
+SRCS+= zlib.c
+.PATH: ${DIR}/../../net
+CFLAGS+=-DNO_DEFALTE
.endif
.if !defined(NO_NET)
+SRCS+= nfs.c
+
# network routines
SRCS+= arp.c ether.c in_cksum.c net.c netif.c rpc.c
-.endif
# network info services:
SRCS+= bootp.c rarp.c bootparam.c
-# boot filesystems
-SRCS+= ufs.c nfs.c cd9660.c
+.else
+# C flags
+CFLAGS+=-DNO_NET
+.endif
+
+.if ${MACHINE_ARCH}=="i386"
+CFLAGS+=-I${DIR}/../../arch/${MACHINE_ARCH}/stand/libsa
+.PATH: ${DIR}/../../arch/${MACHINE_ARCH}/stand/libsa
+.include "${DIR}/../../arch/${MACHINE_ARCH}/stand/libsa/Makefile.inc"
+.endif
NOPROFILE=
NOPIC=
--- /dev/null
+/* $OpenBSD: strncmp.c,v 1.1 1997/02/06 06:47:00 mickey Exp $ */
+
+/*-
+ * Copyright (c) 1996 Michael Shalayeff
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by Michael Shalayeff.
+ * 4. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+#include <sys/types.h>
+#include "stand.h"
+
+int
+strncmp(s1, s2, len)
+ register const char *s1;
+ register const char *s2;
+ register size_t len;
+{
+ if (len-- == 0)
+ return 0;
+
+ while(*s1 && *s2 && len-- && *s1 == *s2)
+ s1++, s2++;
+ return *s1 - *s2;
+}