#! /bin/sh /usr/share/dpatch/dpatch-run
## 01_linkfix.dpatch by  <andre@localhost>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: link alberta_util, blas, X and GL libs correctly

@DPATCH@

diff -Nru alberta-2.0-orig/alberta/src/alberta_1d/Makefile.am alberta-2.0/alberta/src/alberta_1d/Makefile.am
--- alberta-2.0-orig/alberta/src/alberta_1d/Makefile.am	2007-09-27 15:48:17.000000000 +0200
+++ alberta-2.0/alberta/src/alberta_1d/Makefile.am	2008-09-17 19:59:03.000000000 +0200
@@ -13,6 +13,8 @@
 AM_CFLAGS = $(ALBERTA_OPTIMIZE_CFLAGS)
 
 nodist_libalberta_1d_la_SOURCES = $(sources)
+libalberta_1d_la_LIBADD = ../../../alberta_util/src/.libs/libalberta_util.la $(OPENGL_ALL_LIB)
+libalberta_1d_la_LDFLAGS = --as-needed -version-info 2:0:0
 
 if HAVE_GLTOOLS
 nodist_libalberta_1d_la_SOURCES += ../Common/gltools.c
diff -Nru alberta-2.0-orig/alberta/src/alberta_1d_debug/Makefile.am alberta-2.0/alberta/src/alberta_1d_debug/Makefile.am
--- alberta-2.0-orig/alberta/src/alberta_1d_debug/Makefile.am	2007-09-27 15:48:17.000000000 +0200
+++ alberta-2.0/alberta/src/alberta_1d_debug/Makefile.am	2008-09-17 20:01:36.000000000 +0200
@@ -13,6 +13,8 @@
 AM_CFLAGS = $(ALBERTA_DEBUG_CFLAGS)
 
 nodist_libalberta_1d_debug_la_SOURCES = $(sources)
+libalberta_1d_debug_la_LIBADD = ../../../alberta_util/src/.libs/libalberta_util_debug.la $(OPENGL_ALL_LIB)
+libalberta_1d_debug_la_LDFLAGS = --as-needed -version-info 2:0:0
 
 if HAVE_GLTOOLS
 nodist_libalberta_1d_debug_la_SOURCES += ../Common/gltools.c
diff -Nru alberta-2.0-orig/alberta/src/alberta_2d/Makefile.am alberta-2.0/alberta/src/alberta_2d/Makefile.am
--- alberta-2.0-orig/alberta/src/alberta_2d/Makefile.am	2007-09-27 15:48:17.000000000 +0200
+++ alberta-2.0/alberta/src/alberta_2d/Makefile.am	2008-09-17 19:59:19.000000000 +0200
@@ -13,6 +13,8 @@
 AM_CFLAGS = $(ALBERTA_OPTIMIZE_CFLAGS)
 
 nodist_libalberta_2d_la_SOURCES = $(sources)
+libalberta_2d_la_LIBADD = ../../../alberta_util/src/.libs/libalberta_util.la $(OPENGL_ALL_LIB)
+libalberta_2d_la_LDFLAGS = --as-needed -version-info 2:0:0
 
 if HAVE_GLTOOLS
 nodist_libalberta_2d_la_SOURCES += ../Common/gltools.c
diff -Nru alberta-2.0-orig/alberta/src/alberta_2d_debug/Makefile.am alberta-2.0/alberta/src/alberta_2d_debug/Makefile.am
--- alberta-2.0-orig/alberta/src/alberta_2d_debug/Makefile.am	2007-09-27 15:48:17.000000000 +0200
+++ alberta-2.0/alberta/src/alberta_2d_debug/Makefile.am	2008-09-17 20:01:29.000000000 +0200
@@ -13,6 +13,8 @@
 AM_CFLAGS = $(ALBERTA_DEBUG_CFLAGS)
 
 nodist_libalberta_2d_debug_la_SOURCES = $(sources)
+libalberta_2d_debug_la_LIBADD = ../../../alberta_util/src/.libs/libalberta_util_debug.la $(OPENGL_ALL_LIB)
+libalberta_2d_debug_la_LDFLAGS = --as-needed -version-info 2:0:0
 
 if HAVE_GLTOOLS
 nodist_libalberta_2d_debug_la_SOURCES += ../Common/gltools.c
diff -Nru alberta-2.0-orig/alberta/src/alberta_3d/Makefile.am alberta-2.0/alberta/src/alberta_3d/Makefile.am
--- alberta-2.0-orig/alberta/src/alberta_3d/Makefile.am	2007-09-27 15:48:17.000000000 +0200
+++ alberta-2.0/alberta/src/alberta_3d/Makefile.am	2008-09-17 19:59:29.000000000 +0200
@@ -13,6 +13,8 @@
 AM_CFLAGS = $(ALBERTA_OPTIMIZE_CFLAGS)
 
 nodist_libalberta_3d_la_SOURCES = $(sources)
+libalberta_3d_la_LIBADD = ../../../alberta_util/src/.libs/libalberta_util.la $(OPENGL_ALL_LIB)
+libalberta_3d_la_LDFLAGS = --as-needed -version-info 2:0:0
 
 if HAVE_GLTOOLS
 nodist_libalberta_3d_la_SOURCES += ../Common/gltools.c
diff -Nru alberta-2.0-orig/alberta/src/alberta_3d_debug/Makefile.am alberta-2.0/alberta/src/alberta_3d_debug/Makefile.am
--- alberta-2.0-orig/alberta/src/alberta_3d_debug/Makefile.am	2007-09-27 15:48:17.000000000 +0200
+++ alberta-2.0/alberta/src/alberta_3d_debug/Makefile.am	2008-09-17 20:01:18.000000000 +0200
@@ -13,6 +13,8 @@
 AM_CFLAGS = $(ALBERTA_DEBUG_CFLAGS)
 
 nodist_libalberta_3d_debug_la_SOURCES = $(sources)
+libalberta_3d_debug_la_LIBADD = ../../../alberta_util/src/.libs/libalberta_util_debug.la $(OPENGL_ALL_LIB)
+libalberta_3d_debug_la_LDFLAGS = --as-needed -version-info 2:0:0
 
 if HAVE_GLTOOLS
 nodist_libalberta_3d_debug_la_SOURCES += ../Common/gltools.c
diff -Nru alberta-2.0-orig/alberta_util/src/Makefile.am alberta-2.0/alberta_util/src/Makefile.am
--- alberta-2.0-orig/alberta_util/src/Makefile.am	2007-09-27 15:56:20.000000000 +0200
+++ alberta-2.0/alberta_util/src/Makefile.am	2008-09-17 19:58:20.000000000 +0200
@@ -1,4 +1,7 @@
-lib_LTLIBRARIES = libalberta_util.la libalberta_util_debug.la
+lib_LTLIBRARIES = libalberta_util.la 
+if ALBERTA_DEBUG
+lib_LTLIBRARIES += libalberta_util_debug.la
+endif
 
 UTIL_SRC = alberta_util.h divers.c \
 msg.c alloc.c parameters.c cg.c gmres.c newton_fs.c spcg.c \
@@ -7,9 +7,13 @@
 
 libalberta_util_la_SOURCES = $(UTIL_SRC)
 libalberta_util_la_CFLAGS = $(ALBERTA_OPTIMIZE_CFLAGS)
+libalberta_util_la_LIBADD = $(BLAS_LIB)
+libalberta_util_la_LDFLAGS = --as-needed -version-info 2:0:0
 
 libalberta_util_debug_la_SOURCES = $(UTIL_SRC)
 libalberta_util_debug_la_CFLAGS = $(ALBERTA_DEBUG_CFLAGS)
+libalberta_util_debug_la_LIBADD = $(BLAS_LIB)
+libalberta_util_debug_la_LDFLAGS = --as-needed -version-info 2:0:0
 
 F77LD = $(CCLD)
 
