Hi all,
On the home straight getting libvirt to work "out of the box" on MacOS
X. (ideal scenario: it's "good enough" today. :>)
With the very latest git snapshot, to get a working compile requires
these options to be used:
./configure --without-network --without-storage-fs
Leaving either of the network or storage-fs options not explicitly
disabled, causes failure during compilation.
Wondering if these two or fundamentally Linux specific things, so we
should update our configure.ac to not attempt them on non-Linux, or do
they indicate actual problem(s)?
***********************************************************************
***********************************************************************
The remainder of this email is kind of lengthy, giving info on the
specific errors caused by each of the above options. Feel free to
ignore this if it's of no interest. :)
+ Leaving off --without-network gives
***********************************************************************
gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../gnulib/lib -I../gnulib/lib
-I../include -I../src/util -I../include -I/usr/include/libxml2
-DLIBDIR=\"/opt/libvirt/lib\" -DBINDIR=\"/opt/libvirt/libexec\"
-DSBINDIR=\"/opt/libvirt/sbin\" -DSYSCONF_DIR=\"/opt/libvirt/etc\"
-DLOCALEBASEDIR=\"/opt/libvirt/share/locale\"
-DPKGDATADIR=\"/opt/libvirt/share/libvirt\"
-DLOCAL_STATE_DIR=\"/opt/libvirt/var\" -DGETTEXT_PACKAGE=\"libvirt\"
-Wall -Wformat -Wformat-security -Wmissing-prototypes -Wnested-externs
-Wpointer-arith -Wextra -Wshadow -Wcast-align -Wwrite-strings
-Waggregate-return -Wstrict-prototypes -Winline -Wredundant-decls
-Wno-sign-compare -Wp,-D_FORTIFY_SOURCE=2 -fexceptions
-fasynchronous-unwind-tables -fdiagnostics-show-option -DIN_LIBVIRT -g
-O2 -MT libvirt_util_la-bridge.lo -MD -MP -MF
.deps/libvirt_util_la-bridge.Tpo -c util/bridge.c -fno-common -DPIC -o
.libs/libvirt_util_la-bridge.o
gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../gnulib/lib -I../gnulib/lib
-I../include -I../src/util -I../include -I/usr/include/libxml2
-DLIBDIR=\"/opt/libvirt/lib\" -DBINDIR=\"/opt/libvirt/libexec\"
-DSBINDIR=\"/opt/libvirt/sbin\" -DSYSCONF_DIR=\"/opt/libvirt/etc\"
-DLOCALEBASEDIR=\"/opt/libvirt/share/locale\"
-DPKGDATADIR=\"/opt/libvirt/share/libvirt\"
-DLOCAL_STATE_DIR=\"/opt/libvirt/var\" -DGETTEXT_PACKAGE=\"libvirt\"
-Wall -Wformat -Wformat-security -Wmissing-prototypes -Wnested-externs
-Wpointer-arith -Wextra -Wshadow -Wcast-align -Wwrite-strings
-Waggregate-return -Wstrict-prototypes -Winline -Wredundant-decls
-Wno-sign-compare -Wp,-D_FORTIFY_SOURCE=2 -fexceptions
-fasynchronous-unwind-tables -fdiagnostics-show-option -DIN_LIBVIRT -g
-O2 -MT libvirt_util_la-buf.lo -MD -MP -MF .deps/libvirt_util_la-buf.Tpo
-c util/buf.c -fno-common -DPIC -o .libs/libvirt_util_la-buf.o
In file included from util/bridge.h:29,
from util/bridge.c:26:
/usr/include/net/if.h:264: error: field 'ifru_addr' has incomplete type
/usr/include/net/if.h:265: error: field 'ifru_dstaddr' has incomplete type
/usr/include/net/if.h:266: error: field 'ifru_broadaddr' has incomplete type
/usr/include/net/if.h:305: error: field 'ifra_addr' has incomplete type
/usr/include/net/if.h:306: error: field 'ifra_broadaddr' has incomplete type
/usr/include/net/if.h:307: error: field 'ifra_mask' has incomplete type
/usr/include/net/if.h:379: error: field 'addr' has incomplete type
/usr/include/net/if.h:380: error: field 'dstaddr' has incomplete type
util/bridge.c:41:55: error: linux/param.h: No such file or directory
util/bridge.c:42:55: error: linux/sockios.h: No such file or directory
util/bridge.c:43:55: error: linux/if_bridge.h: No such file or directory
util/bridge.c:44:55: error: linux/if_tun.h: No such file or directory
util/bridge.c: In function 'ifSetInterfaceMac':
util/bridge.c:311: error: 'SIOCGIFHWADDR' undeclared (first use in this
function)
util/bridge.c:311: error: (Each undeclared identifier is reported only once
util/bridge.c:311: error: for each function it appears in.)
util/bridge.c:314: error: 'struct ifreq' has no member named 'ifr_hwaddr'
util/bridge.c:314: error: 'struct ifreq' has no member named 'ifr_hwaddr'
util/bridge.c:314: error: 'struct ifreq' has no member named 'ifr_hwaddr'
util/bridge.c:314: error: 'struct ifreq' has no member named 'ifr_hwaddr'
util/bridge.c:316: error: 'SIOCSIFHWADDR' undeclared (first use in this
function)
util/bridge.c: In function 'brAddTap':
util/bridge.c:498: error: 'IFF_TAP' undeclared (first use in this function)
util/bridge.c:498: error: 'IFF_NO_PI' undeclared (first use in this
function)
util/bridge.c:512: error: 'TUNSETIFF' undeclared (first use in this
function)
util/bridge.c:534: error: 'TUNSETPERSIST' undeclared (first use in this
function)
util/bridge.c: In function 'brDeleteTap':
util/bridge.c:564: error: 'IFF_TAP' undeclared (first use in this function)
util/bridge.c:564: error: 'IFF_NO_PI' undeclared (first use in this
function)
util/bridge.c:571: error: 'TUNSETIFF' undeclared (first use in this
function)
util/bridge.c:572: error: 'TUNSETPERSIST' undeclared (first use in this
function)
make[3]: *** [libvirt_util_la-bridge.lo] Error 1
make[3]: *** Waiting for unfinished jobs....
gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../gnulib/lib -I../gnulib/lib
-I../include -I../src/util -I../include -I/usr/include/libxml2
-DLIBDIR=\"/opt/libvirt/lib\" -DBINDIR=\"/opt/libvirt/libexec\"
-DSBINDIR=\"/opt/libvirt/sbin\" -DSYSCONF_DIR=\"/opt/libvirt/etc\"
-DLOCALEBASEDIR=\"/opt/libvirt/share/locale\"
-DPKGDATADIR=\"/opt/libvirt/share/libvirt\"
-DLOCAL_STATE_DIR=\"/opt/libvirt/var\" -DGETTEXT_PACKAGE=\"libvirt\"
-Wall -Wformat -Wformat-security -Wmissing-prototypes -Wnested-externs
-Wpointer-arith -Wextra -Wshadow -Wcast-align -Wwrite-strings
-Waggregate-return -Wstrict-prototypes -Winline -Wredundant-decls
-Wno-sign-compare -Wp,-D_FORTIFY_SOURCE=2 -fexceptions
-fasynchronous-unwind-tables -fdiagnostics-show-option -DIN_LIBVIRT -g
-O2 -MT libvirt_util_la-buf.lo -MD -MP -MF .deps/libvirt_util_la-buf.Tpo
-c util/buf.c -o libvirt_util_la-buf.o >/dev/null 2>&1
make[2]: *** [all] Error 2
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
$
***********************************************************************
+ Leaving off --without-storage-fs gives
***********************************************************************
gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../gnulib/lib -I../gnulib/lib
-I../include -I../src/util -I../include -I/usr/include/libxml2
-DLIBDIR=\"/opt/libvirt/lib\" -DBINDIR=\"/opt/libvirt/libexec\"
-DSBINDIR=\"/opt/libvirt/sbin\" -DSYSCONF_DIR=\"/opt/libvirt/etc\"
-DLOCALEBASEDIR=\"/opt/libvirt/share/locale\"
-DPKGDATADIR=\"/opt/libvirt/share/libvirt\"
-DLOCAL_STATE_DIR=\"/opt/libvirt/var\" -DGETTEXT_PACKAGE=\"libvirt\"
-Wall -Wformat -Wformat-security -Wmissing-prototypes -Wnested-externs
-Wpointer-arith -Wextra -Wshadow -Wcast-align -Wwrite-strings
-Waggregate-return -Wstrict-prototypes -Winline -Wredundant-decls
-Wno-sign-compare -Wp,-D_FORTIFY_SOURCE=2 -fexceptions
-fasynchronous-unwind-tables -fdiagnostics-show-option -DIN_LIBVIRT
-I../src/conf -g -O2 -MT libvirt_driver_storage_la-storage_backend_fs.lo
-MD -MP -MF .deps/libvirt_driver_storage_la-storage_backend_fs.Tpo -c
storage/storage_backend_fs.c -fno-common -DPIC -o
.libs/libvirt_driver_storage_la-storage_backend_fs.o
storage/storage_backend_fs.c:145:21: error: mntent.h: No such file or
directory
storage/storage_backend_fs.c: In function
'virStorageBackendFileSystemIsMounted':
storage/storage_backend_fs.c:274: error: storage size of 'ent' isn't known
storage/storage_backend_fs.c:277: error: '_PATH_MOUNTED' undeclared
(first use in this function)
storage/storage_backend_fs.c:277: error: (Each undeclared identifier is
reported only once
storage/storage_backend_fs.c:277: error: for each function it appears in.)
storage/storage_backend_fs.c:284: warning: implicit declaration of
function 'getmntent_r'
storage/storage_backend_fs.c:284: warning: nested extern declaration of
'getmntent_r' [-Wnested-externs]
storage/storage_backend_fs.c:284: warning: comparison between pointer
and integer
storage/storage_backend_fs.c:274: warning: unused variable 'ent'
[-Wunused-variable]
make[3]: *** [libvirt_driver_storage_la-storage_backend_fs.lo] Error 1
make[3]: *** Waiting for unfinished jobs....
make[2]: *** [all] Error 2
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
$
This one kind of looked like it almost got through the compile stage. ;)
***********************************************************************