$(MAKE) -C test clean
cleandepend:
+ $(MAKE) -C lib cleandepend_all
$(MAKE) -C boot cleandepend
$(MAKE) -C commands cleandepend
$(MAKE) -C bin cleandepend
PROG= acd
CPPFLAGS+= -DARCH=\"`arch`\" -DDESCR=\"/usr/lib/descr\"
LINKS+= ${BINDIR}/acd ${BINDIR}/cc
-FILESDIR= /usr/lib
-FILES= acd.descr
-FILESNAME= descr
MAN=
.include <bsd.prog.mk>
.PATH: ${MINIXSRCDIR}/common/include/arch/i386
INCS+= archtypes.h bios.h cmos.h cpu.h diskparm.h fpu.h int86.h \
- interrupt.h memory.h partition.h \
+ interrupt.h memory.h multiboot.h partition.h \
pci.h pci_amd.h pci_intel.h pci_sis.h pci_via.h \
ports.h stackframe.h vm.h elf.h
+20110701:
+ # rm -rf /usr/include /usr/netbsd
+ # make etcfiles includes cleandepend depend gnu-includes
+
+ DOWNGRADING:
+ Important: this automatically updates your /usr/lib/descr,
+ something you will have to revert manually if you
+ want to go back a revision! Previous to this
+ revision, you do this by:
+ # cp commands/acd/acd.descr /usr/lib/descr
+ Repeating the above commands to make sure your /usr/include
+ is re-acked is probably a good idea too for going back revisions.
+
+ This change moves
+ 1. /usr/include to /usr/include.ack
+ 2. /usr/netbsd/include to /usr/include
+
+ Reduce compiler cases to only two:
+ 1. ack, a.out, minix headers (moved to /usr/include.ack),
+ minix libc
+ 2. gcc/clang, elf, netbsd headers (moved to /usr/include),
+ netbsd libc (moved to /usr/lib)
+
+ So this obsoletes the /usr/netbsd hierarchy.
+
+ There are no specific UPDATING instructions, but you should know
+ that starting with this version, gcc/clang use the netbsd libc and
+ headers system exclusively, and those files are in the standard
+ locations now. It's the first step to switching completely and
+ simplifying building.
+
20110629:
Rebuild m4:
make -C usr.bin/m4 install
clean::
install::
- @echo "Installing /etc and /usr/etc.."
- mkdir -p $(ETC)
+ @echo "Installing /etc, /usr/etc and /usr/lib.."
+ mkdir -p $(ETC) $(USRLIB)
@for f in $(FILES1); do if [ -f $(ETC)/$$f ]; then :; else cp $$f $(ETC)/$$f; chmod 755 $(ETC)/$$f; fi; done
@for f in $(FILES2); do if [ -f $(ETC)/$$f ]; then :; else cp $$f $(ETC)/$$f; chmod 600 $(ETC)/$$f; fi; done
@for f in $(USRFILES); do cp usr/$$f $(USR)/$$f; chmod 644 $(USR)/$$f; done
for u in /usr/ast ~root; do cp ast/.[aepv]* $$u ; done
@echo "Installing fonts.."
install -m 644 -o root -g operator fonts/*.fnt /usr/lib/fonts/
+ @echo "Installing /usr/lib/descr.."
+ install -m 644 -o root -g operator descr /usr/lib/
installforce:: $(ETC)/rc $(ETC)/rs.inet $(ETC)/rs.single $(ETC)/system.conf $(USRETC)/rc $(USR)/Makefile
import ARCH
# Compiler passes.
-ACK_CPP = $A/cpp.ansi $CPP_F $PREDEF $NOLINENO
-ACK_CEM = $A/em_cemcom.ansi -L $CPP_F $PREDEF \
+ACK_CPP = $A/cpp.ansi $CPP_F $PREDEF $NOLINENO -I/usr/include.ack
+ACK_CEM = $A/em_cemcom.ansi -L $CPP_F $PREDEF \
-Vw${W}.${W}i${W}.${W}p${P}.${W}f4.${W}s2.2l4.${W}d8.${W}
ACK_M2 = $A/em_m2 -I$MOD_INCL -WR \
-Vw${W}.${W}i${W}.${W}p${P}.${W}l4.${W}f4.${W}d8.${W}
# Compile C source to EM-code.
transform .c .k
transform .i .k
- $ACK_CEM $* $>
+ $ACK_CEM -I/usr/include.ack $* $>
ifndef RTSO
RTSO = -.c
LIBS = $LIBS + -.c
755 root operator /usr/pkg/etc
755 root operator /usr/pkg/etc/rc.d
755 root operator /home
-755 root operator /usr/include
-755 root operator /usr/include/i386
-755 root operator /usr/include/arpa
-755 root operator /usr/include/minix
-755 root operator /usr/include/net
-755 root operator /usr/include/net/gen
-755 root operator /usr/include/netinet
-755 root operator /usr/include/sys
-755 root operator /usr/include/ddekit
-755 root operator /usr/include/ddekit/minix
+755 root operator /usr/include.ack
+755 root operator /usr/include.ack/i386
+755 root operator /usr/include.ack/arpa
+755 root operator /usr/include.ack/minix
+755 root operator /usr/include.ack/net
+755 root operator /usr/include.ack/net/gen
+755 root operator /usr/include.ack/netinet
+755 root operator /usr/include.ack/sys
+755 root operator /usr/include.ack/ddekit
+755 root operator /usr/include.ack/ddekit/minix
755 root operator /usr/lib
755 root operator /usr/lib/advent
755 root operator /usr/lib/cawf
755 root operator /usr/man/man8
755 root operator /usr/man/man9
755 root operator /usr/mdec
-755 root operator /usr/netbsd
-755 root operator /usr/netbsd/include
-755 root operator /usr/netbsd/include/i386
-755 root operator /usr/netbsd/include/arpa
-755 root operator /usr/netbsd/include/compat
-755 root operator /usr/netbsd/include/compat/machine
-755 root operator /usr/netbsd/include/ddekit
-755 root operator /usr/netbsd/include/ddekit/minix
-755 root operator /usr/netbsd/include/minix
-755 root operator /usr/netbsd/include/net
-755 root operator /usr/netbsd/include/net/gen
-755 root operator /usr/netbsd/include/protocols
-755 root operator /usr/netbsd/include/rpcsvc
-755 root operator /usr/netbsd/include/ssp
-755 root operator /usr/netbsd/include/sys
-755 root operator /usr/netbsd/lib
+755 root operator /usr/include
+755 root operator /usr/include/i386
+755 root operator /usr/include/arpa
+755 root operator /usr/include/compat
+755 root operator /usr/include/compat/machine
+755 root operator /usr/include/ddekit
+755 root operator /usr/include/ddekit/minix
+755 root operator /usr/include/minix
+755 root operator /usr/include/net
+755 root operator /usr/include/net/gen
+755 root operator /usr/include/protocols
+755 root operator /usr/include/rpcsvc
+755 root operator /usr/include/ssp
+755 root operator /usr/include/sys
700 root operator /usr/preserve
755 root operator /usr/run
755 root operator /usr/share
.include <bsd.own.mk>
-INCSDIR= /usr/include
+INCSDIR= /usr/include.ack
.include "${MINIXSRCDIR}/common/include/Makefile.inc"
.include "${MINIXSRCDIR}/common/include/Makefile.termios.inc"
SUBDIR= ${ARCH}
-INCSYMLINKS= ${MACHINE} /usr/include/machine
+INCSYMLINKS= ${MACHINE} /usr/include.ack/machine
.include <bsd.kinc.mk>
-INCSDIR= /usr/include/i386
+INCSDIR= /usr/include.ack/i386
INCS+= _align.h asm.h mcontext.h multiboot.h param.h
.include <bsd.sys.mk>
-INCSDIR= /usr/include/sys
+INCSDIR= /usr/include.ack/sys
INCS= asynchio.h dir.h file.h \
ioctl.h ipc.h jmp_buf.h kbdio.h mman.h \
sh ack_build.sh clean
sh elf_build.sh clean
+cleandepend_all:
+ sh ack_build.sh cleandepend
+ sh elf_build.sh cleandepend
export COMPILER_TYPE=gnu
export PATH=$PATH:/usr/pkg/bin
-export MAKEOBJDIR=obj-elfbase-nbsd
-make $@ NBSD_LIBC=yes
-export MAKEOBJDIR=obj-elfbase
-make $@ NBSD_LIBC=no
+export MAKEOBJDIR=obj-elfbase-nbsd NBSD_LIBC=yes
+make $@
.endif
CPPFLAGS+= -DHAVE_CONFIG_H
-.if (${NBSD_LIBC} != "no")
-INCSDIR= /usr/netbsd/include
-.else
+.if ${NBSD_LIBC} == "yes"
INCSDIR= /usr/include
+.else
+INCSDIR= /usr/include.ack
.endif
INCS= archive.h \
archive_entry.h
huffman.c randtable.c
CPPFLAGS+= -I ${BZ2DIR}
INCS= bzlib.h
+
.if (${NBSD_LIBC} != "no")
-INCSDIR= /usr/netbsd/include
+INCSDIR= /usr/include
.else
-INCSDIR= /usr/include
+INCSDIR= /usr/include.ack
.endif
.include <bsd.lib.mk>
# $Id$
-# Requires NBSD_LIBC and clang/gcc (we default to using clang)
-NBSD_LIBC:= yes
-CC:=${CC:C/^cc/clang/}
-COMPILER_TYPE:= gnu
-
LIB= elf
SRCS= elf.c \
libelf_fsize.c: elf_types.m4 libelf_fsize.m4
libelf_msize.c: elf_types.m4 libelf_msize.m4
-.if (${NBSD_LIBC} != "no")
-INCSDIR= /usr/netbsd/include
-.else
INCSDIR= /usr/include
-.endif
.include <bsd.lib.mk>
SRCS= exec_aout.c exec_elf.c
.if (${NBSD_LIBC} != "no")
-INCSDIR= /usr/netbsd/include
-.else
INCSDIR= /usr/include
+.else
+INCSDIR= /usr/include.ack
.endif
+
.include <bsd.lib.mk>
gzwrite.c infback.c inffast.c inflate.c inftrees.c trees.c uncompr.c zutil.c
.if (${NBSD_LIBC} != "no")
-INCSDIR= /usr/netbsd/include
-.else
INCSDIR= /usr/include
+.else
+INCSDIR= /usr/include.ack
.endif
INCS= zconf.h zlib.h
.PATH: ${MINIXSRCDIR}/lib/libc/asyn
LIB= asyn
INCS= asynchio.h
-INCSDIR= /usr/netbsd/include/sys
-
+INCSDIR= /usr/include/sys
SRCS+= asyn_cancel.c asyn_close.c asyn_init.c asyn_pending.c asyn_read.c \
asyn_special.c asyn_synch.c asyn_wait.c asyn_write.c
NETBSDSRCDIR= ${MINIXSRCDIR}
-NETBSDINCLUDES= /usr/netbsd/include/
+NETBSDINCLUDES= /usr/include/
MACHINE_ARCH?= i386
CITRUS=yes
+#ifdef _REENTRANT /* !__minix */
mutex_t __gdtoa_locks[2] = { MUTEX_INITIALIZER, MUTEX_INITIALIZER };
+#endif /* _REENTRANT */
+diff -ru nbsdsrc/src/lib/libc/gdtoa/gdtoaimp.h lib/nbsd_libc/gdtoa/gdtoaimp.h
+--- nbsdsrc/src/lib/libc/gdtoa/gdtoaimp.h
++++ lib/nbsd_libc/gdtoa/gdtoaimp.h
+@@ -1,4 +1,4 @@
+-/* $NetBSD: gdtoaimp.h,v 1.7 2009/05/07 20:31:44 christos Exp $ */
++/* $NetBSD: gdtoaimp.h,v 1.8 2011/01/21 23:36:49 christos Exp $ */
+
+ /****************************************************************
+
+@@ -276,7 +276,7 @@
+ Exactly one of IEEE_LITTLE_ENDIAN, IEEE_BIG_ENDIAN, VAX, or IBM should be defined.
+ #endif
+
+-typedef union { double d; ULong L[2]; } U;
++typedef union { double d; ULong L[2]; } __attribute__((__may_alias__)) U;
+
+ #ifdef YES_ALIAS
+ #define dval(x) x
diff -ru nbsdsrc/src/lib/libc/gen/Makefile.inc lib/nbsd_libc/gen/Makefile.inc
--- nbsdsrc/src/lib/libc/gen/Makefile.inc
+++ lib/nbsd_libc/gen/Makefile.inc
mutex_unlock(&_pwmutex);
switch (r) {
case NS_SUCCESS:
+diff -ru nbsdsrc/src/lib/libc/gen/glob.c lib/nbsd_libc/gen/glob.c
+--- nbsdsrc/src/lib/libc/gen/glob.c
++++ lib/nbsd_libc/gen/glob.c
+@@ -1,4 +1,4 @@
+-/* $NetBSD: glob.c,v 1.27 2010/09/06 14:40:25 christos Exp $ */
++/* $NetBSD: glob.c,v 1.28 2011/01/21 23:30:31 christos Exp $ */
+
+ /*
+ * Copyright (c) 1989, 1993
+@@ -37,7 +37,7 @@
+ #if 0
+ static char sccsid[] = "@(#)glob.c 8.3 (Berkeley) 10/13/93";
+ #else
+-__RCSID("$NetBSD: glob.c,v 1.27 2010/09/06 14:40:25 christos Exp $");
++__RCSID("$NetBSD: glob.c,v 1.28 2011/01/21 23:30:31 christos Exp $");
+ #endif
+ #endif /* LIBC_SCCS and not lint */
+
+@@ -87,13 +87,18 @@
+ #define NO_GETPW_R
+ #endif
+
+-#define GLOB_LIMIT_MALLOC 65536
+-#define GLOB_LIMIT_STAT 128
+-#define GLOB_LIMIT_READDIR 16384
++#define GLOB_LIMIT_STRING 65536 /* number of readdirs */
++#define GLOB_LIMIT_STAT 128 /* number of stat system calls */
++#define GLOB_LIMIT_READDIR 16384 /* total buffer size of path strings */
++#define GLOB_LIMIT_PATH 1024 /* number of path elements */
++#define GLOB_LIMIT_BRACE 128 /* Number of brace calls */
+
+-#define GLOB_INDEX_MALLOC 0
+-#define GLOB_INDEX_STAT 1
+-#define GLOB_INDEX_READDIR 2
++struct glob_limit {
++ size_t l_string;
++ size_t l_stat;
++ size_t l_readdir;
++ size_t l_brace;
++};
+
+ /*
+ * XXX: For NetBSD 1.4.x compatibility. (kill me l8r)
+@@ -158,17 +163,17 @@
+ static DIR *g_opendir(Char *, glob_t *);
+ static Char *g_strchr(const Char *, int);
+ static int g_stat(Char *, __gl_stat_t *, glob_t *);
+-static int glob0(const Char *, glob_t *, size_t *);
+-static int glob1(Char *, glob_t *, size_t *);
++static int glob0(const Char *, glob_t *, struct glob_limit *);
++static int glob1(Char *, glob_t *, struct glob_limit *);
+ static int glob2(Char *, Char *, Char *, const Char *, glob_t *,
+- size_t *);
++ struct glob_limit *);
+ static int glob3(Char *, Char *, Char *, const Char *, const Char *,
+- const Char *, glob_t *, size_t *);
+-static int globextend(const Char *, glob_t *, size_t *);
++ const Char *, glob_t *, struct glob_limit *);
++static int globextend(const Char *, glob_t *, struct glob_limit *);
+ static const Char *globtilde(const Char *, Char *, size_t, glob_t *);
+-static int globexp1(const Char *, glob_t *, size_t *);
++static int globexp1(const Char *, glob_t *, struct glob_limit *);
+ static int globexp2(const Char *, const Char *, glob_t *, int *,
+- size_t *);
++ struct glob_limit *);
+ static int match(const Char *, const Char *, const Char *);
+ #ifdef DEBUG
+ static void qprintf(const char *, Char *);
+@@ -181,8 +186,7 @@
+ const u_char *patnext;
+ int c;
+ Char *bufnext, *bufend, patbuf[MAXPATHLEN+1];
+- /* 0 = malloc(), 1 = stat(), 2 = readdir() */
+- size_t limit[] = { 0, 0, 0 };
++ struct glob_limit limit = { 0, 0, 0, 0 };
+
+ _DIAGASSERT(pattern != NULL);
+
+@@ -218,9 +222,9 @@
+ *bufnext = EOS;
+
+ if (flags & GLOB_BRACE)
+- return globexp1(patbuf, pglob, limit);
++ return globexp1(patbuf, pglob, &limit);
+ else
+- return glob0(patbuf, pglob, limit);
++ return glob0(patbuf, pglob, &limit);
+ }
+
+ /*
+@@ -229,7 +233,7 @@
+ * characters
+ */
+ static int
+-globexp1(const Char *pattern, glob_t *pglob, size_t *limit)
++globexp1(const Char *pattern, glob_t *pglob, struct glob_limit *limit)
+ {
+ const Char* ptr = pattern;
+ int rv;
+@@ -237,6 +241,12 @@
+ _DIAGASSERT(pattern != NULL);
+ _DIAGASSERT(pglob != NULL);
+
++ if ((pglob->gl_flags & GLOB_LIMIT) &&
++ limit->l_brace++ >= GLOB_LIMIT_BRACE) {
++ errno = 0;
++ return GLOB_NOSPACE;
++ }
++
+ /* Protect a single {}, for find(1), like csh */
+ if (pattern[0] == LBRACE && pattern[1] == RBRACE && pattern[2] == EOS)
+ return glob0(pattern, pglob, limit);
+@@ -256,7 +266,7 @@
+ */
+ static int
+ globexp2(const Char *ptr, const Char *pattern, glob_t *pglob, int *rv,
+- size_t *limit)
++ struct glob_limit *limit)
+ {
+ int i;
+ Char *lm, *ls;
+@@ -461,7 +471,7 @@
+ * to find no matches.
+ */
+ static int
+-glob0(const Char *pattern, glob_t *pglob, size_t *limit)
++glob0(const Char *pattern, glob_t *pglob, struct glob_limit *limit)
+ {
+ const Char *qpatnext;
+ int c, error;
+@@ -570,7 +580,7 @@
+ }
+
+ static int
+-glob1(Char *pattern, glob_t *pglob, size_t *limit)
++glob1(Char *pattern, glob_t *pglob, struct glob_limit *limit)
+ {
+ Char pathbuf[MAXPATHLEN+1];
+
+@@ -596,7 +606,7 @@
+ */
+ static int
+ glob2(Char *pathbuf, Char *pathend, Char *pathlim, const Char *pattern,
+- glob_t *pglob, size_t *limit)
++ glob_t *pglob, struct glob_limit *limit)
+ {
+ __gl_stat_t sb;
+ const Char *p;
+@@ -624,10 +634,11 @@
+ return 0;
+
+ if ((pglob->gl_flags & GLOB_LIMIT) &&
+- limit[GLOB_INDEX_STAT]++ >= GLOB_LIMIT_STAT) {
++ limit->l_stat++ >= GLOB_LIMIT_STAT) {
+ errno = 0;
+ *pathend++ = SEP;
+ *pathend = EOS;
++printf("stat limit\n");
+ return GLOB_NOSPACE;
+ }
+ if (((pglob->gl_flags & GLOB_MARK) &&
+@@ -692,7 +703,7 @@
+ static int
+ glob3(Char *pathbuf, Char *pathend, Char *pathlim, const Char *pattern,
+ const Char *restpattern, const Char *pglobstar, glob_t *pglob,
+- size_t *limit)
++ struct glob_limit *limit)
+ {
+ struct dirent *dp;
+ DIR *dirp;
+@@ -785,7 +796,7 @@
+ Char *dc;
+
+ if ((pglob->gl_flags & GLOB_LIMIT) &&
+- limit[GLOB_INDEX_READDIR]++ >= GLOB_LIMIT_READDIR) {
++ limit->l_readdir++ >= GLOB_LIMIT_READDIR) {
+ errno = 0;
+ *pathend++ = SEP;
+ *pathend = EOS;
+@@ -894,7 +905,7 @@
+ * gl_pathv points to (gl_offs + gl_pathc + 1) items.
+ */
+ static int
+-globextend(const Char *path, glob_t *pglob, size_t *limit)
++globextend(const Char *path, glob_t *pglob, struct glob_limit *limit)
+ {
+ char **pathv;
+ size_t i, newsize, len;
+@@ -905,6 +916,9 @@
+ _DIAGASSERT(pglob != NULL);
+
+ newsize = sizeof(*pathv) * (2 + pglob->gl_pathc + pglob->gl_offs);
++ if ((pglob->gl_flags & GLOB_LIMIT) &&
++ newsize > GLOB_LIMIT_PATH * sizeof(*pathv))
++ goto nospace;
+ pathv = pglob->gl_pathv ? realloc(pglob->gl_pathv, newsize) :
+ malloc(newsize);
+ if (pathv == NULL)
+@@ -921,7 +935,7 @@
+ for (p = path; *p++;)
+ continue;
+ len = (size_t)(p - path);
+- limit[GLOB_INDEX_MALLOC] += len;
++ limit->l_string += len;
+ if ((copy = malloc(len)) != NULL) {
+ if (g_Ctoc(path, copy, len)) {
+ free(copy);
+@@ -932,12 +946,13 @@
+ pathv[pglob->gl_offs + pglob->gl_pathc] = NULL;
+
+ if ((pglob->gl_flags & GLOB_LIMIT) &&
+- (newsize + limit[GLOB_INDEX_MALLOC]) >= GLOB_LIMIT_MALLOC) {
+- errno = 0;
+- return GLOB_NOSPACE;
+- }
++ (newsize + limit->l_string) >= GLOB_LIMIT_STRING)
++ goto nospace;
+
+ return copy == NULL ? GLOB_NOSPACE : 0;
++nospace:
++ errno = 0;
++ return GLOB_NOSPACE;
+ }
+
+
diff -ru nbsdsrc/src/lib/libc/gen/gr_private.h lib/nbsd_libc/gen/gr_private.h
--- nbsdsrc/src/lib/libc/gen/gr_private.h
+++ lib/nbsd_libc/gen/gr_private.h
.include <bsd.own.mk>
FILES=libc.pc
-FILESDIR=/usr/netbsd/lib
+FILESDIR=/usr/lib
FILESMODE=444
.include <bsd.prog.mk>
Name: c
Description: NetBSD C Library
Version: 1.0
-Libs: -nostdlib /usr/netbsd/lib/crt1.o /usr/netbsd/lib/crti.o /usr/netbsd/lib/crtn.o -L/usr/netbsd/lib -lc -L/usr/pkg/lib -lgcc -L/usr/netbsd/lib -lminlib -lcompat_minix
-Cflags: -nostdinc -D__NBSD_LIBC -isystem /usr/netbsd/include
+Libs: -lc -lminlib -lcompat_minix
.PATH: ${MINIXSRCDIR}/lib/nbsd_libcompat_minix/include
-INCSDIR= /usr/netbsd/include
+INCSDIR= /usr/include
INCS+= configfile.h termcap.h
INCS+= compat/a.out.h compat/regexp.h compat/syslog.h \
.include <bsd.own.mk>
FILES=compat_minix.pc
-FILESDIR=/usr/netbsd/lib
+FILESDIR=/usr/lib
FILESMODE=444
.include <bsd.prog.mk>
Name: compat_minix
Description: Minix Compatibility Library
Version: 1.0
-Libs: -L/usr/netbsd/lib -lcompat_minix
-Cflags: -I/usr/netbsd/include
+Libs: -lcompat_minix
.include <bsd.own.mk>
.PATH: ${.CURDIR} ${.CURDIR}/${MACHINE}
-INCSDIR= /usr/netbsd/include
+INCSDIR= /usr/include
LIB= minlib
CPPFLAGS.fslib.c+= -I${MINIXSRCDIR}/servers
.include <bsd.own.mk>
FILES=minlib.pc
-FILESDIR=/usr/netbsd/lib
+FILESDIR=/usr/lib
FILESMODE=444
.include <bsd.prog.mk>
Name: minlib
Description: Minix Compatibility Library
Version: 1.0
-Libs: -L/usr/netbsd/lib -lminlib
-Cflags: -I/usr/netbsd/include
+Libs: -lminlib
+Cflags:
.include <bsd.own.mk>
-.if defined(__MINIX)
-INCSDIR= /usr/netbsd/include
-.else
INCSDIR= /usr/include
-.endif
.if defined(__MINIX)
# RPC is not compiled in the libc. This include also needs
# x68k x86_64 xen \
# zaurus
-INCSYMLINKS= ${MACHINE} /usr/netbsd/include/machine
+INCSYMLINKS= ${MACHINE} /usr/include/machine
-INCSYMLINKS+= machine/float.h /usr/netbsd/include/float.h \
- machine/stdarg.h /usr/netbsd/include/stdarg.h
+INCSYMLINKS+= machine/float.h /usr/include/float.h \
+ machine/stdarg.h /usr/include/stdarg.h
.include <bsd.inc.mk>
# $NetBSD: Makefile,v 1.36 2007/12/20 23:46:12 ad Exp $
.include <bsd.own.mk>
-INCSDIR= /usr/netbsd/include/i386
+INCSDIR= /usr/include/i386
INCS= ansi.h asm.h bswap.h byte_swap.h cdefs.h \
endian.h endian_machdep.h fenv.h float.h ieee.h \
# $NetBSD: Makefile,v 1.13 2008/05/11 15:32:20 ad Exp $
-INCSDIR=/usr/netbsd/include/x86
+INCSDIR=/usr/include/x86
INCS= float.h \
ieee.h \
INCS+= arpa/ftp.h arpa/inet.h arpa/nameser.h arpa/nameser_compat.h \
arpa/telnet.h arpa/tftp.h
INCS+= protocols/dumprestore.h protocols/routed.h protocols/rwhod.h \
-@@ -40,10 +59,28 @@
- .include <bsd.own.mk>
+@@ -42,8 +61,22 @@
-
-+.if defined(__MINIX)
-+INCSDIR= /usr/netbsd/include
-+.else
INCSDIR= /usr/include
-+.endif
+.if defined(__MINIX)
+# RPC is not compiled in the libc. This include also needs
#ifndef _PWD_H_
#define _PWD_H_
-diff -ru nbsdsrc/src/include/rpc/Makefile nbsd_include/rpc/Makefile
---- nbsdsrc/src/include/rpc/Makefile
-+++ nbsd_include/rpc/Makefile
-@@ -7,7 +7,11 @@
- svc.h svc_auth.h svc_soc.h types.h xdr.h
- RPC_INCS= rpcb_prot.h
-
-+.if defined(__MINIX)
-+INCSDIR= /usr/netbsd/include/rpc
-+.else
- INCSDIR= /usr/include/rpc
-+.endif
-
- .include <bsd.rpc.mk>
- .include <bsd.prog.mk>
diff -ru nbsdsrc/src/include/sched.h nbsd_include/sched.h
--- nbsdsrc/src/include/sched.h
+++ nbsd_include/sched.h
.include <bsd.own.mk>
-INCSDIR= /usr/netbsd/include/minix
+INCSDIR= /usr/include/minix
INCS+= dirent.h paths.h types.h
-INCSDIR= /usr/netbsd/include/net
+INCSDIR= /usr/include/net
INCS+= hton.h ethertypes.h if.h if_ether.h netlib.h
-INCSDIR= /usr/netbsd/include/netinet
+INCSDIR= /usr/include/netinet
INCS+= in.h tcp.h
-INCSDIR= /usr/netbsd/include/netinet6
+INCSDIR= /usr/include/netinet6
INCS+= in6.h
svc.h svc_auth.h svc_soc.h types.h xdr.h
RPC_INCS= rpcb_prot.h
-.if defined(__MINIX)
-INCSDIR= /usr/netbsd/include/rpc
-.else
INCSDIR= /usr/include/rpc
-.endif
.include <bsd.rpc.mk>
.include <bsd.prog.mk>
# $NetBSD: Makefile,v 1.126 2010/03/01 21:10:13 darran Exp $
-NETBSDINCSDIR= /usr/netbsd/include
-INCSDIR= /usr/netbsd/include/sys
+NETBSDINCSDIR= /usr/include
+INCSDIR= /usr/include/sys
.include <bsd.sys.mk>
.include <bsd.own.mk>
-SUBDIR= mk
-.if (${NBSD_LIBC} == "no")
-SUBDIR+= zoneinfo
-.endif
+SUBDIR= mk zoneinfo
.include <bsd.subdir.mk>
bsd.init.mk bsd.kinc.mk bsd.klinks.mk bsd.lib.mk \
bsd.links.mk bsd.man.mk bsd.obj.mk bsd.own.mk \
bsd.prog.mk bsd.subdir.mk bsd.sys.mk bsd.gcov.mk \
- minix.libc.mk pkgsrchooks.mk sys.mk
+ pkgsrchooks.mk sys.mk
# MINIX-specific files
FILES+= minix.bootprog.mk
OBJECT_FMT= a.out
.endif
-.if ${COMPILER_TYPE} == "gnu"
-.if defined(NBSD_LIBC) && (${NBSD_LIBC} != "no")
-LIBDIR= /usr/netbsd/lib
-.endif
-.endif
-
#
# If this platform's toolchain is missing, we obviously cannot build it.
#
##### Default values
.if empty(CPPFLAGS:M-nostdinc)
-.if (${NBSD_LIBC} == "yes")
-CPPFLAGS+= ${DESTDIR:D-nostdinc ${CPPFLAG_ISYSTEM} ${DESTDIR}/usr/netbsd/include}
-.else
CPPFLAGS+= ${DESTDIR:D-nostdinc ${CPPFLAG_ISYSTEM} ${DESTDIR}/usr/include}
.endif
-.endif
.if empty(CXXFLAGS:M-nostdinc++)
CXXFLAGS+= ${DESTDIR:D-nostdinc++ ${CPPFLAG_ISYSTEMXX} ${DESTDIR}/usr/include/g++}
.endif
.if ${COMPILER_TYPE} == "ack"
LIB${_lib:tu}= ${DESTDIR}/usr/lib/i386/lib${_lib}.a
.elif ${COMPILER_TYPE} == "gnu"
-.if defined(NBSD_LIBC) && (${NBSD_LIBC} != "no")
-LIB${_lib:tu}= ${DESTDIR}/usr/netbsd/lib/lib${_lib}.a
-.else
LIB${_lib:tu}= ${DESTDIR}/usr/lib/lib${_lib}.a
.endif
-.endif
.MADE: ${LIB${_lib:tu}} # Note: ${DESTDIR} will be expanded
.endif
.endfor
.endif
.if defined(NBSD_LIBC) && (${NBSD_LIBC} != "no")
-CPPFLAGS+= -nostdinc -D__NBSD_LIBC -isystem /usr/netbsd/include
-LDFLAGS+= -L /usr/netbsd/lib
+CPPFLAGS+= -D__NBSD_LIBC
.endif
.if defined(USE_FORT) && (${USE_FORT} != "no")
+++ /dev/null
-# NetBSD libc flags go here
-NETBSD_LIBC_CPPFLAGS=-B/usr/netbsd -D__NBSD_LIBC
-NETBSD_LIBC_LDFLAGS=-B/usr/netbsd:/usr/netbsd/lib -lminlib -lcompat_minix
-# Minix libc flags go here
-MINIX_LIBC_CPPFLAGS=
-MINIX_LIBC_LDFLAGS=
.if !defined(_MINIX_PKGSRC_HOOKS_)
_MINIX_PKGSRC_HOOKS_=1
-
-# Get PKGS_REQUIRING_MINIX_LIBC
-.include "/usr/pkgsrc/minix/pkgs_requiring_minix_libc.mk"
-
-# Get MINIX_LIBC_* and NETBSD_LIBC_*
-.include "/usr/share/mk/minix.libc.mk"
-
-# Build everything not in PKGS_REQUIRING_MINIX_LIBC with NetBSD libc
-PKG_REQUIRES_MINIX_LIBC=no
-
-# Search PKGS_REQUIRING_MINIX_LIBC to see if it needs Minix libc
-.for PKG_REQUIRING_MINIX_LIBC in ${PKGS_REQUIRING_MINIX_LIBC}
-.if "${PKG_REQUIRING_MINIX_LIBC}" == "${PKGPATH}"
-PKG_REQUIRES_MINIX_LIBC=yes
-.endif
-.endfor
-
-# Set the proper compilation flags
-.if ${PKG_REQUIRES_MINIX_LIBC} == yes
-CPPFLAGS+= ${MINIX_LIBC_CPPFLAGS}
-LDFLAGS+= ${MINIX_LIBC_LDFLAGS}
-.else
-SED=/bin/sed
-.include "/usr/pkgsrc/mk/nbsd_libc.buildlink3.mk"
-PREFER_NATIVE+=minlib
-PREFER_NATIVE+=compat_minix
-PREFER_NATIVE+=nbsd_libc
-CPPFLAGS+= ${NETBSD_LIBC_CPPFLAGS}
-LDFLAGS+= ${NETBSD_LIBC_LDFLAGS}
-.endif
-
.endif # !defined(_MINIX_PKGSRC_HOOKS_)
.endif
# Set NBSD_LIBC to either "yes" or "no".
-.if !defined(NBSD) || (${NBSD} == "no") \
- || !defined(COMPILER_TYPE) || (${COMPILER_TYPE} == "ack")
+.if ${COMPILER_TYPE} == "ack"
NBSD_LIBC= no
.else
NBSD_LIBC= yes
-# Requires NBSD_LIBC and clang/gcc (we default to using clang)
-NBSD_LIBC:= yes
+# Requires clang/gcc for NetBSD libc
CC:=${CC:C/^cc/clang/}
COMPILER_TYPE:= gnu