updated SSL build options

This commit is contained in:
Sergio R. Caprile 2022-06-29 17:27:40 -03:00
parent 2536865c4d
commit 75069a44c7
2 changed files with 9 additions and 8 deletions

View File

@ -1,12 +1,13 @@
PROG ?= example
CFLAGS ?= -W -Wall -DMG_ENABLE_LINES=1
ifneq ($(MBEDTLS_DIR),)
CFLAGS += -DMG_ENABLE_MBEDTLS=1 -I$(MBEDTLS_DIR)/include -I/usr/include
CFLAGS += -L$(MBEDTLS_DIR)/lib -lmbedtls -lmbedcrypto -lmbedx509
else ifneq ($(OPENSSL_DIR),)
CFLAGS += -DMG_ENABLE_OPENSSL=1 -I$(OPENSSL_DIR)/include
CFLAGS += -L$(OPENSSL_DIR)/lib -lssl -lcrypto
SSL = ?
ifeq "$(SSL)" "MBEDTLS"
CFLAGS += -DMG_ENABLE_MBEDTLS=1 -lmbedtls -lmbedcrypto -lmbedx509
endif
ifeq "$(SSL)" "OPENSSL"
CFLAGS += -DMG_ENABLE_OPENSSL=1 -lssl -lcrypto
endif
all: $(PROG)

View File

@ -9,7 +9,7 @@
// any other URI serves static files from s_root_dir
//
// To enable SSL/TLS (using self-signed certificates in PEM files),
// 1. make MBEDTLS_DIR=/path/to/your/mbedtls/installation
// 1. make SSL=OPENSSL or make SSL=MBEDTLS
// 2. curl -k https://127.0.0.1:8443
#include "mongoose.h"