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