Fix to detect XRandR on multi-prefix package platforms

Change to find two XrandR header files from invidual directory.
"Xrandr.h" is in `libXrandr`, and "randr.h" is in `xorgproto` (used to be
`randrproto`) package, so they may be installed into different prefix.

Signed-off-by: OBATA Akio <obache@wizdas.com>
pull/33/head
OBATA Akio 4 years ago
parent b6a4a5ec20
commit a31f05cb8e

@ -43,19 +43,17 @@ if [ -z "$F" ]; then
fi fi
# check for Xrandr.h and randr.h # check for Xrandr.h and randr.h
XRANDR_H=
RANDR_H= RANDR_H=
if [ "$XRANDR" = "yes" ]; then if [ "$XRANDR" = "yes" ]; then
INC="X11/extensions/Xrandr.h" INCS="X11/extensions/Xrandr.h X11/extensions/randr.h"
INC2="X11/extensions/randr.h"
XDIRS=`sed -n -e '/^QMAKE_INCDIR_X11[ ]*=/ { s/[^=]*=[ ]*//; s/-I/ /g; p; }' $XCONFIG` XDIRS=`sed -n -e '/^QMAKE_INCDIR_X11[ ]*=/ { s/[^=]*=[ ]*//; s/-I/ /g; p; }' $XCONFIG`
INCDIRS="$IN_INCDIRS $XDIRS /usr/include /include" INCDIRS="$IN_INCDIRS $XDIRS /usr/include /include"
for INC in $INCS; do
F= F=
for INCDIR in $INCDIRS; do for INCDIR in $INCDIRS; do
if [ -f $INCDIR/$INC -a -f $INCDIR/$INC2 ]; then if [ -f $INCDIR/$INC ]; then
F=yes F=yes
XRANDR_H=$INCDIR/$INC [ "$INC" = "X11/extensions/randr.h" ] && RANDR_H=$INCDIR/$INC
RANDR_H=$INCDIR/$INC2
[ "$VERBOSE" = "yes" ] && echo " Found $INC in $INCDIR" [ "$VERBOSE" = "yes" ] && echo " Found $INC in $INCDIR"
break break
fi fi
@ -64,7 +62,9 @@ if [ "$XRANDR" = "yes" ]; then
then then
XRANDR=no XRANDR=no
[ "$VERBOSE" = "yes" ] && echo " Could not find $INC anywhere in $INCDIRS" [ "$VERBOSE" = "yes" ] && echo " Could not find $INC anywhere in $INCDIRS"
break;
fi fi
done
fi fi
# verify that we are using XRandR 1.x >= 1.1 # verify that we are using XRandR 1.x >= 1.1

Loading…
Cancel
Save