diff -ru lighttpd-1.4.18/configure.in lighttpd-1.4.18+iPhone/configure.in
--- lighttpd-1.4.18/configure.in	2007-08-29 00:49:56.000000000 +0000
+++ lighttpd-1.4.18+iPhone/configure.in	2008-10-09 02:21:21.000000000 +0000
@@ -259,15 +259,16 @@
     CPPFLAGS="$CPPFLAGS `$PCRECONFIG --cflags`"
     OLDLIBS="$LIBS"
     LIBS="$LIBS $PCRE_LIB"
+    LIBS="$OLDLIBS"
+  fi
+fi
+
     AC_CHECK_LIB(pcre, pcre_compile, [
       AC_CHECK_HEADERS([pcre.h], [
         AC_DEFINE([HAVE_LIBPCRE], [1], [libpcre])
         AC_DEFINE([HAVE_PCRE_H], [1])
       ])
     ])
-    LIBS="$OLDLIBS"
-  fi
-fi
 
 AC_SUBST(PCRE_LIB)