Re: Make variables to force non default libraries and includes?

2014-04-29 Thread Ian Lepore
On Tue, 2014-04-29 at 13:31 +0800, Julian Elischer wrote:
 On 4/29/14, 8:57 AM, Ian Lepore wrote:
  On Mon, 2014-04-28 at 18:36 -0600, Warner Losh wrote:
  On Apr 28, 2014, at 1:48 AM, Julian Elischer jul...@freebsd.org wrote:
 
  I need to do the equivalent of  cd /usr/src/cddl/usr.sbin/dtrace; make 
  DESTDIR=/mumble all install”
  cd /usr/src
  make distributeworld DESTDIR=/mumble
  cd cddl/usr.sbin/dtrace
  make buildenv
  make all install
 
  but it pulls in libraries from the base system, which differ slightly 
  from those in the source tree.
  The above will create the right /mumble hierarchy, and will pull the 
  libraries from the build rather than the local system.
 
  How can I force it to use /mumble2/include and /mumble2/lib instead of / ?
 
  I can pre-populate /mumble2 using make buildworld, make libraries, 
  and make includes but
  I need to be able to do selective builds of just subdirectories after 
  that..  I haven't spotted the right way of forcing the use of the 
  --system_root /mumble2 option in the compiles.
 
  I know we do it in 'buildworld' is there a more generic way?
 
  I have been looking in the .mk files but I haven't spotted it so far.
  You’re asking for some serious split-brain action. chroot builds are 
  likely your best option. There’s no easy way to force this, although you 
  might get some milage out of WMAKEENV options, but I think we bake most of 
  the where to look for things options into the binaries. One crazy option 
  would be to set CC=“cc —sysroot /mumble” but I’m sure there be dragons 
  there…
 
  Good luck with this crazy, never have we supported it very well, option :)
 
  Warner
  Actually the hooks are in place to do this stuff.  Instead of make
  buildenv to get an interactive shell you can do something like
 
 BLDENV=`${MAKE} buildenvvars`
 chroot buildchroot/ env -i $${BLDENV} cd /usr/src/somewhere  \
  make all install
 
  -- Ian
 
 
 
 
 Is there a way to specify a different toolchain destination? i.e. not 
 /usr/obj/usr/src/tmp ?
 

Not right now -- all that stuff is in Makefile.inc1 (WORLDTMP var and
related stuff) and there are no provisions for overriding it.

-- Ian


___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to freebsd-current-unsubscr...@freebsd.org

Re: Make variables to force non default libraries and includes?

2014-04-28 Thread Ian Lepore
On Mon, 2014-04-28 at 15:50 +0800, Julian Elischer wrote:
 I need to do the equivalent of  cd /usr/src/cddl/usr.sbin/dtrace; 
 make DESTDIR=/mumble all install
 
 but it pulls in libraries from the base system, which differ slightly 
 from those in the source tree.
 
 How can I force it to use /mumble2/include and /mumble2/lib instead of / ?
 
 I can pre-populate /mumble2 using make buildworld, make libraries, 
 and make includes but
 I need to be able to do selective builds of just subdirectories after 
 that..  I haven't spotted the right way of forcing the use of the 
 --system_root /mumble2 option in the compiles.
 
 I know we do it in 'buildworld' is there a more generic way?
 
 I have been looking in the .mk files but I haven't spotted it so far.
 
 An option woudl be a way to 'enter' a buildworld and just rebuild or 
 reinstall small specified parts of it.
 Unfortunately at the moment I see no option other than a lot of 
 WITHOUT_XXX and 'build everything'.
 
 
 Julian

The 'buildenv' target does the enter a buildworld thing.  Just make
buildenv and you get a shell with all the environment variables set up
for doing builds (or cross-builds if you set TARGET_ARCH) within that
source tree.  If csh isn't your favorite shell, set BUILDENV_SHELL in
your environment.  There's also a buildenvvars target that will let
you capture the environment you need so that you can use it within your
own build scripts without needing an interactive shell.

-- Ian


___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to freebsd-current-unsubscr...@freebsd.org


Re: Make variables to force non default libraries and includes?

2014-04-28 Thread Julian Elischer

On 4/28/14, 8:19 PM, Ian Lepore wrote:

On Mon, 2014-04-28 at 15:50 +0800, Julian Elischer wrote:

I need to do the equivalent of  cd /usr/src/cddl/usr.sbin/dtrace;
make DESTDIR=/mumble all install

but it pulls in libraries from the base system, which differ slightly
from those in the source tree.

How can I force it to use /mumble2/include and /mumble2/lib instead of / ?

