From 42b3ba9c82430f4a8e2e9fdfea3ef9c24f11bcce Mon Sep 17 00:00:00 2001 From: Roger Hughston Date: Fri, 17 Mar 2006 22:55:08 +0000 Subject: [PATCH] OSX big Commit ... --- dtool/Config.osx.pp | 13 ++++++++----- dtool/Config.pp | 17 +++++++---------- dtool/pptempl/Global.pp | 10 +++++++--- dtool/pptempl/Template.unix.pp | 7 +++++++ dtool/src/dtoolutil/load_dso.cxx | 11 +++-------- dtool/src/interrogate/functionRemap.cxx | 2 +- dtool/src/interrogate/interfaceMaker.cxx | 2 +- dtool/src/interrogate/interrogate.cxx | 2 +- dtool/src/interrogate/interrogateBuilder.cxx | 4 ++-- dtool/src/interrogate/interrogate_module.cxx | 2 +- .../interrogate/parameterRemapPTToPointer.cxx | 2 +- dtool/src/interrogate/typeManager.cxx | 2 +- dtool/src/interrogatedb/mutexDummyImpl.h | 2 +- dtool/src/interrogatedb/mutexNsprImpl.h | 2 +- dtool/src/interrogatedb/mutexPosixImpl.h | 2 +- dtool/src/interrogatedb/mutexWin32Impl.h | 2 +- dtool/src/interrogatedb/typeHandle.h | 2 +- dtool/src/interrogatedb/typeRegistry.h | 2 +- dtool/src/prc/Sources.pp | 4 ++-- dtool/src/prc/configPageManager.h | 2 +- dtool/src/prc/configVariableCore.cxx | 2 +- dtool/src/prc/configVariableCore.h | 2 +- dtool/src/prc/configVariableManager.h | 2 +- dtool/src/prc/notify.cxx | 2 +- dtool/src/prc/notifyCategory.cxx | 2 +- dtool/src/prc/notifyCategoryProxy.h | 2 +- dtool/src/prc/notifySeverity.cxx | 2 +- dtool/src/prckeys/signPrcFile_src.cxx | 7 ++++++- 28 files changed, 62 insertions(+), 51 deletions(-) diff --git a/dtool/Config.osx.pp b/dtool/Config.osx.pp index 99115ae8a9..2b0d1d0f52 100644 --- a/dtool/Config.osx.pp +++ b/dtool/Config.osx.pp @@ -8,13 +8,13 @@ //#define PYTHON_IPATH /Library/Frameworks/Python.framework/Headers //#define PYTHON_LPATH /Library/Frameworks/Python.framework/Headers -#define PYTHON_IPATH /System/Library/Frameworks/Python.framework/Headers +#define PYTHON_IPATH /Library/Frameworks/Python.framework/Headers #define HAVE_PYTHON 1 #define PYTHON_FRAMEWORK Python // What additional flags should we pass to interrogate? -#define SYSTEM_IGATE_FLAGS -D__ppc__ -D__const=const -Dvolatile -D__BIG_ENDIAN__ -D__inline__=inline +#define SYSTEM_IGATE_FLAGS -D__ppc__ -D__const=const -Dvolatile -D__BIG_ENDIAN__ -D__inline__=inline -D__GNUC__ #define HAVE_GL 1 #define IS_OSX 1 @@ -43,6 +43,9 @@ //#define HAVE_FFTW 1 +#define TIFF_IPATH /opt/local/include +#define TIFF_LPATH /opt/local/lib + // 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. @@ -100,12 +103,12 @@ // 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 +#define GLOBAL_ARGV __Argv +#define GLOBAL_ARGC __Argc // Can we read the file /proc/self/cmdline to determine our // command-line arguments at static init time? -#define HAVE_PROC_SELF_CMDLINE 1 +#define HAVE_PROC_SELF_CMDLINE // Should we include or ? Define HAVE_IOSTREAM // to nonempty if we should use , or empty if we should use diff --git a/dtool/Config.pp b/dtool/Config.pp index 233b3c3d55..0842282674 100644 --- a/dtool/Config.pp +++ b/dtool/Config.pp @@ -476,17 +476,14 @@ // Is OpenGL installed, and where? This should include libGL as well // as libGLU, if they are in different places. +#defer GL_IPATH +#defer GL_LPATH +#defer GL_LIBS #if $[WINDOWS_PLATFORM] - #defer GL_IPATH - #defer GL_LPATH #define GL_LIBS opengl32.lib glu32.lib #elif $[OSX_PLATFORM] - #defer GL_IPATH - #defer GL_LPATH /System/Library/Frameworks/OpenGL.framework/Libraries/ #defer GL_FRAMEWORK OpenGL - #defer GL_LIBS GL GLU #else - #defer GL_IPATH #defer GL_LPATH /usr/X11R6/lib #defer GL_LIBS GL GLU #endif @@ -843,12 +840,12 @@ // list of dependent libraries, and $[lpath] is a space-separated list // of directories in which those libraries can be found. #defer LINK_BIN_C $[cc_ld] -o $[target] $[sources] $[flags] $[lpath:%=-L%] $[libs:%=-l%]\ - $[fpath:%=-Wl,-F%] $[patsubst %,-framework %, $[frameworks]] + $[fpath:%=-Wl,-F%] $[patsubst %,-framework %, $[bin_frameworks]] #defer LINK_BIN_C++ $[cxx_ld]\ -o $[target] $[sources]\ $[flags]\ $[lpath:%=-L%] $[libs:%=-l%]\ - $[fpath:%=-Wl,-F%] $[patsubst %,-framework %, $[frameworks]] + $[fpath:%=-Wl,-F%] $[patsubst %,-framework %, $[bin_frameworks]] // How to generate a static C or C++ library. $[target] is the // name of the library to generate, and $[sources] is the list of .o @@ -880,8 +877,8 @@ // which those libraries can be found. #if $[eq $[PLATFORM], osx] #defer SHARED_LIB_C $[cc_ld] -o $[target] -install_name $[notdir $[target]] $[sources] $[lpath:%=-L%] $[libs:%=-l%] $[patsubst %,-framework %, $[frameworks]] - #defer SHARED_LIB_C++ $[cxx_ld] -dynamic -dynamiclib -o $[target] -install_name $[notdir $[target]] $[sources] $[lpath:%=-L%] $[libs:%=-l%] $[patsubst %,-framework %, $[frameworks]] - #defer BUNDLE_LIB_C++ $[cxx_ld] -bundle -o $[target] -install_name $[notdir $[target]] $[sources] $[lpath:%=-L%] $[libs:%=-l%] $[patsubst %,-framework %, $[frameworks]] + #defer SHARED_LIB_C++ $[cxx_ld] -undefined dynamic_lookup -dynamic -dynamiclib -o $[target] -install_name $[notdir $[target]] $[sources] $[lpath:%=-L%] $[libs:%=-l%] $[patsubst %,-framework %, $[frameworks]] + #defer BUNDLE_LIB_C++ $[cxx_ld] -undefined dynamic_lookup -bundle -o $[target] $[sources] $[lpath:%=-L%] $[libs:%=-l%] $[patsubst %,-framework %, $[frameworks]] #else #defer SHARED_LIB_C $[cc_ld] -shared -o $[target] $[sources] $[lpath:%=-L%] $[libs:%=-l%] #defer SHARED_LIB_C++ $[cxx_ld] -shared -o $[target] $[sources] $[lpath:%=-L%] $[libs:%=-l%] diff --git a/dtool/pptempl/Global.pp b/dtool/pptempl/Global.pp index a1a76b4bd0..6bac30acfd 100644 --- a/dtool/pptempl/Global.pp +++ b/dtool/pptempl/Global.pp @@ -475,13 +475,17 @@ // target claims to require. This returns a space-separated set of // framework names only; the -framework switch is not included here. #defun get_frameworks - #define alt_framework $[if $[IGNORE_LIB_DEFAULTS_HACK],,$[stl_framework] $[nspr_framework] $[python_framework]] + #define alt_frameworks $[if $[IGNORE_LIB_DEFAULTS_HACK],,$[stl_framework] $[nspr_framework] $[python_framework]] + + #if $[OSX_PLATFORM] + #set alt_frameworks $[alt_frameworks] $[OSX_SYS_FRAMEWORKS] + #endif #foreach package $[use_packages] - #set alt_framework $[alt_framework] $[$[package]_framework] + #set alt_frameworks $[alt_frameworks] $[$[package]_framework] #end package - $[alt_framework] + $[alt_frameworks] #end get_frameworks // This function returns the appropriate set of library names to link diff --git a/dtool/pptempl/Template.unix.pp b/dtool/pptempl/Template.unix.pp index efda1da89c..f34edeeb38 100644 --- a/dtool/pptempl/Template.unix.pp +++ b/dtool/pptempl/Template.unix.pp @@ -381,6 +381,13 @@ $[install_lib_dir]/lib$[TARGET]$[DYNAMIC_LIB_EXT] : $[ODIR]/lib$[TARGET]$[DYNAMI #define dest $[install_lib_dir] $[TAB] $[INSTALL] +#if $[BUNDLE_EXT] +$[install_lib_dir]/lib$[TARGET]$[BUNDLE_EXT] : $[ODIR]/lib$[TARGET]$[BUNDLE_EXT] +#define local $[ODIR]/lib$[TARGET]$[BUNDLE_EXT] +#define dest $[install_lib_dir] +$[TAB] $[INSTALL] +#endif // BUNDLE_EXT + #if $[igatescan] // Now, some additional rules to generate and compile the interrogate // data, if needed. diff --git a/dtool/src/dtoolutil/load_dso.cxx b/dtool/src/dtoolutil/load_dso.cxx index 8f0d0804b2..947dabee21 100644 --- a/dtool/src/dtoolutil/load_dso.cxx +++ b/dtool/src/dtoolutil/load_dso.cxx @@ -115,16 +115,10 @@ load_dso_error() { void * load_dso(const Filename &filename) { - cerr << "_dyld_present() = " << _dyld_present() << endl; - cerr << "_dyld_image_count() = " << _dyld_image_count() << endl; std::string fname = filename.to_os_specific(); - printf("----- Trying To Load %s \n",fname.c_str()); - void * answer = dlopen(fname.c_str(),RTLD_NOW| RTLD_LOCAL); - cerr << "_dyld_present() = " << _dyld_present() << endl; - cerr << "_dyld_image_count() = " << _dyld_image_count() << endl; - + //void * answer = dlopen(fname.c_str(),RTLD_NOW); return answer; @@ -132,7 +126,8 @@ void * load_dso(const Filename &filename) string load_dso_error() { - return "No DSO loading yet!"; + return std::string(dlerror()); + //return "No DSO loading yet!"; } #else diff --git a/dtool/src/interrogate/functionRemap.cxx b/dtool/src/interrogate/functionRemap.cxx index efd804fe09..081a088d71 100644 --- a/dtool/src/interrogate/functionRemap.cxx +++ b/dtool/src/interrogate/functionRemap.cxx @@ -30,7 +30,7 @@ #include "cppParameterList.h" #include "cppReferenceType.h" #include "interrogateType.h" -#include "notify.h" +#include "pnotify.h" extern bool inside_python_native; diff --git a/dtool/src/interrogate/interfaceMaker.cxx b/dtool/src/interrogate/interfaceMaker.cxx index d4e3dc153d..aa215e160a 100644 --- a/dtool/src/interrogate/interfaceMaker.cxx +++ b/dtool/src/interrogate/interfaceMaker.cxx @@ -39,7 +39,7 @@ #include "interrogateElement.h" #include "cppFunctionType.h" #include "cppParameterList.h" -#include "notify.h" +#include "pnotify.h" InterrogateType dummy_type; diff --git a/dtool/src/interrogate/interrogate.cxx b/dtool/src/interrogate/interrogate.cxx index e6af81d09a..848ef9ba6d 100644 --- a/dtool/src/interrogate/interrogate.cxx +++ b/dtool/src/interrogate/interrogate.cxx @@ -21,7 +21,7 @@ #include "interrogateDatabase.h" #include "cppGlobals.h" -#include "notify.h" +#include "pnotify.h" #include // If our system getopt() doesn't come with getopt_long_only(), then use diff --git a/dtool/src/interrogate/interrogateBuilder.cxx b/dtool/src/interrogate/interrogateBuilder.cxx index 67a41754a3..1886eef974 100644 --- a/dtool/src/interrogate/interrogateBuilder.cxx +++ b/dtool/src/interrogate/interrogateBuilder.cxx @@ -48,7 +48,7 @@ #include "cppTypeDeclaration.h" #include "cppEnumType.h" #include "cppCommentBlock.h" -#include "notify.h" +#include "pnotify.h" #include #include @@ -358,7 +358,7 @@ void InterrogateBuilder::write_code(ostream &out_code,ostream * out_include, Int ostringstream declaration_bodies; if (watch_asserts) { - declaration_bodies << "#include \"notify.h\"\n"; + declaration_bodies << "#include \"pnotify.h\"\n"; } declaration_bodies << "#include \n"; diff --git a/dtool/src/interrogate/interrogate_module.cxx b/dtool/src/interrogate/interrogate_module.cxx index 355057cd02..63d0fd4dfe 100644 --- a/dtool/src/interrogate/interrogate_module.cxx +++ b/dtool/src/interrogate/interrogate_module.cxx @@ -25,7 +25,7 @@ #include "interrogate_request.h" #include "load_dso.h" #include "pystub.h" -#include "notify.h" +#include "pnotify.h" #include "set" diff --git a/dtool/src/interrogate/parameterRemapPTToPointer.cxx b/dtool/src/interrogate/parameterRemapPTToPointer.cxx index a8634e2596..ded249449b 100644 --- a/dtool/src/interrogate/parameterRemapPTToPointer.cxx +++ b/dtool/src/interrogate/parameterRemapPTToPointer.cxx @@ -24,7 +24,7 @@ #include "cppType.h" #include "cppStructType.h" #include "cppDeclaration.h" -#include "notify.h" +#include "pnotify.h" //////////////////////////////////////////////////////////////////// // Function: ParameterRemapPTToPointer::Constructor diff --git a/dtool/src/interrogate/typeManager.cxx b/dtool/src/interrogate/typeManager.cxx index 421a41a061..ac343ab4dd 100644 --- a/dtool/src/interrogate/typeManager.cxx +++ b/dtool/src/interrogate/typeManager.cxx @@ -28,7 +28,7 @@ #include "cppSimpleType.h" #include "cppStructType.h" #include "cppTypeDeclaration.h" -#include "notify.h" +#include "pnotify.h" #include "cppTypedef.h" #include "cppEnumType.h" diff --git a/dtool/src/interrogatedb/mutexDummyImpl.h b/dtool/src/interrogatedb/mutexDummyImpl.h index b03ee4482f..6fa8759a04 100644 --- a/dtool/src/interrogatedb/mutexDummyImpl.h +++ b/dtool/src/interrogatedb/mutexDummyImpl.h @@ -24,7 +24,7 @@ #ifdef THREAD_DUMMY_IMPL -#include "notify.h" +#include "pnotify.h" //////////////////////////////////////////////////////////////////// // Class : MutexDummyImpl diff --git a/dtool/src/interrogatedb/mutexNsprImpl.h b/dtool/src/interrogatedb/mutexNsprImpl.h index d71597206f..ca4aa96664 100644 --- a/dtool/src/interrogatedb/mutexNsprImpl.h +++ b/dtool/src/interrogatedb/mutexNsprImpl.h @@ -24,7 +24,7 @@ #ifdef THREAD_NSPR_IMPL -#include "notify.h" +#include "pnotify.h" #include diff --git a/dtool/src/interrogatedb/mutexPosixImpl.h b/dtool/src/interrogatedb/mutexPosixImpl.h index 7520e299be..73f38782a8 100644 --- a/dtool/src/interrogatedb/mutexPosixImpl.h +++ b/dtool/src/interrogatedb/mutexPosixImpl.h @@ -24,7 +24,7 @@ #ifdef THREAD_POSIX_IMPL -#include "notify.h" +#include "pnotify.h" #include #include diff --git a/dtool/src/interrogatedb/mutexWin32Impl.h b/dtool/src/interrogatedb/mutexWin32Impl.h index c7c84a8703..aebf204e19 100644 --- a/dtool/src/interrogatedb/mutexWin32Impl.h +++ b/dtool/src/interrogatedb/mutexWin32Impl.h @@ -24,7 +24,7 @@ #ifdef THREAD_WIN32_IMPL -#include "notify.h" +#include "pnotify.h" #include diff --git a/dtool/src/interrogatedb/typeHandle.h b/dtool/src/interrogatedb/typeHandle.h index 206739d308..3477f6cc98 100644 --- a/dtool/src/interrogatedb/typeHandle.h +++ b/dtool/src/interrogatedb/typeHandle.h @@ -21,7 +21,7 @@ #include "dtoolbase.h" #include "typeRegistry.h" -#include "notify.h" +#include "pnotify.h" #include diff --git a/dtool/src/interrogatedb/typeRegistry.h b/dtool/src/interrogatedb/typeRegistry.h index 49324e2905..31a6ad93ff 100644 --- a/dtool/src/interrogatedb/typeRegistry.h +++ b/dtool/src/interrogatedb/typeRegistry.h @@ -21,7 +21,7 @@ #include "dtoolbase.h" #include "mutexImpl.h" -#include "notify.h" +#include "pnotify.h" #include "pvector.h" #include "pmap.h" diff --git a/dtool/src/prc/Sources.pp b/dtool/src/prc/Sources.pp index 5725c0e1ff..ef2a7d3ed3 100644 --- a/dtool/src/prc/Sources.pp +++ b/dtool/src/prc/Sources.pp @@ -25,7 +25,7 @@ configVariableSearchPath.I configVariableSearchPath.h \ configVariableString.I configVariableString.h \ globPattern.I globPattern.h \ - notify.I notify.h \ + pnotify.I pnotify.h \ notifyCategory.I notifyCategory.h \ notifyCategoryProxy.I notifyCategoryProxy.h \ notifySeverity.h \ @@ -74,7 +74,7 @@ configVariableSearchPath.I configVariableSearchPath.h \ configVariableString.I configVariableString.h \ globPattern.I globPattern.h \ - notify.I notify.h \ + pnotify.I pnotify.h \ notifyCategory.I notifyCategory.h \ notifyCategoryProxy.I notifyCategoryProxy.h \ notifySeverity.h \ diff --git a/dtool/src/prc/configPageManager.h b/dtool/src/prc/configPageManager.h index 9ea3d57d25..de5636bfe1 100644 --- a/dtool/src/prc/configPageManager.h +++ b/dtool/src/prc/configPageManager.h @@ -23,7 +23,7 @@ #include "pvector.h" #include "dSearchPath.h" #include "globPattern.h" -#include "notify.h" +#include "pnotify.h" class ConfigPage; diff --git a/dtool/src/prc/configVariableCore.cxx b/dtool/src/prc/configVariableCore.cxx index b323fa0c76..9403d8472c 100644 --- a/dtool/src/prc/configVariableCore.cxx +++ b/dtool/src/prc/configVariableCore.cxx @@ -20,7 +20,7 @@ #include "configDeclaration.h" #include "configPage.h" #include "pset.h" -#include "notify.h" +#include "pnotify.h" #include "config_prc.h" #include diff --git a/dtool/src/prc/configVariableCore.h b/dtool/src/prc/configVariableCore.h index 382deb75b7..0ea1066ba2 100644 --- a/dtool/src/prc/configVariableCore.h +++ b/dtool/src/prc/configVariableCore.h @@ -22,7 +22,7 @@ #include "dtoolbase.h" #include "configFlags.h" #include "configPageManager.h" -#include "notify.h" +#include "pnotify.h" #include "pvector.h" #include "pmap.h" diff --git a/dtool/src/prc/configVariableManager.h b/dtool/src/prc/configVariableManager.h index 97c3e939b4..5f127c9d24 100644 --- a/dtool/src/prc/configVariableManager.h +++ b/dtool/src/prc/configVariableManager.h @@ -21,7 +21,7 @@ #include "dtoolbase.h" #include "configFlags.h" -#include "notify.h" +#include "pnotify.h" #include "globPattern.h" #include "pvector.h" #include "pmap.h" diff --git a/dtool/src/prc/notify.cxx b/dtool/src/prc/notify.cxx index fb65a8c970..ab1210f5d2 100644 --- a/dtool/src/prc/notify.cxx +++ b/dtool/src/prc/notify.cxx @@ -16,7 +16,7 @@ // //////////////////////////////////////////////////////////////////// -#include "notify.h" +#include "pnotify.h" #include "notifyCategory.h" #include "configPageManager.h" #include "configVariableFilename.h" diff --git a/dtool/src/prc/notifyCategory.cxx b/dtool/src/prc/notifyCategory.cxx index bf82dd6332..535079d2d5 100644 --- a/dtool/src/prc/notifyCategory.cxx +++ b/dtool/src/prc/notifyCategory.cxx @@ -17,7 +17,7 @@ //////////////////////////////////////////////////////////////////// #include "notifyCategory.h" -#include "notify.h" +#include "pnotify.h" #include "configPageManager.h" #include "configVariableString.h" #include "configVariableBool.h" diff --git a/dtool/src/prc/notifyCategoryProxy.h b/dtool/src/prc/notifyCategoryProxy.h index e6d75c4fe6..bd4989aa12 100644 --- a/dtool/src/prc/notifyCategoryProxy.h +++ b/dtool/src/prc/notifyCategoryProxy.h @@ -23,7 +23,7 @@ #include "notifyCategory.h" #include "notifySeverity.h" -#include "notify.h" +#include "pnotify.h" //////////////////////////////////////////////////////////////////// // Class : NotifyCategoryProxy diff --git a/dtool/src/prc/notifySeverity.cxx b/dtool/src/prc/notifySeverity.cxx index 97646e5d80..e51c621856 100644 --- a/dtool/src/prc/notifySeverity.cxx +++ b/dtool/src/prc/notifySeverity.cxx @@ -17,7 +17,7 @@ //////////////////////////////////////////////////////////////////// #include "notifySeverity.h" -#include "notify.h" +#include "pnotify.h" ostream & operator << (ostream &out, NotifySeverity severity) { diff --git a/dtool/src/prckeys/signPrcFile_src.cxx b/dtool/src/prckeys/signPrcFile_src.cxx index 280f2d9dd3..8bfc5b888a 100644 --- a/dtool/src/prckeys/signPrcFile_src.cxx +++ b/dtool/src/prckeys/signPrcFile_src.cxx @@ -238,7 +238,12 @@ sign_prc(Filename filename, bool no_comments, EVP_PKEY *pkey) { static const size_t row_width = 32; for (size_t p = 0; p < sig_size; p += row_width) { out << "##!sig "; - size_t end = min(sig_size, p + row_width); + +// size_t end = min(sig_size, p + row_width); + size_t end = sig_size; + if(end > p+row_width) + end = p+row_width; + for (size_t q = p; q < end; q++) { out << setw(2) << (unsigned int)sig_data[q]; }