Commit Graph

20 Commits

Author SHA1 Message Date
lwthiker
60b9df014c Fix incorrect configure --host flag in CI
(Unrelated: make unzip quiet during build)
2022-07-14 16:48:01 +03:00
lwthiker
d860024dac Add cross compilation support
Add support for cross-compiling curl-impersonate.

Cross compiling can now be done using the '--host' flag to the configure
script. This will make sure that all sub-components are cross-compiled.
In addition, compiling for a different system requires explicitly
specifying multiple paths used by curl (e.g. for certificates). These
options were added to the configure script as well.

The build and test CI workflow will now attempt to cross-compile
curl-impersonate to ARM64 (aarch64), and upload this binary to the
GitHub release page.
2022-07-14 15:56:09 +03:00
lwthiker
662b18d131 Fix broken clang build on macOS
Build on macOS is failing due to unknown compiler options previously
added to support gcc 12 on Fedora. Add "-Wno-unknown-warning-option" to
silence this failure.
2022-05-29 17:29:22 +03:00
lwthiker
f51620327a Add compiler flags necessary to build on Fedora
* Add compiler flags to the boringssl build step to suppress gcc errors
raised when compiling with gcc 12+, which is present in Fedora. It is not
clear whether this is a compiler bug or a boringssl bug, however the
errors only appear when building in release mode and with gcc 12, so I
don't see any problem with manually supressing them.
* Add documentation for building on Fedora.
2022-05-20 17:46:56 +03:00
lwthiker
41986464c4 Fix build system to work on Red Hat-based systems
Tweak the curl-impersonate build system to make it work on Red Hat
based systems such as CentOS, Fedora and Amazon Linux.

* Change the Makefile to be more portable with different bash versions.
* Detect whether cmake is 'cmake' or 'cmake3', and whether ninja is
'ninja' or 'ninja-build'.
* Explicitly tell brotli to put its libraries in 'lib' dir, otherwise it
might put them in 'lib64' where curl doesn't find them.
* Add instructions for building curl-impersonate from source on Red Hat
based systems.
2022-05-20 15:52:30 +03:00
lwthiker
92a5b8c7ab Add support for impersonating Firefox 100
Add support for impersonating Firefox 100. The TLS signature is identical to
previous versions of Firefox.

In addition, upgrade NSS (Firefox's TLS library) to version 3.77 used by
Firefox 100. This is not strictly necessary as the previous version used
works just fine, but it's better keep up with the newest version.
2022-05-15 20:50:45 +03:00
lwthiker
201a5472ef Add option to strip binaries before installation
And use 'install' instead of 'cp' for installing the wrapper scripts.
2022-05-14 18:48:28 +03:00
lwthiker
b0e9d4c91e Use 'rm -f' in Makefile.in
Use 'rm -f' to ignore non-existant file errors.
2022-05-14 17:58:22 +03:00
lwthiker
53a87e0d9d Add forgotten '.PHONY' declarations in Makefile.in 2022-05-14 10:10:34 +03:00
lwthiker
5b260dfa3c Add compiled binaries to GitHub releases 2022-05-14 10:09:03 +03:00
lwthiker
124f0740be Cache build files during GitHub action workflows (#60)
To speed up the automatic workflows, attempt to cache the slowest part
of the build, which is the compilation of the TLS libraries (NSS/BoringSSL).
2022-05-13 23:13:51 +03:00
lwthiker
59209c19c7 Add support for linking NSS statically on macOS
This is an attmept to link with NSS statically on macOS (both Intel and
 Apple M1).

 Statically linking with NSS is a total mess and completely
undocumented. There are 20+ .a files to link with, and their linking
order matters. The main reference for this commit is a Mozilla Rust code
responsible for statically linking NSS:

    b2690fd2e4/components/support/rc_crypto/nss/nss_b    uild_common/src/lib.rs#L94

Unfortunately, even with that in hand, a lot of hacking is needed to
make it all work.
2022-04-30 13:56:16 +03:00
lwthiker
7d86e2f285 Add make target to check that build is correct
Add a few checks as in f320cec to ensure that 'curl-impersonate' was
compiled with all the required features (compression, tls, http2).
2022-04-17 17:30:53 +03:00
lwthiker
d7ed859ad0 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.
2022-04-17 17:01:15 +03:00
lwthiker
a6c4fa6ac1 Use $(MAKE) instead of 'make' in Makefile.in
To support platforms where 'make' is named differently (e.g. on MacOS we
use 'gmake' instead), replace it with '$(MAKE)' in Makefile.in
2022-04-17 14:50:53 +03:00
lwthiker
79f8601a30 Fix typo in Makefile.in 2022-04-12 12:43:02 +03:00
lwthiker
4e102d1fbf Add Makefile uninstall targets
Add two targets for uninstalling curl-impersonate to the Makefile.
2022-04-12 12:29:47 +03:00
lwthiker
7e19dd7221 Only install binaries in 'make install'
When doing 'make firefox-install' or 'make chrome-install' in our own
Makefile, only install curl's binaries (curl & libcurl) and do not
install the man pages and headers. This will prevent collision of these
files with any installed curl man pages or headers. In the future it
might be possible to rename the man pages or headers as well to allow
them live side-by-side with the vanilla curl.
2022-04-12 12:29:41 +03:00
lwthiker
b484701491 Use autoconf's srcdir variable in Makefile.in
Use autoconf's automatic variable 'abs_srcdir' to find the path to the
patch files and wrapper scripts, instead of relying on the Makefile's
directory. This allows doing out-of-tree builds, i.e. 'mkdir build && cd
build && ../configure && make'.
2022-04-12 11:32:50 +03:00
lwthiker
35623ee453 Use autoconf to configure the Makefile
Use a 'configure' script generated by autoconf to configure whether a
static build is desired, and where to install the final curl-impersonate
binaries. Add installation targets to the Makefile.
2022-04-12 10:58:53 +03:00