Move pgbench from contrib/ to src/bin/
authorPeter Eisentraut <[email protected]>
Wed, 11 Mar 2015 02:33:24 +0000 (22:33 -0400)
committerPeter Eisentraut <[email protected]>
Mon, 13 Apr 2015 17:07:16 +0000 (13:07 -0400)
Reviewed-by: Michael Paquier <[email protected]>
15 files changed:
contrib/Makefile
contrib/pgbench/Makefile [deleted file]
doc/src/sgml/contrib.sgml
doc/src/sgml/filelist.sgml
doc/src/sgml/ref/allfiles.sgml
doc/src/sgml/ref/pgbench.sgml [moved from doc/src/sgml/pgbench.sgml with 99% similarity]
doc/src/sgml/reference.sgml
src/bin/Makefile
src/bin/pgbench/.gitignore [moved from contrib/pgbench/.gitignore with 100% similarity]
src/bin/pgbench/Makefile [new file with mode: 0644]
src/bin/pgbench/exprparse.y [moved from contrib/pgbench/exprparse.y with 100% similarity]
src/bin/pgbench/exprscan.l [moved from contrib/pgbench/exprscan.l with 100% similarity]
src/bin/pgbench/pgbench.c [moved from contrib/pgbench/pgbench.c with 99% similarity]
src/bin/pgbench/pgbench.h [moved from contrib/pgbench/pgbench.h with 100% similarity]
src/tools/msvc/Mkvcbuild.pm

index c56050eecc37a0d9a19c47f5f425c32300105aea..d63e441cb59db34ca4a10a7b524dac06f9003ba4 100644 (file)
@@ -38,7 +38,6 @@ SUBDIRS = \
                pg_trgm         \
                pg_upgrade      \
                pg_upgrade_support \
-               pgbench         \
                pgcrypto        \
                pgrowlocks      \
                pgstattuple     \
diff --git a/contrib/pgbench/Makefile b/contrib/pgbench/Makefile
deleted file mode 100644 (file)
index a18130b..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-# contrib/pgbench/Makefile
-
-PGFILEDESC = "pgbench - a simple program for running benchmark tests"
-PGAPPICON = win32
-
-PROGRAM = pgbench
-OBJS   = pgbench.o exprparse.o $(WIN32RES)
-
-PG_CPPFLAGS = -I$(libpq_srcdir)
-PG_LIBS = $(libpq_pgport) $(PTHREAD_LIBS)
-
-ifdef USE_PGXS
-PG_CONFIG = pg_config
-PGXS := $(shell $(PG_CONFIG) --pgxs)
-include $(PGXS)
-else
-subdir = contrib/pgbench
-top_builddir = ../..
-include $(top_builddir)/src/Makefile.global
-include $(top_srcdir)/contrib/contrib-global.mk
-
-distprep: exprparse.c exprscan.c
-endif
-
-ifneq ($(PORTNAME), win32)
-override CFLAGS += $(PTHREAD_CFLAGS)
-endif
-
-# exprscan is compiled as part of exprparse
-exprparse.o: exprscan.c
-
-maintainer-clean:
-       rm -f exprparse.c exprscan.c
index f21fa1491825947b73dd4e25950d8c8412696eba..57730955bfaa859b3241467425c8c24ef32ef5de 100644 (file)
@@ -187,7 +187,6 @@ pages.
   </para>
 
  &oid2name;
- &pgbench;
  &vacuumlo;
  </sect1>
 
index 8b9d6a9127966cfe5e19d14a26c62066a67cb61f..ab935a6664f98cf5c4b61f4555e17ab5ce76032a 100644 (file)
 <!ENTITY oid2name        SYSTEM "oid2name.sgml">
 <!ENTITY pageinspect     SYSTEM "pageinspect.sgml">
 <!ENTITY passwordcheck   SYSTEM "passwordcheck.sgml">
-<!ENTITY pgbench         SYSTEM "pgbench.sgml">
 <!ENTITY pgbuffercache   SYSTEM "pgbuffercache.sgml">
 <!ENTITY pgcrypto        SYSTEM "pgcrypto.sgml">
 <!ENTITY pgfreespacemap  SYSTEM "pgfreespacemap.sgml">
