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.
This commit is contained in:
Chun-wei Fan 2016-06-20 10:50:39 +08:00
parent 35b401c8bb
commit bbf07fb15e

View File

@ -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})