[AD] DJGPP build patch

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


Hi,

I have recently changed my system configuration quite drastically, and
somewhere along the line all the DOS-style tools have stopped working
under Bash (not that this is a bad thing...); however, it does mean that
Allegro does not build or install.

I have attached a patch which simply grabs the functionality it needs
from the already existing CROSSCOMPILE system, which already uses UNIX-
style tools to compile Allegro. A few changed checks in the Makefile are
all it takes.

Also, I cleared up a few comments/added a few lines in the
documentation, etc.

diff -ru old/makefile.dj new/makefile.dj
--- old/makefile.dj	Sun Sep  3 14:35:42 2000
+++ new/makefile.dj	Fri Jan 19 19:47:22 2001
@@ -15,6 +15,9 @@
 LIB_NAME = lib/djgpp/lib$(VERSION).a
 EXE = .exe
 OBJ = .o
+ifdef CROSSCOMPILE
+UNIX_TOOLS := 1
+endif
 
 
 
@@ -64,7 +67,7 @@
 
 ifeq ($(wildcard $(DJDIR_U)/bin/djasm.exe),)
 baddjdev:
-	@echo Missing djgpp package! You need to install djdev202.zip (or whatever the
+	@echo Missing djgpp package! You need to install djdev203.zip (or whatever the
 	@echo latest version is). Download this from wherever you got djgpp, and unzip
 	@echo it into the root of your djgpp directory.
 endif
@@ -75,7 +78,7 @@
 
 ifeq ($(wildcard $(DJDIR_U)/bin/gcc.exe),)
 badgcc:
-	@echo Missing djgpp package! You need to install gcc281b.zip (or whatever the
+	@echo Missing djgpp package! You need to install gcc2952b.zip (or whatever the
 	@echo latest version is). Download this from wherever you got djgpp, and unzip
 	@echo it into the root of your djgpp directory.
 endif
@@ -86,7 +89,7 @@
 
 ifeq ($(wildcard $(DJDIR_U)/bin/ld.exe),)
 badbnu:
-	@echo Missing djgpp package! You need to install bnu281b.zip (or whatever the
+	@echo Missing djgpp package! You need to install bnu210b.zip (or whatever the
 	@echo latest version is). Download this from wherever you got djgpp, and unzip
 	@echo it into the root of your djgpp directory.
 endif
@@ -97,7 +100,7 @@
 
 ifeq ($(wildcard $(DJDIR_U)/bin/make.exe),)
 badmake:
-	@echo Missing djgpp package! You need to install mak377b.zip (or whatever the
+	@echo Missing djgpp package! You need to install mak3791b.zip (or whatever the
 	@echo latest version is). Download this from wherever you got djgpp, and unzip
 	@echo it into the root of your djgpp directory.
 endif
@@ -108,7 +111,7 @@
 
 ifeq ($(wildcard $(DJDIR_U)/bin/makeinfo.exe),)
 badtxi:
-	@echo Missing djgpp package! You need to install txi312b.zip (or whatever the
+	@echo Missing djgpp package! You need to install txi40b.zip (or whatever the
 	@echo latest version is). Download this from wherever you got djgpp, and unzip
 	@echo it into the root of your djgpp directory. If you do not need the Info
 	@echo documentation, run make all to ignore this error.
@@ -149,19 +152,21 @@
 
 # -------- decide what compiler options to use --------
 
+WFLAGS := -Wall -Wno-unused
 ifdef WARNMODE
-WFLAGS = -Wall -W -Werror -Wno-unused
-else
-WFLAGS = -Wall -Wno-unused
+WFLAGS := -Wall -W -Werror -Wno-unused
 endif
 
+OFLAGS := -mpentium -O2 -funroll-loops -ffast-math
+
 ifdef PGCC
-OFLAGS = -mpentium -O6 -ffast-math
+OFLAGS := -mpentium -O6 -ffast-math
 else
 ifdef PENTIUMONLY
-OFLAGS = -march=pentium -O2 -funroll-loops -ffast-math
-else
-OFLAGS = -mpentium -O2 -funroll-loops -ffast-math
+OFLAGS := -march=pentium -O2 -funroll-loops -ffast-math
+endif
+ifdef I686ONLY
+OFLAGS := -march=i686 -O2 -funroll-loops -ffast-math
 endif
 endif
 
@@ -222,7 +227,7 @@
 
 # -------- rules for installing and removing the library files --------
 
-ifdef CROSSCOMPILE
+ifdef UNIX_TOOLS
 
 $(DJDIR_U)/lib/lib$(VERSION).a: $(LIB_NAME)
 	cp lib/djgpp/lib$(VERSION).a $(DJDIR_U)/lib
@@ -280,7 +285,7 @@
 uninstall:
 	-install-info --delete $(DJDIR_U)/info/allegro.$(INFO) $(DJDIR_U)/info/dir
 	-rm -fv $(UNINSTALL_FILES)
-ifdef CROSSCOMPILE
+ifdef UNIX_TOOLS
 	-rmdir $(DJDIR_U)/include/allegro
 else
 	-rd $(DJDIR_D)\include\allegro
@@ -294,7 +299,7 @@
 .PHONY: mmxtest
 
 mmxtest:
-ifdef CROSSCOMPILE
+ifdef UNIX_TOOLS
 	echo // no MMX > obj/djgpp/mmx.h
 	echo .text > obj/djgpp/mmxtest.s
 	echo emms >> obj/djgpp/mmxtest.s
@@ -389,7 +394,7 @@
 PLUGIN_DEPS = $(LIB_NAME) $(PLUGIN_LIB)
 PLUGIN_SCR = scr
 
-ifdef CROSSCOMPILE
+ifdef UNIX_TOOLS
 
 define GENERATE_PLUGINS_H
 cat tools/plugins/*.inc > obj/djgpp/plugins.h
diff -ru old/readme.dj new/readme.dj
--- old/readme.dj	Sat Jul  1 01:26:34 2000
+++ new/readme.dj	Fri Jan 19 20:00:26 2001
@@ -55,7 +55,8 @@
    prefer), and unzip everything. Allegro contains several subdirectories, 
    so you must specify the -d flag if you are using pkunzip.
 
-   If you are using PGCC, set the environment variable "PGCC=1".
+   If you are using PGCC, set the environment variable "PGCC=1", or
+   type "make PGCC=1" on the command line.
 
    If you are running under Linux, and want to cross-compile the djgpp 
    version of Allegro, set the environment variable "CROSSCOMPILE=1", set 
@@ -93,13 +94,34 @@
    files and HTML format documentation).
 
    If your copy of Allegro is set up for use with some different compiler 
-   (unlikely, if you downloaded the djgpp distribution), you will have to 
+   (if you downloaded a tar.gz archive or a CVS version), you will have to 
    run fixdjgpp.bat before compiling it.
 
    If your copy of Allegro doesn't include the makefile.dep dependency files 
-   (unlikely, unless you have run "make veryclean" at some point), you can 
+   (if you have run "make veryclean" or you have the CVS version), you can 
    regenerate them by running "make depend".

+   If `make' tells you that you need to download a new package, or if you
+   need the `sed' package to generate dependencies, you can find these at
+     ftp://ftp.demon.co.uk/pub/mirrors/simtelnet/gnu/djgpp/
+ 
+   Some further options you might like to consider are:
+    WARNMODE
+                Set this if you want Allegro to display and stop on
+                nearly all warnings issued by the compiler. Allegro
+                should compile fine with this set.
+
+    PENTIUMONLY
+    I686ONLY
+                These affect the level of optimisation that Allegro
+                uses. Please note that if you compile with either of
+                these options, your executables will not be portable to
+                an earlier processor architecture. Simply set to 1 to
+                activate.
+
+    UNIX_TOOLS
+                If your system does not have the usual DOS tools
+                available (`md', `rd', `copy', etc., and commands which
+                understand the \ character), then set this to 1 to use
+                the unix equivalents. This is set implicitly when you
+                set CROSSCOMPILE.
+
 
 

Bye for now,
-- 
Laurence Withers, lwithers@xxxxxxxxxx
                http://www.lwithers.demon.co.uk/

Attachment: signature.asc
Description: PGP signature



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