Skip to content

Commit

Permalink
[Build-System] Fix build for m1 and m2 chips on macOS
Browse files Browse the repository at this point in the history
  • Loading branch information
seven1240 authored Jan 14, 2025
1 parent ca9430e commit b8a9c8b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
6 changes: 6 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -740,6 +740,8 @@ case "$host" in
APR_REMOVEFROM(SWITCH_AM_CFLAGS, -fPIC)
APR_ADDTO(CPPFLAGS, -I/usr/local/opt/openssl/include)
APR_ADDTO(LDFLAGS, -L/usr/local/opt/openssl/lib)
APR_ADDTO(CPPFLAGS, -I/opt/homebrew/include)
APR_ADDTO(LDFLAGS, -L/opt/homebrew/lib)
if test "x$enable_core_odbc_support" != "xno"; then
APR_ADDTO([PLATFORM_CORE_LDFLAGS], [--framework CoreFoundation])
fi
Expand Down Expand Up @@ -838,6 +840,8 @@ AM_CONDITIONAL([SYSTEM_APR],[test "${use_system_apr}" = "yes"])

save_LIBS="$LIBS"
LIBS=

AC_CHECK_HEADERS([jpeglib.h])
AC_CHECK_LIB(jpeg, jpeg_std_error,, AC_MSG_ERROR([no usable libjpeg; please install libjpeg devel package or equivalent]))

AC_CHECK_LIB(jbig, jbg_enc_out, have_libjbig=yes, have_libjbig=no)
Expand Down Expand Up @@ -1262,6 +1266,8 @@ case $host in
path_push_unique PKG_CONFIG_PATH /usr/local/opt/sqlite/lib/pkgconfig/
path_push_unique PKG_CONFIG_PATH /usr/local/opt/ldns/lib/pkgconfig/
path_push_unique PKG_CONFIG_PATH /usr/local/opt/ffmpeg/lib/pkgconfig/
path_push_unique PKG_CONFIG_PATH /opt/homebrew/lib/pkgconfig/
path_push_unique PKG_CONFIG_PATH /opt/homebrew/opt/sqlite/lib/pkgconfig/
;;
esac

Expand Down
8 changes: 6 additions & 2 deletions libs/libvpx/build/make/configure.sh
Original file line number Diff line number Diff line change
Expand Up @@ -767,6 +767,10 @@ process_common_toolchain() {

# detect tgt_os
case "$gcctarget" in
arm64-apple-darwin*)
tgt_isa=arm64
tgt_os=darwin
;;
*darwin*)
tgt_isa=x86_64
tgt_os=darwin
Expand Down Expand Up @@ -845,7 +849,7 @@ process_common_toolchain() {
# Handle darwin variants. Newer SDKs allow targeting older
# platforms, so use the newest one available.
case ${toolchain} in
arm*-darwin*)
DISABLE-arm*-darwin*)
add_cflags "-miphoneos-version-min=${IOS_VERSION_MIN}"
iphoneos_sdk_dir="$(show_darwin_sdk_path iphoneos)"
if [ -d "${iphoneos_sdk_dir}" ]; then
Expand Down Expand Up @@ -1046,7 +1050,7 @@ EOF
soft_enable unit_tests
;;

darwin*)
DISABLE-darwin*)
XCRUN_FIND="xcrun --sdk iphoneos --find"
CXX="$(${XCRUN_FIND} clang++)"
CC="$(${XCRUN_FIND} clang)"
Expand Down

0 comments on commit b8a9c8b

Please sign in to comment.