heads/modules/gpg2
Thierry Laurion 907e906f01
Pass -O3 and -O2 (optimize for speed) to -Os (Optimize for space)
Adresses @easrentai suggestion to pass modules build optimization for space here: #590 (comment)

- Uniformized module's $(CROSS_TOOLS) being passed as environment variable, prior of ./configure call

Doesn't work for:
- busybox (HOSTCXXFLAGS="-Os" attempted prior of ./configure call)
- zlib (CFLAGS="-Os" attempted prior of ./configure call)
- npth (CFLAGS="-Os" attempted prior of ./configure call)
2023-03-07 18:05:39 -05:00

59 lines
1.7 KiB
Makefile

modules-$(CONFIG_GPG2) += gpg2
gpg2_version := 2.2.21
gpg2_dir := gnupg-$(gpg2_version)
gpg2_tar := gnupg-$(gpg2_version).tar.bz2
gpg2_url := https://www.gnupg.org/ftp/gcrypt/gnupg/$(gpg2_tar)
gpg2_hash := 61e83278fb5fa7336658a8b73ab26f379d41275bb1c7c6e694dd9f9a6e8e76ec
# For reproducibility reasons we have to override the exec_prefix
# and datarootdir on the configure line so that the Makefiles will
# be generated with the correct paths, but then re-write them when
# we use the install target so that they will be copied to the correct
# location.
gpg2_configure := \
$(CROSS_TOOLS) \
CFLAGS="-Os" \
./configure \
CPPFLAGS="-I$(INSTALL)/include/libusb-1.0" \
--host $(MUSL_ARCH)-linux-musl \
--with-libusb="$(INSTALL)" \
--with-gpg-error-prefix="$(INSTALL)" \
--with-libgcrypt-prefix="$(INSTALL)" \
--with-libassuan-prefix="$(INSTALL)" \
--with-ksba-prefix="$(INSTALL)" \
--with-npth-prefix="$(INSTALL)" \
--prefix "/" \
--libexecdir "/bin" \
--enable-scdaemon \
--enable-ccid-driver \
--disable-tofu \
--disable-rpath \
--disable-regex \
--disable-doc \
--disable-bzip2 \
--disable-exec \
--disable-photo-viewers \
--disable-ldap \
--disable-regex \
--disable-nls \
--disable-all-tests \
--disable-wks-tools \
--disable-gnutls \
--disable-dirmngr \
--disable-zip \
--disable-sqlite \
--disable-gpgsm \
# Run one build to generate the executables with the pre-defined
# exec_prefix and datarootdir, then a second make to install the binaries
# into our actual target location
gpg2_target := $(MAKE_JOBS) \
&& $(MAKE) -C $(build)/$(gpg2_dir) \
DESTDIR="$(INSTALL)" \
install
gpg2_output := g10/gpg agent/gpg-agent scd/scdaemon
gpg2_depends := libgpg-error libgcrypt libksba libassuan npth libusb-compat $(musl_dep)