Commit bbf07fb1 authored by Chun-wei Fan's avatar Chun-wei Fan

Visual Studio builds: Fix .pc generation

The previous update did not account for when no exec_prefix is spcified,
so update that, and use ${prefix} by default.  Clean up a bit as well.
parent 35b401c8
......@@ -50,9 +50,13 @@ class BasePCItems:
if not os.path.exists(args.prefix):
raise SystemExit('Specified prefix \'%s\' is invalid' % args.prefix)
# use absolute paths for prefix
self.prefix = os.path.abspath(args.prefix).replace('\\','/')
# check and setup the exec_prefix
if getattr(args, 'exec_prefix', None) is None:
input_exec_prefix = args.prefix
exec_prefix_use_shorthand = True
self.exec_prefix = '${prefix}'
else:
if args.exec_prefix.startswith('${prefix}'):
exec_prefix_use_shorthand = True
......@@ -112,13 +116,6 @@ class BasePCItems:
else:
self.libdir = os.path.abspath(input_libdir).replace('\\','/')
# use absolute paths for prefix and exec_prefix
self.prefix = os.path.abspath(args.prefix).replace('\\','/')
if exec_prefix_use_shorthand is True:
self.exec_prefix = args.exec_prefix.replace('\\','/')
else:
self.exec_prefix = os.path.abspath(input_exec_prefix).replace('\\','/')
# setup dictionary for replacing items in *.pc.in
self.base_replace_items.update({'@VERSION@': self.version})
self.base_replace_items.update({'@prefix@': self.prefix})
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment