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