--- config_office/configure.in-old
+++ config_office/configure.in
@@ -3910,6 +3910,24 @@
 fi
 AC_SUBST(SYSTEM_MYTHES)

+dnl ===================================================================
+dnl Checking for lpsolve
+dnl ===================================================================
+AC_MSG_CHECKING([which lpsolve to use])
+if test -n "$with_system_lpsolve" && test "$with_system_lpsolve" != "no"; then
+    AC_MSG_RESULT([external])
+    SYSTEM_LPSOLVE=YES
+    AC_CHECK_HEADER(lpsolve/lp_lib.h, [],
+       [ AC_MSG_ERROR(lpsolve55 headers not found.)], [])
+    AC_CHECK_LIB(lpsolve55, main, [],
+        [ AC_MSG_ERROR(liblpsolve55 library not found.)], [])
+else
+    AC_MSG_RESULT([internal])
+    SYSTEM_LPSOLVE=NO
+    BUILD_TYPE="$BUILD_TYPE LPSOLVE"
+fi
+AC_SUBST(SYSTEM_LPSOLVE)
+
 dnl ***************************************
 dnl testing libc version for Linux...
 dnl ***************************************

--- config_office/set_soenv.in-old	2006-06-20 13:58:26.000000000 +0200
+++ config_office/set_soenv.in	2006-06-20 14:03:48.000000000 +0200
@@ -1813,6 +1813,7 @@
 ToFile( "HUNSPELL_CFLAGS",   "@HUNSPELL_CFLAGS@",  "e" );
 ToFile( "SYSTEM_HYPH",       "@SYSTEM_HYPH@",      "e" );
 ToFile( "SYSTEM_MYTHES",     "@SYSTEM_MYTHES@",    "e" );
+ToFile( "SYSTEM_LPSOLVE",    "@SYSTEM_LPSOLVE@",  "e" );
 ToFile( "SYSTEM_XMLSEC",     "@SYSTEM_XMLSEC@",    "e" );
 ToFile( "PAM",               "@PAM@",              "e" );
 ToFile( "NEW_SHADOW_API",    "@NEW_SHADOW_API@",   "e" );
