summaryrefslogtreecommitdiffstats
path: root/experimental/tqtinterface/qt4/config.tests/unix/checkavail
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2011-07-10 15:17:53 -0500
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2011-07-10 15:17:53 -0500
commit37e3f157c7d76f13de807fa66e36df209e1005fb (patch)
tree7a4f131b2ee065337dac341bff34515310efba4f /experimental/tqtinterface/qt4/config.tests/unix/checkavail
parent16630c3eff313238fa8412275555285c9195981b (diff)
downloadtde-37e3f157c7d76f13de807fa66e36df209e1005fb.tar.gz
tde-37e3f157c7d76f13de807fa66e36df209e1005fb.zip
Added TQt4 HEAD
Diffstat (limited to 'experimental/tqtinterface/qt4/config.tests/unix/checkavail')
-rwxr-xr-xexperimental/tqtinterface/qt4/config.tests/unix/checkavail124
1 files changed, 124 insertions, 0 deletions
diff --git a/experimental/tqtinterface/qt4/config.tests/unix/checkavail b/experimental/tqtinterface/qt4/config.tests/unix/checkavail
new file mode 100755
index 000000000..1dd59c966
--- /dev/null
+++ b/experimental/tqtinterface/qt4/config.tests/unix/checkavail
@@ -0,0 +1,124 @@
+#!/bin/sh
+#
+# usage: $1 is featurename, $2 verbose
+# $3..$n librarynames like '-llibmysqlclient.*' or (optional) extra library paths like '-L/usr/local/lib'
+# or filenames like "mysql.h" and (optional) extra include paths like '-I/usr/local/include'
+# returns 0 on success
+
+SUCCESS=
+MODULE_NAME=$1
+VERBOSE=$2
+shift 2
+LIBDIRS="/lib /usr/lib"
+LIBNAMES=""
+INCLUDEDIRS="/usr/include"
+INCLUDES=""
+
+PARAMS=$@
+for PARAM in $PARAMS
+do
+ PREFIX=`echo $PARAM | sed 's/^\(..\).*/\1/'`
+ case $PREFIX in
+ -L)
+ CLIBDIR=`echo $PARAM | sed -e 's/^-L//'`
+ LIBDIRS="$LIBDIRS $CLIBDIR"
+ ;;
+ -l)
+ CLIBNAME=`echo $PARAM | sed -e 's/^-l//'`
+ LIBNAMES="$LIBNAMES lib${CLIBNAME}.*"
+ ;;
+ -I)
+ CINCDIR=`echo $PARAM | sed -e 's/^-I//'`
+ INCLUDEDIRS="$INCLUDEDIRS $CINCDIR"
+ ;;
+ *)
+ INCLUDES="$PARAM $INCLUDES"
+ ;;
+ esac
+done
+
+# debuggery
+
+if [ "$VERBOSE" = "yes" ]
+then
+ echo "$MODULE_NAME auto-detection..."
+# echo "searching for $LIBNAMES in $LIBDIRS"
+# echo "and $INCLUDES in $INCLUDEDIRS"
+fi
+
+
+# check for lib
+for LIBNAME in $LIBNAMES
+do
+ SUCCESS=""
+ for LIBDIR in $LIBDIRS
+ do
+ FOUND_LIB=`ls $LIBDIR/$LIBNAME 2>/dev/null`
+ if [ ! -z "$FOUND_LIB" ]
+ then
+ SUCCESS=yes
+ if [ "$VERBOSE" = "yes" ]
+ then
+ echo " Found $LIBNAME in $LIBDIR"
+ fi
+ break
+ fi
+ done
+ if [ -z "$SUCCESS" ]
+ then
+ SUCCESS=no
+ if [ "$VERBOSE" = "yes" ]
+ then
+ echo " Could not tqfind $LIBNAME anywhere in $LIBDIRS"
+ fi
+ break
+ fi
+done
+
+# check for includes
+if [ "$SUCCESS" = "yes" ]
+then
+ for INCLUDE in $INCLUDES
+ do
+ SUCCESS=""
+ for INCLUDEDIR in $INCLUDEDIRS
+ do
+ FOUND_INC=`ls $INCLUDEDIR/$INCLUDE 2>/dev/null`
+ if [ ! -z "$FOUND_INC" ]
+ then
+ SUCCESS=yes
+ if [ "$VERBOSE" = "yes" ]
+ then
+ echo " Found $INCLUDE in $INCLUDEDIR"
+ fi
+ break
+ fi
+ done
+ if [ -z "$SUCCESS" ]
+ then
+ SUCCESS=no
+ if [ "$VERBOSE" = "yes" ]
+ then
+ echo " Could not tqfind $INCLUDE anywhere in $INCLUDEDIRS"
+ fi
+ break
+ fi
+ done
+fi
+
+if [ "$SUCCESS" != "yes" ]
+then
+ if [ "$VERBOSE" = "yes" ]
+ then
+ echo "$MODULE_NAME disabled."
+ fi
+ exit 1
+else
+ if [ "$VERBOSE" = "yes" ]
+ then
+ echo "$MODULE_NAME enabled."
+ fi
+ exit 0
+fi
+exit 1
+