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

Re: [PROPOSAL] changing policy on compiling with -g .. a better way



On Wed, Sep 01, 1999 at 09:55:11AM -0500, Manoj Srivastava wrote:
>         The second way: we don't just offer an alternative, we
>  deprecate the old method, but let it be still legal.
> ======================================================================
>           CC = gcc
> -         CFLAGS = -O2 -g -Wall # sane warning options vary between programs
> +         # sane warning options vary between programs
> +         ifeq (,$(findstring $(BUILD_DEBUG),YES yes Yes))
> +         CFLAGS = -O2 -g -Wall 
> +         else
> +         CFLAGS = -O2 -Wall 
> +         endif

(Aren't the bodies of the if/else/endif around the wrong way here? 
findstring will return <something> if BUILD_DEBUG is yes, and will thus
not be built with debug options, no?)

This example makes me wonder if something more general, like:

	debian/rules binary BUILD_OPTIONS=debug

would be better, tested with something akin to:

	CFLAGS = -O2 -Wall -W
	ifneq (,$(findstring $(BUILD_OPTIONS),debug)
	CFLAGS += -g
	endif

. This would let us later add other options in a fairly clean way, for
things like "FLAKEY_OK" if it's okay to build `flakey' packages that aren't
suitable for user consumption but which are good enough for an autobuilder
to kickstart a port to a new architecture.

>           LDFLAGS = # none
> -          install -s # (or use strip on the files in debian/tmp)

Isn't strip still necessary/desirable?

] [aj@blae ~/test]$ gcc -O2 -Wall -o hello hello.c
] [aj@blae ~/test]$ ls -l hello
] -rwxrwxr-x   1 aj       aj           4457 Sep  2 02:49 hello*
] [aj@blae ~/test]$ strip hello
] [aj@blae ~/test]$ ls -l hello
] -rwxrwxr-x   1 aj       aj           2716 Sep  2 02:49 hello*

Cheers,
aj

-- 
Anthony Towns <aj@humbug.org.au> <http://azure.humbug.org.au/~aj/>
I don't speak for anyone save myself. PGP encrypted mail preferred.

 ``The thing is: trying to be too generic is EVIL. It's stupid, it 
        results in slower code, and it results in more bugs.''
                                        -- Linus Torvalds

Attachment: pgpRn_uNbhtno.pgp
Description: PGP signature


Reply to: