[libvirt] OSX 10.6 build failures

Hi us, Going through the process of getting libvirt to compile on OSX, making notes of the failures on the way through (from a clean system) to be fixed. a) libtool -> glibtool libtoolize -> glibtoolize It turns out that autogen.sh is hard coded to use "libtool", and wants the GNU version. OSX supplies has it's own version, without a --version option, so autogen.sh fails. Installing GNU libtool through MacPorts, makes it available as glibtool, with libtoolize being glibtoolize. Adjusting autogen.sh to detect that, then set LIBTOOL and LIBTOOLIZE appropriately was fairly trivial. Will submit a patch to fix that in a bit. b) pkg-config The next thing to barf was autoconf, complaining about AC_MSG_ERROR not being a defined macro. Googling with some persistence showed this is caused by pkg-config not being installed. Fixed that. Will submit a patch for that too. Probably "pkg-config --version" based, copying the approach used for the other autogen.sh checks. c) This is a compilation failure, one I don't readily know how to fix: ... Making all in src make all-am CC libvirt_util_la-network.lo util/network.c: In function 'getIPv6Addr': util/network.c:50: error: 'struct in6_addr' has no member named 's6_addr16' util/network.c:50: error: 'struct in6_addr' has no member named 's6_addr16' util/network.c:50: error: 'struct in6_addr' has no member named 's6_addr16' util/network.c:50: error: 'struct in6_addr' has no member named 's6_addr16' make[3]: *** [libvirt_util_la-network.lo] Error 1 make[2]: *** [all] Error 2 make[1]: *** [all-recursive] Error 1 make: *** [all] Error 2 $ They're the only problems so far, though most things have been disabled on the ./configure line so it's only the client libraries being built. Anyone know how to address that third one? Regards and best wishes, Justin Clift

On 09/14/2010 05:42 PM, Justin Clift wrote:
b) pkg-config
The next thing to barf was autoconf, complaining about AC_MSG_ERROR not being a defined macro.
Googling with some persistence showed this is caused by pkg-config not being installed. Fixed that.
Will submit a patch for that too. Probably "pkg-config --version" based, copying the approach used for the other autogen.sh checks.
Revisiting this, does it suffice to add pkg-config into the $buildreq table of bootstrap.conf? -- Eric Blake eblake@redhat.com +1-801-349-2682 Libvirt virtualization library http://libvirt.org

On 10/01/2010 03:26 AM, Eric Blake wrote:
On 09/14/2010 05:42 PM, Justin Clift wrote:
b) pkg-config
The next thing to barf was autoconf, complaining about AC_MSG_ERROR not being a defined macro.
Googling with some persistence showed this is caused by pkg-config not being installed. Fixed that.
Will submit a patch for that too. Probably "pkg-config --version" based, copying the approach used for the other autogen.sh checks.
Revisiting this, does it suffice to add pkg-config into the $buildreq table of bootstrap.conf?
That seems to be an improvement. Without pkg-config installed, running autogen.sh gives this failure: **************************************** $ ./autogen.sh <snip> checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for a thread-safe mkdir -p... build-aux/install-sh -c -d checking for gawk... gawk checking whether make sets $(MAKE)... yes configure: error: cannot run /bin/sh build-aux/config.sub $ **************************************** With it added, we get: **************************************** $ ./autogen.sh running bootstrap... Error: 'CONFIG-pkg-config' not found Program Min_version ---------------------- autoconf 2.59 automake 1.9.6 autopoint - gettext - git 1.5.5 gzip - libtool - perl 5.5 pkg-config - tar - ---------------------- Failed to bootstrap gnulib, please investigate. $ **************************************** As a "clarity of error message" idea, do you reckon it's workable for the error message to list the status of each item? Something like: **************************************** $ ./autogen.sh running bootstrap... Error: 'CONFIG-pkg-config' not found Program Min_version Status ----------------------------------------- autoconf 2.59 OK - 2.61 found automake 1.9.6 OK - 1.10 found autopoint - OK gettext - OK git 1.5.5 OK - 1.73 found gzip - OK libtool - OK perl 5.5 OK - 5.10 found pkg-config - MISSING tar - OK ----------------------------------------- Failed to bootstrap gnulib, please investigate. $ **************************************** It just seems like it would convey the problem (and implied solution) in a clearer fashion. As a thought, after installing pkg-config back onto the system, the above error about "CONFIG-pkg-config" not being found still happens, so something isn't right. :/ Any ideas?

