[AD] letting the fix script define the platform.

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


the subject says it all. based on an idea from george, i've let the fix 
scripts write the name of the platform specific include to 
include/allegro/alplatf.h. i've done some minimal testing and it seems to be 
working fine... the patch is attached and applied to cvs.

mixing development utilities and doing cross compiling should now be less 
troublesome.

-- 
Sincerely Henrik Stokseth.
----------------------------------------------------------------------------
E-mail: hstokset@xxxxxxxxxx  Homepage: http://hstokset.n3.net
"Linux is keyboard friendly. I don't smash it like I used to with Windows."
diff -urN allegro_old/fixbcc32.bat allegro/fixbcc32.bat
--- allegro_old/fixbcc32.bat	Sat Apr 28 20:08:04 2001
+++ allegro/fixbcc32.bat	Sat Apr 28 21:45:07 2001
@@ -10,4 +10,7 @@
 echo MAKEFILE_INC = makefile.bcc >> makefile
 echo include makefile.all >> makefile
 
+echo /* generated by fixbcc32.bat */ > include\allegro\alplatf.h
+echo #include "albcc32.h" >> include\allegro\alplatf.h
+
 echo Done!
diff -urN allegro_old/fixbe.sh allegro/fixbe.sh
--- allegro_old/fixbe.sh	Sat Apr 28 20:07:12 2001
+++ allegro/fixbe.sh	Sat Apr 28 21:45:07 2001
@@ -10,6 +10,9 @@
 echo "MAKEFILE_INC = makefile.be" >> makefile
 echo "include makefile.all " >> makefile
 
+echo "/* generated by fixbe.sh */" > include\allegro\alplatf.h
+echo "#include \"albecfg.h\"" >> include\allegro\alplatf.h
+
 find . -type f "(" \
    -name "*.c" -o -name "*.cfg" -o -name "*.cpp" -o -name "*.dep" -o \
    -name "*.h" -o -name "*.hin" -o -name "*.in" -o -name "*.inc" -o \
diff -urN allegro_old/fixdjgpp.bat allegro/fixdjgpp.bat
--- allegro_old/fixdjgpp.bat	Sat Apr 28 20:08:04 2001
+++ allegro/fixdjgpp.bat	Sat Apr 28 21:45:07 2001
@@ -10,6 +10,9 @@
 echo MAKEFILE_INC = makefile.dj >> makefile
 echo include makefile.all >> makefile
 
+echo /* generated by fixdjgpp.bat */ > include\allegro\alplatf.h
+echo #include "aldjgpp.h" >> include\allegro\alplatf.h
+
 utod *.bat .../*.c *.cfg .../*.h .../*.inc
 utod .../*.s .../*.txt .../*._tx makefile.* readme.*
 
diff -urN allegro_old/fixdjgpp.sh allegro/fixdjgpp.sh
--- allegro_old/fixdjgpp.sh	Sat Apr 28 20:07:12 2001
+++ allegro/fixdjgpp.sh	Sat Apr 28 21:45:07 2001
@@ -46,5 +46,8 @@
 echo "MAKEFILE_INC = makefile.dj" >> makefile
 echo "include makefile.all" >> makefile
 
+echo "/* generated by fixdjgpp.sh */" > include/allegro/alplatf.h
+echo "#include \"aldjgpp.h\"" >> include/allegro/alplatf.h
+
 # End allegro/fixdjgpp.sh
 
diff -urN allegro_old/fixming.bat allegro/fixming.bat
--- allegro_old/fixming.bat	Sat Apr 28 20:08:04 2001
+++ allegro/fixming.bat	Sat Apr 28 21:45:07 2001
@@ -9,4 +9,7 @@
 echo MAKEFILE_INC = makefile.mgw >> makefile
 echo include makefile.all >> makefile
 
+echo /* generated by fixming.bat */ > include\allegro\alplatf.h
+echo #include "almngw32.h" >> include\allegro\alplatf.h
+
 echo Done!
