[singular] 02/03: sanitize cf_gmp.h generation

felix salfelder felix-guest at moszumanska.debian.org
Tue May 20 06:39:11 UTC 2014


This is an automated email from the git hooks/post-receive script.

felix-guest pushed a commit to branch master
in repository singular.

commit 03aaa9d48eb8319fb22028a29fbc326128e2ba25
Author: Felix Salfelder <felix at salfelder.org>
Date:   Tue Aug 20 13:52:48 2013 +0200

    sanitize cf_gmp.h generation
    
    this is similar to
    http://trac.sagemath.org/attachment/ticket/14737/sanitize_gmp_header_hack.patch
---
 factory/GNUmakefile.in      | 14 ++++++++------
 factory/gen_cf_gmp.template |  3 ---
 2 files changed, 8 insertions(+), 9 deletions(-)

diff --git a/factory/GNUmakefile.in b/factory/GNUmakefile.in
index cb28207..45836f9 100644
--- a/factory/GNUmakefile.in
+++ b/factory/GNUmakefile.in
@@ -684,9 +684,11 @@ GNUmakefile:	GNUmakefile.in config.status
 config.status:	configure
 		./config.status --recheck
 
-# create cf_gmp.h
-cf_gmp.h: gen_cf_gmp.template
-	echo "#!/bin/sh" >gen_cf_gmp.sh 
-	echo "GMP_H_T=\"`$(CXX) $(LIBCXXFLAGS) -M gen_cf_gmp.cc|grep gmp.h` \"" >>gen_cf_gmp.sh 
-	cat gen_cf_gmp.template >>gen_cf_gmp.sh
-	$(SHELL) gen_cf_gmp.sh
+GMP_H_ = $(shell echo '\#include <gmp.h>' | $(CXX) $(LIBCXXFLAGS) -E - -M -MP | grep 'gmp\.h:$$' )
+GMP_H__ = $(GMP_H_:.h:=.h)
+
+cf_gmp.h: GNUmakefile $(GMP_H__)
+	@echo "Generating $@ from $(GMP_H__)...";
+	test -f "$(GMP_H__)"
+	grep -v '__GMP_DECLSPEC_XX|std::FILE' $(GMP_H__) > $@T
+	diff $@T $@ >/dev/null 2>/dev/null && rm $@T || mv $@T $@
diff --git a/factory/gen_cf_gmp.template b/factory/gen_cf_gmp.template
deleted file mode 100644
index 90389ac..0000000
--- a/factory/gen_cf_gmp.template
+++ /dev/null
@@ -1,3 +0,0 @@
-GMP_H=`echo $GMP_H_T| sed -e 's/^.*gmp.cc//' -e 's/ .$//'`
-echo generating cf_gmp.h from $GMP_H
-cat $GMP_H | grep -v __GMP_DECLSPEC_XX |grep -v std::FILE > cf_gmp.h

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/singular.git



More information about the debian-science-commits mailing list