linux-man.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ingo Schwarze <schwarze@usta.de>
To: Alejandro Colomar <alx@kernel.org>
Cc: linux-man@vger.kernel.org
Subject: Re: configure separate from make or not
Date: Sat, 29 Aug 2026 17:31:32 +0200	[thread overview]
Message-ID: <apL7VAruk1bIOr1M@isnote.usta.de> (raw)
In-Reply-To: <apLV749V4YvfqCOZ@devuan>

[trimming Cc:, this starts becoming off-topic on the groff list;
 i'm not subscribed to linux-man@ though]

Hi Alejandro,

Alejandro Colomar wrote on Sat, Aug 29, 2026 at 03:10:25PM +0200:
> From: Ingo Schwarze <schwarze@usta.de>

> In the Linux man-pages, the configure step is done entirely within
> make(1) --there's no separate ./configure step--.  But as you say,
> a separate configure-only step is important for serious debugging.
> 
> The solution I implemented is a 'nothing' target in the Makefile, which
> as the name implies, does nothing.  However, it still runs the
> configuration step, since that runs as part of parsing the makefiles.

That sounds like a serious abuse of the parsing step to me.
I mean, the whole point of a parsing step is to do parsing and to
build dependency trees, but not to run code.  The purpose of the
execution phase of make(1) then is to run code, in an order determined
from the dependency tree.

> Here's the rule:
> 
> 	nothing:;
> 
> When I need to debug the build system itself, I run that target; often
> with special flags for debugging.  One common command I use when I need
> to do this kind of debugging is:
> 
> 	$ make -p nothing | less

The output of that command looks completely unreadable to me and
is of horrendous size:

   $ gmake -pR nothing | wc
  bash: line 1: gcc: command not found
  realpath: unknown option -- m
  usage: realpath [-q] file
  gmake: warning: undefined variable 'GNUMAKEFLAGS'
   34074  672611 27635924

Over 25 MB of configuration output?  Seriously?


> And if I need to see stderr output from the commands used by the
> configure scripts, here's a common command:
> 
> 	$ make HIDE_ERR= nothing
> 
> I'm not saying that this should be done, but this _can_ be done.  With
> BSD make(1), it might be more difficult to debug, since it doesn't have
> the -p flag.

It does.  From the OpenBSD make(1) manual:

   -p    Print a dump of the target rules and variables on stdout.  Do not
         build anything.

   -d flags
         Turn on debugging, and specify which portions of make are to
         print debugging information.  flags is one or more of the
         following:

         [only quoting the flags here, without the descriptions,
          for brevity]

         AacdDef g1 g2 hiklmnpqstTv

However, reading the output from a simple configure script is much
simpler than reading make(1) debugging output, for example:
 
   $ ./configure
  file config.log: writing...
  file configure.local: reading...
  tested operating system: OpenBSD -> OSENUM=MANDOC_OS_OPENBSD
  tested cc -W: tested noop: yes
  selected CFLAGS="-g -W -Wall -Wmissing-prototypes -Wstrict-prototypes -Wwrite-strings -Wno-unused-parameter"
  tested noop-static: yes
  selected STATIC="-static"
  tested attribute: yes
  tested cmsg: yes
  tested dirent-namlen: yes
  tested be32toh: yes
  tested be32toh-DSYS_ENDIAN: yes
  tested EFTYPE: yes
  tested err: yes
  tested getline: yes
  tested getsubopt: yes
  tested isblank: yes
  tested mkdtemp: yes
  tested mkstemps: yes
  tested nanosleep: yes
  tested ntohl: yes
  tested O_DIRECTORY: yes
  tested PATH_MAX: yes
  tested pledge: yes
  tested sandbox_init: no (compilation failed)
  tested progname: yes
  tested reallocarray: yes
  tested recallocarray: yes
  tested recvmsg: yes
  tested rewb-bsd: yes
  tested rewb-sysv: yes
  tested strcasestr: yes
  tested stringlist: no (compilation failed)
  tested strlcat: yes
  tested strlcpy: yes
  tested strndup: yes
  tested strptime: yes
  tested strsep: yes
  tested strtonum: yes
  tested unveil: yes
  tested vasprintf: yes
  tested fts-DFTS_COMPARE_CONST: no (compilation failed)
  tested fts: yes
  tested less: yes
  selected BINM_PAGER=less
  tested less -T: yes
  selected UTF8_LOCALE=en_US.UTF-8
  tested wchar-DUTF8_LOCALE="en_US.UTF-8": yes
  tested ohash: no (compilation failed)
  tested ohash-lutil: yes
  selected LDADD="   -lutil -lz"
  file config.h: written
  file Makefile.local: written

and then you can inspect config.h and Makefile.local for generated
settings and inspect config.log if serious debugging is needed.

 $ wc config.h Makefile.local config.log
      54     150    1326 config.h
      40     137    1026 Makefile.local
     305    1401   12998 config.log
     399    1688   15350 total

Even the "total" is half a permille of the output volume 
from the gmake -p you recommend - and that already includes *all*
the debugging information, whereas in your 25 MB of gmake -p output,
i was unable to find the reason why the build systems tries to use gcc(1)
even though i don't have GCC installed.  Generally, searching in that
monster is next to impossble because it contains very large numbers
of extremely long lines, each of which contains basically all the
words that one might possibly wish to search for.

> But the output from configure tests can still be read
> without building anything, with a dummy 'nothing' rule.

I briefly tried to read man-pages/GNUmakefile but quickly gave up
because it feels impossible to follow the control flow.
The program fails to explicitly say which targets it runs
with which dependencies, IMHO making it unreadable for a human.

Yours,
  Ingo

  reply	other threads:[~2026-08-29 15:31 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-03 19:21 [PATCH v4 2/4] man/man5/tunables.conf: Document system-wide tunables config DJ Delorie
2026-08-06 14:37 ` Alejandro Colomar
2026-08-06 15:33   ` DJ Delorie
2026-08-06 19:14     ` Alejandro Colomar
2026-08-06 20:17       ` DJ Delorie
2026-08-06 20:31         ` Alejandro Colomar
2026-08-06 20:42           ` DJ Delorie
2026-08-07  2:12             ` G. Branden Robinson
2026-08-07  3:29               ` DJ Delorie
2026-08-07  3:49                 ` G. Branden Robinson
2026-08-07  4:01                   ` DJ Delorie
2026-08-07  4:09                     ` G. Branden Robinson
2026-08-23 12:29               ` Using LS/LE (was: [PATCH v4 2/4] man/man5/tunables.conf: Document system-wide tunables config) Alejandro Colomar
2026-08-23 13:27                 ` G. Branden Robinson
2026-08-23 13:55                   ` Alejandro Colomar
2026-08-23 14:16                     ` G. Branden Robinson
2026-08-23 15:06                       ` Alejandro Colomar
2026-08-23 16:44                         ` G. Branden Robinson
2026-08-23 19:30                           ` Alejandro Colomar
2026-08-23 20:40                             ` G. Branden Robinson
2026-08-23 23:11                               ` Alejandro Colomar
2026-08-24  1:11                                 ` G. Branden Robinson
2026-08-24  2:01                                   ` Using LS/LE Collin Funk
2026-08-24 11:08                                     ` Alejandro Colomar
2026-08-24 11:00                                   ` Using LS/LE (was: [PATCH v4 2/4] man/man5/tunables.conf: Document system-wide tunables config) Alejandro Colomar
2026-08-23 22:31                             ` autotools, was: Using LS/LE Ingo Schwarze
2026-08-24  0:09                               ` Alejandro Colomar
2026-08-29  4:36                               ` G. Branden Robinson
2026-08-29 11:34                                 ` Ingo Schwarze
2026-08-29 12:51                                   ` Alejandro Colomar
2026-08-29 19:16                                     ` G. Branden Robinson
2026-08-29 21:43                                       ` Alejandro Colomar
     [not found]                             ` <8DE76435-CBDB-42D6-9E0F-9E27291560B6@icloud.com>
2026-08-29  8:42                               ` Using LS/LE (was: [PATCH v4 2/4] man/man5/tunables.conf: Document system-wide tunables config) Alejandro Colomar
2026-08-29  8:45                                 ` Alejandro Colomar
2026-08-29  8:52                                   ` Alejandro Colomar
2026-08-29  9:02                                     ` Alejandro Colomar
2026-08-29  9:39                               ` Ingo Schwarze
2026-08-29 13:10                                 ` configure separate from make or not (was: Using LS/LE) Alejandro Colomar
2026-08-29 15:31                                   ` Ingo Schwarze [this message]
2026-08-29 20:49                                     ` configure separate from make or not Alejandro Colomar
2026-08-30 13:17                                       ` Alejandro Colomar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=apL7VAruk1bIOr1M@isnote.usta.de \
    --to=schwarze@usta.de \
    --cc=alx@kernel.org \
    --cc=linux-man@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).