aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rwxr-xr-xtools/ck-copyright-notice54
-rwxr-xr-xtools/ck-version-info67
-rwxr-xr-xtools/get_patches.sh34
3 files changed, 155 insertions, 0 deletions
diff --git a/tools/ck-copyright-notice b/tools/ck-copyright-notice
new file mode 100755
index 0000000..aec5831
--- /dev/null
+++ b/tools/ck-copyright-notice
@@ -0,0 +1,54 @@
+#!/bin/sh
+
+# Copyright 2008, 2009, 2010, 2011, 2012, 2013 Free Software Foundation, Inc.
+# This script is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+# ck-copyright-notice can be run from the tools directory
+dir=`pwd`
+[ -d src ] || [ "`basename "$dir"`" != tools ] || cd ..
+
+# Note: if paragraphs are reformatted, this may need to be updated.
+
+lgpl="`sed -n '/version [0-9.]* or any later version/ {
+ s/.*version //
+ s/ or.*//
+ p
+ q
+ }' doc/mpfr.texi`"
+
+# Do not use "find ... | while read file do ... done" because the "do"
+# part needs to be run in the current shell, and some shells behave in
+# a different way.
+srctests=`find src tests -name '*.[ch]'`
+
+err=0
+for file in $srctests
+do
+ y=""
+ case $file in
+ tests/RRTest.c)
+ # This file doesn't have a copyright notice, but isn't distributed.
+ continue ;;
+ src/mpfr-longlong.h)
+ # This file (which comes from GMP) has a specific copyright notice.
+ continue ;;
+ src/get_patches.c)
+ file="tools/get_patches.sh" ;;
+ */mparam.h)
+ y="2005," ;;
+ esac
+ grep -q "Copyright $y.* Free Software Foundation" "$file" && \
+ grep -q "GNU MPFR Library" "$file" && \
+ grep -q "either version $lgpl of the License" "$file" && continue
+ echo "Possibly missing or incorrect copyright notice in $file"
+ err=1
+done
+
+exit $err
diff --git a/tools/ck-version-info b/tools/ck-version-info
new file mode 100755
index 0000000..7d39d8a
--- /dev/null
+++ b/tools/ck-version-info
@@ -0,0 +1,67 @@
+#!/usr/bin/env perl
+
+# Note: this script must not be used to build MPFR due to the
+# dependency on perl, but this is OK for "make dist".
+
+# Copyright 2010, 2011, 2012, 2013 Free Software Foundation, Inc.
+# This script is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+use strict;
+use Cwd;
+
+if (! -d 'src')
+ {
+ getcwd() =~ m,/tools$,
+ or die "Execute $0 from the MPFR source directory\n";
+ chdir '..' or die "$!\n$0: can't change cwd\n";
+ }
+
+open VERSION, '<', 'VERSION'
+ or die "$!\n$0: can't open VERSION file\n";
+my $version = do { local $/; <VERSION> };
+close VERSION or die "$!\n$0: can't close VERSION file\n";
+
+my ($mv,$pl,$suf) = $version =~ /^(\d+\.\d+)\.(\d+)(-\S+)?/
+ or die "$0: bad VERSION format\n";
+
+open MF, '<', 'src/Makefile.am'
+ or die "$!\n$0: can't open Makefile.am file\n";
+my $cur = 0;
+my $age = -1;
+my $vinfo; # expected -version-info value
+while (<MF>)
+ {
+ last if $cur && ! /^\s*(#.*)$/;
+ /^#\s+(\d+\.\d+)\.x\s+(\d+):x:(\d+)/ or next;
+ $2 == ++$cur or die "$0: bad CURRENT ($2)";
+ $3 == 0 || $3 == $age + 1 or die "$0: bad AGE ($3)";
+ $age = $3;
+ $mv eq $1 and $vinfo = "$cur:$pl:$age";
+ }
+/^libmpfr_la_LDFLAGS\s+=.*\s-version-info\s+(\d+:\d+:\d+)\s/
+ or die "$0: missing correct libmpfr_la_LDFLAGS line";
+close MF or die "$!\n$0: can't close Makefile.am file\n";
+$suf eq '-dev' || $vinfo eq $1
+ or die "$0: bad -version-info value ($1 instead of $vinfo)\n";
+
+open CONFIGURE, '<', 'configure.ac'
+ or die "$!\n$0: can't open configure.ac file\n";
+my $dllversion = $cur - $age;
+my $dllvinconf;
+while (<CONFIGURE>)
+ {
+ /^\s*LIBMPFR_LDFLAGS\s*=.*-Wl,--output-def,\.libs\/libmpfr-(\d+)\.dll\.def/
+ and $dllvinconf = $1, last;
+ }
+close CONFIGURE or die "$!\n$0: can't close configure.ac file\n";
+defined $dllvinconf or die "$0: missing correct LIBMPFR_LDFLAGS line\n";
+$suf eq '-dev' || $dllversion eq $dllvinconf
+ or die "$0: bad libmpfr.dll-version value (libmpfr-$dllvinconf.dll.def".
+ " instead of libmpfr-$dllversion.dll.def)\n";
diff --git a/tools/get_patches.sh b/tools/get_patches.sh
new file mode 100755
index 0000000..872b006
--- /dev/null
+++ b/tools/get_patches.sh
@@ -0,0 +1,34 @@
+#!/bin/sh
+
+cat <<EOF
+/* mpfr_get_patches -- Patches that have been applied
+
+Copyright 2007, 2008, 2009, 2010, 2011, 2012, 2013 Free Software Foundation, Inc.
+Contributed by the AriC and Caramel projects, INRIA.
+
+This file is part of the GNU MPFR Library.
+
+The GNU MPFR Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU Lesser General Public License as published by
+the Free Software Foundation; either version 3 of the License, or (at your
+option) any later version.
+
+The GNU MPFR Library is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+License for more details.
+
+You should have received a copy of the GNU Lesser General Public License
+along with the GNU MPFR Library; see the file COPYING.LESSER. If not, see
+http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc.,
+51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. */
+
+#include "mpfr-impl.h"
+
+const char *
+mpfr_get_patches (void)
+{
+EOF
+
+echo ' return "'`cat PATCHES`'";'
+echo '}'