Update autotools for building with Qt5.

The option --enable-qt5 allows configuring for Qt5. The default is Qt4.
Nothing special is done with respect to Qt4, apart from pulling in the
correct libraries. Indeed, other than the core and gui libraries, now
also the concurrent and widgets libraries are needed.
This commit is contained in:
Enrico Forestieri 2014-07-19 03:34:28 +02:00
parent 4342411297
commit 4bdeae2733
11 changed files with 200 additions and 171 deletions

View File

@ -14,8 +14,8 @@ These four steps will compile, test and install LyX:
distribution). distribution).
1) ./configure configures LyX according to your system. You 1) ./configure configures LyX according to your system. You
may have to set --with-qt4-dir=<path-to-your-qt4-installation> may have to set --with-qt-dir=<path-to-your-qt-installation>
(for example, "--with-qt4-dir=/usr/share/qt4/") if the (for example, "--with-qt-dir=/usr/share/qt4/") if the
environment variable QTDIR is not set and pkg-config is not environment variable QTDIR is not set and pkg-config is not
available. available.

View File

@ -166,10 +166,10 @@ adjust some environment variables to do so.
The required compiler flags to compile a Qt4 application has to be provided. The required compiler flags to compile a Qt4 application has to be provided.
export QT4_CORE_CFLAGS="-FQtCore" export QT_CORE_CFLAGS="-FQtCore"
export QT4_CORE_LIBS="-framework QtCore" export QT_CORE_LIBS="-framework QtCore"
export QT4_FRONTEND_CFLAGS="-FQtGui" export QT_FRONTEND_CFLAGS="-FQtGui"
export QT4_FRONTEND_LIBS="-framework QtGui" export QT_FRONTEND_LIBS="-framework QtGui"
Depending on the architecture and target os add the compiler flags: Depending on the architecture and target os add the compiler flags:
@ -202,7 +202,7 @@ adjust some environment variables to do so.
--with-libiconv-prefix=/usr \ --with-libiconv-prefix=/usr \
--with-x=no \ --with-x=no \
--prefix=/path/to/LyX.app \ --prefix=/path/to/LyX.app \
--with-qt4-dir=/path/to/Qt4 --with-qt-dir=/path/to/Qt4
make make
make install-strip make install-strip
@ -224,7 +224,7 @@ Instead of the instructions above, do the following:
--with-x=no \ --with-x=no \
--disable-stdlib-debug \ --disable-stdlib-debug \
--prefix=/path/to/LyX.app \ --prefix=/path/to/LyX.app \
--with-qt4-dir=/path/to/Qt4 --with-qt-dir=/path/to/Qt4
make make
make install-strip make install-strip
@ -239,7 +239,7 @@ Please read the script if you're about to make a distributable disk image.
To use it, cd to the top of the LyX source hierarchy, and enter: To use it, cd to the top of the LyX source hierarchy, and enter:
sh development/LyX-Mac-binary-release.sh --with-qt4-dir=/path/to/Qt4 sh development/LyX-Mac-binary-release.sh --with-qt-dir=/path/to/Qt4
This script automates all steps of the build process. This script automates all steps of the build process.
It detects the sources for Qt4, Aspell and Hunspell when placed in a It detects the sources for Qt4, Aspell and Hunspell when placed in a

View File

@ -1,5 +1,5 @@
dnl check a particular libname dnl check a particular libname
AC_DEFUN([QT4_TRY_LINK], AC_DEFUN([QT_TRY_LINK],
[ [
SAVE_LIBS="$LIBS" SAVE_LIBS="$LIBS"
LIBS="$LIBS $1" LIBS="$LIBS $1"
@ -13,60 +13,69 @@ AC_DEFUN([QT4_TRY_LINK],
break_me_(\\\); break_me_(\\\);
#endif #endif
], ],
qt4_cv_libname=$1, qt_cv_libname=$1,
) )
LIBS="$SAVE_LIBS" LIBS="$SAVE_LIBS"
]) ])
dnl check we can do a compile dnl check we can do a compile
AC_DEFUN([QT4_CHECK_COMPILE], AC_DEFUN([QT_CHECK_COMPILE],
[ [
AC_MSG_CHECKING([for Qt 4 library name]) AC_MSG_CHECKING([for Qt library name])
AC_CACHE_VAL(qt4_cv_libname, AC_CACHE_VAL(qt_cv_libname,
[ [
AC_LANG_CPLUSPLUS AC_LANG_CPLUSPLUS
SAVE_CXXFLAGS=$CXXFLAGS SAVE_CXXFLAGS=$CXXFLAGS
CXXFLAGS="$CXXFLAGS $QT4_INCLUDES $QT4_LDFLAGS" CXXFLAGS="$CXXFLAGS $QT_INCLUDES $QT_LDFLAGS"
for libname in -lQtCore -lQtCore4 '-framework QtCore' qt_corelibs="-lQtCore -lQtCore4"
qt_guilibs="'-lQtCore -lQtGui' '-lQtCore4 -lQtGui4'"
if test $USE_QT5 = "yes" ; then
qt_corelibs="-lQt5Core"
qt_guilibs="-lQt5Core -lQt5Concurrent -lQt5Gui -lQt5Widgets"
fi
for libname in $qt_corelibs '-framework QtCore'
do do
QT4_TRY_LINK($libname) QT_TRY_LINK($libname)
if test -n "$qt4_cv_libname"; then if test -n "$qt_cv_libname"; then
QT4_CORE_LIB="$qt4_cv_libname" QT_CORE_LIB="$qt_cv_libname"
break; break;
fi fi
done done
qt4_cv_libname= qt_cv_libname=
for libname in '-lQtCore -lQtGui' \ for libname in $qt_guilibs \
'-lQtCore4 -lQtGui4' \
'-framework QtCore -framework QtConcurrent -framework QtWidgets -framework QtGui'\ '-framework QtCore -framework QtConcurrent -framework QtWidgets -framework QtGui'\
'-framework QtCore -framework QtGui' '-framework QtCore -framework QtGui'
do do
QT4_TRY_LINK($libname) QT_TRY_LINK($libname)
if test -n "$qt4_cv_libname"; then if test -n "$qt_cv_libname"; then
break; break;
fi fi
done done
CXXFLAGS=$SAVE_CXXFLAGS CXXFLAGS=$SAVE_CXXFLAGS
]) ])
if test -z "$qt4_cv_libname"; then if test -z "$qt_cv_libname"; then
AC_MSG_RESULT([failed]) AC_MSG_RESULT([failed])
AC_MSG_ERROR([cannot compile a simple Qt 4 executable. Check you have the right \$QT4DIR.]) AC_MSG_ERROR([cannot compile a simple Qt executable. Check you have the right \$QTDIR.])
else else
AC_MSG_RESULT([$qt4_cv_libname]) AC_MSG_RESULT([$qt_cv_libname])
fi fi
]) ])
AC_DEFUN([QT4_FIND_TOOL], AC_DEFUN([QT_FIND_TOOL],
[ [
$1= $1=
if test -n "$qt4_cv_bin" ; then qt_ext=qt4
AC_PATH_PROGS($1, [$2], [], $qt4_cv_bin) if test "x$USE_QT5" != "xno" ; then
qt_ext=qt5
fi
if test -n "$qt_cv_bin" ; then
AC_PATH_PROGS($1, [$2], [], $qt_cv_bin)
fi fi
if test -z "$$1"; then if test -z "$$1"; then
AC_PATH_PROGS($1, [$2-qt4 $2],[],$PATH) AC_PATH_PROGS($1, [$2-$qt_ext $2],[],$PATH)
fi fi
if test -z "$$1"; then if test -z "$$1"; then
AC_MSG_ERROR([cannot find $2 binary.]) AC_MSG_ERROR([cannot find $2 binary.])
@ -75,13 +84,13 @@ AC_DEFUN([QT4_FIND_TOOL],
dnl get Qt version we're using dnl get Qt version we're using
AC_DEFUN([QT4_GET_VERSION], AC_DEFUN([QT_GET_VERSION],
[ [
AC_CACHE_CHECK([Qt 4 version],lyx_cv_qt4version, AC_CACHE_CHECK([Qt version],lyx_cv_qtversion,
[ [
AC_LANG_CPLUSPLUS AC_LANG_CPLUSPLUS
SAVE_CPPFLAGS=$CPPFLAGS SAVE_CPPFLAGS=$CPPFLAGS
CPPFLAGS="$CPPFLAGS $QT4_INCLUDES" CPPFLAGS="$CPPFLAGS $QT_INCLUDES"
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line __oline__ "configure" #line __oline__ "configure"
@ -89,124 +98,144 @@ AC_DEFUN([QT4_GET_VERSION],
#include <qglobal.h> #include <qglobal.h>
"%%%"QT_VERSION_STR"%%%" "%%%"QT_VERSION_STR"%%%"
EOF EOF
lyx_cv_qt4version=`(eval "$ac_cpp conftest.$ac_ext") 2>&5 | \ lyx_cv_qtversion=`(eval "$ac_cpp conftest.$ac_ext") 2>&5 | \
grep '^"%%%"' 2>/dev/null | \ grep '^"%%%"' 2>/dev/null | \
sed -e 's/"%%%"//g' -e 's/"//g'` sed -e 's/"%%%"//g' -e 's/"//g'`
rm -f conftest.$ac_ext rm -f conftest.$ac_ext
CPPFLAGS=$SAVE_CPPFLAGS CPPFLAGS=$SAVE_CPPFLAGS
]) ])
QT4_VERSION=$lyx_cv_qt4version QTLIB_VERSION=$lyx_cv_qtversion
AC_SUBST(QT4_VERSION) AC_SUBST(QTLIB_VERSION)
]) ])
dnl start here dnl start here
AC_DEFUN([QT4_DO_IT_ALL], AC_DEFUN([QT_DO_IT_ALL],
[ [
AC_MSG_CHECKING([whether Qt5 is requested])
dnl Default is Qt4
AC_ARG_ENABLE([qt5],
[ --enable-qt5 use Qt5 for building],
USE_QT5=$enableval, USE_QT5=no)
AC_MSG_RESULT([$USE_QT5])
AC_SUBST([USE_QT5])
dnl this variable is precious dnl this variable is precious
AC_ARG_VAR(QT4DIR, [the place where the Qt 4 files are, e.g. /usr/lib/qt4]) AC_ARG_VAR(QTDIR, [the place where the Qt files are, e.g. /usr/lib/qt4])
AC_ARG_WITH(qt4-dir, [AC_HELP_STRING([--with-qt4-dir], [where the root of Qt 4 is installed])], AC_ARG_WITH(qt-dir, [AC_HELP_STRING([--with-qt-dir], [where the root of Qt is installed])],
[ qt4_cv_dir=`eval echo "$withval"/` ]) [ qt_cv_dir=`eval echo "$withval"/` ])
AC_ARG_WITH(qt4-includes, [AC_HELP_STRING([--with-qt4-includes], [where the Qt 4 includes are])], AC_ARG_WITH(qt-includes, [AC_HELP_STRING([--with-qt-includes], [where the Qt includes are])],
[ qt4_cv_includes=`eval echo "$withval"` ]) [ qt_cv_includes=`eval echo "$withval"` ])
AC_ARG_WITH(qt4-libraries, [AC_HELP_STRING([--with-qt4-libraries], [where the Qt 4 library is installed])], AC_ARG_WITH(qt-libraries, [AC_HELP_STRING([--with-qt-libraries], [where the Qt library is installed])],
[ qt4_cv_libraries=`eval echo "$withval"` ]) [ qt_cv_libraries=`eval echo "$withval"` ])
dnl pay attention to $QT4DIR unless overridden dnl pay attention to $QTDIR unless overridden
if test -z "$qt4_cv_dir"; then if test -z "$qt_cv_dir"; then
qt4_cv_dir=$QT4DIR qt_cv_dir=$QTDIR
fi fi
dnl derive inc/lib if needed dnl derive inc/lib if needed
if test -n "$qt4_cv_dir"; then if test -n "$qt_cv_dir"; then
if test -z "$qt4_cv_includes"; then if test -z "$qt_cv_includes"; then
qt4_cv_includes=$qt4_cv_dir/include qt_cv_includes=$qt_cv_dir/include
fi fi
if test -z "$qt4_cv_libraries"; then if test -z "$qt_cv_libraries"; then
qt4_cv_libraries=$qt4_cv_dir/lib qt_cv_libraries=$qt_cv_dir/lib
fi fi
fi fi
dnl compute the binary dir too dnl compute the binary dir too
if test -n "$qt4_cv_dir"; then if test -n "$qt_cv_dir"; then
qt4_cv_bin=$qt4_cv_dir/bin qt_cv_bin=$qt_cv_dir/bin
fi fi
dnl Preprocessor flags dnl Preprocessor flags
QT4_CPPFLAGS="-DQT_NO_STL -DQT_NO_KEYWORDS" QT_CPPFLAGS="-DQT_NO_STL -DQT_NO_KEYWORDS"
case ${host} in case ${host} in
*mingw*) QT4_CPPFLAGS="-DQT_DLL $QT4_CPPFLAGS";; *mingw*) QT_CPPFLAGS="-DQT_DLL $QT_CPPFLAGS";;
esac esac
AC_SUBST(QT4_CPPFLAGS) AC_SUBST(QT_CPPFLAGS)
dnl Check if it possible to do a pkg-config dnl Check if it possible to do a pkg-config
PKG_PROG_PKG_CONFIG PKG_PROG_PKG_CONFIG
if test -n "$PKG_CONFIG" ; then if test -n "$PKG_CONFIG" ; then
QT4_DO_PKG_CONFIG QT_DO_PKG_CONFIG
fi fi
if test "$pkg_failed" != "no" ; then if test "$pkg_failed" != "no" ; then
QT4_DO_MANUAL_CONFIG QT_DO_MANUAL_CONFIG
fi fi
if test -z "$QT4_LIB"; then if test -z "$QT_LIB"; then
AC_MSG_ERROR([cannot find qt4 library.]) AC_MSG_ERROR([cannot find qt libraries.])
fi fi
dnl Check qt version dnl Check qt version
AS_VERSION_COMPARE($QT4_VERSION, $1, AS_VERSION_COMPARE($QTLIB_VERSION, $1,
[AC_MSG_ERROR([LyX requires at least version $1 of Qt. Only version $QT4_VERSION has been found.]) [AC_MSG_ERROR([LyX requires at least version $1 of Qt. Only version $QTLIB_VERSION has been found.])
]) ])
QT4_FIND_TOOL([MOC4], [moc]) QT_FIND_TOOL([QT_MOC], [moc])
QT4_FIND_TOOL([UIC4], [uic]) QT_FIND_TOOL([QT_UIC], [uic])
QT4_FIND_TOOL([RCC4], [rcc]) QT_FIND_TOOL([QT_RCC], [rcc])
dnl Safety check
mocqtver=`$QT_MOC -v 2>&1 | sed -e 's/.*\([[0-9]]\.[[0-9]]\.[[0-9]]\).*/\1/'`
if test "x$mocqtver" != "x$QTLIB_VERSION"; then
LYX_WARNING([The found moc compiler is for Qt $mocqtver but the Qt library version is $QTLIB_VERSION.])
fi
]) ])
AC_DEFUN([QT4_DO_PKG_CONFIG], AC_DEFUN([QT_DO_PKG_CONFIG],
[ [
dnl tell pkg-config to look also in $qt4_cv_dir/lib. dnl tell pkg-config to look also in $qt_cv_dir/lib.
save_PKG_CONFIG_PATH=$PKG_CONFIG_PATH save_PKG_CONFIG_PATH=$PKG_CONFIG_PATH
if test -n "$qt4_cv_dir" ; then if test -n "$qt_cv_dir" ; then
PKG_CONFIG_PATH=$qt4_cv_dir/lib:$qt4_cv_dir/lib/pkgconfig:$PKG_CONFIG_PATH PKG_CONFIG_PATH=$qt_cv_dir/lib:$qt_cv_dir/lib/pkgconfig:$PKG_CONFIG_PATH
export PKG_CONFIG_PATH export PKG_CONFIG_PATH
fi fi
PKG_CHECK_MODULES(QT4_CORE, QtCore,,[:]) qt_corelibs="QtCore"
if test "$pkg_failed" = "no" ; then qt_guilibs="QtCore QtGui"
QT4_CORE_INCLUDES=$QT4_CORE_CFLAGS if test "x$USE_QT5" != "xno" ; then
AC_SUBST(QT4_CORE_INCLUDES) qt_corelibs="Qt5Core"
QT4_CORE_LDFLAGS=`$PKG_CONFIG --libs-only-L QtCore` qt_guilibs="Qt5Core Qt5Concurrent Qt5Gui Qt5Widgets"
AC_SUBST(QT4_CORE_LDFLAGS)
QT4_CORE_LIB=`$PKG_CONFIG --libs-only-l QtCore`
AC_SUBST(QT4_CORE_LIB)
fi fi
PKG_CHECK_MODULES(QT4_FRONTEND, QtCore QtGui,,[:]) PKG_CHECK_MODULES(QT_CORE, $qt_corelibs,,[:])
if test "$pkg_failed" = "no" ; then if test "$pkg_failed" = "no" ; then
QT4_INCLUDES=$QT4_FRONTEND_CFLAGS QT_CORE_INCLUDES=$QT_CORE_CFLAGS
dnl QT4_LDFLAGS=$QT4_FRONTEND_LIBS AC_SUBST(QT_CORE_INCLUDES)
QT4_LDFLAGS=`$PKG_CONFIG --libs-only-L QtCore QtGui` QT_CORE_LDFLAGS=`$PKG_CONFIG --libs-only-L $qt_corelibs`
AC_SUBST(QT4_INCLUDES) AC_SUBST(QT_CORE_LDFLAGS)
AC_SUBST(QT4_LDFLAGS) QT_CORE_LIB=`$PKG_CONFIG --libs-only-l $qt_corelibs`
QT4_VERSION=`$PKG_CONFIG --modversion QtCore` AC_SUBST(QT_CORE_LIB)
AC_SUBST(QT4_VERSION) fi
QT4_LIB=`$PKG_CONFIG --libs-only-l QtCore QtGui` PKG_CHECK_MODULES(QT_FRONTEND, $qt_guilibs,,[:])
AC_SUBST(QT4_LIB) if test "$pkg_failed" = "no" ; then
dnl LIBS="$LIBS `$PKG_CONFIG --libs-only-other QtCore QtGui`" QT_INCLUDES=$QT_FRONTEND_CFLAGS
dnl QT_LDFLAGS=$QT_FRONTEND_LIBS
QT_LDFLAGS=`$PKG_CONFIG --libs-only-L $qt_guilibs`
AC_SUBST(QT_INCLUDES)
AC_SUBST(QT_LDFLAGS)
QTLIB_VERSION=`$PKG_CONFIG --modversion $qt_corelibs`
AC_SUBST(QTLIB_VERSION)
QT_LIB=`$PKG_CONFIG --libs-only-l $qt_guilibs`
AC_SUBST(QT_LIB)
dnl LIBS="$LIBS `$PKG_CONFIG --libs-only-other $qt_guilibs`"
fi fi
PKG_CONFIG_PATH=$save_PKG_CONFIG_PATH PKG_CONFIG_PATH=$save_PKG_CONFIG_PATH
dnl Actually, the values of QT4_LIB and QT4_CORE_LIB can be completely dnl Actually, the values of QT_LIB and QT_CORE_LIB can be completely
dnl wrong on OS X, where everything goes to --libs-only-other. dnl wrong on OS X, where everything goes to --libs-only-other.
dnl As a quick workaround, let us assign better values. A better patch dnl As a quick workaround, let us assign better values. A better patch
dnl exists for next cycle. dnl exists for next cycle.
QT4_CORE_LIB=$QT4_CORE_LIBS QT_CORE_LIB=$QT_CORE_LIBS
QT4_CORE_LDFLAGS= QT_CORE_LDFLAGS=
QT4_LIB=$QT4_FRONTEND_LIBS QT_LIB=$QT_FRONTEND_LIBS
QT4_LDFLAGS= QT_LDFLAGS=
]) ])
AC_DEFUN([QT4_DO_MANUAL_CONFIG], AC_DEFUN([QT_DO_MANUAL_CONFIG],
[ [
dnl Check for X libraries dnl Check for X libraries
AC_PATH_X AC_PATH_X
@ -219,41 +248,41 @@ AC_DEFUN([QT4_DO_MANUAL_CONFIG],
esac esac
dnl flags for compilation dnl flags for compilation
QT4_INCLUDES= QT_INCLUDES=
QT4_LDFLAGS= QT_LDFLAGS=
QT4_CORE_INCLUDES= QT_CORE_INCLUDES=
QT4_CORE_LDFLAGS= QT_CORE_LDFLAGS=
if test -n "$qt4_cv_includes"; then if test -n "$qt_cv_includes"; then
QT4_INCLUDES="-I$qt4_cv_includes" QT_INCLUDES="-I$qt_cv_includes"
for i in Qt QtCore QtGui QtWidgets QtConcurrent; do for i in Qt QtCore QtGui QtWidgets QtConcurrent; do
QT4_INCLUDES="$QT4_INCLUDES -I$qt4_cv_includes/$i" QT_INCLUDES="$QT_INCLUDES -I$qt_cv_includes/$i"
done done
QT4_CORE_INCLUDES="-I$qt4_cv_includes -I$qt4_cv_includes/QtCore" QT_CORE_INCLUDES="-I$qt_cv_includes -I$qt_cv_includes/QtCore"
fi fi
case "$qt4_cv_libraries" in case "$qt_cv_libraries" in
*framework*) *framework*)
QT4_LDFLAGS="-F$qt4_cv_libraries" QT_LDFLAGS="-F$qt_cv_libraries"
QT4_CORE_LDFLAGS="-F$qt4_cv_libraries" QT_CORE_LDFLAGS="-F$qt_cv_libraries"
;; ;;
"") "")
;; ;;
*) *)
QT4_LDFLAGS="-L$qt4_cv_libraries" QT_LDFLAGS="-L$qt_cv_libraries"
QT4_CORE_LDFLAGS="-L$qt4_cv_libraries" QT_CORE_LDFLAGS="-L$qt_cv_libraries"
;; ;;
esac esac
AC_SUBST(QT4_INCLUDES) AC_SUBST(QT_INCLUDES)
AC_SUBST(QT4_CORE_INCLUDES) AC_SUBST(QT_CORE_INCLUDES)
AC_SUBST(QT4_LDFLAGS) AC_SUBST(QT_LDFLAGS)
AC_SUBST(QT4_CORE_LDFLAGS) AC_SUBST(QT_CORE_LDFLAGS)
QT4_CHECK_COMPILE QT_CHECK_COMPILE
QT4_LIB=$qt4_cv_libname; QT_LIB=$qt_cv_libname;
AC_SUBST(QT4_LIB) AC_SUBST(QT_LIB)
AC_SUBST(QT4_CORE_LIB) AC_SUBST(QT_CORE_LIB)
if test -n "$qt4_cv_libname"; then if test -n "$qt_cv_libname"; then
QT4_GET_VERSION QT_GET_VERSION
fi fi
]) ])

View File

@ -36,7 +36,7 @@ m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
PACKAGE=$save_PACKAGE PACKAGE=$save_PACKAGE
# Allow to build some parts of the code as one big chunk # Allow to build some parts of the code as one big chunk
m4_define([ALLPARTS],[boost,client,insets,mathed,core,tex2lyx,frontend_qt4]) m4_define([ALLPARTS],[boost,client,insets,mathed,core,tex2lyx,frontend_qt])
AC_ARG_ENABLE(monolithic-build, AC_ARG_ENABLE(monolithic-build,
AC_HELP_STRING([--enable-monolithic-build@<:@=LIST@:>@], AC_HELP_STRING([--enable-monolithic-build@<:@=LIST@:>@],
[Use monolithic build for modules in LIST (default: ALLPARTS)]), [Use monolithic build for modules in LIST (default: ALLPARTS)]),
@ -55,7 +55,7 @@ AM_CONDITIONAL(MONOLITHIC_INSETS, test "x$enable_monolithic_insets" = "xyes")
AM_CONDITIONAL(MONOLITHIC_MATHED, test "x$enable_monolithic_mathed" = "xyes") AM_CONDITIONAL(MONOLITHIC_MATHED, test "x$enable_monolithic_mathed" = "xyes")
AM_CONDITIONAL(MONOLITHIC_CORE, test "x$enable_monolithic_core" = "xyes") AM_CONDITIONAL(MONOLITHIC_CORE, test "x$enable_monolithic_core" = "xyes")
AM_CONDITIONAL(MONOLITHIC_TEX2LYX, test "x$enable_monolithic_tex2lyx" = "xyes") AM_CONDITIONAL(MONOLITHIC_TEX2LYX, test "x$enable_monolithic_tex2lyx" = "xyes")
AM_CONDITIONAL(MONOLITHIC_FRONTEND_QT4, test "x$enable_monolithic_frontend_qt4" = "xyes") AM_CONDITIONAL(MONOLITHIC_FRONTEND_QT, test "x$enable_monolithic_frontend_qt" = "xyes")
### Set the execute permissions of the various scripts correctly ### Set the execute permissions of the various scripts correctly
for file in config/install-sh ; do for file in config/install-sh ; do
@ -128,14 +128,14 @@ AC_CHECK_HEADERS(magic.h,
is correctly installed on your system. is correctly installed on your system.
Falling back to builtin file format detection.])]) Falling back to builtin file format detection.])])
### setup the qt4 frontend. ### setup the qt frontend.
dnl The code below is not in a macro, because this would cause big dnl The code below is not in a macro, because this would cause big
dnl problems with the AC_REQUIRE contained in QT4_DO_IT_ALL. dnl problems with the AC_REQUIRE contained in QT_DO_IT_ALL.
QT4_DO_IT_ALL([4.5.0]) QT_DO_IT_ALL([4.5.0])
AC_SUBST([FRONTENDS_SUBDIRS], [qt4]) AC_SUBST([FRONTENDS_SUBDIRS], [qt4])
FRONTEND_INFO="${FRONTEND_INFO}\ FRONTEND_INFO="${FRONTEND_INFO}\
Qt 4 Frontend:\n\ Qt Frontend:\n\
Qt 4 version:\t\t${QT4_VERSION}\n" Qt version:\t\t${QTLIB_VERSION}\n"
# fix the value of the prefixes. # fix the value of the prefixes.
test "x$prefix" = xNONE && prefix=$default_prefix test "x$prefix" = xNONE && prefix=$default_prefix

View File

@ -157,7 +157,7 @@ while [ $# -gt 0 ]; do
fi fi
shift shift
;; ;;
--with-qt4-dir=*) --with-qt-dir=*)
QTDIR=$(echo ${1}|cut -d= -f2) QTDIR=$(echo ${1}|cut -d= -f2)
shift shift
;; ;;
@ -624,10 +624,10 @@ build_lyx() {
HOSTSYSTEM=$(eval "echo \\$HostSystem_$arch") HOSTSYSTEM=$(eval "echo \\$HostSystem_$arch")
if [ "$configure_qt4_frameworks" = "yes" ]; then if [ "$configure_qt4_frameworks" = "yes" ]; then
export QT4_CORE_CFLAGS="-FQtCore" export QT_CORE_CFLAGS="-FQtCore"
export QT4_CORE_LIBS="-framework QtCore" export QT_CORE_LIBS="-framework QtCore"
export QT4_FRONTEND_CFLAGS="-FQtGui" export QT_FRONTEND_CFLAGS="-FQtGui"
export QT4_FRONTEND_LIBS="-framework QtGui" export QT_FRONTEND_LIBS="-framework QtGui"
CPPFLAGS="${CPPFLAGS} -I${SDKROOT}/Library/Frameworks/QtCore.framework/Headers" CPPFLAGS="${CPPFLAGS} -I${SDKROOT}/Library/Frameworks/QtCore.framework/Headers"
CPPFLAGS="${CPPFLAGS} -I${SDKROOT}/Library/Frameworks/QtGui.framework/Headers" CPPFLAGS="${CPPFLAGS} -I${SDKROOT}/Library/Frameworks/QtGui.framework/Headers"
fi fi
@ -636,10 +636,10 @@ build_lyx() {
export LDFLAGS export LDFLAGS
echo CPPFLAGS="${CPPFLAGS}" echo CPPFLAGS="${CPPFLAGS}"
export CPPFLAGS export CPPFLAGS
echo CONFIGURE_OPTIONS="${LyXConfigureOptions}" ${QtInstallDir:+"--with-qt4-dir=${QtInstallDir}"} echo CONFIGURE_OPTIONS="${LyXConfigureOptions}" ${QtInstallDir:+"--with-qt-dir=${QtInstallDir}"}
"${LyxSourceDir}/configure"\ "${LyxSourceDir}/configure"\
--prefix="${LyxAppPrefix}" --with-version-suffix="-${LyXVersionSuffix}"\ --prefix="${LyxAppPrefix}" --with-version-suffix="-${LyXVersionSuffix}"\
${QtInstallDir:+"--with-qt4-dir=${QtInstallDir}"} \ ${QtInstallDir:+"--with-qt-dir=${QtInstallDir}"} \
${LyXConfigureOptions}\ ${LyXConfigureOptions}\
--enable-build-type=rel && \ --enable-build-type=rel && \
make ${MAKEJOBS} && make install${strip} make ${MAKEJOBS} && make install${strip}

View File

@ -8,15 +8,15 @@ CLEANFILES += $(BUILT_SOURCES)
######################### Qt stuff ############################# ######################### Qt stuff #############################
# Use _() for localization instead of tr() or trUtf8() # Use _() for localization instead of tr() or trUtf8()
UIC4FLAGS=-tr lyx::qt_ UICFLAGS=-tr lyx::qt_
ui_%.h: ui/%.ui ui_%.h: ui/%.ui
$(UIC4) $(UIC4FLAGS) $< -o $@ $(QT_UIC) $(UICFLAGS) $< -o $@
MOCEDFILES = $(MOCHEADER:%.h=%_moc.cpp) MOCEDFILES = $(MOCHEADER:%.h=%_moc.cpp)
%_moc.cpp: %.h %_moc.cpp: %.h
$(MOC4) -o $@ $< $(QT_MOC) -o $@ $<
#Resources.qrc: Makefile #Resources.qrc: Makefile
# echo "<!DOCTYPE RCC><RCC version='1.0'><qresource>" > $@ # echo "<!DOCTYPE RCC><RCC version='1.0'><qresource>" > $@
@ -26,21 +26,21 @@ MOCEDFILES = $(MOCHEADER:%.h=%_moc.cpp)
# echo "</qresource></RCC>" >> $@ # echo "</qresource></RCC>" >> $@
# #
#Resources.cpp: Resources.qrc #Resources.cpp: Resources.qrc
# $(RCC4) $< -name Resources -o $@ # $(QT_RCC) $< -name Resources -o $@
######################### LIBRARIES ############################# ######################### LIBRARIES #############################
bin_PROGRAMS = lyxled bin_PROGRAMS = lyxled
lyxled_LDADD = $(QT4_LIB) lyxled_LDADD = $(QT_LIB)
lyxled_DEPENDENCIES = $(MOCEDFILES) lyxled_DEPENDENCIES = $(MOCEDFILES)
AM_CPPFLAGS += \ AM_CPPFLAGS += \
$(QT4_CPPFLAGS) \ $(QT_CPPFLAGS) \
-UQT_NO_KEYWORDS \ -UQT_NO_KEYWORDS \
-I$(top_srcdir)/src \ -I$(top_srcdir)/src \
$(QT4_INCLUDES) $(QT_INCLUDES)
SOURCEFILES = \ SOURCEFILES = \
main.cpp \ main.cpp \
@ -74,15 +74,15 @@ CLEANFILES += $(BUILT_SOURCES)
######################### Qt stuff ############################# ######################### Qt stuff #############################
# Use _() for localization instead of tr() or trUtf8() # Use _() for localization instead of tr() or trUtf8()
UIC4FLAGS=-tr lyx::qt_ UICFLAGS=-tr lyx::qt_
ui_%.h: ui/%.ui ui_%.h: ui/%.ui
$(UIC4) $(UIC4FLAGS) $< -o $@ $(QT_UIC) $(UICFLAGS) $< -o $@
MOCEDFILES = $(MOCHEADER:%.h=%_moc.cpp) MOCEDFILES = $(MOCHEADER:%.h=%_moc.cpp)
%_moc.cpp: %.h %_moc.cpp: %.h
$(MOC4) -o $@ $< $(QT_MOC) -o $@ $<
#Resources.qrc: Makefile #Resources.qrc: Makefile
# echo "<!DOCTYPE RCC><RCC version='1.0'><qresource>" > $@ # echo "<!DOCTYPE RCC><RCC version='1.0'><qresource>" > $@
@ -92,21 +92,21 @@ MOCEDFILES = $(MOCHEADER:%.h=%_moc.cpp)
# echo "</qresource></RCC>" >> $@ # echo "</qresource></RCC>" >> $@
# #
#Resources.cpp: Resources.qrc #Resources.cpp: Resources.qrc
# $(RCC4) $< -name Resources -o $@ # $(QT_RCC) $< -name Resources -o $@
######################### LIBRARIES ############################# ######################### LIBRARIES #############################
bin_PROGRAMS = lyxled bin_PROGRAMS = lyxled
lyxled_LDADD = $(QT4_LIB) lyxled_LDADD = $(QT_LIB)
lyxled_DEPENDENCIES = $(MOCEDFILES) lyxled_DEPENDENCIES = $(MOCEDFILES)
AM_CPPFLAGS += \ AM_CPPFLAGS += \
$(QT4_CPPFLAGS) \ $(QT_CPPFLAGS) \
-UQT_NO_KEYWORDS \ -UQT_NO_KEYWORDS \
-I$(top_srcdir)/src \ -I$(top_srcdir)/src \
$(QT4_INCLUDES) $(QT_INCLUDES)
SOURCEFILES = \ SOURCEFILES = \
main.cpp \ main.cpp \

View File

@ -3,7 +3,7 @@ include $(top_srcdir)/config/common.am
############################### Core ############################## ############################### Core ##############################
AM_CPPFLAGS += $(PCH_FLAGS) -I$(top_srcdir)/src $(BOOST_INCLUDES) $(ENCHANT_CFLAGS) $(HUNSPELL_CFLAGS) AM_CPPFLAGS += $(PCH_FLAGS) -I$(top_srcdir)/src $(BOOST_INCLUDES) $(ENCHANT_CFLAGS) $(HUNSPELL_CFLAGS)
AM_CPPFLAGS += $(QT4_CPPFLAGS) $(QT4_CORE_INCLUDES) AM_CPPFLAGS += $(QT_CPPFLAGS) $(QT_CORE_INCLUDES)
if BUILD_CLIENT_SUBDIR if BUILD_CLIENT_SUBDIR
CLIENT = client CLIENT = client
@ -28,8 +28,8 @@ lyx_LDADD = \
liblyxgraphics.a \ liblyxgraphics.a \
support/liblyxsupport.a \ support/liblyxsupport.a \
$(OTHERLIBS) \ $(OTHERLIBS) \
$(QT4_LDFLAGS) \ $(QT_LDFLAGS) \
$(QT4_LIB) $(QT_LIB)
if LYX_WIN_RESOURCE if LYX_WIN_RESOURCE
.rc.o: .rc.o:
@ -331,7 +331,7 @@ BUILT_SOURCES += $(MOCEDFILES)
CLEANFILES += $(MOCEDFILES) CLEANFILES += $(MOCEDFILES)
moc_%.cpp: %.h moc_%.cpp: %.h
$(MOC4) $(MOCFLAG) -o $@ $< $(QT_MOC) $(MOCFLAG) -o $@ $<
liblyxcore_a_DEPENDENCIES = $(MOCEDFILES) liblyxcore_a_DEPENDENCIES = $(MOCEDFILES)
@ -692,8 +692,8 @@ ADD_FRAMEWORKS = -framework QtGui -framework QtCore -framework AppKit -framework
endif endif
check_layout_CPPFLAGS = $(AM_CPPFLAGS) check_layout_CPPFLAGS = $(AM_CPPFLAGS)
check_layout_LDADD = support/liblyxsupport.a $(LIBICONV) $(BOOST_LIBS) @LIBS@ $(QT4_CORE_LIBS) $(LIBSHLWAPI) check_layout_LDADD = support/liblyxsupport.a $(LIBICONV) $(BOOST_LIBS) @LIBS@ $(QT_CORE_LIBS) $(LIBSHLWAPI)
check_layout_LDFLAGS = $(QT4_CORE_LDFLAGS) $(ADD_FRAMEWORKS) check_layout_LDFLAGS = $(QT_CORE_LDFLAGS) $(ADD_FRAMEWORKS)
check_layout_SOURCES = \ check_layout_SOURCES = \
insets/InsetLayout.cpp \ insets/InsetLayout.cpp \
Color.cpp \ Color.cpp \

View File

@ -13,7 +13,7 @@ AM_CPPFLAGS += -I$(srcdir)/.. $(BOOST_INCLUDES)
lyxclient_LDADD = \ lyxclient_LDADD = \
$(top_builddir)/src/support/liblyxsupport.a \ $(top_builddir)/src/support/liblyxsupport.a \
$(BOOST_LIBS) @LIBS@ $(SOCKET_LIBS) \ $(BOOST_LIBS) @LIBS@ $(SOCKET_LIBS) \
$(QT4_LIB) $(QT4_LDFLAGS) $(LIBSHLWAPI) $(LIBPSAPI) $(QT_LIB) $(QT_LDFLAGS) $(LIBSHLWAPI) $(LIBPSAPI)
if INSTALL_MACOSX if INSTALL_MACOSX
lyxclient_LDFLAGS = -framework AppKit lyxclient_LDFLAGS = -framework AppKit

View File

@ -8,20 +8,20 @@ CLEANFILES += $(BUILT_SOURCES)
######################### Qt stuff ############################# ######################### Qt stuff #############################
# Use _() for localization instead of tr() or trUtf8() # Use _() for localization instead of tr() or trUtf8()
UIC4FLAGS=-tr lyx::qt_ UICFLAGS=-tr lyx::qt_
# The ui_%.h pattern must match the filter in ../../../po/Rules-lyx # The ui_%.h pattern must match the filter in ../../../po/Rules-lyx
ui_%.h: ui/%.ui ui_%.h: ui/%.ui
$(AM_V_GEN)$(UIC4) $(UIC4FLAGS) $< -o $@ $(AM_V_GEN)$(QT_UIC) $(UICFLAGS) $< -o $@
MOCEDFILES = $(MOCHEADER:%.h=moc_%.cpp) MOCEDFILES = $(MOCHEADER:%.h=moc_%.cpp)
QT_VERSION = $(shell IFS=.; set -- `echo $(QT4_VERSION)`; \ QT_VERSION = $(shell IFS=.; set -- `echo $(QTLIB_VERSION)`; \
echo 0x0`echo "obase=16; $$1*65536+$$2*256+$$3" | bc`) echo 0x0`echo "obase=16; $$1*65536+$$2*256+$$3" | bc`)
# The moc_%.cpp pattern must match the filter in ../../../po/Rules-lyx # The moc_%.cpp pattern must match the filter in ../../../po/Rules-lyx
moc_%.cpp: %.h moc_%.cpp: %.h
$(AM_V_GEN)$(MOC4) -DQT_VERSION=$(QT_VERSION) -o $@ $< $(AM_V_GEN)$(QT_MOC) -DQT_VERSION=$(QT_VERSION) -o $@ $<
Resources.qrc: Makefile Resources.qrc: Makefile
$(AM_V_GEN)echo "<!DOCTYPE RCC><RCC version='1.0'><qresource>" > $@ ; \ $(AM_V_GEN)echo "<!DOCTYPE RCC><RCC version='1.0'><qresource>" > $@ ; \
@ -31,7 +31,7 @@ Resources.qrc: Makefile
echo "</qresource></RCC>" >> $@ echo "</qresource></RCC>" >> $@
Resources.cpp: Resources.qrc Resources.cpp: Resources.qrc
$(AM_V_GEN)$(RCC4) $< -name Resources -o $@ $(AM_V_GEN)$(QT_RCC) $< -name Resources -o $@
######################### LIBRARIES ############################# ######################### LIBRARIES #############################
@ -41,13 +41,13 @@ noinst_LIBRARIES = liblyxqt4.a
liblyxqt4_a_DEPENDENCIES = $(MOCEDFILES) liblyxqt4_a_DEPENDENCIES = $(MOCEDFILES)
AM_CPPFLAGS += \ AM_CPPFLAGS += \
$(QT4_CPPFLAGS) \ $(QT_CPPFLAGS) \
-DQT_NO_CAST_TO_ASCII \ -DQT_NO_CAST_TO_ASCII \
-DQT_NO_STL \ -DQT_NO_STL \
-I$(top_srcdir)/src \ -I$(top_srcdir)/src \
-I$(top_srcdir)/src/frontends \ -I$(top_srcdir)/src/frontends \
-I$(top_srcdir)/images \ -I$(top_srcdir)/images \
$(QT4_INCLUDES) $(BOOST_INCLUDES) $(QT_INCLUDES) $(BOOST_INCLUDES)
SOURCEFILES = \ SOURCEFILES = \
ButtonPolicy.cpp \ ButtonPolicy.cpp \
@ -361,7 +361,7 @@ UIFILES = \
liblyxqt4.cpp: liblyxqt4.cpp:
@echo -e '$(SOURCEFILES:%=\n#include "%")\n' > $@ @echo -e '$(SOURCEFILES:%=\n#include "%")\n' > $@
if MONOLITHIC_FRONTEND_QT4 if MONOLITHIC_FRONTEND_QT
liblyxqt4_a_SOURCES = \ liblyxqt4_a_SOURCES = \
liblyxqt4.cpp \ liblyxqt4.cpp \

View File

@ -20,7 +20,7 @@ CLEANFILES += $(MOCEDFILES)
BUILT_SOURCES += $(MOCEDFILES) BUILT_SOURCES += $(MOCEDFILES)
moc_%.cpp: %.h moc_%.cpp: %.h
$(MOC4) -o $@ $< $(QT_MOC) -o $@ $<
liblyxsupport_a_DEPENDENCIES = $(MOCEDFILES) liblyxsupport_a_DEPENDENCIES = $(MOCEDFILES)
@ -28,7 +28,7 @@ liblyxsupport_a_DEPENDENCIES = $(MOCEDFILES)
################################################################## ##################################################################
AM_CPPFLAGS += $(PCH_FLAGS) -I$(srcdir)/.. $(BOOST_INCLUDES) AM_CPPFLAGS += $(PCH_FLAGS) -I$(srcdir)/.. $(BOOST_INCLUDES)
AM_CPPFLAGS += $(QT4_CPPFLAGS) $(QT4_INCLUDES) AM_CPPFLAGS += $(QT_CPPFLAGS) $(QT_INCLUDES)
liblyxsupport_a_SOURCES = \ liblyxsupport_a_SOURCES = \
FileMonitor.h \ FileMonitor.h \
@ -159,22 +159,22 @@ if INSTALL_MACOSX
ADD_FRAMEWORKS = -framework QtGui -framework QtCore -framework AppKit -framework ApplicationServices ADD_FRAMEWORKS = -framework QtGui -framework QtCore -framework AppKit -framework ApplicationServices
endif endif
check_convert_LDADD = liblyxsupport.a $(LIBICONV) $(BOOST_LIBS) $(QT4_CORE_LIBS) $(LIBSHLWAPI) @LIBS@ check_convert_LDADD = liblyxsupport.a $(LIBICONV) $(BOOST_LIBS) $(QT_CORE_LIBS) $(LIBSHLWAPI) @LIBS@
check_convert_LDFLAGS = $(QT4_LDFLAGS) $(ADD_FRAMEWORKS) check_convert_LDFLAGS = $(QT_LDFLAGS) $(ADD_FRAMEWORKS)
check_convert_SOURCES = \ check_convert_SOURCES = \
tests/check_convert.cpp \ tests/check_convert.cpp \
tests/dummy_functions.cpp \ tests/dummy_functions.cpp \
tests/boost.cpp tests/boost.cpp
check_filetools_LDADD = liblyxsupport.a $(LIBICONV) $(BOOST_LIBS) $(QT4_CORE_LIBS) $(LIBSHLWAPI) @LIBS@ check_filetools_LDADD = liblyxsupport.a $(LIBICONV) $(BOOST_LIBS) $(QT_CORE_LIBS) $(LIBSHLWAPI) @LIBS@
check_filetools_LDFLAGS = $(QT4_CORE_LDFLAGS) $(ADD_FRAMEWORKS) check_filetools_LDFLAGS = $(QT_CORE_LDFLAGS) $(ADD_FRAMEWORKS)
check_filetools_SOURCES = \ check_filetools_SOURCES = \
tests/check_filetools.cpp \ tests/check_filetools.cpp \
tests/dummy_functions.cpp \ tests/dummy_functions.cpp \
tests/boost.cpp tests/boost.cpp
check_lstrings_LDADD = liblyxsupport.a $(LIBICONV) $(BOOST_LIBS) $(QT4_CORE_LIBS) $(LIBSHLWAPI) @LIBS@ check_lstrings_LDADD = liblyxsupport.a $(LIBICONV) $(BOOST_LIBS) $(QT_CORE_LIBS) $(LIBSHLWAPI) @LIBS@
check_lstrings_LDFLAGS = $(QT4_CORE_LDFLAGS) $(ADD_FRAMEWORKS) check_lstrings_LDFLAGS = $(QT_CORE_LDFLAGS) $(ADD_FRAMEWORKS)
check_lstrings_SOURCES = \ check_lstrings_SOURCES = \
tests/check_lstrings.cpp \ tests/check_lstrings.cpp \
tests/dummy_functions.cpp \ tests/dummy_functions.cpp \

View File

@ -111,7 +111,7 @@ tex2lyx_SOURCES = \
tex2lyx_LDADD = \ tex2lyx_LDADD = \
$(top_builddir)/src/support/liblyxsupport.a \ $(top_builddir)/src/support/liblyxsupport.a \
$(LIBICONV) $(BOOST_LIBS) \ $(LIBICONV) $(BOOST_LIBS) \
$(QT4_LIB) $(QT4_LDFLAGS) \ $(QT_LIB) $(QT_LDFLAGS) \
@LIBS@ $(LIBSHLWAPI) $(LIBPSAPI) @LIBS@ $(LIBSHLWAPI) $(LIBPSAPI)
if INSTALL_MACOSX if INSTALL_MACOSX