Skip to contentSkip to conversation

Adding support for building QEMU for Windows (with meta-mingw)

PATCH New Nathan Rossi 1 participant 31 messages Jan 16, 2017

lore
Share & tools
lore
#0 lore raw

cover Adding support for building QEMU for Windows (with meta-mingw)

This series is paired with a series that is sent for the meta-mingw layer. That series depends on changes in this series and vice-versa.

The following series is a number of patches to improve mingw32 support both in oe-core itself as well as for individual recipes. The goal is to enable the building of QEMU for Windows such that the oe-core QEMU targets (qemu* machines) will execute on Windows with and without graphics (SDL/VNC and nographic). The series includes the following major changes:

* Support for detecting DLL runtime dependencies (aka shared objects) in both DLLs and EXEs
* Extending of FILES_* defaults for cleaner packaging of mingw32 built components
* Disabling of update-alternatives for mingw32 (not supported on Windows, and not all versions of Windows have symlink support)
* Addition of PACKAGECONFIG options for a number of packages to handle Windows only features and or ability to disable features that do not support mingw32/Windows
* Changes to recipes for proper packaging of DLLs (convention is to ship DLLs in the bindir), EXEs and other files
* Changes to the QEMU include, to clean up configuration and move version specific patches changes into the versioned QEMU recipe

The intended build execution is to allow for 'buildtools-tarball' (or any populate_sdk target with 'nativesdk-qemu' in TOOLCHAIN_HOST_TASK) to create an output that includes all dependent nativesdk binaries as well as a nativesdk QEMU binaries. This series does not however address fixing the environment setup script or self-extracting installer shell script that is normally provided by buildtools-tarball.

This series has been tested on the following Windows targets, executing QEMU 2.7.0 with all qemu* oe-core machines and all qemu machines in meta-xilinx:

* Windows 10 (64-bit)
* Windows 8.1 (64-bit)
* Windows 7 SP1 (64-bit)

Additionally this series has been build tested on the following Linux build hosts:

* Debian 8 (64-bit)
* Ubuntu 16.04 (64-bit)
* CentOS 7 (64-bit)

There are a number of patches in this series which could be applied in oe-core/meta or meta-mingw. Depending the patch it may be desired for the change to be in meta-mingw instead of oe-core. If this is a case I can modify and make the changes for meta-mingw. This is the reason behind the segmentation of changes as small individual patches.

