qb: Add $PKG_CONF_USED to the check_lib function to help avoid undefined referenecs.

This commit is contained in:
orbea 2017-11-25 13:12:31 -08:00
parent 93451012ec
commit e0eb2b8a31
2 changed files with 6 additions and 13 deletions

View File

@ -123,7 +123,6 @@ if [ "$HAVE_EGL" != "no" ] && [ "$OS" != 'Win32' ]; then
HAVE_EGL=auto; check_lib '' EGL "-l${VC_PREFIX}EGL $EXTRA_GL_LIBS"
if [ "$HAVE_EGL" = "yes" ]; then
EGL_LIBS="-l${VC_PREFIX}EGL $EXTRA_GL_LIBS"
PKG_CONF_USED="$PKG_CONF_USED EGL"
fi
else
EGL_LIBS="$EGL_LIBS $EXTRA_GL_LIBS"
@ -316,9 +315,6 @@ if [ "$HAVE_OPENGL" != 'no' ] && [ "$HAVE_OPENGLES" != 'yes' ]; then
[ "$HAVE_CG" = 'yes' ] && CG_LIBS='-lCg -lCgGL'
fi
# fix undefined variables
PKG_CONF_USED="$PKG_CONF_USED CG"
check_pkgconf OSMESA osmesa
else
die : 'Notice: Ignoring Cg. Desktop OpenGL is not enabled.'
@ -410,7 +406,6 @@ if [ "$HAVE_X11" = "no" ] && [ "$OS" != 'Darwin' ]; then
HAVE_X11=auto; check_lib '' X11 -lX11
if [ "$HAVE_X11" = "yes" ]; then
X11_LIBS="-lX11"
PKG_CONF_USED="$PKG_CONF_USED X11"
fi
fi
@ -427,7 +422,6 @@ if [ "$HAVE_X11" != "no" ]; then
HAVE_XEXT=auto; check_lib '' XEXT -lXext
if [ "$HAVE_XEXT" = "yes" ]; then
XEXT_LIBS="-lXext"
PKG_CONF_USED="$PKG_CONF_USED XEXT"
fi
fi
@ -435,7 +429,6 @@ if [ "$HAVE_X11" != "no" ]; then
HAVE_XF86VM=auto; check_lib '' XF86VM -lXxf86vm
if [ "$HAVE_XF86VM" = "yes" ]; then
XF86VM_LIBS="-lXxf86vm"
PKG_CONF_USED="$PKG_CONF_USED XF86VM"
fi
fi
else
@ -457,7 +450,6 @@ if [ "$HAVE_UDEV" != "no" ]; then
HAVE_UDEV=auto; check_lib '' UDEV "-ludev"
if [ "$HAVE_UDEV" = "yes" ]; then
UDEV_LIBS='-ludev'
PKG_CONF_USED="$PKG_CONF_USED UDEV"
fi
fi
fi

View File

@ -58,13 +58,14 @@ check_lib() # $1 = language $2 = HAVE_$2 $3 = lib $4 = function in lib $5 =
printf %s\\n "$ECHOBUF ... $answer"
rm -f -- "$TEMP_CODE" "$TEMP_EXE"
[ "$answer" = 'no' ] && {
if [ "$answer" = 'no' ]; then
[ "$7" ] && die 1 "$7"
[ "$tmpval" = 'yes' ] && {
die 1 "Forced to build with library $3, but cannot locate. Exiting ..."
}
}
else
PKG_CONF_USED="$PKG_CONF_USED $2"
fi
return 0
}
@ -219,8 +220,8 @@ create_config_make()
*$1*)
FLAGS="$(eval "printf %s \"\$$1_CFLAGS\"")"
LIBS="$(eval "printf %s \"\$$1_LIBS\"")"
printf %s\\n "$1_CFLAGS = ${FLAGS%"${FLAGS##*[! ]}"}" \
"$1_LIBS = ${LIBS%"${LIBS##*[! ]}"}"
[ "${FLAGS}" ] && printf %s\\n "$1_CFLAGS = ${FLAGS%"${FLAGS##*[! ]}"}"
[ "${LIBS}" ] && printf %s\\n "$1_LIBS = ${LIBS%"${LIBS##*[! ]}"}"
;;
esac
shift