mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-12 19:09:35 +02:00
eb5c61281c
4 Commits
Author | SHA1 | Message | Date | |
---|---|---|---|---|
![]() |
e8ede4c3e2 |
Merged revision(s) 32508-32510, 32512 from branches/svenbarth/packages:
Keep track whether a package was added directly through a requires section (or the command line) or indirectly. fpkg.pas, tpackageentry: + new field "direct" pkgutil.pas: + add_package: new parameter "direct" which sets the "direct" field of the new package entry options.pas: * TOption.interpret_option & read_arguments: adjust call to add_package() pmodules.pas: * proc_package: adjust call to add_package() ........ Also load all packages that are required by packages, but that are not part of the directly used packages. pkgutil.pas, load_packages: * check the list of required packages for packages that are not yet part of the package list and add these as indirect packages * establish the links to loaded packages in the required packages once all packages were loaded ........ fpcp.pas, tpcppackage: + new method add_required_package() to add a required package while ignoring duplicates ........ pmodules.pas, proc_package: * add all packages of loaded units as required packages ........ git-svn-id: trunk@33517 - |
||
![]() |
7d8d0340b9 |
Merged revision(s) 31988, 31991-31993, 32136, 32308-32309, 32312, 32318 from branches/svenbarth/packages:
Correctly parse the directives DenyPackageUnit and WeakPackageUnit ppu.pas: + add flags uf_packagedeny and uf_packageweak scandir.pas: + new procedure do_moduleflagswitch() which parses a ON/OFF/+/- argument and sets or clears a flag in the current module + new procedure dir_denypackageunit which handles DenyPackageUnit * implement dir_weakpackageunit (and move to the correct location ;) ) * InitScannerDirectives: add dir_denypackageunit handler ........ Respect DenyPackageUnit flag. pmodules.pas, proc_package: * check all contained units that are not already part of a package for their uf_package_deny flag and report an error for each that has it set ........ Do not check whether all units are used as by definition all units of a package are considered as used. pmodules.pas, proc_package: - remove call to current_module.allunitsused ........ Check whether a unit has been implicitely imported in a package. A unit is considered as implicitely imported if it is not part of a required package nor part of the units listed in the contains section. This note is useful (Delphi even provides a dialog in that case) as a package with implicitely imported units /might/ become incompatible with other packages (e.g. if another package includes that unit uses that package and includes that unit explicitely; of course that is the same as if both package included it explicitely, but with the hint one knows where to look). pmodules.pas, proc_package: * while walking the loaded units also check whether any of them not contained in a package was part of the contained units which are the same as the current module's used units ........ Generate CRC for package files pcp.pas, tpcpfile: + new field do_crc which controls CRC generation + override putdata() method to generate CRC when data is written * resetfile: enable do_crc by default ........fppu.pas, tppumodule: * loadfrompackage: mention if a unit is loaded from a package ........ fpkg.pas, tcontainedunit: + new fields offset and size for the PPU data stored inside the PCP fpcp.pas, tpcppackage: * readcontainedunits & addunit: correctly initialize offset and size to 0 ........ Store the modified PPU files directly inside the PCP and thus get finally rid of the .ppl.ppu files. entfile.pas: + new entry type ibpputable pkgutil.pas: * adjust RewritePPU to work on a stream as output instead of a filename fpcp.pas, tpcppackage: + new method writepputable() which writes the offsets and sizes of all contained units (not part of CRC!) + new method writeppudata() which rewrites all contained PPUs directly into the PCP after the ibend entry (Note: the data is written 16 Byte aligned to ease viewing of the PCP and its contained PPUs in a hex editor) + new method readpputable() which reads the offsets and sizes of all contained units + new method getmodulestream() which returns a substream for a contained module * loadpcp: also call readpputable() * writepcp: first write an empty pputable, then finish writing all data that requires the put*/write* methods of the pcpfile, then use writeppudata() to write all PPUs and finally write the correct pputable at the original location fppu.pas, tppumodule: * loadfrompackage: don't read the PPU from a file if it is contained in a package, but using the new tpcppackage.getmodulestream() and tppumodule.openppustream() methods pmodules.pas, proc_package: * don't rewrite the PPUs here pcp.pas: * increase CurrentPCPVersion ........ Fix cycling ........ git-svn-id: trunk@33514 - |
||
![]() |
c5bdc11cb2 |
Merged revision(s) 31924, 31934-31937 from branches/svenbarth/packages:
pmodules.pas, proc_package: * generate the dummy entry symbol only on Windows systems (ToDo for other systems that might need it) ........ options.pas: * TOption.interpret_option & read_arguments: use add_package() from pkgutils instead of addpackage() from fpkg fpkg.pas: - remove no longer needed addpackage() ........ pkgutil.pas: + new procedure add_package_libs() to add all packages as libraries that are also linked against pmodules.pas: * proc_package & proc_program: add all package libraries to the linker before creating the final binary ........ pkgutil.pas, add_package: * package names are case insensitive so add them in uppercase to correctly detect duplicates ........ Keep track of how many units are used from each required/requested package and only link those from which any units are used. fpkg.pas, tpackageentry: + new field usedunits to count how many units of the package are used pkgutil.pas: + new procedure add_package_unit_ref() to increase the amount of used units for the given package pmodules.pas: * proc_package & proc_program: check which units of all loaded ones are provided by other packages ........ git-svn-id: trunk@33510 - |
||
![]() |
f8e9b33f99 |
Merge first batch of package handling related revisions from the packages branch
Merged revision(s) 28796, 28837-28845, 28847-28850, 28852, 32135 from branches/svenbarth/packages: Provide possibility to pass packages and search paths for packages as parameters. fpkg.pas: + new unit which contains the base types related to package files (most importantly "tpackage") globals.pas: + new variable "packagesearchpath" which contains all paths in which package files should be looked for + new variable "packagelist" which contains a list of all packages that should be used in a program or library * InitGlobals & DoneGlobals: initialize/finalize "packagesearchpath" accordingly ("packagelist" is handled in unit fpkg using a init/done-callback) options.pas: + TOption: new fields "parapackagepath" and "parapackages" to keep track of package search paths and package files passed as parameters * TOption.interpret_option: use '-Fp' for package search paths and '-FP' for package files * read_arguments: apply the passed package search paths and packages to their respective containers ........ + add a new unit which will contain basic functions related to handling packages ........ Move package related functions from pmodules to pkgutil. pmodules.pas => pkgutil.pas: * createimportlibfromexports * varexport * procexport * insert_export * RewritePPU ........ * adjust indentation ........ Extract the code to export the symbols of a unit to its own function in pkgutil so that less functions need to be exported. pmodules.pas, proc_package: * move code to export the symbols of a unit to new function export_unit pkgutil.pas: + new function export_unit - remove exports of procexport, varexport and insert_export ........ Some small fixes for package parsing. pmodules.pas, proc_package: * use orgpattern instead of pattern to build the module name (like is done in uses sections) * ignore duplicates when generating exports - no need to generate an import library for the package; that is done by the program/library that uses the package ........ + new unit fpcp of which the class tpcppackage handles the reading and writing of package metadata from/to pcp files (equivalant to tppumodule). ........ + add unit which contains representation of a PCP file (tpcpfile) like tppufile is for units. ........ Improve export generation. pkgutil.pas: + new function exportprocsym to correctly export a procedure with all its aliases + new function exportabstractrecordsymproc to export the members of structured types * insert_export: handle also namespacesym and propertsym (by ignoring them) * insert_export: correctly export classes, record and objects * insert_export: use new exportprocsym function to export a procsym * insert_export: only export public variables of a static symtable ........ + add entry constants for the name of the package and the package file names, both used by a PCP file ........ * use messages to get rid of most writelns related to package loading ........ Add additional entry types for PCP files entfile.pas: + new entries ibstartrequireds and ibendrequireds to store the list of required packages + new entries ibstartcontained and ibendcontained to store the list of contained units + new entries ibstartppus and ibendppus to store the list of contained PPU files ........ Generate the PCP file once the package file and the used units were compiled correctly. pmodules.pas: * proc_package: generate the PCP file upon successful compilation ........ Add the possibility to load all packages supplied as parameters. pkgutil.pas: + new function load_packages to load all packages supplied as parameters pmodules.pas, proc_program: * use load_packages to load all packages before any unit is loaded ........ Add code which tries to load a unit from a package first and only then as usual. fppu.pas, tppumodule: + new method loadfrompackage which searches all available packages for the unit and loads it from there if found * loadppu: first try to load the unit from a package if any are available ........ Don't link objects files of a unit that is provided by a package. pmodules.pas, proc_program: * if a unit has uf_in_library set we must not include it in the units we link against ........ git-svn-id: trunk@33452 - |