diff --git a/README b/README
index 2ecfa448d293af5b32ebfa6ee9b4940faafed7d3..ed5ee404fff4219143d2046a5aef13f3587329f2 100644
--- a/README
+++ b/README
@@ -18,9 +18,10 @@ are not installed in their default locations.
 [ WARNING: Do not use FLTK 1.1.7. FLTK 1.1.7 has a few serious bugs
 that can lead to seemingly random crashes in Gmsh. FLTK 1.1.6 is OK,
 as are most SVN revisions anterior to {"2005-10-10"}. Unfortunately,
-these versions come with a buggy JPEG header: if you enable the local
-JPEG library when you configure FLTK, you will have to remove the
-"#include <config.h>" line in the file "jconfig.h". ]
+both 1.1.6 and all these versions come with a buggy JPEG header: if
+you enable the local JPEG library when you configure FLTK, you will
+have to remove the "#include <config.h>" line in the file
+"jconfig.h". ]
 
 To install a non-graphical version of Gmsh (that does not require FLTK
 nor OpenGL), type
diff --git a/configure b/configure
index 96bf4fb91f2a8f90e6ee714fcdc7741d0b077cc9..169e689126eff64bf97694614e6eaa027fdfb4ea 100755
--- a/configure
+++ b/configure
@@ -825,6 +825,7 @@ Optional Features:
   --enable-metis          compile METIS if available (default=yes)
   --enable-tetgen         compile Tetgen if available (default=yes)
   --enable-matheval       compile MathEval if available (default=yes)
+  --enable-model          compile Model interface if available (default=yes)
 
 Optional Packages:
   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
@@ -1388,6 +1389,11 @@ fi;
 if test "${enable_matheval+set}" = set; then
   enableval="$enable_matheval"
 
+fi;
+# Check whether --enable-model or --disable-model was given.
+if test "${enable_model+set}" = set; then
+  enableval="$enable_model"
+
 fi;
 
 UNAME=`uname`
@@ -3431,8 +3437,8 @@ fi
 
 else
 
-  GMSH_DIRS="${GMSH_DIRS} Box"
-  GMSH_LIBS="-Llib -lGmshBox -lGmshParser -lGmshMesh -lGmshGeo -lGmshCommon"
+  GMSH_DIRS="${GMSH_DIRS} Box BoxMain"
+  GMSH_LIBS="-Llib -lGmshBoxMain -lGmshBox -lGmshParser -lGmshMesh -lGmshGeo -lGmshCommon"
   GMSH_LIBS="${GMSH_LIBS} -lGmshDataStr -lGmshPlugin -lGmshNumeric -lGmshParallel"
 
 fi
@@ -3843,10 +3849,56 @@ fi
     if test "x$enable_ann" != "xno"; then
        echo "********************************************************************"
        echo "If you want to use ANN for doing fast geometrical searchs in the"
-       echo "STL mesher, please download ANN from the"
-       echo "author's web site at http://www.cs.umd.edu/~mount/ANN/,"
-       echo "unpack the archive and copy both src and include directories in the"
-       echo "./contrib/ANN subdirectory. Then run ./configure again."
+       echo "STL mesher, please download ANN from the author's web site at"
+       echo "http://www.cs.umd.edu/~mount/ANN/, unpack the archive and copy both"
+       echo "src and include directories in the /contrib/ANN subdirectory. Then"
+       echo "run ./configure again."
+       echo "********************************************************************"
+    fi
+  fi
+
+
+    as_ac_File=`echo "ac_cv_file_${DEVROOT}/MeshAdapt/model/model/model/SGModel.h" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for ${DEVROOT}/MeshAdapt/model/model/model/SGModel.h" >&5
+echo $ECHO_N "checking for ${DEVROOT}/MeshAdapt/model/model/model/SGModel.h... $ECHO_C" >&6
+if eval "test \"\${$as_ac_File+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  test "$cross_compiling" = yes &&
+  { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5
+echo "$as_me: error: cannot check for file existence when cross compiling" >&2;}
+   { (exit 1); exit 1; }; }
+if test -r "${DEVROOT}/MeshAdapt/model/model/model/SGModel.h"; then
+  eval "$as_ac_File=yes"
+else
+  eval "$as_ac_File=no"
+fi
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_File'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_File'}'`" >&6
+if test `eval echo '${'$as_ac_File'}'` = yes; then
+  MODEL="yes"
+else
+  MODEL="no"
+fi
+
+  if test "x${MODEL}" = "xyes"; then
+    if test "x$enable_model" != "xno"; then
+       GMSH_LIBS="${GMSH_LIBS} ${DEVROOT}/MeshAdapt/model/lib/x86_linux/libmodel-O.a"
+       FLAGS="-D_HAVE_SGMODEL_ ${FLAGS}"
+       echo "********************************************************************"
+       echo "You are building a version of Gmsh that contains model, the"
+       echo "Modeler Interface."
+       echo "Please note that by doing so, you agree with model's licensing"
+       echo "requirements."
+       echo "To disable model, run configure again with the --disable-model"
+       echo "option."
+       echo "********************************************************************"
+    fi
+  else
+    if test "x$enable_model" != "xno"; then
+       echo "********************************************************************"
+       echo "If you want to use model for doing modeling interface, contact us."
        echo "********************************************************************"
     fi
   fi
diff --git a/configure.in b/configure.in
index 166a89eac7cbfbf41b5816eea5428256a471d89f..4b517c564e54b4ebce67e9d9a382ad3a96f1428d 100644
--- a/configure.in
+++ b/configure.in
@@ -1,4 +1,4 @@
-dnl $Id: configure.in,v 1.94 2006-03-08 17:03:35 remacle Exp $
+dnl $Id: configure.in,v 1.95 2006-03-09 12:18:28 geuzaine Exp $
 dnl
 dnl Copyright (C) 1997-2006 C. Geuzaine, J.-F. Remacle
 dnl
@@ -93,6 +93,9 @@ AC_ARG_ENABLE(tetgen,
 AC_ARG_ENABLE(matheval,
               AC_HELP_STRING([--enable-matheval],
                              [compile MathEval if available (default=yes)]))
+AC_ARG_ENABLE(model,
+              AC_HELP_STRING([--enable-model],
+                             [compile Model interface if available (default=yes)]))
 
 dnl Get the operating system name
 UNAME=`uname`
@@ -324,10 +327,10 @@ if test "x$enable_contrib" != "xno"; then
     if test "x$enable_ann" != "xno"; then
        echo "********************************************************************"
        echo "If you want to use ANN for doing fast geometrical searchs in the"
-       echo "STL mesher, please download ANN from the"
-       echo "author's web site at http://www.cs.umd.edu/~mount/ANN/,"
-       echo "unpack the archive and copy both src and include directories in the"
-       echo "./contrib/ANN subdirectory. Then run ./configure again."
+       echo "STL mesher, please download ANN from the author's web site at"
+       echo "http://www.cs.umd.edu/~mount/ANN/, unpack the archive and copy both"
+       echo "src and include directories in the /contrib/ANN subdirectory. Then"
+       echo "run ./configure again."
        echo "********************************************************************"
     fi
   fi