From 03b2b6e34887d9066fd99435dbf8fa19209f0502 Mon Sep 17 00:00:00 2001 From: Oleg Romashin Date: Thu, 20 Feb 2014 18:08:58 -0800 Subject: [PATCH] Bug 974335 - Refactor Qt Widget Backend implementation. Build changes . r=glandium --- configure.in | 88 ++++++++++++++++++++------------- dom/src/geolocation/Makefile.in | 2 +- dom/src/geolocation/moz.build | 2 +- dom/system/unix/Makefile.in | 2 +- dom/system/unix/moz.build | 7 ++- ipc/chromium/moz.build | 4 +- 6 files changed, 64 insertions(+), 41 deletions(-) diff --git a/configure.in b/configure.in index 16e69c7868a8..f85e7bd6180b 100644 --- a/configure.in +++ b/configure.in @@ -4398,6 +4398,19 @@ AC_SUBST(MOZ_ENABLE_STARTUP_NOTIFICATION) AC_SUBST(MOZ_STARTUP_NOTIFICATION_CFLAGS) AC_SUBST(MOZ_STARTUP_NOTIFICATION_LIBS) +dnl ======================================================== +dnl Disable printing +dnl ======================================================== +MOZ_ARG_DISABLE_BOOL(printing, +[ --disable-printing Disable printing support], + NS_PRINTING=, + NS_PRINTING=1) + +if test "$NS_PRINTING"; then + AC_DEFINE(NS_PRINTING) + AC_DEFINE(NS_PRINT_PREVIEW) +fi + dnl ======================================================== dnl = QT support dnl ======================================================== @@ -4418,19 +4431,20 @@ then case $QT_VERSION in 5.*) AC_MSG_RESULT("Using qt5: $QT_VERSION") - PKG_CHECK_MODULES(MOZ_QT, Qt5Gui Qt5Network Qt5Core Qt5OpenGL Qt5Widgets Qt5PrintSupport, , + PKG_CHECK_MODULES(MOZ_QT, Qt5Gui Qt5Network Qt5Core Qt5Quick, , [ AC_MSG_ERROR([$MOZ_QT_PKG_ERRORS Need qtbase development packages, (On Ubuntu, you might try installing the packages qtbase5-dev libqt5opengl5-dev.)]) ]) QT5INCDIR=`pkg-config --variable=includedir Qt5Gui` MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS -I$QT5INCDIR/QtGui/$QT_VERSION/QtGui" - ;; - 4.*) - AC_MSG_RESULT("Using qt4: $QT_VERSION") - PKG_CHECK_MODULES(MOZ_QT, QtGui QtNetwork QtCore QtOpenGL, , - [ - AC_MSG_ERROR([$MOZ_QT_PKG_ERRORS Need qt4 development package, (On Ubuntu, you might try installing the packages libqt4-dev libqt4-opengl-dev.)]) - ]) + if test "$NS_PRINTING"; then + PKG_CHECK_MODULES(MOZ_QT_WIDGETS, Qt5PrintSupport, , + [ + AC_MSG_ERROR([$MOZ_QT_PKG_ERRORS Need qtbase widgets development package]) + ]) + MOZ_QT_LIBS="$MOZ_QT_LIBS $MOZ_QT_WIDGETS_LIBS" + MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS $MOZ_QT_WIDGETS_CFLAGS" + fi ;; *) AC_MSG_ERROR([* * * Unsupported Qt Version: $QT_VERSION]) @@ -4447,20 +4461,15 @@ then MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS -I$QTDIR/include/QtNetwork" MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS -I$QTDIR/include/QtXml" MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS -I$QTDIR/include/QtDeclarative" - case $QT_VERSION in 5.*) AC_MSG_RESULT("Using qt5: $QT_VERSION") - MOZ_QT_LIBS="-L$QTDIR/lib/ -lQt5Gui -lQt5Network -lQt5Core -lQt5Xml -lQt5OpenGL" + MOZ_QT_LIBS="$MOZ_QT_LIBS -L$QTDIR/lib/ -lQt5Gui -lQt5Network -lQt5Core -lQt5Xml" MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS -I$QTDIR/include/QtGui/$QT_VERSION/QtGui" - MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS -I$QTDIR/include/QtWidgets" - MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS -I$QTDIR/include/QtPrintSupport" - MOZ_QT_LIBS="$MOZ_QT_LIBS -lQt5Widgets -lQt5PrintSupport" - ;; - 4.*) - AC_MSG_RESULT("Using qt4: $QT_VERSION") - MOZ_QT_LIBS="-L$QTDIR/lib/ -lQtGui -lQtNetwork -lQtCore -lQtXml -lQtOpenGL" - MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS -I$QTDIR/include/Qt" + if test "$NS_PRINTING"; then + MOZ_QT_LIBS="$MOZ_QT_LIBS -lQt5Widgets -lQt5PrintSupport" + MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS -I$QTDIR/include/QtPrintSupport" + fi ;; *) AC_MSG_ERROR([* * * Unsupported Qt Version: $QT_VERSION]) @@ -4471,12 +4480,10 @@ then HOST_RCC="$QTDIR/bin/rcc" fi if test -z "$HOST_MOC"; then - AC_MSG_ERROR([No acceptable moc preprocessor found. Qt SDK is not installed or --with-qt is -incorrect]) + AC_MSG_ERROR([No acceptable moc preprocessor found. Qt SDK is not installed or --with-qt is incorrect]) fi if test -z "$HOST_RCC"; then - AC_MSG_ERROR([No acceptable rcc preprocessor found. Qt SDK is not installed or --with-qt is -incorrect]) + AC_MSG_ERROR([No acceptable rcc preprocessor found. Qt SDK is not installed or --with-qt is incorrect]) fi MOC=$HOST_MOC @@ -4525,6 +4532,30 @@ incorrect]) ]) fi + MOZ_ENABLE_QT5FEEDBACK= + PKG_CHECK_MODULES(_QT5FEEDBACK, Qt0Feedback, + MOZ_ENABLE_QT5FEEDBACK=1, + MOZ_ENABLE_QT5FEEDBACK=) + if test "$MOZ_ENABLE_QT5FEEDBACK"; then + MOZ_ENABLE_QT5FEEDBACK=1 + MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS $_QT5FEEDBACK_CFLAGS" + MOZ_QT_LIBS="$MOZ_QT_LIBS $_QT5FEEDBACK_LIBS" + AC_DEFINE(MOZ_ENABLE_QT5FEEDBACK) + AC_SUBST(MOZ_ENABLE_QT5FEEDBACK) + fi + + MOZ_ENABLE_QT5GEOPOSITION= + PKG_CHECK_MODULES(_QT5GEOPOSITION, Qt5Positioning, + MOZ_ENABLE_QT5GEOPOSITION=1, + MOZ_ENABLE_QT5GEOPOSITION=) + if test "$MOZ_ENABLE_QT5GEOPOSITION"; then + MOZ_ENABLE_QT5GEOPOSITION=1 + MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS $_QT5GEOPOSITION_CFLAGS" + MOZ_QT_LIBS="$MOZ_QT_LIBS $_QT5GEOPOSITION_LIBS" + AC_DEFINE(MOZ_ENABLE_QT5GEOPOSITION) + AC_SUBST(MOZ_ENABLE_QT5GEOPOSITION) + fi + if test "$MOZ_ENABLE_CONTENTACTION"; then MOZ_ENABLE_CONTENTACTION=1 AC_DEFINE(MOZ_ENABLE_CONTENTACTION) @@ -4960,19 +4991,6 @@ if test "${MOZ_WIDGET_TOOLKIT}" = "linuxgl" -a "$ACCESSIBILITY" != "1"; then AC_MSG_ERROR(["Accessibility is required for the linuxgl widget backend"]) fi -dnl ======================================================== -dnl Disable printing -dnl ======================================================== -MOZ_ARG_DISABLE_BOOL(printing, -[ --disable-printing Disable printing support], - NS_PRINTING=, - NS_PRINTING=1) - -if test "$NS_PRINTING"; then - AC_DEFINE(NS_PRINTING) - AC_DEFINE(NS_PRINT_PREVIEW) -fi - dnl Turn off webrtc for OS's we don't handle yet, but allow dnl --enable-webrtc to override. Can disable for everything in dnl the master list above. diff --git a/dom/src/geolocation/Makefile.in b/dom/src/geolocation/Makefile.in index 0cffbd4852e0..6ac51b347c18 100644 --- a/dom/src/geolocation/Makefile.in +++ b/dom/src/geolocation/Makefile.in @@ -4,6 +4,6 @@ include $(topsrcdir)/config/rules.mk -ifdef MOZ_ENABLE_QTMOBILITY +ifdef MOZ_ENABLE_QT5GEOPOSITION CXXFLAGS += $(MOZ_QT_CFLAGS) endif diff --git a/dom/src/geolocation/moz.build b/dom/src/geolocation/moz.build index 0340d9f08026..43803f3f6529 100644 --- a/dom/src/geolocation/moz.build +++ b/dom/src/geolocation/moz.build @@ -26,7 +26,7 @@ LOCAL_INCLUDES += [ '/dom/ipc', ] -if CONFIG['MOZ_ENABLE_QTMOBILITY']: +if CONFIG['MOZ_ENABLE_QT5GEOPOSITION']: LOCAL_INCLUDES += [ '/dom/system/unix', ] diff --git a/dom/system/unix/Makefile.in b/dom/system/unix/Makefile.in index 0cffbd4852e0..6ac51b347c18 100644 --- a/dom/system/unix/Makefile.in +++ b/dom/system/unix/Makefile.in @@ -4,6 +4,6 @@ include $(topsrcdir)/config/rules.mk -ifdef MOZ_ENABLE_QTMOBILITY +ifdef MOZ_ENABLE_QT5GEOPOSITION CXXFLAGS += $(MOZ_QT_CFLAGS) endif diff --git a/dom/system/unix/moz.build b/dom/system/unix/moz.build index 9f2858d39205..efa72f7f75d4 100644 --- a/dom/system/unix/moz.build +++ b/dom/system/unix/moz.build @@ -4,7 +4,7 @@ # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. -if CONFIG['MOZ_ENABLE_QTMOBILITY']: +if CONFIG['MOZ_ENABLE_QT5GEOPOSITION']: GENERATED_SOURCES += [ 'moc_QTMLocationProvider.cpp', ] @@ -16,6 +16,11 @@ if CONFIG['MOZ_ENABLE_QTMOBILITY']: '/dom/src/geolocation', ] +if CONFIG['MOZ_ENABLE_QT5FEEDBACK']: + SOURCES += [ + 'nsHapticFeedback.cpp', + ] + FAIL_ON_WARNINGS = True include('/ipc/chromium/chromium-config.mozbuild') diff --git a/ipc/chromium/moz.build b/ipc/chromium/moz.build index 8798b3d1ff4d..5622144430a8 100644 --- a/ipc/chromium/moz.build +++ b/ipc/chromium/moz.build @@ -226,7 +226,7 @@ if os_linux: 'src/base/message_pump_qt.cc', ] GENERATED_SOURCES += [ - 'src/base/moc_message_pump_qt.cc', + 'moc_message_pump_qt.cc', ] if not CONFIG['MOZ_NATIVE_LIBEVENT']: if CONFIG['OS_TARGET'] != 'Android': @@ -263,7 +263,7 @@ if os_bsd: 'src/base/message_pump_qt.cc', ] GENERATED_SOURCES += [ - 'src/base/moc_message_pump_qt.cc', + 'moc_message_pump_qt.cc', ] if not CONFIG['MOZ_NATIVE_LIBEVENT']: SOURCES += [