[adding bug-gnulib] On 10/04/2010 11:16 PM, Justin Clift wrote:
Revisiting this, does it suffice to add pkg-config into the $buildreq table of bootstrap.conf?
That seems to be an improvement. Without pkg-config installed, running autogen.sh gives this failure:
**************************************** $ ./autogen.sh <snip> checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for a thread-safe mkdir -p... build-aux/install-sh -c -d checking for gawk... gawk checking whether make sets $(MAKE)... yes configure: error: cannot run /bin/sh build-aux/config.sub
You aren't kidding about that being an obtuse error message for the actual problem.
$ ****************************************
With it added, we get:
**************************************** $ ./autogen.sh running bootstrap... Error: 'CONFIG-pkg-config' not found
Ouch - that smells like bootstrap has a bug in its dependency checking code that does not properly handle - in a dependency name. So, rather than checking for $PKG_CONFIG and falling back on pkg-config, it is checking for $PKG and falling back on CONFIG-pkg-config. Easy enough to fix in gnulib, and re-import into libvirt.
Program Min_version ---------------------- autoconf 2.59 automake 1.9.6 autopoint - gettext - git 1.5.5 gzip - libtool - perl 5.5 pkg-config - tar - ---------------------- Failed to bootstrap gnulib, please investigate. $ ****************************************
As a "clarity of error message" idea, do you reckon it's workable for the error message to list the status of each item?
Again a task for gnulib's bootstrap script.
Something like:
**************************************** $ ./autogen.sh running bootstrap... Error: 'CONFIG-pkg-config' not found
Program Min_version Status ----------------------------------------- autoconf 2.59 OK - 2.61 found automake 1.9.6 OK - 1.10 found autopoint - OK gettext - OK git 1.5.5 OK - 1.73 found gzip - OK libtool - OK perl 5.5 OK - 5.10 found pkg-config - MISSING tar - OK ----------------------------------------- Failed to bootstrap gnulib, please investigate. $ ****************************************
It just seems like it would convey the problem (and implied solution) in a clearer fashion.
Indeed that would be nicer, but it's not as clear-cut as the pkg-config mess-up. At any rate, I'll take a shot at both issues today, even if I end up only solving the first. -- Eric Blake eblake@redhat.com +1-801-349-2682 Libvirt virtualization library http://libvirt.org

On 10/05/2010 11:15 PM, Eric Blake wrote: <snip>
Program Min_version Status ----------------------------------------- autoconf 2.59 OK - 2.61 found automake 1.9.6 OK - 1.10 found autopoint - OK gettext - OK git 1.5.5 OK - 1.73 found gzip - OK libtool - OK perl 5.5 OK - 5.10 found pkg-config - MISSING tar - OK ----------------------------------------- Failed to bootstrap gnulib, please investigate. $ ****************************************
Ouch, that looks horrible. :/ Note for the gnulib people: the above layout has been stripped of spaces by a mail client, so is visually complicated rather than being nice and simple. The original layout, looking nice and simple, is here: https://www.redhat.com/archives/libvir-list/2010-October/msg00099.html <snip>
Indeed that would be nicer, but it's not as clear-cut as the pkg-config mess-up. At any rate, I'll take a shot at both issues today, even if I end up only solving the first.
No worries. Functionality over form is practical. :)

