On Thu, Mar 30, 2006 at 11:01:29AM +0200, Abdelrazak Younes wrote:
> Enrico Forestieri a écrit :
> >I have reviewed all (I think) possible problems related to paths in
> >cygwin. The attached is the patch I come up with. I hope that it can
> >be applied for 1.4.1 as it doesn't harm the other targets and is
> >really needed for cygwin.
> 
> Hello Enrico,
> 
> Having had a (quick) look at your patch, it seems that some (most?) of 
> your patch would be of benefit to non-cygwin windows user. At least they 
> wouldn't hurt. I am in favor of getting rid of the "#ifdef __CYGWIN__" 
> in code and creates a universal Windows binary that will work equally 
> good (via a setting) within a Cygwin environment or not.
> 
> What do you think?

That indeed would be great, but I think that the cygwin target has
some peculiarities not easily mimicked by a native build.

For example, the "Use Cygwin-style paths" checkbox could also be
provided for the plain win32 build, but, apart from the fact that
the routines converting between path styles should be someway
designed (they are provided by cygwin), there's a problem here.

Indeed, if in a native build you use cygwin style paths, you are
obliged to use only cygwin apps, as the native ones will not
understand posix syntax. On the contary, with a cygwin build you
can use both path styles, as cygwin apps also understand plain
win32 style (it is more likely that if you use cygwin, you also
have all cygwin apps).

However, IMO, the cygwin_path_fix switch should also be used in
os_win32.C to decide what kind of paths are to be output to .tex
files, as a user should not be forced to use miktex.

This is easy to do, as it simply involves changing "C:/xxx" to
"/cygdrive/c/xxx" in os:latex_path and in os:internal_path when
it is passed os::LATEX_FILE.

The problem here would be that the "/cygdrive" prefix could be
changed to anything else by the user in cygwin (unlikely but not
impossible). Another problem is converting from posix to win32
style the absolute paths found in a .lyx file (perhaps produced
by a cygwin LyX using cygwin-style paths), if such paths are
relative to the cygwin root. For example, "/home/user/xxx" should
be converted to "<cygwin_root>/home/user/xxx" and you should know
what <cygwin_root> is (this info is stored in the registry, however).

So, I agree with you that a part of the fix can also be applied
to the plain win32 target, but I do not think that we can avoid
all the "#ifdef __CYGWIN__" switches.

I think I can also tweak os_win32.C, but I do not dare to do that
without permission. I dared to modify the cygwin target because it
was my impression that it was being left behind and I didn't want
it going down the sink like the OS2 target...

-- 
Enrico

Reply via email to