Re: [Mesa-dev] [PATCH] gallium: Fix automake for Android
On Thu, Jun 28, 2018 at 4:50 AM Chad Versace wrote: > > > Chromium OS uses Autotools and pkg-config when building Mesa for > Android. The gallium drivers were failing to find the headers and > libraries for zlib and Android's libbacktrace. > > v2: > - Don't add a check for zlib.pc. configure.ac already checks for > zlib.pc elsewhere. [for tfiga] > - Check for backtrace.pc separately from the other Android libs. > [for tfiga] > --- > > Tomasz, I added the suggestions that worked. I tried moving > $(ANDROID_LIBS) and $(BACKTRACE_LIBS) to the hunk in > src/gallium/auxiliary/Makefile.am, but the build no longer worked. > libEGL failed to link. Fair enough. Thanks. Reviewed-by: Tomasz Figa Best regards, Tomasz ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH] gallium: Fix automake for Android
Chromium OS uses Autotools and pkg-config when building Mesa for Android. The gallium drivers were failing to find the headers and libraries for zlib and Android's libbacktrace. v2: - Don't add a check for zlib.pc. configure.ac already checks for zlib.pc elsewhere. [for tfiga] - Check for backtrace.pc separately from the other Android libs. [for tfiga] --- Tomasz, I added the suggestions that worked. I tried moving $(ANDROID_LIBS) and $(BACKTRACE_LIBS) to the hunk in src/gallium/auxiliary/Makefile.am, but the build no longer worked. libEGL failed to link. configure.ac | 3 +++ src/gallium/Automake.inc | 6 ++ src/gallium/auxiliary/Makefile.am | 4 3 files changed, 13 insertions(+) diff --git a/configure.ac b/configure.ac index 7a0e4754208..acdb7f1adb4 100644 --- a/configure.ac +++ b/configure.ac @@ -1831,6 +1831,9 @@ for plat in $platforms; do android) PKG_CHECK_MODULES([ANDROID], [cutils hardware sync]) +if test -n "$with_gallium_drivers"; then +PKG_CHECK_MODULES([BACKTRACE], [backtrace]) +fi DEFINES="$DEFINES -DHAVE_ANDROID_PLATFORM" ;; diff --git a/src/gallium/Automake.inc b/src/gallium/Automake.inc index 3e21aa71b5c..329c8839e17 100644 --- a/src/gallium/Automake.inc +++ b/src/gallium/Automake.inc @@ -59,6 +59,12 @@ GALLIUM_COMMON_LIB_DEPS += \ $(LIBDRM_LIBS) endif +if HAVE_PLATFORM_ANDROID +GALLIUM_COMMON_LIB_DEPS += \ + $(ANDROID_LIBS) \ + $(BACKTRACE_LIBS) +endif + GALLIUM_WINSYS_CFLAGS = \ -I$(top_srcdir)/src \ -I$(top_srcdir)/include \ diff --git a/src/gallium/auxiliary/Makefile.am b/src/gallium/auxiliary/Makefile.am index 6b048b8eebf..03908198772 100644 --- a/src/gallium/auxiliary/Makefile.am +++ b/src/gallium/auxiliary/Makefile.am @@ -21,6 +21,10 @@ libgallium_la_SOURCES = \ $(NIR_SOURCES) \ $(GENERATED_SOURCES) +if HAVE_PLATFORM_ANDROID +libgallium_la_SOURCES += util/u_debug_stack_android.cpp +endif + if HAVE_LIBDRM AM_CFLAGS += \ -- 2.17.0.775.ge144d126d7 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH] gallium: Fix automake for Android
Hello gents, On 19 June 2018 at 14:34, Tomasz Figa wrote: >> --- a/src/gallium/auxiliary/Makefile.am >> +++ b/src/gallium/auxiliary/Makefile.am >> @@ -21,6 +21,10 @@ libgallium_la_SOURCES = \ >> $(NIR_SOURCES) \ >> $(GENERATED_SOURCES) >> >> +if HAVE_PLATFORM_ANDROID >> +libgallium_la_SOURCES += util/u_debug_stack_android.cpp > > Shouldn't we add ANDROID_CFLAGS and ANDROID_LIBS here rather than in > src/gallium/Automake.inc, since this is the module that actually needs > them? > Tl;Dr: Either one will work. Longer version: Your suggestion makes the current relation more obvious, although Chad's approach is more robust in the long run. Think: other parts of mesa using the $new_module or $new_module being a static library. In the latter case you'll end up with multiple conflicting declarations in the final link. I doubt these cases are applicable here, so either approach will be fine ;-) With Tomasz' suggestions, the patch is Reviewed-by: Emil Velikov -Emil ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH] gallium: Fix automake for Android
Hi Chad, On Tue, Jun 19, 2018 at 3:46 PM Chad Versace wrote: > > Chromium OS uses Autotools and pkg-config when building Mesa for > Android. The gallium drivers were failing to find the headers and > libraries for zlib and Android's libbacktrace. > --- > configure.ac | 6 +- > src/gallium/Automake.inc | 5 + > src/gallium/auxiliary/Makefile.am | 4 > 3 files changed, 14 insertions(+), 1 deletion(-) > Please see my comments inline. > diff --git a/configure.ac b/configure.ac > index 7a0e4754208..5f0792cd8ef 100644 > --- a/configure.ac > +++ b/configure.ac > @@ -1830,7 +1830,11 @@ for plat in $platforms; do > ;; > > android) > -PKG_CHECK_MODULES([ANDROID], [cutils hardware sync]) > +android_modules='cutils hardware sync zlib' What's Android-specific in zlib? We already check higher for zlib, shouldn't we just add ZLIB_CFLAGS/LIBS to the respective Makefile.in? > +if test -n "$with_gallium_drivers"; then > +android_modules+=' backtrace' I'd also say this should have a separate PKG_CHECK_MODULES clause, say "BACKTRACE" and BACKTRACE_CFLAGS/LIBS added to respective Makefile.in. Especially since we only need libbacktrace in u_debug_stack*. > +fi > +PKG_CHECK_MODULES([ANDROID], ["$android_modules"]) > DEFINES="$DEFINES -DHAVE_ANDROID_PLATFORM" > ;; > > diff --git a/src/gallium/Automake.inc b/src/gallium/Automake.inc > index 3e21aa71b5c..8181927a396 100644 > --- a/src/gallium/Automake.inc > +++ b/src/gallium/Automake.inc > @@ -59,6 +59,11 @@ GALLIUM_COMMON_LIB_DEPS += \ > $(LIBDRM_LIBS) > endif > > +if HAVE_PLATFORM_ANDROID > +GALLIUM_COMMON_LIB_DEPS += \ > + $(ANDROID_LIBS) > +endif > + > GALLIUM_WINSYS_CFLAGS = \ > -I$(top_srcdir)/src \ > -I$(top_srcdir)/include \ > diff --git a/src/gallium/auxiliary/Makefile.am > b/src/gallium/auxiliary/Makefile.am > index 6b048b8eebf..03908198772 100644 > --- a/src/gallium/auxiliary/Makefile.am > +++ b/src/gallium/auxiliary/Makefile.am > @@ -21,6 +21,10 @@ libgallium_la_SOURCES = \ > $(NIR_SOURCES) \ > $(GENERATED_SOURCES) > > +if HAVE_PLATFORM_ANDROID > +libgallium_la_SOURCES += util/u_debug_stack_android.cpp Shouldn't we add ANDROID_CFLAGS and ANDROID_LIBS here rather than in src/gallium/Automake.inc, since this is the module that actually needs them? Best regards, Tomasz ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH] gallium: Fix automake for Android
Chromium OS uses Autotools and pkg-config when building Mesa for Android. The gallium drivers were failing to find the headers and libraries for zlib and Android's libbacktrace. --- configure.ac | 6 +- src/gallium/Automake.inc | 5 + src/gallium/auxiliary/Makefile.am | 4 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 7a0e4754208..5f0792cd8ef 100644 --- a/configure.ac +++ b/configure.ac @@ -1830,7 +1830,11 @@ for plat in $platforms; do ;; android) -PKG_CHECK_MODULES([ANDROID], [cutils hardware sync]) +android_modules='cutils hardware sync zlib' +if test -n "$with_gallium_drivers"; then +android_modules+=' backtrace' +fi +PKG_CHECK_MODULES([ANDROID], ["$android_modules"]) DEFINES="$DEFINES -DHAVE_ANDROID_PLATFORM" ;; diff --git a/src/gallium/Automake.inc b/src/gallium/Automake.inc index 3e21aa71b5c..8181927a396 100644 --- a/src/gallium/Automake.inc +++ b/src/gallium/Automake.inc @@ -59,6 +59,11 @@ GALLIUM_COMMON_LIB_DEPS += \ $(LIBDRM_LIBS) endif +if HAVE_PLATFORM_ANDROID +GALLIUM_COMMON_LIB_DEPS += \ + $(ANDROID_LIBS) +endif + GALLIUM_WINSYS_CFLAGS = \ -I$(top_srcdir)/src \ -I$(top_srcdir)/include \ diff --git a/src/gallium/auxiliary/Makefile.am b/src/gallium/auxiliary/Makefile.am index 6b048b8eebf..03908198772 100644 --- a/src/gallium/auxiliary/Makefile.am +++ b/src/gallium/auxiliary/Makefile.am @@ -21,6 +21,10 @@ libgallium_la_SOURCES = \ $(NIR_SOURCES) \ $(GENERATED_SOURCES) +if HAVE_PLATFORM_ANDROID +libgallium_la_SOURCES += util/u_debug_stack_android.cpp +endif + if HAVE_LIBDRM AM_CFLAGS += \ -- 2.17.0.775.ge144d126d7 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev