[vlc-commits] contrib: qt4: simplify cross compile

Rafaël Carré git at videolan.org
Wed Nov 9 18:15:33 CET 2011


vlc | branch: master | Rafaël Carré <funman at videolan.org> | Wed Nov  9 12:15:00 2011 -0500| [7a6e884fa6d0aec0b4c673f3a785fff8ea7d12e1] | committer: Rafaël Carré

contrib: qt4: simplify cross compile

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=7a6e884fa6d0aec0b4c673f3a785fff8ea7d12e1
---

 contrib/src/qt4/cross-win32.diff |   65 --------------------------------------
 contrib/src/qt4/cross-win64.diff |   65 --------------------------------------
 contrib/src/qt4/cross.patch      |   44 +++++++++++++++++++++++++
 contrib/src/qt4/rules.mak        |   17 ++++------
 4 files changed, 51 insertions(+), 140 deletions(-)

diff --git a/contrib/src/qt4/cross-win32.diff b/contrib/src/qt4/cross-win32.diff
deleted file mode 100644
index 0c24002..0000000
--- a/contrib/src/qt4/cross-win32.diff
+++ /dev/null
@@ -1,65 +0,0 @@
---- qt-everywhere-opensource-src-4.7.4/mkspecs/win32-g++/qmake.conf.orig	2011-09-28 14:32:02.709958498 -0400
-+++ qt-everywhere-opensource-src-4.7.4/mkspecs/win32-g++/qmake.conf	2011-09-28 14:36:32.529954583 -0400
-@@ -1,5 +1,5 @@
- #
--# qmake configuration for win32-g++
-+# qmake configuration for win32-i586-mingw32msvc-g++
- #
- # Written for MinGW
- #
-@@ -14,7 +14,7 @@
- QMAKE_EXT_OBJ           = .o
- QMAKE_EXT_RES           = _res.o
- 
--QMAKE_CC		= gcc
-+QMAKE_CC		= i586-mingw32msvc-gcc
- QMAKE_LEX		= flex
- QMAKE_LEXFLAGS		=
- QMAKE_YACC		= byacc
-@@ -23,11 +23,11 @@
- QMAKE_CFLAGS_DEPS	= -M
- QMAKE_CFLAGS_WARN_ON	= -Wall
- QMAKE_CFLAGS_WARN_OFF	= -w
--QMAKE_CFLAGS_RELEASE	= -O2
-+QMAKE_CFLAGS_RELEASE	= -O3
- QMAKE_CFLAGS_DEBUG	= -g
- QMAKE_CFLAGS_YACC	= -Wno-unused -Wno-parentheses
- 
--QMAKE_CXX		= g++
-+QMAKE_CXX		= i586-mingw32msvc-g++
- QMAKE_CXXFLAGS		= $$QMAKE_CFLAGS
- QMAKE_CXXFLAGS_DEPS	= $$QMAKE_CFLAGS_DEPS
- QMAKE_CXXFLAGS_WARN_ON	= $$QMAKE_CFLAGS_WARN_ON
-@@ -50,8 +50,8 @@
- QMAKE_RUN_CXX		= $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $obj $src
- QMAKE_RUN_CXX_IMP	= $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $<
- 
--QMAKE_LINK		= g++
--QMAKE_LINK_C		= gcc
-+QMAKE_LINK		= i586-mingw32msvc-g++
-+QMAKE_LINK_C		= i586-mingw32msvc-gcc
- QMAKE_LFLAGS		=
- QMAKE_LFLAGS_EXCEPTIONS_ON = -mthreads
- QMAKE_LFLAGS_EXCEPTIONS_OFF =
-@@ -95,15 +95,15 @@
-     QMAKE_CHK_DIR_EXISTS	= if not exist
- }
- 
--QMAKE_MOC		= $$[QT_INSTALL_BINS]$${DIR_SEPARATOR}moc.exe
--QMAKE_UIC		= $$[QT_INSTALL_BINS]$${DIR_SEPARATOR}uic.exe
--QMAKE_IDC		= $$[QT_INSTALL_BINS]$${DIR_SEPARATOR}idc.exe
-+QMAKE_MOC		= moc
-+QMAKE_UIC		= uic
-+QMAKE_IDC		= idc
- 
- QMAKE_IDL		= midl
--QMAKE_LIB		= ar -ru
--QMAKE_RC		= windres
-+QMAKE_LIB		= i586-mingw32msvc-ar -ru
-+QMAKE_RC		= i586-mingw32msvc-windres
- QMAKE_ZIP		= zip -r -9
- 
--QMAKE_STRIP		= strip
-+QMAKE_STRIP		= i586-mingw32msvc-strip
- QMAKE_STRIPFLAGS_LIB 	+= --strip-unneeded
- load(qt_config)
diff --git a/contrib/src/qt4/cross-win64.diff b/contrib/src/qt4/cross-win64.diff
deleted file mode 100644
index 0190757..0000000
--- a/contrib/src/qt4/cross-win64.diff
+++ /dev/null
@@ -1,65 +0,0 @@
---- qt-everywhere-opensource-src-4.7.4/mkspecs/win32-g++/qmake.conf.orig	2011-09-28 14:32:02.709958498 -0400
-+++ qt-everywhere-opensource-src-4.7.4/mkspecs/win32-g++/qmake.conf	2011-09-28 14:36:32.529954583 -0400
-@@ -1,5 +1,5 @@
- #
--# qmake configuration for win32-g++
-+# qmake configuration for win32-x86_64-w64-mingw32-g++
- #
- # Written for MinGW
- #
-@@ -14,7 +14,7 @@
- QMAKE_EXT_OBJ           = .o
- QMAKE_EXT_RES           = _res.o
- 
--QMAKE_CC		= gcc
-+QMAKE_CC		= x86_64-w64-mingw32-gcc
- QMAKE_LEX		= flex
- QMAKE_LEXFLAGS		=
- QMAKE_YACC		= byacc
-@@ -23,11 +23,11 @@
- QMAKE_CFLAGS_DEPS	= -M
- QMAKE_CFLAGS_WARN_ON	= -Wall
- QMAKE_CFLAGS_WARN_OFF	= -w
--QMAKE_CFLAGS_RELEASE	= -O2
-+QMAKE_CFLAGS_RELEASE	= -O3
- QMAKE_CFLAGS_DEBUG	= -g
- QMAKE_CFLAGS_YACC	= -Wno-unused -Wno-parentheses
- 
--QMAKE_CXX		= g++
-+QMAKE_CXX		= x86_64-w64-mingw32-g++
- QMAKE_CXXFLAGS		= $$QMAKE_CFLAGS
- QMAKE_CXXFLAGS_DEPS	= $$QMAKE_CFLAGS_DEPS
- QMAKE_CXXFLAGS_WARN_ON	= $$QMAKE_CFLAGS_WARN_ON
-@@ -50,8 +50,8 @@
- QMAKE_RUN_CXX		= $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $obj $src
- QMAKE_RUN_CXX_IMP	= $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $<
- 
--QMAKE_LINK		= g++
--QMAKE_LINK_C		= gcc
-+QMAKE_LINK		= x86_64-w64-mingw32-g++
-+QMAKE_LINK_C		= x86_64-w64-mingw32-gcc
- QMAKE_LFLAGS		=
- QMAKE_LFLAGS_EXCEPTIONS_ON = -mthreads
- QMAKE_LFLAGS_EXCEPTIONS_OFF =
-@@ -95,15 +95,15 @@
-     QMAKE_CHK_DIR_EXISTS	= if not exist
- }
- 
--QMAKE_MOC		= $$[QT_INSTALL_BINS]$${DIR_SEPARATOR}moc.exe
--QMAKE_UIC		= $$[QT_INSTALL_BINS]$${DIR_SEPARATOR}uic.exe
--QMAKE_IDC		= $$[QT_INSTALL_BINS]$${DIR_SEPARATOR}idc.exe
-+QMAKE_MOC		= moc
-+QMAKE_UIC		= uic
-+QMAKE_IDC		= idc
- 
- QMAKE_IDL		= midl
--QMAKE_LIB		= ar -ru
--QMAKE_RC		= windres
-+QMAKE_LIB		= x86_64-w64-mingw32-ar -ru
-+QMAKE_RC		= x86_64-w64-mingw32-windres
- QMAKE_ZIP		= zip -r -9
- 
--QMAKE_STRIP		= strip
-+QMAKE_STRIP		= x86_64-w64-mingw32-strip
- QMAKE_STRIPFLAGS_LIB 	+= --strip-unneeded
- load(qt_config)
diff --git a/contrib/src/qt4/cross.patch b/contrib/src/qt4/cross.patch
new file mode 100644
index 0000000..f2f97ae
--- /dev/null
+++ b/contrib/src/qt4/cross.patch
@@ -0,0 +1,44 @@
+--- qt-everywhere-opensource-src-4.7.4/mkspecs/win32-g++/qmake.conf.orig    2011-09-28 14:32:02.709958498 -0400
++++ qt-everywhere-opensource-src-4.7.4/mkspecs/win32-g++/qmake.conf 2011-09-28 14:36:32.529954583 -0400
+@@ -14,7 +14,7 @@
+ QMAKE_EXT_OBJ           = .o
+ QMAKE_EXT_RES           = _res.o
+ 
+-QMAKE_CC		= gcc
++QMAKE_CC		= $(XCC)
+ QMAKE_LEX		= flex
+ QMAKE_LEXFLAGS		=
+ QMAKE_YACC		= byacc
+@@ -27,7 +27,7 @@
+ QMAKE_CFLAGS_DEBUG	= -g
+ QMAKE_CFLAGS_YACC	= -Wno-unused -Wno-parentheses
+ 
+-QMAKE_CXX		= g++
++QMAKE_CXX		= $(XCXX)
+ QMAKE_CXXFLAGS		= $$QMAKE_CFLAGS
+ QMAKE_CXXFLAGS_DEPS	= $$QMAKE_CFLAGS_DEPS
+ QMAKE_CXXFLAGS_WARN_ON	= $$QMAKE_CFLAGS_WARN_ON
+@@ -50,8 +50,8 @@
+ QMAKE_RUN_CXX		= $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $obj $src
+ QMAKE_RUN_CXX_IMP	= $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $<
+ 
+-QMAKE_LINK		= g++
+-QMAKE_LINK_C		= gcc
++QMAKE_LINK		= $(XCXX)
++QMAKE_LINK_C		= $(XCC)
+ QMAKE_LFLAGS		=
+ QMAKE_LFLAGS_EXCEPTIONS_ON = -mthreads
+ QMAKE_LFLAGS_EXCEPTIONS_OFF =
+@@ -100,10 +100,10 @@
+ QMAKE_IDC		= $$[QT_INSTALL_BINS]$${DIR_SEPARATOR}idc.exe
+ 
+ QMAKE_IDL		= midl
+-QMAKE_LIB		= ar -ru
++QMAKE_LIB		= $(XAR) -ru
+ QMAKE_RC		= windres
+ QMAKE_ZIP		= zip -r -9
+ 
+-QMAKE_STRIP		= strip
++QMAKE_STRIP		= $(XSTRIP)
+ QMAKE_STRIPFLAGS_LIB 	+= --strip-unneeded
+ load(qt_config)
diff --git a/contrib/src/qt4/rules.mak b/contrib/src/qt4/rules.mak
index e221255..ca39728 100644
--- a/contrib/src/qt4/rules.mak
+++ b/contrib/src/qt4/rules.mak
@@ -22,19 +22,15 @@ $(TARBALLS)/qt-$(QT4_VERSION).tar.gz:
 
 qt4: qt-$(QT4_VERSION).tar.gz .sum-qt4
 	$(UNPACK)
