···11+This is a userspace compatibility layer for running Darwin/OS X binaries on Linux.
22+33+# General information
44+55+For more information (such as **build instructions**), visit http://darling.dolezel.info
66+77+# Hacking tutorial
88+99+Want to help and don't know what's currently important? Let me know!
1010+Google Group: https://groups.google.com/d/forum/darling-project
1111+1212+**Important:** Use git clone -r (as in recursive) to check out this project.
1313+1414+## Directory tree
1515+1616+<dl>
1717+1818+<dt>benchmarks/</dt>
1919+<dd>No serious stuff in here, used only once for a simple ObjC msg sending benchmark.</dd>
2020+<dt>etc/</dt>
2121+<dd>Contains dylib.conf which is used to map OS X library (framework) paths to Linux/Darling ones. `/dev/null` = load nothing.</dd>
2222+<dt>include/</dt>
2323+<dd>Header files taken from Darwin/OS X (APSL license). The plan is to get rid of these eventually.</dd>
2424+<dt>misc/</dt>
2525+<dd>Random files, nothing that really matters.</dd>
2626+<dt>src/</dt>
2727+<dd>Source code, see below.</dd>
2828+<dt>tests/</dt>
2929+<dd>Test runner. It is specifically designed to work on my testing setup. See below.</dd>
3030+<dt>tests/src/</dt>
3131+<dd>The source code for tests.</dd>
3232+<dt>tools/</dt>
3333+<dd>Various utilities used during the development.</dd>
3434+3535+</dl>
3636+3737+### Source tree
3838+3939+The structure under `src/`.
4040+4141+<dl>
4242+<dt>src/libSystem/</dt>
4343+<dd>Wrappers or implementation of libc funcions, BSD system calls and Mach system calls.</dd>
4444+4545+<dt>src/libobjcdarwin/</dt>
4646+<dd>Loader of ObjC classes/protocols in Mach-O ObjC applications. Contains code for selector fixups and other techniques needed to "make it work" with GNUstep's libobjc2.</dd>
4747+4848+<dt>src/util/</dt>
4949+<dd>Various utility functions/classes common to all parts of Darling.</dd>
5050+5151+<dt>src/libmach-o/</dt>
5252+<dd>Mach-O parsing/loading library.</dd>
5353+5454+<dt>src/dyld/</dt>
5555+<dd>The dynamic loader.</dd>
5656+5757+<dt>src/motool/</dt>
5858+<dd>A very simple tool for Mach-O file examination. (An allusion to "otool" available on OS X.)</dd>
5959+6060+<dt>src/crash/</dt>
6161+<dd>A crash ("force quit") dialog app for Cocoa apps. Not really complete yet.</dd>
6262+6363+<dt>...</dt>
6464+<dd>The rest is code or wrappers in various stages of completion.</dd>
6565+6666+</dl>
6767+6868+### Tests tree
6969+7070+The testing procedure implemented in `src/tests/runtest.cpp` is as follows:
7171+7272+1. It copies the source file to the OS X machine.
7373+2. It remotely builds the source file. If the current binary name is `runtest32`, then `-m32` is added and `dyld32` is used later on. A similar `runtest64` symlink is needed if your 64-bit dyld is called `dyld64`. If the first line in the source file is `// CFLAGS:`, then the rest is used as CFLAGS.
7474+3. It remotely runs the program and keeps its stdout.
7575+4. It copies the binary over to the local machine.
7676+5. It runs the binary via dyld/dyld32/dyld64.
7777+6. It compares the stdout contents of dyld with that of the remotely run binary.
7878+7. Should the stdout contents differ or should the process exit with a non-zero code on either of the systems, the test has failed.
7979+8080+In `src/tests/libsshcxx`, a copy of my libssh C++ wrapper should check itself out.
8181+8282+## Debugging
8383+8484+Find out how Darling can help you with debugging at http://darling.dolezel.info/en/Debugging
8585+8686+