From 74890122cb7ded6fb59b73d408d9ad409dcd7e7d Mon Sep 17 00:00:00 2001 From: Joseph Lee Date: Wed, 1 Mar 2006 02:29:06 +0000 Subject: [PATCH] patches to support FreeBSD build --- dtool/Config.FreeBSD.pp | 178 +++++++++++++++++++++++++++++++++ dtool/Config.pp | 5 + dtool/src/dtoolutil/Sources.pp | 4 +- 3 files changed, 186 insertions(+), 1 deletion(-) create mode 100644 dtool/Config.FreeBSD.pp diff --git a/dtool/Config.FreeBSD.pp b/dtool/Config.FreeBSD.pp new file mode 100644 index 0000000000..43f09629dc --- /dev/null +++ b/dtool/Config.FreeBSD.pp @@ -0,0 +1,178 @@ +// +// Config.FreeBSD.pp +// +// This file defines some custom config variables for the FreeBSD +// platform. It makes some initial guesses about compiler features, +// etc. +// + +// What additional flags should we pass to interrogate? +#define SYSTEM_IGATE_FLAGS -D__i386__ -D__const=const + +// 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 + +// Do we have a gettimeofday() function? +#define HAVE_GETTIMEOFDAY 1 + +// 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 1 +#define HAVE_GETOPT_LONG_ONLY + +// Are the above getopt() functions defined in getopt.h, or somewhere else? +#define HAVE_GETOPT_H 1 + +// Can we determine the terminal width by making an ioctl(TIOCGWINSZ) call? +#define IOCTL_TERMINAL_WIDTH 1 + +// 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/environ to determine our +// environment variables at static init time? +#define HAVE_PROC_SELF_ENVIRON + +// 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 +#define PROTOTYPE_GLOBAL_ARGV +#define GLOBAL_ARGV +#define GLOBAL_ARGC + +// Can we read the file /proc/self/cmdline to determine our +// command-line arguments at static init time? +#define HAVE_PROC_SELF_CMDLINE + +// Should we include or ? Define HAVE_IOSTREAM +// to nonempty if we should use , or empty if we should use +// . +#define HAVE_IOSTREAM 1 + +// Do we have a true stringstream class defined in ? +#define HAVE_SSTREAM 1 + +// Does fstream::open() require a third parameter, specifying the +// umask? Versions of gcc prior to 3.2 had this. +#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 HAVE_NEW 1 + +// Do we have ? +#define HAVE_IO_H + +// Do we have ? +//#define HAVE_MALLOC_H +#define HAVE_SYS_MALLOC_H 1 + +// Do we have ? +#define HAVE_ALLOCA_H + +// Do we have ? +#define HAVE_LOCALE_H 1 + +// Do we have ? +#define HAVE_MINMAX_H + +// Do we have ? +#define HAVE_SYS_TYPES_H 1 +#define HAVE_SYS_TIME_H 1 + +// Do we have ? +#define HAVE_UNISTD_H 1 + +// Do we have ? +#define HAVE_UTIME_H 1 + +// Do we have ? +#define HAVE_DIRENT_H 1 + +// Do we have (and do we want to use it instead of dirent.h)? +#define HAVE_GLOB_H 1 + +// Do we have (and presumably a Linux-style audio +// interface)? +#define HAVE_SYS_SOUNDCARD_H 1 + +// Do we have RTTI (and )? +#define HAVE_RTTI 1 + +// Must global operator new and delete functions throw exceptions? +#define GLOBAL_OPERATOR_NEW_EXCEPTIONS 1 + +// What is the syntax of the STL allocator declaration? See +// LocalSetup.pp for allowable values. +#define STL_ALLOCATOR MODERN + +// The dynamic library file extension (usually .so .dll or .dylib): +#define DYNAMIC_LIB_EXT .so + +#define PYTHON_IPATH /usr/local/include/python2.4 +#define PYTHON_LPATH /usr/local/lib/python2.4 + +#define NSPR_IPATH /usr/local/include/nspr +#define NSPR_LPATH /usr/local/lib/nspr + +#define SSL_IPATH /usr/local/openssl +//#define SSL_097 1 + +#define JPEG_IPATH /usr/local/include +#define JPEG_LPATH /usr/local/lib + +#define PNG_IPATH /usr/local/include +#define PNG_LPATH /usr/local/lib + +#define TIFF_IPATH /usr/local/include +#define TIFF_LPATH /usr/local/lib + +#define CC ccache cc +#define CXX ccache c++ + +//#define LOCAL_INCS /usr/local/include +//#define LOCAL_LIBS /usr/local/lib +//#defer ipath $[ipath] /usr/local/include +//#defer lpath $[lpath] /usr/local/lib + +#defer EXTRA_IPATH $[EXTRA_IPATH] /usr/local/include +#defer EXTRA_LPATH $[EXTRA_LPATH] /usr/local/lib +//#defer alt_ipath $[alt_ipath] /usr/local/include +//#defer alt_lpath $[alt_lpath] /usr/local/lib + +#defer NSPR_LIBS $[NSPR_LIBS] thr diff --git a/dtool/Config.pp b/dtool/Config.pp index 774c3bdc1d..4ed8180bf7 100644 --- a/dtool/Config.pp +++ b/dtool/Config.pp @@ -730,6 +730,8 @@ #define USE_COMPILER GCC #elif $[eq $[PLATFORM], osx] #define USE_COMPILER GCC +#elif $[eq $[PLATFORM], FreeBSD] + #define USE_COMPILER GCC #endif // Permission masks to install data and executable files, @@ -854,6 +856,9 @@ #if $[eq $[PLATFORM], osx] #defer STATIC_LIB_C libtool -static -o $[target] $[sources] #defer STATIC_LIB_C++ libtool -static -o $[target] $[sources] +//#elif $[eq $[PLATFORM], FreeBSD] +// #defer STATIC_LIB_C libtool --mode=link -static -o $[target] $[sources] +// #defer STATIC_LIB_C++ libtool --mode=link -static -o $[target] $[sources] #else #defer STATIC_LIB_C ar cru $[target] $[sources] #defer STATIC_LIB_C++ ar cru $[target] $[sources] diff --git a/dtool/src/dtoolutil/Sources.pp b/dtool/src/dtoolutil/Sources.pp index 65da1b96dc..59ab38b5c5 100644 --- a/dtool/src/dtoolutil/Sources.pp +++ b/dtool/src/dtoolutil/Sources.pp @@ -1,7 +1,9 @@ #begin lib_target #define TARGET dtoolutil #define LOCAL_LIBS dtoolbase - #define UNIX_SYS_LIBS dl + #if $[ne $[PLATFORM], FreeBSD] + #define UNIX_SYS_LIBS dl + #endif #define COMBINED_SOURCES $[TARGET]_composite1.cxx $[TARGET]_composite2.cxx