Subject: Re: Adding to compilation flags during /usr/src/build.sh
To: None <netbsd-help@netbsd.org>
From: Ingolf Steinbach <Ingolf.Steinbach@jena-optronik.de>
List: netbsd-help
Date: 03/24/2004 16:30:07
Juan RP wrote:
> $ ./build.sh -V COPTS="-pipe blah blah"

According to BUILDING, -V prints "make(1)'s idea of the value
of var.  Does not build any targets."

> o Use COPTS+= in /etc/mk.conf.

I tried that. While this works for userland programs, it
it breaks when it comes to kernels:

No COPTS line in /etc/mk.conf:
cat /usr/src/sys/arch/i386/i386/genassym.cf
  | sh /usr/src/sys/kern/genassym.sh /usr/obj/tools/tools.NetBSD-1.6.2-i386
    /bin/i386--netbsdelf-gcc  -ffreestanding  -O2 -Werror -Wall -Wno-main
    -Wno-format-zero-length -Wpointer-arith -Wmissing -prototypes
    -Wstrict-prototypes -Wno-uninitialized  -Di386 -I.  -I/usr/src/sys/arch
    -I/usr/src/sys -nostdinc -DLKM -DMAXUSERS=32 -D_KERNEL
    -D_KERNEL_OPT   > assym.h.tmp &&  mv -f assym.h.tmp assym.h

With COPTS+=-pipe in /etc/mk.conf:
cat /usr/src/sys/arch/i386/i386/genassym.cf
  | sh /usr/src/sys/kern/genassym.sh /usr/obj/tools/tools.NetBSD-1.6.2-i386
    /bin/i386--netbsdelf-gcc  -ffreestanding  -pipe -Werror -Wall -Wno-main
    -Wno-format-zero-length -Wpointer-arith -Wmissing-prototypes
    -Wstrict-prototypes -Wno-uninitialized  -Di386 -I.  -I/usr/src/sys/arch
    -I/usr/src/sys -nostdinc -DLKM -DMAXUSERS=32 -D_KERNEL
    -D_KERNEL_OPT   > assym.h.tmp &&  mv -f assym.h.tmp assym.h

Note that -O2 is /replaced/ by -pipe.

I'd not like to include -O2 in COPTS (via /etc/mk.conf) as there
might be cases where -O2 is not desired...

Kind regards
    Ingolf
-- 

Ingolf Steinbach                       Jena-Optronik GmbH
ingolf.steinbach@jena-optronik.de       ++49 3641 200-147
PGP: 0x7B3B5661  213C 828E 0C92 16B5  05D0 4D5B A324 EC04