#! /bin/sh
-# This script aims to do averything necessary to automate the building
+# This script aims to do everything necessary to automate the building
# of a LyX/Win package.
# Invocation:
# sh build_lyxwin.sh "1.3.6-pre23"
# The string will be shown in the "About LyX" dialog.
-# This script is written as a bunch of subroutines. You'll probably
-# only need to build a couple of the packages (dtl, aspell) once.
-# Thereafter, the invocation of these subroutines can be commented out.
-# (See the end of the script.)
-
# Notes:
-# It uses the MinGW/MinSYS environment and compiler.
+# It uses the MSYS environment and MinGW compiler.
# It asks whether the Qt and LyX cvs trees are up to date.
# It asks whether the Qt library has been compiled.
-# It checks that qt-mt3.dll, libiconv-2.dll,
-# mingw10.dll and clean_dvi.py exist.
+# It checks that qt-mt3.dll and mingw10.dll exist.
# It compiles the dv2dt and dt2dv utilites.
-# It compiles and installs the Aspell library.
# It compiles and installs LyX.
-# It copies the dv2dt and dt2dv utilites, the .dlls and
-# clean_dvi.py to the lyx package.
-# It modifies the Resources/lyx/configure script to
-# ensure that the generated .dvi file is usable.
# Once all this is done, you're ready to "package" LyX.
# See the README for details.
-# The script compiles the .dll version of the Qt libraries. Linking of lyx
+# The script compiles the .dll version of the Qt libraries. Linking of LyX
# against this will, therefore, take "some time".
-# It compiles the static version of the Aspell libraries because no
-# .dll version exists.
-
# You may need to change these four variables.
MINGW_DIR="/j/MinGW"
-QT_DIR="${HOME}"/qt3
-ASPELL_DIR="${HOME}"/aspell-0.50.5
-# A space-separated string of directories
-# ASPELL_DICT_DIRS="${HOME}/aspell-en-0.50-2 ${HOME}/aspell-de-0.50-2 "
-ASPELL_DICT_DIRS="${HOME}/aspell-en-0.50-2"
+QT_DIR="${HOME}"/Qt/3x-msys
# Everything from here on down should be OK "as is".
LYX_DIR="../../.."
PACKAGING_DIR="$LYX_DIR/development/Win32/packaging"
DTL_DIR="$PACKAGING_DIR/dtl"
-CLEAN_DVI_DIR="$PACKAGING_DIR"
ASPELL_INSTALL_DIR="c:/Aspell"
LYX_ASPELL_DIR="/c/Aspell" # the Autotools don't like "C:/" syntax.
# These are all installed in the final LyX package
QT_DLL="${QT_DIR}/bin/qt-mt3.dll"
-LIBICONV_DLL="${MINGW_DIR}/bin/libiconv-2.dll"
MINGW_DLL="${MINGW_DIR}/bin/mingwm10.dll"
DT2DV="${DTL_DIR}/dt2dv.exe"
DV2DT="${DTL_DIR}/dv2dt.exe"
-CLEAN_DVI_PY="${CLEAN_DVI_DIR}/clean_dvi.py"
# Change this to 'mv -f' when you are confident that
# the various sed scripts are working correctly.
check_dirs_exist()
{
- for dir in "$QT_DIR" "$ASPELL_DIR" "$LYX_DIR" "$DTL_DIR"
+ for dir in "$QT_DIR" "$LYX_DIR" "$DTL_DIR"
do
test -d "$dir" || {
echo "$dir does not exist" >&2
check_files_exist()
{
- # Check that the dlls and clean_dvi.py exist
- for file in "${QT_DLL}" "${LIBICONV_DLL}" "${MINGW_DLL}" "${CLEAN_DVI_PY}"
+ # Check that the dlls exist
+ for file in "${QT_DLL}" "${MINGW_DLL}"
do
test -r "${file}" || {
echo "$file does not exist" >&2
}
-build_aspell()
-{
- # Aspell
- (
- cd "$ASPELL_DIR" || {
- echo "Unable to cd $ASPELL_DIR" >&2
- exit 1
- }
-
- ./configure --enable-static --disable-shared --prefix="${ASPELL_INSTALL_DIR}" --sysconfdir="${ASPELL_INSTALL_DIR}" --enable-docdir="${ASPELL_INSTALL_DIR}/doc" --datadir="${ASPELL_INSTALL_DIR}/data" --enable-pkgdatadir="${ASPELL_INSTALL_DIR}/data" --enable-dict-dir="${ASPELL_INSTALL_DIR}/dict" --enable-win32-relocatable || {
- echo "Failed to configure $ASPELL_DIR" >&2
- exit 1
- }
-
- # We have to clean up two of the generated Makefiles.
- TMP=tmp.$$
- MAKEFILE=examples/Makefile
- sed '
-# Replace "CC = gcc" with "CC = g++"
-s/^ *\(CC *= *\)gcc *$/\1g++/
-# Remove trailing "/" from the -I directory.
-s@^ *\(INCLUDES *= *-I\${top_srcdir}/interfaces/cc\)/ *$@\1@
-' "${MAKEFILE}" > "${TMP}"
- cmp -s "${MAKEFILE}" "${TMP}" && {
- echo "${MAKEFILE} is unchanged" 2>&1
- } || {
- diff -u "${MAKEFILE}" "${TMP}"
- ${MV} "${TMP}" "${MAKEFILE}"
- }
- rm -f "${TMP}"
-
- MAKEFILE=prog/Makefile
- sed '
-# Remove trailing "/" from the -I directories.
-/^ *INCLUDES *= *-I\${top_srcdir}\/common/{
-:loop
-$!{
-N
-/\n *$/!bloop
-}
-s@/ *\(\\ *\n\)@ \1@g
-}' "${MAKEFILE}" > "${TMP}"
- cmp -s "${MAKEFILE}" "${TMP}" && {
- echo "${MAKEFILE} is unchanged" 2>&1
- } || {
- diff -u "${MAKEFILE}" "${TMP}"
- ${MV} "${TMP}" "${MAKEFILE}"
- }
- rm -f "${TMP}"
-
- make || {
- echo "Failed to make $ASPELL_DIR" >&2
- exit 1
- }
-
- rm -fr "$ASPELL_INSTALL_DIR" || {
- echo "Failed to remove $ASPELL_INSTALL_DIR prior to installing Aspell" >&2
- exit 1
- }
-
- make install || {
- echo "Failed to install $ASPELL_DIR" >&2
- exit 1
- }
- )
-}
-
-
-build_aspell_dicts()
-{
- (
- PATH="${LYX_ASPELL_DIR}:$PATH"
- export PATH
-
- for dir in $ASPELL_DICT_DIRS
- do
- (
- cd $dir
- ./configure
- make
- make install
- )
- done
- )
-
-}
-
modify_version_C()
{
VERSION_C="src/version.C"
}
-build_lyx()
+run_automake()
{
(
cd "${LYX_DIR}" || {
# Check the line endings of configure.ac
# The configure script will be unable to create config.h if it
# contains Win32-style line endings.
- rm -f configure.ac
- sed 's/\r$//' config/configure.ac > configure.ac.$$
- cmp -s config/configure.ac configure.ac.$$ && {
+ sed 's/\r$//' configure.ac > configure.ac.$$
+ cmp -s configure.ac configure.ac.$$ && {
rm -f configure.ac.$$
} || {
- mv -f configure.ac.$$ config/configure.ac
- echo 'configure.ac has Win32-style line endings. Corrected' >&2
+ mv -f configure.ac.$$ configure.ac
+ cat <<EOF >&2
+configure.ac has Win32-style line endings. Corrected
+Please use the Cygwin flavours of the autotools to
+run autogen.sh
+EOF
+ exit 1
}
- ./autogen.sh || {
- echo "autogen.sh failed" >&2
+# ./autogen.sh || {
+# echo "autogen.sh failed" >&2
+# exit 1
+# }
+ )
+}
+
+
+build_lyx()
+{
+ (
+ cd "${LYX_DIR}" || {
+ echo "Unable to cd ${LYX_DIR}" >&2
exit 1
}
Error "Unable to create build dir, ${BUILDDIR}."
}
- CONFIGURE="../configure --without-x --with-included-gettext --with-extra-prefix='${LYX_ASPELL_DIR}' --with-frontend=qt QTDIR='$QT_DIR'"
+ CONFIGURE="../configure --without-x --with-included-gettext --with-extra-prefix='${LYX_ASPELL_DIR}' --with-frontend=qt QTDIR='$QT_DIR' --disable-maintainer-mode --disable-debug --enable-optimization --disable-pch --disable-concept-checks --disable-stdlib-debug"
echo "${CONFIGURE}"
cd "${BUILDDIR}"
query_qt || exit 1
check_files_exist || exit 1
build_dtl || exit 1
-build_aspell || exit 1
-build_aspell_dicts || exit 1
+run_automake || exit 1
build_lyx || exit 1
install_lyx || exit 1
# The end