diff --git a/Geo/gmshSurface.cpp b/Geo/gmshSurface.cpp
index 09abb0d92f6e6fefd4c308bc4af46c9fbe3c46d1..a0e6c71f3e4f3d0652cd9b00c005cf7b72807ffa 100644
--- a/Geo/gmshSurface.cpp
+++ b/Geo/gmshSurface.cpp
@@ -1,4 +1,4 @@
-// $Id: gmshSurface.cpp,v 1.8 2007-03-14 10:21:12 remacle Exp $
+// $Id: gmshSurface.cpp,v 1.9 2008-01-18 20:41:33 geuzaine Exp $
 //
 // Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle
 //
@@ -117,6 +117,7 @@ SPoint3 gmshParametricSurface ::point(double par1, double par2) const
 {
 #if !defined(HAVE_MATH_EVAL)
   Msg(GERROR, "MathEval is not compiled in this version of Gmsh");
+  return SPoint3(0.,0.,0.);
 #else
   char *names[2] = {"u","v"};
   double values [2] = {par1,par2};
diff --git a/Mesh/Field.cpp b/Mesh/Field.cpp
index ab3d73428b3ffc07e9531df78f45a71cc60f08cc..77bc44676fe897c0b9d31ec3bd80e904a0bddbff 100644
--- a/Mesh/Field.cpp
+++ b/Mesh/Field.cpp
@@ -1,4 +1,4 @@
-// $Id: Field.cpp,v 1.9 2008-01-14 21:29:14 remacle Exp $
+// $Id: Field.cpp,v 1.10 2008-01-18 20:41:33 geuzaine Exp $
 //
 // Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle
 //
@@ -195,6 +195,7 @@ double ParametricField::operator()(double x, double y, double z)
 {
 #if !defined(HAVE_MATH_EVAL)
   Msg(GERROR, "MathEval is not compiled in this version of Gmsh");
+  return 0.;
 #else
   static char *names[3] = {"x", "y", "z"};
   double values [3] = {x, y, z};
@@ -233,6 +234,7 @@ double FunctionField::operator()(double x, double y, double z)
 {
 #if !defined(HAVE_MATH_EVAL)
   Msg(GERROR, "MathEval is not compiled in this version of Gmsh");
+  return 0.;
 #else
   values[0] = x;
   values[1] = y;
@@ -388,6 +390,7 @@ double AttractorField::operator()(double X, double Y, double Z)
     return sqrt(dist[0]);
 #else
     Msg(GERROR,"GMSH should be compiled with ANN in order to enable attractors");
+    return 0.;
 #endif
   }
 }
@@ -506,6 +509,7 @@ double AttractorField_1DMesh::operator()(double X, double Y, double Z)
   return lc;
 #else
   Msg(GERROR,"GMSH should be compiled with ANN in order to enable attractors");
+  return 1.e22;
 #endif
 }
 
diff --git a/Numeric/gsl_min.cpp b/Numeric/gsl_min.cpp
index a9671be5dbf0e22247d50c24dc434d729eac5a19..7cc2510e12d95c587528c2c7dcb694b5c931b450 100644
--- a/Numeric/gsl_min.cpp
+++ b/Numeric/gsl_min.cpp
@@ -1,4 +1,4 @@
-// $Id: gsl_min.cpp,v 1.1 2008-01-14 21:29:53 remacle Exp $
+// $Id: gsl_min.cpp,v 1.2 2008-01-18 20:41:33 geuzaine Exp $
 //
 // Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle
 //
@@ -291,6 +291,33 @@ void minimize_N (int N,
   
 } 					    
 
+#else
 
+#include "Message.h"
+
+void minimize_2 ( double (*f) (double, double, void *data), 
+		  void (*df) (double, double, double &, double &, double &, void *data) ,
+		  void *data,int niter,
+		  double &U, double &V, double &res)
+{
+  Msg(GERROR, "Gmsh must be compiled with GSL support for minimize_2");
+}
+
+void minimize_3 ( double (*f) (double, double, double, void *data), 
+		  void (*df) (double, double, double , double &, double &, double &, double &, void *data) ,
+		  void *data,int niter,
+		  double &U, double &V, double &W, double &res)
+{
+  Msg(GERROR, "Gmsh must be compiled with GSL support for minimize_3");
+}
+
+void minimize_N (int N, 
+		 double (*f) (double*, void *data), 
+		 void (*df) (double*, double*, double &, void *data) ,
+		 void *data,int niter,
+		 double *, double &res)
+{
+  Msg(GERROR, "Gmsh must be compiled with GSL support for minimize_N");
+}
 
 #endif
diff --git a/configure.in b/configure.in
index e9d343b78bfd1e87a8c42ca1c74de33d157e0d92..492fa97793a4e9d07fbc153ce3b979c4d3570b21 100644
--- a/configure.in
+++ b/configure.in
@@ -1,4 +1,4 @@
-dnl $Id: configure.in,v 1.141 2008-01-18 20:02:27 geuzaine Exp $
+dnl $Id: configure.in,v 1.142 2008-01-18 20:41:33 geuzaine Exp $
 dnl
 dnl Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle
 dnl
