Move pgbench from contrib/ to src/bin/

Reviewed-by: Michael Paquier <michael.paquier@gmail.com>
This commit is contained in:
Peter Eisentraut 2015-03-10 22:33:24 -04:00
parent b22a36a62c
commit 81134af3ec
15 changed files with 60 additions and 48 deletions

View File

@ -38,7 +38,6 @@ SUBDIRS = \
pg_trgm \
pg_upgrade \
pg_upgrade_support \
pgbench \
pgcrypto \
pgrowlocks \
pgstattuple \

View File

@ -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

View File

@ -187,7 +187,6 @@ pages.
</para>
&oid2name;
&pgbench;
&vacuumlo;
</sect1>

View File

@ -125,7 +125,6 @@
<!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">

View 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">

View File

@ -1,4 +1,4 @@
<!-- doc/src/sgml/pgbench.sgml -->
<!-- doc/src/sgml/ref/pgbench.sgml -->
<refentry id="pgbench">
<indexterm zone="pgbench">

View File

@ -230,6 +230,7 @@
&dropuser;
&ecpgRef;
&pgBasebackup;
&pgbench;
&pgConfig;
&pgDump;
&pgDumpall;

View File

@ -23,6 +23,7 @@ SUBDIRS = \
pg_dump \
pg_resetxlog \
pg_rewind \
pgbench \
psql \
scripts

42
src/bin/pgbench/Makefile Normal file
View File

@ -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

View 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;
*

View 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');