diff -urN allegro_old/fixming.sh allegro/fixming.sh
--- allegro_old/fixming.sh	Sat Apr 28 20:07:12 2001
+++ allegro/fixming.sh	Sat Apr 28 21:45:07 2001
@@ -23,4 +23,7 @@
 echo "MAKEFILE_INC = makefile.mgw" >> makefile
 echo "include makefile.all" >> makefile
 
+echo "/* generated by fixming.sh */" > include/allegro/alplatf.h
+echo "#include \"almngw32.h\"" >> include/allegro/alplatf.h
+
 echo "Done!"
diff -urN allegro_old/fixmsvc.bat allegro/fixmsvc.bat
--- allegro_old/fixmsvc.bat	Sat Apr 28 20:08:04 2001
+++ allegro/fixmsvc.bat	Sat Apr 28 21:45:07 2001
@@ -10,6 +10,9 @@
 echo MAKEFILE_INC = makefile.vc >> makefile
 echo include makefile.all >> makefile
 
+echo /* generated by fixmsvc.bat */ > include\allegro\alplatf.h
+echo #include "almsvc.h" >> include\allegro\alplatf.h
+
 utod *.bat .../*.c *.cfg .../*.h .../*.inc .../*.rc
 utod .../*.s .../*.txt .../*._tx makefile.* readme.*
 
diff -urN allegro_old/fixqnx.sh allegro/fixqnx.sh
--- allegro_old/fixqnx.sh	Sat Apr 28 20:07:12 2001
+++ allegro/fixqnx.sh	Sat Apr 28 21:45:07 2001
@@ -10,6 +10,9 @@
 echo "MAKEFILE_INC = makefile.qnx" >> makefile
 echo "include makefile.all " >> makefile
 
+echo "/* generated by fixqnx.sh */" > include/allegro/alplatf.h
+echo "#include \"alqnxcfg.h\"" >> include/allegro/alplatf.h
+
 # find . -type f "(" \
 #   -name "*.c" -o -name "*.cfg" -o -name "*.cpp" -o -name "*.dep" -o \
 #   -name "*.h" -o -name "*.hin" -o -name "*.in" -o -name "*.inc" -o \
diff -urN allegro_old/fixrsxnt.bat allegro/fixrsxnt.bat
--- allegro_old/fixrsxnt.bat	Sat Apr 28 20:08:04 2001
+++ allegro/fixrsxnt.bat	Sat Apr 28 21:45:07 2001
@@ -9,6 +9,9 @@
 echo MAKEFILE_INC = makefile.rsx >> makefile
 echo include makefile.all >> makefile
 
+echo /* generated by fixrsxnt.bat */ > include\allegro\alplatf.h
+echo #include "alrsxnt.h" >> include\allegro\alplatf.h
+
 echo.
 echo Note: this is not a full RSXNT port of the Allegro library. This makefile
 echo will create an import library and build all the test programs using RSXNT,
diff -urN allegro_old/fixunix.sh allegro/fixunix.sh
--- allegro_old/fixunix.sh	Sat Apr 28 20:07:12 2001
+++ allegro/fixunix.sh	Sat Apr 28 21:45:07 2001
@@ -6,6 +6,9 @@
 
 echo "Converting Allegro files to Unix format..."
 
+echo "/* generated by fixunix.sh */" > include/allegro/alplatf.h
+echo "#include \"alucfg.h\"" >> include/allegro/alplatf.h
+
 find . -type f "(" \
    -name "*.c" -o -name "*.cfg" -o -name "*.cpp" -o -name "*.dep" -o \
    -name "*.h" -o -name "*.hin" -o -name "*.in" -o -name "*.inc" -o \
