I have been strugglling to build posqlgresql 9.1 with trace_locks on so I can check the memory addresses used by the locks, but after a couple of days effor开发者_JAVA技巧t, I still haven't made any progress.
to compile:
./configure --prefix=/usr/local/pgsql --enable-depend --enable-cassert --enable-debug
make
make install
According to postgresql documentation, LOCK_DEBUG should be set at compile time,
./configure --prefix=/usr/local/pgsql --enable-depend --enable-cassert --enable-debug LOCK_DEBUG='on'
but it doesn't seem like working. Please help! Thanks!!!
I think you just want to get -DLOCK_DEBUG
into the compiler flags, try it like this:
./configure \
--prefix=/usr/local/pgsql \
--enable-depend --enable-cassert \
--enable-debug \
CPPFLAGS='-DLOCK_DEBUG'
I added the backslashes to make it easier to read, you can use this if you want it all in one line:
./configure --prefix=/usr/local/pgsql --enable-depend --enable-cassert --enable-debug CPPFLAGS='-DLOCK_DEBUG'
You can find examples of similar things in the installation documentation, just search for "CFLAGS":
You can specify environment variables on the configure command line, for example:
./configure CC=/opt/bin/gcc CFLAGS='-O2 -pipe'
精彩评论