Subject: Re: CFLAGS and build.sh
To: None <joel@carnat.net>
From: None <segv@netctl.net>
List: port-sparc64
Date: 10/27/2005 14:38:46
On Thu, 27 Oct 2005 15:20:17 +0200
Joel CARNAT <joel@carnat.net> wrote:

> Hi,
> 
> I have CFLAGS and friends set in /etc/mk.conf.
> Everytime I use build.sh, I get the following kinds of errors :

I think the way you set those flags is totally wrong!

Here is how it should be done:

_ACCEPTABLE=yes
DEPENDS_TARGET=package

# When doing 'build.sh release' it's safer to use -Os optimisation
# With -O2 and higher, executables may not fit inside ramdisk image, etc
KERNEL_CPUFLAGS=-mcpu=ultrasparc
KERNEL_CFLAGS=-Os -pipe

PKGSRC_CPUFLAGS=-mcpu=ultrasparc -mvis
PKGSRC_CFLAGS=-O2 -pipe

.ifdef BSD_PKG_MK
COPTS+=${PKGSRC_CFLAGS} ${PKGSRC_CPUFLAGS}
CFLAGS+=${PKGSRC_CFLAGS} ${PKGSRC_CPUFLAGS}
CXXFLAGS+=${PKGSRC_CFLAGS} ${PKGSRC_CPUFLAGS}
.else
COPTS+=${KERNEL_CFLAGS}
CPUFLAGS+=${KERNEL_CPUFLAGS}
.endif