diff -urN allegro_old/fixwat.bat allegro/fixwat.bat
--- allegro_old/fixwat.bat	Sat Apr 28 20:08:04 2001
+++ allegro/fixwat.bat	Sat Apr 28 21:45:07 2001
@@ -10,6 +10,9 @@
 echo MAKEFILE_INC = makefile.wat >> makefile
 echo include makefile.all >> makefile
 
+echo /* generated by fixwat.bat */ > include\allegro\alplatf.h
+echo #include "alwatcom.h" >> include\allegro\alplatf.h
+
 utod *.bat .../*.c *.cfg .../*.h .../*.inc
 utod .../*.s .../*.txt .../*._tx makefile.* readme.*
 
diff -urN allegro_old/include/allegro/albcc32.h allegro/include/allegro/albcc32.h
--- allegro_old/include/allegro/albcc32.h	Sat Apr 28 20:08:08 2001
+++ allegro/include/allegro/albcc32.h	Sat Apr 28 21:53:21 2001
@@ -16,10 +16,6 @@
  */
 
 
-#ifndef __BORLANDC__
-   #error bad include
-#endif
-
 #ifdef ALLEGRO_SRC
    #error Currently BCC32 should only use the DLL
 #endif
diff -urN allegro_old/include/allegro/albecfg.h allegro/include/allegro/albecfg.h
--- allegro_old/include/allegro/albecfg.h	Sat Apr 28 20:08:08 2001
+++ allegro/include/allegro/albecfg.h	Sat Apr 28 21:54:52 2001
@@ -16,10 +16,6 @@
  */
 
 
-#ifndef __BEOS__
-   #error bad include
-#endif
-
 #include <fcntl.h>
 #include <unistd.h>
 
diff -urN allegro_old/include/allegro/alconfig.h allegro/include/allegro/alconfig.h
--- allegro_old/include/allegro/alconfig.h	Sat Apr 28 20:08:08 2001
+++ allegro/include/allegro/alconfig.h	Sat Apr 28 21:59:09 2001
@@ -26,30 +26,13 @@
 /* include platform-specific stuff */
 #if defined SCAN_EXPORT
    #include "alscanex.h"
-#elif defined __RSXNT__
-   #include "alrsxnt.h"
-#elif defined __MINGW32__
-   #include "almngw32.h"
-#elif defined __BORLANDC__
-   #include "albcc32.h"
-#elif defined _MSC_VER
-   #include "almsvc.h"
-#elif defined __WATCOMC__
-   #include "alwatcom.h"
-#elif defined __BEOS__
-   #include "albecfg.h"
-#elif defined __MRC__
-   #include "almaccfg.h"
-#elif defined __QNX__
-   #include "alqnxcfg.h"
-#elif defined DJGPP
-   #include "aldjgpp.h"
-#elif defined __unix__
-   #include "alucfg.h"
 #else
-   #error platform not supported
+   #include "alplatf.h"
 #endif
 
+#if (!defined ALLEGRO_PLATFORM_STR) && (!defined SCAN_EXPORT)
+   #error Allegro platform not defined. (please run the appropriate fix script)
+#endif
 
 /* special definitions for the GCC compiler */
 #ifdef __GNUC__
diff -urN allegro_old/include/allegro/aldjgpp.h allegro/include/allegro/aldjgpp.h
--- allegro_old/include/allegro/aldjgpp.h	Sat Apr 28 20:08:08 2001
+++ allegro/include/allegro/aldjgpp.h	Sat Apr 28 21:56:03 2001
@@ -16,11 +16,6 @@
  */
 
 
-#ifndef DJGPP
-   #error bad include
-#endif
-
-
 #ifndef SCAN_DEPEND
    #include <pc.h>
    #include <dir.h>
diff -urN allegro_old/include/allegro/almngw32.h allegro/include/allegro/almngw32.h
--- allegro_old/include/allegro/almngw32.h	Sat Apr 28 20:08:08 2001
+++ allegro/include/allegro/almngw32.h	Sat Apr 28 21:52:55 2001
@@ -18,11 +18,6 @@
  */
 
 
