diff --git a/qb/config.libs.sh b/qb/config.libs.sh index 777fd57715..29c39c844c 100644 --- a/qb/config.libs.sh +++ b/qb/config.libs.sh @@ -377,8 +377,7 @@ if [ "$HAVE_UDEV" != "no" ]; then fi fi -#this one is broken (XShm.h requires some other X headers first), but xshm itself doesn't work either, so it's okay -check_header XSHM X11/extensions/XShm.h +check_header XSHM X11/Xlib.h X11/extensions/XShm.h check_header PARPORT linux/parport.h check_header PARPORT linux/ppdev.h diff --git a/qb/config.params.sh b/qb/config.params.sh index 587b8bcd2a..67940a399e 100644 --- a/qb/config.params.sh +++ b/qb/config.params.sh @@ -66,3 +66,4 @@ HAVE_IMAGEVIEWER=yes # Built-in image viewer support. C89_IMAGEVIEWER=no # stb_image hates C89 HAVE_MMAP=auto # MMAP support HAVE_QT=no # QT companion support +HAVE_XSHM=auto # XShm video driver support diff --git a/qb/qb.libs.sh b/qb/qb.libs.sh index 7dcf1a3d15..573b982369 100644 --- a/qb/qb.libs.sh +++ b/qb/qb.libs.sh @@ -134,18 +134,19 @@ check_pkgconf() #$1 = HAVE_$1 $2 = package $3 = version $4 = critical error mess } } -check_header() #$1 = HAVE_$1 $2 = header file +check_header() #$1 = HAVE_$1 $2..$5 = header files { tmpval="$(eval echo \$HAVE_$1)" [ "$tmpval" = 'no' ] && return 0 - ECHOBUF="Checking presence of header file $2" + CHECKHEADER="$2" # echo -n "Checking presence of header file $2" - cat << EOF > "$TEMP_C" -#include<$2> -int main(void) { return 0; } -EOF + echo "#include <$2>" > "$TEMP_C" + [ "$3" != "" ] && CHECKHEADER="$3" && echo "#include <$3>" >> "$TEMP_C" + [ "$4" != "" ] && CHECKHEADER="$4" && echo "#include <$4>" >> "$TEMP_C" + [ "$5" != "" ] && CHECKHEADER="$5" && echo "#include <$5>" >> "$TEMP_C" + echo "int main(void) { return 0; }" >> "$TEMP_C" answer='no' "$CC" -o "$TEMP_EXE" "$TEMP_C" $INCLUDE_DIRS >>config.log 2>&1 && answer='yes' - eval HAVE_$1="$answer"; echo "$ECHOBUF ... $answer" + eval HAVE_$1="$answer"; echo "Checking presence of header file $CHECKHEADER ... $answer" rm "$TEMP_C" "$TEMP_EXE" >/dev/null 2>&1 [ "$tmpval" = 'yes' ] && [ "$answer" = 'no' ] && { echo "Build assumed that $2 exists, but cannot locate. Exiting ..."