Print this page
5910 libnisdb won't build with modern GCC
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/lib/libnisdb/Makefile
+++ new/usr/src/lib/libnisdb/Makefile
1 1 #
2 2 # CDDL HEADER START
3 3 #
4 4 # The contents of this file are subject to the terms of the
5 5 # Common Development and Distribution License (the "License").
6 6 # You may not use this file except in compliance with the License.
7 7 #
8 8 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 9 # or http://www.opensolaris.org/os/licensing.
10 10 # See the License for the specific language governing permissions
11 11 # and limitations under the License.
↓ open down ↓ |
11 lines elided |
↑ open up ↑ |
12 12 #
13 13 # When distributing Covered Code, include this CDDL HEADER in each
14 14 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 15 # If applicable, add the following below this CDDL HEADER, with the
16 16 # fields enclosed by brackets "[]" replaced with your own identifying
17 17 # information: Portions Copyright [yyyy] [name of copyright owner]
18 18 #
19 19 # CDDL HEADER END
20 20 #
21 21 #
22 +# Copyright 2015 Gary Mills
22 23 # Copyright 2009 Sun Microsystems, Inc. All rights reserved.
23 24 # Use is subject to license terms.
24 25 #
25 26 #
26 27
27 28 LIBRARY= libnisdb.a
28 29 VERS= .2
29 30 PROTOCOL_DIR= $(ROOT)/include/rpcsvc
30 31 YPTOL_DIR= ./yptol
31 32
32 33 SED= sed
33 34
34 35 OBJECTS = \
35 36 db_entry.o db_entry_c_xdr.o \
36 37 db_item.o db_item_c_xdr.o \
37 38 db_vers.o db_vers_c_xdr.o \
38 39 db_pickle.o \
39 40 db_table.o db_table_c_xdr.o \
40 41 db_index_entry.o db_index_entry_c.o \
41 42 db_index.o db_index_c_xdr.o \
42 43 db_scheme.o db_scheme_c_xdr.o \
43 44 db_query.o db_query_c_xdr.o \
44 45 db_mindex.o db_mindex2.o db_mindex3.o db_mindex_c_xdr.o \
45 46 db_log_entry.o db_log_entry_c_xdr.o \
46 47 db_log.o \
47 48 db.o \
48 49 xdr_nullptr.o \
49 50 db_dictionary.o db_dictionary_c_xdr.o \
50 51 db_dictxdr.o db_dictlog.o db_dictlog_c_xdr.o \
51 52 nis_db.o \
52 53 nisdb_mt.o nisdb_rw.o \
53 54 nis_hashitem.o \
54 55 ldap_attr.o ldap_cto.o ldap_glob.o ldap_ldap.o \
55 56 ldap_map.o ldap_nisdbquery.o \
56 57 ldap_op.o ldap_parse.o ldap_print.o ldap_ruleval.o \
57 58 ldap_util.o ldap_val.o ldap_xdr.o ldap_scheme.o \
58 59 nis_ldap.o \
59 60 nis_parse_ldap_attr.o nis_parse_ldap_conf.o \
60 61 nis_parse_ldap_map.o nis_parse_ldap_util.o \
61 62 nis_parse_ldap_yp_util.o \
62 63 dit_access.o \
63 64 dit_access_utils.o \
64 65 lock_update.o \
65 66 map_conv.o \
66 67 map_ctrl.o \
67 68 yptol_utils.o \
68 69 shim.o \
69 70 shim_ancil.o \
70 71 shim_lockmap.o \
71 72 ttl_utils.o \
72 73 update.o \
73 74 shim_changepasswd.o \
74 75 stubs.o
75 76
76 77 X_FILES= \
77 78 db_c.x db_dictionary_c.x db_entry_c.x db_index_c.x \
78 79 db_index_entry_c.x db_item_c.x db_log_c.x db_log_entry_c.x \
79 80 db_mindex_c.x db_query_c.x db_scheme_c.x db_table_c.x \
80 81 db_vers_c.x db_dictlog_c.x
81 82
82 83 DERIVED_HEADERS= $(X_FILES:%_c.x=%_c.h) $(X_FILES:%_c.x=%.h)
83 84 DERIVED_SOURCES= $(X_FILES:%_c.x=%_c_xdr.c)
84 85 DERIVED_FILES= $(DERIVED_HEADERS) $(DERIVED_SOURCES)
85 86
86 87 # delete the derived files when cleaning up
87 88 CLEANFILES += $(DERIVED_FILES)
88 89
89 90 # include library definitions
90 91 include ../Makefile.lib
91 92
92 93 MAPFILES = mapfile-vers
93 94
94 95 SRCS= db_dictionary_c_xdr.c db_dictlog_c_xdr.c db_dictxdr.c \
95 96 db_entry_c_xdr.c db_index_c_xdr.c db_index_entry_c_xdr.c db_item_c_xdr.c \
96 97 db_log_c_xdr.c db_log_entry_c_xdr.c db_mindex_c_xdr.c db_query_c_xdr.c \
97 98 db_scheme_c_xdr.c db_table_c_xdr.c db_vers_c_xdr.c \
98 99 $(YPTOL_DIR)/dit_access.c \
99 100 $(YPTOL_DIR)/dit_access_utils.c \
100 101 $(YPTOL_DIR)/lock_update.c \
101 102 $(YPTOL_DIR)/map_conv.c \
102 103 $(YPTOL_DIR)/map_ctrl.c \
103 104 $(YPTOL_DIR)/yptol_utils.c \
104 105 $(YPTOL_DIR)/shim.c \
105 106 $(YPTOL_DIR)/shim_ancil.c \
106 107 $(YPTOL_DIR)/shim_lockmap.c \
107 108 $(YPTOL_DIR)/ttl_utils.c \
108 109 $(YPTOL_DIR)/update.c \
109 110 $(YPTOL_DIR)/shim_changepasswd.c \
110 111 $(YPTOL_DIR)/stubs.c \
111 112 #db_c_xdr.c xdr_nullptr.c
112 113
113 114 # Libnisdb has grown large enough that there may be too many symbols
114 115 # wanting `small' PIC references. Hence, compile some files with
115 116 # `large' PIC references; the parser files are good candidates, since
116 117 # they're only used at startup, and performance isn't too important.
117 118 LARGESYMS= nis_parse_ldap_conf.o \
118 119 nis_parse_ldap_attr.o \
119 120 nis_parse_ldap_yp_util.o \
120 121 nis_parse_ldap_map.o \
121 122 ldap_parse.o \
122 123 dit_access.o \
123 124 dit_access_utilis.o \
124 125 map_conv.o \
125 126 map_ctrl.o \
126 127 shim.o \
↓ open down ↓ |
95 lines elided |
↑ open up ↑ |
127 128 shim_ancil.o \
128 129 shim_changepasswd.o \
129 130 update.o \
130 131 stubs.o \
131 132 yptol_utils.o \
132 133 nis_parse_ldap_util.o
133 134 LARGEPICS= $(LARGESYMS:%=pics/%)
134 135 $(LARGEPICS) := sparc_C_PICFLAGS = $(C_BIGPICFLAGS)
135 136 $(LARGEPICS) := i386_C_PICFLAGS = $(C_BIGPICFLAGS)
136 137
138 +# More and stricter semantic checks and lint-like checks
139 +CFLAGS += $(CCVERBOSE)
140 +
137 141 CPPFLAGS += -D_REENTRANT
138 142
139 -CERRWARN += -_gcc=-Wno-unused-variable
140 -CERRWARN += -_gcc=-Wno-unused-value
143 +# Have an unused variable that can't be removed
144 +UVAR_PICS = \
145 +pics/db_dictionary_c_xdr.o \
146 +pics/db_dictlog_c_xdr.o \
147 +pics/db_entry_c_xdr.o \
148 +pics/db_index_c_xdr.o \
149 +pics/db_item_c_xdr.o \
150 +pics/db_log_entry_c_xdr.o \
151 +pics/db_mindex_c_xdr.o \
152 +pics/db_query_c_xdr.o \
153 +pics/db_scheme_c_xdr.o \
154 +pics/db_table_c_xdr.o \
155 +pics/db_vers_c_xdr.o \
156 +pics/ldap_xdr.o \
157 +pics/dit_access.o \
158 +pics/update.o \
159 +pics/yptol_utils.o \
160 +pics/map_ctrl.o
161 +
162 +$(UVAR_PICS) := CERRWARN += -_gcc=-Wno-unused-variable
163 +
164 +# Correcting these might alter logic
141 165 CERRWARN += -_gcc=-Wno-uninitialized
142 -CERRWARN += -_gcc=-Wno-implicit-function-declaration
143 166 CERRWARN += -_gcc=-Wno-switch
144 -CERRWARN += -_gcc=-Wno-parentheses
145 167
146 168 # Extra includes, from yp, for yptol files.
147 169 CPPFLAGS += -I$(SRC)/cmd/ypcmd
148 170
171 +# Need the path to nis_clnt.h
172 +CLNT_PICS = pics/db_entry_c_xdr.o pics/ldap_xdr.o pics/db_mindex_c_xdr.o
173 +
174 +$(CLNT_PICS) := CPPFLAGS += -I../libnsl/nis/gen
175 +
149 176 LIBS = $(DYNLIB)
150 177 ZDEFS=
151 178 LDLIBS += -lnsl -lldap -lc
152 179
153 180 # A number of interfaces are interposed by numerous applications, therefore
154 181 # prevent direct binding to anything in libnisdb. Disable libnisdb from
155 182 # directly binding to itself, but allow libnisdb to directly bind to its
156 183 # dependencies (ie. map -Bdirect -> -zdirect). Ensure lazy loading is
157 184 # established (which is enabled automatically with -Bdirect). In addition,
158 185 # libnisdb interposes on socket(), so tag this library as an interposer.
159 186 # dependencies (lazyload).
160 187 BDIRECT =
161 188 DYNFLAGS += $(BNODIRECT) $(ZINTERPOSE) $(ZDIRECT) $(ZLAZYLOAD)
162 189
163 190 all := TARGET= all
164 191 clean := TARGET= clean
165 192 clobber := TARGET= clobber
166 193 install := TARGET= install
167 194 lint := TARGET= lint
168 195
169 196 .KEEP_STATE:
170 197
171 198 all: $(DERIVED_FILES) $(LIBS)
172 199
173 200 install: all $(ROOTLIBS) $(ROOTLINKS)
174 201
175 202 lint: $(DERIVED_FILES) .WAIT lintcheck
176 203
177 204 pics/%.o: %.c
178 205 $(COMPILE.c) -o $@ $<
179 206 $(POST_PROCESS_O)
180 207
181 208 pics/%.o: %.cc
182 209 $(COMPILE.cc) -o $@ $<
183 210 $(POST_PROCESS_O)
184 211
185 212 objs/%.o pics/%.o profs/%.o: $(YPTOL_DIR)/%.c
186 213 $(COMPILE.c) -o $@ $<
187 214 $(POST_PROCESS_O)
188 215
189 216 #
190 217 # Pattern matching rules that define how to build the derived files.
191 218 #
192 219 %_c.h: %_c.x
193 220 $(RM) $@
194 221 $(RPCGEN) -DUSINGC -h -o $@ $<
195 222
196 223 %.h: %_c.x
197 224 $(RM) $@
198 225 $(RPCGEN) -h -o $@ $<
199 226
200 227 %_c_xdr.c: %_c.x
201 228 $(RM) $@
202 229 $(RPCGEN) -DUSINGC -c -o $@ $<
203 230
204 231 # rename the xdr_db_free_entry() in the db_table_c_xdr.c. So the one
205 232 # in db_index_entry_c is used instead.
206 233 DB_TABLE=db_table_c
207 234
208 235 $(DB_TABLE)_xdr.c: $(DB_TABLE).x
209 236 $(RM) $@
210 237 $(RPCGEN) -DUSINGC -c $(DB_TABLE).x |\
211 238 $(SED) -e 's/^xdr_db_free_entry(/__OBSOLETED_xdr_db_free_entry(/' > $@
212 239
213 240 # include library targets
214 241 include ../Makefile.targ
↓ open down ↓ |
56 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX