[libvirt] Fix for newer yajl

2011-07-27 Thread Brecht Sanders

Hi,
I just notices that compiling libvirt against yail version 2 there were 
some errors, mainly because yajl_parser_config is no longer used.

The patch below fixed this for me.
Regards
Brecht Sanders


--- src/util/json.c  2011-03-24 08:10:26 +0100
+++ src/util/json.c  2011-07-27 09:29:52 +0200
@@ -34,2 +34,3 @@
 # include yajl/yajl_parse.h
+# include yajl/yajl_version.h
 #endif
@@ -896,3 +897,5 @@
 {
+#if YAJL_MAJOR  2
 yajl_parser_config cfg = { 1, 1 };
+#endif
 yajl_handle hand;
@@ -903,3 +906,7 @@

+#if YAJL_MAJOR  2
 hand = yajl_alloc(parserCallbacks, cfg, NULL, parser);
+#else
+hand = yajl_alloc(parserCallbacks, NULL, parser);
+#endif

@@ -1004,3 +1011,5 @@
 {
+#if YAJL_MAJOR  2
 yajl_gen_config conf = { 0,   }; /* Turns off pretty printing 
since QEMUcan't cope */

+#endif
 yajl_gen g;
@@ -1012,3 +1021,7 @@

+#if YAJL_MAJOR  2
 g = yajl_gen_alloc(conf, NULL);
+#else
+g = yajl_gen_alloc(NULL);
+#endif


--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


Re: [libvirt] Fix for newer yajl

2011-07-27 Thread Brecht Sanders



Hi,
I just notices that compiling libvirt against yail version 2 there
were some errors, mainly because yajl_parser_config is no longer
used.

What version of libvirt is your patch against ?  The latest releases
already have fixed compatibility with YAJL 2, so I'm assuming you have
an old release ?

Regards,
Daniel

Hmm, you're right. My bad.
I forgot I was compiling 0.9.0 because I had other issues compiling 
later versions under MinGW/MSYS on Windows.
In case you were not aware of this I'm including the end of my 0.9.3 
output below.


libtool: compile:  gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I.. 
-I../gnulib/lib -I../gnulib/lib -I../include -I../src/util -I../include 
-DIN_LIBVIRT -I/custombuilt32/include/libxml2 -Wall -W -Wformat-y2k 
-Wformat-security -Winit-self -Wmissing-include-dirs -Wunused 
-Wunknown-pragmas -Wstrict-aliasing -Wshadow -Wpointer-arith 
-Wbad-function-cast -Wcast-align -Wwrite-strings -Wlogical-op 
-Waggregate-return -Wstrict-prototypes -Wold-style-definition 
-Wmissing-prototypes -Wmissing-declarations -Wmissing-noreturn 
-Wmissing-format-attribute -Wredundant-decls -Wnested-externs -Winline 
-Winvalid-pch -Wvolatile-register-var -Wdisabled-optimization 
-Wbuiltin-macro-redefined -Wmudflap -Wpacked-bitfield-compat -Wsync-nand 
-Wattributes -Wcoverage-mismatch -Wmultichar 
-Wno-missing-field-initializers -Wno-sign-compare -Wjump-misses-init 
-Wframe-larger-than=4096 -Wp,-D_FORTIFY_SOURCE=2 -fexceptions 
-fasynchronous-unwind-tables -fdiagnostics-show-option -funit-at-a-time 
-Drestrict=__restrict -DWSAAPI -Dsiginfo_t=int -MT 
libvirt_net_rpc_server_la-virnetserver.lo -MD -MP -MF 
.deps/libvirt_net_rpc_server_la-virnetserver.Tpo -c rpc/virnetserver.c  
-DDLL_EXPORT -DPIC -o .libs/libvirt_net_rpc_server_la-virnetserver.o

rpc/virnetserver.c: In function 'virNetServerSignalHandler':
rpc/virnetserver.c:392:12: error: request for member 'si_signo' in 
something not a structure or union

rpc/virnetserver.c: In function 'virNetServerSignalEvent':
rpc/virnetserver.c:423:20: error: request for member 'si_signo' in 
something not a structure or union
rpc/virnetserver.c:432:5: error: request for member 'si_signo' in 
something not a structure or union

make[3]: *** [libvirt_net_rpc_server_la-virnetserver.lo] Error 1
make[3]: Leaving directory `/home/win32/libvirt-0.9.3/src'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/home/win32/libvirt-0.9.3/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/win32/libvirt-0.9.3'
make: *** [all] Error 2

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


Re: [libvirt] Fix for newer yajl

2011-07-27 Thread Brecht Sanders

On 27/07/2011 10:24, Brecht Sanders wrote:



Hi,
I just notices that compiling libvirt against yail version 2 there
were some errors, mainly because yajl_parser_config is no longer
used.

What version of libvirt is your patch against ?  The latest releases
already have fixed compatibility with YAJL 2, so I'm assuming you have
an old release ?

Regards,
Daniel

Hmm, you're right. My bad.
I forgot I was compiling 0.9.0 because I had other issues compiling 
later versions under MinGW/MSYS on Windows.
In case you were not aware of this I'm including the end of my 0.9.3 
output below.

Please ignore my previous mail.
I just noticed this was caused by -Dsiginfo_t=int which I still had in 
there to fix older compiles.

Removing this works fine.

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


[libvirt] win32

2009-04-04 Thread Brecht Sanders

Hi,
Is there any way to compile libvirt with xen some support without 
depending on libxenstore?
The reason I ask is that libxen can be built on Windows, but libxenstore 
seems to depend on the linux kernel, so I doubt it can be built for Windows.

Regards
   Brecht Sanders

--
Libvir-list mailing list
Libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


Re: [libvirt] win32

2009-04-04 Thread Brecht Sanders

Daniel Veillard wrote:

On Sat, Apr 04, 2009 at 02:52:49PM +0200, Brecht Sanders wrote:
  

Hi,
Is there any way to compile libvirt with xen some support without  
depending on libxenstore?
The reason I ask is that libxen can be built on Windows, but libxenstore  
seems to depend on the linux kernel, so I doubt it can be built for 
Windows.



  Honnestly I don't think anybody ever tried. The only drivers usually
compiled on Win32 are remote and possibly test. Basically so far we expected
libvirt on Windows to be only a way to access libvirtd remotely. But
patches to improve/extend this are as usual welcome !
  
Well, I have tried in the past, and I think I actually got libvirt 0.4.4 
to build with MinGW/MSYS on Windows, but unfortunately only static 
libraries.

Bet back then only libxen was needed, not libxenstore.
Shouldn't it - in theory - be possible to build a libvirt for Windows 
without the need for a remote libvirtd?
What made me optimistical was the possibility to build libxen and the 
fact that Qemu also runs on Windows.

Regards
   Brecht
--
Libvir-list mailing list
Libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


Re: [libvirt] libvirt on mingw: undefined reference to htonl/ntohl

2008-06-19 Thread Brecht Sanders

No. Can you tell me where to find it?
I also noticed that I only produced one DLL: libvirt-0.dll.
No Python module DLL was built. Were you able to build this?

Atsushi SAKAI wrote:

Hi,

Did you check my instruction for libvirt on MinGW?

Thanks
Atsushi SAKAI


Brecht Sanders [EMAIL PROTECTED] wrote:

  

Hi,
Some time passed by and I thought I'd have another go at compiling 
libvirt for win32 using MinGW/MSYS again.
I tried to compile libvirt-0.4.3 and I got around most obstacles. Now it 
just seems I am stuck when it is trying to link.

My search on google showed me that I am not the first one to see this issue.
Usually i means -lws2_32 is in the wrong place. However I tried moving 
it around without luck.
Also it doesn't make sense to me that only htonl and ntohl are missing. 
It appears anything else used from the winsock library is found during 
linking.
I feel we're very close to getting libvirt compiled on win32. Or do you 
know if anyone already succeeded?

Regards
Brecht Sanders

gcc -shared  .libs/libvirt_la-libvirt.o .libs/libvirt_la-memory.o 
.libs/libvirt_la-hash.o .libs/libvirt_la-test.o .libs/libvirt_la-buf.o 
.libs/libvirt_la-qparams.o .libs/libvirt_la-capabilities.o 
.libs/libvirt_la-xml.o .libs/libvirt_la-event.o 
.libs/libvirt_la-xen_unified.o .libs/libvirt_la-xen_internal.o 
.libs/libvirt_la-xs_internal.o .libs/libvirt_la-xend_internal.o 
.libs/libvirt_la-stats_linux.o .libs/libvirt_la-sexpr.o 
.libs/libvirt_la-virterror.o .libs/libvirt_la-proxy_internal.o 
.libs/libvirt_la-conf.o .libs/libvirt_la-xm_internal.o 
.libs/libvirt_la-remote_internal.o .libs/libvirt_la-bridge.o 
.libs/libvirt_la-iptables.o .libs/libvirt_la-uuid.o 
.libs/libvirt_la-qemu_driver.o .libs/libvirt_la-qemu_conf.o 
.libs/libvirt_la-openvz_conf.o .libs/libvirt_la-openvz_driver.o 
.libs/libvirt_la-lxc_driver.o .libs/libvirt_la-lxc_conf.o 
.libs/libvirt_la-lxc_container.o .libs/libvirt_la-nodeinfo.o 
.libs/libvirt_la-util.o .libs/libvirt_la-remote_protocol.o 
-Wl,--whole-archive ../gnulib/lib/.libs/libgnu.a -Wl,--no-whole-archive  
-L/mingw/lib /mingw/lib/libxml2.dll.a /mingw/lib/libgnutls.dll.a 
-L/home/bsanders/inst_libgcrypt-1.4.1/lib -lintl -lpthread 
/mingw/lib/libportablexdr.dll.a -lws2_32  
-Wl,--version-script=./libvirt_sym.version -o .libs/libvirt-0.dll 
-Wl,--enable-auto-image-base -Xlinker --out-implib -Xlinker 
.libs/libvirt.dll.a

Creating library file: .libs/libvirt.dll.a
.libs/libvirt_la-remote_protocol.o:remote_protocol.c:(.text+0xa46): 
undefined reference to `htonl'
.libs/libvirt_la-remote_protocol.o:remote_protocol.c:(.text+0xa5f): 
undefined reference to `htonl'
.libs/libvirt_la-remote_protocol.o:remote_protocol.c:(.text+0xa78): 
undefined reference to `htonl'
.libs/libvirt_la-remote_protocol.o:remote_protocol.c:(.text+0xa91): 
undefined reference to `htonl'
.libs/libvirt_la-remote_protocol.o:remote_protocol.c:(.text+0xaaa): 
undefined reference to `htonl'
.libs/libvirt_la-remote_protocol.o:remote_protocol.c:(.text+0xac3): more 
undefined references to `htonl' follow
.libs/libvirt_la-remote_protocol.o:remote_protocol.c:(.text+0xc5d): 
undefined reference to `ntohl'
.libs/libvirt_la-remote_protocol.o:remote_protocol.c:(.text+0xc74): 
undefined reference to `ntohl'
.libs/libvirt_la-remote_protocol.o:remote_protocol.c:(.text+0xc8b): 
undefined reference to `ntohl'
.libs/libvirt_la-remote_protocol.o:remote_protocol.c:(.text+0xca2): 
undefined reference to `ntohl'
.libs/libvirt_la-remote_protocol.o:remote_protocol.c:(.text+0xcb9): 
undefined reference to `ntohl'
.libs/libvirt_la-remote_protocol.o:remote_protocol.c:(.text+0xccc): more 
undefined references to `ntohl' follow

collect2: ld returned 1 exit status
make[2]: *** [libvirt.la] Error 1
make[2]: Leaving directory `/home/bsanders/libvirt-0.4.3/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/bsanders/libvirt-0.4.3'
make: *** [all] Error 2

--
Libvir-list mailing list
Libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list







  


--
Libvir-list mailing list
Libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


Re: [libvirt] libvirt on mingw: undefined reference to htonl/ntohl

2008-06-19 Thread Brecht Sanders

Hi,
I guesss I had got as far as you did.
To Install Python on Windows you will need to download and install the 
following:

   http://www.python.org/ftp/python/2.5.2/python-2.5.2.msi
   
http://ftp.gnome.org/pub/GNOME/binaries/win32/pygobject/2.14/pygobject-2.14.1-1.win32-py2.5.exe
   
http://ftp.gnome.org/pub/GNOME/binaries/win32/pycairo/1.4/pycairo-1.4.12-1.win32-py2.5.exe
   
http://ftp.gnome.org/pub/GNOME/binaries/win32/pygtk/2.12/pygtk-2.12.1-2.win32-py2.5.exe

Also, don't forget to set some environment variables:
   export PYDIR=/C/Prog/Python25
   export PYTHONHOME=$PYDIR
   export PYTHONPATH=$PYDIR/Lib/site-packages
   export PATH=$MINGWPREFIX:$MINGWPREFIX/bin:$PATH
Just out of curiosity, have you done anything with virsh or the DLL you 
have built?

Regards,
   Brecht

Atsushi SAKAI wrote:

Hi, Bericht

By your suggestion, I am recognizing python bindings are not created(on my 
configuration).
If you notice me to install python on MinGW, I will try to investigate it.

My posting mail is follows(it does not create python library)
https://www.redhat.com/archives/libvir-list/2008-June/msg00201.html
It creates general library and virsh only.

Thanks
Atsushi SAKAI


Brecht Sanders [EMAIL PROTECTED] wrote:

  

No. Can you tell me where to find it?
I also noticed that I only produced one DLL: libvirt-0.dll.
No Python module DLL was built. Were you able to build this?

Atsushi SAKAI wrote:


Hi,

Did you check my instruction for libvirt on MinGW?

Thanks
Atsushi SAKAI


Brecht Sanders [EMAIL PROTECTED] wrote:

  
  

Hi,
Some time passed by and I thought I'd have another go at compiling 
libvirt for win32 using MinGW/MSYS again.
I tried to compile libvirt-0.4.3 and I got around most obstacles. Now it 
just seems I am stuck when it is trying to link.

My search on google showed me that I am not the first one to see this issue.
Usually i means -lws2_32 is in the wrong place. However I tried moving 
it around without luck.
Also it doesn't make sense to me that only htonl and ntohl are missing. 
It appears anything else used from the winsock library is found during 
linking.
I feel we're very close to getting libvirt compiled on win32. Or do you 
know if anyone already succeeded?

Regards
Brecht Sanders

gcc -shared  .libs/libvirt_la-libvirt.o .libs/libvirt_la-memory.o 
.libs/libvirt_la-hash.o .libs/libvirt_la-test.o .libs/libvirt_la-buf.o 
.libs/libvirt_la-qparams.o .libs/libvirt_la-capabilities.o 
.libs/libvirt_la-xml.o .libs/libvirt_la-event.o 
.libs/libvirt_la-xen_unified.o .libs/libvirt_la-xen_internal.o 
.libs/libvirt_la-xs_internal.o .libs/libvirt_la-xend_internal.o 
.libs/libvirt_la-stats_linux.o .libs/libvirt_la-sexpr.o 
.libs/libvirt_la-virterror.o .libs/libvirt_la-proxy_internal.o 
.libs/libvirt_la-conf.o .libs/libvirt_la-xm_internal.o 
.libs/libvirt_la-remote_internal.o .libs/libvirt_la-bridge.o 
.libs/libvirt_la-iptables.o .libs/libvirt_la-uuid.o 
.libs/libvirt_la-qemu_driver.o .libs/libvirt_la-qemu_conf.o 
.libs/libvirt_la-openvz_conf.o .libs/libvirt_la-openvz_driver.o 
.libs/libvirt_la-lxc_driver.o .libs/libvirt_la-lxc_conf.o 
.libs/libvirt_la-lxc_container.o .libs/libvirt_la-nodeinfo.o 
.libs/libvirt_la-util.o .libs/libvirt_la-remote_protocol.o 
-Wl,--whole-archive ../gnulib/lib/.libs/libgnu.a -Wl,--no-whole-archive  
-L/mingw/lib /mingw/lib/libxml2.dll.a /mingw/lib/libgnutls.dll.a 
-L/home/bsanders/inst_libgcrypt-1.4.1/lib -lintl -lpthread 
/mingw/lib/libportablexdr.dll.a -lws2_32  
-Wl,--version-script=./libvirt_sym.version -o .libs/libvirt-0.dll 
-Wl,--enable-auto-image-base -Xlinker --out-implib -Xlinker 
.libs/libvirt.dll.a

Creating library file: .libs/libvirt.dll.a
.libs/libvirt_la-remote_protocol.o:remote_protocol.c:(.text+0xa46): 
undefined reference to `htonl'
.libs/libvirt_la-remote_protocol.o:remote_protocol.c:(.text+0xa5f): 
undefined reference to `htonl'
.libs/libvirt_la-remote_protocol.o:remote_protocol.c:(.text+0xa78): 
undefined reference to `htonl'
.libs/libvirt_la-remote_protocol.o:remote_protocol.c:(.text+0xa91): 
undefined reference to `htonl'
.libs/libvirt_la-remote_protocol.o:remote_protocol.c:(.text+0xaaa): 
undefined reference to `htonl'
.libs/libvirt_la-remote_protocol.o:remote_protocol.c:(.text+0xac3): more 
undefined references to `htonl' follow
.libs/libvirt_la-remote_protocol.o:remote_protocol.c:(.text+0xc5d): 
undefined reference to `ntohl'
.libs/libvirt_la-remote_protocol.o:remote_protocol.c:(.text+0xc74): 
undefined reference to `ntohl'
.libs/libvirt_la-remote_protocol.o:remote_protocol.c:(.text+0xc8b): 
undefined reference to `ntohl'
.libs/libvirt_la-remote_protocol.o:remote_protocol.c:(.text+0xca2): 
undefined reference to `ntohl'
.libs/libvirt_la-remote_protocol.o:remote_protocol.c:(.text+0xcb9): 
undefined reference to `ntohl'
.libs/libvirt_la-remote_protocol.o:remote_protocol.c:(.text+0xccc): more 
undefined references to `ntohl' follow

collect2: ld returned 1 exit status
make[2]: *** [libvirt.la] Error 1
make[2]: Leaving directory `/home

Re: [libvirt] libvirt on mingw: undefined reference to htonl/ntohl

2008-06-19 Thread Brecht Sanders
Hi,
On my end I also had built libvirtmod.a, but without a DLL version of
this file I don't think it will be loadable as a Python module.
Or is there a way to load or link static libraries somehow in Python?
Brecht

P.S.: I didn't understand your spelling remark.

Atsushi SAKAI wrote:
 Hi, Brecht

 I can compile and generate .a file on python directory.
 Sorry for spelling (I am using Zen-kaku(2byte) character in your name.)

 Thanks
 Atsushi SAKAI


 Atsushi SAKAI [EMAIL PROTECTED] wrote:

   
 Hi, Brecht

 I can make .a file(not .dll).
 With following instruction.

 ==1==
 Install 
 http://www.python.org/ftp/python/2.5.2/python-2.5.2.msi
 to /usr/local/(C:\msys\1.0\local)

 and copy to include file to /usr/include/python2.5
 and copy /usr/local/python.exe pythonw.exe to /usr/local/bin

 ==2==
 Install to /usr/local (C:\msys\1.0\local)
 http://ftp.gnome.org/pub/GNOME/binaries/win32/pygobject/2.14/pygobject-2.14.1-1.win32-py2.5.exe

 make and make install seems work fine.

 Thanks
 Atsushi SAKAI





 Atsushi SAKAI [EMAIL PROTECTED] wrote:

 
 Hi, Brecht

   
 Just out of curiosity, have you done anything with virsh or the DLL you 
 have built?
 
 Yes

 By the way, I am doing to build Python bingings on MinGW.
 But it will need to do tomorrow, since many compilation warnings.

 Thanks
 Atsushi SAKAI




 Brecht Sanders [EMAIL PROTECTED] wrote:

   
 Hi,
 I guesss I had got as far as you did.
 To Install Python on Windows you will need to download and install the 
 following:
 http://www.python.org/ftp/python/2.5.2/python-2.5.2.msi
 
 http://ftp.gnome.org/pub/GNOME/binaries/win32/pygobject/2.14/pygobject-2.14.1-1.win32-py2.5.exe
 
 http://ftp.gnome.org/pub/GNOME/binaries/win32/pycairo/1.4/pycairo-1.4.12-1.win32-py2.5.exe
 
 http://ftp.gnome.org/pub/GNOME/binaries/win32/pygtk/2.12/pygtk-2.12.1-2.win32-py2.5.exe
 Also, don't forget to set some environment variables:
 export PYDIR=/C/Prog/Python25
 export PYTHONHOME=$PYDIR
 export PYTHONPATH=$PYDIR/Lib/site-packages
 export PATH=$MINGWPREFIX:$MINGWPREFIX/bin:$PATH
 Just out of curiosity, have you done anything with virsh or the DLL you 
 have built?
 Regards,
 Brecht

 Atsushi SAKAI wrote:
 
 Hi, Bericht

 By your suggestion, I am recognizing python bindings are not created(on 
 my configuration).
 If you notice me to install python on MinGW, I will try to investigate it.

 My posting mail is follows(it does not create python library)
 https://www.redhat.com/archives/libvir-list/2008-June/msg00201.html
 It creates general library and virsh only.

 Thanks
 Atsushi SAKAI


 Brecht Sanders [EMAIL PROTECTED] wrote:

   
   
 No. Can you tell me where to find it?
 I also noticed that I only produced one DLL: libvirt-0.dll.
 No Python module DLL was built. Were you able to build this?

 Atsushi SAKAI wrote:
 
 
 Hi,

 Did you check my instruction for libvirt on MinGW?

 Thanks
 Atsushi SAKAI


 Brecht Sanders [EMAIL PROTECTED] wrote:

   
   
   
 Hi,
 Some time passed by and I thought I'd have another go at compiling 
 libvirt for win32 using MinGW/MSYS again.
 I tried to compile libvirt-0.4.3 and I got around most obstacles. Now 
 it 
 just seems I am stuck when it is trying to link.
 My search on google showed me that I am not the first one to see this 
 issue.
 Usually i means -lws2_32 is in the wrong place. However I tried moving 
 it around without luck.
 Also it doesn't make sense to me that only htonl and ntohl are 
 missing. 
 It appears anything else used from the winsock library is found during 
 linking.
 I feel we're very close to getting libvirt compiled on win32. Or do 
 you 
 know if anyone already succeeded?
 Regards
 Brecht Sanders

 gcc -shared  .libs/libvirt_la-libvirt.o .libs/libvirt_la-memory.o 
 .libs/libvirt_la-hash.o .libs/libvirt_la-test.o .libs/libvirt_la-buf.o 
 .libs/libvirt_la-qparams.o .libs/libvirt_la-capabilities.o 
 .libs/libvirt_la-xml.o .libs/libvirt_la-event.o 
 .libs/libvirt_la-xen_unified.o .libs/libvirt_la-xen_internal.o 
 .libs/libvirt_la-xs_internal.o .libs/libvirt_la-xend_internal.o 
 .libs/libvirt_la-stats_linux.o .libs/libvirt_la-sexpr.o 
 .libs/libvirt_la-virterror.o .libs/libvirt_la-proxy_internal.o 
 .libs/libvirt_la-conf.o .libs/libvirt_la-xm_internal.o 
 .libs/libvirt_la-remote_internal.o .libs/libvirt_la-bridge.o 
 .libs/libvirt_la-iptables.o .libs/libvirt_la-uuid.o 
 .libs/libvirt_la-qemu_driver.o .libs/libvirt_la-qemu_conf.o 
 .libs/libvirt_la-openvz_conf.o .libs/libvirt_la-openvz_driver.o 
 .libs/libvirt_la-lxc_driver.o .libs/libvirt_la-lxc_conf.o 
 .libs/libvirt_la-lxc_container.o .libs/libvirt_la-nodeinfo.o 
 .libs/libvirt_la-util.o .libs/libvirt_la-remote_protocol.o 
 -Wl,--whole-archive ../gnulib/lib/.libs/libgnu.a 
 -Wl,--no-whole-archive  
 -L/mingw/lib /mingw/lib/libxml2.dll.a /mingw/lib/libgnutls.dll.a 
 -L/home/bsanders/inst_libgcrypt-1.4.1/lib -lintl -lpthread 
 /mingw/lib/libportablexdr.dll.a

[libvirt] libvirt on mingw: undefined reference to htonl/ntohl

2008-06-18 Thread Brecht Sanders

Hi,
Some time passed by and I thought I'd have another go at compiling 
libvirt for win32 using MinGW/MSYS again.
I tried to compile libvirt-0.4.3 and I got around most obstacles. Now it 
just seems I am stuck when it is trying to link.

My search on google showed me that I am not the first one to see this issue.
Usually i means -lws2_32 is in the wrong place. However I tried moving 
it around without luck.
Also it doesn't make sense to me that only htonl and ntohl are missing. 
It appears anything else used from the winsock library is found during 
linking.
I feel we're very close to getting libvirt compiled on win32. Or do you 
know if anyone already succeeded?

Regards
   Brecht Sanders

gcc -shared  .libs/libvirt_la-libvirt.o .libs/libvirt_la-memory.o 
.libs/libvirt_la-hash.o .libs/libvirt_la-test.o .libs/libvirt_la-buf.o 
.libs/libvirt_la-qparams.o .libs/libvirt_la-capabilities.o 
.libs/libvirt_la-xml.o .libs/libvirt_la-event.o 
.libs/libvirt_la-xen_unified.o .libs/libvirt_la-xen_internal.o 
.libs/libvirt_la-xs_internal.o .libs/libvirt_la-xend_internal.o 
.libs/libvirt_la-stats_linux.o .libs/libvirt_la-sexpr.o 
.libs/libvirt_la-virterror.o .libs/libvirt_la-proxy_internal.o 
.libs/libvirt_la-conf.o .libs/libvirt_la-xm_internal.o 
.libs/libvirt_la-remote_internal.o .libs/libvirt_la-bridge.o 
.libs/libvirt_la-iptables.o .libs/libvirt_la-uuid.o 
.libs/libvirt_la-qemu_driver.o .libs/libvirt_la-qemu_conf.o 
.libs/libvirt_la-openvz_conf.o .libs/libvirt_la-openvz_driver.o 
.libs/libvirt_la-lxc_driver.o .libs/libvirt_la-lxc_conf.o 
.libs/libvirt_la-lxc_container.o .libs/libvirt_la-nodeinfo.o 
.libs/libvirt_la-util.o .libs/libvirt_la-remote_protocol.o 
-Wl,--whole-archive ../gnulib/lib/.libs/libgnu.a -Wl,--no-whole-archive  
-L/mingw/lib /mingw/lib/libxml2.dll.a /mingw/lib/libgnutls.dll.a 
-L/home/bsanders/inst_libgcrypt-1.4.1/lib -lintl -lpthread 
/mingw/lib/libportablexdr.dll.a -lws2_32  
-Wl,--version-script=./libvirt_sym.version -o .libs/libvirt-0.dll 
-Wl,--enable-auto-image-base -Xlinker --out-implib -Xlinker 
.libs/libvirt.dll.a

Creating library file: .libs/libvirt.dll.a
.libs/libvirt_la-remote_protocol.o:remote_protocol.c:(.text+0xa46): 
undefined reference to `htonl'
.libs/libvirt_la-remote_protocol.o:remote_protocol.c:(.text+0xa5f): 
undefined reference to `htonl'
.libs/libvirt_la-remote_protocol.o:remote_protocol.c:(.text+0xa78): 
undefined reference to `htonl'
.libs/libvirt_la-remote_protocol.o:remote_protocol.c:(.text+0xa91): 
undefined reference to `htonl'
.libs/libvirt_la-remote_protocol.o:remote_protocol.c:(.text+0xaaa): 
undefined reference to `htonl'
.libs/libvirt_la-remote_protocol.o:remote_protocol.c:(.text+0xac3): more 
undefined references to `htonl' follow
.libs/libvirt_la-remote_protocol.o:remote_protocol.c:(.text+0xc5d): 
undefined reference to `ntohl'
.libs/libvirt_la-remote_protocol.o:remote_protocol.c:(.text+0xc74): 
undefined reference to `ntohl'
.libs/libvirt_la-remote_protocol.o:remote_protocol.c:(.text+0xc8b): 
undefined reference to `ntohl'
.libs/libvirt_la-remote_protocol.o:remote_protocol.c:(.text+0xca2): 
undefined reference to `ntohl'
.libs/libvirt_la-remote_protocol.o:remote_protocol.c:(.text+0xcb9): 
undefined reference to `ntohl'
.libs/libvirt_la-remote_protocol.o:remote_protocol.c:(.text+0xccc): more 
undefined references to `ntohl' follow

collect2: ld returned 1 exit status
make[2]: *** [libvirt.la] Error 1
make[2]: Leaving directory `/home/bsanders/libvirt-0.4.3/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/bsanders/libvirt-0.4.3'
make: *** [all] Error 2

--
Libvir-list mailing list
Libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


[libvirt] Re: libvirt on mingw: undefined reference to htonl/ntohl

2008-06-18 Thread Brecht Sanders

Hello again,
I may have been a bit to fast quick with my mail.
Now I was able to compile and link libvirt-0.4.3 (except for the tests 
which depend on fork e.a.).
The htonl/ntohl prbem mentioned earliers was fixed by inserting 
#include winsock2.h into qemud/remote_protocol.c.
I also had errors about fprintf in proxy/libvirt_proxy.c which were 
fixed by inserting #include stdio.h.
Previously I had already discovered src/internal.h needs #include 
pthread.h.
As for make install, I had to comment out the chmod u+s line in 
proxy/Makefile, because win32 doesn't support this.
Finally I had an error because config.stat could not be found. I 
resolved this with ln -s config.status config.stat.

Now it's built I guess the next logical step would be testing.
It's a shame though the tests won't compile.
Any chance they could be rewritten using pthreads instead of fork?
Regards
   Brecht Sanders

Brecht Sanders wrote:

Hi,
Some time passed by and I thought I'd have another go at compiling 
libvirt for win32 using MinGW/MSYS again.
I tried to compile libvirt-0.4.3 and I got around most obstacles. Now 
it just seems I am stuck when it is trying to link.
My search on google showed me that I am not the first one to see this 
issue.
Usually i means -lws2_32 is in the wrong place. However I tried moving 
it around without luck.
Also it doesn't make sense to me that only htonl and ntohl are 
missing. It appears anything else used from the winsock library is 
found during linking.
I feel we're very close to getting libvirt compiled on win32. Or do 
you know if anyone already succeeded?

Regards
   Brecht Sanders

gcc -shared  .libs/libvirt_la-libvirt.o .libs/libvirt_la-memory.o 
.libs/libvirt_la-hash.o .libs/libvirt_la-test.o .libs/libvirt_la-buf.o 
.libs/libvirt_la-qparams.o .libs/libvirt_la-capabilities.o 
.libs/libvirt_la-xml.o .libs/libvirt_la-event.o 
.libs/libvirt_la-xen_unified.o .libs/libvirt_la-xen_internal.o 
.libs/libvirt_la-xs_internal.o .libs/libvirt_la-xend_internal.o 
.libs/libvirt_la-stats_linux.o .libs/libvirt_la-sexpr.o 
.libs/libvirt_la-virterror.o .libs/libvirt_la-proxy_internal.o 
.libs/libvirt_la-conf.o .libs/libvirt_la-xm_internal.o 
.libs/libvirt_la-remote_internal.o .libs/libvirt_la-bridge.o 
.libs/libvirt_la-iptables.o .libs/libvirt_la-uuid.o 
.libs/libvirt_la-qemu_driver.o .libs/libvirt_la-qemu_conf.o 
.libs/libvirt_la-openvz_conf.o .libs/libvirt_la-openvz_driver.o 
.libs/libvirt_la-lxc_driver.o .libs/libvirt_la-lxc_conf.o 
.libs/libvirt_la-lxc_container.o .libs/libvirt_la-nodeinfo.o 
.libs/libvirt_la-util.o .libs/libvirt_la-remote_protocol.o 
-Wl,--whole-archive ../gnulib/lib/.libs/libgnu.a 
-Wl,--no-whole-archive  -L/mingw/lib /mingw/lib/libxml2.dll.a 
/mingw/lib/libgnutls.dll.a -L/home/bsanders/inst_libgcrypt-1.4.1/lib 
-lintl -lpthread /mingw/lib/libportablexdr.dll.a -lws2_32  
-Wl,--version-script=./libvirt_sym.version -o .libs/libvirt-0.dll 
-Wl,--enable-auto-image-base -Xlinker --out-implib -Xlinker 
.libs/libvirt.dll.a

Creating library file: .libs/libvirt.dll.a
.libs/libvirt_la-remote_protocol.o:remote_protocol.c:(.text+0xa46): 
undefined reference to `htonl'
.libs/libvirt_la-remote_protocol.o:remote_protocol.c:(.text+0xa5f): 
undefined reference to `htonl'
.libs/libvirt_la-remote_protocol.o:remote_protocol.c:(.text+0xa78): 
undefined reference to `htonl'
.libs/libvirt_la-remote_protocol.o:remote_protocol.c:(.text+0xa91): 
undefined reference to `htonl'
.libs/libvirt_la-remote_protocol.o:remote_protocol.c:(.text+0xaaa): 
undefined reference to `htonl'
.libs/libvirt_la-remote_protocol.o:remote_protocol.c:(.text+0xac3): 
more undefined references to `htonl' follow
.libs/libvirt_la-remote_protocol.o:remote_protocol.c:(.text+0xc5d): 
undefined reference to `ntohl'
.libs/libvirt_la-remote_protocol.o:remote_protocol.c:(.text+0xc74): 
undefined reference to `ntohl'
.libs/libvirt_la-remote_protocol.o:remote_protocol.c:(.text+0xc8b): 
undefined reference to `ntohl'
.libs/libvirt_la-remote_protocol.o:remote_protocol.c:(.text+0xca2): 
undefined reference to `ntohl'
.libs/libvirt_la-remote_protocol.o:remote_protocol.c:(.text+0xcb9): 
undefined reference to `ntohl'
.libs/libvirt_la-remote_protocol.o:remote_protocol.c:(.text+0xccc): 
more undefined references to `ntohl' follow

collect2: ld returned 1 exit status
make[2]: *** [libvirt.la] Error 1
make[2]: Leaving directory `/home/bsanders/libvirt-0.4.3/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/bsanders/libvirt-0.4.3'
make: *** [all] Error 2




--
Libvir-list mailing list
Libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


[Libvir] Re: libvirt for Python on Windows

2008-02-06 Thread Brecht Sanders

Aha, the big question.
So far I only have loose notes, but basically it comes down to the 
instructions below.

I used SWIG (http://www.swig.org/) to build the DLL of the Python module.
My setup had Python 2.4 installed in C:\Prog\Python24. Of course the 
required C dependancies where also already met on my system (including 
libxen).
I have quite some experience in porting *nix stuff to Windows/win32 
using MinGW/MSYS, but Python was new to me.
Nevertheless it took my days (well, nights mostly) to get this result, 
but the instructions below aren't too long. So I believe it shouldn't 
require that many changes to sources and autoconf/automake stuff to 
incorporate the MinGW/MSYS port.
I'm afraid there is still some work ahead meeting all the Python 
dependancies. If we're lucky they will exist for Windows. Otherwise they 
will need porting too (hopefully easier than libvirt).

Here goes:

wget -c http://downloads.sourceforge.net/swig/swigwin-1.3.33.zip
unzip -oqj swigwin-1.3.33.zip -d /C/Prog/Python24 swigwin-1.3.33/swig.exe

wget -c http://libvirt.org/sources/libvirt-cvs-snapshot.tar.gz
tar xfz libvirt-cvs-snapshot.tar.gz
cd libvirt-0.4.0

mkdir linux
touch linux/param.h

mv src/internal.h src/internal.h.bak
echo #include pthread.h  src/internal.h
sed -e 's/^\(#define VIR_DEBUG(.*) *\)$/\1 \\/' src/internal.h.bak  
src/internal.h


mv qemud/remote_protocol.c qemud/remote_protocol.c.bak
echo #include winsock2.h  qemud/remote_protocol.c
cat qemud/remote_protocol.c.bak  qemud/remote_protocol.c

mv configure configure.bak
sed -e s?/include/python\${PYTHON_VERSION}?/include?; 
s?/lib/python\${PYTHON_VERSION}/site-packages?$/Lib/site-packages?; 
s?-lpython\\\${PYTHON_VERSION}?-lpython\`echo \\\$PYTHON_VERSION|sed -e 
's/\\\.//'\`? configure.bak  configure


./configure --prefix=$INSTALLPREFIX --disable-rpath --enable-debug=no 
--enable-compile-warnings=minimum --with-xen --without-xen-proxy 
--without-qemu --without-openvz --without-test --without-libvirtd 
--without-remote --with-init-scripts=none --with-depends --without-sasl 
--without-polkit --with-python=/C/Prog/Python24/python.exe 
PYTHON=/C/Prog/Python24/python.exe 
PYTHON_INCLUDES=/C/Prog/Python24/include CFLAGS=-Drestrict=__restrict 
-DWSAAPI= LDFLAGS=-no-undefined -lportablexdr -lwsock32 -lintl


# don't build tests
mv tests/Makefile tests/Makefile.bak
cat  tests/Makefile  EOF
all:
install:
EOF

make install

cd python

mv Makefile Makefile.bak
sed -e s?^\(PYTHON_INCLUDES *= *.*\)?\1/C/Prog/Python24/include?; 
s?^\(PYTHON_SITE_PACKAGES *= 
*.*\)?\1/C/Prog/Python24/Lib/site-packages? Makefile.bak  Makefile


/C/Prog/Python24/python.exe generator.py
make libvirtmod_la-libvir.lo libvirtmod_la-types.lo 
libvirtmod_la-libvirt-py.lo


# use SWIG to create Python wrapper
cat  libvirtmod.i  EOF
%module libvirtmod
%{
#include ../include/libvirt/libvirt.h
%}
EOF
sed -e s/^\(.*libvirt.*\)$/extern \1/ libvirt-py.h  libvirtmod.i
../../swigwin-1.3.33/swig -python -I../../swigwin-1.3.33/Lib 
-I../../swigwin-1.3.33/Lib/python/ libvirtmod.i


gcc -shared libvirtmod_wrap.c libvirtmod_la-libvir.o 
libvirtmod_la-types.o libvirtmod_la-libvirt-py.o -lportablexdr -lws2_32 
-I/C/Prog/Python24/include -L/C/Prog/Python24/libs -lpython24 
-L../src/.libs/ -lvirt -Wl,--export-all-symbols -o _libvirtmod.dll


# test it
/C/Prog/Python24/python.exe -c import libvirt

cp libvirt.py libvirtmod.py _libvirtmod.dll 
/C/Prog/Python24/Lib/site-packages



Richard W.M. Jones wrote:

Brecht Sanders wrote:

Hi Richard,
I have finally compiled a libvirt Python module.
Attached are the files that need to go into python 2.4 
homelib/site-packages, in case you want to try this.


How did you build _libvirtmod though?

Rich.



--
Libvir-list mailing list
Libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list