I can pre-populate /mumble2 using make buildworld, make libraries,
and make includes but
I need to be able to do selective builds of just subdirectories after
that..  I haven't spotted the right way of forcing the use of the
--system_root /mumble2 option in the compiles.

I know we do it in 'buildworld' is there a more generic way?

I have been looking in the .mk files but I haven't spotted it so far.

An option woudl be a way to 'enter' a buildworld and just rebuild or
reinstall small specified parts of it.
Unfortunately at the moment I see no option other than a lot of
WITHOUT_XXX and 'build everything'.


Julian

The 'buildenv' target does the enter a buildworld thing.  Just make
buildenv and you get a shell with all the environment variables set up
for doing builds (or cross-builds if you set TARGET_ARCH) within that
source tree.  If csh isn't your favorite shell, set BUILDENV_SHELL in
your environment.  There's also a buildenvvars target that will let
you capture the environment you need so that you can use it within your
own build scripts without needing an interactive shell.

-- Ian





oh man that is just what I'm looking for
Is there a single command for populating the  buildenv resources?
i.e. to compile and install all the tools and libraries (and includes 
etc) (into /usr/obj/usr/src/tmp... )


___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to freebsd-current-unsubscr...@freebsd.org


Re: Make variables to force non default libraries and includes?

2014-04-28 Thread Ian Lepore
On Mon, 2014-04-28 at 22:07 +0800, Julian Elischer wrote:
 On 4/28/14, 8:19 PM, Ian Lepore wrote:
  On Mon, 2014-04-28 at 15:50 +0800, Julian Elischer wrote:
  I need to do the equivalent of  cd /usr/src/cddl/usr.sbin/dtrace;
  make DESTDIR=/mumble all install
 
  but it pulls in libraries from the base system, which differ slightly
  from those in the source tree.
 
  How can I force it to use /mumble2/include and /mumble2/lib instead of / ?
 
  I can pre-populate /mumble2 using make buildworld, make libraries,
  and make includes but
  I need to be able to do selective builds of just subdirectories after
  that..  I haven't spotted the right way of forcing the use of the
  --system_root /mumble2 option in the compiles.
 
  I know we do it in 'buildworld' is there a more generic way?
 
  I have been looking in the .mk files but I haven't spotted it so far.
 
  An option woudl be a way to 'enter' a buildworld and just rebuild or
  reinstall small specified parts of it.
  Unfortunately at the moment I see no option other than a lot of
  WITHOUT_XXX and 'build everything'.
 
 
  Julian
  The 'buildenv' target does the enter a buildworld thing.  Just make
  buildenv and you get a shell with all the environment variables set up
  for doing builds (or cross-builds if you set TARGET_ARCH) within that
  source tree.  If csh isn't your favorite shell, set BUILDENV_SHELL in
  your environment.  There's also a buildenvvars target that will let
  you capture the environment you need so that you can use it within your
  own build scripts without needing an interactive shell.
 
  -- Ian
 
 
 
 
 oh man that is just what I'm looking for
 Is there a single command for populating the  buildenv resources?
 i.e. to compile and install all the tools and libraries (and includes 
 etc) (into /usr/obj/usr/src/tmp... )

make toolchain should do that.  There's also kernel-toolchain for
building just the kernel; I think the only difference between the two is
that kernel-toolchain doesn't build userland includes and libs.

-- Ian


___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to freebsd-current-unsubscr...@freebsd.org


Re: Make variables to force non default libraries and includes?

2014-04-28 Thread Julian Elischer

On 4/28/14, 10:27 PM, Ian Lepore wrote:

On Mon, 2014-04-28 at 22:07 +0800, Julian Elischer wrote:

On 4/28/14, 8:19 PM, Ian Lepore wrote:

On Mon, 2014-04-28 at 15:50 +0800, Julian Elischer wrote:

I need to do the equivalent of  cd /usr/src/cddl/usr.sbin/dtrace;
make DESTDIR=/mumble all install

but it pulls in libraries from the base system, which differ slightly
from those in the source tree.

How can I force it to use /mumble2/include and /mumble2/lib instead of / ?

I can pre-populate /mumble2 using make buildworld, make libraries,
and make includes but
I need to be able to do selective builds of just subdirectories after
that..  I haven't spotted the right way of forcing the use of the
--system_root /mumble2 option in the compiles.

I know we do it in 'buildworld' is there a more generic way?

I have been looking in the .mk files but I haven't spotted it so far.

An option woudl be a way to 'enter' a buildworld and just rebuild or
reinstall small specified parts of it.
Unfortunately at the moment I see no option other than a lot of
WITHOUT_XXX and 'build everything'.


Julian

