Skip to content

Commit

Permalink
Move dlfcn-win32 to submodule
Browse files Browse the repository at this point in the history
  • Loading branch information
mmicko committed Nov 12, 2024
1 parent 3afb772 commit dd7cd07
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 917 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,6 @@
[submodule "cxxopts"]
path = libs/cxxopts
url = https://github.com/jarro2783/cxxopts
[submodule "dlfcn-win32"]
path = libs/dlfcn-win32
url = https://github.com/dlfcn-win32/dlfcn-win32
10 changes: 7 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ endif
ifeq ($(ENABLE_PLUGINS),1)
CXXFLAGS += $(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) $(PKG_CONFIG) --silence-errors --cflags libffi) -DYOSYS_ENABLE_PLUGINS
ifeq ($(OS), MINGW)
CXXFLAGS += -Ilibs/dlfcn-win32
CXXFLAGS += -Ilibs/dlfcn-win32/src
endif
LIBS += $(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) $(PKG_CONFIG) --silence-errors --libs libffi || echo -lffi)
ifneq ($(OS), $(filter $(OS),FreeBSD OpenBSD NetBSD MINGW))
Expand Down Expand Up @@ -648,7 +648,7 @@ OBJS += kernel/fstdata.o
endif
ifeq ($(ENABLE_PLUGINS),1)
ifeq ($(OS), MINGW)
OBJS += libs/dlfcn-win32/dlfcn.o
OBJS += libs/dlfcn-win32/src/dlfcn.o
endif
endif

Expand Down Expand Up @@ -754,6 +754,10 @@ else
$(P) $(CXX) -o libyosys.so -shared -Wl,-soname,$(LIBDIR)/libyosys.so $(LINKFLAGS) $^ $(LIBS) $(LIBS_VERIFIC)
endif

%.o: %.c
$(Q) mkdir -p $(dir $@)
$(P) $(CXX) -o $@ -c $(CPPFLAGS) $(CXXFLAGS) $<

%.o: %.cc
$(Q) mkdir -p $(dir $@)
$(P) $(CXX) -o $@ -c $(CPPFLAGS) $(CXXFLAGS) $<
Expand Down Expand Up @@ -788,7 +792,7 @@ LIBS_NOVERIFIC = $(LIBS)
endif

$(PROGRAM_PREFIX)yosys-config: misc/yosys-config.in $(YOSYS_SRC)/Makefile
$(P) $(SED) -e 's#@CXXFLAGS@#$(subst -Ilibs/dlfcn-win32,,$(subst -I. -I"$(YOSYS_SRC)",-I"$(DATDIR)/include",$(strip $(CXXFLAGS_NOVERIFIC))))#;' \
$(P) $(SED) -e 's#@CXXFLAGS@#$(subst -Ilibs/dlfcn-win32/src,,$(subst -I. -I"$(YOSYS_SRC)",-I"$(DATDIR)/include",$(strip $(CXXFLAGS_NOVERIFIC))))#;' \
-e 's#@CXX@#$(strip $(CXX))#;' -e 's#@LINKFLAGS@#$(strip $(LINKFLAGS) $(PLUGIN_LINKFLAGS))#;' -e 's#@LIBS@#$(strip $(LIBS_NOVERIFIC) $(PLUGIN_LIBS))#;' \
-e 's#@BINDIR@#$(strip $(BINDIR))#;' -e 's#@DATDIR@#$(strip $(DATDIR))#;' < $< > $(PROGRAM_PREFIX)yosys-config
$(Q) chmod +x $(PROGRAM_PREFIX)yosys-config
Expand Down
1 change: 1 addition & 0 deletions libs/dlfcn-win32
Submodule dlfcn-win32 added at 048bff
Loading

0 comments on commit dd7cd07

Please sign in to comment.