From 9c13c23f1174a13c9cd8cd6cdbff3c28d2ddbfc5 Mon Sep 17 00:00:00 2001 From: c-spencer Date: Thu, 9 Aug 2012 18:59:46 +0100 Subject: [PATCH] Trial auto-detection of libraries --- binding.gyp | 6 +++--- has_lib.sh | 23 +++++++++++++++++++++++ 2 files changed, 26 insertions(+), 3 deletions(-) create mode 100755 has_lib.sh diff --git a/binding.gyp b/binding.gyp index 40b635f..4cd8571 100644 --- a/binding.gyp +++ b/binding.gyp @@ -1,9 +1,9 @@ { 'variables': { 'GTK_Root%': 'C:/GTK', # Set the location of GTK all-in-one bundle - 'with_jpeg%': 'false', - 'with_gif%': 'false', - 'with_pango%': 'false' + 'with_jpeg%': ' /dev/null && ldconfig -p 2>/dev/null | grep lib$lib`; do + return 0 + done + + # Try just checking common library locations + for dir in /lib /usr/lib /usr/local/lib /opt/local/lib; do + test -d $dir && ls $dir | grep $lib && return 0 + done + + return 1 +} + +has_lib $1 > /dev/null +if test $? -eq 0; then + echo true +else + echo false +fi