From 280dc4b064d33dc045b64a8f8d8a76ce5bdb1490 Mon Sep 17 00:00:00 2001 From: Christopher Cole Date: Fri, 1 Jul 2016 20:22:26 -0400 Subject: [PATCH] Add build support for the Nix package manager Added build support for the Nix package manager: https://nixos.org/nix supersedes #757, forward-ported and ifdef change applied --- Makefile | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 9dabd6d02f..4dfebed0aa 100644 --- a/Makefile +++ b/Makefile @@ -33,6 +33,13 @@ ENDIAN=little # BIN=bin +# Only include/link with this if it exists. +# For the Nix package manager +ifdef NIX_PROFILE + NIXINC=-I$(NIX_PROFILE)/include + NIXLIB=-L$(NIX_PROFILE)/lib +endif + # Only include/link with this if it exists. # (Mac OS X El Capitan clean install does not have /opt) ifneq (,$(wildcard /opt/local/.)) @@ -69,7 +76,7 @@ CC=cc LN=ln -f CXX=c++ CXXFLAGS=$(CFLAGS) -CLD=$(CXX) $(CFLAGS) -L/usr/local/lib $(OPTLOCALLFLAGS) $(OPENSSLLFLAGS) +CLD=$(CXX) $(CFLAGS) -L/usr/local/lib $(NIXLIB) $(OPTLOCALLFLAGS) $(OPENSSLLFLAGS) ifeq ($(OS),osx) CLDOSFLAGS=-bind_at_load @@ -106,6 +113,7 @@ endif CFLAGS+= $(COSFLAGS) -ffast-math \ -funsigned-char \ -I/usr/local/include \ + $(NIXINC) \ $(OPTLOCALIFLAGS) \ $(OPENSSLIFLAGS) \ $(CURLINC) \