freebsd-ports/net/mDNSResponder/files/patch-mDNSPosix-Makefile
Sunpoet Po-Chuan Hsieh c87493299f - Update to 765.1.2
- Remove outdated PORTSCOUT
- Simplify patch file
- Update WWW
2016-11-22 06:55:13 +00:00

110 lines
3.9 KiB
Text

--- mDNSPosix/Makefile.orig 2016-04-24 15:07:24 UTC
+++ mDNSPosix/Makefile
@@ -54,8 +54,8 @@ COREDIR = ../mDNSCore
SHAREDDIR ?= ../mDNSShared
JDK = /usr/jdk
-CC = @cc
-BISON = @bison
+CC ?= @cc
+BISON = @yacc
FLEX = @flex
ST = @strip
LD = ld -shared
@@ -121,9 +121,9 @@ else
ifeq ($(os),freebsd)
# If not already defined, set LOCALBASE to /usr/local
-LOCALBASE?=/usr/local
-INSTBASE=$(LOCALBASE)
-CFLAGS_OS = -DHAVE_IPV6
+LOCALBASE ?= /usr/local
+INSTBASE ?= $(DESTDIR)$(LOCALBASE)
+CFLAGS_OS = -DHAVE_IPV6 -DTARGET_OS_FREEBSD
# FreeBSD 4 requires threaded code to be compiled and linked using the "-pthread" option,
# and requires that the "-lpthread" link option NOT be used
# This appies only to FreeBSD -- "man cc" on FreeBSD says:
@@ -185,12 +185,7 @@
endif
endif
-# If directory /usr/share/man exists, then we install man pages into that, else /usr/man
-ifeq ($(wildcard /usr/share/man), /usr/share/man)
-MANPATH := /usr/share/man
-else
-MANPATH := /usr/man
-endif
+MANPATH := $(DESTDIR)$(MAN_PATH)
# If directories /etc/init.d/rc*.d exist, then we install into that (Suse)
ifeq ($(wildcard /etc/init.d/rc2.d/), /etc/init.d/rc2.d/)
@@ -219,7 +219,7 @@ CFLAGS = $(CFLAGS_COMMON) $(CFLAGS_OS) $
all: setup Daemon libdns_sd Clients SAClient SAResponder SAProxyResponder Identify NetMonitor $(OPTIONALTARG)
-install: setup InstalledStartup InstalledDaemon InstalledLib InstalledManPages InstalledClients $(OPTINSTALL)
+install: setup InstalledDaemon InstalledLib InstalledManPages InstalledClients $(OPTINSTALL)
# 'setup' sets up the build directory structure the way we want
setup:
@@ -259,13 +259,13 @@ libdns_sd: setup $(BUILDDIR)/libdns_sd.$
CLIENTLIBOBJS = $(OBJDIR)/dnssd_clientlib.c.so.o $(OBJDIR)/dnssd_clientstub.c.so.o $(OBJDIR)/dnssd_ipc.c.so.o
$(BUILDDIR)/libdns_sd.$(LDSUFFIX): $(CLIENTLIBOBJS)
- @$(LD) $(LINKOPTS) -o $@ $+
+ @$(CC) $(LINKOPTS) -shared -Wl,-soname=libdns_sd.$(LDSUFFIX).$(LIBVERS) -o $@ $+
@$(STRIP) $@
-Clients: setup libdns_sd ../Clients/build/dns-sd
+Clients: ../Clients/build/dns-sd
@echo "Clients done"
-../Clients/build/dns-sd:
+../Clients/build/dns-sd: setup libdns_sd
@$(MAKE) -C ../Clients
# nss_mdns target builds the Name Service Switch module
@@ -273,7 +273,7 @@ nss_mdns: setup $(BUILDDIR)/$(NSSLIBFILE
@echo "Name Service Switch module done"
$(BUILDDIR)/$(NSSLIBFILE): $(CLIENTLIBOBJS) $(OBJDIR)/nss_mdns.c.so.o
- @$(LD) $(LINKOPTS) -o $@ $+
+ @$(CC) $(LINKOPTS) -shared -Wl,-soname=$(NSSLINKNAME) -o $@ $+
@$(STRIP) $@
#############################################################################
@@ -298,14 +298,12 @@ InstalledNSS: $(NSSINSTPATH)/$(NSSLINKNA
@echo $+ " installed"
# Note: If daemon already installed, we make sure it's stopped before overwriting it
-$(INSTBASE)/sbin/mdnsd: $(BUILDDIR)/mdnsd $(STARTUPSCRIPTDIR)/$(STARTUPSCRIPTNAME)
- @if test -x $@; then $(STARTUPSCRIPTDIR)/$(STARTUPSCRIPTNAME) stop; fi
+$(INSTBASE)/sbin/mdnsd: $(BUILDDIR)/mdnsd
$(CP) $< $@
- @$(STARTUPSCRIPTDIR)/$(STARTUPSCRIPTNAME) start
$(INSTBASE)/lib/libdns_sd.$(LDSUFFIX).$(LIBVERS): $(BUILDDIR)/libdns_sd.$(LDSUFFIX)
$(CP) $< $@
- $(LN) $@ $(INSTBASE)/lib/libdns_sd.$(LDSUFFIX)
+ $(LN) $(notdir $@) $(INSTBASE)/lib/libdns_sd.$(LDSUFFIX)
ifdef LDCONFIG
# -m means 'merge into existing database', -R means 'rescan directories'
$(LDCONFIG) -mR
@@ -338,7 +336,7 @@ $(MANPATH)/man8/%.8: %.8
cp $< $@
chmod 444 $@
-$(MANPATH)/man8/mdnsd.8: $(SHAREDDIR)/mDNSResponder.8
+$(MANPATH)/man8/mdnsd.8: $(SHAREDDIR)/mDNSResponderPosix.8
cp $< $@
chmod 444 $@
@@ -491,6 +489,8 @@ $(OBJDIR)/NetMonitor.c.o: $(C
$(BUILDDIR)/dnsextd: $(DNSEXTDOBJ) $(OBJDIR)/dnsextd.c.threadsafe.o
$(CC) $+ -o $@ $(LINKOPTS) $(LINKOPTS_PTHREAD)
+$(OBJDIR)/dnsextd_lexer.l.o: $(OBJDIR)/dnsextd_parser.y.o
+
#############################################################################
# Implicit rules