Skip to content

Commit

Permalink
Fix missing include header, fix FreeBSD support. (#34)
Browse files Browse the repository at this point in the history
Some of our C files are missing headers and compile then fails on FreeBSD.
I'm not sure how compile passes in other systems / compilers, and the fix
seems relevant and general enough for all platforms.

Also, use `pg_config --libs` to get the right set of libraries needed on the
current platform, rather than hardcoding -lpgport -lpgcommon. Of course we
still need to add -lpq to the list.

Fixes #32.
  • Loading branch information
DimCitus committed Jul 2, 2019
1 parent e6c7229 commit eae65c3
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/bin/pg_autoctl/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ CFLAGS += $(COMMON_LIBS)

LIBS = -L $(shell $(PG_CONFIG) --libdir)
LIBS += -L $(shell $(PG_CONFIG) --pkglibdir)
LIBS += -lpq -lpgport -lpgcommon
LIBS += $(shell $(PG_CONFIG) --libs)
LIBS += -lpq

all: $(PG_AUTOCTL) ;

Expand Down
1 change: 1 addition & 0 deletions src/bin/pg_autoctl/cli_create_drop_node.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
*
*/

#include <arpa/inet.h>
#include <errno.h>
#include <inttypes.h>
#include <getopt.h>
Expand Down
3 changes: 2 additions & 1 deletion src/bin/pg_autoctl/keeper.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@
*/
#include <fcntl.h>
#include <inttypes.h>
#include <time.h>
#include <stdlib.h>
#include <sys/stat.h>
#include <time.h>
#include <unistd.h>


Expand Down
1 change: 1 addition & 0 deletions src/bin/pg_autoctl/state.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include <inttypes.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
#include <time.h>
#include <unistd.h>

Expand Down

0 comments on commit eae65c3

Please sign in to comment.