[AD] Some housekeeping work

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


I've attached three patches that are related to the build process on non-Unix 
platforms:

- unix_tools.diff: unify the autodetection and handling of Unix-like tools 
for all ports (including implementing it for the Watcom port).

- allegro_use_c.diff: unify and fix the handling of ALLEGRO_USE_C for all 
GCC-based ports (including implementing it for the BeOS port).

- make_options_docs.diff: fix and update the docs about the various make 
options (which was the original motivation for the whole thing).


Applied to trunk and branch.

-- 
Eric Botcazou
Index: makefile.bcc
===================================================================
RCS file: /cvsroot/alleg/allegro/makefile.bcc,v
retrieving revision 1.37
diff -u -r1.37 makefile.bcc
--- makefile.bcc	24 Nov 2002 08:22:38 -0000	1.37
+++ makefile.bcc	10 May 2003 09:17:13 -0000
@@ -18,6 +18,10 @@
 
 PLATFORM_DIR = obj/bcc32
 
+ifneq (,$(findstring bash,$(SHELL)))
+   UNIX_TOOLS = 1
+endif
+
 
 
 # -------- link as a DLL --------
Index: makefile.dj
===================================================================
RCS file: /cvsroot/alleg/allegro/makefile.dj,v
retrieving revision 1.30
diff -u -r1.30 makefile.dj
--- makefile.dj	8 Feb 2003 21:31:37 -0000	1.30
+++ makefile.dj	10 May 2003 09:17:13 -0000
@@ -20,11 +20,11 @@
 LIB_NAME = lib/djgpp/lib$(VERSION).a
 
 ifdef CROSSCOMPILE
-  UNIX_TOOLS = 1
+   UNIX_TOOLS = 1
 endif
 
 ifneq (,$(findstring bash,$(SHELL)))
-  UNIX_TOOLS = 1
+   UNIX_TOOLS = 1
 endif
 
 
Index: makefile.mgw
===================================================================
RCS file: /cvsroot/alleg/allegro/makefile.mgw,v
retrieving revision 1.87
diff -u -r1.87 makefile.mgw
--- makefile.mgw	15 Feb 2003 19:43:32 -0000	1.87
+++ makefile.mgw	10 May 2003 09:17:13 -0000
@@ -30,7 +30,7 @@
 endif
 
 ifneq (,$(findstring /sh.exe,$(SHELL)))
-  UNIX_TOOLS = 1
+   UNIX_TOOLS = 1
 endif
 
 
@@ -154,6 +154,8 @@
 endif
 
 OFLAGS = $(TARGET_ARCH) $(TARGET_OPTS)
+
+
 
 ifdef DEBUGMODE
 
Index: makefile.wat
===================================================================
RCS file: /cvsroot/alleg/allegro/makefile.wat,v
retrieving revision 1.19
diff -u -r1.19 makefile.wat
--- makefile.wat	15 Mar 2003 08:59:40 -0000	1.19
+++ makefile.wat	10 May 2003 09:17:18 -0000
@@ -21,6 +21,10 @@
 OBJ = .obj
 HTML = htm
 
+ifneq (,$(findstring bash,$(SHELL)))
+   UNIX_TOOLS = 1
+endif
+
 
 
 # -------- check that the WATCOM environment variable is set --------
@@ -105,6 +109,40 @@
 
 # -------- rules for installing and removing the library files --------
 
+ifdef UNIX_TOOLS
+
+$(WATDIR_U)/lib386/$(VERSION).lib: $(LIB_NAME)
+	cp lib/watcom/$(VERSION).lib $(WATDIR_U)/lib386
+
+$(WATDIR_U)/h/allegro.h: include/allegro.h
+	cp include/allegro.h $(WATDIR_U)/h
+
+$(WATDIR_U)/h/allegro:
+	mkdir $(WATDIR_U)/h/allegro
+
+$(WATDIR_U)/h/allegro/%.h: include/allegro/%.h
+	cp $< $@
+
+$(WATDIR_U)/h/allegro/internal:
+	mkdir $(WATDIR_U)/h/allegro/internal
+
+$(WATDIR_U)/h/allegro/internal/%.h: include/allegro/internal/%.h
+	cp $< $@
+
+$(WATDIR_U)/h/allegro/inline:
+	mkdir $(WATDIR_U)/h/allegro/inline
+
+$(WATDIR_U)/h/allegro/inline/%.inl: include/allegro/inline/%.inl
+	cp $< $@
+
+$(WATDIR_U)/h/allegro/platform:
+	mkdir $(WATDIR_U)/h/allegro/platform
+
+$(WATDIR_U)/h/allegro/platform/%.h: include/allegro/platform/%.h
+	cp $< $@
+
+else
+
 $(WATDIR_U)/lib386/$(VERSION).lib: $(LIB_NAME)
 	copy lib\watcom\$(VERSION).lib $(WATDIR_D)\lib386
 
