+++ /dev/null
-From: Jakub Jirutka <jakub@jirutka.cz>
-
-Fix Makefile to respect system CFLAGS, LDFLAGS, and CC provided by environment.
-Allow to specify pkg-config command using variable, to be friendly with
-cross-compiling etc.
-
-diff --git a/Makefile b/Makefile
-index 195ef6b..375fb65 100644
---- a/Makefile
-+++ b/Makefile
-@@ -2,9 +2,10 @@ T=openssl
- \r
- PREFIX ?=/usr/local\r
- LIB_OPTION ?= -shared \r
-+PKG_CONFIG ?= pkg-config\r
- \r
- #Lua auto detect\r
--LUA_VERSION ?= $(shell pkg-config luajit --print-provides)\r
-+LUA_VERSION ?= $(shell $(PKG_CONFIG) luajit --print-provides)\r
- ifeq ($(LUA_VERSION),) ############ Not use luajit\r
- LUAV ?= $(shell lua -e "_,_,v=string.find(_VERSION,'Lua (.+)');print(v)")\r
- LUA_CFLAGS ?= -I$(PREFIX)/include/lua$(LUAV)\r
-@@ -12,8 +13,8 @@ LUA_LIBS ?= -L$(PREFIX)/lib
- LUA_LIBDIR ?= $(PREFIX)/lib/lua/$(LUAV)\r
- else\r
- LUAV ?= $(shell lua -e "_,_,v=string.find(_VERSION,'Lua (.+)');print(v)")\r
--LUA_CFLAGS ?= $(shell pkg-config luajit --cflags)\r
--LUA_LIBS ?= $(shell pkg-config luajit --libs)\r
-+LUA_CFLAGS ?= $(shell $(PKG_CONFIG) luajit --cflags)\r
-+LUA_LIBS ?= $(shell $(PKG_CONFIG) luajit --libs)\r
- LUA_LIBDIR ?= $(PREFIX)/lib/lua/$(LUAV)\r
- endif\r
- \r
-@@ -22,30 +23,30 @@ SYS := $(shell gcc -dumpmachine)
- \r
- ifneq (, $(findstring linux, $(SYS)))\r
- # Do linux things\r
--LDFLAGS = -fPIC -lrt -ldl\r
--OPENSSL_LIBS ?= $(shell pkg-config openssl --libs) \r
--OPENSSL_CFLAGS ?= $(shell pkg-config openssl --cflags)\r
--CFLAGS = -fPIC $(OPENSSL_CFLAGS) $(LUA_CFLAGS)\r
-+LDFLAGS += -fPIC -lrt -ldl\r
-+OPENSSL_LIBS ?= $(shell $(PKG_CONFIG) openssl --libs) \r
-+OPENSSL_CFLAGS ?= $(shell $(PKG_CONFIG) openssl --cflags)\r
-+CFLAGS += -fPIC $(OPENSSL_CFLAGS) $(LUA_CFLAGS)\r
- endif\r
- ifneq (, $(findstring apple, $(SYS)))\r
- # Do darwin things\r
--LDFLAGS = -fPIC -lrt -ldl\r
--OPENSSL_LIBS ?= $(shell pkg-config openssl --libs) \r
--OPENSSL_CFLAGS ?= $(shell pkg-config openssl --cflags)\r
--CFLAGS = -fPIC $(OPENSSL_CFLAGS) $(LUA_CFLAGS)\r
-+LDFLAGS += -fPIC -lrt -ldl\r
-+OPENSSL_LIBS ?= $(shell $(PKG_CONFIG) openssl --libs) \r
-+OPENSSL_CFLAGS ?= $(shell $(PKG_CONFIG) openssl --cflags)\r
-+CFLAGS += -fPIC $(OPENSSL_CFLAGS) $(LUA_CFLAGS)\r
- endif\r
- ifneq (, $(findstring mingw, $(SYS)))\r
- # Do mingw things\r
- V = $(shell lua -e "v=string.gsub('$(LUAV)','%.','');print(v)")\r
--LDFLAGS = -mwindows -lcrypt32 -lssl -lcrypto -lws2_32 $(PREFIX)/bin/lua$(V).dll \r
-+LDFLAGS += -mwindows -lcrypt32 -lssl -lcrypto -lws2_32 $(PREFIX)/bin/lua$(V).dll\r
- LUA_CFLAGS = -DLUA_LIB -DLUA_BUILD_AS_DLL -I$(PREFIX)/include/\r
--CFLAGS = $(OPENSSL_CFLAGS) $(LUA_CFLAGS)\r
-+CFLAGS += $(OPENSSL_CFLAGS) $(LUA_CFLAGS)\r
- endif\r
- ifneq (, $(findstring cygwin, $(SYS)))\r
- # Do cygwin things\r
--OPENSSL_LIBS ?= $(shell pkg-config openssl --libs) \r
--OPENSSL_CFLAGS ?= $(shell pkg-config openssl --cflags)\r
--CFLAGS = -fPIC $(OPENSSL_CFLAGS) $(LUA_CFLAGS)\r
-+OPENSSL_LIBS ?= $(shell $(PKG_CONFIG) openssl --libs) \r
-+OPENSSL_CFLAGS ?= $(shell $(PKG_CONFIG) openssl --cflags)\r
-+CFLAGS += -fPIC $(OPENSSL_CFLAGS) $(LUA_CFLAGS)\r
- endif\r
- #custome config\r
- ifeq (.config, $(wildcard .config))\r
-@@ -61,7 +62,7 @@ WARN_MOST = -Wall -W -Waggregate-return -Wcast-align -Wmissing-prototypes -Wnest
- WARN = -Wall -Wno-unused-value\r
- WARN_MIN = \r
- CFLAGS += $(WARN_MIN) -DPTHREADS \r
--CC= gcc -g $(CFLAGS) -Ideps\r
-+CC ?= gcc -g $(CFLAGS) -Ideps\r
- \r
- \r
- OBJS=src/asn1.o src/auxiliar.o src/bio.o src/cipher.o src/cms.o src/compat.o src/crl.o src/csr.o src/dh.o src/digest.o src/dsa.o \\r