1diff -rNU3 dist.orig/Makefile.in dist.nbsd/Makefile.in
2--- dist.orig/Makefile.in	2013-03-13 16:38:22.000000000 +0100
3+++ dist.nbsd/Makefile.in	2015-10-16 08:31:48.000000000 +0200
4@@ -337,8 +337,12 @@
5 	$(SHELL) ./config.status --recheck
6
7 $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
8+	@echo "NOT REBUILDING $@"
9+NetBSD_DISABLED_configure:
10 	$(am__cd) $(srcdir) && $(AUTOCONF)
11 $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
12+	@echo "NOT REBUILDING $@"
13+NetBSD_DISABLED_aclocal:
14 	$(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
15 $(am__aclocal_m4_deps):
16
17diff -rNU3 dist.orig/PATCHES dist.nbsd/PATCHES
18--- dist.orig/PATCHES	2013-03-13 16:37:38.000000000 +0100
19+++ dist.nbsd/PATCHES	2015-10-16 08:31:48.000000000 +0200
20@@ -0,0 +1,4 @@
21+texp-zero
22+atan-expo-range
23+rec_sqrt-carry
24+asin_exprange
25diff -rNU3 dist.orig/src/Makefile.in dist.nbsd/src/Makefile.in
26--- dist.orig/src/Makefile.in	2013-03-13 16:38:21.000000000 +0100
27+++ dist.nbsd/src/Makefile.in	2015-10-16 08:31:48.000000000 +0200
28@@ -921,6 +921,8 @@
29 # should not be a problem in practice, in particular because "make dist"
30 # automatically rebuilds get_patches.c before generating the archives.
31 $(srcdir)/get_patches.c: $(top_srcdir)/PATCHES $(top_srcdir)/tools/get_patches.sh
32+	@echo "NOT REBUILDING $@"
33+NetBSD_DISABLED_get_patches.c:
34 	(cd $(top_srcdir) && ./tools/get_patches.sh) > $@ || rm -f $@
35
36 # Do not add get_patches.c to CLEANFILES so that this file doesn't
37diff -rNU3 dist.orig/src/mpfr-longlong.h dist.nbsd/src/mpfr-longlong.h
38--- dist.orig/src/mpfr-longlong.h	2013-03-13 16:37:32.000000000 +0100
39+++ dist.nbsd/src/mpfr-longlong.h	2014-03-25 16:28:15.000000000 +0100
40@@ -1022,7 +1022,7 @@
41 #endif /* __m88000__ */
42
43 #if defined (__mips) && W_TYPE_SIZE == 32
44-#if __GMP_GNUC_PREREQ (4,4)
45+#if __GMP_GNUC_PREREQ (4,4) || defined(__clang__)
46 #define umul_ppmm(w1, w0, u, v) \
47   do {									\
48     UDItype __ll = (UDItype)(u) * (v);					\
49@@ -1044,7 +1044,7 @@
50 #endif /* __mips */
51
52 #if (defined (__mips) && __mips >= 3) && W_TYPE_SIZE == 64
53-#if __GMP_GNUC_PREREQ (4,4)
54+#if __GMP_GNUC_PREREQ (4,4) || defined(__clang__)
55 #define umul_ppmm(w1, w0, u, v) \
56   do {									\
57     typedef unsigned int __ll_UTItype __attribute__((mode(TI)));	\
58@@ -1160,7 +1160,7 @@
59   __asm__ ("{cntlz|cntlzw} %0,%1" : "=r" (count) : "r" (x))
60 #define COUNT_LEADING_ZEROS_0 32
61 #if HAVE_HOST_CPU_FAMILY_powerpc
62-#if __GMP_GNUC_PREREQ (4,4)
63+#if __GMP_GNUC_PREREQ (4,4) || defined(__clang__)
64 #define umul_ppmm(w1, w0, u, v) \
65   do {									\
66     UDItype __ll = (UDItype)(u) * (v);					\
67@@ -1259,7 +1259,7 @@
68 #define count_leading_zeros(count, x) \
69   __asm__ ("cntlzd %0,%1" : "=r" (count) : "r" (x))
70 #define COUNT_LEADING_ZEROS_0 64
71-#if __GMP_GNUC_PREREQ (4,4)
72+#if __GMP_GNUC_PREREQ (4,4) || defined(__clang__)
73 #define umul_ppmm(w1, w0, u, v) \
74   do {									\
75     typedef unsigned int __ll_UTItype __attribute__((mode(TI)));	\
76