Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add prefix flag config option to make_configure #973

Merged
merged 2 commits into from
Nov 3, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion foreign_cc/configure.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ def _create_configure_script(configureParameters):
inputs = inputs,
env_vars = user_env,
configure_in_place = ctx.attr.configure_in_place,
prefix_flag = ctx.attr.prefix_flag,
autoconf = ctx.attr.autoconf,
autoconf_options = ctx.attr.autoconf_options,
autoreconf = ctx.attr.autoreconf,
Expand Down Expand Up @@ -194,10 +195,17 @@ def _attrs():
"install_prefix": attr.string(
doc = (
"Install prefix, i.e. relative path to where to install the result of the build. " +
"Passed to the 'configure' script with --prefix flag."
"Passed to the 'configure' script with the flag specified by prefix_flag."
),
mandatory = False,
),
"prefix_flag": attr.string(
doc = (
"The flag to specify the install directory prefix with."
),
mandatory = False,
default = "--prefix=",
),
"targets": attr.string_list(
doc = (
"A list of targets within the foreign build system to produce. An empty string (`\"\"`) will result in " +
Expand Down
4 changes: 3 additions & 1 deletion foreign_cc/private/configure_script.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ def create_configure_script(
inputs,
env_vars,
configure_in_place,
prefix_flag,
autoconf,
autoconf_options,
autoreconf,
Expand Down Expand Up @@ -70,10 +71,11 @@ def create_configure_script(
).lstrip())

script.append("##mkdirs## $$BUILD_TMPDIR$$/$$INSTALL_PREFIX$$")
script.append("{env_vars} {prefix}\"{configure}\" --prefix=$$BUILD_TMPDIR$$/$$INSTALL_PREFIX$$ {user_options}".format(
script.append("{env_vars} {prefix}\"{configure}\" {prefix_flag}$$BUILD_TMPDIR$$/$$INSTALL_PREFIX$$ {user_options}".format(
env_vars = get_make_env_vars(workspace_name, tools, flags, env_vars, deps, inputs),
prefix = configure_prefix,
configure = configure_path,
prefix_flag = prefix_flag,
user_options = " ".join(user_options),
))

Expand Down