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