From 06b6459a385796a085316144d0baa628ae1ceef5 Mon Sep 17 00:00:00 2001
From: Peter Eisentraut <peter_e@gmx.net>
Date: Tue, 10 Mar 2015 22:33:24 -0400
Subject: [PATCH 5/7] Move pg_test_timing from contrib/ to src/bin/

---
 contrib/Makefile                                     |  1 -
 contrib/pg_test_timing/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}/pgtesttiming.sgml             | 10 +---------
 doc/src/sgml/reference.sgml                          |  1 +
 src/bin/Makefile                                     |  1 +
 {contrib => src/bin}/pg_test_timing/.gitignore       |  0
 src/bin/pg_test_timing/Makefile                      | 14 ++++++++++++++
 {contrib => src/bin}/pg_test_timing/pg_test_timing.c |  0
 11 files changed, 18 insertions(+), 30 deletions(-)
 delete mode 100644 contrib/pg_test_timing/Makefile
 rename doc/src/sgml/{ => ref}/pgtesttiming.sgml (98%)
 rename {contrib => src/bin}/pg_test_timing/.gitignore (100%)
 create mode 100644 src/bin/pg_test_timing/Makefile
 rename {contrib => src/bin}/pg_test_timing/pg_test_timing.c (100%)

diff --git a/contrib/Makefile b/contrib/Makefile
index ed6ebae..60475c4 100644
--- a/contrib/Makefile
+++ b/contrib/Makefile
@@ -33,7 +33,6 @@ SUBDIRS = \
 		pg_prewarm	\
 		pg_standby	\
 		pg_stat_statements \
-		pg_test_timing	\
 		pg_trgm		\
 		pg_upgrade	\
 		pg_upgrade_support \
diff --git a/contrib/pg_test_timing/Makefile b/contrib/pg_test_timing/Makefile
deleted file mode 100644
index 8b37aa8..0000000
--- a/contrib/pg_test_timing/Makefile
+++ /dev/null
@@ -1,18 +0,0 @@
-# contrib/pg_test_timing/Makefile
-
-PGFILEDESC = "pg_test_timing - test timing overhead"
-PGAPPICON = win32
-
-PROGRAM  = pg_test_timing
-OBJS = pg_test_timing.o $(WIN32RES)
-
-ifdef USE_PGXS
-PG_CONFIG = pg_config
-PGXS := $(shell $(PG_CONFIG) --pgxs)
-include $(PGXS)
-else
-subdir = contrib/pg_test_timing
-top_builddir = ../..
-include $(top_builddir)/src/Makefile.global
-include $(top_srcdir)/contrib/contrib-global.mk
-endif
diff --git a/doc/src/sgml/contrib.sgml b/doc/src/sgml/contrib.sgml
index 68cbf78..885a096 100644
--- a/doc/src/sgml/contrib.sgml
+++ b/doc/src/sgml/contrib.sgml
@@ -202,7 +202,6 @@ <title>Server Applications</title>
   </para>
 
  &pgstandby;
- &pgtesttiming;
  &pgupgrade;
  </sect1>
 </appendix>
diff --git a/doc/src/sgml/filelist.sgml b/doc/src/sgml/filelist.sgml
index c14e737..d6120e3 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 pgtesttiming    SYSTEM "pgtesttiming.sgml">
 <!ENTITY pgtrgm          SYSTEM "pgtrgm.sgml">
 <!ENTITY pgupgrade       SYSTEM "pgupgrade.sgml">
 <!ENTITY postgres-fdw    SYSTEM "postgres-fdw.sgml">
diff --git a/doc/src/sgml/ref/allfiles.sgml b/doc/src/sgml/ref/allfiles.sgml
index 572032c..39e0244 100644
--- a/doc/src/sgml/ref/allfiles.sgml
+++ b/doc/src/sgml/ref/allfiles.sgml
@@ -193,6 +193,7 @@
 <!ENTITY pgResetxlog        SYSTEM "pg_resetxlog.sgml">
 <!ENTITY pgRestore          SYSTEM "pg_restore.sgml">
 <!ENTITY pgtestfsync        SYSTEM "pgtestfsync.sgml">
+<!ENTITY pgtesttiming       SYSTEM "pgtesttiming.sgml">
 <!ENTITY pgxlogdump         SYSTEM "pg_xlogdump.sgml">
 <!ENTITY postgres           SYSTEM "postgres-ref.sgml">
 <!ENTITY postmaster         SYSTEM "postmaster.sgml">
diff --git a/doc/src/sgml/pgtesttiming.sgml b/doc/src/sgml/ref/pgtesttiming.sgml
similarity index 98%
rename from doc/src/sgml/pgtesttiming.sgml
rename to doc/src/sgml/ref/pgtesttiming.sgml
index a6ab9b1..d5e231f 100644
--- a/doc/src/sgml/pgtesttiming.sgml
+++ b/doc/src/sgml/ref/pgtesttiming.sgml
@@ -1,4 +1,4 @@
-<!-- doc/src/sgml/pgtesttiming.sgml -->
+<!-- doc/src/sgml/ref/pgtesttiming.sgml -->
 
 <refentry id="pgtesttiming">
  <indexterm zone="pgtesttiming">
@@ -291,14 +291,6 @@ <title>Clock hardware and timing accuracy</title>
  </refsect1>
 
  <refsect1>
-  <title>Author</title>
-
-  <para>
-   Ants Aasma <email>ants.aasma@eesti.ee</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 be7ca70..99bfcda 100644
--- a/doc/src/sgml/reference.sgml
+++ b/doc/src/sgml/reference.sgml
@@ -263,6 +263,7 @@ <title>PostgreSQL Server Applications</title>
    &pgCtl;
    &pgResetxlog;
    &pgtestfsync;
+   &pgtesttiming;
    &pgxlogdump;
    &postgres;
    &postmaster;
diff --git a/src/bin/Makefile b/src/bin/Makefile
index 497f9ee..253119a 100644
--- a/src/bin/Makefile
+++ b/src/bin/Makefile
@@ -23,6 +23,7 @@ SUBDIRS = \
 	pg_dump \
 	pg_resetxlog \
 	pg_test_fsync \
+	pg_test_timing \
 	pg_xlogdump \
 	pgbench \
 	psql \
diff --git a/contrib/pg_test_timing/.gitignore b/src/bin/pg_test_timing/.gitignore
similarity index 100%
rename from contrib/pg_test_timing/.gitignore
rename to src/bin/pg_test_timing/.gitignore
diff --git a/src/bin/pg_test_timing/Makefile b/src/bin/pg_test_timing/Makefile
new file mode 100644
index 0000000..f96d2e9
--- /dev/null
+++ b/src/bin/pg_test_timing/Makefile
@@ -0,0 +1,14 @@
+# src/bin/pg_test_timing/Makefile
+
+PGFILEDESC = "pg_test_timing - test timing overhead"
+PGAPPICON = win32
+
+subdir = src/bin/pg_test_timing
+top_builddir = ../../..
+include $(top_builddir)/src/Makefile.global
+
+PROGRAM  = pg_test_timing
+OBJS = pg_test_timing.o $(WIN32RES)
+
+NO_PGXS = 1
+include $(top_srcdir)/src/makefiles/pgxs.mk
diff --git a/contrib/pg_test_timing/pg_test_timing.c b/src/bin/pg_test_timing/pg_test_timing.c
similarity index 100%
rename from contrib/pg_test_timing/pg_test_timing.c
rename to src/bin/pg_test_timing/pg_test_timing.c
-- 
2.3.2

