Lines 20-27
Link Here
|
20 |
# FreeBSD 4 requires threaded code to be compiled and linked using the "-pthread" option, |
20 |
# FreeBSD 4 requires threaded code to be compiled and linked using the "-pthread" option, |
21 |
# and requires that the "-lpthread" link option NOT be used |
21 |
# and requires that the "-lpthread" link option NOT be used |
22 |
# This appies only to FreeBSD -- "man cc" on FreeBSD says: |
22 |
# This appies only to FreeBSD -- "man cc" on FreeBSD says: |
23 |
@@ -217,7 +217,7 @@ CFLAGS = $(CFLAGS_COMMON) $(CFLAGS_OS) $ |
23 |
@@ -134,6 +134,8 @@ CFLAGS_PTHREAD = -pthread -D_THREAD_SA |
|
|
24 |
LINKOPTS_PTHREAD = -pthread |
25 |
JAVACFLAGS_OS += -I$(JDK)/include/freebsd |
26 |
LDCONFIG = ldconfig |
27 |
+OPTIONALTARG = nss_mdns |
28 |
+OPTINSTALL = InstalledNSS |
29 |
else |
24 |
|
30 |
|
|
|
31 |
ifeq ($(os),openbsd) |
32 |
@@ -165,10 +167,17 @@ endif |
33 |
endif |
34 |
|
35 |
NSSLIBNAME := libnss_mdns |
36 |
+ifeq ($(os),freebsd) |
37 |
+NSSVERSION := $(LIBVERS) |
38 |
+NSSLIBFILE := $(NSSLIBNAME).$(LDSUFFIX).$(LIBVERS) |
39 |
+NSSLINKNAME := $(NSSLIBNAME).$(LDSUFFIX) |
40 |
+NSSINSTPATH := $(INSTBASE)/lib |
41 |
+else |
42 |
NSSVERSION := 0.2 |
43 |
NSSLIBFILE := $(NSSLIBNAME)-$(NSSVERSION).so |
44 |
NSSLINKNAME := $(NSSLIBNAME).so.2 |
45 |
NSSINSTPATH := /lib |
46 |
+endif |
47 |
|
48 |
# If not otherwise defined, we install into /usr/lib and /usr/include |
49 |
# and our startup script is called mdns (e.g. /etc/init.d/mdns) |
50 |
@@ -217,7 +226,7 @@ CFLAGS = $(CFLAGS_COMMON) $(CFLAGS_OS) $ |
51 |
|
25 |
all: setup Daemon libdns_sd Clients SAClient SAResponder SAProxyResponder Identify NetMonitor dnsextd $(OPTIONALTARG) |
52 |
all: setup Daemon libdns_sd Clients SAClient SAResponder SAProxyResponder Identify NetMonitor dnsextd $(OPTIONALTARG) |
26 |
|
53 |
|
27 |
-install: setup InstalledDaemon InstalledStartup InstalledLib InstalledManPages InstalledClients $(OPTINSTALL) |
54 |
-install: setup InstalledDaemon InstalledStartup InstalledLib InstalledManPages InstalledClients $(OPTINSTALL) |
Lines 29-35
Link Here
|
29 |
|
56 |
|
30 |
# 'setup' sets up the build directory structure the way we want |
57 |
# 'setup' sets up the build directory structure the way we want |
31 |
setup: |
58 |
setup: |
32 |
@@ -257,13 +257,13 @@ libdns_sd: setup $(BUILDDIR)/libdns_sd.$ |
59 |
@@ -257,13 +266,13 @@ libdns_sd: setup $(BUILDDIR)/libdns_sd.$ |
33 |
CLIENTLIBOBJS = $(OBJDIR)/dnssd_clientlib.c.so.o $(OBJDIR)/dnssd_clientstub.c.so.o $(OBJDIR)/dnssd_ipc.c.so.o |
60 |
CLIENTLIBOBJS = $(OBJDIR)/dnssd_clientlib.c.so.o $(OBJDIR)/dnssd_clientstub.c.so.o $(OBJDIR)/dnssd_ipc.c.so.o |
34 |
|
61 |
|
35 |
$(BUILDDIR)/libdns_sd.$(LDSUFFIX): $(CLIENTLIBOBJS) |
62 |
$(BUILDDIR)/libdns_sd.$(LDSUFFIX): $(CLIENTLIBOBJS) |
Lines 46-57
Link Here
|
46 |
@$(MAKE) -C ../Clients |
73 |
@$(MAKE) -C ../Clients |
47 |
|
74 |
|
48 |
# nss_mdns target builds the Name Service Switch module |
75 |
# nss_mdns target builds the Name Service Switch module |
49 |
@@ -271,49 +271,49 @@ nss_mdns: setup $(BUILDDIR)/$(NSSLIBFILE |
76 |
@@ -271,49 +280,49 @@ nss_mdns: setup $(BUILDDIR)/$(NSSLIBFILE |
50 |
@echo "Name Service Switch module done" |
77 |
@echo "Name Service Switch module done" |
51 |
|
78 |
|
52 |
$(BUILDDIR)/$(NSSLIBFILE): $(CLIENTLIBOBJS) $(OBJDIR)/nss_mdns.c.so.o |
79 |
$(BUILDDIR)/$(NSSLIBFILE): $(CLIENTLIBOBJS) $(OBJDIR)/nss_mdns.c.so.o |
53 |
- @$(LD) $(LINKOPTS) -o $@ $+ |
80 |
- @$(LD) $(LINKOPTS) -o $@ $+ |
54 |
+ @$(CC) $(LINKOPTS) -shared -Wl,-soname=$(NSSLINKNAME) -o $@ $+ |
81 |
+ @$(CC) $(LINKOPTS) -shared -Wl,-soname=$(NSSLIBFILE) -o $@ $+ |
55 |
@$(STRIP) $@ |
82 |
@$(STRIP) $@ |
56 |
|
83 |
|
57 |
############################################################################# |
84 |
############################################################################# |
Lines 78-84
Link Here
|
78 |
@echo $+ " installed" |
105 |
@echo $+ " installed" |
79 |
|
106 |
|
80 |
-InstalledNSS: $(NSSINSTPATH)/$(NSSLINKNAME) /etc/nss_mdns.conf $(MANPATH)/man5/nss_mdns.conf.5 $(MANPATH)/man8/libnss_mdns.8 |
107 |
-InstalledNSS: $(NSSINSTPATH)/$(NSSLINKNAME) /etc/nss_mdns.conf $(MANPATH)/man5/nss_mdns.conf.5 $(MANPATH)/man8/libnss_mdns.8 |
81 |
+InstalledNSS: $(DESTDIR)$(NSSINSTPATH)/$(NSSLINKNAME) /etc/nss_mdns.conf $(DESTDIR)$(MANPATH)/man5/nss_mdns.conf.5 $(DESTDIR)$(MANPATH)/man8/libnss_mdns.8 |
108 |
+InstalledNSS: $(DESTDIR)$(NSSINSTPATH)/$(NSSLINKNAME) $(DESTDIR)$(INSTBASE)/etc/nss_mdns.conf.sample $(DESTDIR)$(MANPATH)/man5/nss_mdns.conf.5 $(DESTDIR)$(MANPATH)/man8/libnss_mdns.8 |
82 |
@echo $+ " installed" |
109 |
@echo $+ " installed" |
83 |
|
110 |
|
84 |
# Note: If daemon already installed, we make sure it's stopped before overwriting it |
111 |
# Note: If daemon already installed, we make sure it's stopped before overwriting it |
Lines 108-114
Link Here
|
108 |
$(CP) $< $@ |
135 |
$(CP) $< $@ |
109 |
chmod ugo+x $@ |
136 |
chmod ugo+x $@ |
110 |
$@ start |
137 |
$@ start |
111 |
@@ -330,26 +330,26 @@ else |
138 |
@@ -330,36 +339,35 @@ else |
112 |
endif |
139 |
endif |
113 |
endif |
140 |
endif |
114 |
|
141 |
|
Lines 132-140
Link Here
|
132 |
$(CP) $< $@ |
159 |
$(CP) $< $@ |
133 |
|
160 |
|
134 |
-$(NSSINSTPATH)/$(NSSLINKNAME): $(NSSINSTPATH)/$(NSSLIBFILE) |
161 |
-$(NSSINSTPATH)/$(NSSLINKNAME): $(NSSINSTPATH)/$(NSSLIBFILE) |
135 |
+$(DESTDIR)$(NSSINSTPATH)/$(NSSLINKNAME): $(NSSINSTPATH)/$(NSSLIBFILE) |
162 |
- $(LN) $< $@ |
136 |
$(LN) $< $@ |
163 |
- ldconfig |
137 |
ldconfig |
164 |
+$(DESTDIR)$(NSSINSTPATH)/$(NSSLINKNAME): $(DESTDIR)$(NSSINSTPATH)/$(NSSLIBFILE) |
|
|
165 |
+ $(LN) $(NSSLIBFILE) $(DESTDIR)$(NSSINSTPATH)/$(NSSLINKNAME) |
138 |
|
166 |
|
139 |
-$(NSSINSTPATH)/$(NSSLIBFILE): $(BUILDDIR)/$(NSSLIBFILE) |
167 |
-$(NSSINSTPATH)/$(NSSLIBFILE): $(BUILDDIR)/$(NSSLIBFILE) |
140 |
+$(DESTDIR)$(NSSINSTPATH)/$(NSSLIBFILE): $(BUILDDIR)/$(NSSLIBFILE) |
168 |
+$(DESTDIR)$(NSSINSTPATH)/$(NSSLIBFILE): $(BUILDDIR)/$(NSSLIBFILE) |
Lines 141-147
Link Here
|
141 |
$(CP) $< $@ |
169 |
$(CP) $< $@ |
142 |
chmod 444 $@ |
170 |
chmod 444 $@ |
143 |
|
171 |
|
144 |
@@ -491,6 +491,8 @@ $(OBJDIR)/NetMonitor.c.o: $(C |
172 |
-/etc/nss_mdns.conf: nss_mdns.conf |
|
|
173 |
+$(DESTDIR)$(INSTBASE)/etc/nss_mdns.conf.sample: nss_mdns.conf |
174 |
$(CP) $< $@ |
175 |
chmod 444 $@ |
176 |
# Check the nsswitch.conf file. |
177 |
# If 'mdns' does not already appear on the "hosts:" line, then add it right before 'dns' |
178 |
- cp -f /etc/nsswitch.conf /etc/nsswitch.conf.pre-mdns |
179 |
- sed -e '/mdns/!s/^\(hosts:.*\)dns\(.*\)/\1mdns dns\2/' /etc/nsswitch.conf.pre-mdns > /etc/nsswitch.conf |
180 |
+ #cp -f /etc/nsswitch.conf /etc/nsswitch.conf.pre-mdns |
181 |
+ #sed -e '/mdns/!s/^\(hosts:.*\)dns\(.*\)/\1mdns dns\2/' /etc/nsswitch.conf.pre-mdns > /etc/nsswitch.conf |
182 |
|
183 |
############################################################################# |
184 |
|
185 |
@@ -491,6 +499,8 @@ $(OBJDIR)/NetMonitor.c.o: $(C |
145 |
$(BUILDDIR)/dnsextd: $(DNSEXTDOBJ) $(OBJDIR)/dnsextd.c.threadsafe.o |
186 |
$(BUILDDIR)/dnsextd: $(DNSEXTDOBJ) $(OBJDIR)/dnsextd.c.threadsafe.o |
146 |
$(CC) $+ -o $@ $(LINKOPTS) $(LINKOPTS_PTHREAD) |
187 |
$(CC) $+ -o $@ $(LINKOPTS) $(LINKOPTS_PTHREAD) |
147 |
|
188 |
|