From b14e866b278252a2b9845036febc9819ad4b6c2b Mon Sep 17 00:00:00 2001 From: Phil Burk Date: Wed, 24 Feb 2021 18:09:57 -0800 Subject: [PATCH] configure: better test for Mac OS arch Use AC_COMPILE_IFELSE because AC_TRY_COMPILE is deprecated. Include cdefs.h because it has checks for architcture. --- configure | Bin 575026 -> 575139 bytes configure.in | 14 ++++++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/configure b/configure index 42d22a02fc63476e5c34f013cc70cbad2667c288..2a59e10a8bf8ad7f6ba86ecf0481d0c5fde34f77 100755 GIT binary patch delta 216 zcmdngqrA9RxnT=quXcTaqpzcLe28msNPIw$zk86QudNc7f`Y!5LUKxKTCrY+LUKlG za(1yoT7Hp2acMz8eo;wkib7&hazGp|G;H!(9$LsOv|$OVC-RG`j01p{_#pg=8`QhT>HBM>tIF*6Xe05K~Nvu*Fz gW>-}dR>5@UbU|BYiOCK}CEK}u*|&51a;R4V08Mp56aWAK delta 72 zcmZ47tGua4xnT=quXekr4kHjV0WmWWvj8zG5VLI;)nQjwoUX8*k$-wWA3Hmv!Ssvi V>{^rUk4m-I__A-W@#Rpj1OW5!6vF@j diff --git a/configure.in b/configure.in index 1727df7..bb4ae96 100644 --- a/configure.in +++ b/configure.in @@ -11,6 +11,15 @@ dnl Init autoconf and make sure configure is being called dnl from the right directory AC_INIT([include/portaudio.h]) +dnl This is is for testing compilation on Mac OS +PAMAC_TEST_PROGRAM=" + /* cdefs.h checks for supported architectures. */ + #include + int main() { + return 0; + } +" + dnl Define build, build_cpu, build_vendor, build_os AC_CANONICAL_BUILD dnl Define host, host_cpu, host_vendor, host_os @@ -244,13 +253,14 @@ case "${host_os}" in esac dnl Pick which architectures to build for based on what - dnl the compiler supports. + dnl the compiler and SDK supports. mac_arches="" for arch in x86_64 arm64 do save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -arch $arch" - AC_TRY_COMPILE([], [return 0;], + AC_COMPILE_IFELSE( + [AC_LANG_SOURCE([$PAMAC_TEST_PROGRAM])], [ if [[ -z "$mac_arches" ]] ; then mac_arches="-arch $arch" -- 2.43.0