The 'buildenv' target does the enter a buildworld thing.  Just make
buildenv and you get a shell with all the environment variables set up
for doing builds (or cross-builds if you set TARGET_ARCH) within that
source tree.  If csh isn't your favorite shell, set BUILDENV_SHELL in
your environment.  There's also a buildenvvars target that will let
you capture the environment you need so that you can use it within your
own build scripts without needing an interactive shell.

-- Ian





oh man that is just what I'm looking for
Is there a single command for populating the  buildenv resources?
i.e. to compile and install all the tools and libraries (and includes
etc) (into /usr/obj/usr/src/tmp... )

make toolchain should do that.  There's also kernel-toolchain for
building just the kernel; I think the only difference between the two is
that kernel-toolchain doesn't build userland includes and libs.

excellent !


-- Ian






___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to freebsd-current-unsubscr...@freebsd.org


Re: Make variables to force non default libraries and includes?

2014-04-28 Thread Alfred Perlstein

On 4/28/14 12:48 AM, Julian Elischer wrote:
I need to do the equivalent of  cd /usr/src/cddl/usr.sbin/dtrace; 
make DESTDIR=/mumble all install


but it pulls in libraries from the base system, which differ slightly 
from those in the source tree.


How can I force it to use /mumble2/include and /mumble2/lib instead of 
/ ?


I can pre-populate /mumble2 using make buildworld, make libraries, 
and make includes but
I need to be able to do selective builds of just subdirectories after 
that..  I haven't spotted the right way of forcing the use of the 
--system_root /mumble2 option in the compiles.


I know we do it in 'buildworld' is there a more generic way?

I have been looking in the .mk files but I haven't spotted it so far.

There may be a way to use bsd.*.mk to do this, however we just use 
chroots + nullfs mounts.


Basically we buildworld into a directory and then nullfs mount our other 
sources under it, then we chroot to that build.


I recommend doing this (or even using vms) as it's way too easy to 
introduce contamination from the host build environment otherwise.


-Alfred

___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to freebsd-current-unsubscr...@freebsd.org


Re: Make variables to force non default libraries and includes?

2014-04-28 Thread Julian Elischer

On 4/28/14, 11:57 PM, Alfred Perlstein wrote:

On 4/28/14 12:48 AM, Julian Elischer wrote:
I need to do the equivalent of  cd /usr/src/cddl/usr.sbin/dtrace; 
make DESTDIR=/mumble all install


but it pulls in libraries from the base system, which differ 
slightly from those in the source tree.


How can I force it to use /mumble2/include and /mumble2/lib instead 
of / ?


I can pre-populate /mumble2 using make buildworld, make 
libraries, and make includes but
I need to be able to do selective builds of just subdirectories 
after that..  I haven't spotted the right way of forcing the use of 
the --system_root /mumble2 option in the compiles.


I know we do it in 'buildworld' is there a more generic way?

I have been looking in the .mk files but I haven't spotted it so far.

There may be a way to use bsd.*.mk to do this, however we just use 
chroots + nullfs mounts.


Basically we buildworld into a directory and then nullfs mount our 
other sources under it, then we chroot to that build.


I recommend doing this (or even using vms) as it's way too easy to 
introduce contamination from the host build environment otherwise.


we already do this.. but it's more complicated than that..
we end up needing both a chroot (as a stable build environment) AND
a separate toolchain directory (like buildworld uses) which can be 
perturbed by some of our local sources..

anyhow, I now have the answer as to what to use..
make buildenv   and make toolchain are the two points of interst 
for what I need.




-Alfred

___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to 
freebsd-current-unsubscr...@freebsd.org





___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to freebsd-current-unsubscr...@freebsd.org


Re: Make variables to force non default libraries and includes?

2014-04-28 Thread Warner Losh

On Apr 28, 2014, at 1:48 AM, Julian Elischer jul...@freebsd.org wrote:

 I need to do the equivalent of  cd /usr/src/cddl/usr.sbin/dtrace; make 
 DESTDIR=/mumble all install”

cd /usr/src
make distributeworld DESTDIR=/mumble
cd cddl/usr.sbin/dtrace
make buildenv
make all install

 but it pulls in libraries from the base system, which differ slightly from 
 those in the source tree.

The above will create the right /mumble hierarchy, and will pull the libraries 
from the build rather than the local system.

 How can I force it to use /mumble2/include and /mumble2/lib instead of / ?
 
 I can pre-populate /mumble2 using make buildworld, make libraries, and 
 make includes but
 I need to be able to do selective builds of just subdirectories after that..  
 I haven't spotted the right way of forcing the use of the --system_root 
 /mumble2 option in the compiles.
 
 I know we do it in 'buildworld' is there a more generic way?
 
 I have been looking in the .mk files but I haven't spotted it so far.

