diff options
author | Andrew Dunstan | 2021-05-12 00:02:02 +0000 |
---|---|---|
committer | Andrew Dunstan | 2021-05-12 00:02:02 +0000 |
commit | 0bf62931cae0db1294937eb9190b183494af4cf8 (patch) | |
tree | d698865b845e7b4fe7e8b40f7e5b143d31c31fa3 | |
parent | 0b85fa93e4575183aa5a71ebe3c6bae8d97704ed (diff) |
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/[email protected]
-rw-r--r-- | src/backend/utils/Gen_dummy_probes.pl.prolog | 19 | ||||
-rw-r--r-- | src/backend/utils/Makefile | 8 | ||||
-rw-r--r-- | src/backend/utils/README.Gen_dummy_probes | 2 |
3 files changed, 25 insertions, 4 deletions
diff --git a/src/backend/utils/Gen_dummy_probes.pl.prolog b/src/backend/utils/Gen_dummy_probes.pl.prolog new file mode 100644 index 0000000000..1c8993377d --- /dev/null +++ b/src/backend/utils/Gen_dummy_probes.pl.prolog @@ -0,0 +1,19 @@ +#! /usr/bin/perl -w +#------------------------------------------------------------------------- +# +# Gen_dummy_probes.pl +# Perl script that generates probes.h file when dtrace is not available +# +# Portions Copyright (c) 2008-2021, PostgreSQL Global Development Group +# +# +# IDENTIFICATION +# src/backend/utils/Gen_dummy_probes.pl +# +# This program was generated by running perl's s2p over Gen_dummy_probes.sed +# +#------------------------------------------------------------------------- + +# turn off perlcritic for autogenerated code +## no critic + diff --git a/src/backend/utils/Makefile b/src/backend/utils/Makefile index bcf9dd41ad..ef8df25482 100644 --- a/src/backend/utils/Makefile +++ b/src/backend/utils/Makefile @@ -92,10 +92,10 @@ $(top_builddir)/src/include/utils/probes.h: probes.h # Nothing depends on it, so it will never be called unless explicitly requested # The last two lines of the recipe format the script according to our # standard and put back some blank lines for improved readability. -Gen_dummy_probes.pl: Gen_dummy_probes.sed - perl -ni -e ' print; exit if /^\$$0/;' $@ - s2p -f $< | sed -e 1,4d -e '/# #/d' -e '$$d' >> $@ - perltidy --profile=../../tools/pgindent/perltidyrc $@ +Gen_dummy_probes.pl: Gen_dummy_probes.sed Gen_dummy_probes.pl.prolog + cp $(srcdir)/Gen_dummy_probes.pl.prolog $@ + s2p -f $< | sed -e 1,3d -e '/# #/ d' -e '$$d' >> $@ + perltidy --profile=$(srcdir)/../../tools/pgindent/perltidyrc $@ perl -pi -e '!$$lb && ( /^\t+#/ || /^# prototypes/ ) && print qq{\n};'\ -e '$$lb = m/^\n/; ' $@ diff --git a/src/backend/utils/README.Gen_dummy_probes b/src/backend/utils/README.Gen_dummy_probes index 90fec37bce..e17060ef24 100644 --- a/src/backend/utils/README.Gen_dummy_probes +++ b/src/backend/utils/README.Gen_dummy_probes @@ -23,3 +23,5 @@ on Fedora it can be installed using `cpan App::s2p` or The Makefile contains a recipe for regenerating Gen_dummy_probes.pl, so all you need to do is once you have s2p installed is `make Gen_dummy_probes.pl` +Note that in a VPATH build this will generate the file in the vpath tree, +not the source tree. |