index f3b577119bd6d9699251c47a47164c11a0f6f69d..9ae6aecb1a176f2f3871de98733d2c9e88133d17 100644 (file)
@@ -181,6 +181,7 @@ Complete list of usable sgml source files in this directory.
 <!ENTITY initdb             SYSTEM "initdb.sgml">
 <!ENTITY pgarchivecleanup   SYSTEM "pgarchivecleanup.sgml">
 <!ENTITY pgBasebackup       SYSTEM "pg_basebackup.sgml">
+<!ENTITY pgbench            SYSTEM "pgbench.sgml">
 <!ENTITY pgConfig           SYSTEM "pg_config-ref.sgml">
 <!ENTITY pgControldata      SYSTEM "pg_controldata.sgml">
 <!ENTITY pgCtl              SYSTEM "pg_ctl-ref.sgml">
similarity index 99%
rename from doc/src/sgml/pgbench.sgml
rename to doc/src/sgml/ref/pgbench.sgml
index ed12e279064c4dcd4cf9f58ba94a79ed27120fbb..a8085463a5e33c906c2d645e55db6edd14314a28 100644 (file)
@@ -1,4 +1,4 @@
-<!-- doc/src/sgml/pgbench.sgml -->
+<!-- doc/src/sgml/ref/pgbench.sgml -->
 
 <refentry id="pgbench">
  <indexterm zone="pgbench">
index 9fb32f8c284ac75e19d48d486ae4956a1f9882d3..c1765ef1c5ec310b9dd23f7a4425ed6ef70447c5 100644 (file)
    &dropuser;
    &ecpgRef;
    &pgBasebackup;
+   &pgbench;
    &pgConfig;
    &pgDump;
    &pgDumpall;
index 69cc2b83c1bbf04cecc45aa5b39622c1ea84231a..bb77142cab819c2fe6884bc539b6df0335e1b250 100644 (file)
@@ -23,6 +23,7 @@ SUBDIRS = \
        pg_dump \
        pg_resetxlog \
        pg_rewind \
+       pgbench \
        psql \
        scripts
 
diff --git a/src/bin/pgbench/Makefile b/src/bin/pgbench/Makefile
new file mode 100644 (file)
index 0000000..18fdf58
--- /dev/null
@@ -0,0 +1,42 @@
+# src/bin/pgbench/Makefile
+
+PGFILEDESC = "pgbench - a simple program for running benchmark tests"
+PGAPPICON = win32
+
+subdir = src/bin/pgbench
+top_builddir = ../../..
+include $(top_builddir)/src/Makefile.global
+
+OBJS = pgbench.o exprparse.o $(WIN32RES)
+
+override CPPFLAGS := -I. -I$(srcdir) -I$(libpq_srcdir) $(CPPFLAGS)
+
+ifneq ($(PORTNAME), win32)
+override CFLAGS += $(PTHREAD_CFLAGS)
+endif
+
+
+all: pgbench
+
+pgbench: $(OBJS) | submake-libpq submake-libpgport
+       $(CC) $(CFLAGS) $^ $(libpq_pgport) $(PTHREAD_LIBS) $(LDFLAGS) $(LDFLAGS_EX) $(LIBS) -o $@$(X)
+
+# exprscan is compiled as part of exprparse
+exprparse.o: exprscan.c
+
+distprep: exprparse.c exprscan.c
+
+install: all installdirs
+       $(INSTALL_PROGRAM) pgbench$(X) '$(DESTDIR)$(bindir)/pgbench$(X)'
+
+installdirs:
+       $(MKDIR_P) '$(DESTDIR)$(bindir)'
+
+uninstall:
+       rm -f '$(DESTDIR)$(bindir)/pgbench$(X)'
+
+clean distclean:
+       rm -f pgbench$(X) $(OBJS)
+
+maintainer-clean: distclean
+       rm -f exprparse.c exprscan.c
similarity index 99%
rename from contrib/pgbench/pgbench.c
rename to src/bin/pgbench/pgbench.c
index 788484e8793eb30602d88bb6c8caa963aabf626a..06a4dfd9a8c7c98b7fb3565381680dca88474bcd 100644 (file)
@@ -4,7 +4,7 @@
  * A simple benchmark program for PostgreSQL
  * Originally written by Tatsuo Ishii and enhanced by many contributors.
  *
