Re: [AD] Cross compiling 3.9.31

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


Last night I wrote:
>Now this probably wants melding into makefile.dj [...].  I'll try and
>sort this all out in the next week or so.

Turned out to be easier than I expected.  Here's the revised build
instructions and patch.  Note that NATIVEPATH is needed so that the
makefile can find a non-cross gcc to build makedoc with.  A slightly
odd approach, but it reduces the changes needed to the makefiles.  BTW
I'd suggest that `makefile' in the tar file shouldn't have CRs in.

 tar zxvf allegro-3.9.31.tar.gz
 cd allegro-3.9.31
 perl -p -i -e 's/\r//' makefile
 patch < allegro-cross.patch
 export DJDIR=/usr/local/i386-pc-msdosdjgpp
 NATIVEPATH=$PATH PATH=$DJDIR/bin:$PATH CROSSCOMPILE=1 make
 su
 [enter root password]
 NATIVEPATH=$PATH PATH=$DJDIR/bin:$PATH CROSSCOMPILE=1 make install

And allegro-cross.patch is attached below.

Cheers,
Olly

==

diff -rub allegro-3.9.31-orig/makefile.all allegro-3.9.31/makefile.all
--- allegro-3.9.31-orig/makefile.all	Sun Jan 30 21:46:54 2000
+++ allegro-3.9.31/makefile.all	Thu Feb 24 11:59:28 2000
@@ -164,7 +164,21 @@
 
 # -------- rules for converting the documentation --------
 
+ifndef CROSSCOMPILE
+
 MAKEDOC = docs/makedoc$(EXE)
+
+else
+
+MAKEDOC = docs/makedoc
+
+docs/makedoc: docs/makedoc-linux.o
+	PATH=$(NATIVEPATH) gcc -o $@ $<
+
+docs/makedoc-linux.o: docs/makedoc.c
+	PATH=$(NATIVEPATH) gcc -O2 -c -o $@ $<
+
+endif
 
 ifdef HTML
 
diff -rub allegro-3.9.31-orig/makefile.dj allegro-3.9.31/makefile.dj
--- allegro-3.9.31-orig/makefile.dj	Sun Jan 30 21:46:54 2000
+++ allegro-3.9.31/makefile.dj	Thu Feb 24 12:05:45 2000
@@ -48,7 +48,7 @@
 
 ifndef DJDIR
 baddjgpp:
-	@echo Your DJGPP environment variable is not set correctly! It should
+	@echo Your DJDIR environment variable is not set correctly! It should
 	@echo point to the djgpp.env file: see the djgpp readme.1st for details.
 endif
 
@@ -295,7 +295,7 @@
 	echo .text > obj/djgpp/mmxtest.s
 	echo emms >> obj/djgpp/mmxtest.s
 	gcc -c obj/djgpp/mmxtest.s -o obj/djgpp/mmxtest.o
-	echo #define ALLEGRO_MMX > obj/djgpp/mmx.h
+	echo '#define ALLEGRO_MMX' > obj/djgpp/mmx.h
 else
 	echo // no MMX > obj\djgpp\mmx.h
 	echo .text > obj\djgpp\mmxtest.s
@@ -349,6 +349,8 @@
 */%.exe: $(OBJ_DIR)/%.o $(LIB_NAME)
 	gcc $(LFLAGS) -o $@ $< $(LIB_NAME)
 
+ifndef CROSSCOMPILE
+
 obj/djgpp/asmdef.inc: obj/djgpp/asmdef.exe
 	obj/djgpp/asmdef.exe obj/djgpp/asmdef.inc
 
@@ -363,6 +365,16 @@
 
 setup/setup.exe: $(OBJ_DIR)/setup.o obj/djgpp/setupdat.o $(LIB_NAME)
 	gcc $(LFLAGS) -o setup/setup.exe $(OBJ_DIR)/setup.o obj/djgpp/setupdat.o $(LIB_NAME)
+
+else
+
+obj/djgpp/asmdef.inc:
+	touch -c obj/djgpp/asmdef.inc
+
+setup/setup.exe:
+	# do nothing
+
+endif
 
 PLUGIN_LIB = lib/djgpp/lib$(VERY_SHORT_VERSION)dat.a
 PLUGINS_H = obj/djgpp/plugins.h



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/