-#ifndef __MINGW32__
-   #error bad include
-#endif
-
-
 #ifndef SCAN_DEPEND
    #include <io.h>
    #include <fcntl.h>
diff -urN allegro_old/include/allegro/almsvc.h allegro/include/allegro/almsvc.h
--- allegro_old/include/allegro/almsvc.h	Sat Apr 28 20:08:08 2001
+++ allegro/include/allegro/almsvc.h	Sat Apr 28 21:53:36 2001
@@ -16,11 +16,6 @@
  */
 
 
-#ifndef _MSC_VER
-   #error bad include
-#endif
-
-
 #ifndef SCAN_DEPEND
    #include <io.h>
    #include <fcntl.h>
diff -urN allegro_old/include/allegro/alqnxcfg.h allegro/include/allegro/alqnxcfg.h
--- allegro_old/include/allegro/alqnxcfg.h	Sat Apr 28 20:08:08 2001
+++ allegro/include/allegro/alqnxcfg.h	Sat Apr 28 21:55:17 2001
@@ -15,9 +15,6 @@
  *      See readme.txt for copyright information.
  */
 
-#ifndef __QNX__
-#error Bad include!
-#endif
 
 #include <stdio.h>
 #include <stdlib.h>
diff -urN allegro_old/include/allegro/alrsxnt.h allegro/include/allegro/alrsxnt.h
--- allegro_old/include/allegro/alrsxnt.h	Sat Apr 28 20:08:08 2001
+++ allegro/include/allegro/alrsxnt.h	Sat Apr 28 21:52:22 2001
@@ -16,10 +16,6 @@
  */
 
 
-#ifndef __RSXNT__
-   #error bad include
-#endif
-
 #ifdef ALLEGRO_SRC
    #error RSXNT can only use the DLL, not build it
 #endif
diff -urN allegro_old/include/allegro/alwatcom.h allegro/include/allegro/alwatcom.h
--- allegro_old/include/allegro/alwatcom.h	Sat Apr 28 20:08:08 2001
+++ allegro/include/allegro/alwatcom.h	Sat Apr 28 21:54:31 2001
@@ -16,10 +16,6 @@
  */
 
 
-#ifndef __WATCOMC__
-   #error bad include
-#endif
-
 #ifndef __SW_3S
    #error Allegro only supports stack based calling convention
 #endif
diff -urN allegro_old/makefile.bcc allegro/makefile.bcc
--- allegro_old/makefile.bcc	Sat Apr 28 20:08:10 2001
+++ allegro/makefile.bcc	Sat Apr 28 22:05:39 2001
@@ -225,9 +225,7 @@
 
 # -------- generate automatic dependencies --------
 
