mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-02-21 14:24:09 +01:00
make: Add configuration detection and linking of libpq
If we have the client library for postgres configure will define HAVE_POSTGRES the same way it already handled libsqlite3 an we start linking against it. Signed-off-by: Christian Decker <decker.christian@gmail.com>
This commit is contained in:
parent
27790832a5
commit
62dc8dc110
2 changed files with 19 additions and 0 deletions
5
Makefile
5
Makefile
|
@ -201,6 +201,11 @@ else
|
|||
LDLIBS = -L/usr/local/lib -lm -lgmp -lsqlite3 -lz $(COVFLAGS)
|
||||
endif
|
||||
|
||||
# If we have the postgres client library we need to link against it as well
|
||||
ifeq ($(HAVE_POSTGRES),1)
|
||||
LDLIBS += -lpq
|
||||
endif
|
||||
|
||||
default: all-programs all-test-programs
|
||||
|
||||
ccan/config.h: config.vars configure ccan/tools/configurator/configurator.c
|
||||
|
|
14
configure
vendored
14
configure
vendored
|
@ -273,6 +273,20 @@ int main(void)
|
|||
return 0;
|
||||
}
|
||||
/*END*/
|
||||
var=HAVE_POSTGRES
|
||||
desc=postgres
|
||||
style=DEFINES_EVERYTHING|EXECUTE|MAY_NOT_COMPILE
|
||||
link=-lpq
|
||||
code=
|
||||
#include <postgresql/libpq-fe.h>
|
||||
#include <stdio.h>
|
||||
|
||||
int main(void)
|
||||
{
|
||||
printf("libpq version %d\n", PQlibVersion());
|
||||
return 0;
|
||||
}
|
||||
/*END*/
|
||||
var=HAVE_GCC
|
||||
desc=compiler is GCC
|
||||
style=OUTSIDE_MAIN
|
||||
|
|
Loading…
Add table
Reference in a new issue