summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Drake <tlsa@netsurf-browser.org>2016-08-13 12:09:39 (GMT)
committer Michael Drake <tlsa@netsurf-browser.org>2016-08-13 12:31:07 (GMT)
commitfe00eac8cb0740b74ec2f586d98e741c84299d90 (patch)
tree2118f4f5b478ec66439c41fe14ccdfae4ad236e4
parent78d53fff1f7cd6dc3a40c01ac3b31b0eb7ab7e21 (diff)
downloadnetsurf-fe00eac8cb0740b74ec2f586d98e741c84299d90.tar.gz
netsurf-fe00eac8cb0740b74ec2f586d98e741c84299d90.tar.bz2
Buildsystem: Make curl/openssl usage build-time options.
-rw-r--r--Makefile19
-rw-r--r--Makefile.defaults8
-rw-r--r--content/fetch.c2
-rw-r--r--content/fetchers/Makefile6
4 files changed, 25 insertions, 10 deletions
diff --git a/Makefile b/Makefile
index 226bf4f..60810e1 100644
--- a/Makefile
+++ b/Makefile
@@ -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 196e192..1651a2d 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 11adf9c..93c7de2 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 8551542..9c84793 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