1713494a42debdf12ab248a85ec5e4fc828f42b0
angie
Sun Feb 27 11:10:42 2022 -0800
When CONDA_BUILD is set, skip freetype and get openssl static libs from ${PREFIX}/lib.
diff --git src/inc/common.mk src/inc/common.mk
index 1c6c0e9..0c3abb2 100644
--- src/inc/common.mk
+++ src/inc/common.mk
@@ -22,60 +22,65 @@
HG_DEFS=-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE -DMACHTYPE_${MACHTYPE}
HG_INC+=-I../inc -I../../inc -I../../../inc -I../../../../inc -I../../../../../inc -I$(kentSrc)/htslib
# to check for Mac OSX Darwin specifics:
UNAME_S := $(shell uname -s)
# to check for builds on hgwdev
HOSTNAME = $(shell uname -n)
ifeq (${HOSTNAME},hgwdev)
IS_HGWDEV = yes
else
IS_HGWDEV = no
endif
+# Skip freetype for conda build; not needed for utils, and the Mac build environment has
+# freetype installed but we don't want to use the system libraries because they can be
+# for a newer OSX version than the conda build target, and can be incompatible.
+ifneq (${CONDA_BUILD},1)
FREETYPECFLAGS = $(shell freetype-config --cflags 2> /dev/null)
# we use our static library on dev
ifeq (${IS_HGWDEV},no)
ifeq (${FREETYPELIBS},)
ifeq ($(UNAME_S),Darwin)
ifneq ($(wildcard /usr/local/Cellar/freetype/2.11.0/lib/libfreetype.a),)
ifneq ($(wildcard /usr/local/opt/bzip2/lib/libbz2.a),)
FREETYPELIBS = /usr/local/Cellar/freetype/2.11.0/lib/libfreetype.a /usr/local/opt/bzip2/lib/libbz2.a
else
FREETYPELIBS = /usr/local/Cellar/freetype/2.11.0/lib/libfreetype.a -lbz2
endif
else
ifneq ($(wildcard /opt/local/lib/libfreetype.a),)
FREETYPELIBS=/opt/local/lib/libfreetype.a /opt/local/lib/libbz2.a /opt/local/lib/libbrotlidec-static.a /opt/local/lib/libbrotlienc-static.a /opt/local/lib/libbrotlicommon-static.a
endif
endif
endif
ifeq (${FREETYPELIBS},)
FREETYPELIBS = $(shell freetype-config --libs 2> /dev/null )
endif
endif
endif
ifneq (${FREETYPECFLAGS},)
FREETYPECFLAGS += -DUSE_FREETYPE
endif
HG_INC += ${FREETYPECFLAGS}
L += ${FREETYPELIBS}
+endif
ifeq (${IS_HGWDEV},yes)
FULLWARN = yes
endif
ifeq (${HOSTNAME},cirm-01)
FULLWARN = yes
endif
ifeq (${PTHREADLIB},)
PTHREADLIB=-lpthread
endif
# required extra library on Mac OSX
ICONVLIB=
@@ -126,53 +131,57 @@
# libssl: disabled by default
ifneq (${SSL_DIR}, "/usr/include/openssl")
ifneq ($(UNAME_S),Darwin)
ifneq ($(wildcard ${SSL_DIR}),)
L+=-L${SSL_DIR}/lib
endif
endif
HG_INC+=-I${SSL_DIR}/include
endif
# on hgwdev, already using the static library with mysqllient.
ifeq (${IS_HGWDEV},yes)
L+=/hive/groups/browser/freetype/freetype-2.10.0/objs/.libs/libfreetype.a -lbz2
L+=/usr/lib64/libssl.a /usr/lib64/libcrypto.a -lkrb5 -lk5crypto -ldl
else
+ ifeq (${CONDA_BUILD},1)
+ L+=${PREFIX}/lib/libssl.a ${PREFIX}/lib/libcrypto.a
+ else
ifneq ($(wildcard /opt/local/lib/libssl.a),)
L+=/opt/local/lib/libssl.a
else
ifneq ($(wildcard /usr/lib/x86_64-linux-gnu/libssl.a),)
L+=/usr/lib/x86_64-linux-gnu/libssl.a
else
ifneq ($(wildcard /usr/local/opt/openssl/lib/libssl.a),)
L+=/usr/local/opt/openssl/lib/libssl.a
else
L+=-lssl
endif
endif
endif
ifneq ($(wildcard /opt/local/lib/libcrypto.a),)
L+=/opt/local/lib/libcrypto.a
else
ifneq ($(wildcard /usr/local/opt/openssl/lib/libcrypto.a),)
L+=/usr/local/opt/openssl/lib/libcrypto.a
else
L+=-lcrypto
endif
endif
endif
+endif
# autodetect where libm is installed
ifeq (${MLIB},)
ifneq ($(wildcard /usr/lib64/libm.a),)
MLIB=-lm
endif
endif
ifeq (${MLIB},)
MLIB=-lm
endif
# autodetect where png is installed
ifeq (${PNGLIB},)
ifneq ($(wildcard /usr/lib64/libpng.a),)
PNGLIB=/usr/lib64/libpng.a