Closed Char-Aznable closed 6 years ago
OK. I figure it out. The issue was the make command 'subst' only substituting '-l' with '-L-l' but didn't replace '-L' with '-L-L' in the linker flags returned by pkg-config. The following patch using sed instead of subst fixes this issue:
diff --git a/GNUmakefile b/GNUmakefile
index 762033c0..0841fb2e 100644
--- a/GNUmakefile
+++ b/GNUmakefile
@@ -115,12 +115,12 @@ PICOBJECTS_PEASD = $(patsubst %.o,%.pic.o,$(OBJECTS_PEASD))
USE_RUNTIME_LINKER = $(shell grep "Linker" generated/gtkd/gtkc/atk.d)
ifeq ($(USE_RUNTIME_LINKER),)
- SOFLAGS_GTKD = $(subst -l,$(LINKERFLAG)-l,$(shell pkg-config --libs gtk+-3.0 librsvg-2.0))
- SOFLAGS_GTKDGL = $(LINKERFLAG)-L. $(LINKERFLAG)./libgtkd-$(MAJOR).so $(subst -l,$(LINKERFLAG)-l,$(shell pkg-config --libs gtkglext-3.0))
- SOFLAGS_GTKDSV = $(LINKERFLAG)-L. $(LINKERFLAG)./libgtkd-$(MAJOR).so $(subst -l,$(LINKERFLAG)-l,$(shell pkg-config --libs gtksourceview-3.0))
- SOFLAGS_GSTREAMERD = $(LINKERFLAG)-L. $(LINKERFLAG)./libgtkd-$(MAJOR).so $(subst -l,$(LINKERFLAG)-l,$(shell pkg-config --libs gstreamer-base-1.0))
- SOFLAGS_VTED = $(LINKERFLAG)-L. $(LINKERFLAG)./libgtkd-$(MAJOR).so $(subst -l,$(LINKERFLAG)-l,$(shell pkg-config --libs vte-2.91))
- SOFLAGS_PEASD = $(LINKERFLAG)-L. $(LINKERFLAG)./libgtkd-$(MAJOR).so $(subst -l,$(LINKERFLAG)-l,$(shell pkg-config --libs-only-l libpeas-1.0))
+ SOFLAGS_GTKD = $(shell pkg-config --libs gtk+-3.0 librsvg-2.0 | sed 's/-[lL]/-L&/g')
+ SOFLAGS_GTKDGL = $(LINKERFLAG)-L. $(LINKERFLAG)./libgtkd-$(MAJOR).so $(shell pkg-config --libs gtkglext-3.0 | sed 's/-[lL]/-L&/g')
+ SOFLAGS_GTKDSV = $(LINKERFLAG)-L. $(LINKERFLAG)./libgtkd-$(MAJOR).so $(shell pkg-config --libs gtksourceview-3.0 | sed 's/-[lL]/-L&/g')
+ SOFLAGS_GSTREAMERD = $(LINKERFLAG)-L. $(LINKERFLAG)./libgtkd-$(MAJOR).so $(shell pkg-config --libs gstreamer-base-1.0 | sed 's/-[lL]/-L&/g')
+ SOFLAGS_VTED = $(LINKERFLAG)-L. $(LINKERFLAG)./libgtkd-$(MAJOR).so $(shell pkg-config --libs vte-2.91 | sed 's/-[lL]/-L&/g')
+ SOFLAGS_PEASD = $(LINKERFLAG)-L. $(LINKERFLAG)./libgtkd-$(MAJOR).so $(shell pkg-config --libs-only-l libpeas-1.0 | sed 's/-[lL]/-L&/g')
endif
#######################################################################
PR submitted #229
Merged #229
Basically, what I did was cloning the GtkD repo and modify the GNUmakefile the prefix path and run make shared -j4. Everything looks fine until the linking stage. It failed with the message:
and the command that generates the error is
I'm using dmd 2.078.1 on CentOS release 6.9. I'm guessing it's related to some path definition in the makefile but I'm not familiar with the D compiler to figure it out.