Merge pull request #222 from lwthiker/fix-macos-precompiled-binaries

Disable extraneous linking in released binaries
This commit is contained in:
lwthiker
2024-03-02 18:36:34 +02:00
committed by GitHub
6 changed files with 41 additions and 14 deletions

View File

@@ -105,7 +105,8 @@ jobs:
if: matrix.arch == 'x86_64' if: matrix.arch == 'x86_64'
run: | run: |
mkdir ${{ runner.temp }}/install mkdir ${{ runner.temp }}/install
./configure --prefix=${{ runner.temp }}/install ./configure --prefix=${{ runner.temp }}/install \
CURL_CONFIG_FLAGS="--disable-rtsp --without-libidn2 --without-zstd"
# When cross compiling a more complicated configuration is needed, since # When cross compiling a more complicated configuration is needed, since
# curl's configure script can't figure out where some files and libraries # curl's configure script can't figure out where some files and libraries

View File

@@ -134,6 +134,15 @@ cd ../ && rm -Rf build
To compile curl-impersonate statically with libcurl-impersonate, pass `--enable-static` to the `configure` script. To compile curl-impersonate statically with libcurl-impersonate, pass `--enable-static` to the `configure` script.
### Configuring curl's build
You might want to configure the underlying curl build to your needs.
To do that, use the `CURL_CONFIG_FLAGS` variable. These flags will be passed down to curl's `configure` script:
```sh
../configure CURL_CONFIG_FLAGS="--disable-rtsp"
```
### A note about the Firefox version ### A note about the Firefox version
The Firefox version compiles a static version of nss, Firefox's TLS library. The Firefox version compiles a static version of nss, Firefox's TLS library.

View File

