Welcome! Log In Create A New Profile

Advanced

Re: Статическая сборка nginx с GD

April 07, 2019 03:42PM
> On 7 Apr 2019, at 22:16, Anton Kiryushkin <swood@fotofor.biz> wrote:
>
> Я взял код из лога и попробовал его собрать ровно так, как написано.
> Строка моего configure следующая:
> ./configure --prefix=/usr --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-client-body-temp-path=/var/lib/nginx/body --http-fastcgi-temp-path=/var/lib/nginx/fastcgi --http-log-path=/var/log/nginx/access.log --http-proxy-temp-path=/var/lib/nginx/proxy --http-scgi-temp-path=/var/lib/nginx/scgi --http-uwsgi-temp-path=/var/lib/nginx/uwsgi --lock-path=/var/lock/nginx.lock --pid-path=/var/run/nginx.pid --with-debug --with-http_addition_module --with-http_dav_module --with-http_geoip_module --with-http_gzip_static_module --with-http_realip_module --with-http_stub_status_module --with-http_ssl_module --with-http_sub_module --with-sha1=/usr/include/openssl --with-md5=/usr/include/openssl --add-module=/usr/src/naxsi/naxsi_src --with-debug --with-http_v2_module --with-cc-opt="-static -static-libgcc" --with-ld-opt="-static -lm" --with-cpu-opt=generic --with-openssl=./openssl-1.0.2r --with-stream --with-stream_ssl_module --user=www-data --with-http_image_filter_module
>
> Что-то тут уже устаревшее, но это не очень важно.
> Выпадает ошибка:
> checking for GD library ... not found
> checking for GD library in /usr/local/ ... not found
> checking for GD library in /usr/pkg/ ... not found
> checking for GD library in /opt/local/ ... not found
>
> Окей. Берем код автотеста:
>
> #include <sys/types.h>
> #include <unistd.h>
> #include <gd.h>
>
> int main(void) {
> gdImagePtr img = gdImageCreateFromGifPtr(1, NULL);
> (void) img;
> return 0;
> }
>
> Собираем:
> cc -static -static-libgcc -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -I /usr/pkg/include -o objs/autotest objs/autotest.c -static -lm -L/usr/pkg/lib -lgd (строчка из того же лога).
> Не собирается.
> Однако, если подвинуть -lm в конец:
> cc -static -static-libgcc -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -I /usr/pkg/include -o objs/autotest objs/autotest.c -static -L/usr/pkg/lib -lgd -lm
>
> Все соберется.
>
> Вопрос, как передвинуть на уровне сборки?

Штатно не двигается.
Можно добавить в auto/lib/libgd/conf:

- ngx_feature_libs="-L/usr/pkg/lib -lgd"
+ ngx_feature_libs="-L/usr/pkg/lib -lgd -lm"

В динамической libgd.so зависимость от libm.so записана,
а в статической такой возможности нет.


--
Igor Sysoev
http://nginx.com

_______________________________________________
nginx-ru mailing list
nginx-ru@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-ru
Subject Author Posted

Статическая сборка nginx с GD

Anton Kiryushkin April 06, 2019 05:56AM

Re: Статическая сборка nginx с GD

Igor Sysoev April 06, 2019 06:08AM

Re: Статическая сборка nginx с GD

Anton Kiryushkin April 06, 2019 07:08AM

Re: Статическая сборка nginx с GD

Igor Sysoev April 06, 2019 07:16AM

Re: Статическая сборка nginx с GD

Anton Kiryushkin April 06, 2019 07:58AM

Re: Статическая сборка nginx с GD

Igor Sysoev April 06, 2019 02:24PM

Re: Статическая сборка nginx с GD

Anton Kiryushkin April 07, 2019 07:36AM

Re: Статическая сборка nginx с GD

Anton Kiryushkin April 07, 2019 03:18PM

Re: Статическая сборка nginx с GD

Igor Sysoev April 07, 2019 03:42PM

Re: Статическая сборка nginx с GD

Maxim Dounin April 07, 2019 09:46PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 176
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