Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 20 May 2020 19:25:00 +0200
From:      SirDice <sirdice@gmail.com>
To:        freebsd-ports@freebsd.org
Subject:   Port OPTIONS advice
Message-ID:  <CAHNAqm8qkMC1ATdL5Yh95aX5h-0YU86G2O-otWqaWrv6tF4yoQ@mail.gmail.com>

next in thread | raw e-mail | index | archive | help
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.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAHNAqm8qkMC1ATdL5Yh95aX5h-0YU86G2O-otWqaWrv6tF4yoQ>