Add options to disable abc's usage of pthreads and readline

This commit is contained in:
Robert Ou 2018-05-18 22:42:24 -07:00
parent bfce3a7479
commit 93f79299a5
1 changed files with 10 additions and 0 deletions

View File

@ -23,6 +23,8 @@ ENABLE_NDEBUG := 0
LINK_CURSES := 0 LINK_CURSES := 0
LINK_TERMCAP := 0 LINK_TERMCAP := 0
LINK_ABC := 0 LINK_ABC := 0
# Needed for environments that don't have proper thread support (i.e. emscripten)
DISABLE_ABC_THREADS := 0
# clang sanitizers # clang sanitizers
SANITIZER = SANITIZER =
@ -241,9 +243,15 @@ else
ifeq ($(ENABLE_EDITLINE),1) ifeq ($(ENABLE_EDITLINE),1)
CXXFLAGS += -DYOSYS_ENABLE_EDITLINE CXXFLAGS += -DYOSYS_ENABLE_EDITLINE
LDLIBS += -ledit -ltinfo -lbsd LDLIBS += -ledit -ltinfo -lbsd
else
ABCMKARGS += "ABC_USE_NO_READLINE=1"
endif endif
endif endif
ifeq ($(DISABLE_ABC_THREADS),1)
ABCMKARGS += "ABC_USE_NO_PTHREADS=1"
endif
ifeq ($(ENABLE_PLUGINS),1) ifeq ($(ENABLE_PLUGINS),1)
CXXFLAGS += $(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) $(PKG_CONFIG) --silence-errors --cflags libffi) -DYOSYS_ENABLE_PLUGINS CXXFLAGS += $(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) $(PKG_CONFIG) --silence-errors --cflags libffi) -DYOSYS_ENABLE_PLUGINS
LDLIBS += $(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) $(PKG_CONFIG) --silence-errors --libs libffi || echo -lffi) LDLIBS += $(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) $(PKG_CONFIG) --silence-errors --libs libffi || echo -lffi)
@ -295,7 +303,9 @@ ifeq ($(ENABLE_ABC),1)
CXXFLAGS += -DYOSYS_ENABLE_ABC CXXFLAGS += -DYOSYS_ENABLE_ABC
ifeq ($(LINK_ABC),1) ifeq ($(LINK_ABC),1)
CXXFLAGS += -DYOSYS_LINK_ABC CXXFLAGS += -DYOSYS_LINK_ABC
ifeq ($(DISABLE_ABC_THREADS),0)
LDLIBS += -lpthread LDLIBS += -lpthread
endif
else else
ifeq ($(ABCEXTERNAL),) ifeq ($(ABCEXTERNAL),)
TARGETS += yosys-abc$(EXE) TARGETS += yosys-abc$(EXE)