mirror of
https://github.com/lwthiker/curl-impersonate.git
synced 2026-08-25 18:28:12 +00:00
Change nghttp2 link flags to support macOS
Previously '-l:nghttp2.a' was used to specify static linking with nghttp2 and to stop the linker from linking dynamically with libnghttp2.so. This way of linking is not supported on macOS. Instead, add '--disable-shared' to prevent libnghttp2.so from even being compiled. This way the linker will find the static library only and link against it.
This commit is contained in:
@@ -61,15 +61,9 @@ ARG NGHTTP2_URL=https://github.com/nghttp2/nghttp2/releases/download/v1.46.0/ngh
|
||||
RUN curl -o ${NGHTTP2_VERSION}.tar.bz2 -L ${NGHTTP2_URL}
|
||||
RUN tar xf ${NGHTTP2_VERSION}.tar.bz2
|
||||
|
||||
# Patch nghttp2 pkg config file to support static builds.
|
||||
COPY patches/libnghttp2-*.patch ${NGHTTP2_VERSION}/
|
||||
RUN cd ${NGHTTP2_VERSION} && \
|
||||
for p in $(ls libnghttp2-*.patch); do patch -p1 < $p; done && \
|
||||
autoreconf -i && automake && autoconf
|
||||
|
||||
# Compile nghttp2
|
||||
RUN cd ${NGHTTP2_VERSION} && \
|
||||
./configure --with-pic && \
|
||||
./configure --prefix=/build/${NGHTTP2_VERSION}/installed --with-pic --disable-shared && \
|
||||
make && make install
|
||||
|
||||
# Download curl.
|
||||
@@ -89,7 +83,7 @@ RUN cd ${CURL_VERSION} && \
|
||||
./configure --prefix=/build/install \
|
||||
--enable-static \
|
||||
--disable-shared \
|
||||
--with-nghttp2=/usr/local \
|
||||
--with-nghttp2=/build/${NGHTTP2_VERSION}/installed \
|
||||
--with-brotli=/build/brotli-${BROTLI_VERSION}/build/installed \
|
||||
--with-openssl=/build/boringssl/build \
|
||||
LIBS="-pthread" \
|
||||
@@ -107,7 +101,7 @@ RUN rm -Rf /build/install
|
||||
# Re-compile libcurl dynamically
|
||||
RUN cd ${CURL_VERSION} && \
|
||||
./configure --prefix=/build/install \
|
||||
--with-nghttp2=/usr/local \
|
||||
--with-nghttp2=/build/${NGHTTP2_VERSION}/installed \
|
||||
--with-brotli=/build/brotli-${BROTLI_VERSION}/build/installed \
|
||||
--with-openssl=/build/boringssl/build \
|
||||
LIBS="-pthread" \
|
||||
|
||||
@@ -58,15 +58,9 @@ ARG NGHTTP2_URL=https://github.com/nghttp2/nghttp2/releases/download/v1.46.0/ngh
|
||||
RUN curl -o ${NGHTTP2_VERSION}.tar.bz2 -L ${NGHTTP2_URL}
|
||||
RUN tar xf ${NGHTTP2_VERSION}.tar.bz2
|
||||
|
||||
# Patch nghttp2 pkg config file to support static builds.
|
||||
COPY patches/libnghttp2-*.patch ${NGHTTP2_VERSION}/
|
||||
RUN cd ${NGHTTP2_VERSION} && \
|
||||
for p in $(ls libnghttp2-*.patch); do patch -p1 < $p; done && \
|
||||
autoreconf -i && automake && autoconf
|
||||
|
||||
# Compile nghttp2
|
||||
RUN cd ${NGHTTP2_VERSION} && \
|
||||
./configure --with-pic && \
|
||||
./configure --prefix=/build/${NGHTTP2_VERSION}/installed --with-pic --disable-shared && \
|
||||
make && make install
|
||||
|
||||
# Download curl.
|
||||
@@ -86,7 +80,7 @@ RUN cd ${CURL_VERSION} && \
|
||||
./configure --prefix=/build/install \
|
||||
--enable-static \
|
||||
--disable-shared \
|
||||
--with-nghttp2=/usr/local \
|
||||
--with-nghttp2=/build/${NGHTTP2_VERSION}/installed \
|
||||
--with-brotli=/build/brotli-${BROTLI_VERSION}/build/installed \
|
||||
--with-openssl=/build/boringssl/build \
|
||||
LIBS="-pthread" \
|
||||
@@ -104,7 +98,7 @@ RUN rm -Rf /build/install
|
||||
# Re-compile libcurl dynamically
|
||||
RUN cd ${CURL_VERSION} && \
|
||||
./configure --prefix=/build/install \
|
||||
--with-nghttp2=/usr/local \
|
||||
--with-nghttp2=/build/${NGHTTP2_VERSION}/installed \
|
||||
--with-brotli=/build/brotli-${BROTLI_VERSION}/build/installed \
|
||||
--with-openssl=/build/boringssl/build \
|
||||
LIBS="-pthread" \
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
--- nghttp2-1.46.0-original/lib/libnghttp2.pc.in 2021-10-19 12:31:47.000000000 +0300
|
||||
+++ nghttp2-1.46.0/lib/libnghttp2.pc.in 2022-02-17 13:44:46.722604316 +0200
|
||||
@@ -31,3 +31,4 @@
|
||||
Version: @VERSION@
|
||||
-Libs: -L${libdir} -lnghttp2
|
||||
+Libs: -L${libdir}
|
||||
+Libs.private: -l:libnghttp2.a
|
||||
Cflags: -I${includedir}
|
||||
Reference in New Issue
Block a user