build: fix gmp detection on macos when building with no depends (#5394)

## Issue being fixed or feature implemented
gmp can't be detected on macos when installed via `brew` atm

## What was done?
detect package prefix and adjust CPPFLAGS and LDFLAGS accordingly


## How Has This Been Tested?
`./configure`

before: `configure: error: libgmp headers missing`
after: passes

## Breaking Changes
n/a

## Checklist:
- [x] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have added or updated relevant unit/integration/functional/e2e
tests
- [ ] I have made corresponding changes to the documentation
- [x] I have assigned this pull request to a milestone _(for repository
code-owners and collaborators only)_
This commit is contained in:
UdjinM6 2023-05-26 21:41:15 +03:00 committed by GitHub
parent 28469842d0
commit ae0da14174
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -715,6 +715,12 @@ case $host in
export PKG_CONFIG_PATH
fi
gmp_prefix=$($BREW --prefix gmp 2>/dev/null)
if test x$gmp_prefix != x; then
CPPFLAGS="$CPPFLAGS -I$gmp_prefix/include"
LDFLAGS="$LDFLAGS -L$gmp_prefix/lib"
fi
case $host in
*aarch64*)
dnl The preferred Homebrew prefix for Apple Silicon is /opt/homebrew.