Port-sparc archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: How to specify COPTS when cross-building for SPARCclassic?



On Fri, Jan 23, 2009 at 09:29:21AM -0800, Hisashi T Fujinaka wrote:
> On Tue, 6 Jan 2009, Michael wrote:
>
>> On Jan 6, 2009, at 7:18 PM, Hisashi T Fujinaka wrote:
>>
>>> On Mon, 5 Jan 2009, Michael wrote:
>>>> ... and while there don't forget to put -mcpu=v8 -mtune=v8 into
>>>> CFLAGS, otherwise you'd get v7 binaries which would slow things
>>>> down even more.
>>> Is there an easy way to do this just for the cross build? I'm always
>>> confused about all this.
>>
>> I meant COPTS. Putting it into CFLAGS would affect building the tools
>> which would probably now be what you want.
>> For what it's worth I have wrapper scripts for cross-builds, they
>> don't do much except emptying CFLAGS, LDFLAGS, CXXFLAGS and so on and
>> putting options appropriate for the target into COPTS. After that it's
>> just build.sh -m sparc distribution.
>
> I'm going to be a total noob and ask how exactly to do this. I put it in
> an environment variable (using man (1) env) but I'm not sure what's what
> it takes. I'm crosscompiling and I'm not good enough at sh scripting to
> figure out how to conditionally put it into mk.conf.

I have the following bit of stuff in my mk.conf file:

----- snip, snip -----
.ifdef BSD_PKG_MK
# pkgsrc only options
.else  # BSD_PKG_MK
COPTS?= -pipe ${DEFCOPTS}
# For cross-compiling
. if ${MACHINE_ARCH} == sparc
COPTS+=-mcpu=v8
. elif ${MACHINE_ARCH} == sparc64
COPTS+=-mcpu=ultrasparc
. elif ${MACHINE_ARCH} == powerpc
COPTS+=-mcpu=750
. elif ${MACHINE_ARCH} == alpha
COPTS+=-mcpu=21164a
. elif ${MACHINE_ARCH} == i386
COPTS+=-march=pentium2 -mcpu=pentium3
. elif (${MACHINE_ARCH} == m68k) && (${MACHINE} == mvme68k)
#COPTS+=-m68040 -msoft-float -save-temps
#COPTS+=-m68040 -msoft-float
COPTS+=-m68040
. endif
.endif  # BSD_PKG_MK
----- snip, snip -----

-Kurt


Home | Main Index | Thread Index | Old Index