Re: [AD] msvc7 compiler options |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
aj wrote:
i can not confirm that, as i only have msvc7, but feel free to modify
my patch and re-post.
patch attached. it integrates your fix.bat and makefile.vc patches
(IIRC that they have not been already commited)
--
Regards,
Michal
diff -ur allegro.orig/docs/src/build/msvc._tx allegro.new/docs/src/build/msvc._tx
--- allegro.orig/docs/src/build/msvc._tx Wed Jan 19 23:36:16 2005
+++ allegro.new/docs/src/build/msvc._tx Thu Feb 3 19:46:55 2005
@@ -56,7 +56,8 @@
Optional: GNU sed. Used by "<tt>make depend</tt>" and "<tt>fixdll.sh</tt>"<br>
Optional: GNU sort (textutils). Used by "<tt>fixdll.sh</tt>".<br><br>
</ul></ul>
- Allegro should work ok with MSVC versions 4, 5, 6 and 7.
+ Allegro should work ok with MSVC versions 4, 5, 6, 7.0 (.NET)
+ and 7.1 (.NET 2003). However note that the lowest tested version is 6.
The DirectX SDK can be obtained directly from Microsoft. An old version
of the headers is included with MSVC, but Allegro requires more recent
@@ -131,6 +132,10 @@
you are using DJGPP or MinGW), type "<tt>fix.bat msvc</tt>". If you are
using MinGW and want the <tt>fix.bat</tt> to solve problems with long paths,
type "<tt>fix.bat msvc --msvcpaths</tt>".
+
+ If you are using MSVC 7 or higher you can specify "msvc7" instead of "msvc"
+ which will enable better optimalization. However it can make the compilation
+ slower especially for the statically linked version.
If you are compiling from CVS, before continuing you must run both
"<tt>make depend</tt>" and "<tt>misc/fixdll.sh</tt>" as explained below, or the build will
diff -ur allegro.orig/fix.bat allegro.new/fix.bat
--- allegro.orig/fix.bat Wed Jan 19 23:36:46 2005
+++ allegro.new/fix.bat Thu Feb 3 19:39:29 2005
@@ -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
@@ -79,7 +86,7 @@
echo.
echo Usage: fix platform [--quick] [--msvcpaths]
echo.
-echo Where platform is one of: bcc32, djgpp, mingw32, msvc or watcom.
+echo Where platform is one of: bcc32, djgpp, mingw32, msvc, msvc7 or watcom.
echo.
echo The --quick parameter is used to turn off LF to CR/LF conversion.
echo.
@@ -112,6 +119,8 @@
if [%3] == [--quick] goto done
if [%1] == [bcc32] goto done
if [%1] == [mingw32] goto done
+if [%1] == [msvc] goto done
+if [%1] == [msvc7] goto done
echo Converting Allegro files to DOS CR/LF format...
utod .../*.bat .../*.sh .../*.c *.cfg .../*.h .../*.inc .../*.rc
@@ -120,4 +129,4 @@
:done
echo Done!
-:end
+:end
\ No newline at end of file
diff -ur allegro.orig/makefile.vc allegro.new/makefile.vc
--- allegro.orig/makefile.vc Wed Nov 24 14:09:02 2004
+++ allegro.new/makefile.vc Thu Feb 3 20:30:04 2005
@@ -163,9 +163,16 @@
# -------- optimised build --------
-CFLAGS = $(WFLAGS) -Gd -Ox -GB $(RUNTIME_FLAGS)
+CFLAGS = $(WFLAGS) -Gd -O2 -GB $(RUNTIME_FLAGS)
SFLAGS = -Wall
LFLAGS = -release
+LIBPARMS =
+
+ifdef COMPILER_MSVC7
+ CFLAGS += -GL
+ LFLAGS += -LTCG
+ LIBPARMS += -LTCG
+endif
endif
endif
@@ -282,7 +289,7 @@
# -------- link as a static library --------
define MAKE_LIB
- $(RUNNER) lib @ -nologo -out:$(LIB_NAME) $(OBJECTS)
+ $(RUNNER) lib @ -nologo $(LIBPARMS) -out:$(LIB_NAME) $(OBJECTS)
endef
COMPILE_FLAGS = -DALLEGRO_STATICLINK
@@ -387,7 +394,7 @@
endif
define MAKE_PLUGIN_LIB
- $(RUNNER) lib @ -nologo -out:$(PLUGIN_LIB) $(PLUGIN_OBJS)
+ $(RUNNER) lib @ -nologo $(LIBPARMS) -out:$(PLUGIN_LIB) $(PLUGIN_OBJS)
endef
define LINK_WITH_PLUGINS