Installing pg_stat_monitor extension on FreeBSD

Description:

Hello Team,

While trying to build from source code on FreeBSD, I am running into below compilation issues with pg_stat_monitor. Can you pls advise.

Followed the link here:

git clone git://github.com/percona/pg_stat_monitor.git
Cloning into ‘pg_stat_monitor’…
remote: Enumerating objects: 4682, done.
remote: Counting objects: 100% (645/645), done.
remote: Compressing objects: 100% (242/242), done.
remote: Total 4682 (delta 522), reused 434 (delta 384), pack-reused 4037
Receiving objects: 100% (4682/4682), 5.87 MiB | 4.02 MiB/s, done.
Resolving deltas: 100% (3083/3083), done.

cd pg_stat_monitor
make USE_PGXS=1
make USE_PGXS=1 install

make: “/opt/pg_stat_monitor/Makefile” line 23: Invalid line type
make: “/opt/pg_stat_monitor/Makefile” line 26: Could not find
make: “/opt/pg_stat_monitor/Makefile” line 27: Invalid line type
make: “/opt/pg_stat_monitor/Makefile” line 30: Could not find …/…/src/Makefile.global
make: “/opt/pg_stat_monitor/Makefile” line 31: Cannot open /contrib/contrib-global.mk
make: “/opt/pg_stat_monitor/Makefile” line 32: Invalid line type
make: Fatal errors encountered – cannot continue
make: stopped in /opt/pg_stat_monitor
make: “/opt/pg_stat_monitor/Makefile” line 23: Invalid line type
make: “/opt/pg_stat_monitor/Makefile” line 26: Could not find
make: “/opt/pg_stat_monitor/Makefile” line 27: Invalid line type
make: “/opt/pg_stat_monitor/Makefile” line 30: Could not find …/…/src/Makefile.global
make: “/opt/pg_stat_monitor/Makefile” line 31: Cannot open /contrib/contrib-global.mk
make: “/opt/pg_stat_monitor/Makefile” line 32: Invalid line type
make: Fatal errors encountered – cannot continue
make: stopped in /opt/pg_stat_monitor

postgres=# select version();
version

PostgreSQL 13.14 on amd64-portbld-freebsd13.2, compiled by clang version 15.0.7, 64-bit
(1 row)

which pg_config
/usr/local/bin/pg_config
LIBDIR = /usr/local/lib

Thanks!