From b792834a413d666292de47c427a122eb9f9c1d99 Mon Sep 17 00:00:00 2001 From: Pavel Fedin Date: Wed, 8 Jul 2015 14:29:23 +0300 Subject: [PATCH] Add support for portable-rpcgen from portablexdr library This allows to build libvirt under MinGW Signed-off-by: Pavel Fedin --- configure.ac | 2 +- src/rpc/genprotocol.pl | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index cd6c972ac7..6533b88851 100644 --- a/configure.ac +++ b/configure.ac @@ -401,7 +401,7 @@ AM_CONDITIONAL([HAVE_LIBTASN1], [test "x$ac_cv_header_libtasn1_h" = "xyes"]) AC_CHECK_LIB([intl],[gettext],[]) dnl Do we have rpcgen? -AC_PATH_PROG([RPCGEN], [rpcgen], [no]) +AC_PATH_PROGS([RPCGEN], [rpcgen portable-rpcgen], [no]) AM_CONDITIONAL([HAVE_RPCGEN], [test "x$ac_cv_path_RPCGEN" != "xno"]) dnl Is this GLIBC's buggy rpcgen? AM_CONDITIONAL([HAVE_GLIBC_RPCGEN], diff --git a/src/rpc/genprotocol.pl b/src/rpc/genprotocol.pl index 6e6d6d4a93..1ac2507c44 100755 --- a/src/rpc/genprotocol.pl +++ b/src/rpc/genprotocol.pl @@ -38,7 +38,10 @@ my $target = shift; unlink $target; -open RPCGEN, "-|", $rpcgen, $mode, $xdrdef +if ($rpcgen =~ /portable-rpcgen/) { + $rpcgen = "$rpcgen -o -"; +} +open RPCGEN, "-|", "$rpcgen $mode $xdrdef" or die "cannot run $rpcgen $mode $xdrdef: $!"; open TARGET, ">$target" or die "cannot create $target: $!";