From: Marc Kleine-Budder <mkl@pengutronix.de>

This patch fixes the problem, that "mkg3states" is execute
to generate a header. But this program is compiled to run
on "host" not on "build".

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>

---

diff -ruN lbxutil-orig/configure.ac lbxutil/configure.ac
--- lbxutil-orig/configure.ac	2006-01-19 13:17:16.000000000 +0100
+++ lbxutil/configure.ac	2006-01-19 13:17:49.000000000 +0100
@@ -60,4 +60,5 @@
 
 AC_OUTPUT([Makefile
 	   src/Makefile
+	   src/image/Makefile
 	   lbxutil.pc])
diff -ruN lbxutil-orig/src/Makefile.am lbxutil/src/Makefile.am
--- lbxutil-orig/src/Makefile.am	2006-01-19 13:17:16.000000000 +0100
+++ lbxutil/src/Makefile.am	2006-01-19 13:17:49.000000000 +0100
@@ -1,9 +1,6 @@
-lib_LTLIBRARIES = liblbxutil.la
-
-noinst_PROGRAMS = mkg3states
+SUBDIRS = image
 
-mkg3states_SOURCES =				\
-	$(srcdir)/image/mkg3states.c
+lib_LTLIBRARIES = liblbxutil.la
 
 liblbxutil_la_SOURCES =				\
 	$(srcdir)/lbx_zlib/reqstats.h		\
@@ -28,9 +25,9 @@
 
 $(srcdir)/image/dfaxg42d.c: g3states.h
 
-g3states.h: mkg3states
+g3states.h: image/mkg3states
 	-rm -f g3states.h
-	./mkg3states -c > g3states.h_ && mv g3states.h_ g3states.h
+	./image/mkg3states -c > g3states.h_ && mv g3states.h_ g3states.h
 
 liblbxutil_la_LDFLAGS = -version-number 1:0:0
 
diff -ruN lbxutil-orig/src/image/Makefile.am lbxutil/src/image/Makefile.am
--- lbxutil-orig/src/image/Makefile.am	1970-01-01 01:00:00.000000000 +0100
+++ lbxutil/src/image/Makefile.am	2006-01-19 13:17:49.000000000 +0100
@@ -0,0 +1,15 @@
+# evil hack
+CFLAGS=$(CFLAGS_FOR_BUILD)
+CPPFLAGS=$(CPPFLAGS_FOR_BUILD)
+LDFLAGS=$(LDFLAGS_FOR_BUILD)
+
+CC=$(CC_FOR_BUILD)
+LIBTOOL = @LIBTOOL@ --tag=CC
+
+noinst_PROGRAMS = mkg3states
+
+mkg3states_SOURCES =				\
+	mkg3states.c
+
+mkg3states_CFLAGS=$(CFLAGS_FOR_BUILD)
+mkg3states_LDFLAGS=$(LDFLAGS_FOR_BUILD)