@@ -57,6 +57,9 @@ CC = @CC@
CXX = @CXX@ CXX = @CXX@
STRIP = @STRIP@ STRIP = @STRIP@
# Additional flags to be passed down to curl's configure script during build.
CURL_CONFIG_FLAGS = @CURL_CONFIG_FLAGS@
# Auto-generate Makefile help. # Auto-generate Makefile help.
# Borrowed from https://marmelab.com/blog/2016/02/29/auto-documented-makefile.html # Borrowed from https://marmelab.com/blog/2016/02/29/auto-documented-makefile.html
help: ## Show this help message help: ## Show this help message
@@ -360,7 +363,8 @@ $(CURL_VERSION)/.firefox: $(firefox_libs) $(CURL_VERSION).tar.xz $(CURL_VERSION)
# If the user provided the --host flag to our configure script # If the user provided the --host flag to our configure script
# (for cross compilation), then pass it on to curl. # (for cross compilation), then pass it on to curl.
{ \ { \
config_flags="--prefix=@prefix@"; \ config_flags="$(CURL_CONFIG_FLAGS)"; \
config_flags+=" --prefix=@prefix@"; \
config_flags+=" --with-nghttp2=$(nghttp2_install_dir)"; \ config_flags+=" --with-nghttp2=$(nghttp2_install_dir)"; \
config_flags+=" --with-brotli=$(brotli_install_dir)"; \ config_flags+=" --with-brotli=$(brotli_install_dir)"; \
config_flags+=" --with-nss=$(nss_install_dir) --with-nss-deprecated"; \ config_flags+=" --with-nss=$(nss_install_dir) --with-nss-deprecated"; \
@@ -401,7 +405,8 @@ $(CURL_VERSION)/.chrome: $(chrome_libs) $(CURL_VERSION).tar.xz $(CURL_VERSION)/.
# If the user provided the --host flag to our configure script # If the user provided the --host flag to our configure script
# (for cross compilation), then pass it on to curl. # (for cross compilation), then pass it on to curl.
{ \ { \
config_flags="--prefix=@prefix@"; \ config_flags="$(CURL_CONFIG_FLAGS)"; \
config_flags="$$config_flags --prefix=@prefix@"; \
config_flags="$$config_flags --with-nghttp2=$(nghttp2_install_dir)"; \ config_flags="$$config_flags --with-nghttp2=$(nghttp2_install_dir)"; \
config_flags="$$config_flags --with-brotli=$(brotli_install_dir)"; \ config_flags="$$config_flags --with-brotli=$(brotli_install_dir)"; \
config_flags="$$config_flags --with-openssl=$(boringssl_install_dir)"; \ config_flags="$$config_flags --with-openssl=$(boringssl_install_dir)"; \

View File

@@ -74,12 +74,16 @@ More documentation is available in the [docs/](docs/README.md) directory.
There are two versions of `curl-impersonate` for technical reasons. The **chrome** version is used to impersonate Chrome, Edge and Safari. The **firefox** version is used to impersonate Firefox. There are two versions of `curl-impersonate` for technical reasons. The **chrome** version is used to impersonate Chrome, Edge and Safari. The **firefox** version is used to impersonate Firefox.
### Pre-compiled binaries ### Pre-compiled binaries
Pre-compiled binaries for Linux and macOS (Intel) are available at the [GitHub releases](https://github.com/lwthiker/curl-impersonate/releases) page. Before you use them you need to install nss (Firefox's TLS library) and CA certificates: Pre-compiled binaries for Linux and macOS (Intel) are available at the [GitHub releases](https://github.com/lwthiker/curl-impersonate/releases) page.
Before you use them you need to install nss (Firefox's TLS library) and CA certificates:
* Ubuntu - `sudo apt install libnss3 nss-plugin-pem ca-certificates` * Ubuntu - `sudo apt install libnss3 nss-plugin-pem ca-certificates`
* Red Hat/Fedora/CentOS - `yum install nss nss-pem ca-certificates` * Red Hat/Fedora/CentOS - `yum install nss nss-pem ca-certificates`
* Archlinux - `pacman -S nss ca-certificates` * Archlinux - `pacman -S nss ca-certificates`
* macOS - `brew install nss ca-certificates` * macOS - `brew install nss ca-certificates`
Also ensure you have zlib installed on your system.
zlib is almost always present, but on some minimal systems it might be missing.
The pre-compiled binaries contain libcurl-impersonate and a statically compiled curl-impersonate for ease of use. The pre-compiled binaries contain libcurl-impersonate and a statically compiled curl-impersonate for ease of use.
The pre-compiled Linux binaries are built for Ubuntu systems. On other distributions if you have errors with certificate verification you may have to tell curl where to find the CA certificates. For example: The pre-compiled Linux binaries are built for Ubuntu systems. On other distributions if you have errors with certificate verification you may have to tell curl where to find the CA certificates. For example:

26
configure vendored
View File

@@ -1,6 +1,6 @@
#! /bin/sh #! /bin/sh
# Guess values for system-dependent variables and create Makefiles. # Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.71 for curl-impersonate 0.5.0. # Generated by GNU Autoconf 2.71 for curl-impersonate 0.6.0.
# #
# Report bugs to <lwt@lwthiker.com>. # Report bugs to <lwt@lwthiker.com>.
# #
@@ -610,8 +610,8 @@ MAKEFLAGS=
# Identity of this package. # Identity of this package.
PACKAGE_NAME='curl-impersonate' PACKAGE_NAME='curl-impersonate'
PACKAGE_TARNAME='curl-impersonate' PACKAGE_TARNAME='curl-impersonate'
PACKAGE_VERSION='0.5.0' PACKAGE_VERSION='0.6.0'
PACKAGE_STRING='curl-impersonate 0.5.0' PACKAGE_STRING='curl-impersonate 0.6.0'
PACKAGE_BUGREPORT='lwt@lwthiker.com' PACKAGE_BUGREPORT='lwt@lwthiker.com'
PACKAGE_URL='' PACKAGE_URL=''
@@ -619,6 +619,7 @@ ac_subst_vars='LTLIBOBJS
LIBOBJS LIBOBJS
ninja ninja
cmake cmake
CURL_CONFIG_FLAGS
with_libnssckbi with_libnssckbi
with_ca_path with_ca_path
with_ca_bundle with_ca_bundle
@@ -701,7 +702,8 @@ LIBS
CPPFLAGS CPPFLAGS
CXX CXX
CXXFLAGS CXXFLAGS
CCC' CCC
CURL_CONFIG_FLAGS'
# Initialize some variables set by options. # Initialize some variables set by options.
@@ -1250,7 +1252,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing. # Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh. # This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF cat <<_ACEOF
\`configure' configures curl-impersonate 0.5.0 to adapt to many kinds of systems. \`configure' configures curl-impersonate 0.6.0 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]... Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1317,7 +1319,7 @@ fi
if test -n "$ac_init_help"; then if test -n "$ac_init_help"; then
case $ac_init_help in case $ac_init_help in
short | recursive ) echo "Configuration of curl-impersonate 0.5.0:";; short | recursive ) echo "Configuration of curl-impersonate 0.6.0:";;
esac esac
cat <<\_ACEOF cat <<\_ACEOF
@@ -1354,6 +1356,8 @@ Some influential environment variables:
you have headers in a nonstandard directory <include dir> you have headers in a nonstandard directory <include dir>
CXX C++ compiler command CXX C++ compiler command
CXXFLAGS C++ compiler flags CXXFLAGS C++ compiler flags
CURL_CONFIG_FLAGS
"configuration flags to be passed down to curls 'configure'"
Use these variables to override the choices made by `configure' or to help Use these variables to override the choices made by `configure' or to help
it to find libraries and programs with nonstandard names/locations. it to find libraries and programs with nonstandard names/locations.
@@ -1422,7 +1426,7 @@ fi
test -n "$ac_init_help" && exit $ac_status test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then if $ac_init_version; then
cat <<\_ACEOF cat <<\_ACEOF
curl-impersonate configure 0.5.0 curl-impersonate configure 0.6.0
generated by GNU Autoconf 2.71 generated by GNU Autoconf 2.71
Copyright (C) 2021 Free Software Foundation, Inc. Copyright (C) 2021 Free Software Foundation, Inc.
@@ -1584,7 +1588,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake. running configure, to aid debugging if configure makes a mistake.
It was created by curl-impersonate $as_me 0.5.0, which was It was created by curl-impersonate $as_me 0.6.0, which was
generated by GNU Autoconf 2.71. Invocation command line was generated by GNU Autoconf 2.71. Invocation command line was
$ $0$ac_configure_args_raw $ $0$ac_configure_args_raw
@@ -4223,6 +4227,8 @@ else $as_nop
fi fi
# BoringSSL requires cmake 3.5+, which is sometimes available under # BoringSSL requires cmake 3.5+, which is sometimes available under
# "cmake3" instead of "cmake" # "cmake3" instead of "cmake"
for ac_prog in cmake3 cmake for ac_prog in cmake3 cmake
@@ -4859,7 +4865,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their # report actual input values of CONFIG_FILES etc. instead of their
# values after options handling. # values after options handling.
ac_log=" ac_log="
This file was extended by curl-impersonate $as_me 0.5.0, which was This file was extended by curl-impersonate $as_me 0.6.0, which was
generated by GNU Autoconf 2.71. Invocation command line was generated by GNU Autoconf 2.71. Invocation command line was
CONFIG_FILES = $CONFIG_FILES CONFIG_FILES = $CONFIG_FILES
@@ -4914,7 +4920,7 @@ ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config='$ac_cs_config_escaped' ac_cs_config='$ac_cs_config_escaped'
ac_cs_version="\\ ac_cs_version="\\
curl-impersonate config.status 0.5.0 curl-impersonate config.status 0.6.0
configured by $0, generated by GNU Autoconf 2.71, configured by $0, generated by GNU Autoconf 2.71,
with options \\"\$ac_cs_config\\" with options \\"\$ac_cs_config\\"

View File

@@ -67,6 +67,8 @@ AC_ARG_WITH([libnssckbi],
[AC_SUBST([with_libnssckbi], ["$withval"])], [AC_SUBST([with_libnssckbi], ["$withval"])],
[AC_SUBST([with_libnssckbi], [""])]) [AC_SUBST([with_libnssckbi], [""])])
AC_ARG_VAR([CURL_CONFIG_FLAGS], ["configuration flags to be passed down to curls 'configure'"])
# BoringSSL requires cmake 3.5+, which is sometimes available under # BoringSSL requires cmake 3.5+, which is sometimes available under
# "cmake3" instead of "cmake" # "cmake3" instead of "cmake"
AC_CHECK_PROGS([cmake], [cmake3 cmake]) AC_CHECK_PROGS([cmake], [cmake3 cmake])