Description: Link all needed libraries, fixes building with ld --no-undefined.
Author: Yavor Doganov <yavor@gnu.org>
Forwarded: not-needed
Last-Update: 2025-03-05
---

--- gorm.app.orig/Applications/Gorm/Palettes/0Menus/GNUmakefile.preamble
+++ gorm.app/Applications/Gorm/Palettes/0Menus/GNUmakefile.preamble
@@ -1,14 +1,12 @@
 # Additional include directories the compiler should search
 ADDITIONAL_INCLUDE_DIRS += -I../../../..
 
-ifeq ($(GNUSTEP_TARGET_OS),mingw32)
 ADDITIONAL_LIB_DIRS += \
         -L../../../../InterfaceBuilder/$(GNUSTEP_OBJ_DIR) \
         -L../../../../GormObjCHeaderParser/$(GNUSTEP_OBJ_DIR) \
         -L../../../../GormCore/GormCore.framework
 
 ADDITIONAL_GUI_LIBS += -lInterfaceBuilder -lGormCore
-endif
 ifeq ($(GNUSTEP_TARGET_OS),cygwin)
 ADDITIONAL_LIB_DIRS += \
         -L../../../../InterfaceBuilder/$(GNUSTEP_OBJ_DIR) \
--- gorm.app.orig/Applications/Gorm/Palettes/1Windows/GNUmakefile.preamble
+++ gorm.app/Applications/Gorm/Palettes/1Windows/GNUmakefile.preamble
@@ -1,14 +1,13 @@
 # Additional include directories the compiler should search
 ADDITIONAL_INCLUDE_DIRS += -I../../../..
 
-ifeq ($(GNUSTEP_TARGET_OS),mingw32)
 ADDITIONAL_LIB_DIRS += \
         -L../../../../InterfaceBuilder/$(GNUSTEP_OBJ_DIR) \
         -L../../../../GormObjCHeaderParser/$(GNUSTEP_OBJ_DIR) \
         -L../../../../GormCore/GormCore.framework
 
 ADDITIONAL_GUI_LIBS += -lInterfaceBuilder -lGormCore
-endif
+
 ifeq ($(GNUSTEP_TARGET_OS),cygwin)
 ADDITIONAL_LIB_DIRS += \
         -L../../../../InterfaceBuilder/$(GNUSTEP_OBJ_DIR) \
--- gorm.app.orig/Applications/Gorm/Palettes/2Controls/GNUmakefile.preamble
+++ gorm.app/Applications/Gorm/Palettes/2Controls/GNUmakefile.preamble
@@ -1,14 +1,13 @@
 # Additional include directories the compiler should search
 ADDITIONAL_INCLUDE_DIRS += -I../../../..
 
-ifeq ($(GNUSTEP_TARGET_OS),mingw32)
 ADDITIONAL_LIB_DIRS += \
         -L../../../../InterfaceBuilder/$(GNUSTEP_OBJ_DIR) \
         -L../../../../GormObjCHeaderParser/$(GNUSTEP_OBJ_DIR) \
         -L../../../../GormCore/GormCore.framework
 
 ADDITIONAL_GUI_LIBS += -lInterfaceBuilder -lGormCore
-endif
+
 ifeq ($(GNUSTEP_TARGET_OS),cygwin)
 ADDITIONAL_LIB_DIRS += \
         -L../../../../InterfaceBuilder/$(GNUSTEP_OBJ_DIR) \
--- gorm.app.orig/Applications/Gorm/Palettes/3Containers/GNUmakefile.preamble
+++ gorm.app/Applications/Gorm/Palettes/3Containers/GNUmakefile.preamble
@@ -1,14 +1,13 @@
 # Additional include directories the compiler should search
 ADDITIONAL_INCLUDE_DIRS += -I../../../..
 
-ifeq ($(GNUSTEP_TARGET_OS),mingw32)
 ADDITIONAL_LIB_DIRS += \
         -L../../../../InterfaceBuilder/$(GNUSTEP_OBJ_DIR) \
         -L../../../../GormObjCHeaderParser/$(GNUSTEP_OBJ_DIR) \
         -L../../../../GormCore/GormCore.framework
 
-ADDITIONAL_GUI_LIBS += -lInterfaceBuilder -lGormCore
-endif
+ADDITIONAL_GUI_LIBS += -lInterfaceBuilder -lGormCore -lm
+
 ifeq ($(GNUSTEP_TARGET_OS),cygwin)
 ADDITIONAL_LIB_DIRS += \
         -L../../../../InterfaceBuilder/$(GNUSTEP_OBJ_DIR) \
--- gorm.app.orig/Applications/Gorm/Palettes/4Data/GNUmakefile.preamble
+++ gorm.app/Applications/Gorm/Palettes/4Data/GNUmakefile.preamble
@@ -1,14 +1,13 @@
 # Additional include directories the compiler should search
 ADDITIONAL_INCLUDE_DIRS += -I../../../..
 
-ifeq ($(GNUSTEP_TARGET_OS),mingw32)
 ADDITIONAL_LIB_DIRS += \
         -L../../../../InterfaceBuilder/$(GNUSTEP_OBJ_DIR) \
         -L../../../../GormObjCHeaderParser/$(GNUSTEP_OBJ_DIR) \
         -L../../../../GormCore/GormCore.framework
 
 ADDITIONAL_GUI_LIBS += -lInterfaceBuilder -lGormCore
-endif
+
 ifeq ($(GNUSTEP_TARGET_OS),cygwin)
 ADDITIONAL_LIB_DIRS += \
         -L../../../../InterfaceBuilder/$(GNUSTEP_OBJ_DIR) \
--- gorm.app.orig/Plugins/GModel/GNUmakefile.preamble
+++ gorm.app/Plugins/GModel/GNUmakefile.preamble
@@ -1,14 +1,13 @@
 # Additional include directories the compiler should search
 ADDITIONAL_INCLUDE_DIRS += -I../../
 
-ifeq ($(GNUSTEP_TARGET_OS),mingw32)
 ADDITIONAL_LIB_DIRS += \
         -L../../InterfaceBuilder/$(GNUSTEP_OBJ_DIR) \
         -L../../GormObjCHeaderParser/$(GNUSTEP_OBJ_DIR) \
         -L../../GormCore/GormCore.framework
 
 ADDITIONAL_GUI_LIBS += -lInterfaceBuilder -lGormCore
-endif
+
 ifeq ($(GNUSTEP_TARGET_OS),cygwin)
 ADDITIONAL_LIB_DIRS += \
         -L../../InterfaceBuilder/$(GNUSTEP_OBJ_DIR) \
--- gorm.app.orig/Plugins/Gorm/GNUmakefile.preamble
+++ gorm.app/Plugins/Gorm/GNUmakefile.preamble
@@ -1,14 +1,13 @@
 # Additional include directories the compiler should search
 ADDITIONAL_INCLUDE_DIRS += -I../../
 
-ifeq ($(GNUSTEP_TARGET_OS),mingw32)
 ADDITIONAL_LIB_DIRS += \
         -L../../InterfaceBuilder/$(GNUSTEP_OBJ_DIR) \
         -L../../GormObjCHeaderParser/$(GNUSTEP_OBJ_DIR) \
         -L../../GormCore/GormCore.framework
 
 ADDITIONAL_GUI_LIBS += -lInterfaceBuilder -lGormCore
-endif
+
 ifeq ($(GNUSTEP_TARGET_OS),cygwin)
 ADDITIONAL_LIB_DIRS += \
         -L../../InterfaceBuilder/$(GNUSTEP_OBJ_DIR) \
--- gorm.app.orig/Plugins/Nib/GNUmakefile.preamble
+++ gorm.app/Plugins/Nib/GNUmakefile.preamble
@@ -1,14 +1,13 @@
 # Additional include directories the compiler should search
 ADDITIONAL_INCLUDE_DIRS += -I../../
 
