Skip to content

Makefile: enable linking with static libreadline #53

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master+wip
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -21,6 +21,9 @@ ENABLE_LIBYOSYS := 0
ENABLE_PROTOBUF := 0
ENABLE_ZLIB := 1

# valid only if ENABLE_READLINE == 1
ENABLE_STATIC_READLINE ?= 0

# python wrappers
ENABLE_PYOSYS := 0

@@ -61,6 +64,7 @@ GENFILES =
EXTRA_OBJS =
EXTRA_TARGETS =
TARGETS = yosys$(EXE) yosys-config
STATIC_LIBS =

PRETTY = 1
SMALL = 0
@@ -354,7 +358,15 @@ CXXFLAGS += -DYOSYS_ENABLE_READLINE
ifeq ($(OS), FreeBSD)
CXXFLAGS += -I/usr/local/include
endif
ifeq ($(ENABLE_STATIC_READLINE), 1)
LDLIBS += -ltinfo
ifeq ($(READLINE_STATIC),)
$(error Static readline selected, path to libreadline.a is not provided!)
endif
STATIC_LIBS += $(READLINE_STATIC)
else
LDLIBS += -lreadline
endif
ifeq ($(LINK_CURSES),1)
LDLIBS += -lcurses
ABCMKARGS += "ABC_READLINE_LIBRARIES=-lcurses -lreadline"
@@ -603,7 +615,7 @@ yosys.js: $(filter-out yosysjs-$(YOSYS_VER).zip,$(EXTRA_TARGETS))
endif

yosys$(EXE): $(OBJS)
$(P) $(LD) -o yosys$(EXE) $(LDFLAGS) $(OBJS) $(LDLIBS)
$(P) $(LD) -o yosys$(EXE) $(LDFLAGS) $(OBJS) $(LDLIBS) $(STATIC_LIBS)

libyosys.so: $(filter-out kernel/driver.o,$(OBJS))
ifeq ($(OS), Darwin)