#!/bin/sh
#
# Installed MinGW needed.
-# Ubuntu : sudo apt-get install gcc-mingw-w64-i686
+# Ubuntu :
+# sudo apt-get install g++-mingw-w64-i686
+# sudo update-alternatives --set i686-w64-mingw32-gcc /usr/bin/i686-w64-mingw32-gcc-posix
+# sudo update-alternatives --set i686-w64-mingw32-g++ /usr/bin/i686-w64-mingw32-g++-posix
lyxsrcdir=$1
builddir=$PWD
+# ---------------------------------------------------------
+# set 'versionname' to overwrite generated one based on 'ver'
+#
+ver=2.3
date=`date --utc '+%Y.%m.%d-%H.%M'`
-versionname=LyX$ver-$date
+if [ -z $versionname ]; then
+ versionname=LyX$ver-$date
+fi
echo ---------------------------------------------------------
# build LyX
#
-#mergefile=-DLYX_MERGE_FILE
+mergefile=-DLYX_MERGE_FILES=0
#pch=-DLYX_PCH=1
-$cmakebin $lyxsrcdir \
+cmake $lyxsrcdir \
+ -DCMAKE_VERBOSE_MAKEFILE=1 \
-DLYX_CPACK=1 \
-DLYX_PROGRAM_SUFFIX="" \
-DLYX_CONSOLE=FORCE \
-DLYX_XMINGW=$compiler \
-DLYX_USE_QT=QT5 \
-DLYX_QUIET=1 \
- -DLYX_ENABLE_CXX11=1 \
-DLYX_HUNSPELL=1 \
-DLYX_3RDPARTY_BUILD=1 \
$pch $mergefile
checkExitCode
-#processors=2
-make -j $processors
-checkExitCode
+processors=3
+lyxmake() {
+ make -j$processors $1
+ checkExitCode
+}
+
+lyxmake translations
+lyxmake doc
+lyxmake LyX
+lyxmake tex2lyx
+make install
+checkExitCode
# ---------------------------------------------------------