8 // Author: Phil Mesnier
10 // A Library is a collection of Obj_Modules that define a single shared
11 // library. It is used to manipulate the list of unresolved references by
12 // removing those that are resolved and adding those brought in by new modules
13 // that are required to resolve references. The Library is responsible
14 // for outputting a specialized mpc file to build the reduce footprint library.
16 #include "Obj_Module.h"
18 // FUZZ: disable check_for_streams_include
19 #include "ace/streams.h"
21 // The MPC generator class serves as the base class used to output the
22 // custom mpc files used to build the subsetted libraries.
23 // The base class will make libACE_subset.so
28 MPC_Generator (const ACE_CString
& libname
);
29 virtual ~MPC_Generator();
31 void write_prolog (const ACE_CString
& );
32 void write_file (const ACE_CString
& );
36 virtual void write_baseprojects();
37 virtual void write_projectinfo();
41 ACE_CString mpcfilename_
;
44 // Generate mpc files for libraries dependant on ACE, that are not TAO.
45 class MPC_ACE_Dep_Lib
: public MPC_Generator
48 MPC_ACE_Dep_Lib (const ACE_CString
& libname
);
51 virtual void write_baseprojects();
52 virtual void write_projectinfo();
55 // Generates mpc files for libTAO_subset.so
56 class MPC_TAO_Lib
: public MPC_ACE_Dep_Lib
59 MPC_TAO_Lib (const ACE_CString
& libname
);
62 virtual void write_baseprojects();
63 virtual void write_projectinfo();
66 // Generates makefiles for libs dependant on TAO. This has a problem when
67 // building libraries in the orbsvcs tree.
68 class MPC_TAO_Dep_Lib
: public MPC_TAO_Lib
71 MPC_TAO_Dep_Lib (const ACE_CString
& );
74 virtual void write_baseprojects();
75 virtual void write_projectinfo();
78 //----------------------------------------------------------------------------
83 Library (const ACE_TCHAR
*name
= 0 );
84 /// Constructor is responsible for loading all of the modules related to the
88 // Resolve interates over the supplied list of undefined signatures to locate
89 // modules that contain definitions. Any symbol defined in a module marked as
90 // exported is simply removed from the undef list. Any symbol defined in a
91 // module not yet exported removed from the undef list, the module is marked
92 // as exported, and its unresolved symbols are added to the undef list.
93 void resolve (Sig_List
&undefs
);
95 // Outputs a list of files suitable for inclusion in an mpc file to produce
96 // a subsetted library. If the argument is non-zero, reference countes for
97 // each module are also listed.
98 void write_export_list ( int );
100 // set the path to find the .so files
101 void set_path (const ACE_TCHAR
*p
);
103 // Load the actual .so files from the path.
106 // returns the library name
107 const ACE_CString
&name () const;
109 // returns non-zero if the module count is > 0.
110 int has_modules () const;
120 Obj_Module
**modules_
;
122 MPC_Generator
*mpcfile_
;
125 #endif /* _LIBRARY_H_ */