This work is contracted by Xilinx, and it intended to allow for the building of the Xilinx QEMU fork for Windows (recipe is in the meta-xilinx layer ->
http://git.yoctoproject.org/cgit/cgit.cgi/meta-xilinx/tree/recipes-devtools/qemu/qemu-xilinx_2016.4.bb).
The desired configuration for this QEMU fork is to have libgcrypt support in addition to what is needed for the default oe-core QEMU configuration, this is the reason for the inclusion of libgpg-error and libgcrypt changes.

For convenience this series is also available in the git repository:

https://github.com/nathanrossi/openembedded-core nrossi/mingw-qemu-v1

Nathan Rossi (30):
gcc-configure-common.inc: Change 'initfini-array' to PACKAGECONFIG update-alternatives.bbclass: Disable for mingw32 targets package.bbclass: Add SHLIB detection support for mingw targets bitbake.conf: Add '${libdir}/*.def' to FILES_${PN}-dev defaults bitbake.conf: Override FILES_${PN}-bin for mingw32 libpcre_8.39.bb: Handle shipping .exe and .dll files for mingw32 gettext_0.19.8.1.bb: Fix shared building of gettext for mingw32 gettext_0.19.8.1.bb: Handle packaging .dll's for mingw32 gettext_0.19.8.1.bb: Add 'gettext-libintl' package libsdl_1.2.16.bb: Disable x11 for nativesdk mingw32 libsdl_1.2.15.bb: Add 'directx' PACKAGECONFIG libsdl_1.2.15.bb: Add 'stdio-redirect' PACKAGECONFIG glib-2.0/glib.inc: Disable libmount support for mingw32 targets glib-2.0/glib.inc: Only apply MLPREFIX renaming to class-target glib-2.0/glib.inc: If 'charset.alias' exists drop it glib-2.0/glib.inc: Handle packaging .dll and .exe files for mingw32 libgpg-error_1.25.bb: Enable nativesdk libgpg-error_1.25.bb: Add patch to resolve configure bug for mingw32 libgpg-error_1.25.bb: Don't replace the syscfg header for mingw32 libgpg-error_1.25.bb: Handle packaging .exe files libgcrypt.inc: Enable nativesdk
libgcrypt.inc: Add PACKAGECONFIG for 'capabilities' and 'asm' libgcrypt.inc: Disable 'capabilities' for mingw32 libgcrypt.inc: Add patch to resolve configure bug for mingw32 libgcrypt.inc: Enable use of binconfig
libgcrypt.inc: Handle packaging of .exe files
qemu: Improve and add PACKAGECONFIG options
qemu: Consolidate EXTRA_OECONF
qemu: Convert KVMOPTS to PACKAGECONFIG
qemu: Move recipe version specific patches and features to recipe

 meta/classes/package.bbclass                       | 21 ++++++
 meta/classes/update-alternatives.bbclass           |  4 +
 meta/conf/bitbake.conf                             |  5 +-
 .../fix-gl_cv_prog_as_underscore-test.patch        | 67 +++++++++++++++++
 meta/recipes-core/gettext/gettext_0.19.8.1.bb      | 17 +++--
 meta/recipes-core/glib-2.0/glib.inc                | 23 ++++--
 meta/recipes-devtools/gcc/gcc-configure-common.inc |  8 +-
 meta/recipes-devtools/qemu/qemu.inc                | 85 +++++++++-------------
 meta/recipes-devtools/qemu/qemu_2.7.0.bb           | 34 ++++++++-
 meta/recipes-graphics/libsdl/libsdl_1.2.15.bb      |  3 +
 ...c-Set-mym4_revision-to-0-if-not-a-git-rep.patch | 46 ++++++++++++
 meta/recipes-support/libgcrypt/libgcrypt.inc       | 17 +++--
 ...c-Set-mym4_revision-to-0-if-not-a-git-rep.patch | 46 ++++++++++++
 .../libgpg-error/libgpg-error_1.25.bb              | 17 +++--
 meta/recipes-support/libpcre/libpcre_8.39.bb       |  8 +-
 15 files changed, 313 insertions(+), 88 deletions(-)
 create mode 100644 meta/recipes-core/gettext/gettext-0.19.8.1/fix-gl_cv_prog_as_underscore-test.patch
 create mode 100644 meta/recipes-support/libgcrypt/files/configure.ac-Set-mym4_revision-to-0-if-not-a-git-rep.patch
 create mode 100644 meta/recipes-support/libgpg-error/libgpg-error/configure.ac-Set-mym4_revision-to-0-if-not-a-git-rep.patch
Signature · 1 line
2.11.0
#1 lore raw

PATCH 1/30 gcc-configure-common.inc: Change 'initfini-array' to PACKAGECONFIG

Change the '--enable-initfini-array' default config to a PACKAGECONFIG so that it can be disabled (e.g. for mingw32).

The 'initfini-array' option works only for Linux so disable it for mingw32. Otherwise eventually the build will encounter errors like (gcc-crosssdk):

multiple definition of `__do_global_dtors'

Or errors like (gcc-crosssdk-initial):

Assembler messages:
Error: invalid instruction suffix for `push'
Error: invalid instruction suffix for `pop'

---

This patch uses PACKAGECONFIG as suggested by Khem on an existing meta-mingw series by Juro.

https://lists.yoctoproject.org/pipermail/yocto/2016-October/032310.html

This patch also consolidates the two patches in the mentioned series such that initfini-array is disabled for any gcc build that is targeting mingw32.

https://lists.yoctoproject.org/pipermail/yocto/2016-October/032305.html
https://lists.yoctoproject.org/pipermail/yocto/2016-October/032307.html

---
 meta/recipes-devtools/gcc/gcc-configure-common.inc | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
meta/recipes-devtools/gcc/gcc-configure-common.inc +5 -3
index 00ef89ec57..cec17064fe 100644
@@ -15,6 +15,9 @@ JAVA_sh3 ?= ""
 FORTRAN ?= ",f77"
 LANGUAGES ?= "c,c++${FORTRAN}${JAVA}"
 
+PACKAGECONFIG ?= "initfini-array"
+PACKAGECONFIG_remove_mingw32 = "initfini-array"
+
 EXTRA_OECONF_BASE ?= ""
 EXTRA_OECONF_PATHS ?= ""
 EXTRA_OECONF_INITIAL ?= ""
@@ -44,9 +47,8 @@ EXTRA_OECONF = "\
     ${@get_gcc_multiarch_setting(bb, d)} \
 "
 
-# Set this here since GCC configure won't auto-detect and enable
-# initfini-arry when cross compiling.
-EXTRA_OECONF_append = " --enable-initfini-array"
+# GCC does not auto-detect initfini-array when cross compiling
+PACKAGECONFIG[initfini-array] = "--enable-initfini-array,--disable-initfini-array"
 
 export gcc_cv_collect2_libs = 'none required'
 # We need to set gcc_cv_collect2_libs else there is cross-compilation badness
Signature · 1 line
2.11.0
#2 lore raw

PATCH 2/30 update-alternatives.bbclass: Disable for mingw32 targets

In reply to Nathan Rossi

When building for mingw32 targets (e.g. nativesdk cross compiling for windows), disable the dependency on update-alternatives as the Windows platform does not support symlinks or package management.

This avoids the complex (partly non-buildable for mingw32) dependency chain virtual/update-alternatives -> opkg-utils -> python -> ...

---
 meta/classes/update-alternatives.bbclass | 4 ++++
 1 file changed, 4 insertions(+)
meta/classes/update-alternatives.bbclass +4 -0
index a90ef19e45..220171df4d 100644
@@ -94,6 +94,10 @@ python __anonymous() {
        bb.data.inherits_class('cross-canadian', d):
         return
 
+    # Disable when targeting mingw32 (no target support)
+    if d.getVar("TARGET_OS") == "mingw32":
+        return
+
     # compute special vardeps
     gen_updatealternativesvardeps(d)
 
Signature · 1 line
2.11.0
#3 lore raw

PATCH 3/30 package.bbclass: Add SHLIB detection support for mingw targets

In reply to Nathan Rossi

Add support to detect dll files as shared objects as well as process Windows .dll and .exe files to determine the runtime libraries dependencies.

This implementation is sufficient to detect and map runtime library dependencies between packages. And does not implement any version naming conventions that might apply for .dll files (e.g. lib*-x.dll).

---
 meta/classes/package.bbclass | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)
meta/classes/package.bbclass +21 -0
index 568b85c12a..e3b609173a 100644
@@ -1604,6 +1604,25 @@ python package_do_shlibs() {
                 if name and name not in needed[pkg]:
                      needed[pkg].append((name, file, []))
 
+    def mingw_dll(file, needed, sonames, renames, pkgver):
+        if not os.path.exists(file):
+            return
+
+        if file.endswith(".dll"):
+            # assume all dlls are shared objects provided by the package
+            sonames.append((os.path.basename(file), os.path.dirname(file).replace(pkgdest + "/" + pkg, ''), pkgver))
+
+        if (file.endswith(".dll") or file.endswith(".exe")):
+            # use objdump to search for "DLL Name: .*\.dll"
+            p = sub.Popen([d.expand("${HOST_PREFIX}objdump"), "-p", file], stdout = sub.PIPE, stderr= sub.PIPE)
+            out, err = p.communicate()
+            # process the output, grabbing all .dll names
+            if p.returncode == 0:
+                for m in re.finditer("DLL Name: (.*?\.dll)$", out.decode(), re.MULTILINE | re.IGNORECASE):
+                    dllname = m.group(1)
+                    if dllname:
+                        needed[pkg].append((dllname, file, []))
+
     if d.getVar('PACKAGE_SNAP_LIB_SYMLINKS') == "1":
         snap_symlinks = True
     else:
@@ -1638,6 +1657,8 @@ python package_do_shlibs() {
                     continue
                 if targetos == "darwin" or targetos == "darwin8":
                     darwin_so(file, needed, sonames, renames, pkgver)
+                elif targetos.startswith("mingw"):
+                    mingw_dll(file, needed, sonames, renames, pkgver)
                 elif os.access(file, os.X_OK) or lib_re.match(file):
                     ldconfig = linux_so(file, needed, sonames, renames, pkgver)
                     needs_ldconfig = needs_ldconfig or ldconfig
Signature · 1 line
2.11.0
#4 lore raw

PATCH 4/30 bitbake.conf: Add '${libdir}/*.def' to FILES_${PN}-dev defaults

In reply to Nathan Rossi

The *.def files that are populated in ${libdir} define the list of exported functions for Windows DLLs. Whilst *.def files exist for other formats they are not shipped in the ${libdir}.

---
 meta/conf/bitbake.conf | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
meta/conf/bitbake.conf +2 -1
index 40efb959e6..5dbcf5c441 100644
@@ -301,7 +301,8 @@ FILES_SOLIBSDEV ?= "${base_libdir}/lib*${SOLIBSDEV} ${libdir}/lib*${SOLIBSDEV}"
 FILES_${PN}-dev = "${includedir} ${FILES_SOLIBSDEV} ${libdir}/*.la \
                 ${libdir}/*.o ${libdir}/pkgconfig ${datadir}/pkgconfig \
                 ${datadir}/aclocal ${base_libdir}/*.o \
-                ${libdir}/${BPN}/*.la ${base_libdir}/*.la"
+                ${libdir}/${BPN}/*.la ${base_libdir}/*.la \
+                ${libdir}/*.def"
 SECTION_${PN}-dev = "devel"
 ALLOW_EMPTY_${PN}-dev = "1"
 RDEPENDS_${PN}-dev = "${PN} (= ${EXTENDPKGV})"
Signature · 1 line
2.11.0
#5 lore raw

PATCH 5/30 bitbake.conf: Override FILES_${PN}-bin for mingw32

In reply to Nathan Rossi

On MinGW32 targets (aka Windows) it is convention to have DLLs in bindir along side the executables. This is due to how Windows does not have a bindir/libdir separation and thus cannot handle dynamic loading in the same way as other targets (e.g. glibc). To avoid grouping anything other that .exe files into the ${PN}-bin packages, override it so that on mingw32 targets only '${bindir}/*.exe' files are shipped by default.

---
 meta/conf/bitbake.conf | 2 ++
 1 file changed, 2 insertions(+)
meta/conf/bitbake.conf +2 -0
index 5dbcf5c441..6eb60a8553 100644
@@ -292,6 +292,8 @@ FILES_${PN} = "${bindir}/* ${sbindir}/* ${libexecdir}/* ${libdir}/lib*${SOLIBS}
             ${libdir}/bonobo/servers"
 
 FILES_${PN}-bin = "${bindir}/* ${sbindir}/*"
+# For mingw32 limit the -bin pkg to only have .exe's
+FILES_${PN}-bin_mingw32 = "${bindir}/*.exe ${sbindir}/*.exe"
 
 FILES_${PN}-doc = "${docdir} ${mandir} ${infodir} ${datadir}/gtk-doc \
             ${datadir}/gnome/help"
Signature · 1 line
2.11.0
#6 lore raw

PATCH 6/30 libpcre_8.39.bb: Handle shipping .exe and .dll files for mingw32

In reply to Nathan Rossi

Package the .dll and .exe files into their expected packages.

---
 meta/recipes-support/libpcre/libpcre_8.39.bb | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
meta/recipes-support/libpcre/libpcre_8.39.bb +4 -4
index 2d4668b52d..1d2e98d051 100644
@@ -59,11 +59,11 @@ SUMMARY_pcregrep-doc = "grep utility that uses perl 5 compatible regexes - docs"
 SUMMARY_pcretest = "program for testing Perl-comatible regular expressions"
 SUMMARY_pcretest-doc = "program for testing Perl-comatible regular expressions - docs"
 
-FILES_libpcrecpp = "${libdir}/libpcrecpp.so.*"
-FILES_libpcreposix = "${libdir}/libpcreposix.so.*"
-FILES_pcregrep = "${bindir}/pcregrep"
+FILES_libpcrecpp = "${libdir}/libpcrecpp.so.* ${bindir}/libpcrecpp*.dll"
+FILES_libpcreposix = "${libdir}/libpcreposix.so.* ${bindir}/libpcreposix*.dll"
+FILES_pcregrep = "${bindir}/pcregrep*"
 FILES_pcregrep-doc = "${mandir}/man1/pcregrep.1"
-FILES_pcretest = "${bindir}/pcretest"
+FILES_pcretest = "${bindir}/pcretest*"
 FILES_pcretest-doc = "${mandir}/man1/pcretest.1"
 
 BBCLASSEXTEND = "native nativesdk"
Signature · 1 line
2.11.0
#7 lore raw

PATCH 7/30 gettext_0.19.8.1.bb: Fix shared building of gettext for mingw32

In reply to Nathan Rossi

Fix building of shared gettext for i686/32-bit mingw32. This adds a patch which fixes an issue with gnulib that is included in gettext.

This patch does not need to be submitted upstream as it is fixing an issue with the included version of gnulib. Upstream gnulib has already fixed this issue and upstream gettext has already updated the included gnulib, however gettext has not yet made a release that includes this fix.

---
 .../fix-gl_cv_prog_as_underscore-test.patch        | 67 ++++++++++++++++++++++
 meta/recipes-core/gettext/gettext_0.19.8.1.bb      |  1 +
 2 files changed, 68 insertions(+)
 create mode 100644 meta/recipes-core/gettext/gettext-0.19.8.1/fix-gl_cv_prog_as_underscore-test.patch
meta/recipes-core/gettext/gettext-0.19.8.1/fix-gl_cv_prog_as_underscore-test.patch new file +67 -0
new file mode 100644
index 0000000000..636789f31d
@@ -0,0 +1,67 @@
+Backport gnulib fix for mingw into gettext's included version of gnulib
+
+http://git.savannah.gnu.org/cgit/gnulib.git/commit/?id=68b6adebef05670a312fb92b05e7bd089d2ed43a
+
+Upstream-Status: Backport
+Signed-off-by: Nathan Rossi <[email protected]>
+
+--- a/gettext-runtime/gnulib-m4/asm-underscore.m4
++++ b/gettext-runtime/gnulib-m4/asm-underscore.m4
+@@ -27,11 +27,11 @@
+ #endif
+ int foo(void) { return 0; }
+ EOF
+      # Look for the assembly language name in the .s file.
+      AC_TRY_COMMAND(${CC-cc} $CFLAGS $CPPFLAGS $gl_c_asm_opt conftest.c) >/dev/null 2>&1
+-     if LC_ALL=C grep -E '(^|[^a-zA-Z0-9_])_foo([^a-zA-Z0-9_]|$)' conftest.$gl_asmext >/dev/null; then
++     if LC_ALL=C grep -E '(^|[[^a-zA-Z0-9_]])_foo([[^a-zA-Z0-9_]]|$)' conftest.$gl_asmext >/dev/null; then
+        gl_cv_prog_as_underscore=yes
+      else
+        gl_cv_prog_as_underscore=no
+      fi
+      rm -f conftest*
+--- a/gettext-runtime/configure
++++ b/gettext-runtime/configure
+@@ -24601,11 +24601,11 @@
+   { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+   (eval $ac_try) 2>&5
+   ac_status=$?
+   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+   test $ac_status = 0; }; } >/dev/null 2>&1
+-     if LC_ALL=C grep -E '(^|^a-zA-Z0-9_)_foo(^a-zA-Z0-9_|$)' conftest.$gl_asmext >/dev/null; then
++     if LC_ALL=C grep -E '(^|[^a-zA-Z0-9_])_foo([^a-zA-Z0-9_]|$)' conftest.$gl_asmext >/dev/null; then
+        gl_cv_prog_as_underscore=yes
+      else
+        gl_cv_prog_as_underscore=no
+      fi
+      rm -f conftest*
+--- a/gettext-tools/gnulib-m4/asm-underscore.m4
++++ b/gettext-tools/gnulib-m4/asm-underscore.m4
+@@ -27,11 +27,11 @@
+ #endif
+ int foo(void) { return 0; }
+ EOF
+      # Look for the assembly language name in the .s file.
+      AC_TRY_COMMAND(${CC-cc} $CFLAGS $CPPFLAGS $gl_c_asm_opt conftest.c) >/dev/null 2>&1
+-     if LC_ALL=C grep -E '(^|[^a-zA-Z0-9_])_foo([^a-zA-Z0-9_]|$)' conftest.$gl_asmext >/dev/null; then
++     if LC_ALL=C grep -E '(^|[[^a-zA-Z0-9_]])_foo([[^a-zA-Z0-9_]]|$)' conftest.$gl_asmext >/dev/null; then
+        gl_cv_prog_as_underscore=yes
+      else
+        gl_cv_prog_as_underscore=no
+      fi
+      rm -f conftest*
+--- a/gettext-tools/configure
++++ b/gettext-tools/configure
+@@ -32284,11 +32284,11 @@
+   { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+   (eval $ac_try) 2>&5
+   ac_status=$?
+   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+   test $ac_status = 0; }; } >/dev/null 2>&1
+-     if LC_ALL=C grep -E '(^|^a-zA-Z0-9_)_foo(^a-zA-Z0-9_|$)' conftest.$gl_asmext >/dev/null; then
++     if LC_ALL=C grep -E '(^|[^a-zA-Z0-9_])_foo([^a-zA-Z0-9_]|$)' conftest.$gl_asmext >/dev/null; then
+        gl_cv_prog_as_underscore=yes
+      else
+        gl_cv_prog_as_underscore=no
+      fi
+      rm -f conftest*
meta/recipes-core/gettext/gettext_0.19.8.1.bb +1 -0
index 7b8c1e8eb4..0f4b556046 100644
@@ -13,6 +13,7 @@ RCONFLICTS_${PN} = "proxy-libintl"
 SRC_URI = "${GNU_MIRROR}/gettext/gettext-${PV}.tar.gz \
 	   file://parallel.patch \
 	   file://add-with-bisonlocaledir.patch \
+	   file://fix-gl_cv_prog_as_underscore-test.patch \
 "
 
 SRC_URI[md5sum] = "97e034cf8ce5ba73a28ff6c3c0638092"
Signature · 1 line
2.11.0
#8 lore raw

PATCH 8/30 gettext_0.19.8.1.bb: Handle packaging .dll's for mingw32

In reply to Nathan Rossi

Package the libgettext*.dll files in their respective packages.

---
 meta/recipes-core/gettext/gettext_0.19.8.1.bb | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
meta/recipes-core/gettext/gettext_0.19.8.1.bb +2 -2
index 0f4b556046..67173f247c 100644
@@ -64,8 +64,8 @@ do_install_append_libc-musl () {
 # 4       KiB /ep93xx/libgcc-s-dev_4.2.2-r2_ep93xx.ipk
 
 PACKAGES =+ "libgettextlib libgettextsrc"
-FILES_libgettextlib = "${libdir}/libgettextlib-*.so*"
-FILES_libgettextsrc = "${libdir}/libgettextsrc-*.so*"
+FILES_libgettextlib = "${libdir}/libgettextlib-*.so* ${bindir}/libgettextlib-*.dll"
+FILES_libgettextsrc = "${libdir}/libgettextsrc-*.so* ${bindir}/libgettextsrc-*.dll"
 
 PACKAGES =+ "gettext-runtime gettext-runtime-dev gettext-runtime-doc"
 
Signature · 1 line
2.11.0
#9 lore raw

PATCH 9/30 gettext_0.19.8.1.bb: Add 'gettext-libintl' package

In reply to Nathan Rossi

Add a package called 'gettext-libintl' which ships the libintl shared objects (.so/.dll). This allows for the library to be shipped without the additional components included in the gettext-runtime package.

This packages is prefixed with 'gettext-' to define the source of the library due to the existence of multiple providers for libintl.

This change also makes the libintl*.so and .h packaged into the gettext-runtime-dev package by default. Removing the need for a uclibc override to handle packaging these files. Targets that don't intend to distribute these files already remove them during the do_install stage (e.g. musl).

---
 meta/recipes-core/gettext/gettext_0.19.8.1.bb | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
meta/recipes-core/gettext/gettext_0.19.8.1.bb +6 -6
index 67173f247c..f43594686e 100644
@@ -67,6 +67,9 @@ PACKAGES =+ "libgettextlib libgettextsrc"
 FILES_libgettextlib = "${libdir}/libgettextlib-*.so* ${bindir}/libgettextlib-*.dll"
 FILES_libgettextsrc = "${libdir}/libgettextsrc-*.so* ${bindir}/libgettextsrc-*.dll"
 
+PACKAGES =+ "gettext-libintl"
+FILES_gettext-libintl = "${libdir}/libintl*.so.* ${bindir}/libintl*.dll"
+
 PACKAGES =+ "gettext-runtime gettext-runtime-dev gettext-runtime-doc"
 
 FILES_${PN} += "${libdir}/${BPN}/*"
@@ -83,15 +86,12 @@ FILES_gettext-runtime = "${bindir}/gettext \
                          ${libdir}/libasprintf.so* \
                          ${libdir}/GNU.Gettext.dll \
                         "
-FILES_gettext-runtime_append_libc-uclibc = " ${libdir}/libintl.so.* \
-                                             ${libdir}/charset.alias \
-                                           "
+FILES_gettext-runtime_append_libc-uclibc = " ${libdir}/charset.alias"
 FILES_gettext-runtime-dev += "${libdir}/libasprintf.a \
                       ${includedir}/autosprintf.h \
+                      ${libdir}/libintl*.so \
+                      ${includedir}/libintl.h \
                      "
-FILES_gettext-runtime-dev_append_libc-uclibc = " ${libdir}/libintl.so \
-                                                 ${includedir}/libintl.h \
-                                               "
 FILES_gettext-runtime-doc = "${mandir}/man1/gettext.* \
                              ${mandir}/man1/ngettext.* \
                              ${mandir}/man1/envsubst.* \
Signature · 1 line
2.11.0
#10 lore raw

PATCH 10/30 libsdl_1.2.16.bb: Disable x11 for nativesdk mingw32

In reply to Nathan Rossi

Disable X11 support when building for the nativesdk mingw32.

---
 meta/recipes-graphics/libsdl/libsdl_1.2.15.bb | 1 +
 1 file changed, 1 insertion(+)
meta/recipes-graphics/libsdl/libsdl_1.2.15.bb +1 -0
index 9c0ec541e3..e770b5f051 100644
@@ -48,6 +48,7 @@ PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'alsa', 'alsa', '', d
                    ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11', '', d)}"
 PACKAGECONFIG_class-native = "x11"
 PACKAGECONFIG_class-nativesdk = "${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11', '', d)}"
+PACKAGECONFIG_class-nativesdk_mingw32 = ""
 
 PACKAGECONFIG[alsa] = "--enable-alsa --disable-alsatest,--disable-alsa,alsa-lib"
 PACKAGECONFIG[pulseaudio] = "--enable-pulseaudio,--disable-pulseaudio,pulseaudio"
Signature · 1 line
2.11.0
#11 lore raw

PATCH 11/30 libsdl_1.2.15.bb: Add 'directx' PACKAGECONFIG

In reply to Nathan Rossi

Add the 'directx' PACKAGECONFIG to configure whether to build with DirectX support. By default this is enabled (when targeting mingw32/windows) however this requires the DirectX libraries in order to include and link against.

---
 meta/recipes-graphics/libsdl/libsdl_1.2.15.bb | 1 +
 1 file changed, 1 insertion(+)
meta/recipes-graphics/libsdl/libsdl_1.2.15.bb +1 -0
index e770b5f051..21dfb9fdb9 100644
@@ -56,6 +56,7 @@ PACKAGECONFIG[tslib] = "--enable-input-tslib, --disable-input-tslib, tslib"
 PACKAGECONFIG[directfb] = "--enable-video-directfb, --disable-video-directfb, directfb"
 PACKAGECONFIG[opengl] = "--enable-video-opengl, --disable-video-opengl, virtual/libgl libglu"
 PACKAGECONFIG[x11] = "--enable-video-x11 --disable-x11-shared, --disable-video-x11, virtual/libx11 libxext libxrandr libxrender"
+PACKAGECONFIG[directx] = "--enable-directx,--disable-directx"
 
 EXTRA_AUTORECONF += "--include=acinclude --exclude=autoheader"
 
Signature · 1 line
2.11.0
#12 lore raw

PATCH 12/30 libsdl_1.2.15.bb: Add 'stdio-redirect' PACKAGECONFIG

In reply to Nathan Rossi

Add a PACKAGECONFIG for 'stdio-redirect'. This configure option enables/disables the Windows only option for redirecting the stdout/stderr to files instead of to the console.

---
 meta/recipes-graphics/libsdl/libsdl_1.2.15.bb | 1 +
 1 file changed, 1 insertion(+)
meta/recipes-graphics/libsdl/libsdl_1.2.15.bb +1 -0
index 21dfb9fdb9..591aa81343 100644
@@ -57,6 +57,7 @@ PACKAGECONFIG[directfb] = "--enable-video-directfb, --disable-video-directfb, di
 PACKAGECONFIG[opengl] = "--enable-video-opengl, --disable-video-opengl, virtual/libgl libglu"
 PACKAGECONFIG[x11] = "--enable-video-x11 --disable-x11-shared, --disable-video-x11, virtual/libx11 libxext libxrandr libxrender"
 PACKAGECONFIG[directx] = "--enable-directx,--disable-directx"
+PACKAGECONFIG[stdio-redirect] = "--enable-stdio-redirect,--disable-stdio-redirect"
 
 EXTRA_AUTORECONF += "--include=acinclude --exclude=autoheader"
 
Signature · 1 line
2.11.0
#13 lore raw

PATCH 13/30 glib-2.0/glib.inc: Disable libmount support for mingw32 targets

In reply to Nathan Rossi

MinGW/Windows does not have support for libmount, so disable it when targeting mingw32.

---
 meta/recipes-core/glib-2.0/glib.inc | 2 ++
 1 file changed, 2 insertions(+)
meta/recipes-core/glib-2.0/glib.inc +2 -0
index cb6aca702f..0f8535b1b3 100644
@@ -31,6 +31,8 @@ inherit autotools gettext gtk-doc pkgconfig ptest-gnome upstream-version-is-even
 S = "${WORKDIR}/glib-${PV}"
 
 PACKAGECONFIG ??= "system-pcre libmount"
+PACKAGECONFIG_remove_mingw32 = "libmount"
+
 # To use the system pcre it must be configured with --enable-unicode-properties
 PACKAGECONFIG[system-pcre] = "--with-pcre=system,--with-pcre=internal,libpcre"
 PACKAGECONFIG[libmount] = "--enable-libmount,--disable-libmount,util-linux"
Signature · 1 line
2.11.0
#14 lore raw

PATCH 14/30 glib-2.0/glib.inc: Only apply MLPREFIX renaming to class-target

In reply to Nathan Rossi

When renaming the 'gio-querymodules' binary to prefix with the current MLPREFIX, only do this for target packages where the MLPREFIX makes sense. This skips renaming for nativesdk targets which have MLPREFIX set to 'nativesdk-'.

---
 meta/recipes-core/glib-2.0/glib.inc | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
meta/recipes-core/glib-2.0/glib.inc +6 -4
index 0f8535b1b3..b892989b87 100644
@@ -99,11 +99,13 @@ do_install_append () {
 			rm ${D}${datadir}/installed-tests/glib/gdbus-serialization.test
 		fi
 	fi
+}
 
-        # Make sure gio-querymodules is unique among multilibs
-        if test "x${MLPREFIX}" != "x"; then
-                mv ${D}${libexecdir}/gio-querymodules ${D}${libexecdir}/${MLPREFIX}gio-querymodules
-        fi
+do_install_append_class-target () {
+	# Make sure gio-querymodules is unique among multilibs
+	if test "x${MLPREFIX}" != "x"; then
+		mv ${D}${libexecdir}/gio-querymodules ${D}${libexecdir}/${MLPREFIX}gio-querymodules
+	fi
 }
 
 do_install_append_libc-musl () {
Signature · 1 line
2.11.0
#15 lore raw

PATCH 15/30 glib-2.0/glib.inc: If 'charset.alias' exists drop it

In reply to Nathan Rossi

Delete the 'charset.alias' file during the do_install task if it exists. This file is not shipped in any packages and on the targets that it is generated (musl and mingw32) it is undesired.

---
 meta/recipes-core/glib-2.0/glib.inc | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
meta/recipes-core/glib-2.0/glib.inc +4 -4
index b892989b87..24b31a7f9f 100644
@@ -99,6 +99,10 @@ do_install_append () {
 			rm ${D}${datadir}/installed-tests/glib/gdbus-serialization.test
 		fi
 	fi
+
+	if [ -e ${D}${libdir}/charset.alias ]; then
+		rm -f ${D}${libdir}/charset.alias
+	fi
 }
 
 do_install_append_class-target () {
@@ -108,10 +112,6 @@ do_install_append_class-target () {
 	fi
 }
 
-do_install_append_libc-musl () {
-	rm -f ${D}${libdir}/charset.alias
-}
-
 RDEPENDS_${PN}-ptest += "\
             gnome-desktop-testing \
             tzdata \
Signature · 1 line
2.11.0
#16 lore raw

PATCH 16/30 glib-2.0/glib.inc: Handle packaging .dll and .exe files for mingw32

In reply to Nathan Rossi

Handle the packaging of .dll files into the ${PN} package, this is required due to the mingw/windows convention where .dll's are shipped in the bindir.

Wildcard the suffix of '*gio-querymodules' so that the .exe versions are also included in the ${PN} package.

Also handle the packaging of only .exe files into the ${PN}-utils package. As mentioned above, bindir includes more than just binary executables.

---
 meta/recipes-core/glib-2.0/glib.inc | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
meta/recipes-core/glib-2.0/glib.inc +5 -2
index 24b31a7f9f..4ed2808d0f 100644
@@ -52,9 +52,11 @@ do_configure_prepend() {
 }
 
 FILES_${PN} = "${libdir}/lib*${SOLIBS} \
+               ${bindir}/lib*.dll \
                ${libdir}/gio \
-               ${libexecdir}/*gio-querymodules \
-               ${datadir}/glib-2.0/schemas"
+               ${libexecdir}/*gio-querymodules* \
+               ${datadir}/glib-2.0/schemas \
+               "
 FILES_${PN}-dev += "${libdir}/glib-2.0/include \
                     ${libdir}/gio/modules/lib*${SOLIBSDEV} \
                     ${libdir}/gio/modules/*.la \
@@ -69,6 +71,7 @@ FILES_${PN}-dbg += "${datadir}/glib-2.0/gdb ${datadir}/gdb"
 FILES_${PN}-codegen = "${datadir}/glib-2.0/codegen/*.py \
                        ${bindir}/gdbus-codegen"
 FILES_${PN}-utils = "${bindir}/*"
+FILES_${PN}-utils_mingw32 = "${bindir}/*.exe"
 
 ARM_INSTRUCTION_SET_armv4 = "arm"
 ARM_INSTRUCTION_SET_armv5 = "arm"
Signature · 1 line
2.11.0
#17 lore raw

PATCH 17/30 libgpg-error_1.25.bb: Enable nativesdk

In reply to Nathan Rossi

Enable nativesdk on this recipe.

---
 meta/recipes-support/libgpg-error/libgpg-error_1.25.bb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/recipes-support/libgpg-error/libgpg-error_1.25.bb +1 -1
index 9d402ffbb6..d4ce224948 100644
@@ -51,4 +51,4 @@ do_install_append() {
 
 FILES_${PN}-dev += "${bindir}/gpg-error"
 
-BBCLASSEXTEND = "native"
+BBCLASSEXTEND = "native nativesdk"
Signature · 1 line
2.11.0
#18 lore raw

PATCH 18/30 libgpg-error_1.25.bb: Add patch to resolve configure bug for mingw32

In reply to Nathan Rossi

Resolve bug with the generation of the versioninfo.rc file which depends on the BUILD_REVISION being set during configure. The BUILD_REVISION is unset when building against tarball source due to no git repository information. This patch sets the BUILD_REVISION to 0 when no information is available.

---
 ...c-Set-mym4_revision-to-0-if-not-a-git-rep.patch | 46 ++++++++++++++++++++++
 .../libgpg-error/libgpg-error_1.25.bb              |  2 +
 2 files changed, 48 insertions(+)
 create mode 100644 meta/recipes-support/libgpg-error/libgpg-error/configure.ac-Set-mym4_revision-to-0-if-not-a-git-rep.patch
meta/recipes-support/libgpg-error/libgpg-error/configure.ac-Set-mym4_revision-to-0-if-not-a-git-rep.patch new file +46 -0
new file mode 100644
index 0000000000..ea5a10261c
@@ -0,0 +1,46 @@
+From 274bb6fc22f8e0bfe521305d5e67eee268cabf7f Mon Sep 17 00:00:00 2001
+From: Nathan Rossi <[email protected]>
+Date: Fri, 30 Dec 2016 18:02:26 +1000
+Subject: [PATCH] configure.ac: Set 'mym4_revision' to 0 if not a git repo
+
+---
+It is possible for the source to not be located in a git repository
+(e.g. source is from a tarball). In which case the git repository
+information is not available. This results in the mym4_revision being an
+empty string however this value is used in BUILD_FILEVERSION where it is
+assumed to be 4 decimal values. Additionally BUILD_REVISION uses this
+value and is also assumed to be non-empty.
+
+In the case of BUILD_FILEVERSION it is used in versioninfo.rc.in, where
+it must be populated as 4 decimal values due to the expected syntax. In
+cases where it is not (e.g. when BUILD_FILEVERSION = '1,26,0,' a syntax
+error is raised.
+
+    windres: versioninfo.rc.in:21: syntax error
+
+This patch changes mym4_revision so that if the 'git rev-parse' returns
+non-zero (e.g. not in a git repository) the value falls back to '0'.
+This propagates as '0' to both BUILD_FILEVERSION and BUILD_REVISION.
+
+Signed-off-by: Nathan Rossi <[email protected]>
+Upstream-Status: Submitted
+---
+ configure.ac | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index 6d4f173d1b..149ac02b5f 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -35,7 +35,7 @@ m4_define([mym4_version_minor], [27])
+ # processing is done by autoconf and not during the configure run.
+ m4_define([mym4_version], [mym4_version_major.mym4_version_minor])
+ m4_define([mym4_revision],
+-          m4_esyscmd([git rev-parse --short HEAD | tr -d '\n\r']))
++          m4_esyscmd([(git rev-parse --short HEAD || printf '0') | tr -d '\n\r']))
+ m4_define([mym4_revision_dec],
+           m4_esyscmd_s([echo $((0x$(echo ]mym4_revision[|head -c 4)))]))
+ m4_define([mym4_betastring],
+-- 
+2.11.0
+
meta/recipes-support/libgpg-error/libgpg-error_1.25.bb +2 -0
index d4ce224948..c6a6ba098d 100644
@@ -14,8 +14,10 @@ SECTION = "libs"
 UPSTREAM_CHECK_URI = "https://gnupg.org/download/index.html"
 SRC_URI = "${GNUPG_MIRROR}/libgpg-error/libgpg-error-${PV}.tar.bz2 \
            file://pkgconfig.patch \
+           file://configure.ac-Set-mym4_revision-to-0-if-not-a-git-rep.patch \
 	  "
 
+
 SRC_URI[md5sum] = "d9fa545922a5060cbfbd87464bc31686"
 SRC_URI[sha256sum] = "f628f75843433b38b05af248121beb7db5bd54bb2106f384edac39934261320c"
 
Signature · 1 line
2.11.0
#19 lore raw

PATCH 19/30 libgpg-error_1.25.bb: Don't replace the syscfg header for mingw32

In reply to Nathan Rossi

For mingw32 targets do not attempt to replace the syscfg/lock-obj-pub.*.h as for mingw32 there are no arch specific headers that are included in the libgpg-error source.

---
 meta/recipes-support/libgpg-error/libgpg-error_1.25.bb | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)
meta/recipes-support/libgpg-error/libgpg-error_1.25.bb +8 -3
index c6a6ba098d..278ec63bd1 100644
@@ -27,7 +27,10 @@ inherit autotools binconfig-disabled pkgconfig gettext
 CPPFLAGS += "-P"
 do_compile_prepend() {
 	TARGET_FILE=linux-gnu
-	if [ ${TARGET_OS} != "linux" ]; then
+	if [ ${TARGET_OS} = "mingw32" ]; then
+		# There are no arch specific syscfg files for mingw32
+		TARGET_FILE=
+	elif [ ${TARGET_OS} != "linux" ]; then
 		TARGET_FILE=${TARGET_OS}
 	fi
 
@@ -42,8 +45,10 @@ do_compile_prepend() {
 	  *)          TUPLE=${TARGET_ARCH}-unknown-linux-gnu ;; 
 	esac
 
-	cp ${S}/src/syscfg/lock-obj-pub.$TUPLE.h \
-	  ${S}/src/syscfg/lock-obj-pub.$TARGET_FILE.h
+	if [ -n "$TARGET_FILE" ]; then
+		cp ${S}/src/syscfg/lock-obj-pub.$TUPLE.h \
+			${S}/src/syscfg/lock-obj-pub.$TARGET_FILE.h
+	fi
 }
 
 do_install_append() {
Signature · 1 line
2.11.0
#20 lore raw

PATCH 20/30 libgpg-error_1.25.bb: Handle packaging .exe files

In reply to Nathan Rossi

Handle packaging gpg-error.exe in the -dev package.

---
 meta/recipes-support/libgpg-error/libgpg-error_1.25.bb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/recipes-support/libgpg-error/libgpg-error_1.25.bb +1 -1
index 278ec63bd1..3d142a1609 100644
@@ -56,6 +56,6 @@ do_install_append() {
 	rm -rf "${D}${datadir}/common-lisp/"
 }
 
-FILES_${PN}-dev += "${bindir}/gpg-error"
+FILES_${PN}-dev += "${bindir}/gpg-error*"
 
 BBCLASSEXTEND = "native nativesdk"
Signature · 1 line
2.11.0
#21 lore raw

PATCH 21/30 libgcrypt.inc: Enable nativesdk

In reply to Nathan Rossi

Enable nativesdk on this recipe.

---
 meta/recipes-support/libgcrypt/libgcrypt.inc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/recipes-support/libgcrypt/libgcrypt.inc +1 -1
index 15805cd436..c8a48623b4 100644
@@ -46,4 +46,4 @@ FILES_dumpsexp-dev += "${bindir}/dumpsexp"
 
 ARM_INSTRUCTION_SET = "arm"
 
-BBCLASSEXTEND = "native"
+BBCLASSEXTEND = "native nativesdk"
Signature · 1 line
2.11.0
#22 lore raw

PATCH 22/30 libgcrypt.inc: Add PACKAGECONFIG for 'capabilities' and 'asm'

In reply to Nathan Rossi

Add PACKAGECONFIG options for 'capabilities' and 'asm'. The 'capabilities' option implies the libcap dependency.

---
 meta/recipes-support/libgcrypt/libgcrypt.inc | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
meta/recipes-support/libgcrypt/libgcrypt.inc +5 -2
index c8a48623b4..7464637acd 100644
@@ -12,7 +12,7 @@ LICENSE_dumpsexp-dev = "GPLv3+"
 LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \
                     file://COPYING.LIB;md5=bbb461211a33b134d42ed5ee802b37ff"
 
-DEPENDS = "libgpg-error libcap"
+DEPENDS = "libgpg-error"
 
 UPSTREAM_CHECK_URI = "https://gnupg.org/download/index.html"
 SRC_URI = "${GNUPG_MIRROR}/libgcrypt/libgcrypt-${PV}.tar.gz \
@@ -26,7 +26,10 @@ BINCONFIG = "${bindir}/libgcrypt-config"
 
 inherit autotools texinfo binconfig-disabled pkgconfig
 
-EXTRA_OECONF = "--disable-asm --with-capabilities"
+PACKAGECONFIG ??= "capabilities"
+
+PACKAGECONFIG[asm] = "--enable-asm,--disable-asm"
+PACKAGECONFIG[capabilities] = "--with-capabilities,,libcap"
 
 do_configure_prepend () {
 	# Else this could be used in preference to the one in aclocal-copy
Signature · 1 line
2.11.0
#23 lore raw

PATCH 23/30 libgcrypt.inc: Disable 'capabilities' for mingw32

In reply to Nathan Rossi

libcap does not support mingw32, so disable 'capabilities' support for the mingw32 targets.

---
 meta/recipes-support/libgcrypt/libgcrypt.inc | 1 +
 1 file changed, 1 insertion(+)
meta/recipes-support/libgcrypt/libgcrypt.inc +1 -0
index 7464637acd..483b92e157 100644
@@ -27,6 +27,7 @@ BINCONFIG = "${bindir}/libgcrypt-config"
 inherit autotools texinfo binconfig-disabled pkgconfig
 
 PACKAGECONFIG ??= "capabilities"
+PACKAGECONFIG_remove_mingw32 = "capabilities"
 
 PACKAGECONFIG[asm] = "--enable-asm,--disable-asm"
 PACKAGECONFIG[capabilities] = "--with-capabilities,,libcap"
Signature · 1 line
2.11.0
#24 lore raw

PATCH 24/30 libgcrypt.inc: Add patch to resolve configure bug for mingw32

In reply to Nathan Rossi

Resolve bug with the generation of the versioninfo.rc file which depends on the BUILD_REVISION being set during configure. The BUILD_REVISION is unset when building against tarball source due to no git repository information. This patch sets the BUILD_REVISION to 0 when no information is available.

---
 ...c-Set-mym4_revision-to-0-if-not-a-git-rep.patch | 46 ++++++++++++++++++++++
 meta/recipes-support/libgcrypt/libgcrypt.inc       |  1 +
 2 files changed, 47 insertions(+)
 create mode 100644 meta/recipes-support/libgcrypt/files/configure.ac-Set-mym4_revision-to-0-if-not-a-git-rep.patch
meta/recipes-support/libgcrypt/files/configure.ac-Set-mym4_revision-to-0-if-not-a-git-rep.patch new file +46 -0
new file mode 100644
index 0000000000..b7b407ab4b
@@ -0,0 +1,46 @@
+From bb6f9e18b5ccef26978f3f3ed2fe7bf3d4d498e7 Mon Sep 17 00:00:00 2001
+From: Nathan Rossi <[email protected]>
+Date: Fri, 30 Dec 2016 18:02:26 +1000
+Subject: [PATCH] configure.ac: Set 'mym4_revision' to 0 if not a git repo
+
+---
+It is possible for the source to not be located in a git repository
+(e.g. source is from a tarball). In which case the git repository
+information is not available. This results in the mym4_revision being an
+empty string however this value is used in BUILD_FILEVERSION where it is
+assumed to be 4 decimal values. Additionally BUILD_REVISION uses this
+value and is also assumed to be non-empty.
+
+In the case of BUILD_FILEVERSION it is used in versioninfo.rc.in, where
+it must be populated as 4 decimal values due to the expected syntax. In
+cases where it is not (e.g. when BUILD_FILEVERSION = '1,7,5,' a syntax
+error is raised.
+
+    windres: versioninfo.rc.in:21: syntax error
+
+This patch changes mym4_revision so that if the 'git rev-parse' returns
+non-zero (e.g. not in a git repository) the value falls back to '0'.
+This propagates as '0' to both BUILD_FILEVERSION and BUILD_REVISION.
+
+Signed-off-by: Nathan Rossi <[email protected]>
+Upstream-Status: Submitted
+---
+ configure.ac | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index 31c0d553fa..a3deffa6e9 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -39,7 +39,7 @@ m4_define(mym4_version_micro, [0])
+ m4_define(mym4_version,
+           [mym4_version_major.mym4_version_minor.mym4_version_micro])
+ m4_define([mym4_revision],
+-          m4_esyscmd([git rev-parse --short HEAD | tr -d '\n\r']))
++          m4_esyscmd([(git rev-parse --short HEAD || printf '0') | tr -d '\n\r']))
+ m4_define([mym4_revision_dec],
+           m4_esyscmd_s([echo $((0x$(echo ]mym4_revision[|head -c 4)))]))
+ m4_define([mym4_betastring],
+-- 
+2.11.0
+
meta/recipes-support/libgcrypt/libgcrypt.inc +1 -0
index 483b92e157..3ef02ee994 100644
@@ -20,6 +20,7 @@ SRC_URI = "${GNUPG_MIRROR}/libgcrypt/libgcrypt-${PV}.tar.gz \
            file://libgcrypt-fix-building-error-with-O2-in-sysroot-path.patch \
            file://fix-ICE-failure-on-mips-with-option-O-and-g.patch \
            file://fix-undefined-reference-to-pthread.patch \
+           file://configure.ac-Set-mym4_revision-to-0-if-not-a-git-rep.patch \
 "
 
 BINCONFIG = "${bindir}/libgcrypt-config"
Signature · 1 line
2.11.0
#25 lore raw

PATCH 25/30 libgcrypt.inc: Enable use of binconfig

In reply to Nathan Rossi

Due to pkg-config support for libgcrypt being un-available for upstream libgcrypt, some packages that depend on libgcrypt rely on the use of libgcrypt-config (e.g. QEMU).

---
 meta/recipes-support/libgcrypt/libgcrypt.inc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/recipes-support/libgcrypt/libgcrypt.inc +1 -1
index 3ef02ee994..1677a908d1 100644
@@ -25,7 +25,7 @@ SRC_URI = "${GNUPG_MIRROR}/libgcrypt/libgcrypt-${PV}.tar.gz \
 
 BINCONFIG = "${bindir}/libgcrypt-config"
 
-inherit autotools texinfo binconfig-disabled pkgconfig
+inherit autotools texinfo binconfig pkgconfig
 
 PACKAGECONFIG ??= "capabilities"
 PACKAGECONFIG_remove_mingw32 = "capabilities"
Signature · 1 line
2.11.0
#26 lore raw

PATCH 26/30 libgcrypt.inc: Handle packaging of .exe files

In reply to Nathan Rossi

Use a wildcard to handle packaging of .exe for the hmac/dumpexp packages. Also add the packaging of mpicalc* to the -dev package.

---
 meta/recipes-support/libgcrypt/libgcrypt.inc | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
meta/recipes-support/libgcrypt/libgcrypt.inc +2 -2
index 1677a908d1..963338770a 100644
@@ -46,8 +46,8 @@ do_install_append() {
 
 PACKAGES =+ "dumpsexp-dev"
 
-FILES_${PN}-dev += "${bindir}/hmac256"
-FILES_dumpsexp-dev += "${bindir}/dumpsexp"
+FILES_${PN}-dev += "${bindir}/hmac256* ${bindir}/mpicalc*"
+FILES_dumpsexp-dev += "${bindir}/dumpsexp*"
 
 ARM_INSTRUCTION_SET = "arm"
 
Signature · 1 line
2.11.0
#27 lore raw

PATCH 27/30 qemu: Improve and add PACKAGECONFIG options

In reply to Nathan Rossi

Move the '--disable-bluez' and '--disable-iscsi' options to PACKAGECONFIG.

Fix up the 'gcrypt' option to depend on 'libgcrypt' instead of gcrypt. This is the expected dependency as noted in the QEMU configure help.

Handle the '--audio-drv-list' option inside the PACKAGECONFIG[alsa] args. The previous setting uses a ',' to denote the options for the arg however a space inside quotes is also acceptable and allows the arg to be used into the PACKAGECONFIG flag.

---
 meta/recipes-devtools/qemu/qemu.inc | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
meta/recipes-devtools/qemu/qemu.inc +5 -5
index b46e7f72e2..e5bc1864d5 100644
@@ -29,7 +29,7 @@ SRC_URI_append_class-native = "\
     file://cpus.c-qemu_cpu_kick_thread_debugging.patch \
     "
 
-EXTRA_OECONF += "--target-list=${@get_qemu_target_list(d)} --disable-werror  --disable-bluez --disable-libiscsi --with-system-pixman --extra-cflags='${CFLAGS}'"
+EXTRA_OECONF += "--target-list=${@get_qemu_target_list(d)} --disable-werror  --with-system-pixman --extra-cflags='${CFLAGS}'"
 
 EXTRA_OECONF_class-nativesdk = "--target-list=${@get_qemu_target_list(d)} --disable-werror"
 
@@ -123,17 +123,17 @@ PACKAGECONFIG[curses] = "--enable-curses,--disable-curses,ncurses,"
 PACKAGECONFIG[gtk+] = "--enable-gtk --with-gtkabi=3.0 --enable-vte,--disable-gtk --disable-vte,gtk+3 vte"
 PACKAGECONFIG[libcap-ng] = "--enable-cap-ng,--disable-cap-ng,libcap-ng,"
 PACKAGECONFIG[ssh2] = "--enable-libssh2,--disable-libssh2,libssh2,"
-PACKAGECONFIG[gcrypt] = "--enable-gcrypt,--disable-gcrypt,gcrypt,"
+PACKAGECONFIG[gcrypt] = "--enable-gcrypt,--disable-gcrypt,libgcrypt,"
 PACKAGECONFIG[nettle] = "--enable-nettle,--disable-nettle,nettle"
 PACKAGECONFIG[libusb] = "--enable-libusb,--disable-libusb,libusb1"
 PACKAGECONFIG[fdt] = "--enable-fdt,--disable-fdt,dtc"
-PACKAGECONFIG[alsa] = ",,alsa-lib"
+PACKAGECONFIG[alsa] = "--audio-drv-list='oss alsa',,alsa-lib"
 PACKAGECONFIG[glx] = "--enable-opengl,--disable-opengl,mesa"
 PACKAGECONFIG[lzo] = "--enable-lzo,--disable-lzo,lzo"
 PACKAGECONFIG[numa] = "--enable-numa,--disable-numa,numactl"
 PACKAGECONFIG[gnutls] = "--enable-gnutls,--disable-gnutls,gnutls"
 PACKAGECONFIG[bzip2] = "--enable-bzip2,--disable-bzip2,bzip2"
-
-EXTRA_OECONF += "${@bb.utils.contains('PACKAGECONFIG', 'alsa', '--audio-drv-list=oss,alsa', '', d)}"
+PACKAGECONFIG[bluez] = "--enable-bluez,--disable-bluez"
+PACKAGECONFIG[libiscsi] = "--enable-libiscsi,--disable-libiscsi"
 
 INSANE_SKIP_${PN} = "arch"
Signature · 1 line
2.11.0
#28 lore raw

PATCH 28/30 qemu: Consolidate EXTRA_OECONF

In reply to Nathan Rossi

Consolidate the configure options into the EXTRA_OECONF variable, including merging any native specific options.

Also move the options specified in the do_configure into the EXTRA_OECONF variable. And flesh out all the target directories.

---
 meta/recipes-devtools/qemu/qemu.inc | 23 +++++++++++++++++++----
 1 file changed, 19 insertions(+), 4 deletions(-)
meta/recipes-devtools/qemu/qemu.inc +19 -4
index e5bc1864d5..f758f79dff 100644
@@ -29,9 +29,24 @@ SRC_URI_append_class-native = "\
     file://cpus.c-qemu_cpu_kick_thread_debugging.patch \
     "
 
-EXTRA_OECONF += "--target-list=${@get_qemu_target_list(d)} --disable-werror  --with-system-pixman --extra-cflags='${CFLAGS}'"
-
-EXTRA_OECONF_class-nativesdk = "--target-list=${@get_qemu_target_list(d)} --disable-werror"
+EXTRA_OECONF = " \
+    --prefix=${prefix} \
+    --bindir=${bindir} \
+    --includedir=${includedir} \
+    --libdir=${libdir} \
+    --mandir=${mandir} \
+    --datadir=${datadir} \
+    --docdir=${docdir}/${BPN} \
+    --sysconfdir=${sysconfdir} \
+    --libexecdir=${libexecdir} \
+    --localstatedir=${localstatedir} \
+    --with-confsuffix=/${BPN} \
+    --disable-strip \
+    --disable-werror \
+    --target-list=${@get_qemu_target_list(d)} \
+    --with-system-pixman \
+    --extra-cflags='${CFLAGS}' \
+    "
 
 EXTRA_OEMAKE_append_class-native = " LD='${LD}' AR='${AR}' OBJCOPY='${OBJCOPY}' LDFLAGS='${LDFLAGS}'"
 
@@ -64,7 +79,7 @@ do_configure() {
        KVMOPTS="${KVMENABLE}"
     fi
 
-    ${S}/configure --prefix=${prefix} --sysconfdir=${sysconfdir} --libexecdir=${libexecdir} --localstatedir=${localstatedir} --disable-strip ${EXTRA_OECONF} $KVMOPTS
+    ${S}/configure ${EXTRA_OECONF} $KVMOPTS
     test ! -e ${S}/target-i386/beginend_funcs.sh || chmod a+x ${S}/target-i386/beginend_funcs.sh
 }
 
Signature · 1 line
2.11.0
#29 lore raw

PATCH 29/30 qemu: Convert KVMOPTS to PACKAGECONFIG

In reply to Nathan Rossi

Move the KVMOPTS configuration checks and option setting to a PACKAGECONFIG option.

This also changes the checking of KVM support on the host build machine so that it is processed as a PACKAGECONFIG _remove for class-native only. The darwin/mingw32 overrides are kept and applied as _remove overrides.

---
 meta/recipes-devtools/qemu/qemu.inc | 27 ++++++++++++---------------
 1 file changed, 12 insertions(+), 15 deletions(-)
meta/recipes-devtools/qemu/qemu.inc +12 -15
index f758f79dff..f11221c991 100644
@@ -67,19 +67,8 @@ do_configure_prepend_class-native() {
 		"${S}"/Makefile "${S}"/Makefile.target
 }
 
-KVMENABLE = "--enable-kvm"
-KVMENABLE_darwin = "--disable-kvm"
-KVMENABLE_mingw32 = "--disable-kvm"
-
 do_configure() {
-    # Handle distros such as CentOS 5 32-bit that do not have kvm support
-    KVMOPTS="--disable-kvm"
-    if [ "${PN}" != "qemu-native" -a "${PN}" != "nativesdk-qemu" ] \
-       || [ -f /usr/include/linux/kvm.h ] ; then
-       KVMOPTS="${KVMENABLE}"
-    fi
-
-    ${S}/configure ${EXTRA_OECONF} $KVMOPTS
+    ${S}/configure ${EXTRA_OECONF}
     test ! -e ${S}/target-i386/beginend_funcs.sh || chmod a+x ${S}/target-i386/beginend_funcs.sh
 }
 
@@ -116,12 +105,19 @@ do_install_append() {
 # END of qemu-mips workaround
 
 PACKAGECONFIG ??= " \
-	fdt sdl \
+	fdt sdl kvm \
 	${@bb.utils.contains('DISTRO_FEATURES', 'alsa', 'alsa', '', d)} \
 	${@bb.utils.contains('DISTRO_FEATURES', 'xen', 'xen', '', d)} \
 	"
-PACKAGECONFIG_class-native ??= "fdt alsa uuid"
-PACKAGECONFIG_class-nativesdk ??= "fdt sdl"
+PACKAGECONFIG_class-native ??= "fdt alsa uuid kvm"
+PACKAGECONFIG_class-nativesdk ??= "fdt sdl kvm"
+
+# Handle distros such as CentOS 5 32-bit that do not have kvm support
+PACKAGECONFIG_class-native_remove = "${@'kvm' if not os.path.exists('/usr/include/linux/kvm.h') else ''}"
+
+# Disable kvm on targets that do not support it
+PACKAGECONFIG_remove_darwin = "kvm"
+PACKAGECONFIG_remove_mingw32 = "kvm"
 
 PACKAGECONFIG[sdl] = "--enable-sdl,--disable-sdl,libsdl"
 PACKAGECONFIG[virtfs] = "--enable-virtfs --enable-attr,--disable-virtfs,libcap attr,"
@@ -150,5 +146,6 @@ PACKAGECONFIG[gnutls] = "--enable-gnutls,--disable-gnutls,gnutls"
 PACKAGECONFIG[bzip2] = "--enable-bzip2,--disable-bzip2,bzip2"
 PACKAGECONFIG[bluez] = "--enable-bluez,--disable-bluez"
 PACKAGECONFIG[libiscsi] = "--enable-libiscsi,--disable-libiscsi"
+PACKAGECONFIG[kvm] = "--enable-kvm,--disable-kvm"
 
 INSANE_SKIP_${PN} = "arch"
Signature · 1 line
2.11.0
#30 lore raw

PATCH 30/30 qemu: Move recipe version specific patches and features to recipe

In reply to Nathan Rossi

Move all the version specific patches, overrides and configuration that are in qemu.inc to the versioned QEMU recipe.

This includes moving patches that target the versioned recipe as well as ptest configuration (which is not available in QEMU by default) and well and the installing of the powerpc_rom.bin. All these patches/files are also only located in the FILESEXTRAPATHS that is valid from the recipe file and not from qemu.inc itself.

The purpose of this change is to make the qemu.inc re-usable for multiple versions of QEMU as well as forks and recipes that intend to provide custom patches.

---
 meta/recipes-devtools/qemu/qemu.inc      | 31 +----------------------------
 meta/recipes-devtools/qemu/qemu_2.7.0.bb | 34 ++++++++++++++++++++++++++++++--
 2 files changed, 33 insertions(+), 32 deletions(-)
meta/recipes-devtools/qemu/qemu.inc +1 -30
index f11221c991..4a6a88fdbc 100644
@@ -3,10 +3,9 @@ HOMEPAGE = "http://qemu.org"
 LICENSE = "GPLv2 & LGPLv2.1"
 DEPENDS = "glib-2.0 zlib pixman"
 RDEPENDS_${PN}_class-target += "bash"
-RDEPENDS_${PN}-ptest = "bash make"
 
 require qemu-targets.inc
-inherit autotools ptest
+inherit autotools
 BBCLASSEXTEND = "native nativesdk"
 
 PR = "r1"
@@ -14,21 +13,6 @@ PR = "r1"
 # QEMU_TARGETS is overridable variable
 QEMU_TARGETS ?= "arm aarch64 i386 mips mipsel mips64 mips64el ppc sh4 x86_64"
 
-SRC_URI = "\
-    file://powerpc_rom.bin \
-    file://disable-grabs.patch \
-    file://exclude-some-arm-EABI-obsolete-syscalls.patch \
-    file://wacom.patch \
-    file://add-ptest-in-makefile.patch \
-    file://run-ptest \
-    file://0001-target-mips-add-24KEc-CPU-definition.patch \
-    "
-
-SRC_URI_append_class-native = "\
-    file://fix-libcap-header-issue-on-some-distro.patch \
-    file://cpus.c-qemu_cpu_kick_thread_debugging.patch \
-    "
-
 EXTRA_OECONF = " \
     --prefix=${prefix} \
     --bindir=${bindir} \
@@ -72,22 +56,9 @@ do_configure() {
     test ! -e ${S}/target-i386/beginend_funcs.sh || chmod a+x ${S}/target-i386/beginend_funcs.sh
 }
 
-do_compile_ptest() {
-	make buildtest-TESTS
-}
-
-do_install_ptest() {
-	cp -rL ${B}/tests ${D}${PTEST_PATH}
-	find ${D}${PTEST_PATH}/tests -type f -name "*.[Sshcod]" | xargs -i rm -rf {}
-
-	cp ${S}/tests/Makefile.include ${D}${PTEST_PATH}/tests
-}
-
 do_install () {
 	export STRIP="true"
 	autotools_do_install
-	install -d ${D}${datadir}/qemu
-	install -m 0755 ${WORKDIR}/powerpc_rom.bin ${D}${datadir}/qemu
 }
 
 # The following fragment will create a wrapper for qemu-mips user emulation
meta/recipes-devtools/qemu/qemu_2.7.0.bb +32 -2
index 0d680a7eee..fba2184414 100644
@@ -1,9 +1,21 @@
 require qemu.inc
 
+inherit ptest
+
+RDEPENDS_${PN}-ptest = "bash make"
+
 LIC_FILES_CHKSUM = "file://COPYING;md5=441c28d2cf86e15a37fa47e15a72fbac \
                     file://COPYING.LIB;endline=24;md5=c04def7ae38850e7d3ef548588159913"
 
-SRC_URI += "file://configure-fix-Darwin-target-detection.patch \
+SRC_URI += " \
+            file://powerpc_rom.bin \
+            file://disable-grabs.patch \
+            file://exclude-some-arm-EABI-obsolete-syscalls.patch \
+            file://wacom.patch \
+            file://add-ptest-in-makefile.patch \
+            file://run-ptest \
+            file://0001-target-mips-add-24KEc-CPU-definition.patch \
+            file://configure-fix-Darwin-target-detection.patch \
             file://qemu-enlarge-env-entry-size.patch \
             file://Qemu-Arm-versatilepb-Add-memory-size-checking.patch \
             file://no-valgrind.patch \
@@ -14,7 +26,12 @@ SRC_URI += "file://configure-fix-Darwin-target-detection.patch \
             file://0003-fix-CVE-2016-7908.patch \
             file://0004-fix-CVE-2016-7909.patch \
             file://0001-pci-assign-sync-MSI-MSI-X-cap-and-table-with-PCIDevi.patch \
-"
+            "
+
+SRC_URI_append_class-native = " \
+            file://fix-libcap-header-issue-on-some-distro.patch \
+            file://cpus.c-qemu_cpu_kick_thread_debugging.patch \
+            "
 
 SRC_URI_prepend = "http://wiki.qemu-project.org/download/${BP}.tar.bz2"
 SRC_URI[md5sum] = "08d4d06d1cb598efecd796137f4844ab"
@@ -26,4 +43,17 @@ COMPATIBLE_HOST_mipsarchn64 = "null"
 do_install_append() {
     # Prevent QA warnings about installed ${localstatedir}/run
     if [ -d ${D}${localstatedir}/run ]; then rmdir ${D}${localstatedir}/run; fi
+    install -Dm 0755 ${WORKDIR}/powerpc_rom.bin ${D}${datadir}/qemu
+}
+
+do_compile_ptest() {
+	make buildtest-TESTS
 }
+
+do_install_ptest() {
+	cp -rL ${B}/tests ${D}${PTEST_PATH}
+	find ${D}${PTEST_PATH}/tests -type f -name "*.[Sshcod]" | xargs -i rm -rf {}
+
+	cp ${S}/tests/Makefile.include ${D}${PTEST_PATH}/tests
+}
+
Signature · 1 line
2.11.0