[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
>           LDFLAGS = # none
> -          install -s # (or use strip on the files in debian/tmp)
> ...
> 
>           
> 	  The `-g' flag is useful on compilation so that you have available a
> 	  full set of debugging symbols in your built source tree, in case
> 	  anyone should file a bug report involving (for example) a core dump.
> +         It is acceptable, but deprecated, to always have -g in
> +         ``CFLAGS'', and ``use install -s'' to install binaries or use
> +         ``strip'' on the binaries in debian/tmp, but that make it
> +         hard to create a debuggable debian package, and increase
> +         build time for all builds, since debugging information is
> +         created and then stripped away. The preferred method is to
> +         use an environment variable BUILD_DEBUG, which, if set to
> +         `yes', would cause compilation to be done with -g. The
> +         resulting binaries in your package will then contain the full
> +         set of debugging symbols. You can also provide a target
> +         `build-debug' in debian/rules which has the same effect as
> +         setting BUILD_DEBUG to `yes'. This can be done quite simply,
> +         with the folowing lines:
> + build-debug: BUILD_DEBUG=yes
> + build-debug: build
> ======================================================================

I like this one, but I don't think that "build-debug" target should be used
as an alternative since it gives two ways of doing this and the use will still
need to look at the rules file to see which one they need to get the debug
files. Perhaps "build-debug" could be worded as in addition to as opposed
to instead of. I'm sure you didn't mean this in the wording, but some how it
comes across as such.

Also it needs to be noted, IMO, that BUILD_DEBUG should create a package that
is not stripped (ie, don't use "install -s", nor dh_strip[1]) when building.

Ben

[1] Perhaps dh_strip could honor this BUILD_DEBUG env?


Reply to: