qt4: package drivers (kbd, mouse, gfx) seperatly
[openwrt/svn-archive/archive.git] / Xorg / lib / qt4 / Makefile
index c3bd3a98bca16c805022fdcc009146e69f187d12..fc7929ae171892883635a47de63ca6ebcacb3137 100644 (file)
@@ -6,8 +6,6 @@
 #
 
 # TODO:
-#  - handle software which uses qmake in a more generic way (move functionality / generic qmake-config into buildroot)
-#  - use generic qmake, moc, etc. executables since building them within the qt stack will get redundant and annyoing when other sw will need them as well
 #  - test/add X11/xcb support
 #  - handle plugins in a granular way (find out which packages should provide which plugins)
 
@@ -23,6 +21,17 @@ PKG_BUILD_DIR=$(BUILD_DIR)/qt-everywhere-opensource-src-$(PKG_VERSION)
 
 include $(INCLUDE_DIR)/package.mk
 
+# this should be moved to a more generic place later, as other packages are configured different as well depending on available nptl support
+ifeq ($(CONFIG_USE_GLIBC),y)
+  NPTL:=y
+endif
+ifeq ($(CONFIG_USE_EGLIBC),y)
+  NPTL:=y
+endif
+ifeq ($(CONFIG_UCLIBC_VERSION_0_9_32),y)
+  NPTL:=y
+endif
+
 define Package/qt4/Default
   SECTION:=xorg-framework
   CATEGORY:=Xorg
@@ -34,13 +43,13 @@ endef
 
 define Package/qt4
   $(call Package/qt4/Default)
-  DEPENDS:=@FEATURE_drawing-backend_DirectFB +FEATURE_drawing-backend_DirectFB:directfb +zlib +libstdcpp +libsqlite3 # require directfb for now, as other systems (libX11, xcb) are untested
+  DEPENDS:=@FEATURE_drawing-backend_DirectFB +FEATURE_drawing-backend_DirectFB:directfb +zlib +libstdcpp +libsqlite3 +tslib # require directfb for now, as other systems (libX11, xcb) are untested
 endef
 
 define Package/qt4-gui
   $(call Package/qt4/Default)
   #DEPENDS+=+FEATURE_drawing-backend_DirectFB:directfb +libpng +libtiff +libjpeg +libfreetype
-  DEPENDS+=+libpng +libtiff +libjpeg +libfreetype
+  DEPENDS+=+libpng +libtiff +libjpeg +libfreetype +qt4-network
   TITLE+=(gui)
 endef
 
@@ -86,7 +95,7 @@ endef
 define Package/qt4-phonon
   $(call Package/qt4/Default)
   TITLE+=(phonon)
-  DEPENDS+=+qt4-gui
+  DEPENDS+=+qt4-gui +qt4-xml +qt4-dbus +qt4-network
 endef
 
 #define Package/qt4-phonon-backend
@@ -98,13 +107,13 @@ define Package/qt4-svg
   $(call Package/qt4/Default)
   TITLE+=(svg)
   #DEPENDS+=+qt4-gui @BROKEN
-  DEPENDS+=+qt4-gui
+  DEPENDS+=+qt4-gui +qt4-network
 endef
 
 define Package/qt4-webkit
   $(call Package/qt4/Default)
   TITLE+=(webkit)
-  DEPENDS+=@USE_GLIBC||@USE_EGLIBC||@UCLIBC_VERSION_0_9_32 # versions of uclibc prior 0.9.32 do not have nptl support
+  DEPENDS+=@USE_GLIBC||@USE_EGLIBC||@UCLIBC_VERSION_0_9_32 +libsqlite3 +qt4-phonon +qt4-dbus +qt4-xml +qt4-gui +qt4-network # versions of uclibc prior 0.9.32 do not have nptl support
 endef
 
 define Package/qt4-script
@@ -116,7 +125,7 @@ endef
 define Package/qt4-scripttools
   $(call Package/qt4/Default)
   TITLE+=(scripttools)
-  DEPENDS+=+qt4-script
+  DEPENDS+=+qt4-script +qt4-gui +qt4-network
 endef
 
 #define Package/qt4-accessibility
@@ -137,7 +146,7 @@ endef
 define Package/qt4-dbus
   $(call Package/qt4/Default)
   TITLE+=(dbus)
-  DEPENDS+=+libdbus
+  DEPENDS+=+libdbus +qt4-xml
 endef
 
 #define Package/qt4-gtkstyle
