Skip to content

Commit 75f2c10

Browse files
Add WITHOUTURL to build system, prefer /usr/bin/curl-config
1 parent eb45461 commit 75f2c10

File tree

1 file changed

+15
-6
lines changed

1 file changed

+15
-6
lines changed

Makefile

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,19 @@
11
# Automatically configure URL support if libcurl is present
2-
# Test for curl-config command and add build options if so
3-
ifneq (,$(shell command -v curl-config))
4-
export LM_CURL_VERSION=$(shell curl-config --version)
5-
export CFLAGS:=$(CFLAGS) -DLIBMSEED_URL
6-
export LDFLAGS:=$(LDFLAGS) $(shell curl-config --libs)
7-
$(info Configured with $(LM_CURL_VERSION))
2+
# Test for curl-config command and add build options if found
3+
# Prefer /usr/bin/curl-config over any other curl-config
4+
ifndef WITHOUTURL
5+
ifneq (,$(wildcard /usr/bin/curl-config))
6+
CURL_CONFIG := /usr/bin/curl-config
7+
else ifneq (,$(shell command -v curl-config))
8+
CURL_CONFIG := $(shell command -v curl-config)
9+
endif
10+
endif
11+
12+
ifneq (,$(CURL_CONFIG))
13+
export LM_CURL_VERSION=$(shell $(CURL_CONFIG) --version)
14+
export CFLAGS:=$(CFLAGS) -DLIBMSEED_URL
15+
export LDFLAGS:=$(LDFLAGS) $(shell $(CURL_CONFIG) --libs)
16+
$(info Configured with $(LM_CURL_VERSION))
817
endif
918

1019
.PHONY: all clean

0 commit comments

Comments
 (0)