build+docs: support CentOS Stream 9, drop CentOS 8

Refs: #5181
Change-Id: I2d8bc595bad047ceaa78bd3729848491b843e83d
diff --git a/wscript b/wscript
index 2ddc5a5..61aa0ac 100644
--- a/wscript
+++ b/wscript
@@ -89,8 +89,13 @@
     conf.env.WITH_TESTS = conf.options.with_tests
     conf.env.WITH_OTHER_TESTS = conf.options.with_other_tests
 
-    conf.find_program('bash', var='BASH')
-    conf.find_program('dot', var='DOT', mandatory=False)
+    conf.find_program('bash')
+    conf.find_program('dot', mandatory=False)
+
+    # Prefer pkgconf if it's installed, because it gives more correct results
+    # on Fedora/CentOS/RHEL/etc. See https://bugzilla.redhat.com/show_bug.cgi?id=1953348
+    # Store the result in env.PKGCONFIG, which is the variable used inside check_cfg()
+    conf.find_program(['pkgconf', 'pkg-config'], var='PKGCONFIG')
 
     pkg_config_path = os.environ.get('PKG_CONFIG_PATH', f'{conf.env.LIBDIR}/pkgconfig')
     conf.check_cfg(package='libndn-cxx', args=['libndn-cxx >= 0.8.0', '--cflags', '--libs'],