summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makerules7
-rw-r--r--Makethird7
2 files changed, 10 insertions, 4 deletions
diff --git a/Makerules b/Makerules
index d52d5591..6b1b3afd 100644
--- a/Makerules
+++ b/Makerules
@@ -63,8 +63,13 @@ SYS_OPENSSL_CFLAGS = -DHAVE_OPENSSL $(shell pkg-config --cflags libcrypto)
SYS_OPENSSL_LIBS = $(shell pkg-config --libs libcrypto)
endif
-# TODO: use pkg-config for system CURL
+ifeq "$(shell pkg-config --exists libcurl && echo yes)" "yes"
+HAVE_CURL = yes
+SYS_CURL_CFLAGS = $(shell pkg-config --cflags libcurl)
+SYS_CURL_LIBS = $(shell pkg-config --libs libcurl)
+else
SYS_CURL_DEPS = -lpthread -lrt
+endif
SYS_X11_CFLAGS = $(shell pkg-config --cflags x11 xext)
SYS_X11_LIBS = $(shell pkg-config --libs x11 xext)
diff --git a/Makethird b/Makethird
index 123d5509..73638699 100644
--- a/Makethird
+++ b/Makethird
@@ -454,6 +454,10 @@ CURL_CFLAGS := -I$(CURL_DIR)/include
CURL_LIBS := $(SYS_CURL_DEPS)
HAVE_CURL := yes
+
+else ifeq "$(HAVE_CURL)" "yes"
+CURL_CFLAGS := $(SYS_CURL_CFLAGS)
+CURL_LIBS := $(SYS_CURL_LIBS)
endif
# --- X11 ---
@@ -461,7 +465,4 @@ endif
ifeq "$(HAVE_X11)" "yes"
X11_CFLAGS := $(SYS_X11_CFLAGS)
X11_LIBS := $(SYS_X11_LIBS)
-else
-X11_CFLAGS :=
-X11_LIBS :=
endif