Skip to contentSkip to conversation

build: Make autoreconf honour ACLOCAL_FLAGS

PATCH In review Damien Lespiau 2 participants 4 messages Jan 18, 2013 – Feb 4, 2013 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/3 build: Make autoreconf honour ACLOCAL_FLAGS

When running autoreconf, it's possible to give flags to the underlying aclocal by declaring a ACLOCAL_AMFLAGS variable in the top level Makefile.am.

Putting ${ACLOCAL_FLAGS} there allows the user to set an environment variable up before running autogen.sh and pull in the right directories to look for m4 macros, say an up-to-date version of the xorg-util macros.

---
 Makefile.am |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
Makefile.am +1 -0
index b3d37b2..5001674 100644
@@ -18,6 +18,7 @@
 #  IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
 #  CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
+ACLOCAL_AMFLAGS = ${ACLOCAL_FLAGS}
 
 SUBDIRS = man
 
Signature · 1 line
1.7.7.5
#1 lore raw

PATCH 2/3 build: Use $(AM_V_GEN) to silence the assembly of gen programs

---
 src/render_program/Makefile.am  |    8 ++++----
 src/xvmc/shader/mc/Makefile.am  |    2 +-
 src/xvmc/shader/vld/Makefile.am |    2 +-
 3 files changed, 6 insertions(+), 6 deletions(-)
src/render_program/Makefile.am +4 -4
index 8b82b2e..734e7da 100644
@@ -191,16 +191,16 @@ if HAVE_GEN4ASM
 
 SUFFIXES = .g4a .g4b .g5a .g5b .g6a .g6b .g7a .g7b
 .g4a.g4b:
-	m4 -I$(srcdir) -s $< > $*.g4m && @INTEL_GEN4ASM@ -o $@ $*.g4m && @INTEL_GEN4ASM@ -g 5 -o [email protected] $*.g4m && rm $*.g4m
+	$(AM_V_GEN)m4 -I$(srcdir) -s $< > $*.g4m && @INTEL_GEN4ASM@ -o $@ $*.g4m && @INTEL_GEN4ASM@ -g 5 -o [email protected] $*.g4m && rm $*.g4m
 
 .g5a.g5b:
-	m4 -I$(srcdir) -s $< > $*.g5m && @INTEL_GEN4ASM@ -g 5 -o $@ $*.g5m && rm $*.g5m
+	$(AM_V_GEN)m4 -I$(srcdir) -s $< > $*.g5m && @INTEL_GEN4ASM@ -g 5 -o $@ $*.g5m && rm $*.g5m
 
 .g6a.g6b:
-	m4 -I$(srcdir) -s $< > $*.g6m && @INTEL_GEN4ASM@ -g 6 -o $@ $*.g6m && rm $*.g6m
+	$(AM_V_GEN)m4 -I$(srcdir) -s $< > $*.g6m && @INTEL_GEN4ASM@ -g 6 -o $@ $*.g6m && rm $*.g6m
 
 .g7a.g7b:
-	m4 -I$(srcdir) -s $< > $*.g7m && @INTEL_GEN4ASM@ -g 7 -o $@ $*.g7m && rm $*.g7m
+	$(AM_V_GEN)m4 -I$(srcdir) -s $< > $*.g7m && @INTEL_GEN4ASM@ -g 7 -o $@ $*.g7m && rm $*.g7m
 
 $(INTEL_G4B): $(INTEL_G4I)
 $(INTEL_G5B): $(INTEL_G4I)
src/xvmc/shader/mc/Makefile.am +1 -1
index c1bff77..b29fa78 100644
@@ -109,7 +109,7 @@ if HAVE_GEN4ASM
 
 SUFFIXES = .g4a .g4b
 .g4a.g4b:
-	m4 -I$(srcdir) $(srcdir)/$*.g4a > $*.g4m && @INTEL_GEN4ASM@ -o $@ $*.g4m && @INTEL_GEN4ASM@ -g 5 -o [email protected] $*.g4m && rm $*.g4m
+	$(AM_V_GEN)m4 -I$(srcdir) $(srcdir)/$*.g4a > $*.g4m && @INTEL_GEN4ASM@ -o $@ $*.g4m && @INTEL_GEN4ASM@ -g 5 -o [email protected] $*.g4m && rm $*.g4m
 
 $(INTEL_G4B): $(INTEL_G4I)
 
src/xvmc/shader/vld/Makefile.am +1 -1
index 9280f15..fcae087 100644
@@ -62,7 +62,7 @@ if HAVE_GEN4ASM
 
 SUFFIXES = .g4a .g4b
 .g4a.g4b:
