]> granicus.if.org Git - postgresql/blob - src/Makefile.global.in
Add configure thread tests.
[postgresql] / src / Makefile.global.in
1 # -*-makefile-*-
2 # $Header: /cvsroot/pgsql/src/Makefile.global.in,v 1.163 2003/05/27 16:36:50 momjian Exp $
3
4 #------------------------------------------------------------------------------
5 # All PostgreSQL makefiles include this file and use the variables it sets,
6 # which in turn are put here by the configure script. There is no need for
7 # users to edit this file -- if it turns out to be necessary then that's a
8 # bug.
9 #
10 # A makefile that includes this file needs to set the variable `subdir' to
11 # the relative path from the top to itself and `top_builddir' to the relative
12 # path from itself to the top before including this file. (The "top" is the
13 # parent directory of the directory this file is in.)
14 #------------------------------------------------------------------------------
15
16
17 ##########################################################################
18 #
19 # Meta configuration
20
21 .PHONY: all install install-strip installdirs uninstall clean distclean maintainer-clean distprep check installcheck maintainer-check
22 .SILENT: installdirs
23
24 # make `all' the default target
25 all:
26
27 # Delete target files if the command fails after it has
28 # started to update the file.
29 .DELETE_ON_ERROR:
30
31 # PostgreSQL version number
32 VERSION = @PACKAGE_VERSION@
33
34 # Support for VPATH builds
35 vpath_build = @vpath_build@
36 abs_top_srcdir = @abs_top_srcdir@
37
38 ifneq ($(vpath_build),yes)
39 top_srcdir = $(top_builddir)
40 srcdir = .
41 else # vpath_build = yes
42 top_srcdir = $(abs_top_srcdir)
43 srcdir = $(top_srcdir)/$(subdir)
44 VPATH = $(srcdir)
45 endif
46
47 # Saved arguments from configure
48 configure_args = @configure_args@
49
50
51 ##########################################################################
52 #
53 # Installation directories
54 #
55 # These are set by the equivalent --xxxdir configure options.  We
56 # append "postgresql" to some of them, if the string does not already
57 # contain "pgsql" or "postgres", in order to avoid directory clutter.
58
59 prefix := @prefix@
60 exec_prefix := @exec_prefix@
61
62 bindir := @bindir@
63 sbindir := @sbindir@
64
65 libexecdir := @libexecdir@
66 ifeq "$(findstring pgsql, $(libexecdir))" ""
67 ifeq "$(findstring postgres, $(libexecdir))" ""
68 override libexecdir := $(libexecdir)/postgresql
69 endif
70 endif
71
72 datadir := @datadir@
73 ifeq "$(findstring pgsql, $(datadir))" ""
74 ifeq "$(findstring postgres, $(datadir))" ""
75 override datadir := $(datadir)/postgresql
76 endif
77 endif
78
79 sysconfdir := @sysconfdir@
80 ifeq "$(findstring pgsql, $(sysconfdir))" ""
81 ifeq "$(findstring postgres, $(sysconfdir))" ""
82 override sysconfdir := $(sysconfdir)/postgresql
83 endif
84 endif
85
86 libdir := @libdir@
87 pkglibdir = $(libdir)
88 ifeq "$(findstring pgsql, $(pkglibdir))" ""
89 ifeq "$(findstring postgres, $(pkglibdir))" ""
90 override pkglibdir := $(pkglibdir)/postgresql
91 endif
92 endif
93
94 includedir := @includedir@
95 pkgincludedir = $(includedir)
96 ifeq "$(findstring pgsql, $(pkgincludedir))" ""
97 ifeq "$(findstring postgres, $(pkgincludedir))" ""
98 override pkgincludedir := $(pkgincludedir)/postgresql
99 endif
100 endif
101 includedir_server = $(pkgincludedir)/server
102 includedir_internal = $(pkgincludedir)/internal
103
104 mandir := @mandir@
105 sqlmansect_dummy = l
106
107 docdir := @docdir@
108 ifeq "$(findstring pgsql, $(docdir))" ""
109 ifeq "$(findstring postgres, $(docdir))" ""
110 override docdir := $(docdir)/postgresql
111 endif
112 endif
113
114 javadir := $(DESTDIR)$(datadir)/java
115 localedir := @localedir@
116
117
118 ##########################################################################
119 #
120 # Features
121 #
122 # Records the choice of the various --enable-xxx and --with-xxx options.
123
124 with_java       = @with_java@
125 with_perl       = @with_perl@
126 with_python     = @with_python@
127 with_tcl        = @with_tcl@
128 with_tk         = @with_tk@
129 enable_shared   = @enable_shared@
130 enable_rpath    = @enable_rpath@
131 enable_nls      = @enable_nls@
132 enable_debug    = @enable_debug@
133
134 python_version          = @python_version@
135 python_includespec      = @python_includespec@
136 python_moduledir        = @python_moduledir@
137 python_moduleexecdir    = @python_moduleexecdir@
138 python_libspec          = @python_libspec@
139 python_configdir        = @python_configdir@
140
141 krb_srvtab = @krb_srvtab@
142
143 TCLSH                   = @TCLSH@
144 TCL_LIB_FILE            = @TCL_LIB_FILE@
145 TCL_LIBS                = @TCL_LIBS@
146 TCL_LIB_SPEC            = @TCL_LIB_SPEC@
147 TCL_INCLUDE_SPEC        = @TCL_INCLUDE_SPEC@
148 TCL_SHARED_BUILD        = @TCL_SHARED_BUILD@
149 TCL_SHLIB_LD_LIBS       = @TCL_SHLIB_LD_LIBS@
150
151 TK_LIBS                 = @TK_LIBS@
152 TK_LIB_SPEC             = @TK_LIB_SPEC@
153 TK_XINCLUDES            = @TK_XINCLUDES@
154
155 THREAD_CFLAGS           = @THREAD_CFLAGS@
156 THREAD_LIBS             = @THREAD_LIBS@
157
158 have_docbook    = @have_docbook@
159 DOCBOOKSTYLE    = @DOCBOOKSTYLE@
160 COLLATEINDEX    = @COLLATEINDEX@
161
162
163 ##########################################################################
164 #
165 # Programs and flags
166
167 # Compilers
168
169 CPP = @CPP@
170 CPPFLAGS = @CPPFLAGS@
171 override CPPFLAGS := -I$(top_srcdir)/src/include $(CPPFLAGS)
172 ifdef VPATH
173 override CPPFLAGS := -I$(top_builddir)/src/include $(CPPFLAGS)
174 endif
175
176 CC = @CC@
177 GCC = @GCC@
178 CFLAGS = @CFLAGS@
179 ifeq ($(GCC), yes)
180   CFLAGS += -Wall -Wmissing-prototypes -Wmissing-declarations
181 endif
182
183 # Kind-of compilers
184
185 YACC = @YACC@
186 YFLAGS = @YFLAGS@
187 FLEX = @FLEX@
188 FLEXFLAGS = @FLEXFLAGS@ $(LFLAGS)
189
190 # Linking
191
192 LIBS = @LIBS@
193 LD = @LD@
194 with_gnu_ld = @with_gnu_ld@
195 ld_R_works = @ld_R_works@
196 LDFLAGS = @LDFLAGS@
197 LDREL = -r
198 LDOUT = -o
199 RANLIB = @RANLIB@
200 LORDER = @LORDER@
201 X = @EXEEXT@
202
203 # Perl 
204
205 PERL                    = @PERL@
206 perl_archlibexp         = @perl_archlibexp@
207 perl_privlibexp         = @perl_privlibexp@
208 perl_useshrplib         = @perl_useshrplib@
209 perl_embed_ldflags      = @perl_embed_ldflags@
210
211 # Miscellaneous
212
213 ANT     = @ANT@
214 AWK     = @AWK@
215 LN_S    = @LN_S@
216 MSGFMT  = @MSGFMT@
217 MSGMERGE = @MSGMERGE@
218 PYTHON  = @PYTHON@
219 TAR     = @TAR@
220 XGETTEXT = @XGETTEXT@
221
222 GZIP    = gzip
223 BZIP2   = bzip2
224
225 # Installation.
226
227 INSTALL = $(SHELL) $(top_srcdir)/config/install-sh -c
228
229 INSTALL_PROGRAM = $(INSTALL_PROGRAM_ENV) $(INSTALL) $(INSTALL_STRIP_FLAG)
230 INSTALL_SCRIPT  = $(INSTALL) -m 755
231 INSTALL_DATA    = $(INSTALL) -m 644
232 INSTALL_STLIB   = $(INSTALL_STLIB_ENV) $(INSTALL_DATA) $(INSTALL_STRIP_FLAG)
233 INSTALL_SHLIB   = $(INSTALL_SHLIB_ENV) $(INSTALL) $(INSTALL_SHLIB_OPTS) $(INSTALL_STRIP_FLAG)
234 # Override in Makefile.port if necessary
235 INSTALL_SHLIB_OPTS = -m 755
236
237 mkinstalldirs   = $(SHELL) $(top_srcdir)/config/mkinstalldirs
238 missing         = $(SHELL) $(top_srcdir)/config/missing
239
240 STRIP           = @STRIP@
241 STRIP_STATIC_LIB = @STRIP_STATIC_LIB@
242 STRIP_SHARED_LIB = @STRIP_SHARED_LIB@
243
244 # Documentation
245
246 JADE    = @JADE@
247 NSGMLS  = @NSGMLS@
248 SGMLSPL = @SGMLSPL@
249
250 # Feature settings
251
252 DEF_PGPORT = @default_port@
253 WANTED_LANGUAGES = @WANTED_LANGUAGES@
254
255
256 ##########################################################################
257 #
258 # Additional platform-specific settings
259 #
260
261 # Name of the "template"
262 PORTNAME= @PORTNAME@
263
264 host_tuple = @host@
265 host_os = @host_os@
266 host_cpu = @host_cpu@
267
268 # The HP-UX port makefile, for one, needs access to this symbol
269 HAVE_POSIX_SIGNALS= @HAVE_POSIX_SIGNALS@
270
271 # This is mainly for use on FreeBSD, where we have both a.out and elf
272 # systems now.  May be applicable to other systems to?
273 ELF_SYSTEM= @ELF_SYS@
274
275 # Pull in platform-specific magic
276 include $(top_builddir)/src/Makefile.port
277
278 ifeq ($(enable_rpath), yes)
279 LDFLAGS += $(rpath)
280 endif
281
282
283 ##########################################################################
284 #
285 # Some variables needed to find some client interfaces
286
287 libpq_srcdir = $(top_srcdir)/src/interfaces/libpq
288 libpq_builddir = $(top_builddir)/src/interfaces/libpq
289 libpq = -L$(libpq_builddir) -lpq
290
291 submake-libpq:
292         $(MAKE) -C $(libpq_builddir) all
293
294 submake-libpgport:
295         $(MAKE) -C $(top_builddir)/src/port all
296
297 .PHONY: submake-libpq submake-libpgport
298
299
300 ##########################################################################
301 #
302 # Customization
303 #
304 # This includes your local customizations if Makefile.custom exists
305 # in the source directory.  This file doesn't exist in the original
306 # distribution so that it doesn't get overwritten when you upgrade.
307 #
308 # NOTE:  Makefile.custom is from the pre-Autoconf days of PostgreSQL.
309 # You are liable to shoot yourself in the foot if you use it without
310 # knowing exactly what you're doing.  The preferred (and more
311 # reliable) method is to communicate what you want to do to the
312 # configure script, and leave the makefiles alone.
313
314 -include $(top_srcdir)/src/Makefile.custom
315
316 ifneq ($(CUSTOM_INSTALL),)
317 INSTALL= $(CUSTOM_INSTALL)
318 endif
319
320 ifneq ($(CUSTOM_CC),)
321   CC= $(CUSTOM_CC)
322 endif
323
324 ifneq ($(CUSTOM_COPT),)
325   COPT= $(CUSTOM_COPT)
326 endif
327
328 ifdef COPT
329    CFLAGS+= $(COPT)
330    LDFLAGS+= $(COPT)
331 endif
332
333 ifdef PROFILE
334    CFLAGS+= $(PROFILE)
335    LDFLAGS+= $(PROFILE)
336 endif
337
338
339 ##########################################################################
340 #
341 # substitute implementations of the C library
342
343 LIBOBJS = @LIBOBJS@ path.o
344
345 ifneq (,$(LIBOBJS))
346 LIBS += -lpgport
347 LDFLAGS := -L$(top_builddir)/src/port $(LDFLAGS)
348 endif
349
350 # Not really standard libc functions, used by the backend.
351 TAS         = @TAS@
352
353
354 ##########################################################################
355 #
356 # Global targets and rules
357
358 %.gz: %
359         $(GZIP) -f --best $<
360
361 %.bz2: %
362         $(BZIP2) -f $<
363
364 # Remake Makefile.global from Makefile.global.in if the latter
365 # changed. In order to trigger this rule, the including file must
366 # write `include $(top_builddir)/src/Makefile.global', not some
367 # shortcut thereof.
368 $(top_builddir)/src/Makefile.global: $(top_srcdir)/src/Makefile.global.in $(top_builddir)/config.status
369         cd $(top_builddir) && ./config.status src/Makefile.global
370
371 # Remake pg_config.h from pg_config.h.in if the latter changed.
372 # config.status will not change the timestamp on pg_config.h if it
373 # doesn't change, so as to avoid recompiling the entire tree
374 # unnecessarily. Therefore we make config.status update a timestamp file
375 # stamp-h everytime it runs, so that we don't trigger this rule everytime.
376 # (We do trigger the null rule for stamp-h to pg_config.h everytime; so it's
377 # important for that rule to be null!)
378 #
379 # Of course you need to turn on dependency tracking to get any
380 # dependencies on pg_config.h.
381 $(top_builddir)/src/include/pg_config.h: $(top_builddir)/src/include/stamp-h
382
383 $(top_builddir)/src/include/stamp-h: $(top_srcdir)/src/include/pg_config.h.in $(top_builddir)/config.status
384         cd $(top_builddir) && ./config.status src/include/pg_config.h
385
386 # When configure changes, rerun configure with the same options as
387 # last time. To change configure, you need to run autoconf manually.
388 $(top_builddir)/config.status: $(top_srcdir)/configure
389         cd $(top_builddir) && ./config.status --recheck
390
391
392 install-strip:
393         @$(MAKE) INSTALL_PROGRAM_ENV="STRIPPROG='$(STRIP)'" \
394             INSTALL_STLIB_ENV="STRIPPROG='$(STRIP_STATIC_LIB)'" \
395             INSTALL_SHLIB_ENV="STRIPPROG='$(STRIP_SHARED_LIB)'" \
396             INSTALL_STRIP_FLAG=-s \
397             install
398
399
400 ##########################################################################
401 #
402 # Automatic dependency generation
403 # -------------------------------
404 # When we configure with --enable-depend then we override the default
405 # compilation rule with the magic below. While or after creating the
406 # actual output file we also create a dependency list for the .c file.
407 # Next time we invoke make we will have top-notch information about
408 # whether this file needs to be updated. The dependency files are kept
409 # in the .deps subdirectory of each directory.
410 #
411 # The sed command is necessary to post-process the dependency file:
412 # Each dependency file becomes a target of its own, without
413 # dependencies or commands. This is because if you happen to remove a
414 # file that is a dependency (say, you rename a header file) the
415 # dependency would point to a non-existing file and make would fail.
416 # But if the file is listed as a target of its own, without
417 # prerequisites and commands, and doesn't exist then make will
418 # consider it updated. (That in turn also has the nice side effect
419 # that make will update all files that depended on the now removed
420 # file.)
421
422 autodepend = @autodepend@
423
424 ifeq ($(autodepend), yes)
425
426 ifndef COMPILE.c
427 COMPILE.c = $(CC) $(CFLAGS) $(CPPFLAGS) -c
428 endif
429
430 DEPDIR = .deps
431 df = $(DEPDIR)/$(*F)
432
433 # This converts a .d file in the current directory to a .P file in the .deps
434 # subdirectory, with the dummy targets as explained above.
435 define postprocess-depend
436 @if test ! -d $(DEPDIR); then mkdir $(DEPDIR); fi
437 @cp $*.d $(df).P
438 @sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \
439      -e '/^$$/ d' -e 's/$$/ :/' < $*.d >> $(df).P
440 @rm -f $*.d
441 endef
442
443 ifeq ($(GCC), yes)
444
445 # GCC allows us to create object and dependency file in one invocation.
446 %.o : %.c
447         $(COMPILE.c) -o $@ $< -MMD
448         $(postprocess-depend)
449
450 endif # GCC
451
452 # Include all the dependency files generated for the current
453 # directory. List /dev/null as dummy because if the wildcard expands
454 # to nothing then make would complain.
455 -include $(wildcard $(DEPDIR)/*.P) /dev/null
456
457 # hook for clean-up
458 clean distclean maintainer-clean: clean-deps
459
460 .PHONY: clean-deps
461 clean-deps:
462         @rm -rf $(DEPDIR) *.d
463
464 endif # autodepend
465
466
467 ##########################################################################
468 #
469 # Native language support
470
471 ifeq ($(enable_nls), yes)
472 ifneq (,$(wildcard $(srcdir)/nls.mk))
473
474 include $(top_srcdir)/src/nls-global.mk
475
476 endif # nls.mk
477 endif # enable_nls