1
0
mirror of synced 2026-03-10 20:33:32 +00:00

Merge pull request #12 from trholding/master

Support Full Dynamic Linking (Linux)
This commit is contained in:
andrastantos
2025-01-31 15:06:18 -08:00
committed by GitHub
2 changed files with 17 additions and 1 deletions

2
README
View File

@@ -26,6 +26,8 @@ Linux build instructions:
4. Build
cd cray-sim/simulator
make build
Else for Linux distros that require dynamic linking do:
make LINK_TYPE=dynamic build
5. Build images
cd ../target/cos_117
./build_boot_tape

View File

@@ -141,7 +141,12 @@ INC_DIRS += $(DEP_INC_DIRS) $(EXTRA_INC)
DEFINES += _FILE_OFFSET_BITS=64
ifndef LINK_TYPE
LINK_TYPE=static
endif
# $(if ("$(SYSTEM)","cygwin"), $(1), :lib$(strip $(1)).a)
ifeq ($(LINK_TYPE),static)
define static_lib
:lib$(strip $(1)).a
endef
@@ -155,6 +160,13 @@ define static_lib
:lib$(strip $(1))-mt.a
endef
endif
else ifeq ($(LINK_TYPE),dynamic)
define static_lib
$(1)
endef
else
$(error LINK_TYPE must be either 'static' or 'dynamic', not '$(LINK_TYPE)')
endif
#################################################################################
### Setting up some common libraries
@@ -181,9 +193,11 @@ COMMON_LIBS += Bcrypt
endif
ifeq ($(SYSTEM),linux)
NCURSES_LIBS += $(call static_lib, ncurses)
NCURSES_LIBS += $(call static_lib, panel)
ifeq ($(LINK_TYPE),static)
NCURSES_LIBS += $(call static_lib, termcap)
NCURSES_LIBS += $(call static_lib, gpm)
NCURSES_LIBS += $(call static_lib, panel)
endif
BOOST_LIBS += $(call static_lib, rt)
COMMON_LIBS += pthread
endif