aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorJosuah Demangeon <me@josuah.net>2022-07-16 00:47:00 +0200
committerJosuah Demangeon <me@josuah.net>2022-07-18 21:58:16 +0200
commit58fddf61ccd4715150f1dba40e62eac650ef9ee3 (patch)
tree417bda7938aeb18fbe8f352c9e127b01c31bc45f /Makefile
parent6eba56fcf0c8f5e7bddfdf2d71fd157c71876ae8 (diff)
downloadyosys-58fddf61ccd4715150f1dba40e62eac650ef9ee3.tar.gz
yosys-58fddf61ccd4715150f1dba40e62eac650ef9ee3.tar.bz2
yosys-58fddf61ccd4715150f1dba40e62eac650ef9ee3.zip
reduce the Makefile TCL compatibility code
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile10
1 files changed, 4 insertions, 6 deletions
diff --git a/Makefile b/Makefile
index 65efc62a5..99f7f8996 100644
--- a/Makefile
+++ b/Makefile
@@ -450,9 +450,12 @@ endif
ifeq ($(ENABLE_TCL),1)
TCL_VERSION ?= tcl$(shell bash -c "tclsh <(echo 'puts [info tclversion]')")
ifeq ($(OS), $(filter $(OS),FreeBSD OpenBSD NetBSD))
+# BSDs usually use tcl8.6, but the lib is named "libtcl86"
TCL_INCLUDE ?= /usr/local/include/$(TCL_VERSION)
+TCL_LIBS ?= -l$(subst .,,$(TCL_VERSION))
else
TCL_INCLUDE ?= /usr/include/$(TCL_VERSION)
+TCL_LIBS ?= -l$(TCL_VERSION)
endif
ifeq ($(CONFIG),mxe)
@@ -460,12 +463,7 @@ CXXFLAGS += -DYOSYS_ENABLE_TCL
LDLIBS += -ltcl86 -lwsock32 -lws2_32 -lnetapi32 -lz -luserenv
else
CXXFLAGS += $(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) $(PKG_CONFIG) --silence-errors --cflags tcl || echo -I$(TCL_INCLUDE)) -DYOSYS_ENABLE_TCL
-ifeq ($(OS), $(filter $(OS),FreeBSD OpenBSD NetBSD))
-# BSDs usually use tcl8.6, but the lib is named "libtcl86"
-LDLIBS += $(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) $(PKG_CONFIG) --silence-errors --libs tcl || echo -l$(TCL_VERSION) | tr -d '.')
-else
-LDLIBS += $(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) $(PKG_CONFIG) --silence-errors --libs tcl || echo -l$(TCL_VERSION))
-endif
+LDLIBS += $(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) $(PKG_CONFIG) --silence-errors --libs tcl || echo $(TCL_LIBS))
endif
endif