lynx-dev
[Top][All Lists]
Advanced

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

Re: [Lynx-dev] configure-script issue


From: Mouse
Subject: Re: [Lynx-dev] configure-script issue
Date: Thu, 3 Feb 2022 20:53:20 -0500 (EST)

>> Specifically, when I run it with CC set to cc -g, [...]
> I created the macro after dealing with users who would put C
> preprocessor options in $CC (which for lynx will cause it to not
> build the configuration summary page as expected, for ncurses will
> cause interesting build failures, etc) or would load up $CC with
> optimization/debugging options (similar problems, with complaints
> when it didn't evaluate in the expected order).

> A warning message is just a reminder...

Except it's not just a warning message.  The script also insists on
prying the options off $CC and putting them elsewhere.

> CFLAGS is the proper place for compiler options (standard),

> CPPFLAGS is the place for C preprocessor options [...]

When I'm trying to turn debugging on, I've run into way too many build
systems that will use some setting most of the time but then lose it
other times.  For example, some build procedures use CFLAGS when
compiling .c to .o, but not when linking .o files together into an
executable.  The most reliable way I've found of getting -g set
everywhere is to make it part of $CC.  (It is at least somewhat
important that the compilers I use ignore -g, rather than erroring out,
when doing something for which it's not relevant.)  I've even
occasinoally run into some that don't provide a way to set CFLAGS, or
make it obscure and undocumented enough that they might as well not.

>> So if I'm going to end up building 2.9.0dev.10, I'm going to have to
>> resurrect the kludge I used before: create a script (I called it
>> cc-g) that runs cc -g "$@", and tell configure to use that.
> I do that for compiler warnings, but not for optimization/debugging.

For routine use, I do too: I have a script, wgcc, that runs gcc with a
suitable set of options depending on the particular compiler/version in
use.  For example, one of the more heavily used of the lists of flags
is -Werror -W -Wall -Wpointer-arith -Wcast-qual -Wwrite-strings
-Wstrict-prototypes -Wmissing-prototypes -Wno-uninitialized
-Wno-sign-compare -Wno-missing-field-initializers -Wno-pointer-sign
-Wno-format-zero-length.

I don't always want -g, but I often do.  When I was building that lynx,
performance was very much secondary to debuggability.

> I do this with all C programs - lynx isn't special in that regard.

Then I guess I just haven't had occasion to build much else you
maintain. :-)

/~\ The ASCII                             Mouse
\ / Ribbon Campaign
 X  Against HTML                mouse@rodents-montreal.org
/ \ Email!           7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B



reply via email to

[Prev in Thread] Current Thread [Next in Thread]