@@ -153,64 +162,97 @@ endef
 define Package/qt4-qt3support
   $(call Package/qt4/Default)
   TITLE+=(qt3support)
+  DEPENDS+=+qt4-gui +qt4-xml
 endef
 
 define Package/qt4-declarative
   $(call Package/qt4/Default)
   TITLE+=(declarative)
-  DEPENDS+=+qt4-scripttools
+  DEPENDS+=+qt4-script +qt4-xml +qt4-gui +qt4-network
+endef
+
+define Package/qt4-xml
+  $(call Package/qt4/Default)
+  TITLE+=(xml)
+endef
+
+###
+define Package/qt4-drivers-mouse/Default
+  $(call Package/qt4/Default)
+  TITLE+=mousedrivers
 endef
 
-TARGET_CFLAGS+="-I$(STAGING_DIR)/usr/include/freetype2 -I$(PKG_BUILD_DIR)/include"
+define Package/qt4-drivers-mouse-tpmousedriver
+  $(call Package/qt4-drivers-mouse/Default)
+  TITLE+=tpmousedriver
+endef
+
+define Package/qt4-drivers-mouse-pcmousedriver
+  $(call Package/qt4-drivers-mouse/Default)
+  TITLE+=pcmousedriver
+endef
+
+define Package/qt4-drivers-mouse-tslibmousedriver
+  $(call Package/qt4-drivers-mouse/Default)
+  TITLE+=tslibmousedriver
+endef
+
+###
+define Package/qt4-drivers-gfx/Default
+  $(call Package/qt4/Default)
+  TITLE+=gfxdrivers
+endef
+
+define Package/qt4-drivers-gfx-directfb
+  $(call Package/qt4-drivers-gfx/Default)
+  TITLE+=directfb
+endef
+
+define Package/qt4-drivers-gfx-linuxfb
+  $(call Package/qt4-drivers-gfx/Default)
+  TITLE+=linuxfb
+endef
+
+###
+define Package/qt4-drivers-kbd/Default
+  $(call Package/qt4/Default)
+  TITLE+=kbddrivers
+endef
+
+define Package/qt4-drivers-kbd-linuxinput
+  $(call Package/qt4-drivers-kbd/Default)
+  TITLE+=linuxinput
+endef
+
+
+TARGET_INCDIRS+=$(STAGING_DIR)/include $(STAGING_DIR)/usr/include $(TOOLCHAIN_DIR)/include $(TOOLCHAIN_DIR)/usr/include
+TARGET_LIBDIRS+=$(STAGING_DIR)/lib $(STAGING_DIR)/usr/lib $(TOOLCHAIN_DIR)/lib $(TOOLCHAIN_DIR)/usr/lib
+TARGET_LDFLAGS+=-Wl,-rpath-link=$(STAGING_DIR)/usr/lib,-rpath-link=$(PKG_BUILD_DIR)/lib
+TARGET_CFLAGS+=-I$(STAGING_DIR)/usr/include/freetype2 -I$(PKG_BUILD_DIR)/include
 
 define Build/Configure