@@ -135,6 +173,9 @@
 $(WATDIR_U)/h/allegro/platform/%.h: include/allegro/platform/%.h
 	copy $(subst /,\,$<) $(subst /,\,$@)
 
+endif # UNIX_TOOLS
+
+
 HEADERS = $(addprefix $(WATDIR_U)/h/allegro/,$(notdir $(wildcard include/allegro/*.h)))          \
           $(addprefix $(WATDIR_U)/h/allegro/internal/,$(notdir $(wildcard include/allegro/internal/*.h))) \
           $(addprefix $(WATDIR_U)/h/allegro/inline/,$(notdir $(wildcard include/allegro/inline/*.inl)))
@@ -165,6 +206,13 @@
 		  $(WATDIR_U)/h/allegro/platform/*.h
 
 uninstall:
+ifdef UNIX_TOOLS
+	-rm -fv $(UNINSTALL_FILES)
+	-rmdir $(WATDIR_U)/include/allegro/platform
+	-rmdir $(WATDIR_U)/include/allegro/inline
+	-rmdir $(WATDIR_U)/include/allegro/internal
+	-rmdir $(WATDIR_U)/include/allegro
+else
    define RM_FILES
       $(foreach file, $(wildcard $(UNINSTALL_FILES)), del $(subst /,\,$(file))
       )
@@ -175,6 +223,7 @@
 	-rd $(WATDIR_D)\h\allegro\internal
 	-rd $(WATDIR_D)\h\allegro
 	@echo All gone!
+endif
 
 
 
@@ -233,9 +282,15 @@
 PLUGIN_DEPS = $(LIB_NAME) $(PLUGIN_LIB) $(RUNNER)
 PLUGIN_SCR = scw
 
-define GENERATE_PLUGINS_H
-copy /B tools\plugins\*.inc obj\watcom\plugins.h
-endef
+ifdef UNIX_TOOLS
+   define GENERATE_PLUGINS_H
+      cat tools/plugins/*.inc > obj/watcom/plugins.h
+   endef
+else
+   define GENERATE_PLUGINS_H
+      copy /B tools\plugins\*.inc obj\watcom\plugins.h
+   endef
+endif
 
 define MAKE_PLUGIN_LIB
 $(RUNNER) wlib \\ @ -q -b -n $(PLUGIN_LIB) $(addprefix +,$(PLUGIN_OBJS))
Index: makefile.dj
===================================================================
RCS file: /cvsroot/alleg/allegro/makefile.dj,v
retrieving revision 1.30
diff -u -r1.30 makefile.dj
--- makefile.dj	8 Feb 2003 21:31:37 -0000	1.30
+++ makefile.dj	10 May 2003 09:19:34 -0000
@@ -234,7 +234,7 @@
 VPATH += src/i386
 MY_OBJECTS = $(I386_OBJECTS)
 
-endif
+endif # ALLEGRO_USE_C
 
 OBJECT_LIST = $(COMMON_OBJECTS) $(MY_OBJECTS) \
 	      $(basename $(notdir $(ALLEGRO_SRC_DOS_FILES))) \
Index: makefile.be
===================================================================
RCS file: /cvsroot/alleg/allegro/makefile.be,v
retrieving revision 1.41
diff -u -r1.41 makefile.be
--- makefile.be	18 Apr 2003 20:55:52 -0000	1.41
+++ makefile.be	10 May 2003 09:19:34 -0000
@@ -64,16 +64,15 @@
 
 OFLAGS =  $(TARGET_ARCH) $(TARGET_OPTS)
 
-ifdef DEBUGMODE
 
 
+ifdef DEBUGMODE
 
 # -------- debugging build --------
 CFLAGS = -DDEBUGMODE=$(DEBUGMODE) $(WFLAGS) -g -O0
 SFLAGS = -DDEBUGMODE=$(DEBUGMODE) $(WFLAGS)
 LFLAGS = -g
 
-
 else
 ifdef PROFILEMODE
 
@@ -100,12 +99,28 @@
 
 # -------- list which platform specific objects to include --------
 
-VPATH = src/beos src/i386 src/misc src/unix tools/beos
+VPATH = src/beos src/misc src/unix tools/beos
 
-LIBRARIES = -lbe -lgame -ldevice -lmidi -lmedia
+ifdef ALLEGRO_USE_C
 
-OBJECT_LIST = $(COMMON_OBJECTS) $(I386_OBJECTS) \
-	      $(basename $(notdir $(ALLEGRO_SRC_BEOS_FILES)))
+# ------ build a C-only version ------
+
+VPATH += src/c
+MY_OBJECTS = $(C_OBJECTS) cmiscs
+CFLAGS += -DALLEGRO_USE_C
+
+else
+
+# ------ build the normal asm version ------
+
+VPATH += src/i386
+MY_OBJECTS = $(I386_OBJECTS)
+
+endif # ALLEGRO_USE_C
+
+OBJECT_LIST = $(COMMON_OBJECTS) $(MY_OBJECTS) $(basename $(notdir $(ALLEGRO_SRC_BEOS_FILES)))
+
+LIBRARIES = -lbe -lgame -ldevice -lmidi -lmedia
 
 PROGRAMS = bfixicon
 
Index: makefile.qnx
===================================================================
RCS file: /cvsroot/alleg/allegro/makefile.qnx,v
retrieving revision 1.22
diff -u -r1.22 makefile.qnx
--- makefile.qnx	12 Jul 2002 12:48:57 -0000	1.22
+++ makefile.qnx	10 May 2003 09:19:34 -0000
@@ -55,6 +55,8 @@
 
 OFLAGS = $(TARGET_ARCH) $(TARGET_OPTS)
 
+
+
 ifdef DEBUGMODE
 
 # -------- debugging build --------
@@ -105,7 +107,7 @@
 
 endif # ALLEGRO_USE_C
 
-OBJECT_LIST = $(COMMON_OBJECTS) $(I386_OBJECTS) $(basename $(notdir $(ALLEGRO_SRC_QNX_FILES)))
+OBJECT_LIST = $(COMMON_OBJECTS) $(MY_OBJECTS) $(basename $(notdir $(ALLEGRO_SRC_QNX_FILES)))
 
 LIBRARIES = -lm -lph -lasound
 
Index: makefile.all
===================================================================
RCS file: /cvsroot/alleg/allegro/makefile.all,v
retrieving revision 1.35
diff -u -r1.35 makefile.all
--- makefile.all	12 Feb 2003 17:46:07 -0000	1.35
+++ makefile.all	10 May 2003 09:22:26 -0000
@@ -8,14 +8,15 @@
 #        DEBUGMODE=2        selects a build intended to debug Allegro itself.
 #        PROFILEMODE=1      selects a profiling build.
 #        WARNMODE=1         selects strict compiler warnings.
-#        STATICLINK=1       use static linking (MSVC, Mingw32).
-#        TARGET_ARCH_COMPAT optimize for the given processor while preserving
-#                           backwards compatibility with older processors.
-#        TARGET_ARCH_EXCL   optimize for the given processor. this will cause
-#                           the library to *NOT* be backwards compatible.
-#        TARGET_OPTS        allows you to customize general optimalization.
-#        CROSSCOMPILE=1     build djgpp or Mingw32 versions under Linux.
-#        ALLEGRO_USE_C=1    use C drawing code instead of asm (djgpp, Mingw32).
+#        STATICLINK=1       use static linking (MinGW32, MSVC, BeOS).
+#        TARGET_ARCH_COMPAT optimize for the given processor while preserving backwards
+#                           compatibility with older processors (GCC-based platforms).
+#        TARGET_ARCH_EXCL   optimize for the given processor; this will cause the library
+#                           to *NOT* be backwards compatible (GCC-based platforms).
+#        TARGET_OPTS        allows you to customize general optimalization (GCC-based platforms).
+#        CROSSCOMPILE=1     cross-build under Linux (DJGPP, MinGW32).
+#        ALLEGRO_USE_C=1    use C drawing code instead of asm (GCC-based platforms).
+#        UNIX_TOOLS=1       use Unix-like tools instead of DOS tools.
 #
 #     Targets: 
 #        default:           build library version, docs, and programs.
@@ -30,7 +31,7 @@
 #        distclean:         remove objects and executables.
 #        veryclean:         remove all generated files.
 #        depend:            regenerate the dependency files.
-#        compress:          compress the executable files (djgpp, Mingw32, MSVC).
+#        compress:          compress the executable files (DJGPP, MinGW32, MSVC).
 
 
 
Index: docs/src/allegro._tx
===================================================================
RCS file: /cvsroot/alleg/allegro/docs/src/allegro._tx,v
retrieving revision 1.146
diff -u -r1.146 allegro._tx
--- docs/src/allegro._tx	9 May 2003 21:09:56 -0000	1.146
+++ docs/src/allegro._tx	10 May 2003 09:24:03 -0000
@@ -9381,7 +9381,7 @@
 There are a number of options that you can use to control exactly how 
 Allegro will be compiled. On Unix platforms you do this by passing arguments 
 to the configure script (run "configure --help" for a list), but on other 
-platforms you can set the environment variables:
+platforms you can set the following environment variables:
 <ul><li>
    DEBUGMODE=1<br>
    Selects a debug build, rather than the normal optimised version.
@@ -9398,30 +9398,34 @@
    yourself, rather than just using it in your programs, you should be sure 
    to have this mode enabled.
 <li>
-   STATICLINK=1 (MSVC and Mingw32 only)<br>
-   Link as a static library, rather than the default DLL.
+   STATICLINK=1 (MinGW32, MSVC, BeOS only)<br>
+   Link as a static library, rather than the default dynamic library.
 <li>
-   TARGET_ARCH_COMPAT=[cpu] (implemented for most GNU platforms)<br>
+   TARGET_ARCH_COMPAT=[cpu] (GCC-based platforms only)<br>
    This option will optimize for the given processor while maintaining
    compatibility with older processors.
    Example: set TARGET_ARCH_COMPAT=i586
 <li>
-   TARGET_ARCH_EXCL=[cpu] (implemented for most GNU platforms)<br>
+   TARGET_ARCH_EXCL=[cpu] (GCC-based platforms only)<br>
    This option will optimize for the given processor. Please note that
    using it will cause the code to *NOT* run on older processors.
    Example: set TARGET_ARCH_EXCL=i586
 <li>
-   TARGET_OPTS=[opts] (implemented for most GNU platforms)<br>
+   TARGET_OPTS=[opts] (GCC-based platforms only)<br>
    This option allows you to customize general compiler optimisations.
 <li>
-   CROSSCOMPILE=1 (djgpp only)<br>
-   Allows you to build the djgpp library under Linux, using djgpp as a 
-   cross-compiler.
-<li>
-   ALLEGRO_USE_C=1 (djgpp only)<br>
-   Allows you to build the djgpp library using C drawing code instead of the 
-   usual asm routines. This is only really useful for testing, since the asm 
+   CROSSCOMPILE=1 (DJGPP, MinGW32 only)<br>
+   Allows you to build the library under Linux by using a cross-compiler.
+<li>
+   ALLEGRO_USE_C=1 (GCC-based platforms only)<br>
+   Allows you to build the library using C drawing code instead of the usual
+   asm routines. This is only really useful for testing, since the asm
    version is faster.
+<li>
+   UNIX_TOOLS=1<br>
+   Instructs the build process to use Unix-like tools instead of DOS tools.
+   Note that you usually don't need to set it because the build proces will
+   try to autodetect this configuration.
 </ul>
 If you only want to recompile a specific test program or utility, you can 
 specify it as an argument to make, eg. "make demo" or "make grabber". The 


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