Re: [AD] msvc7 compiler options

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



i think i have managed to use diff.
please find attached my 1st patches..  im no longer a patch virgin :(

this patch allows  you to type    fix.bat msvc7
and it will define the COMPILER_MSVC7 var that later gets checked for in makefile.vc which then adds the -GL (whole program optimzation) command line option to the CFLAGS

if this gets approved, i shall submit another for targeting SSE1|2|3.

aj.



> here is what needs to be done,  i am not very familiar with how to setup
> the makefiles to pass this data.. i hope someone else can figure it
> out..

Basically, you would set options with a line like
SOMEVAR=value
and check if options are set using
ifdef SOMEVAR
endif
or to check if not,
ifndef SOMEVAR
endif

> i also think this could be added for Athlon and P4:
>
> -arch:SSE
>
> and this for AMD64, P4:
>
> -arch:SSE2
>
>
> the arch instructions could be put on the TARGET_ARCH_EXCL makefile
> define.

Hmm... I'm not sure how this works for the other options, but then we'd
need to check what sort of platform the user has requested. What I mean is,
if the user runs
make TARGET_ARCH_EXCL=p4
we would need to add -arch:sse2 manually?

> potential problem:  using the -GB compiler option genreates code for
> PPro/P2/P3, what if the end-user is running a P1 ?

The code won't run - meaning that we probably shouldn't do this for the
public binary release of the library.
On the other hand, very few people will be using plain pentiums by now, so
maybe it's ok to have the official binary assume a more advanced processor
and tell people to compile their own if they want plain pentium support?
Hmm... that will give potential problems when people distribute binaries
without the DLL and point to Allegro's download site for the DLL... people
trying to run the game on their Pentium won't nescessarily be able to
compile the DLL themselves...
Thoughts?

Evert
--- ..\allegro_4_1_18__original\fix.bat	2005-01-19 23:36:00.000000000 +1100
+++ fix.bat	2005-02-03 03:07:54.000000000 +1100
@@ -27,9 +27,11 @@
 if [%1] == [djgpp]   goto head
 if [%1] == [mingw32] goto head
 if [%1] == [msvc]    goto head
+if [%1] == [msvc7]   goto head
 if [%1] == [watcom]  goto head
 goto help
 
+
 :head
 rem Generate header of makefile and alplatf.h,
 rem then go to platform specific function.
@@ -40,6 +42,7 @@
 if [%1] == [djgpp]   goto djgpp
 if [%1] == [mingw32] goto mingw32
 if [%1] == [msvc]    goto msvc
+if [%1] == [msvc7]   goto msvc7
 if [%1] == [watcom]  goto watcom
 
 echo fix.bat internal error: not reached
@@ -63,6 +66,10 @@
 echo #define ALLEGRO_MINGW32 >> include\allegro\platform\alplatf.h
 goto tail
 
+:msvc7
+echo COMPILER_MSVC7 = 1 >> makefile
+goto msvc
+
 :msvc
 echo Configuring Allegro for Windows/MSVC...
 echo MAKEFILE_INC = makefile.vc >> makefile
--- ..\allegro_4_1_18__original\makefile.vc	2004-11-24 14:09:00.000000000 +1100
+++ makefile.vc	2005-02-03 03:09:12.000000000 +1100
@@ -1,4 +1,4 @@
-#
+#   4.1.18
 #  Rules for building the Allegro library with MSVC. This file is included
 #  by the primary makefile, and should not be used directly.
 #
@@ -163,7 +163,11 @@
 
 # -------- optimised build --------
 
+ifdef COMPILER_MSVC7
+CFLAGS = $(WFLAGS) -Gd -Ox -GB -GL $(RUNTIME_FLAGS)
+else
 CFLAGS = $(WFLAGS) -Gd -Ox -GB $(RUNTIME_FLAGS)
+endif
 SFLAGS = -Wall
 LFLAGS = -release
 


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