Blob Blame History Raw
From c787dc6c31879f8f05ffe3b83fde7d03601904fb Mon Sep 17 00:00:00 2001
From: Oliver Freyermuth <o.freyermuth@googlemail.com>
Date: Mon, 1 Jan 2018 23:16:00 +0100
Subject: [PATCH] wsdl2h.m4: Fix detection of modern wsdl2h versions.

Modern executables do not show version in help output,
but have a -V parameter instead.
Also, explicitly match the release version in older
wsdl2h version instead of other version numbers
mentioned in help text.

Signed-off-by: Oliver Freyermuth <o.freyermuth@googlemail.com>
---
 m4/wsdl2h.m4 | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/m4/wsdl2h.m4 b/m4/wsdl2h.m4
index 4db40ce..ab1cda8 100644
--- a/m4/wsdl2h.m4
+++ b/m4/wsdl2h.m4
@@ -43,8 +43,13 @@ AC_DEFUN([AC_WSDL2H],
 	dnl 
 	dnl @<:@  becomes [
 	dnl @:>@  becomes ]
-	wsdl2h_version=$($WSDL2H -help 2>&1 | grep -o '@<:@0-9@:>@\.@<:@0-9@:>@\.@<:@0-9@:>@*$')
-	
+	dnl
+	dnl Newer versions support -V parameter.
+	wsdl2h_version=$($WSDL2H -V 2>/dev/null)
+	if test -z "$wsdl2h_version"; then
+		wsdl2h_version=$($WSDL2H -help 2>&1 | grep release | grep -o '@<:@0-9@:>@\.@<:@0-9@:>@\.@<:@0-9@:>@*$')
+	fi
+
 	normalized_version=$(printf "%02d%02d%02d" $(echo $wsdl2h_version | tr '.' ' '))
 
 	WSDL2H_FLAGS=""