From f52f4c6e1086250b3c7dfe8010c12f400cb38f10 Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Fri, 31 Oct 2014 22:46:52 +0000 Subject: [PATCH] Check for pkg-config before attempting to use it in configure Fixes configure when pkg-config is missing and looking for Scilab and Javascript --- configure.ac | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/configure.ac b/configure.ac index d4e29ffcf..cca4fd00a 100644 --- a/configure.ac +++ b/configure.ac @@ -461,6 +461,8 @@ fi]) AC_ARG_WITH(alllang, AS_HELP_STRING([--without-alllang], [Disable all languages]), with_alllang="$withval") +AC_CHECK_PROGS(PKGCONFIG, [pkg-config]) + #-------------------------------------------------------------------- # Look for Tcl #-------------------------------------------------------------------- @@ -1027,8 +1029,10 @@ else AC_MSG_CHECKING(for Scilab header files) if test "$SCILABINCDIR" != ""; then dirs="$SCILABINCDIR" + elif test -n "$PKGCONFIG"; then + dirs=`$PKGCONFIG scilab --cflags-only-I | sed -e 's/-I//g'` else - dirs=`pkg-config scilab --cflags-only-I | sed -e 's/-I//g'` + dirs="" fi for i in $dirs; do if test -r $i/api_scilab.h; then @@ -1275,15 +1279,17 @@ else if test -z "$JSCORELIB"; then case $host in *-*-linux*) - dirs="/usr/lib64/ /usr/local/lib64/ /usr/lib/ /usr/local/lib/" - for i in $dirs ; do - if test -r $i/libjavascriptcoregtk-1.0.so; then - AC_MSG_RESULT($i) - JSCORELIB="-L$i -ljavascriptcoregtk-1.0" - JSCOREVERSION=`pkg-config --modversion javascriptcoregtk-1.0` - break - fi - done + if test -n "$PKGCONFIG"; then + dirs="/usr/lib64/ /usr/local/lib64/ /usr/lib/ /usr/local/lib/" + for i in $dirs ; do + if test -r $i/libjavascriptcoregtk-1.0.so; then + AC_MSG_RESULT($i) + JSCORELIB="-L$i -ljavascriptcoregtk-1.0" + JSCOREVERSION=`$PKGCONFIG --modversion javascriptcoregtk-1.0` + break + fi + done + fi if test -z "$JSCORELIB"; then AC_MSG_RESULT(not found)