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 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148
|
#!/usr/bin/make -f
, := ,
space := $(EMPTY) $(EMPTY)
export SHELL = /bin/bash
# prefix for builds - without leading slash
PF ?= usr
include debian/kernelarch.make
vendor := $(shell if dpkg-vendor --derives-from Ubuntu; then echo Ubuntu; else echo Debian; fi)
distrelease := $(shell lsb_release -cs)
# Support multiple makes at once based on number of processors
COMMA = ,
# Support parallel=<n> in DEB_BUILD_OPTIONS (see #209008)
ifneq (,$(filter parallel=%,$(subst $(COMMA), ,$(DEB_BUILD_OPTIONS))))
NUMCPUS := $(subst parallel=,,$(filter parallel=%,$(subst $(COMMA), ,$(DEB_BUILD_OPTIONS))))
NJOBS := -j $(NUMCPUS)
DH_PARALLEL := parallel=$(NUMCPUS)
endif
DEB_NAME_ACT := $(shell dpkg-parsechangelog| sed -n 's/-*//; s/^Source: \(.*\)/\1/p')
DEB_SVER_ACT := $(shell dpkg-parsechangelog| sed -n 's/^Version: \(.*\)/\1/p')
ifeq ($(DEB_NAME_ACT),cross-toolchain-base-mipsen)
DEB_VER_ACT := $(shell /bin/sh debian/new_cross_version.sh mipsn32r6el)
else
DEB_VER_ACT := $(shell /bin/sh debian/new_cross_version.sh $(if $(filter $(DEB_NAME_ACT), cross-toolchain-base),ppc64el,ppc64))
endif
CROSS_EXT := cross$(DEB_VER_ACT)
HOST_ARCH := $(shell dpkg-architecture -qDEB_HOST_ARCH_CPU)
HOST_GNU_TYPE := $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
BUILD_GNU_TYPE := $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
BUILD_MULTIARCH := $(shell dpkg-architecture -qDEB_BUILD_MULTIARCH)
stamp := stamp-dir/
ifeq ($(vendor),Debian)
skip_dbg_packages = yes
endif
ifeq ($(DEB_NAME_ACT),cross-toolchain-base-mipsen)
skip_dbg_packages = yes
endif
ifeq ($(DEB_NAME_ACT),cross-toolchain-base)
CROSS_ARCHS ?= amd64 i386 s390x ppc64el arm64 armhf armel \
$(if $(filter $(vendor), Ubuntu), powerpc)
else ifeq ($(DEB_NAME_ACT),cross-toolchain-base-ports)
CROSS_ARCHS ?= alpha arc hppa m68k ppc64 riscv64 sh4 sparc64 x32 \
$(if $(filter $(vendor), Ubuntu),, powerpc)
else # -mipsen
CROSS_ARCHS ?= mips mipsel mips64el mips64 mipsn32 mipsn32el \
mipsr6 mipsr6el mipsn32r6 mipsn32r6el mips64r6 mips64r6el
endif
CROSS_ARCH = $(subst .,,$(suffix $@))
KERNEL_ARCH = $(KERNEL_ARCH_$(CROSS_ARCH))
CROSS_BIARCH = $(CROSS_BIARCH_$(CROSS_ARCH))
_gnu_type = $(shell dpkg-architecture -a$(1) -qDEB_HOST_GNU_TYPE -f)
CROSS_GNU_TYPE = $(call _gnu_type,${CROSS_ARCH})
CROSS_PKG_GNU_TYPE = $(subst _,-,$(call _gnu_type,${CROSS_ARCH}))
MIN_VER_GLIBC := 2.36-8~
MIN_VER_LINUX := 6.1.4
MIN_VER_GCC := 12.2.0-14~
MIN_VER_BINUTILS := 2.40-2~
VER_GCC_BASE := 12
libgcc_base := gcc-s
DEB_VER_LINUX := $(shell apt-cache policy linux-libc-dev | awk '/^ \*\*\*/ {print $$2}')
ifeq ($(vendor),Ubuntu)
MIN_VER_GLIBC := 2.36-0~
MIN_VER_LINUX := 5.19.0
MIN_VER_GCC := 12.2.0-2~
MIN_VER_BINUTILS := 2.39-1~
VER_GCC_BASE := 12
libgcc_base := gcc-s
endif
ifeq ($(vendor),Ubuntu)
VER_LINUX := $(shell echo $(MIN_VER_LINUX) | sed 's/^\([0-9]*\.[0-9]*\.[0-9]*\).*/\1/')
else
VER_LINUX := $(shell echo $(MIN_VER_LINUX) | sed 's/^\([0-9]*\.[0-9]*\).*/\1/')
endif
VER_GCC := $(shell dpkg-parsechangelog -SVersion -l/usr/src/gcc-${VER_GCC_BASE}/debian/changelog | cut -f 1 -d '-')
DEB_VER_GCC := $(shell dpkg-parsechangelog -SVersion -l/usr/src/gcc-${VER_GCC_BASE}/debian/changelog)
VER_BINUTILS := $(shell dpkg-parsechangelog -SVersion -l/usr/src/binutils/debian/changelog | cut -f 1 -d '-'|cut -d '.' -f1-3)
PKG_VER_BINUTILS := $(shell dpkg-parsechangelog -SVersion -l/usr/src/binutils/debian/changelog | cut -f 1 -d '-')
DEB_VER_BINUTILS := $(shell dpkg-parsechangelog -SVersion -l/usr/src/binutils/debian/changelog)
VER_GLIBC := $(shell dpkg-parsechangelog -SVersion -l/usr/src/glibc/debian/changelog | cut -f 1 -d '-')
DEB_VER_GLIBC := $(shell dpkg-parsechangelog -SVersion -l/usr/src/glibc/debian/changelog)
LINUX_BUILT_USING := linux (= $(shell echo $(DEB_VER_LINUX) | sed 's/+.*$$//'))
GLIBC_BUILT_USING := binutils (= $(DEB_VER_BINUTILS)), linux (= $(shell echo $(DEB_VER_LINUX) | sed 's/+.*$$//')), gcc-$(VER_GCC_BASE) (= $(DEB_VER_GCC)), glibc (= $(DEB_VER_GLIBC))
control_vars = '-Vbu:linux=$(LINUX_BUILT_USING)' '-Vbu:glibc=$(GLIBC_BUILT_USING)'
CTB_LIBC_DEV_DEPENDS = linux-libc-dev (>= $(DEB_VER_LINUX))
BINUTILS_DIR := /usr/src/binutils
GLIBC_DIR := /usr/src/glibc
GCC_DIR := /usr/src/gcc-${VER_GCC_BASE}
GLIBC_PATCHES := $(CURDIR)/debian/patches/glibc/$(shell echo $(vendor) | tr A-Z a-z)
binutils_ldpath = $(shell if dpkg --compare-versions $(VER_BINUTILS) lt 2.25.51; \
then echo $(CURDIR)/debian/tmp.${CROSS_ARCH}/usr/$(BUILD_GNU_TYPE)/${CROSS_GNU_TYPE}/lib; \
else echo $(CURDIR)/debian/tmp.${CROSS_ARCH}/usr/lib/$(BUILD_MULTIARCH)/binutils; fi)
# FIXME: No conflict for the host == cross case ...
BINUTILS_BUILD_CONFLICTS = $(foreach a,$(CROSS_ARCHS),binutils-$(subst _,-,$(call _gnu_type,$(a))) [!$(a)]$(,))
GLIBC_BUILD_CONFLICTS = $(foreach a,$(CROSS_ARCHS),libc6-$(a)-cross$(,) linux-libc-dev-$(a)-cross$(,))
# taken from gcc packaging
define unpack_tarball
tar -x -f $1
endef
info:
@echo "Binutils version: ${VER_BINUTILS} ${DEB_VER_BINUTILS} ${PKG_VER_BINUTILS}"
@echo "GCC version: ${VER_GCC} ${DEB_VER_GCC} ${VER_GCC_BASE}"
@echo "Glibc version: ${VER_GLIBC} ${DEB_VER_GLIBC}"
@echo "Linux version: ${VER_LINUX} ${DEB_VER_LINUX}"
@echo
@echo "Target architecture: ${CROSS_ARCH}"
@echo "Target GNU type: ${CROSS_GNU_TYPE}"
@echo "Host architecture: ${HOST_ARCH}"
@echo "Host GNU type: ${HOST_GNU_TYPE}"
@echo
@echo "Built using information:"
@echo ' linux: $(LINUX_BUILT_USING)'
@echo ' glibc: $(GLIBC_BUILT_USING)'
@echo
@echo "New versions: $(DEB_LINUX_GLIBC)$(CROSS_EXT) / $(DEB_VER_GLIBC)$(CROSS_EXT)"
$(stamp)init-dirs:
mkdir -p $(foreach arch,$(CROSS_ARCHS),debian/tmp.$(arch))
touch $@
init: $(stamp)init-linux
$(stamp)init-linux:
@echo START $@
rm -rf linux-source-[45].*
$(call unpack_tarball, $(firstword $(wildcard /usr/src/linux-source-$(VER_LINUX).tar.* /usr/src/linux-source-$(VER_LINUX)/linux-source-$(VER_LINUX).tar.*)))
touch $@
$(stamp)build-linux.%: $(stamp)init-linux
@echo START $@
$(MAKE) -C linux-source-$(VER_LINUX) headers_install \
ARCH=$(KERNEL_ARCH) \
INSTALL_HDR_PATH=$(CURDIR)/debian/tmp.$(CROSS_ARCH)/usr
touch $@
p_lld = linux-libc-dev-$(CROSS_ARCH)-cross
$(stamp)install-linux.%: $(stamp)build-linux.% $(stamp)init-dirs
@echo START $@
rm -rf debian/$(p_lld)
dh_installdirs -p$(p_lld) \
usr/share/doc/$(p_lld) \
usr/share/lintian/overrides \
usr/$(CROSS_GNU_TYPE)
cp -a debian/tmp.$(CROSS_ARCH)/usr/include \
debian/$(p_lld)/usr/$(CROSS_GNU_TYPE)/.
rm -rf debian/$(p_lld)/usr/$(CROSS_GNU_TYPE)/{drm,scsi} ;\
rm -f `find debian/$(p_lld)/usr/$(CROSS_GNU_TYPE) -name .install`
rm -f `find debian/$(p_lld)/usr/$(CROSS_GNU_TYPE) -name ..install.cmd`
echo "$(p_lld) binary: non-standard-dir-in-usr" \
>> debian/$(p_lld)/usr/share/lintian/overrides/linux-libc-dev-${CROSS_ARCH}-cross
cp -p /usr/share/doc/linux-source-$(VER_LINUX)/copyright \
debian/$(p_lld)/usr/share/doc/$(p_lld)/.
zcat /usr/share/doc/linux-source-$(VER_LINUX)/changelog.Debian.gz \
> debian/$(p_lld)/usr/share/doc/$(p_lld)/changelog.Debian.linux
gzip -9n debian/$(p_lld)/usr/share/doc/$(p_lld)/changelog.Debian.linux
cp debian/changelog debian/$(p_lld)/usr/share/doc/$(p_lld)/changelog.Debian
gzip -9n debian/$(p_lld)/usr/share/doc/$(p_lld)/changelog.Debian
touch $@
define init_binutils
$(call unpack_tarball, ${BINUTILS_DIR}/binutils-${VER_BINUTILS}.tar.xz)
set -e; \
cd binutils-${VER_BINUTILS} ;\
cp -a ${BINUTILS_DIR}/debian/ . ;\
if [ -n "$$(grep -v '^\#' ${CURDIR}/debian/patches/binutils/series)" ]; then \
QUILT_PATCHES=${CURDIR}/debian/patches/binutils quilt --quiltrc /dev/null push -a; \
fi; \
rm -rf .pc
cd binutils-${VER_BINUTILS} ;\
env -i CROSS_ARCHS="$(CROSS_ARCHS)" PATH="$(PATH)" debian/rules stamps/control
endef
$(stamp)init-binutils:
@echo START $@
$(call init_binutils)
touch $@
$(stamp)build-binutils: $(stamp)init-binutils
@echo START $@
set -e ;\
cd binutils-${VER_BINUTILS} ;\
WITH_SYSROOT=${CURDIR}/debian/tmp.${CROSS_ARCH} \
PATCHED_SOURCES=yes \
PKG_IGNORE_CURRENTLY_BUILDING=1 \
BACKPORT=false \
DEB_BUILD_OPTIONS="$(DEB_BUILD_OPTIONS) nocheck nomult nohppa nopgo" \
CROSS_ARCHS="$(CROSS_ARCHS)" \
dpkg-buildpackage -B -uc -us -d
touch $@
$(stamp)install-binutils.%: $(stamp)build-binutils $(stamp)init-dirs
@echo START $@
dpkg-deb -x binutils-common_${DEB_VER_BINUTILS}_${HOST_ARCH}.deb debian/tmp.${CROSS_ARCH}
dpkg-deb -x binutils-${CROSS_PKG_GNU_TYPE}_${DEB_VER_BINUTILS}_${HOST_ARCH}.deb debian/tmp.${CROSS_ARCH}
$(if $(filter $(HOST_ARCH),$(CROSS_ARCH)), \
dpkg-deb -x libbinutils_${DEB_VER_BINUTILS}_${HOST_ARCH}.deb debian/tmp.${CROSS_ARCH}; \
dpkg-deb -x libctf0_${DEB_VER_BINUTILS}_${HOST_ARCH}.deb debian/tmp.${CROSS_ARCH}; \
dpkg-deb -x libctf-nobfd0_${DEB_VER_BINUTILS}_${HOST_ARCH}.deb debian/tmp.${CROSS_ARCH}; \
)
mkdir -p debian/tmp.${CROSS_ARCH}/usr/lib/$(BUILD_MULTIARCH)/binutils;
mv debian/tmp.${CROSS_ARCH}/usr/lib/$(BUILD_MULTIARCH)/lib{bfd,opcodes}-*.so \
debian/tmp.${CROSS_ARCH}/usr/lib/$(BUILD_MULTIARCH)/binutils;
mv debian/tmp.${CROSS_ARCH}/usr/lib/$(BUILD_MULTIARCH)/libctf*.so* \
debian/tmp.${CROSS_ARCH}/usr/lib/$(BUILD_MULTIARCH)/binutils;
rm -f debian/tmp.${CROSS_ARCH}/usr/bin/*.exe
for i in debian/tmp.${CROSS_ARCH}/usr/bin/*; do \
mv $$i $$i.exe; \
( \
echo '#!/bin/sh'; \
echo 'LD_LIBRARY_PATH=$(call binutils_ldpath,$*)$${LD_LIBRARY_PATH:+:$$LD_LIBRARY_PATH}'; \
echo 'export LD_LIBRARY_PATH'; \
echo 'exec '$$(basename $$i)'.exe "$$@"'; \
) > $$i; \
chmod +x $$i; \
done
touch $@
$(stamp)init-gcc:
@echo START $@
set -e; \
mkdir gcc -p ; \
cd gcc ; \
ln -sf $(wildcard ${GCC_DIR}/gcc-${VER_GCC_BASE}*.tar.xz) \
$$(basename $$(tar tf $(wildcard ${GCC_DIR}/gcc-${VER_GCC_BASE}*.tar.xz) | head -1)).tar.xz ;\
cp -a ${GCC_DIR}/debian/ . ; \
if [ -n "$$(grep -v '^\#' ${CURDIR}/debian/patches/gcc/series)" ]; then \
QUILT_PATCHES=${CURDIR}/debian/patches/gcc quilt --quiltrc /dev/null push -a ; \
fi;
# set -ex; \
# if dpkg --compare-versions $(DEB_VER_GCC) le 9.3.0-6; then \
# cd gcc; \
# patch -p1 < ../debian/patches/gcc/updates.diff; \
# fi
touch $@
$(stamp)build-gcc1.%: $(stamp)init-gcc $(stamp)install-binutils.%
@echo START $@
echo ${CROSS_ARCH} >gcc/debian/target
cd gcc && \
PATH=${CURDIR}/debian/tmp.${CROSS_ARCH}/$(PF)/bin/:${PATH} \
LD_LIBRARY_PATH=$(call binutils_ldpath,$*):${CURDIR}/debian/tmp.${CROSS_ARCH}/usr/lib:${CURDIR}/debian/tmp.${CROSS_ARCH}/lib \
DH_VERBOSE=1 \
WITH_SYSROOT=/ \
WITH_BUILD_SYSROOT=${CURDIR}/debian/tmp.${CROSS_ARCH} \
DEB_STAGE=stage1 \
PKG_IGNORE_CURRENTLY_BUILDING=1 \
BACKPORT=false \
DEB_BUILD_OPTIONS="$(DEB_BUILD_OPTIONS) nocheck nopgo nolto nohppa64 nojit nonvptx" \
WITHOUT_LANG="hppa64 jit nvptx" \
$(if $(filter $(HOST_ARCH),$(CROSS_ARCH)),FORCE_CROSS_LAYOUT=yes WITH_BOOTSTRAP=off) \
dpkg-buildpackage -b -uc -us -d
touch $@
$(stamp)install-gcc1.%: $(stamp)build-gcc1.%
@echo START $@
$(call install_gcc)
cp -r gcc/build/gcc/include \
debian/tmp.${CROSS_ARCH}/$(PF)/lib/gcc-cross/${CROSS_GNU_TYPE}/${VER_GCC_BASE}/
cp -r gcc/build/gcc/include-fixed \
debian/tmp.${CROSS_ARCH}/$(PF)/lib/gcc-cross/${CROSS_GNU_TYPE}/${VER_GCC_BASE}/
$(if $(filter $(CROSS_ARCH),amd64 ppc64 s390x sparc64 x32), \
dpkg-deb -x lib32gcc-${VER_GCC_BASE}-dev-${CROSS_ARCH}-cross_${DEB_VER_GCC}_all.deb \
debian/tmp.${CROSS_ARCH} \
)
$(if $(filter $(CROSS_ARCH),i386 powerpc x32), \
dpkg-deb -x lib64gcc-${VER_GCC_BASE}-dev-${CROSS_ARCH}-cross_${DEB_VER_GCC}_all.deb \
debian/tmp.${CROSS_ARCH} \
)
$(if $(filter $(CROSS_ARCH),amd64 i386), \
dpkg-deb -x libx32gcc-${VER_GCC_BASE}-dev-${CROSS_ARCH}-cross_${DEB_VER_GCC}_all.deb \
debian/tmp.${CROSS_ARCH} \
)
$(if $(filter $(CROSS_ARCH),mips mipsel mipsr6 mipsr6el), \
dpkg-deb -x lib64gcc-${VER_GCC_BASE}-dev-${CROSS_ARCH}-cross_${DEB_VER_GCC}_all.deb \
debian/tmp.${CROSS_ARCH}; \
dpkg-deb -x libn32gcc-${VER_GCC_BASE}-dev-${CROSS_ARCH}-cross_${DEB_VER_GCC}_all.deb \
debian/tmp.${CROSS_ARCH} \
)
$(if $(filter $(CROSS_ARCH),mipsn32 mipsn32el mipsn32r6 mipsn32r6el), \
dpkg-deb -x lib64gcc-${VER_GCC_BASE}-dev-${CROSS_ARCH}-cross_${DEB_VER_GCC}_all.deb \
debian/tmp.${CROSS_ARCH}; \
dpkg-deb -x lib32gcc-${VER_GCC_BASE}-dev-${CROSS_ARCH}-cross_${DEB_VER_GCC}_all.deb \
debian/tmp.${CROSS_ARCH} \
)
$(if $(filter $(CROSS_ARCH),mips64 mips64el mips64r6 mips64r6el), \
dpkg-deb -x lib32gcc-${VER_GCC_BASE}-dev-${CROSS_ARCH}-cross_${DEB_VER_GCC}_all.deb \
debian/tmp.${CROSS_ARCH}; \
dpkg-deb -x libn32gcc-${VER_GCC_BASE}-dev-${CROSS_ARCH}-cross_${DEB_VER_GCC}_all.deb \
debian/tmp.${CROSS_ARCH}; \
)
touch $@
define install_gcc
dpkg-deb -x gcc-${VER_GCC_BASE}-${CROSS_PKG_GNU_TYPE}_${DEB_VER_GCC}_${HOST_ARCH}.deb debian/tmp.${CROSS_ARCH}
dpkg-deb -x cpp-${VER_GCC_BASE}-${CROSS_PKG_GNU_TYPE}_${DEB_VER_GCC}_${HOST_ARCH}.deb debian/tmp.${CROSS_ARCH}
dpkg-deb -x libgcc-${VER_GCC_BASE}-dev-${CROSS_ARCH}-cross_${DEB_VER_GCC}_all.deb debian/tmp.${CROSS_ARCH}
cd debian/tmp.${CROSS_ARCH}/$(PF)/bin/ && \
ln -sf ${CROSS_GNU_TYPE}-gcc-${VER_GCC_BASE} ${CROSS_GNU_TYPE}-gcc && \
ln -sf ${CROSS_GNU_TYPE}-cpp-${VER_GCC_BASE} ${CROSS_GNU_TYPE}-cpp && \
ln -sf ${CROSS_GNU_TYPE}-gcov-${VER_GCC_BASE} ${CROSS_GNU_TYPE}-gcov
endef
$(stamp)build-gcc3.%: $(stamp)init-gcc $(stamp)install-glibc2.%
@echo START $@
cd debian/tmp.${CROSS_ARCH}/$(PF)/bin/ && \
rm -f ${CROSS_GNU_TYPE}-gcc-${VER_GCC_BASE} ${CROSS_GNU_TYPE}-gcc && \
rm -f ${CROSS_GNU_TYPE}-cpp-${VER_GCC_BASE} ${CROSS_GNU_TYPE}-cpp && \
rm -f ${CROSS_GNU_TYPE}-gcov-${VER_GCC_BASE} ${CROSS_GNU_TYPE}-gcov
cd gcc && \
PATH=${CURDIR}/debian/tmp.${CROSS_ARCH}/$(PF)/bin/:${PATH} \
LD_LIBRARY_PATH=$(call binutils_ldpath,$*):${CURDIR}/debian/tmp.${CROSS_ARCH}/usr/lib:${CURDIR}/debian/tmp.${CROSS_ARCH}/lib \
WITH_BUILD_SYSROOT=${CURDIR}/debian/tmp.${CROSS_ARCH} \
DEB_STAGE=stage2 \
PKG_IGNORE_CURRENTLY_BUILDING=1 \
BACKPORT=false \
DEB_BUILD_OPTIONS="$(DEB_BUILD_OPTIONS) nocheck nopgo nolto nohppa64 nojit nonvptx" \
WITHOUT_LANG="hppa64 jit nvptx" \
$(if $(filter $(HOST_ARCH),$(CROSS_ARCH)),FORCE_CROSS_LAYOUT=yes WITH_BOOTSTRAP=off) \
dpkg-buildpackage -b -uc -us -d
touch $@
$(stamp)init-glibc:
@echo START $@
rm -rf glibc-${VER_GLIBC}
$(call unpack_tarball, ${GLIBC_DIR}/glibc-${VER_GLIBC}.tar.xz)
cp -a ${GLIBC_DIR}/debian/ glibc-${VER_GLIBC}
cd glibc-${VER_GLIBC} ; \
QUILT_PATCHES=${GLIBC_PATCHES} quilt --quiltrc /dev/null push -a && \
rm -rf .pc/
# set -ex; \
# if dpkg --compare-versions $(DEB_VER_GLIBC) le 2.27-3; then \
# cd glibc-${VER_GLIBC}; \
# patch -p1 < ../debian/patches/glibc/updates.diff; \
# debian/rules debian/control || true; \
# fi
touch $@
$(stamp)build-glibc2.%: $(stamp)init-glibc $(stamp)install-gcc1.% $(stamp)install-linux.%
@echo START $@
# FIXME: why debian/libgcc1-armel-cross?
cd glibc-${VER_GLIBC} && \
PATH=${CURDIR}/debian/tmp.${CROSS_ARCH}/$(PF)/bin/:${PATH} \
LD_LIBRARY_PATH=$(call binutils_ldpath,$*):${CURDIR}/gcc/debian/lib$(libgcc_base)1-armel-cross/usr/${CROSS_GNU_TYPE}/lib/ \
LINUX_SOURCE=${CURDIR}/debian/tmp.${CROSS_ARCH}/usr \
DEB_BUILD_OPTIONS="nocheck notest notests $(DH_PARALLEL)" \
PATCHED_SOURCES=yes \
WITH_BUILD_SYSROOT=${CURDIR}/debian/tmp.${CROSS_ARCH} \
DEB_BUILD_PROFILES=stage2 \
PKG_IGNORE_CURRENTLY_BUILDING=1 \
BACKPORT=false \
DEB_BUILD_OPTIONS="$(DEB_BUILD_OPTIONS) nocheck" \
CTB_LIBC_DEV_DEPENDS='$(CTB_LIBC_DEV_DEPENDS)' \
fakeroot dpkg-buildpackage -B -uc -us -a${CROSS_ARCH} -d -Pstage2
: # FIXME: a libc6.1-alphaev67 package is built on alpha
$(if $(filter $(CROSS_ARCH),alpha), rm -f libc6.1-alphaev67*.deb)
touch $@
$(stamp)install-glibc2.%: $(stamp)build-glibc2.%
@echo START $@
for deb in *${DEB_VER_GLIBC}*.deb; \
do \
dpkg-deb -x $$deb debian/tmp.${CROSS_ARCH}; \
done; \
bash debian/fix-links ${CROSS_GNU_TYPE}; \
touch $@
clean:
rm -rf linux-source-*
rm -rf linux-[45]*
rm -rf glibc-*
rm -rf gcc
rm -rf binutils-*
rm -rf $(foreach arch,$(CROSS_ARCHS),debian/tmp.$(arch))
rm -f debian/files debian/no-packages
rm -f debian/cross-compile
find debian -name '*~' | xargs -r rm -f
rm -f *.*deb *.changes *.buildinfo
rm -rf repackfiles tmp tmp-* debian/tmp.*
rm -rf $(stamp)
mkdir $(stamp)
dh_clean
# using wildcard for DEB_LIST_ALL gave only problems
DEB_LIST_UNMANGLED = $(foreach a,$(CROSS_ARCHS), \
linux-libc-dev-$(a)-cross_${DEB_VER_LINUX}*_all.deb)
DEB_LIST_MANGLED = $(foreach a,$(CROSS_ARCHS), \
libc$(if $(filter $(a),alpha ia64),6.1,6)-$(a)-cross_${VER_GLIBC}-*_all.deb \
libc$(if $(filter $(a),alpha ia64),6.1,6)-dev-$(a)-cross_${VER_GLIBC}-*_all.deb)
ifneq ($(skip_dbg_packages),yes)
DEB_LIST_MANGLED += $(foreach a,$(CROSS_ARCHS), \
libc$(if $(filter $(a),alpha ia64),6.1,6)-dbg-$(a)-cross_${VER_GLIBC}-*_all.deb)
endif
ifneq (,$(filter ppc64, $(CROSS_ARCHS)))
DEB_LIST_MANGLED += \
libc6-powerpc-ppc64-cross_${VER_GLIBC}-*_all.deb \
libc6-dev-powerpc-ppc64-cross_${VER_GLIBC}-*_all.deb
endif
ifneq (,$(filter s390x, $(CROSS_ARCHS)))
DEB_LIST_MANGLED += \
libc6-s390-s390x-cross_${VER_GLIBC}-*_all.deb \
libc6-dev-s390-s390x-cross_${VER_GLIBC}-*_all.deb
endif
ifneq (,$(filter sparc64, $(CROSS_ARCHS)))
DEB_LIST_MANGLED += \
libc6-sparc-sparc64-cross_${VER_GLIBC}-*_all.deb \
libc6-dev-sparc-sparc64-cross_${VER_GLIBC}-*_all.deb
endif
ifneq (,$(filter amd64, $(CROSS_ARCHS)))
DEB_LIST_MANGLED += \
libc6-i386-amd64-cross_${VER_GLIBC}-*_all.deb \
libc6-dev-i386-amd64-cross_${VER_GLIBC}-*_all.deb \
libc6-x32-amd64-cross_${VER_GLIBC}-*_all.deb \
libc6-dev-x32-amd64-cross_${VER_GLIBC}-*_all.deb
endif
ifneq (,$(filter powerpc, $(CROSS_ARCHS)))
DEB_LIST_MANGLED += \
libc6-ppc64-powerpc-cross_${VER_GLIBC}-*_all.deb \
libc6-dev-ppc64-powerpc-cross_${VER_GLIBC}-*_all.deb
endif
ifneq (,$(filter i386, $(CROSS_ARCHS)))
DEB_LIST_MANGLED += \
libc6-amd64-i386-cross_${VER_GLIBC}-*_all.deb \
libc6-dev-amd64-i386-cross_${VER_GLIBC}-*_all.deb \
libc6-x32-i386-cross_${VER_GLIBC}-*_all.deb \
libc6-dev-x32-i386-cross_${VER_GLIBC}-*_all.deb
endif
ifneq (,$(filter x32, $(CROSS_ARCHS)))
DEB_LIST_MANGLED += \
libc6-amd64-x32-cross_${VER_GLIBC}-*_all.deb \
libc6-dev-amd64-x32-cross_${VER_GLIBC}-*_all.deb \
libc6-i386-x32-cross_${VER_GLIBC}-*_all.deb \
libc6-dev-i386-x32-cross_${VER_GLIBC}-*_all.deb
endif
ifneq (,$(filter mips, $(CROSS_ARCHS)))
DEB_LIST_MANGLED += \
libc6-mips64-mips-cross_${VER_GLIBC}-*_all.deb \
libc6-dev-mips64-mips-cross_${VER_GLIBC}-*_all.deb \
libc6-mipsn32-mips-cross_${VER_GLIBC}-*_all.deb \
libc6-dev-mipsn32-mips-cross_${VER_GLIBC}-*_all.deb
endif
ifneq (,$(filter mipsel, $(CROSS_ARCHS)))
DEB_LIST_MANGLED += \
libc6-mips64-mipsel-cross_${VER_GLIBC}-*_all.deb \
libc6-dev-mips64-mipsel-cross_${VER_GLIBC}-*_all.deb \
libc6-mipsn32-mipsel-cross_${VER_GLIBC}-*_all.deb \
libc6-dev-mipsn32-mipsel-cross_${VER_GLIBC}-*_all.deb
endif
ifneq (,$(filter mipsn32, $(CROSS_ARCHS)))
DEB_LIST_MANGLED += \
libc6-mips64-mipsn32-cross_${VER_GLIBC}-*_all.deb \
libc6-dev-mips64-mipsn32-cross_${VER_GLIBC}-*_all.deb \
libc6-mips32-mipsn32-cross_${VER_GLIBC}-*_all.deb \
libc6-dev-mips32-mipsn32-cross_${VER_GLIBC}-*_all.deb
endif
ifneq (,$(filter mipsn32el, $(CROSS_ARCHS)))
DEB_LIST_MANGLED += \
libc6-mips64-mipsn32el-cross_${VER_GLIBC}-*_all.deb \
libc6-dev-mips64-mipsn32el-cross_${VER_GLIBC}-*_all.deb \
libc6-mips32-mipsn32el-cross_${VER_GLIBC}-*_all.deb \
libc6-dev-mips32-mipsn32el-cross_${VER_GLIBC}-*_all.deb
endif
ifneq (,$(filter mips64, $(CROSS_ARCHS)))
DEB_LIST_MANGLED += \
libc6-mips32-mips64-cross_${VER_GLIBC}-*_all.deb \
libc6-dev-mips32-mips64-cross_${VER_GLIBC}-*_all.deb \
libc6-mipsn32-mips64-cross_${VER_GLIBC}-*_all.deb \
libc6-dev-mipsn32-mips64-cross_${VER_GLIBC}-*_all.deb
endif
ifneq (,$(filter mips64el, $(CROSS_ARCHS)))
DEB_LIST_MANGLED += \
libc6-mips32-mips64el-cross_${VER_GLIBC}-*_all.deb \
libc6-dev-mips32-mips64el-cross_${VER_GLIBC}-*_all.deb \
libc6-mipsn32-mips64el-cross_${VER_GLIBC}-*_all.deb \
libc6-dev-mipsn32-mips64el-cross_${VER_GLIBC}-*_all.deb
endif
ifneq (,$(filter mipsr6, $(CROSS_ARCHS)))
DEB_LIST_MANGLED += \
libc6-mips64-mipsr6-cross_${VER_GLIBC}-*_all.deb \
libc6-dev-mips64-mipsr6-cross_${VER_GLIBC}-*_all.deb \
libc6-mipsn32-mipsr6-cross_${VER_GLIBC}-*_all.deb \
libc6-dev-mipsn32-mipsr6-cross_${VER_GLIBC}-*_all.deb
endif
ifneq (,$(filter mipsr6el, $(CROSS_ARCHS)))
DEB_LIST_MANGLED += \
libc6-mips64-mipsr6el-cross_${VER_GLIBC}-*_all.deb \
libc6-dev-mips64-mipsr6el-cross_${VER_GLIBC}-*_all.deb \
libc6-mipsn32-mipsr6el-cross_${VER_GLIBC}-*_all.deb \
libc6-dev-mipsn32-mipsr6el-cross_${VER_GLIBC}-*_all.deb
endif
ifneq (,$(filter mipsn32r6, $(CROSS_ARCHS)))
DEB_LIST_MANGLED += \
libc6-mips64-mipsn32r6-cross_${VER_GLIBC}-*_all.deb \
libc6-dev-mips64-mipsn32r6-cross_${VER_GLIBC}-*_all.deb \
libc6-mips32-mipsn32r6-cross_${VER_GLIBC}-*_all.deb \
libc6-dev-mips32-mipsn32r6-cross_${VER_GLIBC}-*_all.deb
endif
ifneq (,$(filter mipsn32r6el, $(CROSS_ARCHS)))
DEB_LIST_MANGLED += \
libc6-mips64-mipsn32r6el-cross_${VER_GLIBC}-*_all.deb \
libc6-dev-mips64-mipsn32r6el-cross_${VER_GLIBC}-*_all.deb \
libc6-mips32-mipsn32r6el-cross_${VER_GLIBC}-*_all.deb \
libc6-dev-mips32-mipsn32r6el-cross_${VER_GLIBC}-*_all.deb
endif
ifneq (,$(filter mips64r6, $(CROSS_ARCHS)))
DEB_LIST_MANGLED += \
libc6-mips32-mips64r6-cross_${VER_GLIBC}-*_all.deb \
libc6-dev-mips32-mips64r6-cross_${VER_GLIBC}-*_all.deb \
libc6-mipsn32-mips64r6-cross_${VER_GLIBC}-*_all.deb \
libc6-dev-mipsn32-mips64r6-cross_${VER_GLIBC}-*_all.deb
endif
ifneq (,$(filter mips64r6el, $(CROSS_ARCHS)))
DEB_LIST_MANGLED += \
libc6-mips32-mips64r6el-cross_${VER_GLIBC}-*_all.deb \
libc6-dev-mips32-mips64r6el-cross_${VER_GLIBC}-*_all.deb \
libc6-mipsn32-mips64r6el-cross_${VER_GLIBC}-*_all.deb \
libc6-dev-mipsn32-mips64r6el-cross_${VER_GLIBC}-*_all.deb
endif
# lib$(libgcc_base)1-${CROSS_ARCH}-cross_${DEB_VER_GCC}_all.deb \
# lib$(libgcc_base)1-dbg-${CROSS_ARCH}-cross_${DEB_VER_GCC}_all.deb \
#
# Repack resulting packages to make some changes;
# - I want libgcc1 to contain changelog etc which normally are in gcc-${VER_GCC_BASE}-*-base package
# - libgcc1(-dbg) should depend on proper version libgcc1 (epoch hardcoded)
# - libgcc1-dbg needs to have doc symlink to libgcc1
# - linux-libc-dev gets copyright and changelog
# - libc6 gets copyright and changelog
# - libc6 gets dependencies removed (no dependency on libgcc1)
# - libc6-dev-armhf-cross ships symlink to /usr/arm-linux-gnueabi/lib/hf for multilib cross compiler
# - libc6-sparc64-cross: Remove /usr/sparc64-linux-gnu/lib/ld-linux.so.2
$(stamp)repack-%:
@echo START $@
umask 022; \
deb=$*; \
pkgname=`echo $$deb | cut -d'_' -f1`; \
tmp=tmp-$$pkgname; \
cross_arch=$$(echo $$deb | sed 's/.*-\([^-][^-]*\)-cross_.*/\1/'); \
case $${cross_arch} in alpha|ia64) libc_ver=6.1;; *) libc_ver=6;; esac; \
echo "repack for $$cross_arch: $$pkgname ($$deb) ..."; \
rm -rf $$tmp; \
mkdir -p $$tmp; \
dpkg-deb -x $$deb $$tmp; \
dpkg-deb -e $$deb $$tmp/DEBIAN; \
pkgname=`echo $$deb | cut -d'_' -f1`; \
sed -i \
-e 's/^Source:.*/Source: $(DEB_NAME_ACT) ($(DEB_SVER_ACT))/' \
-e '/^Version:/s/$(DEB_VER_GLIBC)/$(DEB_VER_GLIBC)$(CROSS_EXT)/' \
-e '/^Depends:/s/$(DEB_VER_GLIBC)/$(DEB_VER_GLIBC)$(CROSS_EXT)/g' \
-e 's/^Built-Using:.*/Built-Using: $(GLIBC_BUILT_USING)/' \
-e 's/$(CROSS_EXT)$(CROSS_EXT)/$(CROSS_EXT)/g' \
$$tmp/DEBIAN/control; \
if [ -f $$tmp/DEBIAN/shlibs ]; then \
sed -i 's/\(libc[06][^ ]*\)/\1:'$$cross_arch'/;/^udeb/d' $$tmp/DEBIAN/shlibs; \
fi; \
install -d -m 755 $$tmp/usr/share/lintian/overrides; \
if [ -e debian/overrides/$$pkgname ]; then \
cp debian/overrides/$$pkgname $$tmp/usr/share/lintian/overrides/; \
fi; \
echo "$$pkgname binary: non-standard-dir-in-usr" \
>> $$tmp/usr/share/lintian/overrides/$$pkgname; \
case "$$pkgname" in \
linux*) \
;; \
libc*-dev*) \
echo "$$pkgname binary: arch-independent-package-contains-binary-or-object" \
>> $$tmp/usr/share/lintian/overrides/$$pkgname; \
echo "$$pkgname binary: unstripped-binary-or-object" \
>> $$tmp/usr/share/lintian/overrides/$$pkgname; \
;; \
libc*) \
echo "$$pkgname binary: arch-independent-package-contains-binary-or-object" \
>> $$tmp/usr/share/lintian/overrides/$$pkgname; \
echo "$$pkgname binary: embedded-library" \
>> $$tmp/usr/share/lintian/overrides/$$pkgname; \
echo "$$pkgname binary: missing-depends-line" \
>> $$tmp/usr/share/lintian/overrides/$$pkgname; \
echo "$$pkgname binary: shlibs-declares-dependency-on-other-package" \
>> $$tmp/usr/share/lintian/overrides/$$pkgname; \
echo "$$pkgname binary: shared-lib-without-dependency-information" \
>> $$tmp/usr/share/lintian/overrides/$$pkgname; \
echo "$$pkgname binary: shlib-with-executable-bit" \
>> $$tmp/usr/share/lintian/overrides/$$pkgname; \
echo "$$pkgname binary: unstripped-binary-or-object" \
>> $$tmp/usr/share/lintian/overrides/$$pkgname; \
if [ $$pkgname = libc6-hppa-cross ]; then \
echo "$$pkgname binary: shlib-with-non-pic-code" \
>> $$tmp/usr/share/lintian/overrides/$$pkgname; \
echo "$$pkgname binary: binary-compiled-with-profiling-enabled" \
>> $$tmp/usr/share/lintian/overrides/$$pkgname; \
fi; \
esac; \
case "$$pkgname" in \
libc6-sparc64-cross) \
rm -f $$tmp/usr/sparc64-linux-gnu/lib64/ld-linux.so.2; \
mv $$tmp/usr/sparc64-linux-gnu/lib/ld-linux.so.2 $$tmp/usr/sparc64-linux-gnu/lib64/. ;; \
esac; \
case "$$pkgname" in \
libc6-dev-sparc64-cross) \
sed -i -e 's,/lib[^/]*/ld-linux.so.2,/lib64/ld-linux.so.2,' \
$$tmp/usr/*/lib/libc.so;; \
esac; \
case "$$pkgname" in \
libc6-dev-sparc64-cross) \
sed -i -e 's,/lib[^/]*/ld-linux.so.2,/lib64/ld-linux.so.2,' \
$$tmp/usr/*/lib/libc.so;; \
esac; \
case "$$pkgname" in \
libc6-dev-powerpc-ppc64-cross|libc6-dev-s390-s390x-cross) \
sed -i -e 's,/lib[^/]*/ld.so.1,/lib32/ld.so.1,' \
$$tmp/usr/*/lib32/libc.so;; \
esac; \
case "$$pkgname" in \
libc6-dev-sparc-sparc64-cross|libc6-dev-i386-x32-cross|libc6-dev-i386-amd64-cross|libc6-dev-i386-x32-cross) \
sed -i -e 's,/lib[^/]*/ld-linux.so.2,/lib32/ld-linux.so.2,' \
$$tmp/usr/*/lib32/libc.so;; \
esac; \
case "$$pkgname" in \
libc6-dev-powerpc-ppc64-cross|libc6-dev-sparc-sparc64-cross|libc6-dev-i386-x32-cross|libc6-dev-s390-s390x-cross|libc6-dev-i386-amd64-cross|libc6-dev-i386-x32-cross) \
triplet="$$(basename $$(dirname $$(echo $$tmp/usr/*/lib32)))"; \
sed -i -e 's,//,/,g' \
-e "s, /lib32/libc, /usr/$$triplet/lib32/libc,g" \
-e "s, /usr/lib32/libc, /usr/$$triplet/lib32/libc,g" \
$$tmp/usr/*/lib32/libc.so;; \
esac; \
case "$$pkgname" in \
libc6-dev-amd64-i386-cross|libc6-dev-ppc64-powerpc-cross|libc6-dev-amd64-x32-cross) \
triplet="$$(basename $$(dirname $$(echo $$tmp/usr/*/lib64)))"; \
sed -i -e 's,//,/,g' \
-e "s, /lib64/libc, /usr/$$triplet/lib64/libc,g" \
-e "s, /usr/lib64/libc, /usr/$$triplet/lib64/libc,g" \
$$tmp/usr/*/lib64/libc.so; \
sed -i -e 's,//,/,g' \
-e "s, /lib64/libm, /usr/$$triplet/lib64/libm,g" \
-e "s, /usr/lib64/libm, /usr/$$triplet/lib64/libm,g" \
$$tmp/usr/*/lib64/libm.so;; \
esac; \
case "$$pkgname" in \
libc6-dev-x32-amd64-cross|libc6-dev-x32-i386-cross) \
triplet="$$(basename $$(dirname $$(echo $$tmp/usr/*/libx32)))"; \
sed -i -e 's,//,/,g' \
-e "s, /libx32/libc, /usr/$$triplet/libx32/libc,g" \
-e "s, /usr/libx32/libc, /usr/$$triplet/libx32/libc,g" \
$$tmp/usr/*/libx32/libc.so; \
sed -i -e 's,//,/,g' \
-e "s, /libx32/libm, /usr/$$triplet/libx32/libm,g" \
-e "s, /usr/libx32/libm, /usr/$$triplet/libx32/libm,g" \
$$tmp/usr/*/libx32/libm.so;; \
esac; \
case "$$pkgname" in \
libc6-dev-powerpc-ppc64-cross|libc6-dev-sparc-sparc64-cross|libc6-dev-i386-x32-cross|libc6-dev-s390-s390x-cross|libc6-dev-i386-amd64-cross|libc6-dev-i386-x32-cross|libc6-dev-mipsn32-mips*-cross) \
triplet="$$(basename $$(dirname $$(echo $$tmp/usr/*/lib32)))"; \
sed -i -e 's,//,/,g' \
-e "s, /lib32/libc, /usr/$$triplet/lib32/libc,g" \
-e "s, /usr/lib32/libc, /usr/$$triplet/lib32/libc,g" \
$$tmp/usr/*/lib32/libc.so;; \
esac; \
case "$$pkgname" in \
libc6-dev-amd64-i386-cross|libc6-dev-ppc64-powerpc-cross|libc6-dev-amd64-x32-cross|libc6-dev-mips64-mips*-cross) \
triplet="$$(basename $$(dirname $$(echo $$tmp/usr/*/lib64)))"; \
sed -i -e 's,//,/,g' \
-e "s, /lib64/libc, /usr/$$triplet/lib64/libc,g" \
-e "s, /usr/lib64/libc, /usr/$$triplet/lib64/libc,g" \
$$tmp/usr/*/lib64/libc.so; \
sed -i -e 's,//,/,g' \
-e "s, /lib64/libm, /usr/$$triplet/lib64/libm,g" \
-e "s, /usr/lib64/libm, /usr/$$triplet/lib64/libm,g" \
$$tmp/usr/*/lib64/libm.so;; \
esac; \
case "$$pkgname" in \
libc6-dev-x32-amd64-cross|libc6-dev-x32-i386-cross) \
triplet="$$(basename $$(dirname $$(echo $$tmp/usr/*/libx32)))"; \
sed -i -e 's,//,/,g' \
-e "s, /libx32/libc, /usr/$$triplet/libx32/libc,g" \
-e "s, /usr/libx32/libc, /usr/$$triplet/libx32/libc,g" \
$$tmp/usr/*/libx32/libc.so; \
sed -i -e 's,//,/,g' \
-e "s, /libx32/libm, /usr/$$triplet/libx32/libm,g" \
-e "s, /usr/libx32/libm, /usr/$$triplet/libx32/libm,g" \
$$tmp/usr/*/libx32/libm.so;; \
esac; \
case "$$pkgname" in \
libc6-dev-mips32-mips*-cross) \
triplet="$$(basename $$(dirname $$(echo $$tmp/usr/*/libo32)))"; \
sed -i -e 's,//,/,g' \
-e "s, /libo32/libc, /usr/$$triplet/libo32/libc,g" \
-e "s, /usr/libo32/libc, /usr/$$triplet/libo32/libc,g" \
$$tmp/usr/*/libo32/libc.so; \
sed -i -e 's,//,/,g' \
-e "s, /libo32/libm, /usr/$$triplet/libo32/libm,g" \
-e "s, /usr/libo32/libm, /usr/$$triplet/libo32/libm,g" \
$$tmp/usr/*/libo32/libm.so;; \
esac; \
if [ 'lib$(libgcc_base)1-dbg-$${cross_arch}-cross' = $$pkgname ]; then \
sed -i -e 's/^Depends.*/Depends: lib$(libgcc_base)1-$${cross_arch}-cross (= 1:${DEB_VER_GCC}$(CROSS_EXT))/g' $$tmp/DEBIAN/control; \
ln -sf lib$(libgcc_base)1-$${cross_arch}-cross $$tmp/usr/share/doc/lib$(libgcc_base)1-dbg-$${cross_arch}-cross; \
fi; \
if [ 'lib$(libgcc_base)1-$${cross_arch}-cross' = $$pkgname ]; then \
sed -i -e'/^Depends/d' $$tmp/DEBIAN/control; \
rm $$tmp/usr/share/doc/lib$(libgcc_base)1-$${cross_arch}-cross; \
mkdir -p $$tmp/usr/share/doc/lib$(libgcc_base)1-$${cross_arch}-cross; \
mv $$tmp/usr/share/doc/lib$(libgcc_base)1-$${cross_arch}-cross/changelog.Debian.gz \
$$tmp/usr/share/doc/lib$(libgcc_base)1-$${cross_arch}-cross/changelog.Debian.gcc-${VER_GCC_BASE}.gz; \
gzip -cn9 debian/changelog > $$tmp/usr/share/doc/lib$(libgcc_base)1-$${cross_arch}-cross/changelog.Debian.gz;\
fi; \
if [ 'linux-libc-dev-$${cross_arch}-cross' = $$pkgname ]; then \
mkdir -p $$tmp/usr/share/doc/$$pkgname; \
cp repackfiles/linux.$${cross_arch}/usr/share/doc/linux-libc-dev/copyright $$tmp/usr/share/doc/$$pkgname; \
cp repackfiles/linux.$${cross_arch}/usr/share/doc/linux-libc-dev/changelog.Debian.gz $$tmp/usr/share/doc/$$pkgname; \
fi; \
if [ 'libc6-armel-cross' = $$pkgname ]; then \
sed -i -e'/^Depends/d' $$tmp/DEBIAN/control; \
fi; \
if [ 'libc6-armhf-cross' = $$pkgname ]; then \
sed -i -e'/^Depends/d' $$tmp/DEBIAN/control; \
fi; \
if [ 'libc6-arm64-cross' = $$pkgname ]; then \
sed -i -e'/^Depends/d' $$tmp/DEBIAN/control; \
fi; \
if [ 'libc6-powerpc-cross' = $$pkgname ]; then \
sed -i -e'/^Depends/d' $$tmp/DEBIAN/control; \
fi; \
if [ 'libc6-ppc64-powerpc-cross' = $$pkgname ]; then \
sed -i -e'/^Depends/d' $$tmp/DEBIAN/control; \
fi; \
case `echo $$pkgname | cut -d'-' -f1` in libc6|libc6.1) \
mkdir -p $$tmp/usr/share/doc/$$pkgname; \
cp repackfiles/glibc.$${cross_arch}/usr/share/doc/libc$$libc_ver/copyright $$tmp/usr/share/doc/$$pkgname; \
cp repackfiles/glibc.$${cross_arch}/usr/share/doc/libc$$libc_ver/changelog.Debian.gz $$tmp/usr/share/doc/$$pkgname; \
gzip -c9n debian/changelog > $$tmp/usr/share/doc/$${pkgname}/changelog.gz;\
esac; \
rm -f $$tmp/DEBIAN/md5sums; \
(cd $$tmp && find usr -type f | LC_ALL=C sort | xargs -r md5sum >>DEBIAN/md5sums);\
case "$$pkgname" in \
libc*) \
grep -q '^Built-Using:' $$tmp/DEBIAN/control \
|| echo 'Built-Using: $(GLIBC_BUILT_USING)' >> $$tmp/DEBIAN/control; \
grep -q '^Multi-Arch:' $$tmp/DEBIAN/control \
|| echo 'Multi-Arch: foreign' >> $$tmp/DEBIAN/control; \
esac; \
case "$$pkgname" in \
libc*-dev*-cross) ;; \
libc*-cross) \
sed -i -E '/^Conflicts:/s/ libc[^,]*(,|$$)//g;/^Conflicts: *$$/d' $$tmp/DEBIAN/control; \
esac; \
newdeb=`echo $$deb|sed -e "s/\(.*\)_\(.*\)_\(.*\)/\1_\2$(CROSS_EXT)_\3/g"`; \
NO_PKG_MANGLE=1 PKG_IGNORE_CURRENTLY_BUILDING=1 dpkg-deb -b $$tmp/ ../$$newdeb; \
rm -rf $$tmp
touch $@
$(stamp)repack-debs-indep: $(stamp)dpkg-cross
@echo START $@
# install -d repackfiles/linux
# dpkg-deb -x linux-libc-dev_${DEB_VER_LINUX}_${CROSS_ARCH}.deb repackfiles/linux
$(foreach a,$(CROSS_ARCHS), \
install -d repackfiles/glibc.$(a); \
dpkg-deb -x libc$(if $(filter $(a),alpha ia64),6.1,6)_${DEB_VER_GLIBC}_$(a).deb repackfiles/glibc.$(a);)
$(MAKE) $(NJOBS) -f debian/rules \
$(addprefix $(stamp)repack-,$(wildcard $(sort $(foreach a,$(CROSS_ARCHS), \
$(if $(filter $(skip_dbg_packages),yes),,libc$(if $(filter $(a),alpha ia64),6.1,6)-dbg-$(a)-cross_${DEB_VER_GLIBC}_all.deb) \
libc$(if $(filter $(a),alpha ia64),6.1,6)-$(a)-cross_${DEB_VER_GLIBC}_all.deb \
libc$(if $(filter $(a),alpha ia64),6.1,6)-dev-$(a)-cross_${DEB_VER_GLIBC}_all.deb \
$(if $(filter ppc64, $(CROSS_ARCHS)), \
libc6-powerpc-ppc64-cross_${DEB_VER_GLIBC}_all.deb \
libc6-dev-powerpc-ppc64-cross_${DEB_VER_GLIBC}_all.deb \
) \
$(if $(filter s390x, $(CROSS_ARCHS)), \
libc6-s390-s390x-cross_${DEB_VER_GLIBC}_all.deb \
libc6-dev-s390-s390x-cross_${DEB_VER_GLIBC}_all.deb \
) \
$(if $(filter sparc64, $(CROSS_ARCHS)), \
libc6-sparc-sparc64-cross_${DEB_VER_GLIBC}_all.deb \
libc6-dev-sparc-sparc64-cross_${DEB_VER_GLIBC}_all.deb \
) \
$(if $(filter powerpc, $(CROSS_ARCHS)), \
libc6-ppc64-powerpc-cross_${DEB_VER_GLIBC}_all.deb \
libc6-dev-ppc64-powerpc-cross_${DEB_VER_GLIBC}_all.deb \
) \
$(if $(filter amd64, $(CROSS_ARCHS)), \
libc6-i386-amd64-cross_${DEB_VER_GLIBC}_all.deb \
libc6-dev-i386-amd64-cross_${DEB_VER_GLIBC}_all.deb \
libc6-x32-amd64-cross_${DEB_VER_GLIBC}_all.deb \
libc6-dev-x32-amd64-cross_${DEB_VER_GLIBC}_all.deb \
) \
$(if $(filter i386, $(CROSS_ARCHS)), \
libc6-amd64-i386-cross_${DEB_VER_GLIBC}_all.deb \
libc6-dev-amd64-i386-cross_${DEB_VER_GLIBC}_all.deb \
libc6-x32-i386-cross_${DEB_VER_GLIBC}_all.deb \
libc6-dev-x32-i386-cross_${DEB_VER_GLIBC}_all.deb \
) \
$(if $(filter x32, $(CROSS_ARCHS)), \
libc6-amd64-x32-cross_${DEB_VER_GLIBC}_all.deb \
libc6-dev-amd64-x32-cross_${DEB_VER_GLIBC}_all.deb \
libc6-i386-x32-cross_${DEB_VER_GLIBC}_all.deb \
libc6-dev-i386-x32-cross_${DEB_VER_GLIBC}_all.deb \
) \
$(if $(filter mips, $(CROSS_ARCHS)), \
libc6-mips64-mips-cross_${DEB_VER_GLIBC}_all.deb \
libc6-dev-mips64-mips-cross_${DEB_VER_GLIBC}_all.deb \
libc6-mipsn32-mips-cross_${DEB_VER_GLIBC}_all.deb \
libc6-dev-mipsn32-mips-cross_${DEB_VER_GLIBC}_all.deb \
) \
$(if $(filter mipsel, $(CROSS_ARCHS)), \
libc6-mips64-mipsel-cross_${DEB_VER_GLIBC}_all.deb \
libc6-dev-mips64-mipsel-cross_${DEB_VER_GLIBC}_all.deb \
libc6-mipsn32-mipsel-cross_${DEB_VER_GLIBC}_all.deb \
libc6-dev-mipsn32-mipsel-cross_${DEB_VER_GLIBC}_all.deb \
) \
$(if $(filter mipsn32, $(CROSS_ARCHS)), \
libc6-mips64-mipsn32-cross_${DEB_VER_GLIBC}_all.deb \
libc6-dev-mips64-mipsn32-cross_${DEB_VER_GLIBC}_all.deb \
libc6-mips32-mipsn32-cross_${DEB_VER_GLIBC}_all.deb \
libc6-dev-mips32-mipsn32-cross_${DEB_VER_GLIBC}_all.deb \
) \
$(if $(filter mipsn32el, $(CROSS_ARCHS)), \
libc6-mips64-mipsn32el-cross_${DEB_VER_GLIBC}_all.deb \
libc6-dev-mips64-mipsn32el-cross_${DEB_VER_GLIBC}_all.deb \
libc6-mips32-mipsn32el-cross_${DEB_VER_GLIBC}_all.deb \
libc6-dev-mips32-mipsn32el-cross_${DEB_VER_GLIBC}_all.deb \
) \
$(if $(filter mips64, $(CROSS_ARCHS)), \
libc6-mips32-mips64-cross_${DEB_VER_GLIBC}_all.deb \
libc6-dev-mips32-mips64-cross_${DEB_VER_GLIBC}_all.deb \
libc6-mipsn32-mips64-cross_${DEB_VER_GLIBC}_all.deb \
libc6-dev-mipsn32-mips64-cross_${DEB_VER_GLIBC}_all.deb \
) \
$(if $(filter mips64el, $(CROSS_ARCHS)), \
libc6-mips32-mips64el-cross_${DEB_VER_GLIBC}_all.deb \
libc6-dev-mips32-mips64el-cross_${DEB_VER_GLIBC}_all.deb \
libc6-mipsn32-mips64el-cross_${DEB_VER_GLIBC}_all.deb \
libc6-dev-mipsn32-mips64el-cross_${DEB_VER_GLIBC}_all.deb \
) \
$(if $(filter mipsr6, $(CROSS_ARCHS)), \
libc6-mips64-mipsr6-cross_${DEB_VER_GLIBC}_all.deb \
libc6-dev-mips64-mipsr6-cross_${DEB_VER_GLIBC}_all.deb \
libc6-mipsn32-mipsr6-cross_${DEB_VER_GLIBC}_all.deb \
libc6-dev-mipsn32-mipsr6-cross_${DEB_VER_GLIBC}_all.deb \
) \
$(if $(filter mipsr6el, $(CROSS_ARCHS)), \
libc6-mips64-mipsr6el-cross_${DEB_VER_GLIBC}_all.deb \
libc6-dev-mips64-mipsr6el-cross_${DEB_VER_GLIBC}_all.deb \
libc6-mipsn32-mipsr6el-cross_${DEB_VER_GLIBC}_all.deb \
libc6-dev-mipsn32-mipsr6el-cross_${DEB_VER_GLIBC}_all.deb \
) \
$(if $(filter mipsn32r6, $(CROSS_ARCHS)), \
libc6-mips64-mipsn32r6-cross_${DEB_VER_GLIBC}_all.deb \
libc6-dev-mips64-mipsn32r6-cross_${DEB_VER_GLIBC}_all.deb \
libc6-mips32-mipsn32r6-cross_${DEB_VER_GLIBC}_all.deb \
libc6-dev-mips32-mipsn32r6-cross_${DEB_VER_GLIBC}_all.deb \
) \
$(if $(filter mipsn32r6el, $(CROSS_ARCHS)), \
libc6-mips64-mipsn32r6el-cross_${DEB_VER_GLIBC}_all.deb \
libc6-dev-mips64-mipsn32r6el-cross_${DEB_VER_GLIBC}_all.deb \
libc6-mips32-mipsn32r6el-cross_${DEB_VER_GLIBC}_all.deb \
libc6-dev-mips32-mipsn32r6el-cross_${DEB_VER_GLIBC}_all.deb \
) \
$(if $(filter mips64r6, $(CROSS_ARCHS)), \
libc6-mips32-mips64r6-cross_${DEB_VER_GLIBC}_all.deb \
libc6-dev-mips32-mips64r6-cross_${DEB_VER_GLIBC}_all.deb \
libc6-mipsn32-mips64r6-cross_${DEB_VER_GLIBC}_all.deb \
libc6-dev-mipsn32-mips64r6-cross_${DEB_VER_GLIBC}_all.deb \
) \
$(if $(filter mips64r6el, $(CROSS_ARCHS)), \
libc6-mips32-mips64r6el-cross_${DEB_VER_GLIBC}_all.deb \
libc6-dev-mips32-mips64r6el-cross_${DEB_VER_GLIBC}_all.deb \
libc6-mipsn32-mips64r6el-cross_${DEB_VER_GLIBC}_all.deb \
libc6-dev-mipsn32-mips64r6el-cross_${DEB_VER_GLIBC}_all.deb \
) \
))))
build: $(stamp)build
build-arch: # nothing to do
build-indep: $(stamp)build
$(stamp)build: $(foreach arch,$(CROSS_ARCHS),$(addsuffix .$(arch),$(stamp)build-glibc2))
: # we do not need those packages
rm -f binutils-*.*deb
rm -f cpp-*.*deb gcc-*.*deb
rm -f linux-headers*.*deb
rm -f *-doc*.*deb
rm -f *-source*.*deb
rm -f linux-tools-common_*.*deb
rm -f nscd*deb
rm -f multiarch-support*.deb
rm -f lib*gcc*deb
rm -f libc-*bin*.deb
rm -f libc*-pic_*.deb
rm -f locales*.deb
rm -f *.udeb
touch $@
linux_debs = $(foreach arch,$(CROSS_ARCHS), -plinux-libc-dev-${arch}-cross)
binary: binary-arch binary-indep
binary-arch: build-arch
binary-indep: build $(stamp)dpkg-cross $(stamp)mangle-debian-files-indep
@echo START $@
dh_compress $(linux_debs)
dh_fixperms $(linux_debs)
dh_installdeb $(linux_debs)
dh_gencontrol $(linux_debs) -- -v$(DEB_VER_LINUX)$(CROSS_EXT) $(control_vars)
dh_md5sums $(linux_debs)
dh_builddeb $(linux_debs)
$(stamp)debian-files-base:
@echo START $@
rm -f debian/files
touch $@
define generate_debian_files
@for deb in $1; \
do \
echo -n "`basename $$deb` " >>debian/files; \
dpkg-deb -I $$deb | grep Section | cut -d ' ' -f 3 | tr "\n" ' ' >>debian/files; \
dpkg-deb -I $$deb | grep Priority | cut -d ' ' -f 3 | tr -d "\n" >>debian/files; \
echo "" >>debian/files; \
done
endef
$(stamp)mangle-debian-files-indep: $(stamp)debian-files-base $(stamp)repack-debs-indep
@echo START $@
$(call generate_debian_files, ${DEB_LIST_MANGLED})
sed -i -e "/^libc/s/_all.deb/$(CROSS_EXT)_all.deb/g" debian/files
$(foreach arch,$(CROSS_ARCHS), \
sed -i -e "/^libc/s/_${arch}.deb/$(CROSS_EXT)_${arch}.deb/g" debian/files;)
sed -i -e "/^libc/s/$(CROSS_EXT)$(CROSS_EXT)/$(CROSS_EXT)/g" debian/files
: # glibc packages only, linux-libc-dev doesn't need dpkg-cross
$(stamp)dc-%: build
@echo START $@
@set -e; \
deb=$*; \
arch=$$(echo $$deb | sed 's/.*_\([^_][^_]*\)\.deb$$/\1/'); \
case $$deb in \
libc*-dbg*) \
if [ "$(skip_dbg_packages)" = yes ]; then \
echo "skipping debug package package $$deb"; exit 0; \
fi;; \
libc*-loongson2f*) \
echo "skipping package package $$deb"; exit 0; \
esac; \
echo dpkg-cross $$deb ...; \
echo "default_arch = undefined" > debian/cross-compile; \
set -x; \
PKG_IGNORE_CURRENTLY_BUILDING=1 debian/dpkg-cross -A -M -a $$arch \
-X dpkg -X findutils -X tzdata -X libc-bin -X libc-dev-bin \
-X debconf -X debconf-2.0 \
-b $$deb
touch $@
$(stamp)dpkg-cross: build
@echo START $@
$(MAKE) $(NJOBS) -f debian/rules \
$(addprefix $(stamp)dc-, \
$(wildcard $(foreach a,$(CROSS_ARCHS), \
libc6*_*_$(a).deb libc6*-d*_$(a).deb \
)) \
)
touch $@
control:
ifeq ($(DEB_NAME_ACT),cross-toolchain-base-mipsen)
rm -rf debian/tests
endif
@echo START $@
( \
sed \
-e "s/MIN_VER_GLIBC/${MIN_VER_GLIBC}/g" \
-e "s/MIN_VER_LINUX/${MIN_VER_LINUX}/g" \
-e "s/VER_LINUX/${VER_LINUX}/g" \
-e "s/MIN_VER_GCC/${MIN_VER_GCC}/g" \
-e "s/MIN_VER_BINUTILS/${MIN_VER_BINUTILS}/g" \
-e "s/VER_GCC_BASE/${VER_GCC_BASE}/g" \
-e "s/@SOURCE@/${DEB_NAME_ACT}/g" \
-e "s/BINUTILS_BUILD_CONFLICTS/$(BINUTILS_BUILD_CONFLICTS)/g" \
-e "s/GLIBC_BUILD_CONFLICTS/$(GLIBC_BUILD_CONFLICTS)/g" \
debian/control.source.in; \
$(foreach a,$(sort $(CROSS_ARCHS)),sed -e "s/CROSS_ARCH/$(a)/g" debian/control.linux-libc-dev.in;) \
$(foreach a,$(sort $(CROSS_ARCHS)),sed -e "s/CROSS_ARCH/$(a)/g; s/LIBC_VER/$(if $(filter $(a),alpha ia64),6.1,6)/" debian/control.libc.in;) \
) > debian/control
ifneq (,$(filter ppc64, $(CROSS_ARCHS)))
sed -e "s/CROSS_ARCH/ppc64/g;s/CROSS_BIARCH/powerpc/g" \
debian/control.multilib.in >> debian/control
endif
ifneq (,$(filter s390x, $(CROSS_ARCHS)))
sed -e "s/CROSS_ARCH/s390x/g;s/CROSS_BIARCH/s390/g" \
debian/control.multilib.in >> debian/control
endif
ifneq (,$(filter sparc64, $(CROSS_ARCHS)))
sed -e "s/CROSS_ARCH/sparc64/g;s/CROSS_BIARCH/sparc/g" \
debian/control.multilib.in >> debian/control
endif
ifneq (,$(filter powerpc, $(CROSS_ARCHS)))
sed -e "s/CROSS_ARCH/powerpc/g;s/CROSS_BIARCH/ppc64/g" \
debian/control.multilib.in >> debian/control
endif
ifneq (,$(filter amd64, $(CROSS_ARCHS)))
sed -e "s/CROSS_ARCH/amd64/g;s/CROSS_BIARCH/i386/g" \
debian/control.multilib.in >> debian/control
sed -e "s/CROSS_ARCH/amd64/g;s/CROSS_BIARCH/x32/g" \
debian/control.multilib.in >> debian/control
endif
ifneq (,$(filter i386, $(CROSS_ARCHS)))
sed -e "s/CROSS_ARCH/i386/g;s/CROSS_BIARCH/amd64/g" \
debian/control.multilib.in >> debian/control
sed -e "s/CROSS_ARCH/i386/g;s/CROSS_BIARCH/x32/g" \
debian/control.multilib.in >> debian/control
endif
ifneq (,$(filter x32, $(CROSS_ARCHS)))
sed -e "s/CROSS_ARCH/x32/g;s/CROSS_BIARCH/amd64/g" \
debian/control.multilib.in >> debian/control
sed -e "s/CROSS_ARCH/x32/g;s/CROSS_BIARCH/i386/g" \
debian/control.multilib.in >> debian/control
endif
ifneq (,$(filter mips, $(CROSS_ARCHS)))
sed -e "s/CROSS_ARCH/mips/g;s/CROSS_BIARCH/mips64/g" \
debian/control.multilib.in >> debian/control
sed -e "s/CROSS_ARCH/mips/g;s/CROSS_TRIARCH/mipsn32/g" \
debian/control.trilib.in >> debian/control
endif
ifneq (,$(filter mipsel, $(CROSS_ARCHS)))
sed -e "s/CROSS_ARCH/mipsel/g;s/CROSS_BIARCH/mips64/g" \
debian/control.multilib.in >> debian/control
sed -e "s/CROSS_ARCH/mipsel/g;s/CROSS_TRIARCH/mipsn32/g" \
debian/control.trilib.in >> debian/control
endif
ifneq (,$(filter mipsn32, $(CROSS_ARCHS)))
sed -e "s/CROSS_ARCH/mipsn32/g;s/CROSS_BIARCH/mips64/g" \
debian/control.multilib.in >> debian/control
sed -e "s/CROSS_ARCH/mipsn32/g;s/CROSS_TRIARCH/mips32/g" \
debian/control.trilib.in >> debian/control
endif
ifneq (,$(filter mipsn32el, $(CROSS_ARCHS)))
sed -e "s/CROSS_ARCH/mipsn32el/g;s/CROSS_BIARCH/mips64/g" \
debian/control.multilib.in >> debian/control
sed -e "s/CROSS_ARCH/mipsn32el/g;s/CROSS_TRIARCH/mips32/g" \
debian/control.trilib.in >> debian/control
endif
ifneq (,$(filter mips64, $(CROSS_ARCHS)))
sed -e "s/CROSS_ARCH/mips64/g;s/CROSS_BIARCH/mips32/g" \
debian/control.multilib.in >> debian/control
sed -e "s/CROSS_ARCH/mips64/g;s/CROSS_TRIARCH/mipsn32/g" \
debian/control.trilib.in >> debian/control
endif
ifneq (,$(filter mips64el, $(CROSS_ARCHS)))
sed -e "s/CROSS_ARCH/mips64el/g;s/CROSS_BIARCH/mips32/g" \
debian/control.multilib.in >> debian/control
sed -e "s/CROSS_ARCH/mips64el/g;s/CROSS_TRIARCH/mipsn32/g" \
debian/control.trilib.in >> debian/control
endif
ifneq (,$(filter mipsr6, $(CROSS_ARCHS)))
sed -e "s/CROSS_ARCH/mipsr6/g;s/CROSS_BIARCH/mips64/g" \
debian/control.multilib.in >> debian/control
sed -e "s/CROSS_ARCH/mipsr6/g;s/CROSS_TRIARCH/mipsn32/g" \
debian/control.trilib.in >> debian/control
endif
ifneq (,$(filter mipsr6el, $(CROSS_ARCHS)))
sed -e "s/CROSS_ARCH/mipsr6el/g;s/CROSS_BIARCH/mips64/g" \
debian/control.multilib.in >> debian/control
sed -e "s/CROSS_ARCH/mipsr6el/g;s/CROSS_TRIARCH/mipsn32/g" \
debian/control.trilib.in >> debian/control
endif
ifneq (,$(filter mipsn32r6, $(CROSS_ARCHS)))
sed -e "s/CROSS_ARCH/mipsn32r6/g;s/CROSS_BIARCH/mips64/g" \
debian/control.multilib.in >> debian/control
sed -e "s/CROSS_ARCH/mipsn32r6/g;s/CROSS_TRIARCH/mips32/g" \
debian/control.trilib.in >> debian/control
endif
ifneq (,$(filter mipsn32r6el, $(CROSS_ARCHS)))
sed -e "s/CROSS_ARCH/mipsn32r6el/g;s/CROSS_BIARCH/mips64/g" \
debian/control.multilib.in >> debian/control
sed -e "s/CROSS_ARCH/mipsn32r6el/g;s/CROSS_TRIARCH/mips32/g" \
debian/control.trilib.in >> debian/control
endif
ifneq (,$(filter mips64r6, $(CROSS_ARCHS)))
sed -e "s/CROSS_ARCH/mips64r6/g;s/CROSS_BIARCH/mips32/g" \
debian/control.multilib.in >> debian/control
sed -e "s/CROSS_ARCH/mips64r6/g;s/CROSS_TRIARCH/mipsn32/g" \
debian/control.trilib.in >> debian/control
endif
ifneq (,$(filter mips64r6el, $(CROSS_ARCHS)))
sed -e "s/CROSS_ARCH/mips64r6el/g;s/CROSS_BIARCH/mips32/g" \
debian/control.multilib.in >> debian/control
sed -e "s/CROSS_ARCH/mips64r6el/g;s/CROSS_TRIARCH/mipsn32/g" \
debian/control.trilib.in >> debian/control
endif
echo 'foobar' > debian/no-packages
python3 debian/remove-unbuilt \
$(if $(filter yes,$(skip_dbg_packages)), --skip-dbg-packages) \
debian/control debian/no-packages \
> debian/control.new && mv debian/control.new debian/control
.PRECIOUS: $(stamp)init-dirs \
$(stamp)init-linux \
$(stamp)build-linux.% \
$(stamp)install-linux.% \
$(stamp)init-binutils \
$(stamp)build-binutils.% \
$(stamp)install-binutils.% \
$(stamp)init-gcc \
$(stamp)build-gcc1.% \
$(stamp)install-gcc1.% \
$(stamp)build-gcc3.% \
$(stamp)init-glibc \
$(stamp)build-glibc2.% \
$(stamp)install-glibc2.% \
$(stamp)debian-files-base \
$(stamp)dc-% \
$(stamp)repack-debs-arch \
$(stamp)repack-debs-indep \
$(stamp)repack-debs-indep.% \
$(stamp)mangle-debian-files-arch \
$(stamp)mangle-debian-files-indep
.PHONY: build build-arch build-indep binary binary-arch binary-indep
|