From ad236d6733434ac965b3b792e06f98e9ba90fe19 Mon Sep 17 00:00:00 2001
From: Peter Eisentraut <peter_e@gmx.net>
Date: Tue, 10 Mar 2015 21:32:35 -0700
Subject: [PATCH 4/7] Move pg_test_fsync from contrib/ to src/bin/

---
 contrib/Makefile                                   |  1 -
 contrib/pg_test_fsync/Makefile                     | 18 ------------------
 doc/src/sgml/contrib.sgml                          |  1 -
 doc/src/sgml/filelist.sgml                         |  1 -
 doc/src/sgml/ref/allfiles.sgml                     |  1 +
 doc/src/sgml/{ => ref}/pgtestfsync.sgml            | 10 +---------
 doc/src/sgml/reference.sgml                        |  1 +
 src/bin/Makefile                                   |  1 +
 {contrib => src/bin}/pg_test_fsync/.gitignore      |  0
 src/bin/pg_test_fsync/Makefile                     | 14 ++++++++++++++
 {contrib => src/bin}/pg_test_fsync/pg_test_fsync.c |  0
 src/tools/msvc/Mkvcbuild.pm                        | 20 ++++++++++++--------
 12 files changed, 30 insertions(+), 38 deletions(-)
 delete mode 100644 contrib/pg_test_fsync/Makefile
 rename doc/src/sgml/{ => ref}/pgtestfsync.sgml (95%)
 rename {contrib => src/bin}/pg_test_fsync/.gitignore (100%)
 create mode 100644 src/bin/pg_test_fsync/Makefile
 rename {contrib => src/bin}/pg_test_fsync/pg_test_fsync.c (100%)

diff --git a/contrib/Makefile b/contrib/Makefile
index bd677d1..ed6ebae 100644
--- a/contrib/Makefile
+++ b/contrib/Makefile
@@ -33,7 +33,6 @@ SUBDIRS = \
 		pg_prewarm	\
 		pg_standby	\
 		pg_stat_statements \
-		pg_test_fsync	\
 		pg_test_timing	\
 		pg_trgm		\
 		pg_upgrade	\
diff --git a/contrib/pg_test_fsync/Makefile b/contrib/pg_test_fsync/Makefile
deleted file mode 100644
index 15afba7..0000000
diff --git a/doc/src/sgml/contrib.sgml b/doc/src/sgml/contrib.sgml
index 577791b..68cbf78 100644
--- a/doc/src/sgml/contrib.sgml
+++ b/doc/src/sgml/contrib.sgml
@@ -202,7 +202,6 @@ pages.
   </para>
 
  &pgstandby;
- &pgtestfsync;
  &pgtesttiming;
  &pgupgrade;
  </sect1>
diff --git a/doc/src/sgml/filelist.sgml b/doc/src/sgml/filelist.sgml
index 5bdde7b..c14e737 100644
--- a/doc/src/sgml/filelist.sgml
+++ b/doc/src/sgml/filelist.sgml
@@ -132,7 +132,6 @@
 <!ENTITY pgstandby       SYSTEM "pgstandby.sgml">
 <!ENTITY pgstatstatements SYSTEM "pgstatstatements.sgml">
 <!ENTITY pgstattuple     SYSTEM "pgstattuple.sgml">
-<!ENTITY pgtestfsync     SYSTEM "pgtestfsync.sgml">
 <!ENTITY pgtesttiming    SYSTEM "pgtesttiming.sgml">
 <!ENTITY pgtrgm          SYSTEM "pgtrgm.sgml">
 <!ENTITY pgupgrade       SYSTEM "pgupgrade.sgml">
diff --git a/doc/src/sgml/ref/allfiles.sgml b/doc/src/sgml/ref/allfiles.sgml
index 61462da..572032c 100644
--- a/doc/src/sgml/ref/allfiles.sgml
+++ b/doc/src/sgml/ref/allfiles.sgml
@@ -192,6 +192,7 @@ Complete list of usable sgml source files in this directory.
 <!ENTITY pgRecvlogical      SYSTEM "pg_recvlogical.sgml">
 <!ENTITY pgResetxlog        SYSTEM "pg_resetxlog.sgml">
 <!ENTITY pgRestore          SYSTEM "pg_restore.sgml">
+<!ENTITY pgtestfsync        SYSTEM "pgtestfsync.sgml">
 <!ENTITY pgxlogdump         SYSTEM "pg_xlogdump.sgml">
 <!ENTITY postgres           SYSTEM "postgres-ref.sgml">
 <!ENTITY postmaster         SYSTEM "postmaster.sgml">
diff --git a/doc/src/sgml/pgtestfsync.sgml b/doc/src/sgml/ref/pgtestfsync.sgml
similarity index 95%
rename from doc/src/sgml/pgtestfsync.sgml
rename to doc/src/sgml/ref/pgtestfsync.sgml
index c4b4014..5dcabe4 100644
--- a/doc/src/sgml/pgtestfsync.sgml
+++ b/doc/src/sgml/ref/pgtestfsync.sgml
@@ -1,4 +1,4 @@
-<!-- doc/src/sgml/pgtestfsync.sgml -->
+<!-- doc/src/sgml/ref/pgtestfsync.sgml -->
 
 <refentry id="pgtestfsync">
  <indexterm zone="pgtestfsync">