-ifeq ($(GNUSTEP_TARGET_OS),mingw32)
 ADDITIONAL_LIB_DIRS += \
         -L../../InterfaceBuilder/$(GNUSTEP_OBJ_DIR) \
         -L../../GormObjCHeaderParser/$(GNUSTEP_OBJ_DIR) \
         -L../../GormCore/GormCore.framework
 
 ADDITIONAL_GUI_LIBS += -lInterfaceBuilder -lGormCore
-endif
+
 ifeq ($(GNUSTEP_TARGET_OS),cygwin)
 ADDITIONAL_LIB_DIRS += \
         -L../../InterfaceBuilder/$(GNUSTEP_OBJ_DIR) \
--- gorm.app.orig/Plugins/Xib/GNUmakefile.preamble
+++ gorm.app/Plugins/Xib/GNUmakefile.preamble
@@ -1,14 +1,13 @@
 # Additional include directories the compiler should search
 ADDITIONAL_INCLUDE_DIRS += -I../../
 
-ifeq ($(GNUSTEP_TARGET_OS),mingw32)
 ADDITIONAL_LIB_DIRS += \
         -L../../InterfaceBuilder/$(GNUSTEP_OBJ_DIR) \
         -L../../GormObjCHeaderParser/$(GNUSTEP_OBJ_DIR) \
         -L../../GormCore/GormCore.framework
 
 ADDITIONAL_GUI_LIBS += -lInterfaceBuilder -lGormCore
-endif
+
 ifeq ($(GNUSTEP_TARGET_OS),cygwin)
 ADDITIONAL_LIB_DIRS += \
         -L../../InterfaceBuilder/$(GNUSTEP_OBJ_DIR) \
--- gorm.app.orig/InterfaceBuilder/GNUmakefile
+++ gorm.app/InterfaceBuilder/GNUmakefile
@@ -31,7 +31,8 @@
 # Additional libraries
 #
 
-InterfaceBuilder_LIBRARIES_DEPEND_UPON += -lgnustep-gui -l$(FOUNDATION_LIBRARY_NAME)
+InterfaceBuilder_LIBRARIES_DEPEND_UPON += $(GUI_LIBS) $(FND_LIBS) \
+                                            $(OBJC_LIBS) -lm
 
 #
 # Header files
--- gorm.app.orig/GormObjCHeaderParser/GNUmakefile
+++ gorm.app/GormObjCHeaderParser/GNUmakefile
@@ -22,7 +22,7 @@
 #
 # Additional libraries
 #
-GormObjCHeaderParser_LIBRARIES_DEPEND_UPON += -lgnustep-gui -l$(FOUNDATION_LIBRARY_NAME)
+GormObjCHeaderParser_LIBRARIES_DEPEND_UPON += $(GUI_LIBS) $(FND_LIBS) $(OBJC_LIBS)
 
 #
 # Header files
--- gorm.app.orig/GormCore/GNUmakefile.preamble
+++ gorm.app/GormCore/GNUmakefile.preamble
@@ -24,13 +24,12 @@
 
 ADDITIONAL_INCLUDE_DIRS += -I../..
 
-ifeq ($(GNUSTEP_TARGET_OS),mingw32)
 ADDITIONAL_LIB_DIRS += \
         -L../InterfaceBuilder/$(GNUSTEP_OBJ_DIR) \
         -L../GormObjCHeaderParser/$(GNUSTEP_OBJ_DIR) \
 
-ADDITIONAL_GUI_LIBS += -lInterfaceBuilder -lGormObjCHeaderParser
-endif
+LIBRARIES_DEPEND_UPON += -lInterfaceBuilder -lGormObjCHeaderParser \
+                           $(GUI_LIBS) $(FND_LIBS) $(OBJC_LIBS) -lm
 ifeq ($(GNUSTEP_TARGET_OS),cygwin)
 ADDITIONAL_LIB_DIRS += \
         -L../InterfaceBuilder/$(GNUSTEP_OBJ_DIR) \
