Port OPTIONS advice

SirDice sirdice at gmail.com
Wed May 20 17:25:16 UTC 2020


Hi,

Some time ago I took over maintainership of fs-uae. Port itself is doing
great but I wanted to enable the JIT option to experiment with (it builds
but crashes the application; that's an entirely different issue though). To
enable it I had added this:

OPTIONS_DEFINE_i386=    JIT
OPTIONS_DEFINE_amd64=   JIT

Because the option is only available for i386/amd64 I wanted the port
option to only show up on x86. Unfortunately the brain-dead ./configure
script simply assumes --with-jit on all architectures. As these OPTIONS
were only available on x86, any other ARCH never passes --without-jit to
./configure and thus it fails to build.

The quick solution was to use OPTIONS_DEFINE= JIT and make the port option
available everywhere.  However, if you try to enable it you will run into
build failures on Powerpc or ARM for example.

I could do this:
-----------------------------
OPTIONS_DEFINE_i386=    JIT
OPTIONS_DEFINE_amd64=   JIT

.include <bsd.port.pre.mk>

# JIT is not supported on non-x86
.if ${ARCH} != amd64 && ${ARCH} != i386
CONFIGURE_ARGS+= --without-jit
.endif
----------------------------

Or do something like this:
----------------------------
OPTIONS_DEFINE= JIT

.include <bsd.port.pre.mk>

.if ${PORT_OPTIONS:MJIT}
ONLY_FOR_ARCHS= i386 amd64
.endif

----------------------------

The JIT OPTION is off by default in all cases. But I would  like to only
have it appear on supported architectures or have some sort of sanity check
so it doesn't get enabled on unsupported architectures. As I need to update
the port (new version came out) I would like to fix this OPTION issue too.

What's a good way to deal with this sort of architecture dependent option?

Thanks for your time,

Remko C.


More information about the freebsd-ports mailing list