@@ -869,6 +869,7 @@ AC_SUBST(OBJEXT)
 AC_SUBST(LIBEXT)
 AC_SUBST(ISYM)
 AC_SUBST(CSYM)
+AC_SUBST(DSYM)
 AC_SUBST(SYSINCLUDE)
 AC_OUTPUT(variables)
 
diff --git a/contrib/NR/Makefile b/contrib/NR/Makefile
index 22edd2e89cf985c31fc381b9de2bc83ae0515946..239304dc13583ed06dd3e563329b638615c14fa1 100644
--- a/contrib/NR/Makefile
+++ b/contrib/NR/Makefile
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.5 2008-01-18 20:02:30 geuzaine Exp $
+# $Id: Makefile,v 1.6 2008-01-18 20:41:33 geuzaine Exp $
 #
 # Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle
 #
@@ -21,11 +21,10 @@
 
 include ../../variables
 
-LIB     = ../../lib/libGmshNR.a
-INCLUDE = -I../../Common -I../../DataStr -I../../Numeric
+LIB     = ../../lib/libGmshNR${LIBEXT}
+INCLUDE = ${ISYM}../../Common ${ISYM}../../DataStr ${ISYM}../../Numeric
 # don't optimize this library: there are some problems with gcc...
-OPTIM = -O0
-CFLAGS  = ${OPTIM} ${FLAGS} ${INCLUDE} 
+CFLAGS  = ${FLAGS} ${INCLUDE} ${SYSINCLUDE}
 
 SRC = brent.cpp\
       dpythag.cpp\
@@ -39,19 +38,19 @@ SRC = brent.cpp\
       newt.cpp\
       nrutil.cpp
 
-OBJ = ${SRC:.cpp=.o}
+OBJ = ${SRC:.cpp=${OBJEXT}}
 
-.SUFFIXES: .o .cpp
+.SUFFIXES: ${OBJEXT} .cpp
 
 ${LIB}: ${OBJ}
-	${AR} ${LIB} ${OBJ}
+	${AR} ${ARFLAGS}${LIB} ${OBJ}
 	${RANLIB} ${LIB}
 
-.cpp.o:
-	${CXX} ${CFLAGS} -c $<
+.cpp${OBJEXT}:
+	${CXX} ${CFLAGS} ${CSYM} $<
 
 clean:
-	rm -f *.o 
+	rm -f *${OBJEXT} 
 
 depend:
 	(sed '/^# DO NOT DELETE THIS LINE/q' Makefile && \
diff --git a/contrib/Tetgen/Makefile b/contrib/Tetgen/Makefile
index fc1a5d13c2e17741582437af4469dc88fcf3aaf3..14beefce5b7391e6254aa74230b9457e6ecda77f 100644
--- a/contrib/Tetgen/Makefile
+++ b/contrib/Tetgen/Makefile
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.6 2008-01-18 20:13:13 geuzaine Exp $
+# $Id: Makefile,v 1.7 2008-01-18 20:41:33 geuzaine Exp $
 #
 # Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle
 #
@@ -21,24 +21,24 @@
 
 include ../../variables
 
-LIB     = ../../lib/libGmshTetgen.a
+LIB     = ../../lib/libGmshTetgen${LIBEXT}
 # Do not optimize (same as Triangle...) 
-CFLAGS  =  ${FLAGS} -DTETLIBRARY
+CFLAGS  = ${FLAGS} ${DSYM}TETLIBRARY
 
 SRC = predicates.cxx tetgen.cxx
-OBJ = ${SRC:.cxx=.o}
+OBJ = ${SRC:.cxx=${OBJEXT}}
 
-.SUFFIXES: .o .cxx
+.SUFFIXES: ${OBJEXT} .cxx
 
 ${LIB}: ${OBJ} 
-	${AR} ${LIB} ${OBJ} 
+	${AR} ${ARFLAGS}${LIB} ${OBJ} 
 	${RANLIB} ${LIB}
 
-.cxx.o:
-	${CXX} ${CFLAGS} -c $<
+.cxx${OBJEXT}:
+	${CXX} ${CFLAGS} ${CSYM} $<
 
 clean:
-	rm -f *.o
+	rm -f *${OBJEXT}
 
 depend:
 	(sed '/^# DO NOT DELETE THIS LINE/q' Makefile && \
diff --git a/variables.in b/variables.in
index 49f9ec867825ae2ba8f306011a0bff0e32100b0d..e665704e79fab6f2e186e796f12c7b93df359aae 100644
--- a/variables.in
+++ b/variables.in
@@ -1,4 +1,4 @@
-# $Id: variables.in,v 1.21 2008-01-18 20:13:12 geuzaine Exp $
+# $Id: variables.in,v 1.22 2008-01-18 20:41:33 geuzaine Exp $
 #
 # Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle
 #
@@ -57,6 +57,7 @@ RANLIB=@RANLIB@
 # The symbols used for includes and compiling
 ISYM=@ISYM@
 CSYM=@CSYM@
+DSYM=@DSYM@
 
 # The extension to use for object files, libraries and executables
 OBJEXT=@OBJEXT@