From 392494733b775c79b80873554c84a26b73460d25 Mon Sep 17 00:00:00 2001 From: Doug Coleman Date: Wed, 6 Apr 2011 18:49:15 -0400 Subject: [PATCH] Fix the console spew on missing libraries. Set NO_UI=1 when gtk libraries are missing on linux/unix platforms. --- build-support/factor.sh | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/build-support/factor.sh b/build-support/factor.sh index 8045a5fe7e..46cbaac6fa 100755 --- a/build-support/factor.sh +++ b/build-support/factor.sh @@ -119,18 +119,18 @@ check_library_exists() { GCC_OUT=factor-library-test.out $ECHO -n "Checking for library $1..." $ECHO "int main(){return 0;}" > $GCC_TEST - $CC $GCC_TEST -o $GCC_OUT -l $1 + $CC $GCC_TEST -o $GCC_OUT -l $1 2>&- if [[ $? -ne 0 ]] ; then $ECHO "not found!" - $ECHO "Warning: library $1 not found." $ECHO "***Factor will compile NO_UI=1" NO_UI=1 + else + $ECHO "found." fi $DELETE -f $GCC_TEST check_ret $DELETE $DELETE -f $GCC_OUT check_ret $DELETE - $ECHO "found." } check_X11_libraries() { @@ -141,9 +141,26 @@ check_X11_libraries() { fi } +check_gtk_libraries() { + if [ -z "$NO_UI" ]; then + check_library_exists gobject-2.0 + check_library_exists gtk-x11-2.0 + check_library_exists gdk-x11-2.0 + check_library_exists gdk_pixbuf-2.0 + check_library_exists gtkglext-x11-1.0 + check_library_exists atk-1.0 + check_library_exists gio-2.0 + check_library_exists gdkglext-x11-1.0 + check_library_exists pango-1.0 + fi +} + + check_libraries() { case $OS in - linux) check_X11_libraries;; + linux) check_X11_libraries + check_gtk_libraries;; + unix) check_gtk_libraries;; esac }