On Fri, Apr 04, 2014 at 10:25:29AM +0100, Pedro Alvarez wrote:
This is possible adding a script "morph-arch-config" which
decides the configuration depending on the architecture.
---
mesa-wayland.morph | 2 +-
mesa-x.morph | 2 +-
morph-arch-config | 10 ++++++++++
3 files changed, 12 insertions(+), 2 deletions(-)
create mode 100644 morph-arch-config
diff --git a/mesa-wayland.morph b/mesa-wayland.morph
index 545e4b1..e4f46d3 100644
--- a/mesa-wayland.morph
+++ b/mesa-wayland.morph
@@ -3,6 +3,6 @@
"kind": "chunk",
"build-system": "autotools",
"configure-commands": [
- "./autogen.sh --prefix=\"$PREFIX\" --enable-gles2
--disable-gallium-egl --with-egl-platforms=wayland,drm --enable-gbm --enable-shared-glapi
--with-gallium-drivers=swrast --with-dri-drivers=intel,i915,i965,swrast"
+ "./autogen.sh --prefix=\"$PREFIX\" --enable-gles2
--disable-gallium-egl --with-egl-platforms=wayland,drm --enable-gbm --enable-shared-glapi
--with-gallium-drivers=swrast $(./morph-arch-config)"
]
}
diff --git a/mesa-x.morph b/mesa-x.morph
index 7dc5763..6346577 100644
--- a/mesa-x.morph
+++ b/mesa-x.morph
@@ -3,6 +3,6 @@
"kind": "chunk",
"build-system": "autotools",
"configure-commands": [
- "./autogen.sh --prefix=\"$PREFIX\" --enable-gles2
--disable-gallium-egl --with-egl-platforms=x11,drm --enable-gbm --enable-shared-glapi
--with-gallium-drivers=swrast --with-dri-drivers=intel,i915,i965,swrast"
+ "./autogen.sh --prefix=\"$PREFIX\" --enable-gles2
--disable-gallium-egl --with-egl-platforms=x11,drm --enable-gbm --enable-shared-glapi
--with-gallium-drivers=swrast $(./morph-arch-config)"
]
}
diff --git a/morph-arch-config b/morph-arch-config
new file mode 100644
Are you sure this works? It doesn't appear to have the executable bit set.
index 0000000..d8e60ac
--- /dev/null
+++ b/morph-arch-config
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+# morph-arch-config: ouput MESA-specific configuration for specific
+# Morph architectures
+
+# Morph's armv7* architecture is always armv7-a
+case "$MORPH_ARCH" in
+ armv7*) echo "--with-dri-drivers=swrast" ;;
+ x86*) echo "--with-dri-drivers=intel,i915,i965,swrast" ;;
+esac
I like the deduplication of strata possible by doing this, I'm just a
little concerned about adding new files to the repository, since we're
aiming to reduce our number of branches by moving the morphologies into
the definitions repository, and adding a script means we would still
need to keep the branch around.
While I would normally applaud reducing redundancy like this, I think
in this case it would be more useful to convert the morphology to yaml,
and work out the arch-config flags before running the command, putting
the result in a handy variable, then running the autogen command and
interpolating it in.