From c14f2d4ef81dfcac0fee9e6f8a9622ded1aba13b Mon Sep 17 00:00:00 2001 From: joerg Date: Fri, 10 Aug 2012 16:05:26 +0000 Subject: [PATCH] Deal with optional HAVE_GCC. --- external/gpl3/Makefile | 4 +++- external/historical/nawk/bin/Makefile | 4 +--- external/lgpl3/gmp/lib/libgmp/Makefile | 4 +--- sys/conf/Makefile.kern.inc | 8 ++------ sys/lib/libkern/Makefile.inc | 4 +++- sys/lib/libsa/Makefile | 4 +--- sys/rump/Makefile.rump | 4 ++-- 7 files changed, 13 insertions(+), 19 deletions(-) diff --git a/external/gpl3/Makefile b/external/gpl3/Makefile index e25a11e98cca..600035a31cb7 100644 --- a/external/gpl3/Makefile +++ b/external/gpl3/Makefile @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.6 2011/10/31 08:14:44 mrg Exp $ +# $NetBSD: Makefile,v 1.7 2012/08/10 16:05:26 joerg Exp $ .include @@ -6,11 +6,13 @@ SUBDIR+= binutils .endif +.if ${MKGCC} != "no" .if ${HAVE_GCC} == 45 .if ${MKGCCCMDS} != "no" SUBDIR+= gcc .endif .endif +.endif .if ${MKGDB} != "no" .if ${HAVE_GDB} == "7" diff --git a/external/historical/nawk/bin/Makefile b/external/historical/nawk/bin/Makefile index 27ccb7823ebf..024bc1a5f6e7 100644 --- a/external/historical/nawk/bin/Makefile +++ b/external/historical/nawk/bin/Makefile @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.8 2011/08/16 10:45:37 christos Exp $ +# $NetBSD: Makefile,v 1.9 2012/08/10 16:05:26 joerg Exp $ WARNS?= 4 CWARNFLAGS.clang+= -Wno-self-assign @@ -17,9 +17,7 @@ LDADD+= -lm DPADD+= ${LIBM} .endif YHEADER= yes -.if defined(HAVE_GCC) || defined(HAVE_PCC) COPTS+= -Wno-pointer-sign -.endif COPTS.run.c += -Wno-format-nonliteral COPTS.tran.c += -Wno-format-nonliteral diff --git a/external/lgpl3/gmp/lib/libgmp/Makefile b/external/lgpl3/gmp/lib/libgmp/Makefile index b07d5dddd786..d85b27a837d0 100644 --- a/external/lgpl3/gmp/lib/libgmp/Makefile +++ b/external/lgpl3/gmp/lib/libgmp/Makefile @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.12 2011/09/21 02:06:42 mrg Exp $ +# $NetBSD: Makefile,v 1.13 2012/08/10 16:05:26 joerg Exp $ .include @@ -191,8 +191,6 @@ CLEANFILES+= ${DPSRCS} gen-fac_ui gen-fib gen-bases gen-psqr gen-trialdivtab # Don't warn about functions which cannot be stack smash protected as # there are a lot of them. -.if defined(HAVE_GCC) || defined(HAVE_PCC) COPTS += -Wno-stack-protector -.endif CWARNFLAGS.clang+= -Wno-unused-value -Wno-tautological-compare diff --git a/sys/conf/Makefile.kern.inc b/sys/conf/Makefile.kern.inc index 7621633d2d44..598824164e36 100644 --- a/sys/conf/Makefile.kern.inc +++ b/sys/conf/Makefile.kern.inc @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.kern.inc,v 1.157 2012/07/27 05:40:51 matt Exp $ +# $NetBSD: Makefile.kern.inc,v 1.158 2012/08/10 16:05:26 joerg Exp $ # # This file contains common `MI' targets and definitions and it is included # at the bottom of each `MD' ${MACHINE}/conf/Makefile.${MACHINE}. @@ -70,7 +70,6 @@ CWARNFLAGS+= -Wold-style-definition CWARNFLAGS+= -Wswitch -Wshadow CWARNFLAGS+= -Wcast-qual -Wwrite-strings CWARNFLAGS+= -Wno-unreachable-code -. if defined(HAVE_GCC) || defined(HAVE_PCC) CWARNFLAGS+= -Wno-pointer-sign -Wno-attributes . if ${MACHINE} == "i386" || ${MACHINE_ARCH} == "x86_64" || \ ${MACHINE_ARCH} == "sparc64" || ${MACHINE} == "prep" @@ -79,7 +78,6 @@ CWARNFLAGS+= -Wextra -Wno-unused-parameter . if ${MACHINE} == "i386" || ${MACHINE_ARCH} == "x86_64" CWARNFLAGS+= -Wold-style-definition . endif -. endif # Add -Wno-sign-compare. -Wsign-compare is included in -Wall as of GCC 3.3, # but our sources aren't up for it yet. CWARNFLAGS+= -Wno-sign-compare @@ -96,7 +94,7 @@ CFLAGS+= ${DEBUG} ${COPTS} AFLAGS+= -D_LOCORE -Wa,--fatal-warnings # XXX -.if defined(HAVE_GCC) +.if defined(HAVE_GCC) || defined(HAVE_LLVM) CFLAGS+= -fno-strict-aliasing CFLAGS+= -fno-common .endif @@ -566,11 +564,9 @@ VARSTACK=kern/uipc_socket.c miscfs/genfs/genfs_vnops.c \ uvm/uvm_pager.c dev/ic/aic7xxx.c dev/ic/aic79xx.c arch/xen/i386/gdt.c \ dev/ofw/ofw_subr.c -.if defined(HAVE_GCC) || defined(HAVE_PCC) .for __varstack in ${VARSTACK} COPTS.${__varstack:T} += -Wno-stack-protector .endfor -.endif AFLAGS+= ${AOPTS.${.IMPSRC:T}} CFLAGS+= ${COPTS.${.IMPSRC:T}} ${CPUFLAGS.${.IMPSRC:T}} diff --git a/sys/lib/libkern/Makefile.inc b/sys/lib/libkern/Makefile.inc index 9fe2db2b9a27..12f89fe2c25e 100644 --- a/sys/lib/libkern/Makefile.inc +++ b/sys/lib/libkern/Makefile.inc @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.inc,v 1.40 2005/12/20 19:35:26 christos Exp $ +# $NetBSD: Makefile.inc,v 1.41 2012/08/10 16:05:27 joerg Exp $ # # Configuration variables (default values are below): # @@ -47,6 +47,8 @@ KERNMAKE= \ KERNCPPFLAGS=${CPPFLAGS:S@^-I.@-I${KERNDOTDIR}@g:Q} \ KERNMISCCPPFLAGS=${KERNMISCCPPFLAGS:Q} \ LINTFLAGS=${KERNLINTFLAGS:Q} \ + LIBKERN_ARCH=${LIBKERN_ARCH:Q} \ + COMMON_MACHINE_ARCH=${COMMON_MACHINE_ARCH:Q} \ ${KERNMISCMAKEFLAGS} ${KERNLIB}: .NOTMAIN .MAKE __always_make_kernlib diff --git a/sys/lib/libsa/Makefile b/sys/lib/libsa/Makefile index af9a4d6b3bce..4e0e27b162f6 100644 --- a/sys/lib/libsa/Makefile +++ b/sys/lib/libsa/Makefile @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.77 2012/01/16 18:44:13 christos Exp $ +# $NetBSD: Makefile,v 1.78 2012/08/10 16:05:27 joerg Exp $ LIB= sa NOPIC= # defined @@ -91,9 +91,7 @@ lib${LIB}.o:: ${OBJS} @rm -f lib${LIB}.o @${LD} -r -o lib${LIB}.o `lorder ${OBJS} | tsort` -.if defined(HAVE_GCC) || defined(HAVE_PCC) CPPFLAGS+= -Wno-pointer-sign -.endif .if defined(HAVE_GCC) && ${HAVE_GCC} >= 45 && ${MACHINE_ARCH} == "vax" COPTS.bootp.c+= -O0 diff --git a/sys/rump/Makefile.rump b/sys/rump/Makefile.rump index 612a7b43ba00..dc7db7590570 100644 --- a/sys/rump/Makefile.rump +++ b/sys/rump/Makefile.rump @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.rump,v 1.62 2012/08/05 15:37:39 pooka Exp $ +# $NetBSD: Makefile.rump,v 1.63 2012/08/10 16:05:27 joerg Exp $ # WARNS?= 3 # XXX: src/sys won't compile with -Wsign-compare yet @@ -16,7 +16,7 @@ CPPFLAGS+= -D_RUMP_NATIVE_ABI .endif CFLAGS+= -ffreestanding -fno-strict-aliasing -.if defined(HAVE_GCC) && ${HAVE_GCC} >= 3 +.if (defined(HAVE_GCC) && ${HAVE_GCC} >= 3) || defined(HAVE_LLVM) CFLAGS+= -Wsign-compare CFLAGS+= -Wno-pointer-sign -Wno-attributes CFLAGS+= -std=gnu99