[singular] 29/45: sanitize cf_gmp.h generation

felix salfelder felix-guest at alioth.debian.org
Sat Sep 14 13:57:06 UTC 2013


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

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

commit 77dc62e5ef186d11b5d376af96bc0b71471387f0
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 f2b9c96..0279a51 100644
--- a/factory/GNUmakefile.in
+++ b/factory/GNUmakefile.in
@@ -696,9 +696,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