I understand what you mean, but I'm not sure that's possible to do such thing with a software and a library (tokyocabinet) which the software (CFEngine) depends on.

If I try to only configure Tokyocabinet and CFEngine in the target "configure", CFEngine will fail because of having not the library:
<pre>
# Compile CFEngine 3.4.2 with Tokyocabinet library located in /opt/rudder/lib
cd SOURCES/cfengine-source && ./configure --prefix=/opt/rudder --with-workdir=/var/rudder/cfengine-community --enable-static=yes --enable-shared=no --with-tokyocabinet=/debian/tmp/opt/rudder
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
[...]
checking for EVP_CIPHER_CTX_init in -lmysqlclient... no
checking for tchdbnew in -ltokyocabinet... no
configure: error: Cannot find Tokyo Cabinet
make[1]: *** [configure-stamp] Error 1
make[1]: Leaving directory `/usr/src/rudder-deb-packages'
dpkg-buildpackage: failure: debian/rules build gave error exit status 2
[...]
</pre>

I've tried different ways:

- Building Tokyocabinet in the temporary build folder and compile CFEngine with the same path. The package will be built but when installation will be made, Tokyocabinet will not be found:
<pre>
sles-10-sp3-64:~ # ldd /opt/rudder/bin/cf-agent 
	linux-vdso.so.1 =>  (0x00007fffc7fff000)
	libnss_nis.so.2 => /lib64/libnss_nis.so.2 (0x00002abee2d45000)
	librt.so.1 => /lib64/librt.so.1 (0x00002abee2e50000)
	libm.so.6 => /lib64/libm.so.6 (0x00002abee2f59000)
	libtokyocabinet.so.9 => not found
	libpcre.so.0 => /usr/lib64/libpcre.so.0 (0x00002abee30af000)
	libcrypto.so.0.9.8 => /usr/lib64/libcrypto.so.0.9.8 (0x00002abee31da000)
	libpthread.so.0 => /lib64/libpthread.so.0 (0x00002abee343e000)
	libc.so.6 => /lib64/libc.so.6 (0x00002abee3557000)
	libnsl.so.1 => /lib64/libnsl.so.1 (0x00002abee3797000)
	libnss_files.so.2 => /lib64/libnss_files.so.2 (0x00002abee38ae000)
	/lib64/ld-linux-x86-64.so.2 (0x00002abee2c29000)
	libdl.so.2 => /lib64/libdl.so.2 (0x00002abee39b9000)
sles-10-sp3-64:~ # ls -lh /opt/rudder/lib
total 9,4M
-rw-r--r--  1 root root 5,2M 2013-02-13 11:24 libpromises.a
-rwxr-xr-x  1 root root 1,1K 2013-02-13 11:24 libpromises.la
-rw-r--r--  1 root root 2,5M 2013-02-13 11:23 libtokyocabinet.a
lrwxrwxrwx  1 root root   25 2013-02-13 11:29 libtokyocabinet.so -> libtokyocabinet.so.9.11.0
lrwxrwxrwx  1 root root   25 2013-02-13 11:29 libtokyocabinet.so.9 -> libtokyocabinet.so.9.11.0
-rwxr-xr-x  1 root root 1,8M 2013-02-13 11:23 libtokyocabinet.so.9.11.0
drwxr-xr-x 21 root root  664 2013-02-13 11:29 perl5
drwxr-xr-x  2 root root   80 2013-02-13 11:29 pkgconfig
</pre>

- - Building Tokyocabinet in the temporary build folder and compile CFEngine with the final path. The result will be that CFEngine will not find Tokyocabinet, like on Debian:

<pre>
checking for EVP_CIPHER_CTX_init in -lmysqlclient... no
checking for tchdbnew in -ltokyocabinet... no
configure: error: Cannot find Tokyo Cabinet
</pre>

All of this seems logic to me, that's why I doubt that this is possible. May be Is there somthing that i've missed ?