Re: [libvirt] [PATCH] fix MinGW compilation(200808)
Atsushi SAKAI [EMAIL PROTECTED] wrote: Hi, Jim and Dan How about this? src/domain_conf.c|1 + src/domain_conf.h|6 +++--- src/network_conf.c |1 + src/qemu_driver.c| 32 src/util.c |4 ++-- src/virsh.c |3 +++ tests/testutilsxen.c |2 ++ 7 files changed, 28 insertions(+), 21 deletions(-) Thanks Atsushi SAKAI Jim Meyering [EMAIL PROTECTED] wrote: Atsushi SAKAI [EMAIL PROTECTED] wrote: Hi, Dan Thank you for commenting it. Without WITH_QEMU, following errors are appeared. === In file included from test.c:44: domain_conf.h:447: error: syntax error before '' token domain_conf.h:447: warning: no semicolon at end of struct or union domain_conf.h:448: error: syntax error before '' token domain_conf.h:449: error: syntax error before '' token domain_conf.h:458: error: syntax error before ':' token domain_conf.h:459: error: syntax error before ':' token domain_conf.h:468: error: syntax error before '}' token ... +#ifdef WITH_QEMU int stdin; int stdout; int stderr; +#endif Instead of an ifdef, I suggest renaming those three variables. Then their names won't conflict with the names from stdio.h. Please make that var-renaming change a separate change set. I'd prefer names with the _fd suffix (to make it clear they are file descriptors). The vm prefix is a little redundant. Please make the name-changing delta a separate commit: i.e., do not mix it with the other portability-related changes. Thanks, Jim -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH] fix MinGW compilation(200808)
Hi, Jim I am looking around the code about WEXITSTATUS. It seems that following kind of code needs on gnulib. http://kerneltrap.org/mailarchive/git/2008/2/27/1003054 What do you think? Thanks Atsushi SAKAI Atsushi SAKAI [EMAIL PROTECTED] wrote: Hi, Dan mkstemp is solved by Jim. But WEXITSTATUS problem is not solved yet. Since sys/wait.h does not exist on MinGW. http://www.mingw.org/MinGWiki/index.php/PortingChildren Thanks Atsushi SAKAI Daniel P. Berrange [EMAIL PROTECTED] wrote: On Thu, Aug 07, 2008 at 05:56:48PM +0900, Atsushi SAKAI wrote: Hi, Jim Your patch works fine. It passes inet_pton problem. Please apply it. By the way, virsh compilation error. Is threre any good suggestion? = virsh-virsh.o: In function `editWriteToTempFile': C:/msys/1.0/home/Administrator/work/libvirt/src/virsh.c:5080: undefined reference to `mkstemp' Look like there is a gnulib module for that - Jim could say if its license compatible virsh-virsh.o: In function `editFile': C:/msys/1.0/home/Administrator/work/libvirt/src/virsh.c:5155: undefined reference to `WEXITSTATUS' virsh.c seems to be missing '#include sys/wait.h' Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :| -- 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] [PATCH] fix MinGW compilation(200808)
Atsushi SAKAI [EMAIL PROTECTED] wrote: I am looking around the code about WEXITSTATUS. It seems that following kind of code needs on gnulib. http://kerneltrap.org/mailarchive/git/2008/2/27/1003054 What do you think? Hi Atsushi, Yes, git provides MinGW support, and I see it's compat/mingw.h includes this line: #define WEXITSTATUS(x) ((x) 0xff) Could it be as easy as adding this? #ifndef WEXITSTATUS # define WEXITSTATUS(x) ((x) 0xff) #endif gnulib provides heavy-weight (different API, and GPL'd) support for running subprocesses via its execute module, but it targets more than just MinGW. -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH] fix MinGW compilation(200808)
On Mon, Aug 11, 2008 at 10:41:43AM +0200, Jim Meyering wrote: Atsushi SAKAI [EMAIL PROTECTED] wrote: I am looking around the code about WEXITSTATUS. It seems that following kind of code needs on gnulib. http://kerneltrap.org/mailarchive/git/2008/2/27/1003054 What do you think? Hi Atsushi, Yes, git provides MinGW support, and I see it's compat/mingw.h includes this line: #define WEXITSTATUS(x) ((x) 0xff) Could it be as easy as adding this? #ifndef WEXITSTATUS # define WEXITSTATUS(x) ((x) 0xff) #endif Just adding that to virsh (or one of the libvirt headers) is fine by me. Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :| -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH] fix MinGW compilation(200808)
Hi, Jim and Dan Thank you for commenting. I compiled with attached patch successfully. src/domain_conf.c|1 + src/domain_conf.h|2 ++ src/network_conf.c |1 + src/util.c |4 ++-- src/virsh.c |3 +++ tests/testutilsxen.c |2 ++ 6 files changed, 11 insertions(+), 2 deletions(-) Thanks Atsushi SAKAI Jim Meyering [EMAIL PROTECTED] wrote: Atsushi SAKAI [EMAIL PROTECTED] wrote: I am looking around the code about WEXITSTATUS. It seems that following kind of code needs on gnulib. http://kerneltrap.org/mailarchive/git/2008/2/27/1003054 What do you think? Hi Atsushi, Yes, git provides MinGW support, and I see it's compat/mingw.h includes this line: #define WEXITSTATUS(x) ((x) 0xff) Could it be as easy as adding this? #ifndef WEXITSTATUS # define WEXITSTATUS(x) ((x) 0xff) #endif gnulib provides heavy-weight (different API, and GPL'd) support for running subprocesses via its execute module, but it targets more than just MinGW. fix_mingw_compile_20080811.patch Description: Binary data -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH] fix MinGW compilation(200808)
On Mon, Aug 11, 2008 at 07:57:46PM +0900, Atsushi SAKAI wrote: Hi, Jim and Dan Thank you for commenting. I compiled with attached patch successfully. This is bit not good: diff -u -r1.6 domain_conf.h --- src/domain_conf.h 8 Aug 2008 15:03:00 - 1.6 +++ src/domain_conf.h 11 Aug 2008 10:53:21 - @@ -444,9 +444,11 @@ typedef struct _virDomainObj virDomainObj; typedef virDomainObj *virDomainObjPtr; struct _virDomainObj { +#ifdef WITH_QEMU int stdin; int stdout; int stderr; +#endif int monitor; int logfile; int pid; The domain_conf.{c,h} is *generic* code and should have no driver-specific bits in it. As such there's no need for WITH_QEMU conditional compilation Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :| -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH] fix MinGW compilation(200808)
Hi, Dan Thank you for commenting it. Without WITH_QEMU, following errors are appeared. === In file included from test.c:44: domain_conf.h:447: error: syntax error before '' token domain_conf.h:447: warning: no semicolon at end of struct or union domain_conf.h:448: error: syntax error before '' token domain_conf.h:449: error: syntax error before '' token domain_conf.h:458: error: syntax error before ':' token domain_conf.h:459: error: syntax error before ':' token domain_conf.h:468: error: syntax error before '}' token ==snip== Thanks Atsushi SAKAI Daniel P. Berrange [EMAIL PROTECTED] wrote: On Mon, Aug 11, 2008 at 07:57:46PM +0900, Atsushi SAKAI wrote: Hi, Jim and Dan Thank you for commenting. I compiled with attached patch successfully. This is bit not good: diff -u -r1.6 domain_conf.h --- src/domain_conf.h 8 Aug 2008 15:03:00 - 1.6 +++ src/domain_conf.h 11 Aug 2008 10:53:21 - @@ -444,9 +444,11 @@ typedef struct _virDomainObj virDomainObj; typedef virDomainObj *virDomainObjPtr; struct _virDomainObj { +#ifdef WITH_QEMU int stdin; int stdout; int stderr; +#endif int monitor; int logfile; int pid; The domain_conf.{c,h} is *generic* code and should have no driver-specific bits in it. As such there's no need for WITH_QEMU conditional compilation Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :| -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH] fix MinGW compilation(200808)
Atsushi SAKAI [EMAIL PROTECTED] wrote: Hi, Dan Thank you for commenting it. Without WITH_QEMU, following errors are appeared. === In file included from test.c:44: domain_conf.h:447: error: syntax error before '' token domain_conf.h:447: warning: no semicolon at end of struct or union domain_conf.h:448: error: syntax error before '' token domain_conf.h:449: error: syntax error before '' token domain_conf.h:458: error: syntax error before ':' token domain_conf.h:459: error: syntax error before ':' token domain_conf.h:468: error: syntax error before '}' token ... +#ifdef WITH_QEMU int stdin; int stdout; int stderr; +#endif Instead of an ifdef, I suggest renaming those three variables. Then their names won't conflict with the names from stdio.h. Please make that var-renaming change a separate change set. -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH] fix MinGW compilation(200808)
Hi, Jim and Dan How about this? src/domain_conf.c|1 + src/domain_conf.h|6 +++--- src/network_conf.c |1 + src/qemu_driver.c| 32 src/util.c |4 ++-- src/virsh.c |3 +++ tests/testutilsxen.c |2 ++ 7 files changed, 28 insertions(+), 21 deletions(-) Thanks Atsushi SAKAI Jim Meyering [EMAIL PROTECTED] wrote: Atsushi SAKAI [EMAIL PROTECTED] wrote: Hi, Dan Thank you for commenting it. Without WITH_QEMU, following errors are appeared. === In file included from test.c:44: domain_conf.h:447: error: syntax error before '' token domain_conf.h:447: warning: no semicolon at end of struct or union domain_conf.h:448: error: syntax error before '' token domain_conf.h:449: error: syntax error before '' token domain_conf.h:458: error: syntax error before ':' token domain_conf.h:459: error: syntax error before ':' token domain_conf.h:468: error: syntax error before '}' token ... +#ifdef WITH_QEMU int stdin; int stdout; int stderr; +#endif Instead of an ifdef, I suggest renaming those three variables. Then their names won't conflict with the names from stdio.h. Please make that var-renaming change a separate change set. fix_mingw_compile_20080812.patch Description: Binary data -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH] fix MinGW compilation(200808)
Atsushi SAKAI [EMAIL PROTECTED] wrote: I have a question about inet_pton(). I try to compile libvirt on MinGW after some modification. The error message says follows. C:/msys/1.0/home/sakaia/work/libvirt/src/network_conf.c:290: undefined reference to `inet_pton' C:/msys/1.0/home/sakaia/work/libvirt/src/network_conf.c:296: undefined reference to `inet_pton' Thanks for the report. When the system does not declare inet_pton, gnulib arranges for it to be in gnulib/lib/arpa/inet.h. Since network_conf.c does include arpa/inet.h, and -I directives point to the containing directory, it should use that file. Please run make distclean (or start from a fresh checkout), then run the usual ./autogen.sh command, to ensure that you don't have any stale, generated files. If the problem persists, please post the contents of the generated gnulib/lib/arpa/inet.h. -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH] fix MinGW compilation(200808)
Hi, Jim Thsnk you for your reply. src/network_conf.c defines #include arpa/inet.h. The error message says the link does not exist. So I think it should add inet_pton.c to Makefile Is my understanding incorrect? By the way, I added sys/stat.h to domain_conf.c. It solves the missing definition of S_IRUSR, S_IWUSR. Thanks Atsushi SAKAI Jim Meyering [EMAIL PROTECTED] wrote: Atsushi SAKAI [EMAIL PROTECTED] wrote: I have a question about inet_pton(). I try to compile libvirt on MinGW after some modification. The error message says follows. C:/msys/1.0/home/sakaia/work/libvirt/src/network_conf.c:290: undefined reference to `inet_pton' C:/msys/1.0/home/sakaia/work/libvirt/src/network_conf.c:296: undefined reference to `inet_pton' Thanks for the report. When the system does not declare inet_pton, gnulib arranges for it to be in gnulib/lib/arpa/inet.h. Since network_conf.c does include arpa/inet.h, and -I directives point to the containing directory, it should use that file. Please run make distclean (or start from a fresh checkout), then run the usual ./autogen.sh command, to ensure that you don't have any stale, generated files. If the problem persists, please post the contents of the generated gnulib/lib/arpa/inet.h. -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH] fix MinGW compilation(200808)
Atsushi SAKAI [EMAIL PROTECTED] wrote: Hi, Jim Thsnk you for your reply. src/network_conf.c defines #include arpa/inet.h. The error message says the link does not exist. So I think it should add inet_pton.c to Makefile ... I try to compile libvirt on MinGW after some modification. The error message says follows. C:/msys/1.0/home/sakaia/work/libvirt/src/network_conf.c:290: undefined reference to `inet_pton' C:/msys/1.0/home/sakaia/work/libvirt/src/network_conf.c:296: undefined reference to `inet_pton' Ahh.. those are _link_ errors. That's due to a missing file: gnulib/m4/inet_pton.m4, and one that I didn't update: gnulib/m4/gnulib-comp.m4 My smoke test configure/build worked fine because I ran it on a Linux system, which doesn't need inet_pton. Please try this patch: (this gnulib-comp.m4 changes also reflects some unrelated changes in gnulib -- FYI, I'm preparing another gnulib-related patch that updates several files with bug- and portability- fixes) From 335ac36a1e22da0922eb4abb7501c79bf418b8b0 Mon Sep 17 00:00:00 2001 From: Jim Meyering [EMAIL PROTECTED] Date: Thu, 7 Aug 2008 09:56:38 +0200 Subject: [PATCH] complete the MinGW inet_pton portability fix * gnulib/m4/inet_pton.m4: New file. Required for MinGW. * gnulib/m4/gnulib-comp.m4: Update. --- gnulib/m4/gnulib-comp.m4 | 62 + gnulib/m4/inet_pton.m4 | 27 2 files changed, 67 insertions(+), 22 deletions(-) create mode 100644 gnulib/m4/inet_pton.m4 diff --git a/gnulib/m4/gnulib-comp.m4 b/gnulib/m4/gnulib-comp.m4 index 6341bc2..239eb7a 100644 --- a/gnulib/m4/gnulib-comp.m4 +++ b/gnulib/m4/gnulib-comp.m4 @@ -39,6 +39,8 @@ AC_DEFUN([gl_INIT], m4_pushdef([AC_LIBOBJ], m4_defn([gl_LIBOBJ])) m4_pushdef([AC_REPLACE_FUNCS], m4_defn([gl_REPLACE_FUNCS])) m4_pushdef([AC_LIBSOURCES], m4_defn([gl_LIBSOURCES])) + m4_pushdef([gl_LIBSOURCES_LIST], []) + m4_pushdef([gl_LIBSOURCES_DIR], []) gl_COMMON gl_source_base='gnulib/lib' gl_EOVERFLOW @@ -60,6 +62,8 @@ AC_DEFUN([gl_INIT], AC_SUBST([LTLIBINTL]) gl_INET_NTOP gl_ARPA_INET_MODULE_INDICATOR([inet_ntop]) + gl_INET_PTON + gl_ARPA_INET_MODULE_INDICATOR([inet_pton]) gl_FUNC_LSEEK gl_UNISTD_MODULE_INDICATOR([lseek]) gl_FUNC_MALLOC_POSIX @@ -107,6 +111,19 @@ AC_DEFUN([gl_INIT], AM_XGETTEXT_OPTION([--flag=vasprintf:2:c-format])]) gl_WCHAR_H gl_XSIZE + m4_ifval(gl_LIBSOURCES_LIST, [ +m4_syscmd([test ! -d ]m4_defn([gl_LIBSOURCES_DIR])[ || + for gl_file in ]gl_LIBSOURCES_LIST[ ; do +if test ! -r ]m4_defn([gl_LIBSOURCES_DIR])[/$gl_file ; then + echo missing file ]m4_defn([gl_LIBSOURCES_DIR])[/$gl_file 2 + exit 1 +fi + done])dnl + m4_if(m4_sysval, [0], [], +[AC_FATAL([expected source file, required through AC_LIBSOURCES, not found])]) + ]) + m4_popdef([gl_LIBSOURCES_DIR]) + m4_popdef([gl_LIBSOURCES_LIST]) m4_popdef([AC_LIBSOURCES]) m4_popdef([AC_REPLACE_FUNCS]) m4_popdef([AC_LIBOBJ]) @@ -129,6 +146,8 @@ AC_DEFUN([gl_INIT], m4_pushdef([AC_LIBOBJ], m4_defn([gltests_LIBOBJ])) m4_pushdef([AC_REPLACE_FUNCS], m4_defn([gltests_REPLACE_FUNCS])) m4_pushdef([AC_LIBSOURCES], m4_defn([gltests_LIBSOURCES])) + m4_pushdef([gltests_LIBSOURCES_LIST], []) + m4_pushdef([gltests_LIBSOURCES_DIR], []) gl_COMMON gl_source_base='gnulib/tests' gt_TYPE_WCHAR_T @@ -136,6 +155,19 @@ AC_DEFUN([gl_INIT], AC_CHECK_FUNCS([shutdown]) abs_aux_dir=`cd $ac_aux_dir; pwd` AC_SUBST([abs_aux_dir]) + m4_ifval(gltests_LIBSOURCES_LIST, [ +m4_syscmd([test ! -d ]m4_defn([gltests_LIBSOURCES_DIR])[ || + for gl_file in ]gltests_LIBSOURCES_LIST[ ; do +if test ! -r ]m4_defn([gltests_LIBSOURCES_DIR])[/$gl_file ; then + echo missing file ]m4_defn([gltests_LIBSOURCES_DIR])[/$gl_file 2 + exit 1 +fi + done])dnl + m4_if(m4_sysval, [0], [], +[AC_FATAL([expected source file, required through AC_LIBSOURCES, not found])]) + ]) + m4_popdef([gltests_LIBSOURCES_DIR]) + m4_popdef([gltests_LIBSOURCES_LIST]) m4_popdef([AC_LIBSOURCES]) m4_popdef([AC_REPLACE_FUNCS]) m4_popdef([AC_LIBOBJ]) @@ -164,13 +196,6 @@ AC_DEFUN([gl_LIBOBJ], [ gl_LIBOBJS=$gl_LIBOBJS $1.$ac_objext ]) -# m4_foreach_w is provided by autoconf-2.59c and later. -# This definition is to accommodate developers using versions -# of autoconf older than that. -m4_ifndef([m4_foreach_w], - [m4_define([m4_foreach_w], -[m4_foreach([$1], m4_split(m4_normalize([$2]), [ ]), [$3])])]) - # Like AC_REPLACE_FUNCS, except that the module name goes # into gl_LIBOBJS instead of into LIBOBJS. AC_DEFUN([gl_REPLACE_FUNCS], [ @@ -179,15 +204,14 @@ AC_DEFUN([gl_REPLACE_FUNCS], [ ]) # Like AC_LIBSOURCES, except the directory where the source file is -# expected is derived from the gnulib-tool parametrization, +# expected is derived from the gnulib-tool parameterization, # and alloca is special cased (for the
Re: [libvirt] [PATCH] fix MinGW compilation(200808)
Hi, Jim Your patch works fine. It passes inet_pton problem. Please apply it. By the way, virsh compilation error. Is threre any good suggestion? = virsh-virsh.o: In function `editWriteToTempFile': C:/msys/1.0/home/Administrator/work/libvirt/src/virsh.c:5080: undefined reference to `mkstemp' virsh-virsh.o: In function `editFile': C:/msys/1.0/home/Administrator/work/libvirt/src/virsh.c:5155: undefined reference to `WEXITSTATUS' = Thanks Atsushi SAKAI Jim Meyering [EMAIL PROTECTED] wrote: Atsushi SAKAI [EMAIL PROTECTED] wrote: Hi, Jim Thsnk you for your reply. src/network_conf.c defines #include arpa/inet.h. The error message says the link does not exist. So I think it should add inet_pton.c to Makefile ... I try to compile libvirt on MinGW after some modification. The error message says follows. C:/msys/1.0/home/sakaia/work/libvirt/src/network_conf.c:290: undefined reference to `inet_pton' C:/msys/1.0/home/sakaia/work/libvirt/src/network_conf.c:296: undefined reference to `inet_pton' Ahh.. those are _link_ errors. That's due to a missing file: gnulib/m4/inet_pton.m4, and one that I didn't update: gnulib/m4/gnulib-comp.m4 My smoke test configure/build worked fine because I ran it on a Linux system, which doesn't need inet_pton. Please try this patch: (this gnulib-comp.m4 changes also reflects some unrelated changes in gnulib -- FYI, I'm preparing another gnulib-related patch that updates several files with bug- and portability- fixes) From 335ac36a1e22da0922eb4abb7501c79bf418b8b0 Mon Sep 17 00:00:00 2001 From: Jim Meyering [EMAIL PROTECTED] Date: Thu, 7 Aug 2008 09:56:38 +0200 Subject: [PATCH] complete the MinGW inet_pton portability fix * gnulib/m4/inet_pton.m4: New file. Required for MinGW. * gnulib/m4/gnulib-comp.m4: Update. --- gnulib/m4/gnulib-comp.m4 | 62 + gnulib/m4/inet_pton.m4 | 27 2 files changed, 67 insertions(+), 22 deletions(-) create mode 100644 gnulib/m4/inet_pton.m4 diff --git a/gnulib/m4/gnulib-comp.m4 b/gnulib/m4/gnulib-comp.m4 index 6341bc2..239eb7a 100644 --- a/gnulib/m4/gnulib-comp.m4 +++ b/gnulib/m4/gnulib-comp.m4 @@ -39,6 +39,8 @@ AC_DEFUN([gl_INIT], m4_pushdef([AC_LIBOBJ], m4_defn([gl_LIBOBJ])) m4_pushdef([AC_REPLACE_FUNCS], m4_defn([gl_REPLACE_FUNCS])) m4_pushdef([AC_LIBSOURCES], m4_defn([gl_LIBSOURCES])) + m4_pushdef([gl_LIBSOURCES_LIST], []) + m4_pushdef([gl_LIBSOURCES_DIR], []) gl_COMMON gl_source_base='gnulib/lib' gl_EOVERFLOW @@ -60,6 +62,8 @@ AC_DEFUN([gl_INIT], AC_SUBST([LTLIBINTL]) gl_INET_NTOP gl_ARPA_INET_MODULE_INDICATOR([inet_ntop]) + gl_INET_PTON + gl_ARPA_INET_MODULE_INDICATOR([inet_pton]) gl_FUNC_LSEEK gl_UNISTD_MODULE_INDICATOR([lseek]) gl_FUNC_MALLOC_POSIX @@ -107,6 +111,19 @@ AC_DEFUN([gl_INIT], AM_XGETTEXT_OPTION([--flag=vasprintf:2:c-format])]) gl_WCHAR_H gl_XSIZE + m4_ifval(gl_LIBSOURCES_LIST, [ +m4_syscmd([test ! -d ]m4_defn([gl_LIBSOURCES_DIR])[ || + for gl_file in ]gl_LIBSOURCES_LIST[ ; do +if test ! -r ]m4_defn([gl_LIBSOURCES_DIR])[/$gl_file ; then + echo missing file ]m4_defn([gl_LIBSOURCES_DIR])[/$gl_file 2 + exit 1 +fi + done])dnl + m4_if(m4_sysval, [0], [], +[AC_FATAL([expected source file, required through AC_LIBSOURCES, not found])]) + ]) + m4_popdef([gl_LIBSOURCES_DIR]) + m4_popdef([gl_LIBSOURCES_LIST]) m4_popdef([AC_LIBSOURCES]) m4_popdef([AC_REPLACE_FUNCS]) m4_popdef([AC_LIBOBJ]) @@ -129,6 +146,8 @@ AC_DEFUN([gl_INIT], m4_pushdef([AC_LIBOBJ], m4_defn([gltests_LIBOBJ])) m4_pushdef([AC_REPLACE_FUNCS], m4_defn([gltests_REPLACE_FUNCS])) m4_pushdef([AC_LIBSOURCES], m4_defn([gltests_LIBSOURCES])) + m4_pushdef([gltests_LIBSOURCES_LIST], []) + m4_pushdef([gltests_LIBSOURCES_DIR], []) gl_COMMON gl_source_base='gnulib/tests' gt_TYPE_WCHAR_T @@ -136,6 +155,19 @@ AC_DEFUN([gl_INIT], AC_CHECK_FUNCS([shutdown]) abs_aux_dir=`cd $ac_aux_dir; pwd` AC_SUBST([abs_aux_dir]) + m4_ifval(gltests_LIBSOURCES_LIST, [ +m4_syscmd([test ! -d ]m4_defn([gltests_LIBSOURCES_DIR])[ || + for gl_file in ]gltests_LIBSOURCES_LIST[ ; do +if test ! -r ]m4_defn([gltests_LIBSOURCES_DIR])[/$gl_file ; then + echo missing file ]m4_defn([gltests_LIBSOURCES_DIR])[/$gl_file 2 + exit 1 +fi + done])dnl + m4_if(m4_sysval, [0], [], +[AC_FATAL([expected source file, required through AC_LIBSOURCES, not found])]) + ]) + m4_popdef([gltests_LIBSOURCES_DIR]) + m4_popdef([gltests_LIBSOURCES_LIST]) m4_popdef([AC_LIBSOURCES]) m4_popdef([AC_REPLACE_FUNCS]) m4_popdef([AC_LIBOBJ]) @@ -164,13 +196,6 @@ AC_DEFUN([gl_LIBOBJ], [ gl_LIBOBJS=$gl_LIBOBJS $1.$ac_objext ]) -# m4_foreach_w is provided by autoconf-2.59c and later. -# This
Re: [libvirt] [PATCH] fix MinGW compilation(200808)
On Thu, Aug 07, 2008 at 05:56:48PM +0900, Atsushi SAKAI wrote: Hi, Jim Your patch works fine. It passes inet_pton problem. Please apply it. By the way, virsh compilation error. Is threre any good suggestion? = virsh-virsh.o: In function `editWriteToTempFile': C:/msys/1.0/home/Administrator/work/libvirt/src/virsh.c:5080: undefined reference to `mkstemp' Look like there is a gnulib module for that - Jim could say if its license compatible virsh-virsh.o: In function `editFile': C:/msys/1.0/home/Administrator/work/libvirt/src/virsh.c:5155: undefined reference to `WEXITSTATUS' virsh.c seems to be missing '#include sys/wait.h' Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :| -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH] fix MinGW compilation(200808)
Atsushi SAKAI [EMAIL PROTECTED] wrote: Your patch works fine. It passes inet_pton problem. Please apply it. By the way, virsh compilation error. Is threre any good suggestion? = virsh-virsh.o: In function `editWriteToTempFile': C:/msys/1.0/home/Administrator/work/libvirt/src/virsh.c:5080: undefined reference to `mkstemp' virsh-virsh.o: In function `editFile': C:/msys/1.0/home/Administrator/work/libvirt/src/virsh.c:5155: undefined reference to `WEXITSTATUS' = There's a gnulib module for that (of course ;-). I'll have to relax licenses of mkstemp and the dependent module, tempname. Should be no problem. -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH] fix MinGW compilation(200808)
Hi, Dan mkstemp is solved by Jim. But WEXITSTATUS problem is not solved yet. Since sys/wait.h does not exist on MinGW. http://www.mingw.org/MinGWiki/index.php/PortingChildren Thanks Atsushi SAKAI Daniel P. Berrange [EMAIL PROTECTED] wrote: On Thu, Aug 07, 2008 at 05:56:48PM +0900, Atsushi SAKAI wrote: Hi, Jim Your patch works fine. It passes inet_pton problem. Please apply it. By the way, virsh compilation error. Is threre any good suggestion? = virsh-virsh.o: In function `editWriteToTempFile': C:/msys/1.0/home/Administrator/work/libvirt/src/virsh.c:5080: undefined reference to `mkstemp' Look like there is a gnulib module for that - Jim could say if its license compatible virsh-virsh.o: In function `editFile': C:/msys/1.0/home/Administrator/work/libvirt/src/virsh.c:5155: undefined reference to `WEXITSTATUS' virsh.c seems to be missing '#include sys/wait.h' Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :| -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH] fix MinGW compilation(200808)
Daniel P. Berrange [EMAIL PROTECTED] wrote: On Tue, Aug 05, 2008 at 01:52:58PM +0200, Jim Meyering wrote: Atsushi SAKAI [EMAIL PROTECTED] wrote: ... network_conf.c:290: warning: implicit declaration of function `inet_aton' network_conf.c:290: warning: nested extern declaration of `inet_aton' We can/should use inet_pton instead. Then, not only do we use what seems to be the preferred interface, but there is a gnulib module by the same name that can come into play if it too is missing. Even better would be to use getaddrinfo() with AI_NUMERIC, since we already require getaddrinfo() to work on Windows for the remote driver Dan, If you don't object, I'll go for the simpler interface (and smaller change). However I've just noticed that that will require an adjustment of the gnulib license for the inet_pton module. But that shouldn't be a problem, since the code in question is glibc-derived. Here's the required patch, excluding the bit that will add the new file(s) from gnulib, once the license has been adjusted. diff --git a/bootstrap b/bootstrap index bc1c352..70b9a05 100755 --- a/bootstrap +++ b/bootstrap @@ -69,6 +69,7 @@ c-ctype getaddrinfo getpass gettext +inet_pton mktempd physmem poll diff --git a/src/network_conf.c b/src/network_conf.c index 10c9dca..8c8a366 100644 --- a/src/network_conf.c +++ b/src/network_conf.c @@ -286,13 +286,13 @@ virNetworkDefParseXML(virConnectPtr conn, char *netaddr; xmlNodePtr dhcp; -if (!inet_aton(def-ipAddress, inaddress)) { +if (inet_pton(AF_INET, def-ipAddress, inaddress) = 0) { virNetworkReportError(conn, VIR_ERR_INTERNAL_ERROR, _(cannot parse IP address '%s'), def-ipAddress); goto error; } -if (!inet_aton(def-netmask, innetmask)) { +if (!inet_pton(AF_INET, def-netmask, innetmask) = 0) { virNetworkReportError(conn, VIR_ERR_INTERNAL_ERROR, _(cannot parse netmask '%s'), def-netmask); -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH] fix MinGW compilation(200808)
Jim Meyering [EMAIL PROTECTED] wrote: Daniel P. Berrange [EMAIL PROTECTED] wrote: On Tue, Aug 05, 2008 at 01:52:58PM +0200, Jim Meyering wrote: Atsushi SAKAI [EMAIL PROTECTED] wrote: ... network_conf.c:290: warning: implicit declaration of function `inet_aton' network_conf.c:290: warning: nested extern declaration of `inet_aton' We can/should use inet_pton instead. Then, not only do we use what seems to be the preferred interface, but there is a gnulib module by the same name that can come into play if it too is missing. Even better would be to use getaddrinfo() with AI_NUMERIC, since we already require getaddrinfo() to work on Windows for the remote driver Dan, If you don't object, I'll go for the simpler interface (and smaller change). However I've just noticed that that will require an adjustment of the gnulib license for the inet_pton module. But that shouldn't be a problem, since the code in question is glibc-derived. Here's the required patch, excluding the bit that will add the new file(s) from gnulib, once the license has been adjusted. ... -if (!inet_aton(def-netmask, innetmask)) { +if (!inet_pton(AF_INET, def-netmask, innetmask) = 0) { Whoops. I forgot to remove one of the !. Here's the correct patch: diff --git a/bootstrap b/bootstrap index bc1c352..70b9a05 100755 --- a/bootstrap +++ b/bootstrap @@ -69,6 +69,7 @@ c-ctype getaddrinfo getpass gettext +inet_pton mktempd physmem poll diff --git a/src/network_conf.c b/src/network_conf.c index 10c9dca..f70c73d 100644 --- a/src/network_conf.c +++ b/src/network_conf.c @@ -286,13 +286,13 @@ virNetworkDefParseXML(virConnectPtr conn, char *netaddr; xmlNodePtr dhcp; -if (!inet_aton(def-ipAddress, inaddress)) { +if (inet_pton(AF_INET, def-ipAddress, inaddress) = 0) { virNetworkReportError(conn, VIR_ERR_INTERNAL_ERROR, _(cannot parse IP address '%s'), def-ipAddress); goto error; } -if (!inet_aton(def-netmask, innetmask)) { +if (inet_pton(AF_INET, def-netmask, innetmask) = 0) { virNetworkReportError(conn, VIR_ERR_INTERNAL_ERROR, _(cannot parse netmask '%s'), def-netmask); -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH] fix MinGW compilation(200808)
On Wed, Aug 06, 2008 at 09:10:04AM +0200, Jim Meyering wrote: Daniel P. Berrange [EMAIL PROTECTED] wrote: On Tue, Aug 05, 2008 at 01:52:58PM +0200, Jim Meyering wrote: Atsushi SAKAI [EMAIL PROTECTED] wrote: ... network_conf.c:290: warning: implicit declaration of function `inet_aton' network_conf.c:290: warning: nested extern declaration of `inet_aton' We can/should use inet_pton instead. Then, not only do we use what seems to be the preferred interface, but there is a gnulib module by the same name that can come into play if it too is missing. Even better would be to use getaddrinfo() with AI_NUMERIC, since we already require getaddrinfo() to work on Windows for the remote driver Dan, If you don't object, I'll go for the simpler interface (and smaller change). However I've just noticed that that will require an adjustment of the gnulib license for the inet_pton module. But that shouldn't be a problem, since the code in question is glibc-derived. Yep, fine by me. Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :| -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH] fix MinGW compilation(200808)
Daniel P. Berrange [EMAIL PROTECTED] wrote: On Wed, Aug 06, 2008 at 09:10:04AM +0200, Jim Meyering wrote: Daniel P. Berrange [EMAIL PROTECTED] wrote: On Tue, Aug 05, 2008 at 01:52:58PM +0200, Jim Meyering wrote: Atsushi SAKAI [EMAIL PROTECTED] wrote: ... network_conf.c:290: warning: implicit declaration of function `inet_aton' network_conf.c:290: warning: nested extern declaration of `inet_aton' We can/should use inet_pton instead. Then, not only do we use what seems to be the preferred interface, but there is a gnulib module by the same name that can come into play if it too is missing. Even better would be to use getaddrinfo() with AI_NUMERIC, since we already require getaddrinfo() to work on Windows for the remote driver Dan, If you don't object, I'll go for the simpler interface (and smaller change). However I've just noticed that that will require an adjustment of the gnulib license for the inet_pton module. But that shouldn't be a problem, since the code in question is glibc-derived. Yep, fine by me. Ok. Here's the complete patch, including the new file from gnulib. I've verified that a freshly-cloned directory passes ./autogen make make check Ha! But it failed make syntax-check due to the use of ctype's tolower in inet_pton.c. I'm fixing that in gnulib now, since it can/should be c_tolower. Here's the fix prior to the s/tolower/c_tolower/ inet_pton.c change (it also does s/ctype/c-ctype/). I'll wait until gnulib is fixed before committing here. From 45a33378a90fac3058360ba92ff0afca3e03df73 Mon Sep 17 00:00:00 2001 From: Jim Meyering [EMAIL PROTECTED] Date: Wed, 6 Aug 2008 11:36:14 +0200 Subject: [PATCH] work around MinGW build failure due to its lack of inet_aton Use inet_pton instead; pull in gnulib's module by the same name. * src/network_conf.c (virNetworkDefParseXML): Use inet_pton, rather than inet_aton. * bootstrap (modules): Add inet_pton. * gnulib/lib/inet_pton.c: New file, from gnulib. --- ChangeLog |9 ++ bootstrap |1 + gnulib/lib/inet_pton.c | 257 src/network_conf.c |4 +- 4 files changed, 269 insertions(+), 2 deletions(-) create mode 100644 gnulib/lib/inet_pton.c diff --git a/ChangeLog b/ChangeLog index 133bde6..d066751 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2008-08-06 Jim Meyering [EMAIL PROTECTED] + + work around MinGW build failure due to its lack of inet_aton + Use inet_pton instead; pull in gnulib's module by the same name. + * src/network_conf.c (virNetworkDefParseXML): Use inet_pton, + rather than inet_aton. + * bootstrap (modules): Add inet_pton. + * gnulib/lib/inet_pton.c: New file, from gnulib. + Tue Aug 5 10:43:42 CEST 2008 Jim Meyering [EMAIL PROTECTED] make distclean: remove generated source files diff --git a/bootstrap b/bootstrap index bc1c352..70b9a05 100755 --- a/bootstrap +++ b/bootstrap @@ -69,6 +69,7 @@ c-ctype getaddrinfo getpass gettext +inet_pton mktempd physmem poll diff --git a/gnulib/lib/inet_pton.c b/gnulib/lib/inet_pton.c new file mode 100644 index 000..3e92631 --- /dev/null +++ b/gnulib/lib/inet_pton.c @@ -0,0 +1,257 @@ +/* inet_pton.c -- convert IPv4 and IPv6 addresses from text to binary form + + Copyright (C) 2006, 2008 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as published by + the Free Software Foundation; either version 2.1 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with this program. If not, see http://www.gnu.org/licenses/. */ + +/* + * Copyright (c) 1996,1999 by Internet Software Consortium. + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED AS IS AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS + * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE + * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL + * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR + * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS + * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS + * SOFTWARE. + */ + +#include config.h + +/* Specification. */ +#include arpa/inet.h +
Re: [libvirt] [PATCH] fix MinGW compilation(200808)
On Wed, Aug 06, 2008 at 11:52:20AM +0200, Jim Meyering wrote: Daniel P. Berrange [EMAIL PROTECTED] wrote: If you don't object, I'll go for the simpler interface (and smaller change). However I've just noticed that that will require an adjustment of the gnulib license for the inet_pton module. But that shouldn't be a problem, since the code in question is glibc-derived. Yep, fine by me. Ok. Here's the complete patch, including the new file from gnulib. I've verified that a freshly-cloned directory passes ./autogen make make check Ha! But it failed make syntax-check due to the use of ctype's tolower in inet_pton.c. I'm fixing that in gnulib now, since it can/should be c_tolower. Here's the fix prior to the s/tolower/c_tolower/ inet_pton.c change (it also does s/ctype/c-ctype/). I'll wait until gnulib is fixed before committing here. +1 fine by me Daniel -- Red Hat Virtualization group http://redhat.com/virtualization/ Daniel Veillard | virtualization library http://libvirt.org/ [EMAIL PROTECTED] | libxml GNOME XML XSLT toolkit http://xmlsoft.org/ http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/ -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH] fix MinGW compilation(200808)
Hi, Jim I have a question about inet_pton(). I try to compile libvirt on MinGW after some modification. The error message says follows. C:/msys/1.0/home/sakaia/work/libvirt/src/network_conf.c:290: undefined reference to `inet_pton' C:/msys/1.0/home/sakaia/work/libvirt/src/network_conf.c:296: undefined reference to `inet_pton' I think it should edit gnulib/lib/Makefile.am. Is this my guess correct. Thanks Atsushi SAKAI Jim Meyering [EMAIL PROTECTED] wrote: Atsushi SAKAI [EMAIL PROTECTED] wrote: ... network_conf.c:290: warning: implicit declaration of function `inet_aton' network_conf.c:290: warning: nested extern declaration of `inet_aton' We can/should use inet_pton instead. Then, not only do we use what seems to be the preferred interface, but there is a gnulib module by the same name that can come into play if it too is missing. network_conf.c:598: error: `S_IRUSR' undeclared (first use in this function) The remaining problems should be easy to resolve: Add this line to network_conf.c: #include sys/stat.h network_conf.c:598: error: (Each undeclared identifier is reported only once network_conf.c:598: error: for each function it appears in.) network_conf.c:598: error: `S_IWUSR' undeclared (first use in this function) -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
[libvirt] [PATCH] fix MinGW compilation(200808)
Hi, Currently, compilation for MinGW is broken. Here is the patch. But configure script option for MinGW is changed from previous posting. https://www.redhat.com/archives/libvir-list/2008-June/msg00145.html Currently, it should do # ./configure --without-xen --without-qemu --without-sasl --without-lxc --without-openvz --without-libvirtd --without-test currently following 3 make works, make make install make check I do not know why syntax-check is not exist on Makefile on MinGW. src/domain_conf.c|2 ++ src/network_conf.c |2 ++ src/virsh.c |8 tests/testutilsxen.c |2 ++ 4 files changed, 14 insertions(+) Thanks Atsushi SAKAI fix_compilation_for_mingw.patch Description: Binary data -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH] fix MinGW compilation(200808)
On Tue, Aug 05, 2008 at 04:24:08PM +0900, Atsushi SAKAI wrote: Hi, Currently, compilation for MinGW is broken. Here is the patch. But configure script option for MinGW is changed from previous posting. https://www.redhat.com/archives/libvir-list/2008-June/msg00145.html Currently, it should do # ./configure --without-xen --without-qemu --without-sasl --without-lxc --without-openvz --without-libvirtd --without-test yes I made compilation with lxc and openvz default now, so changing this is normal. currently following 3 make works, make make install make check I do not know why syntax-check is not exist on Makefile on MinGW. I would expect most development to still be done on Linux/Unix, so that's not a big deal IMHO src/domain_conf.c|2 ++ src/network_conf.c |2 ++ basically the changes remove compilations from the XML parsing code. On one end I understand why it's not needed (currently) but I wonder why this need to be defined out. Seems to me the code should compile on WIN32 and that's an important point if we ever want to get some native hypervisor support there. So what miscompiled there ? Can we fix it ? in the interim having the code compiled out as the patch does is fine, but I would like to understand. src/virsh.c |8 edit on windows will be nasty, vi or $EDITOR is unixy tests/testutilsxen.c |2 ++ okay 4 files changed, 14 insertions(+) I think the patch is fine for now, but I would like to understand why the conf files compile need to be supressed. Daniel -- Red Hat Virtualization group http://redhat.com/virtualization/ Daniel Veillard | virtualization library http://libvirt.org/ [EMAIL PROTECTED] | libxml GNOME XML XSLT toolkit http://xmlsoft.org/ http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/ -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH] fix MinGW compilation(200808)
On Tue, Aug 05, 2008 at 04:03:41AM -0400, Daniel Veillard wrote: On Tue, Aug 05, 2008 at 04:24:08PM +0900, Atsushi SAKAI wrote: Hi, Currently, compilation for MinGW is broken. Here is the patch. But configure script option for MinGW is changed from previous posting. https://www.redhat.com/archives/libvir-list/2008-June/msg00145.html Currently, it should do # ./configure --without-xen --without-qemu --without-sasl --without-lxc --without-openvz --without-libvirtd --without-test yes I made compilation with lxc and openvz default now, so changing this is normal. currently following 3 make works, make make install make check I do not know why syntax-check is not exist on Makefile on MinGW. I would expect most development to still be done on Linux/Unix, so that's not a big deal IMHO src/domain_conf.c|2 ++ src/network_conf.c |2 ++ basically the changes remove compilations from the XML parsing code. On one end I understand why it's not needed (currently) but I wonder why this need to be defined out. Seems to me the code should compile on WIN32 and that's an important point if we ever want to get some native hypervisor support there. So what miscompiled there ? Can we fix it ? in the interim having the code compiled out as the patch does is fine, but I would like to understand. Yes, this is completely wrong. The test driver and all the generic network, and domain XML code should all work on Windows. The only stuff we should be disabling is hypervisor drivers, and Linux specific bits of code. Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :| -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH] fix MinGW compilation(200808)
On Tue, Aug 05, 2008 at 04:24:08PM +0900, Atsushi SAKAI wrote: src/virsh.c |8 Is it possible to get edit working on Windows? My MinGW system has a program which looks like 'vi' ... Rich. -- Richard Jones, Emerging Technologies, Red Hat http://et.redhat.com/~rjones virt-top is 'top' for virtual machines. Tiny program with many powerful monitoring features, net stats, disk stats, logging, etc. http://et.redhat.com/~rjones/virt-top -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH] fix MinGW compilation(200808)
Hi, Dan and Daniel Thank you for commenting this. I am digging into the problem domain_conf.c, network_conf.c and test driver. Just for network_conf.c outputs following message. gcc -DHAVE_CONFIG_H -I. -I.. -I../gnulib/lib -I../gnulib/lib -I../include -I../include -I../qemud -Ic:/MinGW/lib/GTK/include/libxml2 -DBINDIR=\/usr/local/libexec\ -DSBINDIR=\/usr/local/sbin\ -DSYSCONF_DIR=\/usr/local/etc\ -DLOCALEBASEDIR=\/usr/local/share/locale\ -DLOCAL_STATE_DIR=\/usr/local/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 -DWITH_REMOTE -DIN_LIBVIRT -g -O2 -MT libvirt_la-network_conf.lo -MD -MP -MF .deps/libvirt_la-network_conf.Tpo -c network_conf.c -DDLL_EXPORT -DPIC -o .libs/libvirt_la-network_conf.o In file included from ../gnulib/lib/arpa/inet.h:24, from network_conf.c:29: ../gnulib/lib/sys/socket.h:109: warning: declaration of 'socket' shadows a global declaration c:/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/winsock2.h:553: warning: shadowed declaration is here network_conf.c: In function `virNetworkDefParseXML': network_conf.c:290: warning: implicit declaration of function `inet_aton' network_conf.c:290: warning: nested extern declaration of `inet_aton' network_conf.c: In function `virNetworkSaveConfig': network_conf.c:598: error: `S_IRUSR' undeclared (first use in this function) network_conf.c:598: error: (Each undeclared identifier is reported only once network_conf.c:598: error: for each function it appears in.) network_conf.c:598: error: `S_IWUSR' undeclared (first use in this function) make[3]: *** [libvirt_la-network_conf.lo] Error 1 make[3]: Leaving directory `/home/Administrator/work/libvirt-0.4.4/src' make[2]: *** [all] Error 2 make[2]: Leaving directory `/home/Administrator/work/libvirt-0.4.4/src' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/home/Administrator/work/libvirt-0.4.4' make: *** [all] Error 2 = Thanks Atsushi SAKAI Daniel P. Berrange [EMAIL PROTECTED] wrote: On Tue, Aug 05, 2008 at 04:03:41AM -0400, Daniel Veillard wrote: On Tue, Aug 05, 2008 at 04:24:08PM +0900, Atsushi SAKAI wrote: Hi, Currently, compilation for MinGW is broken. Here is the patch. But configure script option for MinGW is changed from previous posting. https://www.redhat.com/archives/libvir-list/2008-June/msg00145.html Currently, it should do # ./configure --without-xen --without-qemu --without-sasl --without-lxc --without-openvz --without-libvirtd --without-test yes I made compilation with lxc and openvz default now, so changing this is normal. currently following 3 make works, make make install make check I do not know why syntax-check is not exist on Makefile on MinGW. I would expect most development to still be done on Linux/Unix, so that's not a big deal IMHO src/domain_conf.c|2 ++ src/network_conf.c |2 ++ basically the changes remove compilations from the XML parsing code. On one end I understand why it's not needed (currently) but I wonder why this need to be defined out. Seems to me the code should compile on WIN32 and that's an important point if we ever want to get some native hypervisor support there. So what miscompiled there ? Can we fix it ? in the interim having the code compiled out as the patch does is fine, but I would like to understand. Yes, this is completely wrong. The test driver and all the generic network, and domain XML code should all work on Windows. The only stuff we should be disabling is hypervisor drivers, and Linux specific bits of code. Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :| -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH] fix MinGW compilation(200808)
Atsushi SAKAI [EMAIL PROTECTED] wrote: ... network_conf.c:290: warning: implicit declaration of function `inet_aton' network_conf.c:290: warning: nested extern declaration of `inet_aton' We can/should use inet_pton instead. Then, not only do we use what seems to be the preferred interface, but there is a gnulib module by the same name that can come into play if it too is missing. network_conf.c:598: error: `S_IRUSR' undeclared (first use in this function) The remaining problems should be easy to resolve: Add this line to network_conf.c: #include sys/stat.h network_conf.c:598: error: (Each undeclared identifier is reported only once network_conf.c:598: error: for each function it appears in.) network_conf.c:598: error: `S_IWUSR' undeclared (first use in this function) -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH] fix MinGW compilation(200808)
On Tue, Aug 05, 2008 at 01:52:58PM +0200, Jim Meyering wrote: Atsushi SAKAI [EMAIL PROTECTED] wrote: ... network_conf.c:290: warning: implicit declaration of function `inet_aton' network_conf.c:290: warning: nested extern declaration of `inet_aton' We can/should use inet_pton instead. Then, not only do we use what seems to be the preferred interface, but there is a gnulib module by the same name that can come into play if it too is missing. Even better would be to use getaddrinfo() with AI_NUMERIC, since we already require getaddrinfo() to work on Windows for the remote driver Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :| -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH] fix MinGW compilation(200808)
Hi, Rich I think possible. But It needs time I will consider it. Thanks Atsushi SAKAI Richard W.M. Jones [EMAIL PROTECTED] wrote: On Tue, Aug 05, 2008 at 04:24:08PM +0900, Atsushi SAKAI wrote: src/virsh.c |8 Is it possible to get edit working on Windows? My MinGW system has a program which looks like 'vi' ... Rich. -- Richard Jones, Emerging Technologies, Red Hat http://et.redhat.com/~rjones virt-top is 'top' for virtual machines. Tiny program with many powerful monitoring features, net stats, disk stats, logging, etc. http://et.redhat.com/~rjones/virt-top -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH] fix MinGW compilation(200808)
Hi, Jim Thank you for commenting this. I am wondered how to replace inet_aton. Your suggestion is very helpful. Thanks Atsushi SAKAI Jim Meyering [EMAIL PROTECTED] wrote: Atsushi SAKAI [EMAIL PROTECTED] wrote: ... network_conf.c:290: warning: implicit declaration of function `inet_aton' network_conf.c:290: warning: nested extern declaration of `inet_aton' We can/should use inet_pton instead. Then, not only do we use what seems to be the preferred interface, but there is a gnulib module by the same name that can come into play if it too is missing. network_conf.c:598: error: `S_IRUSR' undeclared (first use in this function) The remaining problems should be easy to resolve: Add this line to network_conf.c: #include sys/stat.h network_conf.c:598: error: (Each undeclared identifier is reported only once network_conf.c:598: error: for each function it appears in.) network_conf.c:598: error: `S_IWUSR' undeclared (first use in this function) -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list