New Makefile variable RPATH_FLAG, possibly used even when we're not
[krb5.git] / src / config / pre.in
1 ## config/pre.in
2 ## common prefix for all Makefile.in in the Kerberos V5 tree.
3
4 WHAT = unix
5 SHELL=/bin/sh
6
7 all:: all-$(WHAT)
8
9 clean:: clean-$(WHAT)
10
11 install:: install-$(WHAT)
12
13 check:: check-$(WHAT)
14
15 install-headers:: install-headers-$(WHAT)
16
17 all-recurse: all-prerecurse
18 all-postrecurse:: all-recurse
19 all-unix:: all-postrecurse
20
21 all-prerecurse::
22 all-postrecurse::
23
24 clean-unix:: clean-prerecurse
25 clean-unix:: clean-recurse
26 clean-unix:: clean-postrecurse
27
28 clean-prerecurse::
29 clean-postrecurse::
30
31 distclean-unix:: distclean-prerecurse
32 distclean-unix:: distclean-recurse
33 distclean-unix:: distclean-postrecurse
34
35 install-unix:: install-prerecurse
36 install-unix:: install-recurse
37 install-unix:: install-postrecurse
38
39 install-prerecurse::
40 install-postrecurse::
41
42 install-headers-unix:: install-headers-prerecurse
43 install-headers-unix:: install-headers-recurse
44 install-headers-unix:: install-headers-postrecurse
45
46 install-headers-prerecurse::
47
48 install-headers-postrecurse::
49
50
51 check-unix:: check-prerecurse
52 check-unix:: check-recurse
53 check-unix:: check-postrecurse
54
55 check-prerecurse::
56 check-postrecurse::
57
58 Makefiles:: Makefiles-prerecurse
59 Makefiles:: Makefiles-recurse
60 Makefiles:: Makefiles-postrecurse
61
62 Makefiles-prerecurse::
63 Makefiles-postrecurse::
64
65 # Directory syntax:
66 #
67 # begin relative path
68 REL=
69 # this is magic... should only be used for preceding a program invocation
70 C=./
71 # "/" for UNIX, "\" for Windows; *sigh*
72 S=/
73
74 SUBDIRS = @subdirs@ $(LOCAL_SUBDIRS)
75 srcdir = @srcdir@
76 SRCTOP = @srcdir@/$(BUILDTOP)
77 VPATH = @srcdir@
78 CONFIG_RELTOPDIR = @CONFIG_RELTOPDIR@
79
80 ALL_CFLAGS = $(DEFS) $(DEFINES) $(LOCALINCLUDES) $(CPPFLAGS) $(CFLAGS)
81 CFLAGS = @CFLAGS@
82 CPPFLAGS = @CPPFLAGS@
83 DEFS = @DEFS@
84 CC = @CC@
85 LD = $(PURE) @LD@
86 DEPLIBS = @DEPLIBS@
87 LDFLAGS = @LDFLAGS@
88 LD_UNRESOLVED_PREFIX = @LD_UNRESOLVED_PREFIX@
89 LD_SHLIBDIR_PREFIX = @LD_SHLIBDIR_PREFIX@
90 LDARGS = @LDARGS@
91 LIBS = @LIBS@
92 SRVLIBS = @SRVLIBS@
93 SRVDEPLIBS = @SRVDEPLIBS@
94 CLNTLIBS = @CLNTLIBS@
95 CLNTDEPLIBS = @CLNTDEPLIBS@
96
97 INSTALL=@INSTALL@
98 INSTALL_STRIP=
99 INSTALL_PROGRAM=@INSTALL_PROGRAM@ $(INSTALL_STRIP)
100 INSTALL_DATA=@INSTALL_DATA@
101 INSTALL_SHLIB=@INSTALL_SHLIB@
102 INSTALL_SETUID=$(INSTALL) $(INSTALL_STRIP) -m 4755 -o root
103 ## This is needed because autoconf will sometimes define @exec_prefix@ to be
104 ## ${prefix}.
105 prefix=@prefix@
106 INSTALL_PREFIX=$(prefix)
107 INSTALL_EXEC_PREFIX=@exec_prefix@
108 exec_prefix=@exec_prefix@
109 SHLIB_TAIL_COMP=@SHLIB_TAIL_COMP@
110
111 KRB5MANROOT = @mandir@
112 ADMIN_BINDIR = @sbindir@
113 SERVER_BINDIR = @sbindir@
114 CLIENT_BINDIR =@bindir@
115 ADMIN_MANDIR = $(KRB5MANROOT)/man8
116 SERVER_MANDIR = $(KRB5MANROOT)/man8
117 CLIENT_MANDIR = $(KRB5MANROOT)/man1
118 FILE_MANDIR = $(KRB5MANROOT)/man5
119 KRB5_LIBDIR = @libdir@
120 KRB5_SHLIBDIR = @libdir@$(SHLIB_TAIL_COMP)
121 KRB5_INCDIR = @includedir@
122 KRB5_INCSUBDIRS = \
123         $(KRB5_INCDIR)/gssapi \
124         $(KRB5_INCDIR)/kerberosIV
125
126 #
127 # Macros used by the KADM5 (OV-based) unit test system.
128 # XXX check which of these are actually used!
129 #
130 TESTDIR         = $(BUILDTOP)/kadmin/testing
131 STESTDIR        = $(SRCTOP)/kadmin/testing
132 COMPARE_DUMP    = $(TESTDIR)/scripts/compare_dump.pl
133 FIX_CONF_FILES  = $(TESTDIR)/scripts/fixup-conf-files.pl
134 INITDB          = $(STESTDIR)/scripts/init_db
135 MAKE_KEYTAB     = $(TESTDIR)/scripts/make-host-keytab.pl
136 LOCAL_MAKE_KEYTAB= $(TESTDIR)/scripts/make-host-keytab.pl
137 RESTORE_FILES   = $(STESTDIR)/scripts/restore_files.sh
138 SAVE_FILES      = $(STESTDIR)/scripts/save_files.sh
139 ENV_SETUP       = $(TESTDIR)/scripts/env-setup.sh
140 CLNTTCL         = $(TESTDIR)/util/ovsec_kadm_clnt_tcl
141 SRVTCL          = $(TESTDIR)/util/ovsec_kadm_srv_tcl
142 # Dejagnu variables.
143 # We have to set the host with --host so that setup_xfail will work.
144 # If we don't set it, then the host type used is "native", which
145 # doesn't match "*-*-*".
146 host=@krb5_cv_host@
147 DEJAFLAGS       = $(DEJALFLAGS) $(CLFLAGS) --debug --srcdir $(srcdir) --host \
148                    $(host)
149 RUNTEST         = runtest $(DEJAFLAGS)
150
151 START_SERVERS   = $(STESTDIR)/scripts/start_servers $(TEST_SERVER) $(TEST_PATH)
152 START_SERVERS_LOCAL = $(STESTDIR)/scripts/start_servers_local
153
154 STOP_SERVERS    = $(STESTDIR)/scripts/stop_servers $(TEST_SERVER) $(TEST_PATH)
155 STOP_SERVERS_LOCAL = $(STESTDIR)/scripts/stop_servers_local
156 #
157 # End of macros for the KADM5 unit test system.
158 #
159
160 transform = @program_transform_name@
161
162 RM = rm -f
163 CP  = cp
164 MV = mv -f
165 CHMOD=chmod
166 RANLIB = @RANLIB@
167 ARCHIVE = @ARCHIVE@
168 ARADD = @ARADD@
169 LN = @LN_S@
170 AWK = @AWK@
171 LEX = @LEX@
172 LEXLIB = @LEXLIB@
173 YACC = @YACC@
174 AUTOCONF = @AUTOCONF@
175 AUTOCONFFLAGS = @AUTOCONFFLAGS@
176 AUTOHEADER = @AUTOHEADER@
177 AUTOHEADERFLAGS = @AUTOHEADERFLAGS@
178
179 HOST_TYPE = @HOST_TYPE@
180 SHEXT = @SHEXT@
181 STEXT=@STEXT@
182 VEXT=@VEXT@
183 DO_MAKE_SHLIB = @DO_MAKE_SHLIB@
184 SHLIB_STATIC_TARGET=@SHLIB_STATIC_TARGET@
185
186 TOPLIBD = $(BUILDTOP)/lib
187
188 OBJEXT = o
189 LIBEXT = a
190 EXEEXT =
191
192 #
193 # variables for libraries, for use in linking programs
194 # -- this may want to get broken out into a separate frag later
195 #
196 #
197 # Note: the following variables must be set in any Makefile.in that
198 # uses KRB5_BUILD_PROGRAM
199 #
200 # PROG_LIBPATH  list of dirs, in -Ldir form, to search for libraries at link
201 # PROG_RPATH    list of dirs, in dir1:dir2 form, for rpath purposes
202 #
203 # invocation is like:
204 # prog: foo.o bar.o $(KRB5_BASE_DEPLIBS)
205 #       $(CC_LINK) -o $@ foo.o bar.o $(KRB5_BASE_LIBS)
206
207
208 CC_LINK=@CC_LINK@
209
210 # prefix (with no spaces after) for rpath flag to cc
211 RPATH_FLAG=@RPATH_FLAG@
212
213 # this gets set by configure to either $(STLIBEXT) or $(SHLIBEXT),
214 # depending on whether we're building with shared libraries.
215 DEPLIBEXT=@DEPLIBEXT@
216
217 KADMCLNT_DEPLIB = $(TOPLIBD)/libkadm5clnt$(DEPLIBEXT)
218 KADMSRV_DEPLIB  = $(TOPLIBD)/libkadm5srv$(DEPLIBEXT)
219 KDB5_DEPLIB     = $(TOPLIBD)/libkdb5$(DEPLIBEXT)
220 DB_DEPLIB       = $(DB_DEPLIB-@DB_VERSION@)
221 DB_DEPLIB-k5    = $(TOPLIBD)/libdb$(DEPLIBEXT)
222 DB_DEPLIB-sys   =
223 GSSRPC_DEPLIB   = $(TOPLIBD)/libgssrpc$(DEPLIBEXT)
224 GSS_DEPLIB      = $(TOPLIBD)/libgssapi_krb5$(DEPLIBEXT)
225 KRB4_DEPLIB     = @KRB4_DEPLIB@         # $(TOPLIBD)/libkrb4$(DEPLIBEXT)
226 DES425_DEPLIB   = @DES425_DEPLIB@       # $(TOPLIBD)/libdes425$(DEPLIBEXT)
227 KRB5_DEPLIB     = $(TOPLIBD)/libkrb5$(DEPLIBEXT)
228 CRYPTO_DEPLIB   = $(TOPLIBD)/libk5crypto$(DEPLIBEXT)
229 COM_ERR_DEPLIB  = $(COM_ERR_DEPLIB-@COM_ERR_VERSION@)
230 COM_ERR_DEPLIB-sys = # empty
231 COM_ERR_DEPLIB-k5 = $(TOPLIBD)/libcom_err$(DEPLIBEXT)
232
233 # These are forced to use ".a" as an extension because they're never
234 # built shared.
235 SS_DEPLIB       = $(SS_DEPLIB-@SS_VERSION@)
236 SS_DEPLIB-k5    = $(TOPLIBD)/libss.a
237 SS_DEPLIB-sys   =
238 KRB524_DEPLIB   = @KRB524_DEPLIB@
239 PTY_DEPLIB      = $(TOPLIBD)/libpty.a
240
241 KRB5_BASE_DEPLIBS       = $(KRB5_DEPLIB) $(CRYPTO_DEPLIB) $(COM_ERR_DEPLIB)
242 KRB4COMPAT_DEPLIBS      = $(KRB4_DEPLIB) $(DES425_DEPLIB) $(KRB5_BASE_DEPLIBS)
243 KDB5_DEPLIBS            = $(KDB5_DEPLIB) $(DB_DEPLIB)
244 GSS_DEPLIBS             = $(GSS_DEPLIB)
245 GSSRPC_DEPLIBS          = $(GSSRPC_DEPLIB) $(GSS_DEPLIBS)
246 KADM_COMM_DEPLIBS       = $(GSSRPC_DEPLIBS) $(KDB5_DEPLIBS) $(GSSRPC_DEPLIBS)
247 KADMSRV_DEPLIBS         = $(KADMSRV_DEPLIB) $(KDB5_DEPLIBS) $(KADM_COMM_DEPLIBS)
248 KADMCLNT_DEPLIBS        = $(KADMCLNT_DEPLIB) $(KADM_COMM_DEPLIBS)
249
250 # Header file dependencies we might override.
251 # See util/depfix.sed.
252 # Also see depend-verify-* in post.in, which wants to confirm that we're using
253 # the in-tree versions.
254 COM_ERR_VERSION = @COM_ERR_VERSION@
255 COM_ERR_DEPS    = $(COM_ERR_DEPS-@COM_ERR_VERSION@)
256 COM_ERR_DEPS-sys =
257 COM_ERR_DEPS-k5 = $(BUILDTOP)/include/com_err.h
258 SS_VERSION      = @SS_VERSION@
259 SS_DEPS         = $(SS_DEPS-@SS_VERSION@)
260 SS_DEPS-sys     =
261 SS_DEPS-k5      = $(BUILDTOP)/include/ss/ss.h $(BUILDTOP)/include/ss/ss_err.h
262 DB_VERSION      = @DB_VERSION@
263 DB_DEPS         = $(DB_DEPS-@DB_HEADER_VERSION@)
264 DB_DEPS-sys     =
265 DB_DEPS-k5      = $(BUILDTOP)/include/db.h $(BUILDTOP)/include/db-config.h
266 DB_DEPS-redirect = $(BUILDTOP)/include/db.h
267
268 # LIBS gets substituted in... e.g. -lnsl -lsocket
269
270 # GEN_LIB is -lgen if needed for regexp
271 GEN_LIB         = @GEN_LIB@
272
273 SS_LIB          = $(SS_LIB-@SS_VERSION@)
274 SS_LIB-sys      = @SS_LIB@
275 SS_LIB-k5       = $(TOPLIBD)/libss.a
276 KDB5_LIB        = -lkdb5
277 DB_LIB          = @DB_LIB@
278
279 KRB5_LIB                        = -lkrb5
280 K5CRYPTO_LIB                    = -lk5crypto
281 COM_ERR_LIB                     = -lcom_err
282 GSS_KRB5_LIB                    = -lgssapi_krb5
283
284 # KRB4_LIB is -lkrb4 if building --with-krb4
285 # needs fixing if ever used on Mac OS X!
286 KRB4_LIB        = @KRB4_LIB@
287
288 # DES425_LIB is -ldes425 if building --with-krb4
289 # needs fixing if ever used on Mac OS X!
290 DES425_LIB      = @DES425_LIB@
291
292 # KRB524_LIB is $(BUILDTOP)/krb524/libkrb524.a if building --with-krb4
293 # needs fixing if ever used on Mac OS X!
294 KRB524_LIB      = @KRB524_LIB@
295
296 # HESIOD_LIBS is -lhesiod...
297 HESIOD_LIBS     = @HESIOD_LIBS@
298
299 KRB5_BASE_LIBS  = $(KRB5_LIB) $(K5CRYPTO_LIB) $(COM_ERR_LIB) $(GEN_LIB) $(LIBS)
300 KRB4COMPAT_LIBS = $(KRB4_LIB) $(DES425_LIB) $(KRB5_BASE_LIBS)
301 KDB5_LIBS       = $(KDB5_LIB) $(DB_LIB)
302 GSS_LIBS        = $(GSS_KRB5_LIB)
303 # needs fixing if ever used on Mac OS X!
304 GSSRPC_LIBS     = -lgssrpc $(GSS_LIBS)
305 KADM_COMM_LIBS  = $(GSSRPC_LIBS)
306 # need fixing if ever used on Mac OS X!
307 KADMSRV_LIBS    = -lkadm5srv $(HESIOD_LIBS) $(KDB5_LIBS) $(KADM_COMM_LIBS)
308 KADMCLNT_LIBS   = -lkadm5clnt $(KADM_COMM_LIBS)
309
310 # need fixing if ever used on Mac OS X!
311 PTY_LIB         = -lpty
312
313 #
314 # some more stuff for --with-krb4
315 KRB4_LIBPATH    = @KRB4_LIBPATH@
316 KRB4_INCLUDES   = @KRB4_INCLUDES@
317
318 #
319 # variables for --with-tcl=
320 TCL_LIBS        = @TCL_LIBS@
321 TCL_LIBPATH     = @TCL_LIBPATH@
322 TCL_RPATH       = @TCL_RPATH@
323 TCL_MAYBE_RPATH = @TCL_MAYBE_RPATH@
324 TCL_INCLUDES    = @TCL_INCLUDES@
325
326 # error table rules
327 #
328 ### /* these are invoked as $(...) foo.et, which works, but could be better */
329 COMPILE_ET= $(COMPILE_ET-@COM_ERR_VERSION@)
330 COMPILE_ET-sys= compile_et
331 COMPILE_ET-k5= $(BUILDTOP)/util/et/compile_et -d $(SRCTOP)/util/et
332
333 .SUFFIXES:  .h .c .et .ct
334
335 # These versions cause both .c and .h files to be generated at once.
336 # But GNU make doesn't understand this, and parallel builds can trigger
337 # both of them at once, causing them to stomp on each other.  The versions
338 # below only update one of the files, so compile_et has to get run twice,
339 # but it won't break parallel builds.
340 #.et.h: ; $(COMPILE_ET) $<
341 #.et.c: ; $(COMPILE_ET) $<
342
343 .et.h:
344         set -x ; d=ettmp$$$$ ; (cp $< $$d.et && $(COMPILE_ET) $$d.et && mv $$d.h $*.h) ; \
345                 e=$$? ; rm -f $$d.* ; exit $$e
346
347 .et.c:
348         set -x ; d=ettmp$$$$ ; (cp $< $$d.et && $(COMPILE_ET) $$d.et && mv $$d.c $*.c) ; \
349                 e=$$? ; rm -f $$d.* ; exit $$e
350
351 # rule to make object files
352 #
353 .SUFFIXES: .c .o
354 .c.o:
355         $(CC) $(ALL_CFLAGS) -c $<
356
357 # ss command table rules
358 #
359 MAKE_COMMANDS= $(MAKE_COMMANDS-@SS_VERSION@)
360 MAKE_COMMANDS-sys= mk_cmds
361 MAKE_COMMANDS-k5= $(BUILDTOP)/util/ss/mk_cmds
362
363 .ct.c:
364         $(MAKE_COMMANDS) $<
365
366 #
367 # end of pre.in