Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pdf support is incomplete #537

Open
dctaylor87 opened this issue Jul 29, 2022 · 20 comments
Open

pdf support is incomplete #537

dctaylor87 opened this issue Jul 29, 2022 · 20 comments

Comments

@dctaylor87
Copy link

Attempting to build flex.pdf fails.

Here's a patch to configure.ac to fix it so that 'make pdf' works:

diff --git a/configure.ac b/configure.ac
index 9b5afd2..5eed27a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -95,7 +95,12 @@ AC_PATH_PROG([HELP2MAN], help2man, [${top_srcdir}/build-aux/missing help2man])

AC_PATH_PROGS([TEXI2DVI], [gtexi2dvi texi2dvi], [${top_srcdir}/build-aux/missing texi2dvi])
AS_IF([test "$TEXI2DVI" = "${top_srcdir}/build-aux/missing texi2dvi"],

  • AC_MSG_WARN(texi2dvi: program not found: building pdf version of manual will not work)
  • AC_MSG_WARN(texi2dvi: program not found: building dvi version of manual will not work)
  • )

+AC_PATH_PROGS([TEXI2PDF], [gtexi2pdf texi2pdf], [${top_srcdir}/build-aux/missing texi2pdf])

  • AS_IF([test "$TEXI2PDF" = "${top_srcdir}/build-aux/missing texi2pdf"],
  • AC_MSG_WARN(texi2pdf: program not found: building pdf version of manual will not work)
    )

Check for a m4 that supports -P

@wendajiang
Copy link

Thanks! It's help.
And I want to offer my question and how to resolve.

System is MacOS 12.4

make pdf throw error:

texi2dvi: Can't use option `--output' with more than one argument.

and run brew install texinfo to intall the newest version of texinfo toolset. It's work.

@musvaage
Copy link
Contributor

musvaage commented Mar 12, 2023

OP's code sample wasn't enclosed to render patch syntax.

```patch

```

Since opening this issue the file has been changed.

$ date
Sun Mar 12 22:06:04 CET 2023
$ git clone -q https://github.com/westes/flex.git
$ ed -s flex/configure.ac <<<'118,123p'
AC_PATH_PROGS([TEXI2DVI], [gtexi2dvi texi2dvi], [\${top_srcdir}/build-aux/missing texi2dvi])
  AS_IF([test "$TEXI2DVI" = "\${top_srcdir}/build-aux/missing texi2dvi"],
    AC_MSG_WARN(texi2dvi: program not found: building pdf version of manual will not work)
  )

# Check for a m4 that supports -P
$ 

I am neither going to comment on any merits of this Issue nor on whether a patch is needed.

@dctaylor87
Copy link
Author

FYI, I am not a flex maintainer, nor do I have a Mac. I use GNU/Linux.

I just updated my clone of the GitHub flex repository and checked configure.ac. I noticed that changes have been made to the file, but my patch has not been applied (nor has PDF support been otherwise fixed).

If I correctly understand wendajiang's posting, her problem was solved by updating texinfo -- which suggests to me that configure.ac should either have a version check (I do not know when the required support was added to texinfo) or it should check to see if texi2dvi has the needed support.

Good luck,
David

@musvaage
Copy link
Contributor

workaround

clone repo and cd to flex directory

./autogen.sh && ./configure

sed -i "s#@TEXI2PDF@#/usr/bin/texi2pdf#g" doc/Makefile

make pdf

@Mightyjo
Copy link
Contributor

The make pdf target is meant to be called from distribution sources. Have you tried running make distcheck to get a distro tarball, then expanding it and trying these targets in that folder?

That part of the build system has been stable since 2.6.4 if you want to download a ready tarball for testing.

@musvaage
Copy link
Contributor

MacOS 12.4

possibly @wendajiang was using 2.6.4 (released on May 6, 2017)

adding a version check based on a coder's use of brew seems excessive

GNU/Linux

as per last comment of @dctaylor87 it's possibly inferred that the OP was using a clone prior to opening this ticket


flex.dvi and (as per my last comment) flex.pdf build on my Slackware box

$ ls /var/log/packages | grep texinfo
texinfo-6.8-x86_64-3
$ 

@musvaage
Copy link
Contributor

musvaage commented Mar 16, 2023

stable since 2.6.4

$ tar xf flex-2.6.4.tar.gz
$ cd flex-2.6.4 && ./configure -silent
config.status: creating po/POTFILES
config.status: creating po/Makefile
$ 

running thereafter make pdf successfully builds flex.pdf

