|
|
1.1 ! root 1: How to build XNU: ! 2: ! 3: 1. Install Beaker build environment: ! 4: ! 5: Install the DeveloperLibs, DeveloperTools, Local, and LocalLibs ! 6: packages onto a Hera system from: ! 7: ! 8: /Net/osbuild/release/<latest Beaker>/System/Installation/Packages ! 9: ! 10: IMPORTANT!!!! ! 11: ! 12: CHANGE THE DEFAULT INSTALL DIRECTORY TO /Local/Public/MacOSX ! 13: ! 14: IF YOU DON'T DO THIS, YOU WILL NEED TO REINSTALL YOUR HERA SYSTEM! ! 15: ! 16: When installing directly on Beaker, you do not need to do this. ! 17: ! 18: 2. Build Setup: ! 19: ! 20: 2.a. Setup your environment: ! 21: ! 22: Create and go to your sandbox directory </sandbox/my_xnu> ! 23: ! 24: $ cd </sandbox/my_xnu> ! 25: ! 26: Extract the xnu project from cvs: ! 27: ! 28: $ cvs co -r<xnu-tag> xnu ! 29: ! 30: where <xnu-tag> must be replaced by the matching xnu tag for ! 31: the xnu project level. ! 32: ! 33: Go to the top directory in your XNU project. ! 34: ! 35: $ cd </sandbox/my_xnu>/xnu ! 36: ! 37: If you are running with sh, run the following command: ! 38: $ . SETUP/setup.sh ! 39: ! 40: If you are running with csh, run the following command: ! 41: % source SETUP/setup.csh ! 42: ! 43: This will define NEXT_ROOT , DSTROOT, OBJROOT, SRCROOT, SYMROOT. ! 44: ! 45: 2.b. Populate OBJROOT (Optional): ! 46: ! 47: Create a symlink in the root of your development and debug machines as ! 48: follows: ! 49: ! 50: $ su ! 51: # ln -s /Network/Servers/humpty/Prebuilt /Prebuilt ! 52: ! 53: $ ./SETUP/seed_objroot <xnu-tag> [RELEASE,DEBUG]_[PPC,I366] ! 54: ! 55: or ! 56: ! 57: $ ./SETUP/seed_objroot <xnu-tag> ! 58: ! 59: seed_objroot populates the OBJROOT with a prebuilt OBJROOT. The ! 60: second argument specifies the configuration (RELEASE_PPC, DEBUG_PPC, etc). ! 61: If no configuration is specified, all the configurations will ! 62: be populated. ! 63: ! 64: You can also use it to duplicate an OBJROOT by setting PREBUILT_OBJROOT ! 65: in your shell environment with your own OBJROOT reference (xnu-tag is ! 66: ignored then). ! 67: ! 68: 3. Export the Component Header Files ! 69: ! 70: From the top directory, run: ! 71: ! 72: $ make exporthdrs ! 73: ! 74: This exports the component header files in the $OBJROOT/EXPORT_HDRS ! 75: directory. ! 76: ! 77: 4. Build all the Components ! 78: ! 79: From the top directory. run: ! 80: ! 81: $ make all ! 82: ! 83: This builds all the components for all architectures defined in ! 84: ARCH_CONFIGS and for all kernel configurations defined in KERNEL_CONFIGS. ! 85: By default, ARCH_CONFIGS contains one architecture, the build machine ! 86: architecture, and KERNEL_CONFIGS is set to build for RELEASE. ! 87: This will also create a bootable image, mach_kernel, and a kernel binary ! 88: with symbols, mach_kernel.sys. ! 89: ! 90: Example: ! 91: $(OBJROOT)/RELEASE_PPC/osfmk/RELEASE/osfmk.o: pre-linked object for osfmk component ! 92: $(OBJROOT)/RELEASE_PPC/mach_kernel: bootable image ! 93: ! 94: 5. Building a Component ! 95: ! 96: From a component top directory: ! 97: ! 98: $make all ! 99: ! 100: This builds a component for all architectures defined in ARCH_CONFIGS ! 101: and for all kernel configurations defined in KERNEL_CONFIGS. ! 102: By default, ARCH_CONFIGS contains one architecture, the build machine ! 103: architecture, and KERNEL_CONFIGS is set to build for RELEASE . ! 104: ! 105: WARNING: If a component header file has been modified, you will have to do ! 106: the above procedures 3 and 4. ! 107: ! 108: Example: ! 109: $(OBJROOT)/RELEASE_PPC/osfmk/RELEASE/osfmk.o: pre-linked object for osfmk component ! 110: ! 111: From the component top directory: ! 112: ! 113: $make mach_kernel ! 114: ! 115: This includes your component in the bootable image, mach_kernel, and ! 116: in the kernel binary with symbols, mach_kernel.sys. ! 117: ! 118: 6. Building DEBUG ! 119: ! 120: Define KERNEL_CONFIGS to DEBUG in your environment or when running a ! 121: make command. Then, apply procedures 4, 5 ! 122: ! 123: $ make KERNEL_CONFIGS=DEBUG all ! 124: ! 125: or ! 126: ! 127: $ export KERNEL_CONFIGS=DEBUG ! 128: $ make all ! 129: ! 130: Example: ! 131: $(OBJROOT)/DEBUG_PPC/osfmk/DEBUG/osfmk.o: pre-linked object for osfmk component ! 132: $(OBJROOT)/DEBUG_PPC/mach_kernel: bootable image ! 133: ! 134: 6. Building fat ! 135: ! 136: Define ARCH_CONFIGS in your environment or when running a make command. ! 137: Apply procedures 3, 4, 5 ! 138: ! 139: $ make ARCH_CONFIGS="PPC I386" exporthdrs all ! 140: ! 141: or ! 142: ! 143: $ export ARCH_CONFIGS="PPC I386" ! 144: $ make exporthdrs all ! 145: ! 146: Optionally you may do the following and your NEXTROOT will be set to ! 147: /Local/Public/MacOSX automaticly. ! 148: ! 149: $ ~rc/bin/buildit . -arch ppc -arch i386 -noinstallsrc -nosum \ ! 150: -release Beaker ! 151: ! 152: 7. Build check before integration ! 153: ! 154: Set NEXT_ROOT to /Local/Public/MacOSX (Default path for Mac OS X SDK) ! 155: ! 156: From the top directory, run: ! 157: ! 158: $ ~rc/bin/buildit . -arch ppc -arch i386 -noinstallsrc -nosum ! 159: ! 160: 8. Creating tags and cscope ! 161: ! 162: Set up your build environment as per instructions in 2.a ! 163: ! 164: From the top directory, run: ! 165: ! 166: $ make tags # this will build ctags and etags ! 167: ! 168: $ make cscope # this will build cscope database ! 169:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.