Here's some notes of my experiences trying to build LyX on Windows having
applied my 'packaging' patch which itself contains Jean-Marc's changes to
the configuration stuff.
Executive summary: with a little tweaking it works --- almost. By which I
mean, I can create a LyX executable that does all the right things (so far
I've only tried to run it from the build directory) but 'make install' is
failing at the moment. Spaces in paths...
Ececutive opinion: I'm sure that we can iron out the remaining problems,
and we can do so from the *nix side. It's just a case of testing with
"configure --prefix='/usr/local/Program Files/LyX'". Life goes by soooo
slooowwwly on Windows.
--
Angus
Experiences with configure under MinGW/MinSys
=============================================
1. Running configure without specifying "--with-packaging=windows"
results in Posix-style packaging. (Adding this option did result
in Windows-style packaging.) Without specifying the packaging
option explicitly:
$ ../configure --enable-maintainer-mode --with-version-suffix --with-included-g
ettext --with-frontend=qt --with-qt-dir=/home/angus/qt3 --with-qt-libraries=/ho
me/angus/qt3/lib --with-qt-includes=/home/angus/qt3/include
Configuration
Host type: i686-pc-mingw32
Special build flags: warnings assertions
C Compiler: gcc
C Compiler flags: -g -O2
C++ Compiler: g++ (3.4.2)
C++ Compiler flags: -g -O -W -Wall -mms-bitfields
Linker flags: -Wl,--export-all-symbols
Frontend: qt
Qt version: 3.3.3
Packaging: posix
LyX binary dir: /usr/local/bin
LyX files dir: /usr/local/share/lyx-1.3.6cvs
It appears that the problem lies in here in lyxinclude.m4
case $host in
*-apple-darwin*) lyx_use_packaging=macosx ;;
*-pc-mingw32-*) lyx_use_packaging=windows;;
*) lyx_use_packaging=posix;;
Note the trailing '-' after '-pc-mingw32'. Removing it leads to:
$ ../configure --enable-maintainer-mode --with-version-suffix --with-included-g
ettext --with-frontend=qt --with-qt-dir=/home/angus/qt3 --with-qt-libraries=/ho
me/angus/qt3/lib --with-qt-includes=/home/angus/qt3/include
[ snip ]
Packaging: windows
LyX binary dir: C:/Program Files/LyX/bin
LyX files dir: C:/Program Files/LyX/Resources/lyx-1.3.6cvs
Interestingly, however, all is not yet well:
configure: configuring in lib/reLyX
configure: running /bin/sh '../../../lib/reLyX/configure' --prefix=C:/Program
Files/LyX '--enable-maintainer-mode' '--with-version-suffix=-1.3.6cvs'
'--with-included-gettext' '--with-frontend=qt' '--with-qt-dir=/home/angus/qt3'
'--with-qt-libraries=/home/angus/qt3/lib'
'--with-qt-includes=/home/angus/qt3/include' --cache-file=/dev/null
--srcdir=../../../lib/reLyX
configure: WARNING: you should use --build, --host, --target
configure: WARNING: invalid host type: Files/LyX
checking whether to enable maintainer-specific portions of Makefiles... yes
Why is the "--prefix=C:/Program Files/LyX" argument unquoted,
especially given that all others are quoted as expected?
Change the default_prefix stuff in lyxinclude.m4:
- default_prefix="C:/Program Files/LyX"
+ default_prefix="'C:/Program Files/LyX'"
Perfect:
configure: configuring in lib/reLyX
configure: running /bin/sh '../../../lib/reLyX/configure' --prefix='C:/Program
Files/LyX' '--enable-maintainer-mode' '--with-version-suffix=-1.3.6cvs'
'--with-included-gettext' '--with-frontend=qt' '--with-qt-dir=/home/angus/qt3'
'--with-qt-libraries=/home/angus/qt3/lib'
'--with-qt-includes=/home/angus/qt3/include' --cache-file=/dev/null
--srcdir=../../../lib/reLyX
checking whether to enable maintainer-specific portions of Makefiles... yes
and the packaging remains correct.
[ snip ]
Packaging: windows
LyX binary dir: C:/Program Files/LyX/bin
LyX files dir: C:/Program Files/LyX/Resources/lyx-1.3.6cvs
Just to check that 'version.C' is happy too:
$ cat src/version.C
[ snip ]
Frontend: qt\n
Qt version: 3.3.3\n
Packaging: windows\n
LyX binary dir: C:/Program Files/LyX/bin\n
LyX files dir: C:/Program
Files/LyX/Resources/lyx-1.3.6cvs\n";
2. Specifying a different ${PREFIX}
$ ../configure --prefix='J:/Program Files/LyX' ...
Hmmm. Interesting. Notice the extra --prefix arg passed to
the reLyX configure script:
configure: running /bin/sh '../../../lib/reLyX/configure' --prefix=J:/Program
Files/LyX '--prefix=J:/Program Files/LyX' '--enable-maintainer-mode'
'--with-version-suffix=-1.3.6cvs' '--with-included-gettext'
'--with-frontend=qt' '--with-qt-dir=/home/angus/qt3'
'--with-qt-libraries=/home/angus/qt3/lib'
'--with-qt-includes=/home/angus/qt3/include' --cache-file=/dev/null
--srcdir=../../../lib/reLyX
configure: WARNING: you should use --build, --host, --target
configure: WARNING: invalid host type: Files/LyX
checking whether to enable maintainer-specific portions of Makefiles... yes
The first is unquoted, leading to these WARNING messages.
The second is fine.
Packaging is correct:
[ snip ]
Packaging: windows
LyX binary dir: J:/Program Files/LyX/bin
LyX files dir: J:/Program Files/LyX/Resources/lyx-1.3.6cvs
I don't know how to tackle that.
3. Using a wrapper script to invoke configure
The script.
#! /bin/sh
cd build-qt
../configure --prefix='J:/Program\ Files/LyX' \
--enable-maintainer-mode --with-version-suffix \
--with-included-gettext --with-frontend=qt \
--with-qt-dir=$QTDIR --with-qt-libraries=$QTDIR/lib \
--with-qt-includes=$QTDIR/include
Compilation succeeds.
Installation fails:
/bin/sh `case "../config/mkinstalldirs" in /*) echo "../config/mkinstalldirs"
;; *) echo "../../config/mkinstalldirs" ;; esac` J:/Program\
Files/LyX/Resources/locale; \
test -f J:/Program\ Files/LyX/Resources/locale/locale.alias \
&& orig=J:/Program\ Files/LyX/Resources/locale/locale.alias \
|| orig=../../intl/locale.alias; \
temp=J:/Program\ Files/LyX/Resources/locale/t-locale.alias; \
dest=J:/Program\ Files/LyX/Resources/locale/locale.alias; \
sed -f ref-add.sed $orig > $temp; \
/bin/install -c -m 644 $temp $dest; \
rm -f $temp; \
else \
: ; \
fi
mkdir J:/Program
mkdir J:/Program/Files
mkdir J:/Program/Files/LyX
mkdir J:/Program/Files/LyX/lib
/bin/sh: J:/Program Files/LyX/lib/t-charset.alias: No such file or directory
/bin/install: installing multiple files, but last argument,
`Files/LyX/lib/charset.alias' is not a directory
Try `/bin/install --help' for more information.
rm: `J:/Program' is a directory
mkdir J:/Program/Files/LyX/Resources
mkdir J:/Program/Files/LyX/Resources/locale
/bin/sh: J:/Program Files/LyX/Resources/locale/t-locale.alias: No such file or
directory
/bin/install: installing multiple files, but last argument,
`Files/LyX/Resources/locale/locale.alias' is not a directory
Try `/bin/install --help' for more information.
rm: `J:/Program' is a directory
make[1]: *** [install-exec] Error 1
make[1]: Leaving directory `/home/Angus/lyx-13x/build-qt/intl'