diff --git a/direct/src/plugin/Sources.pp b/direct/src/plugin/Sources.pp index 49697b0966..8ee50e77e3 100644 --- a/direct/src/plugin/Sources.pp +++ b/direct/src/plugin/Sources.pp @@ -1,13 +1,25 @@ -// This directory builds the code for the "Core API" part of the -// Panda3D browser plugin system. Most Panda3D developers will have -// no need to build this, unless you are developing the plugin system -// itself. Define HAVE_P3D_PLUGIN in your Config.pp to build this -// directory. +// This directory contains the code for the "Core API" part of the +// Panda3D browser plugin system, which is not built unless you have +// defined HAVE_P3D_PLUGIN in your Config.pp. Most Panda3D developers +// will have no need to build this, unless you are developing the +// plugin system itself. -#define BUILD_DIRECTORY $[HAVE_P3D_PLUGIN] +// This directory also contains the code for p3dpython.exe, which is +// part of the Panda3D plugin runtime. It's not strictly part of the +// "Core API"; it is packaged as part of each downloadable version of +// Panda3D. It is only built if you have defined +// PANDA_PACKAGE_HOST_URL in your Config.pp, which indicates an +// intention to build a downloadable version of Panda3D. Developers +// who are preparing a custom Panda3D package for download by the +// plugin will need to build this. #begin lib_target - #define BUILD_TARGET $[and $[HAVE_TINYXML],$[HAVE_OPENSSL],$[HAVE_ZLIB],$[HAVE_JPEG],$[HAVE_PNG]] + +// +// libp3d_plugin.dll, the main entry point to the Core API. +// + + #define BUILD_TARGET $[and $[HAVE_P3D_PLUGIN],$[HAVE_TINYXML],$[HAVE_OPENSSL],$[HAVE_ZLIB],$[HAVE_JPEG],$[HAVE_PNG]] #define USE_PACKAGES tinyxml openssl zlib jpeg png x11 #define TARGET p3d_plugin #define LIB_PREFIX @@ -103,45 +115,61 @@ #end lib_target +#begin bin_target -#begin lib_target -// ***** -// Note! This lib is used to run P3DPythonRun within the parent -// (browser) process, instead of forking a child. This seems like -// it's going to be a bad idea in the long term. This lib remains -// for now as an experiment, but it will likely be removed very soon. -// **** - #define BUILD_TARGET $[and $[HAVE_TINYXML],$[HAVE_PYTHON],$[HAVE_OPENSSL]] - #define USE_PACKAGES tinyxml python openssl - #define TARGET libp3dpython - #define LIB_PREFIX +// +// p3dcert.exe, the authorization GUI invoked when the user clicks the +// red "play" button to approve an unknown certificate. Considered +// part of the Core API, though it is a separate download. +// - #define OTHER_LIBS \ - dtoolutil:c dtoolbase:c dtool:m \ - interrogatedb:c dconfig:c dtoolconfig:m \ - express:c pandaexpress:m \ - pgraph:c pgraphnodes:c cull:c gsgbase:c gobj:c \ - mathutil:c lerp:c downloader:c pnmimage:c \ - prc:c pstatclient:c pandabase:c linmath:c putil:c \ - pipeline:c event:c nativenet:c net:c display:c panda:m + #define BUILD_TARGET $[and $[HAVE_P3D_PLUGIN],$[HAVE_WX],$[HAVE_OPENSSL]] + #define USE_PACKAGES wx openssl + #define TARGET p3dcert + + #define SOURCES p3dCert.cxx + #define OSX_SYS_FRAMEWORKS Carbon + + #if $[OSX_PLATFORM] + // Squelch objections about ___dso_handle. + #define LFLAGS $[LFLAGS] -undefined dynamic_lookup + #endif +#end bin_target + + +#begin static_lib_target + +// +// libplugin_common.lib, a repository of code shared between the core +// API and the various plugin implementations. +// + + #define BUILD_TARGET $[and $[HAVE_P3D_PLUGIN],$[HAVE_TINYXML],$[HAVE_OPENSSL]] + #define TARGET plugin_common + #define USE_PACKAGES tinyxml openssl #define SOURCES \ - binaryXml.cxx binaryXml.h \ - fhandle.h \ - handleStream.cxx handleStream.h handleStream.I \ - handleStreamBuf.cxx handleStreamBuf.h handleStreamBuf.I \ - p3d_lock.h p3d_plugin.h \ - p3d_plugin_config.h \ - p3dCInstance.cxx \ - p3dCInstance.h p3dCInstance.I \ - p3dPythonRun.cxx p3dPythonRun.h p3dPythonRun.I \ - run_p3dpython.h run_p3dpython.cxx + load_plugin.cxx load_plugin.h \ + fileSpec.cxx fileSpec.h fileSpec.I \ + find_root_dir.cxx find_root_dir.h \ + is_pathsep.h is_pathsep.I \ + mkdir_complete.cxx mkdir_complete.h - #define WIN_SYS_LIBS user32.lib -#end lib_target +#end static_lib_target + + + +// The remaining targets build p3dpython.exe and variants. #begin bin_target - #define BUILD_TARGET $[and $[HAVE_TINYXML],$[HAVE_PYTHON],$[HAVE_OPENSSL]] + +// +// p3dpython.exe, the primary entry point to the downloaded Panda3D +// runtime. This executable is run in a child process by the Core API +// to invoke a particular instance of Panda. +// + + #define BUILD_TARGET $[and $[PANDA_PACKAGE_HOST_URL],$[HAVE_TINYXML],$[HAVE_PYTHON],$[HAVE_OPENSSL]] #define USE_PACKAGES tinyxml python openssl #define TARGET p3dpython @@ -184,9 +212,17 @@ #end bin_target #begin bin_target - // Windows requires a special executable, p3dpythonw.exe, to launch - // a desktop-friendly application. - #define BUILD_TARGET $[and $[HAVE_TINYXML],$[HAVE_PYTHON],$[HAVE_OPENSSL],$[WINDOWS_PLATFORM]] + +// +// p3dpythonw.exe, a special variant on p3dpython.exe required by +// Windows (and built only on a Windows platform). This variant is +// compiled as a desktop application, as opposed to p3dpython.exe, +// which is a console application. (Both variants are required, +// because the plugin might be invoked either from a console or from +// the desktop.) +// + + #define BUILD_TARGET $[and $[PANDA_PACKAGE_HOST_URL],$[HAVE_TINYXML],$[HAVE_PYTHON],$[HAVE_OPENSSL],$[WINDOWS_PLATFORM]] #define USE_PACKAGES tinyxml python openssl #define TARGET p3dpythonw #define EXTRA_CDEFS NON_CONSOLE @@ -229,34 +265,42 @@ #define WIN_SYS_LIBS user32.lib #end bin_target -#begin static_lib_target - #define BUILD_TARGET $[and $[HAVE_TINYXML],$[HAVE_OPENSSL]] - #define TARGET plugin_common - #define USE_PACKAGES tinyxml openssl +#begin lib_target + +// +// libp3dpython.dll, a special library used to run P3DPythonRun within +// the parent (browser) process, instead of forking a child, as a +// desparation fallback in case forking fails for some reason. +// + + #define BUILD_TARGET $[and $[PANDA_PACKAGE_HOST_URL],$[HAVE_TINYXML],$[HAVE_PYTHON],$[HAVE_OPENSSL]] + #define USE_PACKAGES tinyxml python openssl + #define TARGET libp3dpython + #define LIB_PREFIX + + #define OTHER_LIBS \ + dtoolutil:c dtoolbase:c dtool:m \ + interrogatedb:c dconfig:c dtoolconfig:m \ + express:c pandaexpress:m \ + pgraph:c pgraphnodes:c cull:c gsgbase:c gobj:c \ + mathutil:c lerp:c downloader:c pnmimage:c \ + prc:c pstatclient:c pandabase:c linmath:c putil:c \ + pipeline:c event:c nativenet:c net:c display:c panda:m #define SOURCES \ - load_plugin.cxx load_plugin.h \ - fileSpec.cxx fileSpec.h fileSpec.I \ - find_root_dir.cxx find_root_dir.h \ - is_pathsep.h is_pathsep.I \ - mkdir_complete.cxx mkdir_complete.h + binaryXml.cxx binaryXml.h \ + fhandle.h \ + handleStream.cxx handleStream.h handleStream.I \ + handleStreamBuf.cxx handleStreamBuf.h handleStreamBuf.I \ + p3d_lock.h p3d_plugin.h \ + p3d_plugin_config.h \ + p3dCInstance.cxx \ + p3dCInstance.h p3dCInstance.I \ + p3dPythonRun.cxx p3dPythonRun.h p3dPythonRun.I \ + run_p3dpython.h run_p3dpython.cxx -#end static_lib_target - - -#begin bin_target - #define BUILD_TARGET $[and $[HAVE_WX],$[HAVE_OPENSSL]] - #define USE_PACKAGES wx openssl - #define TARGET p3dcert - - #define SOURCES p3dCert.cxx - #define OSX_SYS_FRAMEWORKS Carbon - - #if $[OSX_PLATFORM] - // Squelch objections about ___dso_handle. - #define LFLAGS $[LFLAGS] -undefined dynamic_lookup - #endif -#end bin_target + #define WIN_SYS_LIBS user32.lib +#end lib_target #include $[THISDIRPREFIX]p3d_plugin_config.h.pp