diff --git a/direct/src/extensions_native/Sources.pp b/direct/src/extensions_native/Sources.pp index e69de29bb2..a961cd35c4 100644 --- a/direct/src/extensions_native/Sources.pp +++ b/direct/src/extensions_native/Sources.pp @@ -0,0 +1,20 @@ +#if $[OSX_PLATFORM] +#output extensions_darwin.py +#### Generated automatically by $[PPREMAKE] $[PPREMAKE_VERSION] from $[notdir $[THISFILENAME]]. +################################# DO NOT EDIT ########################### + +# This defines the shared-library filename extension that is built and +# imported on OSX. It's normally .dylib, but in certain Python and +# OSX versions (for instance, Python 2.4 on OSX 10.4), it appears that +# we need to generate and import .so files instead, since Python won't +# import the .dylibs directly. This is controlled via the BUNDLE_EXT +# variable defined in Config.pp. +#if $[BUNDLE_EXT] +dll_ext = "$[BUNDLE_EXT]" +#else +dll_ext = ".dylib" +#endif + +#end extensions_darwin.py + +#endif // OSX_PLATFORM diff --git a/direct/src/extensions_native/extension_native_helpers.py b/direct/src/extensions_native/extension_native_helpers.py index bd57aab839..63bf476eb1 100644 --- a/direct/src/extensions_native/extension_native_helpers.py +++ b/direct/src/extensions_native/extension_native_helpers.py @@ -21,8 +21,9 @@ if sys.platform == "win32": if sys.executable.endswith('_d.exe'): dll_suffix = '_d' elif sys.platform == "darwin": - # On OSX, the dynamic libraries usually end in .dylib. - dll_ext = '.dylib' + # On OSX, the dynamic libraries usually end in .dylib, but + # sometimes we need .so. + from extensions_darwin import dll_ext else: # On most other UNIX systems (including linux), .so is used. dll_ext = '.so'