sorry the above patch is incomplete. Attached a patch which also links the shared library correctly. Its probably overlinked, I have not checked if direct GL and GLU links are required. Use --as-needed in the build to remove unecessary links.
diff -Nru gmsh-2.5.1~beta1~svn9559~dfsg/debian/patches/fix-as-needed-build.patch gmsh-2.5.1~beta1~svn9559~dfsg/debian/patches/fix-as-needed-build.patch
--- gmsh-2.5.1~beta1~svn9559~dfsg/debian/patches/fix-as-needed-build.patch 1970-01-01 01:00:00.000000000 +0100
+++ gmsh-2.5.1~beta1~svn9559~dfsg/debian/patches/fix-as-needed-build.patch 2011-07-10 15:50:44.000000000 +0200
@@ -0,0 +1,22 @@
+Index: gmsh-2.5.1~beta1~svn9559~dfsg/CMakeLists.txt
+===================================================================
+--- gmsh-2.5.1~beta1~svn9559~dfsg.orig/CMakeLists.txt 2011-07-10 15:50:08.000000000 +0200
++++ gmsh-2.5.1~beta1~svn9559~dfsg/CMakeLists.txt 2011-07-10 15:50:41.636109844 +0200
+@@ -912,7 +912,7 @@
+ message("WARNING: By enabling ENABLE_MSVC_STATIC_RUNTIME, shared library wont link. "
+ "Change in msvc /MT flag to /MD in the shared project properties")
+ endif(MSVC AND ENABLE_MSVC_STATIC_RUNTIME)
+-target_link_libraries(shared ${LINK_LIBRARIES})
++target_link_libraries(shared ${LINK_LIBRARIES} -lgl2ps -lGL -lglut)
+
+ # binary targets
+ if(HAVE_FLTK)
+@@ -925,7 +925,7 @@
+ else(HAVE_FLTK)
+ add_executable(gmsh Common/Main.cpp ${GMSH_SRC})
+ endif(HAVE_FLTK)
+-target_link_libraries(gmsh ${LINK_LIBRARIES})
++target_link_libraries(gmsh ${LINK_LIBRARIES} -lgl2ps -lGL -lglut)
+
+ # increase stack to 16Mb on Windows to avoid overflows in recursive
+ # tet classification for large 3D Delaunay grids + force static
diff -Nru gmsh-2.5.1~beta1~svn9559~dfsg/debian/patches/series gmsh-2.5.1~beta1~svn9559~dfsg/debian/patches/series
--- gmsh-2.5.1~beta1~svn9559~dfsg/debian/patches/series 2011-07-06 15:06:52.000000000 +0200
+++ gmsh-2.5.1~beta1~svn9559~dfsg/debian/patches/series 2011-07-10 15:50:20.000000000 +0200
@@ -3,3 +3,4 @@
fix_spelling_errors.patch
switch_off_metis_and_tetgen.patch
delete_gl2ps_from_source.patch
+fix-as-needed-build.patch
diff -Nru gmsh-2.5.1~beta1~svn9559~dfsg/debian/rules gmsh-2.5.1~beta1~svn9559~dfsg/debian/rules
--- gmsh-2.5.1~beta1~svn9559~dfsg/debian/rules 2011-07-06 14:52:29.000000000 +0200
+++ gmsh-2.5.1~beta1~svn9559~dfsg/debian/rules 2011-07-10 15:50:20.000000000 +0200
@@ -4,7 +4,7 @@
%:
dh $@ --buildsystem=cmake --builddirectory=$(BUILDDIR)
-extra_flags += -DCMAKE_CXX_FLAGS="-DMPICH_SKIP_MPICXX -DOMPI_SKIP_MPICXX -fopenmp -lgl2ps -lGL -lglut" -DCMAKE_INCLUDE_PATH:="/usr/include/mpi"
+extra_flags += -DCMAKE_CXX_FLAGS="-DMPICH_SKIP_MPICXX -DOMPI_SKIP_MPICXX -fopenmp" -DCMAKE_INCLUDE_PATH:="/usr/include/mpi"
override_dh_auto_clean:
rm -rf $(BUILDDIR)
signature.asc
Description: OpenPGP digital signature