-ifdef HAVE_WIN32
-ifdef HAVE_WIN64
-	patch -p0 < $(SRC)/qt4/cross-win64.diff
-else
-	patch -p0 < $(SRC)/qt4/cross-win32.diff
-endif
-endif
+	patch -p0 < $(SRC)/qt4/cross.patch
 	mv qt-everywhere-opensource-src-4.7.4 $@ && touch $@
 
+XTOOLS := XCC="$(CC)" XCXX="$(CXX)" XSTRIP="$(STRIP)" XAR="$(AR)"
+
 .qt4: qt4
-	cd $< && ./configure -xplatform win32-g++ -static -release -fast -no-exceptions -no-stl -no-sql-sqlite -no-qt3support -no-gif -no-libmng -qt-libjpeg -no-libtiff -no-qdbus -no-openssl -no-webkit -sse -no-script -no-multimedia -no-phonon -opensource -no-scripttools -no-opengl -no-script -no-scripttools -no-declarative -no-declarative-debug -opensource -no-s60 -host-little-endian -confirm-license
-	cd $< && make sub-src
-	cd $</src/plugins/imageformats/jpeg && make # FIXME
+	cd $< && $(XTOOLS) ./configure -xplatform win32-g++ -static -release -fast -no-exceptions -no-stl -no-sql-sqlite -no-qt3support -no-gif -no-libmng -qt-libjpeg -no-libtiff -no-qdbus -no-openssl -no-webkit -sse -no-script -no-multimedia -no-phonon -opensource -no-scripttools -no-opengl -no-script -no-scripttools -no-declarative -no-declarative-debug -opensource -no-s60 -host-little-endian -confirm-license
+	cd $< && $(MAKE) $(XTOOLS) sub-src
+	cd $</src/plugins/imageformats/jpeg && $(MAKE) $(XTOOLS) # FIXME
 	# INSTALLING LIBRARIES
 	for lib in QtGui QtCore; \
 		do install -D -- $</lib/lib$${lib}.a "$(PREFIX)/lib/lib$${lib}.a"; \
@@ -52,6 +48,7 @@ endif
 	cd $</src/gui; find . -type f -name '*.h' -exec install -D -- "{}" "$(PREFIX)/include/qt4/src/gui/{}" \;
 	cd $</include/QtGui; find . -maxdepth 1 -type f \( -name '*.h' -o -name 'Q*' \) -exec install -D -s --strip-program="$(abspath $(SRC)/qt4/fix_header.sh)" -- "{}" "$(PREFIX)/include/qt4/QtGui/{}" \;
 	# INSTALLING PKGCONFIG FILES
+	install -d "$(PREFIX)/lib/pkgconfig"
 	cat $(SRC)/qt4/QtCore.pc.in | sed -e s/@@VERSION@@/$(QT4_VERSION)/ | sed -e 's|@@PREFIX@@|$(PREFIX)|' > "$(PREFIX)/lib/pkgconfig/QtCore.pc"
 	cat $(SRC)/qt4/QtGui.pc.in | sed -e s/@@VERSION@@/$(QT4_VERSION)/ | sed -e 's|@@PREFIX@@|$(PREFIX)|' > "$(PREFIX)/lib/pkgconfig/QtGui.pc"
 	touch $@



More information about the vlc-commits mailing list