- * contrib/pgbench/pgbench.c
+ * src/bin/pgbench/pgbench.c
  * Copyright (c) 2000-2015, PostgreSQL Global Development Group
  * ALL RIGHTS RESERVED;
  *
index ef0833497361569ffd9cfb7b6bb2b5927bffe674..8993efaa19254f0cb1e3e7f69704873510eaba9d 100644 (file)
@@ -31,42 +31,45 @@ my $libpq;
 # Set of variables for contrib modules
 my $contrib_defines = { 'refint' => 'REFINT_VERBOSE' };
 my @contrib_uselibpq =
-  ('dblink', 'oid2name', 'pgbench', 'pg_upgrade', 'postgres_fdw', 'vacuumlo');
+  ('dblink', 'oid2name', 'pg_upgrade', 'postgres_fdw', 'vacuumlo');
 my @contrib_uselibpgport = (
-       'oid2name',      'pgbench',
+       'oid2name',
        'pg_standby',
        'pg_test_fsync', 'pg_test_timing',
        'pg_upgrade',    'pg_xlogdump',
        'vacuumlo');
 my @contrib_uselibpgcommon = (
-       'oid2name',      'pgbench',
+       'oid2name',
        'pg_standby',
        'pg_test_fsync', 'pg_test_timing',
        'pg_upgrade',    'pg_xlogdump',
        'vacuumlo');
-my $contrib_extralibs = { 'pgbench' => ['ws2_32.lib'] };
+my $contrib_extralibs = undef;
 my $contrib_extraincludes =
   { 'tsearch2' => ['contrib/tsearch2'], 'dblink' => ['src/backend'] };
 my $contrib_extrasource = {
        'cube' => [ 'contrib\cube\cubescan.l', 'contrib\cube\cubeparse.y' ],
-       'pgbench' =>
-         [ 'contrib\pgbench\exprscan.l', 'contrib\pgbench\exprparse.y' ],
        'seg' => [ 'contrib\seg\segscan.l', 'contrib\seg\segparse.y' ], };
 my @contrib_excludes = ('pgcrypto', 'intagg', 'sepgsql');
 
 # Set of variables for frontend modules
 my $frontend_defines = { 'initdb' => 'FRONTEND' };
-my @frontend_uselibpq = ('pg_ctl', 'psql');
-my @frontend_uselibpgport = ( 'pg_archivecleanup' );
-my @frontend_uselibpgcommon = ( 'pg_archivecleanup' );
+my @frontend_uselibpq = ('pg_ctl', 'pgbench', 'psql');
+my @frontend_uselibpgport = ( 'pg_archivecleanup', 'pgbench' );
+my @frontend_uselibpgcommon = ( 'pg_archivecleanup', 'pgbench' );
 my $frontend_extralibs = {
        'initdb'     => ['ws2_32.lib'],
        'pg_restore' => ['ws2_32.lib'],
+       'pgbench'    => ['ws2_32.lib'],
        'psql'       => ['ws2_32.lib'] };
 my $frontend_extraincludes = {
        'initdb' => ['src\timezone'],
        'psql'   => [ 'src\bin\pg_dump', 'src\backend' ] };
-my $frontend_extrasource = { 'psql' => ['src\bin\psql\psqlscan.l'] };
+my $frontend_extrasource = {
+       'psql' => ['src\bin\psql\psqlscan.l'],
+       'pgbench' =>
+               [ 'contrib\pgbench\exprscan.l', 'contrib\pgbench\exprparse.y' ],
+};
 my @frontend_excludes =
   ('pgevent', 'pg_basebackup', 'pg_rewind', 'pg_dump', 'scripts');