How to descend into the extract to build in a subdir

Peter Pentchev roam at ringlet.net
Thu Nov 29 09:43:49 UTC 2012


On Tue, Nov 27, 2012 at 02:45:54PM -0600, Paul Schmehl wrote:
> --On November 27, 2012 2:24:12 PM -0600 Paul Schmehl
> <pschmehl_lists at tx.rr.com> wrote:
> 
> >I'm working on a port that requires a separate ./configure and ./make to
> >build libraries before you build the main source.  How is this done in
> >ports?
> >
> >I figure you have to do something in pre-build:, but I'm not sure exactly
> >what.
> >(cd ${WRKSRC}/subdir && ${MAKE}) causes make to fail entirely.  I'm
> >having trouble finding a comparable example in ports and there doesn't
> >seem to be anything about it in the porters handbook (that I have found.)
> 
> Never mind.  I figured it outl
> 
> .if ${PORT_OPTIONS:MBROCCOLI}
> pre-configure:
>        (cd ${WRKSRC}/aux/broccoli && ./configure)
> pre-build:
>        (cd ${WRKSRC}/aux/broccoli && ${MAKE})
> .endif

I know I'm a bit late to this party, but still - if this is a GNU
configure script, you might want to pass a couple more options to it.
Take a look at how bsd.port.mk (around line 3735) does it - it basically
runs
${SETENV} ... ${CONFIGURE_ENV} ./${CONFIGURE_SCRIPT} ${CONFIGURE_ARGS}
with a couple more environment variables defined (compiler, linker,
paths, etc).  If your port does not do at least something similar to
this, it might end up compiling different parts of the source with
different settings (e.g. CC, CFLAGS, CPPFLAGS for -D... and -I... and so
on).

And the same goes for the ${MAKE} invocation - take a look at the
do-build target in bsd.port.mk (just a couple of lines below the
configure one) - at least ${SETENV} ${MAKE_ENV} ${MAKE}, if not a couple
more MAKE_FLAGS and MAKE_ARGS, maybe MAKE_JOBS for parallel building.

G'luck,
Peter

-- 
Peter Pentchev	roam at ringlet.net roam at FreeBSD.org p.penchev at storpool.com
PGP key:	http://people.FreeBSD.org/~roam/roam.key.asc
Key fingerprint 2EE7 A7A5 17FC 124C F115  C354 651E EFB0 2527 DF13
What would this sentence be like if pi were 3?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.freebsd.org/pipermail/freebsd-ports/attachments/20121129/20954660/attachment.sig>


More information about the freebsd-ports mailing list