From b977521d648bf4b124d53d384ac2a0e6efc5601a Mon Sep 17 00:00:00 2001
From: Christophe Geuzaine <cgeuzaine@ulg.ac.be>
Date: Sat, 19 Jan 2008 00:49:08 +0000
Subject: [PATCH] more for vc++

---
 configure               |  2 +-
 configure.in            |  4 ++--
 contrib/ANN/Makefile    | 23 +++++++++++++----------
 contrib/Netgen/Makefile |  5 ++++-
 doc/README.visualc++    |  1 -
 5 files changed, 20 insertions(+), 15 deletions(-)

diff --git a/configure b/configure
index 53cb6dc546..babf8f3ace 100755
--- a/configure
+++ b/configure
@@ -1955,7 +1955,7 @@ if test "x$enable_vc" = "xyes"; then
   FLAGS="/DWIN32 /DYY_NO_UNISTD_H /DHAVE_NO_DLL"
   OPTIM=/O2
   SYSINCLUDE="/I\"C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\" /I\"C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\""
-      LINKER=cl /F16777216
+      LINKER="cl /F16777216"
   EXEEXT=".exe"
 else
   ac_ext=c
diff --git a/configure.in b/configure.in
index 50bf3960c7..4e3dd087bc 100644
--- a/configure.in
+++ b/configure.in
@@ -1,4 +1,4 @@
-dnl $Id: configure.in,v 1.145 2008-01-18 22:53:31 geuzaine Exp $
+dnl $Id: configure.in,v 1.146 2008-01-19 00:49:08 geuzaine Exp $
 dnl
 dnl Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle
 dnl
@@ -167,7 +167,7 @@ if test "x$enable_vc" = "xyes"; then
   SYSINCLUDE="/I\"C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\" /I\"C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\""
   dnl increase stack size to 16Mb to avoid stack overflows in recursive 
   dnl tet classification for large 3D Delaunay grids
-  LINKER=cl /F16777216
+  LINKER="cl /F16777216"
   EXEEXT=".exe"
 else
   AC_PROG_CC
diff --git a/contrib/ANN/Makefile b/contrib/ANN/Makefile
index f1a2fdf7e5..b1631606a6 100644
--- a/contrib/ANN/Makefile
+++ b/contrib/ANN/Makefile
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.17 2008-01-18 20:13:13 geuzaine Exp $
+# $Id: Makefile,v 1.18 2008-01-19 00:49:08 geuzaine Exp $
 #
 # Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle
 #
@@ -21,9 +21,9 @@
 
 include ../../variables
 
-LIB     = ../../lib/libGmshANN.a
-INCLUDE = -I../../Common -I./include
-CFLAGS  = ${OPTIM} ${FLAGS} ${INCLUDE}
+LIB     = ../../lib/libGmshANN${LIBEXT}
+INCLUDE = ${DASH}I../../Common ${DASH}I./include
+CFLAGS  = ${OPTIM} ${FLAGS} ${INCLUDE} ${SYSINCLUDE}
 
 SRC = src/ANN.cpp\
       src/bd_fix_rad_search.cpp\
@@ -40,19 +40,22 @@ SRC = src/ANN.cpp\
       src/kd_util.cpp\
       src/perf.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 $< -o ${<:.cpp=.o}
+.cpp${OBJEXT}:
+	${CXX} ${CFLAGS} ${DASH}c $< ${DASH}o ${<:.cpp=${OBJEXT}}
+	if [ -r ${notdir ${<:.cpp=${OBJEXT}}} ]; then\
+           mv -f ${notdir ${<:.cpp=${OBJEXT}}} ${<:.cpp=${OBJEXT}};\
+        fi
 
 clean:
-	rm -f src/*.o
+	rm -f src/*${OBJEXT}
 
 depend:
 	(sed '/^# DO NOT DELETE THIS LINE/q' Makefile && \
diff --git a/contrib/Netgen/Makefile b/contrib/Netgen/Makefile
index 8af24d07f2..b86f6397cb 100644
--- a/contrib/Netgen/Makefile
+++ b/contrib/Netgen/Makefile
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.22 2008-01-19 00:24:34 geuzaine Exp $
+# $Id: Makefile,v 1.23 2008-01-19 00:49:08 geuzaine Exp $
 #
 # Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle
 #
@@ -136,6 +136,9 @@ ${LIB}: ${OBJ}
 
 .cpp${OBJEXT}:
 	${CXX} ${CFLAGS} ${DASH}c $< ${DASH}o ${<:.cpp=.obj}
+	if [ -r ${notdir ${<:.cpp=${OBJEXT}}} ]; then\
+           mv -f ${notdir ${<:.cpp=${OBJEXT}}} ${<:.cpp=${OBJEXT}};\
+        fi
 
 clean:
 	rm -f *${OBJEXT} libsrc/*/*${OBJEXT}
diff --git a/doc/README.visualc++ b/doc/README.visualc++
index b8ae262360..6fae85ec44 100644
--- a/doc/README.visualc++
+++ b/doc/README.visualc++
@@ -7,7 +7,6 @@ To compile Gmsh with Microsoft VisualC++
 3) set PATH=%PATH%;C:\cygwin\bin   (or wherever the cygin binaries are installed)
 
 4) cd gmsh && ./configure --enable-vc  --disable-gsl --disable-netgen 
-                          --disable-matheval --disable-triangle --disable-ann
                           --disable-occ --disable-med
 
 5) edit SYSINCLUDE in gmsh/variables to match your install of Visual C++
-- 
GitLab