change the cookie structure. In CArchive is add the parameter usesystemlibrary, whose default value is False, use to know if the program must to use the Python system library or not; this information is saved in cookie by changing the pyvers value in negative if the program must to use the Python system library. To continue using the code everytime status->cookie.pyvers is used abs function was added
add parameter use_system_library in PKG's __init__, its default value is False. This parameter is used to save if the user wants use the python system library.
in PyInstaller/build.py in class Analysis' __init__ add parameter use_system_library whose default value is False; this parameter say if the user wants to use the Python system library. To remove this binary it call the new function removePythonLibrary wich search a library whose is the one on the computer and remove that from the list of the binaries. At the moment it work only for linux, infact before call this function assemble check is_unix value. In __init__ of class Exe add parameter use_system_library to tell the exe to use the system library, the default value of this parameter is False; this value is pass to PKG to store this information. In source/common/launch.c in loadPython function add usesystemlibrary variable wich is an unsigned int, its value is 0 if the user wants to use the system library, otherwise is 1. To find the Python library, if the OS is Linux, check usesystemlibrary: if thi variable is 0 the program run the old code, else put in dllpath the library we want to find that is the same of the start computer Python library. In both case the program search the library using dlopen.
move all variable declaration in loadPython function on top of the function, to unsigned int usesystemlibrary declaration remove useless cast of status->cookie.pyvers to uint32_t
add comment to save_trailer method for if self.usesystemlibrary control
add method findLibraryInBinaries to find a library in the list of binaries, to function must pass both these informations. This method is used in fixMissingPythonLib instead the for loop. Change removePythonLibrary: now search the library in binaries using findLibraryInBinaries, if the function doesn't find the library the function create an element searching the library; then remove the element from the list of binaries
in build.py before removePythonLibrary add control to check if the OS is windwos; in this function add names in case is_win is True, and add a cycle to remove all the libpython in binaries. In source/common/launch.c move dlopenMode, pyvers_major, pyvers_minor in no windows case; in windows case add use of system libpython: to find the library use the function LoadLibraryExA function
remove debug print in findLibraryInBinaries function
add test fro the case of use the system library instead save libpython in the direcotry
add option in PyInstaller/makespec.py to create an application that use th systen libpython instead bundle a libpython; the option can be choose using -u or --use-system-library
change docstring of removePythonLibrary method
change comment to explain why a cycle is necessary to remove an element from the list of binaries
change variable name from usesystemlibrary to use_system_library
change class viariable name from self.usesystemlibrary to self.use_system_library
correct typo self.use_system_libary, now the variable name is self.use_system_library
add control to check if the used system is linux or windows: if the system is neither of this option the function exit
In assemble method remove OS control before calling self.removePythonLibrary because this control is done inside the called method
in removePythonLybrary change control if el is None to same control if el
change control of used OS otherwise if the system is Windows or Linux the function is not run
remove useless ternary operator in usesystemlibrary definition