diff --git a/share/mk/bsd.README b/share/mk/bsd.README index e2a8d08f1221..9d394268f360 100644 --- a/share/mk/bsd.README +++ b/share/mk/bsd.README @@ -1,4 +1,4 @@ -# $NetBSD: bsd.README,v 1.290 2011/11/05 22:56:30 christos Exp $ +# $NetBSD: bsd.README,v 1.291 2012/01/28 21:32:13 christos Exp $ # @(#)bsd.README 8.2 (Berkeley) 4/2/94 This is the README file for the make "include" files for the NetBSD @@ -1731,6 +1731,9 @@ OBJCFLAGS Options to ${OBJC}. [${CFLAGS}] OBJCOPY Copy and translate object files. [objcopy] +OBJCOPYLIBFLAGS Flags to pass to objcopy when library objects are + being built. [${.TARGET} =~ "*.po" ? -X : -x] + OBJDUMP Display information from object files. [objdump] RANLIB Generate index to archive. [ranlib] diff --git a/share/mk/bsd.lib.mk b/share/mk/bsd.lib.mk index c2976e863055..03f0f1e7251c 100644 --- a/share/mk/bsd.lib.mk +++ b/share/mk/bsd.lib.mk @@ -1,4 +1,4 @@ -# $NetBSD: bsd.lib.mk,v 1.318 2011/10/07 09:15:22 mrg Exp $ +# $NetBSD: bsd.lib.mk,v 1.319 2012/01/28 21:32:14 christos Exp $ # @(#)bsd.lib.mk 8.3 (Berkeley) 4/22/94 .include @@ -214,7 +214,7 @@ CTFFLAGS+= -g ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} .endif .if !defined(CFLAGS) || empty(CFLAGS:M*-g*) - ${OBJCOPY} -x ${.TARGET} + ${OBJCOPY} ${OBJCOPYFLAGS} ${.TARGET} .endif .c.po: @@ -224,7 +224,7 @@ CTFFLAGS+= -g ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} .endif .if !defined(CFLAGS) || empty(CFLAGS:M*-g*) - ${OBJCOPY} -X ${.TARGET} + ${OBJCOPY} ${OBJCOPYFLAGS} ${.TARGET} .endif .c.go: @@ -235,21 +235,21 @@ CTFFLAGS+= -g ${_MKTARGET_COMPILE} ${COMPILE.c} ${COPTS.${.IMPSRC:T}} ${CPUFLAGS.${.IMPSRC:T}} ${CPPFLAGS.${.IMPSRC:T}} ${CSHLIBFLAGS} ${.IMPSRC} -o ${.TARGET} .if !defined(CFLAGS) || empty(CFLAGS:M*-g*) - ${OBJCOPY} -x ${.TARGET} + ${OBJCOPY} ${OBJCOPYFLAGS} ${.TARGET} .endif .cc.o .cpp.o .cxx.o .C.o: ${_MKTARGET_COMPILE} ${COMPILE.cc} ${COPTS.${.IMPSRC:T}} ${CPUFLAGS.${.IMPSRC:T}} ${CPPFLAGS.${.IMPSRC:T}} ${.IMPSRC} -o ${.TARGET} .if !defined(CFLAGS) || empty(CFLAGS:M*-g*) - ${OBJCOPY} -x ${.TARGET} + ${OBJCOPY} ${OBJCOPYFLAGS} ${.TARGET} .endif .cc.po .cpp.po .cxx.po .C.po: ${_MKTARGET_COMPILE} ${COMPILE.cc} ${PROFFLAGS} ${COPTS.${.IMPSRC:T}} ${CPUFLAGS.${.IMPSRC:T}} ${CPPFLAGS.${.IMPSRC:T}} -pg ${.IMPSRC} -o ${.TARGET} .if !defined(CFLAGS) || empty(CFLAGS:M*-g*) - ${OBJCOPY} -X ${.TARGET} + ${OBJCOPY} ${OBJCOPYFLAGS} ${.TARGET} .endif .cc.go .cpp.go .cxx.go .C.go: @@ -260,7 +260,7 @@ CTFFLAGS+= -g ${_MKTARGET_COMPILE} ${COMPILE.cc} ${COPTS.${.IMPSRC:T}} ${CPUFLAGS.${.IMPSRC:T}} ${CPPFLAGS.${.IMPSRC:T}} ${CSHLIBFLAGS} ${.IMPSRC} -o ${.TARGET} .if !defined(CFLAGS) || empty(CFLAGS:M*-g*) - ${OBJCOPY} -x ${.TARGET} + ${OBJCOPY} ${OBJCOPYFLAGS} ${.TARGET} .endif .f.o: @@ -270,7 +270,7 @@ CTFFLAGS+= -g ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} .endif .if !defined(FOPTS) || empty(FOPTS:M*-g*) - ${OBJCOPY} -x ${.TARGET} + ${OBJCOPY} ${OBJCOPYFLAGS} ${.TARGET} .endif .f.po: @@ -280,7 +280,7 @@ CTFFLAGS+= -g ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} .endif .if !defined(FOPTS) || empty(FOPTS:M*-g*) - ${OBJCOPY} -X ${.TARGET} + ${OBJCOPY} ${OBJCOPYFLAGS} ${.TARGET} .endif .f.go: @@ -291,7 +291,7 @@ CTFFLAGS+= -g ${_MKTARGET_COMPILE} ${COMPILE.f} ${FPICFLAGS} ${.IMPSRC} -o ${.TARGET} .if !defined(FOPTS) || empty(FOPTS:M*-g*) - ${OBJCOPY} -x ${.TARGET} + ${OBJCOPY} ${OBJCOPYFLAGS} ${.TARGET} .endif .f.ln: @@ -305,7 +305,7 @@ CTFFLAGS+= -g ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} .endif .if !defined(OBJCFLAGS) || empty(OBJCFLAGS:M*-g*) - ${OBJCOPY} -x ${.TARGET} + ${OBJCOPY} ${OBJCOPYFLAGS} ${.TARGET} .endif .m.po: @@ -315,21 +315,21 @@ CTFFLAGS+= -g ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} .endif .if !defined(OBJCFLAGS) || empty(OBJCFLAGS:M*-g*) - ${OBJCOPY} -X ${.TARGET} + ${OBJCOPY} ${OBJCOPYFLAGS} ${.TARGET} .endif .m.go: ${_MKTARGET_COMPILE} ${COMPILE.m} ${DEBUGFLAGS} -g ${OBJCOPTS.${.IMPSRC:T}} ${.IMPSRC} -o ${.TARGET} .if !defined(OBJCFLAGS) || empty(OBJCFLAGS:M*-g*) - ${OBJCOPY} -X ${.TARGET} + ${OBJCOPY} ${OBJCOPYFLAGS} ${.TARGET} .endif .m.pico: ${_MKTARGET_COMPILE} ${COMPILE.m} ${CSHLIBFLAGS} ${OBJCOPTS.${.IMPSRC:T}} ${.IMPSRC} -o ${.TARGET} .if !defined(OBJCFLAGS) || empty(OBJCFLAGS:M*-g*) - ${OBJCOPY} -x ${.TARGET} + ${OBJCOPY} ${OBJCOPYFLAGS} ${.TARGET} .endif .s.o: @@ -338,7 +338,7 @@ CTFFLAGS+= -g .if defined(CTFCONVERT) ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} .endif - ${OBJCOPY} -x ${.TARGET} + ${OBJCOPY} ${OBJCOPYFLAGS} ${.TARGET} .S.o: ${_MKTARGET_COMPILE} @@ -346,7 +346,7 @@ CTFFLAGS+= -g .if defined(CTFCONVERT) ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} .endif - ${OBJCOPY} -x ${.TARGET} + ${OBJCOPY} ${OBJCOPYFLAGS} ${.TARGET} .s.po: ${_MKTARGET_COMPILE} @@ -354,7 +354,7 @@ CTFFLAGS+= -g .if defined(CTFCONVERT) ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} .endif - ${OBJCOPY} -X ${.TARGET} + ${OBJCOPY} ${OBJCOPYFLAGS} ${.TARGET} .S.po: ${_MKTARGET_COMPILE} @@ -362,7 +362,7 @@ CTFFLAGS+= -g .if defined(CTFCONVERT) ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} .endif - ${OBJCOPY} -X ${.TARGET} + ${OBJCOPY} ${OBJCOPYFLAGS} ${.TARGET} .s.go: ${_MKTARGET_COMPILE} @@ -375,12 +375,12 @@ CTFFLAGS+= -g .s.pico: ${_MKTARGET_COMPILE} ${COMPILE.s} ${CAPICFLAGS} ${COPTS.${.IMPSRC:T}} ${CPUFLAGS.${.IMPSRC:T}} ${CPPFLAGS.${.IMPSRC:T}} ${.IMPSRC} -o ${.TARGET} - ${OBJCOPY} -x ${.TARGET} + ${OBJCOPY} ${OBJCOPYFLAGS} ${.TARGET} .S.pico: ${_MKTARGET_COMPILE} ${COMPILE.S} ${CAPICFLAGS} ${COPTS.${.IMPSRC:T}} ${CPUFLAGS.${.IMPSRC:T}} ${CPPFLAGS.${.IMPSRC:T}} ${.IMPSRC} -o ${.TARGET} - ${OBJCOPY} -x ${.TARGET} + ${OBJCOPY} ${OBJCOPYFLAGS} ${.TARGET} .if defined(LIB) # { .if (${MKPIC} == "no" || (defined(LDSTATIC) && ${LDSTATIC} != "") \ diff --git a/share/mk/bsd.sys.mk b/share/mk/bsd.sys.mk index c7ea98088a7b..b72fcfd66be4 100644 --- a/share/mk/bsd.sys.mk +++ b/share/mk/bsd.sys.mk @@ -1,4 +1,4 @@ -# $NetBSD: bsd.sys.mk,v 1.210 2011/10/31 14:20:12 chs Exp $ +# $NetBSD: bsd.sys.mk,v 1.211 2012/01/28 21:32:14 christos Exp $ # # Build definitions used for NetBSD source tree builds. @@ -268,4 +268,7 @@ YFLAGS+= ${YPREFIX:D-p${YPREFIX}} ${YHEADER:D-d} .endif .endif +# Objcopy +OBJCOPYLIBFLAGS?=${"${.TARGET:M*.po}" != "":?-X:-x} + .endif # !defined(_BSD_SYS_MK_)