You’re asking for some serious split-brain action. chroot builds are likely 
your best option. There’s no easy way to force this, although you might get 
some milage out of WMAKEENV options, but I think we bake most of the where to 
look for things options into the binaries. One crazy option would be to set 
CC=“cc —sysroot /mumble” but I’m sure there be dragons there…

Good luck with this crazy, never have we supported it very well, option :)

Warner

___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to freebsd-current-unsubscr...@freebsd.org


Re: Make variables to force non default libraries and includes?

2014-04-28 Thread Ian Lepore
On Mon, 2014-04-28 at 18:36 -0600, Warner Losh wrote:
 On Apr 28, 2014, at 1:48 AM, Julian Elischer jul...@freebsd.org wrote:
 
  I need to do the equivalent of  cd /usr/src/cddl/usr.sbin/dtrace; make 
  DESTDIR=/mumble all install”
 
 cd /usr/src
 make distributeworld DESTDIR=/mumble
 cd cddl/usr.sbin/dtrace
 make buildenv
 make all install
 
  but it pulls in libraries from the base system, which differ slightly from 
  those in the source tree.
 
 The above will create the right /mumble hierarchy, and will pull the 
 libraries from the build rather than the local system.
 
  How can I force it to use /mumble2/include and /mumble2/lib instead of / ?
  
  I can pre-populate /mumble2 using make buildworld, make libraries, and 
  make includes but
  I need to be able to do selective builds of just subdirectories after 
  that..  I haven't spotted the right way of forcing the use of the 
  --system_root /mumble2 option in the compiles.
  
  I know we do it in 'buildworld' is there a more generic way?
  
  I have been looking in the .mk files but I haven't spotted it so far.
 
 You’re asking for some serious split-brain action. chroot builds are likely 
 your best option. There’s no easy way to force this, although you might get 
 some milage out of WMAKEENV options, but I think we bake most of the where to 
 look for things options into the binaries. One crazy option would be to set 
 CC=“cc —sysroot /mumble” but I’m sure there be dragons there…
 
 Good luck with this crazy, never have we supported it very well, option :)
 
 Warner

Actually the hooks are in place to do this stuff.  Instead of make
buildenv to get an interactive shell you can do something like

  BLDENV=`${MAKE} buildenvvars`
  chroot buildchroot/ env -i $${BLDENV} cd /usr/src/somewhere  \
   make all install 

-- Ian


___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to freebsd-current-unsubscr...@freebsd.org

Re: Make variables to force non default libraries and includes?

2014-04-28 Thread Julian Elischer

On 4/29/14, 8:57 AM, Ian Lepore wrote:

On Mon, 2014-04-28 at 18:36 -0600, Warner Losh wrote:

On Apr 28, 2014, at 1:48 AM, Julian Elischer jul...@freebsd.org wrote:


I need to do the equivalent of  cd /usr/src/cddl/usr.sbin/dtrace; make 
DESTDIR=/mumble all install”

cd /usr/src
make distributeworld DESTDIR=/mumble
cd cddl/usr.sbin/dtrace
make buildenv
make all install


but it pulls in libraries from the base system, which differ slightly from 
those in the source tree.

The above will create the right /mumble hierarchy, and will pull the libraries 
from the build rather than the local system.


How can I force it to use /mumble2/include and /mumble2/lib instead of / ?

I can pre-populate /mumble2 using make buildworld, make libraries, and make 
includes but
I need to be able to do selective builds of just subdirectories after that..  I haven't 
spotted the right way of forcing the use of the --system_root /mumble2 option 
in the compiles.

I know we do it in 'buildworld' is there a more generic way?

I have been looking in the .mk files but I haven't spotted it so far.

You’re asking for some serious split-brain action. chroot builds are likely 
your best option. There’s no easy way to force this, although you might get 
some milage out of WMAKEENV options, but I think we bake most of the where to 
look for things options into the binaries. One crazy option would be to set 
CC=“cc —sysroot /mumble” but I’m sure there be dragons there…

Good luck with this crazy, never have we supported it very well, option :)

Warner

Actually the hooks are in place to do this stuff.  Instead of make
buildenv to get an interactive shell you can do something like

   BLDENV=`${MAKE} buildenvvars`
   chroot buildchroot/ env -i $${BLDENV} cd /usr/src/somewhere  \
make all install

-- Ian




Is there a way to specify a different toolchain destination? i.e. not 
/usr/obj/usr/src/tmp ?



___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to freebsd-current-unsubscr...@freebsd.org