GNOME Bugzilla – Bug 740004
use pkg-config to check for version of libparted
Last modified: 2015-01-26 18:26:28 UTC
running test programs causes headaches when cross-compiling
Hi Andreas, I an not familiar with the difficulties when cross-compiling. I assume you are talking about the checks in configure.ac? I further assume that just these compile checks are problematic: * libparted ped_get_version() check * availability of set_default_icon_name() check Unfortunately not all distros provide a pkg-config file for parted/ libparted so we compile a test program to determine version and therefore supported features. As noted in the comment for the set_default_icon_name() availability check, using the version reported by pkg-config leads to an incorrect determination on RHEL/CentOS 5. I welcome suggestions for how these checks could be accomplished in the compiling locally case yet help in the cross-compiling case. Thanks, Mike
Hi Mike, > I an not familiar with the difficulties when cross-compiling. I assume > you are talking about the checks in configure.ac? I further assume that > just these compile checks are problematic: > * libparted ped_get_version() check Yes. Problem with cross compiling: Since the binaries build are for different machines, you can run test applications only with quemu quirks. > * availability of set_default_icon_name() check No > Unfortunately not all distros provide a pkg-config file for parted/ > libparted so we compile a test program to determine version and > therefore supported features. I was not aware of that and understand now why this solution was selected. > I welcome suggestions for how these checks could be accomplished in the > compiling locally case yet help in the cross-compiling case. > Have no good solution for both cases (missing pc-files / cross-building). So I suggests you forget this patch and I leave it in my environment (yocto). Andreas
Hi Andreas, It's mostly older distros which don't provide pkg-config files for parted, where as newer ones do. Would it be useful for your cross-compiling case if configure queried pkg-config for libparted version and if that failed, falls back to compiling a test program like it does now? Mike
Hi Mike, Hey that would be cool. Ehm my time and autotools knowlegde are limited and so.. Could you do that? Andreas
Hi Andreas, Out of curiousity, what computer system are you cross-compiling for? Curtis
Hi Andreas, I'm happy to write a fix, but I would need you to test it in your cross-compile environment to confirm it works and is better. Thanks, Mike
Hi Curtis, all kind of ARM based boards: Currently most time I spend on: Gumstix overo https://store.gumstix.com/index.php/category/33/ Variscite VAR-SOM-MX6 http://www.variwiki.com/index.php?title=VAR-SOM-MX6 On my desktop or in some drawer Beaglebone Black http://beagleboard.org/black RaspberryPi http://www.raspberrypi.org/ Toradex Colibri T30 https://www.toradex.com/de/products/colibri-arm-computer-modules/nvidia-tegra-3-computer-module Karo TX28 http://www.karo-electronics.de/tx28.html And all started with ICnova AP7000 Base (grasshopper) http://shop.in-circuit.de/products/Home/ICnova-CPU-Module/57/ICnova-AP7000-Base Think that's the current collection :) Andreas
Hi Mike, Thanks for taking care - and of course I'll test your changes and let you know. Andreas
Thanks Andreas for the prompt response. It would appear that you have quite the collection of development boards. :-) There are Debian packages of GParted for many different architectures. https://packages.debian.org/search?keywords=gparted What I don't know is if all of these packages are compiled on the native architectures. Perhaps there is a guide or how-to on the Internet with tips for developers and cross compiling....
Created attachment 290764 [details] [review] Use pkg-config check for libparted version first (v1) Hi Andreas, Here's the patch which makes configure query libparted version via pkg-config first and via test program to query libparted directly second. To test you you'll have to fetch GParted git repo and use git am to apply the patch. (Follow step 7 "Final review, apply, compile and test" from http://gparted.org/git.php#create-patch). Thanks, Mike
Hi Mike, Thanks for developing this patch set. Often I run and test with a more recent unpackaged libparted version than what the distro has packaged. As such I tested what would happen when a distro libparted package is installed, and there is also a locally compiled and linked newer libparted in /usr/local. Basically I tested building using a specific libparted version. Building using a Specific (lib)parted Version https://git.gnome.org/browse/gparted/tree/README?id=GPARTED_0_20_0#n145 The result was that all worked as expected with this patch set. When the appropriate environment variables are set, GParted will compile and link with the specific version. :-) I guess the real test will be if this works for Andreas. Curtis
Hi Curtis, It's good to know that it works with locally installed libparted too. This was a test I hadn't even though of. Now ./configure reports either this: checking for libparted >= 1.7.1 (querying pkg-config)... 2.4 or: checking for libparted >= 1.7.1 (querying pkg-config)... not found checking for libparted >= 1.7.1 (querying libparted)... 1.8.1 depending on whether a libparted.pc pkg-config file exits or not. So far I've tested all the paths through the new config code: pkg-config reports new enough pkg-config reports too old no pkg-config file libparted new enough libparted too old query libparted program fails to compile query libparted program error exits And performed "make distcheck" on: CentOS 5, 6, 7 After Andreas reports, I plan to do "make distcheck" tests on all the other distro I have too. Thanks, Mike
Hi Mike, Tested and happy! configure:16954: checking for libparted >= 1.7.1 (querying pkg-config) configure:16959: $PKG_CONFIG --exists --print-errors "libparted" configure:16962: $? = 0 configure:16967: result: 3.1 and after update of parted to 3.2 (to see if it does not detect my host's parted) configure:16954: checking for libparted >= 1.7.1 (querying pkg-config) configure:16959: $PKG_CONFIG --exists --print-errors "libparted" configure:16962: $? = 0 configure:16967: result: 3.2 Thanks very much Andreas
Created attachment 290994 [details] [review] Use pkg-config check for libparted version first (v2) Hi Curtis, I have now also successfully run "make distcheck" on the following additional distributions: Debian 6, Fedora 14, 20, 21, Rawhide (22) Kubuntu 12.04 LTS, Xubuntu 14.04 LTS Changed the bug description slightly to reflect that the request was to use pkg-config to query the version of libparted and not gparted. Updated patch to match. Thanks, Mike
Great work on this patch set Mike. I retested the development scenario I mentioned in comment #11 and all went well. :-) The patch set in comment #14 has been committed to the GNOME repository for inclusion in the next release of GParted. The relevant git commits can be viewed at the following links: Use pkg-config Autoconf check for libparted version first (#740004) https://git.gnome.org/browse/gparted/commit/?id=9c7cb6f4965349a2fec0ec16056beff6b8c5d3ce Avoid splitting Autoconf check message for libparted version (#740004) https://git.gnome.org/browse/gparted/commit/?id=5a93a9c432e9fe62ac4df16d96aeb9def81bfd6a
This enhancement was included in the GParted 0.21.0 release on January 26, 2015.