From 84a7c3f46454582dc517aecfac44dd7811ba0ea2 Mon Sep 17 00:00:00 2001 From: Lionel Sambuc Date: Wed, 17 Apr 2013 13:01:55 +0200 Subject: [PATCH] fix sysroot clang Change-Id: I63adf8460e7fdbe3d9d5ad6c828ae5758cb1643c --- commands/ash/Makefile | 2 +- drivers/tty/keymaps/Makefile.inc | 2 +- lib/libsys/Makefile | 4 -- share/mk/bsd.own.mk | 72 +++++++++++++++++++------------- sys/sys/types.h | 8 ++++ test/Makefile | 4 +- 6 files changed, 54 insertions(+), 38 deletions(-) diff --git a/commands/ash/Makefile b/commands/ash/Makefile index 886f17533..bcf56e683 100644 --- a/commands/ash/Makefile +++ b/commands/ash/Makefile @@ -41,7 +41,7 @@ CPPFLAGS+= -I. -I${.CURDIR} # A. Generate C tools used to build ash .for tool in init nodes signames syntax ${.OBJDIR}/mk${tool}: ${.CURDIR}/mk${tool}.c - ${HOST_CC} ${.ALLSRC} -o ${.TARGET} + ${HOST_CC} ${HOST_CFLAGS} ${HOST_CPPFLAGS} ${.ALLSRC} -o ${.TARGET} CLEANFILES+= ${.OBJDIR}/mk${tool} .endfor diff --git a/drivers/tty/keymaps/Makefile.inc b/drivers/tty/keymaps/Makefile.inc index f65d5492f..0e5a73cd7 100644 --- a/drivers/tty/keymaps/Makefile.inc +++ b/drivers/tty/keymaps/Makefile.inc @@ -4,7 +4,7 @@ FILESDIR= /usr/lib/keymaps .src.map: ${_MKTARGET_CREATE} - ${HOST_CC} ${HOST_LDFLAGS} -DKEYSRC=\"$<\" -o ${.OBJDIR}/${.TARGET}_genmap ${.CURDIR}/genmap.c + ${HOST_CC} ${HOST_CFLAGS} ${HOST_CPPFLAGS} ${HOST_LDFLAGS} -DKEYSRC=\"$<\" -o ${.OBJDIR}/${.TARGET}_genmap ${.CURDIR}/genmap.c ${.OBJDIR}/${.TARGET}_genmap > ${.OBJDIR}/${.TARGET} rm -f ${.OBJDIR}/${.TARGET}_genmap diff --git a/lib/libsys/Makefile b/lib/libsys/Makefile index 9b2ec3d36..b20be6ac4 100644 --- a/lib/libsys/Makefile +++ b/lib/libsys/Makefile @@ -128,8 +128,4 @@ CPPFLAGS+= -DUSE_SYSDEBUG CPPFLAGS.sched_start.c+= -I${NETBSDSRCDIR} -.if (${CC} == "gcc") || (${CC} == "clang") -LDADD+= -lminc -.endif - .include diff --git a/share/mk/bsd.own.mk b/share/mk/bsd.own.mk index 5bdb81b27..12d5e0a84 100644 --- a/share/mk/bsd.own.mk +++ b/share/mk/bsd.own.mk @@ -24,11 +24,40 @@ INFOGRP?= operator DOCGRP?= operator MKBINUTILS?= no -MKGDB:= no MKGCC?= no MKGCCCMDS?= no +MKPROFILE?= no MKSLJIT?= no +#MINIX-specific variables +MKCOVERAGE?= no + +# LSC MINIX does not support these features ATM. +USE_FORT:= no +USE_SSP:= no +MKCRYPTO:= no +MKGDB:= no +MKGROFF:= no +MKHESIOD:= no +MKHTML:= no +MKINET6:= no +MKIPFILTER:= no +MKISCSI:= no +MKKERBEROS:= no +MKKMOD:= no +MKLDAP:= no +MKLINT:= no +MKLVM:= no +MKMDNS:= no +MKNLS:= no +MKNPF:= no +MKPAM:= no +MKPF:= no +MKPOSTFIX:= no +MKRUMP:= no +MKSKEY:= no +MKYP:= no + # LSC MINIX SMP Support? .ifdef CONFIG_SMP SMP_FLAGS += -DCONFIG_SMP @@ -63,6 +92,17 @@ USETOOLS?= never MKBITCODE:=no . endif . endif # ${_HAVE_GOLD:U} == "" + +# If DESTDIR was specified, and we are not using the tools, then make sure to +# build out-of-tree and to refer only DESTDIR for target binaries +# The case when using tools is already handled below. +. if ${DESTDIR:U} != "" + CPPFLAGS+= --sysroot=${DESTDIR} + LDFLAGS+= --sysroot=${DESTDIR} +. if defined(HAVE_LLVM) + LDFLAGS+= -L${DESTDIR}/usr/lib +. endif +. endif # ${DESTDIR:U} != "" . endif # ${USETOOLS:Uno} != "yes" . if !defined(HOSTPROG) && !defined(HOSTLIB) @@ -933,36 +973,8 @@ MKBINUTILS?= ${MKBFD} MKZFS?= yes .endif -# Some tough Minix defaults -MKCOVERAGE?= no -MKPROFILE?= no +# LSC: MINIX: Has to be here, otherwise libgcc_s.a is not found!? MKSTATICLIB:= yes -MKLINT:= no - -# LSC MINIX does not support these features ATM. -USE_FORT:= no -USE_SSP:= no -MKYP:= no -MKPF:= no -MKNLS:= no -MKHESIOD:= no -MKPOSTFIX:= no -MKKMOD:= no -MKEXTSRC:= no -MKRUMP:= no -MKSKEY:= no -MKCRYPTO:= no -MKMDNS:= no -MKNPF:= no -MKISCSI:= no -MKLVM:= no -MKKERBEROS:= no -MKLDAP:= no -MKPAM:= no -MKIPFILTER:= no -MKINET6:= no -MKGROFF:= no -MKHTML:= no # # MK* options which default to "yes". diff --git a/sys/sys/types.h b/sys/sys/types.h index 00cabd7d9..b6df6ee85 100644 --- a/sys/sys/types.h +++ b/sys/sys/types.h @@ -97,14 +97,22 @@ typedef uint64_t u_int64_t; #ifdef __minix typedef uint8_t u8_t; +#define u8_t uint8_t typedef uint16_t u16_t; +#define u16_t uint16_t typedef uint32_t u32_t; +#define u32_t uint32_t typedef uint64_t u64_t; +#define u64_t uint64_t typedef int8_t i8_t; +#define i8_t int8_t typedef int16_t i16_t; +#define i16_t int16_t typedef int32_t i32_t; +#define i32_t int32_t typedef int64_t i64_t; +#define i64_t int64_t #ifdef _NETBSD_SOURCE /* some Minix specific types that do not conflict with posix */ diff --git a/test/Makefile b/test/Makefile index 0be26cab0..4bfbb5870 100644 --- a/test/Makefile +++ b/test/Makefile @@ -111,7 +111,7 @@ OBJS.${o} += common.o # LSC Make sure there is not leftover after a failed testrun clean: .PHONY .MAKE - $(MAKE) -C select clean - rm -rf DIR* + @${MAKE} -C select clean || true + @rm -rf DIR* .include -- 2.44.0