Check for pkg-config before attempting to use it in configure

Fixes configure when pkg-config is missing and looking for Scilab and
Javascript
This commit is contained in:
William S Fulton 2014-10-31 22:46:52 +00:00
commit f52f4c6e10

View file

@ -461,6 +461,8 @@ fi])
AC_ARG_WITH(alllang, AS_HELP_STRING([--without-alllang], [Disable all languages]), with_alllang="$withval") AC_ARG_WITH(alllang, AS_HELP_STRING([--without-alllang], [Disable all languages]), with_alllang="$withval")
AC_CHECK_PROGS(PKGCONFIG, [pkg-config])
#-------------------------------------------------------------------- #--------------------------------------------------------------------
# Look for Tcl # Look for Tcl
#-------------------------------------------------------------------- #--------------------------------------------------------------------
@ -1027,8 +1029,10 @@ else
AC_MSG_CHECKING(for Scilab header files) AC_MSG_CHECKING(for Scilab header files)
if test "$SCILABINCDIR" != ""; then if test "$SCILABINCDIR" != ""; then
dirs="$SCILABINCDIR" dirs="$SCILABINCDIR"
elif test -n "$PKGCONFIG"; then
dirs=`$PKGCONFIG scilab --cflags-only-I | sed -e 's/-I//g'`
else else
dirs=`pkg-config scilab --cflags-only-I | sed -e 's/-I//g'` dirs=""
fi fi
for i in $dirs; do for i in $dirs; do
if test -r $i/api_scilab.h; then if test -r $i/api_scilab.h; then
@ -1275,15 +1279,17 @@ else
if test -z "$JSCORELIB"; then if test -z "$JSCORELIB"; then
case $host in case $host in
*-*-linux*) *-*-linux*)
dirs="/usr/lib64/ /usr/local/lib64/ /usr/lib/ /usr/local/lib/" if test -n "$PKGCONFIG"; then
for i in $dirs ; do dirs="/usr/lib64/ /usr/local/lib64/ /usr/lib/ /usr/local/lib/"
if test -r $i/libjavascriptcoregtk-1.0.so; then for i in $dirs ; do
AC_MSG_RESULT($i) if test -r $i/libjavascriptcoregtk-1.0.so; then
JSCORELIB="-L$i -ljavascriptcoregtk-1.0" AC_MSG_RESULT($i)
JSCOREVERSION=`pkg-config --modversion javascriptcoregtk-1.0` JSCORELIB="-L$i -ljavascriptcoregtk-1.0"
break JSCOREVERSION=`$PKGCONFIG --modversion javascriptcoregtk-1.0`
fi break
done fi
done
fi
if test -z "$JSCORELIB"; then if test -z "$JSCORELIB"; then
AC_MSG_RESULT(not found) AC_MSG_RESULT(not found)