#! /bin/sh /usr/share/dpatch/dpatch-run
## 15_build.dpatch by Yavor Doganov <yavor@gnu.org>
## Forwarded: not yet
## DP: Link all objects with the libs they use symbols from.

@DPATCH@
diff -urNad adun.app-0.8.2~/Kernel/AdunKernel/GNUmakefile adun.app-0.8.2/Kernel/AdunKernel/GNUmakefile
--- adun.app-0.8.2~/Kernel/AdunKernel/GNUmakefile	2008-01-17 12:37:12.000000000 +0200
+++ adun.app-0.8.2/Kernel/AdunKernel/GNUmakefile	2008-01-17 12:38:28.000000000 +0200
@@ -9,7 +9,7 @@
 VERSION = 0.13
 FRAMEWORK_NAME =AdunKernel 
 AdunKernel_LIB_DIRS = -L../Base/$(GNUSTEP_OBJ_DIR) -L$(GSL_LIB_DIR) 
-AdunKernel_LIBRARIES_DEPEND_UPON = -ladun_base -lgnustep-base -lgsl -lgslcblas
+AdunKernel_LIBRARIES_DEPEND_UPON = -ladun_base -lgsl -lgslcblas -lm $(FND_LIBS) $(OBJC_LIBS)
 endif
 
 export KERNEL_COMPILER ?= gcc
diff -urNad adun.app-0.8.2~/Kernel/GNUmakefile adun.app-0.8.2/Kernel/GNUmakefile
--- adun.app-0.8.2~/Kernel/GNUmakefile	2008-01-17 12:37:12.000000000 +0200
+++ adun.app-0.8.2/Kernel/GNUmakefile	2008-01-17 12:38:28.000000000 +0200
@@ -10,7 +10,7 @@
 ifeq ($(ADUN_LIBRARY_COMPILER), icc)
 	AdunCore_TOOL_LIBS =   -lAdunKernel -ladun_base -lgsl -lgslcblas -lfl -limf -lsvml -lm -ladun_base 
 else
-	AdunCore_TOOL_LIBS = -lAdunKernel -ladun_base  -lgsl -lgslcblas 
+	AdunCore_TOOL_LIBS = -lAdunKernel -ladun_base
 endif
 
 GNUSTEP_INSTALLATION_DOMAIN=USER
diff -urNad adun.app-0.8.2~/MolTalk/GNUmakefile.preamble adun.app-0.8.2/MolTalk/GNUmakefile.preamble
--- adun.app-0.8.2~/MolTalk/GNUmakefile.preamble	2008-01-17 12:37:12.000000000 +0200
+++ adun.app-0.8.2/MolTalk/GNUmakefile.preamble	2008-01-17 12:38:28.000000000 +0200
@@ -63,7 +63,7 @@
 ifeq ($(GNUSTEP_TARGET_OS),mingw32)
 LIBRARIES_DEPEND_UPON += -lgnustep-base -lobjc
 endif
-LIBRARIES_DEPEND_UPON +=
+LIBRARIES_DEPEND_UPON += -lm $(FND_LIBS) $(OBJC_LIBS)
 
 #
 # Flags dealing with installing and uninstalling
diff -urNad adun.app-0.8.2~/UL/AdunServer/GNUmakefile adun.app-0.8.2/UL/AdunServer/GNUmakefile
--- adun.app-0.8.2~/UL/AdunServer/GNUmakefile	2007-05-30 20:36:59.000000000 +0300
+++ adun.app-0.8.2/UL/AdunServer/GNUmakefile	2008-01-17 12:39:12.000000000 +0200
@@ -18,7 +18,7 @@
 #
 
 AdunServer_LIB_DIRS +=  -L../ULFramework/ULFramework.framework/Versions/Current -L../XMLLib/obj  
-AdunServer_TOOL_LIBS +=  -lXMLLib -lULFramework
+AdunServer_TOOL_LIBS +=  -lXMLLib -lULFramework -ladun_base -lAdunKernel -lMolTalk
 
 #
 # Resource files
diff -urNad adun.app-0.8.2~/UL/AdunServer/GNUmakefile.preamble adun.app-0.8.2/UL/AdunServer/GNUmakefile.preamble
--- adun.app-0.8.2~/UL/AdunServer/GNUmakefile.preamble	2008-01-17 12:37:12.000000000 +0200
+++ adun.app-0.8.2/UL/AdunServer/GNUmakefile.preamble	2008-01-17 12:38:28.000000000 +0200
@@ -15,9 +15,7 @@
 ADDITIONAL_CFLAGS += 
 
 # Additional flags to pass to the linker
-ifeq ($(MAKELEVEL), 3)
-ADDITIONAL_LDFLAGS += -ladun_base -lAdunKernel -lMolTalk 
-endif
+ADDITIONAL_LDFLAGS +=  
 
 # Additional include directories the compiler should search
 ifeq ($(MAKELEVEL),3)
diff -urNad adun.app-0.8.2~/UL/GNUmakefile adun.app-0.8.2/UL/GNUmakefile
--- adun.app-0.8.2~/UL/GNUmakefile	2008-01-17 12:37:12.000000000 +0200
+++ adun.app-0.8.2/UL/GNUmakefile	2008-01-17 12:38:28.000000000 +0200
@@ -25,7 +25,7 @@
 
 UL_LIB_DIRS += -L./XMLLib/obj -L. -L./ULFramework/ULFramework.framework/Versions/Current
 UL_HEADER_FILES_INSTALL_DIR = UL/
-UL_OBJC_LIBS =  -lXMLLib -lULFramework -lAdunKernel -lMolTalk -ladun_base  -lgsl -lgslcblas
+UL_GUI_LIBS =  -lXMLLib -lULFramework -lAdunKernel -lMolTalk -ladun_base
 
 GNUSTEP_INSTALLATION_DOMAIN = USER
 #
diff -urNad adun.app-0.8.2~/UL/ULFramework/GNUmakefile adun.app-0.8.2/UL/ULFramework/GNUmakefile
--- adun.app-0.8.2~/UL/ULFramework/GNUmakefile	2008-01-17 12:37:12.000000000 +0200
+++ adun.app-0.8.2/UL/ULFramework/GNUmakefile	2008-01-17 12:38:28.000000000 +0200
@@ -14,7 +14,7 @@
 #
 # Libraries
 #
-ULFramework_LIBRARIES_DEPEND_UPON += -lAdunKernel -lMolTalk -lXMLLib
+ULFramework_LIBRARIES_DEPEND_UPON += -lAdunKernel -lMolTalk -lXMLLib -lgsl -lgslcblas -lm $(FND_LIBS) $(OBJC_LIBS)
 
 ifeq ($(MAKELEVEL),3)
 ULFramework_LIB_DIRS =  -L$(ADUN_SOURCE_DIR)/Kernel/AdunKernel/AdunKernel.framework/Versions/Current -L$(ADUN_SOURCE_DIR)/MolTalk/MolTalk.framework/Versions/Current 
diff -urNad adun.app-0.8.2~/UL/XMLLib/GNUmakefile.preamble adun.app-0.8.2/UL/XMLLib/GNUmakefile.preamble
--- adun.app-0.8.2~/UL/XMLLib/GNUmakefile.preamble	2008-01-17 12:37:12.000000000 +0200
+++ adun.app-0.8.2/UL/XMLLib/GNUmakefile.preamble	2008-01-17 12:38:28.000000000 +0200
@@ -18,5 +18,6 @@
 ADDITIONAL_INCLUDE_DIRS += -I../ -I../../Kernel -I../../Kernel/AdunKernel/Headers -I$(HOME)/GNUstep/Library/Headers
 
 # Additional library directories the linker should search
-ADDITIONAL_LIB_DIRS += 
+ADDITIONAL_LIB_DIRS += -L$(ADUN_SOURCE_DIR)/Kernel/AdunKernel/AdunKernel.framework/Versions/Current
 
+LIBRARIES_DEPEND_UPON += -lAdunKernel $(FND_LIBS) $(OBJC_LIBS)
diff -urNad adun.app-0.8.2~/Kernel/Base/GNUmakefile.preamble adun.app-0.8.2/Kernel/Base/GNUmakefile.preamble
--- adun.app-0.8.2~/Kernel/Base/GNUmakefile.preamble	2008-01-17 12:37:12.000000000 +0200
+++ adun.app-0.8.2/Kernel/Base/GNUmakefile.preamble	2008-01-17 12:38:28.000000000 +0200
@@ -17,7 +17,8 @@
 ADDITIONAL_CFLAGS += 
 
 # Additional flags to pass to the linker
-ADDITIONAL_LDFLAGS +=  -lgsl -lgslcblas
+ADDITIONAL_LDFLAGS +=
+LIBRARIES_DEPEND_UPON += -lgsl -lm
 
 # Additional include directories the compiler should search
 ADDITIONAL_INCLUDE_DIRS += -I$(GSL_INCLUDE_DIR)
