summaryrefslogtreecommitdiff
path: root/sys/lib
diff options
context:
space:
mode:
authorMichael Shalayeff <mickey@cvs.openbsd.org>1996-09-20 14:20:27 +0000
committerMichael Shalayeff <mickey@cvs.openbsd.org>1996-09-20 14:20:27 +0000
commit73c0da69e8dcb3c7bd698866143aa6a44cfe694c (patch)
tree8864bbdc9b6969bb8abc9ef7c877ca02c616e861 /sys/lib
parentb430a02621f28162b5c32659630e48131c163acc (diff)
fix makefiles. cleanup, addopt for boot.
Diffstat (limited to 'sys/lib')
-rw-r--r--sys/lib/libsa/Makefile4
-rw-r--r--sys/lib/libsa/Makefile.inc32
-rw-r--r--sys/lib/libsa/close.c1
-rw-r--r--sys/lib/libsa/globals.c2
-rw-r--r--sys/lib/libsa/net.c1
-rw-r--r--sys/lib/libsa/printf.c4
-rw-r--r--sys/lib/libsa/saerrno.h2
7 files changed, 28 insertions, 18 deletions
diff --git a/sys/lib/libsa/Makefile b/sys/lib/libsa/Makefile
index ceb9717d667..cd2412190d2 100644
--- a/sys/lib/libsa/Makefile
+++ b/sys/lib/libsa/Makefile
@@ -8,7 +8,9 @@ DIR=${SAREL}${SADIR}
#DEBUGFLAGS= -DNETIF_DEBUG -DETHER_DEBUG -DNFS_DEBUG -DRPC_DEBUG -DRARP_DEBUG -DDEBUG -DPARANOID -Wall
#DEBUGFLAGS= -ansi -pedantic -Wall
-CFLAGS+=-DSTANDALONE -DCOMPAT_UFS $(DEBUGFLAGS) -I${DIR} -I${DIR}/../..
+AFLAGS+=${XAFLAGS}
+CFLAGS+=${XCFLAGS} -D_STANDALONE -DCOMPAT_UFS $(DEBUGFLAGS) -I${DIR} -I${DIR}/../..
+CPPFLAGS+=${XCPPFLAGS}
# stand routines
SRCS+= alloc.c bcopy.c memcpy.c exit.c exec.c getfile.c gets.c globals.c \
diff --git a/sys/lib/libsa/Makefile.inc b/sys/lib/libsa/Makefile.inc
index edcb76854c6..6dac3c430f9 100644
--- a/sys/lib/libsa/Makefile.inc
+++ b/sys/lib/libsa/Makefile.inc
@@ -7,30 +7,30 @@ SADST= lib/sa
SAREL?= ../../
SALIB?= ${SADST}/libsa.a
+SAMAKE= \
+ cd ${SADST} && ${MAKE} -f ${SAREL}${SADIR}/Makefile \
+ CC="${CC}" XCFLAGS="${CFLAGS}" \
+ AS='${AS}' XAFLAGS='${AFLAGS}' \
+ LD='${LD}' \
+ XCPPFLAGS="${CPPFLAGS}" \
+ SAREL="${SAREL}" \
+ SADIR="${SADIR}"
+
${SALIB}: .NOTMAIN __always_make_salib
@echo making sure the stand-alone library is up to date...
.if !defined(NO_NET)
- @(cd ${SADST} && ${MAKE} -f ${SAREL}${SADIR}/Makefile \
- KERNCC="${CC}" \
- KERNCFLAGS="${CFLAGS}" \
- SAREL="${SAREL}" \
- SADIR="${SADIR}" libsa.a)
+ @${SAMAKE} libsa.a
.else
- @(cd ${SADST} && ${MAKE} -f ${SAREL}${SADIR}/Makefile \
- KERNCC="${CC}" \
- KERNCFLAGS="${CFLAGS}" \
- SAREL="${SAREL}" \
- SADIR="${SADIR}" \
- NO_NET="" libsa.a)
+ @${SAMAKE} NO_NET="" libsa.a
.endif
clean:: .NOTMAIN __always_make_salib
@echo cleaning the stand-alone library objects
- @(cd ${SADST} && ${MAKE} -f ${SAREL}${SADIR}/Makefile \
- KERNCC="${CC}" \
- KERNCFLAGS="${CFLAGS}" \
- SAREL="${SAREL}" \
- SADIR="${SADIR}" clean)
+ @${SAMAKE} clean
+
+depend:: .NOTMAIN __always_make_salib
+ @echo depending the standalone library objects
+ @${SAMAKE} depend
__always_make_salib: .NOTMAIN
@([ -d ${SADST} ] || mkdir -p ${SADST})
diff --git a/sys/lib/libsa/close.c b/sys/lib/libsa/close.c
index 388309b47a7..109963dcc3e 100644
--- a/sys/lib/libsa/close.c
+++ b/sys/lib/libsa/close.c
@@ -65,6 +65,7 @@
*/
#include "stand.h"
+#include "saerrno.h"
int
close(fd)
diff --git a/sys/lib/libsa/globals.c b/sys/lib/libsa/globals.c
index 0f022a89e10..abc143a2e66 100644
--- a/sys/lib/libsa/globals.c
+++ b/sys/lib/libsa/globals.c
@@ -8,6 +8,8 @@
*/
#include <sys/param.h>
+#include <sys/socket.h>
+#include <net/if.h>
#include <netinet/in.h>
#include <netinet/in_systm.h>
diff --git a/sys/lib/libsa/net.c b/sys/lib/libsa/net.c
index 9aa1a739177..430b077fdad 100644
--- a/sys/lib/libsa/net.c
+++ b/sys/lib/libsa/net.c
@@ -45,6 +45,7 @@
#include <string.h>
#include <net/if.h>
+#include <netinet/in.h>
#include <netinet/in.h>
#include <netinet/if_ether.h>
diff --git a/sys/lib/libsa/printf.c b/sys/lib/libsa/printf.c
index 3f038648131..9138f8707ff 100644
--- a/sys/lib/libsa/printf.c
+++ b/sys/lib/libsa/printf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: printf.c,v 1.2 1996/02/29 13:29:23 niklas Exp $ */
+/* $OpenBSD: printf.c,v 1.3 1996/09/20 14:20:25 mickey Exp $ */
/* $NetBSD: printf.c,v 1.7 1996/02/08 20:19:36 gwr Exp $ */
/*-
@@ -73,6 +73,7 @@ static void kprintn __P((void (*)(int), u_long, int));
static void sputchar __P((int));
static void kprintf __P((void (*)(int), const char *, va_list));
+#ifndef NO_SPRINTF
static char *sbuf;
static void
@@ -102,6 +103,7 @@ sprintf(buf, fmt, va_alist)
va_end(ap);
*sbuf = '\0';
}
+#endif /* NO_SPRINTF */
void
#ifdef __STDC__
diff --git a/sys/lib/libsa/saerrno.h b/sys/lib/libsa/saerrno.h
index a93ac84eb8f..0ed6e4076a6 100644
--- a/sys/lib/libsa/saerrno.h
+++ b/sys/lib/libsa/saerrno.h
@@ -37,6 +37,8 @@
#include <sys/errno.h>
+extern int errno;
+
/* special stand error codes */
#define EADAPT (ELAST+1) /* bad adaptor */
#define ECTLR (ELAST+2) /* bad controller */