Enrico Forestieri a écrit :
Abdelrazak Younes <[EMAIL PROTECTED]> writes:
Success! I managed to compile everything (qt4) without MSYS. There two
small problem though:
1) I have to use -sysdir option because the generated executable look
for an inexistant directory:
$ ./lyx-qt4
Unable to determine the system directory having searched
d:/msys/home/yns/lyx/trunk/share/lyx-svn/
Try the '-sysdir' command line parameter or set the environment variable
LYX_DIR_14x to the LyX system directory containing the file `chkconfig.ltx'.
That also happened to me once, when I tried running LyX in place.
However, after installation I had no problems. If I remember correctly,
it was immediately after the switch from ...\Resources\lyx to ...\Resources
so, perhaps this is the case with you, too. If not, see below.
I don't see this problem anymore, so may be it was due to not updated
configuration files.
2) I had to hack the source code in order to replace '/tmp' with
'c:/temp' because lyx tells me it cannot write the '/tmp' directory.
Except for that I am happy to report that I cannot see any difference
with the lyx I generated within MSYS. Except that the executable is
smaller (12Mo instead of 19Mo) and that the compilation is faster.
This may simply be due to the fact that mingw executables are to be
stripped. I don't see any significant difference in size between a
mingw and a cygwin LyX.
Enrico, if you have any hint for the problems above...
Well, if '/tmp' is present in the source code, this is a bug with a
native LyX and you have no choice but replacing it with a proper path,
probably protecting the change using an #ifdef.
I have replace those 'tmp' with 'c:/temp' in the code:
[EMAIL PROTECTED] /cygdrive/d/msys/home/yns/lyx/trunk/src
$ grep '/tmp' *.[Ch]
bufferlist.C: s = AddName(MakeAbsPath("/tmp/"), buf->fileName());
lyxrc.C: tempdir_path = "/tmp";
[EMAIL PROTECTED] /cygdrive/d/msys/home/yns/lyx/trunk/src/support
$ grep -r '/tmp' *.[Ch]
filetools.C: if (!deflt.empty() && deflt != "/tmp") {
filetools.C: return createTmpDir("/tmp",
"lyx_tmpdir");
filetools.C: return createTmpDir("/tmp", "lyx_tmpdir");
package.C: return "/tmp";
package.h: * (Eg /tmp on *nix.)
path.h: * Path p("/tmp/blah");
path.h:// Path("/tmp"); // wrong
path.h:// Path p("/tmp"); // right
Could someone knowledgeable tell me how to fix this cleanly? The temp
directory is accessible via the user settings. Why does lyx exits if it
doesn't find it? It could instead switch to no-temp directory, couldn't it?
But it may be a configuration problem. All cygwin tools use posix syntax
by default, so care must be taken when generating Makefiles if they are
meant for building a native version of LyX.
For example, when invoking 'configure', you should use
--prefix=C:/Programs/LyX instead of --prefix=/c/Programs/LyX,
but it is safe using --with-extra-prefix=/c/MinGW.
Yep I used 'c:/' like syntax. But the --with-extra-prefix never worked
for me, with either c:/ or /c/ style. configure just stops telling that
it cannot find 'c' directory even though it was there.
Another problem can arise when a path is autogenerated by configure.
There is some code in the configure script that turns 'C:/Programs/LyX'
into '/c/Programs/LyX' (or '/cygdrive/c/Programs/LyX', depending on your
settings), so I had to add the following to the sed command I use for
modifying configure:
# Set locale and data dir in mixed rather than posix format
/^ *LYX_ABS_INSTALLED/s/\(^ *\)/\1ac_val=`cygpath -m \"\$ac_val\"`\n\1/
otherwise I get '/c/Programs/LyX/Resources/locale' hardcoded into the
executable instead of 'C:/Programs/LyX/Resources/locale', and the net
effect would be that setting LANG to some locale doesn't work.
Thinking about it, perhaps this is the reason (hardcoded path) why
Angus reports that setting LANG seems not working in mingw builds.
Wouldn't it make sense to fix it in svn instead of doing manually the
change? I am sure they would accept your patch.
However, this is the only problem that I spotted. To be honest there
was another one, but it was about the recognition of a multi-threaded
Qt. For some reason the default test program used in configure:
I have heard about this one from Michael Gerz IIRC. I am using Qt4 so
oviously I don't have this problem :-)
I think that's all. The native LyX I compile using cygwin is fully
functional and until now I have seen no side effects.
IMHO cygwin is a much better environment than MSYS and we should switch
to that if we manage to fix those problems.
Thanks for the help Enrico,
Abdel.