@@ -104,14 +104,6 @@
  </refsect1>
 
  <refsect1>
-  <title>Author</title>
-
-  <para>
-   Bruce Momjian <email>bruce@momjian.us</email>
-  </para>
- </refsect1>
-
- <refsect1>
   <title>See Also</title>
 
   <simplelist type="inline">
diff --git a/doc/src/sgml/reference.sgml b/doc/src/sgml/reference.sgml
index d939d01..be7ca70 100644
--- a/doc/src/sgml/reference.sgml
+++ b/doc/src/sgml/reference.sgml
@@ -262,6 +262,7 @@
    &pgControldata;
    &pgCtl;
    &pgResetxlog;
+   &pgtestfsync;
    &pgxlogdump;
    &postgres;
    &postmaster;
diff --git a/src/bin/Makefile b/src/bin/Makefile
index 3ce7707..497f9ee 100644
--- a/src/bin/Makefile
+++ b/src/bin/Makefile
@@ -22,6 +22,7 @@ SUBDIRS = \
 	pg_ctl \
 	pg_dump \
 	pg_resetxlog \
+	pg_test_fsync \
 	pg_xlogdump \
 	pgbench \
 	psql \
diff --git a/contrib/pg_test_fsync/.gitignore b/src/bin/pg_test_fsync/.gitignore
similarity index 100%
rename from contrib/pg_test_fsync/.gitignore
rename to src/bin/pg_test_fsync/.gitignore
diff --git a/src/bin/pg_test_fsync/Makefile b/src/bin/pg_test_fsync/Makefile
new file mode 100644
index 0000000..e8d1952
--- /dev/null
+++ b/src/bin/pg_test_fsync/Makefile
@@ -0,0 +1,14 @@
+# src/bin/pg_test_fsync/Makefile
+
+PGFILEDESC = "pg_test_fsync - test various disk sync methods"
+PGAPPICON = win32
+
+subdir = src/bin/pg_test_fsync
+top_builddir = ../../..
+include $(top_builddir)/src/Makefile.global
+
+PROGRAM  = pg_test_fsync
+OBJS = pg_test_fsync.o $(WIN32RES)
+
+NO_PGXS = 1
+include $(top_srcdir)/src/makefiles/pgxs.mk
diff --git a/contrib/pg_test_fsync/pg_test_fsync.c b/src/bin/pg_test_fsync/pg_test_fsync.c
similarity index 100%
rename from contrib/pg_test_fsync/pg_test_fsync.c
rename to src/bin/pg_test_fsync/pg_test_fsync.c
diff --git a/src/tools/msvc/Mkvcbuild.pm b/src/tools/msvc/Mkvcbuild.pm
index 0a0469a..a915abc 100644
--- a/src/tools/msvc/Mkvcbuild.pm
+++ b/src/tools/msvc/Mkvcbuild.pm
@@ -34,13 +34,13 @@ my $contrib_defines = { 'refint' => 'REFINT_VERBOSE' };
 my @contrib_uselibpq =
   ('dblink', 'oid2name', 'pg_upgrade', 'postgres_fdw', 'vacuumlo');
 my @contrib_uselibpgport = (
-	'oid2name',      'pg_standby',
-	'pg_test_fsync', 'pg_test_timing',
-	'pg_upgrade',    'vacuumlo');
+	'oid2name',       'pg_standby',
+	'pg_test_timing', 'pg_upgrade',
+	'vacuumlo');
 my @contrib_uselibpgcommon = (
-	'oid2name',      'pg_standby',
-	'pg_test_fsync', 'pg_test_timing',
-	'pg_upgrade',    'vacuumlo');
+	'oid2name',       'pg_standby',
+	'pg_test_timing', 'pg_upgrade',
+	'vacuumlo');
 my $contrib_extralibs = undef;
 my $contrib_extraincludes =
   { 'tsearch2' => ['contrib/tsearch2'], 'dblink' => ['src/backend'] };
@@ -52,8 +52,12 @@ my @contrib_excludes = ('pgcrypto', 'intagg', 'sepgsql');
 # Set of variables for frontend modules
 my $frontend_defines = { 'initdb' => 'FRONTEND' };
 my @frontend_uselibpq = ('pg_ctl', 'pgbench', 'psql');
-my @frontend_uselibpgport = ( 'pg_archivecleanup', 'pgbench' );
-my @frontend_uselibpgcommon = ( 'pg_archivecleanup', 'pgbench' );
+my @frontend_uselibpgport = (
+	'pg_archivecleanup', 'pg_test_fsync',
+	'pgbench' );
+my @frontend_uselibpgcommon = (
+	'pg_archivecleanup', 'pg_test_fsync',
+	'pgbench' );
 my $frontend_extralibs = {
 	'initdb'     => ['ws2_32.lib'],
 	'pg_restore' => ['ws2_32.lib'],
-- 
2.3.1

