diff options
-rw-r--r-- | Makefile | 19 | ||||
-rw-r--r-- | Makefile.defaults | 8 | ||||
-rw-r--r-- | content/fetch.c | 2 | ||||
-rw-r--r-- | content/fetchers/Makefile | 6 |
4 files changed, 25 insertions, 10 deletions
@@ -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)) diff --git a/Makefile.defaults b/Makefile.defaults index 196e19236..1651a2d21 100644 --- a/Makefile.defaults +++ b/Makefile.defaults @@ -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 diff --git a/content/fetch.c b/content/fetch.c index 11adf9cf4..93c7de2ad 100644 --- a/content/fetch.c +++ b/content/fetch.c @@ -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) { diff --git a/content/fetchers/Makefile b/content/fetchers/Makefile index 855154232..9c8479320 100644 --- a/content/fetchers/Makefile +++ b/content/fetchers/Makefile @@ -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 |