-GCC2BCC = -D__BORLANDC__ -U__GNUC__ -UDJGPP -U__unix__
-
-DEPEND_PARMS = $(GCC2BCC) -MM -MG -I. -I./include -DSCAN_DEPEND
+DEPEND_PARMS = -MM -MG -I. -I./include -DSCAN_DEPEND
 
 depend:
 	gcc $(DEPEND_PARMS) demo/*.c examples/*.c setup/*.c tests/*.c > _depend.tmp
diff -urN allegro_old/makefile.be allegro/makefile.be
--- allegro_old/makefile.be	Sat Apr 28 20:08:10 2001
+++ allegro/makefile.be	Sat Apr 28 22:05:12 2001
@@ -192,13 +192,7 @@
 
 # -------- generate automatic dependencies --------
 
-GCC2BEOS = -D__BEOS__ -UDJGPP -U__unix__
-
-ifdef CROSSCOMPILE
-  DEPEND_PARAMS = $(GCC2BEOS) -MM -MG -I. -I./include -DSCAN_DEPEND
-else
-  DEPEND_PARAMS = -MM -MG -I. -I./include -DSCAN_DEPEND
-endif
+DEPEND_PARAMS = -MM -MG -I. -I./include -DSCAN_DEPEND
 
 depend:
 	gcc $(DEPEND_PARAMS) src/*.c src/beos/*.c src/beos/*.cpp src/i386/*.c src/misc/*.c demo/*.c examples/*.c setup/*.c tests/*.c tools/*.c tools/plugins/*.c > _depend.tmp
diff -urN allegro_old/makefile.dj allegro/makefile.dj
--- allegro_old/makefile.dj	Sat Apr 28 20:08:10 2001
+++ allegro/makefile.dj	Sat Apr 28 22:04:55 2001
@@ -426,13 +426,7 @@
 
 # -------- generate automatic dependencies --------
 
-GCC2DJGPP = -DDJGPP -U__unix__
-
-ifdef CROSSCOMPILE
-  DEPEND_PARAMS = $(GCC2DJGPP) -MM -MG -I. -I./include -DSCAN_DEPEND
-else
-  DEPEND_PARAMS = -MM -MG -I. -I./include -DSCAN_DEPEND
-endif
+DEPEND_PARAMS = -MM -MG -I. -I./include -DSCAN_DEPEND
 
 depend:
 	gcc $(DEPEND_PARAMS) src/*.c src/dos/*.c src/c/*.c src/i386/*.c src/misc/*.c demo/*.c examples/*.c setup/*.c tests/*.c tools/*.c tools/plugins/*.c > _depend.tmp
diff -urN allegro_old/makefile.mgw allegro/makefile.mgw
--- allegro_old/makefile.mgw	Sat Apr 28 20:08:10 2001
+++ allegro/makefile.mgw	Sat Apr 28 22:04:29 2001
@@ -418,13 +418,7 @@
 
 # -------- generate automatic dependencies --------
 
-GCC2MINGW = -D__MINGW32__ -UDJGPP -U__unix__
-
-ifdef CROSSCOMPILE
-  DEPEND_PARAMS = $(GCC2MINGW) -MM -MG -I. -I./include -DSCAN_DEPEND
-else
-  DEPEND_PARAMS = -MM -MG -I. -I./include -DSCAN_DEPEND
-endif
+DEPEND_PARAMS = -MM -MG -I. -I./include -DSCAN_DEPEND
 
 depend:
 	gcc $(DEPEND_PARAMS) src/*.c src/win/*.c src/i386/*.c src/c/*.c src/misc/*.c demo/*.c examples/*.c setup/*.c tests/*.c tools/*.c tools/plugins/*.c tests/win/*.c > _depend.tmp
@@ -448,4 +442,3 @@
 	del _depend.tmp
 	del _depend2.tmp
 endif
-
diff -urN allegro_old/makefile.qnx allegro/makefile.qnx
--- allegro_old/makefile.qnx	Sat Apr 28 20:08:10 2001
+++ allegro/makefile.qnx	Sat Apr 28 22:04:04 2001
@@ -192,13 +192,7 @@
 
 # -------- generate automatic dependencies --------
 
-GCC2QNX = -D__QNX__ -UDJGPP -U__unix__
-
-ifdef CROSSCOMPILE
-  DEPEND_PARAMS = $(GCC2QNX) -MM -MG -I. -I./include -DSCAN_DEPEND
-else
-  DEPEND_PARAMS = -MM -MG -I. -I./include -DSCAN_DEPEND
-endif
+DEPEND_PARAMS = -MM -MG -I. -I./include -DSCAN_DEPEND
 
 depend:
 	gcc $(DEPEND_PARAMS) src/*.c src/qnx/*.c src/unix/*.c src/i386/*.c src/misc/*.c demo/*.c examples/*.c setup/*.c tests/*.c tools/*.c tools/plugins/*.c > _depend.tmp
diff -urN allegro_old/makefile.rsx allegro/makefile.rsx
--- allegro_old/makefile.rsx	Sat Apr 28 20:08:10 2001
+++ allegro/makefile.rsx	Sat Apr 28 22:03:47 2001
@@ -177,9 +177,7 @@
 
 # -------- generate automatic dependencies --------
 
-GCC2RSXNT = -D__RSXNT__ -UDJGPP -U__unix__
-
-DEPEND_PARAMS = $(GCC2RSXNT) -MM -MG -I. -I./include -DSCAN_DEPEND
+DEPEND_PARAMS = -MM -MG -I. -I./include -DSCAN_DEPEND
 
 depend:
 	gcc $(DEPEND_PARAMS) demo/*.c examples/*.c setup/*.c tests/*.c tools/*.c tools/plugins/*.c tests/win/*.c > _depend.tmp
diff -urN allegro_old/makefile.vc allegro/makefile.vc
--- allegro_old/makefile.vc	Sat Apr 28 20:08:10 2001
+++ allegro/makefile.vc	Sat Apr 28 22:03:29 2001
@@ -281,15 +281,13 @@
 
 endif
 
-GCC2MSVC = -D_MSC_VER -D_WIN32 -D_M_IX86 -U__GNUC__ -UDJGPP -U__unix__
-
 COMPILE_FLAGS += $(subst src/,-DALLEGRO_SRC ,$(findstring src/, $<))$(CFLAGS)
 
 $(OBJ_DIR)/%.obj: %.c $(RUNNER)
 	$(RUNNER) cl @ -nologo $(COMPILE_FLAGS) -I. -I./include -Fo$@ -c $<
 
 $(OBJ_DIR)/%.obj: %.s
-	gcc $(GCC2MSVC) $(SFLAGS) -I. -I./include -x assembler-with-cpp -o $@ -c $<
+	gcc $(SFLAGS) -I. -I./include -x assembler-with-cpp -o $@ -c $<
 
 */%.exe: $(OBJ_DIR)/%.obj $(IMPLIB_NAME) $(RUNNER)
 	$(RUNNER) link @ -nologo $(LFLAGS) -subsystem:windows -out:$@ $< $(IMPLIB_NAME) $(LIBRARIES)
