Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 22 Sep 2013 19:27:10 -0400
From:      Glen Barber <gjb@FreeBSD.org>
To:        Ian Lepore <ian@FreeBSD.org>
Cc:        FreeBSD Hackers <freebsd-hackers@FreeBSD.org>, freebsd-current <freebsd-current@FreeBSD.org>
Subject:   Re: The right way to invoke sh from a freebsd makefile?
Message-ID:  <20130922232710.GD2336@glenbarber.us>
In-Reply-To: <1379891905.1197.115.camel@revolution.hippie.lan>
References:  <1379891905.1197.115.camel@revolution.hippie.lan>

next in thread | previous in thread | raw e-mail | index | archive | help

--Km1U/tdNT/EmXiR1
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Sun, Sep 22, 2013 at 05:18:25PM -0600, Ian Lepore wrote:
> What's the right way to launch the bourne shell from a makefile?  I had
> assumed the ${SHELL} variable would be set to "the right" copy
> of /bin/sh (like maybe the one in tmp or legacy at various stages).  It
> appears that that's not the case, and ${SHELL} is whatever comes from
> the environment, which can lead to using csh or bash or whatever.
>=20
> I see some of our makefiles use just a bare "sh" which seems reasonable
> to me, but I don't want to glitch this in src/include/Makefile again.
> The goal is to run a script in src/include/Makefile by launching sh with
> the script name (as opposed to launching the script and letting the #!
> do its thing, which doesn't work if the source dir is mounted noexec).
>=20

I think BUILDENV_SHELL is what you are looking for.  For this specific
case, I think instead of '#!/bin/sh', maybe '#!/usr/bin/env sh' may be
preferable.

Glen


--Km1U/tdNT/EmXiR1
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.21 (FreeBSD)

iQEcBAEBCAAGBQJSP3zOAAoJEFJPDDeguUajdYEH/AqxeG19/GGa9zYHLmaqxr+4
sjDJ9Y++f99y+1XLTRdjwPZWRY/8g/nMpXEs42y+HP1Ap2CTdlyCom+i//cQUQSL
DKGfJosGErZpuEIxXHXeou7LKg1mNtKNHe+JW0O5vC9GWOFB+9D1y6iR9RHX9V/l
LLQIC9h7jRJAoqLMJ24f2y6zgYWjaMqEvSHNS6+756y126QxjY058bTHDg1stOIE
WoLRaYydLhDWp80go6m0Os34VRks/HgcKOCCi6RBQi7BV/pu7303vchamSOxCW5W
ACOjGtXBP7jM44MQzHf6KmKLeoBffTSqY5VzZyHxpTYqTmwPpTNi7/YdMtOhUT8=
=PS+8
-----END PGP SIGNATURE-----

--Km1U/tdNT/EmXiR1--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20130922232710.GD2336>