From dfdcf8bfad7c8d05896eab4478cbd34481f88e8d Mon Sep 17 00:00:00 2001 From: Chris Brunner Date: Thu, 27 May 2010 23:45:57 +0000 Subject: [PATCH] 64-bit build support --- dtool/pptempl/Global.gmsvc.pp | 23 +++++++++++++++++++---- dtool/pptempl/compilerSettings.pp | 11 ++++++++--- 2 files changed, 27 insertions(+), 7 deletions(-) diff --git a/dtool/pptempl/Global.gmsvc.pp b/dtool/pptempl/Global.gmsvc.pp index 33760230ff..299decfce4 100644 --- a/dtool/pptempl/Global.gmsvc.pp +++ b/dtool/pptempl/Global.gmsvc.pp @@ -104,7 +104,11 @@ // '#defer extra_cflags $[extra_cflags] /STUFF' will never work because extra_cflags hasnt been // defined yet, so this just evaluates the reference to null and removes the reference and the // the defining extra_cflags in individual sources.pp's will not picked up. use END_FLAGS instead -#defer extra_cflags /EHsc /Zm500 /DWIN32_VC /DWIN32=1 $[WARNING_LEVEL_FLAG] $[END_CFLAGS] +#if $[eq $[USE_COMPILER], MSVC9x64] + #defer extra_cflags /EHsc /Zm500 /DWIN64_VC /DWIN64=1 $[WARNING_LEVEL_FLAG] $[END_CFLAGS] +#else + #defer extra_cflags /EHsc /Zm500 /DWIN32_VC /DWIN32=1 $[WARNING_LEVEL_FLAG] $[END_CFLAGS] +#endif #if $[direct_tau] #define tau_ipath $[TAU_ROOT]/include @@ -127,7 +131,12 @@ #defer STATIC_LIB_C $[LIBBER] /nologo $[sources] /OUT:"$[osfilename $[target]]" #defer STATIC_LIB_C++ $[STATIC_LIB_C] -#defer COMPILE_IDL midl /nologo /env win32 /Oicf $[DECYGWINED_INC_PATHLIST_ARGS] +#if $[eq $[USE_COMPILER], MSVC9x64] + #defer COMPILE_IDL midl /nologo /env win64 /Oicf $[DECYGWINED_INC_PATHLIST_ARGS] +#else + #defer COMPILE_IDL midl /nologo /env win32 /Oicf $[DECYGWINED_INC_PATHLIST_ARGS] +#endif + #defer COMPILE_RC rc /R /L 0x409 $[DECYGWINED_INC_PATHLIST_ARGS] // if we're attached, use dllbase.txt. otherwise let OS loader resolve dll addrspace collisions @@ -143,10 +152,16 @@ #defer LINKER_DEF_FILE_ARG $[if $[LINKER_DEF_FILE],/DEF:"$[LINKER_DEF_FILE]",] -#defer SHARED_LIB_C $[LINKER] /nologo /DLL $[LINKER_DEF_FILE_ARG] $[LDFLAGS_OPT$[OPTIMIZE]] $[DLLBASEARG] /OUT:"$[osfilename $[target]]" $[sources] $[decygwin %,/LIBPATH:"%",$[lpath] $[EXTRA_LIBPATH] $[tau_lpath]] $[patsubst %.lib,%.lib,%,lib%.lib,$[libs]] $[tau_libs] $[VER_RESOURCE]$[if $[and $[eq $[USE_COMPILER], MSVC9],$[not $[LINK_FORCE_STATIC_RELEASE_C_RUNTIME]]],; $[MT_BIN] -nologo -manifest $[target].manifest -outputresource:$[target]\;2,] +#if $or[ $[eq $[USE_COMPILER], MSVC9x64], $[eq $[USE_COMPILER], MSVC9]] + #define USE_MT 1 +#else + #define USE_MT 0 +#endif + +#defer SHARED_LIB_C $[LINKER] /nologo /DLL $[LINKER_DEF_FILE_ARG] $[LDFLAGS_OPT$[OPTIMIZE]] $[DLLBASEARG] /OUT:"$[osfilename $[target]]" $[sources] $[decygwin %,/LIBPATH:"%",$[lpath] $[EXTRA_LIBPATH] $[tau_lpath]] $[patsubst %.lib,%.lib,%,lib%.lib,$[libs]] $[tau_libs] $[VER_RESOURCE]$[if $[and $[eq $[USE_MT], 1],$[not $[LINK_FORCE_STATIC_RELEASE_C_RUNTIME]]],; $[MT_BIN] -nologo -manifest $[target].manifest -outputresource:$[target]\;2,] #defer SHARED_LIB_C++ $[SHARED_LIB_C] -#defer LINK_BIN_C $[LINKER] /nologo $[LDFLAGS_OPT$[OPTIMIZE]] $[sources] $[decygwin %,/LIBPATH:"%",$[lpath] $[EXTRA_LIBPATH] $[tau_lpath]] $[patsubst %.lib,%.lib,%,lib%.lib,$[libs]] $[tau_libs] /OUT:"$[osfilename $[target]]"$[if $[and $[eq $[USE_COMPILER], MSVC9],$[not $[LINK_FORCE_STATIC_RELEASE_C_RUNTIME]]],; $[MT_BIN] -nologo -manifest $[target].manifest -outputresource:$[target]\;1,] +#defer LINK_BIN_C $[LINKER] /nologo $[LDFLAGS_OPT$[OPTIMIZE]] $[sources] $[decygwin %,/LIBPATH:"%",$[lpath] $[EXTRA_LIBPATH] $[tau_lpath]] $[patsubst %.lib,%.lib,%,lib%.lib,$[libs]] $[tau_libs] /OUT:"$[osfilename $[target]]"$[if $[and $[eq $[USE_MT], 1],$[not $[LINK_FORCE_STATIC_RELEASE_C_RUNTIME]]],; $[MT_BIN] -nologo -manifest $[target].manifest -outputresource:$[target]\;1,] #defer LINK_BIN_C++ $[LINK_BIN_C] #defer MIDL_COMMAND $[COMPILE_IDL] /out $[ODIR] $[IDL_CDEFS:%=/D%] $[idl] diff --git a/dtool/pptempl/compilerSettings.pp b/dtool/pptempl/compilerSettings.pp index 2480768704..4af857566a 100644 --- a/dtool/pptempl/compilerSettings.pp +++ b/dtool/pptempl/compilerSettings.pp @@ -261,7 +261,8 @@ #define COMMONFLAGS /DHAVE_DINKUM /Zc:forScope // use "unsafe" QIfist flt->int rounding only if FAST_FLT_TO_INT is defined - #define REGULAR_OPTFLAGS /O2 /Ob2 $[if $[ne $[FAST_FLT_TO_INT],], /QIfist,] + // use /bigobj in 64-bit environment + #define REGULAR_OPTFLAGS $[if $[eq $[USE_COMPILER],MSVC9x64], /bigobj,] /O2 /Ob2 $[if $[ne $[FAST_FLT_TO_INT],], /QIfist,] #defer OPTFLAGS $[if $[OPT_MINSIZE],/Ox /Og /Ob1 /Oi /Os /Oy /GL,$[REGULAR_OPTFLAGS]] @@ -292,7 +293,7 @@ #endif // Note: all Opts will link w/debug info now - #define LINKER_FLAGS /DEBUG $[PROFILE_FLAG] /MAP $[MAPINFOFLAGS] /fixed:no /incremental:no /stack:4194304 + #define LINKER_FLAGS /DEBUG $[PROFILE_FLAG] $[if $[eq $[USE_COMPILER],MSVC9x64], /MACHINE:X64,] /MAP $[MAPINFOFLAGS] /fixed:no /incremental:no /stack:4194304 // Added to avoid old iostream reference problems #define LINKER_FLAGS $[LINKER_FLAGS] /NODEFAULTLIB:LIBCI.LIB @@ -405,6 +406,10 @@ #endif #defer tau_opts $[decygwin %,-I"%",$[EXTRA_INCPATH] $[ipath] $[WIN32_PLATFORMSDK_INCPATH] $[tau_ipath]] $[building_var:%=-D%] -#defer TAU_MAKE_IL $[PDT_ROOT]/Windows/bin/edgcpfe -o $[il_source] $[tau_opts] $[cdefines:%=-D%] $[C++FLAGS] -DWIN32=1 $[TAU_INSTRUMENTOR_FLAGS] $[source] +#if $[eq $[USE_COMPILER], MSVC9x64] + #defer TAU_MAKE_IL $[PDT_ROOT]/Windows/bin/edgcpfe -o $[il_source] $[tau_opts] $[cdefines:%=-D%] $[C++FLAGS] -DWIN64=1 $[TAU_INSTRUMENTOR_FLAGS] $[source] +#else + #defer TAU_MAKE_IL $[PDT_ROOT]/Windows/bin/edgcpfe -o $[il_source] $[tau_opts] $[cdefines:%=-D%] $[C++FLAGS] -DWIN32=1 $[TAU_INSTRUMENTOR_FLAGS] $[source] +#endif #defer TAU_MAKE_PDB $[PDT_ROOT]/Windows/bin/taucpdisp $[il_source] > $[pdb_source] #defer TAU_MAKE_INST $[TAU_ROOT]/bin/tau_instrumentor $[pdb_source] $[source] -o $[inst_source]