11b2e6edbSDustin Sallings* Hacking Memcached 21b2e6edbSDustin Sallings 31b2e6edbSDustin Sallings* Prerequisites 41b2e6edbSDustin Sallings 51b2e6edbSDustin Sallings - autoconf 61b2e6edbSDustin Sallings - automake 71b2e6edbSDustin Sallings - autotools 81b2e6edbSDustin Sallings - libevent 91b2e6edbSDustin Sallings 101b2e6edbSDustin Sallings* Getting Started 111b2e6edbSDustin Sallings 121b2e6edbSDustin SallingsAfter checking out a git repository, you must first run autogen.sh 131b2e6edbSDustin Sallingsonce in order to create the configure script. 141b2e6edbSDustin Sallings 151b2e6edbSDustin SallingsNext, run the configure script and start doing builds. 161b2e6edbSDustin Sallings 171b2e6edbSDustin Sallings* Setting up Git 181b2e6edbSDustin Sallings 191b2e6edbSDustin SallingsThough not required, there are a couple of things you can add to git 201b2e6edbSDustin Sallingsto help development. 211b2e6edbSDustin Sallings 221b2e6edbSDustin Sallings** Pre Commit Hook 231b2e6edbSDustin Sallings 241b2e6edbSDustin SallingsThe pre-commit hook can be used to ensure that your tree passes tests 251b2e6edbSDustin Sallingsbefore allowing a commit. To do so, add the following to 261b2e6edbSDustin Sallings.git/hooks/pre-commit (which must be executable): 271b2e6edbSDustin Sallings 281b2e6edbSDustin Sallings #!/bin/sh 291b2e6edbSDustin Sallings make test 301b2e6edbSDustin Sallings 311b2e6edbSDustin Sallings** Post Commit Hook 321b2e6edbSDustin Sallings 331b2e6edbSDustin SallingsBecause the version number changes on each commit, it's good to use a 341b2e6edbSDustin Sallingspost commit hook to update the version number after each commit so as 351b2e6edbSDustin Sallingsto keep the reporting accurate. To do so, add the following to 361b2e6edbSDustin Sallings.git/hooks/post-commit (which must be executable) 371b2e6edbSDustin Sallings 381b2e6edbSDustin Sallings #!/bin/sh 391b2e6edbSDustin Sallings ./version.sh 40189b78deSdormando 41189b78deSdormando** Running memcached in gdb for tests. 42189b78deSdormando 43189b78deSdormandoBy default `make test` will spawn a memcached daemon for each test. 44189b78deSdormandoThis doesn't let you easily drop into gdb or run verbosely. 45189b78deSdormando 46189b78deSdormandoIf you export the environment variable 47189b78deSdormandoT_MEMD_USE_DAEMON="127.0.0.1:11211" the tests will use an existing 48189b78deSdormandodaemon at that address. 49*ff24fb8fSBrad Fitzpatrick 50*ff24fb8fSBrad Fitzpatrick* Sending patches 51*ff24fb8fSBrad Fitzpatrick 52*ff24fb8fSBrad FitzpatrickSee current instructions at http://contributing.appspot.com/memcached 53