# -*- 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 series_file ?= $(patchdir)/series # which patches should be applied? debian_patches = \ svn-updates \ $(if $(with_linaro_branch),pr61208-revert) \ $(if $(with_linaro_branch),gcc-linaro) \ $(if $(with_linaro_branch),gcc-linaro-no-local) \ # FIXME: pr61208 requires Linaro 4.9-2014.04. # $(if $(with_linaro_branch),pr61208-linaro) \ ifeq ($(with_java),yes) # debian_patches += \ # svn-class-updates endif ifneq ($(GFDL_INVARIANT_FREE),yes) debian_patches += \ rename-info-files \ $(if $(with_linaro_branch),gcc-linaro-doc) \ # svn-doc-updates \ # $(if $(with_linaro_branch),,svn-doc-updates) \ else debian_patches += \ $(if $(with_linaro_branch),gcc-dfsg-linaro-doc) endif debian_patches += \ gcc-gfdl-build # boehm-gc-nocheck: seems to work on the buildds \ debian_patches += \ gcc-textdomain \ gcc-driver-extra-langs ifneq (,$(filter $(distrelease),etch lenny squeeze wheezy dapper hardy intrepid jaunty karmic lucid)) debian_patches += gcc-hash-style-both else debian_patches += gcc-hash-style-gnu endif debian_patches += \ libstdc++-pic \ libstdc++-doclink \ libstdc++-man-3cxx \ libstdc++-test-installed \ libjava-stacktrace \ libjava-jnipath \ libjava-sjlj \ libjava-disable-plugin \ alpha-no-ev4-directive \ boehm-gc-getnprocs \ note-gnu-stack \ libgomp-omp_h-multilib \ sparc-force-cpu \ gccgo-version \ pr47818 \ pr49944 \ gcc-base-version \ libgo-testsuite \ gcc-target-include-asm \ libgo-revert-timeout-exp \ $(if $(with_linaro_branch),,arm-sanitizer) \ libgo-setcontext-config \ pr57211 \ kfreebsd-unwind \ libgcc-no-limits-h \ kfreebsd-boehm-gc \ pr49847 \ libffi-m68k \ m68k-picflag \ sys-auxv-header \ go-use-gold \ go-testsuite \ pr57363 \ $(if $(with_linaro_branch),pr59744) \ $(if $(with_linaro_branch),aarch64-call-frame-info) \ $(if $(with_linaro_branch),aarch64-abi-fix) \ fix-ffi_call_VFP-with-no-VFP-argument \ $(if $(with_linaro_branch),pr60034) \ pr61106 \ pr61126 \ pr57653 \ libitm-aarch64 \ pr61046 \ pr61336 \ gcc-setmultilib-fix \ gcc-elfv2-abi-warn1 \ gcc-elfv2-abi-warn2 \ gcc-elfv2-abi-warn3 \ gcc-elfv2-abi-warn4 \ # FIXME: still necessary for cross building the native compiler? # gcc-auto-build \ ifeq (,$(filter $(distrelease),wheezy squeeze dapper hardy lucid maverick natty oneiric precise quantal raring)) debian_patches += libstdc++-python3 endif # $(if $(filter yes, $(DEB_CROSS)),,gcc-print-file-name) \ # libstdc++-nothumb-check \ # TODO: update ... # gcc-cloog-dl \ # libjava-rpath \ hardening_patches = ifeq ($(with_ssp)-$(with_ssp_default),yes-yes) hardening_patches += gcc-default-ssp hardening_patches += gcc-default-format-security endif ifeq ($(distribution),Ubuntu) ifneq (,$(findstring gcc-4, $(PKGSOURCE))) hardening_patches += \ gcc-default-fortify-source \ gcc-default-relro \ testsuite-hardening-format \ testsuite-hardening-printf-types \ testsuite-hardening-updates endif endif # FIXME 4.5: Drop and adjust symbols files ifneq (,$(findstring 4.4, $(PKGSOURCE))) debian_patches += pr39491 endif ifeq ($(with_ada),yes) debian_patches += \ ada-driver-check \ ada-gcc-name \ ada-default-project-path \ ada-symbolic-tracebacks \ ada-library-project-files-soname \ ada-ppc64 ifeq ($(biarch64),yes) debian_patches += \ ada-nobiarch-check endif ifeq ($(with_libgnat),yes) debian_patches += \ ada-link-lib \ ada-libgnatvsn \ ada-libgnatprj \ ada-acats ifeq ($(with_gnat_zcx)-$(with_gnat_sjlj),yes-yes) debian_patches += \ ada-sjlj endif endif ifeq ($(DEB_TARGET_ARCH_OS),hurd) debian_patches += \ gcc_ada_gcc-interface_Makefile.in \ ada-s-osinte-gnu.adb \ ada-s-osinte-gnu.ads \ ada-s-taprop-gnu.adb endif debian_patches += \ ada-link-shlib endif ifeq ($(with_d),yes) debian_patches += \ gdc-4.8 \ gdc-versym-cpu \ gdc-versym-os \ gdc-frontend-posix # gdc-updates \ # gdc-multiarch ifneq ($(GFDL_INVARIANT_FREE),yes) debian_patches += gdc-4.8-doc else debian_patches += gdc-texinfo endif ifeq ($(with_libphobos),yes) debian_patches += gdc-libphobos-build else debian_patches += gdc-driver-nophobos endif ifeq (,$(filter $(DEB_TARGET_ARCH),amd64 i386)) debian_patches += disable-gdc-tests endif else debian_patches += gcc-d-lang endif ifeq ($(DEB_TARGET_ARCH),alpha) debian_patches += alpha-ieee ifneq ($(GFDL_INVARIANT_FREE),yes) debian_patches += alpha-ieee-doc endif endif ifeq ($(DEB_TARGET_ARCH_CPU),amd64) debian_patches += libjava-testsuite endif ifneq (,$(findstring $(DEB_TARGET_ARCH),arm armel armhf)) debian_patches += libjava-armel-unwind endif ifeq ($(DEB_TARGET_ARCH),armhf) debian_patches += gcj-arm-mode else ifeq ($(DEB_TARGET_ARCH),armel) ifneq (,$(filter $(distrelease),lucid maverick natty oneiric precise)) debian_patches += gcj-arm-mode endif endif ifeq ($(DEB_TARGET_ARCH),m68k) debian_patches += m68k-ada debian_patches += m68k-revert-pr45144 debian_patches += pr52714 debian_patches += pr58369 debian_patches += pr52306 endif ifeq ($(DEB_TARGET_ARCH),powerpcspe) debian_patches += powerpc_remove_many debian_patches += powerpc_nofprs endif #debian_patches += link-libs # all patches below this line are applied for gcc-snapshot builds as well ifeq ($(single_package),yes) debian_patches = endif debian_patches += gcc-sysroot debian_patches += goarch-aarch64 debian_patches += libgo-explicit-reservation debian_patches += \ ada-kfreebsd \ ifeq ($(with_softfloat),yes) debian_patches += arm-multilib-soft-float else ifeq ($(multilib),yes) ifneq (,$(filter $(distrelease),lucid maverick natty oneiric precise)) debian_patches += arm-multilib-softfp$(if $(filter yes,$(DEB_CROSS)),-cross) else debian_patches += arm-multilib-soft$(if $(filter yes,$(DEB_CROSS)),-cross) endif endif debian_patches += arm-multilib-defaults ifeq ($(DEB_CROSS),yes) debian_patches += cross-fixes ifeq ($(with_deps_on_target_arch_pkgs),yes) debian_patches += cross-ma-install-location else debian_patches += cross-install-location endif endif ifeq ($(DEB_TARGET_ARCH_OS),hurd) debian_patches += hurd-changes endif debian_patches += gcc-ice-hack gcc-ice-apport #FIXME #debian_patches += gold-and-ld debian_patches += libjava-fixed-symlinks ifneq (,$(filter $(DEB_TARGET_ARCH), mips mipsel)) # timeouts on the buildd's, Debian debian_patches += libstdc++-no-testsuite else ifeq ($(distribution),Ubuntu) # timeouts on the buildd's, Ubuntu only ifneq (,$(filter $(DEB_TARGET_ARCH), armel ia64)) debian_patches += libstdc++-no-testsuite endif endif debian_patches += ada-mips debian_patches += libffi-ro-eh_frame_sect debian_patches += gcc-multiarch ifeq ($(with_multiarch_lib),yes) ifneq ($(single_package),yes) debian_patches += libjava-multiarch endif endif debian_patches += libjava-nobiarch-check debian_patches += config-ml ifneq ($(single_package),yes) ifeq ($(with_multiarch_cxxheaders),yes) debian_patches += g++-multiarch-incdir endif endif ifeq ($(DEB_CROSS),yes) debian_patches += cross-no-locale-include endif ifeq ($(biarch64),yes) ifeq ($(DEB_CROSS),yes) debian_patches += cross-biarch endif endif debian_patches += gcc-multilib-multiarch ifneq (,$(filter $(derivative),Ubuntu)) ifeq (,$(filter $(distrelease),dapper hardy intrepid jaunty karmic lucid maverick)) debian_patches += gcc-as-needed endif else # Debian #debian_patches += gcc-as-needed endif debian_patches += mips-fix-loongson2f-nop ifeq ($(derivative),Ubuntu) ifeq ($(DEB_TARGET_ARCH),ppc64) debian_patches += gcc-ppc64-O3 endif endif debian_patches += libgomp-kfreebsd-testsuite ifeq ($(DEB_TARGET_ARCH_OS), illumos) debian_patches += illumos-multiarch debian_patches += illumos-rdynamic debian_patches += illumos-spec debian_patches += illumos-use_libgcj_bc debian_patches += illumos-pragma-align debian_patches += illumos-fclone-functions debian_patches += illumos-strict-calling-conventions endif series_stamp = $(stampdir)/02-series-stamp series: $(series_stamp) $(series_stamp): echo $(strip $(addsuffix .diff,$(debian_patches))) \ | sed -r 's/ +/ /g' | tr " " "\n" > $(series_file) ifneq (,$(strip $(hardening_patches))) ifneq ($(trunk_build),yes) echo $(strip $(addsuffix .diff,$(hardening_patches))) \ | sed -r 's/ +/ /g' | tr " " "\n" >> $(series_file) endif endif sed -r 's/(.)$$/\1 -p1/' -i $(series_file) touch $@ autotools_files = $(addprefix ./,$(foreach file,$(shell lsdiff --no-filename \ $(foreach patch,$(debian_patches),$(patchdir)/$(patch).diff) \ | sed -r 's:[^/]+/src/:src/:' | sort | uniq),$(shell echo $(file) \ | egrep 'configure\.(ac|in)|Makefile\.(am|in)|acinclude.m4'))) autoconf_version = 2.64 ifeq ($(trunk_build),yes) # The actual version depends on the build-dependencies set by # variable AUTO_BUILD_DEP in rules.conf. Here, we assume the # correct version is installed. #autoconf_version = endif # FIXME: the auto* stuff is done every time for every subdir, which # leads to build errors. Idea: record the auto* calls in the patch # files (AUTO