[sudo-workers] [PATCH] pass _PATH_SUDO_PLUGIN_DIR via CPPFLAGS/Makefile so we can get multiple expansion of variables (rather than the current single expansion with `eval` that does not always work)

Mike Frysinger vapier at gentoo.org
Tue Nov 22 13:54:27 EST 2011


On Tuesday 22 November 2011 13:38:07 Todd C. Miller wrote:
> On Wed, 16 Nov 2011 10:55:31 EST, Mike Frysinger wrote:
> > pass _PATH_SUDO_PLUGIN_DIR via CPPFLAGS/Makefile so we can get multiple
> > expan sion of variables (rather than the current single expansion with
> > `eval` that does not always work)
> 
> Can you give an example of what did not work for you?  I'd prefer
> to have _PATH_SUDO_PLUGIN_DIR defined in pathnames.h and not on the
> command line (which is crowded enough as it is).  If it is just a
> matter of calling eval multiple times that is not a big deal.

i tried to do:
	./configure --with-plugindir='${libdir}/sudo'
and it blew up because by default:
	exec_prefix='/usr/local'
	libdir='${exec_prefix}/lib'

which means plugindir started off as:
	plugindir='${libdir}/sudo'
and after a single eval became:
	plugindir='${exec_prefix}/lib/sudo'

allowing the expansion to occur at `make` time tends to be the common behavior 
in autotool based projects.  but if you really want to stick to configure+eval, 
i guess something like this should work:
	_plugindir=
	while [ "${_plugindir}" != "${plugindir}" ] ; do
		_plugindir=${plugindir}
		eval plugindir=\"${plugindir}\"
	done
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: </pipermail/sudo-workers/attachments/20111122/15bd87eb/attachment.bin>


More information about the sudo-workers mailing list