Skip to content

Commit

Permalink
Introduce placeholder option to STP
Browse files Browse the repository at this point in the history
Using STP_USE_LIB=placeholder means that the stub is compiled with a generic name and
copied to the installation, but is supposed to be replaced at a later date.

To make the intentions clear, the library is renamed to *_placeholder with a symlink
created with the original name pointing to the library.
  • Loading branch information
Vekhir committed Aug 16, 2023
1 parent cf03829 commit 9f34ab6
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/vendor/stp/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ ifeq ($(STP_USE_LIB),included) # compile from provided source
else ifeq ($(STP_USE_LIB),disable) # disable STP
SRC = src_stub
SNAME=libstp_disabled.$(SO)
else ifeq ($(STP_USE_LIB),placeholder) # use stub to be replaced by real library later
SRC = src_stub
SNAME=libstp.$(SO)
else ifeq ($(STP_USE_LIB),system) # use system STP
SRC = src_sys
ifeq ($(OSTYPE), Darwin)
Expand Down Expand Up @@ -64,10 +67,15 @@ install:
@# necessary for bsc linker (src/comp/Makefile:51)
ln -s "$(SNAME)" lib/libstp.$(SO)
# put self-compiled library in path where it can be found at runtime
ifeq ($(SRC), $(findstring $(SRC), src src_stub))
ifeq ($(STP_USE_LIB), $(findstring $(STP_USE_LIB), included disable placeholder))
install -m 755 -d $(PREFIX)/lib/SAT
install -m 644 "lib/$(SNAME)" $(PREFIX)/lib/SAT
endif
# make it obvious that the library is a placeholder
ifeq ($(STP_USE_LIB), $(findstring $(STP_USE_LIB), placeholder))
mv "$(PREFIX)/lib/SAT/$(SNAME)" libstp_placeholder.$(SO)
ln -s libstp_placeholder.$(SO) "$(PREFIX)/lib/SAT/$(SNAME)"
endif

clean:
$(MAKE) -C $(SRC) clean
Expand Down

0 comments on commit 9f34ab6

Please sign in to comment.