Changeset 11 for trunk/llmozlib2/README-mac.txt
- Timestamp:
- 03/17/08 15:22:04 (2 years ago)
- Files:
-
- trunk/llmozlib2/README-mac.txt (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/llmozlib2/README-mac.txt
r8 r11 1 The projects and scripts in this directory create the llmozlib library and package it with the mozilla runtime.1 The projects and scripts in this directory create the llmozlib2 library and package it with the mozilla runtime. 2 2 3 If you just need to rebuild the llmozlib library, you can skip ahead to building the xcode project. 3 If you just need to rebuild the llmozlib2 library, you can skip ahead to building the xcode project. 4 5 Install libIDL 6 -------------- 7 8 Building mozilla requires you to have libIDL installed on the build machine. It's used during the build process, but not actually included as part of the final build package, so it doesn't need to be built universal or installed in the application bundle. 9 10 There are a number of ways to install libIDL. I installed it via "MacPorts" as outlined on this page: 11 12 http://developer.mozilla.org/en/docs/Mac_OS_X_Build_Prerequisites 13 14 but if you prefer to use Fink or build it from source, that's your choice. 15 16 You should only need to do this once, since it's not tied to a particular version of llmozlib2 or your checked-out sandbox. 17 4 18 5 19 Building mozilla from scratch … … 10 24 Once you have the mozilla library built, run the copy_products_mac.sh script in this directory to pull the necessary bits across. This will repopulate the architecture-specific portions of the libraries directory here, so you may want to do a preemptive 'svn remove' and commit first. It will also create mozilla-universal-darwin-original.tgz which contains the necessary runtime bits that need to go into the application bundle. 11 25 12 At this point, you can 'svn add' any new files in ./libraries, commit them and mozilla-universal-darwin-original.tgz, and someone else will be able to check out this directory and rebuild llmozlib without having to do a full mozilla build. This is the reason for splitting the build process at this point.26 At this point, you can 'svn add' any new files in ./libraries, commit them and mozilla-universal-darwin-original.tgz, and someone else will be able to check out this directory and rebuild llmozlib2 without having to do a full mozilla build. This is the reason for splitting the build process at this point. 13 27 14 Rebuilding llmozlib (Xcode)28 Rebuilding llmozlib2 (Xcode) 15 29 --------------------------- 16 30 … … 19 33 Build will fail the first time! This is expected! There's some voodoo going on with include directory names. Open the project in Xcode (or use the command line equivalent listed at the end of this section). Build it. Now close the Xcode project and reopen it and build it again (or just run the command line equivalent again). 20 34 21 Once you've got the mozilla libraries in place, open llmozlib .xcodeproj and build the "Release" build style. If the build fails with a bunch of missing include files, close the project and reopen it, then try again. (A script phase in the project creates a symlink, but xcode only reevaluates the wildcard header path search when the project is opened. You should only have to do this once per checkout.)35 Once you've got the mozilla libraries in place, open llmozlib2.xcodeproj and build the "Release" build style. If the build fails with a bunch of missing include files, close the project and reopen it, then try again. (A script phase in the project creates a symlink, but xcode only reevaluates the wildcard header path search when the project is opened. You should only have to do this once per checkout.) 22 36 23 If the llmozlib build still fails due to missing header files after doing the steps above, you'll want to figure out where in the mozilla build they live and modify copy_products_mac.sh to copy them, run it (so they get pulled into ./libraries), 'svn add' the new files, and commit.37 If the llmozlib2 build still fails due to missing header files after doing the steps above, you'll want to figure out where in the mozilla build they live and modify copy_products_mac.sh to copy them, run it (so they get pulled into ./libraries), 'svn add' the new files, and commit. 24 38 25 39 If there's any chance the public interface (i.e. member functions) of the LLMozLib class has changed, you need to regenerate the exports file and (re)build the "Release" target. See the NOTE about llmozlib2.exp below. … … 31 45 build_mozilla/objdir-mozilla-universal 32 46 33 After the xcode build completes, run repackage_runtime.sh to do the final packaging step (including creating mozilla-universal-darwin.tgz from mozilla-universal-darwin-original.tgz and the llmozlib build products) and copy the necessary pieces into your sandbox. The script takes a single argument, which is the location of the sandbox directory. (Note that this should be the directory containing the 'libraries' and 'indra' directories.) The script should be run from the llmozlibdirectory, and the sandbox path can either be relative or absolute (i.e. './repackage_runtime.sh ../../BRANCH' will work fine).47 After the xcode build completes, run repackage_runtime.sh to do the final packaging step (including creating mozilla-universal-darwin.tgz from mozilla-universal-darwin-original.tgz and the llmozlib2 build products) and copy the necessary pieces into your sandbox. The script takes a single argument, which is the location of the sandbox directory. (Note that this should be the directory containing the 'libraries' and 'indra' directories.) The script should be run from the llmozlib2 directory, and the sandbox path can either be relative or absolute (i.e. './repackage_runtime.sh ../../BRANCH' will work fine). 34 48 35 49 NOTE: Command line build command: … … 42 56 NOTE: about llmozlib2.exp 43 57 44 In order to hide internal symbols in the mozilla library, we have to use an explicit export list when building llmozlib .58 In order to hide internal symbols in the mozilla library, we have to use an explicit export list when building llmozlib2. 45 59 46 The list of symbols to export is in llmozlib .exp. The symbols are in "name mangled" form, making them a bit of a pain to read.60 The list of symbols to export is in llmozlib2.exp. The symbols are in "name mangled" form, making them a bit of a pain to read. 47 61 48 If changes are made to any of the class definitions in llmozlib .h, this list may need to be regenerated. The script update-mac-symbols.sh in this directory now takes care of doing this step. The following directions are what I used to do manually, preserved for posterity (or in case the script breaks in the future). If you run the script and it works, you don't need to read any further.62 If changes are made to any of the class definitions in llmozlib2.h, this list may need to be regenerated. The script update-mac-symbols.sh in this directory now takes care of doing this step. The following directions are what I used to do manually, preserved for posterity (or in case the script breaks in the future). If you run the script and it works, you don't need to read any further. 49 63 50 64 … … 60 74 - symbols2.txt should now contain the list of global symbols that the library would export with no controls in place. 61 75 62 Now comes the hard part. The list must be manually pruned. At the moment, deleting all symbols that don't begin with __ZN8LLMozLib seems to be correct. Look at the existing llmozlib .exp for guidance.76 Now comes the hard part. The list must be manually pruned. At the moment, deleting all symbols that don't begin with __ZN8LLMozLib seems to be correct. Look at the existing llmozlib2.exp for guidance. 63 77 64 Once you've got the new list, paste it into llmozlib .exp and change the "Exported Symbols File" setting back to "llmozlib.exp".78 Once you've got the new list, paste it into llmozlib2.exp and change the "Exported Symbols File" setting back to "llmozlib2.exp". 65 79 66 80 NOTE: Command line build command: … … 71 85 72 86 ----------- 73 NOTE: about llmozlib _stub.c87 NOTE: about llmozlib2_stub.c 74 88 75 89 Due to the way the Mac linker works, it was necessary to create a 'stub' library. This is a shared library containing nothing but the export symbols that is used to make the linker happy when building the application. The real shared library then gets referenced during runtime. 76 90 77 There's a shell script phase in the project that runs a 'sed' script which creates llmozlib _stub.c from llmozlib.exp. It's about as stupid as possible.91 There's a shell script phase in the project that runs a 'sed' script which creates llmozlib2_stub.c from llmozlib2.exp. It's about as stupid as possible. 78 92 79 93 Make sure the stub library gets copied into libraries/universal-darwin/lib_{debug|release} and that the real library gets put into the application bundle. Getting either one into the other's place will cause problems.
