Skip to content

Commit c297dd3

Browse files
committed
Handle incomplete versions in AX_SPLIT_VERSION
This ought to fix the error with clang that was triggered by libMesh/TIMPI#53
1 parent ff1e9d9 commit c297dd3

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

ax_split_version.m4

+5-2
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#
1616
# LICENSE
1717
#
18+
# Copyright (c) 2020 Roy Stogner
1819
# Copyright (c) 2008 Tom Howard <[email protected]>
1920
#
2021
# Copying and distribution of this file, with or without modification, are
@@ -27,8 +28,10 @@
2728
AC_DEFUN([AX_SPLIT_VERSION],[
2829
AC_REQUIRE([AC_PROG_SED])
2930
AX_MAJOR_VERSION=`echo "$VERSION" | $SED 's/\([[^.]][[^.]]*\).*/\1/'`
30-
AX_MINOR_VERSION=`echo "$VERSION" | $SED 's/[[^.]][[^.]]*.\([[^.]][[^.]]*\).*/\1/'`
31-
AX_POINT_VERSION=`echo "$VERSION" | $SED 's/[[^.]][[^.]]*.[[^.]][[^.]]*.\(.*\)/\1/'`
31+
AX_MINOR_VERSION=`echo "$VERSION" | $SED -n 's/[[^.]][[^.]]*.\([[^.]][[^.]]*\).*/\1/p'`
32+
AS_IF([test "x$AX_MINOR_VERSION" = "x"], [AX_MINOR_VERSION=0])
33+
AX_POINT_VERSION=`echo "$VERSION" | $SED -n 's/[[^.]][[^.]]*.[[^.]][[^.]]*.\(.*\)/\1/p'`
34+
AS_IF([test "x$AX_POINT_VERSION" = "x"], [AX_POINT_VERSION=0])
3235
AC_MSG_CHECKING([Major version])
3336
AC_MSG_RESULT([$AX_MAJOR_VERSION])
3437
AC_MSG_CHECKING([Minor version])

0 commit comments

Comments
 (0)