configure: unset CAPSTONE_* vars when it is not used (fix #10266) (#11654)

This commit is contained in:
Riccardo Schirone 2018-10-01 16:08:47 +02:00 committed by radare
parent 6525f1b28e
commit 3012a2de6b
2 changed files with 8 additions and 2 deletions

6
configure vendored
View File

@ -435,18 +435,20 @@ LIBMAGIC="-lmagic"
else
USE_LIB_MAGIC="0"
LIBMAGIC=""; fi
if [ "$WITH_CAPSTONE" = "1" ]; then
[ -z "${PKGCONFIG}" ] && PKGCONFIG=pkg-config
type ${PKGCONFIG} > /dev/null 2>&1 || echo "ERROR: Cannot find PKGCONFIG ${PKGCONFIG}"
echo 'Using PKGCONFIG: '${PKGCONFIG}
printf 'checking pkg-config flags for capstone... '
tmp=`${PKGCONFIG} --cflags capstone 2>/dev/null`
if [ $? != 0 ]; then echo no ; HAVE_PKGCFG_CAPSTONE=0;
CAPSTONE_CFLAGS='';CAPSTONE_LDFLAGS='';
else
CAPSTONE_CFLAGS=$tmp;
tmp=`${PKGCONFIG} --libs capstone 2>/dev/null`
if [ $? = 0 ]; then
echo yes; HAVE_PKGCFG_CAPSTONE=1;
CAPSTONE_LDFLAGS=$tmp; fi; fi
CAPSTONE_LDFLAGS=$tmp; fi; fi; fi
if [ 11 = "$WITH_CAPSTONE$HAVE_PKGCFG_CAPSTONE" ]; then
USE_CAPSTONE="1"
@ -501,6 +503,7 @@ check_library HAVE_LIB_SSL ssl 0
printf 'checking pkg-config flags for openssl... '
tmp=`${PKGCONFIG} --cflags openssl 2>/dev/null`
if [ $? != 0 ]; then echo no ; HAVE_PKGCFG_OPENSSL=0;
SSL_CFLAGS='';SSL_LDFLAGS='';
else
SSL_CFLAGS=$tmp;
tmp=`${PKGCONFIG} --libs openssl 2>/dev/null`
@ -524,6 +527,7 @@ check_library HAVE_LIB_LIBUV libuv 0
printf 'checking pkg-config flags for libuv... '
tmp=`${PKGCONFIG} --cflags libuv 2>/dev/null`
if [ $? != 0 ]; then echo no ; HAVE_PKGCFG_LIBUV=0;
LIBUV_CFLAGS='';LIBUV_LDFLAGS='';
else
LIBUV_CFLAGS=$tmp;
tmp=`${PKGCONFIG} --libs libuv 2>/dev/null`

View File

@ -29,7 +29,9 @@ ARG_WITHOUT HAVE_FORK fork disable fork ;
ARG_WITH WITH_LIBR libr build libr.a and libr.dylib ;
ARG_WITH WITH_CAPSTONE syscapstone force to use system-wide capstone ;
PKGCFG CAPSTONE_CFLAGS CAPSTONE_LDFLAGS capstone
IF WITH_CAPSTONE {
PKGCFG CAPSTONE_CFLAGS CAPSTONE_LDFLAGS capstone
}
IFAND WITH_CAPSTONE HAVE_PKGCFG_CAPSTONE {
USE_CAPSTONE = 1 ;
}{