Using gcc as a build dependency only

Dewayne Geraghty dewayne at heuristicsystems.com.au
Tue Nov 10 21:28:15 UTC 2020


On 11/11/2020 7:55 am, Bob Eager wrote:
> I have a port that, for reasons I won't go into, I build with gcc.
> 
> It all works fine with USE_GCC= yes - no problem.
> 
> The issue is that it's a build dependency and a run dependency. So
> anyone wanting to use it has to install gcc, and is discouraged because
> (a) it's big and (b) it drags in other stuff.
> 
> Presumably this is because it needs the gcc runtime, but I'm not sure.
> And I can't see a runtime package that parallels the compiler.
> 
> Can anyone comment on this? And please don't say 'convert to clang'
> because that isn't possible, at least not yet.
> _______________________________________________
> freebsd-ports at freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/freebsd-ports
> To unsubscribe, send any mail to "freebsd-ports-unsubscribe at freebsd.org"
> 

Hi Bob, I have faced the same dilemma.  The process I use is to:
Install (tar) only the gcc files needed, usually
libstdc++.s*
libgcc_s*

You might need to consider the other tools that gcc uses (like
math/{gmp,mpc,mpfr}

and then add to /usr/ports/Mk/local.mk, I append:
RUN_DEPENDS:=${RUN_DEPENDS:Ngcc*}
BUILD_DEPENDS:=${BUILD_DEPENDS:Ngcc*}
I also have, but I'm unsure if this is still required
LIB_DEPENDS:=${LIB_DEPENDS:Ngcc*}

I hope someone has a better way?
Regards.
PS All my build, install, update processes are automated; so you'll need
something to track gcc (and friends) updates.


More information about the freebsd-ports mailing list