# Compile ngx\_resty to statically link some libs?

**URL:** <https://www.ruby-forum.com/t/compile-ngx-resty-to-statically-link-some-libs/213879>\
**Category:** NGINX\
**Created:** [November 15, 2011, 3:31am UTC](https://www.ruby-forum.com/t/compile-ngx-resty-to-statically-link-some-libs/213879 "2011-11-15T03:31:03Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![dubstep](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/cdc98d/32.png) [@dubstep](https://www.ruby-forum.com/u/dubstep)\
**Post date:** [November 15, 2011, 3:31am UTC](https://www.ruby-forum.com/t/compile-ngx-resty-to-statically-link-some-libs/213879/1 "2011-11-15T03:31:03Z")

</div>

Hey agentzh, could you provide tips on how I could cut down this list of  
dynamically linked libs:

[david@dev-3 ngx\_openresty-1.0.8.26]$ ldd  
/usr/local/encap/nginx-resty-1.0.8.26/nginx/sbin/nginx  
linux-vdso.so.1 =\> (0x00007fff079fd000)  
libpthread.so.0 =\> /lib64/libpthread.so.0 (0x0000003aac200000)  
libcrypt.so.1 =\> /lib64/libcrypt.so.1 (0x0000003e08a00000)  
libssl.so.10 =\> /usr/lib64/libssl.so.10 (0x00000033d9c00000)  
libdrizzle.so.0 =\> /usr/lib64/libdrizzle.so.0 (0x00007fd4bcdf1000)  
libm.so.6 =\> /lib64/libm.so.6 (0x0000003e12000000)  
libpcre.so.0 =\> /lib64/libpcre.so.0 (0x0000003710800000)  
libcrypto.so.10 =\> /lib64/libcrypto.so.10 (0x0000003e13400000)  
libdl.so.2 =\> /lib64/libdl.so.2 (0x0000003e11000000)  
libz.so.1 =\> /lib64/libz.so.1 (0x0000003e11c00000)  
libc.so.6 =\> /lib64/libc.so.6 (0x0000003e10c00000)  
/lib64/ld-linux-x86-64.so.2 (0x0000003e10800000)  
libfreebl3.so =\> /lib64/libfreebl3.so (0x0000003e08e00000)  
libgssapi\_krb5.so.2 =\> /lib64/libgssapi\_krb5.so.2 (0x00000033d9400000)  
libkrb5.so.3 =\> /lib64/libkrb5.so.3 (0x00000033d9800000)  
libcom\_err.so.2 =\> /lib64/libcom\_err.so.2 (0x00000033d9000000)  
libk5crypto.so.3 =\> /lib64/libk5crypto.so.3 (0x000000374a800000)  
libkrb5support.so.0 =\> /lib64/libkrb5support.so.0 (0x000000374a000000)  
libkeyutils.so.1 =\> /lib64/libkeyutils.so.1 (0x0000003e13800000)  
libresolv.so.2 =\> /lib64/libresolv.so.2 (0x0000003e12c00000)  
libselinux.so.1 =\> /lib64/libselinux.so.1 (0x0000003749c00000)

Specifically, I’d really like to remove libdrizzle as a dependency on  
the target machine and just have the compile pull it in at link time.

Posted at Nginx Forum:

> **[compile ngx\_resty to statically link some libs?](https://forum.nginx.org/read.php?2,218343,218343#msg-218343)**
>
> Hey agentzh, could you provide tips on how I could cut down this list of dynamically linked libs: \[david@dev-3 ngx\_openresty-1.0.8.26\]$ ldd /usr/local/encap/nginx-resty-1.0.8.26/nginx/sbin/nginx linux-vdso.so.1 =\> (0x00007fff079fd000)...

---

<div class="post-metadata">

**Author:** ![dannynoonan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/839c29/32.png) [@dannynoonan](https://www.ruby-forum.com/u/dannynoonan)\
**Post date:** [November 15, 2011, 5:24am UTC](https://www.ruby-forum.com/t/compile-ngx-resty-to-statically-link-some-libs/213879/2 "2011-11-15T05:24:56Z")

</div>

On Tue, Nov 15, 2011 at 10:30 AM, dannynoonan [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> Hey agentzh, could you provide tips on how I could cut down this list of  
> dynamically linked libs:

[snip]

> Specifically, I’d really like to remove libdrizzle as a dependency on  
> the target machine and just have the compile pull it in at link time.

Try

```
./configure --with-ld-opt="-static" ...

```

while building ngx\_openresty 🙂

Regards,  
-agentzh

---

<div class="post-metadata">

**Author:** ![dannynoonan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/839c29/32.png) [@dannynoonan](https://www.ruby-forum.com/u/dannynoonan)\
**Post date:** [November 15, 2011, 11:35am UTC](https://www.ruby-forum.com/t/compile-ngx-resty-to-statically-link-some-libs/213879/3 "2011-11-15T11:35:56Z")

</div>

I’d tried that, but figured I was invoking it wrong, the error it  
yields:

checking for --with-ld-opt="-static" ... not found ./configure: error: the invalid value in --with-ld-opt="-static"

failed to run command: ./configure  
–prefix=/data/local/nginx-resty-1.0.8.26/nginx \

Reading up on the man page for ld caused me to try  
–with-ld-opt=“-Bstatic” which gets me past configure, but gmake still  
yields an ELF binary that dynamically links out to libdrizzle. The final  
gcc linking step looked like this:

gcc -o objs/nginx   
objs/src/core/nginx.o   
objs/src/core/ngx\_log.o   
objs/src/core/ngx\_palloc.o   
objs/src/core/ngx\_array.o   
objs/src/core/ngx\_list.o   
objs/src/core/ngx\_hash.o   
objs/src/core/ngx\_buf.o   
objs/src/core/ngx\_queue.o   
objs/src/core/ngx\_output\_chain.o   
objs/src/core/ngx\_string.o   
objs/src/core/ngx\_parse.o   
objs/src/core/ngx\_inet.o   
objs/src/core/ngx\_file.o   
objs/src/core/ngx\_crc32.o   
objs/src/core/ngx\_murmurhash.o   
objs/src/core/ngx\_md5.o   
objs/src/core/ngx\_rbtree.o   
objs/src/core/ngx\_radix\_tree.o   
objs/src/core/ngx\_slab.o   
objs/src/core/ngx\_times.o   
objs/src/core/ngx\_shmtx.o   
objs/src/core/ngx\_connection.o   
objs/src/core/ngx\_cycle.o   
objs/src/core/ngx\_spinlock.o   
objs/src/core/ngx\_cpuinfo.o   
objs/src/core/ngx\_conf\_file.o   
objs/src/core/ngx\_resolver.o   
objs/src/core/ngx\_open\_file\_cache.o   
objs/src/core/ngx\_crypt.o   
objs/src/event/ngx\_event.o   
objs/src/event/ngx\_event\_timer.o   
objs/src/event/ngx\_event\_posted.o   
objs/src/event/ngx\_event\_busy\_lock.o   
objs/src/event/ngx\_event\_accept.o   
objs/src/event/ngx\_event\_connect.o   
objs/src/event/ngx\_event\_pipe.o   
objs/src/os/unix/ngx\_time.o   
objs/src/os/unix/ngx\_errno.o   
objs/src/os/unix/ngx\_alloc.o   
objs/src/os/unix/ngx\_files.o   
objs/src/os/unix/ngx\_socket.o   
objs/src/os/unix/ngx\_recv.o   
objs/src/os/unix/ngx\_readv\_chain.o   
objs/src/os/unix/ngx\_udp\_recv.o   
objs/src/os/unix/ngx\_send.o   
objs/src/os/unix/ngx\_writev\_chain.o   
objs/src/os/unix/ngx\_channel.o   
objs/src/os/unix/ngx\_shmem.o   
objs/src/os/unix/ngx\_process.o   
objs/src/os/unix/ngx\_daemon.o   
objs/src/os/unix/ngx\_setproctitle.o   
objs/src/os/unix/ngx\_posix\_init.o   
objs/src/os/unix/ngx\_user.o   
objs/src/os/unix/ngx\_process\_cycle.o   
objs/src/os/unix/ngx\_linux\_init.o   
objs/src/event/modules/ngx\_epoll\_module.o   
objs/src/os/unix/ngx\_linux\_sendfile\_chain.o   
objs/src/event/ngx\_event\_openssl.o   
objs/src/core/ngx\_regex.o   
objs/src/http/ngx\_http.o   
objs/src/http/ngx\_http\_core\_module.o   
objs/src/http/ngx\_http\_special\_response.o   
objs/src/http/ngx\_http\_request.o   
objs/src/http/ngx\_http\_parse.o   
objs/src/http/ngx\_http\_header\_filter\_module.o   
objs/src/http/ngx\_http\_write\_filter\_module.o   
objs/src/http/ngx\_http\_copy\_filter\_module.o   
objs/src/http/modules/ngx\_http\_log\_module.o   
objs/src/http/ngx\_http\_request\_body.o   
objs/src/http/ngx\_http\_variables.o   
objs/src/http/ngx\_http\_script.o   
objs/src/http/ngx\_http\_upstream.o   
objs/src/http/ngx\_http\_upstream\_round\_robin.o   
objs/src/http/ngx\_http\_parse\_time.o   
objs/src/http/modules/ngx\_http\_static\_module.o   
objs/src/http/modules/ngx\_http\_index\_module.o   
objs/src/http/modules/ngx\_http\_chunked\_filter\_module.o   
objs/src/http/modules/ngx\_http\_range\_filter\_module.o   
objs/src/http/modules/ngx\_http\_headers\_filter\_module.o   
objs/src/http/modules/ngx\_http\_not\_modified\_filter\_module.o   
objs/src/http/ngx\_http\_busy\_lock.o   
objs/src/http/ngx\_http\_file\_cache.o   
objs/src/http/modules/ngx\_http\_gzip\_filter\_module.o   
objs/src/http/ngx\_http\_postpone\_filter\_module.o   
objs/src/http/modules/ngx\_http\_ssi\_filter\_module.o   
objs/src/http/modules/ngx\_http\_charset\_filter\_module.o   
objs/src/http/modules/ngx\_http\_userid\_filter\_module.o   
objs/src/http/modules/ngx\_http\_autoindex\_module.o   
objs/src/http/modules/ngx\_http\_auth\_basic\_module.o   
objs/src/http/modules/ngx\_http\_access\_module.o   
objs/src/http/modules/ngx\_http\_limit\_zone\_module.o   
objs/src/http/modules/ngx\_http\_limit\_req\_module.o   
objs/src/http/modules/ngx\_http\_geo\_module.o   
objs/src/http/modules/ngx\_http\_map\_module.o   
objs/src/http/modules/ngx\_http\_split\_clients\_module.o   
objs/src/http/modules/ngx\_http\_referer\_module.o   
objs/src/http/modules/ngx\_http\_rewrite\_module.o   
objs/src/http/modules/ngx\_http\_ssl\_module.o   
objs/src/http/modules/ngx\_http\_proxy\_module.o   
objs/src/http/modules/ngx\_http\_fastcgi\_module.o   
objs/src/http/modules/ngx\_http\_uwsgi\_module.o   
objs/src/http/modules/ngx\_http\_scgi\_module.o   
objs/src/http/modules/ngx\_http\_memcached\_module.o   
objs/src/http/modules/ngx\_http\_empty\_gif\_module.o   
objs/src/http/modules/ngx\_http\_browser\_module.o   
objs/src/http/modules/ngx\_http\_upstream\_ip\_hash\_module.o   
objs/addon/src/ndk.o   
objs/addon/src/ngx\_http\_echo\_module.o   
objs/addon/src/ngx\_http\_echo\_util.o   
objs/addon/src/ngx\_http\_echo\_timer.o   
objs/addon/src/ngx\_http\_echo\_var.o   
objs/addon/src/ngx\_http\_echo\_handler.o   
objs/addon/src/ngx\_http\_echo\_filter.o   
objs/addon/src/ngx\_http\_echo\_sleep.o   
objs/addon/src/ngx\_http\_echo\_location.o   
objs/addon/src/ngx\_http\_echo\_echo.o   
objs/addon/src/ngx\_http\_echo\_request\_info.o   
objs/addon/src/ngx\_http\_echo\_subrequest.o   
objs/addon/src/ngx\_http\_echo\_foreach.o   
objs/addon/src/ngx\_http\_xss\_filter\_module.o   
objs/addon/src/ngx\_http\_xss\_util.o   
objs/addon/src/ngx\_http\_set\_base32.o   
objs/addon/src/ngx\_http\_set\_default\_value.o   
objs/addon/src/ngx\_http\_set\_hashed\_upstream.o   
objs/addon/src/ngx\_http\_set\_quote\_sql.o   
objs/addon/src/ngx\_http\_set\_quote\_json.o   
objs/addon/src/ngx\_http\_set\_unescape\_uri.o   
objs/addon/src/ngx\_http\_set\_misc\_module.o   
objs/addon/src/ngx\_http\_set\_escape\_uri.o   
objs/addon/src/ngx\_http\_set\_hash.o   
objs/addon/src/ngx\_http\_set\_local\_today.o   
objs/addon/src/ngx\_http\_set\_hex.o   
objs/addon/src/ngx\_http\_set\_base64.o   
objs/addon/src/ngx\_http\_set\_random.o   
objs/addon/src/ngx\_http\_set\_hmac.o   
objs/addon/src/ngx\_http\_form\_input\_module.o   
objs/addon/src/ngx\_http\_encrypted\_session\_module.o   
objs/addon/src/ngx\_http\_encrypted\_session\_cipher.o   
objs/addon/src/ngx\_http\_drizzle\_module.o   
objs/addon/src/ngx\_http\_drizzle\_handler.o   
objs/addon/src/ngx\_http\_drizzle\_processor.o   
objs/addon/src/ngx\_http\_drizzle\_upstream.o   
objs/addon/src/ngx\_http\_drizzle\_util.o   
objs/addon/src/ngx\_http\_drizzle\_output.o   
objs/addon/src/ngx\_http\_drizzle\_keepalive.o   
objs/addon/src/ngx\_http\_drizzle\_quoting.o   
objs/addon/src/ngx\_http\_drizzle\_checker.o   
objs/addon/src/ngx\_http\_lua\_script.o   
objs/addon/src/ngx\_http\_lua\_log.o   
objs/addon/src/ngx\_http\_lua\_subrequest.o   
objs/addon/src/ngx\_http\_lua\_ndk.o   
objs/addon/src/ngx\_http\_lua\_control.o   
objs/addon/src/ngx\_http\_lua\_time.o   
objs/addon/src/ngx\_http\_lua\_misc.o   
objs/addon/src/ngx\_http\_lua\_variable.o   
objs/addon/src/ngx\_http\_lua\_string.o   
objs/addon/src/ngx\_http\_lua\_output.o   
objs/addon/src/ngx\_http\_lua\_headers.o   
objs/addon/src/ngx\_http\_lua\_req\_body.o   
objs/addon/src/ngx\_http\_lua\_uri.o   
objs/addon/src/ngx\_http\_lua\_args.o   
objs/addon/src/ngx\_http\_lua\_ctx.o   
objs/addon/src/ngx\_http\_lua\_regex.o   
objs/addon/src/ngx\_http\_lua\_module.o   
objs/addon/src/ngx\_http\_lua\_headers\_out.o   
objs/addon/src/ngx\_http\_lua\_headers\_in.o   
objs/addon/src/ngx\_http\_lua\_directive.o   
objs/addon/src/ngx\_http\_lua\_consts.o   
objs/addon/src/ngx\_http\_lua\_exception.o   
objs/addon/src/ngx\_http\_lua\_util.o   
objs/addon/src/ngx\_http\_lua\_cache.o   
objs/addon/src/ngx\_http\_lua\_conf.o   
objs/addon/src/ngx\_http\_lua\_contentby.o   
objs/addon/src/ngx\_http\_lua\_rewriteby.o   
objs/addon/src/ngx\_http\_lua\_accessby.o   
objs/addon/src/ngx\_http\_lua\_setby.o   
objs/addon/src/ngx\_http\_lua\_capturefilter.o   
objs/addon/src/ngx\_http\_lua\_clfactory.o   
objs/addon/src/ngx\_http\_lua\_pcrefix.o   
objs/addon/src/ngx\_http\_lua\_headerfilterby.o   
objs/addon/src/ngx\_http\_lua\_shdict.o   
objs/addon/src/ngx\_http\_headers\_more\_filter\_module.o   
objs/addon/src/ngx\_http\_headers\_more\_headers\_out.o   
objs/addon/src/ngx\_http\_headers\_more\_headers\_in.o   
objs/addon/src/ngx\_http\_headers\_more\_util.o   
objs/addon/src/ngx\_http\_srcache\_filter\_module.o   
objs/addon/src/ngx\_http\_srcache\_util.o   
objs/addon/src/ngx\_http\_srcache\_var.o   
objs/addon/src/ngx\_http\_srcache\_store.o   
objs/addon/src/ngx\_http\_srcache\_fetch.o   
objs/addon/src/ngx\_http\_array\_var\_module.o   
objs/addon/src/ngx\_http\_array\_var\_util.o   
objs/addon/src/ngx\_http\_memc\_module.o   
objs/addon/src/ngx\_http\_memc\_request.o   
objs/addon/src/ngx\_http\_memc\_response.o   
objs/addon/src/ngx\_http\_memc\_util.o   
objs/addon/src/ngx\_http\_memc\_handler.o   
objs/addon/src/ngx\_http\_redis2\_module.o   
objs/addon/src/ngx\_http\_redis2\_handler.o   
objs/addon/src/ngx\_http\_redis2\_reply.o   
objs/addon/src/ngx\_http\_redis2\_util.o   
objs/addon/upstream-keepalive-nginx-module-0.3/ngx\_http\_upstream\_keepalive\_module.o  
  
objs/addon/auth-request-nginx-module-0.2/ngx\_http\_auth\_request\_module.o  
  
objs/addon/src/ngx\_http\_rds\_json\_filter\_module.o   
objs/addon/src/ngx\_http\_rds\_json\_processor.o   
objs/addon/src/ngx\_http\_rds\_json\_util.o   
objs/addon/src/ngx\_http\_rds\_json\_output.o   
objs/addon/src/ngx\_http\_rds\_json\_handler.o   
objs/addon/src/ngx\_http\_rds\_csv\_filter\_module.o   
objs/addon/src/ngx\_http\_rds\_csv\_processor.o   
objs/addon/src/ngx\_http\_rds\_csv\_util.o   
objs/addon/src/ngx\_http\_rds\_csv\_output.o   
objs/ngx\_modules.o   
-Bstatic -Wl,-E -lpthread -lcrypt -lssl -ldrizzle  
-L/home/david/src/third-party/ngx\_openresty-1.0.8.26/build/lua-root/data/local/nginx-resty-1.0.8.26/lua/lib  
-llua -lm -lpcre -lssl -lcrypto -ldl -lz

Here’s the full configure line:  
./configure --prefix=/data/local/nginx-resty-loko-1.0.8.26  
–with-ld-opt=“-Bstatic” --with-http\_drizzle\_module

Any ideas? Is trying to statically link a never ending struggle I should  
give up on early?

Posted at Nginx Forum:

> **[Re: compile ngx\_resty to statically link some libs?](https://forum.nginx.org/read.php?2,218343,218372#msg-218372)**
>
> Hey agentzh, could you provide tips on how I could cut down this list of dynamically linked libs: \[david@dev-3 ngx\_openresty-1.0.8.26\]$ ldd /usr/local/encap/nginx-resty-1.0.8.26/nginx/sbin/nginx linux-vdso.so.1 =\> (0x00007fff079fd000)...

---

<div class="post-metadata">

**Author:** ![dannynoonan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/839c29/32.png) [@dannynoonan](https://www.ruby-forum.com/u/dannynoonan)\
**Post date:** [November 17, 2011, 11:34pm UTC](https://www.ruby-forum.com/t/compile-ngx-resty-to-statically-link-some-libs/213879/4 "2011-11-17T23:34:18Z")

</div>

I replied to this, but it seems my reply got lost. I had some responses  
and follow-up questions, but I’ll wait a bit to see if this BB will just  
post it after a few hours.

Posted at Nginx Forum:

> **[Re: compile ngx\_resty to statically link some libs?](https://forum.nginx.org/read.php?2,218343,218520#msg-218520)**
>
> Hey agentzh, could you provide tips on how I could cut down this list of dynamically linked libs: \[david@dev-3 ngx\_openresty-1.0.8.26\]$ ldd /usr/local/encap/nginx-resty-1.0.8.26/nginx/sbin/nginx linux-vdso.so.1 =\> (0x00007fff079fd000)...

---

<div class="post-metadata">

**Author:** ![dannynoonan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/839c29/32.png) [@dannynoonan](https://www.ruby-forum.com/u/dannynoonan)\
**Post date:** [November 18, 2011, 3:20am UTC](https://www.ruby-forum.com/t/compile-ngx-resty-to-statically-link-some-libs/213879/5 "2011-11-18T03:20:54Z")

</div>

This forum can’t keep up w/ my posts.

Anyway, I figured out how to build a libdrizzle.a, now I need to figure  
out how to tell the ngx resty congfigure or gmake steps to slurp it in.

Posted at Nginx Forum:

> **[Re: compile ngx\_resty to statically link some libs?](https://forum.nginx.org/read.php?2,218343,218534#msg-218534)**
>
> Hey agentzh, could you provide tips on how I could cut down this list of dynamically linked libs: \[david@dev-3 ngx\_openresty-1.0.8.26\]$ ldd /usr/local/encap/nginx-resty-1.0.8.26/nginx/sbin/nginx linux-vdso.so.1 =\> (0x00007fff079fd000)...

---

<div class="post-metadata">

**Author:** ![dannynoonan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/839c29/32.png) [@dannynoonan](https://www.ruby-forum.com/u/dannynoonan)\
**Post date:** [November 16, 2011, 2:37am UTC](https://www.ruby-forum.com/t/compile-ngx-resty-to-statically-link-some-libs/213879/6 "2011-11-16T02:37:31Z")

</div>

On Tue, Nov 15, 2011 at 6:35 PM, dannynoonan [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> Reading up on the man page for ld caused me to try  
> –with-ld-opt=“-Bstatic” which gets me past configure, but gmake still  
> yields an ELF binary that dynamically links out to libdrizzle.

Could you confirm that the file libdrizzle.a indeed exists in your  
system?

> Any ideas? Is trying to statically link a never ending struggle I should  
> give up on early?

What’s your gcc’s version? And what does your “uname -a” say? Do you  
have the libdrizzle.a file in the right place?

Regards,  
-agentzh

---

<div class="post-metadata">

**Author:** ![dannynoonan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/839c29/32.png) [@dannynoonan](https://www.ruby-forum.com/u/dannynoonan)\
**Post date:** [November 18, 2011, 4:07am UTC](https://www.ruby-forum.com/t/compile-ngx-resty-to-statically-link-some-libs/213879/7 "2011-11-18T04:07:43Z")

</div>

On Fri, Nov 18, 2011 at 10:20 AM, dannynoonan [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> This forum can’t keep up w/ my posts.
> 
> Anyway, I figured out how to build a libdrizzle.a, now I need to figure  
> out how to tell the ngx resty congfigure or gmake steps to slurp it in.

When you have libdrizzle.a in the right place, then passing proper  
–with-ld-opt option for your system (like -static on my system) to  
the configure script should be sufficient 🙂

Regards,  
-agentzh

---

<div class="post-metadata">

**Author:** ![dannynoonan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/839c29/32.png) [@dannynoonan](https://www.ruby-forum.com/u/dannynoonan)\
**Post date:** [December 2, 2011, 2:45am UTC](https://www.ruby-forum.com/t/compile-ngx-resty-to-statically-link-some-libs/213879/8 "2011-12-02T02:45:32Z")

</div>

To close out the thread, here’s some shell snippets that produce an  
nginx binary with libdrizzle statically liniked in:

curl http://agentzh.org/misc/nginx/ngx\_openresty-1.0.9.10.tar.gz | tar -zxvf - cd ngx\_openresty-1.0.9.10 curl http://agentzh.org/misc/nginx/drizzle7-2011.07.21.tar.gz | tar -zxvf -
# build librizzle statically

(cd drizzle7-2011.07.21 && ./configure --without-server  
–enable-static && make libdrizzle-1.0)  
find . -name libdrizzle.a -exec cp {} . ;  
export LIBDRIZZLE\_INC=`pwd`/drizzle7-2011.07.21/libdrizzle-1.0/  
export LIBDRIZZLE\_LIB=`pwd`  
./configure --prefix=/data/local/nginx-resty-1.0.9.10  
–with-http\_drizzle\_module  
–add-module=$HOME/src/third-party/nginx-gridfs  
–add-module=$HOME/src/third-party/nginx\_upload\_module-2.2.0  
–with-ld-opt=“-Bstatic”  
gmake

[david@dev-3 ngx\_openresty-1.0.9.10]$ ldd build/nginx-1.0.9/objs/nginx |  
grep drizzle  
[david@dev-3 ngx\_openresty-1.0.9.10]$

Huzzah!

Posted at Nginx Forum:  
[http://forum.nginx.org/read.php?2,218343,219452#msg-219452](http://forum.nginx.org/read.php?2,218343,219452#msg-219452)