* .gnulib: Update to latest, for bootstrap fixes. * bootstrap: Synchronize with upstream. * bootstrap.conf: Add pkg-config pre-requisite. ---
As a thought, after installing pkg-config back onto the system, the above error about "CONFIG-pkg-config" not being found still happens, so something isn't right. :/
That something was gnulib, which has now been fixed upstream. This patch then copies upstream into place in libvirt. * .gnulib 9f940e9...ae0a6b2 (18):
bootstrap: work with pkg-config faccessat: remove unused wrappers tests: require @PRAGMA_COLUMNS@ with each @PRAGMA_SYSTEM_HEADER@ gnulib-tool: Synthesize appropriate _LDFLAGS for a libtool library. threadlib: Make option --with-libpth-prefix work. Avoid line length limitation from HP NonStop system header files. read-file tests: Avoid a test failure on NonStop Kernel. gnulib-tool: Fixes for --create-testdir with --libtool. Avoid some lines longer than 80 characters. acl: Add support for ACLs on NonStop Kernel. More info about ACLs on NonStop Kernel. Info about ACLs on NonStop Kernel. Define missing EDQUOT on NonStop Kernel. Update doc for POSIX:2008. gnulib-tool: In testdirs, use the newest available config.{guess.sub}. New module 'system-posix'. More renaming from 'getdate' to 'get_date'. bootstrap: support ACLOCAL_FLAGS during aclocal
.gnulib | 2 +- bootstrap | 18 ++++++++++-------- bootstrap.conf | 1 + 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/.gnulib b/.gnulib index 9f940e9..ae0a6b2 160000 --- a/.gnulib +++ b/.gnulib @@ -1 +1 @@ -Subproject commit 9f940e90a7555c3399c9972d9688483c011068c7 +Subproject commit ae0a6b2df106b7ed760cc393312997adf995cc3b diff --git a/bootstrap b/bootstrap index e94a29a..29802a1 100755 --- a/bootstrap +++ b/bootstrap @@ -1,6 +1,6 @@ #! /bin/sh # Print a version string. -scriptversion=2010-09-30.17; # UTC +scriptversion=2010-10-05.14; # UTC # Bootstrap this package from checked-out sources. @@ -351,7 +351,7 @@ check_versions() { app=libtoolize fi # Honor $APP variables ($TAR, $AUTOCONF, etc.) - appvar=`echo $app | tr '[a-z]' '[A-Z]'` + appvar=`echo $app | tr 'a-z-' 'A-Z_'` test "$appvar" = TAR && appvar=AMTAR eval "app=\${$appvar-$app}" inst_ver=$(get_version $app) @@ -374,7 +374,7 @@ check_versions() { print_versions() { echo "Program Min_version" echo "----------------------" - printf "$buildreq" + printf %s "$buildreq" echo "----------------------" # can't depend on column -t } @@ -392,10 +392,12 @@ if test $use_libtool = 1; then fi if ! printf "$buildreq" | check_versions; then - test -f README-prereq && - echo "See README-prereq for notes on obtaining these prerequisite programs:" >&2 - echo - print_versions + echo >&2 + if test -f README-prereq; then + echo "See README-prereq for notes on obtaining the prerequisite programs" >&2 + else + echo "Please install the prerequisite programs" >&2 + fi exit 1 fi @@ -800,7 +802,7 @@ grep -E '^[ ]*AC_CONFIG_HEADERS?\>' configure.ac >/dev/null || for command in \ libtool \ - "${ACLOCAL-aclocal} --force -I m4" \ + "${ACLOCAL-aclocal} --force -I m4 $ACLOCAL_FLAGS" \ "${AUTOCONF-autoconf} --force" \ "${AUTOHEADER-autoheader} --force" \ "${AUTOMAKE-automake} --add-missing --copy --force-missing" diff --git a/bootstrap.conf b/bootstrap.conf index 7ce1e5d..8f25554 100644 --- a/bootstrap.conf +++ b/bootstrap.conf @@ -150,6 +150,7 @@ git 1.5.5 gzip - libtool - perl 5.5 +pkg-config - tar - " -- 1.7.2.3

On 10/06/2010 02:15 AM, Eric Blake wrote:
* .gnulib: Update to latest, for bootstrap fixes. * bootstrap: Synchronize with upstream. * bootstrap.conf: Add pkg-config pre-requisite. ---
As a thought, after installing pkg-config back onto the system, the above error about "CONFIG-pkg-config" not being found still happens, so something isn't right. :/
ACK. It now runs through correctly when pkg-config is on the system, and also errors out with a useful error if it's not found: ***************************************************** $ ./autogen.sh --prefix=/opt/libvirt running bootstrap... Error: 'pkg-config' not found Please install the prerequisite programs Failed to bootstrap gnulib, please investigate. $ ***************************************************** So, seems good. :)

On 10/05/2010 10:39 AM, Justin Clift wrote:
On 10/06/2010 02:15 AM, Eric Blake wrote:
* .gnulib: Update to latest, for bootstrap fixes. * bootstrap: Synchronize with upstream. * bootstrap.conf: Add pkg-config pre-requisite. ---
As a thought, after installing pkg-config back onto the system, the above error about "CONFIG-pkg-config" not being found still happens, so something isn't right. :/
ACK. It now runs through correctly when pkg-config is on the system, and also errors out with a useful error if it's not found:
Thanks for testing. Pushed with one tweak suggested by Bruno Haible. Gnulib itself doesn't depend on pkg-config; when libvirt's bootstrap process fails, we don't want to confuse users with a message that might cause them to look to the wrong package for a fix. diff --git i/autogen.sh w/autogen.sh index 3fff381..6c2e3bc 100755 --- i/autogen.sh +++ w/autogen.sh @@ -49,7 +49,7 @@ if test "$t" = "$(cat $curr_status 2>/dev/null)" \ else echo running bootstrap... ./bootstrap && bootstrap_hash > $curr_status \ - || { echo "Failed to bootstrap gnulib, please investigate."; exit 1; } + || { echo "Failed to bootstrap, please investigate."; exit 1; } fi cd "$THEDIR" -- Eric Blake eblake@redhat.com +1-801-349-2682 Libvirt virtualization library http://libvirt.org
participants (2)
-
Eric Blake
-
Justin Clift