summaryrefslogtreecommitdiff
path: root/Makerules
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2017-03-07 15:40:09 +0100
committerTor Andersson <tor.andersson@artifex.com>2017-03-15 09:47:01 +0100
commit3966550ae8198eef2050c24d87dd7a89d1410ded (patch)
tree8fe50f9a6bf4666cf8cf4a16447956e357ecf01e /Makerules
parent0f5f5642a01dc7e8b9bc421ea8712c31e4c43429 (diff)
downloadmupdf-3966550ae8198eef2050c24d87dd7a89d1410ded.tar.xz
Only include pthread library when needed.
Rename HAVE_PTHREADS to HAVE_PTHREAD to match naming of other defines, where the macro is named after the library that is linked.
Diffstat (limited to 'Makerules')
-rw-r--r--Makerules24
1 files changed, 13 insertions, 11 deletions
diff --git a/Makerules b/Makerules
index 59f3612b..9282b5c4 100644
--- a/Makerules
+++ b/Makerules
@@ -78,12 +78,15 @@ CFLAGS+= -U__STRICT_ANSI__
else ifeq "$(OS)" "MACOS"
HAVE_X11 ?= no
-HAVE_PTHREADS ?= yes
+
+HAVE_PTHREAD := yes
+SYS_PTHREAD_CFLAGS :=
+SYS_PTHREAD_LIBS := -lpthread
# Mac OS X deprecated libcrypto, so the default is to not include it.
-HAVE_LIBCRYTO ?= no
-SYS_LIBCRYPTO_CFLAGS =
-SYS_LIBCRYPTO_LIBS =
+HAVE_LIBCRYTO := no
+SYS_LIBCRYPTO_CFLAGS :=
+SYS_LIBCRYPTO_LIBS :=
ifeq "$(HAVE_LIBCRYPTO)" "yes"
SYS_LIBCRYPTO_CFLAGS := -DHAVE_LIBCRYPTO
SYS_LIBCRYPTO_LIBS := -lcrypto
@@ -109,7 +112,9 @@ RANLIB_CMD := xcrun ranlib $@
# Linux uses pkg-config for system libraries.
else ifeq "$(OS)" "Linux"
-HAVE_PTHREADS ?= yes
+HAVE_PTHREAD := yes
+SYS_PTHREAD_CFLAGS :=
+SYS_PTHREAD_LIBS := -lpthread
ifeq "$(shell pkg-config --exists 'libcrypto <= 1.0.1t' && echo yes)" "yes"
HAVE_LIBCRYPTO := yes
@@ -175,7 +180,9 @@ LD = arm-none-linux-gnueabi-gcc
AR = arm-none-linux-gnueabi-ar
CFLAGS += -O3 -mfpu=neon -mcpu=cortex-a8 -mfloat-abi=softfp -ftree-vectorize -ffast-math -fsingle-precision-constant
CROSSCOMPILE=yes
-HAVE_PTHREADS ?= yes
+HAVE_PTHREAD := yes
+SYS_PTHREAD_CFLAGS :=
+SYS_PTHREAD_LIBS := -lpthread
endif
ifeq "$(OS)" "webos-pre-cross"
@@ -272,8 +279,3 @@ ifeq "$(CROSSCOMPILE)" "yes"
HAVE_X11 ?= no
HAVE_GLFW ?= no
endif
-
-ifeq "$(HAVE_PTHREADS)" "yes"
-CFLAGS += -DHAVE_PTHREADS
-LIBS += -lpthread
-endif