From: Ben Gras Date: Wed, 27 Jul 2011 16:01:44 +0000 (+0200) Subject: mk: single mk fragment for new libc X-Git-Tag: v3.2.0~401 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/soc.html?a=commitdiff_plain;h=f614d0015a7ebbf501df080e42ba55d6771e6712;p=minix.git mk: single mk fragment for new libc . allow commands to use it by setting NEED_NBSDLIBC . also add mkfiles to clean and cleandepend so they don't break on missing new mkfiles --- diff --git a/Makefile b/Makefile index 1871be377..7256106ac 100644 --- a/Makefile +++ b/Makefile @@ -94,7 +94,7 @@ install: $(MAKE) -C share install $(MAKE) -C tools install -clean: +clean: mkfiles $(MAKE) -C boot clean $(MAKE) -C commands clean $(MAKE) -C bin clean @@ -103,7 +103,7 @@ clean: $(MAKE) -C lib clean_all $(MAKE) -C test clean -cleandepend: +cleandepend: mkfiles $(MAKE) -C lib cleandepend_all $(MAKE) -C boot cleandepend $(MAKE) -C commands cleandepend diff --git a/bin/Makefile.inc b/bin/Makefile.inc index 744f304bb..e8bdba632 100644 --- a/bin/Makefile.inc +++ b/bin/Makefile.inc @@ -1,7 +1,4 @@ -# Requires NBSD_LIBC and clang/gcc (we default to using clang) -NBSD_LIBC:= yes -CC:=${CC:C/^cc/clang/} -COMPILER_TYPE:= gnu +.include CPPFLAGS+= -D_NETBSD_SOURCE diff --git a/commands/Makefile.inc b/commands/Makefile.inc index f927292cc..adbe8e787 100644 --- a/commands/Makefile.inc +++ b/commands/Makefile.inc @@ -1,3 +1,9 @@ +# Any of the commands can force the new libc being used by +# setting NEED_NBSDLIBC +.if defined(NEED_NBSDLIBC) +.include +.endif + .if (${NBSD_LIBC} != "no") CPPFLAGS+= -D_MINIX -D_NETBSD_SOURCE -D_MINIX_COMPAT LDADD+= -lminlib -lcompat_minix -lasyn -lterminfo diff --git a/share/mk/Makefile b/share/mk/Makefile index a670a3845..72868ff6a 100644 --- a/share/mk/Makefile +++ b/share/mk/Makefile @@ -12,7 +12,8 @@ FILES= bsd.dep.mk bsd.files.mk \ # MINIX-specific files FILES+= minix.bootprog.mk minix.service.mk minix.ackdep.mk \ - minix.ack.mk minix.gcc.mk minix.gcov.mk pkgsrchooks.mk + minix.ack.mk minix.gcc.mk minix.gcov.mk pkgsrchooks.mk \ + minix.newlibc.mk FILESDIR=/usr/share/mk .endif diff --git a/share/mk/minix.newlibc.mk b/share/mk/minix.newlibc.mk new file mode 100644 index 000000000..a102b6fb7 --- /dev/null +++ b/share/mk/minix.newlibc.mk @@ -0,0 +1,5 @@ +# Force clang/gcc and using new libc +# Requires NBSD_LIBC and clang/gcc (we default to using clang) +NBSD_LIBC:= yes +CC:=${CC:C/^cc/clang/} +COMPILER_TYPE:= gnu diff --git a/usr.bin/Makefile.inc b/usr.bin/Makefile.inc index 7c252331e..708a7b326 100644 --- a/usr.bin/Makefile.inc +++ b/usr.bin/Makefile.inc @@ -1,6 +1,4 @@ -# Requires clang/gcc for NetBSD libc -CC:=${CC:C/^cc/clang/} -COMPILER_TYPE:= gnu +.include CPPFLAGS+= -D_NETBSD_SOURCE -D__NBSD_LIBC=1