Re: configure-script issue
Thomas Dickey <[email protected]>
| Newsgroups | gmane.comp.web.lynx.devel |
|---|---|
| Message-ID | <[email protected]> |
On Thu, Feb 03, 2022 at 03:26:34PM -0500, Mouse wrote: > I wrote, earlier today, of trying to rebuild a past lynx install, > saying > > > This led me to rediscover that the configure script for that version > > appears to be broken. > > I fetched the current .tar.bz2, which unpacked into lynx2.9.0dev.10. > Turns out the configure script is still broken, just in a trivially > different way. (Aside from all the ways that inhere in using configure > scripts at all, that is.) > > Specifically, when I run it with CC set to cc -g, in order to get -g on > all compiler runs, the configure script calls this broken. The old > script then claimed this was a misuse of $CC. The modern script > doesn't call it _mis_use, but it does still - like the old one - someone complained about the word "misuse" 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... CFLAGS is the proper place for compiler options (standard), CPPFLAGS is the place for C preprocessor options (originally GNU make, but adopted in autoconf -- autoconf introduced DEFS, unnecessarily) dnl CF_CC_ENV_FLAGS version: 10 updated: 2020/12/31 18:40:20 dnl --------------- dnl Check for user's environment-breakage by stuffing CFLAGS/CPPFLAGS content dnl into CC. This will not help with broken scripts that wrap the compiler dnl with options, but eliminates a more common category of user confusion. dnl dnl In particular, it addresses the problem of being able to run the C dnl preprocessor in a consistent manner. dnl dnl Caveat: this also disallows blanks in the pathname for the compiler, but dnl the nuisance of having inconsistent settings for compiler and preprocessor dnl outweighs that limitation. > complain and pull the -g off $CC and put it...somewhere else; configure > code is sufficiently twisted I'm not entirely sure where. > > 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. > But this leads me to ask: why do this? Is there something wrong with > wanting a specific option on _all_ cc runs? Or is there some other way > to specify that? Doing this has worked with every other such thing > I've tried, and it strikes me as remarkably obnoxious for the script to > think it knows better than I do how the compiler should be run in my > environment, forcing me to workarounds such as the cc-g script I > sketched above. (I notice other examples of this, such as the way it > maps c[1-9][0-9] to clang with some option, if clang is detected; that's because clang's c89/c99 wrappers are broken (especially on MacOS) to the point that they've become unusable. (I test-compile with c89, c99, gcc with different levels of warnings, clang and any other compiler which I have on a given machine). https://invisible-island.net/personal/lint-tools.html#tool_clang > fortunately, I'm not trying to use clang, so I can ignore that in > practice - but there certainly are plenty of ways it could cause the > build to break when just using what the user told it to would work.) > > But lynx is so sane in so many other respects this quite stands out, > leading me to ask what's behind it and why the complaint doesn't > explain either why it's a bad idea to want to specify options on all cc > runs or what the correct way to do so is. I do this with all C programs - lynx isn't special in that regard. -- Thomas E. Dickey <[email protected]> https://invisible-island.net ftp://ftp.invisible-island.net
signature.asc
(application/pgp-signature, 659 B)
-----BEGIN PGP SIGNATURE----- iQGzBAABCgAdFiEEGYgtkt2kxADCLA1WzCr0RyFnvgMFAmH8XcwACgkQzCr0RyFn vgPsIQwA89+kGkDAjucLKwkBLpfTrG8KBwNQK8nNS+yZAO79X42lGRVD3LzI/L8Y jpEzum48BP1/Aa58IJ1iEoHWjX9a5LyqRg3NuBNus+RWoab5EhluEjCQ6mY4fCgx Z2mlGnrI6t76KdqaRj67axlKPT2Znvz1zD26LspsvIiaSGjnhrc1jD05e1rxxbeh HIL/SAYSGwVbSeX0uv3hKo5dRcrEPjqS/UzTNe4e7pEiO22noTdDsJJ0ru5p5F5r KRheYEW3St856mCOnKZow0oM4mIQpNxgEssZXLxH5DuZHHc2l/DPi/S46yBM2qjW THqN8Q9oTi2G67SUCkqCRnGumS6louustlJuBtGV0GBCwlbppSPM2EbKCB4Cw0+E ZqTopHda/mkGsn8B7+ltovQj65xj3S+6DZiJb7JXKqSzZAk4ueIcqmzNkHGfAQUh VzD89lXT73MUDjf6wpVl/Ym0N3fc1xVtJ0mIv3ZXCusAEF8LuZm68cNU9RIEYmUM nURdEy57 =unkj -----END PGP SIGNATURE-----