xref: /illumos-gate/usr/src/lib/libwrap/Makefile.com (revision 7c478bd95313f5f23a4c958a745db2134aa03244)
1#
2# Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
3# Use is subject to license terms.
4#
5# ident	"%Z%%M%	%I%	%E% SMI"
6#
7
8LIBRARY =	libwrap.a
9MAJOR =		.1
10MINOR =		.0
11VERS =		$(MAJOR)$(MINOR)
12OBJECTS =	hosts_access.o options.o shell_cmd.o rfc931.o eval.o \
13		hosts_ctl.o refuse.o percent_x.o clean_exit.o \
14		fromhost.o fix_options.o socket.o tli.o workarounds.o \
15		update.o misc.o diag.o percent_m.o
16
17include ../../Makefile.lib
18
19LIBS =		$(DYNLIB) $(LINTLIB)
20ROOTLIBDIR =	$(ROOTSFWLIB)
21SONAME =	$(LIBRARY:.a=.so)$(MAJOR)
22ROOTLINKS +=	$(ROOTLIBDIR)/$(LIBLINKS)$(MAJOR)
23SRCDIR =	..
24$(LINTLIB) :=	SRCS = $(SRCDIR)/$(LINTSRC)
25DYNFLAGS +=	-M $(SRCDIR)/mapfile
26LDLIBS +=	-lsocket -lnsl -lc
27
28CPPFLAGS +=	$(NETGROUP) $(TLI) $(ALWAYS_HOSTNAME) $(AUTH) \
29		$(STYLE) $(TABLES) $(DOT) $(BUGS) \
30		-DRFC931_TIMEOUT=$(RFC931_TIMEOUT) \
31		-I$(SRCDIR)
32CFLAGS +=	$(CCVERBOSE) -erroff=E_FUNC_EXPECTS_TO_RETURN_VALUE \
33		-erroff=E_IMPLICIT_DECL_FUNC_RETURN_INT \
34		-erroff=E_OLD_STYLE_DECL_HIDES_PROTO
35
36DISTFILES =	clean_exit.c diag.c eval.c fix_options.c fromhost.c \
37		hosts_access.c hosts_ctl.c misc.c mystdarg.h options.c \
38		patchlevel.h percent_m.c percent_x.c refuse.c rfc931.c \
39		setenv.c shell_cmd.c socket.c tcpd.h tli.c update.c \
40		workarounds.c
41
42ROOTSFWSRC =	$(ROOTSFWSHSRC)/tcp_wrappers
43ROOTSFWSRCFILES = $(DISTFILES:%=$(ROOTSFWSRC)/%)
44
45.KEEP_STATE:
46
47all: $(LIBS)
48
49lint: lintcheck
50
51$(ROOTLIBS): $(ROOTLIBDIR)
52
53$(ROOTLIBDIR): $(ROOTSFW)
54	$(INS.dir)
55
56$(ROOTLIBDIR)/$(LIBLINKS)$(MAJOR): $(ROOTLIBDIR)/$(LIBLINKS)$(VERS)
57	$(INS.liblink)
58
59$(ROOTSFWSRCFILES) := FILEMODE = 0444
60$(ROOTSFWSRCFILES): $(ROOTSFWSRC)
61
62$(ROOTSFWSRC): $(ROOTSFWSHSRC)
63	$(INS.dir)
64
65$(ROOTSFWSHSRC): $(ROOTSFW)/share
66	$(INS.dir)
67
68$(ROOTSFWSRC)/%: $(SRCDIR)/%
69	$(INS.file)
70
71$(ROOTSFW)/share: $(ROOTSFW)
72	$(INS.dir)
73
74$(ROOTSFW):
75	$(INS.dir)
76
77include ../../Makefile.targ
78
79
80# The rest of this file contains definitions more-or-less directly from the
81# original Makefile of the tcp_wrappers distribution.
82
83##############################
84# System parameters appropriate for Solaris 9
85
86TLI		= -DTLI
87BUGS		= -DGETPEERNAME_BUG -DBROKEN_FGETS -DLIBC_CALLS_STRTOK
88NETGROUP	= -DNETGROUP
89
90##############################
91# Start of the optional stuff.
92
93###########################################
94# Optional: Turning on language extensions
95#
96# Instead of the default access control language that is documented in
97# the hosts_access.5 document, the wrappers can be configured to
98# implement an extensible language documented in the hosts_options.5
99# document.  This language is implemented by the "options.c" source
100# module, which also gives hints on how to add your own extensions.
101# Uncomment the next definition to turn on the language extensions
102# (examples: allow, deny, banners, twist and spawn).
103#
104STYLE	= -DPROCESS_OPTIONS	# Enable language extensions.
105
106###########################
107# Optional: Reduce DNS load
108#
109# When looking up the address for a host.domain name, the typical DNS
110# code will first append substrings of your own domain, so it tries
111# host.domain.your.own.domain, then host.domain.own.domain, and then
112# host.domain. The APPEND_DOT feature stops this waste of cycles. It is
113# off by default because it causes problems on sites that don't use DNS
114# and with Solaris < 2.4. APPEND_DOT will not work with hostnames taken
115# from /etc/hosts or from NIS maps. It does work with DNS through NIS.
116#
117# DOT= -DAPPEND_DOT
118
119##################################################
120# Optional: Always attempt remote username lookups
121#
122# By default, the wrappers look up the remote username only when the
123# access control rules require them to do so.
124#
125# Username lookups require that the remote host runs a daemon that
126# supports an RFC 931 like protocol.  Remote user name lookups are not
127# possible for UDP-based connections, and can cause noticeable delays
128# with connections from non-UNIX PCs.  On some systems, remote username
129# lookups can trigger a kernel bug, causing loss of service. The README
130# file describes how to find out if your UNIX kernel has that problem.
131#
132# Uncomment the following definition if the wrappers should always
133# attempt to get the remote user name. If this is not enabled you can
134# still do selective username lookups as documented in the hosts_access.5
135# and hosts_options.5 manual pages (`nroff -man' format).
136#
137#AUTH	= -DALWAYS_RFC931
138#
139# The default username lookup timeout is 10 seconds. This may not be long
140# enough for slow hosts or networks, but is enough to irritate PC users.
141
142RFC931_TIMEOUT = 10
143
144########################################################
145# Optional: Changing the access control table pathnames
146#
147# The HOSTS_ALLOW and HOSTS_DENY macros define where the programs will
148# look for access control information. Watch out for the quotes and
149# backslashes when you make changes.
150
151TABLES	= -DHOSTS_DENY=\"/etc/hosts.deny\" -DHOSTS_ALLOW=\"/etc/hosts.allow\"
152
153########################################
154# Optional: turning off hostname lookups
155#
156# By default, the software always attempts to look up the client
157# hostname.  With selective hostname lookups, the client hostname
158# lookup is postponed until the name is required by an access control
159# rule or by a %letter expansion.
160#
161# In order to perform selective hostname lookups, disable paranoid
162# mode (see previous section) and comment out the following definition.
163
164ALWAYS_HOSTNAME= -DALWAYS_HOSTNAME
165
166## End configuration options
167############################
168