-
Notifications
You must be signed in to change notification settings - Fork 21
Make Builds for Developers
./configure
make USE_PGXS=1
sudo make USE_PGXS=1 install
We use autoconf for the make builds. So configure
shouldn't be edited directly. Any changes instead should be made to configure.ac
which must be processed with autoconf to produce a configure script.
The whole sequence:
- Change
configure.ac
. - Run
autoconf
to produce an updatedconfigure
. - Run
./configure
to createMakefile
based onMakefile.in
. -
make USE_PGXS=1 && sudo make USE_PGXS=1 install
.
Currently, it only tries to find and link required libs. To add a new one, use REQUIRE_LIB(name, lib, testfn, include_file.h)
function, for example:
REQUIRE_LIB(jsonc, json-c, json_object_get, json_object.h)
REQUIRE_LIB(libcurl, curl, curl_easy_setopt, curl/curl.h)
The resulting configure will try to define OS and find the respective include and lib paths for the lib. Then check for <include_file.h>
and try to link the lib and check <testfn>
. If successful it will extend PG_CPPFLAGS
and SHLIB_LINK
with proper include (-I
) and lib (-L
, -l
) flags respectively in the generated Makefile
.
REQUIRE_LIB
also adds flags --with-<name>=<path>
(e.g. --with-jsonc=<path>
) to configure
were user can set a non-standard path to the lib installed. Includes and libs will be located by the provided option in that case (-I<path>/include
, -L<path>/lib
).
See the autoconf documentation here https://www.gnu.org/savannah-checkouts/gnu/autoconf/manual/autoconf-2.71/html_node/index.html
These two programs are needed by autoconf to compute the canonical triplets for the given build, host, or target architecture. These programs are updated regularly to support new architectures and fix probes broken by changes in new kernel versions.
!!! We should fetch the latest versions of these files from https://savannah.gnu.org/git/?group=config before making a release.
wget 'http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD' -O './config.guess'
wget 'http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD' -O './config.sub'
Then config.guess
and config.sub
can be updated with automake --add-missing
. But up-to-date copies of these programs come with new versions of Automake
. Hence we'd have to remember to update Automake
. _Plus it requires Makefile.am
to Makefile.in
. This means additional redundant abstractions that also should be fitted into the PG's make infrastructure. _
Automake docs: https://www.gnu.org/software/automake/manual/automake.html