Skip to content

Commit

Permalink
Fix cross-compilation on some systems
Browse files Browse the repository at this point in the history
Some Linux distributions (e.g. NixOS, where this issue was spotted) don't provide an unprefixed ar when cross-compiling. This PR aims to fix this.

See[NixOS/nixpkgs#67490](NixOS/nixpkgs#67490) for information on where did it start.
  • Loading branch information
Vika authored Aug 26, 2019
1 parent 62358ba commit cd1c1d8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,8 @@ ifdef LINKED_LIB_EXT
LINKED_LIB_SH := lib$(LIB_NAME).$(LINKED_LIB_EXT)
endif

# Some systems don't provide an unprefixed ar when cross-compiling.
AR=ar

LIBRARIES = $(LIB_SH) $(LIB_ST)
HEADERS = include/argon2.h
Expand Down Expand Up @@ -182,7 +184,7 @@ $(LIB_SH): $(SRC)
$(CC) $(CFLAGS) $(LIB_CFLAGS) $(LDFLAGS) $(SO_LDFLAGS) $^ -o $@

$(LIB_ST): $(OBJ)
ar rcs $@ $^
$(AR) rcs $@ $^

.PHONY: clean
clean:
Expand Down

0 comments on commit cd1c1d8

Please sign in to comment.