Skip to content

Commit

Permalink
Search build directory first when linking (#523)
Browse files Browse the repository at this point in the history
Make sure that we look into our build directory before /usr/local/lib
or any other system directories. Developer builds should use newly
built libraries even if the system already has Themis installed.

If we look into /usr/local/lib first then developer builds may fail
on macOS which has Themis installed to /usr/local/lib by default.
This is important for correct dependency information to be recorded
in the libraries (especially if the ABI changes one day).
  • Loading branch information
ilammy committed Sep 3, 2019
1 parent c475dc1 commit da8b52c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ TEST_SRC_PATH = tests
TEST_BIN_PATH = $(BIN_PATH)/tests

CFLAGS += -I$(SRC_PATH) -I$(SRC_PATH)/wrappers/themis/ -I/usr/local/include -fPIC $(CRYPTO_ENGINE_CFLAGS)
LDFLAGS += -L/usr/local/lib
LDFLAGS += -L$(BIN_PATH) -L/usr/local/lib

unexport CFLAGS LDFLAGS

Expand Down
2 changes: 1 addition & 1 deletion src/themis/themis.mk
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ $(BIN_PATH)/$(LIBTHEMIS_A): $(THEMIS_OBJ)
@echo -n "link "
@$(BUILD_CMD)

$(BIN_PATH)/$(LIBTHEMIS_SO): CMD = $(CC) -shared -o $@ $(filter %.o %.a, $^) $(LDFLAGS) -L$(BIN_PATH) -lsoter $(LIBTHEMIS_SO_LDFLAGS)
$(BIN_PATH)/$(LIBTHEMIS_SO): CMD = $(CC) -shared -o $@ $(filter %.o %.a, $^) $(LDFLAGS) -lsoter $(LIBTHEMIS_SO_LDFLAGS)

$(BIN_PATH)/$(LIBTHEMIS_SO): $(BIN_PATH)/$(LIBSOTER_SO) $(THEMIS_OBJ)
@mkdir -p $(@D)
Expand Down

0 comments on commit da8b52c

Please sign in to comment.