-       # demos/examples: which demos are going to be built depends on which features are going to to be compiled into qt
-       # svg: svg support always compiled in, as once qt is built without, strange include errors occur when we're going to compile qt4-svg afterwards
-       # linuxfb/directfb: since directfb is not much overhead compared to plain framebuffer, force using directfb
-       # do not use fontconfig as it doesn't work anyway for qte
-       ( \
-               cd $(PKG_BUILD_DIR); \
-               QPATH='mkspecs/qws/linux-openwrt-g++' ; \
-               mkdir $$$$QPATH ; \
-               echo '#include "../../linux-g++/qplatformdefs.h"' \
-                       >> $$$$QPATH/qplatformdefs.h ; \
-               echo 'include(../../common/g++.conf)' \
-                       >> $$$$QPATH/qmake.conf ; \
-               echo 'include(../../common/linux.conf)' \
-                       >> $$$$QPATH/qmake.conf ; \
-               echo 'include(../../common/qws.conf)' \
-                       >> $$$$QPATH/qmake.conf ; \
-               echo "QMAKE_CC                  = $(TARGET_CC)" \
-                       >> $$$$QPATH/qmake.conf ; \
-               echo "QMAKE_CXX                 = $(TARGET_CXX)" \
-                       >> $$$$QPATH/qmake.conf ; \
-               echo "QMAKE_AR                  = $(TARGET_CROSS)ar cqs" \
-                       >> $$$$QPATH/qmake.conf ; \
-               echo "QMAKE_OBJCOPY             = $(TARGET_CROSS)objcopy" \
-                       >> $$$$QPATH/qmake.conf ; \
-               echo "QMAKE_RANLIB              = $(TARGET_CROSS)ranlib" \
-                       >> $$$$QPATH/qmake.conf ; \
-               echo "QMAKE_CFLAGS              = $(TARGET_CFLAGS) $(EXTRA_CFLAGS) $(TARGET_CPPFLAGS) $(EXTRA_CPPFLAGS)" \
-                       >> $$$$QPATH/qmake.conf ; \
-               echo "QMAKE_CXXFLAGS            = $(TARGET_CFLAGS) $(EXTRA_CFLAGS) $(TARGET_CPPFLAGS) $(EXTRA_CPPFLAGS)" \
-                       >> $$$$QPATH/qmake.conf ; \
-               echo "QMAKE_LINK                = $(TARGET_CXX)" \
-                       >> $$$$QPATH/qmake.conf ; \
-               echo "QMAKE_LINK_SHLIB          = $(TARGET_CXX)" \
-                       >> $$$$QPATH/qmake.conf ; \
-               echo "QMAKE_LINK_C              = $(TARGET_CC)" \
-                       >> $$$$QPATH/qmake.conf ; \
-               echo "QMAKE_LINK_C_SHLIB        = $(TARGET_CC)" \
-                       >> $$$$QPATH/qmake.conf ; \
-               echo "QMAKE_LFLAGS              = -L$(PKG_BUILD_DIR)/lib $(TARGET_LDFLAGS) -Wl,-rpath-link=$(STAGING_DIR)/usr/lib" \
-                       >> $$$$QPATH/qmake.conf ; \
-               echo "QMAKE_STRIP               = : " \
-                       >> $$$$QPATH/qmake.conf ; \
-               echo "QMAKE_STRIPFLAGS_LIB      = " \
-                       >> $$$$QPATH/qmake.conf ; \
-               echo 'load(qt_config)' \
-                       >> $$$$QPATH/qmake.conf ; \
-               echo yes | ./configure \
+       # NOTES:
+       #  demos/examples: which demos are going to be built depends on which features are going to to be compiled into qt
+       #  svg: always compile in svg-support, as once qt is built without, strange include errors occur when we're going to compile qt4-svg afterwards
+       #  linuxfb/directfb: since directfb is not much overhead compared to plain framebuffer, force using directfb
+       #  do not use fontconfig as it doesn't work anyway for qte
+       #  bindir: bindir is where the host tools (qmake, moc, rcc, uic) will get installed into - they are just used on the host and not goig to be packaged
+       mkdir -p $(PKG_BUILD_DIR)/mkspecs/qws/linux-openwrt-g++
+       cp -a ./files/{qmake.conf,qplatformdefs.h} $(PKG_BUILD_DIR)/mkspecs/qws/linux-openwrt-g++/
+       ( cd $(PKG_BUILD_DIR) ; \
+               TARGET_CC="$(TARGET_CROSS)gcc" \
+               TARGET_CXX="$(TARGET_CROSS)g++" \
+               TARGET_AR="$(TARGET_CROSS)ar cqs" \
+               TARGET_OBJCOPY="$(TARGET_CROSS)objcopy" \
+               TARGET_RANLIB="$(TARGET_CROSS)ranlib" \
+               TARGET_CFLAGS="$(TARGET_CFLAGS) $(EXTRA_CFLAGS)" \
+               TARGET_CXXFLAGS="$(TARGET_CFLAGS) $(EXTRA_CFLAGS)" \
+               TARGET_LDFLAGS="$(TARGET_LDFLAGS) $(EXTRA_LDFLAGS)" \
+               TARGET_INCDIRS="$(TARGET_INCDIRS)" \
+               TARGET_LIBDIRS="$(TARGET_LIBDIRS)" \
+               STAGING_DIR="$(STAGING_DIR)" \
+               STAGING_DIR_HOST="$(STAGING_DIR)/../host" \
+               ./configure \
                        -prefix $(CONFIGURE_PREFIX) \
                        -bindir $(CONFIGURE_PREFIX)/bin \
                        -libdir $(CONFIGURE_PREFIX)/lib \
@@ -222,13 +264,15 @@ define Build/Configure
                        -no-rpath \
                        -force-pkg-config \
                        -nomake tools \
-                       -$(if $(CONFIG_PACKAGE_qt4-demos),make demos,nomake demos) \
-                       -$(if $(CONFIG_PACKAGE_qt4-examples),make examples,nomake examples) \
+                       -make demos \
+                       -make examples \
                        -nomake docs \
                        -nomake translations \
-                       -embedded openwrt \
+                       -xplatform qws/linux-openwrt-g++ \
                        -platform linux-g++ \
+                       -embedded \
                        -release \
+                       -confirm-license \
                        -opensource \
                        -no-mmx \
                        -no-3dnow \
@@ -251,12 +295,12 @@ define Build/Configure
                        -phonon \
                        -no-phonon-backend \
                        -svg \
-                       -webkit \
+                       -$(if $(NPTL),webkit,-no-webkit) \
                        -no-javascript-jit \
-                       -script \
-                       -scripttools \
+                       -$(if $(NPTL),script,-no-script) \
+                       -$(if $(NPTL),scripttools,-no-scripttools) \
                        -no-accessibility \
-                       -declarative \
+                       -$(if $(NPTL),declarative,-no-declarative) \
                        -no-openssl \
                        -no-nis \
                        -no-cups \
@@ -280,14 +324,42 @@ define Build/Configure
                        -no-xkb \
                        -no-glib \
                        -qt3support \
-                       -qt-gfx-directfb \
-                       -qt-gfx-linuxfb \
+                       -no-gfx-transformed \
+                       -no-gfx-qvfb \
+                       -no-gfx-vnc \
                        -no-gfx-multiscreen \
+                       -no-gfx-qnx \
+                       -plugin-gfx-directfb \
+                       -plugin-gfx-linuxfb \
+                       -no-mouse-qvfb \
+                       -no-mouse-qnx \
+                       -qt-mouse-linuxinput \
+                       -plugin-mouse-linuxtp \
+                       -plugin-mouse-pc \
+                       -plugin-mouse-tslib \
+                       -no-kbd-qvfb \
+                       -no-kbd-qnx \
+                       -qt-kbd-tty \
+                       -plugin-kbd-linuxinput \
        )
 endef
 
 define Build/Compile
        # just passing <make install> results in not building 3rdparty/webkit/JavaScriptCore
+       # unfortunately in this particular case, <make> makes further <qmake> calls, therewith
+       #  uses the qmake.conf which needs get the cross-compiling vars passed once again
+       TARGET_CC="$(TARGET_CROSS)gcc" \
+       TARGET_CXX="$(TARGET_CROSS)g++" \
+       TARGET_AR="$(TARGET_CROSS)ar cqs" \
+       TARGET_OBJCOPY="$(TARGET_CROSS)objcopy" \
+       TARGET_RANLIB="$(TARGET_CROSS)ranlib" \
+       TARGET_CFLAGS="$(TARGET_CFLAGS) $(EXTRA_CFLAGS)" \
+       TARGET_CXXFLAGS="$(TARGET_CFLAGS) $(EXTRA_CFLAGS)" \
+       TARGET_LDFLAGS="$(TARGET_LDFLAGS) $(EXTRA_LDFLAGS)" \
+       TARGET_INCDIRS="$(TARGET_INCDIRS)" \
+       TARGET_LIBDIRS="$(TARGET_LIBDIRS)" \
+       STAGING_DIR="$(STAGING_DIR)" \
+       STAGING_DIR_HOST="$(STAGING_DIR)/../host" \
        $(MAKE) -C $(PKG_BUILD_DIR)
        INSTALL_ROOT=$(PKG_INSTALL_DIR) \
                $(MAKE) -C $(PKG_BUILD_DIR) install
@@ -295,12 +367,25 @@ endef
 
 define Build/InstallDev
        $(INSTALL_DIR) \
+               $(STAGING_DIR_HOST)/bin
+
+       # host tools (qmake, moc, rcc, uic)
+       $(CP) \
+               $(PKG_INSTALL_DIR)/usr/bin/{qmake,moc,rcc,uic} \
+               $(STAGING_DIR_HOST)/bin/
+
+       $(INSTALL_DIR) \
+               $(1)/mk \
                $(1)/usr/share/mkspecs \
                $(1)/usr/lib/pkgconfig \
                $(1)/usr/lib \
                $(1)/usr/include \
                $(1)/usr/lib/Qt/plugins
 
+       $(CP) \
+               ./files/qmake.mk \
+               $(1)/mk/
+
        $(CP) \
                $(PKG_INSTALL_DIR)/usr/share/Qt/mkspecs/* \
                $(1)/usr/share/mkspecs/
@@ -544,6 +629,76 @@ define Package/qt4-declarative/install
                $(1)/usr/lib/
 endef
 
+define Package/qt4-xml/install
+       $(INSTALL_DIR) \
+               $(1)/usr/lib
+
+       $(CP) \
+               $(PKG_INSTALL_DIR)/usr/lib/libQtXml.so* \
+               $(1)/usr/lib/
+endef
+
+# plugins
+#  mouse drivers
+define Package/qt4-drivers-mouse-tpmousedriver/install
+       $(INSTALL_DIR) \
+               $(1)/usr/lib/Qt/plugins/mousedrivers
+
+       $(CP) \
+               $(PKG_INSTALL_DIR)/usr/lib/Qt/plugins/mousedrivers/libqlinuxtpmousedriver.so \
+               $(1)/usr/lib/Qt/plugins/mousedrivers/
+endef
+
+define Package/qt4-drivers-mouse-pcmousedriver/install
+       $(INSTALL_DIR) \
+               $(1)/usr/lib/Qt/plugins/mousedrivers
+
+       $(CP) \
+               $(PKG_INSTALL_DIR)/usr/lib/Qt/plugins/mousedrivers/libqpcmousedriver.so \
+               $(1)/usr/lib/Qt/plugins/mousedrivers/
+endef
+
+define Package/qt4-drivers-mouse-tslibmousedriver/install
+       $(INSTALL_DIR) \
+               $(1)/usr/lib/Qt/plugins/mousedrivers
+
+       $(CP) \
+               $(PKG_INSTALL_DIR)/usr/lib/Qt/plugins/mousedrivers/libqtslibmousedriver.so \
+               $(1)/usr/lib/Qt/plugins/mousedrivers/
+endef
+
+#  graphics drivers
+define Package/qt4-drivers-gfx-directfb/install
+       $(INSTALL_DIR) \
+               $(1)/usr/lib/Qt/plugins/gfxdrivers
+
+       $(CP) \
+               $(PKG_INSTALL_DIR)/usr/lib/Qt/plugins/gfxdrivers/libqdirectfbscreen.so \
+               $(1)/usr/lib/Qt/plugins/gfxdrivers/
+endef
+
+define Package/qt4-drivers-gfx-linuxfb/install
+       $(INSTALL_DIR) \
+               $(1)/usr/lib/Qt/plugins/gfxdrivers
+
+       $(CP) \
+               $(PKG_INSTALL_DIR)/usr/lib/Qt/plugins/gfxdrivers/libqscreenlinuxfb.so \
+               $(1)/usr/lib/Qt/plugins/gfxdrivers/
+endef
+
+#  keyboard drivers
+define Package/qt4-drivers-kbd-linuxinput/install
+       $(INSTALL_DIR) \
+               $(1)/usr/lib/Qt/plugins/kbddrivers
+
+       $(CP) \
+               $(PKG_INSTALL_DIR)/usr/lib/Qt/plugins/kbddrivers/libqlinuxinputkbddriver.so \
+               $(1)/usr/lib/Qt/plugins/kbddrivers/
+endef
+
+
+
+
 $(eval $(call BuildPackage,qt4))
 $(eval $(call BuildPackage,qt4-gui))
 $(eval $(call BuildPackage,qt4-demos))
@@ -567,3 +722,13 @@ $(eval $(call BuildPackage,qt4-dbus))
 #$(eval $(call BuildPackage,qt4-glib))
 $(eval $(call BuildPackage,qt4-qt3support))
 $(eval $(call BuildPackage,qt4-declarative))
+$(eval $(call BuildPackage,qt4-xml))
+
+$(eval $(call BuildPackage,qt4-drivers-mouse-tpmousedriver))
+$(eval $(call BuildPackage,qt4-drivers-mouse-pcmousedriver))
+$(eval $(call BuildPackage,qt4-drivers-mouse-tslibmousedriver))
+
+$(eval $(call BuildPackage,qt4-drivers-gfx-directfb))
+$(eval $(call BuildPackage,qt4-drivers-gfx-linuxfb))
+
+$(eval $(call BuildPackage,qt4-drivers-kbd-linuxinput))