diff --git a/configure b/configure
new file mode 100644
--- /dev/null
+++ b/configure
@@ -0,0 +1,9 @@
+#!/bin/sh
+#
+
+# subst standard header path variables
+if test -n "$CPPFLAGS" ; then
+    echo "Found CPPFLAGS in environment: '$CPPFLAGS'"
+    sed 's,@CPPFLAGS@,'"$CPPFLAGS"',g;s,@LDFLAGS@,'"$LDFLAGS"',g'  \
+        < fastcgi.buildinfo.in > fastcgi.buildinfo
+fi
diff --git a/fastcgi.buildinfo.in b/fastcgi.buildinfo.in
new file mode 100644
--- /dev/null
+++ b/fastcgi.buildinfo.in
@@ -0,0 +1,3 @@
+ghc-options: -optc@CPPFLAGS@
+cc-options:  @CPPFLAGS@
+ld-options:  @LDFLAGS@
diff --git a/hack-handler-fastcgi.cabal b/hack-handler-fastcgi.cabal
--- a/hack-handler-fastcgi.cabal
+++ b/hack-handler-fastcgi.cabal
@@ -1,5 +1,5 @@
 name:            hack-handler-fastcgi
-version:         0.0.0
+version:         0.0.1
 license:         BSD3
 license-file:    LICENSE
 author:          Michael Snoyman <michael@snoyman.com>
@@ -8,7 +8,8 @@
 category:        Web
 stability:       stable
 cabal-version:   >= 1.2
-build-type:      Simple
+build-type:      Configure
+extra-source-files: configure fastcgi.buildinfo.in
 homepage:        http://github.com/snoyberg/hack-handler-fastcgi/tree/master
 
 library
