From 6853b59dc3564e0774bb9ab2c6b20de41fb82cdf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrien=20Gallou=C3=ABt?= Date: Tue, 3 Sep 2019 16:23:59 +0000 Subject: [PATCH] Add sodium.sh MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Adrien Gallouët --- Makefile | 3 +++ sodium.sh | 18 ++++++++++++++++++ 2 files changed, 21 insertions(+) create mode 100755 sodium.sh diff --git a/Makefile b/Makefile index ffc65a7..b843257 100644 --- a/Makefile +++ b/Makefile @@ -11,6 +11,9 @@ CFLAGS ?= -std=c11 -O2 -Wall -fstack-protector-strong FLAGS := $(CFLAGS) $(LDFLAGS) $(CPPFLAGS) FLAGS += -DPACKAGE_NAME=\"$(NAME)\" -DPACKAGE_VERSION=\"$(VERSION)\" +FLAGS += -Ilibsodium-stable/src/libsodium/include +FLAGS += -Llibsodium-stable/src/libsodium/.libs + SRC := argz/argz.c mud/mud.c $(wildcard src/*.c) .PHONY: $(NAME) diff --git a/sodium.sh b/sodium.sh new file mode 100755 index 0000000..7d7e191 --- /dev/null +++ b/sodium.sh @@ -0,0 +1,18 @@ +#!/bin/sh + +file=LATEST.tar.gz +url=https://download.libsodium.org/libsodium/releases + +[ -f "$file" ] || wget -q "$url/$file" -O "$file" +[ -f "$file" ] || curl -SsfLO "$url/$file" +[ -f "$file" ] || { + echo "Couldn't download $url/$file" + exit 1 +} + +rm -rf libsodium-stable +tar zxf "$file" +cd libsodium-stable || exit 1 + +./configure --enable-minimal --disable-dependency-tracking --enable-static --disable-shared +make -j