mirror of
https://github.com/EnterpriseDB/repmgr.git
synced 2026-03-27 17:06:29 +00:00
Makefiles and placeholder code
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -31,7 +31,7 @@ lib*.pc
|
|||||||
|
|
||||||
# configure output
|
# configure output
|
||||||
/Makefile
|
/Makefile
|
||||||
/run_tests
|
/Makefile.global
|
||||||
/config.log
|
/config.log
|
||||||
/config.status
|
/config.status
|
||||||
|
|
||||||
|
|||||||
27
Makefile.global.in
Normal file
27
Makefile.global.in
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
# -*-makefile-*-
|
||||||
|
# Makefile.global.in
|
||||||
|
# @configure_input@
|
||||||
|
|
||||||
|
# Can only be built using pgxs
|
||||||
|
USE_PGXS=1
|
||||||
|
|
||||||
|
repmgr_abs_srcdir := @abs_srcdir@
|
||||||
|
PG_CONFIG :=@PG_CONFIG@
|
||||||
|
PGXS := $(shell $(PG_CONFIG) --pgxs)
|
||||||
|
|
||||||
|
vpath_build=@vpath_build@
|
||||||
|
ifeq ($(vpath_build),yes)
|
||||||
|
VPATH := $(repmgr_abs_srcdir)/$(repmgr_subdir)
|
||||||
|
USE_VPATH :=$(VPATH)
|
||||||
|
endif
|
||||||
|
GIT_WORK_TREE=${repmgr_abs_srcdir}
|
||||||
|
GIT_DIR=${repmgr_abs_srcdir}/.git
|
||||||
|
export GIT_DIR
|
||||||
|
export GIT_WORK_TREE
|
||||||
|
|
||||||
|
include $(PGXS)
|
||||||
|
|
||||||
|
-include ${repmgr_abs_srcdir}/Makefile.custom
|
||||||
|
|
||||||
|
REPMGR_VERSION=$(shell awk '/^\#define REPMGR_VERSION / { print $3; }' ${repmgr_abs_srcdir}/repmgr_version.h.in | cut -d '"' -f 2)
|
||||||
|
|
||||||
51
Makefile.in
Normal file
51
Makefile.in
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
# -*-makefile-*-
|
||||||
|
# Makefile.in
|
||||||
|
# @configure_input@
|
||||||
|
|
||||||
|
repmgr_subdir = .
|
||||||
|
repmgr_top_builddir = .
|
||||||
|
|
||||||
|
MODULE_big = repmgr
|
||||||
|
|
||||||
|
EXTENSION = repmgr
|
||||||
|
|
||||||
|
# Hacky workaround to install the binaries
|
||||||
|
SCRIPTS_built = repmgr
|
||||||
|
|
||||||
|
|
||||||
|
# When in development add -Werror
|
||||||
|
PG_CPPFLAGS = -std=gnu89 -I$(libpq_srcdir) -Wall -Wmissing-prototypes -Wmissing-declarations $(EXTRA_CFLAGS)
|
||||||
|
SHLIB_LINK = $(libpq)
|
||||||
|
|
||||||
|
OBJS = \
|
||||||
|
repmgr.o
|
||||||
|
|
||||||
|
include Makefile.global
|
||||||
|
|
||||||
|
$(info Building against PostgreSQL $(MAJORVERSION))
|
||||||
|
|
||||||
|
REPMGR_CLIENT_OBJS = repmgr-client.o
|
||||||
|
|
||||||
|
repmgr: $(REPMGR_CLIENT_OBJS)
|
||||||
|
$(CC) $(CFLAGS) $(REPMGR_CLIENT_OBJS) $(libpq_pgport) $(LDFLAGS) $(LDFLAGS_EX) $(LIBS) -o $@$(X)
|
||||||
|
|
||||||
|
|
||||||
|
# Ensure Makefiles are up-to-date (should we move this to Makefile.global?)
|
||||||
|
Makefile: Makefile.in config.status configure
|
||||||
|
./config.status $@
|
||||||
|
|
||||||
|
Makefile.global: Makefile.global.in config.status configure
|
||||||
|
./config.status $@
|
||||||
|
|
||||||
|
clean: additional-clean
|
||||||
|
|
||||||
|
maintainer-clean: additional-maintainer-clean
|
||||||
|
|
||||||
|
additional-clean:
|
||||||
|
rm -f repmgr-client.o
|
||||||
|
|
||||||
|
maintainer-additional-clean: clean
|
||||||
|
rm -f configure
|
||||||
|
rm -f config.status config.log
|
||||||
|
rm -f Makefile
|
||||||
|
@rm -rf autom4te.cache/
|
||||||
@@ -23,7 +23,7 @@ if test -z "$version_num"; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
version_num_int=$(echo "$version_num"|
|
version_num_int=$(echo "$version_num"|
|
||||||
$SED -e 's/^\([[0-9]]*\)\([[0-9]]*\)$/\1\2/')
|
$SED -e 's/^\([[0-9]]*\)\.\([[0-9]]*\)$/\1\2/')
|
||||||
|
|
||||||
if test "$version_num_int" -lt '93'; then
|
if test "$version_num_int" -lt '93'; then
|
||||||
AC_MSG_ERROR([repmgr is not compatible with detected PostgreSQL version: $version_num])
|
AC_MSG_ERROR([repmgr is not compatible with detected PostgreSQL version: $version_num])
|
||||||
@@ -41,3 +41,8 @@ else
|
|||||||
vpath_build=yes
|
vpath_build=yes
|
||||||
fi
|
fi
|
||||||
AC_SUBST(vpath_build)
|
AC_SUBST(vpath_build)
|
||||||
|
|
||||||
|
AC_CONFIG_FILES([Makefile])
|
||||||
|
AC_CONFIG_FILES([Makefile.global])
|
||||||
|
AC_OUTPUT
|
||||||
|
|
||||||
|
|||||||
21
repmgr-client.c
Normal file
21
repmgr-client.c
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
/*
|
||||||
|
* repmgr.c - Command interpreter for the repmgr package
|
||||||
|
*
|
||||||
|
* Copyright (c) 2ndQuadrant, 2010-2017
|
||||||
|
*
|
||||||
|
* This module is a command-line utility to easily setup a cluster of
|
||||||
|
* hot standby servers for an HA environment
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
#include "repmgr.h"
|
||||||
|
|
||||||
|
int
|
||||||
|
main(int argc, char **argv)
|
||||||
|
{
|
||||||
|
puts("repmgr");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
46
repmgr.c
Normal file
46
repmgr.c
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
/*
|
||||||
|
* repmgr.c - repmgr extension
|
||||||
|
*
|
||||||
|
* Copyright (c) 2ndQuadrant, 2010-2017
|
||||||
|
*
|
||||||
|
* This is the actual extension code; see repmgr-client.c for the code which
|
||||||
|
* generates the repmgr binary
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "postgres.h"
|
||||||
|
#include "fmgr.h"
|
||||||
|
#include "access/xlog.h"
|
||||||
|
#include "miscadmin.h"
|
||||||
|
#include "replication/walreceiver.h"
|
||||||
|
#include "storage/ipc.h"
|
||||||
|
#include "storage/lwlock.h"
|
||||||
|
#include "storage/procarray.h"
|
||||||
|
#include "storage/shmem.h"
|
||||||
|
#include "storage/spin.h"
|
||||||
|
#include "utils/builtins.h"
|
||||||
|
#include "utils/timestamp.h"
|
||||||
|
|
||||||
|
#define MAXFNAMELEN 64
|
||||||
|
|
||||||
|
PG_MODULE_MAGIC;
|
||||||
|
|
||||||
|
|
||||||
|
void _PG_init(void);
|
||||||
|
void _PG_fini(void);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Module load callback
|
||||||
|
*/
|
||||||
|
void
|
||||||
|
_PG_init(void)
|
||||||
|
{
|
||||||
|
elog(INFO, "repmgr init");
|
||||||
|
}
|
||||||
|
/*
|
||||||
|
* Module unload callback
|
||||||
|
*/
|
||||||
|
void
|
||||||
|
_PG_fini(void)
|
||||||
|
{
|
||||||
|
elog(INFO, "repmgr fini");
|
||||||
|
}
|
||||||
7
repmgr.control
Normal file
7
repmgr.control
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
# repmgr extension
|
||||||
|
comment = 'Replication manager for PostgreSQL'
|
||||||
|
default_version = '4.0.0.0'
|
||||||
|
module_pathname = '$libdir/repmgr'
|
||||||
|
relocatable = false
|
||||||
|
schema = pg_catalog
|
||||||
|
|
||||||
16
repmgr.h
Normal file
16
repmgr.h
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
/*
|
||||||
|
* repmgr.h
|
||||||
|
* Copyright (c) 2ndQuadrant, 2010-2017
|
||||||
|
*/
|
||||||
|
#ifndef _REPMGR_H_
|
||||||
|
#define _REPMGR_H_
|
||||||
|
|
||||||
|
#include <libpq-fe.h>
|
||||||
|
#include <postgres_fe.h>
|
||||||
|
#include <getopt_long.h>
|
||||||
|
#include <pqexpbuffer.h>
|
||||||
|
|
||||||
|
#define MIN_SUPPORTED_VERSION "9.3"
|
||||||
|
#define MIN_SUPPORTED_VERSION_NUM 90300
|
||||||
|
|
||||||
|
#endif
|
||||||
6
repmgr_version.h
Normal file
6
repmgr_version.h
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
#ifndef _VERSION_H_
|
||||||
|
#define _VERSION_H_
|
||||||
|
|
||||||
|
#define REPMGR_VERSION "4.0dev"
|
||||||
|
|
||||||
|
#endif
|
||||||
Reference in New Issue
Block a user