westes / flex

The Fast Lexical Analyzer - scanner generator for lexing in C and C++
Other
3.56k stars 533 forks source link

Using help2man to generate manpages does not work when cross-compiling #560

Closed th-otto closed 1 year ago

th-otto commented 1 year ago

In the doc directory, help2man is used to generate the manpage. help2man executes the binary and parses its output; obviously that doesn't work when cross-compiling. Luckily, when cross-compiling, flex already has a binary for the host. Attached patch fixes the Makefile to use that instead.

(the patch is against the source of the last official 2.6.4 release, and might need adjustments for current source, but its minimal)

--- a/doc/Makefile.am   2023-04-07 09:32:49.975936180 +0200
+++ b/doc/Makefile.am   2023-04-07 09:33:47.699833005 +0200
@@ -1,4 +1,8 @@
+if CROSS
+FLEX = $(top_builddir)/src/stage1flex
+else
 FLEX = $(top_builddir)/src/flex$(EXEEXT)
+endif

 info_TEXINFOS =    flex.texi
 dist_man_MANS = flex.1
westes commented 1 year ago

Thanks for this -- good catch. It's merged to master now.

th-otto commented 1 year ago

That was quick ;) thanks.

BTW, imho its a bit useless to use help2man to provide a manpage. It won't give any information that is not already available by running flex --help. But flex is not the only package where that is done ;)

westes commented 1 year ago

The purpose of help2man isn't to provide additional information. It is to make having a current man page happen automatically.