$NetBSD: patch-aa,v 1.11 2011/01/12 08:53:52 adam Exp $ Find libpthread.so when not on the default rpath. Allow custom CC and CFLAGS. --- mDNSPosix/Makefile.orig 2009-02-02 19:44:06.000000000 +0000 +++ mDNSPosix/Makefile @@ -54,7 +54,6 @@ COREDIR = ../mDNSCore SHAREDDIR ?= ../mDNSShared JDK = /usr/jdk -CC = @cc BISON = @bison FLEX = @flex LD = ld -shared @@ -64,7 +64,7 @@ LN = ln -s -f CFLAGS_COMMON = -I$(COREDIR) -I$(SHAREDDIR) -I$(OBJDIR) -fwrapv -W -Wall -DPID_FILE=\"/var/run/mdnsd.pid\" -DMDNS_UDS_SERVERPATH=\"/var/run/mdnsd\" CFLAGS_PTHREAD = LINKOPTS = -LINKOPTS_PTHREAD = -lpthread +LINKOPTS_PTHREAD = $(LIBFLAGS) ${COMPILER_RPATH_FLAG}${PTHREADBASE}/lib ${PTHREAD_LDFLAGS} ${PTHREAD_LIBS} ${EXTRA_LIBS} LDSUFFIX = so JAVACFLAGS_OS = -fPIC -shared -ldns_sd @@ -100,7 +100,7 @@ endif else ifeq ($(os),linux) -CFLAGS_OS = -DNOT_HAVE_SA_LEN -DUSES_NETLINK -DHAVE_LINUX -DTARGET_OS_LINUX +CFLAGS_OS = -DNOT_HAVE_SA_LEN -DUSES_NETLINK -DHAVE_LINUX -DTARGET_OS_LINUX -D_GNU_SOURCE FLEXFLAGS_OS = -l JAVACFLAGS_OS += -I$(JDK)/include/linux OPTIONALTARG = nss_mdns @@ -126,7 +126,7 @@ CFLAGS_OS = # -pthread # Link a user-threaded process against libc_r instead of libc. CFLAGS_PTHREAD = -pthread -D_THREAD_SAFE -LINKOPTS_PTHREAD = -pthread +LINKOPTS_PTHREAD = $(LIBFLAGS) ${COMPILER_RPATH_FLAG}${PTHREADBASE}/lib ${PTHREAD_LDFLAGS} ${PTHREAD_LIBS} ${EXTRA_LIBS} JAVACFLAGS_OS += -I$(JDK)/include/freebsd LDCONFIG = ldconfig else @@ -141,7 +140,6 @@ ifeq ($(os),x) # we get build failures: ‘daemon’ is deprecated (declared at /usr/include/stdlib.h:283) CFLAGS_OS = -DHAVE_IPV6 -no-cpp-precomp -Werror -Wdeclaration-after-statement \ -D__MAC_OS_X_VERSION_MIN_REQUIRED=__MAC_OS_X_VERSION_10_4 #-Wunreachable-code -CC = @gcc-4.0 LD = $(CC) -dynamiclib LINKOPTS = -lSystem LDSUFFIX = dylib @@ -205,7 +204,7 @@ endif endif endif -CFLAGS = $(CFLAGS_COMMON) $(CFLAGS_OS) $(CFLAGS_DEBUG) +CFLAGS += $(CFLAGS_COMMON) $(CFLAGS_OS) -DMDNS_DEBUGMSGS=0 #############################################################################