diff options
author | dequis <dx@dxzone.com.ar> | 2015-08-07 20:53:28 -0300 |
---|---|---|
committer | dequis <dx@dxzone.com.ar> | 2015-08-07 21:12:36 -0300 |
commit | a59bd116198bb52a2e7a4ef21276ddb0801dd9ec (patch) | |
tree | d7b2023400e2d5c4fc8d426e00de88f21aaeb79b | |
parent | e88fe7da23a43f7129ebf0001f22f25158c6ee4d (diff) |
configure: use pkg-config for libotr
-rwxr-xr-x | configure | 36 |
1 files changed, 14 insertions, 22 deletions
@@ -352,7 +352,7 @@ EFLAGS+=$($PKG_CONFIG --libs gnutls) $(libgcrypt-config --libs) CFLAGS+=$($PKG_CONFIG --cflags gnutls) $(libgcrypt-config --cflags) EOF ssl=gnutls - if ! pkg-config gnutls --atleast-version=2.8; then + if ! $PKG_CONFIG gnutls --atleast-version=2.8; then echo echo 'Warning: With GnuTLS versions <2.8, certificate expire dates are not verified.' fi @@ -642,37 +642,29 @@ else fi otrprefix="" -for i in / /usr /usr/local; do - if [ -f ${i}/lib/libotr.a ]; then - otrprefix=${i} - break - fi -done if [ "$otr" = "auto" ]; then - if [ -n "$otrprefix" ]; then - otr=1 - else - otr=0 - fi + ! $PKG_CONFIG --exists libotr + otr=$? +fi + +if [ "$otr" != 0 ] && ! $PKG_CONFIG --atleast-version=4.0 --print-errors libotr; then + exit 1 fi + if [ "$otr" = 1 ]; then # BI == built-in echo '#define OTR_BI' >> config.h - echo "EFLAGS+=-L${otrprefix}/lib -lotr -lgcrypt" >> Makefile.settings - echo "CFLAGS+=-I${otrprefix}/include" >> Makefile.settings + echo "EFLAGS+=$($PKG_CONFIG --libs libotr)$(libgcrypt-config --libs)" >> Makefile.settings + echo "CFLAGS+=$($PKG_CONFIG --cflags libotr)$(libgcrypt-config --cflags)" >> Makefile.settings echo 'OTR_BI=otr.o' >> Makefile.settings elif [ "$otr" = "plugin" ]; then + # for some mysterious reason beyond the comprehension of my mortal mind, + # the libgcrypt flags aren't needed when building as plugin. add them anyway. echo '#define OTR_PI' >> config.h - echo "OTRFLAGS=-L${otrprefix}/lib -lotr" >> Makefile.settings - echo "CFLAGS+=-I${otrprefix}/include" >> Makefile.settings + echo "OTRFLAGS=$($PKG_CONFIG --libs libotr)$(libgcrypt-config --libs)" >> Makefile.settings + echo "CFLAGS+=$($PKG_CONFIG --cflags libotr)$(libgcrypt-config --cflags)" >> Makefile.settings echo 'OTR_PI=otr.so' >> Makefile.settings fi -if [ "$otr" != 0 ] && ! pkg-config libotr --atleast-version=4.0; then - echo - echo 'WARNING: Your libotr seems to be old. BitlBee now needs at least libotr 4.0.' - # Not hard-failing because the code above doesn't use pkg-config, so who knows - # what's true at this point... -fi if [ "$skype" = "1" -o "$skype" = "plugin" ]; then if [ "$arch" = "Darwin" ]; then |