Re: [AD] DJGPP build patch

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


Actually, I rewrote the patch. It's better this time. Also on
SourceForge, if you don't want to apply it now (no reason not to, since
it doesn't break anything). Quick summary:

 - added some options to DJGPP build system. Doesn't change any 
   defaults, doesn't affect users unless they explicitly request one
   of the new options.

 - updated version numbers of latest packages :-) and wrote where to
   get them from in readme.dj

 - added fixdjgpp.sh, for those of us running Bash.

 - documented everything in readme.dj.

diff -ruN /home/cvs/allegro/fixdjgpp.sh ./allegro/fixdjgpp.sh
--- /home/cvs/allegro/fixdjgpp.sh	Thu Jan  1 00:00:00 1970
+++ ./allegro/fixdjgpp.sh	Mon Jan 22 19:53:44 2001
@@ -0,0 +1,49 @@
+#!/bin/sh
+#  allegro/fixdjgpp.sh
+#
+#  Bash script to fix up Allegro for DJGPP compilation after downloading
+#  from CVS or whatever.
+#
+
+# First, evaluate if we need to run the `utod' utility.
+
+if ! [ $UNIX_FILES ]
+then
+  utod *.bat .../*.c *.cfg .../*.h .../*.inc
+  utod .../*.s .../*.txt .../*._tx makefile.* readme.*
+fi
+
+# Now, generate makefile.inc
+
+echo "# generated by fixdjgpp.sh" > makefile
+
+# Evaluate any options
+
+if [ $CROSSCOMPILE ]
+then
+  echo "CROSSCOMPILE := 1" >> makefile
+fi
+if [ $WARNMODE ]
+then
+  echo "WARNMODE := 1" >> makefile
+fi
+if [ $PENTIUM_ONLY ]
+then
+  echo "PENTIUM_ONLY := 1" >> makefile
+fi
+if [ $I686_ONLY ]
+then
+  echo "I686_ONLY := 1" >> makefile
+fi
+if [ $UNIX_TOOLS ]
+then
+  echo "UNIX_TOOLS := 1" >> makefile
+fi
+
+# finish makefile.inc
+
+echo "MAKEFILE_INC = makefile.dj" >> makefile
+echo "include makefile.all" >> makefile
+
+# End allegro/fixdjgpp.sh
+
diff -ruN /home/cvs/allegro/makefile.dj ./allegro/makefile.dj
--- /home/cvs/allegro/makefile.dj	Sun Sep  3 14:35:40 2000
+++ ./allegro/makefile.dj	Mon Jan 22 19:22:38 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 -ruN /home/cvs/allegro/readme.dj ./allegro/readme.dj
--- /home/cvs/allegro/readme.dj	Sat Jul  1 01:26:34 2000
+++ ./allegro/readme.dj	Mon Jan 22 19:53:20 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,62 @@
    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 
-   run fixdjgpp.bat before compiling it.
+   (if you downloaded a tar.gz archive or a CVS version), you will have to 
+   run fixdjgpp.bat before compiling it. If you are using bash you can run
+   fixdjgpp.sh instead. See below for why you might want to do this.
 
    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/
+ 
+   A list of all the available options:
+    CROSSCOMPILE
+                Set this if you are crosscompiling; it implies
+                UNIX_TOOLS.
+
+    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
+      or
+    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. The default level of optimisation Allegro uses
+                will run adequately on these systems, and will also work
+                on anything from a 386 upwards.
+
+    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.
+
+    UNIX_FILES
+                (This only applies if you use it when running the
+                fixdjgpp.sh script).
+
+                If you set this, then the `utod' utility won't be run on
+                the Allegro files before compilation. DJGPP and all
+                related utilities handle UNIX-style files (LF instead of
+                CRLF for a newline) without problems; it is only MS-DOS
+                style editors/broken Windows applications that fail. Set
+                this if you want to be able to use the Allegro files in
+                both DJGPP and UNIX.
+
+   To activate any of these, type "make WARNMODE=1" on the command line.
+   Alternatively, if you use the fixdjgpp.sh script, you can pass these
+   on the command line (eg. "WARNMODE=1;UNIX_TOOLS=1;./fixdjgpp.sh").
+
 
 
 =======================================
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/