fix makefiles. cleanup, addopt for boot.
authormickey <mickey@openbsd.org>
Fri, 20 Sep 1996 14:20:23 +0000 (14:20 +0000)
committermickey <mickey@openbsd.org>
Fri, 20 Sep 1996 14:20:23 +0000 (14:20 +0000)
sys/lib/libsa/Makefile
sys/lib/libsa/Makefile.inc
sys/lib/libsa/close.c
sys/lib/libsa/globals.c
sys/lib/libsa/net.c
sys/lib/libsa/printf.c
sys/lib/libsa/saerrno.h

index ceb9717..cd24121 100644 (file)
@@ -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 \
index edcb768..6dac3c4 100644 (file)
@@ -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})
index 388309b..109963d 100644 (file)
@@ -65,6 +65,7 @@
  */
 
 #include "stand.h"
+#include "saerrno.h"
 
 int
 close(fd)
index 0f022a8..abc143a 100644 (file)
@@ -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>
 
index 9aa1a73..430b077 100644 (file)
@@ -45,6 +45,7 @@
 #include <string.h>
 
 #include <net/if.h>
+#include <netinet/in.h>
 
 #include <netinet/in.h>
 #include <netinet/if_ether.h>
index 3f03864..9138f87 100644 (file)
@@ -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__
index a93ac84..0ed6e40 100644 (file)
@@ -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 */