Welcome! Log In Create A New Profile

Advanced

Re: [PATCH] Configure: add support for Homebrew on Apple Silicon

Roman Arutyunyan
March 06, 2024 07:58AM
Hi Piotr,

On Wed, Feb 28, 2024 at 01:24:26AM +0000, Piotr Sikora via nginx-devel wrote:
> # HG changeset patch
> # User Piotr Sikora <piotr@aviatrix.com>
> # Date 1708977643 0
> # Mon Feb 26 20:00:43 2024 +0000
> # Branch patch017
> # Node ID dd95daa55cf6131a7e845edd6ad3b429bcef6f98
> # Parent bb99cbe3a343ae581d2369b990aee66e69679ca2
> Configure: add support for Homebrew on Apple Silicon.
>
> Signed-off-by: Piotr Sikora <piotr@aviatrix.com>
>
> diff -r bb99cbe3a343 -r dd95daa55cf6 auto/lib/geoip/conf
> --- a/auto/lib/geoip/conf Mon Feb 26 20:00:42 2024 +0000
> +++ b/auto/lib/geoip/conf Mon Feb 26 20:00:43 2024 +0000
> @@ -64,6 +64,23 @@
> fi
>
>
> +if [ $ngx_found = no ]; then
> +
> + # Homebrew on Apple Silicon
> +
> + ngx_feature="GeoIP library in /opt/homebrew/"
> + ngx_feature_path="/opt/homebrew/include"
> +
> + if [ $NGX_RPATH = YES ]; then
> + ngx_feature_libs="-R/opt/homebrew/lib -L/opt/homebrew/lib -lGeoIP"
> + else
> + ngx_feature_libs="-L/opt/homebrew/lib -lGeoIP"
> + fi
> +
> + . auto/feature
> +fi
> +
> +
> if [ $ngx_found = yes ]; then
>
> CORE_INCS="$CORE_INCS $ngx_feature_path"
> diff -r bb99cbe3a343 -r dd95daa55cf6 auto/lib/google-perftools/conf
> --- a/auto/lib/google-perftools/conf Mon Feb 26 20:00:42 2024 +0000
> +++ b/auto/lib/google-perftools/conf Mon Feb 26 20:00:43 2024 +0000
> @@ -46,6 +46,22 @@
> fi
>
>
> +if [ $ngx_found = no ]; then
> +
> + # Homebrew on Apple Silicon
> +
> + ngx_feature="Google perftools in /opt/homebrew/"
> +
> + if [ $NGX_RPATH = YES ]; then
> + ngx_feature_libs="-R/opt/homebrew/lib -L/opt/homebrew/lib -lprofiler"
> + else
> + ngx_feature_libs="-L/opt/homebrew/lib -lprofiler"
> + fi
> +
> + . auto/feature
> +fi
> +
> +
> if [ $ngx_found = yes ]; then
> CORE_LIBS="$CORE_LIBS $ngx_feature_libs"
>
> diff -r bb99cbe3a343 -r dd95daa55cf6 auto/lib/libgd/conf
> --- a/auto/lib/libgd/conf Mon Feb 26 20:00:42 2024 +0000
> +++ b/auto/lib/libgd/conf Mon Feb 26 20:00:43 2024 +0000
> @@ -65,6 +65,23 @@
> fi
>
>
> +if [ $ngx_found = no ]; then
> +
> + # Homebrew on Apple Silicon
> +
> + ngx_feature="GD library in /opt/homebrew/"
> + ngx_feature_path="/opt/homebrew/include"
> +
> + if [ $NGX_RPATH = YES ]; then
> + ngx_feature_libs="-R/opt/homebrew/lib -L/opt/homebrew/lib -lgd"
> + else
> + ngx_feature_libs="-L/opt/homebrew/lib -lgd"
> + fi
> +
> + . auto/feature
> +fi
> +
> +
> if [ $ngx_found = yes ]; then
>
> CORE_INCS="$CORE_INCS $ngx_feature_path"
> diff -r bb99cbe3a343 -r dd95daa55cf6 auto/lib/openssl/conf
> --- a/auto/lib/openssl/conf Mon Feb 26 20:00:42 2024 +0000
> +++ b/auto/lib/openssl/conf Mon Feb 26 20:00:43 2024 +0000
> @@ -122,6 +122,24 @@
> . auto/feature
> fi
>
> + if [ $ngx_found = no ]; then
> +
> + # Homebrew on Apple Silicon
> +
> + ngx_feature="OpenSSL library in /opt/homebrew/"
> + ngx_feature_path="/opt/homebrew/include"
> +
> + if [ $NGX_RPATH = YES ]; then
> + ngx_feature_libs="-R/opt/homebrew/lib -L/opt/homebrew/lib -lssl -lcrypto"
> + else
> + ngx_feature_libs="-L/opt/homebrew/lib -lssl -lcrypto"
> + fi
> +
> + ngx_feature_libs="$ngx_feature_libs $NGX_LIBDL $NGX_LIBPTHREAD"
> +
> + . auto/feature
> + fi
> +
> if [ $ngx_found = yes ]; then
> have=NGX_SSL . auto/have
> CORE_INCS="$CORE_INCS $ngx_feature_path"
> diff -r bb99cbe3a343 -r dd95daa55cf6 auto/lib/pcre/conf
> --- a/auto/lib/pcre/conf Mon Feb 26 20:00:42 2024 +0000
> +++ b/auto/lib/pcre/conf Mon Feb 26 20:00:43 2024 +0000
> @@ -182,6 +182,22 @@
> . auto/feature
> fi
>
> + if [ $ngx_found = no ]; then
> +
> + # Homebrew on Apple Silicon
> +
> + ngx_feature="PCRE library in /opt/homebrew/"
> + ngx_feature_path="/opt/homebrew/include"
> +
> + if [ $NGX_RPATH = YES ]; then
> + ngx_feature_libs="-R/opt/homebrew/lib -L/opt/homebrew/lib -lpcre"
> + else
> + ngx_feature_libs="-L/opt/homebrew/lib -lpcre"
> + fi
> +
> + . auto/feature
> + fi
> +
> if [ $ngx_found = yes ]; then
> CORE_INCS="$CORE_INCS $ngx_feature_path"
> CORE_LIBS="$CORE_LIBS $ngx_feature_libs"

Thanks for the patch. Looks good to me.

For the record:

Among the libraries we search MacPorts for, there are xml/xslt-related
libraries as well, which are not included in this patch. Modern MacOS however
includes those libraries by default, and older versions do not support Apple
Silicon.

--
Roman Arutyunyan
_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
https://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[PATCH] Configure: add support for Homebrew on Apple Silicon

Piotr Sikora via nginx-devel 325 February 27, 2024 08:26PM

Re: [PATCH] Configure: add support for Homebrew on Apple Silicon

Roman Arutyunyan 27 March 06, 2024 07:58AM

Re: [PATCH] Configure: add support for Homebrew on Apple Silicon

Sergey Kandaurov 27 March 06, 2024 10:38AM

Re: [PATCH] Configure: add support for Homebrew on Apple Silicon

J Carter 37 March 07, 2024 09:24AM

Re: [PATCH] Configure: add support for Homebrew on Apple Silicon

Piotr Sikora via nginx-devel 32 March 08, 2024 10:32AM

Re: [PATCH] Configure: add support for Homebrew on Apple Silicon

Sergey Kandaurov 37 March 11, 2024 11:16AM

Re: [PATCH] Configure: add support for Homebrew on Apple Silicon

Sergey Kandaurov 47 March 27, 2024 02:00PM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 152
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready