Changeset a59bd11 for configure


Ignore:
Timestamp:
2015-08-08T00:12:36Z (9 years ago)
Author:
dequis <dx@…>
Branches:
master
Children:
4850065
Parents:
e88fe7da
git-author:
dequis <dx@…> (07-08-15 23:53:28)
git-committer:
dequis <dx@…> (08-08-15 00:12:36)
Message:

configure: use pkg-config for libotr

File:
1 edited

Legend:

Unmodified
Added
Removed
  • configure

    re88fe7da ra59bd11  
    353353EOF
    354354                ssl=gnutls
    355                 if ! pkg-config gnutls --atleast-version=2.8; then
     355                if ! $PKG_CONFIG gnutls --atleast-version=2.8; then
    356356                        echo
    357357                        echo 'Warning: With GnuTLS versions <2.8, certificate expire dates are not verified.'
     
    643643
    644644otrprefix=""
    645 for i in / /usr /usr/local; do
    646         if [ -f ${i}/lib/libotr.a ]; then
    647                 otrprefix=${i}
    648                 break
    649         fi
    650 done
    651645if [ "$otr" = "auto" ]; then
    652         if [ -n "$otrprefix" ]; then
    653                 otr=1
    654         else
    655                 otr=0
    656         fi
    657 fi
     646        ! $PKG_CONFIG --exists libotr
     647        otr=$?
     648fi
     649
     650if [ "$otr" != 0 ] && ! $PKG_CONFIG --atleast-version=4.0 --print-errors libotr; then
     651        exit 1
     652fi
     653
    658654if [ "$otr" = 1 ]; then
    659655        # BI == built-in
    660656        echo '#define OTR_BI' >> config.h
    661         echo "EFLAGS+=-L${otrprefix}/lib -lotr -lgcrypt" >> Makefile.settings
    662         echo "CFLAGS+=-I${otrprefix}/include" >> Makefile.settings
     657        echo "EFLAGS+=$($PKG_CONFIG --libs libotr)$(libgcrypt-config --libs)" >> Makefile.settings
     658        echo "CFLAGS+=$($PKG_CONFIG --cflags libotr)$(libgcrypt-config --cflags)" >> Makefile.settings
    663659        echo 'OTR_BI=otr.o' >> Makefile.settings
    664660elif [ "$otr" = "plugin" ]; then
     661        # for some mysterious reason beyond the comprehension of my mortal mind,
     662        # the libgcrypt flags aren't needed when building as plugin. add them anyway.
    665663        echo '#define OTR_PI' >> config.h
    666         echo "OTRFLAGS=-L${otrprefix}/lib -lotr" >> Makefile.settings
    667         echo "CFLAGS+=-I${otrprefix}/include" >> Makefile.settings
     664        echo "OTRFLAGS=$($PKG_CONFIG --libs libotr)$(libgcrypt-config --libs)" >> Makefile.settings
     665        echo "CFLAGS+=$($PKG_CONFIG --cflags libotr)$(libgcrypt-config --cflags)" >> Makefile.settings
    668666        echo 'OTR_PI=otr.so' >> Makefile.settings
    669 fi
    670 if [ "$otr" != 0 ] && ! pkg-config libotr --atleast-version=4.0; then
    671         echo
    672         echo 'WARNING: Your libotr seems to be old. BitlBee now needs at least libotr 4.0.'
    673         # Not hard-failing because the code above doesn't use pkg-config, so who knows
    674         # what's true at this point...
    675667fi
    676668
Note: See TracChangeset for help on using the changeset viewer.