]> granicus.if.org Git - postgresql/blob - src/Makefile.global.in
Adjust TupleHashTables to use MinimalTuple format for contained tuples.
[postgresql] / src / Makefile.global.in
1 # -*-makefile-*-
2 # $PostgreSQL: pgsql/src/Makefile.global.in,v 1.222 2006/04/19 16:32:08 tgl 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 # In a PGXS build, we cannot use the values inserted into Makefile.global
60 # by configure, since the installation tree may have been relocated.
61 # Instead get the path values from pg_config.
62
63 ifndef PGXS
64
65 # Note that prefix and exec_prefix aren't defined in a PGXS build;
66 # makefiles may only use the derived variables such as bindir.
67
68 prefix := @prefix@
69 exec_prefix := @exec_prefix@
70
71 bindir := @bindir@
72
73 datadir := @datadir@
74 ifeq "$(findstring pgsql, $(datadir))" ""
75 ifeq "$(findstring postgres, $(datadir))" ""
76 override datadir := $(datadir)/postgresql
77 endif
78 endif
79
80 sysconfdir := @sysconfdir@
81 ifeq "$(findstring pgsql, $(sysconfdir))" ""
82 ifeq "$(findstring postgres, $(sysconfdir))" ""
83 override sysconfdir := $(sysconfdir)/postgresql
84 endif
85 endif
86
87 libdir := @libdir@
88
89 pkglibdir = $(libdir)
90 ifeq "$(findstring pgsql, $(pkglibdir))" ""
91 ifeq "$(findstring postgres, $(pkglibdir))" ""
92 override pkglibdir := $(pkglibdir)/postgresql
93 endif
94 endif
95
96 includedir := @includedir@
97
98 pkgincludedir = $(includedir)
99 ifeq "$(findstring pgsql, $(pkgincludedir))" ""
100 ifeq "$(findstring postgres, $(pkgincludedir))" ""
101 override pkgincludedir := $(pkgincludedir)/postgresql
102 endif
103 endif
104
105 mandir := @mandir@
106
107 docdir := @docdir@
108 # docdir can be an empty string to signify --without-docdir
109 ifneq (,$(docdir))
110 ifeq "$(findstring pgsql, $(docdir))" ""
111 ifeq "$(findstring postgres, $(docdir))" ""
112 override docdir := $(docdir)/postgresql
113 endif
114 endif
115 endif
116
117 localedir := @localedir@
118
119 else # PGXS case
120
121 bindir := $(shell pg_config --bindir)
122 datadir := $(shell pg_config --sharedir)
123 sysconfdir := $(shell pg_config --sysconfdir)
124 libdir := $(shell pg_config --libdir)
125 pkglibdir := $(shell pg_config --pkglibdir)
126 includedir := $(shell pg_config --includedir)
127 pkgincludedir := $(shell pg_config --pkgincludedir)
128 mandir := $(shell pg_config --mandir)
129 docdir := $(shell pg_config --docdir)
130 localedir := $(shell pg_config --localedir)
131
132 endif # PGXS
133
134 # These derived path variables aren't separately configurable.
135
136 includedir_server = $(pkgincludedir)/server
137 includedir_internal = $(pkgincludedir)/internal
138 pgxsdir = $(pkglibdir)/pgxs
139
140 sqlmansect_dummy = l
141
142
143 ##########################################################################
144 #
145 # Features
146 #
147 # Records the choice of the various --enable-xxx and --with-xxx options.
148
149 with_perl       = @with_perl@
150 with_python     = @with_python@
151 with_tcl        = @with_tcl@
152 with_openssl    = @with_openssl@
153 with_zlib       = @with_zlib@
154 enable_shared   = @enable_shared@
155 enable_rpath    = @enable_rpath@
156 enable_nls      = @enable_nls@
157 enable_debug    = @enable_debug@
158 enable_thread_safety    = @enable_thread_safety@
159
160 python_includespec      = @python_includespec@
161 python_libdir           = @python_libdir@
162 python_libspec          = @python_libspec@
163 python_additional_libs  = @python_additional_libs@
164 python_configdir        = @python_configdir@
165 python_version          = @python_version@
166
167 krb_srvtab = @krb_srvtab@
168
169 TCLSH                   = @TCLSH@
170 TCL_LIB_FILE            = @TCL_LIB_FILE@
171 TCL_LIBS                = @TCL_LIBS@
172 TCL_LIB_SPEC            = @TCL_LIB_SPEC@
173 TCL_INCLUDE_SPEC        = @TCL_INCLUDE_SPEC@
174 TCL_SHARED_BUILD        = @TCL_SHARED_BUILD@
175 TCL_SHLIB_LD_LIBS       = @TCL_SHLIB_LD_LIBS@
176
177 PTHREAD_CFLAGS          = @PTHREAD_CFLAGS@
178 PTHREAD_LIBS            = @PTHREAD_LIBS@
179
180 have_docbook    = @have_docbook@
181 DOCBOOKSTYLE    = @DOCBOOKSTYLE@
182 COLLATEINDEX    = @COLLATEINDEX@
183
184
185 ##########################################################################
186 #
187 # Programs and flags
188
189 # Compilers
190
191 CPP = @CPP@
192 CPPFLAGS = @CPPFLAGS@
193
194 ifdef PGXS
195 override CPPFLAGS := -I$(includedir_server) -I$(includedir_internal) $(CPPFLAGS)
196 else # not PGXS
197 override CPPFLAGS := -I$(top_srcdir)/src/include $(CPPFLAGS)
198 ifdef VPATH
199 override CPPFLAGS := -I$(top_builddir)/src/include $(CPPFLAGS)
200 endif
201 endif # not PGXS
202
203 CC = @CC@
204 GCC = @GCC@
205 CFLAGS = @CFLAGS@
206
207 # Kind-of compilers
208
209 YACC = @YACC@
210 YFLAGS = @YFLAGS@
211 FLEX = @FLEX@
212 FLEXFLAGS = @FLEXFLAGS@ $(LFLAGS)
213
214 # Linking
215
216 LIBS = @LIBS@
217 LD = @LD@
218 with_gnu_ld = @with_gnu_ld@
219 ld_R_works = @ld_R_works@
220 LDFLAGS = @LDFLAGS@
221 LDFLAGS_SL = @LDFLAGS_SL@
222 LDREL = -r
223 LDOUT = -o
224 RANLIB = @RANLIB@
225 X = @EXEEXT@
226
227 # Perl 
228
229 # quoted for pathname with spaces
230 PERL                    = "@PERL@"
231 perl_archlibexp         = @perl_archlibexp@
232 perl_privlibexp         = @perl_privlibexp@
233 perl_useshrplib         = @perl_useshrplib@
234 perl_embed_ldflags      = @perl_embed_ldflags@
235
236 # Miscellaneous
237
238 AWK     = @AWK@
239 LN_S    = @LN_S@
240 MSGFMT  = @MSGFMT@
241 MSGMERGE = @MSGMERGE@
242 PYTHON  = @PYTHON@
243 TAR     = @TAR@
244 XGETTEXT = @XGETTEXT@
245
246 GZIP    = gzip
247 BZIP2   = bzip2
248
249 PL_TESTDB = pl_regression
250 CONTRIB_TESTDB = contrib_regression
251
252 # Installation.
253
254 INSTALL = $(SHELL) $(top_srcdir)/config/install-sh -c
255
256 INSTALL_SCRIPT_MODE     = 755
257 INSTALL_DATA_MODE       = 644
258 INSTALL_PROGRAM = $(INSTALL_PROGRAM_ENV) $(INSTALL) $(INSTALL_STRIP_FLAG)
259 INSTALL_SCRIPT  = $(INSTALL) -m $(INSTALL_SCRIPT_MODE)
260 INSTALL_DATA    = $(INSTALL) -m $(INSTALL_DATA_MODE)
261 INSTALL_STLIB   = $(INSTALL_STLIB_ENV) $(INSTALL_DATA) $(INSTALL_STRIP_FLAG)
262 INSTALL_SHLIB   = $(INSTALL_SHLIB_ENV) $(INSTALL) $(INSTALL_SHLIB_OPTS) $(INSTALL_STRIP_FLAG)
263 # Override in Makefile.port if necessary
264 INSTALL_SHLIB_OPTS = -m 755
265
266 mkinstalldirs   = $(SHELL) $(top_srcdir)/config/mkinstalldirs
267 missing         = $(SHELL) $(top_srcdir)/config/missing
268
269 STRIP           = @STRIP@
270 STRIP_STATIC_LIB = @STRIP_STATIC_LIB@
271 STRIP_SHARED_LIB = @STRIP_SHARED_LIB@
272
273 # Documentation
274
275 JADE    = @JADE@
276 NSGMLS  = @NSGMLS@
277 SGMLSPL = @SGMLSPL@
278
279 # Feature settings
280
281 DEF_PGPORT = @default_port@
282 WANTED_LANGUAGES = @WANTED_LANGUAGES@
283
284
285 ##########################################################################
286 #
287 # Additional platform-specific settings
288 #
289
290 # Name of the "template"
291 PORTNAME= @PORTNAME@
292
293 host_tuple = @host@
294 host_os = @host_os@
295 host_cpu = @host_cpu@
296
297 # Make HAVE_IPV6 available for initdb script creation
298 HAVE_IPV6= @HAVE_IPV6@
299
300 # The HP-UX port makefile, for one, needs access to this symbol
301 HAVE_POSIX_SIGNALS= @HAVE_POSIX_SIGNALS@
302
303 # This is mainly for use on FreeBSD, where we have both a.out and elf
304 # systems now.  May be applicable to other systems to?
305 ELF_SYSTEM= @ELF_SYS@
306
307 # Pull in platform-specific magic
308 include $(top_builddir)/src/Makefile.port
309
310 # Set up rpath if enabled.  By default it will point to our libdir,
311 # but individual Makefiles can force other rpath paths if needed.
312 rpathdir = $(libdir)
313
314 ifeq ($(enable_rpath), yes)
315 LDFLAGS += $(rpath)
316 endif
317
318
319 ##########################################################################
320 #
321 # Some variables needed to find some client interfaces
322
323 ifdef PGXS
324 # some contribs assumes headers and libs are in the source tree...
325 libpq_srcdir = $(includedir)
326 libpq_builddir = $(libdir)
327 else
328 libpq_srcdir = $(top_srcdir)/src/interfaces/libpq
329 libpq_builddir = $(top_builddir)/src/interfaces/libpq
330 endif
331
332 # This is for use for libraries linking to libpq.  Because libpqport
333 # isn't created with the same link flags as libpq, it can't be used.
334 libpq = -L$(libpq_builddir) -lpq
335   
336 # If doing static linking, shared library dependency can't be
337 # used so we specify pthread libs for every usage of libpq
338 ifeq ($(enable_shared), no)
339 libpq += $(PTHREAD_LIBS)
340 else
341 # AIX libraries do not remember their required libs so we have to force
342 # thread dependent libraires in the link
343 ifeq ($(PORTNAME), aix)
344 libpq += $(PTHREAD_LIBS)
345 endif
346 endif
347
348 # Force clients to pull symbols from the non-shared library libpgport 
349 # rather than pulling some libpgport symbols from libpq just because 
350 # libpq uses those functions too.  This makes applications less 
351 # dependent on changes in libpq's usage of pgport.  To do this we link to
352 # pgport before libpq.  This does cause duplicate -lpgport's to appear
353 # on client link lines.
354 ifdef PGXS
355 libpq_pgport = -L$(libdir) -lpgport $(libpq)
356 else
357 libpq_pgport = -L$(top_builddir)/src/port -lpgport $(libpq)
358 endif
359
360
361 submake-libpq:
362         $(MAKE) -C $(libpq_builddir) all
363
364 submake-libpgport:
365         $(MAKE) -C $(top_builddir)/src/port all
366
367 .PHONY: submake-libpq submake-libpgport
368
369
370 ##########################################################################
371 #
372 # Customization
373 #
374 # This includes your local customizations if Makefile.custom exists
375 # in the source directory.  This file doesn't exist in the original
376 # distribution so that it doesn't get overwritten when you upgrade.
377 #
378 # NOTE:  Makefile.custom is from the pre-Autoconf days of PostgreSQL.
379 # You are liable to shoot yourself in the foot if you use it without
380 # knowing exactly what you're doing.  The preferred (and more
381 # reliable) method is to communicate what you want to do to the
382 # configure script, and leave the makefiles alone.
383
384 -include $(top_srcdir)/src/Makefile.custom
385
386 ifneq ($(CUSTOM_INSTALL),)
387 INSTALL= $(CUSTOM_INSTALL)
388 endif
389
390 ifneq ($(CUSTOM_CC),)
391   CC= $(CUSTOM_CC)
392 endif
393
394 ifneq ($(CUSTOM_COPT),)
395   COPT= $(CUSTOM_COPT)
396 endif
397
398 ifdef COPT
399    CFLAGS += $(COPT)
400    LDFLAGS += $(COPT)
401 endif
402
403 ifdef PROFILE
404    CFLAGS += $(PROFILE)
405    LDFLAGS += $(PROFILE)
406 endif
407
408
409 ##########################################################################
410 #
411 # substitute implementations of C library routines (see src/port/)
412
413 LIBOBJS = @LIBOBJS@ copydir.o dirmod.o exec.o noblock.o path.o pipe.o pgsleep.o pgstrcasecmp.o sprompt.o thread.o
414
415 LIBS := -lpgport $(LIBS)
416 # add location of libpgport.a to LDFLAGS
417 ifdef PGXS
418 override LDFLAGS := -L$(libdir) $(LDFLAGS)
419 else
420 override LDFLAGS := -L$(top_builddir)/src/port $(LDFLAGS)
421 endif
422
423 # to make ws2_32.lib the last library, and always link with shfolder,
424 # so SHGetFolderName isn't picked up from shell32.dll
425 ifeq ($(PORTNAME),win32)
426 LIBS += -lws2_32 -lshfolder
427 endif
428
429 # Not really standard libc functions, used by the backend.
430 TAS         = @TAS@
431
432
433 ##########################################################################
434 #
435 # Global targets and rules
436
437 %.gz: %
438         $(GZIP) -f --best $<
439
440 %.bz2: %
441         $(BZIP2) -f $<
442
443 ifeq ($(PORTNAME),win32)
444 # Build rules to add versioninfo resources to win32 binaries
445 WIN32RES += win32ver.o
446 ifeq ($(PGFILESHLIB),1)
447 PGFTYPE=VFT_DLL
448 else
449 PGFTYPE=VFT_APP
450 endif
451 ifneq (,$(PGAPPICON))
452 PGICOSTR=$(subst /,\/,IDI_ICON ICON \"$(top_builddir)/src/port/$(PGAPPICON).ico\")
453 endif
454 win32ver.rc: $(top_builddir)/src/port/win32ver.rc
455         sed -e 's;FILEDESC;$(PGFILEDESC);' -e 's;VFT_APP;$(PGFTYPE);' -e 's;_ICO_;$(PGICOSTR);' -e 's;\(VERSION.*\),0 *$$;\1,'`date '+%y%j' | sed 's/^0*//'`';' $(top_builddir)/src/port/win32ver.rc > win32ver.rc
456 win32ver.o: $(top_builddir)/src/port/win32ver.rc
457         sed -e 's;FILEDESC;$(PGFILEDESC);' -e 's;VFT_APP;$(PGFTYPE);' -e 's;_ICO_;$(PGICOSTR);' -e 's;\(VERSION.*\),0 *$$;\1,'`date '+%y%j' | sed 's/^0*//'`';' $(top_builddir)/src/port/win32ver.rc > win32ver.rc
458         windres -i win32ver.rc -o win32ver.o --include-dir=$(top_builddir)/src/include
459         rm -f win32ver.rc
460 endif
461
462 ifndef PGXS
463
464 # Remake Makefile.global from Makefile.global.in if the latter
465 # changed. In order to trigger this rule, the including file must
466 # write `include $(top_builddir)/src/Makefile.global', not some
467 # shortcut thereof.
468 $(top_builddir)/src/Makefile.global: $(top_srcdir)/src/Makefile.global.in $(top_builddir)/config.status
469         cd $(top_builddir) && ./config.status src/Makefile.global
470
471 # Remake pg_config.h from pg_config.h.in if the latter changed.
472 # config.status will not change the timestamp on pg_config.h if it
473 # doesn't change, so as to avoid recompiling the entire tree
474 # unnecessarily. Therefore we make config.status update a timestamp file
475 # stamp-h everytime it runs, so that we don't trigger this rule everytime.
476 # (We do trigger the null rule for stamp-h to pg_config.h everytime; so it's
477 # important for that rule to be null!)
478 #
479 # Of course you need to turn on dependency tracking to get any
480 # dependencies on pg_config.h.
481 $(top_builddir)/src/include/pg_config.h: $(top_builddir)/src/include/stamp-h
482
483 $(top_builddir)/src/include/stamp-h: $(top_srcdir)/src/include/pg_config.h.in $(top_builddir)/config.status
484         cd $(top_builddir) && ./config.status src/include/pg_config.h
485
486 # When configure changes, rerun configure with the same options as
487 # last time. To change configure, you need to run autoconf manually.
488 $(top_builddir)/config.status: $(top_srcdir)/configure
489         cd $(top_builddir) && ./config.status --recheck
490
491 endif # not PGXS
492
493
494 install-strip:
495         @$(MAKE) INSTALL_PROGRAM_ENV="STRIPPROG='$(STRIP)'" \
496             INSTALL_STLIB_ENV="STRIPPROG='$(STRIP_STATIC_LIB)'" \
497             INSTALL_SHLIB_ENV="STRIPPROG='$(STRIP_SHARED_LIB)'" \
498             INSTALL_STRIP_FLAG=-s \
499             install
500
501
502 ##########################################################################
503 #
504 # Automatic dependency generation
505 # -------------------------------
506 # When we configure with --enable-depend then we override the default
507 # compilation rule with the magic below. While or after creating the
508 # actual output file we also create a dependency list for the .c file.
509 # Next time we invoke make we will have top-notch information about
510 # whether this file needs to be updated. The dependency files are kept
511 # in the .deps subdirectory of each directory.
512 #
513 # The sed command is necessary to post-process the dependency file:
514 # Each dependency file becomes a target of its own, without
515 # dependencies or commands. This is because if you happen to remove a
516 # file that is a dependency (say, you rename a header file) the
517 # dependency would point to a non-existing file and make would fail.
518 # But if the file is listed as a target of its own, without
519 # prerequisites and commands, and doesn't exist then make will
520 # consider it updated. (That in turn also has the nice side effect
521 # that make will update all files that depended on the now removed
522 # file.)
523
524 autodepend = @autodepend@
525
526 ifeq ($(autodepend), yes)
527
528 ifndef COMPILE.c
529 COMPILE.c = $(CC) $(CFLAGS) $(CPPFLAGS) -c
530 endif
531
532 DEPDIR = .deps
533 df = $(DEPDIR)/$(*F)
534
535 # This converts a .d file in the current directory to a .P file in the .deps
536 # subdirectory, with the dummy targets as explained above.
537 define postprocess-depend
538 @if test ! -d $(DEPDIR); then mkdir -p $(DEPDIR); fi
539 @cp $*.d $(df).P
540 @sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \
541      -e '/^$$/ d' -e 's/$$/ :/' < $*.d >> $(df).P
542 @rm -f $*.d
543 endef
544
545 ifeq ($(GCC), yes)
546
547 # GCC allows us to create object and dependency file in one invocation.
548 %.o : %.c
549         $(COMPILE.c) -o $@ $< -MMD
550         $(postprocess-depend)
551
552 endif # GCC
553
554 # Include all the dependency files generated for the current
555 # directory. List /dev/null as dummy because if the wildcard expands
556 # to nothing then make would complain.
557 -include $(wildcard $(DEPDIR)/*.P) /dev/null
558
559 # hook for clean-up
560 clean distclean maintainer-clean: clean-deps
561
562 .PHONY: clean-deps
563 clean-deps:
564         @rm -rf $(DEPDIR) *.d
565
566 endif # autodepend
567
568
569 ##########################################################################
570 #
571 # Native language support
572
573 ifeq ($(enable_nls), yes)
574 ifneq (,$(wildcard $(srcdir)/nls.mk))
575
576 include $(top_srcdir)/src/nls-global.mk
577
578 endif # nls.mk
579 endif # enable_nls