Changeset b8c336b for configure


Ignore:
Timestamp:
2015-05-09T19:50:30Z (10 years ago)
Author:
dequis <dx@…>
Children:
ec8b369
Parents:
356e2dd (diff), 5014380 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'develop' into feat/hip-cat

Conflicts:

protocols/jabber/hipchat.c
protocols/jabber/iq.c
protocols/jabber/jabber.h

File:
1 edited

Legend:

Unmodified
Added
Removed
  • configure

    r356e2dd rb8c336b  
    5656GLIB_MIN_VERSION=2.16
    5757
    58 echo BitlBee configure
    59 
    6058# Cygwin and Darwin don't support PIC/PIE
    6159case "$arch" in
     
    6563                pie=0;;
    6664esac
     65
     66get_version() {
     67        REAL_BITLBEE_VERSION=$(grep '^#define BITLBEE_VERSION ' $srcdir/bitlbee.h | sed 's/.*\"\(.*\)\".*/\1/')
     68
     69        if [ -n "$BITLBEE_VERSION" ]; then
     70                # environment variable already set to something to spoof it
     71                # don't replace it with the git stuff
     72                return
     73        fi
     74
     75        BITLBEE_VERSION=$REAL_BITLBEE_VERSION
     76
     77        if [ -d $srcdir/.git ] && type git > /dev/null 2> /dev/null; then
     78                timestamp=$(cd $srcdir; git show -s --format=%ci HEAD | sed 's/ .*$//; s/-//g')
     79                branch=$(cd $srcdir; git rev-parse --abbrev-ref HEAD)
     80
     81                search="(.+)-([0-9]+)-(g[0-9a-f]+)"
     82                replace="\1+$timestamp+$branch+\2-\3-git"
     83
     84                BITLBEE_VERSION=$(cd $srcdir; git describe --long --tags | sed -r "s/$search/$replace/")
     85
     86                unset timestamp branch search replace
     87        fi
     88}
     89
     90if [ "$1" = "--dump-version" ]; then
     91        srcdir=$(cd $(dirname $0);pwd)
     92        get_version
     93        echo $BITLBEE_VERSION
     94        exit
     95fi
     96
     97echo BitlBee configure
    6798
    6899while [ -n "$1" ]; do
     
    672703fi
    673704
    674 REAL_BITLBEE_VERSION=`grep '^#define BITLBEE_VERSION ' $srcdir/bitlbee.h | sed 's/.*\"\(.*\)\".*/\1/'`
    675 echo
    676 if [ -z "$BITLBEE_VERSION" -a -d .bzr ] && type bzr > /dev/null 2> /dev/null; then
    677         nick=`bzr nick`
    678         if [ -n "$nick" -a "$nick" != "bitlbee" ]; then
    679                 nick="-$nick"
    680         else
    681                 nick=""
    682         fi
    683         rev=`bzr revno`
    684         echo 'Using bzr revision #'$rev' as version number'
    685         BITLBEE_VERSION=$REAL_BITLBEE_VERSION-bzr$nick-$rev
    686 fi
    687 
    688 if [ -z "$BITLBEE_VERSION" -a -d .git ] && type git > /dev/null 2> /dev/null; then
    689         rev=`git describe --long --tags`-`git rev-parse --abbrev-ref HEAD`
    690         echo 'Using '$rev' as git version number'
    691         BITLBEE_VERSION=$rev-git
    692 fi
    693 
    694 if [ -n "$BITLBEE_VERSION" ]; then
     705get_version
     706
     707if [ "$BITLBEE_VERSION" != "$REAL_BITLBEE_VERSION" ]; then
    695708        echo 'Spoofing version number: '$BITLBEE_VERSION
    696709        echo '#undef BITLBEE_VERSION' >> config.h
    697710        echo '#define BITLBEE_VERSION "'$BITLBEE_VERSION'"' >> config.h
    698711        echo
    699 else
    700         # for pkg-config
    701         BITLBEE_VERSION=$REAL_BITLBEE_VERSION
    702712fi
    703713
Note: See TracChangeset for help on using the changeset viewer.