Skip to content

Commit

Permalink
Pass --host to autoconf, it does not use ARCHFLAGS
Browse files Browse the repository at this point in the history
Otherwise we get the wrong architecture for MacOS builds
  • Loading branch information
jlaine committed Feb 10, 2022
1 parent 3200051 commit d2d8d90
Showing 1 changed file with 15 additions and 7 deletions.
22 changes: 15 additions & 7 deletions scripts/build-codecs.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,18 @@ def run(cmd):
if not os.path.exists(output_tarball):
os.chdir(build_dir)

prepend_env("CPPFLAGS", "-I" + os.path.join(dest_dir, "include"))
prepend_env("LDFLAGS", "-L" + os.path.join(dest_dir, "lib"))
prepend_env("PATH", os.path.join(dest_dir, "bin"), separator=":")
prepend_env(
"PKG_CONFIG_PATH", os.path.join(dest_dir, "lib", "pkgconfig"), separator=":"
)
if platform.system() == "Darwin" and os.environ.get("ARCHFLAGS") == "-arch arm64":
opus_configure_args = [
"--build",
"x86_64-apple-darwin20.6.0",
"--host",
"amd64-apple-darwin20.6.0",
]
vpx_configure_args = ["--target=arm64-darwin20-gcc"]
else:
opus_configure_args = []
vpx_configure_args = []

#### BUILD TOOLS ####

Expand All @@ -121,7 +127,8 @@ def run(cmd):
"--disable-shared",
"--enable-static",
"--with-pic",
],
]
+ opus_configure_args,
)

# build vpx
Expand All @@ -133,7 +140,8 @@ def run(cmd):
"--disable-tools",
"--disable-unit-tests",
"--enable-pic",
],
]
+ vpx_configure_args,
)

run(["tar", "czvf", output_tarball, "-C", dest_dir, "include", "lib"])

0 comments on commit d2d8d90

Please sign in to comment.