Changeset b1dc403 for configure


Ignore:
Timestamp:
2015-05-04T21:58:50Z (10 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Children:
5726a0d
Parents:
531eabd (diff), 5ca1416 (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:

Catch up with master.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • configure

    r531eabd rb1dc403  
    3838purple=0
    3939
     40doc=1
    4041debug=0
    4142strip=1
     
    5657GLIB_MIN_VERSION=2.16
    5758
    58 echo BitlBee configure
    59 
    6059# Cygwin and Darwin don't support PIC/PIE
    6160case "$arch" in
    62     CYGWIN* )
    63         pie=0;;
    64     Darwin )
    65         pie=0;;
     61        CYGWIN* )
     62                pie=0;;
     63        Darwin )
     64                pie=0;;
    6665esac
     66
     67get_version() {
     68        REAL_BITLBEE_VERSION=$(grep '^#define BITLBEE_VERSION ' $srcdir/bitlbee.h | sed 's/.*\"\(.*\)\".*/\1/')
     69        BITLBEE_VERSION=$REAL_BITLBEE_VERSION
     70
     71        if [ -d $srcdir/.git ] && type git > /dev/null 2> /dev/null; then
     72                timestamp=$(cd $srcdir; git show -s --format=%ci HEAD | sed 's/ .*$//; s/-//g')
     73                branch=$(cd $srcdir; git rev-parse --abbrev-ref HEAD)
     74
     75                search="(.+)-([0-9]+)-(g[0-9a-f]+)"
     76                replace="\1+$timestamp+$branch+\2-\3-git"
     77
     78                BITLBEE_VERSION=$(cd $srcdir; git describe --long --tags | sed -r "s/$search/$replace/")
     79
     80                unset timestamp branch search replace
     81        fi
     82}
     83
     84if [ "$1" = "--dump-version" ]; then
     85        srcdir=$(cd $(dirname $0);pwd)
     86        get_version
     87        echo $BITLBEE_VERSION
     88        exit
     89fi
     90
     91echo BitlBee configure
    6792
    6893while [ -n "$1" ]; do
     
    96121--rpc=0/1       Disable/enable RPC interface            $rpc
    97122
     123--doc=0/1       Disable/enable help.txt generation      $doc
    98124--debug=0/1     Disable/enable debugging                $debug
    99125--strip=0/1     Disable/enable binary stripping         $strip
     
    450476        ret=1
    451477        echo "$RESOLV_NS_TESTCODE" | $CC -o $TMPFILE -x c - $LIBRESOLV >/dev/null 2>/dev/null
    452         if [ "$?" = "0" ]; then
    453                 ret=0
    454         fi
     478        if [ "$?" = "0" ]; then
     479                ret=0
     480        fi
    455481
    456482        rm -f $TMPFILE
     
    465491                if [ -f $i/libresolv.a ]; then
    466492                        echo "$RESOLV_NS_TESTCODE" | $CC -o $TMPFILE -x c - -Wl,$i/libresolv.a >/dev/null 2>/dev/null
    467                         if [ "$?" = "0" ]; then
    468                                 ret=0
    469                         fi
     493                        if [ "$?" = "0" ]; then
     494                                ret=0
     495                        fi
    470496                fi
    471497        done
     
    477503detect_nameser_has_ns_types()
    478504{
    479     TMPFILE=$(mktemp /tmp/bitlbee-configure.XXXXXX)
    480     ret=1
    481     # since we aren't actually linking with ns_* routines
    482     # we can just compile the test code
    483     echo "$RESOLV_NS_TYPES_TESTCODE" | $CC -o $TMPFILE -x c -  >/dev/null 2>/dev/null
    484     if [ "$?" = "0" ]; then
    485         ret=0
    486     fi
    487 
    488     rm -f $TMPFILE
    489     return $ret
     505        TMPFILE=$(mktemp /tmp/bitlbee-configure.XXXXXX)
     506        ret=1
     507        # since we aren't actually linking with ns_* routines
     508        # we can just compile the test code
     509        echo "$RESOLV_NS_TYPES_TESTCODE" | $CC -o $TMPFILE -x c -  >/dev/null 2>/dev/null
     510        if [ "$?" = "0" ]; then
     511                ret=0
     512        fi
     513
     514        rm -f $TMPFILE
     515        return $ret
    490516}
    491517
     
    548574if detect_resolv_dynamic || detect_resolv_static; then
    549575        echo '#define HAVE_RESOLV_A' >> config.h
    550     if detect_resolv_ns_dynamic || detect_resolv_ns_static; then
    551             echo '#define HAVE_RESOLV_A_WITH_NS' >> config.h
    552     fi
    553 else
    554     echo 'Insufficient resolv routines. Jabber server must be set explicitly'
     576        if detect_resolv_ns_dynamic || detect_resolv_ns_static; then
     577                echo '#define HAVE_RESOLV_A_WITH_NS' >> config.h
     578        fi
     579else
     580        echo 'Insufficient resolv routines. Jabber server must be set explicitly'
    555581fi
    556582
     
    649675fi
    650676
    651 if [ ! -e doc/user-guide/help.txt ] && ! type xmlto > /dev/null 2> /dev/null; then
    652         echo
    653         echo 'WARNING: Building from an unreleased source tree without prebuilt helpfile.'
    654         echo 'Install xmlto if you want online help to work.'
    655 fi
    656 
    657 REAL_BITLBEE_VERSION=`grep '^#define BITLBEE_VERSION ' $srcdir/bitlbee.h | sed 's/.*\"\(.*\)\".*/\1/'`
    658 echo
    659 if [ -z "$BITLBEE_VERSION" -a -d .bzr ] && type bzr > /dev/null 2> /dev/null; then
    660         nick=`bzr nick`
    661         if [ -n "$nick" -a "$nick" != "bitlbee" ]; then
    662                 nick="-$nick"
     677if [ "$doc" = "1" ]; then
     678        if [ ! -e doc/user-guide/help.txt ] && \
     679             ! type xmlto > /dev/null 2> /dev/null || \
     680             ! type xsltproc > /dev/null 2> /dev/null
     681        then
     682                echo
     683                echo 'WARNING: Building from an unreleased source tree without prebuilt helpfile.'
     684                echo 'Install xmlto and xsltproc if you want online help to work.'
    663685        else
    664                 nick=""
    665         fi
    666         rev=`bzr revno`
    667         echo 'Using bzr revision #'$rev' as version number'
    668         BITLBEE_VERSION=$REAL_BITLBEE_VERSION-bzr$nick-$rev
    669 fi
    670 
    671 if [ -z "$BITLBEE_VERSION" -a -d .git ] && type git > /dev/null 2> /dev/null; then
    672         rev=`git describe --long --tags`-`git rev-parse --abbrev-ref HEAD`
    673         echo 'Using '$rev' as git version number'
    674         BITLBEE_VERSION=$rev-git
    675 fi
    676 
    677 if [ -n "$BITLBEE_VERSION" ]; then
     686                echo "DOC=1" >> Makefile.settings
     687        fi
     688
     689        if [ "$skype" = "1" -o "$skype" = "plugin" ]; then
     690                # skype also needs asciidoc
     691                if ! type a2x > /dev/null 2> /dev/null; then
     692                        echo
     693                        echo 'WARNING: The skyped man page requires asciidoc. It will not be generated.'
     694                else
     695                        echo "ASCIIDOC=1" >> Makefile.settings
     696                fi
     697        fi
     698fi
     699
     700get_version
     701
     702if [ "$BITLBEE_VERSION" != "$REAL_BITLBEE_VERSION" ]; then
    678703        echo 'Spoofing version number: '$BITLBEE_VERSION
    679704        echo '#undef BITLBEE_VERSION' >> config.h
    680705        echo '#define BITLBEE_VERSION "'$BITLBEE_VERSION'"' >> config.h
    681706        echo
    682 else
    683         # for pkg-config
    684         BITLBEE_VERSION=$REAL_BITLBEE_VERSION
    685707fi
    686708
Note: See TracChangeset for help on using the changeset viewer.