-	m4 $*.g4a > $*.g4m && @INTEL_GEN4ASM@ -o $@ $*.g4m && @INTEL_GEN4ASM@ -g 5 -o [email protected] $*.g4m && rm $*.g4m
+	$(AM_V_GEN)m4 $*.g4a > $*.g4m && @INTEL_GEN4ASM@ -o $@ $*.g4m && @INTEL_GEN4ASM@ -g 5 -o [email protected] $*.g4m && rm $*.g4m
 
 $(INTEL_G4B): $(INTEL_G4I)
 
Signature · 1 line
1.7.7.5
#2 lore raw

PATCH 3/3 build: Make generation of gen code depend on intel-gen4asm

In reply to Damien Lespiau

This way, when a new intel-gen4asm is available (because one just hacked on it and has installed a new version for instance) the shaders will be recompiled. This helps catching regressions, testing the latest changes in the assembler haven't broken too many things.

---
 src/render_program/Makefile.am  |    8 ++++----
 src/xvmc/shader/mc/Makefile.am  |    2 +-
 src/xvmc/shader/vld/Makefile.am |    2 +-
 3 files changed, 6 insertions(+), 6 deletions(-)
src/render_program/Makefile.am +4 -4
index 734e7da..1298625 100644
@@ -202,10 +202,10 @@ SUFFIXES = .g4a .g4b .g5a .g5b .g6a .g6b .g7a .g7b
 .g7a.g7b:
 	$(AM_V_GEN)m4 -I$(srcdir) -s $< > $*.g7m && @INTEL_GEN4ASM@ -g 7 -o $@ $*.g7m && rm $*.g7m
 
-$(INTEL_G4B): $(INTEL_G4I)
-$(INTEL_G5B): $(INTEL_G4I)
-$(INTEL_G6B): $(INTEL_G4I) $(INTEL_G6I)
-$(INTEL_G7B): $(INTEL_G4I) $(INTEL_G6I)
+$(INTEL_G4B): $(INTEL_GEN4ASM) $(INTEL_G4I)
+$(INTEL_G5B): $(INTEL_GEN4ASM) $(INTEL_G4I)
+$(INTEL_G6B): $(INTEL_GEN4ASM) $(INTEL_G4I) $(INTEL_G6I)
+$(INTEL_G7B): $(INTEL_GEN4ASM) $(INTEL_G4I) $(INTEL_G6I)
 
 BUILT_SOURCES= $(INTEL_G4B) $(INTEL_G5B) $(INTEL_G6B) $(INTEL_G7B)
 
src/xvmc/shader/mc/Makefile.am +1 -1
index b29fa78..8d65769 100644
@@ -111,7 +111,7 @@ SUFFIXES = .g4a .g4b
 .g4a.g4b:
 	$(AM_V_GEN)m4 -I$(srcdir) $(srcdir)/$*.g4a > $*.g4m && @INTEL_GEN4ASM@ -o $@ $*.g4m && @INTEL_GEN4ASM@ -g 5 -o [email protected] $*.g4m && rm $*.g4m
 
-$(INTEL_G4B): $(INTEL_G4I)
+$(INTEL_G4B): $(INTEL_GEN4ASM) $(INTEL_G4I)
 
 BUILT_SOURCES= $(INTEL_G4B)
 
src/xvmc/shader/vld/Makefile.am +1 -1
index fcae087..8f1047e 100644
@@ -64,7 +64,7 @@ SUFFIXES = .g4a .g4b
 .g4a.g4b:
 	$(AM_V_GEN)m4 $*.g4a > $*.g4m && @INTEL_GEN4ASM@ -o $@ $*.g4m && @INTEL_GEN4ASM@ -g 5 -o [email protected] $*.g4m && rm $*.g4m
 
-$(INTEL_G4B): $(INTEL_G4I)
+$(INTEL_G4B): $(INTEL_GEN4ASM) $(INTEL_G4I)
 
 BUILT_SOURCES= $(INTEL_G4B)
 
Signature · 1 line
1.7.7.5
#3 lore raw
In reply to Damien Lespiau
Quoted 9 lines · Damien Lespiau

When running autoreconf, it's possible to give flags to the underlying aclocal by declaring a ACLOCAL_AMFLAGS variable in the top level Makefile.am.

Putting ${ACLOCAL_FLAGS} there allows the user to set an environment variable up before running autogen.sh and pull in the right directories to look for m4 macros, say an up-to-date version of the xorg-util macros.

Thanks for the ping, now pushed.

Had a momentarily doubt about 2/3 as it look like it could trigger spurious rebuilds of the asm, but then remembered that you would have had to ./configure --enable-gen4asm in the first place... -Chris

Signature · 1 line
Chris Wilson, Intel Open Source Technology Centre