| 1 |
* Hacking Memcached |
| 2 |
|
| 3 |
* Prerequisites |
| 4 |
|
| 5 |
- autoconf |
| 6 |
- automake |
| 7 |
- autotools |
| 8 |
- libevent |
| 9 |
|
| 10 |
* Getting Started |
| 11 |
|
| 12 |
After checking out a git repository, you must first run autogen.sh |
| 13 |
once in order to create the configure script. |
| 14 |
|
| 15 |
Next, run the configure script and start doing builds. |
| 16 |
|
| 17 |
* Setting up Git |
| 18 |
|
| 19 |
Though not required, there are a couple of things you can add to git |
| 20 |
to help development. |
| 21 |
|
| 22 |
** Pre Commit Hook |
| 23 |
|
| 24 |
The pre-commit hook can be used to ensure that your tree passes tests |
| 25 |
before allowing a commit. To do so, add the following to |
| 26 |
.git/hooks/pre-commit (which must be executable): |
| 27 |
|
| 28 |
#!/bin/sh |
| 29 |
make test |
| 30 |
|
| 31 |
** Post Commit Hook |
| 32 |
|
| 33 |
Because the version number changes on each commit, it's good to use a |
| 34 |
post commit hook to update the version number after each commit so as |
| 35 |
to keep the reporting accurate. To do so, add the following to |
| 36 |
.git/hooks/post-commit (which must be executable) |
| 37 |
|
| 38 |
#!/bin/sh |
| 39 |
./version.sh |
| 40 |
|
| 41 |
** Running memcached in gdb for tests. |
| 42 |
|
| 43 |
By default `make test` will spawn a memcached daemon for each test. |
| 44 |
This doesn't let you easily drop into gdb or run verbosely. |
| 45 |
|
| 46 |
If you export the environment variable |
| 47 |
T_MEMD_USE_DAEMON="127.0.0.1:11211" the tests will use an existing |
| 48 |
daemon at that address. |
| 49 |
|
| 50 |
* Sending patches |
| 51 |
|
| 52 |
See current instructions at http://contributing.appspot.com/memcached |