Closed bsdjhb closed 1 year ago
This is a prerequisite for building GDB as purecap.
I'm fine with the current patch but it isn't sufficient to build it for CheriABI as math/gmp
requires texinfo
which we don't have for CheriABI.
I was thinking of the below patch (we disable DOCS NLS MANPAGES
when building packages -- I should disable them in CheriBSD ports rather than external make.conf files) but gmp
doesn't have an option to disable building docs/. It seems that patching configure for that is the only option here?
diff --git a/math/gmp/Makefile b/math/gmp/Makefile
index c3a8da71d5de..9e88757baa79 100644
--- a/math/gmp/Makefile
+++ b/math/gmp/Makefile
@@ -9,18 +9,16 @@ WWW= https://gmplib.org/
LICENSE= LGPL3
-USES= cpe libtool makeinfo tar:xz
+USES= cpe libtool tar:xz
CPE_VENDOR= gmplib
OPTIONS_DEFINE= CPU_OPTS
+OPTIONS_DEFINE+=INFO MANPAGES
CPU_OPTS_DESC= Enable assembly optimizations for your CPU
HAS_CONFIGURE= yes
-CONFIGURE_ENV= MAKEINFO="${MAKEINFO} --no-split"
CONFIGURE_ARGS= --prefix=${PREFIX} \
- --infodir=${PREFIX}/${INFO_PATH} \
- --mandir=${PREFIX}/man \
--enable-cxx
USE_LDCONFIG= yes
@@ -30,6 +28,18 @@ INFO= gmp
INSTALL_TARGET= install-strip
TEST_TARGET= check
+.include <bsd.port.options.mk>
+
+.if ${PORT_OPTIONS:MINFO}
+USES+= makeinfo
+CONFIGURE_ENV+= MAKEINFO="${MAKEINFO} --no-split"
+CONFIGURE_ARGS+= --infodir=${PREFIX}/${INFO_PATH}
+.endif
+
+.if ${PORT_OPTIONS:MMANPAGES}
+CONFIGURE_ARGS+= --mandir=${PREFIX}/man
+.endif
+
.include <bsd.port.pre.mk>
.if ${ARCH:Mmips*}
I'd be fine with merging this now and fixing the docs/ issue separately.
Huh, I built this as a port, and I guess it used the hybrid texinfo I had installed which is why I didn't run into that. Possibly it would be simpler to just install a hybrid texinfo as a build tool as we do for some other build tools since otherwise we will have to patch more ports in the future? (e.g. gdb itself also uses texinfo)
So far, we were able to disable texinfo use cases with appropriate build system flags. If it turns out that multiple ports would have to be patched (because they don't provide flags to disable docs) then I agree using hybrid ABI texinfo makes sense. I should do an experimental to see how many extra packages we'd get with that.
Patch configure to use sizeof(long) instead of sizeof(void *) to decide on 32 vs 64-bit ABI for aarch64.
Disable assembly for purecap ABIs.