absent any other comments possibly this ticket can be closed as resolved

@dctaylor87
Copy link
Author

Okay. I just tried that. Did a 'make distcheck' Took the tarball, untarred it into /tmp/flex-2.6.4. Did './configure' and then
ran 'make pdf'. Here's the output:
taylor@bloomington:/tmp/flex-2.6.4$ make pdf
Making pdf in src
make[1]: Entering directory '/tmp/flex-2.6.4/src'
make[1]: Nothing to be done for 'pdf'.
make[1]: Leaving directory '/tmp/flex-2.6.4/src'
Making pdf in doc
make[1]: Entering directory '/tmp/flex-2.6.4/doc'
TEXINPUTS="../build-aux:$TEXINPUTS"
MAKEINFO='/bin/bash '/tmp/flex-2.6.4/build-aux/missing' makeinfo -I ./../examples/manual/ -I .'
@TEXI2PDF@ -I ./../examples/manual/ --build-dir=flex.t2p -o flex.pdf
flex.texi
/bin/bash: line 1: @TEXI2PDF@: command not found
make[1]: *** [Makefile:444: flex.pdf] Error 127
make[1]: Leaving directory '/tmp/flex-2.6.4/doc'
make: *** [Makefile:545: pdf-recursive] Error 1
taylor@bloomington:/tmp/flex-2.6.4$ which makeinfo
/usr/bin/makeinfo
taylor@bloomington:/tmp/flex-2.6.4$ which texi2pdf
/usr/bin/texi2pdf
taylor@bloomington:/tmp/flex-2.6.4$

As you can see, makeinfo and texi2pdf are installed. But, 'make pdf' failed.

As to my suggestion about a version check for wendajiang's problem. It's not brew specific. if the build requires a feature that is only available in recent releases of a command, it is not unreasonable to check if the version installed is recent enough.

@Mightyjo
Copy link
Contributor

Mightyjo commented Mar 17, 2023 via email

@musvaage
Copy link
Contributor

musvaage commented Mar 18, 2023

$ grep texi2dvi $(which texi2pdf)
# Execute texi2dvi --pdf.
texi2dvi --pdf ${1+"$@"}
$ grep pdflatex $(which texi2dvi) | sed 1q
  -p, --pdf     use pdftex or pdflatex for processing
$ file $(which pdflatex)
/usr/bin/pdflatex: symbolic link to pdftex
$ 

@dctaylor87
Copy link
Author

dctaylor87 commented Mar 20, 2023 via email

@musvaage
Copy link
Contributor

Ubuntu 22.04 (LTS)

I don't have access to that distribution and version.

$ pdftex --version | sed 1q
pdfTeX 3.141592653-2.6-1.40.22 (TeX Live 2021 on Slackware)
$ 

texlive-2021.210418-x86_64-2.txz

Slackware's texlive is a single package whereas .deb and .rpm based distributions typically use multiple packages.

@dctaylor87
Copy link
Author

'pdftex --version | sed 1q' returns:
pdfTeX 3.141592653-2.6-1.40.22 (TeX Live 2022/dev/Debian)

I have TeX installed and have previously used it to produce PDF files using texi2pdf. With the small patch that I posted I was able to produce PDF from flex's texinfo file.

@Mightyjo
Copy link
Contributor

Mightyjo commented Mar 21, 2023 via email

@musvaage
Copy link
Contributor

musvaage commented Mar 26, 2023

#537 (comment)

@srivasta

Are you able to successfully build flex.pdf?

@dctaylor87
Copy link
Author

Sorry for the delay. If I take the 2.6.4 tarball, configure it, and say 'make pdf', it succeeds.
But, if I take the top of the master branch, do a 'make distcheck', untar it in a clean directory, configure it, and then do a 'make pdf', it fails. So, something has changed to break it. If I apply my posted patch, it succeeds.

@musvaage
Copy link
Contributor

musvaage commented Mar 30, 2023

Why are there 3 AC_MSG_WARN macros in the opening post?

@dctaylor87
Copy link
Author

dctaylor87 commented Mar 31, 2023 via email

@Mightyjo
Copy link
Contributor

Mightyjo commented Mar 31, 2023 via email

@musvaage
Copy link
Contributor

I posted the patch

#537 (comment)

with syntax highlighting

It's easier to read a patch by posting its content enclosed in three backticks with GH Linguist patch designation.

without syntax highlighting

It's easier to read a patch by simply posting the shell output of cat my.patch enclosed in three backticks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants