Browse Source

OSX big Commit ...

Roger Hughston 20 years ago
parent
commit
42b3ba9c82

+ 8 - 5
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 <iostream> or <iostream.h>?  Define HAVE_IOSTREAM
 // to nonempty if we should use <iostream>, or empty if we should use

+ 7 - 10
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%]

+ 7 - 3
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

+ 7 - 0
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.

+ 3 - 8
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

+ 1 - 1
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;
 

+ 1 - 1
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;
 

+ 1 - 1
dtool/src/interrogate/interrogate.cxx

@@ -21,7 +21,7 @@
 
 #include "interrogateDatabase.h"
 #include "cppGlobals.h"
-#include "notify.h"
+#include "pnotify.h"
 #include <time.h>
 
 // If our system getopt() doesn't come with getopt_long_only(), then use

+ 2 - 2
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 <ctype.h>
 #include <algorithm>
@@ -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 <sstream>\n";

+ 1 - 1
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"
 

+ 1 - 1
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

+ 1 - 1
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"
 

+ 1 - 1
dtool/src/interrogatedb/mutexDummyImpl.h

@@ -24,7 +24,7 @@
 
 #ifdef THREAD_DUMMY_IMPL
 
-#include "notify.h"
+#include "pnotify.h"
 
 ////////////////////////////////////////////////////////////////////
 //       Class : MutexDummyImpl

+ 1 - 1
dtool/src/interrogatedb/mutexNsprImpl.h

@@ -24,7 +24,7 @@
 
 #ifdef THREAD_NSPR_IMPL
 
-#include "notify.h"
+#include "pnotify.h"
 
 #include <prlock.h>
 

+ 1 - 1
dtool/src/interrogatedb/mutexPosixImpl.h

@@ -24,7 +24,7 @@
 
 #ifdef THREAD_POSIX_IMPL
 
-#include "notify.h"
+#include "pnotify.h"
 
 #include <pthread.h>
 #include <errno.h>

+ 1 - 1
dtool/src/interrogatedb/mutexWin32Impl.h

@@ -24,7 +24,7 @@
 
 #ifdef THREAD_WIN32_IMPL
 
-#include "notify.h"
+#include "pnotify.h"
 
 #include <windows.h>
 

+ 1 - 1
dtool/src/interrogatedb/typeHandle.h

@@ -21,7 +21,7 @@
 
 #include "dtoolbase.h"
 #include "typeRegistry.h"
-#include "notify.h"
+#include "pnotify.h"
 
 #include <set>
 

+ 1 - 1
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"
 

+ 2 - 2
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 \

+ 1 - 1
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;
 

+ 1 - 1
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 <algorithm>

+ 1 - 1
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"
 

+ 1 - 1
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"

+ 1 - 1
dtool/src/prc/notify.cxx

@@ -16,7 +16,7 @@
 //
 ////////////////////////////////////////////////////////////////////
 
-#include "notify.h"
+#include "pnotify.h"
 #include "notifyCategory.h"
 #include "configPageManager.h"
 #include "configVariableFilename.h"

+ 1 - 1
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"

+ 1 - 1
dtool/src/prc/notifyCategoryProxy.h

@@ -23,7 +23,7 @@
 
 #include "notifyCategory.h"
 #include "notifySeverity.h"
-#include "notify.h"
+#include "pnotify.h"
 
 ////////////////////////////////////////////////////////////////////
 //       Class : NotifyCategoryProxy

+ 1 - 1
dtool/src/prc/notifySeverity.cxx

@@ -17,7 +17,7 @@
 ////////////////////////////////////////////////////////////////////
 
 #include "notifySeverity.h"
-#include "notify.h"
+#include "pnotify.h"
 
 ostream &
 operator << (ostream &out, NotifySeverity severity) {

+ 6 - 1
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];
     }