From 051e5ee70f0d633a63e0e8d1f87f37334898718e Mon Sep 17 00:00:00 2001 From: Chris Brunner Date: Thu, 27 May 2010 23:28:00 +0000 Subject: [PATCH] 64-bit build support --- dtool/Config.Cygwin.pp | 5 ++ dtool/Config.Win64.pp | 174 +++++++++++++++++++++++++++++++++++++++++ dtool/LocalSetup.pp | 9 ++- 3 files changed, 186 insertions(+), 2 deletions(-) create mode 100755 dtool/Config.Win64.pp diff --git a/dtool/Config.Cygwin.pp b/dtool/Config.Cygwin.pp index 688d55bc7b..1420db98db 100644 --- a/dtool/Config.Cygwin.pp +++ b/dtool/Config.Cygwin.pp @@ -5,5 +5,10 @@ // platform, when ppremake has been compiled using Cygwin. It // inherits most of its parameters from Config.Win32.pp. // +// *** UNCOMMENT ONE OF THE TWO OPTIONS BELOW FOR 32 OR 64 BIT BUILDS +// 32-bit #include $[THISDIRPREFIX]Config.Win32.pp + +// 64-bit +// #include $[THISDIRPREFIX]Config.Win64.pp diff --git a/dtool/Config.Win64.pp b/dtool/Config.Win64.pp new file mode 100755 index 0000000000..3e7ff4a095 --- /dev/null +++ b/dtool/Config.Win64.pp @@ -0,0 +1,174 @@ +// +// Config.Win64.pp +// +// This file defines some custom config variables for the Windows +// platform, using MS VC++. It makes some initial guesses about +// compiler features, etc. +// + +// ******************************************************************* +// NOTE: you should not attempt to copy this file verbatim as your own +// personal Config.pp file. Instead, you should start with an empty +// Config.pp file, and add lines to it when you wish to override +// settings given in here. In the normal ppremake system, this file +// will always be read first, and then your personal Config.pp file +// will be read later, which gives you a chance to override the +// default settings found in this file. However, if you start by +// copying the entire file, it will be difficult to tell which +// settings you have customized, and it will be difficult to upgrade +// to a subsequent version of Panda. +// ******************************************************************* + +// What additional flags should we pass to interrogate? +#define SYSTEM_IGATE_FLAGS -longlong __int64 -D_X64_ -DWIN32_VC -D"_declspec(param)=" -D"__declspec(param)=" -D_near -D_far -D__near -D__far -D_WIN64 -D__stdcall -Dvolatile -Dmutable -DWIN64 + +// Additional flags to pass to the Tau instrumentor. +#define TAU_INSTRUMENTOR_FLAGS -DTAU_USE_C_API -DPROFILING_ON -DWIN64_VC -D_WIN64 -D__cdecl= -D__stdcall= -D__fastcall= -D__i386 -D_MSC_VER=1310 -D_W64= -D_INTEGRAL_MAX_BITS=64 --exceptions --late_tiebreaker --no_class_name_injection --no_warnings --restrict --microsoft --new_for_init + +// Is the platform big-endian (like an SGI workstation) or +// little-endian (like a PC)? Define this to the empty string to +// indicate little-endian, or nonempty to indicate big-endian. +#define WORDS_BIGENDIAN + +// Does the C++ compiler support namespaces? +#define HAVE_NAMESPACE 1 + +// Does the C++ compiler support ios::binary? +#define HAVE_IOS_BINARY 1 + +// How about the typename keyword? +#define HAVE_TYPENAME 1 + +// Will the compiler avoid inserting extra bytes in structs between a +// base struct and its derived structs? It is safe to define this +// false if you don't know, but if you know that you can get away with +// this you may gain a tiny performance gain by defining this true. +// If you define this true incorrectly, you will get lots of +// assertion failures on execution. +#define SIMPLE_STRUCT_POINTERS 1 + +// Do we have a gettimeofday() function? +#define HAVE_GETTIMEOFDAY + +// Does gettimeofday() take only one parameter? +#define GETTIMEOFDAY_ONE_PARAM + +// Do we have getopt() and/or getopt_long_only() built into the +// system? +#define HAVE_GETOPT +#define HAVE_GETOPT_LONG_ONLY + +// Are the above getopt() functions defined in getopt.h, or somewhere else? +#define PHAVE_GETOPT_H + +// Can we determine the terminal width by making an ioctl(TIOCGWINSZ) call? +#define IOCTL_TERMINAL_WIDTH + +// Do the system headers define a "streamsize" typedef? How about the +// ios::binary enumerated value? And other ios typedef symbols like +// ios::openmode and ios::fmtflags? +#define HAVE_STREAMSIZE 1 +#define HAVE_IOS_BINARY 1 +#define HAVE_IOS_TYPEDEFS 1 + +// Can we safely call getenv() at static init time? +#define STATIC_INIT_GETENV 1 + +// Can we read the file /proc/self/* to determine our +// environment variables at static init time? +#define HAVE_PROC_SELF_EXE +#define HAVE_PROC_SELF_MAPS +#define HAVE_PROC_SELF_ENVIRON +#define HAVE_PROC_SELF_CMDLINE + +// Do we have a global pair of argc/argv variables that we can read at +// static init time? Should we prototype them? What are they called? +#define HAVE_GLOBAL_ARGV 1 +#define PROTOTYPE_GLOBAL_ARGV +#define GLOBAL_ARGV __argv +#define GLOBAL_ARGC __argc + +// Should we include or ? Define PHAVE_IOSTREAM +// to nonempty if we should use , or empty if we should use +// . +#define PHAVE_IOSTREAM 1 + +// Do we have a true stringstream class defined in ? +#define PHAVE_SSTREAM 1 + +// Does fstream::open() require a third parameter, specifying the +// umask? +#define HAVE_OPEN_MASK + +// Do the compiler or system libraries define wchar_t for you? +#define HAVE_WCHAR_T 1 + +// Does define the typedef wstring? Most do, but for some +// reason, versions of gcc before 3.0 didn't do this. +#define HAVE_WSTRING 1 + +// Do we have ? +#define PHAVE_NEW 1 + +// Do we have ? +#define PHAVE_IO_H 1 + +// Do we have ? +#define PHAVE_MALLOC_H 1 + +// Do we have ? +#define PHAVE_ALLOCA_H + +// Do we have ? +#define PHAVE_LOCALE_H + +// Do we have ? +#define PHAVE_STRING_H 1 + +// Do we have ? +#define PHAVE_STDLIB_H + +// Do we have ? +#define PHAVE_LIMITS_H + +// Do we have ? +#define PHAVE_MINMAX_H 1 + +// Do we have ? +#define PHAVE_SYS_TYPES_H 1 +#define PHAVE_SYS_TIME_H + +// Do we have ? +#define PHAVE_UNISTD_H + +// Do we have ? +#define PHAVE_UTIME_H + +// Do we have ? +#define PHAVE_DIRENT_H + +// Do we have (and presumably a Linux-style audio +// interface)? +#define PHAVE_SYS_SOUNDCARD_H + +// Do we have (and therefore makecontext() / swapcontext())? +#define PHAVE_UCONTEXT_H + +// Do we have RTTI (and )? +#define HAVE_RTTI 1 + +// Do we have ? +#define PHAVE_STDINT_H + +// MSVC7 does support the latest STL allocator definitions. +#define USE_STL_ALLOCATOR 1 + +// can Intel C++ build this directory successfully (if not, change CC to msvc) +#define NOT_INTEL_BUILDABLE false + +// The dynamic library file extension (usually .so .dll or .dylib): +#define DYNAMIC_LIB_EXT .dll +#define STATIC_LIB_EXT .lib +#define BUNDLE_EXT + + diff --git a/dtool/LocalSetup.pp b/dtool/LocalSetup.pp index 832a6af4fb..ed3669680b 100644 --- a/dtool/LocalSetup.pp +++ b/dtool/LocalSetup.pp @@ -381,6 +381,11 @@ $[cdefine HAVE_DX8] /* Define if we have DirectX installed and want to build for DX. */ $[cdefine HAVE_DX9] +/* If we're building 64-bit, we want to use generic DirectX error libraries. */ +#if $[eq $[USE_COMPILER],MSVC9x64] + $[cdefine USE_GENERIC_DXERR_LIBRARY] +#endif + /* Define if we want to build tinydisplay. */ $[cdefine HAVE_TINYDISPLAY] @@ -679,10 +684,10 @@ $[cdefine USE_DELETED_CHAIN] $[cdefine WANT_NATIVE_NET] /* Turn off warnings for using scanf and such */ -#if $[eq $[USE_COMPILER],MSVC9] +#if $[or $[eq $[USE_COMPILER],MSVC9], $[USE_COMPILER],MSVC9x64] #print Will ignore CRT_SECURE warnings for MSVC9 $[cdefine _CRT_SECURE_NO_WARNINGS] - # pragma warning( disable : 4996 4275 ) + # pragma warning( disable : 4996 4275 4267 4099 4049 4013 4005 ) #endif