Print this page
8411 Build should warn when linking against libraries outside proto area
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/cmd/svc/svccfg/Makefile
+++ new/usr/src/cmd/svc/svccfg/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.
12 12 #
13 13 # When distributing Covered Code, include this CDDL HEADER in each
↓ open down ↓ |
13 lines elided |
↑ open up ↑ |
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 22 #
23 23 # Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
24 +# Copyright 2017 RackTop Systems.
24 25 #
25 26
26 27 MYPROG = svccfg
27 28 PROG = $(MYPROG)
28 29
29 30 SRCS = svccfg_main.c \
30 31 svccfg_engine.c \
31 32 svccfg_internal.c \
32 33 svccfg_libscf.c \
33 34 svccfg_tmpl.c \
34 35 svccfg_xml.c \
35 36 svccfg_help.c
36 37
37 38 LNTS = $(SRCS:%.c=%.ln) \
38 39 manifest_find.ln \
39 40 manifest_hash.ln
40 41
41 42 MYOBJS = $(SRCS:%.c=%.o) \
42 43 svccfg_grammar.o \
43 44 svccfg_lex.o \
44 45 manifest_find.o \
45 46 manifest_hash.o \
46 47 notify_params.o
47 48 OBJS = $(MYOBJS)
48 49
49 50 POFILES = $(SRCS:%.c=%.po) \
50 51 svccfg_grammar.po \
51 52 svccfg_lex.po \
52 53 ../common/manifest_find.po \
53 54 ../common/manifest_hash.po
54 55
55 56 include ../../Makefile.cmd
56 57 include ../../Makefile.ctf
57 58
58 59 POFILE = $(PROG)_all.po
59 60
60 61 NATIVE_BUILD=$(POUND_SIGN)
61 62 $(NATIVE_BUILD)NOT_NATIVE=$(POUND_SIGN)
62 63
63 64 $(NATIVE_BUILD)PROG = $(MYPROG:%=%-native)
64 65 $(NATIVE_BUILD)OBJS = $(MYOBJS:%.o=%-native.o)
65 66
66 67 # svccfg has a name clash with main() and libl.so.1. However, svccfg must
67 68 # still export a number of "yy*" (libl) interfaces. Reduce all other symbols
68 69 # to local scope.
69 70 MAPFILES += $(MAPFILE.LEX) $(MAPFILE.NGB)
70 71 MAPOPTS = $(MAPFILES:%=-M%)
71 72
72 73 MYCPPFLAGS = -I ../common -I$(ADJUNCT_PROTO)/usr/include/libxml2
73 74 CPPFLAGS += $(MYCPPFLAGS)
74 75 LDFLAGS += $(MAPOPTS)
75 76
76 77 CERRWARN += -_gcc=-Wno-unused-label
77 78 CERRWARN += -_gcc=-Wno-implicit-function-declaration
78 79 CERRWARN += -_gcc=-Wno-switch
79 80 CERRWARN += -_gcc=-Wno-uninitialized
80 81 CERRWARN += -_gcc=-Wno-unused-variable
81 82 CERRWARN += -_gcc=-Wno-parentheses
↓ open down ↓ |
48 lines elided |
↑ open up ↑ |
82 83
83 84 LFLAGS = -t
84 85 YFLAGS = -d
85 86
86 87 CLOBBERFILES += svccfg_lex.c svccfg_grammar.c svccfg_grammar.h \
87 88 $(MYPROG:%=%-native)
88 89
89 90 SVCCFG_EXTRA_LIBS = -lxml2 -lscf -ll -luutil -lumem -lmd5 -lnvpair
90 91 $(NOT_NATIVE)SVCCFG_EXTRA_LIBS += -ltecla
91 92
93 +# Allow libxml2 to be taken from outside the proto area.
94 +$(ADJUNCT_PROTO_NOT_SET)LDFLAGS += $(ZASSERTDEFLIB)=libxml2.so
95 +
92 96 LIBSCF = $(SRC)/lib/libscf
93 97 LIBTECLA = $(SRC)/lib/libtecla # just for the header
94 98 LIBUUTIL = $(SRC)/lib/libuutil
95 99
96 100 debug := COPTFLAG = -g
97 101
98 102 lint := LINTFLAGS = -mux
99 103 lint := SVCCFG_EXTRA_LIBS = -lscf -ll -luutil -lumem -lmd5 -lnvpair
100 104
101 105 LDLIBS += $(SVCCFG_EXTRA_LIBS)
102 106
103 107 $(NATIVE_BUILD)CC = $(NATIVECC)
104 108 $(NATIVE_BUILD)LD = $(NATIVELD)
105 109 $(NATIVE_BUILD)CFLAGS = $(NATIVE_CFLAGS)
106 110 $(NATIVE_BUILD)CPPFLAGS = \
107 111 -DNATIVE_BUILD \
108 112 $(MYCPPFLAGS) \
109 113 -I$(LIBSCF)/inc \
110 114 -I$(LIBTECLA) \
111 115 -I$(LIBUUTIL)/common
112 116 $(NATIVE_BUILD)LDFLAGS =
113 117 $(NATIVE_BUILD)LDLIBS = \
114 118 -L$(LIBUUTIL)/native -R $(LIBUUTIL)/native \
115 119 -L$(LIBSCF)/native -R $(LIBSCF)/native \
116 120 -L$(ADJUNCT_PROTO)/usr/lib -R$(ADJUNCT_PROTO)/usr/lib \
117 121 $(SVCCFG_EXTRA_LIBS)
118 122
119 123 svccfg_lex.o svccfg_grammar.o := CCVERBOSE =
120 124
121 125 svccfg_help.po := XGETFLAGS = -a
122 126
123 127 .KEEP_STATE:
124 128 .PARALLEL: $(OBJS) $(LNTS)
125 129
126 130 all debug: $(PROG)
127 131
128 132 native: FRC
129 133 @cd $(LIBUUTIL)/native; pwd; $(MAKE) $(MFLAGS) install
130 134 @cd $(LIBSCF)/native; pwd; $(MAKE) $(MFLAGS) install
131 135 @NATIVE_BUILD= $(MAKE) $(MFLAGS) all
132 136
133 137 $(PROG): $(OBJS) $(MAPFILES)
134 138 $(LINK.c) -o $@ $(OBJS) $(LDLIBS)
135 139 $(POST_PROCESS)
136 140
137 141 $(POFILE): $(POFILES)
138 142 cat $(POFILES) > $(POFILE)
139 143
140 144 install: all $(ROOTUSRSBINPROG)
141 145
142 146 svccfg_lex.c: svccfg.l svccfg_grammar.h
143 147 $(LEX) $(LFLAGS) svccfg.l > $@
144 148
145 149 svccfg_help.o: svccfg_grammar.h
146 150 svccfg_help-native.o: svccfg_grammar.h
147 151
148 152 svccfg_grammar.h svccfg_grammar.c: svccfg.y
149 153 $(YACC) $(YFLAGS) svccfg.y
150 154 @$(MV) y.tab.h svccfg_grammar.h
151 155 @$(MV) y.tab.c svccfg_grammar.c
152 156
153 157 clean: FRC
154 158 $(RM) $(MYOBJS) $(MYOBJS:%.o=%-native.o) $(LNTS)
155 159
156 160 lint: $(LNTS)
157 161 $(LINT.c) $(LINTFLAGS) $(LNTS) $(LDLIBS)
158 162
159 163 %-native.o: %.c
160 164 $(COMPILE.c) -o $@ $<
161 165 $(POST_PROCESS_O)
162 166
163 167 %-native.o: ../common/%.c
164 168 $(COMPILE.c) -o $@ $<
165 169 $(POST_PROCESS_O)
166 170
167 171 %.o: ../common/%.c
168 172 $(COMPILE.c) $(OUTPUT_OPTION) $<
169 173 $(POST_PROCESS_O)
170 174
171 175 %.ln: ../common/%.c
172 176 $(LINT.c) $(OUTPUT_OPTION) -c $<
173 177
174 178 include ../../Makefile.targ
175 179
176 180 FRC:
↓ open down ↓ |
75 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX