Changeset 561


Ignore:
Timestamp:
Mar 7, 2008, 1:12:13 AM (13 years ago)
Author:
Peter Johansson
Message:

lifting out parsing of version to a separate function. Also adding a test that there is no 'pre' in official release version. refs #315

Location:
trunk
Files:
1 added
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/configure.ac

    r559 r561  
    4343AM_INIT_AUTOMAKE([std-options check-news])
    4444
    45 DEV=`echo $VERSION|sed 's/\([[a-z]]*\).*/\1/'`
    46 if test "$DEV" = "pre"; then
    47   DEV="1"
    48 else
    49   DEV="0"
    50 fi
    51 MY_MAJOR=`echo $VERSION|sed 's/[[a-z]]*\([[0-9]]*\).*/\1/'`
    52 MY_MINOR=`echo $VERSION|sed 's/[[a-z]]*[[0-9]]*\.\([[0-9]]*\).*/\1/'`
    53 if test "$MY_MINOR" = "$VERSION" || test "$MY_MAJOR" = "$VERSION" ; then
    54    AC_MSG_ERROR([version number is incorrect])
    55 fi
    56 
    57 MY_PATCH=`echo $VERSION|sed 's/[[a-z]]*[[0-9]]*\.[[0-9]]*\.\([[0-9]]*\).*/\1/'`
    58 
    59 if test "$MY_PATCH" = "$VERSION"; then
    60    MY_PATCH="0"
    61 fi
    62 
    63 # AM_CONDITIONAL(DEV_BUILD, $DEV )
    64 AC_SUBST([VERSION_MAJOR], [$MY_MAJOR])
    65 AC_SUBST([VERSION_MINOR], [$MY_MINOR])
    66 AC_SUBST([VERSION_PATCH], [$MY_PATCH])
    67 AC_DEFINE_UNQUOTED([DEV_BUILD],[$DEV],
    68                    [true if dev build (version starts with pre)])
    69 AC_DEFINE_UNQUOTED([VERSION_MAJOR], [$MY_MAJOR],
    70                    [Define to the svndigest major version])
    71 AC_DEFINE_UNQUOTED([VERSION_MINOR], [$MY_MINOR],
    72                    [Define to the svndigest minor version])
    73 AC_DEFINE_UNQUOTED([VERSION_PATCH], [$MY_PATCH],
    74                    [Define to the svndigest patch version])
    75 
     45sinclude(./build_support/svndigest.m4)
     46SPLIT_VERSION([VERSION], [$VERSION])
    7647
    7748# seems like these variables are not set with older autoconf(?)
     
    166137AC_CHECK_FILE("lib/subversion_info.h", info_found="yes", info_found="no")
    167138
     139# Checking that a release (non-dev) has no pre in VERSION
     140# Failure should be captured by distcheck
     141if (test "$wc_found" = "no" && test "$DEV_BUILD" = "yes") ; then
     142   AC_MSG_ERROR([Incorrect version number: $VERSION
     143                 Version number of an official release should have format
     144                 MAJOR.MINOR or MAJOR.MINOR.PATCH])
     145fi
     146
    168147# devel version should have svn WC and SVNVERSION installed
    169148AM_CONDITIONAL(HAVE_SVN_WC, test "$wc_found" = "yes" )
Note: See TracChangeset for help on using the changeset viewer.