Re: XeTeX @image support

2016-01-05 Thread Masamichi HOSODA
> Here's a file that I ran with pdftex and with luatex: both worked.
> If this looks right, the code can be moved into texinfo.tex.
>>> 
>>> \ifx\XeTeXrevision\thisisundefined
>>> \else
>>> \XeTeXinputencoding "bytes"
>>> \fi
>>> 
>>> although I haven't been able to test this.
>> 
>> I've tried the attached file.
>> Both pdfTeX and XeTeX, it works fine in my environment.
>> Thank you.
> 
> I've noticed that XeTeX with texinfo.tex can not use @image.
> Here is a patch that I've tried to make.

It seems that \XeTeXpdffile changes input encoding.
So I add ``\XeTeXinputencoding "bytes"''.
--- texinfo.tex.org	2016-01-05 22:26:04.245558200 +0900
+++ texinfo.tex	2016-01-06 00:50:37.963751000 +0900
@@ -1449,6 +1449,48 @@
   \let\pdfmakeoutlines = \relax
 \fi  % \ifx\pdfoutput
 
+\ifx\XeTeXrevision\thisisundefined
+\else
+  \def\doxeteximage#1#2#3{%
+\def\xeteximagewidth{#2}\setbox0 = \hbox{\ignorespaces #2}%
+\def\xeteximageheight{#3}\setbox2 = \hbox{\ignorespaces #3}%
+%
+\let\xeteximgext=\empty
+\def\xeteximgpdf{0}
+\begingroup
+  \openin 1 #1.pdf \ifeof 1
+\openin 1 #1.PDF \ifeof 1
+  \openin 1 #1.png \ifeof 1
+\openin 1 #1.jpg \ifeof 1
+  \openin 1 #1.jpeg \ifeof 1
+\openin 1 #1.JPG \ifeof 1
+  \errmessage{Could not find image file #1 for XeTeX}%
+\else \gdef\xeteximgext{JPG}%
+\fi
+  \else \gdef\xeteximgext{jpeg}%
+  \fi
+\else \gdef\xeteximgext{jpg}%
+\fi
+  \else \gdef\xeteximgext{png}%
+  \fi
+\else \gdef\xeteximgext{PDF} \gdef\xeteximgpdf{1}%
+\fi
+  \else \gdef\xeteximgext{pdf} \gdef\xeteximgpdf{1}%
+  \fi
+  \closein 1
+\endgroup
+%
+\ifnum\xeteximgpdf=1
+  \XeTeXpdffile "#1".\xeteximgext ""
+\else
+  \XeTeXpicfile "#1".\xeteximgext ""
+\fi
+\ifdim \wd0 >0pt width \xeteximagewidth \fi
+\ifdim \wd2 >0pt height \xeteximageheight \fi \relax
+%
+\XeTeXinputencoding "bytes"
+  }
+\fi
 
 \message{fonts,}
 
@@ -9078,10 +9120,14 @@
   \ifpdf
 \dopdfimage{#1}{#2}{#3}%
   \else
-% \epsfbox itself resets \epsf?size at each figure.
-\setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \epsfxsize=#2\relax \fi
-\setbox0 = \hbox{\ignorespaces #3}\ifdim\wd0 > 0pt \epsfysize=#3\relax \fi
-\epsfbox{#1.eps}%
+\ifx\XeTeXrevision\thisisundefined
+  % \epsfbox itself resets \epsf?size at each figure.
+  \setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \epsfxsize=#2\relax \fi
+  \setbox0 = \hbox{\ignorespaces #3}\ifdim\wd0 > 0pt \epsfysize=#3\relax \fi
+  \epsfbox{#1.eps}%
+\else
+  \doxeteximage{#1}{#2}{#3}%
+\fi
   \fi
   %
   \ifimagevmode


XeTeX @image support (was Re: luatex problems with texinfo.tex)

2016-01-05 Thread Masamichi HOSODA
 Here's a file that I ran with pdftex and with luatex: both worked.
 If this looks right, the code can be moved into texinfo.tex.
>> 
>> \ifx\XeTeXrevision\thisisundefined
>> \else
>> \XeTeXinputencoding "bytes"
>> \fi
>> 
>> although I haven't been able to test this.
> 
> I've tried the attached file.
> Both pdfTeX and XeTeX, it works fine in my environment.
> Thank you.

I've noticed that XeTeX with texinfo.tex can not use @image.
Here is a patch that I've tried to make.
--- texinfo.tex.org	2016-01-05 22:26:04.245558200 +0900
+++ texinfo.tex	2016-01-06 00:15:56.681485800 +0900
@@ -1449,6 +1449,46 @@
   \let\pdfmakeoutlines = \relax
 \fi  % \ifx\pdfoutput
 
+\ifx\XeTeXrevision\thisisundefined
+\else
+  \def\doxeteximage#1#2#3{%
+\def\xeteximagewidth{#2}\setbox0 = \hbox{\ignorespaces #2}%
+\def\xeteximageheight{#3}\setbox2 = \hbox{\ignorespaces #3}%
+%
+\let\xeteximgext=\empty
+\def\xeteximgpdf{0}
+\begingroup
+  \openin 1 #1.pdf \ifeof 1
+\openin 1 #1.PDF \ifeof 1
+  \openin 1 #1.png \ifeof 1
+\openin 1 #1.jpg \ifeof 1
+  \openin 1 #1.jpeg \ifeof 1
+\openin 1 #1.JPG \ifeof 1
+  \errmessage{Could not find image file #1 for XeTeX}%
+\else \gdef\xeteximgext{JPG}%
+\fi
+  \else \gdef\xeteximgext{jpeg}%
+  \fi
+\else \gdef\xeteximgext{jpg}%
+\fi
+  \else \gdef\xeteximgext{png}%
+  \fi
+\else \gdef\xeteximgext{PDF} \gdef\xeteximgpdf{1}%
+\fi
+  \else \gdef\xeteximgext{pdf} \gdef\xeteximgpdf{1}%
+  \fi
+  \closein 1
+\endgroup
+%
+\ifnum\xeteximgpdf=1
+  \XeTeXpdffile "#1".\xeteximgext ""
+\else
+  \XeTeXpicfile "#1".\xeteximgext ""
+\fi
+\ifdim \wd0 >0pt width \xeteximagewidth \fi
+\ifdim \wd2 >0pt height \xeteximageheight \fi \relax
+  }
+\fi
 
 \message{fonts,}
 
@@ -9078,10 +9118,14 @@
   \ifpdf
 \dopdfimage{#1}{#2}{#3}%
   \else
-% \epsfbox itself resets \epsf?size at each figure.
-\setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \epsfxsize=#2\relax \fi
-\setbox0 = \hbox{\ignorespaces #3}\ifdim\wd0 > 0pt \epsfysize=#3\relax \fi
-\epsfbox{#1.eps}%
+\ifx\XeTeXrevision\thisisundefined
+  % \epsfbox itself resets \epsf?size at each figure.
+  \setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \epsfxsize=#2\relax \fi
+  \setbox0 = \hbox{\ignorespaces #3}\ifdim\wd0 > 0pt \epsfysize=#3\relax \fi
+  \epsfbox{#1.eps}%
+\else
+  \doxeteximage{#1}{#2}{#3}%
+\fi
   \fi
   %
   \ifimagevmode


Re: texinfo-6.0.91 pretest

2016-01-05 Thread Eli Zaretskii
> Cc: gavinsmith0...@gmail.com, bug-texinfo@gnu.org
> From: Ken Brown 
> Date: Tue, 5 Jan 2016 17:15:35 -0500
> 
> > I think the Windows ports will have to use PERL_EXT_LDFLAGS when
> > configuring Texinfo.
> 
> I tested this on Cygwin by doing
> 
> ./configure PERL_EXT_LDFLAGS='-L$(PERL_INC) -lperl'
> 
> and it worked.  Is this what you meant?

Yes.

> Or is there a way to set PERL_EXT_LDFLAGS on Cygwin by putting
> appropriate statements in configure.ac and/or Makefile.am?

You mean, by special-casing Cygwin and using these fixed flags?  It
should also be possible, although I'm not sure how necessary that
would be.



Re: texinfo-6.0.91 pretest

2016-01-05 Thread Ken Brown

On 1/2/2016 8:53 AM, Eli Zaretskii wrote:

Cc: gavinsmith0...@gmail.com, bug-texinfo@gnu.org
From: Ken Brown 
Date: Sat, 2 Jan 2016 08:31:26 -0500


-XSParagraph_la_LDFLAGS=-no-undefined -avoid-version -module 
$(PERL_CONF_cccdlflags)
+XSParagraph_la_LDFLAGS=-no-undefined -avoid-version -module 
$(PERL_CONF_cccdlflags) -L$(PERL_INC) -lperl


I don't think it's correct to use literally "-L$(PERL_INC) -lperl",
although it might be in many installations.  The correct values should
obtained from "perl -V:", and I already provided the
variables that should be used here.  E.g., if the user has Active Perl
installed, like I do, the "-lperl" part should be replaced with
"-lperl520" (for Perl 5.20.X).


On Cygwin, "perl -V:libperl" returns "libperl='cygperl5_22.dll';", but
you wouldn't guess from this that you should use "-lperl" for linking
(i.e., the actual import library is libperl.dll.a).


That's an unfortunate choice by the Cygwin Perl maintainers, I'd say.
Why isn't the import library named libcygperl.dll.a or something
similar?


Moreover, on Posix hosts I'm not sure it's TRT to link against
libperl.a, as that's a static library, and Unix doesn't need import
libraries to link against shared libraries at run time.


Are you sure that using -lperl on Posix hosts would link against
libperl.a rather than libperl.so?  I thought the whole point of the '-l'
was so that the linker would choose the appropriate library, depending
on the context.


You may be right.  I think we need to talk to a Perl expert (which I
am not).

I think the Windows ports will have to use PERL_EXT_LDFLAGS when
configuring Texinfo.


I tested this on Cygwin by doing

   ./configure PERL_EXT_LDFLAGS='-L$(PERL_INC) -lperl'

and it worked.  Is this what you meant?  Or is there a way to set 
PERL_EXT_LDFLAGS on Cygwin by putting appropriate statements in 
configure.ac and/or Makefile.am?  I made several attempts, but they all 
failed.  My knowledge of autotools is pretty limited.


Ken