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 <[email protected]>" 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
diff --git a/Makefile.am b/Makefile.am
index 778bc45..90a98c5 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -48,28 +48,24 @@ EXTRA_CLEAN = \
 	examples \
 	$(NULL)
 
-ABS_BUILDDIR=$(shell pwd)
 if XMLSEC_NO_APPS_CRYPTO_DYNAMIC_LOADING
 PRECHECK_COMMANDS = \
-	ABS_BUILDDIR=$(ABS_BUILDDIR) && \
-	cd $(top_srcdir) \
+	cd $(abs_top_srcdir) \
 	$(NULL)
 CHECK_CRYPTO_LIST = \
 	"default" \
 	$(NULL)
 else
 PRECHECK_COMMANDS= \
-	ABS_BUILDDIR=$(ABS_BUILDDIR) && \
 	for i in $(XMLSEC_CRYPTO_LIST) ; do \
-	    export LD_LIBRARY_PATH="$(ABS_BUILDDIR)/src/$$i/.libs:$$LD_LIBRARY_PATH" ; \
+	    export LD_LIBRARY_PATH="$(abs_top_builddir)/src/$$i/.libs:$$LD_LIBRARY_PATH" ; \
 	done && \
-	cd $(top_srcdir) \
+	cd $(abs_top_srcdir) \
 	$(NULL)	
 CHECK_CRYPTO_LIST = \
 	$(XMLSEC_CRYPTO_LIST) \
 	$(NULL)
 endif
-ABS_SRCDIR=$(shell pwd)
 
 docs: docs-man
 	@(cd docs && $(MAKE) docs)
@@ -86,9 +82,9 @@ check-all: $(TEST_APP)
 	@($(PRECHECK_COMMANDS) && \
 	for i in $(CHECK_CRYPTO_LIST) ; do \
 	    echo "=================== Checking xmlsec-$$i =================================" && \
-	    $(SHELL) ./tests/testKeys.sh $$i $(ABS_SRCDIR)/tests $(ABS_BUILDDIR)/$(TEST_APP) der && \
-	    $(SHELL) ./tests/testDSig.sh $$i $(ABS_SRCDIR)/tests $(ABS_BUILDDIR)/$(TEST_APP) der && \
-	    $(SHELL) ./tests/testEnc.sh  $$i $(ABS_SRCDIR)/tests $(ABS_BUILDDIR)/$(TEST_APP) der ; \
+	    $(SHELL) ./tests/testKeys.sh $$i $(abs_top_srcdir)/tests $(abs_top_builddir)/$(TEST_APP) der && \
+	    $(SHELL) ./tests/testDSig.sh $$i $(abs_top_srcdir)/tests $(abs_top_builddir)/$(TEST_APP) der && \
+	    $(SHELL) ./tests/testEnc.sh  $$i $(abs_top_srcdir)/tests $(abs_top_builddir)/$(TEST_APP) der ; \
 	done; )
 
 check-info:
@@ -103,19 +99,19 @@ check-info:
 
 check-km: $(TEST_APP)
 	@($(PRECHECK_COMMANDS) && \
-	$(SHELL) ./tests/testKeys.sh default $(ABS_SRCDIR)/tests $(ABS_BUILDDIR)/$(TEST_APP) der)
+	$(SHELL) ./tests/testKeys.sh default $(abs_top_srcdir)/tests $(abs_top_builddir)/$(TEST_APP) der)
 
 check-dsig: $(TEST_APP) 	
 	@($(PRECHECK_COMMANDS) && \
-	$(SHELL) ./tests/testDSig.sh default $(ABS_SRCDIR)/tests $(ABS_BUILDDIR)/$(TEST_APP) der)
+	$(SHELL) ./tests/testDSig.sh default $(abs_top_srcdir)/tests $(abs_top_builddir)/$(TEST_APP) der)
 
 check-xkms: $(TEST_APP) 	
 	@($(PRECHECK_COMMANDS) && \
-	$(SHELL) ./tests/testXKMS.sh default $(ABS_SRCDIR)/tests $(ABS_BUILDDIR)/$(TEST_APP) der)
+	$(SHELL) ./tests/testXKMS.sh default $(abs_top_srcdir)/tests $(abs_top_builddir)/$(TEST_APP) der)
 
 check-enc: $(TEST_APP) 
 	@($(PRECHECK_COMMANDS) && \
-	$(SHELL) ./tests/testEnc.sh  default $(ABS_SRCDIR)/tests $(ABS_BUILDDIR)/$(TEST_APP) der)
+	$(SHELL) ./tests/testEnc.sh  default $(abs_top_srcdir)/tests $(abs_top_builddir)/$(TEST_APP) der)
 
 memcheck-res:
 	@grep -i lost /tmp/*.log | sed 's/==.*== *//' | sort -u
_______________________________________________
xmlsec mailing list
[email protected]
http://www.aleksey.com/mailman/listinfo/xmlsec

Reply via email to