1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214
|
# -*- makefile -*-
# rules to patch the unpacked files in the source directory
# ---------------------------------------------------------------------------
# various rules to unpack addons and (un)apply patches.
# - patch / apply-patches
# - unpatch / reverse-patches
.NOTPARALLEL:
patchdir = debian/patches
# which patches should be applied?
debian_patches =
ifneq ($(GFDL_INVARIANT_FREE),yes)
debian_patches += \
rename-info-files \
pr14925-doc \
gcc-doc-locale
endif
debian_patches += \
pr14925 \
pr17684 \
pr18153 \
pr18380 \
pr18508 \
pr10692 \
pr23241 \
gcc-version \
libf2c-update \
libobjc-update \
libstdc++-pic libstdc++-doclink \
gccbug \
gccbug-posix \
hppa-libffi hppa-libjava \
libffi-config \
i386-mtune \
link-libs \
gcc-mips-update \
collect2-open \
fix-siginfo-type \
fix-ucontext-type \
ifeq ($(GFDL_INVARIANT_FREE),yes)
debian_patches += \
fastjar-doc
endif
# cvs-updates \
debian_patches += libtool-rpath
debian_patches += multiarch
ifeq ($(with_multiarch),yes)
debian_patches += multiarch-include
endif
ifeq ($(with_java),yes)
debian_patches += gcj-without-rpath
endif
ifeq ($(with_libffi),yes)
debian_patches += libffi-install libffi-no-debug
ifneq ($(with_java),yes)
debian_patches += libffi-without-libgcj
endif
endif
ifeq ($(with_proto),yes)
debian_patches += deb-protoize
endif
ifeq ($(with_objc),yes)
debian_patches += libobjc
endif
ifeq ($(with_ada),yes)
ifeq ($(with_libgnat),yes)
debian_patches += ada-link-lib
endif
debian_patches += ada-gcc-name #ada-names
ifeq ($(DEB_TARGET_ARCH),mips)
debian_patches += ada-no-gnatpsta
endif
ifeq ($(DEB_TARGET_ARCH),mipsel)
debian_patches += ada-no-gnatpsta
endif
endif
ifeq ($(with_pascal),yes)
debian_patches += gpc-3.x gpc-range-check
debian_patches += gpc-names
debian_patches += gpc-doc
ifneq ($(with_gpidump),yes)
debian_patches += gpc-no-gpidump
endif
endif
ifeq ($(DEB_TARGET_ARCH),alpha)
debian_patches += alpha-ieee
endif
ifeq ($(DEB_TARGET_ARCH),arm)
debian_patches += arm-tune arm-gotoff arm-ldm
endif
ifeq ($(DEB_TARGET_ARCH),armeb)
debian_patches += arm-tune arm-gotoff arm-ldm pr22528 arm-bigendian
endif
ifneq (,$(findstring $(DEB_TARGET_ARCH),i386))
debian_patches += cpu-default-i486
endif
ifeq ($(DEB_TARGET_ARCH),ia64)
debian_patches += ia64-unwind
endif
ifeq ($(DEB_TARGET_ARCH),hurd-i386)
debian_patches += hurd-changes cpu-default-i586
endif
ifeq ($(DEB_TARGET_ARCH),hppa)
debian_patches += boehm-gc-nocheck
endif
ifeq ($(DEB_TARGET_ARCH),m68k)
debian_patches += m68k-subreg m68k-update2 m68k-update3
endif
ifeq ($(DEB_TARGET_GNU_CPU), $(findstring $(DEB_TARGET_GNU_CPU),mips mipsel))
debian_patches += libstdc++-mips-atomic
endif
ifeq ($(DEB_TARGET_ARCH)-$(biarch),i386-yes)
debian_patches += i386-biarch
endif
ifeq ($(DEB_TARGET_ARCH)-$(biarch),s390-yes)
debian_patches += s390-biarch s390-config-ml s390-ifcvt
endif
ifeq ($(DEB_TARGET_ARCH),sparc)
ifeq ($(biarch),yes)
debian_patches += sparc64-build sparc-config-ml
endif
endif
ifeq ($(biarch),yes)
ifeq ($(DEB_TARGET_ARCH),s390)
debian_patches += biarch-include-s390
else
debian_patches += biarch-include
endif
else
debian_patches += multiarch-include
endif
ifeq ($(DEB_TARGET_ARCH),kfreebsd-i386)
debian_patches += cpu-default-i486
debian_patches += kbsd-gnu
endif
debian_patches += reporting # applied after gcc-cvs-updates
ifdef DEB_CROSS
debian_patches += cross-cpp-installman
endif
# not applied by default
#debian_patches += protector
ifeq ($(findstring linux,$(DEB_TARGET_GNU_SYSTEM)),linux)
debian_patches += configure-deplibs_check_method # applied last
endif
# debian/rules.conf isn't yet sourced
SOURCE_VERSION := $(shell dpkg-parsechangelog | awk '/^Version:/ {print $$NF}')
DEB_VERSION := $(shell echo $(SOURCE_VERSION) | sed 's/ds[0-9]*//')
patch: $(patch_stamp)
$(patch_stamp): $(unpack_stamp) pre-patch \
$(foreach p,$(debian_patches),$(patch_stamp)-$(p))
echo -e "\nPatches that $(distribution) applied in this version:" > pxxx
for i in $(debian_patches); do \
echo -e "\n$$i:" >> pxxx; \
sed -n 's/^# *DP: */ /p' $(patchdir)/$$i.dpatch >> pxxx; \
done
mv -f pxxx $@
pre-patch:
@if [ -x /usr/bin/automake-1.4 ]; then \
: ; \
else \
mkdir -p $(PWD)/bin; \
ln -sf /usr/bin/automake $(PWD)/bin/automake-1.4; \
fi
unpatch:
for stamp in none `ls -1t $(patch_stamp)-*`; do \
case "$$stamp" in none|patched-stamp|patched-\*) continue; esac; \
patch=`echo $$stamp | sed -e 's,$(patch_stamp)-,,'`; \
echo "trying to revert patch $$patch ..."; \
if [ -x $(patchdir)/$$patch.dpatch ]; then true; else \
chmod +x $(patchdir)/$$patch.dpatch; fi; \
if $(patchdir)/$$patch.dpatch -unpatch -d $(srcdir); then \
echo "reverted $$patch patch."; \
rm -f $$stamp; \
else \
echo "error in reverting $$patch patch."; \
exit 1; \
fi; \
done
rm -f patched-stamp
$(patch_stamp)-%: $(patchdir)/%.dpatch
if [ -x $< ]; then true; else chmod +x $<; fi
if [ -f $@ ]; then \
echo "$* patches already applied."; exit 1; \
fi
DEB_VERSION='$(DEB_VERSION)'; export DEB_VERSION; \
$< -patch -d $(srcdir)
echo "$* patches applied." > $@
|