From d4fdffc9c39edab017d26ac19dd5c27144fcd2c1 Mon Sep 17 00:00:00 2001 From: Rick V Date: Wed, 10 Apr 2019 04:21:26 -0500 Subject: [PATCH] build fixes: using -s on Sun strips the ELF export symbol table, which leads to Bad Things if yer using the GNU linker for some godforsaken reason --- libhttp/Makefile | 2 +- libhttp/README.md | 14 +++++++++----- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/libhttp/Makefile b/libhttp/Makefile index f6f97a001..00543c1e7 100644 --- a/libhttp/Makefile +++ b/libhttp/Makefile @@ -49,7 +49,7 @@ libhttp.dll: cacerts.o miniz.o libhttp.o uri.o internal.o $(CC) -fPIC $(CFLAGS) $^ -s -shared -o $@ -static -lmbedx509 -lmbedtls -lmbedcrypto $(LIBS) libhttp.so: cacerts.o miniz.o libhttp.o uri.o internal.o - $(CC) -fPIC $(CFLAGS) $^ -s -shared -o $@ -static -lmbedx509 -lmbedtls -lmbedcrypto $(LIBS) + $(CC) $^ -fPIC $(CFLAGS) -shared -o $@ $(LIBS) -lmbedx509 -lmbedtls -lmbedcrypto $(SYS_LIBS) clean: -@rm base64enc diff --git a/libhttp/README.md b/libhttp/README.md index fe23f9c4d..c9ea0c7ff 100644 --- a/libhttp/README.md +++ b/libhttp/README.md @@ -4,19 +4,23 @@ ### requirements -- mbedtls 2.13.0 or later, for both host and windows -- wget for host (to download Netscape CA bundle from cURL website) +- mbedtls 2.13.0 or later, for both host and target (if cross-compiling) +- wget for host (to download Netscape root certificate store from cURL website) - Also included is a patch that can be applied to the mbedtls source to enable features like AES-NI in protected mode, plus some networking fixes for win32, see `../contrib/lokinet-bootstrap-winnt/mbedtls-win32.patch` build: - $ [g]make prepare; [g]make libhttp.[so|dll] + $ make prepare; make libhttp.[so|dll] -if you have installed mbedtls in a different path, define INCLUDE and LIBS with the path to the mbedtls headers, library search path, and any extra system libraries required (libsocket/libnsl on Sun, `ws2_32.lib` on Windows) +## Useful build-time variables + +- INCLUDE: path to mbedtls headers +- LIBS: path to mbedtls libraries +- SYS_LIBS: system-specific link libraries (`-lsocket -lnsl` on Sun systems, `-lws2_32` [or `-lwsock32` if IPv6 is disabled] on Windows) ## Usage - include libhttp.h in your source - link against libhttp.[so|dll] --rick \ No newline at end of file +-rick