~oif-team/ubuntu/natty/qt4-x11/xi2.1

« back to all changes in this revision

Viewing changes to config.tests/x11/xshape.test

  • Committer: Bazaar Package Importer
  • Author(s): Adam Conrad
  • Date: 2005-08-24 04:09:09 UTC
  • Revision ID: james.westby@ubuntu.com-20050824040909-xmxe9jfr4a0w5671
Tags: upstream-4.0.0
ImportĀ upstreamĀ versionĀ 4.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh
 
2
 
 
3
XSHAPE=yes
 
4
XCONFIG=$1/qmake.conf
 
5
VERBOSE=$2
 
6
shift 2
 
7
IN_LIBDIRS=
 
8
IN_INCDIRS=
 
9
PARAMS=$@
 
10
for PARAM in $PARAMS; do
 
11
    PREFIX=`echo $PARAM | sed 's/^\(..\).*/\1/'`
 
12
    case $PREFIX in
 
13
    -L)
 
14
        CLIBDIR=`echo $PARAM | sed -e 's/^-L//'`
 
15
        IN_LIBDIRS="$IN_LIBDIRS $CLIBDIR"
 
16
        ;;
 
17
    -I)
 
18
        CINCDIR=`echo $PARAM | sed -e 's/^-I//'`
 
19
        IN_INCDIRS="$IN_INCDIRS $CINCDIR"
 
20
        ;;
 
21
    *) ;;
 
22
    esac
 
23
done
 
24
 
 
25
# debuggery
 
26
[ "$VERBOSE" = "yes" ] && echo "XShape auto-detection... ($*)"
 
27
 
 
28
# NOTE: we assume that libXext is always available...
 
29
INCS="X11/extensions/shape.h"
 
30
XDIRS=`sed -n -e '/^QMAKE_INCDIR_X11[   ]*=/ { s/[^=]*=[         ]*//; s/-I/ /g; p; }' $XCONFIG`
 
31
INCDIRS="$IN_INCDIRS $XDIRS /usr/include /include"
 
32
for I in $INCS; do
 
33
    F=
 
34
    for INCDIR in $INCDIRS; do
 
35
        if [ -f $INCDIR/$I ]; then
 
36
            F=yes
 
37
            [ "$VERBOSE" = "yes" ] && echo "  Found $I in $INCDIR"
 
38
            break
 
39
        fi
 
40
    done
 
41
    if [ -z "$F" ]; then
 
42
        XSHAPE=no
 
43
        [ "$VERBOSE" = "yes" ] && echo "  Could not find $I anywhere in $INCDIRS"
 
44
    fi
 
45
done
 
46
 
 
47
# done
 
48
if [ "$XSHAPE" != "yes" ]; then
 
49
    [ "$VERBOSE" = "yes" ] && echo "XShape disabled."
 
50
    exit 0
 
51
else
 
52
    [ "$VERBOSE" = "yes" ] && echo "XShape enabled."
 
53
    exit 1
 
54
fi