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