 |
|
 |
|
Adding XPIDL interface files to the build process
We've a few rules to the build process to make it easy to create
headers and xpt typelib files from XPIDL interface files.
- Windows and Unixes:
Define XPIDLSRCS in your
Makefile.in or makefile.win, listing all the .idl files that you
want to compile. rules.mk and rules.mak will use this variable to
- create .h files for each .idl file and export them to the
include directory.
- create .xpt files for each .idl file
- link the .xpt files together into $(MODULE).xpt
- export the resulting .xpt file to the components directory.
If you have several directories with the same MODULE that you want to compile .idl files in, you may want to define XPIDL_MODULE as well with a new name to avoid conflicts. The build system will use XPIDL_MODULE instead.
- Macintosh:
John McMullen contributed the following instructions:
- Start with an existing idl project, eg mozilla/xpfe/components/history/macbuild/historyIDL.mcp.
- Copy this project file to the desired location (by convention, in mozilla/foo/macbuild),
and rename it "fooIDL.mcp".
- Open the project file.
- Switch to the "targets" tab.
- Double-click on the "headers" target, to bring up the settings window.
- On the "Target"/"Target settings" panel, change the output directory to your liking.
- On the "Target"/"Access paths" panel, make sure that the only access path is to
::::dist:idl: (your number of leading colons will vary). Other needed access paths
may get added automatically when you add your idl files.
- On the "Language Settings"/"xpidl Settings" panel change the linker output to "foo.headers".
- Close the settings window, and save the changes.
- Double-click the "history.xpt" target, to bring up the settings window.
- On the "Target"/"Target settings" panel, change the target name to "foo.xpt".
- On the "Target"/"Access paths" panel, make sure that the only access path is to
::::dist:idl: (your number of leading colons will vary). Other needed access paths
may get added automatically when you add your idl files.
- On the "Language Settings"/"xpidl Settings" panel change the linker output to "foo.xpt"
- Close the settings window, and save the changes.
- Switch to the "Files" tab.
- Select all the files in the list, and remove them from the project (eg, using cmd-delete).
- Add your foo idl files to the project. (or proceed to the next step, and add the files
later).
- Open MacCVS Pro, and find your new file fooIDL.mcp. Select it and choose "Orphan Files"
to remove the previous MacCVS information. At this point, you can check the new file in,
if you want.
- If you want your IDL files to be exported, a file MANIFEST_IDL must be added to the
same directory as the .idl file. Add the name of your .idl file to MANIFEST_IDL,
leaf name only, one file per line.
- Finally, modify the build script that drives the build, namely
mozilla/build/mac/NGLayoutBuildList.pm. Find
the function BuildClientDist(). Add lines such as these:
InstallFromManifest(":mozilla:foo:public:MANIFEST_IDL", "$distdirectory:idl:");
BuildIDLProject(":mozilla:foo:macbuild:fooIDL.mcp", "foo");
The first line exports your idl headers to dist (assuming
you want this, and have created the manifest file in a
previous step). The second line causes the .h and the .xpt
files to be generated. Be sure that, if your idl files
include other idl files, that your new lines follow the lines
that export the headers on which they depend. - You're
done!
mccabe@netscape.com
Last modified: Fri Jun 4 11:02:49 PDT 1999
|
|
 |