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