ccc9f64c81d44f2e734c61cc73149f60e7768b10
hiram
  Tue Mar 26 19:16:36 2019 -0700
required new library on Mac OSX refs #23070

diff --git src/inc/common.mk src/inc/common.mk
index 19fc8aa..493d085 100644
--- src/inc/common.mk
+++ src/inc/common.mk
@@ -31,33 +31,42 @@
   IS_HGWDEV = no
 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=
+
 # pthreads is required
 ifneq ($(UNAME_S),Darwin)
   L+=${PTHREADLIB}
+else
+  ifneq ($(wildcard /opt/local/lib/libiconv.a),)
+       ICONVLIB=/opt/local/lib/libiconv.a
+  else
+       ICONVLIB=-liconv
+  endif
 endif
 
 # autodetect if openssl is installed
 ifeq (${SSLDIR},)
   SSLDIR = /usr/include/openssl
 endif
 
 # autodetect UCSC installation of hal:
 ifeq (${HALDIR},)
     HALDIR = /hive/groups/browser/hal/halRelease
     ifneq ($(wildcard ${HALDIR}),)
         ifeq (${USE_HAL},)
           USE_HAL=1
         endif
     endif
@@ -267,31 +276,31 @@
 endif
 
 ifeq (${ZLIB},)
   ZLIB=-lz
   ifneq ($(wildcard /opt/local/lib/libz.a),)
     ZLIB=/opt/local/lib/libz.a
   endif
   ifneq ($(wildcard /usr/lib64/libz.a),)
     ZLIB=/usr/lib64/libz.a
   endif
 endif
 
 #global external libraries
 L += $(kentSrc)/htslib/libhts.a
 
-L+=${PNGLIB} ${MLIB} ${ZLIB}
+L+=${PNGLIB} ${MLIB} ${ZLIB} ${ICONVLIB}
 HG_INC+=${PNGINCL}
 
 # pass through COREDUMP
 ifneq (${COREDUMP},)
     HG_DEFS+=-DCOREDUMP
 endif
 
 # autodetect UCSC additional source code with password for some external tracks on gbib
 GBIBDIR = /hive/groups/browser/gbib/
 ifneq ($(wildcard ${GBIBDIR}/*.c),)
   HG_DEFS+=-DUSE_GBIB_PWD
   HG_INC += -I${GBIBDIR}
 endif
 
 SYS = $(shell uname -s)