[virglrenderer-devel] [PATCH 4/4] configure: check for -lgbm
Marc-André Lureau
marcandre.lureau at gmail.com
Thu Feb 11 12:56:29 UTC 2016
Hi
On Thu, Feb 11, 2016 at 1:51 PM, Michal Privoznik <mprivozn at redhat.com> wrote:
> We use the library unconditionally, however not check it in
> configure phase. Let's produce an error there and not at
> compilation phase.
> Signed-off-by: Michal Privoznik <mprivozn at redhat.com>
> ---
> configure.ac | 7 +++++++
> src/Makefile.am | 3 ++-
> 2 files changed, 9 insertions(+), 1 deletion(-)
>
> diff --git a/configure.ac b/configure.ac
> index 53d9ef4..98d33b1 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -86,6 +86,13 @@ LIBDRM_REQUIRED=2.4.50
>
> PKG_CHECK_MODULES([LIBDRM], [libdrm >= $LIBDRM_REQUIRED])
> PKG_CHECK_MODULES([EPOXY], [epoxy])
> +save_LIBS="$LIBS"
> +save_CFLAGS="$CFLAGS"
> +AC_CHECK_LIB([gbm], [gbm_create_device], [], [AC_MSG_ERROR([gbm library is required for the build])])
> +GBM_LIBS="-lgbm"
> +LIBS="$save_LIBS"
> +CFLAGS="$save_CFLAGS"
> +AC_SUBST([GBM_LIBS])
Why not use pkg-config check for that?
>
> AC_SUBST([DEFINES])
> AC_CONFIG_FILES([
> diff --git a/src/Makefile.am b/src/Makefile.am
> index 8f6538a..b87e221 100644
> --- a/src/Makefile.am
> +++ b/src/Makefile.am
> @@ -1,5 +1,6 @@
> SUBDIRS := gallium/auxiliary
> -AM_LDFLAGS = -lgbm -lm -ldl \
> +AM_LDFLAGS = -lm -ldl \
> + $(GBM_LIBS) \
> $(EPOXY_LIBS) \
> $(CODE_COVERAGE_LDFLAGS)
>
> --
> 2.4.10
>
> _______________________________________________
> virglrenderer-devel mailing list
> virglrenderer-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/virglrenderer-devel
--
Marc-André Lureau
More information about the virglrenderer-devel
mailing list