]> Zhao Yanbai Git Server - minix.git/commitdiff
fix sysroot clang 20/920/2
authorLionel Sambuc <lionel@minix3.org>
Wed, 17 Apr 2013 11:01:55 +0000 (13:01 +0200)
committerLionel Sambuc <lionel@minix3.org>
Tue, 18 Feb 2014 10:25:01 +0000 (11:25 +0100)
Change-Id: I63adf8460e7fdbe3d9d5ad6c828ae5758cb1643c

commands/ash/Makefile
drivers/tty/keymaps/Makefile.inc
lib/libsys/Makefile
share/mk/bsd.own.mk
sys/sys/types.h
test/Makefile

index 886f17533a9d35be661138d0a6f6c2ed77397283..bcf56e68342f172a880f99caf439e30cd532c2dc 100644 (file)
@@ -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
index f65d5492f4d6c424ced9089b0fe06a3fa254a183..0e5a73cd7c72e1b32f012057a73af350107429a1 100644 (file)
@@ -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
 
index 9b2ec3d369b4b2456b880b5d98b11ef18730bbea..b20be6ac44c24b81d7601f0414ab02bef73cf85a 100644 (file)
@@ -128,8 +128,4 @@ CPPFLAGS+= -DUSE_SYSDEBUG
 
 CPPFLAGS.sched_start.c+=       -I${NETBSDSRCDIR}
 
-.if (${CC} == "gcc") || (${CC} == "clang")
-LDADD+=        -lminc
-.endif
-
 .include <bsd.lib.mk>
index 5bdb81b274301a825fa261f427436a169453cc10..12d5e0a84355f6a10c99cf8d523400336a9e398d 100644 (file)
@@ -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".
index 00cabd7d9a353a886127d108ee2dff75edf5186e..b6df6ee8528e93d59ed1b3f1feeac8fac5922503 100644 (file)
@@ -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 */
index 0be26cab0703546a663e0f5f04082d8ab4138f12..4bfbb587092fd479bc95ac63b9661e44081a169b 100644 (file)
@@ -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 <bsd.prog.mk>