Buildsystem: Make curl/openssl usage build-time options.

This commit is contained in:
Michael Drake 2016-08-13 13:09:39 +01:00
parent 78d53fff1f
commit fe00eac8cb
4 changed files with 25 additions and 10 deletions

View File

@ -511,14 +511,6 @@ $(eval $(call pkg_config_find_and_add,libcss,CSS))
$(eval $(call pkg_config_find_and_add,libdom,DOM))
$(eval $(call pkg_config_find_and_add,libnsutils,nsutils))
$(eval $(call pkg_config_find_and_add,libutf8proc,utf8proc))
$(eval $(call pkg_config_find_and_add,openssl,OpenSSL))
# freemint does not support pkg-config for libcurl
ifeq ($(HOST),mint)
CFLAGS += $(shell curl-config --cflags)
LDFLAGS += $(shell curl-config --libs)
else
$(eval $(call pkg_config_find_and_add,libcurl,Curl))
endif
# Common libraries without pkg-config support
LDFLAGS += -lz
@ -529,9 +521,20 @@ LDFLAGS += -lz
NETSURF_FEATURE_PNG_CFLAGS := -DWITH_PNG
NETSURF_FEATURE_BMP_CFLAGS := -DWITH_BMP
NETSURF_FEATURE_GIF_CFLAGS := -DWITH_GIF
NETSURF_FEATURE_CURL_CFLAGS := -DWITH_CURL
NETSURF_FEATURE_NSSVG_CFLAGS := -DWITH_NS_SVG
NETSURF_FEATURE_OPENSSL_CFLAGS := -DWITH_OPENSSL
NETSURF_FEATURE_ROSPRITE_CFLAGS := -DWITH_NSSPRITE
$(eval $(call pkg_config_find_and_add_enabled,OPENSSL,openssl,OpenSSL))
# freemint does not support pkg-config for libcurl
ifeq ($(HOST),mint)
CFLAGS += $(shell curl-config --cflags)
LDFLAGS += $(shell curl-config --libs)
else
$(eval $(call pkg_config_find_and_add_enabled,CURL,libcurl,Curl))
endif
$(eval $(call pkg_config_find_and_add_enabled,PNG,libpng,PNG))
$(eval $(call pkg_config_find_and_add_enabled,BMP,libnsbmp,BMP))
$(eval $(call pkg_config_find_and_add_enabled,GIF,libnsgif,GIF))

View File

@ -31,6 +31,14 @@
# Options relating to all versions of NetSurf
# ----------------------------------------------------------------------------
# Enable NetSurf's use of libcurl for fetching over http(s)
# Valid options: YES, NO
NETSURF_USE_CURL := YES
# Enable NetSurf's use of openssl for fetching over https
# Valid options: YES, NO
NETSURF_USE_OPENSSL := YES
# Enable NetSurf's use of libnsbmp for displaying BMPs and ICOs
# Valid options: YES, NO
NETSURF_USE_BMP := YES

View File

@ -290,10 +290,12 @@ nserror fetcher_init(void)
{
nserror ret;
#ifdef WITH_CURL
ret = fetch_curl_register();
if (ret != NSERROR_OK) {
return ret;
}
#endif
ret = fetch_data_register();
if (ret != NSERROR_OK) {

View File

@ -1,8 +1,10 @@
# Content fetchers sources
S_FETCHERS := curl.c data.c file.c about.c resource.c
S_FETCHERS_YES := data.c file.c about.c resource.c
S_FETCHERS_NO :=
S_FETCHERS_$(NETSURF_USE_CURL) += curl.c
S_FETCHERS := $(addprefix content/fetchers/,$(S_FETCHERS))
S_FETCHERS := $(addprefix content/fetchers/,$(S_FETCHERS_YES))
# The following files depend on the testament
content/fetchers/about.c: testament $(OBJROOT)/testament.h