File gyp-rpmoptflags.patch of Package gyp
---
pylib/gyp/generator/make.py | 13 +++++++++++++
1 file changed, 13 insertions(+)
Index: pylib/gyp/generator/make.py
===================================================================
--- pylib/gyp/generator/make.py.orig 2025-05-15 13:27:57.801201776 +0000
+++ pylib/gyp/generator/make.py 2025-05-15 13:28:02.430658517 +0000
@@ -1208,6 +1208,7 @@
# Write configuration-specific variables for CFLAGS, etc.
for configname in sorted(configs.keys()):
config = configs[configname]
+ rpmoptflags = ['$(RPM_OPT_FLAGS)']
self.WriteList(config.get('defines'), 'DEFS_%s' % configname, prefix='-D',
quoter=EscapeCppDefine)
@@ -1219,8 +1220,20 @@
cflags_objcc = self.xcode_settings.GetCflagsObjCC(configname)
else:
cflags = config.get('cflags')
+ if cflags:
+ cflags += rpmoptflags
+ else:
+ cflags = rpmoptflags
cflags_c = config.get('cflags_c')
+ if cflags_c:
+ cflags_c += rpmoptflags
+ else:
+ cflags_c = rpmoptflags
cflags_cc = config.get('cflags_cc')
+ if cflags_cc:
+ cflags_cc += rpmoptflags
+ else:
+ cflags_cc = rpmoptflags
self.WriteLn("# Flags passed to all source files.");
self.WriteList(cflags, 'CFLAGS_%s' % configname)