diff --git a/dtool/Config.osxintel.pp b/dtool/Config.osxintel.pp index 5aaaa13e32..e3949a31f5 100644 --- a/dtool/Config.osxintel.pp +++ b/dtool/Config.osxintel.pp @@ -168,7 +168,7 @@ #define HAVE_IO_H // Do we have ? -#define HAVE_MALLOC_H 1 +#define HAVE_MALLOC_H // Do we have ? #define HAVE_ALLOCA_H 1 diff --git a/dtool/pptempl/Depends.pp b/dtool/pptempl/Depends.pp index 5dd886f69f..4e3c55d37a 100644 --- a/dtool/pptempl/Depends.pp +++ b/dtool/pptempl/Depends.pp @@ -27,10 +27,14 @@ // We define $[c_sources], $[cxx_sources], $[yxx_sources], and // $[lxx_sources] within each target, which lists original files as - // well as synthetic composite files. There's also - // $[compile_sources], which is the union of all the others: any - // source files that are actually compiled and result in a generated - // .o (or .obj) file. + // well as synthetic composite files. We also now add + // $[cxx_interrogate_sources], which are the C++ files generated by + // interrogate. Under OSX, we want to compile these files + // separately. + + // Finally, there's $[compile_sources], which is the union of all + // the others: any source files that are actually compiled and + // result in a generated .o (or .obj) file. // Finally, we build up $[composite_list] out here to list all of // the composite files generated for all targets. @@ -78,11 +82,17 @@ // Now compute the source files. #define c_sources $[filter %.c,$[get_sources]] #define cxx_sources $[filter-out %_src.cxx,$[filter %.cxx %.cpp,$[get_sources]]] + #define cxx_interrogate_sources + #if $[PYTHON_MODULE_ONLY] + #set cxx_interrogate_sources $[cxx_sources] + #set cxx_sources + #endif + #define yxx_sources $[filter %.yxx,$[get_sources]] #define lxx_sources $[filter %.lxx,$[get_sources]] // Define what the object files are. - #foreach file $[c_sources] $[cxx_sources] $[yxx_sources] $[lxx_sources] + #foreach file $[c_sources] $[cxx_sources] $[cxx_interrogate_sources] $[yxx_sources] $[lxx_sources] #define $[file]_obj $[patsubst %.c %.cxx %.cpp %.yxx %.lxx,$[ODIR]/$[obj_prefix]%$[OBJ],$[notdir $[file]]] #push 1 $[file]_obj #end file @@ -97,7 +107,11 @@ #define $[composite_file]_obj $[ODIR]/$[TARGET]_composite$[OBJ] #push 1 $[composite_file]_sources #push 1 $[composite_file]_obj - #set cxx_sources $[composite_file] + #if $[PYTHON_MODULE_ONLY] + #set cxx_interrogate_sources $[composite_file] + #else + #set cxx_sources $[composite_file] + #endif #endif #if $[> $[words $[c_sources]], 1] // If we have multiple C files, put them together into one @@ -128,6 +142,10 @@ #define $[generated_file]_obj $[get_igateoutput:%.cxx=%$[OBJ]] #define $[generated_file]_sources $[get_igatescan] #push 1 $[generated_file]_obj + // We add this to cxx_sources instead of cxx_interrogate_sources, + // even though it's an interrogate-generated file, because it's + // not a module file--we really only accumulate module files into + // cxx_interrogate_sources. #set cxx_sources $[cxx_sources] $[generated_file] #endif #if $[get_igatemout] @@ -135,10 +153,10 @@ #define $[generated_file]_obj $[get_igatemout:%.cxx=%$[OBJ]] #define $[generated_file]_sources none #push 1 $[generated_file]_obj - #set cxx_sources $[cxx_sources] $[generated_file] + #set cxx_interrogate_sources $[cxx_interrogate_sources] $[generated_file] #endif - #define compile_sources $[c_sources] $[cxx_sources] + #define compile_sources $[c_sources] $[cxx_sources] $[cxx_interrogate_sources] #end metalib_target lib_target noinst_lib_target test_lib_target static_lib_target ss_lib_target bin_target noinst_bin_target test_bin_target diff --git a/dtool/pptempl/Template.gmsvc.pp b/dtool/pptempl/Template.gmsvc.pp index 0546f3adf5..7f0f81aeb1 100644 --- a/dtool/pptempl/Template.gmsvc.pp +++ b/dtool/pptempl/Template.gmsvc.pp @@ -856,7 +856,7 @@ $[TAB] $[COMPILE_C] // Rules to compile C++ files. -#foreach file $[sort $[cxx_sources]] +#foreach file $[sort $[cxx_sources] $[cxx_interrogate_sources]] #define target $[$[file]_obj] #define source $[file] #define ipath $[target_ipath] diff --git a/dtool/pptempl/Template.nmake.pp b/dtool/pptempl/Template.nmake.pp index c2284cbe2c..dfd984d49b 100644 --- a/dtool/pptempl/Template.nmake.pp +++ b/dtool/pptempl/Template.nmake.pp @@ -868,7 +868,7 @@ $[TAB] $[COMPILE_C] // Rules to compile C++ files. -#foreach file $[sort $[cxx_sources]] +#foreach file $[sort $[cxx_sources] $[cxx_interrogate_sources]] #define target $[$[file]_obj] #define source $[file] #define ipath $[target_ipath] diff --git a/dtool/pptempl/Template.unix.pp b/dtool/pptempl/Template.unix.pp index 51f349edef..68ac4cda51 100644 --- a/dtool/pptempl/Template.unix.pp +++ b/dtool/pptempl/Template.unix.pp @@ -347,12 +347,14 @@ igate : $[get_igatedb(metalib_target lib_target ss_lib_target)] // various .obj files. #define sources \ - $[patsubst %,$[%_obj],$[compile_sources]] + $[patsubst %,$[%_obj],$[c_sources] $[cxx_sources]] + #define interrogate_sources \ + $[patsubst %,$[%_obj],$[cxx_interrogate_sources]] #define cc_ld $[or $[get_ld],$[CC]] #define cxx_ld $[or $[get_ld],$[CXX]] #define varname $[subst -,_,lib$[TARGET]_so] -$[varname] = $[sources] +$[varname] = $[sources] $[if $[not $[BUNDLE_EXT]],$[interrogate_sources]] #define target $[ODIR]/lib$[TARGET]$[DYNAMIC_LIB_EXT] #define sources $($[varname]) @@ -366,7 +368,7 @@ $[TAB] $[shared_lib_c] #if $[BUNDLE_EXT] // Also generate the bundles (on OSX only). #define target $[ODIR]/lib$[TARGET]$[BUNDLE_EXT] - #define sources $[ODIR]/lib$[TARGET]$[DYNAMIC_LIB_EXT] + #define sources $[interrogate_sources] $[ODIR]/lib$[TARGET]$[DYNAMIC_LIB_EXT] $[target] : $[sources] $[static_lib_dependencies] $[TAB] $[BUNDLE_LIB_C++] #endif // BUNDLE_EXT @@ -700,7 +702,7 @@ $[TAB] $[compile_c] // Rules to compile C++ files (static objects). -#foreach file $[sort $[cxx_sources]] +#foreach file $[sort $[cxx_sources] $[cxx_interrogate_sources]] #define target $[$[file]_obj] #define source $[file] #define ipath $[target_ipath] @@ -741,7 +743,7 @@ $[TAB] $[compile_c] // Rules to compile C++ files (shared objects). -#foreach file $[sort $[cxx_sources]] +#foreach file $[sort $[cxx_sources] $[cxx_interrogate_sources]] #define target $[$[file]_obj] #define source $[file] #define ipath $[target_ipath] diff --git a/dtool/src/attach/ctattach.drv b/dtool/src/attach/ctattach.drv index ae97fda4c3..5d71e7f245 100755 --- a/dtool/src/attach/ctattach.drv +++ b/dtool/src/attach/ctattach.drv @@ -130,6 +130,7 @@ if (( $proj eq "-" ) || ( $flav eq "-" )) { if (( $curflav eq "" ) || ( $noflav == 0 )) { $envsep{"PATH"} = ":" ; $envsep{"LD_LIBRARY_PATH"} = ":" ; + $envsep{"DYLD_LIBRARY_PATH"} = ":" ; $envsep{"PFPATH"} = ":" ; $envsep{"SSPATH"} = ":" ; $envsep{"STKPATH"} = ":" ; diff --git a/dtool/src/attach/ctattch.pl b/dtool/src/attach/ctattch.pl index 71172440f5..660b1db846 100644 --- a/dtool/src/attach/ctattch.pl +++ b/dtool/src/attach/ctattch.pl @@ -374,6 +374,7 @@ sub CTAttachCompute { #if ( -e $item ) { &CTAttachMod( "PATH", $item, $root, $proj ) ; &CTAttachMod( "LD_LIBRARY_PATH", $item, $root, $proj ) ; + &CTAttachMod( "DYLD_LIBRARY_PATH", $item, $root, $proj ) ; #} $item = $root . "/built/include" ; diff --git a/dtool/src/attach/ctattch.pl.rnd b/dtool/src/attach/ctattch.pl.rnd index f73e2910db..02edd6103b 100644 --- a/dtool/src/attach/ctattch.pl.rnd +++ b/dtool/src/attach/ctattch.pl.rnd @@ -565,6 +565,7 @@ sub CTAttachCompute { &CTAttachAddToMod( "PATH", $root . "/bin" ) ; &CTAttachAddToMod( "LD_LIBRARY_PATH", $root . "/lib" ) ; + &CTAttachAddToMod( "DYLD_LIBRARY_PATH", $root . "/lib" ) ; #&CTAttachAddToMod( "CDPATH", $root . "/src/all" ) ; &CTAttachAddToMod( "CT_INCLUDE_PATH", $root . "/include" ) ; &CTAttachAddToMod( "DC_PATH", $root . "/etc" ) ; diff --git a/dtool/src/attach/ctunattach.drv b/dtool/src/attach/ctunattach.drv index 134e5ef8ea..365faf144b 100644 --- a/dtool/src/attach/ctunattach.drv +++ b/dtool/src/attach/ctunattach.drv @@ -29,6 +29,7 @@ foreach $proj ( @ARGV ) { if ( $curflav ne "" ) { $envsep{"PATH"} = ":" ; $envsep{"LD_LIBRARY_PATH"} = ":" ; + $envsep{"DYLD_LIBRARY_PATH"} = ":" ; $envsep{"PFPATH"} = ":" ; $envsep{"SSPATH"} = ":" ; $envsep{"STKPATH"} = ":" ; diff --git a/dtool/src/attach/ctunattach.pl b/dtool/src/attach/ctunattach.pl index 30ba40d6e7..08e867921f 100644 --- a/dtool/src/attach/ctunattach.pl +++ b/dtool/src/attach/ctunattach.pl @@ -92,6 +92,7 @@ sub CTUnattachCompute { &CTUnattachMod( "PATH", $item ) ; } &CTUnattachMod( "LD_LIBRARY_PATH", $item ) ; + &CTUnattachMod( "DYLD_LIBRARY_PATH", $item ) ; #$item = $root . "/src/all" ; #&CTUnattachMod( "CDPATH", $item ) ; $item = $root . "/built/include" ; diff --git a/dtool/src/attach/dtool.cshrc b/dtool/src/attach/dtool.cshrc index e73b307fbb..e3c58d5eea 100644 --- a/dtool/src/attach/dtool.cshrc +++ b/dtool/src/attach/dtool.cshrc @@ -4,6 +4,7 @@ setenv OS `uname` # careful, security exploit here setenv LD_LIBRARY_PATH "." +setenv DYLD_LIBRARY_PATH "." setenv CTEMACS_FOREHIGHLIGHT white setenv CTEMACS_BACKHIGHLIGHT blue diff --git a/dtool/src/attach/dtool.sh b/dtool/src/attach/dtool.sh index 8cc713f374..598cd37cc0 100755 --- a/dtool/src/attach/dtool.sh +++ b/dtool/src/attach/dtool.sh @@ -28,6 +28,8 @@ fi LD_LIBRARY_PATH="." export LD_LIBRARY_PATH +DYLD_LIBRARY_PATH="." +export DYLD_LIBRARY_PATH CT_INCLUDE_PATH="." export CT_INCLUDE_PATH #cdpath=. diff --git a/panda/src/event/asyncTask.I b/panda/src/event/asyncTask.I index efbf183d49..5e3753d3ba 100644 --- a/panda/src/event/asyncTask.I +++ b/panda/src/event/asyncTask.I @@ -98,7 +98,8 @@ get_python_object() const { Py_XINCREF(_python_object); return _python_object; } - Py_RETURN_NONE; + Py_INCREF(Py_None); + return Py_None; } #endif // HAVE_PYTHON diff --git a/panda/src/pgraph/nodePath.I b/panda/src/pgraph/nodePath.I index b6eb155a25..95bf5a6c1a 100644 --- a/panda/src/pgraph/nodePath.I +++ b/panda/src/pgraph/nodePath.I @@ -2239,7 +2239,8 @@ get_python_tag(const string &key) const { // An empty NodePath quietly returns no tags. This makes // get_net_python_tag() easier to implement. if (is_empty()) { - Py_RETURN_NONE; + Py_INCREF(Py_None); + return Py_None; } return node()->get_python_tag(key); } diff --git a/panda/src/pgraph/pandaNode.cxx b/panda/src/pgraph/pandaNode.cxx index 820555eabf..fde7513016 100644 --- a/panda/src/pgraph/pandaNode.cxx +++ b/panda/src/pgraph/pandaNode.cxx @@ -1339,7 +1339,8 @@ get_python_tag(const string &key) const { Py_XINCREF(result); return result; } - Py_RETURN_NONE; + Py_INCREF(Py_None); + return Py_None; } #endif // HAVE_PYTHON