Changeset 2526


Ignore:
Timestamp:
Jul 28, 2007, 4:10:09 AM (14 years ago)
Author:
charles
Message:

get both build systems (hand-written configure, and autoconf) to generate equivalent version.h headers

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/configure.ac

    r2434 r2526  
    1 AC_INIT([Transmission],[0.72Z],[http://bugzilla.gnome.org/enter_bug.cgi?product=Pan])
     1AC_INIT([Transmission],[0.72Z],[http://transmission.m0k.org/trac/newticket])
     2PEERID_PREFIX="-TR072Z-"
     3USERAGENT_PREFIX="0.72+"
     4
    25AC_PREREQ(2.54)
    3 AM_CONFIG_HEADER(config.h)
     6dnl AM_CONFIG_HEADER(config.h)
    47AC_CONFIG_SRCDIR(libtransmission/transmission.h)
    58AM_INIT_AUTOMAKE(AC_PACKAGE_NAME,AC_PACKAGE_VERSION)
     
    184187dnl constraint: strlen(MAJOR MINOR MAINT BETA) must be 4
    185188dnl convention: BETA: "Z" for a beta, "0" for a stable
    186 MAJOR="0"
    187 MINOR="7"
    188 MAINT="2"
    189 BETA="Z"
    190 STRING=0.80-svn
    191 REV=`svnversion -n`
    192 AC_SUBST(VERSION_MAJOR,[$MAJOR])
    193 AC_SUBST(VERSION_MINOR,[$MINOR])
    194 AC_SUBST(VERSION_MAINTENANCE,[$MAINT])
    195 AC_SUBST(VERSION_REVISION,[$REV])
    196 AC_SUBST(VERSION_BETA,[$BETA])
    197 AC_SUBST(VERSION_STRING,[$MAJOR.$MINOR$MAINT$BETA])
    198 AC_SUBST(VERSION_STRING_LONG,[$MAJOR.$MINOR$MAINT$BETA-r$REV])
    199 
    200 dnl for macosx
    201 AC_SUBST(BUNDLE_VERSION,[$REV])
    202 dnl if it's a beta version, include the svn revision number
    203 if test x${BETA} = "xZ"; then
    204   AC_SUBST(VERSION_PACKAGE,$MAJOR.$MINOR$MAINT$BETA-r$REV)
    205 else
    206   AC_SUBST(VERSION_PACKAGE,$MAJOR.$MINOR$MAINT$BETA)
    207 fi
    208 AC_SUBST(VERSION_PACKAGE)
     189SVN_REVISION=`svn info . | sed -ne "s/^Revision: \(.*\:\)\{0,1\}\(.*\)$/\2/p"`
     190AC_SUBST(PEERID_PREFIX,[$PEERID_PREFIX])
     191AC_SUBST(USERAGENT_PREFIX,[$USERAGENT_PREFIX])
     192AC_SUBST(SVN_REVISION,[$SVN_REVISION])
     193AC_SUBST(BUNDLE_VERSION,[$SVN_REVISION])
     194AC_SUBST(VERSION_PACKAGE,$USERAGENT_PREFIX-r$SVN_REVISION)
    209195
    210196
  • trunk/libtransmission/transmission.c

    r2455 r2526  
    4343    int i;
    4444    assert( buflen == TR_ID_LEN + 1 );
    45     snprintf( buf, TR_ID_LEN, "-TR" VERSION_MAJOR VERSION_MINOR VERSION_MAINTENANCE VERSION_BETA "-" );
     45
     46    snprintf( buf, TR_ID_LEN, "%s", PEERID_PREFIX );
    4647    assert( strlen(buf) == 8 );
    4748    for( i=8; i<TR_ID_LEN; ++i ) {
  • trunk/libtransmission/version.h.in

    r2518 r2526  
    1 #define VERSION_MAJOR         "@VERSION_MAJOR@"
    2 #define VERSION_MINOR         "@VERSION_MINOR@"
    3 #define VERSION_MAINTENANCE   "@VERSION_MAINTENANCE@"
    4 #define VERSION_REVISION      "@VERSION_REVISION@"
    5 #define VERSION_BETA          "@VERSION_BETA@"
    6 #define SHORT_VERSION_STRING  "@VERSION_STRING@"
    7 #define LONG_VERSION_STRING   "@VERSION_STRING_LONG@"
     1#define PEERID_PREFIX         "@PEERID_PREFIX@"
     2#define USERAGENT_PREFIX      "@USERAGENT_PREFIX@"
     3#define SVN_REVISION          "@SVN_REVISION@"
     4#define SHORT_VERSION_STRING  "@USERAGENT_PREFIX@"
     5#define LONG_VERSION_STRING   "@USERAGENT_PREFIX@ r(@SVN_REVISION@)"
  • trunk/version.sh

    r2517 r2526  
    1111STRING=0.72+
    1212
    13 # Get current SVN revision from Ids in all source files
    14 REV=`( find . '(' -name '*.[chm]' -o -name '*.cpp' -o -name '*.po' \
    15             -o -name '*.mk' -o -name '*.in' -o -name 'Makefile' \
    16             -o -name 'configure' ')' -exec cat '{}' ';' ) | \
    17           sed -e '/\$Id:/!d' -e \
    18             's/.*\$Id: [^ ]* \([0-9]*\) .*/\1/' |
    19           awk 'BEGIN { REV=0 }
    20                      { if ( $1 > REV ) REV=$1 }
    21                END   { print REV }'`
     13PEERID_PREFIX="-TR072Z-"
     14USERAGENT_PREFIX="0.72+"
     15SVN_REVISION=`svn info . | sed -ne "s/^Revision: \(.*\:\)\{0,1\}\(.*\)$/\2/p"`
    2216 
    2317# Generate files to be included: only overwrite them if changed so make
     
    4438# Generate version.h
    4539cat > libtransmission/version.h.new << EOF
    46 #define VERSION_MAJOR        "$MAJOR"
    47 #define VERSION_MINOR        "$MINOR"
    48 #define VERSION_MAINTENANCE  "$MAINT"
    49 #define VERSION_REVISION     "$REV"
    50 #define VERSION_BETA         "$BETA"
    51 #define SHORT_VERSION_STRING "$STRING"
    52 #define LONG_VERSION_STRING  "$STRING ($REV)"
     40#define PEERID_PREFIX         "$PEERID_PREFIX"
     41#define USERAGENT_PREFIX      "$USERAGENT_PREFIX"
     42#define SVN_REVISION          "$SVN_REVISION"
     43#define SHORT_VERSION_STRING  "$USERAGENT_PREFIX"
     44#define LONG_VERSION_STRING   "$USERAGENT_PREFIX r($SVN_REVISION)"
    5345EOF
    5446replace_if_differs libtransmission/version.h.new libtransmission/version.h
    5547
    5648# Generate Info.plist from Info.plist.in
    57 sed -e "s/%%BUNDLE_VERSION%%/$REV/" -e "s/%%SHORT_VERSION_STRING%%/$STRING/" \
     49sed -e "s/%%BUNDLE_VERSION%%/$SVN_REVISION/" -e "s/%%SHORT_VERSION_STRING%%/$USERAGENT_PREFIX/" \
    5850        < macosx/Info.plist.in > macosx/Info.plist.new
    5951replace_if_differs macosx/Info.plist.new macosx/Info.plist
Note: See TracChangeset for help on using the changeset viewer.