~ubuntu-branches/ubuntu/hardy/postgresql-8.4/hardy-backports

« back to all changes in this revision

Viewing changes to src/port/README

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2009-03-20 12:00:13 UTC
  • Revision ID: james.westby@ubuntu.com-20090320120013-hogj7egc5mjncc5g
Tags: upstream-8.4~0cvs20090328
ImportĀ upstreamĀ versionĀ 8.4~0cvs20090328

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
$PostgreSQL$
 
2
 
 
3
libpgport
 
4
=========
 
5
 
 
6
libpgport must have special behavior.  It supplies functions to both
 
7
libraries and applications.  However, there are two complexities:
 
8
 
 
9
1)  Libraries need to use object files that are compiled with exactly
 
10
the same flags as the library.  libpgport might not use the same flags,
 
11
so it is necessary to recompile the object files for individual
 
12
libraries.  This is done by removing -lpgport from the link line:
 
13
 
 
14
        # Need to recompile any libpgport object files
 
15
        LIBS := $(filter-out -lpgport, $(LIBS))
 
16
 
 
17
and adding infrastructure to recompile the object files:
 
18
 
 
19
        OBJS= execute.o typename.o descriptor.o data.o error.o prepare.o memory.o \
 
20
                connect.o misc.o path.o exec.o \
 
21
                $(filter snprintf.o, $(LIBOBJS))
 
22
 
 
23
The problem is that there is no testing of which object files need to be
 
24
added, but missing functions usually show up when linking user
 
25
applications.
 
26
 
 
27
2) For applications, we use -lpgport before -lpq, so the static files
 
28
from libpgport are linked first.  This avoids having applications
 
29
dependent on symbols that are _used_ by libpq, but not intended to be
 
30
exported by libpq.  libpq's libpgport usage changes over time, so such a
 
31
dependency is a problem.  Win32, Linux, and Darwin use an export list to
 
32
control the symbols exported by libpq.
 
33