From a2297dd7a178912755f7135576d6e0ee79633e7c Mon Sep 17 00:00:00 2001 From: Jan Viljanen <527069+javian@users.noreply.github.com> Date: Mon, 27 Aug 2018 23:10:20 +0200 Subject: [PATCH 1/2] Fix #76403: MacOS compilation incorrectly linking to system libs --- acinclude.m4 | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/acinclude.m4 b/acinclude.m4 index 1deb50d2983c5..d0e66c8b63446 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -441,7 +441,11 @@ dnl dnl Adds a path to linkpath/runpath (LDFLAGS) dnl AC_DEFUN([PHP_ADD_LIBPATH],[ - if test "$1" != "/usr/$PHP_LIBDIR" && test "$1" != "/usr/lib"; then + case "$1" in + "/usr/$PHP_LIBDIR"|"/usr/lib"[)] ;; + /Library/Developer/CommandLineTools/SDKs/*/usr/lib[)] ;; + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/*/usr/lib[)] ;; + *[)] PHP_EXPAND_PATH($1, ai_p) ifelse([$2],,[ _PHP_ADD_LIBPATH_GLOBAL([$ai_p]) @@ -452,8 +456,8 @@ AC_DEFUN([PHP_ADD_LIBPATH],[ else _PHP_ADD_LIBPATH_GLOBAL([$ai_p]) fi - ]) - fi + ]) ;; + esac ]) dnl From 46edde22ebaf8110d5cc1c506d63e6382f46c872 Mon Sep 17 00:00:00 2001 From: Jan Viljanen <527069+javian@users.noreply.github.com> Date: Sun, 2 Sep 2018 22:52:17 +0200 Subject: [PATCH 2/2] Support for additional variations such as XCode-beta.app --- acinclude.m4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/acinclude.m4 b/acinclude.m4 index d0e66c8b63446..521934881dd3a 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -444,7 +444,7 @@ AC_DEFUN([PHP_ADD_LIBPATH],[ case "$1" in "/usr/$PHP_LIBDIR"|"/usr/lib"[)] ;; /Library/Developer/CommandLineTools/SDKs/*/usr/lib[)] ;; - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/*/usr/lib[)] ;; + /Applications/Xcode*.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/*/usr/lib[)] ;; *[)] PHP_EXPAND_PATH($1, ai_p) ifelse([$2],,[