qb: Define $2_LIBS in the check_lib function.

This commit is contained in:
orbea 2017-11-25 15:00:01 -08:00
parent cda840683b
commit fc5f04a762
2 changed files with 15 additions and 27 deletions

View File

@ -120,10 +120,8 @@ if [ "$HAVE_EGL" != "no" ] && [ "$OS" != 'Win32' ]; then
check_pkgconf EGL "$VC_PREFIX"egl check_pkgconf EGL "$VC_PREFIX"egl
# some systems have EGL libs, but no pkgconfig # some systems have EGL libs, but no pkgconfig
if [ "$HAVE_EGL" = "no" ]; then if [ "$HAVE_EGL" = "no" ]; then
HAVE_EGL=auto; check_lib '' EGL "-l${VC_PREFIX}EGL $EXTRA_GL_LIBS" HAVE_EGL=auto
if [ "$HAVE_EGL" = "yes" ]; then check_lib '' EGL "-l${VC_PREFIX}EGL $EXTRA_GL_LIBS"
EGL_LIBS="-l${VC_PREFIX}EGL $EXTRA_GL_LIBS"
fi
else else
EGL_LIBS="$EGL_LIBS $EXTRA_GL_LIBS" EGL_LIBS="$EGL_LIBS $EXTRA_GL_LIBS"
fi fi
@ -304,15 +302,12 @@ if [ "$HAVE_OPENGL" != 'no' ] && [ "$HAVE_OPENGLES" != 'yes' ]; then
if [ "$HAVE_OPENGL" = 'yes' ]; then if [ "$HAVE_OPENGL" = 'yes' ]; then
if [ "$OS" = 'Darwin' ]; then if [ "$OS" = 'Darwin' ]; then
check_lib '' CG "-framework Cg" cgCreateContext check_lib '' CG '-framework Cg' cgCreateContext
[ "$HAVE_CG" = 'yes' ] && CG_LIBS='-framework Cg'
elif [ "$OS" = 'Win32' ]; then elif [ "$OS" = 'Win32' ]; then
check_lib cxx CG -lcg cgCreateContext check_lib cxx CG '-lcg -lcgGL' cgCreateContext
[ "$HAVE_CG" = 'yes' ] && CG_LIBS='-lcg -lcgGL'
else else
# On some distros, -lCg doesn't link against -lstdc++ it seems ... # On some distros, -lCg doesn't link against -lstdc++ it seems ...
check_lib cxx CG -lCg cgCreateContext check_lib cxx CG '-lCg -lCgGL' cgCreateContext
[ "$HAVE_CG" = 'yes' ] && CG_LIBS='-lCg -lCgGL'
fi fi
check_pkgconf OSMESA osmesa check_pkgconf OSMESA osmesa
@ -403,10 +398,8 @@ check_pkgconf X11 x11
check_pkgconf XCB xcb check_pkgconf XCB xcb
if [ "$HAVE_X11" = "no" ] && [ "$OS" != 'Darwin' ]; then if [ "$HAVE_X11" = "no" ] && [ "$OS" != 'Darwin' ]; then
HAVE_X11=auto; check_lib '' X11 -lX11 HAVE_X11=auto
if [ "$HAVE_X11" = "yes" ]; then check_lib '' X11 -lX11
X11_LIBS="-lX11"
fi
fi fi
check_pkgconf WAYLAND wayland-egl check_pkgconf WAYLAND wayland-egl
@ -419,17 +412,13 @@ check_pkgconf XF86VM xxf86vm
if [ "$HAVE_X11" != "no" ]; then if [ "$HAVE_X11" != "no" ]; then
if [ "$HAVE_XEXT" = "no" ]; then if [ "$HAVE_XEXT" = "no" ]; then
HAVE_XEXT=auto; check_lib '' XEXT -lXext HAVE_XEXT=auto
if [ "$HAVE_XEXT" = "yes" ]; then check_lib '' XEXT -lXext
XEXT_LIBS="-lXext"
fi
fi fi
if [ "$HAVE_XF86VM" = "no" ]; then if [ "$HAVE_XF86VM" = "no" ]; then
HAVE_XF86VM=auto; check_lib '' XF86VM -lXxf86vm HAVE_XF86VM=auto
if [ "$HAVE_XF86VM" = "yes" ]; then check_lib '' XF86VM -lXxf86vm
XF86VM_LIBS="-lXxf86vm"
fi
fi fi
else else
HAVE_XEXT=no; HAVE_XF86VM=no; HAVE_XINERAMA=no; HAVE_XSHM=no HAVE_XEXT=no; HAVE_XF86VM=no; HAVE_XINERAMA=no; HAVE_XSHM=no
@ -447,10 +436,8 @@ fi
if [ "$HAVE_UDEV" != "no" ]; then if [ "$HAVE_UDEV" != "no" ]; then
check_pkgconf UDEV libudev check_pkgconf UDEV libudev
if [ "$HAVE_UDEV" = "no" ]; then if [ "$HAVE_UDEV" = "no" ]; then
HAVE_UDEV=auto; check_lib '' UDEV "-ludev" HAVE_UDEV=auto
if [ "$HAVE_UDEV" = "yes" ]; then check_lib '' UDEV "-ludev"
UDEV_LIBS='-ludev'
fi
fi fi
fi fi

View File

@ -64,6 +64,7 @@ check_lib() # $1 = language $2 = HAVE_$2 $3 = lib $4 = function in lib $5 =
die 1 "Forced to build with library $3, but cannot locate. Exiting ..." die 1 "Forced to build with library $3, but cannot locate. Exiting ..."
} }
else else
eval "${2}_LIBS=\"$3\""
PKG_CONF_USED="$PKG_CONF_USED $2" PKG_CONF_USED="$PKG_CONF_USED $2"
fi fi