Skip to content

Commit 0bf6293

Browse files
committed
Tweak generation of Gen_dummy_probes.pl
Use a static prolog file instead of generating the prolog from the existing perl script. Also, support generation of the file in a vpath build. Discussion: https://postgr.es/m/700620.1620662868@sss.pgh.pa.us
1 parent 0b85fa9 commit 0bf6293

File tree

3 files changed

+25
-4
lines changed

3 files changed

+25
-4
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#! /usr/bin/perl -w
2+
#-------------------------------------------------------------------------
3+
#
4+
# Gen_dummy_probes.pl
5+
# Perl script that generates probes.h file when dtrace is not available
6+
#
7+
# Portions Copyright (c) 2008-2021, PostgreSQL Global Development Group
8+
#
9+
#
10+
# IDENTIFICATION
11+
# src/backend/utils/Gen_dummy_probes.pl
12+
#
13+
# This program was generated by running perl's s2p over Gen_dummy_probes.sed
14+
#
15+
#-------------------------------------------------------------------------
16+
17+
# turn off perlcritic for autogenerated code
18+
## no critic
19+

src/backend/utils/Makefile

+4-4
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,10 @@ $(top_builddir)/src/include/utils/probes.h: probes.h
9292
# Nothing depends on it, so it will never be called unless explicitly requested
9393
# The last two lines of the recipe format the script according to our
9494
# standard and put back some blank lines for improved readability.
95-
Gen_dummy_probes.pl: Gen_dummy_probes.sed
96-
perl -ni -e ' print; exit if /^\$$0/;' $@
97-
s2p -f $< | sed -e 1,4d -e '/# #/d' -e '$$d' >> $@
98-
perltidy --profile=../../tools/pgindent/perltidyrc $@
95+
Gen_dummy_probes.pl: Gen_dummy_probes.sed Gen_dummy_probes.pl.prolog
96+
cp $(srcdir)/Gen_dummy_probes.pl.prolog $@
97+
s2p -f $< | sed -e 1,3d -e '/# #/ d' -e '$$d' >> $@
98+
perltidy --profile=$(srcdir)/../../tools/pgindent/perltidyrc $@
9999
perl -pi -e '!$$lb && ( /^\t+#/ || /^# prototypes/ ) && print qq{\n};'\
100100
-e '$$lb = m/^\n/; ' $@
101101

src/backend/utils/README.Gen_dummy_probes

+2
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,5 @@ on Fedora it can be installed using `cpan App::s2p` or
2323

2424
The Makefile contains a recipe for regenerating Gen_dummy_probes.pl, so all
2525
you need to do is once you have s2p installed is `make Gen_dummy_probes.pl`
26+
Note that in a VPATH build this will generate the file in the vpath tree,
27+
not the source tree.

0 commit comments

Comments
 (0)