[xmlsec] ABS_%DIR vs abs_%dir

Roumen Petrov xmlsec at roumenpetrov.info
Sun Oct 25 09:58:25 PST 2009


Hi All,

the current version adds some makefile macros(variables). It seems to 
that implementation is incorrect.

Lets see following makefile:
=============================================
ABS_BUILDDIR=$(shell echo ABS_BUILDDIR)
ABS_SRCDIR=$(shell echo ABS_SRCDIR)

all:
	@echo all
	@ABS_BUILDDIR=XX$(ABS_BUILDDIR); echo $$ABS_BUILDDIR; echo $(ABS_BUILDDIR)
	@echo $(ABS_SRCDIR)
=============================================
The difference is that make macro is evaluated in the target commands.

The issue for xmlsec is that tests fail to run if build and source 
directory differ. Simple solutions is to use variables in targers, i.e. 
$$ABS_BUILDDIR. I guess this will resolve issue but see below ...


Another issue is portability. As I know $(shell ...) is specific to GNU 
make and may is not implemented in other make implementations.


What about to use abs_%dirs as in attached file xmlsec-abs_dir.patch. 
Note this is not complete patch !

The idea is to replease ABS_%DIR macros with values substituted from 
configure script.

According autoconf change log "2001-12-13  Peter Eisentraut 
<peter_e at gmx.net>" adds abs_%dir and for first time version 2.52g 
substitute them in files.
So abs%dir support require configure.in to be changed : AC_PREREQ(2.2) 
-> AC_PREREQ([2.52g])


Next is automake. I could not found first automake version that adds 
paths like abs_%dir to generated file. According my knowledge and test 
it is 1.10. This is not problem as in Makefile.am we can just add as 
example "abs_top_builddir = @abs_top_builddir@" and this will work with 
1.10+ and earlier.
So abs%dir support don't require changes in configure.in 
(AM_INIT_AUTOMAKE([1.7])) .  It require only to add abs_XXX variables to 
Makefile.am for backward compatibility with pre 1.10 versions of automake.


Also instead abs_top_%dir makefile could use abs_%dir.


Regards,
Roumen
-------------- next part --------------
A non-text attachment was scrubbed...
Name: xmlsec-abs_dir.patch
Type: text/x-diff
Size: 2809 bytes
Desc: not available
Url : http://www.aleksey.com/pipermail/xmlsec/attachments/20091025/7f61caaf/xmlsec-abs_dir.bin


More information about the xmlsec mailing list