Re: Normalized absolute path

2014-12-22 Thread Stefano Lattarini

On 12/19/2014 11:58 PM, Kip Warner wrote:

Hey list,

I am attempting to set a variable in my Makefile.am that contains a
normalized absolute path. I am doing this because another application
invoked through one of my rules breaks when fed a relative path and it
needs it.

 PATH_WORKAROUND=$(realpath abs_top_builddir)/Tests/some_file.foo

I have tried the above and too many syntactical variations, but automake
complains about all of them when I try to achieve the intention of the
above.

Respectfully,


I guess Automake is just complaining about GNU make specific
constructs ('$(replapth ...)' in this case) that would cause
other make implementations to choke.  You might need to add
AUTOMAKE_OPTIONS = -Wno-portability to the Makefile(s) using
such constructs (I assume you are OK with mandating the use of
GNU make to build your package).

HTH,
  Stefano



Re: Normalized absolute path

2014-12-22 Thread Kip Warner
On Mon, 2014-12-22 at 11:09 +0100, Stefano Lattarini wrote:
 I guess Automake is just complaining about GNU make specific
 constructs ('$(replapth ...)' in this case) that would cause
 other make implementations to choke.  You might need to add
 AUTOMAKE_OPTIONS = -Wno-portability to the Makefile(s) using
 such constructs (I assume you are OK with mandating the use of
 GNU make to build your package).

Hey Stefano,

I'd prefer to keep it portable, so I wonder if it's possible to invoke
things like realpath directly from the shell if realpath is present on
the system?

-- 
Kip Warner -- Senior Software Engineer
OpenPGP encrypted/signed mail preferred
http://www.thevertigo.com


signature.asc
Description: This is a digitally signed message part


Re: Normalized absolute path

2014-12-22 Thread Kip Warner
On Mon, 2014-12-22 at 17:24 +0100, Stefano Lattarini wrote:
 You might be able to use:
 
   PATH_WORKAROUND = `relpath $(abs_top_builddir)/Tests/some_file.foo`
 
 But then you must be aware that $(PATH_WORKAROUND) cannot be used
 as a file at make level (i.e., can't be a prerequisite, or a target,
 and so on), and can only be used as a shorthand in the shell code
 of your recipes.

Thanks Stefano. What I ended up doing that may be helpful for others
without relying on non-portable extensions to Make was the following...

PATH_WORKAROUND != mktemp --suffix=.dtshd.spdif --dry-run

...to generate a path the ALSA file writer plugin can write out to which
is absolute, normalized, and (should) contains no spaces.

-- 
Kip Warner -- Senior Software Engineer
OpenPGP encrypted/signed mail preferred
http://www.thevertigo.com


signature.asc
Description: This is a digitally signed message part


Normalized absolute path

2014-12-20 Thread Kip Warner
Hey list,

I am attempting to set a variable in my Makefile.am that contains a
normalized absolute path. I am doing this because another application
invoked through one of my rules breaks when fed a relative path and it
needs it.

PATH_WORKAROUND=$(realpath abs_top_builddir)/Tests/some_file.foo

I have tried the above and too many syntactical variations, but automake
complains about all of them when I try to achieve the intention of the
above.

Respectfully,

-- 
Kip Warner -- Senior Software Engineer
OpenPGP encrypted/signed mail preferred
http://www.thevertigo.com


signature.asc
Description: This is a digitally signed message part