@@ -359,7 +357,7 @@
 
 # -------- generate automatic dependencies --------
 
-DEPEND_PARAMS = $(GCC2MSVC) -MM -MG -I. -I./include -DSCAN_DEPEND
+DEPEND_PARAMS = -MM -MG -I. -I./include -DSCAN_DEPEND
 
 depend:
 	gcc $(DEPEND_PARAMS) src/*.c src/win/*.c src/i386/*.c src/misc/*.c demo/*.c examples/*.c setup/*.c tests/*.c tools/*.c tools/plugins/*.c tests/win/*.c > _depend.tmp
diff -urN allegro_old/makefile.wat allegro/makefile.wat
--- allegro_old/makefile.wat	Sat Apr 28 20:08:10 2001
+++ allegro/makefile.wat	Sat Apr 28 22:02:17 2001
@@ -145,7 +145,7 @@
 $(RUNNER) wlib \\ @ -q -b -n $(LIB_NAME) $(addprefix +,$(OBJECTS))
 endef
 
-GCC2WATCOM = -D__WATCOMC__ -D__SW_3S -D__SW_S -U__GNUC__ -UDJGPP -U__unix__
+GCC2WATCOM = -D__SW_3S -D__SW_S
 
 COMPILE_FLAGS = $(subst src/,-dALLEGRO_SRC ,$(findstring src/, $<))$(CFLAGS)
 
diff -urN allegro_old/todo.txt allegro/todo.txt
--- allegro_old/todo.txt	Sat Apr 28 20:08:08 2001
+++ allegro/todo.txt	Sat Apr 28 21:45:07 2001
@@ -64,6 +64,7 @@
   colordepths.
 - Update the docs.
 - Window close button?
+- fix script must write #include "almaccfg.h" into include\allegro\alplatf.h
 
 BeOS todos:
 ---------------------------------------------------------------------------


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