[Gnucash-changes] Further improvement for libofx version check
Christian Stimming
cstim at cvs.gnucash.org
Sun Jan 2 07:21:51 EST 2005
Log Message:
-----------
Further improvement for libofx version check
Modified Files:
--------------
gnucash:
configure.in
Revision Data
-------------
Index: configure.in
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/configure.in,v
retrieving revision 1.398
retrieving revision 1.399
diff -Lconfigure.in -Lconfigure.in -u -r1.398 -r1.399
--- configure.in
+++ configure.in
@@ -527,21 +527,35 @@
LIBOFX_CFLAGS="-I${OFXPREFIX}/include"
fi
- # check libofx version
+ ### Check libofx version
+ # Obtain version string
AC_MSG_CHECKING(for libofx version >= 0.7.0)
if test x${OFXPREFIX} = x ; then
- LIBOFX_VERSION=`ofxdump --version | cut -d" " -f2`
+ ofx_version_output=`ofxdump --version`
else
- LIBOFX_VERSION=`${OFXPREFIX}/bin/ofxdump --version | cut -d" " -f2`
+ ofx_version_output=`${OFXPREFIX}/bin/ofxdump --version`
fi
- if test `echo ${LIBOFX_VERSION} | cut -d. -f1` -ge 1 -o \
- `echo ${LIBOFX_VERSION} | cut -d. -f2` -ge 7; then
+ # Extract version number; output format changed from 0.6.x to 0.7.x
+ LIBOFX_VERSION=`echo ${ofx_version_output} | sed 's/\([[^0-9]]*\)\([[0-9]]*\.\)/\2/' `
+ LIBOFX_VERSION_MAJOR=`echo ${LIBOFX_VERSION} | cut -d. -f1`
+ LIBOFX_VERSION_MINOR=`echo ${LIBOFX_VERSION} | cut -d. -f2`
+ # Make sure the numbers are not empty
+ if test x${LIBOFX_VERSION_MAJOR} = x ; then
+ LIBOFX_VERSION_MAJOR=0
+ fi
+ if test x${LIBOFX_VERSION_MINOR} = x ; then
+ LIBOFX_VERSION_MINOR=0
+ fi
+ # Now check for >= 0.7.x or >= 1.x.x
+ if test "${LIBOFX_VERSION_MAJOR}" -ge 1 -o \
+ "${LIBOFX_VERSION_MINOR}" -ge 7; then
# This is libofx >= 0.7.x
AC_MSG_RESULT([found ${LIBOFX_VERSION}])
else
- AC_MSG_ERROR([Libofx 0.7.0 or newer needed for ofx support])
+ AC_MSG_ERROR([found ${LIBOFX_VERSION}; Libofx 0.7.0 or newer needed for ofx support])
fi
+ # Version number verified. Now check header files.
AC_MSG_CHECKING(for libofx/libofx.h)
AS_SCRUB_INCLUDE(LIBOFX_CFLAGS)
save_CPPFLAGS="${CPPFLAGS}"
More information about the gnucash-changes
mailing list