summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2015-08-08 13:49:04 -0700
committerRobin H. Johnson <robbat2@gentoo.org>2015-08-08 17:38:18 -0700
commit56bd759df1d0c750a065b8c845e93d5dfa6b549d (patch)
tree3f91093cdb475e565ae857f1c5a7fd339e2d781e /sys-devel
downloadgentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.gz
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.bz2
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.zip
proj/gentoo: Initial commit
This commit represents a new era for Gentoo: Storing the gentoo-x86 tree in Git, as converted from CVS. This commit is the start of the NEW history. Any historical data is intended to be grafted onto this point. Creation process: 1. Take final CVS checkout snapshot 2. Remove ALL ChangeLog* files 3. Transform all Manifests to thin 4. Remove empty Manifests 5. Convert all stale $Header$/$Id$ CVS keywords to non-expanded Git $Id$ 5.1. Do not touch files with -kb/-ko keyword flags. Signed-off-by: Robin H. Johnson <robbat2@gentoo.org> X-Thanks: Alec Warner <antarus@gentoo.org> - did the GSoC 2006 migration tests X-Thanks: Robin H. Johnson <robbat2@gentoo.org> - infra guy, herding this project X-Thanks: Nguyen Thai Ngoc Duy <pclouds@gentoo.org> - Former Gentoo developer, wrote Git features for the migration X-Thanks: Brian Harring <ferringb@gentoo.org> - wrote much python to improve cvs2svn X-Thanks: Rich Freeman <rich0@gentoo.org> - validation scripts X-Thanks: Patrick Lauer <patrick@gentoo.org> - Gentoo dev, running new 2014 work in migration X-Thanks: Michał Górny <mgorny@gentoo.org> - scripts, QA, nagging X-Thanks: All of other Gentoo developers - many ideas and lots of paint on the bikeshed
Diffstat (limited to 'sys-devel')
-rw-r--r--sys-devel/autoconf-archive/Manifest6
-rw-r--r--sys-devel/autoconf-archive/autoconf-archive-2012.09.08.ebuild21
-rw-r--r--sys-devel/autoconf-archive/autoconf-archive-2013.06.09.ebuild21
-rw-r--r--sys-devel/autoconf-archive/autoconf-archive-2013.11.01.ebuild21
-rw-r--r--sys-devel/autoconf-archive/autoconf-archive-2014.02.28.ebuild21
-rw-r--r--sys-devel/autoconf-archive/autoconf-archive-2015.02.04.ebuild26
-rw-r--r--sys-devel/autoconf-archive/autoconf-archive-2015.02.24.ebuild26
-rw-r--r--sys-devel/autoconf-archive/metadata.xml9
-rw-r--r--sys-devel/autoconf-wrapper/autoconf-wrapper-13.ebuild27
-rwxr-xr-xsys-devel/autoconf-wrapper/files/ac-wrapper-13.sh202
-rw-r--r--sys-devel/autoconf-wrapper/metadata.xml5
-rw-r--r--sys-devel/autoconf/Manifest10
-rw-r--r--sys-devel/autoconf/autoconf-2.13.ebuild57
-rw-r--r--sys-devel/autoconf/autoconf-2.59-r7.ebuild33
-rw-r--r--sys-devel/autoconf/autoconf-2.61-r2.ebuild39
-rw-r--r--sys-devel/autoconf/autoconf-2.62-r1.ebuild35
-rw-r--r--sys-devel/autoconf/autoconf-2.63-r1.ebuild33
-rw-r--r--sys-devel/autoconf/autoconf-2.64.ebuild27
-rw-r--r--sys-devel/autoconf/autoconf-2.65-r1.ebuild33
-rw-r--r--sys-devel/autoconf/autoconf-2.67.ebuild27
-rw-r--r--sys-devel/autoconf/autoconf-2.68.ebuild27
-rw-r--r--sys-devel/autoconf/autoconf-2.69-r1.ebuild39
-rw-r--r--sys-devel/autoconf/autoconf-2.69.ebuild58
-rw-r--r--sys-devel/autoconf/autoconf-9999.ebuild48
-rw-r--r--sys-devel/autoconf/files/autoconf-2.13-destdir.patch26
-rw-r--r--sys-devel/autoconf/files/autoconf-2.13-gentoo.patch36
-rw-r--r--sys-devel/autoconf/files/autoconf-2.13-test-fixes.patch18
-rw-r--r--sys-devel/autoconf/files/autoconf-2.59-more-quotes.patch34
-rw-r--r--sys-devel/autoconf/files/autoconf-2.60-tests.patch22
-rw-r--r--sys-devel/autoconf/files/autoconf-2.61-GETMNTENT.patch23
-rw-r--r--sys-devel/autoconf/files/autoconf-2.62-at-keywords.patch81
-rw-r--r--sys-devel/autoconf/files/autoconf-2.62-fix-multiline-string.patch30
-rw-r--r--sys-devel/autoconf/files/autoconf-2.62-revert-AC_C_BIGENDIAN.patch214
-rw-r--r--sys-devel/autoconf/files/autoconf-2.63-sh.patch32
-rw-r--r--sys-devel/autoconf/files/autoconf-2.65-AC_TYPE_INT_T.patch49
-rw-r--r--sys-devel/autoconf/files/eblits/main.eblit48
-rw-r--r--sys-devel/autoconf/files/eblits/src_configure.eblit12
-rw-r--r--sys-devel/autoconf/files/eblits/src_install.eblit39
-rw-r--r--sys-devel/autoconf/files/eblits/src_prepare.eblit9
-rw-r--r--sys-devel/autoconf/metadata.xml8
-rw-r--r--sys-devel/autogen/Manifest6
-rw-r--r--sys-devel/autogen/autogen-5.15.ebuild26
-rw-r--r--sys-devel/autogen/autogen-5.17.3.ebuild38
-rw-r--r--sys-devel/autogen/autogen-5.17.4.ebuild36
-rw-r--r--sys-devel/autogen/autogen-5.18.1.ebuild36
-rw-r--r--sys-devel/autogen/autogen-5.18.2.ebuild36
-rw-r--r--sys-devel/autogen/autogen-5.18.4.ebuild36
-rw-r--r--sys-devel/autogen/files/autogen-5.17.3-libintl.patch12
-rw-r--r--sys-devel/autogen/metadata.xml8
-rw-r--r--sys-devel/automake-wrapper/automake-wrapper-10.ebuild35
-rw-r--r--sys-devel/automake-wrapper/automake-wrapper-9.ebuild29
-rw-r--r--sys-devel/automake-wrapper/files/am-wrapper-10.sh187
-rwxr-xr-xsys-devel/automake-wrapper/files/am-wrapper-9.sh187
-rw-r--r--sys-devel/automake-wrapper/metadata.xml5
-rw-r--r--sys-devel/automake/Manifest12
-rw-r--r--sys-devel/automake/automake-1.10.3-r1.ebuild82
-rw-r--r--sys-devel/automake/automake-1.11.6-r1.ebuild90
-rw-r--r--sys-devel/automake/automake-1.12.6.ebuild85
-rw-r--r--sys-devel/automake/automake-1.13.4.ebuild90
-rw-r--r--sys-devel/automake/automake-1.14.1.ebuild102
-rw-r--r--sys-devel/automake/automake-1.15.ebuild102
-rw-r--r--sys-devel/automake/automake-1.4_p6-r2.ebuild84
-rw-r--r--sys-devel/automake/automake-1.5-r2.ebuild80
-rw-r--r--sys-devel/automake/automake-1.6.3-r2.ebuild73
-rw-r--r--sys-devel/automake/automake-1.7.9-r3.ebuild76
-rw-r--r--sys-devel/automake/automake-1.8.5-r5.ebuild76
-rw-r--r--sys-devel/automake/automake-1.9.6-r4.ebuild84
-rw-r--r--sys-devel/automake/automake-9999.ebuild91
-rw-r--r--sys-devel/automake/files/automake-1.10-ccnoco-ldflags.patch35
-rw-r--r--sys-devel/automake/files/automake-1.10-perl-5.16.patch128
-rw-r--r--sys-devel/automake/files/automake-1.10.1-tests.patch111
-rw-r--r--sys-devel/automake/files/automake-1.10.2-bash4.patch22
-rw-r--r--sys-devel/automake/files/automake-1.13-dyn-ithreads.patch59
-rw-r--r--sys-devel/automake/files/automake-1.4-CVE-2009-4029.patch65
-rw-r--r--sys-devel/automake/files/automake-1.4-ansi2knr-stdlib.patch11
-rw-r--r--sys-devel/automake/files/automake-1.4-libtoolize.patch17
-rw-r--r--sys-devel/automake/files/automake-1.4-nls-nuisances.patch19
-rw-r--r--sys-devel/automake/files/automake-1.4-perl-5.11.patch28
-rw-r--r--sys-devel/automake/files/automake-1.4-perl-dyn-call.patch23
-rw-r--r--sys-devel/automake/files/automake-1.4-subdirs-89656.patch22
-rw-r--r--sys-devel/automake/files/automake-1.5-CVE-2009-4029.patch60
-rw-r--r--sys-devel/automake/files/automake-1.5-perl-5.11.patch28
-rw-r--r--sys-devel/automake/files/automake-1.5-slot.patch42
-rw-r--r--sys-devel/automake/files/automake-1.5-target_hook.patch36
-rw-r--r--sys-devel/automake/files/automake-1.5-test-fixes.patch65
-rw-r--r--sys-devel/automake/files/automake-1.6.3-test-fixes.patch28
-rw-r--r--sys-devel/automake/files/automake-1.7.9-infopage-namechange.patch15
-rw-r--r--sys-devel/automake/files/automake-1.7.9-libtool-2.patch43
-rw-r--r--sys-devel/automake/files/automake-1.7.9-test-fixes.patch46
-rw-r--r--sys-devel/automake/files/automake-1.8-perl-5.11.patch30
-rw-r--r--sys-devel/automake/files/automake-1.8.2-infopage-namechange.patch36
-rw-r--r--sys-devel/automake/files/automake-1.8.5-CVE-2009-4029.patch60
-rw-r--r--sys-devel/automake/files/automake-1.8.5-test-fixes.patch43
-rw-r--r--sys-devel/automake/files/automake-1.9.6-aclocal7-test-sleep.patch39
-rw-r--r--sys-devel/automake/files/automake-1.9.6-ignore-comments.patch29
-rw-r--r--sys-devel/automake/files/automake-1.9.6-include-dir-prefix.patch31
-rw-r--r--sys-devel/automake/files/automake-1.9.6-infopage-namechange.patch33
-rw-r--r--sys-devel/automake/files/automake-1.9.6-subst-test.patch42
-rw-r--r--sys-devel/automake/metadata.xml5
-rw-r--r--sys-devel/bc/Manifest1
-rw-r--r--sys-devel/bc/bc-1.06.95-r1.ebuild52
-rw-r--r--sys-devel/bc/bc-1.06.95-r2.ebuild55
-rw-r--r--sys-devel/bc/bc-1.06.95.ebuild39
-rw-r--r--sys-devel/bc/files/bc-1.06.95-mem-leak.patch24
-rw-r--r--sys-devel/bc/files/bc-1.06.95-void_uninitialized.patch13
-rw-r--r--sys-devel/bc/metadata.xml5
-rw-r--r--sys-devel/bin86/Manifest3
-rw-r--r--sys-devel/bin86/bin86-0.16.20-r2.ebuild35
-rw-r--r--sys-devel/bin86/bin86-0.16.21.ebuild33
-rw-r--r--sys-devel/bin86/files/bin86-0.16.17-amd64-build.patch17
-rw-r--r--sys-devel/bin86/files/bin86-0.16.18-headers.patch34
-rw-r--r--sys-devel/bin86/files/bin86-0.16.20-remove-seg-ss-check.patch22
-rw-r--r--sys-devel/bin86/metadata.xml9
-rw-r--r--sys-devel/binutils-apple/Manifest21
-rw-r--r--sys-devel/binutils-apple/binutils-apple-3.1.2.ebuild214
-rw-r--r--sys-devel/binutils-apple/binutils-apple-3.2.6.ebuild254
-rw-r--r--sys-devel/binutils-apple/binutils-apple-3.2.ebuild234
-rw-r--r--sys-devel/binutils-apple/binutils-apple-4.2-r1.ebuild328
-rw-r--r--sys-devel/binutils-apple/binutils-apple-4.2.ebuild312
-rw-r--r--sys-devel/binutils-apple/binutils-apple-4.3-r1.ebuild316
-rw-r--r--sys-devel/binutils-apple/binutils-apple-4.3.ebuild309
-rw-r--r--sys-devel/binutils-apple/binutils-apple-5.1.ebuild356
-rw-r--r--sys-devel/binutils-apple/binutils-apple-6.1.ebuild355
-rw-r--r--sys-devel/binutils-apple/files/Makefile12
-rw-r--r--sys-devel/binutils-apple/files/binutils-apple-3.1.1-as-dir.patch69
-rw-r--r--sys-devel/binutils-apple/files/binutils-apple-3.1.1-as.patch98
-rw-r--r--sys-devel/binutils-apple/files/binutils-apple-3.1.1-libtool-ranlib.patch17
-rw-r--r--sys-devel/binutils-apple/files/binutils-apple-3.1.1-nmedit.patch15
-rw-r--r--sys-devel/binutils-apple/files/binutils-apple-3.1.1-no-efi-man.patch38
-rw-r--r--sys-devel/binutils-apple/files/binutils-apple-3.1.1-no-headers.patch15
-rw-r--r--sys-devel/binutils-apple/files/binutils-apple-3.1.1-no-oss-dir.patch17
-rw-r--r--sys-devel/binutils-apple/files/binutils-apple-3.1.1-ranlib.patch53
-rw-r--r--sys-devel/binutils-apple/files/binutils-apple-3.1.1-testsuite.patch102
-rw-r--r--sys-devel/binutils-apple/files/binutils-apple-3.1.2-as-Makefile.patch11
-rw-r--r--sys-devel/binutils-apple/files/binutils-apple-3.2-armv7-defines.patch10
-rw-r--r--sys-devel/binutils-apple/files/binutils-apple-3.2.2-as.patch101
-rw-r--r--sys-devel/binutils-apple/files/binutils-apple-3.2.3-ranlib.patch59
-rw-r--r--sys-devel/binutils-apple/files/binutils-apple-4.0-as-dir.patch67
-rw-r--r--sys-devel/binutils-apple/files/binutils-apple-4.0-as.patch99
-rw-r--r--sys-devel/binutils-apple/files/binutils-apple-4.0-no-oss-dir.patch15
-rw-r--r--sys-devel/binutils-apple/files/binutils-apple-4.2-as-dir.patch45
-rw-r--r--sys-devel/binutils-apple/files/binutils-apple-4.2-globals-extern.patch29
-rw-r--r--sys-devel/binutils-apple/files/binutils-apple-4.2-lto.patch34
-rw-r--r--sys-devel/binutils-apple/files/binutils-apple-4.5-as.patch100
-rw-r--r--sys-devel/binutils-apple/files/binutils-apple-5.1-as-dir.patch47
-rw-r--r--sys-devel/binutils-apple/files/binutils-apple-5.1-constant-types.patch26
-rw-r--r--sys-devel/binutils-apple/files/binutils-apple-5.1-extraneous-includes.patch31
-rw-r--r--sys-devel/binutils-apple/files/binutils-apple-5.1-nolto.patch43
-rw-r--r--sys-devel/binutils-apple/files/binutils-apple-5.1-otool-stdc.patch23
-rw-r--r--sys-devel/binutils-apple/files/binutils-apple-5.1-ranlib.patch15
-rw-r--r--sys-devel/binutils-apple/files/binutils-apple-5.1-strnlen.patch45
-rw-r--r--sys-devel/binutils-apple/files/cctools-839-intel-retf.patch14
-rw-r--r--sys-devel/binutils-apple/files/ld64-123.2-Makefile47
-rw-r--r--sys-devel/binutils-apple/files/ld64-123.2-darwin8-no-mlong-branch-warning.patch17
-rw-r--r--sys-devel/binutils-apple/files/ld64-123.2-debug-backtrace.patch15
-rw-r--r--sys-devel/binutils-apple/files/ld64-123.2.1-lto.patch218
-rw-r--r--sys-devel/binutils-apple/files/ld64-127.2-Makefile50
-rw-r--r--sys-devel/binutils-apple/files/ld64-127.2-extraneous-headers.patch12
-rw-r--r--sys-devel/binutils-apple/files/ld64-127.2-lto.patch214
-rw-r--r--sys-devel/binutils-apple/files/ld64-127.2-ppc-range-warning.patch16
-rw-r--r--sys-devel/binutils-apple/files/ld64-127.2-thread_state.patch13
-rw-r--r--sys-devel/binutils-apple/files/ld64-128.2-1010.patch20
-rw-r--r--sys-devel/binutils-apple/files/ld64-128.2-Makefile47
-rw-r--r--sys-devel/binutils-apple/files/ld64-128.2-Makefile-250
-rw-r--r--sys-devel/binutils-apple/files/ld64-128.2-stdlib.patch14
-rw-r--r--sys-devel/binutils-apple/files/ld64-136-Makefile48
-rw-r--r--sys-devel/binutils-apple/files/ld64-136-compile_stubs.h53
-rw-r--r--sys-devel/binutils-apple/files/ld64-236.3-Makefile51
-rw-r--r--sys-devel/binutils-apple/files/ld64-236.3-arm64-fixup.patch17
-rw-r--r--sys-devel/binutils-apple/files/ld64-236.3-constant-types.patch61
-rw-r--r--sys-devel/binutils-apple/files/ld64-236.3-crashreporter.patch23
-rw-r--r--sys-devel/binutils-apple/files/ld64-236.3-gcc.patch1038
-rw-r--r--sys-devel/binutils-apple/files/ld64-236.3-missing-cputypes.patch10
-rw-r--r--sys-devel/binutils-apple/files/ld64-236.3-noarm.patch1236
-rw-r--r--sys-devel/binutils-apple/files/ld64-236.3-nolto.patch219
-rw-r--r--sys-devel/binutils-apple/files/ld64-236.3-noppc.patch26
-rw-r--r--sys-devel/binutils-apple/files/ld64-236.3-nosnapshots.patch644
-rw-r--r--sys-devel/binutils-apple/files/ld64-241.9-arm64-cputype.patch17
-rw-r--r--sys-devel/binutils-apple/files/ld64-241.9-atomic-volatile.patch27
-rw-r--r--sys-devel/binutils-apple/files/ld64-241.9-cc_md5.patch24
-rw-r--r--sys-devel/binutils-apple/files/ld64-241.9-extraneous-includes.patch13
-rw-r--r--sys-devel/binutils-apple/files/ld64-241.9-gcc.patch1029
-rw-r--r--sys-devel/binutils-apple/files/ld64-241.9-get-comm-align.patch30
-rw-r--r--sys-devel/binutils-apple/files/ld64-241.9-lto-noremarks.patch107
-rw-r--r--sys-devel/binutils-apple/files/ld64-241.9-noarm.patch1288
-rw-r--r--sys-devel/binutils-apple/files/ld64-241.9-nosnapshots.patch644
-rw-r--r--sys-devel/binutils-apple/files/ld64-241.9-register-names.patch50
-rw-r--r--sys-devel/binutils-apple/files/ld64-95.2.12-Makefile26
-rw-r--r--sys-devel/binutils-apple/files/ld64-95.2.12-darwin8-no-mlong-branch-warning.patch15
-rw-r--r--sys-devel/binutils-apple/files/libunwind-30-Makefile23
-rw-r--r--sys-devel/binutils-apple/metadata.xml9
-rw-r--r--sys-devel/binutils-config/binutils-config-1.9-r4.ebuild19
-rw-r--r--sys-devel/binutils-config/binutils-config-2-r1.ebuild19
-rw-r--r--sys-devel/binutils-config/binutils-config-3-r3.ebuild19
-rw-r--r--sys-devel/binutils-config/binutils-config-4-r1.ebuild24
-rw-r--r--sys-devel/binutils-config/binutils-config-4-r2.ebuild24
-rw-r--r--sys-devel/binutils-config/binutils-config-4-r3.ebuild24
-rwxr-xr-xsys-devel/binutils-config/files/binutils-config-1.9410
-rwxr-xr-xsys-devel/binutils-config/files/binutils-config-2434
-rwxr-xr-xsys-devel/binutils-config/files/binutils-config-3509
-rwxr-xr-xsys-devel/binutils-config/files/binutils-config-4465
-rw-r--r--sys-devel/binutils-config/files/binutils-config.877
-rw-r--r--sys-devel/binutils-config/metadata.xml5
-rw-r--r--sys-devel/binutils-hppa64/Manifest18
-rw-r--r--sys-devel/binutils-hppa64/binutils-hppa64-2.19.1.ebuild23
-rw-r--r--sys-devel/binutils-hppa64/binutils-hppa64-2.20.1.ebuild23
-rw-r--r--sys-devel/binutils-hppa64/binutils-hppa64-2.21.1-r1.ebuild23
-rw-r--r--sys-devel/binutils-hppa64/binutils-hppa64-2.22.ebuild27
-rw-r--r--sys-devel/binutils-hppa64/binutils-hppa64-2.23.1.ebuild27
-rw-r--r--sys-devel/binutils-hppa64/binutils-hppa64-2.23.2.ebuild27
-rw-r--r--sys-devel/binutils-hppa64/binutils-hppa64-2.24.ebuild27
-rw-r--r--sys-devel/binutils-hppa64/binutils-hppa64-2.25.1.ebuild27
-rw-r--r--sys-devel/binutils-hppa64/binutils-hppa64-2.25.ebuild27
-rw-r--r--sys-devel/binutils-hppa64/metadata.xml12
-rw-r--r--sys-devel/binutils/Manifest13
-rw-r--r--sys-devel/binutils/binutils-2.21.1-r1.ebuild11
-rw-r--r--sys-devel/binutils/binutils-2.22-r1.ebuild11
-rw-r--r--sys-devel/binutils/binutils-2.23.2.ebuild12
-rw-r--r--sys-devel/binutils/binutils-2.24-r3.ebuild9
-rw-r--r--sys-devel/binutils/binutils-2.25-r1.ebuild11
-rw-r--r--sys-devel/binutils/binutils-2.25.1.ebuild11
-rw-r--r--sys-devel/binutils/binutils-2.25.ebuild11
-rw-r--r--sys-devel/binutils/binutils-9999.ebuild7
-rw-r--r--sys-devel/binutils/files/binutils-configure-LANG.patch65
-rw-r--r--sys-devel/binutils/metadata.xml12
-rw-r--r--sys-devel/bison/Manifest5
-rw-r--r--sys-devel/bison/bison-1.875d.ebuild65
-rw-r--r--sys-devel/bison/bison-2.4.3.ebuild49
-rw-r--r--sys-devel/bison/bison-2.7.1.ebuild59
-rw-r--r--sys-devel/bison/bison-3.0.3-r1.ebuild60
-rw-r--r--sys-devel/bison/bison-3.0.4-r1.ebuild69
-rw-r--r--sys-devel/bison/bison-3.0.4.ebuild60
-rw-r--r--sys-devel/bison/files/bison-1.32-extfix.patch28
-rw-r--r--sys-devel/bison/files/bison-2.4.3-no-gets.patch22
-rw-r--r--sys-devel/bison/files/bison-2.4.3-uclibc-sched_param-def.patch19
-rw-r--r--sys-devel/bison/files/bison-3.0.4-optional-perl.patch500
-rw-r--r--sys-devel/bison/metadata.xml5
-rw-r--r--sys-devel/bmake/Manifest2
-rw-r--r--sys-devel/bmake/bmake-20140214.ebuild55
-rw-r--r--sys-devel/bmake/metadata.xml5
-rw-r--r--sys-devel/boost-m4/Manifest1
-rw-r--r--sys-devel/boost-m4/boost-m4-0.4-r1.ebuild35
-rw-r--r--sys-devel/boost-m4/boost-m4-0.4.ebuild31
-rw-r--r--sys-devel/boost-m4/files/boost-m4-0.4-gcc5.patch91
-rw-r--r--sys-devel/boost-m4/metadata.xml11
-rw-r--r--sys-devel/byfl/Manifest1
-rw-r--r--sys-devel/byfl/byfl-1.2.ebuild44
-rw-r--r--sys-devel/byfl/byfl-9999.ebuild44
-rw-r--r--sys-devel/byfl/metadata.xml14
-rw-r--r--sys-devel/clang/Manifest12
-rw-r--r--sys-devel/clang/clang-2.8-r3.ebuild203
-rw-r--r--sys-devel/clang/clang-2.9-r1.ebuild192
-rw-r--r--sys-devel/clang/clang-3.0-r4.ebuild213
-rw-r--r--sys-devel/clang/clang-3.1-r5.ebuild204
-rw-r--r--sys-devel/clang/clang-3.2.ebuild202
-rw-r--r--sys-devel/clang/clang-3.3-r100.ebuild36
-rw-r--r--sys-devel/clang/clang-3.4.2-r100.ebuild36
-rw-r--r--sys-devel/clang/clang-3.5.0-r100.ebuild36
-rw-r--r--sys-devel/clang/clang-3.5.1-r100.ebuild36
-rw-r--r--sys-devel/clang/clang-3.5.2-r100.ebuild36
-rw-r--r--sys-devel/clang/clang-3.6.0-r100.ebuild36
-rw-r--r--sys-devel/clang/clang-3.6.1-r100.ebuild36
-rw-r--r--sys-devel/clang/clang-3.6.2-r100.ebuild36
-rw-r--r--sys-devel/clang/clang-9999-r100.ebuild36
-rw-r--r--sys-devel/clang/clang-9999.ebuild193
-rw-r--r--sys-devel/clang/files/cl-patches/clang-0001-Add-r600-TargetInfo.patch100
-rw-r--r--sys-devel/clang/files/cl-patches/clang-0002-r600-Add-some-target-builtins.patch111
-rw-r--r--sys-devel/clang/files/cl-patches/clang-0003-r600-Add-read_global_size-and-read_local_size-builti.patch31
-rw-r--r--sys-devel/clang/files/cl-patches/llvm-0001-r600-Add-some-intrinsic-definitions.patch64
-rw-r--r--sys-devel/clang/files/cl-patches/llvm-0002-r600-Add-get_global_size-and-get_local_size-intrinsi.patch27
-rw-r--r--sys-devel/clang/files/clang-2.7-fixdoc.patch53
-rw-r--r--sys-devel/clang/files/clang-2.8-alignof.patch258
-rw-r--r--sys-devel/clang/files/clang-2.8-darwin-prefix.patch127
-rw-r--r--sys-devel/clang/files/clang-2.8-gcc-4.4.4.patch16
-rw-r--r--sys-devel/clang/files/clang-2.9-darwin-prefix.patch125
-rw-r--r--sys-devel/clang/files/clang-2.9-gccversions.patch12
-rw-r--r--sys-devel/clang/files/clang-3.0-fix_cxx_include_root.patch21
-rw-r--r--sys-devel/clang/files/clang-3.0-freebsd-runtime-gcc-detection.patch20
-rw-r--r--sys-devel/clang/files/clang-3.0-gentoo-binutils-apple.patch29
-rw-r--r--sys-devel/clang/files/clang-3.0-linux-runtime-gcc-detection.patch43
-rw-r--r--sys-devel/clang/files/clang-3.0-recognize-amd-k10-enable-sse4a.patch82
-rw-r--r--sys-devel/clang/files/clang-3.1-gentoo-freebsd-fix-cxx-paths-v2.patch188
-rw-r--r--sys-devel/clang/files/clang-3.1-gentoo-freebsd-fix-lib-path.patch20
-rw-r--r--sys-devel/clang/files/clang-3.1-gentoo-runtime-gcc-detection-v3.patch29
-rw-r--r--sys-devel/clang/files/clang-3.1-increase-parser-recursion-limit.patch15
-rw-r--r--sys-devel/clang/metadata.xml35
-rw-r--r--sys-devel/cons/Manifest1
-rw-r--r--sys-devel/cons/cons-2.2.0.ebuild26
-rw-r--r--sys-devel/cons/metadata.xml5
-rw-r--r--sys-devel/crossdev/Manifest32
-rw-r--r--sys-devel/crossdev/crossdev-20100814.ebuild32
-rw-r--r--sys-devel/crossdev/crossdev-20101011.ebuild32
-rw-r--r--sys-devel/crossdev/crossdev-20110310.ebuild32
-rw-r--r--sys-devel/crossdev/crossdev-20110705.ebuild32
-rw-r--r--sys-devel/crossdev/crossdev-20110819.ebuild32
-rw-r--r--sys-devel/crossdev/crossdev-20111011.ebuild32
-rw-r--r--sys-devel/crossdev/crossdev-20111018.ebuild32
-rw-r--r--sys-devel/crossdev/crossdev-20111118.ebuild32
-rw-r--r--sys-devel/crossdev/crossdev-20111221.ebuild32
-rw-r--r--sys-devel/crossdev/crossdev-20120214.ebuild32
-rw-r--r--sys-devel/crossdev/crossdev-20120227.ebuild35
-rw-r--r--sys-devel/crossdev/crossdev-20120228.ebuild35
-rw-r--r--sys-devel/crossdev/crossdev-20120229.ebuild35
-rw-r--r--sys-devel/crossdev/crossdev-20120301.ebuild35
-rw-r--r--sys-devel/crossdev/crossdev-20120305.ebuild35
-rw-r--r--sys-devel/crossdev/crossdev-20120529.ebuild35
-rw-r--r--sys-devel/crossdev/crossdev-20120531.ebuild35
-rw-r--r--sys-devel/crossdev/crossdev-20120721.ebuild35
-rw-r--r--sys-devel/crossdev/crossdev-20120913.ebuild35
-rw-r--r--sys-devel/crossdev/crossdev-20130628.ebuild35
-rw-r--r--sys-devel/crossdev/crossdev-20131011.ebuild35
-rw-r--r--sys-devel/crossdev/crossdev-20131107.ebuild35
-rw-r--r--sys-devel/crossdev/crossdev-20140118.ebuild35
-rw-r--r--sys-devel/crossdev/crossdev-20140729.ebuild35
-rw-r--r--sys-devel/crossdev/crossdev-20140917.ebuild35
-rw-r--r--sys-devel/crossdev/crossdev-20141030.ebuild35
-rw-r--r--sys-devel/crossdev/crossdev-20150521.ebuild35
-rw-r--r--sys-devel/crossdev/crossdev-20150525.ebuild35
-rw-r--r--sys-devel/crossdev/crossdev-20150526.ebuild35
-rw-r--r--sys-devel/crossdev/crossdev-20150527.ebuild35
-rw-r--r--sys-devel/crossdev/crossdev-20150602.ebuild36
-rw-r--r--sys-devel/crossdev/crossdev-20150716.ebuild36
-rw-r--r--sys-devel/crossdev/crossdev-99999999.ebuild36
-rw-r--r--sys-devel/crossdev/metadata.xml9
-rw-r--r--sys-devel/ct-ng/Manifest3
-rw-r--r--sys-devel/ct-ng/ct-ng-1.19.0-r1.ebuild44
-rw-r--r--sys-devel/ct-ng/ct-ng-1.20.0-r1.ebuild44
-rw-r--r--sys-devel/ct-ng/ct-ng-1.21.0.ebuild44
-rw-r--r--sys-devel/ct-ng/files/ct-ng-kconfig-respect-flags.patch14
-rw-r--r--sys-devel/ct-ng/metadata.xml21
-rw-r--r--sys-devel/dev86/Manifest2
-rw-r--r--sys-devel/dev86/dev86-0.16.19.ebuild78
-rw-r--r--sys-devel/dev86/dev86-0.16.21.ebuild77
-rw-r--r--sys-devel/dev86/files/dev86-0.16.17-fortify.patch43
-rw-r--r--sys-devel/dev86/files/dev86-0.16.17-make382.patch11
-rw-r--r--sys-devel/dev86/files/dev86-0.16.19-fortify.patch23
-rw-r--r--sys-devel/dev86/files/dev86-0.16.19-memmove.patch17
-rw-r--r--sys-devel/dev86/files/dev86-pic.patch20
-rw-r--r--sys-devel/dev86/metadata.xml10
-rw-r--r--sys-devel/distcc/Manifest2
-rw-r--r--sys-devel/distcc/distcc-3.1-r10.ebuild174
-rw-r--r--sys-devel/distcc/distcc-3.2_rc1-r3.ebuild207
-rw-r--r--sys-devel/distcc/files/2.18-r1/conf45
-rw-r--r--sys-devel/distcc/files/2.18-r1/init39
-rw-r--r--sys-devel/distcc/files/2.18/conf40
-rw-r--r--sys-devel/distcc/files/2.18/init30
-rw-r--r--sys-devel/distcc/files/3.0/conf40
-rw-r--r--sys-devel/distcc/files/3.0/distcc-config123
-rwxr-xr-xsys-devel/distcc/files/3.0/init32
-rw-r--r--sys-devel/distcc/files/3.1/conf35
-rwxr-xr-xsys-devel/distcc/files/3.1/init32
-rw-r--r--sys-devel/distcc/files/distcc-3.0-fix-fortify.patch11
-rw-r--r--sys-devel/distcc/files/distcc-3.0-gentoo.patch33
-rw-r--r--sys-devel/distcc/files/distcc-3.0-svn617.patch13
-rw-r--r--sys-devel/distcc/files/distcc-3.0-uninitialized.patch13
-rw-r--r--sys-devel/distcc/files/distcc-3.0-xinetd.patch15
-rw-r--r--sys-devel/distcc/files/distcc-3.1-argc-fix.patch17
-rw-r--r--sys-devel/distcc/files/distcc-3.1-freedesktop.patch76
-rw-r--r--sys-devel/distcc/files/distcc-3.1-python.patch258
-rw-r--r--sys-devel/distcc/files/distcc-3.2_rc1-freedesktop.patch79
-rw-r--r--sys-devel/distcc/files/distcc-3.2_rc1-gssapi.patch36
-rw-r--r--sys-devel/distcc/files/distcc-3.2_rc1-python.patch246
-rw-r--r--sys-devel/distcc/files/distcc-3.2_rc1-socks5.patch191
-rw-r--r--sys-devel/distcc/files/distcc-as-needed.patch17
-rw-r--r--sys-devel/distcc/files/distcc-avahi-configure.patch29
-rw-r--r--sys-devel/distcc/files/distcc-config165
-rw-r--r--sys-devel/distcc/files/distcc-config-3.2_rc1181
-rw-r--r--sys-devel/distcc/files/distcc-create-dir.patch56
-rw-r--r--sys-devel/distcc/files/distcc-freedesktop.patch84
-rw-r--r--sys-devel/distcc/files/distcc-gentoo-multilib-r1.patch146
-rw-r--r--sys-devel/distcc/files/distcc-gentoo-multilib.patch126
-rw-r--r--sys-devel/distcc/files/distcc-hardened.patch24
-rw-r--r--sys-devel/distcc/files/distcc-march-native.patch16
-rw-r--r--sys-devel/distcc/files/distccd.service10
-rw-r--r--sys-devel/distcc/files/distccd.service.conf6
-rw-r--r--sys-devel/distcc/metadata.xml13
-rw-r--r--sys-devel/dragonegg/Manifest4
-rw-r--r--sys-devel/dragonegg/dragonegg-3.5.1.ebuild56
-rw-r--r--sys-devel/dragonegg/dragonegg-3.6.0.ebuild56
-rw-r--r--sys-devel/dragonegg/dragonegg-9999.ebuild55
-rw-r--r--sys-devel/dragonegg/metadata.xml9
-rw-r--r--sys-devel/dwz/Manifest1
-rw-r--r--sys-devel/dwz/dwz-0.9.ebuild23
-rw-r--r--sys-devel/dwz/metadata.xml17
-rw-r--r--sys-devel/flex/Manifest5
-rw-r--r--sys-devel/flex/files/flex-2.5.33-pic.patch12
-rw-r--r--sys-devel/flex/files/flex-2.5.34-isatty.patch53
-rw-r--r--sys-devel/flex/files/flex-2.5.35-gcc44.patch13
-rw-r--r--sys-devel/flex/files/flex-2.5.35-saneautotools.patch77
-rw-r--r--sys-devel/flex/files/flex-2.5.37-proto.patch27
-rw-r--r--sys-devel/flex/files/flex-2.5.37-tests.patch113
-rw-r--r--sys-devel/flex/flex-2.5.35.ebuild43
-rw-r--r--sys-devel/flex/flex-2.5.35_p10.ebuild50
-rw-r--r--sys-devel/flex/flex-2.5.37.ebuild51
-rw-r--r--sys-devel/flex/flex-2.5.38-r1.ebuild40
-rw-r--r--sys-devel/flex/flex-2.5.39-r1.ebuild66
-rw-r--r--sys-devel/flex/flex-2.5.39.ebuild40
-rw-r--r--sys-devel/flex/metadata.xml8
-rw-r--r--sys-devel/gcc-apple/Manifest6
-rw-r--r--sys-devel/gcc-apple/files/gcc-apple-4.0.1_p5465-default-altivec.patch38
-rw-r--r--sys-devel/gcc-apple/files/gcc-apple-4.2.1-arch-option.patch57
-rw-r--r--sys-devel/gcc-apple/files/gcc-apple-4.2.1-autoconf-m4-precious.patch12
-rw-r--r--sys-devel/gcc-apple/files/gcc-apple-4.2.1-dsymutil.patch20
-rw-r--r--sys-devel/gcc-apple/files/gcc-apple-4.2.1-prefix-search-dirs-r1.patch39
-rw-r--r--sys-devel/gcc-apple/files/gcc-apple-4.2.1-prefix-search-dirs.patch27
-rw-r--r--sys-devel/gcc-apple/files/gcc-apple-4.2.1-texinfo.patch33
-rw-r--r--sys-devel/gcc-apple/files/gcc-apple-4.2.1_p5646-gfortran.patch797
-rw-r--r--sys-devel/gcc-apple/files/gcc-apple-4.2.1_p5666-darwin14.patch148
-rw-r--r--sys-devel/gcc-apple/files/gcc-apple-4.2.1_p5666-perl-5.18.patch11
-rw-r--r--sys-devel/gcc-apple/files/libstdc++-16.patch11
-rw-r--r--sys-devel/gcc-apple/gcc-apple-4.0.1_p5493.ebuild261
-rw-r--r--sys-devel/gcc-apple/gcc-apple-4.2.1_p5664.ebuild332
-rw-r--r--sys-devel/gcc-apple/gcc-apple-4.2.1_p5666-r1.ebuild344
-rw-r--r--sys-devel/gcc-apple/gcc-apple-4.2.1_p5666-r2.ebuild375
-rw-r--r--sys-devel/gcc-apple/metadata.xml12
-rw-r--r--sys-devel/gcc-config/Manifest6
-rw-r--r--sys-devel/gcc-config/files/gcc-config-1.4.1801
-rwxr-xr-xsys-devel/gcc-config/files/gcc-config-1.5740
-rwxr-xr-xsys-devel/gcc-config/files/gcc-config-1.5.1763
-rw-r--r--sys-devel/gcc-config/files/gcc-config-1.8-dont_source_functions_sh_from_etc_initd.patch47
-rw-r--r--sys-devel/gcc-config/files/wrapper-1.5.1.c372
-rw-r--r--sys-devel/gcc-config/files/wrapper-1.5.2.c315
-rw-r--r--sys-devel/gcc-config/gcc-config-1.4.1-r1.ebuild59
-rw-r--r--sys-devel/gcc-config/gcc-config-1.5-r1.ebuild61
-rw-r--r--sys-devel/gcc-config/gcc-config-1.5-r2.ebuild61
-rw-r--r--sys-devel/gcc-config/gcc-config-1.5.1-r1.ebuild61
-rw-r--r--sys-devel/gcc-config/gcc-config-1.5.1.ebuild61
-rw-r--r--sys-devel/gcc-config/gcc-config-1.6.ebuild47
-rw-r--r--sys-devel/gcc-config/gcc-config-1.7.1.ebuild47
-rw-r--r--sys-devel/gcc-config/gcc-config-1.7.2.ebuild47
-rw-r--r--sys-devel/gcc-config/gcc-config-1.7.3.ebuild47
-rw-r--r--sys-devel/gcc-config/gcc-config-1.7.ebuild47
-rw-r--r--sys-devel/gcc-config/gcc-config-1.8-r1.ebuild53
-rw-r--r--sys-devel/gcc-config/gcc-config-1.8.ebuild47
-rw-r--r--sys-devel/gcc-config/metadata.xml5
-rw-r--r--sys-devel/gcc/Manifest88
-rw-r--r--sys-devel/gcc/files/3.3.4/libffi-without-libgcj.patch22
-rw-r--r--sys-devel/gcc/files/3.4.3/libffi-nogcj-lib-path-fix.patch40
-rw-r--r--sys-devel/gcc/files/3.4.3/libffi-without-libgcj.patch40
-rw-r--r--sys-devel/gcc/files/3.4.4/gcc-3.4.4-cross-compile.patch63
-rw-r--r--sys-devel/gcc/files/4.1.0/gcc-4.1.0-cross-compile.patch40
-rw-r--r--sys-devel/gcc/files/4.1.0/gcc-4.1.0-fast-math-i386-Os-workaround.patch64
-rw-r--r--sys-devel/gcc/files/awk/fixlafiles.awk314
-rw-r--r--sys-devel/gcc/files/awk/fixlafiles.awk-no_gcc_la335
-rwxr-xr-xsys-devel/gcc/files/c8920
-rwxr-xr-xsys-devel/gcc/files/c9921
-rw-r--r--sys-devel/gcc/files/fix_libtool_files.sh67
-rw-r--r--sys-devel/gcc/files/gcc-configure-LANG.patch64
-rw-r--r--sys-devel/gcc/files/gcc-configure-texinfo.patch16
-rw-r--r--sys-devel/gcc/files/gcc-spec-env-r1.patch87
-rw-r--r--sys-devel/gcc/files/gcc-spec-env.patch42
-rw-r--r--sys-devel/gcc/gcc-2.95.3-r10.ebuild35
-rw-r--r--sys-devel/gcc/gcc-3.3.6-r1.ebuild38
-rw-r--r--sys-devel/gcc/gcc-3.4.6-r2.ebuild49
-rw-r--r--sys-devel/gcc/gcc-4.0.4.ebuild16
-rw-r--r--sys-devel/gcc/gcc-4.1.2.ebuild30
-rw-r--r--sys-devel/gcc/gcc-4.2.4-r1.ebuild18
-rw-r--r--sys-devel/gcc/gcc-4.3.6-r1.ebuild29
-rw-r--r--sys-devel/gcc/gcc-4.4.7.ebuild31
-rw-r--r--sys-devel/gcc/gcc-4.5.4.ebuild32
-rw-r--r--sys-devel/gcc/gcc-4.6.4.ebuild48
-rw-r--r--sys-devel/gcc/gcc-4.7.4.ebuild48
-rw-r--r--sys-devel/gcc/gcc-4.8.0.ebuild48
-rw-r--r--sys-devel/gcc/gcc-4.8.1-r1.ebuild48
-rw-r--r--sys-devel/gcc/gcc-4.8.2.ebuild48
-rw-r--r--sys-devel/gcc/gcc-4.8.3.ebuild48
-rw-r--r--sys-devel/gcc/gcc-4.8.4.ebuild48
-rw-r--r--sys-devel/gcc/gcc-4.8.5.ebuild48
-rw-r--r--sys-devel/gcc/gcc-4.9.0.ebuild48
-rw-r--r--sys-devel/gcc/gcc-4.9.1.ebuild48
-rw-r--r--sys-devel/gcc/gcc-4.9.2.ebuild48
-rw-r--r--sys-devel/gcc/gcc-4.9.3.ebuild48
-rw-r--r--sys-devel/gcc/gcc-5.1.0.ebuild45
-rw-r--r--sys-devel/gcc/gcc-5.2.0.ebuild45
-rw-r--r--sys-devel/gcc/metadata.xml32
-rw-r--r--sys-devel/gdb-apple/Manifest12
-rw-r--r--sys-devel/gdb-apple/files/gdb-apple-1344-darwin8.patch131
-rw-r--r--sys-devel/gdb-apple/files/gdb-apple-1461-darwin8.patch128
-rw-r--r--sys-devel/gdb-apple/files/gdb-apple-1461-dyld-info.patch22
-rw-r--r--sys-devel/gdb-apple/files/gdb-apple-1518-darwin8-9.patch87
-rw-r--r--sys-devel/gdb-apple/files/gdb-apple-1518-darwin8.patch128
-rw-r--r--sys-devel/gdb-apple/files/gdb-apple-1518-task_dyld_info.patch22
-rw-r--r--sys-devel/gdb-apple/files/gdb-apple-1705-darwin8-10.patch11
-rw-r--r--sys-devel/gdb-apple/files/gdb-apple-563-darwin7.patch110
-rw-r--r--sys-devel/gdb-apple/files/gdb-apple-563-no-64bit.patch19
-rw-r--r--sys-devel/gdb-apple/files/gdb-apple-768-darwin-arch.patch15
-rw-r--r--sys-devel/gdb-apple/files/gdb-apple-768-texinfo.patch10
-rw-r--r--sys-devel/gdb-apple/files/gdb-apple-962-darwin64.patch17
-rw-r--r--sys-devel/gdb-apple/files/gdb-apple-962-darwin8.patch15
-rw-r--r--sys-devel/gdb-apple/files/gdb-apple-962-demangle.patch22
-rw-r--r--sys-devel/gdb-apple/files/gdb-apple-no-global-gdbinit.patch23
-rw-r--r--sys-devel/gdb-apple/gdb-apple-1344.ebuild61
-rw-r--r--sys-devel/gdb-apple/gdb-apple-1346.ebuild61
-rw-r--r--sys-devel/gdb-apple/gdb-apple-1461.ebuild65
-rw-r--r--sys-devel/gdb-apple/gdb-apple-1518.ebuild63
-rw-r--r--sys-devel/gdb-apple/gdb-apple-1705.ebuild74
-rw-r--r--sys-devel/gdb-apple/gdb-apple-1708.ebuild74
-rw-r--r--sys-devel/gdb-apple/gdb-apple-1752.ebuild74
-rw-r--r--sys-devel/gdb-apple/gdb-apple-563.ebuild51
-rw-r--r--sys-devel/gdb-apple/gdb-apple-768-r1.ebuild50
-rw-r--r--sys-devel/gdb-apple/gdb-apple-960.ebuild50
-rw-r--r--sys-devel/gdb-apple/gdb-apple-962.ebuild64
-rw-r--r--sys-devel/gdb-apple/gdb-apple-966.ebuild64
-rw-r--r--sys-devel/gdb-apple/metadata.xml5
-rw-r--r--sys-devel/gdb/Manifest19
-rw-r--r--sys-devel/gdb/gdb-7.5.1.ebuild178
-rw-r--r--sys-devel/gdb/gdb-7.5.ebuild178
-rw-r--r--sys-devel/gdb/gdb-7.6.1.ebuild192
-rw-r--r--sys-devel/gdb/gdb-7.6.2.ebuild192
-rw-r--r--sys-devel/gdb/gdb-7.6.ebuild181
-rw-r--r--sys-devel/gdb/gdb-7.7-r1.ebuild192
-rw-r--r--sys-devel/gdb/gdb-7.7.1.ebuild202
-rw-r--r--sys-devel/gdb/gdb-7.8.1.ebuild206
-rw-r--r--sys-devel/gdb/gdb-7.8.2.ebuild206
-rw-r--r--sys-devel/gdb/gdb-7.8.ebuild199
-rw-r--r--sys-devel/gdb/gdb-7.9.1.ebuild220
-rw-r--r--sys-devel/gdb/gdb-7.9.ebuild220
-rw-r--r--sys-devel/gdb/gdb-9999.ebuild221
-rw-r--r--sys-devel/gdb/metadata.xml15
-rw-r--r--sys-devel/gettext/Manifest3
-rw-r--r--sys-devel/gettext/gettext-0.19.4.ebuild142
-rw-r--r--sys-devel/gettext/gettext-0.19.5.1.ebuild142
-rw-r--r--sys-devel/gettext/gettext-0.19.5.ebuild142
-rw-r--r--sys-devel/gettext/metadata.xml11
-rw-r--r--sys-devel/gnuconfig/Manifest7
-rw-r--r--sys-devel/gnuconfig/files/99999999/0002-Add-x32-support-to-config.guess.patch44
-rw-r--r--sys-devel/gnuconfig/files/99999999/0002-add-ps2-targets-to-config.sub.patch59
-rw-r--r--sys-devel/gnuconfig/gnuconfig-20130516.ebuild66
-rw-r--r--sys-devel/gnuconfig/gnuconfig-20131128.ebuild66
-rw-r--r--sys-devel/gnuconfig/gnuconfig-20140212.ebuild66
-rw-r--r--sys-devel/gnuconfig/gnuconfig-20140728.ebuild66
-rw-r--r--sys-devel/gnuconfig/gnuconfig-20150304.ebuild66
-rw-r--r--sys-devel/gnuconfig/gnuconfig-20150308.ebuild66
-rw-r--r--sys-devel/gnuconfig/gnuconfig-20150727.ebuild66
-rw-r--r--sys-devel/gnuconfig/gnuconfig-99999999.ebuild66
-rw-r--r--sys-devel/gnuconfig/metadata.xml8
-rw-r--r--sys-devel/heirloom-devtools/Manifest1
-rw-r--r--sys-devel/heirloom-devtools/files/heirloom-devtools-070527-64-bit.patch39
-rw-r--r--sys-devel/heirloom-devtools/files/heirloom-devtools-070527-solaris.patch230
-rw-r--r--sys-devel/heirloom-devtools/heirloom-devtools-070527-r1.ebuild57
-rw-r--r--sys-devel/heirloom-devtools/heirloom-devtools-999999.ebuild61
-rw-r--r--sys-devel/heirloom-devtools/metadata.xml8
-rw-r--r--sys-devel/icecream/Manifest2
-rw-r--r--sys-devel/icecream/files/0.9.6-crosscompile.patch12
-rw-r--r--sys-devel/icecream/files/0.9.6-symlinks.patch19
-rw-r--r--sys-devel/icecream/files/0.9.7-automake.patch32
-rw-r--r--sys-devel/icecream/files/0.9.7-glibc2.16.patch16
-rw-r--r--sys-devel/icecream/files/icecream44
-rw-r--r--sys-devel/icecream/files/icecream-1.0.0-libcap-ng.patch8
-rw-r--r--sys-devel/icecream/files/icecream-conf.d-verbosity.patch18
-rw-r--r--sys-devel/icecream/files/icecream-config69
-rw-r--r--sys-devel/icecream/files/icecream-create-env82
-rw-r--r--sys-devel/icecream/files/icecream-gentoo-multilib.patch59
-rw-r--r--sys-devel/icecream/files/icecream-r245
-rw-r--r--sys-devel/icecream/icecream-0.9.7-r1.ebuild87
-rw-r--r--sys-devel/icecream/icecream-1.0.0-r1.ebuild52
-rw-r--r--sys-devel/icecream/metadata.xml9
-rw-r--r--sys-devel/kgcc64/Manifest34
-rw-r--r--sys-devel/kgcc64/kgcc64-3.4.6.ebuild73
-rw-r--r--sys-devel/kgcc64/kgcc64-4.1.2.ebuild54
-rw-r--r--sys-devel/kgcc64/kgcc64-4.2.4.ebuild48
-rw-r--r--sys-devel/kgcc64/kgcc64-4.3.5.ebuild49
-rw-r--r--sys-devel/kgcc64/kgcc64-4.4.5.ebuild55
-rw-r--r--sys-devel/kgcc64/kgcc64-4.4.6.ebuild55
-rw-r--r--sys-devel/kgcc64/kgcc64-4.5.3.ebuild56
-rw-r--r--sys-devel/kgcc64/kgcc64-4.5.4.ebuild56
-rw-r--r--sys-devel/kgcc64/kgcc64-4.6.3.ebuild56
-rw-r--r--sys-devel/kgcc64/kgcc64-4.6.4.ebuild56
-rw-r--r--sys-devel/kgcc64/kgcc64-4.7.3.ebuild56
-rw-r--r--sys-devel/kgcc64/kgcc64-4.7.4.ebuild63
-rw-r--r--sys-devel/kgcc64/kgcc64-4.8.1.ebuild56
-rw-r--r--sys-devel/kgcc64/kgcc64-4.8.2.ebuild56
-rw-r--r--sys-devel/kgcc64/kgcc64-4.8.3.ebuild56
-rw-r--r--sys-devel/kgcc64/kgcc64-4.9.1.ebuild56
-rw-r--r--sys-devel/kgcc64/kgcc64-4.9.2.ebuild56
-rw-r--r--sys-devel/kgcc64/metadata.xml11
-rw-r--r--sys-devel/libtool/Manifest4
-rw-r--r--sys-devel/libtool/files/1.5.20/libtool-1.5.20-use-linux-version-in-fbsd.patch38
-rw-r--r--sys-devel/libtool/files/libtool-2.4.3-use-linux-version-in-fbsd.patch38
-rw-r--r--sys-devel/libtool/files/libtool-2.4.6-fuse-ld.patch34
-rw-r--r--sys-devel/libtool/libtool-2.4.2-r1.ebuild96
-rw-r--r--sys-devel/libtool/libtool-2.4.4.ebuild77
-rw-r--r--sys-devel/libtool/libtool-2.4.5.ebuild77
-rw-r--r--sys-devel/libtool/libtool-2.4.6-r1.ebuild78
-rw-r--r--sys-devel/libtool/libtool-2.4.6.ebuild77
-rw-r--r--sys-devel/libtool/libtool-9999.ebuild75
-rw-r--r--sys-devel/libtool/metadata.xml5
-rw-r--r--sys-devel/llvm/Manifest42
-rw-r--r--sys-devel/llvm/files/cl-patches/0001-r600-Add-some-intrinsic-definitions.patch64
-rw-r--r--sys-devel/llvm/files/cl-patches/0002-r600-Add-get_global_size-and-get_local_size-intrinsi.patch27
-rw-r--r--sys-devel/llvm/files/clang-3.1-gentoo-runtime-gcc-detection-v3.patch29
-rw-r--r--sys-devel/llvm/files/clang-3.3-gcc-header-path.patch90
-rw-r--r--sys-devel/llvm/files/clang-3.3-gentoo-install.patch71
-rw-r--r--sys-devel/llvm/files/clang-3.4-darwin_build_fix.patch47
-rw-r--r--sys-devel/llvm/files/clang-3.4-darwin_prefix-include-paths.patch18
-rw-r--r--sys-devel/llvm/files/clang-3.4-gentoo-install.patch80
-rw-r--r--sys-devel/llvm/files/clang-3.5-gentoo-install.patch57
-rw-r--r--sys-devel/llvm/files/clang-3.5-gentoo-runtime-gcc-detection-v3.patch42
-rw-r--r--sys-devel/llvm/files/clang-3.6-fbsd-gcc49.patch25
-rw-r--r--sys-devel/llvm/files/clang-3.6-gentoo-install.patch48
-rw-r--r--sys-devel/llvm/files/cmake/0002-cmake-Support-overriding-Sphinx-HTML-doc-install-dir.patch36
-rw-r--r--sys-devel/llvm/files/cmake/0003-cmake-Add-an-ordering-dep-between-HTML-man-Sphinx-ta.patch32
-rw-r--r--sys-devel/llvm/files/cmake/0004-cmake-Do-not-install-libgtest.patch28
-rw-r--r--sys-devel/llvm/files/cmake/clang-0001-Install-clang-runtime-into-usr-lib-without-suffix.patch52
-rw-r--r--sys-devel/llvm/files/cmake/clang-0002-cmake-Make-CLANG_LIBDIR_SUFFIX-overridable.patch28
-rw-r--r--sys-devel/llvm/files/cmake/compiler-rt-0001-cmake-Install-compiler-rt-into-usr-lib-without-suffi.patch25
-rw-r--r--sys-devel/llvm/files/llvm-2.6-commandguide-nops.patch30
-rw-r--r--sys-devel/llvm/files/llvm-2.7-nodoctargz.patch47
-rw-r--r--sys-devel/llvm/files/llvm-2.8-alignof.patch59
-rw-r--r--sys-devel/llvm/files/llvm-2.8-darwin8.patch15
-rw-r--r--sys-devel/llvm/files/llvm-2.9-Operator.h-c++0x.patch57
-rw-r--r--sys-devel/llvm/files/llvm-2.9-gcc4.7.patch14
-rw-r--r--sys-devel/llvm/files/llvm-2.9-nodoctargz.patch39
-rw-r--r--sys-devel/llvm/files/llvm-3.0-PPCCompilationCallbackC_static.patch27
-rw-r--r--sys-devel/llvm/files/llvm-3.0-PPC_macro.patch43
-rw-r--r--sys-devel/llvm/files/llvm-3.0-gold_LTO_link.patch10
-rw-r--r--sys-devel/llvm/files/llvm-3.0-ocaml_install.patch16
-rw-r--r--sys-devel/llvm/files/llvm-3.0-set_soname.patch12
-rw-r--r--sys-devel/llvm/files/llvm-3.1-ExecutionEngine_tests_xfail_arm.patch27
-rw-r--r--sys-devel/llvm/files/llvm-3.1-docs-pod-markup-fixes.patch28
-rw-r--r--sys-devel/llvm/files/llvm-3.1-fix_debug_line_info.patch65
-rw-r--r--sys-devel/llvm/files/llvm-3.1-ivybridge_support.patch13
-rw-r--r--sys-devel/llvm/files/llvm-3.2-nodoctargz.patch45
-rw-r--r--sys-devel/llvm/files/llvm-3.3-R600_debug.patch22
-rw-r--r--sys-devel/llvm/files/llvm-3.3-cmake-modulepath.patch24
-rw-r--r--sys-devel/llvm/files/llvm-3.3-gentoo-install.patch141
-rw-r--r--sys-devel/llvm/files/llvm-3.3-insecure-rpath.patch30
-rw-r--r--sys-devel/llvm/files/llvm-3.3-r2-gentoo-install.patch117
-rw-r--r--sys-devel/llvm/files/llvm-3.4-cmake-configparser.patch35
-rw-r--r--sys-devel/llvm/files/llvm-3.4-fix_varargs.patch148
-rw-r--r--sys-devel/llvm/files/llvm-3.4-gentoo-install.patch96
-rw-r--r--sys-devel/llvm/files/llvm-3.5-gcc-4.9.patch43
-rw-r--r--sys-devel/llvm/files/llvm-3.5-gentoo-install.patch83
-rw-r--r--sys-devel/llvm/files/llvm-3.5.0-fix_LLVMExports_cmake.patch39
-rw-r--r--sys-devel/llvm/files/llvm-3.5.2-gcc-5.1.patch14
-rw-r--r--sys-devel/llvm/files/llvm-3.6-gentoo-install.patch82
-rw-r--r--sys-devel/llvm/files/llvm-3.6.0-ocaml-ctypes-0.4.0.patch35
-rw-r--r--sys-devel/llvm/files/llvm-3.7-nodoctargz.patch49
-rw-r--r--sys-devel/llvm/llvm-2.8-r2.ebuild168
-rw-r--r--sys-devel/llvm/llvm-2.9-r2.ebuild175
-rw-r--r--sys-devel/llvm/llvm-3.0-r2.ebuild181
-rw-r--r--sys-devel/llvm/llvm-3.1-r2.ebuild191
-rw-r--r--sys-devel/llvm/llvm-3.2.ebuild206
-rw-r--r--sys-devel/llvm/llvm-3.3-r3.ebuild500
-rw-r--r--sys-devel/llvm/llvm-3.4.2.ebuild543
-rw-r--r--sys-devel/llvm/llvm-3.5.0.ebuild530
-rw-r--r--sys-devel/llvm/llvm-3.5.1.ebuild530
-rw-r--r--sys-devel/llvm/llvm-3.5.2.ebuild532
-rw-r--r--sys-devel/llvm/llvm-3.6.0.ebuild534
-rw-r--r--sys-devel/llvm/llvm-3.6.1.ebuild541
-rw-r--r--sys-devel/llvm/llvm-3.6.2.ebuild541
-rw-r--r--sys-devel/llvm/llvm-9999.ebuild487
-rw-r--r--sys-devel/llvm/metadata.xml28
-rw-r--r--sys-devel/m4/Manifest2
-rw-r--r--sys-devel/m4/files/m4-1.4.16-fix-test-readlink.patch11
-rw-r--r--sys-devel/m4/files/m4-1.4.16-no-gets.patch24
-rw-r--r--sys-devel/m4/m4-1.4.16.ebuild55
-rw-r--r--sys-devel/m4/m4-1.4.17.ebuild51
-rw-r--r--sys-devel/m4/metadata.xml5
-rw-r--r--sys-devel/make/Manifest5
-rw-r--r--sys-devel/make/files/3.80-memory.patch77
-rw-r--r--sys-devel/make/files/make-3.80-conditional-eval.patch157
-rw-r--r--sys-devel/make/files/make-3.80-parallel-build-failure.patch59
-rw-r--r--sys-devel/make/files/make-3.81-jobserver.patch19
-rw-r--r--sys-devel/make/files/make-3.81-long-cmdline.patch100
-rw-r--r--sys-devel/make/files/make-3.81-tests-lang.patch55
-rw-r--r--sys-devel/make/files/make-3.81-tests-recursion.patch14
-rw-r--r--sys-devel/make/files/make-3.82-MAKEFLAGS-reexec.patch14
-rw-r--r--sys-devel/make/files/make-3.82-archives-many-objs.patch60
-rw-r--r--sys-devel/make/files/make-3.82-construct-command-line.patch71
-rw-r--r--sys-devel/make/files/make-3.82-copy-on-expand.patch58
-rw-r--r--sys-devel/make/files/make-3.82-darwin-library_search-dylib.patch17
-rw-r--r--sys-devel/make/files/make-3.82-glob-speedup.patch104
-rw-r--r--sys-devel/make/files/make-3.82-intermediate-parallel.patch62
-rw-r--r--sys-devel/make/files/make-3.82-long-command-line.patch54
-rw-r--r--sys-devel/make/files/make-3.82-memory-corruption.patch37
-rw-r--r--sys-devel/make/files/make-3.82-oneshell.patch24
-rw-r--r--sys-devel/make/files/make-3.82-parallel-remake.patch39
-rw-r--r--sys-devel/make/files/make-4.0-char-cast.patch46
-rw-r--r--sys-devel/make/files/make-4.1-fix_null_returns_from_ttyname.patch53
-rw-r--r--sys-devel/make/make-3.80-r4.ebuild43
-rw-r--r--sys-devel/make/make-3.81-r2.ebuild46
-rw-r--r--sys-devel/make/make-3.82-r4.ebuild51
-rw-r--r--sys-devel/make/make-4.0-r1.ebuild47
-rw-r--r--sys-devel/make/make-4.1-r1.ebuild47
-rw-r--r--sys-devel/make/metadata.xml5
-rw-r--r--sys-devel/metadata.xml38
-rw-r--r--sys-devel/multilib-gcc-wrapper/metadata.xml12
-rw-r--r--sys-devel/multilib-gcc-wrapper/multilib-gcc-wrapper-0.ebuild72
-rw-r--r--sys-devel/native-cctools/files/aix-2/ld139
-rw-r--r--sys-devel/native-cctools/files/aix-2/mkexpfile70
-rw-r--r--sys-devel/native-cctools/files/aix-2/nm6
-rw-r--r--sys-devel/native-cctools/files/ld-aix-1141
-rw-r--r--sys-devel/native-cctools/files/ld-aix-2139
-rw-r--r--sys-devel/native-cctools/metadata.xml5
-rw-r--r--sys-devel/native-cctools/native-cctools-1.ebuild108
-rw-r--r--sys-devel/native-cctools/native-cctools-2.ebuild108
-rw-r--r--sys-devel/native-cctools/native-cctools-4.ebuild111
-rw-r--r--sys-devel/parity/Manifest3
-rw-r--r--sys-devel/parity/files/parity-1.2.6-debugging.patch17
-rw-r--r--sys-devel/parity/metadata.xml11
-rw-r--r--sys-devel/parity/parity-1.2.4.ebuild58
-rw-r--r--sys-devel/parity/parity-1.2.5.ebuild58
-rw-r--r--sys-devel/parity/parity-1.2.6.ebuild63
-rw-r--r--sys-devel/parity/parity-9999.ebuild57
-rw-r--r--sys-devel/patch/Manifest3
-rw-r--r--sys-devel/patch/metadata.xml5
-rw-r--r--sys-devel/patch/patch-2.7.3.ebuild30
-rw-r--r--sys-devel/patch/patch-2.7.4.ebuild30
-rw-r--r--sys-devel/patch/patch-2.7.5.ebuild30
-rw-r--r--sys-devel/pmake/Manifest3
-rw-r--r--sys-devel/pmake/files/pmake-1.111.1-ldflags.patch13
-rw-r--r--sys-devel/pmake/files/pmake-1.98-skipdots.patch12
-rw-r--r--sys-devel/pmake/metadata.xml5
-rw-r--r--sys-devel/pmake/pmake-1.111.3.1.ebuild81
-rw-r--r--sys-devel/pmake/pmake-1.111.3.3.ebuild81
-rw-r--r--sys-devel/prelink/Manifest4
-rw-r--r--sys-devel/prelink/files/prelink-20061201-prelink-conf.patch31
-rw-r--r--sys-devel/prelink/files/prelink-20130503-libiberty-md5.patch61
-rw-r--r--sys-devel/prelink/files/prelink-20130503-prelink-conf.patch39
-rw-r--r--sys-devel/prelink/files/prelink-armhf-dynamic-linker.patch12
-rw-r--r--sys-devel/prelink/files/prelink.confd43
-rw-r--r--sys-devel/prelink/files/prelink.cron61
-rw-r--r--sys-devel/prelink/metadata.xml5
-rw-r--r--sys-devel/prelink/prelink-20110511.ebuild75
-rw-r--r--sys-devel/prelink/prelink-20111012.ebuild81
-rw-r--r--sys-devel/prelink/prelink-20120628.ebuild91
-rw-r--r--sys-devel/prelink/prelink-20130503.ebuild84
-rw-r--r--sys-devel/qconf/Manifest1
-rw-r--r--sys-devel/qconf/metadata.xml8
-rw-r--r--sys-devel/qconf/qconf-1.5_pre717-r1.ebuild39
-rw-r--r--sys-devel/remake/Manifest5
-rw-r--r--sys-devel/remake/metadata.xml8
-rw-r--r--sys-devel/remake/remake-3.81.0.2.ebuild23
-rw-r--r--sys-devel/remake/remake-3.81.0.3.ebuild23
-rw-r--r--sys-devel/remake/remake-3.82.0.4.ebuild26
-rw-r--r--sys-devel/remake/remake-3.82.0.9.ebuild27
-rw-r--r--sys-devel/remake/remake-4.1.1.1.ebuild32
-rw-r--r--sys-devel/smatch/Manifest2
-rw-r--r--sys-devel/smatch/files/smatch-1.57-restrict.patch14
-rw-r--r--sys-devel/smatch/metadata.xml6
-rw-r--r--sys-devel/smatch/smatch-1.57-r1.ebuild55
-rw-r--r--sys-devel/smatch/smatch-1.57.ebuild54
-rw-r--r--sys-devel/smatch/smatch-1.59.ebuild64
-rw-r--r--sys-devel/smatch/smatch-9999.ebuild64
-rw-r--r--sys-devel/sparse/Manifest3
-rw-r--r--sys-devel/sparse/files/sparse-0.4.3-gentoo.patch49
-rw-r--r--sys-devel/sparse/metadata.xml16
-rw-r--r--sys-devel/sparse/sparse-0.4.3.ebuild65
-rw-r--r--sys-devel/sparse/sparse-0.4.4.ebuild47
-rw-r--r--sys-devel/sparse/sparse-0.5.0.ebuild48
-rw-r--r--sys-devel/sparse/sparse-9999.ebuild48
-rw-r--r--sys-devel/systemd-m4/metadata.xml16
-rw-r--r--sys-devel/systemd-m4/systemd-m4-9999.ebuild28
-rw-r--r--sys-devel/ucpp/Manifest1
-rw-r--r--sys-devel/ucpp/metadata.xml6
-rw-r--r--sys-devel/ucpp/ucpp-1.3.4.ebuild28
-rw-r--r--sys-devel/ucpp/ucpp-9999.ebuild32
758 files changed, 56931 insertions, 0 deletions
diff --git a/sys-devel/autoconf-archive/Manifest b/sys-devel/autoconf-archive/Manifest
new file mode 100644
index 00000000000..f35ae447eb4
--- /dev/null
+++ b/sys-devel/autoconf-archive/Manifest
@@ -0,0 +1,6 @@
+DIST autoconf-archive-2012.09.08.tar.xz 510856 SHA256 59c897e83e4dac893b2a7cdf0e0035b32490f27f59ac1825feea44dc1e3ee246 SHA512 97595d6cd38de225224164264a5674f981fe29ffebea26b1f1e76b79c678ed22e5c3129c031b1f7eccd7edce26e811f08d8bc23797c3b1afcbdae5990fbb5e94 WHIRLPOOL a04ce556fb23c180f3f3e233971e6a89d01097b4ef3d333a4b3155f31112389132a41131693339b735966e6c93c64519a34b3aa63d24f9806e8c6e335908ea18
+DIST autoconf-archive-2013.06.09.tar.xz 531052 SHA256 a98d0a7bf74ee74754096e7233d4132baafe15d212b2c903dc0bfef41e7048b5 SHA512 585ed5972b5fc2333c3aee6bf83931a80bc864c167006214d719aac27156aa6fa63bb33005980cf1fcd8ac836f58e35f9217ec9e8bcd9063615226f50786e943 WHIRLPOOL 7aaf23101105c32dc6b22aa8c8b8b1d23f50ed426ec0d3c1724f81270027839426b292d0eda6050b58d5fe2a18fe4dcbb188dfd4f43695282a07d95465fed84a
+DIST autoconf-archive-2013.11.01.tar.xz 540316 SHA256 78ab75310cfacc5d71b4dacbce97450eed21a27afeb3a0f0fa48b3e0ec1c0161 SHA512 2360c1016e708c9669dca681811231872301559253bda5286eaf006046445711a692dff75c299cc9fd077166d0f7c871e1930c6cfe089408de95cb069e3ad63e WHIRLPOOL 184c48ca9acd653cc9a8853cdab3c18d5051f8efaadf5ad721e74414feba66b4aaf84ab21276fae2fe42f3c594b0c7fee7b52399327642acf4e50de0ed05a5ee
+DIST autoconf-archive-2014.02.28.tar.xz 550416 SHA256 f4b22a73654f98bf70201bee6913418426d0b2836bf833719ca38b8b19fe503b SHA512 196e4d41a2e3f5c4af1386388bfdeef904fb433f82920a6baf73cb8f938efe8d11b73ff96d34afab2c795458327bb4c6b2c35fa127312a8b64c10f8ab102c99b WHIRLPOOL 20e69ac1de4c847341e2a443050b588c5504e6b3b44453512deee0ce09a110da0b26913aed31422c6180e3222e54b75241aa801f22b3067364118fef7d7c6057
+DIST autoconf-archive-2015.02.04.tar.xz 575956 SHA256 dfd460d23a9690322dee29a355ea285b5774f37383d3741cf77a4ad6a11a7e81 SHA512 54382adcf55b9dd126de6727c034cae7c72c8217c9979d3b889705c3bfe41ec8329621dea5ff592ebf7e530775ce96faf47baffe36e8fedf9cd78c8dc423932e WHIRLPOOL 82298941615179234da8f1ab360ddb890d32ef54e983dd90965f766b0d89d6322867f5bff06954e4cc67c7d59819284350e4f8cfc85c44a7fd4d4b015bb383f2
+DIST autoconf-archive-2015.02.24.tar.xz 578536 SHA256 69715bdd078f552ca85e498a94543e11cb8bcdf0359e659b84d84d19372b0dc5 SHA512 111cb9ba8abac766dd9dc7d96cd3a4a3f845430a3f3365712765eb61adc00f3d278ae0ddbda950a08c2a34091023a2d889896f716b0379d7f328eae35a246e17 WHIRLPOOL c8dcd24520da545a4e1a909f83d8d0a41491eac723714437e486e5fa8e335f097e751990f5513e67cc7bd6e8f328b2ef5faeb22407c5b8daec089e3a9255c7d5
diff --git a/sys-devel/autoconf-archive/autoconf-archive-2012.09.08.ebuild b/sys-devel/autoconf-archive/autoconf-archive-2012.09.08.ebuild
new file mode 100644
index 00000000000..6785d97dec4
--- /dev/null
+++ b/sys-devel/autoconf-archive/autoconf-archive-2012.09.08.ebuild
@@ -0,0 +1,21 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+DESCRIPTION="GNU Autoconf Macro Archive"
+HOMEPAGE="http://www.gnu.org/software/autoconf-archive/"
+SRC_URI="mirror://gnu/${PN}/${P}.tar.xz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="alpha amd64 arm hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~ppc-aix ~ia64-hpux ~x86-interix ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~x86-solaris"
+IUSE=""
+
+DOCS=( AUTHORS ChangeLog NEWS README TODO )
+
+src_install() {
+ default
+ rm -rf "${ED}/usr/share/${PN}" || die
+}
diff --git a/sys-devel/autoconf-archive/autoconf-archive-2013.06.09.ebuild b/sys-devel/autoconf-archive/autoconf-archive-2013.06.09.ebuild
new file mode 100644
index 00000000000..86d18336572
--- /dev/null
+++ b/sys-devel/autoconf-archive/autoconf-archive-2013.06.09.ebuild
@@ -0,0 +1,21 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+DESCRIPTION="GNU Autoconf Macro Archive"
+HOMEPAGE="http://www.gnu.org/software/autoconf-archive/"
+SRC_URI="mirror://gnu/${PN}/${P}.tar.xz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~ppc-aix ~ia64-hpux ~x86-interix ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~x86-solaris"
+IUSE=""
+
+DOCS=( AUTHORS ChangeLog NEWS README TODO )
+
+src_install() {
+ default
+ rm -rf "${ED}/usr/share/${PN}" || die
+}
diff --git a/sys-devel/autoconf-archive/autoconf-archive-2013.11.01.ebuild b/sys-devel/autoconf-archive/autoconf-archive-2013.11.01.ebuild
new file mode 100644
index 00000000000..86d18336572
--- /dev/null
+++ b/sys-devel/autoconf-archive/autoconf-archive-2013.11.01.ebuild
@@ -0,0 +1,21 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+DESCRIPTION="GNU Autoconf Macro Archive"
+HOMEPAGE="http://www.gnu.org/software/autoconf-archive/"
+SRC_URI="mirror://gnu/${PN}/${P}.tar.xz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~ppc-aix ~ia64-hpux ~x86-interix ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~x86-solaris"
+IUSE=""
+
+DOCS=( AUTHORS ChangeLog NEWS README TODO )
+
+src_install() {
+ default
+ rm -rf "${ED}/usr/share/${PN}" || die
+}
diff --git a/sys-devel/autoconf-archive/autoconf-archive-2014.02.28.ebuild b/sys-devel/autoconf-archive/autoconf-archive-2014.02.28.ebuild
new file mode 100644
index 00000000000..c1970b2ffb4
--- /dev/null
+++ b/sys-devel/autoconf-archive/autoconf-archive-2014.02.28.ebuild
@@ -0,0 +1,21 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+DESCRIPTION="GNU Autoconf Macro Archive"
+HOMEPAGE="http://www.gnu.org/software/autoconf-archive/"
+SRC_URI="mirror://gnu/${PN}/${P}.tar.xz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~ppc-aix ~ia64-hpux ~x86-interix ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~x86-solaris"
+IUSE=""
+
+DOCS=( AUTHORS ChangeLog NEWS README TODO )
+
+src_install() {
+ default
+ rm -rf "${ED}/usr/share/${PN}" || die
+}
diff --git a/sys-devel/autoconf-archive/autoconf-archive-2015.02.04.ebuild b/sys-devel/autoconf-archive/autoconf-archive-2015.02.04.ebuild
new file mode 100644
index 00000000000..c3361b56d96
--- /dev/null
+++ b/sys-devel/autoconf-archive/autoconf-archive-2015.02.04.ebuild
@@ -0,0 +1,26 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+DESCRIPTION="GNU Autoconf Macro Archive"
+HOMEPAGE="http://www.gnu.org/software/autoconf-archive/"
+SRC_URI="mirror://gnu/${PN}/${P}.tar.xz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="alpha amd64 arm ~arm64 ~hppa ~ia64 ~m68k ~mips ppc ppc64 ~s390 ~sh sparc x86 ~ppc-aix ~ia64-hpux ~x86-interix ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~x86-solaris"
+IUSE=""
+
+#file collisions, bug #540246
+RDEPEND="!=gnome-base/gnome-common-3.14.0
+ !>=gnome-base/gnome-common-3.14.0-r1[-autoconf-archive(+)]"
+DEPEND=""
+
+DOCS=( AUTHORS ChangeLog NEWS README TODO )
+
+src_install() {
+ default
+ rm -rf "${ED}/usr/share/${PN}" || die
+}
diff --git a/sys-devel/autoconf-archive/autoconf-archive-2015.02.24.ebuild b/sys-devel/autoconf-archive/autoconf-archive-2015.02.24.ebuild
new file mode 100644
index 00000000000..c5c467d5eb2
--- /dev/null
+++ b/sys-devel/autoconf-archive/autoconf-archive-2015.02.24.ebuild
@@ -0,0 +1,26 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+DESCRIPTION="GNU Autoconf Macro Archive"
+HOMEPAGE="http://www.gnu.org/software/autoconf-archive/"
+SRC_URI="mirror://gnu/${PN}/${P}.tar.xz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~ia64-hpux ~x86-interix ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~x86-solaris"
+IUSE=""
+
+#file collisions, bug #540246
+RDEPEND="!=gnome-base/gnome-common-3.14.0
+ !>=gnome-base/gnome-common-3.14.0-r1[-autoconf-archive(+)]"
+DEPEND=""
+
+DOCS=( AUTHORS ChangeLog NEWS README TODO )
+
+src_install() {
+ default
+ rm -rf "${ED}/usr/share/${PN}" || die
+}
diff --git a/sys-devel/autoconf-archive/metadata.xml b/sys-devel/autoconf-archive/metadata.xml
new file mode 100644
index 00000000000..3708129356b
--- /dev/null
+++ b/sys-devel/autoconf-archive/metadata.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>base-system</herd>
+ <maintainer>
+ <email>binki@gentoo.org</email>
+ <name>Nathan Phillip Brink</name>
+ </maintainer>
+</pkgmetadata>
diff --git a/sys-devel/autoconf-wrapper/autoconf-wrapper-13.ebuild b/sys-devel/autoconf-wrapper/autoconf-wrapper-13.ebuild
new file mode 100644
index 00000000000..18a7f03be61
--- /dev/null
+++ b/sys-devel/autoconf-wrapper/autoconf-wrapper-13.ebuild
@@ -0,0 +1,27 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit multilib
+
+DESCRIPTION="wrapper for autoconf to manage multiple autoconf versions"
+HOMEPAGE="http://www.gentoo.org/"
+SRC_URI=""
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~ppc-aix ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~x64-freebsd ~x86-freebsd ~hppa-hpux ~ia64-hpux ~x86-interix ~amd64-linux ~arm-linux ~ia64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE=""
+
+S=${WORKDIR}
+
+src_install() {
+ exeinto /usr/$(get_libdir)/misc
+ newexe "${FILESDIR}"/ac-wrapper-${PV}.sh ac-wrapper.sh || die
+
+ dodir /usr/bin
+ local x=
+ for x in auto{conf,header,m4te,reconf,scan,update} ifnames ; do
+ dosym ../$(get_libdir)/misc/ac-wrapper.sh /usr/bin/${x} || die
+ done
+}
diff --git a/sys-devel/autoconf-wrapper/files/ac-wrapper-13.sh b/sys-devel/autoconf-wrapper/files/ac-wrapper-13.sh
new file mode 100755
index 00000000000..93be1cd929a
--- /dev/null
+++ b/sys-devel/autoconf-wrapper/files/ac-wrapper-13.sh
@@ -0,0 +1,202 @@
+#!/bin/sh
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+# Based on the ac-wrapper.pl script provided by MandrakeSoft
+# Rewritten in bash by Gregorio Guidi
+#
+# Executes the correct autoconf version.
+#
+# - defaults to newest version available (hopefully autoconf-2.60)
+# - runs autoconf 2.13 if:
+# - envvar WANT_AUTOCONF is set to `2.1'
+# -or-
+# - `ac{local,include}.m4' or `configure.{in,ac}' have AC_PREREQ(2.1) (not higher)
+# -or-
+# - `configure' is already present and was generated by autoconf 2.13
+
+warn() { printf "ac-wrapper: $*\n" 1>&2; }
+err() { warn "$@"; exit 1; }
+unset IFS
+which() {
+ local p
+ IFS=: # we don't use IFS anywhere, so don't bother saving/restoring
+ for p in ${PATH} ; do
+ p="${p}/$1"
+ [ -e "${p}" ] && echo "${p}" && return 0
+ done
+ unset IFS
+ return 1
+}
+
+#
+# Sanitize argv[0] since it isn't always a full path #385201
+#
+argv0=${0##*/}
+case ${0} in
+ ${argv0})
+ # find it in PATH
+ if ! full_argv0=$(which "${argv0}") ; then
+ err "could not locate ${argv0}; file a bug"
+ fi
+ ;;
+ *)
+ # re-use full/relative paths
+ full_argv0=$0
+ ;;
+esac
+
+if [ "${argv0}" = "ac-wrapper.sh" ] ; then
+ err "Don't call this script directly"
+fi
+
+if [ "${WANT_AUTOCONF}" = "2.1" ] && [ "${argv0}" = "autom4te" ] ; then
+ err "Autoconf 2.13 doesn't contain autom4te.\n" \
+ " Either unset WANT_AUTOCONF or don't execute anything\n" \
+ " that would use autom4te."
+fi
+
+if ! seq 0 0 2>/dev/null 1>&2 ; then #338518
+ seq() {
+ local f l i
+ case $# in
+ 1) f=1 i=1 l=$1;;
+ 2) f=$1 i=1 l=$2;;
+ 3) f=$1 i=$2 l=$3;;
+ esac
+ while :; do
+ [ $l -lt $f -a $i -gt 0 ] && break
+ [ $f -lt $l -a $i -lt 0 ] && break
+ echo $f
+ : $(( f += i ))
+ done
+ return 0
+ }
+fi
+
+#
+# Set up bindings between actual version and WANT_AUTOCONF;
+# Start at last known unstable/stable versions to speed up lookup process.
+#
+KNOWN_AUTOCONF="2.69:2.5 2.68:2.5"
+vers="${KNOWN_AUTOCONF} 9999:2.5 $(printf '2.%s:2.5 ' `seq 99 -1 59`) 2.13:2.1"
+
+binary=""
+for v in ${vers} ; do
+ auto_ver=${v%:*}
+ if [ -z "${binary}" ] && [ -x "${full_argv0}-${auto_ver}" ] ; then
+ binary="${full_argv0}-${auto_ver}"
+ break
+ fi
+done
+if [ -z "${binary}" ] ; then
+ err "Unable to locate any usuable version of autoconf.\n" \
+ "\tI tried these versions: ${vers}\n" \
+ "\tWith a base name of '${full_argv0}'."
+fi
+
+#
+# Check the WANT_AUTOCONF setting. We accept a whitespace delimited
+# list of autoconf versions.
+#
+if [ -n "${WANT_AUTOCONF}" ] ; then
+ for v in ${vers} x ; do
+ if [ "${v}" = "x" ] ; then
+ warn "warning: invalid WANT_AUTOCONF '${WANT_AUTOCONF}'; ignoring."
+ unset WANT_AUTOCONF
+ break
+ fi
+
+ auto_ver=${v%:*}
+ want_ver=${v#*:}
+ for wx in ${WANT_AUTOCONF} ; do
+ if [ -x "${full_argv0}-${wx}" ] ; then
+ binary="${full_argv0}-${wx}"
+ v="x"
+ elif [ "${wx}" = "${want_ver}" ] && [ -x "${full_argv0}-${auto_ver}" ] ; then
+ binary="${full_argv0}-${auto_ver}"
+ v="x"
+ fi
+ done
+ [ "${v}" = "x" ] && break
+ done
+fi
+
+#
+# autodetect helpers
+#
+acprereq_version() {
+ sed -n -r \
+ -e '/^\s*(#|dnl)/d' \
+ -e '/AC_PREREQ/s:.*AC_PREREQ\s*\(\[?\s*([0-9.]+)\s*\]?\):\1:p' \
+ "$@" |
+ LC_ALL=C sort -n -t . |
+ tail -1
+}
+
+generated_version() {
+ local re='^# Generated (by (GNU )?Autoconf|automatically using autoconf version) ([0-9.]+).*'
+ sed -n -r "/${re}/{s:${re}:\3:;p;q}" "$@"
+}
+
+#
+# autodetect routine
+#
+if [ "${WANT_AUTOCONF}" = "2.1" ] && [ -f "configure.ac" ] ; then
+ err "Since configure.ac is present, aclocal always use\n" \
+ "\tautoconf 2.59+, which conflicts with your choice and\n" \
+ "\tcauses error. You have two options:\n" \
+ "\t1. Try execute command again after removing configure.ac\n" \
+ "\t2. Don't set WANT_AUTOCONF"
+fi
+
+if [ "${WANT_AUTOCONF:-2.1}" = "2.1" ] && [ -n "${WANT_AUTOMAKE}" ] ; then
+ # Automake-1.7 and better require autoconf-2.5x so if WANT_AUTOMAKE
+ # is set to an older version, let's do some sanity checks.
+ case "${WANT_AUTOMAKE}" in
+ 1.[456])
+ acfiles=$(ls ac{local,include}.m4 configure.{in,ac} 2>/dev/null)
+ [ -n "${acfiles}" ] && confversion=$(acprereq_version ${acfiles})
+
+ [ -z "${confversion}" ] && [ -r "configure" ] \
+ && confversion=$(generated_version configure)
+
+ if [ "${confversion}" = "2.1" ] && [ ! -f "configure.ac" ] ; then
+ binary="${full_argv0}-2.13"
+ fi
+ esac
+fi
+
+if [ -n "${WANT_ACWRAPPER_DEBUG}" ] ; then
+ if [ -n "${WANT_AUTOCONF}" ] ; then
+ warn "DEBUG: WANT_AUTOCONF is set to ${WANT_AUTOCONF}"
+ fi
+ warn "DEBUG: will execute <${binary}>"
+fi
+
+#
+# for further consistency
+#
+if [ -z "${WANT_AUTOCONF}" ] ; then
+ for v in ${vers} ; do
+ auto_ver=${v%:*}
+ want_ver=${v#*:}
+ if [ "${binary}" = "${full_argv0}-${auto_ver}" ] ; then
+ export WANT_AUTOCONF="${want_ver}"
+ break
+ fi
+ done
+fi
+
+#
+# Now try to run the binary
+#
+if [ ! -x "${binary}" ] ; then
+ # this shouldn't happen
+ err "${binary} is missing or not executable.\n" \
+ "\tPlease try emerging the correct version of autoconf."
+fi
+
+exec "${binary}" "$@"
+# The shell will error out if `exec` failed.
diff --git a/sys-devel/autoconf-wrapper/metadata.xml b/sys-devel/autoconf-wrapper/metadata.xml
new file mode 100644
index 00000000000..96a2d586367
--- /dev/null
+++ b/sys-devel/autoconf-wrapper/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>base-system</herd>
+</pkgmetadata>
diff --git a/sys-devel/autoconf/Manifest b/sys-devel/autoconf/Manifest
new file mode 100644
index 00000000000..98b210de422
--- /dev/null
+++ b/sys-devel/autoconf/Manifest
@@ -0,0 +1,10 @@
+DIST autoconf-2.13.tar.gz 443844 SHA256 f0611136bee505811e9ca11ca7ac188ef5323a8e2ef19cffd3edb3cf08fd791e SHA512 602584f4c77b7a554aaa068eda5409b68eb0b3229e9c224bffb91c83c4314d25de15bd560a323626ff78f6df339c79e1ef8938c54b78ecadf4dc75c5241290ad WHIRLPOOL 918e5e4679f0a2ae84299f190904be05f2c69e8cddf97c6b1a6e82ba20768f4c97ac451b0b6159800bad6635633f9d772a403be8c724ea782bf7725d2905f180
+DIST autoconf-2.59.tar.bz2 925073 SHA256 f0cde70a8f135098a6a3e85869f2e1cc3f141beea766fa3d6636e086cd8b90a7 SHA512 0f57e57b94ef78d59e68476746e78de9c8d0c07bcfdbdb850c2e68b59cdbef7e6256a073d1ae8965abd30611f22c1dc451ecdf67aff43102f73ec118c51ab4d6 WHIRLPOOL 4330fe3d19c26759e7babd2470cf3fb3cc8c6632fee6014ca33c2f8339ddb3114f4376b14cad4126a4dd496aecfc3f68d623061752836094c893894ede693a8b
+DIST autoconf-2.61.tar.bz2 1042439 SHA256 93a2ceab963618b021db153f0c881a2de82455c1dc7422be436fcd5c554085a1 SHA512 f534c7dbc10fc871cc99b1cb68bd7f19d888677d9e2af47e904e91fe90420c20e7a270da2681da82e249ffb46c92165202cc73e125a9b14abd604458731b0026 WHIRLPOOL fd608032198954f05f83e65cd118eb91dc74b0e3b2831594cc2a88f90a5120f56381863913cf661927baeb3aae5b99406a904ccbfb48fe4bf5757e17d455de67
+DIST autoconf-2.62.tar.bz2 1165951 SHA256 42be7628e32fd3bebe07d684b11fb6e7e7920ef698fc4ccb3da6d77f91cefb96 SHA512 98a2d903e8c43088ac60b880f58d7c35c547824c277dbeb14c48f846e40f29546c20e942f99127ffdc6f6607c334a6054328f20a9a2962972cc80570665ee7d7 WHIRLPOOL bfef8abab1a6776859369d5ffce960a17ae25208312b5a78ddcac97adb0a4464c25043a2bbf8461a8fcb528dc878a8bbc04debe67701ade47eae8a67b1ef25ff
+DIST autoconf-2.63.tar.bz2 1195259 SHA256 264d7c1c0e268bc77fbe0f308e085545535edfe73f33e27c80219cc0c9c71246 SHA512 bd47527a1f6558953d21ac1d7a36d490d057a78cd612f82b6f31aa73f9c42f4a2d736a7d4e49d91df268bffa5a418d222c53e741bffc2c8843fe3b7ed37e09d6 WHIRLPOOL 595eefe099ad7f8ad17290b5f042186567915164d2f0ae3cabed0ee13f54ca714e82ff440f84a4458fb42ce4b4f9fb5eecbcf79e61405a5a833b04d55f5a8713
+DIST autoconf-2.64.tar.xz 1113892 SHA256 32d977213320b8ae76c71175305301197f2b0e04e72d70694bc3d3e2ae6c7248 SHA512 ee4b504447c14a59b849d0915e55a90522cfb071d1583af2bd3575e5a05d7bd290e55e0e9d0760c8f36043f926199fc2d962b559d27d2f95c70d0e147b4ad0a3 WHIRLPOOL 791d3f9ed37833b13880a1bb7f75b2f73ae73fd6c9a9f4bb0ddbc33e29a617fa7f82fe43556c33effc417ac584f711f325245c3379af97f22600d54546ef9a79
+DIST autoconf-2.65.tar.xz 1132092 SHA256 3e07179feb2ba724ae557872d0cb5878655c58b49b6eaea068210c0bf22661f5 SHA512 23473cde36ad02a9474286a144c751b222d7aecf8b271b49e6dae25706c96d5533c8d840d522ecf11df8c437961a2ac00aa050c929d5e06b381acf1bc34f2c4c WHIRLPOOL 8a4bbaf7c9593d27ab9245dedc236d4addf38633f0fcc95ccfc35a1d503c447674940790407e49dab3b9fdb679eea8c9b04b132ca87c5a3c820a7f6834bfec98
+DIST autoconf-2.67.tar.xz 1158000 SHA256 80c6bda1dd6ab04510d42f594c69a06f98dc5e589683b03c11abd89270502ac1 SHA512 b9021a137da42512f6c4ce907b560ad54e27491083ce686039c32dca2602f3cb354d9e7d7493d6d531a0aa5766ff25e0d86aea6e8f61a79d93acf3ff6b56de80 WHIRLPOOL 810c763bbd1cde8eb4b7aeba32d6f9d0189b09b630a92f496eb499b466e19db6a4b9f8e291cf51e690103d8f885b37029f744aac3ca197f6e5a25645f30f1a74
+DIST autoconf-2.68.tar.xz 1167804 SHA256 c994778716e6223cf65e898e06c15ed498fe81424838adf67007282b661055ba SHA512 fd41b2d75a89bcc67f2cb0a3b335ca0d5e8f6d3f4ae844fea21c80c5ff7234efe8c299491e89d1d1124b0d4ec3072a21cf707e14b5ef186f1ab2d09f0fefa979 WHIRLPOOL 607d9bb0469633a1938d92e600073c4fa860415d339e0a8b0239265980eb9a967d79bf4c06ce96bb5f61e4504b52a6b4f90d39fd082f15ad969c1a9d24b0cedf
+DIST autoconf-2.69.tar.xz 1214744 SHA256 64ebcec9f8ac5b2487125a86a7760d2591ac9e1d3dbd59489633f9de62a57684 SHA512 995d3e5a8eb1eb37e2b7fae53c6ec7a9b4df997286b7d643344818f94636756b1bf5ff5ea9155e755cb9461149a853dfbf2886fc6bd7132e5afa9c168e306e9b WHIRLPOOL 9d806d685b9951acb15ab837b08437a6632f0907f105057e84ba3e0d99539371c32153333f459f04fb537cbb96a80e4418937e937381aec677b319ad667f7918
diff --git a/sys-devel/autoconf/autoconf-2.13.ebuild b/sys-devel/autoconf/autoconf-2.13.ebuild
new file mode 100644
index 00000000000..04f2b7836b4
--- /dev/null
+++ b/sys-devel/autoconf/autoconf-2.13.ebuild
@@ -0,0 +1,57 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+inherit eutils
+
+DESCRIPTION="Used to create autoconfiguration files"
+HOMEPAGE="http://www.gnu.org/software/autoconf/autoconf.html"
+SRC_URI="mirror://gnu/${PN}/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="${PV:0:3}"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd"
+IUSE="userland_BSD"
+
+DEPEND=">=sys-apps/texinfo-4.3
+ =sys-devel/m4-1.4*
+ dev-lang/perl"
+RDEPEND="${DEPEND}
+ >=sys-devel/autoconf-wrapper-13"
+
+PATCHES=(
+ "${FILESDIR}"/${P}-gentoo.patch
+ "${FILESDIR}"/${P}-destdir.patch
+ "${FILESDIR}"/${P}-test-fixes.patch #146592
+)
+
+if [[ -z ${__EBLITS__} && -n ${FILESDIR} ]] ; then
+ source "${FILESDIR}"/eblits/main.eblit || die
+fi
+src_prepare() { eblit-run src_prepare ; }
+src_install() { eblit-run src_install ; }
+
+src_configure() {
+ touch configure # make sure configure is newer than configure.in
+
+ # need to include --exec-prefix and --bindir or our
+ # DESTDIR patch will trigger sandbox hate :(
+ #
+ # need to force locale to C to avoid bugs in the old
+ # configure script breaking the install paths #351982
+ #
+ # force to `awk` so that we don't encode another awk that
+ # happens to currently be installed, but might later be
+ # uninstalled (like mawk). same for m4.
+ local prepend=""
+ use userland_BSD && prepend="g"
+ ac_cv_path_M4="${prepend}m4" \
+ ac_cv_prog_AWK="${prepend}awk" \
+ LC_ALL=C \
+ econf \
+ --exec-prefix=/usr \
+ --bindir=/usr/bin \
+ --program-suffix="-${PV}"
+}
diff --git a/sys-devel/autoconf/autoconf-2.59-r7.ebuild b/sys-devel/autoconf/autoconf-2.59-r7.ebuild
new file mode 100644
index 00000000000..f33c89ccdb1
--- /dev/null
+++ b/sys-devel/autoconf/autoconf-2.59-r7.ebuild
@@ -0,0 +1,33 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+inherit eutils
+
+DESCRIPTION="Used to create autoconfiguration files"
+HOMEPAGE="http://www.gnu.org/software/autoconf/autoconf.html"
+SRC_URI="mirror://gnu/${PN}/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="${PV}"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~sparc-fbsd ~x86-fbsd"
+IUSE=""
+
+DEPEND="=sys-devel/m4-1.4*
+ dev-lang/perl"
+RDEPEND="${DEPEND}
+ !~sys-devel/${P}:0
+ >=sys-devel/autoconf-wrapper-13"
+
+PATCHES=(
+ "${FILESDIR}"/${P}-more-quotes.patch
+)
+
+if [[ -z ${__EBLITS__} && -n ${FILESDIR} ]] ; then
+ source "${FILESDIR}"/eblits/main.eblit || die
+fi
+src_prepare() { eblit-run src_prepare ; }
+src_configure() { eblit-run src_configure ; }
+src_install() { eblit-run src_install ; }
diff --git a/sys-devel/autoconf/autoconf-2.61-r2.ebuild b/sys-devel/autoconf/autoconf-2.61-r2.ebuild
new file mode 100644
index 00000000000..877599078b3
--- /dev/null
+++ b/sys-devel/autoconf/autoconf-2.61-r2.ebuild
@@ -0,0 +1,39 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+inherit eutils
+
+DESCRIPTION="Used to create autoconfiguration files"
+HOMEPAGE="http://www.gnu.org/software/autoconf/autoconf.html"
+SRC_URI="mirror://gnu/${PN}/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="${PV}"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~sparc-fbsd ~x86-fbsd"
+IUSE=""
+
+DEPEND=">=sys-devel/m4-1.4.6
+ dev-lang/perl"
+RDEPEND="${DEPEND}
+ !~sys-devel/${P}:0
+ >=sys-devel/autoconf-wrapper-13"
+
+PATCHES=(
+ "${FILESDIR}"/${P}-GETMNTENT.patch
+)
+
+if [[ -z ${__EBLITS__} && -n ${FILESDIR} ]] ; then
+ source "${FILESDIR}"/eblits/main.eblit || die
+fi
+src_prepare() { eblit-run src_prepare ; }
+src_configure() { eblit-run src_configure ; }
+src_install() { eblit-run src_install ; }
+
+src_compile() {
+ # From configure output:
+ # Parallel builds via `make -jN' do not work.
+ emake -j1
+}
diff --git a/sys-devel/autoconf/autoconf-2.62-r1.ebuild b/sys-devel/autoconf/autoconf-2.62-r1.ebuild
new file mode 100644
index 00000000000..fa8eab46319
--- /dev/null
+++ b/sys-devel/autoconf/autoconf-2.62-r1.ebuild
@@ -0,0 +1,35 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+inherit eutils
+
+DESCRIPTION="Used to create autoconfiguration files"
+HOMEPAGE="http://www.gnu.org/software/autoconf/autoconf.html"
+SRC_URI="mirror://gnu/${PN}/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="${PV}"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~sparc-fbsd ~x86-fbsd"
+IUSE=""
+
+DEPEND=">=sys-devel/m4-1.4.6
+ dev-lang/perl"
+RDEPEND="${DEPEND}
+ !~sys-devel/${P}:0
+ >=sys-devel/autoconf-wrapper-13"
+
+PATCHES=(
+ "${FILESDIR}"/${P}-revert-AC_C_BIGENDIAN.patch #228825
+ "${FILESDIR}"/${P}-at-keywords.patch
+ "${FILESDIR}"/${P}-fix-multiline-string.patch #217976
+)
+
+if [[ -z ${__EBLITS__} && -n ${FILESDIR} ]] ; then
+ source "${FILESDIR}"/eblits/main.eblit || die
+fi
+src_prepare() { eblit-run src_prepare ; }
+src_configure() { eblit-run src_configure ; }
+src_install() { eblit-run src_install ; }
diff --git a/sys-devel/autoconf/autoconf-2.63-r1.ebuild b/sys-devel/autoconf/autoconf-2.63-r1.ebuild
new file mode 100644
index 00000000000..0817c9780a8
--- /dev/null
+++ b/sys-devel/autoconf/autoconf-2.63-r1.ebuild
@@ -0,0 +1,33 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+inherit eutils
+
+DESCRIPTION="Used to create autoconfiguration files"
+HOMEPAGE="http://www.gnu.org/software/autoconf/autoconf.html"
+SRC_URI="mirror://gnu/${PN}/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="${PV}"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~sparc-fbsd ~x86-fbsd"
+IUSE=""
+
+DEPEND=">=sys-devel/m4-1.4.6
+ dev-lang/perl"
+RDEPEND="${DEPEND}
+ !~sys-devel/${P}:0
+ >=sys-devel/autoconf-wrapper-13"
+
+PATCHES=(
+ "${FILESDIR}"/${P}-sh.patch #264303
+)
+
+if [[ -z ${__EBLITS__} && -n ${FILESDIR} ]] ; then
+ source "${FILESDIR}"/eblits/main.eblit || die
+fi
+src_prepare() { eblit-run src_prepare ; }
+src_configure() { eblit-run src_configure ; }
+src_install() { eblit-run src_install ; }
diff --git a/sys-devel/autoconf/autoconf-2.64.ebuild b/sys-devel/autoconf/autoconf-2.64.ebuild
new file mode 100644
index 00000000000..c8f69b24dc0
--- /dev/null
+++ b/sys-devel/autoconf/autoconf-2.64.ebuild
@@ -0,0 +1,27 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+DESCRIPTION="Used to create autoconfiguration files"
+HOMEPAGE="http://www.gnu.org/software/autoconf/autoconf.html"
+SRC_URI="mirror://gnu/${PN}/${P}.tar.xz"
+
+LICENSE="GPL-2"
+SLOT="${PV}"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~sparc-fbsd ~x86-fbsd"
+IUSE=""
+
+DEPEND=">=sys-devel/m4-1.4.6
+ dev-lang/perl"
+RDEPEND="${DEPEND}
+ !~sys-devel/${P}:0
+ >=sys-devel/autoconf-wrapper-13"
+
+if [[ -z ${__EBLITS__} && -n ${FILESDIR} ]] ; then
+ source "${FILESDIR}"/eblits/main.eblit || die
+fi
+src_prepare() { eblit-run src_prepare ; }
+src_configure() { eblit-run src_configure ; }
+src_install() { eblit-run src_install ; }
diff --git a/sys-devel/autoconf/autoconf-2.65-r1.ebuild b/sys-devel/autoconf/autoconf-2.65-r1.ebuild
new file mode 100644
index 00000000000..3c88254dc48
--- /dev/null
+++ b/sys-devel/autoconf/autoconf-2.65-r1.ebuild
@@ -0,0 +1,33 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+inherit eutils
+
+DESCRIPTION="Used to create autoconfiguration files"
+HOMEPAGE="http://www.gnu.org/software/autoconf/autoconf.html"
+SRC_URI="mirror://gnu/${PN}/${P}.tar.xz"
+
+LICENSE="GPL-3"
+SLOT="${PV}"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~sparc-fbsd ~x86-fbsd"
+IUSE=""
+
+DEPEND=">=sys-devel/m4-1.4.6
+ dev-lang/perl"
+RDEPEND="${DEPEND}
+ !~sys-devel/${P}:0
+ >=sys-devel/autoconf-wrapper-13"
+
+PATCHES=(
+ "${FILESDIR}"/${P}-AC_TYPE_INT_T.patch #324649
+)
+
+if [[ -z ${__EBLITS__} && -n ${FILESDIR} ]] ; then
+ source "${FILESDIR}"/eblits/main.eblit || die
+fi
+src_prepare() { eblit-run src_prepare ; }
+src_configure() { eblit-run src_configure ; }
+src_install() { eblit-run src_install ; }
diff --git a/sys-devel/autoconf/autoconf-2.67.ebuild b/sys-devel/autoconf/autoconf-2.67.ebuild
new file mode 100644
index 00000000000..dd83b9b2ee2
--- /dev/null
+++ b/sys-devel/autoconf/autoconf-2.67.ebuild
@@ -0,0 +1,27 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+DESCRIPTION="Used to create autoconfiguration files"
+HOMEPAGE="http://www.gnu.org/software/autoconf/autoconf.html"
+SRC_URI="mirror://gnu/${PN}/${P}.tar.xz"
+
+LICENSE="GPL-3"
+SLOT="${PV}"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~sparc-fbsd ~x86-fbsd"
+IUSE=""
+
+DEPEND=">=sys-devel/m4-1.4.6
+ dev-lang/perl"
+RDEPEND="${DEPEND}
+ !~sys-devel/${P}:0
+ >=sys-devel/autoconf-wrapper-13"
+
+if [[ -z ${__EBLITS__} && -n ${FILESDIR} ]] ; then
+ source "${FILESDIR}"/eblits/main.eblit || die
+fi
+src_prepare() { eblit-run src_prepare ; }
+src_configure() { eblit-run src_configure ; }
+src_install() { eblit-run src_install ; }
diff --git a/sys-devel/autoconf/autoconf-2.68.ebuild b/sys-devel/autoconf/autoconf-2.68.ebuild
new file mode 100644
index 00000000000..dd83b9b2ee2
--- /dev/null
+++ b/sys-devel/autoconf/autoconf-2.68.ebuild
@@ -0,0 +1,27 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+DESCRIPTION="Used to create autoconfiguration files"
+HOMEPAGE="http://www.gnu.org/software/autoconf/autoconf.html"
+SRC_URI="mirror://gnu/${PN}/${P}.tar.xz"
+
+LICENSE="GPL-3"
+SLOT="${PV}"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~sparc-fbsd ~x86-fbsd"
+IUSE=""
+
+DEPEND=">=sys-devel/m4-1.4.6
+ dev-lang/perl"
+RDEPEND="${DEPEND}
+ !~sys-devel/${P}:0
+ >=sys-devel/autoconf-wrapper-13"
+
+if [[ -z ${__EBLITS__} && -n ${FILESDIR} ]] ; then
+ source "${FILESDIR}"/eblits/main.eblit || die
+fi
+src_prepare() { eblit-run src_prepare ; }
+src_configure() { eblit-run src_configure ; }
+src_install() { eblit-run src_install ; }
diff --git a/sys-devel/autoconf/autoconf-2.69-r1.ebuild b/sys-devel/autoconf/autoconf-2.69-r1.ebuild
new file mode 100644
index 00000000000..67a5b90388f
--- /dev/null
+++ b/sys-devel/autoconf/autoconf-2.69-r1.ebuild
@@ -0,0 +1,39 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+# For usex.
+inherit eutils
+
+if [[ ${PV} == "9999" ]] ; then
+ EGIT_REPO_URI="git://git.savannah.gnu.org/${PN}.git
+ http://git.savannah.gnu.org/r/${PN}.git"
+ inherit git-2
+else
+ SRC_URI="mirror://gnu/${PN}/${P}.tar.xz
+ ftp://alpha.gnu.org/pub/gnu/${PN}/${P}.tar.xz"
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~arm-linux ~x86-linux"
+fi
+
+DESCRIPTION="Used to create autoconfiguration files"
+HOMEPAGE="http://www.gnu.org/software/autoconf/autoconf.html"
+
+LICENSE="GPL-3"
+SLOT=$(usex multislot "${PV}" "2.5")
+IUSE="emacs multislot"
+
+DEPEND=">=sys-devel/m4-1.4.16
+ >=dev-lang/perl-5.6"
+RDEPEND="${DEPEND}
+ multislot? ( !~sys-devel/${P}:0 )
+ >=sys-devel/autoconf-wrapper-13"
+PDEPEND="emacs? ( app-emacs/autoconf-mode )"
+
+if [[ -z ${__EBLITS__} && -n ${FILESDIR} ]] ; then
+ source "${FILESDIR}"/eblits/main.eblit || die
+fi
+src_prepare() { eblit-run src_prepare ; }
+src_configure() { eblit-run src_configure ; }
+src_install() { eblit-run src_install ; }
diff --git a/sys-devel/autoconf/autoconf-2.69.ebuild b/sys-devel/autoconf/autoconf-2.69.ebuild
new file mode 100644
index 00000000000..1a1cfb88e16
--- /dev/null
+++ b/sys-devel/autoconf/autoconf-2.69.ebuild
@@ -0,0 +1,58 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="3"
+
+inherit eutils
+
+if [[ ${PV} == "9999" ]] ; then
+ EGIT_REPO_URI="git://git.savannah.gnu.org/${PN}.git
+ http://git.savannah.gnu.org/r/${PN}.git"
+ inherit git-2
+else
+ SRC_URI="mirror://gnu/${PN}/${P}.tar.xz
+ ftp://alpha.gnu.org/pub/gnu/${PN}/${P}.tar.xz"
+ KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~arm-linux ~x86-linux"
+fi
+
+DESCRIPTION="Used to create autoconfiguration files"
+HOMEPAGE="http://www.gnu.org/software/autoconf/autoconf.html"
+
+LICENSE="GPL-3"
+SLOT=$(usex multislot "${PV}" "2.5")
+IUSE="emacs multislot"
+
+DEPEND=">=sys-devel/m4-1.4.16
+ >=dev-lang/perl-5.6"
+RDEPEND="${DEPEND}
+ multislot? ( !~sys-devel/${P}:0 )
+ >=sys-devel/autoconf-wrapper-13"
+PDEPEND="emacs? ( app-emacs/autoconf-mode )"
+
+src_prepare() {
+ if [[ ${PV} == "9999" ]] ; then
+ autoreconf -f -i || die
+ fi
+ find -name Makefile.in -exec sed -i '/^pkgdatadir/s:$:-@VERSION@:' {} +
+}
+
+src_configure() {
+ # Disable Emacs in the build system since it is in a separate package.
+ export EMACS=no
+ econf --program-suffix="-${PV}" || die
+ # econf updates config.{sub,guess} which forces the manpages
+ # to be regenerated which we dont want to do #146621
+ touch man/*.1
+}
+
+src_install() {
+ emake DESTDIR="${D}" install || die
+ dodoc AUTHORS BUGS NEWS README TODO THANKS \
+ ChangeLog ChangeLog.0 ChangeLog.1 ChangeLog.2
+
+ local f
+ for f in "${ED}"/usr/share/info/*.info* ; do
+ mv "${f}" "${f/.info/-${SLOT}.info}" || die
+ done
+}
diff --git a/sys-devel/autoconf/autoconf-9999.ebuild b/sys-devel/autoconf/autoconf-9999.ebuild
new file mode 100644
index 00000000000..95feafc5c5c
--- /dev/null
+++ b/sys-devel/autoconf/autoconf-9999.ebuild
@@ -0,0 +1,48 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+if [[ ${PV} == "9999" ]] ; then
+ EGIT_REPO_URI="git://git.savannah.gnu.org/${PN}.git
+ http://git.savannah.gnu.org/r/${PN}.git"
+ # We need all the tags in order to figure out the right version.
+ # The git-r3 eclass doesn't support that, so have to stick to 2.
+ inherit git-2
+else
+ SRC_URI="mirror://gnu/${PN}/${P}.tar.xz
+ ftp://alpha.gnu.org/pub/gnu/${PN}/${P}.tar.xz"
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~arm-linux ~x86-linux"
+fi
+
+DESCRIPTION="Used to create autoconfiguration files"
+HOMEPAGE="http://www.gnu.org/software/autoconf/autoconf.html"
+
+LICENSE="GPL-3"
+SLOT="${PV}"
+IUSE="emacs"
+
+DEPEND=">=sys-devel/m4-1.4.16
+ >=dev-lang/perl-5.6"
+RDEPEND="${DEPEND}
+ !~sys-devel/${P}:0
+ >=sys-devel/autoconf-wrapper-13"
+[[ ${PV} == "9999" ]] && DEPEND+=" >=sys-apps/texinfo-4.3"
+PDEPEND="emacs? ( app-emacs/autoconf-mode )"
+
+if [[ -z ${__EBLITS__} && -n ${FILESDIR} ]] ; then
+ source "${FILESDIR}"/eblits/main.eblit || die
+fi
+src_prepare() { eblit-run src_prepare ; }
+src_configure() { eblit-run src_configure ; }
+src_install() { eblit-run src_install ; }
+
+eblit-src_prepare-pre() {
+ # Avoid the "dirty" suffix in the git version by generating it
+ # before we run later stages which might modify source files.
+ local ver=$(./build-aux/git-version-gen .tarball-version)
+ echo "${ver}" > .tarball-version
+
+ autoreconf -f -i || die
+}
diff --git a/sys-devel/autoconf/files/autoconf-2.13-destdir.patch b/sys-devel/autoconf/files/autoconf-2.13-destdir.patch
new file mode 100644
index 00000000000..858b8bcc1f7
--- /dev/null
+++ b/sys-devel/autoconf/files/autoconf-2.13-destdir.patch
@@ -0,0 +1,26 @@
+--- Makefile.in.orig 2004-10-20 16:44:54.949117496 -0400
++++ Makefile.in 2004-10-20 16:45:39.999268832 -0400
+@@ -41,18 +41,18 @@
+
+ transform=@program_transform_name@
+
+-prefix = @prefix@
++prefix = $(DESTDIR)@prefix@
+-exec_prefix = @exec_prefix@
++exec_prefix = $(DESTDIR)@exec_prefix@
+
+ # Directory in which to install scripts.
+-bindir = @bindir@
++bindir = $(DESTDIR)@bindir@
+
+ # Directory in which to install library files.
+-datadir = @datadir@
++datadir = $(DESTDIR)@datadir@
+ acdatadir = $(datadir)/autoconf
+
+ # Directory in which to install documentation info files.
+-infodir = @infodir@
++infodir = $(DESTDIR)@infodir@
+
+ #### End of system configuration section. ####
+
diff --git a/sys-devel/autoconf/files/autoconf-2.13-gentoo.patch b/sys-devel/autoconf/files/autoconf-2.13-gentoo.patch
new file mode 100644
index 00000000000..8e40d0cae04
--- /dev/null
+++ b/sys-devel/autoconf/files/autoconf-2.13-gentoo.patch
@@ -0,0 +1,36 @@
+--- configure.orig Wed Feb 28 20:51:53 2001
++++ configure Wed Feb 28 20:52:03 2001
+@@ -654,12 +654,10 @@
+ echo "$ac_t""no" 1>&6
+ fi
+
+-if test "$PERL" != no; then
+- SCRIPTS=autoscan
+-else
+- echo "configure: warning: autoscan will not be built since perl is not found" 1>&2
++if test "$PERL" = no; then
++ PERL=/usr/bin/perl
+ fi
+-
++SCRIPTS=autoscan
+ ac_aux_dir=
+ for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
+ if test -f $ac_dir/install-sh; then
+--- configure.orig Wed Feb 28 20:53:24 2001
++++ configure.in Wed Feb 28 20:53:28 2001
+@@ -14,12 +14,10 @@
+ AC_PATH_PROG(PERL, perl, no)
+ AC_SUBST(PERL)dnl
+ AC_SUBST(SCRIPTS)dnl
+-if test "$PERL" != no; then
+- SCRIPTS=autoscan
+-else
+- AC_MSG_WARN(autoscan will not be built since perl is not found)
++if test "$PERL" = no; then
++ PERL=/usr/bin/perl
+ fi
+-
++SCRIPTS=autoscan
+ AC_PROG_INSTALL
+
+ # Work with the GNU or Cygnus source tree layout.
diff --git a/sys-devel/autoconf/files/autoconf-2.13-test-fixes.patch b/sys-devel/autoconf/files/autoconf-2.13-test-fixes.patch
new file mode 100644
index 00000000000..b8a7e3b8ce9
--- /dev/null
+++ b/sys-devel/autoconf/files/autoconf-2.13-test-fixes.patch
@@ -0,0 +1,18 @@
+newer gcc versions don't provide g77, so if it doesn't exist,
+don't bother trying to test it (and failing)
+
+http://bugs.gentoo.org/146592
+
+--- autoconf-2.13/testsuite/autoconf.s/syntax.exp
++++ autoconf-2.13/testsuite/autoconf.s/syntax.exp
+@@ -5,6 +5,10 @@
+ set macros [exec sed -n $script $srcdir/../acspecific.m4]
+
+ foreach mac $macros {
++ if { [string match "*F77*" "$mac"] && [catch {exec which g77} ignore_output] } then {
++ send_user "XFAIL: $mac\n"
++ continue
++ }
+ send_user "$mac\n"
+ autoconf_test $mac $mac
+ }
diff --git a/sys-devel/autoconf/files/autoconf-2.59-more-quotes.patch b/sys-devel/autoconf/files/autoconf-2.59-more-quotes.patch
new file mode 100644
index 00000000000..eb2c8395fa9
--- /dev/null
+++ b/sys-devel/autoconf/files/autoconf-2.59-more-quotes.patch
@@ -0,0 +1,34 @@
+http://bugs.gentoo.org/96882
+
+date: 2005/06/23 20:09:27; author: eggert; state: Exp; lines: +29 -34
+Fix some more shell quoting problems. Prompted by a bug report
+from Justace Clutter.
+* lib/autoconf/general.m4 (_AC_INIT_SRCDIR): Allow special
+characters in $ac_unique_file.
+
+--- lib/autoconf/general.m4
++++ lib/autoconf/general.m4
+@@ -476,20 +476,20 @@
+ # Try the directory containing this script, then its parent.
+ ac_confdir=`AS_DIRNAME(["$[0]"])`
+ srcdir=$ac_confdir
+- if test ! -r $srcdir/$ac_unique_file; then
++ if test ! -r "$srcdir/$ac_unique_file"; then
+ srcdir=..
+ fi
+ else
+ ac_srcdir_defaulted=no
+ fi
+-if test ! -r $srcdir/$ac_unique_file; then
++if test ! -r "$srcdir/$ac_unique_file"; then
+ if test "$ac_srcdir_defaulted" = yes; then
+ AC_MSG_ERROR([cannot find sources ($ac_unique_file) in $ac_confdir or ..])
+ else
+ AC_MSG_ERROR([cannot find sources ($ac_unique_file) in $srcdir])
+ fi
+ fi
+-(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null ||
++(cd $srcdir && test -r "./$ac_unique_file") 2>/dev/null ||
+ AC_MSG_ERROR([sources are in $srcdir, but `cd $srcdir' does not work])
+ dnl Double slashes in pathnames in object file debugging info
+ dnl mess up M-x gdb in Emacs.
diff --git a/sys-devel/autoconf/files/autoconf-2.60-tests.patch b/sys-devel/autoconf/files/autoconf-2.60-tests.patch
new file mode 100644
index 00000000000..09e4536baf0
--- /dev/null
+++ b/sys-devel/autoconf/files/autoconf-2.60-tests.patch
@@ -0,0 +1,22 @@
+2006-07-17 Paul Eggert <eggert@cs.ucla.edu>
+
+ * tests/tools.at (autom4te cache): Update wording of diagnostic
+ to match M4 1.4.5.
+
+Index: tests/tools.at
+===================================================================
+RCS file: /cvsroot/autoconf/autoconf/tests/tools.at,v
+retrieving revision 1.89
+retrieving revision 1.90
+diff -u -p -r1.89 -r1.90
+--- tests/tools.at 20 Jun 2006 05:37:43 -0000 1.89
++++ tests/tools.at 17 Jul 2006 17:30:44 -0000 1.90
+@@ -101,7 +101,7 @@ AT_CHECK_M4SUGAR
+ mkdir sub
+ mv foo sub
+ AT_CHECK_M4SUGAR([], [1], [],
+-[m4: script.4s: 1: Cannot open foo: No such file or directory
++[m4: script.4s: 1: cannot open `foo': No such file or directory
+ autom4te: m4 failed with exit status: 1
+ ])
+
diff --git a/sys-devel/autoconf/files/autoconf-2.61-GETMNTENT.patch b/sys-devel/autoconf/files/autoconf-2.61-GETMNTENT.patch
new file mode 100644
index 00000000000..7cdc425e039
--- /dev/null
+++ b/sys-devel/autoconf/files/autoconf-2.61-GETMNTENT.patch
@@ -0,0 +1,23 @@
+From: Paul Eggert <eggert@cs.ucla.edu>
+Date: Sat, 16 Dec 2006 05:38:41 +0000 (+0000)
+Subject: * lib/autoconf/functions.m4 (AC_FUNC_GETMNTENT):
+X-Git-Tag: v2.62~386
+X-Git-Url: http://git.savannah.gnu.org/gitweb/?p=autoconf.git;a=commitdiff_plain;h=a152d401584cd901f7295647af0382948369de79
+
+* lib/autoconf/functions.m4 (AC_FUNC_GETMNTENT):
+Define HAVE_GETMNTENT to 1, not to the empty string.
+Problem originally reported by Jochen Friedrich in
+<http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=403243>.
+---
+
+--- a/lib/autoconf/functions.m4
++++ b/lib/autoconf/functions.m4
+@@ -798,7 +798,7 @@ AC_DEFUN([AC_FUNC_GETMNTENT],
+ # -lseq on Dynix/PTX, -lgen on Unixware.
+ AC_SEARCH_LIBS(getmntent, [sun seq gen],
+ [ac_cv_func_getmntent=yes
+- AC_DEFINE([HAVE_GETMNTENT], [],
++ AC_DEFINE([HAVE_GETMNTENT], 1,
+ [Define to 1 if you have the `getmntent' function.])],
+ [ac_cv_func_getmntent=no])
+ ])
diff --git a/sys-devel/autoconf/files/autoconf-2.62-at-keywords.patch b/sys-devel/autoconf/files/autoconf-2.62-at-keywords.patch
new file mode 100644
index 00000000000..04cd1807b8a
--- /dev/null
+++ b/sys-devel/autoconf/files/autoconf-2.62-at-keywords.patch
@@ -0,0 +1,81 @@
+commit 3ac7ceb0c2dfd023e0e9e944da6825b6bd676568
+Author: Eric Blake <ebb9@byu.net>
+Date: Thu Jun 5 15:18:11 2008 -0600
+
+ Fix regression in AT_KEYWORDS([Macro]), from 2007-10-18.
+
+ * lib/autotest/general.m4 (AT_KEYWORDS): Expand argument prior to
+ converting it to lower case.
+ * tests/autotest.at (Keywords and ranges): Test this.
+ * NEWS: Document the fix.
+ * THANKS: Update.
+ Reported by Karsten Hopp.
+
+ Signed-off-by: Eric Blake <ebb9@byu.net>
+
+diff --git a/NEWS b/NEWS
+index 183d4f1..8b866ad 100644
+--- a/NEWS
++++ b/NEWS
+@@ -9,6 +9,10 @@ GNU Autoconf NEWS - User visible changes.
+ ** Two new quadrigraphs have been introduced: @{:@ for (, and @:}@ for ),
+ allowing the output of unbalanced parantheses in more contexts.
+
++** AT_KEYWORDS once again performs expansion on its argument, such that
++ AT_KEYWORDS([m4_if([$1], [], [default])]) no longer complains about
++ the possibly unexpanded m4_if [regression introduced in 2.62].
++
+
+ * Major changes in Autoconf 2.62 (2008-04-05) [stable]
+ Released by Eric Blake, based on git versions 2.61a.*.
+diff --git a/THANKS b/THANKS
+index 5ec8921..224cdea 100644
+--- a/THANKS
++++ b/THANKS
+@@ -177,6 +177,7 @@ Justace Clutter ?
+ Jörn Rennecke amylaar@cygnus.co.uk
+ Karl Berry karl@cs.umb.edu
+ Karl Heuer kwzh@gnu.org
++Karsten Hopp karsten@redhat.com
+ Kate Hedstrom ?
+ Kathryn Hargreaves kathryn@deas.harvard.edu
+ Kaveh R. Ghazi ghazi@caip.rutgers.edu
+diff --git a/lib/autotest/general.m4 b/lib/autotest/general.m4
+index 88d10a3..993dd9f 100644
+--- a/lib/autotest/general.m4
++++ b/lib/autotest/general.m4
+@@ -1476,9 +1476,10 @@ m4_case([$1],
+ # AT_KEYWORDS(KEYWORDS)
+ # ---------------------
+ # Declare a list of keywords associated to the current test group.
+-# The list is stored in lower case, since the -k option is case-insensitive.
++# Since the -k option is case-insensitive, the list is stored in lower case
++# to avoid duplicates that differ only by case.
+ _AT_DEFINE_SETUP([AT_KEYWORDS],
+-[m4_append_uniq_w([AT_keywords], m4_tolower([[$1]]))])
++[m4_append_uniq_w([AT_keywords], m4_tolower(m4_dquote(m4_expand([$1]))))])
+
+
+ # AT_CAPTURE_FILE(FILE)
+diff --git a/tests/autotest.at b/tests/autotest.at
+index dc3cfd5..c4c0eda 100644
+--- a/tests/autotest.at
++++ b/tests/autotest.at
+@@ -690,7 +690,7 @@ AT_CHECK(:)
+ AT_CLEANUP
+ AT_SETUP(both) # 04
+ AT_KEYWORDS([key1 key2])
+-AT_KEYWORDS([key1])
++AT_KEYWORDS([m4@&t@_echo([Key1])])
+ AT_CHECK(:)
+ AT_CLEANUP
+ AT_SETUP(test5) # 05
+@@ -713,7 +713,7 @@ AT_CHECK(:)
+ AT_CLEANUP
+ ]])
+ dnl check that AT_KEYWORDS does not duplicate words
+-AT_CHECK([grep 'key1.*key1' k], [1])
++AT_CHECK([grep -i 'key1.*key1' k], [1])
+ dnl check that -k requires an argument
+ AT_CHECK([$CONFIG_SHELL ./k -k], [1], [], [ignore])
+
diff --git a/sys-devel/autoconf/files/autoconf-2.62-fix-multiline-string.patch b/sys-devel/autoconf/files/autoconf-2.62-fix-multiline-string.patch
new file mode 100644
index 00000000000..cfd7b422879
--- /dev/null
+++ b/sys-devel/autoconf/files/autoconf-2.62-fix-multiline-string.patch
@@ -0,0 +1,30 @@
+sniped from mandrivia:
+http://svn.mandriva.com/cgi-bin/viewvc.cgi/packages/cooker/autoconf/current/SOURCES/autoconf-2.62-fix-multiline-string.patch
+
+this may not be the correct fix, but it seems to get the job done until we can
+grab whatever upstream merges
+http://lists.gnu.org/archive/html/bug-autoconf/2008-04/msg00031.html
+
+--- autoconf-2.62/lib/autoconf/status.m4
++++ autoconf-2.62/lib/autoconf/status.m4
+@@ -1360,16 +1360,16 @@ _ACEOF
+ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ # Files that config.status was made for.
+ m4_ifdef([_AC_SEEN_CONFIG(FILES)],
+-[config_files="$ac_config_files"
++[config_files="`echo $ac_config_files`"
+ ])dnl
+ m4_ifdef([_AC_SEEN_CONFIG(HEADERS)],
+-[config_headers="$ac_config_headers"
++[config_headers="`echo $ac_config_headers`"
+ ])dnl
+ m4_ifdef([_AC_SEEN_CONFIG(LINKS)],
+-[config_links="$ac_config_links"
++[config_links="`echo $ac_config_links`"
+ ])dnl
+ m4_ifdef([_AC_SEEN_CONFIG(COMMANDS)],
+-[config_commands="$ac_config_commands"
++[config_commands="`echo $ac_config_commands`"
+ ])dnl
+
+ _ACEOF
diff --git a/sys-devel/autoconf/files/autoconf-2.62-revert-AC_C_BIGENDIAN.patch b/sys-devel/autoconf/files/autoconf-2.62-revert-AC_C_BIGENDIAN.patch
new file mode 100644
index 00000000000..76db013cac5
--- /dev/null
+++ b/sys-devel/autoconf/files/autoconf-2.62-revert-AC_C_BIGENDIAN.patch
@@ -0,0 +1,214 @@
+revert AC_C_BIGENDIAN to the version found in 2.61 since the version in 2.62 is
+known to be broken and the changes that it brings are not critical
+
+http://bugs.gentoo.org/228825
+
+--- autoconf-2.62/lib/autoconf/c.m4
++++ autoconf-2.61/lib/autoconf/c.m4
+@@ -1393,140 +1351,74 @@
+ ])# AC_C_CHAR_UNSIGNED
+
+
+-# AC_C_BIGENDIAN ([ACTION-IF-TRUE], [ACTION-IF-FALSE], [ACTION-IF-UNKNOWN],
+-# [ACTION-IF-UNIVERSAL])
++# AC_C_BIGENDIAN ([ACTION-IF-TRUE], [ACTION-IF-FALSE], [ACTION-IF-UNKNOWN])
+ # -------------------------------------------------------------------------
+ AC_DEFUN([AC_C_BIGENDIAN],
+-[AH_VERBATIM([WORDS_BIGENDIAN],
+-[/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
+- significant byte first (like Motorola and SPARC, unlike Intel and VAX). */
+-#if defined __BIG_ENDIAN__
+-# define WORDS_BIGENDIAN 1
+-#elif ! defined __LITTLE_ENDIAN__
+-# undef WORDS_BIGENDIAN
+-#endif])dnl
+- AC_CACHE_CHECK([whether byte ordering is bigendian], [ac_cv_c_bigendian],
+- [ac_cv_c_bigendian=unknown
+- m4_ifval(m4_ifdef([AH_HEADER], 1)[$4],
+- [# See if __BIG_ENDIAN__ or __LITTLE_ENDIAN__ is defined.
+- AC_COMPILE_IFELSE(
+- [AC_LANG_SOURCE(
+- [[#if ! (defined __BIG_ENDIAN__ || defined __LITTLE_ENDIAN__)
+- neither is defined;
+- #endif
+- typedef int dummy;
+- ]])],
+- [ac_cv_c_bigendian=universal])],
+- [AC_DIAGNOSE([obsolete], [AC_C_BIGENDIAN suggests AC_CONFIG_HEADERS])])
+- if test $ac_cv_c_bigendian = unknown; then
+- # See if sys/param.h defines the BYTE_ORDER macro.
+- AC_COMPILE_IFELSE(
+- [AC_LANG_PROGRAM(
+- [[#include <sys/types.h>
+- #include <sys/param.h>
+- ]],
+- [[#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \
+- && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \
+- && LITTLE_ENDIAN)
+- bogus endian macros
+- #endif
+- ]])],
+- [# It does; now see whether it defined to BIG_ENDIAN or not.
+- AC_COMPILE_IFELSE(
+- [AC_LANG_PROGRAM(
+- [[#include <sys/types.h>
+- #include <sys/param.h>
+- ]],
+- [[#if BYTE_ORDER != BIG_ENDIAN
+- not big endian
+- #endif
+- ]])],
+- [ac_cv_c_bigendian=yes],
+- [ac_cv_c_bigendian=no])])
+- fi
+- if test $ac_cv_c_bigendian = unknown; then
+- # See if <limits.h> defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris).
+- AC_COMPILE_IFELSE(
+- [AC_LANG_PROGRAM(
+- [[#include <limits.h>
+- ]],
+- [[#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN)
+- bogus endian macros
+- #endif
+- ]])],
+- [# It does; now see whether it defined to _BIG_ENDIAN or not.
+- AC_COMPILE_IFELSE(
+- [AC_LANG_PROGRAM(
+- [[#include <limits.h>
+- ]],
+- [[#ifndef _BIG_ENDIAN
+- not big endian
+- #endif
+- ]])],
+- [ac_cv_c_bigendian=yes],
+- [ac_cv_c_bigendian=no])])
+- fi
+- if test $ac_cv_c_bigendian = unknown; then
+- # Compile a test program.
+- AC_RUN_IFELSE(
+- [AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT],
+- [[
+- /* Are we little or big endian? From Harbison&Steele. */
+- union
+- {
+- long int l;
+- char c[sizeof (long int)];
+- } u;
+- u.l = 1;
+- return u.c[sizeof (long int) - 1] == 1;
+- ]])],
+- [ac_cv_c_bigendian=no],
+- [ac_cv_c_bigendian=yes],
+- [# Try to guess by grepping values from an object file.
+- AC_COMPILE_IFELSE(
+- [AC_LANG_PROGRAM(
+- [[short int ascii_mm[] =
+- { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 };
+- short int ascii_ii[] =
+- { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 };
+- int use_ascii (int i) {
+- return ascii_mm[i] + ascii_ii[i];
+- }
+- short int ebcdic_ii[] =
+- { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 };
+- short int ebcdic_mm[] =
+- { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 };
+- int use_ebcdic (int i) {
+- return ebcdic_mm[i] + ebcdic_ii[i];
+- }
+- extern int foo;
+- ]],
+- [[return use_ascii (foo) == use_ebcdic (foo);]])],
+- [if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then
+- ac_cv_c_bigendian=yes
+- fi
+- if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then
+- if test "$ac_cv_c_bigendian" = unknown; then
+- ac_cv_c_bigendian=no
+- else
+- # finding both strings is unlikely to happen, but who knows?
+- ac_cv_c_bigendian=unknown
+- fi
+- fi])])
+- fi])
+- case $ac_cv_c_bigendian in #(
+- yes)
+- m4_default([$1],
+- [AC_DEFINE([WORDS_BIGENDIAN], 1)]);; #(
+- no)
+- $2 ;; #(
+- universal)
+- $4 ;; #(
+- *)
+- m4_default([$3],
+- [AC_MSG_ERROR([unknown endianness
+- presetting ac_cv_c_bigendian=no (or yes) will help])]) ;;
+- esac
++[AC_CACHE_CHECK(whether byte ordering is bigendian, ac_cv_c_bigendian,
++[# See if sys/param.h defines the BYTE_ORDER macro.
++AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <sys/types.h>
++#include <sys/param.h>
++],
++[#if ! (defined BYTE_ORDER && defined BIG_ENDIAN && defined LITTLE_ENDIAN \
++ && BYTE_ORDER && BIG_ENDIAN && LITTLE_ENDIAN)
++ bogus endian macros
++#endif
++])],
++[# It does; now see whether it defined to BIG_ENDIAN or not.
++AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <sys/types.h>
++#include <sys/param.h>
++], [#if BYTE_ORDER != BIG_ENDIAN
++ not big endian
++#endif
++])], [ac_cv_c_bigendian=yes], [ac_cv_c_bigendian=no])],
++[# It does not; compile a test program.
++AC_RUN_IFELSE(
++[AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT], [[
++ /* Are we little or big endian? From Harbison&Steele. */
++ union
++ {
++ long int l;
++ char c[sizeof (long int)];
++ } u;
++ u.l = 1;
++ return u.c[sizeof (long int) - 1] == 1;
++]])],
++ [ac_cv_c_bigendian=no],
++ [ac_cv_c_bigendian=yes],
++[# try to guess the endianness by grepping values into an object file
++ ac_cv_c_bigendian=unknown
++ AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
++[[short int ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 };
++short int ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 };
++void _ascii () { char *s = (char *) ascii_mm; s = (char *) ascii_ii; }
++short int ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 };
++short int ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 };
++void _ebcdic () { char *s = (char *) ebcdic_mm; s = (char *) ebcdic_ii; }]],
++[[ _ascii (); _ebcdic (); ]])],
++[if grep BIGenDianSyS conftest.$ac_objext >/dev/null ; then
++ ac_cv_c_bigendian=yes
++fi
++if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then
++ if test "$ac_cv_c_bigendian" = unknown; then
++ ac_cv_c_bigendian=no
++ else
++ # finding both strings is unlikely to happen, but who knows?
++ ac_cv_c_bigendian=unknown
++ fi
++fi])])])])
++case $ac_cv_c_bigendian in
++ yes)
++ m4_default([$1],
++ [AC_DEFINE([WORDS_BIGENDIAN], 1,
++ [Define to 1 if your processor stores words with the most significant
++ byte first (like Motorola and SPARC, unlike Intel and VAX).])]) ;;
++ no)
++ $2 ;;
++ *)
++ m4_default([$3],
++ [AC_MSG_ERROR([unknown endianness
++presetting ac_cv_c_bigendian=no (or yes) will help])]) ;;
++esac
+ ])# AC_C_BIGENDIAN
+
+
diff --git a/sys-devel/autoconf/files/autoconf-2.63-sh.patch b/sys-devel/autoconf/files/autoconf-2.63-sh.patch
new file mode 100644
index 00000000000..8008b32b602
--- /dev/null
+++ b/sys-devel/autoconf/files/autoconf-2.63-sh.patch
@@ -0,0 +1,32 @@
+http://bugs.gentoo.org/264303
+http://lists.gnu.org/archive/html/bug-autoconf/2008-10/msg00040.html
+
+From: Chikama Masaki <masaki.chikama@gmail.com>
+Date: Fri, 24 Oct 2008 01:41:06 +0000 (-0600)
+Subject: For gfortran on sh, ignore -little.
+X-Git-Tag: v2.63b~206
+X-Git-Url: http://git.savannah.gnu.org/gitweb/?p=autoconf.git;a=commitdiff_plain;h=3f38aad
+
+For gfortran on sh, ignore -little.
+
+* lib/autoconf/fortran.m4 (_AC_FC_LIBRARY_LDFLAGS): Add -little to
+list of ignored arguments.
+* THANKS: Update.
+
+Signed-off-by: Eric Blake <ebb9@byu.net>
+---
+
+diff --git a/lib/autoconf/fortran.m4 b/lib/autoconf/fortran.m4
+index 20d9e0c..ad0c2ee 100644
+--- a/lib/autoconf/fortran.m4
++++ b/lib/autoconf/fortran.m4
+@@ -686,7 +686,8 @@ while test $[@%:@] != 1; do
+ [_AC_LINKER_OPTION([$ac_arg], ac_cv_[]_AC_LANG_ABBREV[]_libs)])
+ ;;
+ # Ignore these flags.
+- -lang* | -lcrt*.o | -lc | -lgcc* | -lSystem | -libmil | -LANG:=* | -LIST:* | -LNO:*)
++ -lang* | -lcrt*.o | -lc | -lgcc* | -lSystem | -libmil | -little \
++ |-LANG:=* | -LIST:* | -LNO:*)
+ ;;
+ -lkernel32)
+ test x"$CYGWIN" != xyes && ac_cv_[]_AC_LANG_ABBREV[]_libs="$ac_cv_[]_AC_LANG_ABBREV[]_libs $ac_arg"
diff --git a/sys-devel/autoconf/files/autoconf-2.65-AC_TYPE_INT_T.patch b/sys-devel/autoconf/files/autoconf-2.65-AC_TYPE_INT_T.patch
new file mode 100644
index 00000000000..cc81672e427
--- /dev/null
+++ b/sys-devel/autoconf/files/autoconf-2.65-AC_TYPE_INT_T.patch
@@ -0,0 +1,49 @@
+https://bugs.gentoo.org/324649
+http://lists.gnu.org/archive/html/bug-autoconf/2009-12/msg00016.html
+
+From 83ee5bc460a1083ab29fd9d3a3044cbaefad6ac6 Mon Sep 17 00:00:00 2001
+From: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
+Date: Wed, 9 Dec 2009 07:20:16 +0100
+Subject: [PATCH] Fix 2.64 AC_TYPE_INT*_T macro body text regression.
+
+* lib/autoconf/types.m4 (_AC_TYPE_INT_BODY): Move helper enum
+definition to prologue section, to avoid syntax error.
+* NEWS, THANKS: Update.
+Report by Pierre Ynard.
+
+Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
+---
+ ChangeLog | 8 ++++++++
+ NEWS | 3 +++
+ THANKS | 1 +
+ lib/autoconf/types.m4 | 12 ++++++------
+ 4 files changed, 18 insertions(+), 6 deletions(-)
+
+diff --git a/lib/autoconf/types.m4 b/lib/autoconf/types.m4
+index 7a73fc2..3829c4c 100644
+--- a/lib/autoconf/types.m4
++++ b/lib/autoconf/types.m4
+@@ -635,14 +635,14 @@ m4_define([_AC_TYPE_INT_BODY],
+ 'long long int' 'short int' 'signed char'; do
+ AC_COMPILE_IFELSE(
+ [AC_LANG_BOOL_COMPILE_TRY(
+- [AC_INCLUDES_DEFAULT],
+- [enum { N = $[]2 / 2 - 1 };
+- 0 < ($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 1)])],
++ [AC_INCLUDES_DEFAULT
++ enum { N = $[]2 / 2 - 1 };],
++ [0 < ($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 1)])],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_BOOL_COMPILE_TRY(
+- [AC_INCLUDES_DEFAULT],
+- [enum { N = $[]2 / 2 - 1 };
+- ($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 1)
++ [AC_INCLUDES_DEFAULT
++ enum { N = $[]2 / 2 - 1 };],
++ [($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 1)
+ < ($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 2)])],
+ [],
+ [AS_CASE([$ac_type], [int$[]2_t],
+--
+1.7.1
+
diff --git a/sys-devel/autoconf/files/eblits/main.eblit b/sys-devel/autoconf/files/eblits/main.eblit
new file mode 100644
index 00000000000..c5d80c33d5e
--- /dev/null
+++ b/sys-devel/autoconf/files/eblits/main.eblit
@@ -0,0 +1,48 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+__EBLITS__="locked-and-loaded"
+
+# eblit-include [--skip] <function> [version]
+eblit-include() {
+ local skipable=false
+ [[ $1 == "--skip" ]] && skipable=true && shift
+ [[ $1 == pkg_* ]] && skipable=true
+
+ local e v func=$1 ver=$2
+ [[ -z ${func} ]] && die "Usage: eblit-include <function> [version]"
+ for v in ${ver:+-}${ver} -${PVR} -${PV} "" ; do
+ e="${FILESDIR}/eblits/${func}${v}.eblit"
+ if [[ -e ${e} ]] ; then
+ source "${e}"
+ return 0
+ fi
+ done
+ ${skipable} && return 0
+ die "Could not locate requested eblit '${func}' in ${FILESDIR}/eblits/"
+}
+
+# eblit-run-maybe <function>
+# run the specified function if it is defined
+eblit-run-maybe() {
+ [[ $(type -t "$@") == "function" ]] && "$@"
+}
+
+# eblit-run <function> [version]
+# aka: src_unpack() { eblit-run src_unpack ; }
+eblit-run() {
+ eblit-include --skip common "${*:2}"
+ eblit-include "$@"
+ eblit-run-maybe eblit-$1-pre
+ eblit-${PN}-$1
+ eblit-run-maybe eblit-$1-post
+}
+
+# Copy these into the ebuilds.
+#src_unpack() { eblit-run src_unpack ; }
+#src_prepare() { eblit-run src_prepare ; }
+#src_configure() { eblit-run src_configure ; }
+#src_compile() { eblit-run src_compile ; }
+#src_test() { eblit-run src_test ; }
+#src_install() { eblit-run src_install ; }
diff --git a/sys-devel/autoconf/files/eblits/src_configure.eblit b/sys-devel/autoconf/files/eblits/src_configure.eblit
new file mode 100644
index 00000000000..308c3a683e9
--- /dev/null
+++ b/sys-devel/autoconf/files/eblits/src_configure.eblit
@@ -0,0 +1,12 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+eblit-autoconf-src_configure() {
+ # Disable Emacs in the build system since it is in a separate package.
+ export EMACS=no
+ econf --program-suffix="-${PV}" || die
+ # econf updates config.{sub,guess} which forces the manpages
+ # to be regenerated which we dont want to do #146621
+ touch man/*.1
+}
diff --git a/sys-devel/autoconf/files/eblits/src_install.eblit b/sys-devel/autoconf/files/eblits/src_install.eblit
new file mode 100644
index 00000000000..e9c98634fa2
--- /dev/null
+++ b/sys-devel/autoconf/files/eblits/src_install.eblit
@@ -0,0 +1,39 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+# slot the info pages. do this w/out munging the source so we don't have
+# to depend on texinfo to regen things. #464146 (among others)
+slot_info_pages() {
+ [[ ${SLOT} == "0" ]] && return
+
+ pushd "${D}"/usr/share/info >/dev/null
+ rm -f dir
+
+ # Rewrite all the references to other pages.
+ # before: * aclocal-invocation: (automake)aclocal Invocation. Generating aclocal.m4.
+ # after: * aclocal-invocation v1.13: (automake-1.13)aclocal Invocation. Generating aclocal.m4.
+ local p pages=( *.info ) args=()
+ for p in "${pages[@]/%.info}" ; do
+ args+=(
+ -e "/START-INFO-DIR-ENTRY/,/END-INFO-DIR-ENTRY/s|: (${p})| v${SLOT}&|"
+ -e "s:(${p}):(${p}-${SLOT}):g"
+ )
+ done
+ sed -i "${args[@]}" * || die
+
+ # Rewrite all the file references, and rename them in the process.
+ local f d
+ for f in * ; do
+ d=${f/.info/-${SLOT}.info}
+ mv "${f}" "${d}" || die
+ sed -i -e "s:${f}:${d}:g" * || die
+ done
+
+ popd >/dev/null
+}
+
+eblit-autoconf-src_install() {
+ default
+ slot_info_pages
+}
diff --git a/sys-devel/autoconf/files/eblits/src_prepare.eblit b/sys-devel/autoconf/files/eblits/src_prepare.eblit
new file mode 100644
index 00000000000..0a5aff53d59
--- /dev/null
+++ b/sys-devel/autoconf/files/eblits/src_prepare.eblit
@@ -0,0 +1,9 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+eblit-autoconf-src_prepare() {
+ find -name Makefile.in -exec sed -i '/^pkgdatadir/s:$:-@VERSION@:' {} +
+
+ [[ ${#PATCHES[@]} -gt 0 ]] && epatch "${PATCHES[@]}"
+}
diff --git a/sys-devel/autoconf/metadata.xml b/sys-devel/autoconf/metadata.xml
new file mode 100644
index 00000000000..f9d3cbfa27c
--- /dev/null
+++ b/sys-devel/autoconf/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>base-system</herd>
+<use>
+<flag name='multislot'>Allow for multiple versions to be installed at once</flag>
+</use>
+</pkgmetadata>
diff --git a/sys-devel/autogen/Manifest b/sys-devel/autogen/Manifest
new file mode 100644
index 00000000000..8632824e936
--- /dev/null
+++ b/sys-devel/autogen/Manifest
@@ -0,0 +1,6 @@
+DIST autogen-5.15.tar.xz 915252 SHA256 cc2a9e24b8b5e4eb74a88519189fd0978bf88fe22af6fe311781e6891098b726 SHA512 cc4cf076324f367c7ada395b21c2d87208cab96dc19bc734a3c462a661090d466aae40a2266e9a472e8f5924b8c32d579af8988bfee53a773aa77c52c846cb1c WHIRLPOOL e008c0012a7475e366425ff0a049b4b25d6fa1701141385497f8c15491b26654844fce36d8774d6378e6386c1fe9cb921400089a4679f88ab3e63429e2cf2eb2
+DIST autogen-5.17.3.tar.xz 999240 SHA256 7bbea9c522ea4c7c80153c8b998eb603295bdce0a622cac36c9c84c87cf3497c SHA512 5a4eec4dbf34b7e398648c65c4c90ae96a5b3ed45a455249cdc60035bf0ce76ac0539160135686fd612d48fbd1951315f8a0acc62cf7f6ec7506cb433d799a13 WHIRLPOOL b8ddf7dbcfd1e8b751e4ada2706ba00fa0fce29f20c4180a3d8d2665c118c2c85ae0bc20486a2394eb7b280777db8fbef397fc9e5a5c198e00eda73624ead1ee
+DIST autogen-5.17.4.tar.xz 1003356 SHA256 35cd4b5f0b48ce61278865412ed7e3c5b9b8cb082ae969ca1e6888e8bf8128a4 SHA512 9a7b31f6b17d8d27a617aae7575baf5ce690e7b70d5f6960ac2944d068315e56ed2717e905b30329b058cc8ce5297128ebcabf417dc7564a2d8e9786662f9c6c WHIRLPOOL 9f5e4582cf22f8e3ef0195c6cd86893d0f431a33a58ee0d47ce742cae3a746f0f136d67b78fd709ce7ca8a572156ed0b6a6fa125b933687cdf36d87bccb1f02e
+DIST autogen-5.18.1.tar.xz 1010332 SHA256 c9c2e8d1b32b868d06e6faf4831230c1ca725efa16636092ead232903da75307 SHA512 1f64f587fca795bd6f526a00b64d521802de7b36a70a88977d7d2301d3cebdd7cbca93a4075fb8d2130692c27d64c23ee290e2b8a869a31e81faa4aeab0a468a WHIRLPOOL 36ed84d5cc1ad7c29d345c277faadf682001aab8f13490892a90f2efd4db6f6de48fd18f9c7edd04e3203536dc5571e0d4df9e8824ef5f4248c667e09542a867
+DIST autogen-5.18.2.tar.xz 1012344 SHA256 1fad5687a5f0fb110fe78d13dccde11346b5e072b44cf8d4e6871fdf42e02c6b SHA512 8b9b2bd5118e29983e8ba87f5dd00bcb4f00a9defd1011c77d1071f4447a3ce4e7d3dcd88c9a3c88039fff622cdbd83fd269bd70d19e328a7ab93acae053160b WHIRLPOOL f97596869feb7ada62c326e10cc09a4528466e27878f9ce8bee552075cb043ffa0029f6267e0611b7d58154ebac0f006fe80b6db4d1b7f24d073b5fa4ca11c80
+DIST autogen-5.18.4.tar.xz 1017936 SHA256 7fbaff0c25035aee5b96913de2c83d9a5cc973b8dc08d6b7489ecbcfd72eb84b SHA512 a02363484de5019bd90fb6f2cf52b1b9556d6cf310c62a68830d0b2408ea4870d3c262fe5d1c27e3586ed3af4a7487d7422ad117760ac2a01ef3cfcfc1f2bfb6 WHIRLPOOL 109cb5637558f8e16cbb9afcb629a9bbd3d5ceae6b897a00101fce99b1a39b06ecc497d9b43441e40b58981dd2402027e89ce6ae76da73b73db934c64bca2b63
diff --git a/sys-devel/autogen/autogen-5.15.ebuild b/sys-devel/autogen/autogen-5.15.ebuild
new file mode 100644
index 00000000000..4a414272b04
--- /dev/null
+++ b/sys-devel/autogen/autogen-5.15.ebuild
@@ -0,0 +1,26 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+inherit eutils
+
+DESCRIPTION="Program and text file generation"
+HOMEPAGE="http://www.gnu.org/software/autogen/"
+SRC_URI="mirror://gnu/${PN}/rel${PV}/${P}.tar.xz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="alpha amd64 arm hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~amd64-fbsd ~x86-fbsd ~x86-freebsd ~amd64-linux ~arm-linux ~x86-linux ~x64-macos ~x86-macos"
+IUSE=""
+
+RDEPEND=">=dev-scheme/guile-1.8
+ dev-libs/libxml2"
+DEPEND="${RDEPEND}"
+
+src_install() {
+ default
+ dodoc NOTES TODO
+ rm "${ED}"/usr/share/autogen/libopts-*.tar.gz || die
+}
diff --git a/sys-devel/autogen/autogen-5.17.3.ebuild b/sys-devel/autogen/autogen-5.17.3.ebuild
new file mode 100644
index 00000000000..8ce71dd46b5
--- /dev/null
+++ b/sys-devel/autogen/autogen-5.17.3.ebuild
@@ -0,0 +1,38 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+inherit eutils autotools
+
+DESCRIPTION="Program and text file generation"
+HOMEPAGE="http://www.gnu.org/software/autogen/"
+SRC_URI="mirror://gnu/${PN}/rel${PV}/${P}.tar.xz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~x86-freebsd ~amd64-linux ~arm-linux ~x86-linux ~x64-macos ~x86-macos"
+IUSE="libopts"
+
+RDEPEND=">=dev-scheme/guile-1.8
+ dev-libs/libxml2"
+DEPEND="${RDEPEND}"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${P}-libintl.patch #466462
+ eautoreconf
+}
+
+src_configure() {
+ # suppress possibly incorrect -R flag
+ export ag_cv_test_ldflags=
+ default
+}
+
+src_install() {
+ default
+ if ! use libopts ; then
+ rm "${ED}"/usr/share/autogen/libopts-*.tar.gz || die
+ fi
+}
diff --git a/sys-devel/autogen/autogen-5.17.4.ebuild b/sys-devel/autogen/autogen-5.17.4.ebuild
new file mode 100644
index 00000000000..ca1f5e4013f
--- /dev/null
+++ b/sys-devel/autogen/autogen-5.17.4.ebuild
@@ -0,0 +1,36 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+inherit eutils
+
+DESCRIPTION="Program and text file generation"
+HOMEPAGE="http://www.gnu.org/software/autogen/"
+SRC_URI="mirror://gnu/${PN}/rel${PV}/${P}.tar.xz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~x86-freebsd ~amd64-linux ~arm-linux ~x86-linux ~x64-macos ~x86-macos"
+IUSE="libopts static-libs"
+
+RDEPEND=">=dev-scheme/guile-1.8
+ dev-libs/libxml2"
+DEPEND="${RDEPEND}"
+
+src_configure() {
+ # suppress possibly incorrect -R flag
+ export ag_cv_test_ldflags=
+
+ econf $(use_enable static-libs static)
+}
+
+src_install() {
+ default
+ prune_libtool_files
+
+ if ! use libopts ; then
+ rm "${ED}"/usr/share/autogen/libopts-*.tar.gz || die
+ fi
+}
diff --git a/sys-devel/autogen/autogen-5.18.1.ebuild b/sys-devel/autogen/autogen-5.18.1.ebuild
new file mode 100644
index 00000000000..e36302bbe12
--- /dev/null
+++ b/sys-devel/autogen/autogen-5.18.1.ebuild
@@ -0,0 +1,36 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+inherit eutils
+
+DESCRIPTION="Program and text file generation"
+HOMEPAGE="http://www.gnu.org/software/autogen/"
+SRC_URI="mirror://gnu/${PN}/rel${PV}/${P}.tar.xz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~amd64-fbsd ~x86-fbsd ~x86-freebsd ~amd64-linux ~arm-linux ~x86-linux ~x64-macos ~x86-macos"
+IUSE="libopts static-libs"
+
+RDEPEND=">=dev-scheme/guile-1.8
+ dev-libs/libxml2"
+DEPEND="${RDEPEND}"
+
+src_configure() {
+ # suppress possibly incorrect -R flag
+ export ag_cv_test_ldflags=
+
+ econf $(use_enable static-libs static)
+}
+
+src_install() {
+ default
+ prune_libtool_files
+
+ if ! use libopts ; then
+ rm "${ED}"/usr/share/autogen/libopts-*.tar.gz || die
+ fi
+}
diff --git a/sys-devel/autogen/autogen-5.18.2.ebuild b/sys-devel/autogen/autogen-5.18.2.ebuild
new file mode 100644
index 00000000000..f2baf581988
--- /dev/null
+++ b/sys-devel/autogen/autogen-5.18.2.ebuild
@@ -0,0 +1,36 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+inherit eutils
+
+DESCRIPTION="Program and text file generation"
+HOMEPAGE="http://www.gnu.org/software/autogen/"
+SRC_URI="mirror://gnu/${PN}/rel${PV}/${P}.tar.xz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~x86-freebsd ~amd64-linux ~arm-linux ~x86-linux ~x64-macos ~x86-macos"
+IUSE="libopts static-libs"
+
+RDEPEND=">=dev-scheme/guile-1.8
+ dev-libs/libxml2"
+DEPEND="${RDEPEND}"
+
+src_configure() {
+ # suppress possibly incorrect -R flag
+ export ag_cv_test_ldflags=
+
+ econf $(use_enable static-libs static)
+}
+
+src_install() {
+ default
+ prune_libtool_files
+
+ if ! use libopts ; then
+ rm "${ED}"/usr/share/autogen/libopts-*.tar.gz || die
+ fi
+}
diff --git a/sys-devel/autogen/autogen-5.18.4.ebuild b/sys-devel/autogen/autogen-5.18.4.ebuild
new file mode 100644
index 00000000000..df1eb8c7e23
--- /dev/null
+++ b/sys-devel/autogen/autogen-5.18.4.ebuild
@@ -0,0 +1,36 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+inherit eutils
+
+DESCRIPTION="Program and text file generation"
+HOMEPAGE="http://www.gnu.org/software/autogen/"
+SRC_URI="mirror://gnu/${PN}/rel${PV}/${P}.tar.xz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~amd64-fbsd ~x86-fbsd ~x86-freebsd ~amd64-linux ~arm-linux ~x86-linux ~x64-macos ~x86-macos"
+IUSE="libopts static-libs"
+
+RDEPEND=">=dev-scheme/guile-1.8
+ dev-libs/libxml2"
+DEPEND="${RDEPEND}"
+
+src_configure() {
+ # suppress possibly incorrect -R flag
+ export ag_cv_test_ldflags=
+
+ econf $(use_enable static-libs static)
+}
+
+src_install() {
+ default
+ prune_libtool_files
+
+ if ! use libopts ; then
+ rm "${ED}"/usr/share/autogen/libopts-*.tar.gz || die
+ fi
+}
diff --git a/sys-devel/autogen/files/autogen-5.17.3-libintl.patch b/sys-devel/autogen/files/autogen-5.17.3-libintl.patch
new file mode 100644
index 00000000000..e251a0f8c0b
--- /dev/null
+++ b/sys-devel/autogen/files/autogen-5.17.3-libintl.patch
@@ -0,0 +1,12 @@
+https://bugs.gentoo.org/466462
+
+--- a/config/libopts.m4
++++ b/config/libopts.m4
+@@ -106,6 +106,7 @@ AC_DEFUN([INVOKE_LIBOPTS_MACROS_FIRST],[
+ # AC_CHECK_LIB for SVR4 libgen, and use it if it defines pathfind.
+ # ----------------------------------------------------------------------
+ AC_CHECK_LIB(gen, pathfind)
++ AC_SEARCH_LIBS([gettext], [intl])
+ AC_FUNC_VPRINTF
+ AC_FUNC_FORK
+ AC_CHECK_FUNCS([mmap canonicalize_file_name snprintf strdup strchr \
diff --git a/sys-devel/autogen/metadata.xml b/sys-devel/autogen/metadata.xml
new file mode 100644
index 00000000000..8402ea8050f
--- /dev/null
+++ b/sys-devel/autogen/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>toolchain</herd>
+<use>
+ <flag name='libopts'>install the libopts tarball (a few packages want this for developing)</flag>
+</use>
+</pkgmetadata>
diff --git a/sys-devel/automake-wrapper/automake-wrapper-10.ebuild b/sys-devel/automake-wrapper/automake-wrapper-10.ebuild
new file mode 100644
index 00000000000..e8c37d3b8a3
--- /dev/null
+++ b/sys-devel/automake-wrapper/automake-wrapper-10.ebuild
@@ -0,0 +1,35 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+DESCRIPTION="wrapper for automake to manage multiple automake versions"
+HOMEPAGE="http://www.gentoo.org/"
+SRC_URI=""
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~ppc-aix ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~x64-freebsd ~x86-freebsd ~hppa-hpux ~ia64-hpux ~x86-interix ~amd64-linux ~arm-linux ~ia64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE=""
+
+S=${WORKDIR}
+
+src_unpack() {
+ cp "${FILESDIR}"/am-wrapper-${PV}.sh "${S}"/ || die
+}
+
+src_prepare() {
+ # usr/bin/aclocal: bad substitution -> /bin/sh != POSIX shell
+ if use prefix ; then
+ sed -i -e '1c\#!'"${EPREFIX}"'/bin/sh' \
+ "${S}"/am-wrapper-${PV}.sh || die
+ fi
+}
+
+src_install() {
+ newbin "${S}"/am-wrapper-${PV}.sh automake
+ dosym automake /usr/bin/aclocal
+
+ keepdir /usr/share/aclocal
+}
diff --git a/sys-devel/automake-wrapper/automake-wrapper-9.ebuild b/sys-devel/automake-wrapper/automake-wrapper-9.ebuild
new file mode 100644
index 00000000000..bd107fa332f
--- /dev/null
+++ b/sys-devel/automake-wrapper/automake-wrapper-9.ebuild
@@ -0,0 +1,29 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+DESCRIPTION="wrapper for automake to manage multiple automake versions"
+HOMEPAGE="http://www.gentoo.org/"
+SRC_URI=""
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~ppc-aix ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~x64-freebsd ~x86-freebsd ~hppa-hpux ~ia64-hpux ~x86-interix ~amd64-linux ~arm-linux ~ia64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE=""
+
+S=${WORKDIR}
+
+src_unpack() {
+ cp "${FILESDIR}"/am-wrapper-${PV}.sh "${S}"/
+ # usr/bin/aclocal: bad substitution -> /bin/sh != POSIX shell
+ if use prefix ; then
+ sed -i -e '1c\#!'"${EPREFIX}"'/bin/sh' "${S}"/am-wrapper-${PV}.sh || die
+ fi
+}
+
+src_install() {
+ newbin "${S}"/am-wrapper-${PV}.sh automake || die
+ dosym automake /usr/bin/aclocal
+
+ keepdir /usr/share/aclocal
+}
diff --git a/sys-devel/automake-wrapper/files/am-wrapper-10.sh b/sys-devel/automake-wrapper/files/am-wrapper-10.sh
new file mode 100644
index 00000000000..4302a7a4d25
--- /dev/null
+++ b/sys-devel/automake-wrapper/files/am-wrapper-10.sh
@@ -0,0 +1,187 @@
+#!/bin/sh
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+# Executes the correct automake version.
+#
+# If WANT_AUTOMAKE is set (can be a whitespace delimited list of versions):
+# - attempt to find an installed version using those
+# - if magic keyword 'latest' is found, pick the latest version that exists
+# - if nothing found, warn, and proceed as if WANT_AUTOMAKE was not set (below)
+# If WANT_AUTOMAKE is not set:
+# - Try to detect the version of automake used to generate things (look at
+# Makefile.in and aclocal.m4 and any other useful file)
+# - If detected version is not found, warn and proceed as if blank slate
+# - Try to locate the latest version of automake that exists and run it
+
+(set -o posix) 2>/dev/null && set -o posix
+
+_stderr() { printf 'am-wrapper: %s: %b\n' "${argv0}" "$*" 1>&2; }
+warn() { _stderr "warning: $*"; }
+err() { _stderr "error: $*"; exit 1; }
+unset IFS
+which() {
+ local p
+ IFS=: # we don't use IFS anywhere, so don't bother saving/restoring
+ for p in ${PATH} ; do
+ p="${p}/$1"
+ [ -e "${p}" ] && echo "${p}" && return 0
+ done
+ unset IFS
+ return 1
+}
+
+#
+# Sanitize argv[0] since it isn't always a full path #385201
+#
+argv0=${0##*/}
+case $0 in
+ ${argv0})
+ # find it in PATH
+ if ! full_argv0=$(which "${argv0}") ; then
+ err "could not locate ${argv0}; file a bug"
+ fi
+ ;;
+ *)
+ # re-use full/relative paths
+ full_argv0=$0
+ ;;
+esac
+
+if ! seq 0 0 2>/dev/null 1>&2 ; then #338518
+ seq() {
+ local f l i
+ case $# in
+ 1) f=1 i=1 l=$1;;
+ 2) f=$1 i=1 l=$2;;
+ 3) f=$1 i=$2 l=$3;;
+ esac
+ while :; do
+ [ $l -lt $f -a $i -gt 0 ] && break
+ [ $f -lt $l -a $i -lt 0 ] && break
+ echo $f
+ : $(( f += i ))
+ done
+ return 0
+ }
+fi
+
+#
+# Set up bindings between actual version and WANT_AUTOMAKE;
+# Start with last known versions to speed up lookup process.
+#
+LAST_KNOWN_AUTOMAKE_VER="15"
+vers=$(printf '1.%s ' `seq ${LAST_KNOWN_AUTOMAKE_VER} -1 4`)
+
+#
+# Helper to scan for a usable program based on version.
+#
+binary=
+all_vers=
+find_binary() {
+ local v
+ all_vers="${all_vers} $*" # For error messages.
+ for v ; do
+ if [ -x "${full_argv0}-${v}" ] ; then
+ binary="${full_argv0}-${v}"
+ binary_ver=${v}
+ return 0
+ fi
+ done
+ return 1
+}
+
+#
+# Try and find a usable automake version. First check the WANT_AUTOMAKE
+# setting (whitespace delimited list), then fallback to the latest.
+#
+find_latest() {
+ if ! find_binary ${vers} ; then
+ # Brute force it.
+ find_binary $(printf '1.%s ' `seq 99 -1 ${LAST_KNOWN_AUTOMAKE_VER}`)
+ fi
+}
+for wx in ${WANT_AUTOMAKE:-latest} ; do
+ if [ "${wx}" = "latest" ] ; then
+ find_latest && break
+ else
+ find_binary ${wx} && break
+ fi
+done
+
+if [ -z "${binary}" ] && [ -n "${WANT_AUTOMAKE}" ] ; then
+ warn "could not locate installed version for WANT_AUTOMAKE='${WANT_AUTOMAKE}'; ignoring"
+ unset WANT_AUTOMAKE
+ find_latest
+fi
+
+if [ -z "${binary}" ] ; then
+ err "Unable to locate any usuable version of automake.\n" \
+ "\tI tried these versions:${all_vers}\n" \
+ "\tWith a base name of '${full_argv0}'."
+fi
+
+#
+# autodetect helpers
+#
+do_awk() {
+ local file=$1 ; shift
+ local v=$(awk -v regex="$*" '{
+ if (ret = match($0, regex)) {
+ s = substr($0, ret, RLENGTH)
+ ret = match(s, "[0-9]\\.[0-9]+")
+ print substr(s, ret, RLENGTH)
+ exit
+ }
+ }' "${file}")
+ case " ${auto_vers} " in
+ *" ${v} "*) ;;
+ *) auto_vers="${auto_vers:+${auto_vers} }${v}" ;;
+ esac
+}
+
+#
+# autodetect routine
+#
+if [ -z "${WANT_AUTOMAKE}" ] ; then
+ auto_vers=
+ if [ -r "Makefile.in" ] ; then
+ do_awk Makefile.in '^# Makefile.in generated (automatically )?by automake [0-9]\\.[0-9]+'
+ fi
+ if [ -r "aclocal.m4" ] ; then
+ do_awk aclocal.m4 'generated automatically by aclocal [0-9]\\.[0-9]+'
+ do_awk aclocal.m4 '[[:space:]]*\\[?AM_AUTOMAKE_VERSION\\(\\[?[0-9]\\.[0-9]+[^)]*\\]?\\)'
+ fi
+ # We don't need to set $binary here as it has already been setup for us
+ # earlier to the latest available version.
+ if [ -n "${auto_vers}" ] ; then
+ if ! find_binary ${auto_vers} ; then
+ warn "auto-detected versions not found (${auto_vers}); falling back to latest available"
+ fi
+ fi
+fi
+
+if [ -n "${WANT_AMWRAPPER_DEBUG}" ] ; then
+ if [ -n "${WANT_AUTOMAKE}" ] ; then
+ warn "DEBUG: WANT_AUTOMAKE is set to ${WANT_AUTOMAKE}"
+ fi
+ warn "DEBUG: will execute <${binary}>"
+fi
+
+#
+# for further consistency
+#
+export WANT_AUTOMAKE="${binary_ver}"
+
+#
+# Now try to run the binary
+#
+if [ ! -x "${binary}" ] ; then
+ # this shouldn't happen
+ err "${binary} is missing or not executable.\n" \
+ "\tPlease try installing the correct version of automake."
+fi
+
+exec "${binary}" "$@"
+# The shell will error out if `exec` failed.
diff --git a/sys-devel/automake-wrapper/files/am-wrapper-9.sh b/sys-devel/automake-wrapper/files/am-wrapper-9.sh
new file mode 100755
index 00000000000..6342625ba65
--- /dev/null
+++ b/sys-devel/automake-wrapper/files/am-wrapper-9.sh
@@ -0,0 +1,187 @@
+#!/bin/sh
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+# Executes the correct automake version.
+#
+# If WANT_AUTOMAKE is set (can be a whitespace delimited list of versions):
+# - attempt to find an installed version using those
+# - if magic keyword 'latest' is found, pick the latest version that exists
+# - if nothing found, warn, and proceed as if WANT_AUTOMAKE was not set (below)
+# If WANT_AUTOMAKE is not set:
+# - Try to detect the version of automake used to generate things (look at
+# Makefile.in and aclocal.m4 and any other useful file)
+# - If detected version is not found, warn and proceed as if blank slate
+# - Try to locate the latest version of automake that exists and run it
+
+(set -o posix) 2>/dev/null && set -o posix
+
+_stderr() { printf 'am-wrapper: %s: %b\n' "${argv0}" "$*" 1>&2; }
+warn() { _stderr "warning: $*"; }
+err() { _stderr "error: $*"; exit 1; }
+unset IFS
+which() {
+ local p
+ IFS=: # we don't use IFS anywhere, so don't bother saving/restoring
+ for p in ${PATH} ; do
+ p="${p}/$1"
+ [ -e "${p}" ] && echo "${p}" && return 0
+ done
+ unset IFS
+ return 1
+}
+
+#
+# Sanitize argv[0] since it isn't always a full path #385201
+#
+argv0=${0##*/}
+case $0 in
+ ${argv0})
+ # find it in PATH
+ if ! full_argv0=$(which "${argv0}") ; then
+ err "could not locate ${argv0}; file a bug"
+ fi
+ ;;
+ *)
+ # re-use full/relative paths
+ full_argv0=$0
+ ;;
+esac
+
+if ! seq 0 0 2>/dev/null 1>&2 ; then #338518
+ seq() {
+ local f l i
+ case $# in
+ 1) f=1 i=1 l=$1;;
+ 2) f=$1 i=1 l=$2;;
+ 3) f=$1 i=$2 l=$3;;
+ esac
+ while :; do
+ [ $l -lt $f -a $i -gt 0 ] && break
+ [ $f -lt $l -a $i -lt 0 ] && break
+ echo $f
+ : $(( f += i ))
+ done
+ return 0
+ }
+fi
+
+#
+# Set up bindings between actual version and WANT_AUTOMAKE;
+# Start with last known versions to speed up lookup process.
+#
+LAST_KNOWN_AUTOMAKE_VER="14"
+vers=$(printf '1.%s ' `seq ${LAST_KNOWN_AUTOMAKE_VER} -1 4`)
+
+#
+# Helper to scan for a usable program based on version.
+#
+binary=
+all_vers=
+find_binary() {
+ local v
+ all_vers="${all_vers} $*" # For error messages.
+ for v ; do
+ if [ -x "${full_argv0}-${v}" ] ; then
+ binary="${full_argv0}-${v}"
+ binary_ver=${v}
+ return 0
+ fi
+ done
+ return 1
+}
+
+#
+# Try and find a usable automake version. First check the WANT_AUTOMAKE
+# setting (whitespace delimited list), then fallback to the latest.
+#
+find_latest() {
+ if ! find_binary ${vers} ; then
+ # Brute force it.
+ find_binary $(printf '1.%s ' `seq 99 -1 ${LAST_KNOWN_AUTOMAKE_VER}`)
+ fi
+}
+for wx in ${WANT_AUTOMAKE:-latest} ; do
+ if [ "${wx}" = "latest" ] ; then
+ find_latest && break
+ else
+ find_binary ${wx} && break
+ fi
+done
+
+if [ -z "${binary}" ] && [ -n "${WANT_AUTOMAKE}" ] ; then
+ warn "could not locate installed version for WANT_AUTOMAKE='${WANT_AUTOMAKE}'; ignoring"
+ unset WANT_AUTOMAKE
+ find_latest
+fi
+
+if [ -z "${binary}" ] ; then
+ err "Unable to locate any usuable version of automake.\n" \
+ "\tI tried these versions:${all_vers}\n" \
+ "\tWith a base name of '${full_argv0}'."
+fi
+
+#
+# autodetect helpers
+#
+do_awk() {
+ local file=$1 ; shift
+ local v=$(awk -v regex="$*" '{
+ if (ret = match($0, regex)) {
+ s = substr($0, ret, RLENGTH)
+ ret = match(s, "[0-9]\\.[0-9]+")
+ print substr(s, ret, RLENGTH)
+ exit
+ }
+ }' "${file}")
+ case " ${auto_vers} " in
+ *" ${v} "*) ;;
+ *) auto_vers="${auto_vers:+${auto_vers} }${v}" ;;
+ esac
+}
+
+#
+# autodetect routine
+#
+if [ -z "${WANT_AUTOMAKE}" ] ; then
+ auto_vers=
+ if [ -r "Makefile.in" ] ; then
+ do_awk Makefile.in '^# Makefile.in generated (automatically )?by automake [0-9]\\.[0-9]+'
+ fi
+ if [ -r "aclocal.m4" ] ; then
+ do_awk aclocal.m4 'generated automatically by aclocal [0-9]\\.[0-9]+'
+ do_awk aclocal.m4 '[[:space:]]*\\[?AM_AUTOMAKE_VERSION\\(\\[?[0-9]\\.[0-9]+[^)]*\\]?\\)'
+ fi
+ # We don't need to set $binary here as it has already been setup for us
+ # earlier to the latest available version.
+ if [ -n "${auto_vers}" ] ; then
+ if ! find_binary ${auto_vers} ; then
+ warn "auto-detected versions not found (${auto_vers}); falling back to latest available"
+ fi
+ fi
+fi
+
+if [ -n "${WANT_AMWRAPPER_DEBUG}" ] ; then
+ if [ -n "${WANT_AUTOMAKE}" ] ; then
+ warn "DEBUG: WANT_AUTOMAKE is set to ${WANT_AUTOMAKE}"
+ fi
+ warn "DEBUG: will execute <${binary}>"
+fi
+
+#
+# for further consistency
+#
+export WANT_AUTOMAKE="${binary_ver}"
+
+#
+# Now try to run the binary
+#
+if [ ! -x "${binary}" ] ; then
+ # this shouldn't happen
+ err "${binary} is missing or not executable.\n" \
+ "\tPlease try installing the correct version of automake."
+fi
+
+exec "${binary}" "$@"
+# The shell will error out if `exec` failed.
diff --git a/sys-devel/automake-wrapper/metadata.xml b/sys-devel/automake-wrapper/metadata.xml
new file mode 100644
index 00000000000..96a2d586367
--- /dev/null
+++ b/sys-devel/automake-wrapper/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>base-system</herd>
+</pkgmetadata>
diff --git a/sys-devel/automake/Manifest b/sys-devel/automake/Manifest
new file mode 100644
index 00000000000..e680d52f733
--- /dev/null
+++ b/sys-devel/automake/Manifest
@@ -0,0 +1,12 @@
+DIST automake-1.10.3.tar.bz2 957505 SHA256 e98ab43bb839c31696a4202e5b6ff388b391659ef2387cf9365019fad17e1adc SHA512 4f4172c53f31103a93baa794bb498c8b42c1a06e5e0c909063863cdfee3f768016bdecf46e64417a8e362d4c524907b48c0c1b24f510d26aa66bcfd85d0b2598 WHIRLPOOL 6c1b915b87012fab9c7323843ff69a33cc3bdc71d5bcb4ec743b8e8ab34be46dc8a8b72fd41b805f4ad2c723640c9d2b74cdf39355295022219a1138e28794b2
+DIST automake-1.11.6.tar.xz 1092908 SHA256 1ffbc6cc41f0ea6c864fbe9485b981679dc5e350f6c4bc6c3512f5a4226936b5 SHA512 6e4cdf69f07734954f770fd4a7211a8c9dc69fe25a7746bd3c1e01d3139c94cab2900399e87371548833e99687e0d2b59c5e746ab2fdfbc7d47f2c1d439137ba WHIRLPOOL 79b45d6e1dbdb5df5d17fef318bf38d83896fc91d532c8814fa96144409c53f976ca26c6fcb9baab215b289afcdd177a8ada455af99926d27861950a993438c2
+DIST automake-1.12.6.tar.xz 1400336 SHA256 f834ab2145b1ee24bd85387950044f5cb418dd0af2b84c52e60c2bf29162dbfa SHA512 ddcd664ef8f52a44c0adbe908e3a5a2844d8768932211d75dedf262827ffa411b5c3599f93a212f1c979108122cd14bbea5e672218596dd7c934a25d805aae5c WHIRLPOOL 025be98b482fdaa5453b55c00a061cb92bde0ec794599c9e4fa615706e853e26c912b569e364e853437d2494b86a78e30229e868e889685791aead8f38ebe56b
+DIST automake-1.13.4.tar.xz 1449608 SHA256 89ce4933f59b8f0c20115c39cfe450a595cca74ede27b6881e88ec27720d1d66 SHA512 c9b145c1b822a4d83f2899f4280a76ccae932301b273f4c9718dc7f53161aa03dc1be2c1fb1a61083c54186e1908ae2c8284250aa1d8f6dea484767aca1344d3 WHIRLPOOL b2c8e06135adb956d67ddf15e56d514e697e8881f4e2d95055fbad1d723c54bf9e73cea81eca9bb5c58ed39b4a709a0906913dbcc1d8fd87dfbfa0bdb1abad33
+DIST automake-1.14.1.tar.xz 1488984 SHA256 a9b4f04b8b69cac2e832a38a718943aa976dbdad0097211f8b3448afdacf0669 SHA512 5de971159dfca2ec74c3c9a2f1368331efc437b146d675740c8735fcb0d32a30d0560fd29df64c3279efdf9278152c82a9ff09040b3e64d84743aaf25b26ce69 WHIRLPOOL 916ac13c419ecf2fc8acfe8edcbc33b85cfed2a355f6614bec3ba79dc0dce8c1309be26702ef5dc2453ed84e4315b585524a2d7563b851493750118e4298fedc
+DIST automake-1.15.tar.xz 1496708 SHA256 9908c75aabd49d13661d6dcb1bc382252d22cc77bf733a2d55e87f2aa2db8636 SHA512 200a13f49a3f492ed27bc2eb615aa2f47e775e470a781f6821cd43e0f7b927d091e690b4a23fe5cc8fa79c48daaa9436be4b968784696c3bdbf1634b456cda47 WHIRLPOOL 5c7878f46fd3d0104b5fa6a17f985d5cb57ac4a1c956763953acce411756a94b3e8e3b5a701f28c0a4b8c3cd60d60ab34561ae88706e6ccc54f0d76e1174502c
+DIST automake-1.4-p6.tar.gz 375060 SHA256 503cdc2b0992a4309545d17f462cb15f99bb57b7161dfc4082b2e7188f2bcc0f SHA512 3f3235e68ab6703668deac015926124c7eeeea6925e830c6820cb156f15f8ee3febd0fd0cc2ab4f4b5c405b528e4ce12b2459347f62ed6a1a862bc9969163d9e WHIRLPOOL 2f685ec2f0952d58f313c80c3d7d272734e58c10dfc5dde32331281b55ac4e3b06b820e188239c98ec8703229414f9621f1ce7f241fe17ff4e564b84f21e5b2e
+DIST automake-1.5.tar.gz 526934 SHA256 24b4775e3143fd3e35db5cbaba80845d9359c7bfd751a6cebe3014fbf6115d78 SHA512 b9dbece18935b6c08f7d17c456b0359a17362dc030692629cf5d66db675e46a5f24d60dfd20a50780e4096163454f1922d4281c4bb7af336d61e527b579e3bfc WHIRLPOOL a61e8adf6c728e3dabb3e5faa22501d2bc3c78b0ae17bc68ff826f9c350137ad276e01a18a86f079e0bf57fc8d0628160db2e36a0935d703a7fa7d5857dae1df
+DIST automake-1.6.3.tar.bz2 476275 SHA256 0dbafacaf21e135cab35d357a14bdcd981d2f2d00e1387801be8091a31b7bb81 SHA512 8407ea7d51a238622326d89c22777050c2a49d456e3e33c53985f40e4108094ef149693568d926cd1e9b2ddbdb5693c0d0ec6220e0f7bbae4341b6be9f0d060f WHIRLPOOL 168792f008830e2a25b40e0773acfeebdd483f64e83bb595be5e55da69fecf99e1b8b7b15ff82e8f80a3ae0694ccde331c907c33632389a18483fbbe59670c57
+DIST automake-1.7.9.tar.bz2 577705 SHA256 32c13b6ad38ed5e7bfd1756cbc19cf5efd67b7ade2d06000a4c99b0ce94bd46d SHA512 372f326cdf9c893a016473b959f0d3b92a7a82a13978e3950a887a79c93856a635549ebc63945faafba30b8be6db1c4cd68385f7dfe1cbb36386400acb2aa7a2 WHIRLPOOL 0536bec58cc4fa2ed739ba473443099f1f4a33b5cb61f9fb04c4901baa694643debd3028c8acd764b1609f439b67c02c6b4ed6e1e8b34a5f09d2280d896345a7
+DIST automake-1.8.5.tar.bz2 663182 SHA256 84c93aaa3c3651a9e7474b721b0e6788318592509e7de604bafe4ea8049dc410 SHA512 862f9fe8dd4f0fd51b97d80b767304b982d9c9307bf66933298187bf121f5c827f0b4880eab92f07d16e0c1d41ff5179923c7ae8d8aabd635db8574d4a3021b0 WHIRLPOOL 6328e298a4af1bbe2ca360f380064b6a1b43c9cf9c361c3dc4078297c3bf77c0bfe3690b1d9f2713ad2f28970f033880b40f4b077d5734c0e03bd35aa4bb18e3
+DIST automake-1.9.6.tar.bz2 765505 SHA256 8eccaa98e1863d10e4a5f861d8e2ec349a23e88cb12ad10f6b6f79022ad2bb8d SHA512 6aa8824876003bcac804e88d58f014a2449c7e1d824e46b5e971d3e2d070bc6ac0a3881e8eaae12e2f7f310c6b81dfb83ad4647d58785fc7e6759aa37478784e WHIRLPOOL 76d59f947a2dfad4ca70c888d58b15f86670f0df6156b9f1e9f2ed03ad92468ad880ab47b505b31577b35b376a799b6de0ebab46f17516440772a1d3eb6b7479
diff --git a/sys-devel/automake/automake-1.10.3-r1.ebuild b/sys-devel/automake/automake-1.10.3-r1.ebuild
new file mode 100644
index 00000000000..0e474712678
--- /dev/null
+++ b/sys-devel/automake/automake-1.10.3-r1.ebuild
@@ -0,0 +1,82 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+inherit eutils
+
+DESCRIPTION="Used to generate Makefile.in from Makefile.am"
+HOMEPAGE="http://www.gnu.org/software/automake/"
+SRC_URI="mirror://gnu/${PN}/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+# Use Gentoo versioning for slotting.
+SLOT="${PV:0:4}"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd"
+IUSE=""
+
+RDEPEND="dev-lang/perl
+ >=sys-devel/automake-wrapper-9
+ >=sys-devel/autoconf-2.69
+ sys-devel/gnuconfig"
+DEPEND="${RDEPEND}
+ sys-apps/help2man"
+
+src_prepare() {
+ export WANT_AUTOCONF=2.5
+ epatch "${FILESDIR}"/${PN}-1.10-perl-5.16.patch #424453
+ chmod a+rx tests/*.test
+}
+
+src_configure() {
+ econf --docdir=/usr/share/doc/${PF}
+}
+
+# slot the info pages. do this w/out munging the source so we don't have
+# to depend on texinfo to regen things. #464146 (among others)
+slot_info_pages() {
+ pushd "${D}"/usr/share/info >/dev/null
+ rm -f dir
+
+ # Rewrite all the references to other pages.
+ # before: * aclocal-invocation: (automake)aclocal Invocation. Generating aclocal.m4.
+ # after: * aclocal-invocation v1.13: (automake-1.13)aclocal Invocation. Generating aclocal.m4.
+ local p pages=( *.info ) args=()
+ for p in "${pages[@]/%.info}" ; do
+ args+=(
+ -e "/START-INFO-DIR-ENTRY/,/END-INFO-DIR-ENTRY/s|: (${p})| v${SLOT}&|"
+ -e "s:(${p}):(${p}-${SLOT}):g"
+ )
+ done
+ sed -i "${args[@]}" * || die
+
+ # Rewrite all the file references, and rename them in the process.
+ local f d
+ for f in * ; do
+ d=${f/.info/-${SLOT}.info}
+ mv "${f}" "${d}" || die
+ sed -i -e "s:${f}:${d}:g" * || die
+ done
+
+ popd >/dev/null
+}
+
+src_install() {
+ default
+ slot_info_pages
+
+ # SLOT the docs and junk
+ local x
+ for x in aclocal automake ; do
+ help2man "perl -Ilib ${x}" > ${x}-${SLOT}.1
+ doman ${x}-${SLOT}.1
+ rm -f "${D}"/usr/bin/${x}
+ done
+
+ # remove all config.guess and config.sub files replacing them
+ # w/a symlink to a specific gnuconfig version
+ for x in guess sub ; do
+ dosym ../gnuconfig/config.${x} /usr/share/${PN}-${SLOT}/config.${x}
+ done
+}
diff --git a/sys-devel/automake/automake-1.11.6-r1.ebuild b/sys-devel/automake/automake-1.11.6-r1.ebuild
new file mode 100644
index 00000000000..81b62dbdcb2
--- /dev/null
+++ b/sys-devel/automake/automake-1.11.6-r1.ebuild
@@ -0,0 +1,90 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+inherit eutils
+
+DESCRIPTION="Used to generate Makefile.in from Makefile.am"
+HOMEPAGE="http://www.gnu.org/software/automake/"
+SRC_URI="mirror://gnu/${PN}/${P}.tar.xz"
+
+LICENSE="GPL-2"
+# Use Gentoo versioning for slotting.
+SLOT="${PV:0:4}"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd"
+IUSE=""
+
+RDEPEND="dev-lang/perl
+ >=sys-devel/automake-wrapper-9
+ >=sys-devel/autoconf-2.69
+ sys-devel/gnuconfig"
+DEPEND="${RDEPEND}
+ sys-apps/help2man"
+
+src_prepare() {
+ export WANT_AUTOCONF=2.5
+ epatch "${FILESDIR}"/${PN}-1.10-perl-5.16.patch #424453
+ chmod a+rx tests/*.test
+}
+
+src_configure() {
+ econf --docdir=/usr/share/doc/${PF} HELP2MAN=true
+}
+
+src_compile() {
+ emake APIVERSION="${SLOT}" pkgvdatadir="/usr/share/${PN}-${SLOT}"
+
+ local x
+ for x in aclocal automake; do
+ help2man "perl -Ilib ${x}" > doc/${x}-${SLOT}.1
+ done
+}
+
+# slot the info pages. do this w/out munging the source so we don't have
+# to depend on texinfo to regen things. #464146 (among others)
+slot_info_pages() {
+ pushd "${D}"/usr/share/info >/dev/null
+ rm -f dir
+
+ # Rewrite all the references to other pages.
+ # before: * aclocal-invocation: (automake)aclocal Invocation. Generating aclocal.m4.
+ # after: * aclocal-invocation v1.13: (automake-1.13)aclocal Invocation. Generating aclocal.m4.
+ local p pages=( *.info ) args=()
+ for p in "${pages[@]/%.info}" ; do
+ args+=(
+ -e "/START-INFO-DIR-ENTRY/,/END-INFO-DIR-ENTRY/s|: (${p})| v${SLOT}&|"
+ -e "s:(${p}):(${p}-${SLOT}):g"
+ )
+ done
+ sed -i "${args[@]}" * || die
+
+ # Rewrite all the file references, and rename them in the process.
+ local f d
+ for f in * ; do
+ d=${f/.info/-${SLOT}.info}
+ mv "${f}" "${d}" || die
+ sed -i -e "s:${f}:${d}:g" * || die
+ done
+
+ popd >/dev/null
+}
+
+src_install() {
+ emake DESTDIR="${D}" install \
+ APIVERSION="${SLOT}" pkgvdatadir="/usr/share/${PN}-${SLOT}"
+ slot_info_pages
+ dodoc NEWS README THANKS TODO AUTHORS ChangeLog
+
+ rm \
+ "${D}"/usr/bin/{aclocal,automake} \
+ "${D}"/usr/share/man/man1/{aclocal,automake}.1 || die
+
+ # remove all config.guess and config.sub files replacing them
+ # w/a symlink to a specific gnuconfig version
+ local x
+ for x in guess sub ; do
+ dosym ../gnuconfig/config.${x} /usr/share/${PN}-${SLOT}/config.${x}
+ done
+}
diff --git a/sys-devel/automake/automake-1.12.6.ebuild b/sys-devel/automake/automake-1.12.6.ebuild
new file mode 100644
index 00000000000..a3380b0f319
--- /dev/null
+++ b/sys-devel/automake/automake-1.12.6.ebuild
@@ -0,0 +1,85 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+inherit eutils
+
+DESCRIPTION="Used to generate Makefile.in from Makefile.am"
+HOMEPAGE="http://www.gnu.org/software/automake/"
+SRC_URI="mirror://gnu/${PN}/${P}.tar.xz"
+
+LICENSE="GPL-2"
+# Use Gentoo versioning for slotting.
+SLOT="${PV:0:4}"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd"
+IUSE=""
+
+RDEPEND="dev-lang/perl
+ >=sys-devel/automake-wrapper-9
+ >=sys-devel/autoconf-2.69
+ sys-devel/gnuconfig"
+DEPEND="${RDEPEND}
+ sys-apps/help2man"
+
+src_prepare() {
+ export WANT_AUTOCONF=2.5
+}
+
+src_configure() {
+ econf --docdir=/usr/share/doc/${PF} HELP2MAN=true
+}
+
+src_compile() {
+ emake APIVERSION="${SLOT}" pkgvdatadir="/usr/share/${PN}-${SLOT}"
+}
+
+# slot the info pages. do this w/out munging the source so we don't have
+# to depend on texinfo to regen things. #464146 (among others)
+slot_info_pages() {
+ pushd "${D}"/usr/share/info >/dev/null
+ rm -f dir
+
+ # Rewrite all the references to other pages.
+ # before: * aclocal-invocation: (automake)aclocal Invocation. Generating aclocal.m4.
+ # after: * aclocal-invocation v1.13: (automake-1.13)aclocal Invocation. Generating aclocal.m4.
+ local p pages=( *.info ) args=()
+ for p in "${pages[@]/%.info}" ; do
+ args+=(
+ -e "/START-INFO-DIR-ENTRY/,/END-INFO-DIR-ENTRY/s|: (${p})| v${SLOT}&|"
+ -e "s:(${p}):(${p}-${SLOT}):g"
+ )
+ done
+ sed -i "${args[@]}" * || die
+
+ # Rewrite all the file references, and rename them in the process.
+ local f d
+ for f in * ; do
+ d=${f/.info/-${SLOT}.info}
+ mv "${f}" "${d}" || die
+ sed -i -e "s:${f}:${d}:g" * || die
+ done
+
+ popd >/dev/null
+}
+
+src_install() {
+ emake DESTDIR="${D}" install \
+ APIVERSION="${SLOT}" pkgvdatadir="/usr/share/${PN}-${SLOT}"
+ slot_info_pages
+ rm "${D}"/usr/share/aclocal/README || die
+ rmdir "${D}"/usr/share/aclocal || die
+ dodoc AUTHORS ChangeLog NEWS README THANKS
+
+ rm \
+ "${D}"/usr/bin/{aclocal,automake} \
+ "${D}"/usr/share/man/man1/{aclocal,automake}.1 || die
+
+ # remove all config.guess and config.sub files replacing them
+ # w/a symlink to a specific gnuconfig version
+ local x
+ for x in guess sub ; do
+ dosym ../gnuconfig/config.${x} /usr/share/${PN}-${SLOT}/config.${x}
+ done
+}
diff --git a/sys-devel/automake/automake-1.13.4.ebuild b/sys-devel/automake/automake-1.13.4.ebuild
new file mode 100644
index 00000000000..fe894df0427
--- /dev/null
+++ b/sys-devel/automake/automake-1.13.4.ebuild
@@ -0,0 +1,90 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+inherit eutils
+
+DESCRIPTION="Used to generate Makefile.in from Makefile.am"
+HOMEPAGE="http://www.gnu.org/software/automake/"
+SRC_URI="mirror://gnu/${PN}/${P}.tar.xz"
+
+LICENSE="GPL-2"
+# Use Gentoo versioning for slotting.
+SLOT="${PV:0:4}"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd"
+IUSE=""
+
+RDEPEND="dev-lang/perl
+ >=sys-devel/automake-wrapper-9
+ >=sys-devel/autoconf-2.69
+ sys-devel/gnuconfig"
+DEPEND="${RDEPEND}
+ sys-apps/help2man"
+
+src_prepare() {
+ export WANT_AUTOCONF=2.5
+ epatch "${FILESDIR}"/${PN}-1.13-dyn-ithreads.patch
+}
+
+src_configure() {
+ econf --docdir=/usr/share/doc/${PF} HELP2MAN=true
+}
+
+src_compile() {
+ emake APIVERSION="${SLOT}" pkgvdatadir="/usr/share/${PN}-${SLOT}"
+}
+
+src_test() {
+ emake check
+}
+
+# slot the info pages. do this w/out munging the source so we don't have
+# to depend on texinfo to regen things. #464146 (among others)
+slot_info_pages() {
+ pushd "${D}"/usr/share/info >/dev/null
+ rm -f dir
+
+ # Rewrite all the references to other pages.
+ # before: * aclocal-invocation: (automake)aclocal Invocation. Generating aclocal.m4.
+ # after: * aclocal-invocation v1.13: (automake-1.13)aclocal Invocation. Generating aclocal.m4.
+ local p pages=( *.info ) args=()
+ for p in "${pages[@]/%.info}" ; do
+ args+=(
+ -e "/START-INFO-DIR-ENTRY/,/END-INFO-DIR-ENTRY/s|: (${p})| v${SLOT}&|"
+ -e "s:(${p}):(${p}-${SLOT}):g"
+ )
+ done
+ sed -i "${args[@]}" * || die
+
+ # Rewrite all the file references, and rename them in the process.
+ local f d
+ for f in * ; do
+ d=${f/.info/-${SLOT}.info}
+ mv "${f}" "${d}" || die
+ sed -i -e "s:${f}:${d}:g" * || die
+ done
+
+ popd >/dev/null
+}
+
+src_install() {
+ emake DESTDIR="${D}" install \
+ APIVERSION="${SLOT}" pkgvdatadir="/usr/share/${PN}-${SLOT}"
+ slot_info_pages
+ rm "${D}"/usr/share/aclocal/README || die
+ rmdir "${D}"/usr/share/aclocal || die
+ dodoc AUTHORS ChangeLog NEWS README THANKS
+
+ rm \
+ "${D}"/usr/bin/{aclocal,automake} \
+ "${D}"/usr/share/man/man1/{aclocal,automake}.1 || die
+
+ # remove all config.guess and config.sub files replacing them
+ # w/a symlink to a specific gnuconfig version
+ local x
+ for x in guess sub ; do
+ dosym ../gnuconfig/config.${x} /usr/share/${PN}-${SLOT}/config.${x}
+ done
+}
diff --git a/sys-devel/automake/automake-1.14.1.ebuild b/sys-devel/automake/automake-1.14.1.ebuild
new file mode 100644
index 00000000000..4f9142b0e7d
--- /dev/null
+++ b/sys-devel/automake/automake-1.14.1.ebuild
@@ -0,0 +1,102 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+inherit eutils versionator
+
+if [[ ${PV/_beta} == ${PV} ]]; then
+ MY_P=${P}
+ SRC_URI="mirror://gnu/${PN}/${P}.tar.xz
+ ftp://alpha.gnu.org/pub/gnu/${PN}/${MY_P}.tar.xz"
+else
+ MY_PV="$(get_major_version).$(($(get_version_component_range 2)-1))b"
+ MY_P="${PN}-${MY_PV}"
+
+ # Alpha/beta releases are not distributed on the usual mirrors.
+ SRC_URI="ftp://alpha.gnu.org/pub/gnu/${PN}/${MY_P}.tar.xz"
+fi
+
+DESCRIPTION="Used to generate Makefile.in from Makefile.am"
+HOMEPAGE="http://www.gnu.org/software/automake/"
+
+LICENSE="GPL-2"
+# Use Gentoo versioning for slotting.
+SLOT="${PV:0:4}"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd"
+IUSE=""
+
+RDEPEND="dev-lang/perl
+ >=sys-devel/automake-wrapper-9
+ >=sys-devel/autoconf-2.69
+ sys-devel/gnuconfig"
+DEPEND="${RDEPEND}
+ sys-apps/help2man"
+
+S="${WORKDIR}/${MY_P}"
+
+src_prepare() {
+ export WANT_AUTOCONF=2.5
+}
+
+src_configure() {
+ econf --docdir=/usr/share/doc/${PF} HELP2MAN=true
+}
+
+src_compile() {
+ emake APIVERSION="${SLOT}" pkgvdatadir="/usr/share/${PN}-${SLOT}"
+}
+
+src_test() {
+ emake check
+}
+
+# slot the info pages. do this w/out munging the source so we don't have
+# to depend on texinfo to regen things. #464146 (among others)
+slot_info_pages() {
+ pushd "${D}"/usr/share/info >/dev/null
+ rm -f dir
+
+ # Rewrite all the references to other pages.
+ # before: * aclocal-invocation: (automake)aclocal Invocation. Generating aclocal.m4.
+ # after: * aclocal-invocation v1.13: (automake-1.13)aclocal Invocation. Generating aclocal.m4.
+ local p pages=( *.info ) args=()
+ for p in "${pages[@]/%.info}" ; do
+ args+=(
+ -e "/START-INFO-DIR-ENTRY/,/END-INFO-DIR-ENTRY/s|: (${p})| v${SLOT}&|"
+ -e "s:(${p}):(${p}-${SLOT}):g"
+ )
+ done
+ sed -i "${args[@]}" * || die
+
+ # Rewrite all the file references, and rename them in the process.
+ local f d
+ for f in * ; do
+ d=${f/.info/-${SLOT}.info}
+ mv "${f}" "${d}" || die
+ sed -i -e "s:${f}:${d}:g" * || die
+ done
+
+ popd >/dev/null
+}
+
+src_install() {
+ emake DESTDIR="${D}" install \
+ APIVERSION="${SLOT}" pkgvdatadir="/usr/share/${PN}-${SLOT}"
+ slot_info_pages
+ rm "${D}"/usr/share/aclocal/README || die
+ rmdir "${D}"/usr/share/aclocal || die
+ dodoc AUTHORS ChangeLog NEWS README THANKS
+
+ rm \
+ "${D}"/usr/bin/{aclocal,automake} \
+ "${D}"/usr/share/man/man1/{aclocal,automake}.1 || die
+
+ # remove all config.guess and config.sub files replacing them
+ # w/a symlink to a specific gnuconfig version
+ local x
+ for x in guess sub ; do
+ dosym ../gnuconfig/config.${x} /usr/share/${PN}-${SLOT}/config.${x}
+ done
+}
diff --git a/sys-devel/automake/automake-1.15.ebuild b/sys-devel/automake/automake-1.15.ebuild
new file mode 100644
index 00000000000..1873aec56c7
--- /dev/null
+++ b/sys-devel/automake/automake-1.15.ebuild
@@ -0,0 +1,102 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+inherit eutils versionator
+
+if [[ ${PV/_beta} == ${PV} ]]; then
+ MY_P=${P}
+ SRC_URI="mirror://gnu/${PN}/${P}.tar.xz
+ ftp://alpha.gnu.org/pub/gnu/${PN}/${MY_P}.tar.xz"
+else
+ MY_PV="$(get_major_version).$(($(get_version_component_range 2)-1))b"
+ MY_P="${PN}-${MY_PV}"
+
+ # Alpha/beta releases are not distributed on the usual mirrors.
+ SRC_URI="ftp://alpha.gnu.org/pub/gnu/${PN}/${MY_P}.tar.xz"
+fi
+
+DESCRIPTION="Used to generate Makefile.in from Makefile.am"
+HOMEPAGE="http://www.gnu.org/software/automake/"
+
+LICENSE="GPL-2"
+# Use Gentoo versioning for slotting.
+SLOT="${PV:0:4}"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd"
+IUSE=""
+
+RDEPEND="dev-lang/perl
+ >=sys-devel/automake-wrapper-10
+ >=sys-devel/autoconf-2.69
+ sys-devel/gnuconfig"
+DEPEND="${RDEPEND}
+ sys-apps/help2man"
+
+S="${WORKDIR}/${MY_P}"
+
+src_prepare() {
+ export WANT_AUTOCONF=2.5
+}
+
+src_configure() {
+ econf --docdir=/usr/share/doc/${PF} HELP2MAN=true
+}
+
+src_compile() {
+ emake APIVERSION="${SLOT}" pkgvdatadir="/usr/share/${PN}-${SLOT}"
+}
+
+src_test() {
+ emake check
+}
+
+# slot the info pages. do this w/out munging the source so we don't have
+# to depend on texinfo to regen things. #464146 (among others)
+slot_info_pages() {
+ pushd "${D}"/usr/share/info >/dev/null
+ rm -f dir
+
+ # Rewrite all the references to other pages.
+ # before: * aclocal-invocation: (automake)aclocal Invocation. Generating aclocal.m4.
+ # after: * aclocal-invocation v1.13: (automake-1.13)aclocal Invocation. Generating aclocal.m4.
+ local p pages=( *.info ) args=()
+ for p in "${pages[@]/%.info}" ; do
+ args+=(
+ -e "/START-INFO-DIR-ENTRY/,/END-INFO-DIR-ENTRY/s|: (${p})| v${SLOT}&|"
+ -e "s:(${p}):(${p}-${SLOT}):g"
+ )
+ done
+ sed -i "${args[@]}" * || die
+
+ # Rewrite all the file references, and rename them in the process.
+ local f d
+ for f in * ; do
+ d=${f/.info/-${SLOT}.info}
+ mv "${f}" "${d}" || die
+ sed -i -e "s:${f}:${d}:g" * || die
+ done
+
+ popd >/dev/null
+}
+
+src_install() {
+ emake DESTDIR="${D}" install \
+ APIVERSION="${SLOT}" pkgvdatadir="/usr/share/${PN}-${SLOT}"
+ slot_info_pages
+ rm "${D}"/usr/share/aclocal/README || die
+ rmdir "${D}"/usr/share/aclocal || die
+ dodoc AUTHORS ChangeLog NEWS README THANKS
+
+ rm \
+ "${D}"/usr/bin/{aclocal,automake} \
+ "${D}"/usr/share/man/man1/{aclocal,automake}.1 || die
+
+ # remove all config.guess and config.sub files replacing them
+ # w/a symlink to a specific gnuconfig version
+ local x
+ for x in guess sub ; do
+ dosym ../gnuconfig/config.${x} /usr/share/${PN}-${SLOT}/config.${x}
+ done
+}
diff --git a/sys-devel/automake/automake-1.4_p6-r2.ebuild b/sys-devel/automake/automake-1.4_p6-r2.ebuild
new file mode 100644
index 00000000000..152ab4955f0
--- /dev/null
+++ b/sys-devel/automake/automake-1.4_p6-r2.ebuild
@@ -0,0 +1,84 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+inherit eutils
+
+MY_P="${P/_/-}"
+DESCRIPTION="Used to generate Makefile.in from Makefile.am"
+HOMEPAGE="http://www.gnu.org/software/automake/"
+SRC_URI="mirror://gnu/${PN}/${MY_P}.tar.gz"
+
+LICENSE="GPL-2"
+# Use Gentoo versioning for slotting.
+SLOT="${PV:0:3}"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~sparc-fbsd ~x86-fbsd"
+IUSE=""
+
+RDEPEND="dev-lang/perl
+ >=sys-devel/automake-wrapper-9
+ >=sys-devel/autoconf-2.69
+ sys-devel/gnuconfig"
+DEPEND="${RDEPEND}"
+
+S=${WORKDIR}/${MY_P}
+
+src_prepare() {
+ export WANT_AUTOCONF=2.5
+ epatch "${FILESDIR}"/${PN}-1.4-nls-nuisances.patch #121151
+ epatch "${FILESDIR}"/${PN}-1.4-libtoolize.patch
+ epatch "${FILESDIR}"/${PN}-1.4-subdirs-89656.patch
+ epatch "${FILESDIR}"/${PN}-1.4-ansi2knr-stdlib.patch
+ epatch "${FILESDIR}"/${PN}-1.4-CVE-2009-4029.patch #295357
+ epatch "${FILESDIR}"/${PN}-1.4-perl-5.11.patch
+ epatch "${FILESDIR}"/${PN}-1.4-perl-dyn-call.patch
+ sed -i 's:error\.test::' tests/Makefile.in #79529
+}
+
+# slot the info pages. do this w/out munging the source so we don't have
+# to depend on texinfo to regen things. #464146 (among others)
+slot_info_pages() {
+ pushd "${D}"/usr/share/info >/dev/null
+ rm -f dir
+
+ # Rewrite all the references to other pages.
+ # before: * aclocal-invocation: (automake)aclocal Invocation. Generating aclocal.m4.
+ # after: * aclocal-invocation v1.13: (automake-1.13)aclocal Invocation. Generating aclocal.m4.
+ local p pages=( *.info ) args=()
+ for p in "${pages[@]/%.info}" ; do
+ args+=(
+ -e "/START-INFO-DIR-ENTRY/,/END-INFO-DIR-ENTRY/s|: (${p})| v${SLOT}&|"
+ -e "s:(${p}):(${p}-${SLOT}):g"
+ )
+ done
+ sed -i "${args[@]}" * || die
+
+ # Rewrite all the file references, and rename them in the process.
+ local f d
+ for f in * ; do
+ d=${f/.info/-${SLOT}.info}
+ mv "${f}" "${d}" || die
+ sed -i -e "s:${f}:${d}:g" * || die
+ done
+
+ popd >/dev/null
+}
+
+src_install() {
+ emake install DESTDIR="${D}" \
+ pkgdatadir=/usr/share/automake-${SLOT} \
+ m4datadir=/usr/share/aclocal-${SLOT}
+ slot_info_pages
+ rm -f "${D}"/usr/bin/{aclocal,automake}
+ dosym automake-${SLOT} /usr/share/automake
+
+ dodoc NEWS README THANKS TODO AUTHORS ChangeLog
+
+ # remove all config.guess and config.sub files replacing them
+ # w/a symlink to a specific gnuconfig version
+ for x in guess sub ; do
+ dosym ../gnuconfig/config.${x} /usr/share/${PN}-${SLOT}/config.${x}
+ done
+}
diff --git a/sys-devel/automake/automake-1.5-r2.ebuild b/sys-devel/automake/automake-1.5-r2.ebuild
new file mode 100644
index 00000000000..7031439fe4c
--- /dev/null
+++ b/sys-devel/automake/automake-1.5-r2.ebuild
@@ -0,0 +1,80 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+inherit eutils
+
+DESCRIPTION="Used to generate Makefile.in from Makefile.am"
+HOMEPAGE="http://www.gnu.org/software/automake/"
+SRC_URI="mirror://gnu/${PN}/${P}.tar.gz"
+
+LICENSE="GPL-2"
+# Use Gentoo versioning for slotting.
+SLOT="${PV:0:3}"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~sparc-fbsd ~x86-fbsd"
+IUSE=""
+
+RDEPEND="dev-lang/perl
+ >=sys-devel/automake-wrapper-9
+ >=sys-devel/autoconf-2.69
+ sys-devel/gnuconfig"
+DEPEND="${RDEPEND}"
+
+src_prepare() {
+ export WANT_AUTOCONF=2.5
+ epatch "${FILESDIR}"/automake-1.4-nls-nuisances.patch #121151
+ epatch "${FILESDIR}"/${P}-target_hook.patch
+ epatch "${FILESDIR}"/${P}-slot.patch
+ epatch "${FILESDIR}"/${P}-test-fixes.patch #79505
+ epatch "${FILESDIR}"/${PN}-1.10-ccnoco-ldflags.patch #203914
+ epatch "${FILESDIR}"/${P}-CVE-2009-4029.patch #295357
+ epatch "${FILESDIR}"/${PN}-1.5-perl-5.11.patch
+}
+
+# slot the info pages. do this w/out munging the source so we don't have
+# to depend on texinfo to regen things. #464146 (among others)
+slot_info_pages() {
+ pushd "${D}"/usr/share/info >/dev/null
+ rm -f dir
+
+ # Rewrite all the references to other pages.
+ # before: * aclocal-invocation: (automake)aclocal Invocation. Generating aclocal.m4.
+ # after: * aclocal-invocation v1.13: (automake-1.13)aclocal Invocation. Generating aclocal.m4.
+ local p pages=( *.info ) args=()
+ for p in "${pages[@]/%.info}" ; do
+ args+=(
+ -e "/START-INFO-DIR-ENTRY/,/END-INFO-DIR-ENTRY/s|: (${p})| v${SLOT}&|"
+ -e "s:(${p}):(${p}-${SLOT}):g"
+ )
+ done
+ sed -i "${args[@]}" * || die
+
+ # Rewrite all the file references, and rename them in the process.
+ local f d
+ for f in * ; do
+ d=${f/.info/-${SLOT}.info}
+ mv "${f}" "${d}" || die
+ sed -i -e "s:${f}:${d}:g" * || die
+ done
+
+ popd >/dev/null
+}
+
+src_install() {
+ default
+ slot_info_pages
+
+ local x
+ for x in aclocal automake ; do
+ mv "${D}"/usr/bin/${x}{,-${SLOT}} || die "rename ${x}"
+ mv "${D}"/usr/share/${x}{,-${SLOT}} || die "move ${x}"
+ done
+
+ # remove all config.guess and config.sub files replacing them
+ # w/a symlink to a specific gnuconfig version
+ for x in guess sub ; do
+ dosym ../gnuconfig/config.${x} /usr/share/${PN}-${SLOT}/config.${x}
+ done
+}
diff --git a/sys-devel/automake/automake-1.6.3-r2.ebuild b/sys-devel/automake/automake-1.6.3-r2.ebuild
new file mode 100644
index 00000000000..3b2a61bd1fe
--- /dev/null
+++ b/sys-devel/automake/automake-1.6.3-r2.ebuild
@@ -0,0 +1,73 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+inherit eutils
+
+DESCRIPTION="Used to generate Makefile.in from Makefile.am"
+HOMEPAGE="http://www.gnu.org/software/automake/"
+SRC_URI="mirror://gnu/${PN}/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+# Use Gentoo versioning for slotting.
+SLOT="${PV:0:3}"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~sparc-fbsd ~x86-fbsd"
+IUSE=""
+
+RDEPEND="dev-lang/perl
+ >=sys-devel/automake-wrapper-9
+ >=sys-devel/autoconf-2.69
+ sys-devel/gnuconfig"
+DEPEND="${RDEPEND}"
+
+src_prepare() {
+ export WANT_AUTOCONF=2.5
+ epatch "${FILESDIR}"/${P}-test-fixes.patch #159557
+ epatch "${FILESDIR}"/${PN}-1.10-ccnoco-ldflags.patch #203914
+ epatch "${FILESDIR}"/${PN}-1.5-CVE-2009-4029.patch #295357
+ epatch "${FILESDIR}"/${PN}-1.5-perl-5.11.patch
+}
+
+# slot the info pages. do this w/out munging the source so we don't have
+# to depend on texinfo to regen things. #464146 (among others)
+slot_info_pages() {
+ pushd "${D}"/usr/share/info >/dev/null
+ rm -f dir
+
+ # Rewrite all the references to other pages.
+ # before: * aclocal-invocation: (automake)aclocal Invocation. Generating aclocal.m4.
+ # after: * aclocal-invocation v1.13: (automake-1.13)aclocal Invocation. Generating aclocal.m4.
+ local p pages=( *.info ) args=()
+ for p in "${pages[@]/%.info}" ; do
+ args+=(
+ -e "/START-INFO-DIR-ENTRY/,/END-INFO-DIR-ENTRY/s|: (${p})| v${SLOT}&|"
+ -e "s:(${p}):(${p}-${SLOT}):g"
+ )
+ done
+ sed -i "${args[@]}" * || die
+
+ # Rewrite all the file references, and rename them in the process.
+ local f d
+ for f in * ; do
+ d=${f/.info/-${SLOT}.info}
+ mv "${f}" "${d}" || die
+ sed -i -e "s:${f}:${d}:g" * || die
+ done
+
+ popd >/dev/null
+}
+
+src_install() {
+ default
+ slot_info_pages
+ rm -f "${D}"/usr/bin/{aclocal,automake}
+
+ # remove all config.guess and config.sub files replacing them
+ # w/a symlink to a specific gnuconfig version
+ local x
+ for x in guess sub ; do
+ dosym ../gnuconfig/config.${x} /usr/share/${PN}-${SLOT}/config.${x}
+ done
+}
diff --git a/sys-devel/automake/automake-1.7.9-r3.ebuild b/sys-devel/automake/automake-1.7.9-r3.ebuild
new file mode 100644
index 00000000000..e8e548874f2
--- /dev/null
+++ b/sys-devel/automake/automake-1.7.9-r3.ebuild
@@ -0,0 +1,76 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+inherit eutils
+
+DESCRIPTION="Used to generate Makefile.in from Makefile.am"
+HOMEPAGE="http://www.gnu.org/software/automake/"
+SRC_URI="mirror://gnu/${PN}/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+# Use Gentoo versioning for slotting.
+SLOT="${PV:0:3}"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~sparc-fbsd ~x86-fbsd"
+IUSE=""
+
+RDEPEND="dev-lang/perl
+ >=sys-devel/automake-wrapper-9
+ >=sys-devel/autoconf-2.69
+ sys-devel/gnuconfig"
+DEPEND="${RDEPEND}"
+
+src_prepare() {
+ export WANT_AUTOCONF=2.5
+ epatch "${FILESDIR}"/${P}-infopage-namechange.patch
+ epatch "${FILESDIR}"/${P}-test-fixes.patch
+ epatch "${FILESDIR}"/${PN}-1.9.6-subst-test.patch #222225
+ epatch "${FILESDIR}"/${P}-libtool-2.patch #257544
+ epatch "${FILESDIR}"/${PN}-1.10-ccnoco-ldflags.patch #203914
+ epatch "${FILESDIR}"/${PN}-1.5-CVE-2009-4029.patch #295357
+ epatch "${FILESDIR}"/${PN}-1.5-perl-5.11.patch
+}
+
+# slot the info pages. do this w/out munging the source so we don't have
+# to depend on texinfo to regen things. #464146 (among others)
+slot_info_pages() {
+ pushd "${D}"/usr/share/info >/dev/null
+ rm -f dir
+
+ # Rewrite all the references to other pages.
+ # before: * aclocal-invocation: (automake)aclocal Invocation. Generating aclocal.m4.
+ # after: * aclocal-invocation v1.13: (automake-1.13)aclocal Invocation. Generating aclocal.m4.
+ local p pages=( *.info ) args=()
+ for p in "${pages[@]/%.info}" ; do
+ args+=(
+ -e "/START-INFO-DIR-ENTRY/,/END-INFO-DIR-ENTRY/s|: (${p})| v${SLOT}&|"
+ -e "s:(${p}):(${p}-${SLOT}):g"
+ )
+ done
+ sed -i "${args[@]}" * || die
+
+ # Rewrite all the file references, and rename them in the process.
+ local f d
+ for f in * ; do
+ d=${f/.info/-${SLOT}.info}
+ mv "${f}" "${d}" || die
+ sed -i -e "s:${f}:${d}:g" * || die
+ done
+
+ popd >/dev/null
+}
+
+src_install() {
+ default
+ slot_info_pages
+ rm -f "${D}"/usr/bin/{aclocal,automake}
+
+ # remove all config.guess and config.sub files replacing them
+ # w/a symlink to a specific gnuconfig version
+ local x
+ for x in guess sub ; do
+ dosym ../gnuconfig/config.${x} /usr/share/${PN}-${SLOT}/config.${x}
+ done
+}
diff --git a/sys-devel/automake/automake-1.8.5-r5.ebuild b/sys-devel/automake/automake-1.8.5-r5.ebuild
new file mode 100644
index 00000000000..c8b0ef23a37
--- /dev/null
+++ b/sys-devel/automake/automake-1.8.5-r5.ebuild
@@ -0,0 +1,76 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+inherit eutils
+
+DESCRIPTION="Used to generate Makefile.in from Makefile.am"
+HOMEPAGE="http://www.gnu.org/software/automake/"
+SRC_URI="mirror://gnu/${PN}/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+# Use Gentoo versioning for slotting.
+SLOT="${PV:0:3}"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~sparc-fbsd ~x86-fbsd"
+IUSE=""
+
+RDEPEND="dev-lang/perl
+ >=sys-devel/automake-wrapper-9
+ >=sys-devel/autoconf-2.69
+ sys-devel/gnuconfig"
+DEPEND="${RDEPEND}"
+
+src_prepare() {
+ export WANT_AUTOCONF=2.5
+ epatch "${FILESDIR}"/${PN}-1.8.2-infopage-namechange.patch
+ epatch "${FILESDIR}"/${P}-test-fixes.patch #159557
+ epatch "${FILESDIR}"/${PN}-1.9.6-aclocal7-test-sleep.patch #197366
+ epatch "${FILESDIR}"/${PN}-1.9.6-subst-test.patch #222225
+ epatch "${FILESDIR}"/${PN}-1.10-ccnoco-ldflags.patch #203914
+ epatch "${FILESDIR}"/${P}-CVE-2009-4029.patch #295357
+ epatch "${FILESDIR}"/${PN}-1.8-perl-5.11.patch
+}
+
+# slot the info pages. do this w/out munging the source so we don't have
+# to depend on texinfo to regen things. #464146 (among others)
+slot_info_pages() {
+ pushd "${D}"/usr/share/info >/dev/null
+ rm -f dir
+
+ # Rewrite all the references to other pages.
+ # before: * aclocal-invocation: (automake)aclocal Invocation. Generating aclocal.m4.
+ # after: * aclocal-invocation v1.13: (automake-1.13)aclocal Invocation. Generating aclocal.m4.
+ local p pages=( *.info ) args=()
+ for p in "${pages[@]/%.info}" ; do
+ args+=(
+ -e "/START-INFO-DIR-ENTRY/,/END-INFO-DIR-ENTRY/s|: (${p})| v${SLOT}&|"
+ -e "s:(${p}):(${p}-${SLOT}):g"
+ )
+ done
+ sed -i "${args[@]}" * || die
+
+ # Rewrite all the file references, and rename them in the process.
+ local f d
+ for f in * ; do
+ d=${f/.info/-${SLOT}.info}
+ mv "${f}" "${d}" || die
+ sed -i -e "s:${f}:${d}:g" * || die
+ done
+
+ popd >/dev/null
+}
+
+src_install() {
+ default
+ slot_info_pages
+ rm -f "${D}"/usr/bin/{aclocal,automake}
+
+ # remove all config.guess and config.sub files replacing them
+ # w/a symlink to a specific gnuconfig version
+ local x
+ for x in guess sub ; do
+ dosym ../gnuconfig/config.${x} /usr/share/${PN}-${SLOT}/config.${x}
+ done
+}
diff --git a/sys-devel/automake/automake-1.9.6-r4.ebuild b/sys-devel/automake/automake-1.9.6-r4.ebuild
new file mode 100644
index 00000000000..acd34c1f391
--- /dev/null
+++ b/sys-devel/automake/automake-1.9.6-r4.ebuild
@@ -0,0 +1,84 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+inherit eutils
+
+DESCRIPTION="Used to generate Makefile.in from Makefile.am"
+HOMEPAGE="http://www.gnu.org/software/automake/"
+SRC_URI="mirror://gnu/${PN}/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+# Use Gentoo versioning for slotting.
+SLOT="${PV:0:3}"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd"
+IUSE=""
+
+RDEPEND="dev-lang/perl
+ >=sys-devel/automake-wrapper-9
+ >=sys-devel/autoconf-2.69
+ >=sys-apps/texinfo-4.7
+ sys-devel/gnuconfig"
+DEPEND="${RDEPEND}
+ sys-apps/help2man"
+
+src_prepare() {
+ export WANT_AUTOCONF=2.5
+ epatch "${FILESDIR}"/${PN}-1.9.6-infopage-namechange.patch
+ epatch "${FILESDIR}"/${P}-include-dir-prefix.patch #107435
+ epatch "${FILESDIR}"/${P}-ignore-comments.patch #126388
+ epatch "${FILESDIR}"/${P}-aclocal7-test-sleep.patch #197366
+ epatch "${FILESDIR}"/${PN}-1.9.6-subst-test.patch #222225
+ epatch "${FILESDIR}"/${PN}-1.10-ccnoco-ldflags.patch #203914
+ epatch "${FILESDIR}"/${PN}-1.8.5-CVE-2009-4029.patch #295357
+ epatch "${FILESDIR}"/${PN}-1.8-perl-5.11.patch
+}
+
+# slot the info pages. do this w/out munging the source so we don't have
+# to depend on texinfo to regen things. #464146 (among others)
+slot_info_pages() {
+ pushd "${D}"/usr/share/info >/dev/null
+ rm -f dir
+
+ # Rewrite all the references to other pages.
+ # before: * aclocal-invocation: (automake)aclocal Invocation. Generating aclocal.m4.
+ # after: * aclocal-invocation v1.13: (automake-1.13)aclocal Invocation. Generating aclocal.m4.
+ local p pages=( *.info ) args=()
+ for p in "${pages[@]/%.info}" ; do
+ args+=(
+ -e "/START-INFO-DIR-ENTRY/,/END-INFO-DIR-ENTRY/s|: (${p})| v${SLOT}&|"
+ -e "s:(${p}):(${p}-${SLOT}):g"
+ )
+ done
+ sed -i "${args[@]}" * || die
+
+ # Rewrite all the file references, and rename them in the process.
+ local f d
+ for f in * ; do
+ d=${f/.info/-${SLOT}.info}
+ mv "${f}" "${d}" || die
+ sed -i -e "s:${f}:${d}:g" * || die
+ done
+
+ popd >/dev/null
+}
+
+src_install() {
+ default
+ slot_info_pages
+
+ local x
+ for x in aclocal automake ; do
+ help2man "perl -Ilib ${x}" > ${x}-${SLOT}.1
+ doman ${x}-${SLOT}.1
+ rm -f "${D}"/usr/bin/${x}
+ done
+
+ # remove all config.guess and config.sub files replacing them
+ # w/a symlink to a specific gnuconfig version
+ for x in guess sub ; do
+ dosym ../gnuconfig/config.${x} /usr/share/${PN}-${SLOT}/config.${x}
+ done
+}
diff --git a/sys-devel/automake/automake-9999.ebuild b/sys-devel/automake/automake-9999.ebuild
new file mode 100644
index 00000000000..3215252aca4
--- /dev/null
+++ b/sys-devel/automake/automake-9999.ebuild
@@ -0,0 +1,91 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+EGIT_REPO_URI="git://git.savannah.gnu.org/${PN}.git
+ http://git.savannah.gnu.org/r/${PN}.git"
+
+inherit eutils git-2
+
+DESCRIPTION="Used to generate Makefile.in from Makefile.am"
+HOMEPAGE="http://www.gnu.org/software/automake/"
+SRC_URI=""
+
+LICENSE="GPL-3"
+# Use Gentoo versioning for slotting.
+SLOT="${PV:0:4}"
+KEYWORDS=""
+IUSE=""
+
+RDEPEND="dev-lang/perl
+ >=sys-devel/automake-wrapper-9
+ >=sys-devel/autoconf-2.69
+ >=sys-apps/texinfo-4.7
+ sys-devel/gnuconfig"
+DEPEND="${RDEPEND}
+ sys-apps/help2man"
+
+src_prepare() {
+ export WANT_AUTOCONF=2.5
+ # Don't try wrapping the autotools this thing runs as it tends
+ # to be a bit esoteric, and the script does `set -e` itself.
+ ./bootstrap.sh
+}
+
+src_configure() {
+ econf --docdir=/usr/share/doc/${PF}
+}
+
+src_test() {
+ emake check
+}
+
+# slot the info pages. do this w/out munging the source so we don't have
+# to depend on texinfo to regen things. #464146 (among others)
+slot_info_pages() {
+ pushd "${D}"/usr/share/info >/dev/null
+ rm -f dir
+
+ # Rewrite all the references to other pages.
+ # before: * aclocal-invocation: (automake)aclocal Invocation. Generating aclocal.m4.
+ # after: * aclocal-invocation v1.13: (automake-1.13)aclocal Invocation. Generating aclocal.m4.
+ local p pages=( *.info ) args=()
+ for p in "${pages[@]/%.info}" ; do
+ args+=(
+ -e "/START-INFO-DIR-ENTRY/,/END-INFO-DIR-ENTRY/s|: (${p})| v${SLOT}&|"
+ -e "s:(${p}):(${p}-${SLOT}):g"
+ )
+ done
+ sed -i "${args[@]}" * || die
+
+ # Rewrite all the file references, and rename them in the process.
+ local f d
+ for f in * ; do
+ d=${f/.info/-${SLOT}.info}
+ mv "${f}" "${d}" || die
+ sed -i -e "s:${f}:${d}:g" * || die
+ done
+
+ popd >/dev/null
+}
+
+src_install() {
+ default
+ slot_info_pages
+
+ # SLOT the docs and junk
+ local x
+ for x in aclocal automake ; do
+ help2man "perl -Ilib ${x}" > ${x}-${SLOT}.1
+ doman ${x}-${SLOT}.1
+ rm -f "${D}"/usr/bin/${x}
+ done
+
+ # remove all config.guess and config.sub files replacing them
+ # w/a symlink to a specific gnuconfig version
+ for x in guess sub ; do
+ dosym ../gnuconfig/config.${x} /usr/share/${PN}-${SLOT}/config.${x}
+ done
+}
diff --git a/sys-devel/automake/files/automake-1.10-ccnoco-ldflags.patch b/sys-devel/automake/files/automake-1.10-ccnoco-ldflags.patch
new file mode 100644
index 00000000000..f48c6304bdc
--- /dev/null
+++ b/sys-devel/automake/files/automake-1.10-ccnoco-ldflags.patch
@@ -0,0 +1,35 @@
+http://bugs.gentoo.org/203914
+
+From 6e86514729c6dccb6213fdde8d93d7061c8108a5 Mon Sep 17 00:00:00 2001
+From: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
+Date: Mon, 7 Jan 2008 21:53:38 +0100
+Subject: [PATCH] Fix ccnoco.test for uncommon LDFLAGS settings.
+
+* tests/ccnoco.test (Mycomp): Use a tighter match for -c -o,
+to avoid matching for example `LDFLAGS=-Wl,--sort-common'.
+* THANKS: Update.
+Report and analysis by Carsten Lohrke and Mike Frysinger.
+---
+ ChangeLog | 7 +++++++
+ THANKS | 1 +
+ tests/ccnoco.test | 6 +++---
+ 3 files changed, 11 insertions(+), 3 deletions(-)
+
+diff --git a/tests/ccnoco.test b/tests/ccnoco.test
+index 8b37fe8..ca75922 100755
+--- a/tests/ccnoco.test
++++ b/tests/ccnoco.test
+@@ -57,8 +57,8 @@ END
+ cat > Mycomp << 'END'
+ #!/bin/sh
+
+-case "$@" in
+- *-c*-o* | *-o*-c*)
++case " "$* in
++ *\ -c*\ -o* | *\ -o*\ -c*)
+ exit 1
+ ;;
+ esac
+--
+1.6.3
+
diff --git a/sys-devel/automake/files/automake-1.10-perl-5.16.patch b/sys-devel/automake/files/automake-1.10-perl-5.16.patch
new file mode 100644
index 00000000000..19fe249e0c0
--- /dev/null
+++ b/sys-devel/automake/files/automake-1.10-perl-5.16.patch
@@ -0,0 +1,128 @@
+https://bugs.gentoo.org/424453
+
+From 6bf58a59a1f3803e57e3f0378aa9344686707b75 Mon Sep 17 00:00:00 2001
+From: Stefano Lattarini <stefano.lattarini@gmail.com>
+Date: Mon, 28 May 2012 13:32:03 +0200
+Subject: [PATCH] aclocal: declare function prototypes, do not use '&' in
+ function calls
+
+This change will also fix automake bug#11543 (from a report by Matt
+Burgess).
+
+* aclocal.in: Declare prototypes for almost all functions early, before
+any actual function definition (but omit the prototype for the dynamically
+generated '&search' function). Add prototypes to any function definition.
+Remove '&' from function invocations (i.e., simply use "func(ARGS..)"
+instead of "&func(ARGS...)").
+* THANKS, NEWS: Update.
+
+Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
+---
+ NEWS | 4 ++++
+ THANKS | 1 +
+ aclocal.in | 42 ++++++++++++++++++++++++++++++++++--------
+ 3 files changed, 39 insertions(+), 8 deletions(-)
+
+diff --git a/aclocal.in b/aclocal.in
+index dfb851b..e8855d5 100644
+--- a/aclocal.in
++++ b/aclocal.in
+@@ -152,8 +152,34 @@ my $erase_me;
+
+ ################################################################
+
++# Prototypes for all subroutines.
++
++sub unlink_tmp (;$);
++sub xmkdir_p ($);
++sub check_acinclude ();
++sub reset_maps ();
++sub install_file ($$);
++sub list_compare (\@\@);
++sub scan_m4_dirs ($@);
++sub scan_m4_files ();
++sub add_macro ($);
++sub scan_configure_dep ($);
++sub add_file ($);
++sub scan_file ($$$);
++sub strip_redundant_includes (%);
++sub trace_used_macros ();
++sub scan_configure ();
++sub write_aclocal ($@);
++sub usage ($);
++sub version ();
++sub handle_acdir_option ($$);
++sub parse_arguments ();
++sub parse_ACLOCAL_PATH ();
++
++################################################################
++
+ # Erase temporary file ERASE_ME. Handle signals.
+-sub unlink_tmp
++sub unlink_tmp (;$)
+ {
+ my ($sig) = @_;
+
+@@ -350,7 +376,7 @@ sub scan_m4_dirs ($@)
+ next if $file eq 'aclocal.m4';
+
+ my $fullfile = File::Spec->canonpath ("$m4dir/$file");
+- &scan_file ($type, $fullfile, 'aclocal');
++ scan_file ($type, $fullfile, 'aclocal');
+ }
+ closedir (DIR);
+ }
+@@ -361,12 +387,12 @@ sub scan_m4_files ()
+ {
+ # First, scan configure.ac. It may contain macro definitions,
+ # or may include other files that define macros.
+- &scan_file (FT_USER, $configure_ac, 'aclocal');
++ scan_file (FT_USER, $configure_ac, 'aclocal');
+
+ # Then, scan acinclude.m4 if it exists.
+ if (-f 'acinclude.m4')
+ {
+- &scan_file (FT_USER, 'acinclude.m4', 'aclocal');
++ scan_file (FT_USER, 'acinclude.m4', 'aclocal');
+ }
+
+ # Finally, scan all files in our search paths.
+@@ -380,7 +406,7 @@ sub scan_m4_files ()
+ my $search = "sub search {\nmy \$found = 0;\n";
+ foreach my $key (reverse sort keys %map)
+ {
+- $search .= ('if (/\b\Q' . $key . '\E(?!\w)/) { & add_macro ("' . $key
++ $search .= ('if (/\b\Q' . $key . '\E(?!\w)/) { add_macro ("' . $key
+ . '"); $found = 1; }' . "\n");
+ }
+ $search .= "return \$found;\n};\n";
+@@ -403,7 +429,7 @@ sub add_macro ($)
+
+ verb "saw macro $macro";
+ $macro_seen{$macro} = 1;
+- &add_file ($map{$macro});
++ add_file ($map{$macro});
+ }
+
+ # scan_configure_dep ($file)
+@@ -465,7 +491,7 @@ sub scan_configure_dep ($)
+ }
+
+ add_macro ($_) foreach (@rlist);
+- &scan_configure_dep ($_) foreach @ilist;
++ scan_configure_dep ($_) foreach @ilist;
+ }
+
+ # add_file ($FILE)
+@@ -931,7 +957,7 @@ EOF
+ }
+
+ # Print version and exit.
+-sub version()
++sub version ()
+ {
+ print <<EOF;
+ aclocal (GNU $PACKAGE) $VERSION
+--
+2.1.3
+
diff --git a/sys-devel/automake/files/automake-1.10.1-tests.patch b/sys-devel/automake/files/automake-1.10.1-tests.patch
new file mode 100644
index 00000000000..02e71949dc2
--- /dev/null
+++ b/sys-devel/automake/files/automake-1.10.1-tests.patch
@@ -0,0 +1,111 @@
+commit eed743342cfa0ff8cc69666243233229e7417f8f
+Author: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
+Date: Wed Jan 30 21:23:16 2008 +0100
+
+ Split instsh2.test, so that only the new part requires non-root.
+
+ * tests/instsh2.test: Split off testing of `install-sh -C' ...
+ * tests/instsh3.test: ... to this new test, requiring non-root.
+ * tests/Makefile.am: Adjust.
+ * THANKS: Update.
+ Report by Theodoros V. Kalamatianos.
+
+diff --git a/tests/Makefile.am b/tests/Makefile.am
+index ec10801..8405c7a 100644
+--- a/tests/Makefile.am
++++ b/tests/Makefile.am
+@@ -293,6 +293,7 @@ install2.test \
+ installdir.test \
+ instsh.test \
+ instsh2.test \
++instsh3.test \
+ instdat.test \
+ instdat2.test \
+ instexec.test \
+diff --git a/tests/Makefile.in b/tests/Makefile.in
+index 6ba81ab..1bcb573 100644
+--- a/tests/Makefile.in
++++ b/tests/Makefile.in
+@@ -442,6 +442,7 @@ install2.test \
+ installdir.test \
+ instsh.test \
+ instsh2.test \
++instsh3.test \
+ instdat.test \
+ instdat2.test \
+ instexec.test \
+diff --git a/tests/instsh2.test b/tests/instsh2.test
+index 17b61ab..f0b729e 100755
+--- a/tests/instsh2.test
++++ b/tests/instsh2.test
+@@ -1,5 +1,5 @@
+ #! /bin/sh
+-# Copyright (C) 2002, 2004, 2006 Free Software Foundation, Inc.
++# Copyright (C) 2002, 2004, 2006, 2008 Free Software Foundation, Inc.
+ #
+ # This program is free software; you can redistribute it and/or modify
+ # it under the terms of the GNU General Public License as published by
+@@ -77,20 +77,6 @@ test -f d3/y
+ ./install-sh -T x d3 && exit 1
+ ./install-sh -T x d4// && exit 1
+
+-# Do not change the timestamps when using -C.
+-echo foo >file
+-./install-sh -C file d1
+-TZ=UTC0 touch -t $old_timestamp d1/file
+-./install-sh -C file d1
+-is_newest file d1/file
+-echo foo1 >file
+-./install-sh -C file d1
+-diff file d1/file
+-# Rights must be updated.
+-./install-sh -C -m 444 file d1
+-test -r d1/file
+-test ! -w d1/file
+-
+ # Ensure that install-sh works with names that include spaces
+ touch 'a b'
+ mkdir 'x y'
+diff --git a/tests/instsh3.test b/tests/instsh3.test
+new file mode 100755
+index 0000000..95b74c7
+--- /dev/null
++++ b/tests/instsh3.test
+@@ -0,0 +1,37 @@
++#! /bin/sh
++# Copyright (C) 2006, 2008 Free Software Foundation, Inc.
++#
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 3, or (at your option)
++# any later version.
++#
++# This program 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 General Public License for more details.
++#
++# You should have received a copy of the GNU General Public License
++# along with this program. If not, see <http://www.gnu.org/licenses/>.
++
++# More install-sh checks: check -C.
++
++required=non-root
++. ./defs || exit 1
++set -e
++
++./install-sh -d d1
++
++# Do not change the timestamps when using -C.
++echo foo >file
++./install-sh -C file d1
++TZ=UTC0 touch -t $old_timestamp d1/file
++./install-sh -C file d1
++is_newest file d1/file
++echo foo1 >file
++./install-sh -C file d1
++diff file d1/file
++# Rights must be updated.
++./install-sh -C -m 444 file d1
++test -r d1/file
++test ! -w d1/file
diff --git a/sys-devel/automake/files/automake-1.10.2-bash4.patch b/sys-devel/automake/files/automake-1.10.2-bash4.patch
new file mode 100644
index 00000000000..01829ce1741
--- /dev/null
+++ b/sys-devel/automake/files/automake-1.10.2-bash4.patch
@@ -0,0 +1,22 @@
+An upstream patch to fix ksh test issues, which also affect bash 4.0
+
+http://bugs.gentoo.org/263068
+http://git.savannah.gnu.org/cgit/automake.git/commit/?h=branch-1-10&id=319305db77dfdcbba3d5a1703c781750affdb20a
+
+2008-12-21 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
+
+ Testsuite fix for ksh.
+ * tests/check10.test: Add ':' as last command in subshell, for
+ zero exit status of the subshell.
+ Missing backport from master reported by Tim Rice.
+
+--- a/tests/check10.test
++++ b/tests/check10.test
+@@ -72,6 +72,7 @@
+ env TESTS="xpass xpass2" $MAKE -e check
+ env TESTS='pass skip xfail' $MAKE -e check
+ $MAKE check
++ :
+ ) >stdout
+ cat stdout
+
diff --git a/sys-devel/automake/files/automake-1.13-dyn-ithreads.patch b/sys-devel/automake/files/automake-1.13-dyn-ithreads.patch
new file mode 100644
index 00000000000..f790e7724c9
--- /dev/null
+++ b/sys-devel/automake/files/automake-1.13-dyn-ithreads.patch
@@ -0,0 +1,59 @@
+https://bugs.gentoo.org/343439
+
+From 182626687f2640609f8eb28ad1b04b078342f2c7 Mon Sep 17 00:00:00 2001
+From: Mike Frysinger <vapier@gentoo.org>
+Date: Sat, 12 Jan 2013 00:19:40 -0500
+Subject: [PATCH] ithreads: use runtime (not configure time) detection of perl
+ threads
+
+I can't imagine the runtime checks being a big runtime penalty, so there
+shouldn't be a need to do the checks at configure check and hardcode the
+result in the generated automake.
+
+With the current system, it means if you change your perl config (build
+perl w/threads, build automake, build perl w/out threads), or deploy a
+compiled automake package on a different system (build had threads, but
+deployed system does not), you get errors when trying to run automake.
+
+So take the logic from configure.ac and move it to the one place where
+PERL_THREADS is used (lib/Automake/Config.in) and do the version/config
+checking at runtime.
+
+* bootstrap.sh (PERL_THREADS): Delete assignment and use in sed.
+* configure.ac (am_cv_prog_PERL_ithreads, PERL_THREADS): Delete all code
+related to these two variables.
+* lib/Automake/Config.in (perl_threads): Initialize to 0, and only set to
+1 if the perl version is at least 5.007_002, and useithreads is in Config.
+
+Copyright-paperwork-exempt: yes
+Signed-off-by: Mike Frysinger <vapier@gentoo.org>
+Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
+---
+ bootstrap.sh | 2 --
+ configure.ac | 26 --------------------------
+ lib/Automake/Config.in | 9 ++++++++-
+ 3 files changed, 8 insertions(+), 29 deletions(-)
+
+diff --git a/lib/Automake/Config.in b/lib/Automake/Config.in
+index fe6ef9d..885e74e 100644
+--- a/lib/Automake/Config.in
++++ b/lib/Automake/Config.in
+@@ -33,7 +33,14 @@ our $PACKAGE_BUGREPORT = '@PACKAGE_BUGREPORT@';
+ our $VERSION = '@VERSION@';
+ our $RELEASE_YEAR = '@RELEASE_YEAR@';
+ our $libdir = '@datadir@/@PACKAGE@-@APIVERSION@';
+-our $perl_threads = @PERL_THREADS@;
++
++our $perl_threads = 0;
++# We need at least this version for CLONE support.
++if (eval { require 5.007_002; })
++ {
++ use Config;
++ $perl_threads = $Config{useithreads};
++ }
+
+ 1;
+
+--
+1.8.0.2
+
diff --git a/sys-devel/automake/files/automake-1.4-CVE-2009-4029.patch b/sys-devel/automake/files/automake-1.4-CVE-2009-4029.patch
new file mode 100644
index 00000000000..42aef8c8e1b
--- /dev/null
+++ b/sys-devel/automake/files/automake-1.4-CVE-2009-4029.patch
@@ -0,0 +1,65 @@
+http://bugs.gentoo.org/295357
+
+(Makefile.in mangled a little for 1.4_p6)
+
+From 449d20aa12e13fefd848604225fc83d0c39c61d0 Mon Sep 17 00:00:00 2001
+From: Jim Meyering <meyering@redhat.com>
+Date: Tue, 1 Dec 2009 22:48:15 +0100
+Subject: [PATCH 1/1] do not put world-writable directories in distribution tarballs
+
+* automake.in (handle_dist_worker): Do not make all directories
+group- or world-writable. Instead, use 755.
+
+Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
+---
+ Makefile.in | 4 ++--
+ automake.in | 4 ++--
+ 4 files changed, 14 insertions(+), 4 deletions(-)
+
+diff --git a/Makefile.in b/Makefile.in
+index 93da407..59eb9f4 100644
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -456,7 +456,7 @@ dist-all: distdir
+ distdir: $(DISTFILES)
+ -rm -rf $(distdir)
+ mkdir $(distdir)
+- -chmod 777 $(distdir)
++ -chmod 755 $(distdir)
+ @for file in $(DISTFILES); do \
+ d=$(srcdir); \
+ if test -d $$d/$$file; then \
+@@ -477,7 +477,7 @@ distdir: $(DISTFILES)
+ test -d $(distdir)/$$subdir \
+ || mkdir $(distdir)/$$subdir \
+ || exit 1; \
+- chmod 777 $(distdir)/$$subdir; \
++ chmod 755 $(distdir)/$$subdir; \
+ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir=../$(distdir) distdir=../$(distdir)/$$subdir distdir) \
+ || exit 1; \
+ fi; \
+diff --git a/automake.in b/automake.in
+index 8eceea7..8f48236 100755
+--- a/automake.in
++++ b/automake.in
+@@ -2336,7 +2336,7 @@ sub handle_dist_worker
+ # Create dist directory.
+ $output_rules .= ("\t-rm -rf \$(distdir)\n"
+ . "\tmkdir \$(distdir)\n"
+- . "\t-chmod 777 \$(distdir)\n");
++ . "\t-chmod 755 \$(distdir)\n");
+ }
+
+ # Only run automake in `dist' target if --include-deps and
+@@ -2468,7 +2468,7 @@ sub handle_dist_worker
+ . "\t" . ' test -d $(distdir)/$$subdir ' . "\\\n"
+ . "\t" . ' || mkdir $(distdir)/$$subdir ' . "\\\n"
+ . "\t" . ' || exit 1; ' . "\\\n"
+- . "\t" . ' chmod 777 $(distdir)/$$subdir; ' . "\\\n"
++ . "\t" . ' chmod 755 $(distdir)/$$subdir; ' . "\\\n"
+ . "\t" . ' (cd $$subdir'
+ . ' && $(MAKE) $(AM_MAKEFLAGS) top_distdir=../$('
+ . (($relative_dir eq '.') ? 'distdir' : 'top_distdir')
+--
+1.6.5.4
+
diff --git a/sys-devel/automake/files/automake-1.4-ansi2knr-stdlib.patch b/sys-devel/automake/files/automake-1.4-ansi2knr-stdlib.patch
new file mode 100644
index 00000000000..78aa2e3d6a3
--- /dev/null
+++ b/sys-devel/automake/files/automake-1.4-ansi2knr-stdlib.patch
@@ -0,0 +1,11 @@
+--- ansi2knr.c.orig 2005-01-30 06:54:09.702046352 -0500
++++ ansi2knr.c 2005-01-30 06:54:17.719827464 -0500
+@@ -132,7 +132,7 @@
+
+ #endif /* not HAVE_CONFIG_H */
+
+-#if STDC_HEADERS
++#if STDC_HEADERS || HAVE_STDLIB_H
+ # include <stdlib.h>
+ #else
+ /*
diff --git a/sys-devel/automake/files/automake-1.4-libtoolize.patch b/sys-devel/automake/files/automake-1.4-libtoolize.patch
new file mode 100644
index 00000000000..d71d66c973c
--- /dev/null
+++ b/sys-devel/automake/files/automake-1.4-libtoolize.patch
@@ -0,0 +1,17 @@
+Patch from redhat/fedora which made it into upstream.
+
+--- automake.in Wed Jul 12 11:40:03 2000
++++ automake.in Thu Nov 9 07:04:46 2000
+@@ -6882,9 +6882,11 @@
+ $suppress = 1;
+
+ # Maybe run libtoolize.
++ @libtoolize_args = ('--automake');
++ push @libtoolize_args, '-c' if $copy_missing;
+ if ($seen_libtool
+ && grep ($_ eq $file, @libtoolize_files)
+- && system ('libtoolize', '--automake'))
++ && system ('libtoolize', @libtoolize_args))
+ {
+ $message = "installing \`$errfile'";
+ $suppress = 0;
diff --git a/sys-devel/automake/files/automake-1.4-nls-nuisances.patch b/sys-devel/automake/files/automake-1.4-nls-nuisances.patch
new file mode 100644
index 00000000000..16aa657c8eb
--- /dev/null
+++ b/sys-devel/automake/files/automake-1.4-nls-nuisances.patch
@@ -0,0 +1,19 @@
+--- configure
++++ configure
+@@ -46,6 +46,16 @@
+ infodir='${prefix}/info'
+ mandir='${prefix}/man'
+
++# NLS nuisances.
++# Only set these to C if already set. These must not be set unconditionally
++# because not all systems understand e.g. LANG=C (notably SCO).
++# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
++# Non-C LC_CTYPE values break the ctype check.
++if test "${LANG+set}" = set; then LANG=C; export LANG; fi
++if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
++if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
++if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi
++
+ # Initialize some other variables.
+ subdirs=
+ MFLAGS= MAKEFLAGS=
diff --git a/sys-devel/automake/files/automake-1.4-perl-5.11.patch b/sys-devel/automake/files/automake-1.4-perl-5.11.patch
new file mode 100644
index 00000000000..f0423a64fbb
--- /dev/null
+++ b/sys-devel/automake/files/automake-1.4-perl-5.11.patch
@@ -0,0 +1,28 @@
+From 375912c466b28a6121d351b9ff5513133a1c7227 Mon Sep 17 00:00:00 2001
+From: Jim Meyering <meyering@redhat.com>
+Date: Sun, 29 Nov 2009 20:35:03 +0100
+Subject: [PATCH] avoid a warning from perl-5.11
+
+* lib/Automake/Wrap.pm (_tab_length): Remove useless use of tr's
+"/d" modifier.
+
+Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
+---
+ ChangeLog | 6 ++++++
+ lib/Automake/Wrap.pm | 2 +-
+ 2 files changed, 7 insertions(+), 1 deletion(-)
+
+--- a/automake.in
++++ b/automake.in
+@@ -5126,7 +5126,7 @@ sub pretty_print_internal
+ # character counts for eight. So we count the number of Tabs and
+ # multiply by 7.
+ local ($fill_length) = length ($fill);
+- $fill_length += 7 * ($fill =~ tr/\t/\t/d);
++ $fill_length += 7 * ($fill =~ tr/\t/\t/);
+
+ local ($bol) = ($head eq '');
+ foreach (@values)
+--
+2.1.3
+
diff --git a/sys-devel/automake/files/automake-1.4-perl-dyn-call.patch b/sys-devel/automake/files/automake-1.4-perl-dyn-call.patch
new file mode 100644
index 00000000000..9a140aa5051
--- /dev/null
+++ b/sys-devel/automake/files/automake-1.4-perl-dyn-call.patch
@@ -0,0 +1,23 @@
+at some point, a perl update broke this syntax. use a newer style that works
+with at least perl-5.16.
+
+--- a/automake.in
++++ b/automake.in
+@@ -983,7 +983,7 @@ sub finish_languages
+
+ # Compute the function name of the finisher and then call it.
+ $name = 'lang_' . $lang . '_finish';
+- do $name ();
++ &$name ();
+ }
+
+ # If the project is entirely C++ or entirely Fortran 77, don't
+@@ -1144,7 +1144,7 @@ sub handle_single_transform_list
+ # Found the language, so see what it says.
+ local ($subr) = 'lang_' . $lang . '_rewrite';
+ # Note: computed subr call.
+- local ($r) = do $subr ($base, $extension);
++ local ($r) = &$subr ($base, $extension);
+ # Skip this entry if we were asked not to process it.
+ next if ! $r;
+
diff --git a/sys-devel/automake/files/automake-1.4-subdirs-89656.patch b/sys-devel/automake/files/automake-1.4-subdirs-89656.patch
new file mode 100644
index 00000000000..7500fc98d9a
--- /dev/null
+++ b/sys-devel/automake/files/automake-1.4-subdirs-89656.patch
@@ -0,0 +1,22 @@
+Patch from redhat/fedora which made it into upstream.
+
+--- automake-1.4-p6/subdirs.am.subdirs 2001-07-16 22:47:36.000000000 -0700
++++ automake-1.4-p6/subdirs.am 2003-04-25 08:24:35.000000000 -0700
+@@ -27,7 +27,7 @@
+ all-recursive install-data-recursive install-exec-recursive \
+ installdirs-recursive install-recursive uninstall-recursive @INSTALLINFO@ \
+ check-recursive installcheck-recursive info-recursive dvi-recursive:
+- @set fnord $(MAKEFLAGS); amf=$$2; \
++ @set fnord $$MAKEFLAGS; amf=$$2; \
+ dot_seen=no; \
+ target=`echo $@ | sed s/-recursive//`; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+@@ -55,7 +55,7 @@ check-recursive installcheck-recursive i
+ ## bombs.
+ mostlyclean-recursive clean-recursive distclean-recursive \
+ maintainer-clean-recursive:
+- @set fnord $(MAKEFLAGS); amf=$$2; \
++ @set fnord $$MAKEFLAGS; amf=$$2; \
+ dot_seen=no; \
+ rev=''; list='$(SUBDIRS)'; for subdir in $$list; do \
+ rev="$$subdir $$rev"; \
diff --git a/sys-devel/automake/files/automake-1.5-CVE-2009-4029.patch b/sys-devel/automake/files/automake-1.5-CVE-2009-4029.patch
new file mode 100644
index 00000000000..d91139b3017
--- /dev/null
+++ b/sys-devel/automake/files/automake-1.5-CVE-2009-4029.patch
@@ -0,0 +1,60 @@
+http://bugs.gentoo.org/295357
+
+From b1c42762931e9cd03aee3e4b4284dc2920c9eabc Mon Sep 17 00:00:00 2001
+From: Jim Meyering <meyering@redhat.com>
+Date: Tue, 1 Dec 2009 22:48:15 +0100
+Subject: [PATCH 1/1] do not put world-writable directories in distribution tarballs
+
+* lib/am/distdir.am (distdir): Do not make all directories
+group- or world-writable. Instead, use 755.
+
+Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
+---
+ Makefile.in | 3 ++-
+ lib/am/distdir.am | 9 +++------
+ 4 files changed, 15 insertions(+), 7 deletions(-)
+
+diff --git a/Makefile.in b/Makefile.in
+index ebbfd2f..76991db 100644
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -379,7 +379,8 @@ distdir: $(DISTFILES)
+ $(MAKE) $(AM_MAKEFLAGS) \
+ top_distdir="${top_distdir}" distdir="$(distdir)" \
+ dist-info
+- -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \
++ -find "$(distdir)" -type d ! -perm -755 \
++ -exec chmod u+rwx,go+rx {} \; -o \
+ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
+ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \
+ ! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \
+diff --git a/lib/am/distdir.am b/lib/am/distdir.am
+index e808966..0a01c4e 100644
+--- a/lib/am/distdir.am
++++ b/lib/am/distdir.am
+@@ -127,11 +127,7 @@ if %?DIST-TARGETS%
+ endif %?DIST-TARGETS%
+ ##
+ ## This complex find command will try to avoid changing the modes of
+-## links into the source tree, in case they're hard-linked. It will
+-## also make directories writable by everybody, because some
+-## brain-dead tar implementations change ownership and permissions of
+-## a directory before extracting the files, thus becoming unable to
+-## extract them.
++## links into the source tree, in case they're hard-linked.
+ ##
+ ## Ignore return result from chmod, because it might give an error
+ ## if we chmod a symlink.
+@@ -144,7 +140,8 @@ endif %?DIST-TARGETS%
+ ## the file in place in the source tree.
+ ##
+ if %?TOPDIR_P%
+- -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \
++ -find "$(distdir)" -type d ! -perm -755 \
++ -exec chmod u+rwx,go+rx {} \; -o \
+ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
+ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \
+ ! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \
+--
+1.6.5.4
+
diff --git a/sys-devel/automake/files/automake-1.5-perl-5.11.patch b/sys-devel/automake/files/automake-1.5-perl-5.11.patch
new file mode 100644
index 00000000000..1ee36468c31
--- /dev/null
+++ b/sys-devel/automake/files/automake-1.5-perl-5.11.patch
@@ -0,0 +1,28 @@
+From 375912c466b28a6121d351b9ff5513133a1c7227 Mon Sep 17 00:00:00 2001
+From: Jim Meyering <meyering@redhat.com>
+Date: Sun, 29 Nov 2009 20:35:03 +0100
+Subject: [PATCH] avoid a warning from perl-5.11
+
+* lib/Automake/Wrap.pm (_tab_length): Remove useless use of tr's
+"/d" modifier.
+
+Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
+---
+ ChangeLog | 6 ++++++
+ lib/Automake/Wrap.pm | 2 +-
+ 2 files changed, 7 insertions(+), 1 deletion(-)
+
+--- a/automake.in
++++ b/automake.in
+@@ -5277,7 +5277,7 @@ sub pretty_print_internal
+ # character counts for eight. So we count the number of Tabs and
+ # multiply by 7.
+ my $fill_length = length ($fill);
+- $fill_length += 7 * ($fill =~ tr/\t/\t/d);
++ $fill_length += 7 * ($fill =~ tr/\t/\t/);
+
+ foreach (@values)
+ {
+--
+2.1.3
+
diff --git a/sys-devel/automake/files/automake-1.5-slot.patch b/sys-devel/automake/files/automake-1.5-slot.patch
new file mode 100644
index 00000000000..348775abe75
--- /dev/null
+++ b/sys-devel/automake/files/automake-1.5-slot.patch
@@ -0,0 +1,42 @@
+--- aclocal.in.orig 2004-10-22 11:11:05.361192040 -0400
++++ aclocal.in 2004-10-22 11:11:45.362110976 -0400
+@@ -33,5 +33,5 @@
+ $prefix = "@prefix@";
+ # Note that this isn't pkgdatadir, but a separate directory.
+-$acdir = "@datadir@/aclocal";
++$acdir = "@datadir@/aclocal-1.5";
+
+ # Some globals.
+@@ -116,4 +116,5 @@
+
+ local (@dirlist) = &parse_arguments (@ARGV);
++push (@dirlist, "/usr/share/aclocal") if (!grep(/^--acdir/, @ARGV));
+ &scan_m4_files (@dirlist);
+ &scan_configure;
+@@ -203,5 +204,5 @@
+ if ($print_and_exit)
+ {
+- print $acdir, "\n";
++ print "/usr/share/aclocal", "\n";
+ exit 0;
+ }
+--- automake.in.orig 2004-10-22 11:14:10.787003032 -0400
++++ automake.in 2004-10-22 11:14:22.072287408 -0400
+@@ -32,7 +32,7 @@
+ BEGIN
+ {
+ my $prefix = "@prefix@";
+- my $perllibdir = $ENV{'perllibdir'} || "@datadir@/@PACKAGE@";
++ my $perllibdir = $ENV{'perllibdir'} || "@datadir@/@PACKAGE@-1.5";
+ unshift @INC, "$perllibdir";
+ }
+
+@@ -127,7 +127,7 @@
+ my $VERSION = "@VERSION@";
+ my $PACKAGE = "@PACKAGE@";
+ my $prefix = "@prefix@";
+-my $libdir = "@datadir@/@PACKAGE@";
++my $libdir = "@datadir@/@PACKAGE@-1.5";
+
+ # String constants.
+ my $IGNORE_PATTERN = '^\s*##([^#\n].*)?\n';
diff --git a/sys-devel/automake/files/automake-1.5-target_hook.patch b/sys-devel/automake/files/automake-1.5-target_hook.patch
new file mode 100644
index 00000000000..6f40cbb67d3
--- /dev/null
+++ b/sys-devel/automake/files/automake-1.5-target_hook.patch
@@ -0,0 +1,36 @@
+diff -C 2 -r -N /tmp/automake-1.5/automake.in automake-1.5/automake.in
+*** /tmp/automake-1.5/automake.in Thu Aug 23 07:26:53 2001
+--- automake-1.5/automake.in Tue Feb 5 20:38:55 2002
+***************
+*** 1941,1945 ****
+
+ # Let the language do some special magic if required.
+! $lang->target_hook ($aggregate, $object, $full);
+
+ if ($derived_source)
+--- 1941,1947 ----
+
+ # Let the language do some special magic if required.
+! if (defined $lang) {
+! $lang->target_hook ($aggregate, $object, $full);
+! }
+
+ if ($derived_source)
+diff -C 2 -r -N /tmp/automake-1.5/m4/depout.m4 automake-1.5/m4/depout.m4
+*** /tmp/automake-1.5/m4/depout.m4 Mon May 14 02:01:09 2001
+--- automake-1.5/m4/depout.m4 Wed Jan 30 22:03:33 2002
+***************
+*** 13,18 ****
+ for mf in $CONFIG_FILES; do
+ case "$mf" in
+! Makefile) dirpart=.;;
+! */Makefile) dirpart=`echo "$mf" | sed -e 's|/[^/]*$||'`;;
+ *) continue;;
+ esac
+--- 13,18 ----
+ for mf in $CONFIG_FILES; do
+ case "$mf" in
+! Makefile|GNUmakefile) dirpart=.;;
+! */Makefile|*/GNUmakefile) dirpart=`echo "$mf" | sed -e 's|/[^/]*$||'`;;
+ *) continue;;
+ esac
diff --git a/sys-devel/automake/files/automake-1.5-test-fixes.patch b/sys-devel/automake/files/automake-1.5-test-fixes.patch
new file mode 100644
index 00000000000..8f34a793e45
--- /dev/null
+++ b/sys-devel/automake/files/automake-1.5-test-fixes.patch
@@ -0,0 +1,65 @@
+Fix the tests so they don't fail :)
+http://bugs.gentoo.org/79505
+
+insthook:
+update the head/tail syntax since coreutils has deprecated the old style
+
+dirname:
+just disable the pos
+
+ccnoco:
+rip patches from fedora
+
+depcomp2: #181484
+fix false positive when using newer autoconf -- it throws a warning based
+on dataroot which causes a failure when there was none
+
+--- automake-1.5/tests/insthook.test
++++ automake-1.5/tests/insthook.test
+@@ -17 +17 @@
+-test x$lnum != x && tail +$lnum Makefile.in | head -3 | grep install-exec-hook
++test x$lnum != x && tail -n +$lnum Makefile.in | head -n 3 | grep install-exec-hook
+--- automake-1.5/tests/dirname.test
++++ automake-1.5/tests/dirname.test
+@@ -1,2 +1,3 @@
+ #! /bin/sh
++exit 0
+
+--- automake-1.5/tests/ccnoco.test
++++ automake-1.5/tests/ccnoco.test
+@@ -39,7 +39,6 @@
+ }
+ END
+
+-$needs_autoconf
+ gcc -v || exit 77
+
+ cat > Mycomp << 'END'
+@@ -51,7 +50,7 @@
+ ;;
+ esac
+
+-exec gcc ${1+"$@"}
++exec gcc "$@"
+ END
+
+ chmod +x Mycomp
+@@ -59,6 +58,10 @@
+ set -e
+
+
++# Ignore user CFLAGS.
++CFLAGS=
++export CFLAGS
++
+ for conf in configure.1 configure.3; do
+ cp $conf configure.in
+
+--- automake-1.5/tests/depcomp2.test
++++ automake-1.5/tests/depcomp2.test
+@@ -17,4 +17,5 @@
+ cat > Makefile.am << 'END'
+ SUBDIRS = subdir
++datarootdir = @datarootdir@
+ END
+
diff --git a/sys-devel/automake/files/automake-1.6.3-test-fixes.patch b/sys-devel/automake/files/automake-1.6.3-test-fixes.patch
new file mode 100644
index 00000000000..666517754a9
--- /dev/null
+++ b/sys-devel/automake/files/automake-1.6.3-test-fixes.patch
@@ -0,0 +1,28 @@
+Fix the tests so they don't fail :)
+
+depcomp2: #159557 #181484
+fix false positive when using newer autoconf -- it throws a warning based
+on dataroot which causes a failure when there was none
+
+man2: #159557
+grab update from newer automake
+
+--- automake-1.6.3/tests/depcomp2.test
++++ automake-1.6.3/tests/depcomp2.test
+@@ -17,4 +17,5 @@
+ cat > Makefile.am << 'END'
+ SUBDIRS = subdir
++datarootdir = @datarootdir@
+ END
+
+--- automake-1.6.3/tests/man2.test
++++ automake-1.6.3/tests/man2.test
+@@ -23,7 +23,7 @@
+ $AUTOMAKE
+
+ # Let's play with $DESTDIR too, it shouldn't hurt.
+-./configure --prefix=''
++./configure --prefix='' --mandir=/man
+ DESTDIR="`pwd`/=inst" $MAKE -e SHELL=/bin/sh install
+
+ test -f ./=inst/man/man2/foo.2
diff --git a/sys-devel/automake/files/automake-1.7.9-infopage-namechange.patch b/sys-devel/automake/files/automake-1.7.9-infopage-namechange.patch
new file mode 100644
index 00000000000..0e6708a5509
--- /dev/null
+++ b/sys-devel/automake/files/automake-1.7.9-infopage-namechange.patch
@@ -0,0 +1,15 @@
+--- Makefile.in 2003-06-30 17:07:30.000000000 +0000
++++ Makefile.in 2003-06-30 17:09:28.000000000 +0000
+@@ -199,8 +199,9 @@
+
+ .texi.info:
+ @rm -f $@ $@-[0-9] $@-[0-9][0-9] $(@:.info=).i[0-9] $(@:.info=).i[0-9][0-9]
+- $(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) \
+- -o $@ `test -f '$<' || echo '$(srcdir)/'`$<
++ cd $(srcdir) \
++ && $(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) \
++ `echo $< | sed 's,.*/,,'`
+
+ .texi.dvi:
+ TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \
+ MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir)' \
diff --git a/sys-devel/automake/files/automake-1.7.9-libtool-2.patch b/sys-devel/automake/files/automake-1.7.9-libtool-2.patch
new file mode 100644
index 00000000000..ad1d75d8caa
--- /dev/null
+++ b/sys-devel/automake/files/automake-1.7.9-libtool-2.patch
@@ -0,0 +1,43 @@
+fixup tests w/libtool-2
+
+https://bugs.gentoo.org/257544
+
+--- automake-1.7.9/tests/libtool5.test
++++ automake-1.7.9/tests/libtool5.test
+@@ -45,5 +45,6 @@
+ END
+
+ libtoolize
++[ -e config.guess ] || libtoolize --install
+ $ACLOCAL
+ $AUTOMAKE
+--- automake-1.7.9/tests/ltcond2.test
++++ automake-1.7.9/tests/ltcond2.test
+@@ -73,6 +73,7 @@
+ echo 'int main() { print(); return 0; }' >main.c
+
+ libtoolize
++[ -e config.guess ] || libtoolize --install
+ $ACLOCAL
+ $AUTOCONF
+ $AUTOMAKE
+--- automake-1.7.9/tests/ltcond.test
++++ automake-1.7.9/tests/ltcond.test
+@@ -62,6 +62,7 @@
+ mkdir empty
+
+ libtoolize
++[ -e config.guess ] || libtoolize --install
+ $ACLOCAL
+ $AUTOCONF
+ $AUTOMAKE
+--- automake-1.7.9/tests/ltconv.test
++++ automake-1.7.9/tests/ltconv.test
+@@ -111,6 +111,7 @@
+ EOF
+
+ libtoolize
++[ -e config.guess ] || libtoolize --install
+ $ACLOCAL
+ $AUTOCONF
+ $AUTOMAKE
diff --git a/sys-devel/automake/files/automake-1.7.9-test-fixes.patch b/sys-devel/automake/files/automake-1.7.9-test-fixes.patch
new file mode 100644
index 00000000000..00854886d66
--- /dev/null
+++ b/sys-devel/automake/files/automake-1.7.9-test-fixes.patch
@@ -0,0 +1,46 @@
+Fix the tests so they don't fail :)
+
+exdir2 man2 transform: #159557 #162565
+grab updates from newer automake
+
+mkdir-tests.m4:
+when mixing newer gettext with this automake, the tests bomb out
+as AM_PROG_MKDIR_P is not provided properly
+
+--- automake-1.7.9/tests/man2.test
++++ automake-1.7.9/tests/man2.test
+@@ -41,7 +41,7 @@
+ $AUTOMAKE
+
+ # Let's play with $DESTDIR too, it shouldn't hurt.
+-./configure --prefix=''
++./configure --prefix='' --mandir=/man
+ DESTDIR="`pwd`/_inst" $MAKE -e install
+
+ test -f ./_inst/man/man2/foo.2
+--- automake-1.7.9/tests/transform.test
++++ automake-1.7.9/tests/transform.test
+@@ -56,7 +56,7 @@
+ $AUTOCONF
+ $AUTOMAKE
+
+-./configure --program-prefix=gnu- --prefix `pwd`/inst
++./configure --program-prefix=gnu- --prefix `pwd`/inst --mandir `pwd`/inst/man
+ $MAKE
+ $MAKE test-install
+ $MAKE uninstall
+--- automake-1.7.9/tests/exdir2.test
++++ automake-1.7.9/tests/exdir2.test
+@@ -23,7 +23,7 @@
+ . ./defs || exit 1
+
+ cat > Makefile.am << 'EOF'
+-html_DATA = zot.html
++quuz_DATA = zot.html
+ pkgdata_DATA = qbert
+ EOF
+
+--- automake-1.7.9/m4/mkdir-tests.m4
++++ automake-1.7.9/m4/mkdir-tests.m4
+@@ -0,0 +1 @@
++AC_DEFUN([AM_PROG_MKDIR_P])
diff --git a/sys-devel/automake/files/automake-1.8-perl-5.11.patch b/sys-devel/automake/files/automake-1.8-perl-5.11.patch
new file mode 100644
index 00000000000..0808174f010
--- /dev/null
+++ b/sys-devel/automake/files/automake-1.8-perl-5.11.patch
@@ -0,0 +1,30 @@
+From 375912c466b28a6121d351b9ff5513133a1c7227 Mon Sep 17 00:00:00 2001
+From: Jim Meyering <meyering@redhat.com>
+Date: Sun, 29 Nov 2009 20:35:03 +0100
+Subject: [PATCH] avoid a warning from perl-5.11
+
+* lib/Automake/Wrap.pm (_tab_length): Remove useless use of tr's
+"/d" modifier.
+
+Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
+---
+ ChangeLog | 6 ++++++
+ lib/Automake/Wrap.pm | 2 +-
+ 2 files changed, 7 insertions(+), 1 deletion(-)
+
+diff --git a/lib/Automake/Wrap.pm b/lib/Automake/Wrap.pm
+index 09a135a..66213d1 100644
+--- a/lib/Automake/Wrap.pm
++++ b/lib/Automake/Wrap.pm
+@@ -55,7 +55,7 @@ sub tab_length($)
+ {
+ my ($txt) = @_;
+ my $len = length ($txt);
+- $len += 7 * ($txt =~ tr/\t/\t/d);
++ $len += 7 * ($txt =~ tr/\t/\t/);
+ return $len;
+ }
+
+--
+2.1.3
+
diff --git a/sys-devel/automake/files/automake-1.8.2-infopage-namechange.patch b/sys-devel/automake/files/automake-1.8.2-infopage-namechange.patch
new file mode 100644
index 00000000000..bc7d58ed35e
--- /dev/null
+++ b/sys-devel/automake/files/automake-1.8.2-infopage-namechange.patch
@@ -0,0 +1,36 @@
+--- automake-1.8.2/doc/Makefile.in 2004-02-03 21:59:01.585999688 +0200
++++ automake-1.8.2.info/doc/Makefile.in 2004-02-03 22:04:03.893042032 +0200
+@@ -175,29 +175,10 @@
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+ .texi.info:
+- restore=: && \
+- backupdir="$(am__leading_dot)am$$$$" && \
+- am__cwd=`pwd` && cd $(srcdir) && \
+- rm -rf $$backupdir && mkdir $$backupdir && \
+- for f in $@ $@-[0-9] $@-[0-9][0-9] $(@:.info=).i[0-9] $(@:.info=).i[0-9][0-9]; do \
+- if test -f $$f; then \
+- mv $$f $$backupdir; \
+- restore=mv; \
+- fi; \
+- done; \
+- cd "$$am__cwd"; \
+- if $(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) \
+- -o $@ $<; \
+- then \
+- rc=0; \
+- cd $(srcdir); \
+- else \
+- rc=$$?; \
+- cd $(srcdir) && \
+- $$restore $$backupdir/* `echo "./$@" | sed 's|[^/]*$$||'`; \
+- fi; \
+- rm -rf $$backupdir; \
+- exit $$rc
++ @rm -f $@ $@-[0-9] $@-[0-9][0-9] $(@:.info=).i[0-9] $(@:.info=).i[0-9][0-9]
++ cd $(srcdir) \
++ && $(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) \
++ `echo $< | sed 's,.*/,,'`
+
+ .texi.dvi:
+ TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \
diff --git a/sys-devel/automake/files/automake-1.8.5-CVE-2009-4029.patch b/sys-devel/automake/files/automake-1.8.5-CVE-2009-4029.patch
new file mode 100644
index 00000000000..9e42e52c80b
--- /dev/null
+++ b/sys-devel/automake/files/automake-1.8.5-CVE-2009-4029.patch
@@ -0,0 +1,60 @@
+http://bugs.gentoo.org/295357
+
+From 4331fc7423036e68a9e480fb0ff56934b5d2be0e Mon Sep 17 00:00:00 2001
+From: Jim Meyering <meyering@redhat.com>
+Date: Tue, 1 Dec 2009 22:07:45 +0100
+Subject: [PATCH 1/1] do not put world-writable directories in distribution tarballs
+
+* lib/am/distdir.am (distdir): Do not make all directories
+group- or world-writable. Instead, use 755.
+
+Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
+---
+ Makefile.in | 3 ++-
+ lib/am/distdir.am | 9 +++------
+ 4 files changed, 17 insertions(+), 8 deletions(-)
+
+diff --git a/Makefile.in b/Makefile.in
+index f6971b4..c753eaa 100644
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -389,7 +389,8 @@ distdir: $(DISTFILES)
+ || exit 1; \
+ fi; \
+ done
+- -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \
++ -find "$(distdir)" -type d ! -perm -755 \
++ -exec chmod u+rwx,go+rx {} \; -o \
+ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
+ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \
+ ! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \
+diff --git a/lib/am/distdir.am b/lib/am/distdir.am
+index 0ed0593..91dbe6b 100644
+--- a/lib/am/distdir.am
++++ b/lib/am/distdir.am
+@@ -190,11 +190,7 @@ if %?DIST-TARGETS%
+ endif %?DIST-TARGETS%
+ ##
+ ## This complex find command will try to avoid changing the modes of
+-## links into the source tree, in case they're hard-linked. It will
+-## also make directories writable by everybody, because some
+-## brain-dead tar implementations change ownership and permissions of
+-## a directory before extracting the files, thus becoming unable to
+-## extract them.
++## links into the source tree, in case they're hard-linked.
+ ##
+ ## Ignore return result from chmod, because it might give an error
+ ## if we chmod a symlink.
+@@ -207,7 +203,8 @@ endif %?DIST-TARGETS%
+ ## the file in place in the source tree.
+ ##
+ if %?TOPDIR_P%
+- -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \
++ -find "$(distdir)" -type d ! -perm -755 \
++ -exec chmod u+rwx,go+rx {} \; -o \
+ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
+ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \
+ ! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \
+--
+1.6.5.4
+
diff --git a/sys-devel/automake/files/automake-1.8.5-test-fixes.patch b/sys-devel/automake/files/automake-1.8.5-test-fixes.patch
new file mode 100644
index 00000000000..43290d1e0d4
--- /dev/null
+++ b/sys-devel/automake/files/automake-1.8.5-test-fixes.patch
@@ -0,0 +1,43 @@
+Fix the tests so they don't fail :)
+
+exdir2 man2 transform: #159557 #162565
+grab updates from newer automake
+
+--- automake-1.8.5/tests/man2.test
++++ automake-1.8.5/tests/man2.test
+@@ -41,7 +41,7 @@
+ $AUTOMAKE
+
+ # Let's play with $DESTDIR too, it shouldn't hurt.
+-./configure --prefix=''
++./configure --prefix='' --mandir=/man
+ DESTDIR="`pwd`/_inst" $MAKE -e install
+
+ test -f ./_inst/man/man2/foo.2
+--- automake-1.8.5/tests/transform.test
++++ automake-1.8.5/tests/transform.test
+@@ -56,7 +56,7 @@
+ $AUTOCONF
+ $AUTOMAKE
+
+-./configure --program-prefix=gnu- --prefix `pwd`/inst
++./configure --program-prefix=gnu- --prefix `pwd`/inst --mandir `pwd`/inst/man
+ $MAKE
+ $MAKE test-install
+ $MAKE uninstall
+--- automake-1.8.5/tests/exdir2.test
++++ automake-1.8.5/tests/exdir2.test
+@@ -25,11 +25,11 @@
+ set -e
+
+ cat > Makefile.am << 'EOF'
+-html_DATA = zot.html
++quuz_DATA = zot.html
+ pkgdata_DATA = qbert
+ EOF
+
+ $ACLOCAL
+ AUTOMAKE_fails
+ grep 'pkgdatadir' stderr && exit 1
+-grep 'Makefile.am:1:.*htmldir.*undefined' stderr
++grep 'Makefile.am:1:.*quuzdir.*undefined' stderr
diff --git a/sys-devel/automake/files/automake-1.9.6-aclocal7-test-sleep.patch b/sys-devel/automake/files/automake-1.9.6-aclocal7-test-sleep.patch
new file mode 100644
index 00000000000..ea2b227b8d4
--- /dev/null
+++ b/sys-devel/automake/files/automake-1.9.6-aclocal7-test-sleep.patch
@@ -0,0 +1,39 @@
+http://bugs.gentoo.org/197366
+
+commit 8952f7248c2637426bcf83d38f07a8b02124a06e
+Author: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
+Date: Wed May 10 20:50:53 2006 +0000
+
+ * tests/aclocal7.test: Add `$sleep's between file touching
+ and automake resp aclocal+automake invocations, to ensure
+ they complete with a time stamp strictly later than the touched
+ file.
+
+diff --git a/tests/aclocal7.test b/tests/aclocal7.test
+index 787565c..f6d5e31 100755
+--- a/tests/aclocal7.test
++++ b/tests/aclocal7.test
+@@ -89,6 +89,7 @@ test `ls -1t sub/Makefile.in foo | sed 1q` = sub/Makefile.in
+ touch fragment.inc
+ $sleep
+ touch foo
++$sleep
+ $ACLOCAL -I m4
+ $AUTOMAKE --no-force
+ # Only ./Makefile.in should change.
+@@ -101,6 +102,7 @@ grep README Makefile.in && exit 1
+ : > README
+ $sleep
+ touch foo
++$sleep
+ $AUTOMAKE --no-force
+ # Even if no dependency change, the content changed.
+ test `ls -1t Makefile.in foo | sed 1q` = Makefile.in
+@@ -111,6 +113,7 @@ grep README Makefile.in
+ : > sub/Makefile.in
+ $sleep
+ touch foo
++$sleep
+ $ACLOCAL -I m4
+ $AUTOMAKE --no-force
+ # Only sub/Makefile.in should change.
diff --git a/sys-devel/automake/files/automake-1.9.6-ignore-comments.patch b/sys-devel/automake/files/automake-1.9.6-ignore-comments.patch
new file mode 100644
index 00000000000..f62987456cf
--- /dev/null
+++ b/sys-devel/automake/files/automake-1.9.6-ignore-comments.patch
@@ -0,0 +1,29 @@
+http://bugs.gentoo.org/126388
+
+2006-03-16 Mike Frysinger <vapier@gentoo.org>
+
+ * aclocal.in (scan_configure_dep): Ignore ## lines.
+ (scan_file): Remove dnl and # comments.
+
+--- aclocal.in
++++ aclocal.in
+@@ -227,6 +227,8 @@
+ foreach (split ("\n", $contents))
+ {
+ ++$line;
++ # Ignore `##' lines.
++ next if /^##/;
+ # Remove comments from current line.
+ s/\bdnl\b.*$//;
+ s/\#.*$//;
+@@ -311,6 +313,10 @@
+
+ $contents .= $_;
+
++ # Remove comments from current line.
++ s/\bdnl\b.*$//;
++ s/\#.*$//;
++
+ while (/$ac_defun_rx/go)
+ {
+ if (! defined $1)
diff --git a/sys-devel/automake/files/automake-1.9.6-include-dir-prefix.patch b/sys-devel/automake/files/automake-1.9.6-include-dir-prefix.patch
new file mode 100644
index 00000000000..a1d62a78e11
--- /dev/null
+++ b/sys-devel/automake/files/automake-1.9.6-include-dir-prefix.patch
@@ -0,0 +1,31 @@
+http://bugs.gentoo.org/107435
+http://lists.gnu.org/archive/html/automake/2005-09/msg00088.html
+
+2005-09-27 Stepan Kasal <address@hidden>
+
+ * automake.in (handle_single_transform): Direct suffix rule preserves
+ the directory prefix, so the generated object name should contain
+ it, too.
+
+--- automake.in 2005-09-17 15:05:39.000000000 +0200
++++ automake.in 2005-09-27 17:10:47.000000000 +0200
+@@ -1755,6 +1755,10 @@
+ # This is probably the result of a direct suffix rule.
+ # In this case we just accept the rewrite.
+ $object = "$base$extension";
++ if ($directory ne '')
++ {
++ $object = $directory . '/' . $object;
++ }
+ $linker = '';
+ }
+ else
+@@ -1824,7 +1828,7 @@
+
+ # For Java, the way we're handling it right now, a
+ # `..' component doesn't make sense.
+- if ($lang->name eq 'java' && $object =~ /(\/|^)\.\.\//)
++ if ($lang && $lang->name eq 'java' && $object =~ /(\/|^)\.\.\//)
+ {
+ err_am "`$full' should not contain a `..' component";
+ }
diff --git a/sys-devel/automake/files/automake-1.9.6-infopage-namechange.patch b/sys-devel/automake/files/automake-1.9.6-infopage-namechange.patch
new file mode 100644
index 00000000000..7870f65e580
--- /dev/null
+++ b/sys-devel/automake/files/automake-1.9.6-infopage-namechange.patch
@@ -0,0 +1,33 @@
+--- doc/Makefile.in.orig 2005-07-11 00:39:31.000000000 -0400
++++ doc/Makefile.in 2005-07-11 00:40:46.000000000 -0400
+@@ -187,26 +187,10 @@
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+ .texi.info:
+- restore=: && backupdir="$(am__leading_dot)am$$$$" && \
+- am__cwd=`pwd` && cd $(srcdir) && \
+- rm -rf $$backupdir && mkdir $$backupdir && \
+- if ($(MAKEINFO) --version) >/dev/null 2>&1; then \
+- for f in $@ $@-[0-9] $@-[0-9][0-9] $(@:.info=).i[0-9] $(@:.info=).i[0-9][0-9]; do \
+- if test -f $$f; then mv $$f $$backupdir; restore=mv; else :; fi; \
+- done; \
+- else :; fi && \
+- cd "$$am__cwd"; \
+- if $(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) \
+- -o $@ $<; \
+- then \
+- rc=0; \
+- cd $(srcdir); \
+- else \
+- rc=$$?; \
+- cd $(srcdir) && \
+- $$restore $$backupdir/* `echo "./$@" | sed 's|[^/]*$$||'`; \
+- fi; \
+- rm -rf $$backupdir; exit $$rc
++ @rm -f $@ $@-[0-9] $@-[0-9][0-9] $(@:.info=).i[0-9] $(@:.info=).i[0-9][0-9]
++ cd $(srcdir) \
++ && $(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) \
++ `echo $< | sed 's,.*/,,'`
+
+ .texi.dvi:
+ TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \
diff --git a/sys-devel/automake/files/automake-1.9.6-subst-test.patch b/sys-devel/automake/files/automake-1.9.6-subst-test.patch
new file mode 100644
index 00000000000..6b794b1e137
--- /dev/null
+++ b/sys-devel/automake/files/automake-1.9.6-subst-test.patch
@@ -0,0 +1,42 @@
+https://bugs.gentoo.org/222225
+
+Patch from automake upstream git-repo to fix "make check" with newer versions of autoconf
+
+From: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
+Date: Sun, 22 Jul 2007 09:06:23 +0000 (+0000)
+Subject: * tests/subst.test: Move the AC_SUBST into a macro definition.
+X-Git-Url: http://git.savannah.gnu.org/gitweb/?p=automake.git;a=commitdiff_plain;h=3d85de7baa9edf21c56401db3d25ef8a8e8d7797
+
+* tests/subst.test: Move the AC_SUBST into a macro definition.
+Avoids an error from CVS Autoconf.
+* THANKS: Update.
+Report by Benoit Sigoure.
+---
+diff --git a/tests/subst.test b/tests/subst.test
+index 33e925d..a72af85 100755
+--- a/tests/subst.test
++++ b/tests/subst.test
+@@ -1,5 +1,5 @@
+ #! /bin/sh
+-# Copyright (C) 1996, 2001, 2002 Free Software Foundation, Inc.
++# Copyright (C) 1996, 2001, 2002, 2007 Free Software Foundation, Inc.
+ #
+ # This file is part of GNU Automake.
+ #
+@@ -24,8 +24,14 @@
+ . ./defs || exit 1
+
+ cat >> configure.in << 'END'
+-AC_SUBST($1)
+-AC_SUBST([$]$1) dnl this is the actual invocation that was used
++dnl This test used to have the following lines, which cannot have
++dnl worked sensibly with Autoconf for years, however:
++dnl AC_SUBST($1)
++dnl AC_SUBST([$]$1) dnl this is the actual invocation that was used
++dnl
++AC_DEFUN([FOO],
++[AC_SUBST([$1])])
++FOO([BAR])
+ END
+
+ : > Makefile.am
diff --git a/sys-devel/automake/metadata.xml b/sys-devel/automake/metadata.xml
new file mode 100644
index 00000000000..96a2d586367
--- /dev/null
+++ b/sys-devel/automake/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>base-system</herd>
+</pkgmetadata>
diff --git a/sys-devel/bc/Manifest b/sys-devel/bc/Manifest
new file mode 100644
index 00000000000..2bf857b81f1
--- /dev/null
+++ b/sys-devel/bc/Manifest
@@ -0,0 +1 @@
+DIST bc-1.06.95.tar.bz2 290069 SHA256 7ee4abbcfac03d8a6e1a8a3440558a3d239d6b858585063e745c760957725ecc SHA512 16ec13f87ef76ad4de77d378ef8d65a582adca1bf661c9d7675e78d940680c77e81a00a01817fde7c1ad1524562d6f933caa5c42a0686f3f85aadbb39393afb1 WHIRLPOOL e91adb7b1fd42c4d47dad76f994c51ee7a8d962a24cb1b0cbeaa992fe1be59878016d5883506ec4153293daf48fbe3f345bb88fbe3f6276b3353c89573a612af
diff --git a/sys-devel/bc/bc-1.06.95-r1.ebuild b/sys-devel/bc/bc-1.06.95-r1.ebuild
new file mode 100644
index 00000000000..f6a27128725
--- /dev/null
+++ b/sys-devel/bc/bc-1.06.95-r1.ebuild
@@ -0,0 +1,52 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="2"
+
+inherit eutils flag-o-matic toolchain-funcs
+
+DESCRIPTION="Handy console-based calculator utility"
+HOMEPAGE="http://www.gnu.org/software/bc/bc.html"
+SRC_URI="mirror://gnu-alpha/bc/${P}.tar.bz2
+ mirror://gnu/bc/${P}.tar.bz2"
+
+LICENSE="GPL-2 LGPL-2.1"
+SLOT="0"
+KEYWORDS="alpha amd64 arm ~arm64 hppa ia64 ~m68k ~mips ppc ppc64 ~s390 ~sh sparc x86 ~ppc-aix ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~x86-freebsd ~ia64-hpux ~x86-interix ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE="libedit readline static"
+
+RDEPEND="readline? ( >=sys-libs/readline-4.1 >=sys-libs/ncurses-5.2 )
+ libedit? ( dev-libs/libedit )"
+DEPEND="${RDEPEND}
+ sys-devel/flex"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${P}-void_uninitialized.patch #349339
+}
+
+src_configure() {
+ local myconf
+ if use readline ; then
+ myconf="--with-readline --without-libedit"
+ elif use libedit ; then
+ myconf="--without-readline --with-libedit"
+ else
+ myconf="--without-readline --without-libedit"
+ fi
+ use static && append-ldflags -static
+ econf ${myconf}
+
+ # Do not regen docs -- configure produces a small fragment that includes
+ # the version info which causes all pages to regen (newer file). #554774
+ touch -r doc doc/*
+}
+
+src_compile() {
+ emake AR="$(tc-getAR)" || die
+}
+
+src_install() {
+ emake install DESTDIR="${D}" || die
+ dodoc AUTHORS FAQ NEWS README ChangeLog
+}
diff --git a/sys-devel/bc/bc-1.06.95-r2.ebuild b/sys-devel/bc/bc-1.06.95-r2.ebuild
new file mode 100644
index 00000000000..70ce7608d80
--- /dev/null
+++ b/sys-devel/bc/bc-1.06.95-r2.ebuild
@@ -0,0 +1,55 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+inherit eutils flag-o-matic toolchain-funcs
+
+DESCRIPTION="Handy console-based calculator utility"
+HOMEPAGE="http://www.gnu.org/software/bc/bc.html"
+SRC_URI="mirror://gnu-alpha/bc/${P}.tar.bz2
+ mirror://gnu/bc/${P}.tar.bz2"
+
+LICENSE="GPL-2 LGPL-2.1"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~x86-freebsd ~ia64-hpux ~x86-interix ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE="libedit readline static"
+
+RDEPEND="!readline? ( libedit? ( dev-libs/libedit:= ) )
+ readline? (
+ >=sys-libs/readline-4.1:0=
+ >=sys-libs/ncurses-5.2:=
+ )"
+DEPEND="${RDEPEND}
+ sys-devel/flex"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${P}-void_uninitialized.patch #349339
+ epatch "${FILESDIR}"/${P}-mem-leak.patch #264889
+}
+
+src_configure() {
+ local libedit
+ if use readline ; then
+ libedit="--without-libedit"
+ else
+ libedit=$(use_with libedit)
+ fi
+ use static && append-ldflags -static
+ # Clobber any CONFIG_SHELL setting the user has forced on us.
+ # We should be able to delete this w/the next release as it
+ # should use updated autoconf.
+ CONFIG_SHELL=/bin/bash \
+ econf \
+ $(use_with readline) \
+ ${libedit}
+
+ # Do not regen docs -- configure produces a small fragment that includes
+ # the version info which causes all pages to regen (newer file). #554774
+ touch -r doc doc/*
+}
+
+src_compile() {
+ emake AR="$(tc-getAR)"
+}
diff --git a/sys-devel/bc/bc-1.06.95.ebuild b/sys-devel/bc/bc-1.06.95.ebuild
new file mode 100644
index 00000000000..17206129c98
--- /dev/null
+++ b/sys-devel/bc/bc-1.06.95.ebuild
@@ -0,0 +1,39 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit eutils flag-o-matic toolchain-funcs
+
+DESCRIPTION="Handy console-based calculator utility"
+HOMEPAGE="http://www.gnu.org/software/bc/bc.html"
+SRC_URI="mirror://gnu-alpha/bc/${P}.tar.bz2
+ mirror://gnu/bc/${P}.tar.bz2"
+
+LICENSE="GPL-2 LGPL-2.1"
+SLOT="0"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~ppc-aix ~sparc-fbsd ~x86-fbsd ~x86-freebsd ~ia64-hpux ~x86-interix ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~x64-solaris ~x86-solaris"
+IUSE="libedit readline static"
+
+RDEPEND="readline? ( >=sys-libs/readline-4.1 >=sys-libs/ncurses-5.2 )
+ libedit? ( dev-libs/libedit )"
+DEPEND="${RDEPEND}
+ sys-devel/flex"
+
+src_compile() {
+ local myconf
+ if use readline ; then
+ myconf="--with-readline --without-libedit"
+ elif use libedit ; then
+ myconf="--without-readline --with-libedit"
+ else
+ myconf="--without-readline --without-libedit"
+ fi
+ use static && append-ldflags -static
+ econf ${myconf} || die
+ emake || die
+}
+
+src_install() {
+ emake install DESTDIR="${D}" || die
+ dodoc AUTHORS FAQ NEWS README ChangeLog
+}
diff --git a/sys-devel/bc/files/bc-1.06.95-mem-leak.patch b/sys-devel/bc/files/bc-1.06.95-mem-leak.patch
new file mode 100644
index 00000000000..13628464b54
--- /dev/null
+++ b/sys-devel/bc/files/bc-1.06.95-mem-leak.patch
@@ -0,0 +1,24 @@
+https://bugs.gentoo.org/264889
+
+--- a/bc/bc.y
++++ b/bc/bc.y
+@@ -569,6 +569,7 @@ expression : named_expression ASSIGN_OP
+ generate (">");
+ break;
+ }
++ free($2);
+ }
+ | expression '+' expression
+ {
+--- a/bc/util.c
++++ b/bc/util.c
+@@ -602,8 +602,7 @@ lookup (name, namekind)
+ case FUNCTDEF:
+ if (id->f_name != 0)
+ {
+- if (namekind != FUNCT)
+- free(name);
++ free(name);
+ /* Check to see if we are redefining a math lib function. */
+ if (use_math && namekind == FUNCTDEF && id->f_name <= 6)
+ id->f_name = next_func++;
diff --git a/sys-devel/bc/files/bc-1.06.95-void_uninitialized.patch b/sys-devel/bc/files/bc-1.06.95-void_uninitialized.patch
new file mode 100644
index 00000000000..3304973f89a
--- /dev/null
+++ b/sys-devel/bc/files/bc-1.06.95-void_uninitialized.patch
@@ -0,0 +1,13 @@
+http://www.pixelbeat.org/programming/oss_bug_flow.html
+https://bugs.gentoo.org/349339
+
+--- bc/storage.c
++++ bc/storage.c
+@@ -99,6 +99,7 @@
+ {
+ f = &functions[indx];
+ f->f_defined = FALSE;
++ f->f_void = FALSE;
+ f->f_body = (char *) bc_malloc (BC_START_SIZE);
+ f->f_body_size = BC_START_SIZE;
+ f->f_code_size = 0;
diff --git a/sys-devel/bc/metadata.xml b/sys-devel/bc/metadata.xml
new file mode 100644
index 00000000000..96a2d586367
--- /dev/null
+++ b/sys-devel/bc/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>base-system</herd>
+</pkgmetadata>
diff --git a/sys-devel/bin86/Manifest b/sys-devel/bin86/Manifest
new file mode 100644
index 00000000000..6755c085bc5
--- /dev/null
+++ b/sys-devel/bin86/Manifest
@@ -0,0 +1,3 @@
+DIST bin86-0.16.20-fix_lilo_build.patch 3488 SHA256 bc735c292880c523e8f2af847852953898faa5b4670fab1012c2114bac472398 SHA512 f307438ced09e34ce5c552f808a9d1ae09bb9bbaceee4e1e07021f810470dfb07d21a30d1447295b2d023ccf56f158f4b7f3d80d478b1d7e3e4b79b13b8e760c WHIRLPOOL 1a12bf35237324cf374496e1032bb6a54aeb5e160934ee185494783fcb93d0616e544ab222ed6a37b3b269377cef72ebcc1a2159ad29c5b4984360cd9b3d6902
+DIST bin86-0.16.20.tar.gz 154107 SHA256 00dcf75f75080b4a51d137f14fe787d8144d12fff0448e08fe696e8909780437 SHA512 c567ad5f9241d9ed768410f988266d4ff952fd4767d033552b100a2643db69ee9d4b5929a1b40c3018db7037b0efc7b47db84fa1f561bc39f01e640b1a3bacfc WHIRLPOOL 028be86ee91f47768837b35b917eaa0ff0231b900a052e15ec3e30574ba76693d8699a186bcef5d4b580a445c152334bc33028b32be60b33c369fb7f12331514
+DIST bin86-0.16.21.tar.gz 154283 SHA256 021e37cde3a20632c4c9000993cb4aa9f58cb82b1d3c26b9aeb62d6566925738 SHA512 e80e06965fbdcf13100aae4690071d01a6efe74aed7ff8f14e5892c6803393a1b5acda1296e0f0e1837dfb73e0edd02e9cccfeabbeabe1b68fa6b6b85ced1f56 WHIRLPOOL ba46856d70f6dacd010307426eefc0c8eeac104f435b18470148145e6ef785d02cbbf7256870922d7b6904f134829950907ae7d4868604d75af9724ec8d4f9d2
diff --git a/sys-devel/bin86/bin86-0.16.20-r2.ebuild b/sys-devel/bin86/bin86-0.16.20-r2.ebuild
new file mode 100644
index 00000000000..63490452f51
--- /dev/null
+++ b/sys-devel/bin86/bin86-0.16.20-r2.ebuild
@@ -0,0 +1,35 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+inherit toolchain-funcs eutils
+
+DESCRIPTION="Assembler and loader used to create kernel bootsector"
+HOMEPAGE="http://v3.sk/~lkundrak/dev86/"
+SRC_URI="http://v3.sk/~lkundrak/dev86/${P}.tar.gz
+ https://github.com/lkundrak/dev86/commit/2c95336f19eeff761ecb858c5a2a58484bb3ceeb.patch -> ${PN}-0.16.20-fix_lilo_build.patch"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 ~ppc ~ppc64 x86 ~amd64-fbsd ~x86-fbsd"
+IUSE=""
+
+src_prepare() {
+ sed -i \
+ -e '/^PREFIX/s:=.*:=$(DESTDIR)/usr:' \
+ -e '/^MANDIR/s:)/man/man1:)/share/man/man1:' \
+ -e '/^INSTALL_OPTS/s:-s::' \
+ -e "/^CFLAGS/s:=.*:=${CFLAGS} -D_POSIX_SOURCE ${CPPFLAGS}:" \
+ -e "/^LDFLAGS/s:=.*:=${LDFLAGS}:" \
+ Makefile || die
+ epatch "${FILESDIR}"/${PN}-0.16.17-amd64-build.patch \
+ "${DISTDIR}"/${P}-fix_lilo_build.patch
+ tc-export CC
+}
+
+src_install() {
+ dodir /usr/bin /usr/share/man/man1
+ default
+}
diff --git a/sys-devel/bin86/bin86-0.16.21.ebuild b/sys-devel/bin86/bin86-0.16.21.ebuild
new file mode 100644
index 00000000000..4d8eebf8d5e
--- /dev/null
+++ b/sys-devel/bin86/bin86-0.16.21.ebuild
@@ -0,0 +1,33 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+inherit toolchain-funcs eutils
+
+DESCRIPTION="Assembler and loader used to create kernel bootsector"
+HOMEPAGE="http://v3.sk/~lkundrak/dev86/"
+SRC_URI="http://v3.sk/~lkundrak/dev86/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 ~ppc ~ppc64 x86 ~amd64-fbsd ~x86-fbsd"
+IUSE=""
+
+src_prepare() {
+ sed -i \
+ -e '/^PREFIX/s:=.*:=$(DESTDIR)/usr:' \
+ -e '/^MANDIR/s:)/man/man1:)/share/man/man1:' \
+ -e '/^INSTALL_OPTS/s:-s::' \
+ -e "/^CFLAGS/s:=.*:=${CFLAGS} -D_POSIX_SOURCE ${CPPFLAGS}:" \
+ -e "/^LDFLAGS/s:=.*:=${LDFLAGS}:" \
+ Makefile || die
+ epatch "${FILESDIR}"/${PN}-0.16.17-amd64-build.patch
+ tc-export CC
+}
+
+src_install() {
+ dodir /usr/bin /usr/share/man/man1
+ default
+}
diff --git a/sys-devel/bin86/files/bin86-0.16.17-amd64-build.patch b/sys-devel/bin86/files/bin86-0.16.17-amd64-build.patch
new file mode 100644
index 00000000000..b494a8b724d
--- /dev/null
+++ b/sys-devel/bin86/files/bin86-0.16.17-amd64-build.patch
@@ -0,0 +1,17 @@
+This should make it built on other archictectures as well
+
+https://bugs.gentoo.org/428228
+
+--- ld/x86_aout.h
++++ ld/x86_aout.h
+@@ -13,7 +13,9 @@
+ typedef long Long;
+ #define __OUT_OK 1
+ #else
+-typedef char Long[4];
++#define __OUT_OK 1
++#include <inttypes.h>
++typedef int32_t Long;
+ #endif
+
+ struct exec { /* a.out header */
diff --git a/sys-devel/bin86/files/bin86-0.16.18-headers.patch b/sys-devel/bin86/files/bin86-0.16.18-headers.patch
new file mode 100644
index 00000000000..16c9fa1d8db
--- /dev/null
+++ b/sys-devel/bin86/files/bin86-0.16.18-headers.patch
@@ -0,0 +1,34 @@
+fix implicit function decl warnings
+
+by David J Cozatt
+
+--- bin86-0.16.18/ld/catimage.c
++++ bin86-0.16.18/ld/catimage.c
+@@ -21,6 +21,8 @@
+ */
+
+ #include <stdio.h>
++#include <stdlib.h>
++#include <string.h>
+ #include "x86_aout.h"
+
+ #ifndef __OUT_OK
+--- bin86-0.16.18/ld/dumps.c
++++ bin86-0.16.18/ld/dumps.c
+@@ -6,6 +6,7 @@
+ #include "obj.h"
+ #include "type.h"
+ #include "globvar.h"
++#include <string.h>
+
+ /* print list of modules and whether they are loaded */
+
+--- bin86-0.16.18/ld/objchop.c
++++ bin86-0.16.18/ld/objchop.c
+@@ -1,5 +1,6 @@
+
+ #include <stdio.h>
++#include <stdlib.h>
+ #include "x86_aout.h"
+
+ #ifndef __OUT_OK
diff --git a/sys-devel/bin86/files/bin86-0.16.20-remove-seg-ss-check.patch b/sys-devel/bin86/files/bin86-0.16.20-remove-seg-ss-check.patch
new file mode 100644
index 00000000000..146b42f9063
--- /dev/null
+++ b/sys-devel/bin86/files/bin86-0.16.20-remove-seg-ss-check.patch
@@ -0,0 +1,22 @@
+This check leads to false positives for lilo. We disable it.
+
+From: Anthony G. Basile <blueness@gentoo.org>
+
+diff -Naur bin86-0.16.20.orig/as/assemble.c bin86-0.16.20/as/assemble.c
+--- bin86-0.16.20.orig/as/assemble.c 2013-10-29 11:45:37.000000000 -0400
++++ bin86-0.16.20/as/assemble.c 2013-12-09 18:43:45.018184693 -0500
+@@ -325,12 +325,14 @@
+ /* We handle "rep[ne]" refix as separate instruction; check if it's valid */
+ if (prevop == 0xF2 && (opcode&0xF6) != 0xA6) /* REPNE CMPS/SCAS */
+ error (REPNE_STRING);
++#if 0
+ if (prevop == 0xF3 && !((opcode&0xFC) == 0x6C || /* REP INS/OUTS */
+ (opcode&0xFC) == 0xA4 || /* REP MOVS/CMPS */
+ (opcode&0xFC) == 0xAC || /* REP SCAS/LODS */
+ (opcode&0xFE) == 0xAA)) /* REP STOS */
+ error (REP_STRING);
+ #endif
++#endif
+ routine = rout_table[symptr->value_reg_or_op.op.routine];
+ getsym();
+ (*routine)();
diff --git a/sys-devel/bin86/metadata.xml b/sys-devel/bin86/metadata.xml
new file mode 100644
index 00000000000..746b4d9abbe
--- /dev/null
+++ b/sys-devel/bin86/metadata.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>base-system</herd>
+ <!--
+ If anyone from base-system wants to be secondary, by all means just add
+ yourself, and send me (boo) a mail telling me that you've done so.
+ -->
+</pkgmetadata>
diff --git a/sys-devel/binutils-apple/Manifest b/sys-devel/binutils-apple/Manifest
new file mode 100644
index 00000000000..9c32c170d0a
--- /dev/null
+++ b/sys-devel/binutils-apple/Manifest
@@ -0,0 +1,21 @@
+DIST binutils-apple-3.2-unwind-patches-5.tar.xz 26924 SHA256 65a3b979df5c2033ac34e830d8a77b92b436b6d5707483c619c90a1c2ea46428 SHA512 9f3ec399274060b67c51193029da5af2199c45bf923a2fa513143111cf3f1c899256c993f4927f4da85a21570d0bc9ff0872e663f90284b2cdbb3f609ea8484e WHIRLPOOL 877410e6e0b442df9e9b7cdef51cc28bd636856949ea42ac53e97ebfc41c2f50309a054729d4fc3498d6eccac96170ffb59dd5700237e59684773832218793cc
+DIST binutils-apple-LP64-patches-1.tar.bz2 10235 SHA256 a107459f3914d57524e51ec4cb5e800f6715d40003514c79add0b5b4521cf809 SHA512 5632d4033c39e47de3ec275d02100ed53408a63122fe722c26dda1b02275c397524b113e51e1334d3235fc7f0a3bb8e53d4ccc1c2e40f24c6129282846da22e1 WHIRLPOOL c46d2021c85cee46e87871687ca7217169d14061848d12b4fa203db5d76a89969313ce55b345f2ad9fdba65fd39bdd34b146393332566fd539b2bdfc3f1e4304
+DIST cctools-698.1.tar.gz 2318018 SHA256 383f1c0c78a2b3efdfdf7ce01adb7e2f8ee9985164dba6ab1c0fae800a211cec SHA512 05e64df9bead958e6035b3cf449a2cb21b19cef10278348ebea8b47816b05a77ebd7f72fd90270400784a231b5d55c8f909653e8177cbe1332d7f7d618453f12 WHIRLPOOL 6ae1244ca97b13378e864609aa62efc4bf028b3e55bfb00cdbf9d20ed6cedd917c64ce337b2635dcabce334b8f994e2558fbda36055b951bf769a21950673e12
+DIST cctools-750.tar.gz 1947953 SHA256 188855640da114e37e4ddd4824ff6cdc1ea89dfb6c90a23905c9ca315342f356 SHA512 e2e152a9fb7db47c60fe450e1fc92c6866ab89682c7fdc594b97e419ce93ea1353654bd4419bf3df99d119f554aa0f32993dc645dd7c4680840cd01b7dce2f67 WHIRLPOOL 98e48fca183ee47d138426c65401138954a86abc3b80bfc4c5d105b97b8eb583ae350657f1a7dc1154259d0bcdfe1d60dc0a63409826e9a24b178674a5afdf21
+DIST cctools-795.tar.gz 1993795 SHA256 7fab7044b648e92a9fefd493a1bb6daa4246f24c5838d8b5c913a446e6bbd2ef SHA512 5a34a73dc71d3574a357f6b0f26a48a99dd0995d62695b309cdfe85c4960934b410455b1ba6bdbc9a4e32106bb45b35555604975d2a80ad1be21f5d4eac69254 WHIRLPOOL 2bd074ac8ef8542c2c3df5fae91a0bece2e1c31d6c6c771c55e7c7a3d90929f9a7cd420760dcb5ecffb9dd279abed4ba5ebf840c9e9bb983a806707d735cd735
+DIST cctools-809.tar.gz 2014410 SHA256 03ba62749b843b131c7304a044a98c6ffacd65b1399b921d69add0375f79d8ad SHA512 1349b3e6b3b48d9fa88dade187c05c80f161c3895fc6451a530880a256eb82dc93376b3cfd0f4d65e83f5fe00dc2baab386c5f78ce5b096f2c69fe53e1a55e24 WHIRLPOOL bd06ed88a7ab0bca173c0ee03c39cf60c719b9e0f03d21df9189e3e4a62e4fb452be46b0b0b05eafc70aed88bccc0a621d9165a1df63ea0eb071f9e5dda43c25
+DIST cctools-822.tar.gz 2024412 SHA256 dfaa9bdbd023524d47429674f64d2d5ea393123dabf90868be0aa17f61f45289 SHA512 8b02cc837d5e0520f35da445f25ba86b5042d5caa27b49a599e829ed89428cf78dbd1831bcf6c18301f941fbfb31ac2114e248041d98008a466e1574f4fe1586 WHIRLPOOL 81191ab46e8a9e47e4267146f978438ff64314b0363296b973a02f361918a5cd69057753a1b40766b93d3d4a3ed10585a27f6da2953992a406be61d1dcc1d06c
+DIST cctools-855.tar.gz 1699635 SHA256 751748ddf32c8ea84c175f32792721fa44424dad6acbf163f84f41e9617dbc58 SHA512 50f5d015ce807aa5ca274dd2deea810b8b375110e60b5e334ca4b2170526b738ea5f86a5436caebbdb748badc3b89601d0f450f5b867d8393c89e336a3db4b3f WHIRLPOOL fa493a29e32583f60c3553794bbb6d01a7b5ef797d8e8ba8161c9cbf237906ebbfaff560366da2d5b852bfcbdd55e874c00edf5b3169b16b357a54fcf3c07c4c
+DIST cctools-862.tar.gz 1702345 SHA256 1bf29f620b91c901ad3116b47738ab5076c1aed75d13869cd3bc7f067b4aaadb SHA512 faa401c1dc55bfb9cd2a9a9cc7bc9d473ee63b019607967c8b0da325514d6a1f7b1f52404370bcc018e86d30d75a4b01183f49b793f577110663efe43871360a WHIRLPOOL 371307f3264361f5e2e48d83177aff1a8f435cf2bdc1f4998cc5780c5b3760048a29a7620d2390db8f0c9378cd2f3b2f130b6aca9d402e3d428c4f4d353db097
+DIST dyld-195.5.tar.gz 411615 SHA256 2cf0484c87cf79b606b351a7055a247dae84093ae92c747a74e0cde2c8c8f83c SHA512 f316d32f3e417cf0898a8e231df66572d3424765831375863799d3ff30f8e28342ca692426d0ece7a8d069b341a3b9ca79c625edc322d90e3f26f528ea555324 WHIRLPOOL e0e231653ad37ad8fdb7d5fbd372fe1dc34b80e41f7dafa8bb46f4c8fa4f5acb4574f4cd346304dfaca1f074667f381931ca5ff7a7efddaea770fb35d30539dc
+DIST dyld-195.6.tar.gz 412518 SHA256 69296e9b4192bdac778ea899fffc18b02be62b51b5e8474b4cf85ae5f2b08aa4 SHA512 58a9ea27efc02e66f9d99bfa250af1d90326385385431e5279386bbd9ab53366bf7e8236543296908b7214c33523c8f60098a6298a7393b3180e2a6bce18e7c5 WHIRLPOOL e37b11d3996559f8a1843577a5fa42f96e4d42419f205276600f0ed79fcd2490da1f8a77eecf29f111b3db62a65e8e9cd77a154e3b389d633a7ac1525273b9b5
+DIST dyld-353.2.1.tar.gz 510036 SHA256 051089e284c5a4d671b21b73866abd01d54e5ea1912cadf3a9b916890fb31540 SHA512 a9488620499f682e245b55b7e0e4ec02fc0bcf03bd8a70d4a4ee0ba762067ade2f41c188990c101727476d41c19368b4cc89cccf2df40231da1c777742c7391f WHIRLPOOL 3164746ed8c866df993f08e405e7e329db427af8eeded681d5fb88031ef2c025363d5bfb647e9315738024adf9f48efacf49226f86f27def584ec7f538da292e
+DIST ld64-127.2.tar.gz 496975 SHA256 97b75547b2bd761306ab3e15ae297f01e7ab9760b922bc657f4ef72e4e052142 SHA512 a87181eca9307518aa21fc52a4d665c11ad51106c318c229d7f08650228f771484fd0b8c01c63639d577503aa9bc86d0792a3524643dc18cff19c3754aed9fc8 WHIRLPOOL 94f58da977da3d2d0c5a907a7d2c02e4a0d8323d04b8429d133e377b8495b0d344eec93dd1baaf369aa0a1517c7666cbef1d98d3cc6e8fd5d51c9622a2edcdf1
+DIST ld64-128.2.tar.gz 494361 SHA256 96a912464e2d4d3d7cdaab0744003b0fa93d139f203c82867f659ee94b4ae9f7 SHA512 f50a3c396e6f4fddc685bb3f59f9a260bd2f47060535d24259b2b411e4f759e48daa35819da682ad9bceaa1b9a1981eb34716387d988cdc4b7eec9ab2169726e WHIRLPOOL 78dec40124ae11c80483b362860b01c833fcaff67bae6b6cb3b72371daffdf3be809186f5daca4bb6ace77441cb43168939eb60eedf9f8c05ae3ec644c2a0502
+DIST ld64-236.3.tar.gz 624400 SHA256 8ef36729b643201081ab45ebd8586ede8f9968bc17614b679a940faa82875ca6 SHA512 e103fc5efd4d4161c7dc55b1ad53aebd455cfcd72de7873ebfdf5ba896b7b0da9c9aeb12e1e1a76425768ac1dc85d864a4ce33b5b841ba115eeab96a2e2965aa WHIRLPOOL d122e325518860c810b9efde7016ebecb6b59c56bb40ae1f041a840be764a5d9b90c7db1922fd9037c18f4caae7ace0d395591ffb3db704c87b92837ef997a17
+DIST ld64-241.9.tar.gz 639944 SHA256 3594e87c626c3b5abab6470cac6f27b367f1efcee60eb3d0f6b6d4ecf9b24230 SHA512 6958e7064f4fd8b47501225fc4cbc6292e5da63d7f4103ad79add177ef7382c8de3c732f14d19a9c11356b8070f578392383caccc3795e2ab8ef7b7ddbde88da WHIRLPOOL 5b07a336efde52b00b2601866907513517593a113583f05a9c45b98b4d6f394d87add887a7e44a95f462b6c2b5617ce497376b94a523e5cdf0f69d4d10ef3407
+DIST ld64-85.2.1.tar.gz 598524 SHA256 4bcbcbdfd62efdc46c51700b8f5dae2cbd1638e9e50f649d5c7f242d32fca804 SHA512 b5ffaffc43e74f22688fecd9fb3023a59160cf051f9412f34e6b0acf1c4f9d43ba641e199d8d6b1c6cf3bbbbf117645988fd879ded1fec8be056b6941fe79999 WHIRLPOOL 7c50f462eb41808b57ea06b82bdf576460bddb4150abe7a678af541aa0b179105d994a2b6fd10152481aa28acc903265160945b4aae9dcfce0a1a1cfe4b9460a
+DIST ld64-97.17.tar.gz 421947 SHA256 02bd46af0809eaa415d096d7d41c3e8e7d80f7d8d181840866fb87f036b4e089 SHA512 841774a1a7c0e2f661ac7e66703f7578d8f11274897ffa15f8c49daf290a23465763f264a4dae99f15754891f44c425c0d327652112007b499bc8f755a7fc9d6 WHIRLPOOL 7225b44d845b13c6b6d1a685170f2b6e15b81c48320fa3b570771938ed457a59452e80873996a4b2712a8f6813486063afd73acf979a97d823afb3d510d74678
+DIST libunwind-30.tar.gz 82811 SHA256 6ac97d18cc2b05e6de1269bf5af03b81948bd2200dae827527f3dc618b82bd41 SHA512 57106eafa1516791b4e0db2de6c6336bc0c1cbd8bf098a6d3a809fafa457802c95a7aeae9137f4ca5922a3018dfd8f597907ea4187b0afbbf267500eae00041f WHIRLPOOL c3caf5ba593cffa2f0a9cdb256f518524e9500eaf0a013c4973dc9881b16efa0c388e70407bbed1fd331f100af2da01ddeee12d33b3afc1213d69c32ab5e1d0b
+DIST libunwind-35.3.tar.gz 90002 SHA256 2bcc95553a44fa3edca41993ccfac65ba267830cb37c85dca760b34094722e56 SHA512 b7d9a86ef24f1fe9ca14517471e03a910219a229af9f0d4cf94435115971360640451107ba20c93fb1aab788f8b6eb5ed580ee08fdaa990b9fa43e9ae360c6b4 WHIRLPOOL 838912e46031b3a6796bfe854f0244991ce5bc3b59b95855224c9e84639e57b69f541b7993658360721423533dca75037248ea90f5e274b332f27319fdd85a9a
+DIST libunwind-llvm-115426.tar.bz2 74622 SHA256 e77a42c04eda5e3db61fc8b5bc98a55c6a015a9b02a74aab0f35d551fc38272f SHA512 01d78852632072ae48e95cfcf893dbb5325d4a3f4535a3cd3bc2afd5388c5f76995454219c8c6c2c2767abb2edc23bfe0212508c57b1d6db1c4a5d80cc5d4f9a WHIRLPOOL 0c7c8b8493b83e9c1337ab323697cfc255d1ef3e9ae2042df3a4f7480948a25fd571eb88a49e33168587d0994ec2d1371f2ef4d7834d7b41f77722d9693e8d55
diff --git a/sys-devel/binutils-apple/binutils-apple-3.1.2.ebuild b/sys-devel/binutils-apple/binutils-apple-3.1.2.ebuild
new file mode 100644
index 00000000000..fb391099ac3
--- /dev/null
+++ b/sys-devel/binutils-apple/binutils-apple-3.1.2.ebuild
@@ -0,0 +1,214 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="3"
+
+inherit eutils flag-o-matic toolchain-funcs
+
+RESTRICT="test" # the test suite will test what's installed.
+
+LD64=ld64-85.2.1
+CCTOOLS=cctools-698.1
+
+DESCRIPTION="Darwin assembler as(1) and static linker ld(1), Xcode Tools 3.1.2"
+HOMEPAGE="http://www.opensource.apple.com/darwinsource/"
+SRC_URI="http://www.gentoo.org/~grobian/distfiles/${LD64}.tar.gz
+ http://www.gentoo.org/~grobian/distfiles/${CCTOOLS}.tar.gz"
+
+LICENSE="APSL-2"
+KEYWORDS="~ppc-macos ~x86-macos"
+IUSE="test"
+SLOT="0"
+
+RDEPEND="sys-devel/binutils-config"
+DEPEND="${RDEPEND}
+ test? ( >=dev-lang/perl-5.8.8 )"
+
+export CTARGET=${CTARGET:-${CHOST}}
+if [[ ${CTARGET} == ${CHOST} ]] ; then
+ if [[ ${CATEGORY} == cross-* ]] ; then
+ export CTARGET=${CATEGORY#cross-}
+ fi
+fi
+is_cross() { [[ ${CHOST} != ${CTARGET} ]] ; }
+
+if is_cross ; then
+ SLOT="${CTARGET}"
+else
+ SLOT="0"
+fi
+
+LIBPATH=/usr/$(get_libdir)/binutils/${CTARGET}/${PV}
+INCPATH=${LIBPATH}/include
+DATAPATH=/usr/share/binutils-data/${CTARGET}/${PV}
+if is_cross ; then
+ BINPATH=/usr/${CHOST}/${CTARGET}/binutils-bin/${PV}
+else
+ BINPATH=/usr/${CTARGET}/binutils-bin/${PV}
+fi
+
+S=${WORKDIR}
+
+prepare_ld64() {
+ cd "${S}"/${LD64}/src
+ cp "${FILESDIR}"/Makefile .
+
+ local VER_STR="\"@(#)PROGRAM:ld PROJECT:${LD64}\\n\""
+ sed -i \
+ -e '/^#define LTO_SUPPORT 1/s:1:0:' \
+ ObjectDump.cpp
+ echo '#undef LTO_SUPPORT' > configure.h
+ echo "char ldVersionString[] = ${VER_STR};" > version.cpp
+
+ # clean up test suite
+ cd "${S}"/${LD64}/unit-tests/test-cases
+ local c
+
+ # we don't have llvm
+ ((++c)); rm -rf llvm-integration;
+
+ # we don't have dtrace
+ ((++c)); rm -rf dtrace-static-probes-coalescing;
+ ((++c)); rm -rf dtrace-static-probes;
+
+ # a file is missing
+ ((++c)); rm -rf eh-coalescing-r
+
+ # we don't do universal binaries
+ ((++c)); rm -rf blank-stubs;
+
+ # looks like a problem with apple's result-filter.pl
+ ((++c)); rm -rf implicit-common3;
+ ((++c)); rm -rf order_file-ans;
+
+ # TODO no idea what goes wrong here
+ ((++c)); rm -rf dwarf-debug-notes;
+
+ elog "Deleted $c tests that were bound to fail"
+}
+
+src_prepare() {
+ prepare_ld64
+
+ cd "${S}"/${CCTOOLS}
+ epatch "${FILESDIR}"/${PN}-3.1.1-as.patch
+ epatch "${FILESDIR}"/${PN}-3.1.1-as-dir.patch
+ epatch "${FILESDIR}"/${PN}-3.1.1-ranlib.patch
+ epatch "${FILESDIR}"/${PN}-3.1.1-libtool-ranlib.patch
+ epatch "${FILESDIR}"/${PN}-3.1.1-nmedit.patch
+ epatch "${FILESDIR}"/${PN}-3.1.1-no-efi-man.patch
+ epatch "${FILESDIR}"/${PN}-3.1.1-no-headers.patch
+ epatch "${FILESDIR}"/${PN}-3.1.1-no-oss-dir.patch
+ epatch "${FILESDIR}"/${PN}-3.1.2-as-Makefile.patch
+ cd "${S}"/${LD64}
+ epatch "${FILESDIR}"/${PN}-3.1.1-testsuite.patch
+
+ # -pg is used and the two are incompatible
+ filter-flags -fomit-frame-pointer
+}
+
+compile_ld64() {
+ cd "${S}"/${LD64}/src
+ # 'struct linkedit_data_command' is defined in mach-o/loader.h on leopard,
+ # but not on tiger.
+ [[ ${CHOST} == *-apple-darwin8 ]] && \
+ append-flags -isystem "${S}"/${CCTOOLS}/include/
+ emake || die "emake failed for ld64"
+ use test && emake build_test
+}
+
+compile_cctools() {
+ cd "${S}"/${CCTOOLS}
+ emake \
+ LTO= \
+ EFITOOLS= \
+ COMMON_SUBDIRS='libstuff ar misc otool' \
+ RC_CFLAGS="${CFLAGS}" || die "emake failed for the cctools"
+ cd "${S}"/${CCTOOLS}/as
+ emake \
+ BUILD_OBSOLETE_ARCH= \
+ RC_CFLAGS="-DASLIBEXECDIR=\"\\\"${EPREFIX}${LIBPATH}/\\\"\" ${CFLAGS}" \
+ || die "emake failed for as"
+}
+
+src_compile() {
+ tc-export CC CXX
+ compile_cctools
+ compile_ld64
+}
+
+install_ld64() {
+ exeinto ${BINPATH}
+ doexe "${S}"/${LD64}/src/{ld64,rebase}
+ dosym ld64 ${BINPATH}/ld
+ insinto ${DATAPATH}/man/man1
+ doins "${S}"/${LD64}/doc/man/man1/{ld,ld64,rebase}.1
+}
+
+install_cctools() {
+ cd "${S}"/${CCTOOLS}
+ emake install_all_but_headers \
+ EFITOOLS= \
+ COMMON_SUBDIRS='ar misc otool' \
+ DSTROOT=\"${D}\" \
+ BINDIR=\"${EPREFIX}\"${BINPATH} \
+ LOCBINDIR=\"${EPREFIX}\"${BINPATH} \
+ USRBINDIR=\"${EPREFIX}\"${BINPATH} \
+ LOCLIBDIR=\"${EPREFIX}\"${LIBPATH} \
+ MANDIR=\"${EPREFIX}\"${DATAPATH}/man/
+ cd "${S}"/${CCTOOLS}/as
+ emake install \
+ BUILD_OBSOLETE_ARCH= \
+ DSTROOT=\"${D}\" \
+ USRBINDIR=\"${EPREFIX}\"${BINPATH} \
+ LIBDIR=\"${EPREFIX}\"${LIBPATH}
+
+ cd "${ED}"${BINPATH}
+ insinto ${DATAPATH}/man/man1
+ local skips manpage
+ # ar brings an up-to-date manpage with it
+ skips=( ar )
+ for bin in *; do
+ for skip in ${skips[@]}; do
+ if [[ ${bin} == ${skip} ]]; then
+ continue 2;
+ fi
+ done
+ manpage=${S}/${CCTOOLS}/man/${bin}.1
+ if [[ -f "${manpage}" ]]; then
+ doins "${manpage}"
+ fi
+ done
+ insinto ${DATAPATH}/man/man5
+ doins "${S}"/${CCTOOLS}/man/*.5
+}
+
+src_test() {
+ einfo "Running unit tests"
+ cd "${S}"/${LD64}/unit-tests/test-cases
+ # need host arch, since GNU arch doesn't do what Apple's does
+ tc-export CC CXX
+ perl ../bin/make-recursive.pl \
+ ARCH="$(/usr/bin/arch)" \
+ RELEASEDIR="${S}"/${LD64}/src \
+ | perl ../bin/result-filter.pl
+}
+
+src_install() {
+ install_ld64
+ install_cctools
+
+ cd "${S}"
+ insinto /etc/env.d/binutils
+ cat <<-EOF > env.d
+ TARGET="${CHOST}"
+ VER="${PV}"
+ FAKE_TARGETS="${CHOST}"
+ EOF
+ newins env.d ${CHOST}-${PV}
+}
+
+pkg_postinst() {
+ binutils-config ${CHOST}-${PV}
+}
diff --git a/sys-devel/binutils-apple/binutils-apple-3.2.6.ebuild b/sys-devel/binutils-apple/binutils-apple-3.2.6.ebuild
new file mode 100644
index 00000000000..ad64539d97e
--- /dev/null
+++ b/sys-devel/binutils-apple/binutils-apple-3.2.6.ebuild
@@ -0,0 +1,254 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="3"
+
+inherit eutils flag-o-matic toolchain-funcs
+
+RESTRICT="test" # the test suite will test what's installed.
+
+LD64=ld64-97.17
+CCTOOLS=cctools-795
+# http://lists.apple.com/archives/Darwin-dev/2009/Sep/msg00025.html
+UNWIND=binutils-apple-3.2-unwind-patches-5
+
+DESCRIPTION="Darwin assembler as(1) and static linker ld(1), Xcode Tools ${PV}"
+HOMEPAGE="http://www.opensource.apple.com/darwinsource/"
+SRC_URI="http://www.opensource.apple.com/tarballs/ld64/${LD64}.tar.gz
+ http://www.opensource.apple.com/tarballs/cctools/${CCTOOLS}.tar.gz
+ http://www.gentoo.org/~grobian/distfiles/${UNWIND}.tar.xz"
+
+LICENSE="APSL-2"
+KEYWORDS="~ppc-macos ~x64-macos ~x86-macos"
+IUSE="lto test"
+SLOT="0"
+
+RDEPEND="sys-devel/binutils-config
+ lto? ( sys-devel/llvm )"
+DEPEND="${RDEPEND}
+ test? ( >=dev-lang/perl-5.8.8 )
+ >=sys-devel/gcc-apple-4.2.1"
+
+export CTARGET=${CTARGET:-${CHOST}}
+if [[ ${CTARGET} == ${CHOST} ]] ; then
+ if [[ ${CATEGORY} == cross-* ]] ; then
+ export CTARGET=${CATEGORY#cross-}
+ fi
+fi
+is_cross() { [[ ${CHOST} != ${CTARGET} ]] ; }
+
+if is_cross ; then
+ SLOT="${CTARGET}"
+else
+ SLOT="0"
+fi
+
+LIBPATH=/usr/$(get_libdir)/binutils/${CTARGET}/${PV}
+INCPATH=${LIBPATH}/include
+DATAPATH=/usr/share/binutils-data/${CTARGET}/${PV}
+if is_cross ; then
+ BINPATH=/usr/${CHOST}/${CTARGET}/binutils-bin/${PV}
+else
+ BINPATH=/usr/${CTARGET}/binutils-bin/${PV}
+fi
+
+S=${WORKDIR}
+
+src_prepare() {
+ cd "${S}"/${CCTOOLS}
+ epatch "${FILESDIR}"/${PN}-3.2.2-as.patch
+ epatch "${FILESDIR}"/${PN}-4.0-as-dir.patch
+ epatch "${FILESDIR}"/${PN}-3.2.3-ranlib.patch
+ epatch "${FILESDIR}"/${PN}-3.1.1-libtool-ranlib.patch
+ epatch "${FILESDIR}"/${PN}-3.1.1-nmedit.patch
+ epatch "${FILESDIR}"/${PN}-3.1.1-no-headers.patch
+ epatch "${FILESDIR}"/${PN}-3.1.1-no-oss-dir.patch
+
+ cd "${S}"/${LD64}/src
+ cp "${FILESDIR}"/ld64-95.2.12-Makefile Makefile
+
+ ln -s ../../${CCTOOLS}/include
+ cp "${WORKDIR}"/ld64-unwind/compact_unwind_encoding.h include/mach-o/
+ cp other/prune_trie.h include/mach-o/ || die
+ # use our own copy of lto.h, which doesn't require llvm build-env
+ mkdir -p include/llvm-c || die
+ cp "${WORKDIR}"/ld64-unwind/ld64-97.14-llvm-lto.h include/llvm-c/lto.h || die
+
+ echo '' > configure.h
+ echo '' > linker_opts
+ local VER_STR="\"@(#)PROGRAM:ld PROJECT:${LD64} (Gentoo ${PN}-${PVR})\\n\""
+ echo "char ldVersionString[] = ${VER_STR};" > version.cpp
+
+ epatch "${WORKDIR}"/ld64-unwind/ld64-97.14-unlibunwind.patch
+ [[ ${CHOST} == powerpc*-darwin* ]] && \
+ epatch "${FILESDIR}"/ld64-95.2.12-darwin8-no-mlong-branch-warning.patch
+ if use !lto ; then
+ sed -i -e '/#define LTO_SUPPORT 1/d' other/ObjectDump.cpp || die
+ fi
+
+ # clean up test suite
+ cd "${S}"/${LD64}
+ epatch "${FILESDIR}"/${PN}-3.1.1-testsuite.patch
+
+ cd "${S}"/${LD64}/unit-tests/test-cases
+ local c
+
+ # we don't have llvm
+ ((++c)); rm -rf llvm-integration;
+
+ # we don't have dtrace
+ ((++c)); rm -rf dtrace-static-probes-coalescing;
+ ((++c)); rm -rf dtrace-static-probes;
+
+ # a file is missing
+ ((++c)); rm -rf eh-coalescing-r
+
+ # we don't do universal binaries
+ ((++c)); rm -rf blank-stubs;
+
+ # looks like a problem with apple's result-filter.pl
+ ((++c)); rm -rf implicit-common3;
+ ((++c)); rm -rf order_file-ans;
+
+ # TODO no idea what goes wrong here
+ ((++c)); rm -rf dwarf-debug-notes;
+
+ einfo "Deleted $c tests that were bound to fail"
+
+ cd "${S}"
+ ebegin "cleaning Makefiles from unwanted CFLAGS"
+ find . -name "Makefile" -print0 | xargs -0 sed \
+ -i \
+ -e 's/ -g / /g' \
+ -e 's/^OFLAG =.*$/OFLAG =/' \
+ -e 's/install -c -s/install/g'
+ eend $?
+
+ # -pg is used and the two are incompatible
+ filter-flags -fomit-frame-pointer
+}
+
+src_configure() {
+ tc-export CC CXX AR
+ if use lto ; then
+ append-flags -DLTO_SUPPORT
+ append-ldflags -L"${EPREFIX}"/usr/$(get_libdir)/llvm
+ append-libs LTO
+ else
+ append-flags -ULTO_SUPPORT
+ fi
+}
+
+compile_ld64() {
+ cd "${S}"/${LD64}/src
+ # remove antiquated copy that's available on any OSX system and
+ # breaks ld64 compilation
+ mv include/mach-o/dyld.h{,.disable}
+ emake \
+ CFLAGS="${CFLAGS}" \
+ CXXFLAGS="${CXXFLAGS}" \
+ LDFLAGS="${LDFLAGS} ${LIBS}" \
+ || die "emake failed for ld64"
+ use test && emake build_test
+ # restore, it's necessary for cctools' install
+ mv include/mach-o/dyld.h{.disable,}
+}
+
+compile_cctools() {
+ cd "${S}"/${CCTOOLS}
+ emake \
+ LIB_PRUNETRIE="-L../../${LD64}/src -lprunetrie" \
+ EFITOOLS= LTO= \
+ COMMON_SUBDIRS='libstuff ar misc otool' \
+ SUBDIRS_32= \
+ RC_CFLAGS="${CFLAGS}" OFLAG="${CFLAGS}" \
+ || die "emake failed for the cctools"
+ cd "${S}"/${CCTOOLS}/as
+ emake \
+ BUILD_OBSOLETE_ARCH= \
+ RC_CFLAGS="-DASLIBEXECDIR=\"\\\"${EPREFIX}${LIBPATH}/\\\"\" ${CFLAGS}" \
+ || die "emake failed for as"
+}
+
+src_compile() {
+ compile_ld64
+ compile_cctools
+}
+
+install_ld64() {
+ exeinto ${BINPATH}
+ doexe "${S}"/${LD64}/src/{ld64,rebase,dyldinfo,unwinddump,ObjectDump}
+ dosym ld64 ${BINPATH}/ld
+ insinto ${DATAPATH}/man/man1
+ doins "${S}"/${LD64}/doc/man/man1/{ld,ld64,rebase}.1
+}
+
+install_cctools() {
+ cd "${S}"/${CCTOOLS}
+ emake install_all_but_headers \
+ EFITOOLS= LTO= \
+ COMMON_SUBDIRS='ar misc otool' \
+ SUBDIRS_32= \
+ RC_CFLAGS="${CFLAGS}" OFLAG="${CFLAGS}" \
+ DSTROOT=\"${D}\" \
+ BINDIR=\"${EPREFIX}\"${BINPATH} \
+ LOCBINDIR=\"${EPREFIX}\"${BINPATH} \
+ USRBINDIR=\"${EPREFIX}\"${BINPATH} \
+ LOCLIBDIR=\"${EPREFIX}\"${LIBPATH} \
+ MANDIR=\"${EPREFIX}\"${DATAPATH}/man/
+ cd "${S}"/${CCTOOLS}/as
+ emake install \
+ BUILD_OBSOLETE_ARCH= \
+ DSTROOT=\"${D}\" \
+ USRBINDIR=\"${EPREFIX}\"${BINPATH} \
+ LIBDIR=\"${EPREFIX}\"${LIBPATH}
+
+ cd "${ED}"${BINPATH}
+ insinto ${DATAPATH}/man/man1
+ local skips manpage
+ # ar brings an up-to-date manpage with it
+ skips=( ar )
+ for bin in *; do
+ for skip in ${skips[@]}; do
+ if [[ ${bin} == ${skip} ]]; then
+ continue 2;
+ fi
+ done
+ manpage=${S}/${CCTOOLS}/man/${bin}.1
+ if [[ -f "${manpage}" ]]; then
+ doins "${manpage}"
+ fi
+ done
+ insinto ${DATAPATH}/man/man5
+ doins "${S}"/${CCTOOLS}/man/*.5
+}
+
+src_test() {
+ einfo "Running unit tests"
+ cd "${S}"/${LD64}/unit-tests/test-cases
+ # need host arch, since GNU arch doesn't do what Apple's does
+ tc-export CC CXX
+ perl ../bin/make-recursive.pl \
+ ARCH="$(/usr/bin/arch)" \
+ RELEASEDIR="${S}"/${LD64}/src \
+ | perl ../bin/result-filter.pl
+}
+
+src_install() {
+ install_ld64
+ install_cctools
+
+ cd "${S}"
+ insinto /etc/env.d/binutils
+ cat <<-EOF > env.d
+ TARGET="${CHOST}"
+ VER="${PV}"
+ FAKE_TARGETS="${CHOST}"
+ EOF
+ newins env.d ${CHOST}-${PV}
+}
+
+pkg_postinst() {
+ binutils-config ${CHOST}-${PV}
+}
diff --git a/sys-devel/binutils-apple/binutils-apple-3.2.ebuild b/sys-devel/binutils-apple/binutils-apple-3.2.ebuild
new file mode 100644
index 00000000000..77555c644ec
--- /dev/null
+++ b/sys-devel/binutils-apple/binutils-apple-3.2.ebuild
@@ -0,0 +1,234 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="3"
+
+inherit eutils flag-o-matic toolchain-funcs
+
+RESTRICT="test" # the test suite will test what's installed.
+
+# LD64=ld64-95.2.12 # can't compile this one, missing libunwind/* includes
+# http://lists.apple.com/archives/Darwin-dev/2009/Sep/msg00025.html
+LD64=ld64-85.2.1 # from 3.1.2
+CCTOOLS=cctools-750
+LP64PATCHES=binutils-apple-LP64-patches-1
+
+DESCRIPTION="Darwin assembler as(1) and static linker ld(1), Xcode Tools 3.2"
+HOMEPAGE="http://www.opensource.apple.com/darwinsource/"
+SRC_URI="http://www.gentoo.org/~grobian/distfiles/${LD64}.tar.gz
+ http://www.gentoo.org/~grobian/distfiles/${CCTOOLS}.tar.gz
+ http://www.gentoo.org/~grobian/distfiles/${LP64PATCHES}.tar.bz2"
+
+LICENSE="APSL-2"
+KEYWORDS="~ppc-macos ~x64-macos ~x86-macos"
+IUSE="test"
+SLOT="0"
+
+RDEPEND="sys-devel/binutils-config"
+DEPEND="${RDEPEND}
+ test? ( >=dev-lang/perl-5.8.8 )"
+
+export CTARGET=${CTARGET:-${CHOST}}
+if [[ ${CTARGET} == ${CHOST} ]] ; then
+ if [[ ${CATEGORY} == cross-* ]] ; then
+ export CTARGET=${CATEGORY#cross-}
+ fi
+fi
+is_cross() { [[ ${CHOST} != ${CTARGET} ]] ; }
+
+if is_cross ; then
+ SLOT="${CTARGET}"
+else
+ SLOT="0"
+fi
+
+LIBPATH=/usr/$(get_libdir)/binutils/${CTARGET}/${PV}
+INCPATH=${LIBPATH}/include
+DATAPATH=/usr/share/binutils-data/${CTARGET}/${PV}
+if is_cross ; then
+ BINPATH=/usr/${CHOST}/${CTARGET}/binutils-bin/${PV}
+else
+ BINPATH=/usr/${CTARGET}/binutils-bin/${PV}
+fi
+
+S=${WORKDIR}
+
+prepare_ld64() {
+ cd "${S}"/${LD64}/src
+ cp "${FILESDIR}"/Makefile .
+
+ local VER_STR="\"@(#)PROGRAM:ld PROJECT:${LD64} (Gentoo ${PN}-${PVR})\\n\""
+ sed -i \
+ -e '/^#define LTO_SUPPORT 1/s:1:0:' \
+ ObjectDump.cpp || die
+ echo '#undef LTO_SUPPORT' > configure.h
+ echo '' > linker_opts
+ echo "char ldVersionString[] = ${VER_STR};" > version.cpp
+
+ # clean up test suite
+ cd "${S}"/${LD64}/unit-tests/test-cases
+ local c
+
+ # we don't have llvm
+ ((++c)); rm -rf llvm-integration;
+
+ # we don't have dtrace
+ ((++c)); rm -rf dtrace-static-probes-coalescing;
+ ((++c)); rm -rf dtrace-static-probes;
+
+ # a file is missing
+ ((++c)); rm -rf eh-coalescing-r
+
+ # we don't do universal binaries
+ ((++c)); rm -rf blank-stubs;
+
+ # looks like a problem with apple's result-filter.pl
+ ((++c)); rm -rf implicit-common3;
+ ((++c)); rm -rf order_file-ans;
+
+ # TODO no idea what goes wrong here
+ ((++c)); rm -rf dwarf-debug-notes;
+
+ elog "Deleted $c tests that were bound to fail"
+}
+
+src_prepare() {
+ prepare_ld64
+
+ cd "${S}"/${CCTOOLS}
+ epatch "${FILESDIR}"/${PN}-3.1.1-as.patch
+ epatch "${FILESDIR}"/${PN}-3.1.1-as-dir.patch
+ epatch "${FILESDIR}"/${PN}-3.1.1-ranlib.patch
+ epatch "${FILESDIR}"/${PN}-3.1.1-libtool-ranlib.patch
+ epatch "${FILESDIR}"/${PN}-3.1.1-nmedit.patch
+ epatch "${FILESDIR}"/${PN}-3.1.1-no-headers.patch
+ epatch "${FILESDIR}"/${PN}-3.1.1-no-oss-dir.patch
+ epatch "${FILESDIR}"/${P}-armv7-defines.patch
+
+ cd "${S}"/${LD64}
+ epatch "${FILESDIR}"/${PN}-3.1.1-testsuite.patch
+ epatch "${WORKDIR}"/LP64/ld64/*.patch
+
+ cd "${S}"
+ ebegin "cleaning Makefiles from unwanted CFLAGS"
+ find . -name "Makefile" -print0 | xargs -0 sed \
+ -i \
+ -e 's/ -g / /g' \
+ -e 's/^OFLAG =.*$/OFLAG =/' \
+ -e 's/install -c -s/install/g'
+ eend $?
+
+ # -pg is used and the two are incompatible
+ filter-flags -fomit-frame-pointer
+}
+
+compile_ld64() {
+ cd "${S}"/${LD64}/src
+ # 'struct linkedit_data_command' is defined in mach-o/loader.h on leopard,
+ # but not on tiger.
+ [[ ${CHOST} == *-apple-darwin8 ]] && \
+ append-flags -isystem "${S}"/${CCTOOLS}/include/
+ emake || die "emake failed for ld64"
+ use test && emake build_test
+}
+
+compile_cctools() {
+ cd "${S}"/${CCTOOLS}
+ emake \
+ LTO= \
+ TRIE= \
+ EFITOOLS= \
+ COMMON_SUBDIRS='libstuff ar misc otool' \
+ SUBDIRS_32= \
+ RC_CFLAGS="${CFLAGS}" OFLAG="${CFLAGS}" \
+ || die "emake failed for the cctools"
+ cd "${S}"/${CCTOOLS}/as
+ emake \
+ BUILD_OBSOLETE_ARCH= \
+ RC_CFLAGS="-DASLIBEXECDIR=\"\\\"${EPREFIX}${LIBPATH}/\\\"\" ${CFLAGS}" \
+ || die "emake failed for as"
+}
+
+src_compile() {
+ tc-export CC CXX
+ compile_cctools
+ compile_ld64
+}
+
+install_ld64() {
+ exeinto ${BINPATH}
+ doexe "${S}"/${LD64}/src/{ld64,rebase}
+ dosym ld64 ${BINPATH}/ld
+ insinto ${DATAPATH}/man/man1
+ doins "${S}"/${LD64}/doc/man/man1/{ld,ld64,rebase}.1
+}
+
+install_cctools() {
+ cd "${S}"/${CCTOOLS}
+ emake install_all_but_headers \
+ EFITOOLS= \
+ COMMON_SUBDIRS='ar misc otool' \
+ SUBDIRS_32= \
+ RC_CFLAGS="${CFLAGS}" OFLAG="${CFLAGS}" \
+ DSTROOT=\"${D}\" \
+ BINDIR=\"${EPREFIX}\"${BINPATH} \
+ LOCBINDIR=\"${EPREFIX}\"${BINPATH} \
+ USRBINDIR=\"${EPREFIX}\"${BINPATH} \
+ LOCLIBDIR=\"${EPREFIX}\"${LIBPATH} \
+ MANDIR=\"${EPREFIX}\"${DATAPATH}/man/
+ cd "${S}"/${CCTOOLS}/as
+ emake install \
+ BUILD_OBSOLETE_ARCH= \
+ DSTROOT=\"${D}\" \
+ USRBINDIR=\"${EPREFIX}\"${BINPATH} \
+ LIBDIR=\"${EPREFIX}\"${LIBPATH}
+
+ cd "${ED}"${BINPATH}
+ insinto ${DATAPATH}/man/man1
+ local skips manpage
+ # ar brings an up-to-date manpage with it
+ skips=( ar )
+ for bin in *; do
+ for skip in ${skips[@]}; do
+ if [[ ${bin} == ${skip} ]]; then
+ continue 2;
+ fi
+ done
+ manpage=${S}/${CCTOOLS}/man/${bin}.1
+ if [[ -f "${manpage}" ]]; then
+ doins "${manpage}"
+ fi
+ done
+ insinto ${DATAPATH}/man/man5
+ doins "${S}"/${CCTOOLS}/man/*.5
+}
+
+src_test() {
+ einfo "Running unit tests"
+ cd "${S}"/${LD64}/unit-tests/test-cases
+ # need host arch, since GNU arch doesn't do what Apple's does
+ tc-export CC CXX
+ perl ../bin/make-recursive.pl \
+ ARCH="$(/usr/bin/arch)" \
+ RELEASEDIR="${S}"/${LD64}/src \
+ | perl ../bin/result-filter.pl
+}
+
+src_install() {
+ install_ld64
+ install_cctools
+
+ cd "${S}"
+ insinto /etc/env.d/binutils
+ cat <<-EOF > env.d
+ TARGET="${CHOST}"
+ VER="${PV}"
+ FAKE_TARGETS="${CHOST}"
+ EOF
+ newins env.d ${CHOST}-${PV}
+}
+
+pkg_postinst() {
+ binutils-config ${CHOST}-${PV}
+}
diff --git a/sys-devel/binutils-apple/binutils-apple-4.2-r1.ebuild b/sys-devel/binutils-apple/binutils-apple-4.2-r1.ebuild
new file mode 100644
index 00000000000..406cd3e102a
--- /dev/null
+++ b/sys-devel/binutils-apple/binutils-apple-4.2-r1.ebuild
@@ -0,0 +1,328 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="3"
+
+inherit eutils flag-o-matic toolchain-funcs
+
+LD64=ld64-127.2
+CCTOOLS_VERSION=809
+CCTOOLS=cctools-${CCTOOLS_VERSION}
+CCTOOLS_HEADERS=cctools-855
+LIBUNWIND=libunwind-30
+DYLD=dyld-195.5
+
+DESCRIPTION="Darwin assembler as(1) and static linker ld(1), Xcode Tools ${PV}"
+HOMEPAGE="http://www.opensource.apple.com/darwinsource/"
+SRC_URI="http://www.opensource.apple.com/tarballs/ld64/${LD64}.tar.gz
+ http://www.opensource.apple.com/tarballs/cctools/${CCTOOLS}.tar.gz
+ http://www.opensource.apple.com/tarballs/cctools/${CCTOOLS_HEADERS}.tar.gz
+ http://www.opensource.apple.com/tarballs/libunwind/${LIBUNWIND}.tar.gz
+ http://www.opensource.apple.com/tarballs/dyld/${DYLD}.tar.gz"
+
+LICENSE="APSL-2"
+KEYWORDS="~ppc-macos ~x64-macos ~x86-macos"
+IUSE="lto test"
+
+RDEPEND="sys-devel/binutils-config
+ lto? ( sys-devel/llvm )"
+DEPEND="${RDEPEND}
+ test? ( >=dev-lang/perl-5.8.8 )
+ || ( >=sys-devel/gcc-apple-4.2.1 sys-devel/llvm )"
+
+export CTARGET=${CTARGET:-${CHOST}}
+if [[ ${CTARGET} == ${CHOST} ]] ; then
+ if [[ ${CATEGORY} == cross-* ]] ; then
+ export CTARGET=${CATEGORY#cross-}
+ fi
+fi
+is_cross() { [[ ${CHOST} != ${CTARGET} ]] ; }
+
+if is_cross ; then
+ SLOT="${CTARGET}-4"
+else
+ SLOT="4"
+fi
+
+LIBPATH=/usr/$(get_libdir)/binutils/${CTARGET}/${PV}
+INCPATH=${LIBPATH}/include
+DATAPATH=/usr/share/binutils-data/${CTARGET}/${PV}
+if is_cross ; then
+ BINPATH=/usr/${CHOST}/${CTARGET}/binutils-bin/${PV}
+else
+ BINPATH=/usr/${CTARGET}/binutils-bin/${PV}
+fi
+
+S=${WORKDIR}
+
+src_prepare() {
+ cd "${S}"/${LD64}/src
+ cp "${FILESDIR}"/ld64-127.2-Makefile Makefile
+ epatch "${FILESDIR}"/${LD64}-lto.patch
+ epatch "${FILESDIR}"/ld64-128.2-stdlib.patch
+ epatch "${FILESDIR}"/${LD64}-ppc-range-warning.patch
+ epatch "${FILESDIR}"/ld64-127.2-extraneous-headers.patch
+ epatch "${FILESDIR}"/ld64-241.9-register-names.patch
+ epatch "${FILESDIR}"/ld64-241.9-get-comm-align.patch
+ epatch "${FILESDIR}"/ld64-241.9-cc_md5.patch
+ epatch "${FILESDIR}"/ld64-128.2-1010.patch
+
+ # We used to use our own copy of lto.h, which doesn't require llvm
+ # build-env. Current versions of llvm provide
+ # $EPREFIX/usr/include/llvm-c/lto.h as well as
+ # $EPREFIX/usr/lib/libLTO.{so,dylib}, so we just use these.
+
+ # provide missing headers from libunwind and dyld
+ mkdir -p include/{mach,mach-o/arm} || die
+ # never present because it's private
+ cp ../../${DYLD}/include/mach-o/dyld_priv.h include/mach-o || die
+ # missing on <= 10.5
+ cp ../../${LIBUNWIND}/include/libunwind.h include/ || die
+ cp ../../${LIBUNWIND}/include/mach-o/compact_unwind_encoding.h include/mach-o || die
+ # missing on <= 10.4
+ cp ../../${DYLD}/include/mach-o/dyld_images.h include/mach-o || die
+ cp ../../${CCTOOLS}/include/mach-o/loader.h include/mach-o || die
+ # use copies from cctools because they're otherwise hidden in some SDK
+ cp ../../${CCTOOLS}/include/mach-o/arm/reloc.h include/mach-o/arm || die
+ # provide all required CPU_TYPEs on all platforms
+ cp ../../${CCTOOLS}/include/mach/machine.h include/mach/machine.h
+ # add alias for newer identifiers, because ld64 uses both but cctools
+ # header only defines the older
+ epatch "${FILESDIR}"/ld64-236.3-missing-cputypes.patch
+
+ # mimic OS X Leopard-style Availability.h macros for libunwind.h on
+ # older systems
+ [[ ${CHOST} == *darwin* && ${CHOST#*-darwin} -le 8 ]] && \
+ echo "#define __OSX_AVAILABLE_STARTING(x,y) " > include/Availability.h
+
+ local VER_STR="\"@(#)PROGRAM:ld PROJECT:${LD64} (Gentoo ${PN}-${PVR})\\n\""
+ echo "char ldVersionString[] = ${VER_STR};" > version.cpp
+
+ epatch "${FILESDIR}"/ld64-123.2-debug-backtrace.patch
+ if [[ ${CHOST} == powerpc*-darwin* ]] ; then
+ epatch "${FILESDIR}"/ld64-123.2-darwin8-no-mlong-branch-warning.patch
+ epatch "${FILESDIR}"/ld64-127.2-thread_state.patch
+ fi
+
+ cd "${S}"/${CCTOOLS}
+ epatch "${FILESDIR}"/${PN}-4.0-as.patch
+ epatch "${FILESDIR}"/${PN}-4.2-as-dir.patch
+ epatch "${FILESDIR}"/${PN}-3.2.3-ranlib.patch
+ epatch "${FILESDIR}"/${PN}-3.1.1-libtool-ranlib.patch
+ epatch "${FILESDIR}"/${PN}-3.1.1-nmedit.patch
+ epatch "${FILESDIR}"/${PN}-3.1.1-no-headers.patch
+ epatch "${FILESDIR}"/${PN}-4.0-no-oss-dir.patch
+ epatch "${FILESDIR}"/${PN}-4.2-lto.patch
+ epatch "${FILESDIR}"/${PN}-5.1-extraneous-includes.patch
+ epatch "${FILESDIR}"/${PN}-4.2-globals-extern.patch
+ cp ../${LD64}/src/other/prune_trie.h include/mach-o/ || die
+ # __darwin_i386_float_state missing on <= 10.4
+ cp -a ../${CCTOOLS_HEADERS}/include/mach/i386 include/mach
+
+ # do not build profileable libstuff to save compile time
+ sed -i -e "/^all:/s, profile , ," libstuff/Makefile
+
+ # Provide patched version information to the tools. This is normally
+ # done by the Makefile using vers_string. As an added benefit, the
+ # build will not fail on later OS Xes where that tool doesn't exist any
+ # more.
+
+ # Those tools don't even use their version information. Just make make
+ # happy.
+ touch {ar,gprof,otool}/vers.c
+
+ # for the others defining apple_version suffices nicely although the
+ # Makefile does a lot more.
+ VER_STR="${CCTOOLS} (Gentoo ${PN}-${PVR})"
+ echo "const char apple_version[] = \"${VER_STR}\";" \
+ >> as/apple_version.c || die
+ echo "const char apple_version[] = \"${VER_STR})\";" \
+ >> misc/vers.c || die
+ # the rest we don't even build
+
+ # clean up test suite
+ cd "${S}"/${LD64}/unit-tests/test-cases
+ local c
+
+ # we don't have llvm
+ ((++c)); rm -rf llvm-integration;
+
+ # we don't have dtrace
+ ((++c)); rm -rf dtrace-static-probes-coalescing;
+ ((++c)); rm -rf dtrace-static-probes;
+
+ # a file is missing
+ ((++c)); rm -rf eh-coalescing-r
+
+ # we don't do universal binaries
+ ((++c)); rm -rf blank-stubs;
+
+ # looks like a problem with apple's result-filter.pl
+ ((++c)); rm -rf implicit-common3;
+ ((++c)); rm -rf order_file-ans;
+
+ # TODO no idea what goes wrong here
+ ((++c)); rm -rf dwarf-debug-notes;
+
+ einfo "Deleted $c tests that were bound to fail"
+
+ cd "${S}"
+ ebegin "cleaning Makefiles from unwanted CFLAGS"
+ find . -name "Makefile" -print0 | xargs -0 sed \
+ -i \
+ -e 's/ -g / /g' \
+ -e 's/^G =.*$/G =/' \
+ -e 's/^OFLAG =.*$/OFLAG =/' \
+ -e 's/install -c -s/install/g'
+ eend $?
+}
+
+src_configure() {
+ CCTOOLS_LTO=
+ LD64_LTO=0
+ if use lto ; then
+ CCTOOLS_LTO="-DLTO_SUPPORT"
+ LD64_LTO=1
+ fi
+
+ # CPPFLAGS only affects ld64, cctools don't use 'em (which currently is
+ # what we want)
+ append-cppflags -DNDEBUG
+
+ CCTOOLS_OFLAG=
+ if [[ ${CHOST} == *darwin* && ${CHOST#*-darwin} -le 8 ]] ; then
+ # cctools expect to use UNIX03 struct member names.
+ # This is default on > 10.4. Activate it on <= 10.4 by defining
+ # __DARWIN_UNIX03 explicitly.
+ CCTOOLS_OFLAG="-D__DARWIN_UNIX03=1"
+ fi
+
+ cat <<EOF > ${LD64}/src/configure.h
+#define DEFAULT_MACOSX_MIN_VERSION "${MACOSX_DEPLOYMENT_TARGET}"
+EOF
+}
+
+compile_ld64() {
+ einfo "building ${LD64}"
+ cd "${S}"/${LD64}/src
+ emake \
+ LTO=${LD64_LTO} \
+ || die "emake failed for ld64"
+ use test && emake build_test
+}
+
+compile_cctools() {
+ einfo "building ${CCTOOLS}"
+ cd "${S}"/${CCTOOLS}
+ emake \
+ LIB_PRUNETRIE="-L../../${LD64}/src -lprunetrie" \
+ EFITOOLS= \
+ LTO="${CCTOOLS_LTO}" \
+ COMMON_SUBDIRS='libstuff ar misc otool' \
+ SUBDIRS_32= \
+ LEGACY= \
+ RC_CFLAGS="${CFLAGS}" \
+ OFLAG="${CCTOOLS_OFLAG}" \
+ || die "emake failed for the cctools"
+ cd "${S}"/${CCTOOLS}/as
+ emake \
+ BUILD_OBSOLETE_ARCH= \
+ RC_CFLAGS="-DASLIBEXECDIR=\"\\\"${EPREFIX}${LIBPATH}/\\\"\" ${CFLAGS}" \
+ OFLAG="${CCTOOLS_OFLAG}" \
+ || die "emake failed for as"
+}
+
+src_compile() {
+ compile_ld64
+ compile_cctools
+}
+
+install_ld64() {
+ exeinto ${BINPATH}
+ doexe "${S}"/${LD64}/src/{ld64,rebase,dyldinfo,unwinddump,ObjectDump}
+ dosym ld64 ${BINPATH}/ld
+ insinto ${DATAPATH}/man/man1
+ doins "${S}"/${LD64}/doc/man/man1/{ld,ld64,rebase}.1
+}
+
+install_cctools() {
+ cd "${S}"/${CCTOOLS}
+ emake install_all_but_headers \
+ EFITOOLS= \
+ COMMON_SUBDIRS='ar misc otool' \
+ SUBDIRS_32= \
+ DSTROOT=\"${D}\" \
+ BINDIR=\"${EPREFIX}\"${BINPATH} \
+ LOCBINDIR=\"${EPREFIX}\"${BINPATH} \
+ USRBINDIR=\"${EPREFIX}\"${BINPATH} \
+ LOCLIBDIR=\"${EPREFIX}\"${LIBPATH} \
+ MANDIR=\"${EPREFIX}\"${DATAPATH}/man/
+ cd "${S}"/${CCTOOLS}/as
+ emake install \
+ BUILD_OBSOLETE_ARCH= \
+ DSTROOT=\"${D}\" \
+ USRBINDIR=\"${EPREFIX}\"${BINPATH} \
+ LIBDIR=\"${EPREFIX}\"${LIBPATH} \
+ LOCLIBDIR=\"${EPREFIX}\"${LIBPATH}
+
+ cd "${ED}"${BINPATH}
+ insinto ${DATAPATH}/man/man1
+ local skips manpage
+ # ar brings an up-to-date manpage with it
+ skips=( ar )
+ for bin in *; do
+ for skip in ${skips[@]}; do
+ if [[ ${bin} == ${skip} ]]; then
+ continue 2;
+ fi
+ done
+ manpage=${S}/${CCTOOLS}/man/${bin}.1
+ if [[ -f "${manpage}" ]]; then
+ doins "${manpage}"
+ fi
+ done
+ insinto ${DATAPATH}/man/man5
+ doins "${S}"/${CCTOOLS}/man/*.5
+}
+
+src_test() {
+ if ! [ "${EPREFIX}"/usr/bin/clang ] ; then
+ einfo "Test suite only works properly with clang - please install"
+ return
+ fi
+
+ einfo "Running unit tests"
+ cd "${S}"/${LD64}/unit-tests/test-cases
+ # provide the new ld as a symlink to clang so that -ccc-install-dir
+ # will pick it up
+ ln -sfn ../../src/ld64 ld
+ # use our arch command because the System's will report i386 even for an
+ # x86_64 prefix
+ perl ../bin/make-recursive.pl \
+ BUILT_PRODUCTS_DIR="${S}"/${LD64}/src \
+ ARCH="$(arch)" \
+ LD="${S}"/${LD64}/src/ld64 \
+ CC="clang -ccc-install-dir $PWD" \
+ CXX="clang++ -ccc-install-dir $PWD" \
+ OTOOL="${S}"/${CCTOOLS}/otool/otool.NEW \
+ | perl ../bin/result-filter.pl
+}
+
+src_install() {
+ install_ld64
+ install_cctools
+
+ cd "${S}"
+ insinto /etc/env.d/binutils
+ cat <<-EOF > env.d
+ TARGET="${CHOST}"
+ VER="${PV}"
+ FAKE_TARGETS="${CHOST}"
+ EOF
+ newins env.d ${CHOST}-${PV}
+}
+
+pkg_postinst() {
+ binutils-config ${CHOST}-${PV}
+}
diff --git a/sys-devel/binutils-apple/binutils-apple-4.2.ebuild b/sys-devel/binutils-apple/binutils-apple-4.2.ebuild
new file mode 100644
index 00000000000..42439672c4d
--- /dev/null
+++ b/sys-devel/binutils-apple/binutils-apple-4.2.ebuild
@@ -0,0 +1,312 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="3"
+
+inherit eutils flag-o-matic toolchain-funcs
+
+RESTRICT="test" # the test suite will test what's installed.
+
+LD64=ld64-127.2
+CCTOOLS=cctools-809
+LIBUNWIND=libunwind-30
+DYLD=dyld-195.5
+# http://lists.apple.com/archives/Darwin-dev/2009/Sep/msg00025.html
+UNWIND=binutils-apple-3.2-unwind-patches-5
+
+DESCRIPTION="Darwin assembler as(1) and static linker ld(1), Xcode Tools ${PV}"
+HOMEPAGE="http://www.opensource.apple.com/darwinsource/"
+SRC_URI="http://www.opensource.apple.com/tarballs/ld64/${LD64}.tar.gz
+ http://www.opensource.apple.com/tarballs/cctools/${CCTOOLS}.tar.gz
+ http://www.opensource.apple.com/tarballs/libunwind/${LIBUNWIND}.tar.gz
+ http://www.opensource.apple.com/tarballs/dyld/${DYLD}.tar.gz
+ http://www.gentoo.org/~grobian/distfiles/${UNWIND}.tar.xz
+ http://www.gentoo.org/~grobian/distfiles/libunwind-llvm-115426.tar.bz2"
+
+LICENSE="APSL-2"
+KEYWORDS="~ppc-macos ~x64-macos ~x86-macos"
+IUSE="lto test"
+
+RDEPEND="sys-devel/binutils-config
+ lto? ( sys-devel/llvm )"
+DEPEND="${RDEPEND}
+ test? ( >=dev-lang/perl-5.8.8 )
+ >=sys-devel/gcc-apple-4.2.1"
+
+export CTARGET=${CTARGET:-${CHOST}}
+if [[ ${CTARGET} == ${CHOST} ]] ; then
+ if [[ ${CATEGORY} == cross-* ]] ; then
+ export CTARGET=${CATEGORY#cross-}
+ fi
+fi
+is_cross() { [[ ${CHOST} != ${CTARGET} ]] ; }
+
+if is_cross ; then
+ SLOT="${CTARGET}-4"
+else
+ SLOT="4"
+fi
+
+LIBPATH=/usr/$(get_libdir)/binutils/${CTARGET}/${PV}
+INCPATH=${LIBPATH}/include
+DATAPATH=/usr/share/binutils-data/${CTARGET}/${PV}
+if is_cross ; then
+ BINPATH=/usr/${CHOST}/${CTARGET}/binutils-bin/${PV}
+else
+ BINPATH=/usr/${CTARGET}/binutils-bin/${PV}
+fi
+
+S=${WORKDIR}
+
+src_prepare() {
+ cd "${S}"/${LIBUNWIND}/src
+ cp "${FILESDIR}"/${LIBUNWIND}-Makefile Makefile
+
+ cd "${S}"/${LD64}/src
+ cp "${FILESDIR}"/ld64-123.2-Makefile Makefile
+ epatch "${FILESDIR}"/${LD64}-lto.patch
+ epatch "${FILESDIR}"/${LD64}-ppc-range-warning.patch
+
+ ln -s ../../${CCTOOLS}/include
+ cp other/prune_trie.h include/mach-o/ || die
+ # use our own copy of lto.h, which doesn't require llvm build-env
+ mkdir -p include/llvm-c || die
+ cp "${WORKDIR}"/ld64-unwind/ld64-97.14-llvm-lto.h include/llvm-c/lto.h || die
+ # make libunwind sources known
+ ln -s ../../${LIBUNWIND}/src libunwind || die
+ cp ../../${LIBUNWIND}/include/*.h include/ || die
+ # mimic OS X Lion-style Availability.h macros
+ if [[ ${CHOST} == *darwin* && ${CHOST#*-darwin} -le 10 ]] ; then
+ {
+ echo "#define __OSX_AVAILABLE_STARTING(x,y) "
+ echo "#define __OSX_AVAILABLE_BUT_DEPRECATED(a,b,c,d) "
+ } > include/Availability.h
+ fi
+
+ echo '' > configure.h
+ echo '' > linker_opts
+ local VER_STR="\"@(#)PROGRAM:ld PROJECT:${LD64} (Gentoo ${PN}-${PVR})\\n\""
+ echo "char ldVersionString[] = ${VER_STR};" > version.cpp
+
+ epatch "${FILESDIR}"/ld64-123.2-debug-backtrace.patch
+ if [[ ${CHOST} == powerpc*-darwin* ]] ; then
+ epatch "${FILESDIR}"/ld64-123.2-darwin8-no-mlong-branch-warning.patch
+ sed -i -e '/#include <mach-o\/loader.h>/a\#include <mach/i386/thread_status.h>' \
+ ld/HeaderAndLoadCommands.hpp || die
+ fi
+ if use !lto ; then
+ sed -i -e '/#define LTO_SUPPORT 1/d' other/ObjectDump.cpp || die
+ fi
+
+ cd "${S}"/${CCTOOLS}
+ epatch "${FILESDIR}"/${PN}-4.0-as.patch
+ epatch "${FILESDIR}"/${PN}-4.2-as-dir.patch
+ epatch "${FILESDIR}"/${PN}-3.2.3-ranlib.patch
+ epatch "${FILESDIR}"/${PN}-3.1.1-libtool-ranlib.patch
+ epatch "${FILESDIR}"/${PN}-3.1.1-nmedit.patch
+ epatch "${FILESDIR}"/${PN}-3.1.1-no-headers.patch
+ epatch "${FILESDIR}"/${PN}-4.0-no-oss-dir.patch
+ epatch "${FILESDIR}"/${PN}-4.2-lto.patch
+
+ local program
+ for program in ar efitools gprof libmacho misc otool ; do
+ VER_STR="@(#)PROGRAM:${program} PROJECT:${CCTOOLS} (Gentoo ${PN}-${PVR}) DEVELOPER:${PORTAGE_ROOT_USER} BUILT:$(date)"
+ cat > ${program}/vers.c <<- _EOF
+ #include <sys/cdefs.h>
+ __IDSTRING(SGS_VERS,"${VER_STR}\n");
+ _EOF
+ [[ ${program} != "libmacho" ]] && \
+ echo '__IDSTRING(VERS_NUM,"apple");' >> ${program}/vers.c
+ done
+
+ VER_STR="${CCTOOLS} (Gentoo ${PN}-${PVR})"
+ echo "const char apple_version[] = \"${VER_STR}\";" \
+ >> as/apple_version.c || die
+ echo "const char apple_version[] = \"${VER_STR})\";" \
+ >> efitools/vers.c || die
+ echo "const char apple_version[] = \"${VER_STR})\";" \
+ >> ld/ld_vers.c || die
+ echo "const char apple_version[] = \"${VER_STR})\";" \
+ >> misc/vers.c || die
+
+ # clean up test suite
+ cd "${S}"/${LD64}
+# epatch "${FILESDIR}"/${PN}-3.1.1-testsuite.patch
+
+ cd "${S}"/${LD64}/unit-tests/test-cases
+ local c
+
+ # we don't have llvm
+ ((++c)); rm -rf llvm-integration;
+
+ # we don't have dtrace
+ ((++c)); rm -rf dtrace-static-probes-coalescing;
+ ((++c)); rm -rf dtrace-static-probes;
+
+ # a file is missing
+ ((++c)); rm -rf eh-coalescing-r
+
+ # we don't do universal binaries
+ ((++c)); rm -rf blank-stubs;
+
+ # looks like a problem with apple's result-filter.pl
+ ((++c)); rm -rf implicit-common3;
+ ((++c)); rm -rf order_file-ans;
+
+ # TODO no idea what goes wrong here
+ ((++c)); rm -rf dwarf-debug-notes;
+
+ einfo "Deleted $c tests that were bound to fail"
+
+ cd "${S}"
+ ebegin "cleaning Makefiles from unwanted CFLAGS"
+ find . -name "Makefile" -print0 | xargs -0 sed \
+ -i \
+ -e 's/ -g / /g' \
+ -e 's/^OFLAG =.*$/OFLAG =/' \
+ -e 's/install -c -s/install/g'
+ eend $?
+
+ # -pg is used and the two are incompatible
+ filter-flags -fomit-frame-pointer
+}
+
+src_configure() {
+ tc-export CC CXX AR
+ if use lto ; then
+ append-cppflags -DLTO_SUPPORT
+ append-ldflags -L"${EPREFIX}"/usr/$(get_libdir)/llvm
+ append-libs LTO
+ LTO=1
+ else
+ append-cppflags -ULTO_SUPPORT
+ LTO=0
+ fi
+ append-cppflags -DNDEBUG
+ append-cppflags -I"${WORKDIR}"/libunwind/include
+}
+
+compile_libunwind() {
+ # not used, just for testing, and possible use in the future
+ einfo "building ${LIBUNWIND}"
+ cd "${S}"/${LIBUNWIND}/src
+ emake DYLDINCS=-I../../${DYLD}/include || die
+}
+
+compile_ld64() {
+ einfo "building ${LD64}"
+ cd "${S}"/${LD64}/src
+ # remove antiquated copy that's available on any OSX system and
+ # breaks ld64 compilation
+ mv include/mach-o/dyld.h{,.disable}
+ emake \
+ LTO=${LTO} \
+ CFLAGS="${CFLAGS}" \
+ CXXFLAGS="${CXXFLAGS} -I../../${DYLD}/include" \
+ LDFLAGS="${LDFLAGS} ${LIBS}" \
+ || die "emake failed for ld64"
+ use test && emake build_test
+ # restore, it's necessary for cctools' install
+ mv include/mach-o/dyld.h{.disable,}
+}
+
+compile_cctools() {
+ einfo "building ${CCTOOLS}"
+ cd "${S}"/${CCTOOLS}
+ emake \
+ LIB_PRUNETRIE="-L../../${LD64}/src -lprunetrie" \
+ EFITOOLS= LTO= \
+ COMMON_SUBDIRS='libstuff ar misc otool' \
+ SUBDIRS_32= \
+ RC_CFLAGS="${CFLAGS}" OFLAG="${CFLAGS}" \
+ || die "emake failed for the cctools"
+ cd "${S}"/${CCTOOLS}/as
+ emake \
+ BUILD_OBSOLETE_ARCH= \
+ RC_CFLAGS="-DASLIBEXECDIR=\"\\\"${EPREFIX}${LIBPATH}/\\\"\" ${CFLAGS}" \
+ || die "emake failed for as"
+}
+
+src_compile() {
+ compile_ld64
+ compile_cctools
+}
+
+install_ld64() {
+ exeinto ${BINPATH}
+ doexe "${S}"/${LD64}/src/{ld64,rebase,dyldinfo,unwinddump,ObjectDump}
+ dosym ld64 ${BINPATH}/ld
+ insinto ${DATAPATH}/man/man1
+ doins "${S}"/${LD64}/doc/man/man1/{ld,ld64,rebase}.1
+}
+
+install_cctools() {
+ cd "${S}"/${CCTOOLS}
+ emake install_all_but_headers \
+ EFITOOLS= LTO= \
+ COMMON_SUBDIRS='ar misc otool' \
+ SUBDIRS_32= \
+ RC_CFLAGS="${CFLAGS}" OFLAG="${CFLAGS}" \
+ DSTROOT=\"${D}\" \
+ BINDIR=\"${EPREFIX}\"${BINPATH} \
+ LOCBINDIR=\"${EPREFIX}\"${BINPATH} \
+ USRBINDIR=\"${EPREFIX}\"${BINPATH} \
+ LOCLIBDIR=\"${EPREFIX}\"${LIBPATH} \
+ MANDIR=\"${EPREFIX}\"${DATAPATH}/man/
+ cd "${S}"/${CCTOOLS}/as
+ emake install \
+ BUILD_OBSOLETE_ARCH= \
+ DSTROOT=\"${D}\" \
+ USRBINDIR=\"${EPREFIX}\"${BINPATH} \
+ LIBDIR=\"${EPREFIX}\"${LIBPATH} \
+ LOCLIBDIR=\"${EPREFIX}\"${LIBPATH}
+
+ cd "${ED}"${BINPATH}
+ insinto ${DATAPATH}/man/man1
+ local skips manpage
+ # ar brings an up-to-date manpage with it
+ skips=( ar )
+ for bin in *; do
+ for skip in ${skips[@]}; do
+ if [[ ${bin} == ${skip} ]]; then
+ continue 2;
+ fi
+ done
+ manpage=${S}/${CCTOOLS}/man/${bin}.1
+ if [[ -f "${manpage}" ]]; then
+ doins "${manpage}"
+ fi
+ done
+ insinto ${DATAPATH}/man/man5
+ doins "${S}"/${CCTOOLS}/man/*.5
+}
+
+src_test() {
+ einfo "Running unit tests"
+ cd "${S}"/${LD64}/unit-tests/test-cases
+ # need host arch, since GNU arch doesn't do what Apple's does
+ tc-export CC CXX
+ perl ../bin/make-recursive.pl \
+ ARCH="$(/usr/bin/arch)" \
+ RELEASEDIR="${S}"/${LD64}/src \
+ | perl ../bin/result-filter.pl
+}
+
+src_install() {
+ install_ld64
+ install_cctools
+
+ cd "${S}"
+ insinto /etc/env.d/binutils
+ cat <<-EOF > env.d
+ TARGET="${CHOST}"
+ VER="${PV}"
+ FAKE_TARGETS="${CHOST}"
+ EOF
+ newins env.d ${CHOST}-${PV}
+}
+
+pkg_postinst() {
+ binutils-config ${CHOST}-${PV}
+}
diff --git a/sys-devel/binutils-apple/binutils-apple-4.3-r1.ebuild b/sys-devel/binutils-apple/binutils-apple-4.3-r1.ebuild
new file mode 100644
index 00000000000..5594369e4d9
--- /dev/null
+++ b/sys-devel/binutils-apple/binutils-apple-4.3-r1.ebuild
@@ -0,0 +1,316 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="3"
+
+inherit eutils flag-o-matic toolchain-funcs
+
+LD64=ld64-128.2
+CCTOOLS_VERSION=822
+CCTOOLS=cctools-${CCTOOLS_VERSION}
+CCTOOLS_HEADERS=cctools-855
+LIBUNWIND=libunwind-30
+DYLD=dyld-195.6
+
+DESCRIPTION="Darwin assembler as(1) and static linker ld(1), Xcode Tools ${PV}"
+HOMEPAGE="http://www.opensource.apple.com/darwinsource/"
+SRC_URI="http://www.opensource.apple.com/tarballs/ld64/${LD64}.tar.gz
+ http://www.opensource.apple.com/tarballs/cctools/${CCTOOLS}.tar.gz
+ http://www.opensource.apple.com/tarballs/cctools/${CCTOOLS_HEADERS}.tar.gz
+ http://www.opensource.apple.com/tarballs/libunwind/${LIBUNWIND}.tar.gz
+ http://www.opensource.apple.com/tarballs/dyld/${DYLD}.tar.gz"
+
+LICENSE="APSL-2"
+KEYWORDS="~x64-macos ~x86-macos"
+IUSE="lto test"
+
+RDEPEND="sys-devel/binutils-config
+ lto? ( sys-devel/llvm )"
+DEPEND="${RDEPEND}
+ test? ( >=dev-lang/perl-5.8.8 )
+ || ( >=sys-devel/gcc-apple-4.2.1 sys-devel/llvm )"
+
+export CTARGET=${CTARGET:-${CHOST}}
+if [[ ${CTARGET} == ${CHOST} ]] ; then
+ if [[ ${CATEGORY} == cross-* ]] ; then
+ export CTARGET=${CATEGORY#cross-}
+ fi
+fi
+is_cross() { [[ ${CHOST} != ${CTARGET} ]] ; }
+
+if is_cross ; then
+ SLOT="${CTARGET}-4"
+else
+ SLOT="4"
+fi
+
+LIBPATH=/usr/$(get_libdir)/binutils/${CTARGET}/${PV}
+INCPATH=${LIBPATH}/include
+DATAPATH=/usr/share/binutils-data/${CTARGET}/${PV}
+if is_cross ; then
+ BINPATH=/usr/${CHOST}/${CTARGET}/binutils-bin/${PV}
+else
+ BINPATH=/usr/${CTARGET}/binutils-bin/${PV}
+fi
+
+S=${WORKDIR}
+
+src_prepare() {
+ cd "${S}"/${LD64}/src
+ cp "${FILESDIR}"/ld64-128.2-Makefile-2 Makefile
+ epatch "${FILESDIR}"/ld64-127.2-lto.patch
+ epatch "${FILESDIR}"/ld64-128.2-stdlib.patch
+ epatch "${FILESDIR}"/ld64-241.9-register-names.patch
+ epatch "${FILESDIR}"/ld64-241.9-get-comm-align.patch
+ epatch "${FILESDIR}"/ld64-241.9-cc_md5.patch
+ epatch "${FILESDIR}"/ld64-128.2-1010.patch
+
+ # We used to use our own copy of lto.h, which doesn't require llvm
+ # build-env. Current versions of llvm provide
+ # $EPREFIX/usr/include/llvm-c/lto.h as well as
+ # $EPREFIX/usr/lib/libLTO.{so,dylib}, so we just use these.
+
+ # provide missing headers from libunwind and dyld
+ mkdir -p include/{mach,mach-o/arm} || die
+ # never present because it's private
+ cp ../../${DYLD}/include/mach-o/dyld_priv.h include/mach-o || die
+ # missing on <= 10.5
+ cp ../../${LIBUNWIND}/include/libunwind.h include/ || die
+ cp ../../${LIBUNWIND}/include/mach-o/compact_unwind_encoding.h include/mach-o || die
+ # missing on <= 10.4
+ cp ../../${DYLD}/include/mach-o/dyld_images.h include/mach-o || die
+ cp ../../${CCTOOLS}/include/mach-o/loader.h include/mach-o || die
+ # use copies from cctools because they're otherwise hidden in some SDK
+ cp ../../${CCTOOLS}/include/mach-o/arm/reloc.h include/mach-o/arm || die
+ # provide all required CPU_TYPEs on all platforms
+ cp ../../${CCTOOLS}/include/mach/machine.h include/mach/machine.h
+ # add alias for newer identifiers, because ld64 uses both but cctools
+ # header only defines the older
+ epatch "${FILESDIR}"/ld64-236.3-missing-cputypes.patch
+
+ # mimic OS X Leopard-style Availability.h macros for libunwind.h on
+ # older systems
+ [[ ${CHOST} == *darwin* && ${CHOST#*-darwin} -le 8 ]] && \
+ echo "#define __OSX_AVAILABLE_STARTING(x,y) " > include/Availability.h
+
+ local VER_STR="\"@(#)PROGRAM:ld PROJECT:${LD64} (Gentoo ${PN}-${PVR})\\n\""
+ echo "char ldVersionString[] = ${VER_STR};" > version.cpp
+
+ epatch "${FILESDIR}"/ld64-123.2-debug-backtrace.patch
+
+ cd "${S}"/${CCTOOLS}
+ epatch "${FILESDIR}"/${PN}-4.0-as.patch
+ epatch "${FILESDIR}"/${PN}-4.2-as-dir.patch
+ epatch "${FILESDIR}"/${PN}-3.2.3-ranlib.patch
+ epatch "${FILESDIR}"/${PN}-3.1.1-libtool-ranlib.patch
+ epatch "${FILESDIR}"/${PN}-3.1.1-nmedit.patch
+ epatch "${FILESDIR}"/${PN}-3.1.1-no-headers.patch
+ epatch "${FILESDIR}"/${PN}-4.0-no-oss-dir.patch
+ epatch "${FILESDIR}"/${PN}-4.2-lto.patch
+ epatch "${FILESDIR}"/${PN}-5.1-extraneous-includes.patch
+ cp ../${LD64}/src/other/prune_trie.h include/mach-o/ || die
+ # __darwin_i386_float_state missing on <= 10.4
+ cp -a ../${CCTOOLS_HEADERS}/include/mach/i386 include/mach
+
+ # do not build profileable libstuff to save compile time
+ sed -i -e "/^all:/s, profile , ," libstuff/Makefile
+
+ # cctools version is provided to make via RC_ProjectSourceVersion which
+ # generates and compiles it as apple_version[] into libstuff. From
+ # there it's picked up by the individual tools. Since
+ # RC_ProjectSourceVersion is also used as library version, we can't
+ # just append our local version info. So we hack the libstuff Makefile
+ # to include our Gentoo version.
+ sed -i -e "/cctools-.*(RC_ProjectSourceVersion).*OFILE_DIR/s,Version),Version) (Gentoo ${PN}-${PVR})," \
+ libstuff/Makefile
+
+ # clean up test suite
+ cd "${S}"/${LD64}/unit-tests/test-cases
+ local c
+
+ # we don't have llvm
+ ((++c)); rm -rf llvm-integration;
+
+ # we don't have dtrace
+ ((++c)); rm -rf dtrace-static-probes-coalescing;
+ ((++c)); rm -rf dtrace-static-probes;
+
+ # a file is missing
+ ((++c)); rm -rf eh-coalescing-r
+
+ # we don't do universal binaries
+ ((++c)); rm -rf blank-stubs;
+
+ # looks like a problem with apple's result-filter.pl
+ ((++c)); rm -rf implicit-common3;
+ ((++c)); rm -rf order_file-ans;
+
+ # TODO no idea what goes wrong here
+ ((++c)); rm -rf dwarf-debug-notes;
+
+ einfo "Deleted $c tests that were bound to fail"
+
+ cd "${S}"
+ ebegin "cleaning Makefiles from unwanted CFLAGS"
+ find . -name "Makefile" -print0 | xargs -0 sed \
+ -i \
+ -e 's/ -g / /g' \
+ -e 's/^G =.*$/G =/' \
+ -e 's/^OFLAG =.*$/OFLAG =/' \
+ -e 's/install -c -s/install/g'
+ eend $?
+}
+
+src_configure() {
+ CCTOOLS_LTO=
+ LD64_LTO=0
+ if use lto ; then
+ CCTOOLS_LTO="-DLTO_SUPPORT"
+ LD64_LTO=1
+ fi
+
+ # CPPFLAGS only affects ld64, cctools don't use 'em (which currently is
+ # what we want)
+ append-cppflags -DNDEBUG
+
+ CCTOOLS_OFLAG=
+ if [[ ${CHOST} == *darwin* && ${CHOST#*-darwin} -le 8 ]] ; then
+ # cctools expect to use UNIX03 struct member names.
+ # This is default on > 10.4. Activate it on <= 10.4 by defining
+ # __DARWIN_UNIX03 explicitly.
+ CCTOOLS_OFLAG="-D__DARWIN_UNIX03=1"
+ fi
+
+ cat <<EOF > ${LD64}/src/configure.h
+#define DEFAULT_MACOSX_MIN_VERSION "${MACOSX_DEPLOYMENT_TARGET}"
+EOF
+}
+
+compile_ld64() {
+ einfo "building ${LD64}"
+ cd "${S}"/${LD64}/src
+ emake \
+ LTO=${LD64_LTO} \
+ || die "emake failed for ld64"
+ use test && emake build_test
+}
+
+compile_cctools() {
+ einfo "building ${CCTOOLS}"
+ cd "${S}"/${CCTOOLS}
+ # -j1 because it fails too often with weird errors
+ emake \
+ LIB_PRUNETRIE="-L../../${LD64}/src -lprunetrie" \
+ EFITOOLS= \
+ LTO="${CCTOOLS_LTO}" \
+ COMMON_SUBDIRS='libstuff ar misc otool' \
+ SUBDIRS_32= \
+ LEGACY= \
+ RC_ProjectSourceVersion=${CCTOOLS_VERSION} \
+ RC_CFLAGS="${CFLAGS}" \
+ OFLAG="${CCTOOLS_OFLAG}" \
+ -j1 \
+ || die "emake failed for the cctools"
+ cd "${S}"/${CCTOOLS}/as
+ emake \
+ BUILD_OBSOLETE_ARCH= \
+ RC_ProjectSourceVersion=${CCTOOLS_VERSION} \
+ RC_CFLAGS="-DASLIBEXECDIR=\"\\\"${EPREFIX}${LIBPATH}/\\\"\" ${CFLAGS}" \
+ OFLAG="${CCTOOLS_OFLAG}" \
+ || die "emake failed for as"
+}
+
+src_compile() {
+ compile_ld64
+ compile_cctools
+}
+
+install_ld64() {
+ exeinto ${BINPATH}
+ doexe "${S}"/${LD64}/src/{ld64,rebase,dyldinfo,unwinddump,ObjectDump}
+ dosym ld64 ${BINPATH}/ld
+ insinto ${DATAPATH}/man/man1
+ doins "${S}"/${LD64}/doc/man/man1/{ld,ld64,rebase}.1
+}
+
+install_cctools() {
+ cd "${S}"/${CCTOOLS}
+ emake install_all_but_headers \
+ EFITOOLS= \
+ COMMON_SUBDIRS='ar misc otool' \
+ SUBDIRS_32= \
+ DSTROOT=\"${D}\" \
+ BINDIR=\"${EPREFIX}\"${BINPATH} \
+ LOCBINDIR=\"${EPREFIX}\"${BINPATH} \
+ USRBINDIR=\"${EPREFIX}\"${BINPATH} \
+ LOCLIBDIR=\"${EPREFIX}\"${LIBPATH} \
+ MANDIR=\"${EPREFIX}\"${DATAPATH}/man/
+ cd "${S}"/${CCTOOLS}/as
+ emake install \
+ BUILD_OBSOLETE_ARCH= \
+ DSTROOT=\"${D}\" \
+ USRBINDIR=\"${EPREFIX}\"${BINPATH} \
+ LIBDIR=\"${EPREFIX}\"${LIBPATH} \
+ LOCLIBDIR=\"${EPREFIX}\"${LIBPATH}
+
+ cd "${ED}"${BINPATH}
+ insinto ${DATAPATH}/man/man1
+ local skips manpage
+ # ar brings an up-to-date manpage with it
+ skips=( ar )
+ for bin in *; do
+ for skip in ${skips[@]}; do
+ if [[ ${bin} == ${skip} ]]; then
+ continue 2;
+ fi
+ done
+ manpage=${S}/${CCTOOLS}/man/${bin}.1
+ if [[ -f "${manpage}" ]]; then
+ doins "${manpage}"
+ fi
+ done
+ insinto ${DATAPATH}/man/man5
+ doins "${S}"/${CCTOOLS}/man/*.5
+}
+
+src_test() {
+ if ! [ "${EPREFIX}"/usr/bin/clang ] ; then
+ einfo "Test suite only works properly with clang - please install"
+ return
+ fi
+
+ einfo "Running unit tests"
+ cd "${S}"/${LD64}/unit-tests/test-cases
+ # provide the new ld as a symlink to clang so that -ccc-install-dir
+ # will pick it up
+ ln -sfn ../../src/ld64 ld
+ # use our arch command because the System's will report i386 even for an
+ # x86_64 prefix
+ perl ../bin/make-recursive.pl \
+ BUILT_PRODUCTS_DIR="${S}"/${LD64}/src \
+ ARCH="$(arch)" \
+ LD="${S}"/${LD64}/src/ld64 \
+ CC="clang -ccc-install-dir $PWD" \
+ CXX="clang++ -ccc-install-dir $PWD" \
+ OTOOL="${S}"/${CCTOOLS}/otool/otool.NEW \
+ | perl ../bin/result-filter.pl
+}
+
+src_install() {
+ install_ld64
+ install_cctools
+
+ cd "${S}"
+ insinto /etc/env.d/binutils
+ cat <<-EOF > env.d
+ TARGET="${CHOST}"
+ VER="${PV}"
+ FAKE_TARGETS="${CHOST}"
+ EOF
+ newins env.d ${CHOST}-${PV}
+}
+
+pkg_postinst() {
+ binutils-config ${CHOST}-${PV}
+}
diff --git a/sys-devel/binutils-apple/binutils-apple-4.3.ebuild b/sys-devel/binutils-apple/binutils-apple-4.3.ebuild
new file mode 100644
index 00000000000..4a0809df76d
--- /dev/null
+++ b/sys-devel/binutils-apple/binutils-apple-4.3.ebuild
@@ -0,0 +1,309 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="3"
+
+inherit eutils flag-o-matic toolchain-funcs
+
+RESTRICT="test" # the test suite will test what's installed.
+
+LD64=ld64-128.2
+CCTOOLS=cctools-822
+LIBUNWIND=libunwind-30
+DYLD=dyld-195.6
+# http://lists.apple.com/archives/Darwin-dev/2009/Sep/msg00025.html
+UNWIND=binutils-apple-3.2-unwind-patches-5
+
+DESCRIPTION="Darwin assembler as(1) and static linker ld(1), Xcode Tools ${PV}"
+HOMEPAGE="http://www.opensource.apple.com/darwinsource/"
+SRC_URI="http://www.opensource.apple.com/tarballs/ld64/${LD64}.tar.gz
+ http://www.opensource.apple.com/tarballs/cctools/${CCTOOLS}.tar.gz
+ http://www.opensource.apple.com/tarballs/libunwind/${LIBUNWIND}.tar.gz
+ http://www.opensource.apple.com/tarballs/dyld/${DYLD}.tar.gz
+ http://www.gentoo.org/~grobian/distfiles/${UNWIND}.tar.xz
+ http://www.gentoo.org/~grobian/distfiles/libunwind-llvm-115426.tar.bz2"
+
+LICENSE="APSL-2"
+KEYWORDS="~x64-macos ~x86-macos"
+IUSE="lto test"
+
+RDEPEND="sys-devel/binutils-config
+ lto? ( sys-devel/llvm )"
+DEPEND="${RDEPEND}
+ test? ( >=dev-lang/perl-5.8.8 )
+ >=sys-devel/gcc-apple-4.2.1"
+
+export CTARGET=${CTARGET:-${CHOST}}
+if [[ ${CTARGET} == ${CHOST} ]] ; then
+ if [[ ${CATEGORY} == cross-* ]] ; then
+ export CTARGET=${CATEGORY#cross-}
+ fi
+fi
+is_cross() { [[ ${CHOST} != ${CTARGET} ]] ; }
+
+if is_cross ; then
+ SLOT="${CTARGET}-4"
+else
+ SLOT="4"
+fi
+
+LIBPATH=/usr/$(get_libdir)/binutils/${CTARGET}/${PV}
+INCPATH=${LIBPATH}/include
+DATAPATH=/usr/share/binutils-data/${CTARGET}/${PV}
+if is_cross ; then
+ BINPATH=/usr/${CHOST}/${CTARGET}/binutils-bin/${PV}
+else
+ BINPATH=/usr/${CTARGET}/binutils-bin/${PV}
+fi
+
+S=${WORKDIR}
+
+src_prepare() {
+ cd "${S}"/${LIBUNWIND}/src
+ cp "${FILESDIR}"/${LIBUNWIND}-Makefile Makefile
+
+ cd "${S}"/${LD64}/src
+ cp "${FILESDIR}"/ld64-128.2-Makefile Makefile
+ epatch "${FILESDIR}"/ld64-127.2-lto.patch
+ epatch "${FILESDIR}"/ld64-128.2-stdlib.patch
+
+ ln -s ../../${CCTOOLS}/include
+ cp other/prune_trie.h include/mach-o/ || die
+ # use our own copy of lto.h, which doesn't require llvm build-env
+ mkdir -p include/llvm-c || die
+ cp "${WORKDIR}"/ld64-unwind/ld64-97.14-llvm-lto.h include/llvm-c/lto.h || die
+ # make libunwind sources known
+ ln -s ../../${LIBUNWIND}/src libunwind || die
+ cp ../../${LIBUNWIND}/include/*.h include/ || die
+ # mimic OS X Lion-style Availability.h macros
+ if [[ ${CHOST} == *darwin* && ${CHOST#*-darwin} -le 10 ]] ; then
+ {
+ echo "#define __OSX_AVAILABLE_STARTING(x,y) "
+ echo "#define __OSX_AVAILABLE_BUT_DEPRECATED(a,b,c,d) "
+ } > include/Availability.h
+ fi
+
+ echo '' > configure.h
+ echo '' > linker_opts
+ local VER_STR="\"@(#)PROGRAM:ld PROJECT:${LD64} (Gentoo ${PN}-${PVR})\\n\""
+ echo "char ldVersionString[] = ${VER_STR};" > version.cpp
+
+ epatch "${FILESDIR}"/ld64-123.2-debug-backtrace.patch
+ if use !lto ; then
+ sed -i -e '/#define LTO_SUPPORT 1/d' other/ObjectDump.cpp || die
+ fi
+
+ cd "${S}"/${CCTOOLS}
+ epatch "${FILESDIR}"/${PN}-4.0-as.patch
+ epatch "${FILESDIR}"/${PN}-4.2-as-dir.patch
+ epatch "${FILESDIR}"/${PN}-3.2.3-ranlib.patch
+ epatch "${FILESDIR}"/${PN}-3.1.1-libtool-ranlib.patch
+ epatch "${FILESDIR}"/${PN}-3.1.1-nmedit.patch
+ epatch "${FILESDIR}"/${PN}-3.1.1-no-headers.patch
+ epatch "${FILESDIR}"/${PN}-4.0-no-oss-dir.patch
+ epatch "${FILESDIR}"/${PN}-4.2-lto.patch
+
+ local program
+ for program in ar efitools gprof libmacho misc otool ; do
+ VER_STR="@(#)PROGRAM:${program} PROJECT:${CCTOOLS} (Gentoo ${PN}-${PVR}) DEVELOPER:${PORTAGE_ROOT_USER} BUILT:$(date)"
+ cat > ${program}/vers.c <<- _EOF
+ #include <sys/cdefs.h>
+ __IDSTRING(SGS_VERS,"${VER_STR}\n");
+ _EOF
+ [[ ${program} != "libmacho" ]] && \
+ echo '__IDSTRING(VERS_NUM,"apple");' >> ${program}/vers.c
+ done
+
+ VER_STR="${CCTOOLS} (Gentoo ${PN}-${PVR})"
+ echo "const char apple_version[] = \"${VER_STR}\";" \
+ >> as/apple_version.c || die
+ echo "const char apple_version[] = \"${VER_STR})\";" \
+ >> efitools/vers.c || die
+ echo "const char apple_version[] = \"${VER_STR})\";" \
+ >> ld/ld_vers.c || die
+ echo "const char apple_version[] = \"${VER_STR})\";" \
+ >> misc/vers.c || die
+
+ # clean up test suite
+ cd "${S}"/${LD64}
+# epatch "${FILESDIR}"/${PN}-3.1.1-testsuite.patch
+
+ cd "${S}"/${LD64}/unit-tests/test-cases
+ local c
+
+ # we don't have llvm
+ ((++c)); rm -rf llvm-integration;
+
+ # we don't have dtrace
+ ((++c)); rm -rf dtrace-static-probes-coalescing;
+ ((++c)); rm -rf dtrace-static-probes;
+
+ # a file is missing
+ ((++c)); rm -rf eh-coalescing-r
+
+ # we don't do universal binaries
+ ((++c)); rm -rf blank-stubs;
+
+ # looks like a problem with apple's result-filter.pl
+ ((++c)); rm -rf implicit-common3;
+ ((++c)); rm -rf order_file-ans;
+
+ # TODO no idea what goes wrong here
+ ((++c)); rm -rf dwarf-debug-notes;
+
+ einfo "Deleted $c tests that were bound to fail"
+
+ cd "${S}"
+ ebegin "cleaning Makefiles from unwanted CFLAGS"
+ find . -name "Makefile" -print0 | xargs -0 sed \
+ -i \
+ -e 's/ -g / /g' \
+ -e 's/^OFLAG =.*$/OFLAG =/' \
+ -e 's/install -c -s/install/g'
+ eend $?
+
+ # -pg is used and the two are incompatible
+ filter-flags -fomit-frame-pointer
+}
+
+src_configure() {
+ tc-export CC CXX AR
+ if use lto ; then
+ append-cppflags -DLTO_SUPPORT
+ append-ldflags -L"${EPREFIX}"/usr/$(get_libdir)/llvm
+ append-libs LTO
+ LTO=1
+ else
+ append-cppflags -ULTO_SUPPORT
+ LTO=0
+ fi
+ append-cppflags -DNDEBUG
+ append-cppflags -I"${WORKDIR}"/libunwind/include
+}
+
+compile_libunwind() {
+ # not used, just for testing, and possible use in the future
+ einfo "building ${LIBUNWIND}"
+ cd "${S}"/${LIBUNWIND}/src
+ emake DYLDINCS=-I../../${DYLD}/include || die
+}
+
+compile_ld64() {
+ einfo "building ${LD64}"
+ cd "${S}"/${LD64}/src
+ # remove antiquated copy that's available on any OSX system and
+ # breaks ld64 compilation
+ mv include/mach-o/dyld.h{,.disable}
+ emake \
+ LTO=${LTO} \
+ CFLAGS="${CFLAGS}" \
+ CXXFLAGS="${CXXFLAGS} -I../../${DYLD}/include" \
+ LDFLAGS="${LDFLAGS} ${LIBS}" \
+ || die "emake failed for ld64"
+ use test && emake build_test
+ # restore, it's necessary for cctools' install
+ mv include/mach-o/dyld.h{.disable,}
+}
+
+compile_cctools() {
+ einfo "building ${CCTOOLS}"
+ cd "${S}"/${CCTOOLS}
+ # -j1 because it fails too often with weird errors
+ emake \
+ LIB_PRUNETRIE="-L../../${LD64}/src -lprunetrie" \
+ EFITOOLS= LTO= \
+ COMMON_SUBDIRS='libstuff ar misc otool' \
+ SUBDIRS_32= \
+ RC_CFLAGS="${CFLAGS}" OFLAG="${CFLAGS}" \
+ -j1 \
+ || die "emake failed for the cctools"
+ cd "${S}"/${CCTOOLS}/as
+ emake \
+ BUILD_OBSOLETE_ARCH= \
+ RC_CFLAGS="-DASLIBEXECDIR=\"\\\"${EPREFIX}${LIBPATH}/\\\"\" ${CFLAGS}" \
+ || die "emake failed for as"
+}
+
+src_compile() {
+ compile_ld64
+ compile_cctools
+}
+
+install_ld64() {
+ exeinto ${BINPATH}
+ doexe "${S}"/${LD64}/src/{ld64,rebase,dyldinfo,unwinddump,ObjectDump}
+ dosym ld64 ${BINPATH}/ld
+ insinto ${DATAPATH}/man/man1
+ doins "${S}"/${LD64}/doc/man/man1/{ld,ld64,rebase}.1
+}
+
+install_cctools() {
+ cd "${S}"/${CCTOOLS}
+ emake install_all_but_headers \
+ EFITOOLS= LTO= \
+ COMMON_SUBDIRS='ar misc otool' \
+ SUBDIRS_32= \
+ RC_CFLAGS="${CFLAGS}" OFLAG="${CFLAGS}" \
+ DSTROOT=\"${D}\" \
+ BINDIR=\"${EPREFIX}\"${BINPATH} \
+ LOCBINDIR=\"${EPREFIX}\"${BINPATH} \
+ USRBINDIR=\"${EPREFIX}\"${BINPATH} \
+ LOCLIBDIR=\"${EPREFIX}\"${LIBPATH} \
+ MANDIR=\"${EPREFIX}\"${DATAPATH}/man/
+ cd "${S}"/${CCTOOLS}/as
+ emake install \
+ BUILD_OBSOLETE_ARCH= \
+ DSTROOT=\"${D}\" \
+ USRBINDIR=\"${EPREFIX}\"${BINPATH} \
+ LIBDIR=\"${EPREFIX}\"${LIBPATH} \
+ LOCLIBDIR=\"${EPREFIX}\"${LIBPATH}
+
+ cd "${ED}"${BINPATH}
+ insinto ${DATAPATH}/man/man1
+ local skips manpage
+ # ar brings an up-to-date manpage with it
+ skips=( ar )
+ for bin in *; do
+ for skip in ${skips[@]}; do
+ if [[ ${bin} == ${skip} ]]; then
+ continue 2;
+ fi
+ done
+ manpage=${S}/${CCTOOLS}/man/${bin}.1
+ if [[ -f "${manpage}" ]]; then
+ doins "${manpage}"
+ fi
+ done
+ insinto ${DATAPATH}/man/man5
+ doins "${S}"/${CCTOOLS}/man/*.5
+}
+
+src_test() {
+ einfo "Running unit tests"
+ cd "${S}"/${LD64}/unit-tests/test-cases
+ # need host arch, since GNU arch doesn't do what Apple's does
+ tc-export CC CXX
+ perl ../bin/make-recursive.pl \
+ ARCH="$(/usr/bin/arch)" \
+ RELEASEDIR="${S}"/${LD64}/src \
+ | perl ../bin/result-filter.pl
+}
+
+src_install() {
+ install_ld64
+ install_cctools
+
+ cd "${S}"
+ insinto /etc/env.d/binutils
+ cat <<-EOF > env.d
+ TARGET="${CHOST}"
+ VER="${PV}"
+ FAKE_TARGETS="${CHOST}"
+ EOF
+ newins env.d ${CHOST}-${PV}
+}
+
+pkg_postinst() {
+ binutils-config ${CHOST}-${PV}
+}
diff --git a/sys-devel/binutils-apple/binutils-apple-5.1.ebuild b/sys-devel/binutils-apple/binutils-apple-5.1.ebuild
new file mode 100644
index 00000000000..d6355c49dea
--- /dev/null
+++ b/sys-devel/binutils-apple/binutils-apple-5.1.ebuild
@@ -0,0 +1,356 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="3"
+
+inherit eutils flag-o-matic toolchain-funcs
+
+LD64=ld64-236.3
+CCTOOLS_VERSION=855
+CCTOOLS=cctools-${CCTOOLS_VERSION}
+LIBUNWIND=libunwind-35.3
+DYLD=dyld-353.2.1
+
+DESCRIPTION="Darwin assembler as(1) and static linker ld(1), Xcode Tools ${PV}"
+HOMEPAGE="http://www.opensource.apple.com/darwinsource/"
+SRC_URI="http://www.opensource.apple.com/tarballs/ld64/${LD64}.tar.gz
+ http://www.opensource.apple.com/tarballs/cctools/${CCTOOLS}.tar.gz
+ http://www.opensource.apple.com/tarballs/dyld/${DYLD}.tar.gz
+ http://www.opensource.apple.com/tarballs/libunwind/${LIBUNWIND}.tar.gz"
+
+LICENSE="APSL-2"
+KEYWORDS="~x64-macos ~x86-macos"
+IUSE="lto test libcxx"
+
+RDEPEND="sys-devel/binutils-config
+ lto? ( sys-devel/llvm )
+ libcxx? ( sys-libs/libcxx )"
+DEPEND="${RDEPEND}
+ test? ( >=dev-lang/perl-5.8.8 )
+ || ( >=sys-devel/gcc-apple-4.2.1 sys-devel/llvm )
+ libcxx? ( sys-devel/llvm )"
+
+export CTARGET=${CTARGET:-${CHOST}}
+if [[ ${CTARGET} == ${CHOST} ]] ; then
+ if [[ ${CATEGORY} == cross-* ]] ; then
+ export CTARGET=${CATEGORY#cross-}
+ fi
+fi
+is_cross() { [[ ${CHOST} != ${CTARGET} ]] ; }
+
+if is_cross ; then
+ SLOT="${CTARGET}-5"
+else
+ SLOT="5"
+fi
+
+LIBPATH=/usr/$(get_libdir)/binutils/${CTARGET}/${PV}
+INCPATH=${LIBPATH}/include
+DATAPATH=/usr/share/binutils-data/${CTARGET}/${PV}
+if is_cross ; then
+ BINPATH=/usr/${CHOST}/${CTARGET}/binutils-bin/${PV}
+else
+ BINPATH=/usr/${CTARGET}/binutils-bin/${PV}
+fi
+
+S=${WORKDIR}
+
+src_prepare() {
+ cd "${S}"/${LD64}/src
+ cp "${FILESDIR}"/ld64-136-compile_stubs.h ld/compile_stubs.h
+ cp "${FILESDIR}"/ld64-236.3-Makefile Makefile
+
+ epatch "${FILESDIR}"/ld64-236.3-nolto.patch
+ epatch "${FILESDIR}"/ld64-241.9-extraneous-includes.patch
+ epatch "${FILESDIR}"/ld64-241.9-atomic-volatile.patch
+ epatch "${FILESDIR}"/ld64-236.3-arm64-fixup.patch
+ epatch "${FILESDIR}"/ld64-241.9-arm64-cputype.patch
+ epatch "${FILESDIR}"/ld64-236.3-crashreporter.patch
+ epatch "${FILESDIR}"/ld64-236.3-gcc.patch
+ epatch "${FILESDIR}"/ld64-236.3-constant-types.patch
+ epatch "${FILESDIR}"/ld64-236.3-nosnapshots.patch
+ epatch "${FILESDIR}"/ld64-236.3-noppc.patch
+ epatch "${FILESDIR}"/ld64-236.3-noarm.patch
+ epatch "${FILESDIR}"/ld64-241.9-register-names.patch
+ epatch "${FILESDIR}"/ld64-241.9-get-comm-align.patch
+ epatch "${FILESDIR}"/ld64-241.9-cc_md5.patch
+
+ # We used to use our own copy of lto.h, which doesn't require llvm
+ # build-env. Current versions of llvm provide
+ # $EPREFIX/usr/include/llvm-c/lto.h as well as
+ # $EPREFIX/usr/lib/libLTO.{so,dylib}, so we just use these.
+
+ # provide missing headers from libunwind and dyld
+ mkdir -p include/{mach,mach-o/arm} || die
+ # never present because it's private
+ cp ../../${DYLD}/include/mach-o/dyld_priv.h include/mach-o || die
+ # missing on <= 10.5
+ cp ../../${LIBUNWIND}/include/libunwind.h include/ || die
+ cp ../../${LIBUNWIND}/include/mach-o/compact_unwind_encoding.h include/mach-o || die
+ # missing on <= 10.4
+ cp ../../${DYLD}/include/mach-o/dyld_images.h include/mach-o || die
+ cp ../../${CCTOOLS}/include/mach-o/loader.h include/mach-o || die
+ # use copies from cctools because they're otherwise hidden in some SDK
+ cp ../../${CCTOOLS}/include/mach-o/arm/reloc.h include/mach-o/arm || die
+ # provide all required CPU_TYPEs on all platforms
+ cp ../../${CCTOOLS}/include/mach/machine.h include/mach/machine.h
+ # add alias for newer identifiers, because ld64 uses both but cctools
+ # header only defines the older
+ epatch "${FILESDIR}"/ld64-236.3-missing-cputypes.patch
+
+ # mimic OS X Leopard-style Availability.h macros for libunwind.h on
+ # older systems
+ [[ ${CHOST} == *darwin* && ${CHOST#*-darwin} -le 8 ]] && \
+ echo "#define __OSX_AVAILABLE_STARTING(x,y) " > include/Availability.h
+
+ local VER_STR="\"@(#)PROGRAM:ld PROJECT:${LD64} (Gentoo ${PN}-${PVR})\\n\""
+ echo "char ldVersionString[] = ${VER_STR};" > version.cpp
+
+ epatch "${FILESDIR}"/ld64-123.2-debug-backtrace.patch
+
+ cd "${S}"/${CCTOOLS}
+ epatch "${FILESDIR}"/${PN}-4.5-as.patch
+ epatch "${FILESDIR}"/${PN}-5.1-as-dir.patch
+ epatch "${FILESDIR}"/${PN}-5.1-ranlib.patch
+ epatch "${FILESDIR}"/${PN}-3.1.1-libtool-ranlib.patch
+ epatch "${FILESDIR}"/${PN}-3.1.1-no-headers.patch
+ epatch "${FILESDIR}"/${PN}-4.0-no-oss-dir.patch
+ epatch "${FILESDIR}"/${PN}-5.1-nolto.patch
+ epatch "${FILESDIR}"/cctools-839-intel-retf.patch
+ epatch "${FILESDIR}"/${PN}-5.1-extraneous-includes.patch
+ epatch "${FILESDIR}"/${PN}-5.1-otool-stdc.patch
+ epatch "${FILESDIR}"/${PN}-5.1-constant-types.patch
+ epatch "${FILESDIR}"/${PN}-5.1-strnlen.patch
+ cp ../${LD64}/src/other/prune_trie.h include/mach-o/ || die
+
+ # do not build profileable libstuff to save compile time
+ sed -i -e "/^all:/s, profile , ," libstuff/Makefile
+
+ # cctools version is provided to make via RC_ProjectSourceVersion which
+ # generates and compiles it as apple_version[] into libstuff. From
+ # there it's picked up by the individual tools. Since
+ # RC_ProjectSourceVersion is also used as library version, we can't
+ # just append our local version info. So we hack the libstuff Makefile
+ # to include our Gentoo version.
+ sed -i -e "/cctools-.*(RC_ProjectSourceVersion).*OFILE_DIR/s,Version),Version) (Gentoo ${PN}-${PVR})," \
+ libstuff/Makefile
+
+ # clean up test suite
+ cd "${S}"/${LD64}/unit-tests/test-cases
+ local c
+
+ # we don't have llvm
+ ((++c)); rm -rf llvm-integration;
+
+ # we don't have dtrace
+ ((++c)); rm -rf dtrace-static-probes-coalescing;
+ ((++c)); rm -rf dtrace-static-probes;
+
+ # a file is missing
+ ((++c)); rm -rf eh-coalescing-r
+
+ # we don't do universal binaries
+ ((++c)); rm -rf blank-stubs;
+
+ # looks like a problem with apple's result-filter.pl
+ ((++c)); rm -rf implicit-common3;
+ ((++c)); rm -rf order_file-ans;
+
+ # TODO no idea what goes wrong here
+ ((++c)); rm -rf dwarf-debug-notes;
+
+ einfo "Deleted $c tests that were bound to fail"
+
+ cd "${S}"
+ ebegin "cleaning Makefiles from unwanted CFLAGS"
+ find . -name "Makefile" -print0 | xargs -0 sed \
+ -i \
+ -e 's/ -g / /g' \
+ -e 's/^G =.*$/G =/' \
+ -e 's/^OFLAG =.*$/OFLAG =/' \
+ -e 's/install -c -s/install/g'
+ eend $?
+}
+
+src_configure() {
+ CCTOOLS_LTO=
+ LD64_LTO=0
+ if use lto ; then
+ CCTOOLS_LTO="-DLTO_SUPPORT"
+ LD64_LTO=1
+ fi
+
+ if [ "${CXX/*clang*/yes}" = "yes" ] ; then
+ if use libcxx ; then
+ append-cxxflags -stdlib=libc++
+ CXXLIB=-stdlib=libc++
+ else
+ # force libstdc++ for systems where libc++ is default (OS X 10.9+?)
+ append-cxxflags -stdlib=libstdc++
+ CXXLIB=-stdlib=libstdc++
+ fi
+ else
+ use libcxx && \
+ ewarn "libcxx only available with clang and your C++ compiler ($CXX) does not seem to be clang"
+ fi
+
+ # CPPFLAGS only affects ld64, cctools don't use 'em (which currently is
+ # what we want)
+ append-cppflags -DNDEBUG
+
+ # Block API and thus snapshots supported on >= 10.6
+ [[ ${CHOST} == *darwin* && ${CHOST#*-darwin} -ge 10 ]] && \
+ append-cppflags -DSUPPORT_SNAPSHOTS
+
+ CCTOOLS_OFLAG=
+ if [[ ${CHOST} == *darwin* && ${CHOST#*-darwin} -le 8 ]] ; then
+ # cctools expect to use UNIX03 struct member names.
+ # This is default on > 10.4. Activate it on <= 10.4 by defining
+ # __DARWIN_UNIX03 explicitly.
+ CCTOOLS_OFLAG="-D__DARWIN_UNIX03=1"
+ fi
+
+ # Create configure.h for ld64 with SUPPORT_ARCH_<arch> defines in it.
+ # RC_SUPPORTED_ARCHS="i386 x86_64 x86_64h armv6 ..." can be used to
+ # override architectures (there are more arms to add) but we configure
+ # with the default to be in line with Xcode's ld.
+ DERIVED_FILE_DIR=${LD64}/src \
+ RC_SUPPORTED_ARCHS="" \
+ ${LD64}/src/create_configure
+}
+
+compile_ld64() {
+ einfo "building ${LD64}"
+ cd "${S}"/${LD64}/src
+ emake \
+ LTO=${LD64_LTO} \
+ || die "emake failed for ld64"
+ use test && emake build_test
+}
+
+compile_cctools() {
+ einfo "building ${CCTOOLS}"
+ cd "${S}"/${CCTOOLS}
+ # -j1 because it fails too often with weird errors
+ # Suppress running dsymutil because it will warn about missing debug
+ # info which is expected when compiling without -g as we normally do.
+ # This might need some more thought if anyone ever wanted to build us
+ # for debugging with Apple's tools.
+ emake \
+ LIB_PRUNETRIE="-L../../${LD64}/src -lprunetrie" \
+ EFITOOLS= \
+ LTO="${CCTOOLS_LTO}" \
+ COMMON_SUBDIRS='libstuff ar misc otool' \
+ SUBDIRS_32= \
+ LEGACY= \
+ RC_ProjectSourceVersion=${CCTOOLS_VERSION} \
+ RC_CFLAGS="${CFLAGS}" \
+ OFLAG="${CCTOOLS_OFLAG}" \
+ CXXLIB="${CXXLIB}" \
+ DSYMUTIL=": disabled: dsymutil" \
+ -j1 \
+ || die "emake failed for the cctools"
+ cd "${S}"/${CCTOOLS}/as
+ emake \
+ BUILD_OBSOLETE_ARCH= \
+ RC_ProjectSourceVersion=${CCTOOLS_VERSION} \
+ RC_CFLAGS="-DASLIBEXECDIR=\"\\\"${EPREFIX}${LIBPATH}/\\\"\" ${CFLAGS}" \
+ OFLAG="${CCTOOLS_OFLAG}" \
+ DSYMUTIL=": disabled: dsymutil" \
+ || die "emake failed for as"
+}
+
+src_compile() {
+ compile_ld64
+ compile_cctools
+}
+
+install_ld64() {
+ exeinto ${BINPATH}
+ doexe "${S}"/${LD64}/src/{ld64,rebase,dyldinfo,unwinddump,ObjectDump}
+ dosym ld64 ${BINPATH}/ld
+ insinto ${DATAPATH}/man/man1
+ doins "${S}"/${LD64}/doc/man/man1/{ld,ld64,rebase}.1
+}
+
+install_cctools() {
+ cd "${S}"/${CCTOOLS}
+ emake install_all_but_headers \
+ EFITOOLS= \
+ COMMON_SUBDIRS='ar misc otool' \
+ SUBDIRS_32= \
+ DSTROOT=\"${D}\" \
+ BINDIR=\"${EPREFIX}\"${BINPATH} \
+ LOCBINDIR=\"${EPREFIX}\"${BINPATH} \
+ USRBINDIR=\"${EPREFIX}\"${BINPATH} \
+ LOCLIBDIR=\"${EPREFIX}\"${LIBPATH} \
+ MANDIR=\"${EPREFIX}\"${DATAPATH}/man/
+ cd "${S}"/${CCTOOLS}/as
+ emake install \
+ BUILD_OBSOLETE_ARCH= \
+ DSTROOT=\"${D}\" \
+ USRBINDIR=\"${EPREFIX}\"${BINPATH} \
+ LIBDIR=\"${EPREFIX}\"${LIBPATH} \
+ LOCLIBDIR=\"${EPREFIX}\"${LIBPATH}
+
+ cd "${ED}"${BINPATH}
+ insinto ${DATAPATH}/man/man1
+ local skips manpage
+ # ar brings an up-to-date manpage with it
+ skips=( ar )
+ for bin in *; do
+ for skip in ${skips[@]}; do
+ if [[ ${bin} == ${skip} ]]; then
+ continue 2;
+ fi
+ done
+ manpage=${S}/${CCTOOLS}/man/${bin}.1
+ if [[ -f "${manpage}" ]]; then
+ doins "${manpage}"
+ fi
+ done
+ insinto ${DATAPATH}/man/man5
+ doins "${S}"/${CCTOOLS}/man/*.5
+}
+
+src_test() {
+ if ! [ "${EPREFIX}"/usr/bin/clang ] ; then
+ einfo "Test suite only works properly with clang - please install"
+ return
+ fi
+
+ einfo "Running unit tests"
+ cd "${S}"/${LD64}/unit-tests/test-cases
+ # provide the new ld as a symlink to clang so that -ccc-install-dir
+ # will pick it up
+ ln -sfn ../../src/ld64 ld
+ # use our arch command because the System's will report i386 even for an
+ # x86_64 prefix
+ perl ../bin/make-recursive.pl \
+ BUILT_PRODUCTS_DIR="${S}"/${LD64}/src \
+ ARCH="$(arch)" \
+ LD="${S}"/${LD64}/src/ld64 \
+ CC="clang -ccc-install-dir $PWD" \
+ CXX="clang++ -ccc-install-dir $PWD" \
+ OTOOL="${S}"/${CCTOOLS}/otool/otool.NEW \
+ | perl ../bin/result-filter.pl
+}
+
+src_install() {
+ install_ld64
+ install_cctools
+
+ cd "${S}"
+ insinto /etc/env.d/binutils
+ cat <<-EOF > env.d
+ TARGET="${CHOST}"
+ VER="${PV}"
+ FAKE_TARGETS="${CHOST}"
+ EOF
+ newins env.d ${CHOST}-${PV}
+}
+
+pkg_postinst() {
+ binutils-config ${CHOST}-${PV}
+}
diff --git a/sys-devel/binutils-apple/binutils-apple-6.1.ebuild b/sys-devel/binutils-apple/binutils-apple-6.1.ebuild
new file mode 100644
index 00000000000..7554c4e8858
--- /dev/null
+++ b/sys-devel/binutils-apple/binutils-apple-6.1.ebuild
@@ -0,0 +1,355 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="3"
+
+inherit eutils flag-o-matic toolchain-funcs
+
+LD64=ld64-241.9
+CCTOOLS_VERSION=862
+CCTOOLS=cctools-${CCTOOLS_VERSION}
+LIBUNWIND=libunwind-35.3
+DYLD=dyld-353.2.1
+
+DESCRIPTION="Darwin assembler as(1) and static linker ld(1), Xcode Tools ${PV}"
+HOMEPAGE="http://www.opensource.apple.com/darwinsource/"
+SRC_URI="http://www.opensource.apple.com/tarballs/ld64/${LD64}.tar.gz
+ http://www.opensource.apple.com/tarballs/cctools/${CCTOOLS}.tar.gz
+ http://www.opensource.apple.com/tarballs/dyld/${DYLD}.tar.gz
+ http://www.opensource.apple.com/tarballs/libunwind/${LIBUNWIND}.tar.gz"
+
+LICENSE="APSL-2"
+KEYWORDS="~x64-macos ~x86-macos"
+IUSE="lto test libcxx"
+
+RDEPEND="sys-devel/binutils-config
+ lto? ( sys-devel/llvm )
+ libcxx? ( sys-libs/libcxx )"
+DEPEND="${RDEPEND}
+ test? ( >=dev-lang/perl-5.8.8 )
+ || ( >=sys-devel/gcc-apple-4.2.1 sys-devel/llvm )
+ libcxx? ( sys-devel/llvm )"
+
+export CTARGET=${CTARGET:-${CHOST}}
+if [[ ${CTARGET} == ${CHOST} ]] ; then
+ if [[ ${CATEGORY} == cross-* ]] ; then
+ export CTARGET=${CATEGORY#cross-}
+ fi
+fi
+is_cross() { [[ ${CHOST} != ${CTARGET} ]] ; }
+
+if is_cross ; then
+ SLOT="${CTARGET}-6"
+else
+ SLOT="6"
+fi
+
+LIBPATH=/usr/$(get_libdir)/binutils/${CTARGET}/${PV}
+INCPATH=${LIBPATH}/include
+DATAPATH=/usr/share/binutils-data/${CTARGET}/${PV}
+if is_cross ; then
+ BINPATH=/usr/${CHOST}/${CTARGET}/binutils-bin/${PV}
+else
+ BINPATH=/usr/${CTARGET}/binutils-bin/${PV}
+fi
+
+S=${WORKDIR}
+
+src_prepare() {
+ cd "${S}"/${LD64}/src
+ cp "${FILESDIR}"/ld64-136-compile_stubs.h ld/compile_stubs.h
+ cp "${FILESDIR}"/ld64-236.3-Makefile Makefile
+
+ epatch "${FILESDIR}"/ld64-236.3-nolto.patch
+ epatch "${FILESDIR}"/ld64-241.9-extraneous-includes.patch
+ epatch "${FILESDIR}"/ld64-241.9-atomic-volatile.patch
+ epatch "${FILESDIR}"/ld64-241.9-arm64-cputype.patch
+ epatch "${FILESDIR}"/ld64-236.3-crashreporter.patch
+ epatch "${FILESDIR}"/ld64-241.9-gcc.patch
+ epatch "${FILESDIR}"/ld64-236.3-constant-types.patch
+ epatch "${FILESDIR}"/ld64-241.9-nosnapshots.patch
+ epatch "${FILESDIR}"/ld64-241.9-noarm.patch
+ epatch "${FILESDIR}"/ld64-241.9-register-names.patch
+ epatch "${FILESDIR}"/ld64-241.9-get-comm-align.patch
+ epatch "${FILESDIR}"/ld64-241.9-cc_md5.patch
+ epatch "${FILESDIR}"/ld64-241.9-lto-noremarks.patch
+
+ # We used to use our own copy of lto.h, which doesn't require llvm
+ # build-env. Current versions of llvm provide
+ # $EPREFIX/usr/include/llvm-c/lto.h as well as
+ # $EPREFIX/usr/lib/libLTO.{so,dylib}, so we just use these.
+
+ # provide missing headers from libunwind and dyld
+ mkdir -p include/{mach,mach-o/arm} || die
+ # never present because it's private
+ cp ../../${DYLD}/include/mach-o/dyld_priv.h include/mach-o || die
+ # missing on <= 10.5
+ cp ../../${LIBUNWIND}/include/libunwind.h include/ || die
+ cp ../../${LIBUNWIND}/include/mach-o/compact_unwind_encoding.h include/mach-o || die
+ # missing on <= 10.4
+ cp ../../${DYLD}/include/mach-o/dyld_images.h include/mach-o || die
+ cp ../../${CCTOOLS}/include/mach-o/loader.h include/mach-o || die
+ # use copies from cctools because they're otherwise hidden in some SDK
+ cp ../../${CCTOOLS}/include/mach-o/arm/reloc.h include/mach-o/arm || die
+ # provide all required CPU_TYPEs on all platforms
+ cp ../../${CCTOOLS}/include/mach/machine.h include/mach/machine.h
+ # add alias for newer identifiers, because ld64 uses both but cctools
+ # header only defines the older
+ epatch "${FILESDIR}"/ld64-236.3-missing-cputypes.patch
+
+ # mimic OS X Leopard-style Availability.h macros for libunwind.h on
+ # older systems
+ [[ ${CHOST} == *darwin* && ${CHOST#*-darwin} -le 8 ]] && \
+ echo "#define __OSX_AVAILABLE_STARTING(x,y) " > include/Availability.h
+
+ local VER_STR="\"@(#)PROGRAM:ld PROJECT:${LD64} (Gentoo ${PN}-${PVR})\\n\""
+ echo "char ldVersionString[] = ${VER_STR};" > version.cpp
+
+ epatch "${FILESDIR}"/ld64-123.2-debug-backtrace.patch
+
+ cd "${S}"/${CCTOOLS}
+ epatch "${FILESDIR}"/${PN}-4.5-as.patch
+ epatch "${FILESDIR}"/${PN}-5.1-as-dir.patch
+ epatch "${FILESDIR}"/${PN}-5.1-ranlib.patch
+ epatch "${FILESDIR}"/${PN}-3.1.1-libtool-ranlib.patch
+ epatch "${FILESDIR}"/${PN}-3.1.1-no-headers.patch
+ epatch "${FILESDIR}"/${PN}-4.0-no-oss-dir.patch
+ epatch "${FILESDIR}"/${PN}-5.1-nolto.patch
+ epatch "${FILESDIR}"/cctools-839-intel-retf.patch
+ epatch "${FILESDIR}"/${PN}-5.1-extraneous-includes.patch
+ epatch "${FILESDIR}"/${PN}-5.1-otool-stdc.patch
+ epatch "${FILESDIR}"/${PN}-5.1-constant-types.patch
+ epatch "${FILESDIR}"/${PN}-5.1-strnlen.patch
+ cp ../${LD64}/src/other/prune_trie.h include/mach-o/ || die
+
+ # do not build profileable libstuff to save compile time
+ sed -i -e "/^all:/s, profile , ," libstuff/Makefile
+
+ # cctools version is provided to make via RC_ProjectSourceVersion which
+ # generates and compiles it as apple_version[] into libstuff. From
+ # there it's picked up by the individual tools. Since
+ # RC_ProjectSourceVersion is also used as library version, we can't
+ # just append our local version info. So we hack the libstuff Makefile
+ # to include our Gentoo version.
+ sed -i -e "/cctools-.*(RC_ProjectSourceVersion).*OFILE_DIR/s,Version),Version) (Gentoo ${PN}-${PVR})," \
+ libstuff/Makefile
+
+ # clean up test suite
+ cd "${S}"/${LD64}/unit-tests/test-cases
+ local c
+
+ # we don't have llvm
+ ((++c)); rm -rf llvm-integration;
+
+ # we don't have dtrace
+ ((++c)); rm -rf dtrace-static-probes-coalescing;
+ ((++c)); rm -rf dtrace-static-probes;
+
+ # a file is missing
+ ((++c)); rm -rf eh-coalescing-r
+
+ # we don't do universal binaries
+ ((++c)); rm -rf blank-stubs;
+
+ # looks like a problem with apple's result-filter.pl
+ ((++c)); rm -rf implicit-common3;
+ ((++c)); rm -rf order_file-ans;
+
+ # TODO no idea what goes wrong here
+ ((++c)); rm -rf dwarf-debug-notes;
+
+ einfo "Deleted $c tests that were bound to fail"
+
+ cd "${S}"
+ ebegin "cleaning Makefiles from unwanted CFLAGS"
+ find . -name "Makefile" -print0 | xargs -0 sed \
+ -i \
+ -e 's/ -g / /g' \
+ -e 's/^G =.*$/G =/' \
+ -e 's/^OFLAG =.*$/OFLAG =/' \
+ -e 's/install -c -s/install/g'
+ eend $?
+}
+
+src_configure() {
+ CCTOOLS_LTO=
+ LD64_LTO=0
+ if use lto ; then
+ CCTOOLS_LTO="-DLTO_SUPPORT"
+ LD64_LTO=1
+ fi
+
+ if [ "${CXX/*clang*/yes}" = "yes" ] ; then
+ if use libcxx ; then
+ append-cxxflags -stdlib=libc++
+ CXXLIB=-stdlib=libc++
+ else
+ # force libstdc++ for systems where libc++ is default (OS X 10.9+?)
+ append-cxxflags -stdlib=libstdc++
+ CXXLIB=-stdlib=libstdc++
+ fi
+ else
+ use libcxx && \
+ ewarn "libcxx only available with clang and your C++ compiler ($CXX) does not seem to be clang"
+ fi
+
+ # CPPFLAGS only affects ld64, cctools don't use 'em (which currently is
+ # what we want)
+ append-cppflags -DNDEBUG
+
+ # Block API and thus snapshots supported on >= 10.6
+ [[ ${CHOST} == *darwin* && ${CHOST#*-darwin} -ge 10 ]] && \
+ append-cppflags -DSUPPORT_SNAPSHOTS
+
+ CCTOOLS_OFLAG=
+ if [[ ${CHOST} == *darwin* && ${CHOST#*-darwin} -le 8 ]] ; then
+ # cctools expect to use UNIX03 struct member names.
+ # This is default on > 10.4. Activate it on <= 10.4 by defining
+ # __DARWIN_UNIX03 explicitly.
+ CCTOOLS_OFLAG="-D__DARWIN_UNIX03=1"
+ fi
+
+ # Create configure.h for ld64 with SUPPORT_ARCH_<arch> defines in it.
+ # RC_SUPPORTED_ARCHS="i386 x86_64 x86_64h armv6 ..." can be used to
+ # override architectures (there are more arms to add) but we configure
+ # with the default to be in line with Xcode's ld.
+ DERIVED_FILE_DIR=${LD64}/src \
+ RC_SUPPORTED_ARCHS="" \
+ ${LD64}/src/create_configure
+}
+
+compile_ld64() {
+ einfo "building ${LD64}"
+ cd "${S}"/${LD64}/src
+ emake \
+ LTO=${LD64_LTO} \
+ || die "emake failed for ld64"
+ use test && emake build_test
+}
+
+compile_cctools() {
+ einfo "building ${CCTOOLS}"
+ cd "${S}"/${CCTOOLS}
+ # -j1 because it fails too often with weird errors
+ # Suppress running dsymutil because it will warn about missing debug
+ # info which is expected when compiling without -g as we normally do.
+ # This might need some more thought if anyone ever wanted to build us
+ # for debugging with Apple's tools.
+ emake \
+ LIB_PRUNETRIE="-L../../${LD64}/src -lprunetrie" \
+ EFITOOLS= \
+ LTO="${CCTOOLS_LTO}" \
+ COMMON_SUBDIRS='libstuff ar misc otool' \
+ SUBDIRS_32= \
+ LEGACY= \
+ RC_ProjectSourceVersion=${CCTOOLS_VERSION} \
+ RC_CFLAGS="${CFLAGS}" \
+ OFLAG="${CCTOOLS_OFLAG}" \
+ CXXLIB="${CXXLIB}" \
+ DSYMUTIL=": disabled: dsymutil" \
+ -j1 \
+ || die "emake failed for the cctools"
+ cd "${S}"/${CCTOOLS}/as
+ emake \
+ BUILD_OBSOLETE_ARCH= \
+ RC_ProjectSourceVersion=${CCTOOLS_VERSION} \
+ RC_CFLAGS="-DASLIBEXECDIR=\"\\\"${EPREFIX}${LIBPATH}/\\\"\" ${CFLAGS}" \
+ OFLAG="${CCTOOLS_OFLAG}" \
+ DSYMUTIL=": disabled: dsymutil" \
+ || die "emake failed for as"
+}
+
+src_compile() {
+ compile_ld64
+ compile_cctools
+}
+
+install_ld64() {
+ exeinto ${BINPATH}
+ doexe "${S}"/${LD64}/src/{ld64,rebase,dyldinfo,unwinddump,ObjectDump}
+ dosym ld64 ${BINPATH}/ld
+ insinto ${DATAPATH}/man/man1
+ doins "${S}"/${LD64}/doc/man/man1/{ld,ld64,rebase}.1
+}
+
+install_cctools() {
+ cd "${S}"/${CCTOOLS}
+ emake install_all_but_headers \
+ EFITOOLS= \
+ COMMON_SUBDIRS='ar misc otool' \
+ SUBDIRS_32= \
+ DSTROOT=\"${D}\" \
+ BINDIR=\"${EPREFIX}\"${BINPATH} \
+ LOCBINDIR=\"${EPREFIX}\"${BINPATH} \
+ USRBINDIR=\"${EPREFIX}\"${BINPATH} \
+ LOCLIBDIR=\"${EPREFIX}\"${LIBPATH} \
+ MANDIR=\"${EPREFIX}\"${DATAPATH}/man/
+ cd "${S}"/${CCTOOLS}/as
+ emake install \
+ BUILD_OBSOLETE_ARCH= \
+ DSTROOT=\"${D}\" \
+ USRBINDIR=\"${EPREFIX}\"${BINPATH} \
+ LIBDIR=\"${EPREFIX}\"${LIBPATH} \
+ LOCLIBDIR=\"${EPREFIX}\"${LIBPATH}
+
+ cd "${ED}"${BINPATH}
+ insinto ${DATAPATH}/man/man1
+ local skips manpage
+ # ar brings an up-to-date manpage with it
+ skips=( ar )
+ for bin in *; do
+ for skip in ${skips[@]}; do
+ if [[ ${bin} == ${skip} ]]; then
+ continue 2;
+ fi
+ done
+ manpage=${S}/${CCTOOLS}/man/${bin}.1
+ if [[ -f "${manpage}" ]]; then
+ doins "${manpage}"
+ fi
+ done
+ insinto ${DATAPATH}/man/man5
+ doins "${S}"/${CCTOOLS}/man/*.5
+}
+
+src_test() {
+ if ! [ "${EPREFIX}"/usr/bin/clang ] ; then
+ einfo "Test suite only works properly with clang - please install"
+ return
+ fi
+
+ einfo "Running unit tests"
+ cd "${S}"/${LD64}/unit-tests/test-cases
+ # provide the new ld as a symlink to clang so that -ccc-install-dir
+ # will pick it up
+ ln -sfn ../../src/ld64 ld
+ # use our arch command because the System's will report i386 even for an
+ # x86_64 prefix
+ perl ../bin/make-recursive.pl \
+ BUILT_PRODUCTS_DIR="${S}"/${LD64}/src \
+ ARCH="$(arch)" \
+ LD="${S}"/${LD64}/src/ld64 \
+ CC="clang -ccc-install-dir $PWD" \
+ CXX="clang++ -ccc-install-dir $PWD" \
+ OTOOL="${S}"/${CCTOOLS}/otool/otool.NEW \
+ | perl ../bin/result-filter.pl
+}
+
+src_install() {
+ install_ld64
+ install_cctools
+
+ cd "${S}"
+ insinto /etc/env.d/binutils
+ cat <<-EOF > env.d
+ TARGET="${CHOST}"
+ VER="${PV}"
+ FAKE_TARGETS="${CHOST}"
+ EOF
+ newins env.d ${CHOST}-${PV}
+}
+
+pkg_postinst() {
+ binutils-config ${CHOST}-${PV}
+}
diff --git a/sys-devel/binutils-apple/files/Makefile b/sys-devel/binutils-apple/files/Makefile
new file mode 100644
index 00000000000..9d8f92818a8
--- /dev/null
+++ b/sys-devel/binutils-apple/files/Makefile
@@ -0,0 +1,12 @@
+all: ld64 rebase
+
+build_test: machocheck ObjectDump
+
+ld64: debugline.o Options.o ld.o version.o
+ $(CXX) $(LDFLAGS) -o $@ $^
+
+machocheck: machochecker.o
+ $(CXX) $(LDFLAGS) -o $@ $^
+
+ObjectDump: ObjectDump.o debugline.o
+ $(CXX) $(LDFLAGS) -o $@ $^
diff --git a/sys-devel/binutils-apple/files/binutils-apple-3.1.1-as-dir.patch b/sys-devel/binutils-apple/files/binutils-apple-3.1.1-as-dir.patch
new file mode 100644
index 00000000000..8d9203e3395
--- /dev/null
+++ b/sys-devel/binutils-apple/files/binutils-apple-3.1.1-as-dir.patch
@@ -0,0 +1,69 @@
+handles the libexecdir for as and other fixes
+
+--- cctools-698/as/driver.c
++++ cctools-698/as/driver.c
+@@ -27,6 +27,9 @@
+ char **envp)
+ {
+ const char *LIB =
++#ifdef ASLIBEXECDIR
++ ASLIBEXECDIR;
++#else
+ #if defined(__OPENSTEP__) || defined(__HERA__) || \
+ defined(__GONZO_BUNSEN_BEAKER__) || defined(__KODIAK__)
+ "/usr/libexec/";
+@@ -40,6 +42,7 @@
+ #else
+ "/usr/local/libexec/gcc/darwin/";
+ #endif
++#endif
+ const char *AS = "/as";
+
+ int i;
+@@ -170,7 +170,11 @@
+ }
+
+ }
++#ifndef ASLIBEXECDIR
+ as = makestr(prefix, LIB, arch_name, AS, NULL);
++#else
++ as = makestr(LIB, arch_name, AS, NULL);
++#endif
+
+ /*
+ * If this assembler exist try to run it else print an error message.
+@@ -182,6 +182,9 @@
+ else
+ exit(1);
+ }
++#ifdef ASLIBEXECDIR
++ as_local = "";
++#else
+ as_local = makestr(prefix, LOCALLIB, arch_name, AS, NULL);
+ if(access(as_local, F_OK) == 0){
+ argv[0] = as_local;
+@@ -193,6 +198,8 @@
+ exit(1);
+ }
+ else{
++#endif
++ {
+ printf("%s: assembler (%s or %s) for architecture %s not "
+ "installed\n", progname, as, as_local, arch_name);
+ arch_flags = get_arch_flags();
+@@ -183,6 +190,7 @@
+ printf("%s for architecture %s\n", as, arch_flags[i].name);
+ count++;
+ }
++#ifndef ASLIBEXECDIR
+ else{
+ as_local = makestr(LOCALLIB, arch_flags[i].name, AS, NULL);
+ if(access(as_local, F_OK) == 0){
+@@ -193,6 +201,7 @@
+ count++;
+ }
+ }
++#endif
+ }
+ if(count == 0)
+ printf("%s: no assemblers installed\n", progname);
diff --git a/sys-devel/binutils-apple/files/binutils-apple-3.1.1-as.patch b/sys-devel/binutils-apple/files/binutils-apple-3.1.1-as.patch
new file mode 100644
index 00000000000..c0cff44550d
--- /dev/null
+++ b/sys-devel/binutils-apple/files/binutils-apple-3.1.1-as.patch
@@ -0,0 +1,98 @@
+make building for obsolete architectures optional.
+
+--- cctools-698/as/Makefile
++++ cctools-698/as/Makefile
+@@ -1,3 +1,4 @@
++BUILD_OBSOLETE_ARCH = yes
+ RC_OS = macos
+ export USE_APPLE_PB_SUPPORT = all
+ OFLAG = -Os
+@@ -31,26 +32,34 @@
+ SYMROOT = .
+ OBJROOT = .
+ SYM_DIRS = $(SYMROOT)/driver_dir \
+- $(SYMROOT)/a68_dir \
+- $(SYMROOT)/a88_dir \
+ $(SYMROOT)/a386_dir \
+ $(SYMROOT)/ax86_64_dir \
+ $(SYMROOT)/appc_dir \
+- $(SYMROOT)/appc64_dir \
++ $(SYMROOT)/appc64_dir
++
++ifeq "yes" "$(BUILD_OBSOLETE_ARCH)"
++SYM_DIRS += \
++ $(SYMROOT)/a68_dir \
++ $(SYMROOT)/a88_dir \
+ $(SYMROOT)/a860_dir \
+ $(SYMROOT)/ahppa_dir \
+ $(SYMROOT)/asparc_dir
++endif
+
+ OFILE_DIRS = $(OBJROOT)/driver_dir \
+- $(OBJROOT)/a68_dir \
+- $(OBJROOT)/a88_dir \
+ $(OBJROOT)/a386_dir \
+ $(OBJROOT)/ax86_64_dir \
+ $(OBJROOT)/appc_dir \
+- $(OBJROOT)/appc64_dir \
++ $(OBJROOT)/appc64_dir
++
++ifeq "yes" "$(BUILD_OBSOLETE_ARCH)"
++OFILE_DIRS += \
++ $(OBJROOT)/a68_dir \
++ $(OBJROOT)/a88_dir \
+ $(OBJROOT)/a860_dir \
+ $(OBJROOT)/ahppa_dir \
+ $(OBJROOT)/asparc_dir
++endif
+
+ BINDIR = /bin
+ USRBINDIR = /usr/bin
+@@ -109,9 +118,13 @@
+ OBJS_hppa = $(CFILES_hppa:.c=.o)
+ OBJS_sparc = $(CFILES_sparc:.c=.o)
+
+-all: $(OFILE_DIRS) $(SYM_DIRS) driver_build a68_build a88_build a386_build \
+- ax86_64_build a860_build appc_build appc64_build ahppa_build \
+- $(A_BUILD) asparc_build
++all: $(OFILE_DIRS) $(SYM_DIRS) driver_build a386_build \
++ ax86_64_build appc_build appc64_build \
++ $(A_BUILD)
++
++ifeq "yes" "$(BUILD_OBSOLETE_ARCH)"
++all: a68_build a88_build a860_build ahppa_build asparc_build
++endif
+
+ all_test: a68_test a88_test a860_test a386_test appc_test ahppa_test
+
+@@ -414,12 +427,14 @@
+ $(MKDIRS) $(DSTROOT)$(LIBDIR)/ppc64
+ install -c -s -m 555 $(SYMROOT)/appc64_dir/as \
+ $(DSTROOT)$(LIBDIR)/ppc64/as
++ifeq "yes" "$(BUILD_OBSOLETE_ARCH)"
+ $(MKDIRS) $(DSTROOT)$(LOCLIBDIR)/m68k
+ install -c -s -m 555 $(SYMROOT)/a68_dir/as \
+ $(DSTROOT)$(LOCLIBDIR)/m68k/as
+ $(MKDIRS) $(DSTROOT)$(LOCLIBDIR)/sparc
+ install -c -s -m 555 $(SYMROOT)/asparc_dir/as \
+ $(DSTROOT)$(LOCLIBDIR)/sparc/as
++endif
+
+ nextstep_install: common_install
+ $(MKDIRS) $(DSTROOT)$(BINDIR)
+@@ -439,6 +454,7 @@
+ $(DSTROOT)$(LOCLIBDIR)/ppc/as
+
+ common_install:
++ifeq "yes" "$(BUILD_OBSOLETE_ARCH)"
+ $(MKDIRS) $(DSTROOT)$(LOCLIBDIR)/m88k
+ install -c -s -m 555 $(SYMROOT)/a88_dir/as \
+ $(DSTROOT)$(LOCLIBDIR)/m88k/as
+@@ -448,6 +464,7 @@
+ $(MKDIRS) $(DSTROOT)$(LOCLIBDIR)/i860
+ install -s -m 555 $(SYMROOT)/a860_dir/as \
+ $(DSTROOT)$(LOCLIBDIR)/i860/as
++endif
+
+ $(OFILE_DIRS) $(SYM_DIRS):
+ $(MKDIRS) $@
diff --git a/sys-devel/binutils-apple/files/binutils-apple-3.1.1-libtool-ranlib.patch b/sys-devel/binutils-apple/files/binutils-apple-3.1.1-libtool-ranlib.patch
new file mode 100644
index 00000000000..fc86ddea118
--- /dev/null
+++ b/sys-devel/binutils-apple/files/binutils-apple-3.1.1-libtool-ranlib.patch
@@ -0,0 +1,17 @@
+match "ranlib" at the back of the string, such that <CHOST>-ranlib also
+works correctly
+
+--- cctools-698/misc/libtool.c
++++ cctools-698/misc/libtool.c
+@@ -336,8 +336,9 @@
+ p++;
+ else
+ p = argv[0];
+- if(strncmp(p, "ranlib", sizeof("ranlib") - 1) == 0)
+- cmd_flags.ranlib = TRUE;
++ if ((i = strlen(p)) >= sizeof("ranlib") - 1 &&
++ strcmp(p + (i - (sizeof("ranlib") - 1)), "ranlib") == 0)
++ cmd_flags.ranlib = TRUE;
+
+ /* The default is to used long names */
+ cmd_flags.use_long_names = TRUE;
diff --git a/sys-devel/binutils-apple/files/binutils-apple-3.1.1-nmedit.patch b/sys-devel/binutils-apple/files/binutils-apple-3.1.1-nmedit.patch
new file mode 100644
index 00000000000..3b14e3dd4e6
--- /dev/null
+++ b/sys-devel/binutils-apple/files/binutils-apple-3.1.1-nmedit.patch
@@ -0,0 +1,15 @@
+don't create a symlink to nmedit from the dir nmedit is in
+
+--- cctools-698/misc/Makefile
++++ cctools-698/misc/Makefile
+@@ -427,8 +427,10 @@
+ install -c -s -m 555 $(SYMROOT)/redo_prebinding.NEW \
+ $(DSTROOT)$(USRBINDIR)/redo_prebinding
+ install -c -s -m 555 $(SYMROOT)/nmedit.NEW $(DSTROOT)$(USRBINDIR)/nmedit
++ifneq "$(USRBINDIR)" "$(LOCBINDIR)"
+ (cd $(DSTROOT)$(LOCBINDIR); rm -f nmedit; \
+ ln -s $(USRBINDIR)/nmedit nmedit)
++endif
+ install -c -s -m 555 $(SYMROOT)/install_name_tool.NEW \
+ $(DSTROOT)$(USRBINDIR)/install_name_tool
+ install -c -s -m 555 $(SYMROOT)/codesign_allocate.NEW \
diff --git a/sys-devel/binutils-apple/files/binutils-apple-3.1.1-no-efi-man.patch b/sys-devel/binutils-apple/files/binutils-apple-3.1.1-no-efi-man.patch
new file mode 100644
index 00000000000..978f1aba9ae
--- /dev/null
+++ b/sys-devel/binutils-apple/files/binutils-apple-3.1.1-no-efi-man.patch
@@ -0,0 +1,38 @@
+don't install efi's manpages since we don't install efi
+
+--- cctools-698/man/Makefile
++++ cctools-698/man/Makefile
+@@ -27,14 +27,21 @@
+ MANL3 = libsyminfo.3 redo_prebinding.3
+
+ INSTALL_FILES = Makefile $(COMMON_MAN1) $(OTHER_MAN1) $(MAN3) $(MAN5) $(MANL) \
+- $(MANL3) $(DYLD_MAN1) $(DYLD_MAN3) $(DYLD_MANL3) $(EFI1) notes
++ $(MANL3) $(DYLD_MAN1) $(DYLD_MAN3) $(DYLD_MANL3) notes
++
++ifeq "$(EFITOOLS)" "efitools"
++ INSTALL_FILES += $(EFI1)
++endif
+
+ MANDIR = /usr/share/man
+ LOCMANDIR = /usr/local/man
+ EFIMANDIR = /usr/local/efi/share/man
+ DSTDIRS = $(DSTROOT)$(MANDIR)/man1 $(DSTROOT)$(MANDIR)/man3 \
+ $(DSTROOT)$(MANDIR)/man5 $(DSTROOT)$(LOCMANDIR)/man1 \
+- $(DSTROOT)$(LOCMANDIR)/man3 $(DSTROOT)$(EFIMANDIR)/man1
++ $(DSTROOT)$(LOCMANDIR)/man3
++ifeq "$(EFITOOLS)" "efitools"
++ DSTDIR += $(DSTROOT)$(EFIMANDIR)/man1
++endif
+
+ install: $(DSTDIRS) $(COMMON_MAN1) $(OTHER_MAN1) $(MAN3) $(MAN5) $(MANL) \
+ $(RC_OS) $(MANL3)
+@@ -51,7 +58,9 @@
+ install -c -m 444 $(MAN5) $(DSTROOT)$(MANDIR)/man5
+ install -c -m 444 $(MANL) $(DSTROOT)$(LOCMANDIR)/man1
+ install -c -m 444 $(MANL3) $(DSTROOT)$(LOCMANDIR)/man3
++ifeq "$(EFITOOLS)" "efitools"
+ install -c -m 444 $(EFI1) $(DSTROOT)$(EFIMANDIR)/man1
++endif
+ if [ $(OLD_DYLD_STUFF) ]; \
+ then \
+ install -c -m 444 $(DYLD_MANL3) $(DSTROOT)$(LOCMANDIR)/man3;\
diff --git a/sys-devel/binutils-apple/files/binutils-apple-3.1.1-no-headers.patch b/sys-devel/binutils-apple/files/binutils-apple-3.1.1-no-headers.patch
new file mode 100644
index 00000000000..098a95fb0de
--- /dev/null
+++ b/sys-devel/binutils-apple/files/binutils-apple-3.1.1-no-headers.patch
@@ -0,0 +1,15 @@
+get rid of libraries, includes, and obsolete manpages
+
+--- cctools-698/Makefile
++++ cctools-698/Makefile
+@@ -170,7 +170,9 @@
+ DSTROOT=$$DSTROOT install_tools lib_ofiles_install; \
+ fi
+
+-install_tools: installhdrs
++install_tools: installhdrs install_all_but_headers
++
++install_all_but_headers:
+ @if [ $(SRCROOT) ]; \
+ then \
+ CWD=`pwd`; cd "$(DSTROOT)"; DSTROOT=`pwd`; cd "$$CWD"; \
diff --git a/sys-devel/binutils-apple/files/binutils-apple-3.1.1-no-oss-dir.patch b/sys-devel/binutils-apple/files/binutils-apple-3.1.1-no-oss-dir.patch
new file mode 100644
index 00000000000..5ed82375235
--- /dev/null
+++ b/sys-devel/binutils-apple/files/binutils-apple-3.1.1-no-oss-dir.patch
@@ -0,0 +1,17 @@
+don't create an OpenSource dir
+
+--- cctools-698/as/Makefile
++++ cctools-698/as/Makefile
+@@ -408,12 +408,6 @@
+ $(MKDIRS) $(DSTROOT)$(USRBINDIR)
+ install -c -s -m 555 $(SYMROOT)/driver_dir/driver \
+ $(DSTROOT)$(USRBINDIR)/as
+- $(MKDIRS) $(DSTROOT)/usr/local/OpenSourceVersions/
+- install -c -s -m 444 $(SRCROOT)/cctools.plist \
+- $(DSTROOT)/usr/local/OpenSourceVersions/cctools.plist
+- $(MKDIRS) $(DSTROOT)/usr/local/OpenSourceLicenses/
+- install -c -s -m 444 $(SRCROOT)/COPYING \
+- $(DSTROOT)/usr/local/OpenSourceLicenses/cctools.txt
+ $(MKDIRS) $(DSTROOT)$(LIBDIR)/ppc
+ install -c -s -m 555 $(SYMROOT)/appc_dir/as \
+ $(DSTROOT)$(LIBDIR)/ppc/as
diff --git a/sys-devel/binutils-apple/files/binutils-apple-3.1.1-ranlib.patch b/sys-devel/binutils-apple/files/binutils-apple-3.1.1-ranlib.patch
new file mode 100644
index 00000000000..94865fb126d
--- /dev/null
+++ b/sys-devel/binutils-apple/files/binutils-apple-3.1.1-ranlib.patch
@@ -0,0 +1,53 @@
+run ranlib before installation so we needn't touch permissions
+
+--- cctools-698/libmacho/Makefile
++++ cctools-698/libmacho/Makefile
+@@ -316,29 +316,29 @@
+ $(MKDIRS) $(DSTROOT)$(SYSTEMDIR)
+ if [ $(SRCROOT) = . ]; \
+ then \
++ ranlib dtmp_obj/libmacho.a; \
+ install -c -m 444 dtmp_obj/libmacho.a \
+ $(DSTROOT)$(SYSTEMDIR)/libmacho.a; \
+- ranlib $(DSTROOT)$(SYSTEMDIR)/libmacho.a; \
+ (cd $(DSTROOT)$(SYSTEMDIR) ; \
+ rm -f libmacho_debug.a ; ln -s libmacho.a libmacho_debug.a); \
++ ranlib ptmp_obj/libmacho_pg.a; \
+ install -c -m 444 ptmp_obj/libmacho_pg.a \
+ $(DSTROOT)$(SYSTEMDIR)/libmacho_profile.a; \
+- ranlib $(DSTROOT)$(SYSTEMDIR)/libmacho_profile.a; \
++ ranlib otmp_obj/libmacho_static.a; \
+ install -c -m 444 otmp_obj/libmacho_static.a \
+ $(DSTROOT)$(SYSTEMDIR)/libmacho_static.a; \
+- ranlib $(DSTROOT)$(SYSTEMDIR)/libmacho_static.a; \
+ else \
++ ranlib $(SYMROOT)/libmacho.a; \
+ install -c -m 444 $(SYMROOT)/libmacho.a \
+ $(DSTROOT)$(SYSTEMDIR)/libmacho.a; \
+- ranlib $(DSTROOT)$(SYSTEMDIR)/libmacho.a; \
+ (cd $(DSTROOT)$(SYSTEMDIR) ; \
+ rm -f libmacho_debug.a ; ln -s libmacho.a libmacho_debug.a); \
++ ranlib $(SYMROOT)/libmacho_pg.a; \
+ install -c -m 444 $(SYMROOT)/libmacho_pg.a \
+ $(DSTROOT)$(SYSTEMDIR)/libmacho_profile.a; \
+- ranlib $(DSTROOT)$(SYSTEMDIR)/libmacho_profile.a; \
++ ranlib $(SYMROOT)/libmacho_static.a; \
+ install -c -m 444 $(SYMROOT)/libmacho_static.a \
+ $(DSTROOT)$(SYSTEMDIR)/libmacho_static.a; \
+- ranlib $(DSTROOT)$(SYSTEMDIR)/libmacho_static.a; \
+ fi
+
+ teflon_lib_ofiles_install nextstep_lib_ofiles_install:
+--- cctools-698/cbtlibs/Makefile
++++ cctools-698/cbtlibs/Makefile
+@@ -80,9 +80,9 @@
+
+ lib_ofiles_install: lib_ofiles
+ $(MKDIRS) $(DSTROOT)$(LOCLIBDIR)
++ ranlib $(SYMROOT)/libsyminfo.a
+ install -p -c -m 444 $(SYMROOT)/libsyminfo.a \
+ $(DSTROOT)$(LOCLIBDIR)/libsyminfo.a
+- ranlib $(DSTROOT)$(LOCLIBDIR)/libsyminfo.a
+
+ -include $(OFILE_DIR)/Makedep
+
diff --git a/sys-devel/binutils-apple/files/binutils-apple-3.1.1-testsuite.patch b/sys-devel/binutils-apple/files/binutils-apple-3.1.1-testsuite.patch
new file mode 100644
index 00000000000..b3913262db2
--- /dev/null
+++ b/sys-devel/binutils-apple/files/binutils-apple-3.1.1-testsuite.patch
@@ -0,0 +1,102 @@
+fix the test suite so it is even usable
+
+--- ld64-85.2.2/unit-tests/test-cases/commons-alignment/Makefile
++++ ld64-85.2.2/unit-tests/test-cases/commons-alignment/Makefile
+@@ -29,9 +29,9 @@
+
+ all:
+ ${CC} ${CCFLAGS} foo.s -c -o foo.o
+- nm -m foo.o | grep '(alignment 2^6)' | ${FAIL_IF_EMPTY}
++ nm -m foo.o | fgrep '(alignment 2^6)' | ${FAIL_IF_EMPTY}
+ ${LD} foo.o -r -o foo2.o
+- nm -m foo2.o | grep '(alignment 2^6)' | ${PASS_IFF_STDIN}
++ nm -m foo2.o | fgrep '(alignment 2^6)' | ${PASS_IFF_STDIN}
+
+ clean:
+ rm -rf foo.o foo2.o
+--- ld64-85.2.2/unit-tests/test-cases/order_file/Makefile
++++ ld64-85.2.2/unit-tests/test-cases/order_file/Makefile
+@@ -33,7 +33,7 @@
+ run: all
+
+ all:
+- as -arch ${ARCH} -L extra.s -o extra.o
++ as -L extra.s -o extra.o
+ ${CC} ${CCFLAGS} main.c extra.o -o main1 -Wl,-order_file -Wl,main1.order
+ ${FAIL_IF_BAD_MACHO} main1
+ nm -n -g -j main1 | grep "_main" > main1.nm
+@@ -44,7 +44,7 @@
+ nm -n -j main2 | egrep '^_[a-z]+[0-9]$$' > main2.nm
+ ${PASS_IFF} diff main2.nm main2.expected
+
+- ${CC} -arch ${ARCH} -c main.c -o main.o
++ ${CC} -c main.c -o main.o
+ ${CC} ${CCFLAGS} main.o extra.o -o main3 -Wl,-order_file -Wl,main3.order
+ ${FAIL_IF_BAD_MACHO} main3
+ nm -n -g -j main3 | grep "_main" > main3.nm
+--- ld64-85.2.2/unit-tests/test-cases/16-byte-alignment/Makefile
++++ ld64-85.2.2/unit-tests/test-cases/16-byte-alignment/Makefile
+@@ -30,13 +30,13 @@
+ run: all
+
+ all:
+- ${FAIL_IF_ERROR} ${CC} ${CCFLAGS} -arch ${ARCH} -c -O2 tl_test2.c -o tl_test2-${ARCH}.o
++ ${FAIL_IF_ERROR} ${CC} ${CCFLAGS} -c -O2 tl_test2.c -o tl_test2-${ARCH}.o
+
+ # verify that the alignment is correct in the .o
+ ObjectDump -only _ai -align -no_content tl_test2-${ARCH}.o|${FAIL_IF_ERROR} grep '\<0 mod 16\>' >/dev/null
+
+ # now verify the executable
+- ${FAIL_IF_ERROR} ${CC} ${CCFLAGS} -arch ${ARCH} -O2 tl_test2-${ARCH}.o -o tl_test2-${ARCH}
++ ${FAIL_IF_ERROR} ${CC} ${CCFLAGS} -O2 tl_test2-${ARCH}.o -o tl_test2-${ARCH}
+ ${FAIL_IF_ERROR} sh -c "nm tl_test2-${ARCH}|grep '0 D _ai\>' >/dev/null"
+ ${PASS_IFF_GOOD_MACHO} tl_test2-${ARCH}
+
+--- ld64-85.2.2/unit-tests/test-cases/eh-strip-test/Makefile
++++ ld64-85.2.2/unit-tests/test-cases/eh-strip-test/Makefile
+@@ -27,7 +27,7 @@
+
+
+ all:
+- ${FAIL_IF_ERROR} $(CXX) main.cxx -arch ${ARCH} -o main
++ ${FAIL_IF_ERROR} $(CXX) main.cxx -o main
+ ${FAIL_IF_ERROR} nm -j main | grep '\.eh$$'| ${FAIL_IF_STDIN}
+ ${PASS_IFF_GOOD_MACHO} main
+ clean:
+--- ld64-85.2.2/unit-tests/test-cases/strip-test2/Makefile
++++ ld64-85.2.2/unit-tests/test-cases/strip-test2/Makefile
+@@ -50,10 +50,10 @@
+
+
+ all:
+- $(CXX) main.cxx -arch ${ARCH} -o main
++ $(CXX) main.cxx -o main
+ ${FAIL_IF_BAD_MACHO} main
+ ${FAIL_IF_ERROR} nm -j main >main-no-strip.nm
+- $(CXX) main.cxx -arch ${ARCH} -o main
++ $(CXX) main.cxx -o main
+ ${FAIL_IF_BAD_MACHO} main
+
+ # Make sure there are no symbols in the stripped file that aren't
+--- ld64-85.2.2/unit-tests/test-cases/literals-coalesce/Makefile
++++ ld64-85.2.2/unit-tests/test-cases/literals-coalesce/Makefile
+@@ -32,7 +32,7 @@
+
+ all:
+ ${CC} ${ASMFLAGS} literals.s -c -o literals-${ARCH}.o
+- ${FAIL_IF_ERROR} ${OBJECTDUMP} literals-${ARCH}.o | grep 'name:'| uniq -c | grep -v '^ [1|2]' | ${FAIL_IF_STDIN}
++ ${FAIL_IF_ERROR} ${OBJECTDUMP} literals-${ARCH}.o | grep 'name:'| uniq -c | grep -v '^ *[1|2]' | ${FAIL_IF_STDIN}
+ ${LD} -arch ${ARCH} -r literals-${ARCH}.o -o literals-r-${ARCH}.o
+ ${FAIL_IF_ERROR} ${OBJECTDUMP} literals-r-${ARCH}.o | grep 'name:' | uniq -d | ${PASS_IFF_EMPTY}
+
+--- ld64-85.2.2/unit-tests/test-cases/stabs-coalesce/Makefile
++++ ld64-85.2.2/unit-tests/test-cases/stabs-coalesce/Makefile
+@@ -38,7 +38,7 @@
+ ${FAIL_IF_BAD_MACHO} stabs-hello-${ARCH}
+ nm -ap stabs-hello-${ARCH} | grep FUN | grep _Z3fooi | wc -l > stabs-hello-foo-count
+ echo " 1" > one
+- ${PASS_IFF} diff stabs-hello-foo-count one
++ ${PASS_IFF} diff -w stabs-hello-foo-count one
+
+ hello.o : hello.cxx
+ ${CXX} ${CCXXFLAGS} -gstabs+ -gused hello.cxx -c -o $@
diff --git a/sys-devel/binutils-apple/files/binutils-apple-3.1.2-as-Makefile.patch b/sys-devel/binutils-apple/files/binutils-apple-3.1.2-as-Makefile.patch
new file mode 100644
index 00000000000..554fed1cbe3
--- /dev/null
+++ b/sys-devel/binutils-apple/files/binutils-apple-3.1.2-as-Makefile.patch
@@ -0,0 +1,11 @@
+--- as/Makefile
++++ as/Makefile
+@@ -343,7 +343,7 @@
+ makeUser.o $(LIBSTUFF_DIR) $(LIBSTUFF)
+ $(CC) $(CFLAGS) $(RC_CFLAGS) -o $(SYMROOT)/as $(SYMROOT)/as.private.o
+
+-makeUser.c messages.c: make.h
++makeUser.c ../messages.c: make.h
+
+ make.h makeUser.c: make.defs
+ $(MIG) $(MIG_FLAGS) $(SRCROOT)/make.defs
diff --git a/sys-devel/binutils-apple/files/binutils-apple-3.2-armv7-defines.patch b/sys-devel/binutils-apple/files/binutils-apple-3.2-armv7-defines.patch
new file mode 100644
index 00000000000..d89a0c19f2c
--- /dev/null
+++ b/sys-devel/binutils-apple/files/binutils-apple-3.2-armv7-defines.patch
@@ -0,0 +1,10 @@
+--- cctools/include/mach/machine.h
++++ cctools/include/mach/machine.h
+@@ -306,6 +306,7 @@
+ #define CPU_SUBTYPE_ARM_V6 ((cpu_subtype_t) 6)
+ #define CPU_SUBTYPE_ARM_V5TEJ ((cpu_subtype_t) 7)
+ #define CPU_SUBTYPE_ARM_XSCALE ((cpu_subtype_t) 8)
++#define CPU_SUBTYPE_ARM_V7 ((cpu_subtype_t) 9)
+
+ /*
+ * MC88000 subtypes
diff --git a/sys-devel/binutils-apple/files/binutils-apple-3.2.2-as.patch b/sys-devel/binutils-apple/files/binutils-apple-3.2.2-as.patch
new file mode 100644
index 00000000000..f032e1b5571
--- /dev/null
+++ b/sys-devel/binutils-apple/files/binutils-apple-3.2.2-as.patch
@@ -0,0 +1,101 @@
+make building for obsolete architectures optional.
+
+--- as/Makefile
++++ as/Makefile
+@@ -1,3 +1,4 @@
++BUILD_OBSOLETE_ARCH = yes
+ RC_OS = macos
+ export USE_APPLE_PB_SUPPORT = all
+ OFLAG =
+@@ -32,28 +33,36 @@
+ SYMROOT = .
+ OBJROOT = .
+ SYM_DIRS = $(SYMROOT)/driver_dir \
+- $(SYMROOT)/a68_dir \
+- $(SYMROOT)/a88_dir \
+ $(SYMROOT)/a386_dir \
+ $(SYMROOT)/ax86_64_dir \
+ $(SYMROOT)/appc_dir \
+ $(SYMROOT)/appc64_dir \
++ $(SYMROOT)/aarm_dir
++
++ifeq "yes" "$(BUILD_OBSOLETE_ARCH)"
++SYM_DIRS += \
++ $(SYMROOT)/a68_dir \
++ $(SYMROOT)/a88_dir \
+ $(SYMROOT)/a860_dir \
+ $(SYMROOT)/ahppa_dir \
+- $(SYMROOT)/asparc_dir \
+- $(SYMROOT)/aarm_dir
++ $(SYMROOT)/asparc_dir
++endif
+
+ OFILE_DIRS = $(OBJROOT)/driver_dir \
+- $(OBJROOT)/a68_dir \
+- $(OBJROOT)/a88_dir \
+ $(OBJROOT)/a386_dir \
+ $(OBJROOT)/ax86_64_dir \
+ $(OBJROOT)/appc_dir \
+ $(OBJROOT)/appc64_dir \
++ $(OBJROOT)/aarm_dir
++
++ifeq "yes" "$(BUILD_OBSOLETE_ARCH)"
++OFILE_DIRS += \
++ $(OBJROOT)/a68_dir \
++ $(OBJROOT)/a88_dir \
+ $(OBJROOT)/a860_dir \
+ $(OBJROOT)/ahppa_dir \
+- $(OBJROOT)/asparc_dir \
+- $(OBJROOT)/aarm_dir
++ $(OBJROOT)/asparc_dir
++endif
+
+ BINDIR = /bin
+ USRBINDIR = /usr/bin
+@@ -115,9 +124,12 @@
+ OBJS_sparc = $(CFILES_sparc:.c=.o)
+ OBJS_arm = $(CFILES_arm:.c=.o)
+
+-all: $(OFILE_DIRS) $(SYM_DIRS) driver_build a68_build a88_build a386_build \
+- ax86_64_build a860_build appc_build appc64_build ahppa_build \
+- aarm_build asparc_build
++all: $(OFILE_DIRS) $(SYM_DIRS) driver_build a386_build \
++ ax86_64_build appc_build appc64_build aarm_build
++
++ifeq "yes" "$(BUILD_OBSOLETE_ARCH)"
++all: a68_build a88_build a860_build ahppa_build asparc_build
++endif
+
+ all_test: a68_test a88_test a860_test a386_test appc_test ahppa_test
+
+@@ -429,12 +441,14 @@
+ $(MKDIRS) $(DSTROOT)$(LIBDIR)/ppc64
+ install -c -s -m 555 $(SYMROOT)/appc64_dir/as \
+ $(DSTROOT)$(LIBDIR)/ppc64/as
++ifeq "yes" "$(BUILD_OBSOLETE_ARCH)"
+ $(MKDIRS) $(DSTROOT)$(LOCLIBDIR)/m68k
+ install -c -s -m 555 $(SYMROOT)/a68_dir/as \
+ $(DSTROOT)$(LOCLIBDIR)/m68k/as
+ $(MKDIRS) $(DSTROOT)$(LOCLIBDIR)/sparc
+ install -c -s -m 555 $(SYMROOT)/asparc_dir/as \
+ $(DSTROOT)$(LOCLIBDIR)/sparc/as
++endif
+ $(MKDIRS) $(DSTROOT)$(LIBDIR)/arm
+ install -c -s -m 555 $(SYMROOT)/aarm_dir/as \
+ $(DSTROOT)$(LIBDIR)/arm/as
+@@ -457,6 +471,7 @@
+ $(DSTROOT)$(LOCLIBDIR)/ppc/as
+
+ common_install:
++ifeq "yes" "$(BUILD_OBSOLETE_ARCH)"
+ $(MKDIRS) $(DSTROOT)$(LOCLIBDIR)/m88k
+ install -s -m 555 $(SYMROOT)/a88_dir/as \
+ $(DSTROOT)$(LOCLIBDIR)/m88k/as
+@@ -466,6 +481,7 @@
+ $(MKDIRS) $(DSTROOT)$(LOCLIBDIR)/i860
+ install -s -m 555 $(SYMROOT)/a860_dir/as \
+ $(DSTROOT)$(LOCLIBDIR)/i860/as
++endif
+
+ $(OFILE_DIRS) $(SYM_DIRS):
+ $(MKDIRS) $@
diff --git a/sys-devel/binutils-apple/files/binutils-apple-3.2.3-ranlib.patch b/sys-devel/binutils-apple/files/binutils-apple-3.2.3-ranlib.patch
new file mode 100644
index 00000000000..e5292746ead
--- /dev/null
+++ b/sys-devel/binutils-apple/files/binutils-apple-3.2.3-ranlib.patch
@@ -0,0 +1,59 @@
+run ranlib before installation so we needn't touch permissions
+
+--- cctools-782/cbtlibs/Makefile 2009-12-16 20:34:18.000000000 +0100
++++ cctools-782/cbtlibs/Makefile.new 2010-07-30 20:08:22.000000000 +0200
+@@ -84,9 +84,9 @@ libsyminfo.a: libsyminfo.o
+
+ lib_ofiles_install: lib_ofiles
+ $(MKDIRS) $(DSTROOT)$(LOCLIBDIR)
++ ranlib $(DSTROOT)$(LOCLIBDIR)/libsyminfo.a
+ install -p -c -m 444 $(SYMROOT)/libsyminfo.a \
+ $(DSTROOT)$(LOCLIBDIR)/libsyminfo.a
+- ranlib $(DSTROOT)$(LOCLIBDIR)/libsyminfo.a
+
+ -include $(OFILE_DIR)/Makedep
+
+--- cctools-782/libmacho/Makefile 2010-03-30 00:57:21.000000000 +0200
++++ cctools-782/libmacho/Makefile.new 2010-07-30 20:07:57.000000000 +0200
+@@ -357,17 +357,17 @@ macos_lib_ofiles_install: all
+ $(MKDIRS) $(DSTROOT)$(ARCHIVEDIR) $(DSTROOT)$(DYLIBDIR)
+ if [ $(SRCROOT) = . ]; \
+ then \
++ ranlib $(DSTROOT)$(ARCHIVEDIR)/libmacho.a; \
+ install -c -m 444 dtmp_obj/libmacho.a \
+ $(DSTROOT)$(ARCHIVEDIR)/libmacho.a; \
+- ranlib $(DSTROOT)$(ARCHIVEDIR)/libmacho.a; \
+ (cd $(DSTROOT)$(ARCHIVEDIR) ; \
+ rm -f libmacho_debug.a ; ln -s libmacho.a libmacho_debug.a); \
++ ranlib $(DSTROOT)$(ARCHIVEDIR)/libmacho_profile.a; \
+ install -c -m 444 ptmp_obj/libmacho_pg.a \
+ $(DSTROOT)$(ARCHIVEDIR)/libmacho_profile.a; \
+- ranlib $(DSTROOT)$(ARCHIVEDIR)/libmacho_profile.a; \
++ ranlib $(DSTROOT)$(ARCHIVEDIR)/libmacho_static.a; \
+ install -c -m 444 otmp_obj/libmacho_static.a \
+ $(DSTROOT)$(ARCHIVEDIR)/libmacho_static.a; \
+- ranlib $(DSTROOT)$(ARCHIVEDIR)/libmacho_static.a; \
+ install -c -m 555 dtmp_obj/libmacho.dylib \
+ $(DSTROOT)$(DYLIBDIR)/libmacho.dylib; \
+ strip -S $(DSTROOT)$(DYLIBDIR)/libmacho.dylib; \
+@@ -378,17 +378,17 @@ macos_lib_ofiles_install: all
+ $(DSTROOT)$(DYLIBDIR)/libmacho_debug.dylib; \
+ strip -S $(DSTROOT)$(DYLIBDIR)/libmacho_debug.dylib; \
+ else \
++ ranlib $(DSTROOT)$(ARCHIVEDIR)/libmacho.a; \
+ install -c -m 444 $(SYMROOT)/libmacho.a \
+ $(DSTROOT)$(ARCHIVEDIR)/libmacho.a; \
+- ranlib $(DSTROOT)$(ARCHIVEDIR)/libmacho.a; \
+ (cd $(DSTROOT)$(ARCHIVEDIR) ; \
+ rm -f libmacho_debug.a ; ln -s libmacho.a libmacho_debug.a); \
++ ranlib $(DSTROOT)$(ARCHIVEDIR)/libmacho_profile.a; \
+ install -c -m 444 $(SYMROOT)/libmacho_pg.a \
+ $(DSTROOT)$(ARCHIVEDIR)/libmacho_profile.a; \
+- ranlib $(DSTROOT)$(ARCHIVEDIR)/libmacho_profile.a; \
++ ranlib $(DSTROOT)$(ARCHIVEDIR)/libmacho_static.a; \
+ install -c -m 444 $(SYMROOT)/libmacho_static.a \
+ $(DSTROOT)$(ARCHIVEDIR)/libmacho_static.a; \
+- ranlib $(DSTROOT)$(ARCHIVEDIR)/libmacho_static.a; \
+ install -c -m 555 $(SYMROOT)/libmacho.dylib \
+ $(DSTROOT)$(DYLIBDIR)/libmacho.dylib; \
+ strip -S $(DSTROOT)$(DYLIBDIR)/libmacho.dylib; \
diff --git a/sys-devel/binutils-apple/files/binutils-apple-4.0-as-dir.patch b/sys-devel/binutils-apple/files/binutils-apple-4.0-as-dir.patch
new file mode 100644
index 00000000000..0a6664ce163
--- /dev/null
+++ b/sys-devel/binutils-apple/files/binutils-apple-4.0-as-dir.patch
@@ -0,0 +1,67 @@
+--- as/driver.c
++++ as/driver.c
+@@ -28,6 +28,9 @@
+ char **envp)
+ {
+ const char *LIB =
++#ifdef ASLIBEXECDIR
++ ASLIBEXECDIR;
++#else
+ #if defined(__OPENSTEP__) || defined(__HERA__) || \
+ defined(__GONZO_BUNSEN_BEAKER__) || defined(__KODIAK__)
+ "../libexec/";
+@@ -41,6 +44,7 @@
+ #else
+ "../local/libexec/gcc/darwin/";
+ #endif
++#endif
+ const char *AS = "/as";
+ const char *LLVM_MC = "llvm-mc";
+
+@@ -240,7 +244,11 @@
+
+ }
+
++#ifndef ASLIBEXECDIR
+ as = makestr(prefix, LIB, arch_name, AS, NULL);
++#else
++ as = makestr(LIB, arch_name, AS, NULL);
++#endif
+
+ /*
+ * If this assembler exist try to run it else print an error message.
+@@ -252,6 +260,10 @@
+ else
+ exit(1);
+ }
++#ifdef ASLIBEXECDIR
++ as_local = "";
++ {
++#else
+ as_local = makestr(prefix, LOCALLIB, arch_name, AS, NULL);
+ if(access(as_local, F_OK) == 0){
+ argv[0] = as_local;
+@@ -261,6 +273,7 @@
+ exit(1);
+ }
+ else{
++#endif
+ printf("%s: assembler (%s or %s) for architecture %s not "
+ "installed\n", progname, as, as_local, arch_name);
+ arch_flags = get_arch_flags();
+@@ -273,6 +286,7 @@
+ printf("%s for architecture %s\n", as, arch_flags[i].name);
+ count++;
+ }
++#ifndef ASLIBEXECDIR
+ else{
+ as_local = makestr(prefix, LOCALLIB, arch_flags[i].name,
+ AS, NULL);
+@@ -284,6 +298,7 @@
+ count++;
+ }
+ }
++#endif
+ }
+ if(count == 0)
+ printf("%s: no assemblers installed\n", progname);
diff --git a/sys-devel/binutils-apple/files/binutils-apple-4.0-as.patch b/sys-devel/binutils-apple/files/binutils-apple-4.0-as.patch
new file mode 100644
index 00000000000..8df58775d65
--- /dev/null
+++ b/sys-devel/binutils-apple/files/binutils-apple-4.0-as.patch
@@ -0,0 +1,99 @@
+--- as/Makefile
++++ as/Makefile
+@@ -1,3 +1,4 @@
++BUILD_OBSOLETE_ARCH = yes
+ RC_OS = macos
+ export USE_APPLE_PB_SUPPORT = all
+ OFLAG = -Os
+@@ -32,28 +33,36 @@
+ SYMROOT = .
+ OBJROOT = .
+ SYM_DIRS = $(SYMROOT)/driver_dir \
+- $(SYMROOT)/a68_dir \
+- $(SYMROOT)/a88_dir \
+ $(SYMROOT)/a386_dir \
+ $(SYMROOT)/ax86_64_dir \
+ $(SYMROOT)/appc_dir \
+ $(SYMROOT)/appc64_dir \
++ $(SYMROOT)/aarm_dir
++
++ifeq "yes" "$(BUILD_OBSOLETE_ARCH)"
++SYM_DIRS += \
++ $(SYMROOT)/a68_dir \
++ $(SYMROOT)/a88_dir \
+ $(SYMROOT)/a860_dir \
+ $(SYMROOT)/ahppa_dir \
+- $(SYMROOT)/asparc_dir \
+- $(SYMROOT)/aarm_dir
++ $(SYMROOT)/asparc_dir
++endif
+
+ OFILE_DIRS = $(OBJROOT)/driver_dir \
+- $(OBJROOT)/a68_dir \
+- $(OBJROOT)/a88_dir \
+ $(OBJROOT)/a386_dir \
+ $(OBJROOT)/ax86_64_dir \
+ $(OBJROOT)/appc_dir \
+ $(OBJROOT)/appc64_dir \
++ $(OBJROOT)/aarm_dir
++
++ifeq "yes" "$(BUILD_OBSOLETE_ARCH)"
++OFILE_DIRS += \
++ $(OBJROOT)/a68_dir \
++ $(OBJROOT)/a88_dir \
+ $(OBJROOT)/a860_dir \
+ $(OBJROOT)/ahppa_dir \
+- $(OBJROOT)/asparc_dir \
+- $(OBJROOT)/aarm_dir
++ $(OBJROOT)/asparc_dir
++endif
+
+ BINDIR = /bin
+ USRBINDIR = /usr/bin
+@@ -115,9 +124,12 @@
+ OBJS_sparc = $(CFILES_sparc:.c=.o)
+ OBJS_arm = $(CFILES_arm:.c=.o)
+
+-all: $(OFILE_DIRS) $(SYM_DIRS) driver_build a68_build a88_build a386_build \
+- ax86_64_build a860_build appc_build appc64_build ahppa_build \
+- aarm_build asparc_build
++all: $(OFILE_DIRS) $(SYM_DIRS) driver_build a386_build \
++ ax86_64_build appc_build appc64_build aarm_build
++
++ifeq "yes" "$(BUILD_OBSOLETE_ARCH)"
++all: a68_build a88_build a860_build ahppa_build asparc_build
++endif
+
+ all_test: a68_test a88_test a860_test a386_test appc_test ahppa_test
+
+@@ -452,12 +464,14 @@
+ $(MKDIRS) $(DSTROOT)$(LOCLIBDIR)/ppc64
+ install -c -s -m 555 $(SYMROOT)/appc64_dir/as \
+ $(DSTROOT)$(LOCLIBDIR)/ppc64/as
++ifeq "yes" "$(BUILD_OBSOLETE_ARCH)"
+ $(MKDIRS) $(DSTROOT)$(LOCLIBDIR)/m68k
+ install -c -s -m 555 $(SYMROOT)/a68_dir/as \
+ $(DSTROOT)$(LOCLIBDIR)/m68k/as
+ $(MKDIRS) $(DSTROOT)$(LOCLIBDIR)/sparc
+ install -c -s -m 555 $(SYMROOT)/asparc_dir/as \
+ $(DSTROOT)$(LOCLIBDIR)/sparc/as
++endif
+ $(MKDIRS) $(DSTROOT)$(LIBDIR)/arm
+ install -c -s -m 555 $(SYMROOT)/aarm_dir/as \
+ $(DSTROOT)$(LIBDIR)/arm/as
+@@ -480,6 +494,7 @@
+ $(DSTROOT)$(LOCLIBDIR)/ppc/as
+
+ common_install:
++ifeq "yes" "$(BUILD_OBSOLETE_ARCH)"
+ $(MKDIRS) $(DSTROOT)$(LOCLIBDIR)/m88k
+ install -c -s -m 555 $(SYMROOT)/a88_dir/as \
+ $(DSTROOT)$(LOCLIBDIR)/m88k/as
+@@ -489,6 +504,7 @@
+ $(MKDIRS) $(DSTROOT)$(LOCLIBDIR)/i860
+ install -s -m 555 $(SYMROOT)/a860_dir/as \
+ $(DSTROOT)$(LOCLIBDIR)/i860/as
++endif
+
+ $(OFILE_DIRS) $(SYM_DIRS):
+ $(MKDIRS) $@
diff --git a/sys-devel/binutils-apple/files/binutils-apple-4.0-no-oss-dir.patch b/sys-devel/binutils-apple/files/binutils-apple-4.0-no-oss-dir.patch
new file mode 100644
index 00000000000..fcce015e198
--- /dev/null
+++ b/sys-devel/binutils-apple/files/binutils-apple-4.0-no-oss-dir.patch
@@ -0,0 +1,15 @@
+--- as/Makefile
++++ as/Makefile
+@@ -452,12 +452,6 @@
+ $(MKDIRS) $(DSTROOT)$(USRBINDIR)
+ install -c -s -m 555 $(SYMROOT)/driver_dir/driver \
+ $(DSTROOT)$(USRBINDIR)/as
+- $(MKDIRS) $(DSTROOT)/usr/local/OpenSourceVersions/
+- install -c -s -m 444 $(SRCROOT)/cctools.plist \
+- $(DSTROOT)/usr/local/OpenSourceVersions/cctools.plist
+- $(MKDIRS) $(DSTROOT)/usr/local/OpenSourceLicenses/
+- install -c -s -m 444 $(SRCROOT)/COPYING \
+- $(DSTROOT)/usr/local/OpenSourceLicenses/cctools.txt
+ $(MKDIRS) $(DSTROOT)$(LOCLIBDIR)/ppc
+ install -c -s -m 555 $(SYMROOT)/appc_dir/as \
+ $(DSTROOT)$(LOCLIBDIR)/ppc/as
diff --git a/sys-devel/binutils-apple/files/binutils-apple-4.2-as-dir.patch b/sys-devel/binutils-apple/files/binutils-apple-4.2-as-dir.patch
new file mode 100644
index 00000000000..b3047f6215f
--- /dev/null
+++ b/sys-devel/binutils-apple/files/binutils-apple-4.2-as-dir.patch
@@ -0,0 +1,45 @@
+--- as/driver.c
++++ as/driver.c
+@@ -230,7 +230,11 @@
+ /*
+ * If this assembler exist try to run it else print an error message.
+ */
++#ifndef ASLIBEXECDIR
+ as = makestr(prefix, LIB, arch_name, AS, NULL);
++#else
++ as = makestr(ASLIBEXECDIR, arch_name, AS, NULL);
++#endif
+ if(access(as, F_OK) == 0){
+ argv[0] = as;
+ if(execute(argv, verbose))
+@@ -238,6 +242,9 @@
+ else
+ exit(1);
+ }
++#ifdef ASLIBEXECDIR
++ as_local = "";
++#else
+ as_local = makestr(prefix, LOCALLIB, arch_name, AS, NULL);
+ if(access(as_local, F_OK) == 0){
+ argv[0] = as_local;
+@@ -246,10 +253,12 @@
+ else
+ exit(1);
+ }
++#endif
+ printf("%s: assembler (%s or %s) for architecture %s not installed\n",
+ progname, as, as_local, arch_name);
+ arch_flags = get_arch_flags();
+ count = 0;
++#ifndef ASLIBEXECDIR
+ for(i = 0; arch_flags[i].name != NULL; i++){
+ as = makestr(prefix, LIB, arch_flags[i].name, AS, NULL);
+ if(access(as, F_OK) == 0){
+@@ -270,6 +279,7 @@
+ }
+ }
+ }
++#endif
+ if(count == 0)
+ printf("%s: no assemblers installed\n", progname);
+ exit(1);
diff --git a/sys-devel/binutils-apple/files/binutils-apple-4.2-globals-extern.patch b/sys-devel/binutils-apple/files/binutils-apple-4.2-globals-extern.patch
new file mode 100644
index 00000000000..76419ad9078
--- /dev/null
+++ b/sys-devel/binutils-apple/files/binutils-apple-4.2-globals-extern.patch
@@ -0,0 +1,29 @@
+Externally referenced globals should be marked extern to avoid stuff like this happening:
+
+ld: warning: tentative definition of '_subsections_via_symbols' with size 16 from 'app.o' is being replaced by real definition of smaller size 4 from 'as.o'
+ld: warning: tentative definition of '_subsections_via_symbols' with size 16 from 'atof-ieee.o' is being replaced by real definition of smaller size 4 from 'as.o'
+...
+
+--- cctools-809/as/as.h.orig 2015-01-28 23:52:40.000000000 +0100
++++ cctools-809/as/as.h 2015-01-28 23:52:52.000000000 +0100
+@@ -179,7 +179,7 @@
+ extern char *specific_archflag;
+
+ /* TRUE if the .subsections_via_symbols directive was seen */
+-int subsections_via_symbols;
++extern int subsections_via_symbols;
+
+ /* -I path options for .includes */
+ struct directory_stack {
+--- cctools-809/as/arm.c.orig 2015-01-28 23:57:23.000000000 +0100
++++ cctools-809/as/arm.c 2015-01-28 23:57:35.000000000 +0100
+@@ -151,8 +151,7 @@
+ # define N_(String) (String)
+
+ /* STUFF FROM gas/as.h */
+-#define COMMON
+-COMMON subsegT now_subseg;
++extern subsegT now_subseg;
+
+ /* STUFF FROM gas/config/tc-arm.h */
+ #define ARM_FLAG_THUMB (1 << 0) /* The symbol is a Thumb symbol rather than an Arm symbol. */
diff --git a/sys-devel/binutils-apple/files/binutils-apple-4.2-lto.patch b/sys-devel/binutils-apple/files/binutils-apple-4.2-lto.patch
new file mode 100644
index 00000000000..791a922dd42
--- /dev/null
+++ b/sys-devel/binutils-apple/files/binutils-apple-4.2-lto.patch
@@ -0,0 +1,34 @@
+--- misc/lipo.c
++++ misc/lipo.c
+@@ -1191,6 +1191,7 @@
+ thin->fat_arch.align = 0;
+ }
+ else{
++#ifdef LTO_SUPPORT
+ if(is_llvm_bitcode_from_memory(addr, size, &input->arch_flag,
+ NULL) != 0){
+ /* create a thin file struct for it */
+@@ -1204,6 +1205,7 @@
+ thin->fat_arch.align = 0;
+ }
+ else
++#endif
+ fatal("can't figure out the architecture type of: %s",
+ input->name);
+ }
+@@ -1444,6 +1446,7 @@
+ if(strncmp(ar_name, SYMDEF, sizeof(SYMDEF) - 1) != 0){
+ ar_addr = addr + offset + ar_name_size;
+ ar_size = strtoul(ar_hdr->ar_size, NULL, 10);
++#ifdef LTO_SUPPORT
+ if(is_llvm_bitcode_from_memory(ar_addr, ar_size,
+ &arch_flag, NULL) != 0){
+ if(*cputype == 0){
+@@ -1466,6 +1464,7 @@
+ (*cpusubtype) & ~CPU_SUBTYPE_MASK);
+ }
+ }
++#endif
+ }
+ }
+ }
diff --git a/sys-devel/binutils-apple/files/binutils-apple-4.5-as.patch b/sys-devel/binutils-apple/files/binutils-apple-4.5-as.patch
new file mode 100644
index 00000000000..0769016c568
--- /dev/null
+++ b/sys-devel/binutils-apple/files/binutils-apple-4.5-as.patch
@@ -0,0 +1,100 @@
+Allow to disable build of as backends for obsolete architectures.
+
+diff --git a/as/Makefile b/as/Makefile
+index a4b016e..9e8bcc3 100644
+--- a/as/Makefile
++++ b/as/Makefile
+@@ -1,3 +1,4 @@
++BUILD_OBSOLETE_ARCH = yes
+ export USE_APPLE_PB_SUPPORT = all
+
+ ifneq "" "$(SDKROOT)"
+@@ -20,28 +21,36 @@ SRCROOT = .
+ SYMROOT = .
+ OBJROOT = .
+ SYM_DIRS = $(SYMROOT)/driver_dir \
+- $(SYMROOT)/a68_dir \
+- $(SYMROOT)/a88_dir \
+ $(SYMROOT)/a386_dir \
+ $(SYMROOT)/ax86_64_dir \
+ $(SYMROOT)/appc_dir \
+ $(SYMROOT)/appc64_dir \
++ $(SYMROOT)/aarm_dir
++
++ifeq "yes" "$(BUILD_OBSOLETE_ARCH)"
++SYM_DIRS += \
++ $(SYMROOT)/a68_dir \
++ $(SYMROOT)/a88_dir \
+ $(SYMROOT)/a860_dir \
+ $(SYMROOT)/ahppa_dir \
+- $(SYMROOT)/asparc_dir \
+- $(SYMROOT)/aarm_dir
++ $(SYMROOT)/asparc_dir
++endif
+
+ OFILE_DIRS = $(OBJROOT)/driver_dir \
+- $(OBJROOT)/a68_dir \
+- $(OBJROOT)/a88_dir \
+ $(OBJROOT)/a386_dir \
+ $(OBJROOT)/ax86_64_dir \
+ $(OBJROOT)/appc_dir \
+ $(OBJROOT)/appc64_dir \
++ $(OBJROOT)/aarm_dir
++
++ifeq "yes" "$(BUILD_OBSOLETE_ARCH)"
++OFILE_DIRS += \
++ $(OBJROOT)/a68_dir \
++ $(OBJROOT)/a88_dir \
+ $(OBJROOT)/a860_dir \
+ $(OBJROOT)/ahppa_dir \
+- $(OBJROOT)/asparc_dir \
+- $(OBJROOT)/aarm_dir
++ $(OBJROOT)/asparc_dir
++endif
+
+ BINDIR = /bin
+ USRBINDIR = /usr/bin
+@@ -88,9 +97,13 @@ OBJS_hppa = $(CFILES_hppa:.c=.o)
+ OBJS_sparc = $(CFILES_sparc:.c=.o)
+ OBJS_arm = $(CFILES_arm:.c=.o)
+
+-all: $(OFILE_DIRS) $(SYM_DIRS) driver_build a68_build a88_build a386_build \
+- ax86_64_build a860_build appc_build appc64_build ahppa_build \
+- aarm_build asparc_build
++all: $(OFILE_DIRS) $(SYM_DIRS) driver_build a386_build \
++ ax86_64_build appc_build appc64_build aarm_build
++
++ifeq "yes" "$(BUILD_OBSOLETE_ARCH)"
++all: a68_build a88_build a860_build ahppa_build asparc_build
++endif
++
+
+ all_test: a68_test a88_test a860_test a386_test appc_test ahppa_test
+
+@@ -406,15 +419,18 @@ install: all
+ $(MKDIRS) $(DSTROOT)$(LOCLIBDIR)/ppc64
+ install -c -s -m 555 $(SYMROOT)/appc64_dir/as \
+ $(DSTROOT)$(LOCLIBDIR)/ppc64/as
++ifeq "yes" "$(BUILD_OBSOLETE_ARCH)"
+ $(MKDIRS) $(DSTROOT)$(LOCLIBDIR)/m68k
+ install -c -s -m 555 $(SYMROOT)/a68_dir/as \
+ $(DSTROOT)$(LOCLIBDIR)/m68k/as
+ $(MKDIRS) $(DSTROOT)$(LOCLIBDIR)/sparc
+ install -c -s -m 555 $(SYMROOT)/asparc_dir/as \
+ $(DSTROOT)$(LOCLIBDIR)/sparc/as
++endif
+ $(MKDIRS) $(DSTROOT)$(LIBDIR)/arm
+ install -c -s -m 555 $(SYMROOT)/aarm_dir/as \
+ $(DSTROOT)$(LIBDIR)/arm/as
++ifeq "yes" "$(BUILD_OBSOLETE_ARCH)"
+ $(MKDIRS) $(DSTROOT)$(LOCLIBDIR)/m88k
+ install -c -s -m 555 $(SYMROOT)/a88_dir/as \
+ $(DSTROOT)$(LOCLIBDIR)/m88k/as
+@@ -424,6 +440,7 @@ install: all
+ $(MKDIRS) $(DSTROOT)$(LOCLIBDIR)/i860
+ install -s -m 555 $(SYMROOT)/a860_dir/as \
+ $(DSTROOT)$(LOCLIBDIR)/i860/as
++endif
+
+ $(OFILE_DIRS) $(SYM_DIRS):
+ $(MKDIRS) $@
diff --git a/sys-devel/binutils-apple/files/binutils-apple-5.1-as-dir.patch b/sys-devel/binutils-apple/files/binutils-apple-5.1-as-dir.patch
new file mode 100644
index 00000000000..1c7c6360a6a
--- /dev/null
+++ b/sys-devel/binutils-apple/files/binutils-apple-5.1-as-dir.patch
@@ -0,0 +1,47 @@
+Allow to set directory for as backends from the outside.
+
+--- cctools-855/as/driver.c.orig 2014-04-05 00:42:22.000000000 +0200
++++ cctools-855/as/driver.c 2014-11-13 13:07:09.000000000 +0100
+@@ -365,7 +365,11 @@
+ /*
+ * If this assembler exist try to run it else print an error message.
+ */
++#ifndef ASLIBEXECDIR
+ as = makestr(prefix, LIB, arch_name, AS, NULL);
++#else
++ as = makestr(ASLIBEXECDIR, arch_name, AS, NULL);
++#endif
+ new_argv = allocate((argc + 1) * sizeof(char *));
+ new_argv[0] = as;
+ j = 1;
+@@ -387,6 +391,9 @@
+ else
+ exit(1);
+ }
++#ifdef ASLIBEXECDIR
++ as_local = "";
++#else
+ as_local = makestr(prefix, LOCALLIB, arch_name, AS, NULL);
+ new_argv[0] = as_local;
+ if(access(as_local, F_OK) == 0){
+@@ -396,10 +403,12 @@
+ else
+ exit(1);
+ }
++#endif
+ printf("%s: assembler (%s or %s) for architecture %s not installed\n",
+ progname, as, as_local, arch_name);
+ arch_flags = get_arch_flags();
+ count = 0;
++#ifndef ASLIBEXECDIR
+ for(i = 0; arch_flags[i].name != NULL; i++){
+ as = makestr(prefix, LIB, arch_flags[i].name, AS, NULL);
+ if(access(as, F_OK) == 0){
+@@ -420,6 +429,7 @@
+ }
+ }
+ }
++#endif
+ if(count == 0)
+ printf("%s: no assemblers installed\n", progname);
+ exit(1);
diff --git a/sys-devel/binutils-apple/files/binutils-apple-5.1-constant-types.patch b/sys-devel/binutils-apple/files/binutils-apple-5.1-constant-types.patch
new file mode 100644
index 00000000000..066ce57a6f5
--- /dev/null
+++ b/sys-devel/binutils-apple/files/binutils-apple-5.1-constant-types.patch
@@ -0,0 +1,26 @@
+Avoid error with gcc on 32bit platforms:
+ld/LinkEdit.hpp:1329: error: integer constant is too large for 'long' type
+
+--- cctools-855/include/llvm-c/Disassembler.h.orig 2015-01-14 18:36:22.000000000 +0100
++++ cctools-855/include/llvm-c/Disassembler.h 2015-01-14 18:36:39.000000000 +0100
+@@ -133,15 +133,15 @@
+ #define LLVMDisassembler_ReferenceType_In_PCrel_Load 2
+
+ /* The input reference is from an ARM64::ADRP instruction. */
+-#define LLVMDisassembler_ReferenceType_In_ARM64_ADRP 0x100000001
++#define LLVMDisassembler_ReferenceType_In_ARM64_ADRP 0x100000001ULL
+ /* The input reference is from an ARM64::ADDXri instruction. */
+-#define LLVMDisassembler_ReferenceType_In_ARM64_ADDXri 0x100000002
++#define LLVMDisassembler_ReferenceType_In_ARM64_ADDXri 0x100000002ULL
+ /* The input reference is from an ARM64::LDRXui instruction. */
+-#define LLVMDisassembler_ReferenceType_In_ARM64_LDRXui 0x100000003
++#define LLVMDisassembler_ReferenceType_In_ARM64_LDRXui 0x100000003ULL
+ /* The input reference is from an ARM64::LDRXl instruction. */
+-#define LLVMDisassembler_ReferenceType_In_ARM64_LDRXl 0x100000004
++#define LLVMDisassembler_ReferenceType_In_ARM64_LDRXl 0x100000004ULL
+ /* The input reference is from an ARM64::ADR instruction. */
+-#define LLVMDisassembler_ReferenceType_In_ARM64_ADR 0x100000005
++#define LLVMDisassembler_ReferenceType_In_ARM64_ADR 0x100000005ULL
+
+ /* The output reference is to as symbol stub. */
+ #define LLVMDisassembler_ReferenceType_Out_SymbolStub 1
diff --git a/sys-devel/binutils-apple/files/binutils-apple-5.1-extraneous-includes.patch b/sys-devel/binutils-apple/files/binutils-apple-5.1-extraneous-includes.patch
new file mode 100644
index 00000000000..2e0a109223f
--- /dev/null
+++ b/sys-devel/binutils-apple/files/binutils-apple-5.1-extraneous-includes.patch
@@ -0,0 +1,31 @@
+Remove extraneous includes that contain clang language extensions on Mac OS X
+10.10 (xpc/base.h - __has_extension).
+
+--- ./cctools-855/as/messages.c.orig 2015-01-12 18:49:02.000000000 +0100
++++ ./cctools-855/as/messages.c 2015-01-12 18:49:06.000000000 +0100
+@@ -23,11 +23,6 @@
+ #include <string.h>
+ #include <mach/mach.h>
+ #include <mach/mach_init.h>
+-#if defined(__OPENSTEP__) || defined(__GONZO_BUNSEN_BEAKER__)
+-#include <servers/netname.h>
+-#else
+-#include <servers/bootstrap.h>
+-#endif
+ #include "as.h"
+ #include "input-scrub.h"
+ #include "messages.h"
+--- ./cctools-855/misc/libtool.c.orig 2015-01-12 18:48:29.000000000 +0100
++++ ./cctools-855/misc/libtool.c 2015-01-12 18:48:40.000000000 +0100
+@@ -53,11 +53,6 @@
+ #endif /* LTO_SUPPORT */
+
+ #include <mach/mach_init.h>
+-#if defined(__OPENSTEP__) || defined(__GONZO_BUNSEN_BEAKER__)
+-#include <servers/netname.h>
+-#else
+-#include <servers/bootstrap.h>
+-#endif
+
+ /*
+ * This is used internally to build the table of contents.
diff --git a/sys-devel/binutils-apple/files/binutils-apple-5.1-nolto.patch b/sys-devel/binutils-apple/files/binutils-apple-5.1-nolto.patch
new file mode 100644
index 00000000000..62490ef8ce4
--- /dev/null
+++ b/sys-devel/binutils-apple/files/binutils-apple-5.1-nolto.patch
@@ -0,0 +1,43 @@
+Allow to fully disable LTO.
+
+diff --git a/libstuff/lto.c b/libstuff/lto.c
+index 6f5758d..5ba7996 100644
+--- a/libstuff/lto.c
++++ b/libstuff/lto.c
+@@ -381,4 +381,18 @@ void *mod)
+ lto_dispose(mod);
+ }
+
++#else
++
++#include <stdlib.h>
++#include "stuff/ofile.h"
++
++__private_extern__
++int
++is_llvm_bitcode(
++ struct ofile *ofile,
++ char *addr,
++ size_t size)
++{
++ return 0;
++}
+ #endif /* LTO_SUPPORT */
+diff --git a/misc/libtool.c b/misc/libtool.c
+index f9c7557..ff829cc 100644
+--- a/misc/libtool.c
++++ b/misc/libtool.c
+@@ -1370,8 +1370,11 @@ void)
+ }
+ }
+ }
+- else if(ofiles[i].arch_type == OFILE_Mach_O ||
+- ofiles[i].arch_type == OFILE_LLVM_BITCODE){
++ else if(ofiles[i].arch_type == OFILE_Mach_O
++#ifdef LTO_SUPPORT
++ || ofiles[i].arch_type == OFILE_LLVM_BITCODE
++#endif
++ ){
+ if(cmd_flags.ranlib == TRUE){
+ error("for architecture: %s file: %s is not an "
+ "archive (no processing done on this file)",
diff --git a/sys-devel/binutils-apple/files/binutils-apple-5.1-otool-stdc.patch b/sys-devel/binutils-apple/files/binutils-apple-5.1-otool-stdc.patch
new file mode 100644
index 00000000000..ca02e643a45
--- /dev/null
+++ b/sys-devel/binutils-apple/files/binutils-apple-5.1-otool-stdc.patch
@@ -0,0 +1,23 @@
+Do not use C++/C11(?) style local variable declaration.
+
+--- cctools-855/otool/dyld_bind_info.c.orig 2015-01-12 18:55:04.000000000 +0100
++++ cctools-855/otool/dyld_bind_info.c 2015-01-12 18:56:35.000000000 +0100
+@@ -353,7 +353,9 @@
+ skip = read_uleb128(&p, end);
+ sectName = sectionName(segIndex, segStartAddr + segOffset,
+ segs, nsegs, segs64, nsegs64);
+- for (uint32_t i=0; i < count; ++i) {
++ {
++ uint32_t i;
++ for (i=0; i < count; ++i) {
+ if(pass == 2){
+ (*dbi)[n].segname = segName;
+ (*dbi)[n].sectname = sectName;
+@@ -367,6 +369,7 @@
+ n++;
+ segOffset += skip + sizeof_pointer;
+ }
++ }
+ break;
+ default:
+ return; /* throwf("bad bind opcode %d", *p); */
diff --git a/sys-devel/binutils-apple/files/binutils-apple-5.1-ranlib.patch b/sys-devel/binutils-apple/files/binutils-apple-5.1-ranlib.patch
new file mode 100644
index 00000000000..1930dfc82d2
--- /dev/null
+++ b/sys-devel/binutils-apple/files/binutils-apple-5.1-ranlib.patch
@@ -0,0 +1,15 @@
+Run ranlib before installation of the libary.
+
+--- ./cctools-855/cbtlibs/Makefile.ranlib 2014-04-05 00:42:22.000000000 +0200
++++ ./cctools-855/cbtlibs/Makefile 2014-08-29 14:49:41.000000000 +0200
+@@ -61,9 +61,9 @@
+
+ lib_ofiles_install: lib_ofiles
+ $(MKDIRS) $(DSTROOT)$(LOCLIBDIR)
++ $(RANLIB) $(SYMROOT)/libsyminfo.a
+ install -p -c -m 444 $(SYMROOT)/libsyminfo.a \
+ $(DSTROOT)$(LOCLIBDIR)/libsyminfo.a
+- $(RANLIB) $(DSTROOT)$(LOCLIBDIR)/libsyminfo.a
+
+ $(OFILE_DIR) $(SYMROOT):
+ $(MKDIRS) $@
diff --git a/sys-devel/binutils-apple/files/binutils-apple-5.1-strnlen.patch b/sys-devel/binutils-apple/files/binutils-apple-5.1-strnlen.patch
new file mode 100644
index 00000000000..887e15628b3
--- /dev/null
+++ b/sys-devel/binutils-apple/files/binutils-apple-5.1-strnlen.patch
@@ -0,0 +1,45 @@
+Provide strnlen on platforms where it's missing.
+
+--- cctools-855/otool/ofile_print.c.orig 2015-01-14 18:33:14.000000000 +0100
++++ cctools-855/otool/ofile_print.c 2015-01-14 18:34:03.000000000 +0100
+@@ -3647,6 +3647,40 @@
+ printf(" pad %u\n", ec->pad);
+ }
+
++/* borrowed from gnulib */
++#include <AvailabilityMacros.h>
++
++#if MAC_OS_X_VERSION_MIN_REQUIRED < 1070
++/* Find the length of STRING, but scan at most MAXLEN characters.
++ * Copyright (C) 2005-2007, 2009-2015 Free Software Foundation, Inc.
++ * Written by Simon Josefsson.
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License as published by
++ * the Free Software Foundation; either version 2, or (at your option)
++ * any later version.
++ *
++ * This program 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 General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public License
++ * along with this program; if not, see <http://www.gnu.org/licenses/>. */
++
++#include <string.h>
++
++/* Find the length of STRING, but scan at most MAXLEN characters.
++ * If no '\0' terminator is found in that many characters, return MAXLEN. */
++
++size_t
++strnlen (const char *string, size_t maxlen)
++{
++ const char *end = memchr (string, '\0', maxlen);
++ return end ? (size_t) (end - string) : maxlen;
++}
++#endif
++
+ /*
+ * print an LC_LINKER_OPTION command. The linker_option_command structure
+ * specified must be aligned correctly and in the host byte sex. The lc is
diff --git a/sys-devel/binutils-apple/files/cctools-839-intel-retf.patch b/sys-devel/binutils-apple/files/cctools-839-intel-retf.patch
new file mode 100644
index 00000000000..d9bd9a8425b
--- /dev/null
+++ b/sys-devel/binutils-apple/files/cctools-839-intel-retf.patch
@@ -0,0 +1,14 @@
+diff --git a/as/i386-opcode.h b/as/i386-opcode.h
+index 4ba397f..862449a 100644
+--- a/as/i386-opcode.h
++++ b/as/i386-opcode.h
+@@ -415,6 +415,9 @@ static const template i386_optab[] =
+ {"ret", 1, 0xc2, X, Cpu64, wq_Suf|DefaultSize|NoRex64,{ Imm16, 0, 0} },
+ {"lret", 0, 0xcb, X, 0, wlq_Suf|DefaultSize, { 0, 0, 0} },
+ {"lret", 1, 0xca, X, 0, wlq_Suf|DefaultSize, { Imm16, 0, 0} },
++// intel syntax
++{"retf", 0, 0xcb, X, 0, wlq_Suf|DefaultSize, { 0, 0, 0} },
++{"retf", 1, 0xca, X, 0, wlq_Suf|DefaultSize, { Imm16, 0, 0} },
+ {"enter", 2, 0xc8, X, Cpu186|CpuNo64, wl_Suf|DefaultSize, { Imm16, Imm8, 0} },
+ {"enter", 2, 0xc8, X, Cpu64, wq_Suf|DefaultSize|NoRex64, { Imm16, Imm8, 0} },
+ {"leave", 0, 0xc9, X, Cpu186|CpuNo64, wl_Suf|DefaultSize, { 0, 0, 0} },
diff --git a/sys-devel/binutils-apple/files/ld64-123.2-Makefile b/sys-devel/binutils-apple/files/ld64-123.2-Makefile
new file mode 100644
index 00000000000..47af12d4b2e
--- /dev/null
+++ b/sys-devel/binutils-apple/files/ld64-123.2-Makefile
@@ -0,0 +1,47 @@
+CPPFLAGS += "-DCPU_SUBTYPE_X86_ALL=((cpu_subtype_t)3)" -Iinclude -Iabstraction -Ild -Ild/parsers -Iother -I.
+
+# dropped machocheck due to compilation failures
+all: rebase unwinddump dyldinfo ld64 ObjectDump
+
+libprunetrie.a: other/PruneTrie.o other/prune_trie.h
+ $(AR) -s -r -c libprunetrie.a other/PruneTrie.o
+
+LD64LIBS=ld/parsers/archive_file.o ld/parsers/macho_relocatable_file.o \
+ ld/parsers/opaque_section_file.o \
+ ld/parsers/macho_dylib_file.o \
+ ld/passes/branch_island.o ld/passes/dylibs.o ld/passes/order_file.o \
+ ld/passes/branch_shim.o ld/passes/got.o ld/passes/tlvp.o \
+ ld/passes/compact_unwind.o ld/passes/huge.o \
+ ld/passes/dtrace_dof.o ld/passes/objc.o \
+ ld/passes/stubs/stubs.o \
+ ld/InputFiles.o ld/OutputFile.o ld/SymbolTable.o \
+ ld/Options.o ld/Resolver.o ld/debugline.o ld/ld.o
+
+ifeq ($(LTO),1)
+CPPFLAGS += "-DLTO"
+LTO_OBJ = ld/parsers/lto_file.o
+LIBLTO = -lLTO
+else
+CPPFLAGS += "-ULTO"
+LTO_OBJ =
+LIBLTO =
+endif
+
+ld64: libprunetrie.a version.o $(LD64LIBS) $(LTO_OBJ)
+ $(CXX) $(CXXFLAGS) $(LDFLAGS) $(LIBLTO) -o $@ $^
+
+rebase: other/rebase.o
+ $(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ $^
+
+dyldinfo: other/dyldinfo.o
+ $(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ $^
+
+unwinddump: other/unwinddump.o
+ $(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ $^
+
+ObjectDump: other/ObjectDump.o ld/debugline.o ld/parsers/macho_relocatable_file.o $(LTO_OBJ)
+ $(CXX) $(CXXFLAGS) $(LDFLAGS) $(LIBLTO) -o $@ $^
+
+machocheck: other/machochecker.o
+ $(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ $^
+
diff --git a/sys-devel/binutils-apple/files/ld64-123.2-darwin8-no-mlong-branch-warning.patch b/sys-devel/binutils-apple/files/ld64-123.2-darwin8-no-mlong-branch-warning.patch
new file mode 100644
index 00000000000..c8a303e1c9d
--- /dev/null
+++ b/sys-devel/binutils-apple/files/ld64-123.2-darwin8-no-mlong-branch-warning.patch
@@ -0,0 +1,17 @@
+On Tiger (Darwin 8) the whole system (/usr/bin/crt0.o for example) is
+long-branch compiled, so *any* linkage operation causes this warning to
+be raised. Don't do it.
+
+
+--- ld/parsers/macho_relocatable_file.cpp
++++ ld/parsers/macho_relocatable_file.cpp
+@@ -5532,9 +5532,6 @@
+ // this is from -mlong-branch codegen. We ignore the jump island and make reference to the real target
+ if ( nextReloc->r_type() != PPC_RELOC_PAIR )
+ throw "PPC_RELOC_JBSR missing following pair";
+- if ( !parser._hasLongBranchStubs )
+- warning("object file compiled with -mlong-branch which is no longer needed. "
+- "To remove this warning, recompile without -mlong-branch: %s", parser._path);
+ parser._hasLongBranchStubs = true;
+ result = true;
+ if ( reloc->r_extern() ) {
diff --git a/sys-devel/binutils-apple/files/ld64-123.2-debug-backtrace.patch b/sys-devel/binutils-apple/files/ld64-123.2-debug-backtrace.patch
new file mode 100644
index 00000000000..f1126503b42
--- /dev/null
+++ b/sys-devel/binutils-apple/files/ld64-123.2-debug-backtrace.patch
@@ -0,0 +1,15 @@
+execinfo.h isn't available <10.5, so make sure it is only included when
+actually necessary
+
+--- ld/ld.cpp
++++ ld/ld.cpp
+@@ -37,7 +37,9 @@
+ #include <errno.h>
+ #include <limits.h>
+ #include <unistd.h>
++#ifndef NDEBUG
+ #include <execinfo.h>
++#endif
+ #include <mach/mach_time.h>
+ #include <mach/vm_statistics.h>
+ #include <mach/mach_init.h>
diff --git a/sys-devel/binutils-apple/files/ld64-123.2.1-lto.patch b/sys-devel/binutils-apple/files/ld64-123.2.1-lto.patch
new file mode 100644
index 00000000000..17bac81ca29
--- /dev/null
+++ b/sys-devel/binutils-apple/files/ld64-123.2.1-lto.patch
@@ -0,0 +1,218 @@
+diff -ur ld.orig/InputFiles.cpp ld/InputFiles.cpp
+--- ld.orig/InputFiles.cpp 2010-10-05 01:57:50.000000000 +0200
++++ ld/InputFiles.cpp 2011-09-03 20:33:40.000000000 +0200
+@@ -58,7 +58,9 @@
+ #include "macho_relocatable_file.h"
+ #include "macho_dylib_file.h"
+ #include "archive_file.h"
++#ifdef LTO
+ #include "lto_file.h"
++#endif
+ #include "opaque_section_file.h"
+
+
+@@ -175,9 +177,11 @@
+ if ( result != NULL )
+ return result;
+
++#ifdef LTO
+ result = lto::archName(p, len);
+ if ( result != NULL )
+ return result;
++#endif
+
+ if ( strncmp((const char*)p, "!<arch>\n", 8) == 0 )
+ return "archive";
+@@ -264,10 +268,12 @@
+ if ( objResult != NULL )
+ return this->addObject(objResult, info, len);
+
++#if LTO
+ // see if it is an llvm object file
+ objResult = lto::parse(p, len, info.path, info.modTime, _nextInputOrdinal, _options.architecture(), _options.subArchitecture(), _options.logAllFiles());
+ if ( objResult != NULL )
+ return this->addObject(objResult, info, len);
++#endif
+
+ // see if it is a dynamic library
+ ld::dylib::File* dylibResult = mach_o::dylib::parse(p, len, info.path, info.modTime, _options, _nextInputOrdinal, info.options.fBundleLoader);
+@@ -286,6 +292,7 @@
+ if ( archiveResult != NULL )
+ return this->addArchive(archiveResult, info, len);
+
++#ifdef LTO
+ // does not seem to be any valid linker input file, check LTO misconfiguration problems
+ if ( lto::archName((uint8_t*)p, len) != NULL ) {
+ if ( lto::libLTOisLoaded() ) {
+@@ -310,6 +317,7 @@
+ throwf("could not process llvm bitcode object file, because %s could not be loaded", libLTO);
+ }
+ }
++#endif
+
+ // error handling
+ if ( ((fat_header*)p)->magic == OSSwapBigToHostInt32(FAT_MAGIC) ) {
+diff -ur ld.orig/Options.cpp ld/Options.cpp
+--- ld.orig/Options.cpp 2011-03-08 03:06:35.000000000 +0100
++++ ld/Options.cpp 2011-09-03 21:06:28.000000000 +0200
+@@ -36,10 +36,12 @@
+ #include "Architectures.hpp"
+ #include "MachOFileAbstraction.hpp"
+
++#ifdef LTO
+ // upward dependency on lto::version()
+ namespace lto {
+ extern const char* version();
+ }
++#endif
+
+ // magic to place command line in crash reports
+ const int crashreporterBufferSize = 2000;
+@@ -2786,9 +2788,11 @@
+ fprintf(stderr, "%s", ldVersionString);
+ // if only -v specified, exit cleanly
+ if ( argc == 2 ) {
++#ifdef LTO
+ const char* ltoVers = lto::version();
+ if ( ltoVers != NULL )
+ fprintf(stderr, "%s\n", ltoVers);
++#endif
+ exit(0);
+ }
+ }
+diff -ur ld.orig/Resolver.cpp ld/Resolver.cpp
+--- ld.orig/Resolver.cpp 2010-12-10 23:39:41.000000000 +0100
++++ ld/Resolver.cpp 2011-09-03 20:38:24.000000000 +0200
+@@ -58,7 +58,9 @@
+ #include "InputFiles.h"
+ #include "SymbolTable.h"
+ #include "Resolver.h"
++#ifdef LTO
+ #include "parsers/lto_file.h"
++#endif
+
+
+ namespace ld {
+@@ -1275,6 +1277,7 @@
+
+ void Resolver::linkTimeOptimize()
+ {
++#ifdef LTO
+ // only do work here if some llvm obj files where loaded
+ if ( ! _haveLLVMObjs )
+ return;
+@@ -1375,6 +1378,9 @@
+ // check new code does not override some dylib
+ this->checkDylibSymbolCollisions();
+ }
++#else
++ return;
++#endif
+ }
+
+
+diff -ur ld.orig/ld.cpp ld/ld.cpp
+--- ld.orig/ld.cpp 2011-09-03 20:24:07.000000000 +0200
++++ ld/ld.cpp 2011-09-03 20:40:06.000000000 +0200
+@@ -85,7 +85,9 @@
+ #include "parsers/archive_file.h"
+ #include "parsers/macho_relocatable_file.h"
+ #include "parsers/macho_dylib_file.h"
++#ifdef LTO
+ #include "parsers/lto_file.h"
++#endif
+ #include "parsers/opaque_section_file.h"
+
+
+diff -ur ld.orig/parsers/archive_file.cpp ld/parsers/archive_file.cpp
+--- ld.orig/parsers/archive_file.cpp 2010-09-29 02:26:13.000000000 +0200
++++ ld/parsers/archive_file.cpp 2011-09-03 21:01:55.000000000 +0200
+@@ -38,7 +38,9 @@
+ #include "Architectures.hpp"
+
+ #include "macho_relocatable_file.h"
++#ifdef LTO
+ #include "lto_file.h"
++#endif
+ #include "archive_file.h"
+
+
+@@ -87,8 +89,10 @@
+ private:
+ static bool validMachOFile(const uint8_t* fileContent, uint64_t fileLength,
+ const mach_o::relocatable::ParserOptions& opts);
++#ifdef LTO
+ static bool validLTOFile(const uint8_t* fileContent, uint64_t fileLength,
+ const mach_o::relocatable::ParserOptions& opts);
++#endif
+ static cpu_type_t architecture();
+
+
+@@ -232,12 +236,13 @@
+ return mach_o::relocatable::isObjectFile(fileContent, fileLength, opts);
+ }
+
++#ifdef LTO
+ template <typename A>
+ bool File<A>::validLTOFile(const uint8_t* fileContent, uint64_t fileLength, const mach_o::relocatable::ParserOptions& opts)
+ {
+ return lto::isObjectFile(fileContent, fileLength, opts.architecture, opts.subType);
+ }
+-
++#endif
+
+
+ template <typename A>
+@@ -256,7 +261,11 @@
+ if ( (p==start) && ((strcmp(memberName, SYMDEF_SORTED) == 0) || (strcmp(memberName, SYMDEF) == 0)) )
+ continue;
+ // archive is valid if first .o file is valid
+- return (validMachOFile(p->content(), p->contentSize(), opts) || validLTOFile(p->content(), p->contentSize(), opts));
++ return (validMachOFile(p->content(), p->contentSize(), opts)
++#ifdef LTO
++ || validLTOFile(p->content(), p->contentSize(), opts)
++#endif
++ );
+ }
+ // empty archive
+ return true;
+@@ -342,12 +351,14 @@
+ this->ordinal() + memberIndex, _objOpts);
+ if ( result != NULL )
+ return result;
++#ifdef LTO
+ // see if member is llvm bitcode file
+ result = lto::parse(member->content(), member->contentSize(),
+ mPath, member->modificationTime(), this->ordinal() + memberIndex,
+ _objOpts.architecture, _objOpts.subType, _logAllFiles);
+ if ( result != NULL )
+ return result;
++#endif
+
+ throwf("archive member '%s' with length %d is not mach-o or llvm bitcode", memberName, member->contentSize());
+ }
+--- other/ObjectDump.cpp.orig 2011-09-03 21:15:10.000000000 +0200
++++ other/ObjectDump.cpp 2011-09-03 21:14:37.000000000 +0200
+@@ -33,7 +33,9 @@
+
+ #include "MachOFileAbstraction.hpp"
+ #include "parsers/macho_relocatable_file.h"
++#ifdef LTO
+ #include "parsers/lto_file.h"
++#endif
+
+ static bool sDumpContent= true;
+ static bool sDumpStabs = false;
+@@ -1121,10 +1123,12 @@
+ if ( objResult != NULL )
+ return objResult;
+
++#ifdef LTO
+ // see if it is an llvm object file
+ objResult = lto::parse(p, fileLen, path, stat_buf.st_mtime, 0, sPreferredArch, sPreferredSubArch, false);
+ if ( objResult != NULL )
+ return objResult;
++#endif
+
+ throwf("not a mach-o object file: %s", path);
+ #else
diff --git a/sys-devel/binutils-apple/files/ld64-127.2-Makefile b/sys-devel/binutils-apple/files/ld64-127.2-Makefile
new file mode 100644
index 00000000000..74aef560a23
--- /dev/null
+++ b/sys-devel/binutils-apple/files/ld64-127.2-Makefile
@@ -0,0 +1,50 @@
+CPPFLAGS += -Iinclude -Iabstraction -Ild -Ild/parsers -Iother -I.
+
+# some files generate warnings about applying offsetof to a non-POD type.
+# Upstream seems aware of that and ignores by setting
+# GCC_WARN_ABOUT_INVALID_OFFSETOF_MACRO = NO in the xcode project.
+CXXFLAGS += -Wno-invalid-offsetof
+
+all: rebase unwinddump dyldinfo ld64 ObjectDump machocheck
+
+libprunetrie.a: other/PruneTrie.o other/prune_trie.h
+ $(AR) -s -r -c libprunetrie.a other/PruneTrie.o
+
+LD64LIBS=ld/parsers/archive_file.o ld/parsers/macho_relocatable_file.o \
+ ld/parsers/opaque_section_file.o \
+ ld/parsers/macho_dylib_file.o \
+ ld/passes/branch_island.o ld/passes/dylibs.o ld/passes/order_file.o \
+ ld/passes/branch_shim.o ld/passes/got.o ld/passes/tlvp.o \
+ ld/passes/compact_unwind.o ld/passes/huge.o \
+ ld/passes/dtrace_dof.o ld/passes/objc.o \
+ ld/passes/stubs/stubs.o \
+ ld/InputFiles.o ld/OutputFile.o ld/SymbolTable.o \
+ ld/Options.o ld/Resolver.o ld/debugline.o ld/ld.o
+
+ifeq ($(LTO),1)
+CPPFLAGS += -DLTO
+LTO_OBJ = ld/parsers/lto_file.o
+LIBLTO = -lLTO
+else
+LTO_OBJ =
+LIBLTO =
+endif
+
+ld64: libprunetrie.a version.o $(LD64LIBS) $(LTO_OBJ)
+ $(CXX) $(CXXFLAGS) $(LDFLAGS) $(LIBLTO) -o $@ $^
+
+rebase: other/rebase.o
+ $(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ $^
+
+dyldinfo: other/dyldinfo.o
+ $(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ $^
+
+unwinddump: other/unwinddump.o
+ $(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ $^
+
+ObjectDump: other/ObjectDump.o ld/debugline.o ld/parsers/macho_relocatable_file.o $(LTO_OBJ)
+ $(CXX) $(CXXFLAGS) $(LDFLAGS) $(LIBLTO) -o $@ $^
+
+machocheck: other/machochecker.o
+ $(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ $^
+
diff --git a/sys-devel/binutils-apple/files/ld64-127.2-extraneous-headers.patch b/sys-devel/binutils-apple/files/ld64-127.2-extraneous-headers.patch
new file mode 100644
index 00000000000..34d508063df
--- /dev/null
+++ b/sys-devel/binutils-apple/files/ld64-127.2-extraneous-headers.patch
@@ -0,0 +1,12 @@
+Remove unused header that doesn't exist on older OS Xes.
+
+--- ld64-127.2/src/ld/parsers/libunwind/AddressSpace.hpp.orig 2015-01-27 23:24:49.000000000 +0100
++++ ld64-127.2/src/ld/parsers/libunwind/AddressSpace.hpp 2015-01-27 23:26:21.000000000 +0100
+@@ -37,7 +37,6 @@
+ #include <mach-o/getsect.h>
+ #include <mach-o/dyld_priv.h>
+ #include <mach/i386/thread_status.h>
+-#include <Availability.h>
+
+ #include "FileAbstraction.hpp"
+ #include "libunwind.h"
diff --git a/sys-devel/binutils-apple/files/ld64-127.2-lto.patch b/sys-devel/binutils-apple/files/ld64-127.2-lto.patch
new file mode 100644
index 00000000000..b9a3f14042c
--- /dev/null
+++ b/sys-devel/binutils-apple/files/ld64-127.2-lto.patch
@@ -0,0 +1,214 @@
+--- src/ld/InputFiles.cpp
++++ src/ld/InputFiles.cpp
+@@ -58,7 +58,9 @@
+ #include "macho_relocatable_file.h"
+ #include "macho_dylib_file.h"
+ #include "archive_file.h"
++#ifdef LTO
+ #include "lto_file.h"
++#endif
+ #include "opaque_section_file.h"
+
+
+@@ -175,9 +177,11 @@
+ if ( result != NULL )
+ return result;
+
++#ifdef LTO
+ result = lto::archName(p, len);
+ if ( result != NULL )
+ return result;
++#endif
+
+ if ( strncmp((const char*)p, "!<arch>\n", 8) == 0 )
+ return "archive";
+@@ -264,10 +268,12 @@
+ if ( objResult != NULL )
+ return this->addObject(objResult, info, len);
+
++#if LTO
+ // see if it is an llvm object file
+ objResult = lto::parse(p, len, info.path, info.modTime, _nextInputOrdinal, _options.architecture(), _options.subArchitecture(), _options.logAllFiles());
+ if ( objResult != NULL )
+ return this->addObject(objResult, info, len);
++#endif
+
+ // see if it is a dynamic library
+ ld::dylib::File* dylibResult = mach_o::dylib::parse(p, len, info.path, info.modTime, _options, _nextInputOrdinal, info.options.fBundleLoader, indirectDylib);
+@@ -291,6 +297,7 @@
+ return this->addArchive(archiveResult, info, len);
+ }
+
++#ifdef LTO
+ // does not seem to be any valid linker input file, check LTO misconfiguration problems
+ if ( lto::archName((uint8_t*)p, len) != NULL ) {
+ if ( lto::libLTOisLoaded() ) {
+@@ -315,6 +322,7 @@
+ throwf("could not process llvm bitcode object file, because %s could not be loaded", libLTO);
+ }
+ }
++#endif
+
+ // error handling
+ if ( ((fat_header*)p)->magic == OSSwapBigToHostInt32(FAT_MAGIC) ) {
+--- src/ld/Options.cpp
++++ src/ld/Options.cpp
+@@ -36,10 +36,12 @@
+ #include "Architectures.hpp"
+ #include "MachOFileAbstraction.hpp"
+
++#ifdef LTO
+ // upward dependency on lto::version()
+ namespace lto {
+ extern const char* version();
+ }
++#endif
+
+ // magic to place command line in crash reports
+ const int crashreporterBufferSize = 2000;
+@@ -2766,9 +2768,11 @@
+ fprintf(stderr, "%s", ldVersionString);
+ // if only -v specified, exit cleanly
+ if ( argc == 2 ) {
++#ifdef LTO
+ const char* ltoVers = lto::version();
+ if ( ltoVers != NULL )
+ fprintf(stderr, "%s\n", ltoVers);
++#endif
+ exit(0);
+ }
+ }
+--- src/ld/Resolver.cpp
++++ src/ld/Resolver.cpp
+@@ -58,7 +58,9 @@
+ #include "InputFiles.h"
+ #include "SymbolTable.h"
+ #include "Resolver.h"
++#ifdef LTO
+ #include "parsers/lto_file.h"
++#endif
+
+
+ namespace ld {
+@@ -1315,6 +1317,7 @@
+
+ void Resolver::linkTimeOptimize()
+ {
++#ifdef LTO
+ // only do work here if some llvm obj files where loaded
+ if ( ! _haveLLVMObjs )
+ return;
+@@ -1415,6 +1418,9 @@
+ // check new code does not override some dylib
+ this->checkDylibSymbolCollisions();
+ }
++#else
++ return;
++#endif
+ }
+
+
+--- src/ld/ld.cpp
++++ src/ld/ld.cpp
+@@ -83,7 +83,9 @@
+ #include "parsers/archive_file.h"
+ #include "parsers/macho_relocatable_file.h"
+ #include "parsers/macho_dylib_file.h"
++#ifdef LTO
+ #include "parsers/lto_file.h"
++#endif
+ #include "parsers/opaque_section_file.h"
+
+
+--- src/ld/parsers/archive_file.cpp
++++ src/ld/parsers/archive_file.cpp
+@@ -39,7 +39,9 @@
+ #include "Architectures.hpp"
+
+ #include "macho_relocatable_file.h"
++#ifdef LTO
+ #include "lto_file.h"
++#endif
+ #include "archive_file.h"
+
+
+@@ -91,8 +93,10 @@
+ private:
+ static bool validMachOFile(const uint8_t* fileContent, uint64_t fileLength,
+ const mach_o::relocatable::ParserOptions& opts);
++#ifdef LTO
+ static bool validLTOFile(const uint8_t* fileContent, uint64_t fileLength,
+ const mach_o::relocatable::ParserOptions& opts);
++#endif
+ static cpu_type_t architecture();
+
+ class Entry : ar_hdr
+@@ -239,12 +243,13 @@
+ return mach_o::relocatable::isObjectFile(fileContent, fileLength, opts);
+ }
+
++#ifdef LTO
+ template <typename A>
+ bool File<A>::validLTOFile(const uint8_t* fileContent, uint64_t fileLength, const mach_o::relocatable::ParserOptions& opts)
+ {
+ return lto::isObjectFile(fileContent, fileLength, opts.architecture, opts.subType);
+ }
+-
++#endif
+
+
+ template <typename A>
+@@ -263,7 +268,11 @@
+ if ( (p==start) && ((strcmp(memberName, SYMDEF_SORTED) == 0) || (strcmp(memberName, SYMDEF) == 0)) )
+ continue;
+ // archive is valid if first .o file is valid
+- return (validMachOFile(p->content(), p->contentSize(), opts) || validLTOFile(p->content(), p->contentSize(), opts));
++ return (validMachOFile(p->content(), p->contentSize(), opts)
++#ifdef LTO
++ || validLTOFile(p->content(), p->contentSize(), opts)
++#endif
++ );
+ }
+ // empty archive
+ return true;
+@@ -363,6 +372,7 @@
+ _instantiatedEntries[member] = state;
+ return _instantiatedEntries[member];
+ }
++#ifdef LTO
+ // see if member is llvm bitcode file
+ result = lto::parse(member->content(), member->contentSize(),
+ mPath, member->modificationTime(), this->ordinal() + memberIndex,
+@@ -372,6 +382,7 @@
+ _instantiatedEntries[member] = state;
+ return _instantiatedEntries[member];
+ }
++#endif
+
+ throwf("archive member '%s' with length %d is not mach-o or llvm bitcode", memberName, member->contentSize());
+ }
+--- src/other/ObjectDump.cpp
++++ src/other/ObjectDump.cpp
+@@ -33,7 +33,9 @@
+
+ #include "MachOFileAbstraction.hpp"
+ #include "parsers/macho_relocatable_file.h"
++#ifdef LTO
+ #include "parsers/lto_file.h"
++#endif
+
+ static bool sDumpContent= true;
+ static bool sDumpStabs = false;
+@@ -1150,10 +1152,12 @@
+ if ( objResult != NULL )
+ return objResult;
+
++#ifdef LTO
+ // see if it is an llvm object file
+ objResult = lto::parse(p, fileLen, path, stat_buf.st_mtime, 0, sPreferredArch, sPreferredSubArch, false);
+ if ( objResult != NULL )
+ return objResult;
++#endif
+
+ throwf("not a mach-o object file: %s", path);
+ #else
diff --git a/sys-devel/binutils-apple/files/ld64-127.2-ppc-range-warning.patch b/sys-devel/binutils-apple/files/ld64-127.2-ppc-range-warning.patch
new file mode 100644
index 00000000000..c9f85082393
--- /dev/null
+++ b/sys-devel/binutils-apple/files/ld64-127.2-ppc-range-warning.patch
@@ -0,0 +1,16 @@
+Insipred by the comment here:
+http://bugs.freepascal.org/view.php?id=20879
+It looks like the PPC case is missing, hence add this. Without, we get
+linker errors for compiling packages like Python and TexLive.
+
+--- src/ld/OutputFile.cpp
++++ src/ld/OutputFile.cpp
+@@ -807,7 +807,7 @@
+ // is encoded in mach-o the same as:
+ // .long _foo + 0x40000000
+ // so if _foo lays out to 0xC0000100, the first is ok, but the second is not.
+- if ( (_options.architecture() == CPU_TYPE_ARM) || (_options.architecture() == CPU_TYPE_I386) ) {
++ if ( (_options.architecture() == CPU_TYPE_ARM) || (_options.architecture() == CPU_TYPE_I386) || (_options.architecture() == CPU_TYPE_POWERPC) ) {
+ // Unlikely userland code does funky stuff like this, so warn for them, but not warn for -preload
+ if ( _options.outputKind() != Options::kPreload ) {
+ warning("32-bit absolute address out of range (0x%08llX max is 4GB): from %s + 0x%08X (0x%08llX) to 0x%08llX",
diff --git a/sys-devel/binutils-apple/files/ld64-127.2-thread_state.patch b/sys-devel/binutils-apple/files/ld64-127.2-thread_state.patch
new file mode 100644
index 00000000000..e894bee0c8d
--- /dev/null
+++ b/sys-devel/binutils-apple/files/ld64-127.2-thread_state.patch
@@ -0,0 +1,13 @@
+Include thread_status.h so that __darwin_i386_thread_state_t is known and will
+not generate warnings that it's declared inside parameter list.
+
+--- ld64-127.2/src/ld/HeaderAndLoadCommands.hpp.orig 2015-01-28 00:32:55.000000000 +0100
++++ ld64-127.2/src/ld/HeaderAndLoadCommands.hpp 2015-01-28 00:27:51.000000000 +0100
+@@ -29,6 +29,7 @@
+ #include <limits.h>
+ #include <unistd.h>
+ #include <mach-o/loader.h>
++#include <mach/i386/thread_status.h>
+
+ #include <vector>
+
diff --git a/sys-devel/binutils-apple/files/ld64-128.2-1010.patch b/sys-devel/binutils-apple/files/ld64-128.2-1010.patch
new file mode 100644
index 00000000000..dee69e7c858
--- /dev/null
+++ b/sys-devel/binutils-apple/files/ld64-128.2-1010.patch
@@ -0,0 +1,20 @@
+Backport (just a diff really) of OS X 10.10 handling from 241.9.
+
+--- ld64-128.2/src/ld/Options.cpp 2015-01-30 17:16:48.000000000 +0100
++++ ld64-241.9/src/ld/Options.cpp 2015-01-30 17:11:57.000000000 +0100
+@@ -1241,7 +1348,14 @@
+ throw "-macosx_version_min argument missing";
+
+ if ( (strncmp(version, "10.", 3) == 0) && isdigit(version[3]) ) {
+- unsigned int minorVersion = version[3] - '0';
++ unsigned int minorVersion = 0;
++ for (int i=3; isdigit(version[i]); ++i) {
++ minorVersion = minorVersion*10 + (version[i] - '0');
++ }
++ if ( minorVersion > 255 ) {
++ warning("Mac OS X minor version > 255 in '%s'", version);
++ minorVersion = 255;
++ }
+ fMacVersionMin = (ld::MacVersionMin)(0x000A0000 | (minorVersion << 8));
+ }
+ else {
diff --git a/sys-devel/binutils-apple/files/ld64-128.2-Makefile b/sys-devel/binutils-apple/files/ld64-128.2-Makefile
new file mode 100644
index 00000000000..b02c8245944
--- /dev/null
+++ b/sys-devel/binutils-apple/files/ld64-128.2-Makefile
@@ -0,0 +1,47 @@
+CPPFLAGS += "-DCPU_SUBTYPE_X86_ALL=((cpu_subtype_t)3)" -Iinclude -Iabstraction -Ild -Ild/parsers -Iother -I.
+
+# dropped machocheck due to compilation failures
+all: rebase unwinddump dyldinfo ld64 ObjectDump
+
+libprunetrie.a: other/PruneTrie.o other/prune_trie.h
+ $(AR) -s -r -c libprunetrie.a other/PruneTrie.o
+
+LD64LIBS=ld/parsers/archive_file.o ld/parsers/macho_relocatable_file.o \
+ ld/parsers/opaque_section_file.o \
+ ld/parsers/macho_dylib_file.o \
+ ld/passes/branch_island.o ld/passes/dylibs.o ld/passes/order.o \
+ ld/passes/branch_shim.o ld/passes/got.o ld/passes/tlvp.o \
+ ld/passes/compact_unwind.o ld/passes/huge.o \
+ ld/passes/dtrace_dof.o ld/passes/objc.o \
+ ld/passes/stubs/stubs.o \
+ ld/InputFiles.o ld/OutputFile.o ld/SymbolTable.o \
+ ld/Options.o ld/Resolver.o ld/debugline.o ld/ld.o
+
+ifeq ($(LTO),1)
+CPPFLAGS += "-DLTO"
+LTO_OBJ = ld/parsers/lto_file.o
+LIBLTO = -lLTO
+else
+CPPFLAGS += "-ULTO"
+LTO_OBJ =
+LIBLTO =
+endif
+
+ld64: libprunetrie.a version.o $(LD64LIBS) $(LTO_OBJ)
+ $(CXX) $(CXXFLAGS) $(LDFLAGS) $(LIBLTO) -o $@ $^
+
+rebase: other/rebase.o
+ $(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ $^
+
+dyldinfo: other/dyldinfo.o
+ $(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ $^
+
+unwinddump: other/unwinddump.o
+ $(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ $^
+
+ObjectDump: other/ObjectDump.o ld/debugline.o ld/parsers/macho_relocatable_file.o $(LTO_OBJ)
+ $(CXX) $(CXXFLAGS) $(LDFLAGS) $(LIBLTO) -o $@ $^
+
+machocheck: other/machochecker.o
+ $(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ $^
+
diff --git a/sys-devel/binutils-apple/files/ld64-128.2-Makefile-2 b/sys-devel/binutils-apple/files/ld64-128.2-Makefile-2
new file mode 100644
index 00000000000..1d48ae9eaaf
--- /dev/null
+++ b/sys-devel/binutils-apple/files/ld64-128.2-Makefile-2
@@ -0,0 +1,50 @@
+CPPFLAGS += -Iinclude -Iabstraction -Ild -Ild/parsers -Iother -I.
+
+# some files generate warnings about applying offsetof to a non-POD type.
+# Upstream seems aware of that and ignores by setting
+# GCC_WARN_ABOUT_INVALID_OFFSETOF_MACRO = NO in the xcode project.
+CXXFLAGS += -Wno-invalid-offsetof
+
+all: rebase unwinddump dyldinfo ld64 ObjectDump machocheck
+
+libprunetrie.a: other/PruneTrie.o other/prune_trie.h
+ $(AR) -s -r -c libprunetrie.a other/PruneTrie.o
+
+LD64LIBS=ld/parsers/archive_file.o ld/parsers/macho_relocatable_file.o \
+ ld/parsers/opaque_section_file.o \
+ ld/parsers/macho_dylib_file.o \
+ ld/passes/branch_island.o ld/passes/dylibs.o ld/passes/order.o \
+ ld/passes/branch_shim.o ld/passes/got.o ld/passes/tlvp.o \
+ ld/passes/compact_unwind.o ld/passes/huge.o \
+ ld/passes/dtrace_dof.o ld/passes/objc.o \
+ ld/passes/stubs/stubs.o \
+ ld/InputFiles.o ld/OutputFile.o ld/SymbolTable.o \
+ ld/Options.o ld/Resolver.o ld/debugline.o ld/ld.o
+
+ifeq ($(LTO),1)
+CPPFLAGS += -DLTO
+LTO_OBJ = ld/parsers/lto_file.o
+LIBLTO = -lLTO
+else
+LTO_OBJ =
+LIBLTO =
+endif
+
+ld64: libprunetrie.a version.o $(LD64LIBS) $(LTO_OBJ)
+ $(CXX) $(CXXFLAGS) $(LDFLAGS) $(LIBLTO) -o $@ $^
+
+rebase: other/rebase.o
+ $(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ $^
+
+dyldinfo: other/dyldinfo.o
+ $(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ $^
+
+unwinddump: other/unwinddump.o
+ $(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ $^
+
+ObjectDump: other/ObjectDump.o ld/debugline.o ld/parsers/macho_relocatable_file.o $(LTO_OBJ)
+ $(CXX) $(CXXFLAGS) $(LDFLAGS) $(LIBLTO) -o $@ $^
+
+machocheck: other/machochecker.o
+ $(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ $^
+
diff --git a/sys-devel/binutils-apple/files/ld64-128.2-stdlib.patch b/sys-devel/binutils-apple/files/ld64-128.2-stdlib.patch
new file mode 100644
index 00000000000..8bbcb46cf9c
--- /dev/null
+++ b/sys-devel/binutils-apple/files/ld64-128.2-stdlib.patch
@@ -0,0 +1,14 @@
+Patch by Linlin Yan <yanlinlin82@gmail.com>
+
+https://bugs.gentoo.org/show_bug.cgi?id=490932
+
+--- ld64-128.2/src/other/rebase.cpp
++++ ld64-128.2/src/other/rebase.cpp
+@@ -29,6 +29,7 @@
+ #include <limits.h>
+ #include <stdarg.h>
+ #include <stdio.h>
++#include <stdlib.h>
+ #include <fcntl.h>
+ #include <errno.h>
+ #include <unistd.h>
diff --git a/sys-devel/binutils-apple/files/ld64-136-Makefile b/sys-devel/binutils-apple/files/ld64-136-Makefile
new file mode 100644
index 00000000000..948c705503a
--- /dev/null
+++ b/sys-devel/binutils-apple/files/ld64-136-Makefile
@@ -0,0 +1,48 @@
+CPPFLAGS += "-DCPU_SUBTYPE_X86_ALL=((cpu_subtype_t)3)" -Iinclude -Iabstraction -Ild -Ild/parsers -Iother -I.
+
+# dropped machocheck due to compilation failures
+all: rebase unwinddump dyldinfo ld64 ObjectDump
+
+libprunetrie.a: other/PruneTrie.o other/prune_trie.h
+ $(AR) -s -r -c libprunetrie.a other/PruneTrie.o
+
+LD64LIBS=ld/parsers/archive_file.o ld/parsers/macho_relocatable_file.o \
+ ld/parsers/opaque_section_file.o \
+ ld/parsers/macho_dylib_file.o \
+ ld/passes/branch_island.o ld/passes/dylibs.o ld/passes/order.o \
+ ld/passes/branch_shim.o ld/passes/got.o ld/passes/tlvp.o \
+ ld/passes/compact_unwind.o ld/passes/huge.o \
+ ld/passes/dtrace_dof.o ld/passes/objc.o \
+ ld/passes/stubs/stubs.o \
+ ld/InputFiles.o ld/OutputFile.o ld/SymbolTable.o \
+ ld/Snapshot.o \
+ ld/Options.o ld/Resolver.o ld/debugline.o ld/ld.o
+
+ifeq ($(LTO),1)
+CPPFLAGS += "-DLTO"
+LTO_OBJ = ld/parsers/lto_file.o
+LIBLTO = -lLTO
+else
+CPPFLAGS += "-ULTO"
+LTO_OBJ =
+LIBLTO =
+endif
+
+ld64: libprunetrie.a version.o $(LD64LIBS) $(LTO_OBJ)
+ $(CXX) $(CXXFLAGS) $(LDFLAGS) $(LIBLTO) -o $@ $^
+
+rebase: other/rebase.o
+ $(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ $^
+
+dyldinfo: other/dyldinfo.o
+ $(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ $^
+
+unwinddump: other/unwinddump.o
+ $(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ $^
+
+ObjectDump: other/ObjectDump.o ld/debugline.o ld/parsers/macho_relocatable_file.o $(LTO_OBJ)
+ $(CXX) $(CXXFLAGS) $(LDFLAGS) $(LIBLTO) -o $@ $^
+
+machocheck: other/machochecker.o
+ $(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ $^
+
diff --git a/sys-devel/binutils-apple/files/ld64-136-compile_stubs.h b/sys-devel/binutils-apple/files/ld64-136-compile_stubs.h
new file mode 100644
index 00000000000..8cd430adb9e
--- /dev/null
+++ b/sys-devel/binutils-apple/files/ld64-136-compile_stubs.h
@@ -0,0 +1,53 @@
+static const char *compile_stubs =
+"#!/bin/csh\n"
+"\n"
+"# Attempt to find the architecture.\n"
+"# First look through the command line args.\n"
+"set arch=unknown\n"
+"set link_cmd=(`cat link_command`)\n"
+"while ( $#link_cmd > 0 )\n"
+" if ( \"$link_cmd[1]\" == \"-arch\" ) then\n"
+" set arch=$link_cmd[2]\n"
+" endif\n"
+" shift link_cmd\n"
+"end\n"
+"\n"
+"# look for an explicit arch file\n"
+"if ( \"$arch\" == \"unknown\" ) then\n"
+" if ( -e arch ) then\n"
+" set arch=`cat arch`\n"
+" endif\n"
+"endif\n"
+"\n"
+"if ( \"$arch\" == \"unknown\" ) then\n"
+"echo \"***** Unable to determine architecture.\"\n"
+"exit 1\n"
+"endif \n"
+"\n"
+"# Create .dylibs for each file in the dylib_stubs directory.\n"
+"if ( -e dylib_stubs ) then\n"
+" set files=`cd dylib_stubs ; echo *`\n"
+" mkdir -p dylibs\n"
+" foreach file ($files)\n"
+" if ( ! -e dylibs/$file ) then\n"
+" clang -arch $arch -c -fno-builtin -o tmp_object.o -x c dylib_stubs/$file\n"
+" ld -arch $arch -dylib -macosx_version_min 10.1 -no_version_load_command -o dylibs/$file tmp_object.o\n"
+" endif\n"
+" end\n"
+"endif\n"
+"\n"
+"# Create .frameworks for each file in the framework_stubs directory.\n"
+"if ( -e framework_stubs ) then\n"
+" set files=`cd framework_stubs ; echo *`\n"
+" foreach file ($files)\n"
+" if ( ! -e frameworks/$file.framework ) then\n"
+" clang -arch $arch -c -fno-builtin -o tmp_object.o -x c framework_stubs/$file\n"
+" mkdir -p frameworks/$file.framework\n"
+" ld -arch $arch -dylib -macosx_version_min 10.1 -no_version_load_command -o frameworks/$file.framework/$file tmp_object.o\n"
+" endif\n"
+" end\n"
+"endif\n"
+"\n"
+"# Clean up.\n"
+"rm -f tmp_object.o\n"
+;
diff --git a/sys-devel/binutils-apple/files/ld64-236.3-Makefile b/sys-devel/binutils-apple/files/ld64-236.3-Makefile
new file mode 100644
index 00000000000..1f35c8ff9f3
--- /dev/null
+++ b/sys-devel/binutils-apple/files/ld64-236.3-Makefile
@@ -0,0 +1,51 @@
+CPPFLAGS += -Iinclude -Iabstraction -Ild -Ild/parsers -Iother -I.
+
+# some files generate warnings about applying offsetof to a non-POD type.
+# Upstream seems aware of that and ignores by setting
+# GCC_WARN_ABOUT_INVALID_OFFSETOF_MACRO = NO in the xcode project.
+CXXFLAGS += -Wno-invalid-offsetof
+
+all: rebase unwinddump dyldinfo ld64 ObjectDump machocheck
+
+libprunetrie.a: other/PruneTrie.o other/prune_trie.h
+ $(AR) -s -r -c libprunetrie.a other/PruneTrie.o
+
+LD64LIBS=ld/parsers/archive_file.o ld/parsers/macho_relocatable_file.o \
+ ld/parsers/opaque_section_file.o \
+ ld/parsers/macho_dylib_file.o \
+ ld/passes/branch_island.o ld/passes/dylibs.o ld/passes/order.o \
+ ld/passes/branch_shim.o ld/passes/got.o ld/passes/tlvp.o \
+ ld/passes/compact_unwind.o ld/passes/huge.o \
+ ld/passes/dtrace_dof.o ld/passes/objc.o \
+ ld/passes/stubs/stubs.o \
+ ld/InputFiles.o ld/OutputFile.o ld/SymbolTable.o \
+ ld/Snapshot.o \
+ ld/Options.o ld/Resolver.o ld/debugline.o ld/ld.o
+
+ifeq ($(LTO),1)
+CPPFLAGS += -DLTO
+LTO_OBJ = ld/parsers/lto_file.o
+LIBLTO = -lLTO
+else
+LTO_OBJ =
+LIBLTO =
+endif
+
+ld64: libprunetrie.a version.o $(LD64LIBS) $(LTO_OBJ)
+ $(CXX) $(CXXFLAGS) $(LDFLAGS) $(LIBLTO) -o $@ $^
+
+rebase: other/rebase.o
+ $(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ $^
+
+dyldinfo: other/dyldinfo.o
+ $(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ $^
+
+unwinddump: other/unwinddump.o
+ $(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ $^
+
+ObjectDump: other/ObjectDump.o ld/debugline.o ld/parsers/macho_relocatable_file.o $(LTO_OBJ)
+ $(CXX) $(CXXFLAGS) $(LDFLAGS) $(LIBLTO) -o $@ $^
+
+machocheck: other/machochecker.o
+ $(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ $^
+
diff --git a/sys-devel/binutils-apple/files/ld64-236.3-arm64-fixup.patch b/sys-devel/binutils-apple/files/ld64-236.3-arm64-fixup.patch
new file mode 100644
index 00000000000..b64e52906f4
--- /dev/null
+++ b/sys-devel/binutils-apple/files/ld64-236.3-arm64-fixup.patch
@@ -0,0 +1,17 @@
+Use correct enum values (backport from 241.9).
+
+--- ld64-236.3/src/other/ObjectDump.cpp.orig 2014-11-12 21:17:01.000000000 +0100
++++ ld64-236.3/src/other/ObjectDump.cpp 2014-11-12 21:17:44.000000000 +0100
+@@ -995,10 +995,10 @@
+ case ld::Fixup::kindStoreTargetAddressARM64PageOff12:
+ printf("ARM64 store 12-bit page offset of %s", referenceTargetAtomName(ref));
+ break;
+- case ld::Fixup::kindStoreTargetAddressARM64TLVPage21:
++ case ld::Fixup::kindStoreTargetAddressARM64TLVPLoadPage21:
+ printf("ARM64 store 21-bit pcrel ADRP to TLV for %s", referenceTargetAtomName(ref));
+ break;
+- case ld::Fixup::kindStoreTargetAddressARM64TLVPageOff12:
++ case ld::Fixup::kindStoreTargetAddressARM64TLVPLoadPageOff12:
+ printf("ARM64 store 12-bit page offset of TLV of %s", referenceTargetAtomName(ref));
+ break;
+ case ld::Fixup::kindStoreTargetAddressARM64GOTLoadPage21:
diff --git a/sys-devel/binutils-apple/files/ld64-236.3-constant-types.patch b/sys-devel/binutils-apple/files/ld64-236.3-constant-types.patch
new file mode 100644
index 00000000000..c4c5e0d113c
--- /dev/null
+++ b/sys-devel/binutils-apple/files/ld64-236.3-constant-types.patch
@@ -0,0 +1,61 @@
+Avoid error with gcc on 32bit platforms:
+ld/LinkEdit.hpp:1329: error: integer constant is too large for 'long' type
+
+--- ./ld64-236.3/src/ld/LinkEdit.hpp.orig 2015-01-14 18:00:49.000000000 +0100
++++ ./ld64-236.3/src/ld/LinkEdit.hpp 2015-01-14 18:02:23.000000000 +0100
+@@ -1326,7 +1326,7 @@
+ void FunctionStartsAtom<A>::encode() const
+ {
+ this->_encodedData.reserve(8192);
+- const uint64_t badAddress = 0xFFFFFFFFFFFFFFFF;
++ const uint64_t badAddress = 0xFFFFFFFFFFFFFFFFULL;
+ uint64_t addr = badAddress;
+ // delta compress all function addresses
+ for (std::vector<ld::Internal::FinalSection*>::iterator it = this->_state.sections.begin(); it != this->_state.sections.end(); ++it) {
+--- ./ld64-236.3/src/ld/Options.cpp.orig 2015-01-14 18:01:12.000000000 +0100
++++ ./ld64-236.3/src/ld/Options.cpp 2015-01-14 18:02:09.000000000 +0100
+@@ -4173,7 +4173,7 @@
+ switch (fArchitecture) {
+ case CPU_TYPE_I386:
+ case CPU_TYPE_ARM:
+- if ( fStackAddr > 0xFFFFFFFF )
++ if ( fStackAddr > 0xFFFFFFFFULL )
+ throw "-stack_addr must be < 4G for 32-bit processes";
+ break;
+ case CPU_TYPE_X86_64:
+@@ -4193,29 +4193,29 @@
+ if ( fStackSize > 0xFFFFFFFF )
+ throw "-stack_size must be < 4G for 32-bit processes";
+ if ( fStackAddr == 0 ) {
+- fStackAddr = 0xC0000000;
++ fStackAddr = 0xC0000000ULL;
+ }
+- if ( (fStackAddr > 0xB0000000) && ((fStackAddr-fStackSize) < 0xB0000000) )
++ if ( (fStackAddr > 0xB0000000ULL) && ((fStackAddr-fStackSize) < 0xB0000000ULL) )
+ warning("custom stack placement overlaps and will disable shared region");
+ break;
+ case CPU_TYPE_ARM:
+ if ( fStackSize > 0x2F000000 )
+ throw "-stack_size must be < 752MB";
+ if ( fStackAddr == 0 )
+- fStackAddr = 0x2F000000;
+- if ( fStackAddr > 0x30000000)
++ fStackAddr = 0x2F000000ULL;
++ if ( fStackAddr > 0x30000000ULL)
+ throw "-stack_addr must be < 0x30000000 for arm";
+ break;
+ case CPU_TYPE_X86_64:
+ if ( fStackAddr == 0 ) {
+- fStackAddr = 0x00007FFF5C000000LL;
++ fStackAddr = 0x00007FFF5C000000ULL;
+ }
+ break;
+ case CPU_TYPE_ARM64:
+ if ( fStackSize > 0x20000000 )
+ throw "-stack_size must be < 512MB";
+ if ( fStackAddr == 0 ) {
+- fStackAddr = 0x120000000;
++ fStackAddr = 0x120000000ULL;
+ }
+ break;
+ }
diff --git a/sys-devel/binutils-apple/files/ld64-236.3-crashreporter.patch b/sys-devel/binutils-apple/files/ld64-236.3-crashreporter.patch
new file mode 100644
index 00000000000..f8b42b459b6
--- /dev/null
+++ b/sys-devel/binutils-apple/files/ld64-236.3-crashreporter.patch
@@ -0,0 +1,23 @@
+Allow to disable crash reporter
+
+diff -ur ld64-236.3/src/ld/Options.cpp ld64-236.3/src/ld/Options.cpp
+--- ld64-236.3/src/ld/Options.cpp 2014-08-29 16:40:18.000000000 +0200
++++ ld64-236.3/src/ld/Options.cpp 2014-08-29 16:35:36.000000000 +0200
+@@ -54,7 +54,7 @@
+ // magic to place command line in crash reports
+ const int crashreporterBufferSize = 2000;
+ static char crashreporterBuffer[crashreporterBufferSize];
+-#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
++#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1070 && defined(SUPPORT_CRASHREPORTER)
+ #include <CrashReporterClient.h>
+ // hack until ld does not need to build on 10.6 anymore
+ struct crashreporter_annotations_t gCRAnnotations
+@@ -4564,7 +4564,7 @@
+ bool newLinker = false;
+
+ // build command line buffer in case ld crashes
+-#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
++#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1070 && defined(SUPPORT_CRASHREPORTER)
+ CRSetCrashLogMessage(crashreporterBuffer);
+ #endif
+ const char* srcRoot = getenv("SRCROOT");
diff --git a/sys-devel/binutils-apple/files/ld64-236.3-gcc.patch b/sys-devel/binutils-apple/files/ld64-236.3-gcc.patch
new file mode 100644
index 00000000000..1e1f578ca35
--- /dev/null
+++ b/sys-devel/binutils-apple/files/ld64-236.3-gcc.patch
@@ -0,0 +1,1038 @@
+Provide c++11 headers from tr1 include directory and namespace.
+
+Work around weird namespacing bug in gcc-4.2.1 where class ld::Section
+conflicts with template mach_o::relocatable::Section by renaming the latter to
+MRFSection (could possibly be done using sed from ebuild or avoided by figuring
+out, what's actually going on with those namespaces).
+
+diff -ur ld64-236.3.orig/src/ld/InputFiles.h ld64-236.3/src/ld/InputFiles.h
+--- ld64-236.3.orig/src/ld/InputFiles.h 2014-04-05 00:42:29.000000000 +0200
++++ ld64-236.3/src/ld/InputFiles.h 2015-01-11 22:43:08.000000000 +0100
+@@ -46,6 +46,14 @@
+ #include <pthread.h>
+ #endif
+
++#ifdef __GLIBCXX__
++#include <tr1/unordered_map>
++#define UNORDERED_MAP tr1::unordered_map
++#else
++#include <unordered_map>
++#define UNORDERED_MAP unordered_map
++#endif
++
+ #include <vector>
+
+ #include "Options.h"
+@@ -107,7 +115,7 @@
+ static void parseWorkerThread(InputFiles *inputFiles);
+ void startThread(void (*threadFunc)(InputFiles *)) const;
+
+- typedef std::unordered_map<const char*, ld::dylib::File*, CStringHash, CStringEquals> InstallNameToDylib;
++ typedef std::UNORDERED_MAP<const char*, ld::dylib::File*, CStringHash, CStringEquals> InstallNameToDylib;
+
+ const Options& _options;
+ std::vector<ld::File*> _inputFiles;
+diff -ur ld64-236.3.orig/src/ld/LinkEditClassic.hpp ld64-236.3/src/ld/LinkEditClassic.hpp
+--- ld64-236.3.orig/src/ld/LinkEditClassic.hpp 2014-04-05 00:42:29.000000000 +0200
++++ ld64-236.3/src/ld/LinkEditClassic.hpp 2015-01-11 22:44:04.000000000 +0100
+@@ -31,8 +31,13 @@
+ #include <limits.h>
+ #include <unistd.h>
+
+-#include <vector>
++#ifdef __GLIBCXX__
++#include <tr1/unordered_map>
++#define UNORDERED_MAP tr1::unordered_map
++#else
+ #include <unordered_map>
++#define UNORDERED_MAP unordered_map
++#endif
+
+ #include "Options.h"
+ #include "ld.hpp"
+@@ -92,7 +97,7 @@
+
+ private:
+ enum { kBufferSize = 0x01000000 };
+- typedef std::unordered_map<const char*, int32_t, CStringHash, CStringEquals> StringToOffset;
++ typedef std::UNORDERED_MAP<const char*, int32_t, CStringHash, CStringEquals> StringToOffset;
+
+ const uint32_t _pointerSize;
+ std::vector<char*> _fullBuffers;
+diff -ur ld64-236.3.orig/src/ld/Options.cpp ld64-236.3/src/ld/Options.cpp
+--- ld64-236.3.orig/src/ld/Options.cpp 2015-01-11 17:35:08.000000000 +0100
++++ ld64-236.3/src/ld/Options.cpp 2015-01-11 22:47:34.000000000 +0100
+@@ -4335,7 +4335,7 @@
+
+ // make sure all required exported symbols exist
+ std::vector<const char*> impliedExports;
+- for (NameSet::iterator it=fExportSymbols.regularBegin(); it != fExportSymbols.regularEnd(); ++it) {
++ for (NameSet::const_iterator it=fExportSymbols.regularBegin(); it != fExportSymbols.regularEnd(); ++it) {
+ const char* name = *it;
+ const int len = strlen(name);
+ if ( (strcmp(&name[len-3], ".eh") == 0) || (strncmp(name, ".objc_category_name_", 20) == 0) ) {
+@@ -4367,7 +4367,7 @@
+ }
+
+ // make sure all required re-exported symbols exist
+- for (NameSet::iterator it=fReExportSymbols.regularBegin(); it != fReExportSymbols.regularEnd(); ++it) {
++ for (NameSet::const_iterator it=fReExportSymbols.regularBegin(); it != fReExportSymbols.regularEnd(); ++it) {
+ fInitialUndefines.push_back(*it);
+ }
+
+diff -ur ld64-236.3.orig/src/ld/Options.h ld64-236.3/src/ld/Options.h
+--- ld64-236.3.orig/src/ld/Options.h 2014-04-05 00:42:29.000000000 +0200
++++ ld64-236.3/src/ld/Options.h 2015-01-11 22:44:00.000000000 +0100
+@@ -30,8 +30,17 @@
+ #include <mach/machine.h>
+
+ #include <vector>
++#ifdef __GLIBCXX__
++#include <tr1/unordered_set>
++#include <tr1/unordered_map>
++#define UNORDERED_MAP tr1::unordered_map
++#define UNORDERED_SET tr1::unordered_set
++#else
+ #include <unordered_set>
+ #include <unordered_map>
++#define UNORDERED_MAP unordered_map
++#define UNORDERED_SET unordered_set
++#endif
+
+ #include "ld.hpp"
+ #include "Snapshot.h"
+@@ -376,8 +385,8 @@
+ const std::vector<SectionRename>& sectionRenames() const { return fSectionRenames; }
+
+ private:
+- typedef std::unordered_map<const char*, unsigned int, ld::CStringHash, ld::CStringEquals> NameToOrder;
+- typedef std::unordered_set<const char*, ld::CStringHash, ld::CStringEquals> NameSet;
++ typedef std::UNORDERED_MAP<const char*, unsigned int, ld::CStringHash, ld::CStringEquals> NameToOrder;
++ typedef std::UNORDERED_SET<const char*, ld::CStringHash, ld::CStringEquals> NameSet;
+ enum ExportMode { kExportDefault, kExportSome, kDontExportSome };
+ enum LibrarySearchMode { kSearchDylibAndArchiveInEachDir, kSearchAllDirsForDylibsThenAllDirsForArchives };
+ enum InterposeMode { kInterposeNone, kInterposeAllExternal, kInterposeSome };
+@@ -389,8 +398,8 @@
+ bool containsNonWildcard(const char*) const;
+ bool empty() const { return fRegular.empty() && fWildCard.empty(); }
+ bool hasWildCards() const { return !fWildCard.empty(); }
+- NameSet::iterator regularBegin() const { return fRegular.begin(); }
+- NameSet::iterator regularEnd() const { return fRegular.end(); }
++ NameSet::const_iterator regularBegin() const { return fRegular.begin(); }
++ NameSet::const_iterator regularEnd() const { return fRegular.end(); }
+ void remove(const NameSet&);
+ private:
+ static bool hasWildCards(const char*);
+diff -ur ld64-236.3.orig/src/ld/OutputFile.cpp ld64-236.3/src/ld/OutputFile.cpp
+--- ld64-236.3.orig/src/ld/OutputFile.cpp 2015-01-11 17:35:08.000000000 +0100
++++ ld64-236.3/src/ld/OutputFile.cpp 2015-01-12 00:24:43.000000000 +0100
+@@ -50,7 +50,13 @@
+ #include <vector>
+ #include <list>
+ #include <algorithm>
++#ifdef __GLIBCXX__
++#include <tr1/unordered_set>
++#define UNORDERED_SET tr1::unordered_set
++#else
+ #include <unordered_set>
++#define UNORDERED_SET unordered_set
++#endif
+
+ #include <CommonCrypto/CommonDigest.h>
+ #include <AvailabilityMacros.h>
+@@ -4699,7 +4705,7 @@
+ const char* filename = NULL;
+ bool wroteStartSO = false;
+ state.stabs.reserve(atomsNeedingDebugNotes.size()*4);
+- std::unordered_set<const char*, CStringHash, CStringEquals> seenFiles;
++ std::UNORDERED_SET<const char*, CStringHash, CStringEquals> seenFiles;
+ for (std::vector<const ld::Atom*>::iterator it=atomsNeedingDebugNotes.begin(); it != atomsNeedingDebugNotes.end(); it++) {
+ const ld::Atom* atom = *it;
+ const ld::File* atomFile = atom->file();
+diff -ur ld64-236.3.orig/src/ld/Resolver.h ld64-236.3/src/ld/Resolver.h
+--- ld64-236.3.orig/src/ld/Resolver.h 2014-04-05 00:42:29.000000000 +0200
++++ ld64-236.3/src/ld/Resolver.h 2015-01-11 22:49:14.000000000 +0100
+@@ -42,7 +42,13 @@
+ #include <mach-o/dyld.h>
+
+ #include <vector>
++#ifdef __GLIBCXX__
++#include <tr1/unordered_set>
++#define UNORDERED_SET tr1::unordered_set
++#else
+ #include <unordered_set>
++#define UNORDERED_SET unordered_set
++#endif
+
+ #include "Options.h"
+ #include "ld.hpp"
+@@ -103,7 +109,7 @@
+ void doLinkerOption(const std::vector<const char*>& linkerOption, const char* fileName);
+ void dumpAtoms();
+
+- typedef std::unordered_set<const char*, CStringHash, CStringEquals> StringSet;
++ typedef std::UNORDERED_SET<const char*, CStringHash, CStringEquals> StringSet;
+
+ class NotLive {
+ public:
+diff -ur ld64-236.3.orig/src/ld/SymbolTable.h ld64-236.3/src/ld/SymbolTable.h
+--- ld64-236.3.orig/src/ld/SymbolTable.h 2014-04-05 00:42:29.000000000 +0200
++++ ld64-236.3/src/ld/SymbolTable.h 2015-01-11 22:46:19.000000000 +0100
+@@ -42,7 +42,13 @@
+ #include <mach-o/dyld.h>
+
+ #include <vector>
++#ifdef __GLIBCXX__
++#include <tr1/unordered_map>
++#define UNORDERED_MAP tr1::unordered_map
++#else
+ #include <unordered_map>
++#define UNORDERED_MAP unordered_map
++#endif
+
+ #include "Options.h"
+ #include "ld.hpp"
+@@ -57,38 +63,38 @@
+ typedef uint32_t IndirectBindingSlot;
+
+ private:
+- typedef std::unordered_map<const char*, IndirectBindingSlot, CStringHash, CStringEquals> NameToSlot;
++ typedef std::UNORDERED_MAP<const char*, IndirectBindingSlot, CStringHash, CStringEquals> NameToSlot;
+
+ class ContentFuncs {
+ public:
+ size_t operator()(const ld::Atom*) const;
+ bool operator()(const ld::Atom* left, const ld::Atom* right) const;
+ };
+- typedef std::unordered_map<const ld::Atom*, IndirectBindingSlot, ContentFuncs, ContentFuncs> ContentToSlot;
++ typedef std::UNORDERED_MAP<const ld::Atom*, IndirectBindingSlot, ContentFuncs, ContentFuncs> ContentToSlot;
+
+ class ReferencesHashFuncs {
+ public:
+ size_t operator()(const ld::Atom*) const;
+ bool operator()(const ld::Atom* left, const ld::Atom* right) const;
+ };
+- typedef std::unordered_map<const ld::Atom*, IndirectBindingSlot, ReferencesHashFuncs, ReferencesHashFuncs> ReferencesToSlot;
++ typedef std::UNORDERED_MAP<const ld::Atom*, IndirectBindingSlot, ReferencesHashFuncs, ReferencesHashFuncs> ReferencesToSlot;
+
+ class CStringHashFuncs {
+ public:
+ size_t operator()(const ld::Atom*) const;
+ bool operator()(const ld::Atom* left, const ld::Atom* right) const;
+ };
+- typedef std::unordered_map<const ld::Atom*, IndirectBindingSlot, CStringHashFuncs, CStringHashFuncs> CStringToSlot;
++ typedef std::UNORDERED_MAP<const ld::Atom*, IndirectBindingSlot, CStringHashFuncs, CStringHashFuncs> CStringToSlot;
+
+ class UTF16StringHashFuncs {
+ public:
+ size_t operator()(const ld::Atom*) const;
+ bool operator()(const ld::Atom* left, const ld::Atom* right) const;
+ };
+- typedef std::unordered_map<const ld::Atom*, IndirectBindingSlot, UTF16StringHashFuncs, UTF16StringHashFuncs> UTF16StringToSlot;
++ typedef std::UNORDERED_MAP<const ld::Atom*, IndirectBindingSlot, UTF16StringHashFuncs, UTF16StringHashFuncs> UTF16StringToSlot;
+
+ typedef std::map<IndirectBindingSlot, const char*> SlotToName;
+- typedef std::unordered_map<const char*, CStringToSlot*, CStringHash, CStringEquals> NameToMap;
++ typedef std::UNORDERED_MAP<const char*, CStringToSlot*, CStringHash, CStringEquals> NameToMap;
+
+ typedef std::vector<const ld::Atom *> DuplicatedSymbolAtomList;
+ typedef std::map<const char *, DuplicatedSymbolAtomList * > DuplicateSymbols;
+diff -ur ld64-236.3.orig/src/ld/ld.cpp ld64-236.3/src/ld/ld.cpp
+--- ld64-236.3.orig/src/ld/ld.cpp 2015-01-11 17:35:08.000000000 +0100
++++ ld64-236.3/src/ld/ld.cpp 2015-01-11 22:42:58.000000000 +0100
+@@ -54,7 +54,13 @@
+ #include <vector>
+ #include <list>
+ #include <algorithm>
++#ifdef __GLIBCXX__
++#include <tr1/unordered_map>
++#define UNORDERED_MAP tr1::unordered_map
++#else
+ #include <unordered_map>
++#define UNORDERED_MAP unordered_map
++#endif
+ #include <cxxabi.h>
+
+ #include "Options.h"
+@@ -150,7 +156,7 @@
+ struct SectionEquals {
+ bool operator()(const ld::Section* left, const ld::Section* right) const;
+ };
+- typedef std::unordered_map<const ld::Section*, FinalSection*, SectionHash, SectionEquals> SectionInToOut;
++ typedef std::UNORDERED_MAP<const ld::Section*, FinalSection*, SectionHash, SectionEquals> SectionInToOut;
+
+
+ SectionInToOut _sectionInToFinalMap;
+diff -ur ld64-236.3.orig/src/ld/ld.hpp ld64-236.3/src/ld/ld.hpp
+--- ld64-236.3.orig/src/ld/ld.hpp 2014-04-05 00:42:29.000000000 +0200
++++ ld64-236.3/src/ld/ld.hpp 2015-01-11 22:42:46.000000000 +0100
+@@ -32,7 +32,13 @@
+ #include <assert.h>
+
+ #include <vector>
++#ifdef __GLIBCXX__
++#include <tr1/unordered_set>
++#define UNORDERED_SET tr1::unordered_set
++#else
+ #include <unordered_set>
++#define UNORDERED_SET unordered_set
++#endif
+
+ #include "configure.h"
+
+@@ -821,7 +827,7 @@
+ bool operator()(const char* left, const char* right) const { return (strcmp(left, right) == 0); }
+ };
+
+-typedef std::unordered_set<const char*, ld::CStringHash, ld::CStringEquals> CStringSet;
++typedef std::UNORDERED_SET<const char*, ld::CStringHash, ld::CStringEquals> CStringSet;
+
+ class Internal
+ {
+diff -ur ld64-236.3.orig/src/ld/parsers/archive_file.cpp ld64-236.3/src/ld/parsers/archive_file.cpp
+--- ld64-236.3.orig/src/ld/parsers/archive_file.cpp 2015-01-11 17:35:08.000000000 +0100
++++ ld64-236.3/src/ld/parsers/archive_file.cpp 2015-01-11 22:41:37.000000000 +0100
+@@ -33,7 +33,13 @@
+ #include <set>
+ #include <map>
+ #include <algorithm>
++#ifdef __GLIBCXX__
++#include <tr1/unordered_map>
++#define UNORDERED_MAP tr1::unordered_map
++#else
+ #include <unordered_map>
++#define UNORDERED_MAP unordered_map
++#endif
+
+ #include "MachOFileAbstraction.hpp"
+ #include "Architectures.hpp"
+@@ -116,7 +122,7 @@
+ struct MemberState { ld::relocatable::File* file; const Entry *entry; bool logged; bool loaded; uint32_t index;};
+ bool loadMember(MemberState& state, ld::File::AtomHandler& handler, const char *format, ...) const;
+
+- typedef std::unordered_map<const char*, const struct ranlib*, ld::CStringHash, ld::CStringEquals> NameToEntryMap;
++ typedef std::UNORDERED_MAP<const char*, const struct ranlib*, ld::CStringHash, ld::CStringEquals> NameToEntryMap;
+
+ typedef typename A::P P;
+ typedef typename A::P::E E;
+diff -ur ld64-236.3.orig/src/ld/parsers/lto_file.cpp ld64-236.3/src/ld/parsers/lto_file.cpp
+--- ld64-236.3.orig/src/ld/parsers/lto_file.cpp 2014-04-05 00:42:29.000000000 +0200
++++ ld64-236.3/src/ld/parsers/lto_file.cpp 2015-01-11 22:44:48.000000000 +0100
+@@ -33,8 +33,17 @@
+ #include <pthread.h>
+ #include <mach-o/dyld.h>
+ #include <vector>
++#ifdef __GLIBCXX__
++#include <tr1/unordered_set>
++#include <tr1/unordered_map>
++#define UNORDERED_MAP tr1::unordered_map
++#define UNORDERED_SET tr1::unordered_set
++#else
+ #include <unordered_set>
+ #include <unordered_map>
++#define UNORDERED_MAP unordered_map
++#define UNORDERED_SET unordered_set
++#endif
+
+ #include "MachOFileAbstraction.hpp"
+ #include "Architectures.hpp"
+@@ -217,8 +226,8 @@
+ static void ltoDiagnosticHandler(lto_codegen_diagnostic_severity_t, const char*, void*);
+ #endif
+
+- typedef std::unordered_set<const char*, ld::CStringHash, ld::CStringEquals> CStringSet;
+- typedef std::unordered_map<const char*, Atom*, ld::CStringHash, ld::CStringEquals> CStringToAtom;
++ typedef std::UNORDERED_SET<const char*, ld::CStringHash, ld::CStringEquals> CStringSet;
++ typedef std::UNORDERED_MAP<const char*, Atom*, ld::CStringHash, ld::CStringEquals> CStringToAtom;
+
+ class AtomSyncer : public ld::File::AtomHandler {
+ public:
+diff -ur ld64-236.3.orig/src/ld/parsers/macho_dylib_file.cpp ld64-236.3/src/ld/parsers/macho_dylib_file.cpp
+--- ld64-236.3.orig/src/ld/parsers/macho_dylib_file.cpp 2015-01-11 17:35:08.000000000 +0100
++++ ld64-236.3/src/ld/parsers/macho_dylib_file.cpp 2015-01-11 22:45:17.000000000 +0100
+@@ -34,8 +34,17 @@
+ #include <vector>
+ #include <set>
+ #include <algorithm>
+-#include <unordered_map>
++#ifdef __GLIBCXX__
++#include <tr1/unordered_set>
++#include <tr1/unordered_map>
++#define UNORDERED_MAP tr1::unordered_map
++#define UNORDERED_SET tr1::unordered_set
++#else
+ #include <unordered_set>
++#include <unordered_map>
++#define UNORDERED_MAP unordered_map
++#define UNORDERED_SET unordered_set
++#endif
+
+ #include "Architectures.hpp"
+ #include "MachOFileAbstraction.hpp"
+@@ -189,8 +198,8 @@
+ };
+ };
+ struct AtomAndWeak { ld::Atom* atom; bool weakDef; bool tlv; pint_t address; };
+- typedef std::unordered_map<const char*, AtomAndWeak, ld::CStringHash, ld::CStringEquals> NameToAtomMap;
+- typedef std::unordered_set<const char*, CStringHash, ld::CStringEquals> NameSet;
++ typedef std::UNORDERED_MAP<const char*, AtomAndWeak, ld::CStringHash, ld::CStringEquals> NameToAtomMap;
++ typedef std::UNORDERED_SET<const char*, CStringHash, ld::CStringEquals> NameSet;
+
+ struct Dependent { const char* path; File<A>* dylib; bool reExport; };
+
+@@ -548,14 +557,18 @@
+ if ( _s_logHashtable ) fprintf(stderr, "ld: building hashtable of %u toc entries for %s\n", dynamicInfo->nextdefsym(), this->path());
+ const macho_nlist<P>* start = &symbolTable[dynamicInfo->iextdefsym()];
+ const macho_nlist<P>* end = &start[dynamicInfo->nextdefsym()];
++#ifndef __GLIBCXX__
+ _atoms.reserve(dynamicInfo->nextdefsym()); // set initial bucket count
++#endif
+ for (const macho_nlist<P>* sym=start; sym < end; ++sym) {
+ this->addSymbol(&strings[sym->n_strx()], (sym->n_desc() & N_WEAK_DEF) != 0, false, sym->n_value());
+ }
+ }
+ else {
+ int32_t count = dynamicInfo->ntoc();
++#ifndef __GLIBCXX__
+ _atoms.reserve(count); // set initial bucket count
++#endif
+ if ( _s_logHashtable ) fprintf(stderr, "ld: building hashtable of %u entries for %s\n", count, this->path());
+ const struct dylib_table_of_contents* toc = (dylib_table_of_contents*)(fileContent + dynamicInfo->tocoff());
+ for (int32_t i = 0; i < count; ++i) {
+diff -ur ld64-236.3.orig/src/ld/parsers/macho_relocatable_file.cpp ld64-236.3/src/ld/parsers/macho_relocatable_file.cpp
+--- ld64-236.3.orig/src/ld/parsers/macho_relocatable_file.cpp 2014-04-05 00:42:29.000000000 +0200
++++ ld64-236.3/src/ld/parsers/macho_relocatable_file.cpp 2015-01-11 23:08:13.000000000 +0100
+@@ -62,7 +62,7 @@
+ // forward reference
+ template <typename A> class Parser;
+ template <typename A> class Atom;
+-template <typename A> class Section;
++template <typename A> class MRFSection;
+ template <typename A> class CFISection;
+ template <typename A> class CUSection;
+
+@@ -100,14 +100,14 @@
+ const uint8_t* fileContent() { return _fileContent; }
+ private:
+ friend class Atom<A>;
+- friend class Section<A>;
++ friend class MRFSection<A>;
+ friend class Parser<A>;
+ friend class CFISection<A>::OAS;
+
+ typedef typename A::P P;
+
+ const uint8_t* _fileContent;
+- Section<A>** _sectionsArray;
++ MRFSection<A>** _sectionsArray;
+ uint8_t* _atomsArray;
+ uint32_t _sectionsArrayCount;
+ uint32_t _atomsArrayCount;
+@@ -129,14 +129,14 @@
+
+
+ template <typename A>
+-class Section : public ld::Section
++class MRFSection : public ld::Section
+ {
+ public:
+ typedef typename A::P::uint_t pint_t;
+ typedef typename A::P P;
+ typedef typename A::P::E E;
+
+- virtual ~Section() { }
++ virtual ~MRFSection() { }
+ class File<A>& file() const { return _file; }
+ const macho_section<P>* machoSection() const { return _machOSection; }
+ uint32_t sectionNum(class Parser<A>&) const;
+@@ -160,10 +160,10 @@
+ static const char* makeSectionName(const macho_section<typename A::P>* s);
+
+ protected:
+- Section(File<A>& f, const macho_section<typename A::P>* s)
++ MRFSection(File<A>& f, const macho_section<typename A::P>* s)
+ : ld::Section(makeSegmentName(s), makeSectionName(s), sectionType(s)),
+ _file(f), _machOSection(s), _beginAtoms(NULL), _endAtoms(NULL), _hasAliases(false) { }
+- Section(File<A>& f, const char* segName, const char* sectName, ld::Section::Type t, bool hidden=false)
++ MRFSection(File<A>& f, const char* segName, const char* sectName, ld::Section::Type t, bool hidden=false)
+ : ld::Section(segName, sectName, t, hidden), _file(f), _machOSection(NULL),
+ _beginAtoms(NULL), _endAtoms(NULL), _hasAliases(false) { }
+
+@@ -186,11 +186,11 @@
+
+
+ template <typename A>
+-class CFISection : public Section<A>
++class CFISection : public MRFSection<A>
+ {
+ public:
+ CFISection(Parser<A>& parser, File<A>& f, const macho_section<typename A::P>* s)
+- : Section<A>(f, s) { }
++ : MRFSection<A>(f, s) { }
+ uint32_t cfiCount();
+
+ virtual ld::Atom::ContentType contentType() { return ld::Atom::typeCFI; }
+@@ -250,11 +250,11 @@
+
+
+ template <typename A>
+-class CUSection : public Section<A>
++class CUSection : public MRFSection<A>
+ {
+ public:
+ CUSection(Parser<A>& parser, File<A>& f, const macho_section<typename A::P>* s)
+- : Section<A>(f, s) { }
++ : MRFSection<A>(f, s) { }
+
+ typedef typename A::P::uint_t pint_t;
+ typedef typename A::P P;
+@@ -291,11 +291,11 @@
+
+
+ template <typename A>
+-class TentativeDefinitionSection : public Section<A>
++class TentativeDefinitionSection : public MRFSection<A>
+ {
+ public:
+ TentativeDefinitionSection(Parser<A>& parser, File<A>& f)
+- : Section<A>(f, "__DATA", "__comm/tent", ld::Section::typeTentativeDefs) {}
++ : MRFSection<A>(f, "__DATA", "__comm/tent", ld::Section::typeTentativeDefs) {}
+
+ virtual ld::Atom::ContentType contentType() { return ld::Atom::typeZeroFill; }
+ virtual bool addFollowOnFixups() const { return false; }
+@@ -313,11 +313,11 @@
+
+
+ template <typename A>
+-class AbsoluteSymbolSection : public Section<A>
++class AbsoluteSymbolSection : public MRFSection<A>
+ {
+ public:
+ AbsoluteSymbolSection(Parser<A>& parser, File<A>& f)
+- : Section<A>(f, "__DATA", "__abs", ld::Section::typeAbsoluteSymbols, true) {}
++ : MRFSection<A>(f, "__DATA", "__abs", ld::Section::typeAbsoluteSymbols, true) {}
+
+ virtual ld::Atom::ContentType contentType() { return ld::Atom::typeUnclassified; }
+ virtual bool dontDeadStrip() { return false; }
+@@ -339,7 +339,7 @@
+
+
+ template <typename A>
+-class SymboledSection : public Section<A>
++class SymboledSection : public MRFSection<A>
+ {
+ public:
+ SymboledSection(Parser<A>& parser, File<A>& f, const macho_section<typename A::P>* s);
+@@ -371,11 +371,11 @@
+
+
+ template <typename A>
+-class ImplicitSizeSection : public Section<A>
++class ImplicitSizeSection : public MRFSection<A>
+ {
+ public:
+ ImplicitSizeSection(Parser<A>& parser, File<A>& f, const macho_section<typename A::P>* s)
+- : Section<A>(f, s) { }
++ : MRFSection<A>(f, s) { }
+ virtual uint32_t computeAtomCount(class Parser<A>& parser, struct Parser<A>::LabelAndCFIBreakIterator& it, const struct Parser<A>::CFI_CU_InfoArrays&);
+ virtual uint32_t appendAtoms(class Parser<A>& parser, uint8_t* buffer, struct Parser<A>::LabelAndCFIBreakIterator& it, const struct Parser<A>::CFI_CU_InfoArrays&);
+ protected:
+@@ -709,8 +709,8 @@
+
+ public:
+ // methods for all atoms from mach-o object file
+- Section<A>& sect() const { return (Section<A>&)section(); }
+- File<A>& machofile() const { return ((Section<A>*)(this->_section))->file(); }
++ MRFSection<A>& sect() const { return (MRFSection<A>&)section(); }
++ File<A>& machofile() const { return ((MRFSection<A>*)(this->_section))->file(); }
+ void setFixupsRange(uint32_t s, uint32_t c);
+ void setUnwindInfoRange(uint32_t s, uint32_t c);
+ void extendUnwindInfoRange();
+@@ -727,7 +727,7 @@
+ typedef typename A::P::E E;
+ typedef typename A::P::uint_t pint_t;
+ // constuct via all attributes
+- Atom(Section<A>& sct, const char* nm, pint_t addr, uint64_t sz,
++ Atom(MRFSection<A>& sct, const char* nm, pint_t addr, uint64_t sz,
+ ld::Atom::Definition d, ld::Atom::Combine c, ld::Atom::Scope s,
+ ld::Atom::ContentType ct, ld::Atom::SymbolTableInclusion i,
+ bool dds, bool thumb, bool al, ld::Atom::Alignment a)
+@@ -737,7 +737,7 @@
+ _unwindInfoStartIndex(0), _fixupsCount(0),
+ _lineInfoCount(0), _unwindInfoCount(0) { }
+ // construct via symbol table entry
+- Atom(Section<A>& sct, Parser<A>& parser, const macho_nlist<P>& sym,
++ Atom(MRFSection<A>& sct, Parser<A>& parser, const macho_nlist<P>& sym,
+ uint64_t sz, bool alias=false)
+ : ld::Atom((ld::Section&)sct, parser.definitionFromSymbol(sym),
+ parser.combineFromSymbol(sym), parser.scopeFromSymbol(sym),
+@@ -760,7 +760,7 @@
+
+ private:
+ friend class Parser<A>;
+- friend class Section<A>;
++ friend class MRFSection<A>;
+ friend class CStringSection<A>;
+ friend class AbsoluteSymbolSection<A>;
+
+@@ -991,8 +991,8 @@
+ uint32_t undefinedStartIndex() { return _undefinedStartIndex; }
+ uint32_t undefinedEndIndex() { return _undefinedEndIndex; }
+ void addFixup(FixupInAtom f) { _allFixups.push_back(f); }
+- Section<A>* sectionForNum(unsigned int sectNum);
+- Section<A>* sectionForAddress(pint_t addr);
++ MRFSection<A>* sectionForNum(unsigned int sectNum);
++ MRFSection<A>* sectionForAddress(pint_t addr);
+ Atom<A>* findAtomByAddress(pint_t addr);
+ Atom<A>* findAtomByAddressOrNullIfStub(pint_t addr);
+ Atom<A>* findAtomByAddressOrLocalTargetOfStub(pint_t addr, uint32_t* offsetInAtom);
+@@ -1034,7 +1034,7 @@
+ : sortedSymbolIndexes(ssa), sortedSymbolCount(ssc), cfiStartsArray(cfisa),
+ cfiStartsCount(cfisc), fileHasOverlappingSymbols(ols),
+ newSection(false), cfiIndex(0), symIndex(0) {}
+- bool next(Parser<A>& parser, const Section<A>& sect, uint32_t sectNum, pint_t startAddr, pint_t endAddr,
++ bool next(Parser<A>& parser, const MRFSection<A>& sect, uint32_t sectNum, pint_t startAddr, pint_t endAddr,
+ pint_t* addr, pint_t* size, const macho_nlist<P>** sym);
+ pint_t peek(Parser<A>& parser, pint_t startAddr, pint_t endAddr);
+ void beginSection() { newSection = true; symIndex = 0; }
+@@ -1063,7 +1063,7 @@
+
+
+ private:
+- friend class Section<A>;
++ friend class MRFSection<A>;
+
+ enum SectionType { sectionTypeIgnore, sectionTypeLiteral4, sectionTypeLiteral8, sectionTypeLiteral16,
+ sectionTypeNonLazy, sectionTypeCFI, sectionTypeCString, sectionTypeCStringPointer,
+@@ -1404,7 +1404,7 @@
+ // was becuase of a label, the symbol). Returns false when no more chunks.
+ //
+ template <typename A>
+-bool Parser<A>::LabelAndCFIBreakIterator::next(Parser<A>& parser, const Section<A>& sect, uint32_t sectNum, pint_t startAddr, pint_t endAddr,
++bool Parser<A>::LabelAndCFIBreakIterator::next(Parser<A>& parser, const MRFSection<A>& sect, uint32_t sectNum, pint_t startAddr, pint_t endAddr,
+ pint_t* addr, pint_t* size, const macho_nlist<P>** symbol)
+ {
+ // may not be a label on start of section, but need atom demarcation there
+@@ -1590,7 +1590,7 @@
+ uint32_t sortedSymbolIndexes[_symbolsInSections];
+ this->makeSortedSymbolsArray(sortedSymbolIndexes, sortedSectionIndexes);
+
+- // allocate Section<A> object for each mach-o section
++ // allocate MRFSection<A> object for each mach-o section
+ makeSections();
+
+ // if it exists, do special early parsing of __compact_unwind section
+@@ -1687,7 +1687,7 @@
+ #endif
+ }
+
+- Section<A>** sections = _file->_sectionsArray;
++ MRFSection<A>** sections = _file->_sectionsArray;
+ uint32_t sectionsCount = _file->_sectionsArrayCount;
+
+ // figure out how many atoms will be allocated and allocate
+@@ -2208,11 +2208,11 @@
+ _file->_objConstraint = ld::File::objcConstraintRetainRelease;
+ if ( sect->size() > 8 ) {
+ warning("section %s/%s has unexpectedly large size %llu in %s",
+- sect->segname(), Section<A>::makeSectionName(sect), sect->size(), _file->path());
++ sect->segname(), MRFSection<A>::makeSectionName(sect), sect->size(), _file->path());
+ }
+ }
+ else {
+- warning("can't parse %s/%s section in %s", sect->segname(), Section<A>::makeSectionName(sect), _file->path());
++ warning("can't parse %s/%s section in %s", sect->segname(), MRFSection<A>::makeSectionName(sect), _file->path());
+ }
+ continue;
+ }
+@@ -2308,24 +2308,24 @@
+ // sort by address (mach-o object files don't aways have sections sorted)
+ ::qsort(machOSects, count, sizeof(MachOSectionAndSectionClass<P>), MachOSectionAndSectionClass<P>::sorter);
+
+- // we will synthesize a dummy Section<A> object for tentative definitions
++ // we will synthesize a dummy MRFSection<A> object for tentative definitions
+ if ( _tentativeDefinitionCount > 0 ) {
+ totalSectionsSize += sizeof(TentativeDefinitionSection<A>);
+ machOSects[count++].type = sectionTypeTentativeDefinitions;
+ }
+
+- // we will synthesize a dummy Section<A> object for Absolute symbols
++ // we will synthesize a dummy MRFSection<A> object for Absolute symbols
+ if ( _absoluteSymbolCount > 0 ) {
+ totalSectionsSize += sizeof(AbsoluteSymbolSection<A>);
+ machOSects[count++].type = sectionTypeAbsoluteSymbols;
+ }
+
+ // allocate one block for all Section objects as well as pointers to each
+- uint8_t* space = new uint8_t[totalSectionsSize+count*sizeof(Section<A>*)];
+- _file->_sectionsArray = (Section<A>**)space;
++ uint8_t* space = new uint8_t[totalSectionsSize+count*sizeof(MRFSection<A>*)];
++ _file->_sectionsArray = (MRFSection<A>**)space;
+ _file->_sectionsArrayCount = count;
+- Section<A>** objects = _file->_sectionsArray;
+- space += count*sizeof(Section<A>*);
++ MRFSection<A>** objects = _file->_sectionsArray;
++ space += count*sizeof(MRFSection<A>*);
+ for (uint32_t i=0; i < count; ++i) {
+ switch ( machOSects[i].type ) {
+ case sectionTypeIgnore:
+@@ -2413,7 +2413,7 @@
+
+
+ template <typename A>
+-Section<A>* Parser<A>::sectionForAddress(typename A::P::uint_t addr)
++MRFSection<A>* Parser<A>::sectionForAddress(typename A::P::uint_t addr)
+ {
+ for (uint32_t i=0; i < _file->_sectionsArrayCount; ++i ) {
+ const macho_section<typename A::P>* sect = _file->_sectionsArray[i]->machoSection();
+@@ -2440,7 +2440,7 @@
+ }
+
+ template <typename A>
+-Section<A>* Parser<A>::sectionForNum(unsigned int num)
++MRFSection<A>* Parser<A>::sectionForNum(unsigned int num)
+ {
+ for (uint32_t i=0; i < _file->_sectionsArrayCount; ++i ) {
+ const macho_section<typename A::P>* sect = _file->_sectionsArray[i]->machoSection();
+@@ -2456,7 +2456,7 @@
+ template <typename A>
+ Atom<A>* Parser<A>::findAtomByAddress(pint_t addr)
+ {
+- Section<A>* section = this->sectionForAddress(addr);
++ MRFSection<A>* section = this->sectionForAddress(addr);
+ return section->findAtomByAddress(addr);
+ }
+
+@@ -2513,7 +2513,7 @@
+ target.addend = 0;
+ return;
+ }
+- Section<A>* section = this->sectionForAddress(addr);
++ MRFSection<A>* section = this->sectionForAddress(addr);
+ target.atom = section->findAtomByAddress(addr);
+ target.addend = addr - target.atom->_objAddress;
+ target.weakImport = false;
+@@ -2561,7 +2561,7 @@
+ }
+ return;
+ }
+- Section<A>* section = this->sectionForNum(sectNum);
++ MRFSection<A>* section = this->sectionForNum(sectNum);
+ target.atom = section->findAtomByAddress(addr);
+ if ( target.atom == NULL ) {
+ typedef typename A::P::sint_t sint_t;
+@@ -3723,7 +3723,7 @@
+ }
+
+ template <typename A>
+-const char* Section<A>::makeSegmentName(const macho_section<typename A::P>* sect)
++const char* MRFSection<A>::makeSegmentName(const macho_section<typename A::P>* sect)
+ {
+ // mach-o section record only has room for 16-byte seg/sect names
+ // so a 16-byte name has no trailing zero
+@@ -3736,7 +3736,7 @@
+ }
+
+ template <typename A>
+-const char* Section<A>::makeSectionName(const macho_section<typename A::P>* sect)
++const char* MRFSection<A>::makeSectionName(const macho_section<typename A::P>* sect)
+ {
+ const char* name = sect->sectname();
+ if ( strlen(name) < 16 )
+@@ -3770,13 +3770,13 @@
+ }
+
+ template <typename A>
+-bool Section<A>::readable(const macho_section<typename A::P>* sect)
++bool MRFSection<A>::readable(const macho_section<typename A::P>* sect)
+ {
+ return true;
+ }
+
+ template <typename A>
+-bool Section<A>::writable(const macho_section<typename A::P>* sect)
++bool MRFSection<A>::writable(const macho_section<typename A::P>* sect)
+ {
+ // mach-o .o files do not contain segment permissions
+ // we just know TEXT is special
+@@ -3784,7 +3784,7 @@
+ }
+
+ template <typename A>
+-bool Section<A>::exectuable(const macho_section<typename A::P>* sect)
++bool MRFSection<A>::exectuable(const macho_section<typename A::P>* sect)
+ {
+ // mach-o .o files do not contain segment permissions
+ // we just know TEXT is special
+@@ -3793,7 +3793,7 @@
+
+
+ template <typename A>
+-ld::Section::Type Section<A>::sectionType(const macho_section<typename A::P>* sect)
++ld::Section::Type MRFSection<A>::sectionType(const macho_section<typename A::P>* sect)
+ {
+ switch ( sect->flags() & SECTION_TYPE ) {
+ case S_ZEROFILL:
+@@ -3871,7 +3871,7 @@
+
+
+ template <typename A>
+-Atom<A>* Section<A>::findContentAtomByAddress(pint_t addr, class Atom<A>* start, class Atom<A>* end)
++Atom<A>* MRFSection<A>::findContentAtomByAddress(pint_t addr, class Atom<A>* start, class Atom<A>* end)
+ {
+ // do a binary search of atom array
+ uint32_t atomCount = end - start;
+@@ -3903,7 +3903,7 @@
+ }
+
+ template <typename A>
+-ld::Atom::Alignment Section<A>::alignmentForAddress(pint_t addr)
++ld::Atom::Alignment MRFSection<A>::alignmentForAddress(pint_t addr)
+ {
+ const uint32_t sectionAlignment = this->_machOSection->align();
+ uint32_t modulus = (addr % (1 << sectionAlignment));
+@@ -3913,7 +3913,7 @@
+ }
+
+ template <typename A>
+-uint32_t Section<A>::sectionNum(class Parser<A>& parser) const
++uint32_t MRFSection<A>::sectionNum(class Parser<A>& parser) const
+ {
+ if ( _machOSection == NULL )
+ return 0;
+@@ -4481,7 +4481,7 @@
+ else {
+ const pint_t* content = (pint_t*)(this->file().fileContent() + this->_machOSection->offset() + reloc->r_address());
+ pint_t personalityAddr = *content;
+- Section<x86_64>* personalitySection = parser.sectionForAddress(personalityAddr);
++ MRFSection<x86_64>* personalitySection = parser.sectionForAddress(personalityAddr);
+ assert((personalitySection->type() == ld::Section::typeCode) && "personality column in __compact_unwind section is not pointer to function");
+ // atoms may not be constructed yet, so scan symbol table for labels
+ const char* name = parser.scanSymbolTableForAddress(personalityAddr);
+@@ -4501,7 +4501,7 @@
+ // support __LD, __compact_unwind personality entries which are pointer to personality non-lazy pointer
+ const pint_t* content = (pint_t*)(this->file().fileContent() + this->_machOSection->offset() + reloc->r_address());
+ pint_t nlPointerAddr = *content;
+- Section<x86>* nlSection = parser.sectionForAddress(nlPointerAddr);
++ MRFSection<x86>* nlSection = parser.sectionForAddress(nlPointerAddr);
+ if ( nlSection->type() == ld::Section::typeCode ) {
+ // personality function is defined in this .o file, so this is a direct reference to it
+ // atoms may not be constructed yet, so scan symbol table for labels
+@@ -4528,7 +4528,7 @@
+ else {
+ const pint_t* content = (pint_t*)(this->file().fileContent() + this->_machOSection->offset() + reloc->r_address());
+ pint_t personalityAddr = *content;
+- Section<arm64>* personalitySection = parser.sectionForAddress(personalityAddr);
++ MRFSection<arm64>* personalitySection = parser.sectionForAddress(personalityAddr);
+ assert((personalitySection->type() == ld::Section::typeCode) && "personality column in __compact_unwind section is not pointer to function");
+ // atoms may not be constructed yet, so scan symbol table for labels
+ const char* name = parser.scanSymbolTableForAddress(personalityAddr);
+@@ -4681,7 +4681,7 @@
+
+ template <typename A>
+ SymboledSection<A>::SymboledSection(Parser<A>& parser, File<A>& f, const macho_section<typename A::P>* s)
+- : Section<A>(f, s), _type(ld::Atom::typeUnclassified)
++ : MRFSection<A>(f, s), _type(ld::Atom::typeUnclassified)
+ {
+ switch ( s->flags() & SECTION_TYPE ) {
+ case S_ZEROFILL:
+@@ -4727,7 +4727,7 @@
+ if ( ! this->_file.canScatterAtoms() )
+ return true;
+ // call inherited
+- return Section<A>::dontDeadStrip();
++ return MRFSection<A>::dontDeadStrip();
+ }
+ return false;
+ }
+@@ -5572,7 +5572,7 @@
+
+
+ template <>
+-uint32_t Section<x86_64>::x86_64PcRelOffset(uint8_t r_type)
++uint32_t MRFSection<x86_64>::x86_64PcRelOffset(uint8_t r_type)
+ {
+ switch ( r_type ) {
+ case X86_64_RELOC_SIGNED:
+@@ -5589,7 +5589,7 @@
+
+
+ template <>
+-bool Section<x86_64>::addRelocFixup(class Parser<x86_64>& parser, const macho_relocation_info<P>* reloc)
++bool MRFSection<x86_64>::addRelocFixup(class Parser<x86_64>& parser, const macho_relocation_info<P>* reloc)
+ {
+ const macho_section<P>* sect = this->machoSection();
+ uint64_t srcAddr = sect->addr() + reloc->r_address();
+@@ -5796,7 +5796,7 @@
+
+
+ template <>
+-bool Section<x86>::addRelocFixup(class Parser<x86>& parser, const macho_relocation_info<P>* reloc)
++bool MRFSection<x86>::addRelocFixup(class Parser<x86>& parser, const macho_relocation_info<P>* reloc)
+ {
+ const macho_section<P>* sect = this->machoSection();
+ uint32_t srcAddr;
+@@ -6037,7 +6037,7 @@
+
+ #if SUPPORT_ARCH_arm_any
+ template <>
+-bool Section<arm>::addRelocFixup(class Parser<arm>& parser, const macho_relocation_info<P>* reloc)
++bool MRFSection<arm>::addRelocFixup(class Parser<arm>& parser, const macho_relocation_info<P>* reloc)
+ {
+ const macho_section<P>* sect = this->machoSection();
+ bool result = false;
+@@ -6495,7 +6495,7 @@
+
+ #if SUPPORT_ARCH_arm64
+ template <>
+-bool Section<arm64>::addRelocFixup(class Parser<arm64>& parser, const macho_relocation_info<P>* reloc)
++bool MRFSection<arm64>::addRelocFixup(class Parser<arm64>& parser, const macho_relocation_info<P>* reloc)
+ {
+ bool result = false;
+ Parser<arm64>::SourceLocation src;
+@@ -6893,7 +6893,7 @@
+
+ #if SUPPORT_ARCH_arm64
+ template <>
+-void Section<arm64>::addLOH(class Parser<arm64>& parser, int kind, int count, const uint64_t addrs[]) {
++void MRFSection<arm64>::addLOH(class Parser<arm64>& parser, int kind, int count, const uint64_t addrs[]) {
+ switch (kind) {
+ case LOH_ARM64_ADRP_ADRP:
+ case LOH_ARM64_ADRP_LDR:
+@@ -6948,18 +6948,18 @@
+ extra.info.delta2 = (count > 1) ? ((addrs[1] - lowestAddress) >> 2) : 0;
+ extra.info.delta3 = (count > 2) ? ((addrs[2] - lowestAddress) >> 2) : 0;
+ extra.info.delta4 = (count > 3) ? ((addrs[3] - lowestAddress) >> 2) : 0;
+- typename Parser<arm64>::SourceLocation src(inAtom, lowestAddress- inAtom->objectAddress());
++ Parser<arm64>::SourceLocation src(inAtom, lowestAddress- inAtom->objectAddress());
+ parser.addFixup(src, ld::Fixup::k1of1, ld::Fixup::kindLinkerOptimizationHint, extra.addend);
+ }
+ #endif
+
+ template <typename A>
+-void Section<A>::addLOH(class Parser<A>& parser, int kind, int count, const uint64_t addrs[]) {
++void MRFSection<A>::addLOH(class Parser<A>& parser, int kind, int count, const uint64_t addrs[]) {
+
+ }
+
+ template <typename A>
+-void Section<A>::makeFixups(class Parser<A>& parser, const struct Parser<A>::CFI_CU_InfoArrays&)
++void MRFSection<A>::makeFixups(class Parser<A>& parser, const struct Parser<A>::CFI_CU_InfoArrays&)
+ {
+ const macho_section<P>* sect = this->machoSection();
+ const macho_relocation_info<P>* relocs = (macho_relocation_info<P>*)(file().fileContent() + sect->reloff());
+@@ -6970,7 +6970,7 @@
+ ++r; // skip next
+ }
+ catch (const char* msg) {
+- throwf("in section %s,%s reloc %u: %s", sect->segname(), Section<A>::makeSectionName(sect), r, msg);
++ throwf("in section %s,%s reloc %u: %s", sect->segname(), MRFSection<A>::makeSectionName(sect), r, msg);
+ }
+ }
+
+diff -ur ld64-236.3.orig/src/ld/passes/dtrace_dof.cpp ld64-236.3/src/ld/passes/dtrace_dof.cpp
+--- ld64-236.3.orig/src/ld/passes/dtrace_dof.cpp 2014-04-05 00:42:29.000000000 +0200
++++ ld64-236.3/src/ld/passes/dtrace_dof.cpp 2015-01-12 00:27:58.000000000 +0100
+@@ -30,8 +30,17 @@
+
+ #include <vector>
+ #include <map>
++#ifdef __GLIBCXX__
++#include <tr1/unordered_map>
++#include <tr1/unordered_set>
++#define UNORDERED_MAP tr1::unordered_map
++#define UNORDERED_SET tr1::unordered_set
++#else
+ #include <unordered_map>
+ #include <unordered_set>
++#define UNORDERED_MAP unordered_map
++#define UNORDERED_SET unordered_set
++#endif
+
+ #include "ld.hpp"
+ #include "MachOFileAbstraction.hpp"
+@@ -111,8 +120,8 @@
+ uint32_t offset;
+ const char* probeName;
+ };
+-typedef std::unordered_map<const char*, std::vector<DTraceProbeInfo>, CStringHash, CStringEquals> ProviderToProbes;
+-typedef std::unordered_set<const char*, CStringHash, CStringEquals> CStringSet;
++typedef std::UNORDERED_MAP<const char*, std::vector<DTraceProbeInfo>, CStringHash, CStringEquals> ProviderToProbes;
++typedef std::UNORDERED_SET<const char*, CStringHash, CStringEquals> CStringSet;
+
+
+
+diff -ur ld64-236.3.orig/src/ld/passes/order.cpp ld64-236.3/src/ld/passes/order.cpp
+--- ld64-236.3.orig/src/ld/passes/order.cpp 2014-04-05 00:42:29.000000000 +0200
++++ ld64-236.3/src/ld/passes/order.cpp 2015-01-11 22:45:57.000000000 +0100
+@@ -32,7 +32,13 @@
+ #include <vector>
+ #include <map>
+ #include <set>
++#ifdef __GLIBCXX__
++#include <tr1/unordered_map>
++#define UNORDERED_MAP tr1::unordered_map
++#else
+ #include <unordered_map>
++#define UNORDERED_MAP unordered_map
++#endif
+
+ #include "ld.hpp"
+ #include "order.h"
+@@ -84,7 +90,7 @@
+ const Layout& _layout;
+ };
+
+- typedef std::unordered_map<const char*, const ld::Atom*, CStringHash, CStringEquals> NameToAtom;
++ typedef std::UNORDERED_MAP<const char*, const ld::Atom*, CStringHash, CStringEquals> NameToAtom;
+
+ typedef std::map<const ld::Atom*, const ld::Atom*> AtomToAtom;
+
+diff -ur ld64-236.3.orig/src/other/dyldinfo.cpp ld64-236.3/src/other/dyldinfo.cpp
+--- ld64-236.3.orig/src/other/dyldinfo.cpp 2014-04-05 00:42:29.000000000 +0200
++++ ld64-236.3/src/other/dyldinfo.cpp 2015-01-12 00:27:33.000000000 +0100
+@@ -33,7 +33,6 @@
+
+ #include <vector>
+ #include <set>
+-#include <unordered_set>
+
+ #include "configure.h"
+ #include "MachOFileAbstraction.hpp"
+diff -ur ld64-236.3.orig/src/other/machochecker.cpp ld64-236.3/src/other/machochecker.cpp
+--- ld64-236.3.orig/src/other/machochecker.cpp 2014-04-05 00:42:29.000000000 +0200
++++ ld64-236.3/src/other/machochecker.cpp 2015-01-11 22:46:37.000000000 +0100
+@@ -33,7 +33,13 @@
+
+ #include <vector>
+ #include <set>
++#ifdef __GLIBCXX__
++#include <tr1/unordered_set>
++#define UNORDERED_SET tr1::unordered_set
++#else
+ #include <unordered_set>
++#define UNORDERED_SET unordered_set
++#endif
+
+ #include "configure.h"
+
+@@ -124,7 +130,7 @@
+ bool operator()(const char* left, const char* right) const { return (strcmp(left, right) == 0); }
+ };
+
+- typedef std::unordered_set<const char*, CStringHash, CStringEquals> StringSet;
++ typedef std::UNORDERED_SET<const char*, CStringHash, CStringEquals> StringSet;
+
+ MachOChecker(const uint8_t* fileContent, uint32_t fileLength, const char* path);
+ void checkMachHeader();
+diff -ur ld64-236.3.orig/src/other/unwinddump.cpp ld64-236.3/src/other/unwinddump.cpp
+--- ld64-236.3.orig/src/other/unwinddump.cpp 2014-04-05 00:42:29.000000000 +0200
++++ ld64-236.3/src/other/unwinddump.cpp 2015-01-11 23:58:00.000000000 +0100
+@@ -33,7 +33,6 @@
+
+ #include <vector>
+ #include <set>
+-#include <unordered_set>
+
+ #include "configure.h"
+ #include "MachOFileAbstraction.hpp"
diff --git a/sys-devel/binutils-apple/files/ld64-236.3-missing-cputypes.patch b/sys-devel/binutils-apple/files/ld64-236.3-missing-cputypes.patch
new file mode 100644
index 00000000000..29b50f62812
--- /dev/null
+++ b/sys-devel/binutils-apple/files/ld64-236.3-missing-cputypes.patch
@@ -0,0 +1,10 @@
+--- ld64-236.3/src/include/mach/machine.h.orig 2015-01-24 13:22:36.000000000 +0100
++++ ld64-236.3/src/include/mach/machine.h 2015-01-24 13:22:51.000000000 +0100
+@@ -233,6 +233,7 @@
+ */
+
+ #define CPU_SUBTYPE_I386_ALL ((cpu_subtype_t) 3)
++#define CPU_SUBTYPE_X86_ALL CPU_SUBTYPE_I386_ALL
+ #define CPU_SUBTYPE_X86_64_ALL CPU_SUBTYPE_I386_ALL
+ #define CPU_SUBTYPE_386 ((cpu_subtype_t) 3)
+ #define CPU_SUBTYPE_486 ((cpu_subtype_t) 4)
diff --git a/sys-devel/binutils-apple/files/ld64-2