Skip to content

Commit

Permalink
Expand locations and make variables in configure options (#1102)
Browse files Browse the repository at this point in the history
  • Loading branch information
jsharpe authored Oct 14, 2023
1 parent e3003dd commit ef3031e
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 10 deletions.
4 changes: 2 additions & 2 deletions examples/third_party/apr_util/BUILD.apr_util.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ configure_make(
name = "apr_util",
configure_in_place = True,
configure_options = [
"--with-apr=$EXT_BUILD_DEPS/apr",
"--with-expat=$EXT_BUILD_DEPS/expat",
"--with-apr=$$EXT_BUILD_DEPS/apr",
"--with-expat=$$EXT_BUILD_DEPS/expat",
],
env = select({
"@platforms//os:macos": {"AR": ""},
Expand Down
4 changes: 2 additions & 2 deletions examples/third_party/log4cxx/BUILD.log4cxx.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ configure_make(
name = "log4cxx",
configure_options = [
"--disable-shared",
"--with-apr=$EXT_BUILD_DEPS/apr",
"--with-apr-util=$EXT_BUILD_DEPS/apr_util",
"--with-apr=$$EXT_BUILD_DEPS/apr",
"--with-apr-util=$$EXT_BUILD_DEPS/apr_util",
],
env = select({
"@platforms//os:macos": {
Expand Down
4 changes: 2 additions & 2 deletions examples/third_party/python/BUILD.python3.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ configure_make(
name = "python3",
configure_options = [
"CFLAGS='-Dredacted=\"redacted\"'",
"--with-openssl=$EXT_BUILD_DEPS/openssl",
"--with-zlib=$EXT_BUILD_DEPS/zlib",
"--with-openssl=$$EXT_BUILD_DEPS/openssl",
"--with-zlib=$$EXT_BUILD_DEPS/zlib",
"--enable-optimizations",
],
env = select({
Expand Down
6 changes: 3 additions & 3 deletions examples/third_party/subversion/BUILD.subversion.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ configure_make(
configure_options = [
"--enable-all-static",
"--without-boost",
"--with-apr=$EXT_BUILD_DEPS/apr",
"--with-apr-util=$EXT_BUILD_DEPS/apr_util",
"--with-zlib=$EXT_BUILD_DEPS/zlib",
"--with-apr=$$EXT_BUILD_DEPS/apr",
"--with-apr-util=$$EXT_BUILD_DEPS/apr_util",
"--with-zlib=$$EXT_BUILD_DEPS/zlib",
"--with-lz4=internal",
"--with-utf8proc=internal",
"--enable-optimize",
Expand Down
3 changes: 2 additions & 1 deletion foreign_cc/configure.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ def _create_configure_script(configureParameters):
make_commands = []
prefix = "{} ".format(expand_locations_and_make_variables(ctx, attrs.tool_prefix, "tool_prefix", data)) if attrs.tool_prefix else ""
configure_prefix = "{} ".format(expand_locations_and_make_variables(ctx, ctx.attr.configure_prefix, "configure_prefix", data)) if ctx.attr.configure_prefix else ""
configure_options = [expand_locations_and_make_variables(ctx, option, "configure_option", data) for option in ctx.attr.configure_options] if ctx.attr.configure_options else []

for target in ctx.attr.targets:
# Configure will have generated sources into `$BUILD_TMPDIR` so make sure we `cd` there
Expand All @@ -91,7 +92,7 @@ def _create_configure_script(configureParameters):
tools = tools,
flags = flags,
root = detect_root(ctx.attr.lib_source),
user_options = ctx.attr.configure_options,
user_options = configure_options,
configure_prefix = configure_prefix,
configure_command = ctx.attr.configure_command,
deps = ctx.attr.deps,
Expand Down

0 comments on commit ef3031e

Please sign in to comment.