mirror of
https://github.com/flatcar/scripts.git
synced 2025-12-07 10:22:12 +01:00
bump(sys-devel/gcc-config): sync with upstream
Stabilizes 1.7.3 for arm64. (same version amd64)
This commit is contained in:
parent
24bb5b9cdb
commit
46d647c65c
@ -0,0 +1,9 @@
|
||||
DEFINED_PHASES=compile install postinst unpack
|
||||
DESCRIPTION=Utility to change the gcc compiler being used
|
||||
HOMEPAGE=http://www.gentoo.org/
|
||||
KEYWORDS=alpha amd64 arm hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc ~sparc-fbsd x86 ~x86-fbsd
|
||||
LICENSE=GPL-2
|
||||
RDEPEND=!app-admin/eselect-compiler
|
||||
SLOT=0
|
||||
_eclasses_=eutils 6faef4c127028ccbba3a11400d24ae34 flag-o-matic eda1c0b5ba85b3eeb555a071d69eb819 multilib 3bf24e6abb9b76d9f6c20600f0b716bf toolchain-funcs 0dfbfa13f57c6184f4728d12ac002aac
|
||||
_md5_=7ffa07611d5cf67363d1426027a20454
|
||||
9
sdk_container/src/third_party/portage-stable/metadata/md5-cache/sys-devel/gcc-config-1.5-r1
vendored
Normal file
9
sdk_container/src/third_party/portage-stable/metadata/md5-cache/sys-devel/gcc-config-1.5-r1
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
DEFINED_PHASES=compile install postinst unpack
|
||||
DESCRIPTION=Utility to change the gcc compiler being used
|
||||
HOMEPAGE=http://www.gentoo.org/
|
||||
KEYWORDS=~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 -sparc-fbsd -x86-fbsd
|
||||
LICENSE=GPL-2
|
||||
RDEPEND=!app-admin/eselect-compiler
|
||||
SLOT=0
|
||||
_eclasses_=eutils 6faef4c127028ccbba3a11400d24ae34 flag-o-matic eda1c0b5ba85b3eeb555a071d69eb819 multilib 3bf24e6abb9b76d9f6c20600f0b716bf toolchain-funcs 0dfbfa13f57c6184f4728d12ac002aac
|
||||
_md5_=41aa67c91560537730ddbc167da976e6
|
||||
9
sdk_container/src/third_party/portage-stable/metadata/md5-cache/sys-devel/gcc-config-1.5-r2
vendored
Normal file
9
sdk_container/src/third_party/portage-stable/metadata/md5-cache/sys-devel/gcc-config-1.5-r2
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
DEFINED_PHASES=compile install postinst unpack
|
||||
DESCRIPTION=Utility to change the gcc compiler being used
|
||||
HOMEPAGE=http://www.gentoo.org/
|
||||
KEYWORDS=alpha amd64 arm hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~sparc-fbsd ~x86-fbsd
|
||||
LICENSE=GPL-2
|
||||
RDEPEND=!app-admin/eselect-compiler
|
||||
SLOT=0
|
||||
_eclasses_=eutils 6faef4c127028ccbba3a11400d24ae34 flag-o-matic eda1c0b5ba85b3eeb555a071d69eb819 multilib 3bf24e6abb9b76d9f6c20600f0b716bf toolchain-funcs 0dfbfa13f57c6184f4728d12ac002aac
|
||||
_md5_=750ff540c188eb74d550b7b518cfa7b6
|
||||
9
sdk_container/src/third_party/portage-stable/metadata/md5-cache/sys-devel/gcc-config-1.5.1
vendored
Normal file
9
sdk_container/src/third_party/portage-stable/metadata/md5-cache/sys-devel/gcc-config-1.5.1
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
DEFINED_PHASES=compile install postinst unpack
|
||||
DESCRIPTION=Utility to change the gcc compiler being used
|
||||
HOMEPAGE=http://www.gentoo.org/
|
||||
KEYWORDS=~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~sparc-fbsd ~x86-fbsd
|
||||
LICENSE=GPL-2
|
||||
RDEPEND=!app-admin/eselect-compiler
|
||||
SLOT=0
|
||||
_eclasses_=eutils 6faef4c127028ccbba3a11400d24ae34 flag-o-matic eda1c0b5ba85b3eeb555a071d69eb819 multilib 3bf24e6abb9b76d9f6c20600f0b716bf toolchain-funcs 0dfbfa13f57c6184f4728d12ac002aac
|
||||
_md5_=c4dd8d4f4345bf199034778373325a2f
|
||||
@ -0,0 +1,9 @@
|
||||
DEFINED_PHASES=compile install postinst unpack
|
||||
DESCRIPTION=Utility to change the gcc compiler being used
|
||||
HOMEPAGE=http://www.gentoo.org/
|
||||
KEYWORDS=~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~sparc-fbsd ~x86-fbsd
|
||||
LICENSE=GPL-2
|
||||
RDEPEND=!app-admin/eselect-compiler
|
||||
SLOT=0
|
||||
_eclasses_=eutils 6faef4c127028ccbba3a11400d24ae34 flag-o-matic eda1c0b5ba85b3eeb555a071d69eb819 multilib 3bf24e6abb9b76d9f6c20600f0b716bf toolchain-funcs 0dfbfa13f57c6184f4728d12ac002aac
|
||||
_md5_=b91eac442a9129e4da6878d2ff0c40ed
|
||||
9
sdk_container/src/third_party/portage-stable/metadata/md5-cache/sys-devel/gcc-config-1.6
vendored
Normal file
9
sdk_container/src/third_party/portage-stable/metadata/md5-cache/sys-devel/gcc-config-1.6
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
DEFINED_PHASES=compile install postinst unpack
|
||||
DESCRIPTION=utility to manage compilers
|
||||
HOMEPAGE=http://git.overlays.gentoo.org/gitweb/?p=proj/gcc-config.git
|
||||
KEYWORDS=alpha amd64 arm hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~sparc-fbsd ~x86-fbsd
|
||||
LICENSE=GPL-2
|
||||
SLOT=0
|
||||
SRC_URI=mirror://gentoo/gcc-config-1.6.tar.xz http://dev.gentoo.org/~vapier/dist/gcc-config-1.6.tar.xz
|
||||
_eclasses_=multilib 3bf24e6abb9b76d9f6c20600f0b716bf toolchain-funcs 0dfbfa13f57c6184f4728d12ac002aac unpacker f300a7ca9131b1024a79762e8edd3c52
|
||||
_md5_=3699c05b9f7187fc3a3c169dc7e3e05f
|
||||
9
sdk_container/src/third_party/portage-stable/metadata/md5-cache/sys-devel/gcc-config-1.7
vendored
Normal file
9
sdk_container/src/third_party/portage-stable/metadata/md5-cache/sys-devel/gcc-config-1.7
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
DEFINED_PHASES=compile install postinst unpack
|
||||
DESCRIPTION=utility to manage compilers
|
||||
HOMEPAGE=http://git.overlays.gentoo.org/gitweb/?p=proj/gcc-config.git
|
||||
KEYWORDS=~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd
|
||||
LICENSE=GPL-2
|
||||
SLOT=0
|
||||
SRC_URI=mirror://gentoo/gcc-config-1.7.tar.xz http://dev.gentoo.org/~vapier/dist/gcc-config-1.7.tar.xz
|
||||
_eclasses_=multilib 3bf24e6abb9b76d9f6c20600f0b716bf toolchain-funcs 0dfbfa13f57c6184f4728d12ac002aac unpacker f300a7ca9131b1024a79762e8edd3c52
|
||||
_md5_=07f41d4df96ee0aee3b752a1389b03e1
|
||||
9
sdk_container/src/third_party/portage-stable/metadata/md5-cache/sys-devel/gcc-config-1.7.1
vendored
Normal file
9
sdk_container/src/third_party/portage-stable/metadata/md5-cache/sys-devel/gcc-config-1.7.1
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
DEFINED_PHASES=compile install postinst unpack
|
||||
DESCRIPTION=utility to manage compilers
|
||||
HOMEPAGE=http://git.overlays.gentoo.org/gitweb/?p=proj/gcc-config.git
|
||||
KEYWORDS=~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd
|
||||
LICENSE=GPL-2
|
||||
SLOT=0
|
||||
SRC_URI=mirror://gentoo/gcc-config-1.7.1.tar.xz http://dev.gentoo.org/~vapier/dist/gcc-config-1.7.1.tar.xz
|
||||
_eclasses_=multilib 3bf24e6abb9b76d9f6c20600f0b716bf toolchain-funcs 0dfbfa13f57c6184f4728d12ac002aac unpacker f300a7ca9131b1024a79762e8edd3c52
|
||||
_md5_=7f7216bebf1504a599e6494bbcb6a21f
|
||||
9
sdk_container/src/third_party/portage-stable/metadata/md5-cache/sys-devel/gcc-config-1.7.2
vendored
Normal file
9
sdk_container/src/third_party/portage-stable/metadata/md5-cache/sys-devel/gcc-config-1.7.2
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
DEFINED_PHASES=compile install postinst unpack
|
||||
DESCRIPTION=utility to manage compilers
|
||||
HOMEPAGE=http://git.overlays.gentoo.org/gitweb/?p=proj/gcc-config.git
|
||||
KEYWORDS=~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd
|
||||
LICENSE=GPL-2
|
||||
SLOT=0
|
||||
SRC_URI=mirror://gentoo/gcc-config-1.7.2.tar.xz http://dev.gentoo.org/~vapier/dist/gcc-config-1.7.2.tar.xz
|
||||
_eclasses_=multilib 3bf24e6abb9b76d9f6c20600f0b716bf toolchain-funcs 0dfbfa13f57c6184f4728d12ac002aac unpacker f300a7ca9131b1024a79762e8edd3c52
|
||||
_md5_=43bf2b38db57e9cae041dcacf579fc39
|
||||
@ -1,9 +1,9 @@
|
||||
DEFINED_PHASES=compile install postinst unpack
|
||||
DESCRIPTION=utility to manage compilers
|
||||
HOMEPAGE=http://git.overlays.gentoo.org/gitweb/?p=proj/gcc-config.git
|
||||
KEYWORDS=~alpha amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd
|
||||
KEYWORDS=alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd
|
||||
LICENSE=GPL-2
|
||||
SLOT=0
|
||||
SRC_URI=mirror://gentoo/gcc-config-1.7.3.tar.xz http://dev.gentoo.org/~vapier/dist/gcc-config-1.7.3.tar.xz
|
||||
_eclasses_=multilib 3bf24e6abb9b76d9f6c20600f0b716bf toolchain-funcs 0dfbfa13f57c6184f4728d12ac002aac unpacker f300a7ca9131b1024a79762e8edd3c52
|
||||
_md5_=a592ef9d2e42f56645022b3505cc6a08
|
||||
_md5_=3af21fe42abd172adca1c35d88ab42a9
|
||||
|
||||
9
sdk_container/src/third_party/portage-stable/metadata/md5-cache/sys-devel/gcc-config-1.8
vendored
Normal file
9
sdk_container/src/third_party/portage-stable/metadata/md5-cache/sys-devel/gcc-config-1.8
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
DEFINED_PHASES=compile install postinst unpack
|
||||
DESCRIPTION=utility to manage compilers
|
||||
HOMEPAGE=http://git.overlays.gentoo.org/gitweb/?p=proj/gcc-config.git
|
||||
KEYWORDS=~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd
|
||||
LICENSE=GPL-2
|
||||
SLOT=0
|
||||
SRC_URI=mirror://gentoo/gcc-config-1.8.tar.xz http://dev.gentoo.org/~vapier/dist/gcc-config-1.8.tar.xz
|
||||
_eclasses_=multilib 3bf24e6abb9b76d9f6c20600f0b716bf toolchain-funcs 0dfbfa13f57c6184f4728d12ac002aac unpacker f300a7ca9131b1024a79762e8edd3c52
|
||||
_md5_=94671c31b79248e2e22cef600679fc85
|
||||
1081
sdk_container/src/third_party/portage-stable/sys-devel/gcc-config/ChangeLog
vendored
Normal file
1081
sdk_container/src/third_party/portage-stable/sys-devel/gcc-config/ChangeLog
vendored
Normal file
File diff suppressed because it is too large
Load Diff
@ -1 +1,44 @@
|
||||
DIST gcc-config-1.7.3.tar.xz 15088 RMD160 398c3b36813d65580dc05fffb4bbe64746259f7d SHA1 08da2330e165c4fd0be71a6728339c4cff511bdc SHA256 2c6cca69a028f157dc54e19ea10efc240e0d26824cd223b22c294c003ce9325e
|
||||
-----BEGIN PGP SIGNED MESSAGE-----
|
||||
Hash: SHA256
|
||||
|
||||
AUX gcc-config-1.4.1 21715 SHA256 0b6fd9ff44350638b45875bf8e0c020c503a814270e2093733293d87e7ea26d6 SHA512 66d3bec15bb5b461001612ab8f13bb1c64f61aaa8f2a01b1f46b7b666ddbcfd20594825da13932465618b211a2b76dfc39cc9f7e7009fdc38af0f38ace00ee7b WHIRLPOOL 0f8ef9b8628762905d9d9eaad051af4522c498672fd506aa9f6c88812638d21f06674113ab5a2029e55e5cd2528dd733e963206721271783fbb2de06a6cd08f9
|
||||
AUX gcc-config-1.5 20085 SHA256 d35d9de2c3950c036a39c184dd5ef10777925d683b8b9c7a6ef6e33cecaddde9 SHA512 71945cce94fdb41bb8f88c3d1751380154a32aa3c5aecb8ef57e354e33d6dcfea29841ee2c5d6941d6e4d055ca1c87a2bd405d2b5591eacb03959d721d9b5914 WHIRLPOOL cf8961fb4c1f7823b654c78d8394bf95fab595bfc8bbbe99ae8c77576bb190a853dcc431c64484ed1f2bdd6ee3e093ab00fd712b929331c5095a0a3fb673fddf
|
||||
AUX gcc-config-1.5.1 21018 SHA256 383c0b113548e826191842d1b5eed83303eee142fbc77547021a915f8b2a9c12 SHA512 2010eead56780da69173ad2a289d1bf54937f355a38a355be568ede6f84e828c04b1edbb532b5855e16ffd3ebe9404f08023922faa6750bc83bb54d879bce24b WHIRLPOOL e62147fcc5b0ae07a0b47e94fa57242e712c7823bd6916b1fb70b586676018e971f91f0da159c2438ca10b664b1152f907868473910257e1fe3582217b3a6fec
|
||||
AUX wrapper-1.5.1.c 9788 SHA256 991981059fdcd0a9c76d73ff2ce576e553f37ae7d3b378b92ead553963f7339a SHA512 65a5bcae53163e7b46bfb863bb93e2d4b8b44eaa7eb5d0d9a749a1c1de05e790efe9477ff822916f5d3e806f3929512f26da40562d1a2cae330cefdfb8ea0ae7 WHIRLPOOL fc1f605d498e2b55690bda24effa6dd9356c3dae180f9e2ef1bb6c955d595cd2bad6dd7a4b81c7b39dd4570184d6a0dfae01976ef845c999f3ca235356c3f44c
|
||||
AUX wrapper-1.5.2.c 8021 SHA256 5ed07f88103ecea30f66a4415421f90d1ddfdd4a902aa34a346a7883cd947e36 SHA512 650497a0101536e06c7e8842267cabe4a9032032e54d6e208bbc09fce162a8fbf9e972a43f138ce7821599c98dc7cb41ecb58316c43f69dc80b1a059a3195032 WHIRLPOOL 7940635c2d6ccee80c2a4d0a1446df02543e12e2bdf99d4f5d915ee966b7c3f7e074589cd7308f438c93a1dd9a0423a46d0b2c2aaf76543ce1456fa932358404
|
||||
DIST gcc-config-1.6.tar.xz 14232 SHA256 ca6a94d685a60e9ae5b8ff32c3173929848455a123233709ca791e72b640bf77 SHA512 d44256f67ed398c997cd8ce7f0b6e9bf5e602ee214deef3f7d53affd27693230526645627f00126e8b3492e5b1c7360d771b6138fb7cbc8145467c3a7ba0839d WHIRLPOOL 1a612ee1f652b0b73b4110e956c1559a56083fb4d4813f63ab374c6bba071954a13710555ffa93eec3dee94257d8891baa86989a41c0b72f3aef0edfe43f2f02
|
||||
DIST gcc-config-1.7.1.tar.xz 14708 SHA256 5d69148957bc48db2bf107558724d8c40701f8d27d1cfc7636f02353e9c2f79a SHA512 ed4f8c188679969c3428409813c1e78ca9fbf86f81f9a3e42489eecffc5857352b7d1fc90433679890b7c89da458ff1e2607e7a6f3578c6f65d1beaf71194d00 WHIRLPOOL 5f96a64dad21ae755270000adc1933dc5d2ccd28f5e49ecd96c36da266b2d64cbf3772045e529ffe6fc15381de26757c7ef742093262593a05608d52f8a97a78
|
||||
DIST gcc-config-1.7.2.tar.xz 15004 SHA256 2d235dfc1ff749b46ae8342dc3d30d5628f22eecd1ea665d16f90e82da88e899 SHA512 3bc2964fa9ede507a778787434e3aa64ef691616063d7d55020878eab9a8bf08ed5a6530dd36e15348927db9ce2b7fe22fa2aeb0039549a6e69ca895c087169b WHIRLPOOL 2692bd8289ae224a3011fbef94e45e7b903138cfa11dad4e27eca7a239f67a682def5563745bdebdfe05359d909d3f49142b23bc13141d4fa8528085c3a19299
|
||||
DIST gcc-config-1.7.3.tar.xz 15088 SHA256 2c6cca69a028f157dc54e19ea10efc240e0d26824cd223b22c294c003ce9325e SHA512 88b585787b5ad79017b27e68dbca6b5de96784582ee657d18562b1994bc1c27a6609b3dfcbf30f39a02b0b2886a289a1ddc955281fc60fe974436d13aa685908 WHIRLPOOL a9a45b489e34756da66e4597ba9f4fa061b5431a82310317237293a0c519c72906d14d3c72b76483c1c674bf779ac606cf85f22a5e4a4065dd92b1b91215461a
|
||||
DIST gcc-config-1.7.tar.xz 14584 SHA256 b704cb3b98c7a8f478dcc932ae7e4ac4f4f8a847bebe35f97dc45fa7a29268ee SHA512 4ab78c662feab59bc55e40b9dc63b967c1551b6d084638e2a16866488510e7c34e0b30a0bedaeae9dd806c77f79d1e31ccb834c6112794e7fbb557756f59c43d WHIRLPOOL 50415916834dc9d097e78afbc09a32a023e3542dd6ebcf60cd6c12d0e8fc484a6d63f821c9d3acf958fdaf5ce209976521bf22d3adcd5d20fa522f1f2fd38bdb
|
||||
DIST gcc-config-1.8.tar.xz 15020 SHA256 2453e2a07521b12267ca62b9b860eb2d2bc606cad0f29bf42a1c9543673f5a1b SHA512 3b84af2d961a0527834759e047330dbab7bac0ff3d6aae103f14fca2d44bd612bd4a1005649e8b4198036231ed8a8319fb13326b4d2c40474826cf53f7bc0826 WHIRLPOOL 4899bc1da43a158cc486022f68661e5318db7e4e83afdb5d892fc7ce5098a4bdb059dbab3c50e632901e577cd8760b2386da3ee24f5e944db12d3e246d9c26b6
|
||||
EBUILD gcc-config-1.4.1-r1.ebuild 1645 SHA256 f19f05b52db8eb0816ad4953ecba68a28943a6c8948439edc35c56ce18761b1d SHA512 90ba4f69e7c29792920b24f710fad21c72ac4a978b6146ebe44b9fb243148444de28da8ec847fdeafa00f8b848b018e78f3ab39fe98737b269ee7693d1cb130b WHIRLPOOL b30217616b6a03688b98b573989448532530c8c4011620957bf8e83f3e6ba48a7725eb8bd80ad86fbfd93869b1001438f39c7697631a453bc0a45d2dc17f6731
|
||||
EBUILD gcc-config-1.5-r1.ebuild 1647 SHA256 96e9b0e83ac1ce0e194f839b0dbfa713beb3951c7c53619fe80afaacba8f0c7b SHA512 cbf3e02072fa2b1c71217f3411a6b5ccfe9cf3d9d275bad7e251d94134c0c1e1430b0e830d0841a143747f67b4272ca9a31b401ddde093a2bec9714c5eb3add0 WHIRLPOOL c2b0d3bab7f801fb94337fd56cb62d27273e43738967ffa0b5d92f26c66be47de0ce0fa6f258ebcd9c8377ba59f0348d7e6145dcab7fda2437661e548760f257
|
||||
EBUILD gcc-config-1.5-r2.ebuild 1633 SHA256 5ba1ed03cb6b03399ef4781d7092a004b7fa5fb30effb9c141da847acc63051a SHA512 577580e447073686cfda617b6fe11beeba48fb9956bfb8014bc96754607d1158fad630da2b62dc59e90290e5e30c4818611b7ced7561a8a04e9f149d016ab1d8 WHIRLPOOL dcb9ece15b494df9e98609b08ed057a2b9f00fc0a5f6e8aad80fbe7d1e057ab499f4bb2d4e85e8077c0d055f79063191bfe1de50ebf30028793e130d8a78160b
|
||||
EBUILD gcc-config-1.5.1-r1.ebuild 1647 SHA256 a7794c24c16349756f5d13f25899d94477069e89ecfa76ca4952f7073a61f058 SHA512 24133b50cb6cedbbde06fb829d2cdb554d543d9656c5ce2852d8fc210c13602fc0c93d7f9195d26d393e2386370b0d423b48f6b3a51ddab43b81860c8063f626 WHIRLPOOL 0e9311354c63403085b26587a9f6776a00de8227b851d7c8a79042b8b9b0355df1332677b9e855009d8fa333556903ac56d30df778d3b886a511137abab55bc8
|
||||
EBUILD gcc-config-1.5.1.ebuild 1644 SHA256 d608e32fe85c65266178acecd5be054230e78d0ecb85779974f524fe5d10d139 SHA512 98052baa412e8d0895b7aea9fa4ddfbbf3d7e287cedc3d89486303c73be485fcf08416a5bcb1d39385544a3d4737f7c0d27eb074ac2013e82305d60a11b6a2d9 WHIRLPOOL 946cab1f1b32ac34d4d55500b8c1986756a0e1f79c17a4d4daf44d12d58ee682ef6176fcc1e8ae30e3575fd141ce843c4c0bf059133ad17f3ce2437ff3382a35
|
||||
EBUILD gcc-config-1.6.ebuild 1219 SHA256 75c42a8eb44b158f178b4f80dc2512f45c8154e546033f8b788a8cf6f6780344 SHA512 51fa367da264420cffc9adc3c1269f9bc994f260c5550a5c9f1f113f15733dc6ec5df466dc01e904ac992e84404941971ec23fe4b87e5ffef256e9b547005e1e WHIRLPOOL 2fa8f3bc17876408af9d4bd9cd5bdbccf847371dfbb6bcc268da59a3ab227f09a6e6e00e6678bfc4ca900dc479392092acf5448734aa4f2a57b51473e59948b1
|
||||
EBUILD gcc-config-1.7.1.ebuild 1244 SHA256 7af82844612a8f9fbc03824b5ebfa3f8a172a6ea70212f6dc556d591223cf7db SHA512 139394d6b956bbc2641e2c3893ff88fb100bf16be77ec140846fb7d86455c9b82fa9e87d9df5c2e2f0ca2ffc6356957a2b85e52e34dbba6f06cfb559f1ce8742 WHIRLPOOL 0243b70d4549ed528f929c35d5c557835b6a7aa86b3358ce3fe734d56980e1b372e9b8c0691ce9ee32e752b211c0ada58f988f9c59e2c4867601477e49b00e9f
|
||||
EBUILD gcc-config-1.7.2.ebuild 1244 SHA256 c3722b59b29a99d951acf7805d774992ec2b83276738baa65b8ea40fb8c87592 SHA512 fae4f14a839ad64cff3990403e00acfce8577c5bed735c345126523804585412d23fca26fd8eb9b1934ee9f32dded6551728aec3c91e0fc2c2d0364ef72228bb WHIRLPOOL 048f056965d73ef843cb695e494c1449b6d95c2f82460fc752858eb812d314a2589f69ce5c3a12a3a249b5fbe5a0c3e905f2ec2ffc92821894e3c5ee13d4a84d
|
||||
EBUILD gcc-config-1.7.3.ebuild 1238 SHA256 44a8bb4f729f9c0eb1e4d0ad34f484f373fd62ee052bce27e055a84b4b081de3 SHA512 7c2595c05c5e6bea3b1d349c7645e9ec9d54bf2ade4179f3cbb12b770d9cd390322b4acdec11e3bec2605f53fe639870c74d550d11d8d2f65e0339c1bf7643a5 WHIRLPOOL 2c622c0f1b6786ef69c50ad3ac35f69e1e3781d8a80f123b91b38e326c3ebd5a9a0f405dd8a73bf92f180d2aed10ebfbc6a17c8c5bd2a3d480290e6550dd4ea6
|
||||
EBUILD gcc-config-1.7.ebuild 1244 SHA256 9f0f7d0fd0ef62c5d3b16db643575b6854d9b50327cc8dad6b486b73fb38fb1e SHA512 dbd109a77c533988f0bf9113ac7d07fc31136f35766b4ac69beafd01d75e6307da199569cfb759e14e367fd31d4fd3fd2c0e09a0d6da7e759998e45f3b37fcf4 WHIRLPOOL 4e00f684caaf031608225fbdf34e67194b8a925a4eb8675aaeef390d2e2b3f72c1e444b6bac3e59191aaf085f4be9988be98b97e2016b6be8515922ed94e2a31
|
||||
EBUILD gcc-config-1.8.ebuild 1249 SHA256 1b05db8c3da2e242f44cea0e5f497a1e09ea620012cc2083069f69f9b7029002 SHA512 9684d96b16fc5f6d888b36381c6c9343163ed56d80f6f189378622ee0219dfe6056af852c8aa3341a621ce012b5cf3042df90ae4025356829d97f565cc37da05 WHIRLPOOL cdd3fc5f7a24a773ffb80ac2e6f6e68091e387c860805f92fba2619db406ec7517e89b3d81f4c2144b79d146b598c6ea86e213a607b752096ba54d726283d5e5
|
||||
MISC ChangeLog 39343 SHA256 dd823b4ba36b485aa658b3fda33d8eb469b02a881652fe22b8acdbd46e515005 SHA512 27941a396e545e58d0caf437434d3a3ab92c6cb364266809c84264cd6592dfd6c822be18f6c668b38541a0ddb8212778c2e4c31fb5e73772b2d85c854f724f81 WHIRLPOOL 1b13c5c47edfa825f234e77e2a8b2e2a9a0b9453efe9c8c5d9e7e2423db463a227c1d72fbb81ae5a6d32881f925c92b036cfe54e8c39910a1c6f82f353cde839
|
||||
MISC metadata.xml 162 SHA256 65a915d44de1f01d4b7f72d313b4192c38374a9835d24988c00c1e73dca5805a SHA512 2a857e10b277827773a6c7967e070d7bfff23d75f44fa4d4fa8a7339df3225e6dba512a865d91c9c55bdb013dafdce85dface1b845acfbb5473e232666cdda45 WHIRLPOOL f7586c1570803b3e646f0be89ba6c767e82ec6889ef92d15f62a38f1410ed9d82c36892e5e83f694471959783d0d5ad667f1a39b7eb51f2080c269d5fa23d819
|
||||
-----BEGIN PGP SIGNATURE-----
|
||||
Version: GnuPG v2.0.22 (GNU/Linux)
|
||||
|
||||
iQIcBAEBCAAGBQJS2fA0AAoJEPGu1DbS6WIAiCMQAJg5+g/pXzVAcqPHKI0F5ReR
|
||||
D4TVBMfddt6Q6TeBy2w9aWF5LDpPhKUOD5vDbNZFJA/saBKel8UNPQbamVDOsAS6
|
||||
SNGvMU03WuN7b7PU7vEzRu4qh5Jm824Cgz10Rd/XDMc6IbE1CPbY6D6LmCy4ya3W
|
||||
kwGbx0Y3HfPnkBm0o1I8HrJd9P17WssEAB5XlQ8XFuOR0UotsgSsc7IaobX7f8dW
|
||||
F2xo1dzv1fGWQhs/4wSnVVpj3QhH/2f5TwB/ag89EBJ3K5bM0C6mlYeDwNeqpeyV
|
||||
vh6eOQhk1sbIKdPO4/E/3SYoYa7STInAr+abx3cfK9PrrKnyXpMb5NLTTqPcne7d
|
||||
mcCMF8fpTUZRExFnMhchQla1OuemGvyWiJ3MZv3Qndbjc02b11lNq16YVk20IKG/
|
||||
RHb4qbGnHhb8ljZ+zRnBdNL7WNneaPk/5VWiSqtfP2oiSIc1dN38X/FzYbyGQ81p
|
||||
n+e/tHtPngMy+zPSVQvbsqsAqf0krd01BXxh463SsHaC0VX9OB9IOlfRWcBBTaXg
|
||||
wYYXAwGGNa9ti6uOec5rJ9qzRhgdIPjBcFD7yoXN4323xWe0MVtcW9o/KWuEXRD+
|
||||
56Tr9cLELk0T9gUGYkCAg8YGD4cU9dTt3y/1N5gWSFNvDUkswrwhKSoxAZnZGM44
|
||||
wh9/+pJtBwf4J6YT++7L
|
||||
=07Sr
|
||||
-----END PGP SIGNATURE-----
|
||||
|
||||
801
sdk_container/src/third_party/portage-stable/sys-devel/gcc-config/files/gcc-config-1.4.1
vendored
Normal file
801
sdk_container/src/third_party/portage-stable/sys-devel/gcc-config/files/gcc-config-1.4.1
vendored
Normal file
@ -0,0 +1,801 @@
|
||||
#!/bin/bash
|
||||
# Copyright 1999-2011 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
# $Header: /var/cvsroot/gentoo-x86/sys-devel/gcc-config/files/gcc-config-1.4.1,v 1.12 2011/12/07 05:42:19 vapier Exp $
|
||||
|
||||
trap ":" INT QUIT TSTP
|
||||
|
||||
argv0=${0##*/}
|
||||
source /etc/init.d/functions.sh || {
|
||||
echo "${argv0}: Could not source /etc/init.d/functions.sh!"
|
||||
exit 1
|
||||
}
|
||||
esyslog() { :; }
|
||||
umask 022
|
||||
|
||||
# *BSD are plain stupid ... copy a GNU extension but don't just copy it,
|
||||
# change it so it works differently. Wish Darwin did selective evolution
|
||||
# on software developers.
|
||||
SED=$(type -P gsed)
|
||||
SED=${SED:-$(type -P sed)}
|
||||
|
||||
GENTOO_LIBDIR="@GENTOO_LIBDIR@"
|
||||
[[ ${GENTOO_LIBDIR} == @*@ ]] && GENTOO_LIBDIR="lib"
|
||||
|
||||
usage() {
|
||||
cat << "USAGE_END"
|
||||
Usage: gcc-config [options] [CC Profile]
|
||||
Change the current cc/gcc profile, or give info about profiles.
|
||||
|
||||
Options:
|
||||
-C, --nocolor Disable color output
|
||||
-O, --use-old Use the old profile if one was selected.
|
||||
-f, --force Make sure all config files are regenerated.
|
||||
-P, --use-portage-chost Only set to given profile if its CHOST is the
|
||||
same as that set for portage in /etc/make.conf
|
||||
(or one of other portage config files...).
|
||||
-c, --get-current-profile Print current used gcc profile.
|
||||
-l, --list-profiles Print a list of available profiles.
|
||||
-S, --split-profile Split profiles into their components
|
||||
-E, --print-environ Print environment that can be used to setup the
|
||||
current gcc profile, or a specified one.
|
||||
-B, --get-bin-path Print path where binaries of the given/current
|
||||
profile are located.
|
||||
-L, --get-lib-path Print path where libraries of the given/current
|
||||
profile are located.
|
||||
-X, --get-stdcxx-incdir Print path where g++ include files of the
|
||||
given/current profile are located.
|
||||
|
||||
Profile names are of the form: <CHOST>-<gcc version>
|
||||
For example: i686-pc-linux-gnu-3.2.1
|
||||
USAGE_END
|
||||
exit $1
|
||||
}
|
||||
[[ $# -lt 1 ]] && usage 1
|
||||
|
||||
try_real_hard_to_find_CHOST() {
|
||||
#
|
||||
# First we read make.conf
|
||||
#
|
||||
|
||||
local varname=${1:-CHOST}
|
||||
local conf=${ROOT}/etc/make.conf
|
||||
local ret=$(source "${conf}" 2>/dev/null ; echo ${!varname})
|
||||
if [[ -z ${ret} ]] ; then
|
||||
# newer portage supports spaces between the var and =
|
||||
# CHOST = "this-is-retarded"
|
||||
ret=$(eval $(
|
||||
sed -n \
|
||||
-e 's:[[:space:]]::g' \
|
||||
-e "/^${varname}=/p" \
|
||||
"${conf}"
|
||||
) ; echo ${!varname}
|
||||
)
|
||||
fi
|
||||
|
||||
if [[ -n ${ret} ]] ; then
|
||||
echo ${ret}
|
||||
return 0
|
||||
fi
|
||||
|
||||
#
|
||||
# Then we try /etc/env.d/gcc/config-${CTARGET}
|
||||
#
|
||||
if [[ -s ${ROOT}/etc/env.d/gcc/config-${CTARGET} ]] ; then
|
||||
ret=$(split_gcc_ver $(eval $(<"${ROOT}"/etc/env.d/gcc/config-${CTARGET}) ; echo ${CURRENT}))
|
||||
echo ${ret% *}
|
||||
fi
|
||||
}
|
||||
|
||||
get_real_chost() {
|
||||
[[ -n ${REAL_CHOST} ]] && return 0
|
||||
|
||||
# shortcut for switching compilers in a cross chroot
|
||||
if [[ -n ${CHOST} && ${ROOT} != "/" ]] ; then
|
||||
REAL_CHOST=${CHOST}
|
||||
return 0
|
||||
fi
|
||||
|
||||
# make sure portage isnt broken
|
||||
if python -V &>/dev/null ; then
|
||||
export REAL_CHOST=$(env -i portageq envvar CHOST 2>/dev/null)
|
||||
else
|
||||
ewarn "Python seems to be broken, attempting to locate CHOST ourselves ..."
|
||||
export REAL_CHOST=$(try_real_hard_to_find_CHOST)
|
||||
fi
|
||||
|
||||
if [[ -z ${REAL_CHOST} ]] ; then
|
||||
eerror "${argv0}: Could not get portage CHOST!"
|
||||
eerror "${argv0}: You should verify that CHOST is set in one of these places:"
|
||||
eerror "${argv0}: - ${ROOT}/etc/make.conf"
|
||||
eerror "${argv0}: - active environment"
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
is_cross_compiler() {
|
||||
get_real_chost
|
||||
[[ ${CC_COMP/${REAL_CHOST}} == ${CC_COMP} ]]
|
||||
}
|
||||
|
||||
# bool files_exists(search_path, files)
|
||||
# Return shell true if the specified files exist.
|
||||
# Files with relative paths are searched for in search_path.
|
||||
# Both lists are : delimited.
|
||||
files_exist() {
|
||||
local p f ret old_IFS
|
||||
local paths=$1 files=$2
|
||||
|
||||
old_IFS=${IFS}
|
||||
export IFS=":"
|
||||
|
||||
ret=0
|
||||
for f in ${files} ; do
|
||||
if [[ ${f} == /* ]] ; then
|
||||
[[ ! -f ${f} ]] && ret=1 && break
|
||||
else
|
||||
# make sure the file exists in at least
|
||||
# one of the specified paths
|
||||
ret=1
|
||||
for p in ${paths} ; do
|
||||
[[ -f ${p}/${f} ]] && ret=0 && break
|
||||
done
|
||||
[[ ${ret} == 1 ]] && break
|
||||
fi
|
||||
done
|
||||
|
||||
export IFS=${old_IFS}
|
||||
if [[ ${ret} == 1 ]] ; then
|
||||
ewarn "Could not locate '${f}' in '${paths}'"
|
||||
fi
|
||||
return ${ret}
|
||||
}
|
||||
|
||||
switch_profile() {
|
||||
local MY_LDPATH=
|
||||
local GCC_PROFILES=
|
||||
local OLD_CC_COMP=
|
||||
local GCC_PATH=
|
||||
|
||||
if [[ $(id -u) != "0" ]] ; then
|
||||
eerror "${argv0}: Must be root."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if is_cross_compiler ; then
|
||||
ebegin "Switching cross-compiler to ${CC_COMP}"
|
||||
else
|
||||
ebegin "Switching native-compiler to ${CC_COMP}"
|
||||
fi
|
||||
|
||||
if ! is_cross_compiler ; then
|
||||
# Order our profiles to have the default first ...
|
||||
# We do this so that we can have them ordered with default
|
||||
# first in /etc/ld.so.conf, as the logical is that all
|
||||
# compilers for default CHOST will be used to compile stuff,
|
||||
# and thus we want all their lib paths in /etc/ld.so.conf ...
|
||||
get_real_chost
|
||||
GCC_PROFILES=$(LC_ALL="C" ls -r ${GCC_ENV_D}/${REAL_CHOST}-*)
|
||||
GCC_PROFILES="${GCC_ENV_D}/${CC_COMP} ${GCC_PROFILES}"
|
||||
|
||||
# Extract all LDPATH's for our CHOST
|
||||
MY_LDPATH=""
|
||||
for x in ${GCC_PROFILES} ; do
|
||||
if [[ -f ${x} ]] ; then
|
||||
LDPATH=$(source "${x}"; echo ${LDPATH})
|
||||
|
||||
# Handle LDPATH's that have multiple directories
|
||||
local old_IFS=${IFS}
|
||||
export IFS=":"
|
||||
local sub_ldpath=
|
||||
for sub_ldpath in ${LDPATH} ; do
|
||||
if [[ -d ${sub_ldpath} ]] ; then
|
||||
if [[ ${MY_LDPATH/:${sub_ldpath}} == ${MY_LDPATH} ]] ; then
|
||||
MY_LDPATH="${MY_LDPATH}:${sub_ldpath}"
|
||||
fi
|
||||
fi
|
||||
done
|
||||
export IFS=${old_IFS}
|
||||
fi
|
||||
done
|
||||
MY_LDPATH="${MY_LDPATH:1}" # trim leading :
|
||||
fi
|
||||
|
||||
# Translate old PATH/ROOTPATH to GCC_PATH
|
||||
cp -p "${GCC_ENV_D}/${CC_COMP}" "${GCC_ENV_D}/${CC_COMP}.gcc-config-ref" || return 1
|
||||
GCC_PATH=$(
|
||||
unset GCC_PATH PATH ROOTPATH
|
||||
source "${GCC_ENV_D}/${CC_COMP}"
|
||||
echo ${GCC_PATH:-${PATH:-${ROOTPATH}}}
|
||||
)
|
||||
${SED} -i \
|
||||
-e '/^PATH=/d' \
|
||||
-e '/^ROOTPATH=/d' \
|
||||
-e '/^GCC_PATH=/d' \
|
||||
"${GCC_ENV_D}/${CC_COMP}" || return 1
|
||||
echo "GCC_PATH=\"${GCC_PATH}\"" >> "${GCC_ENV_D}/${CC_COMP}" || return 1
|
||||
touch -r "${GCC_ENV_D}/${CC_COMP}.gcc-config-ref" "${GCC_ENV_D}/${CC_COMP}" || return 1
|
||||
rm -f "${GCC_ENV_D}/${CC_COMP}.gcc-config-ref" || return 1
|
||||
|
||||
# Setup things properly again for this profile
|
||||
unset GCC_SPECS LDPATH
|
||||
source "${GCC_ENV_D}/${CC_COMP}"
|
||||
OLD_CC_COMP=$(get_current_profile)
|
||||
|
||||
# What kind of env.d entry are we going to generate ?
|
||||
if is_cross_compiler ; then
|
||||
echo "PATH=\"${GCC_PATH}\"" > "${ENV_D}/05gcc-${CTARGET}"
|
||||
echo "ROOTPATH=\"${GCC_PATH}\"" >> "${ENV_D}/05gcc-${CTARGET}"
|
||||
echo "CURRENT=${CC_COMP}" > "${GCC_ENV_D}/config-${CTARGET}"
|
||||
else
|
||||
# Pass all by default
|
||||
awk '!/^(STDCXX_INCDIR|LDPATH|CC|CXX|CTARGET|GCCBITS|GCC_SPECS|GCC_PATH)=/ {print $0}' \
|
||||
"${GCC_ENV_D}/${CC_COMP}" > "${ENV_D}/05gcc-${CTARGET}"
|
||||
echo "LDPATH=\"${MY_LDPATH}\"" >> "${ENV_D}/05gcc-${CTARGET}"
|
||||
echo "PATH=\"${GCC_PATH}\"" >> "${ENV_D}/05gcc-${CTARGET}"
|
||||
echo "ROOTPATH=\"${GCC_PATH}\"" >> "${ENV_D}/05gcc-${CTARGET}"
|
||||
if [[ -n ${GCC_SPECS} ]] ; then
|
||||
if files_exist ${MY_LDPATH} ${GCC_SPECS} ; then
|
||||
echo "GCC_SPECS=\"${GCC_SPECS}\"" >> "${ENV_D}/05gcc-${CTARGET}"
|
||||
else
|
||||
echo
|
||||
ewarn "Your GCC spec configurations are broken."
|
||||
ewarn "Please re-emerge gcc."
|
||||
echo
|
||||
fi
|
||||
else
|
||||
# People need to rebuild their gcc or setting GCC_SPECS to
|
||||
# "" will cause issues again :(
|
||||
if [[ ${ROOT} != "/" ]] ; then
|
||||
echo "GCC_SPECS=\"\"" >> "${ENV_D}/05gcc-${CTARGET}"
|
||||
else
|
||||
if ! GCC_SPECS="" /usr/bin/gcc -v &>/dev/null ; then
|
||||
echo
|
||||
ewarn "Your gcc has a bug with GCC_SPECS."
|
||||
ewarn "Please re-emerge gcc."
|
||||
ewarn "http://bugs.gentoo.org/68395"
|
||||
echo
|
||||
else
|
||||
echo "GCC_SPECS=\"\"" >> "${ENV_D}/05gcc-${CTARGET}"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "CURRENT=${CC_COMP}" > "${GCC_ENV_D}/config-${CTARGET}"
|
||||
|
||||
# Help out the gcc wrapper
|
||||
rm -f "${GCC_ENV_D}/NATIVE" "${GCC_ENV_D}/.NATIVE"
|
||||
ln -sf ${CC_COMP} "${GCC_ENV_D}/.NATIVE"
|
||||
|
||||
# Punt old files
|
||||
rm -f "${ENV_D}/05gcc"
|
||||
rm -f "${ENV_D}/05gcc-${CTARGET}"-*
|
||||
rm -f "${GCC_ENV_D}/config"
|
||||
rm -f "${GCC_ENV_D}/config-${CTARGET}"-*
|
||||
fi
|
||||
|
||||
# Find the bin wrapper
|
||||
local wrapper
|
||||
for wrapper in ${GENTOO_LIBDIR} lib lib64 lib32 lib ; do
|
||||
wrapper="${ROOT}usr/${wrapper}/misc/gcc-config"
|
||||
[[ -e ${wrapper} ]] && break
|
||||
done
|
||||
|
||||
# Update the wrappers for this profile
|
||||
for x in {,${CTARGET}-}{cpp,cc,gcc,c++,g++,f77,g77,gcj,gcjh,gcov,gdc,gdmd,gfortran} ; do
|
||||
# Obviously don't want to touch native stuff for cross-compilers
|
||||
[[ ${x} != ${CTARGET}-* ]] && is_cross_compiler && continue
|
||||
|
||||
# Make sure we have no stale wrappers
|
||||
rm -f "${ROOT}/usr/bin/${x}"
|
||||
[[ ${x:${#x}-3} == "gcc" || ${x:${#x}-3} == "g++" ]] \
|
||||
&& rm -f "${ROOT}/usr/bin/${x}"{32,64}
|
||||
|
||||
# Only install a wrapper if the binary exists ...
|
||||
# We want to figure out the 'reference file' for each
|
||||
# wrapper (the binary we're 'wrapping') so that we can
|
||||
# sync mtimes together. This makes things like ccache
|
||||
# happy. See Bug #70548 for more info.
|
||||
local ref
|
||||
case ${x} in
|
||||
cc) ref=${ROOT}/${GCC_PATH}/gcc;;
|
||||
f77) ref=${ROOT}/${GCC_PATH}/g77;;
|
||||
*) ref=${ROOT}/${GCC_PATH}/${x};;
|
||||
esac
|
||||
if [[ -x ${ref} ]] ; then
|
||||
cp -f "${wrapper}" "${ROOT}/usr/bin/${x}"
|
||||
touch -r "${ref}" "${ROOT}/usr/bin/${x}"
|
||||
|
||||
# Install 32bit and 64bit wrappers if need be
|
||||
# This should probably get folded back into the wrapper ...
|
||||
if [[ ${x:${#x}-3} == "gcc" ]] || [[ ${x:${#x}-3} == "g++" ]] ; then
|
||||
for bits in ${GCCBITS} ; do
|
||||
cp -f "${wrapper}" "${ROOT}/usr/bin/${x}${bits}"
|
||||
done
|
||||
fi
|
||||
fi
|
||||
done
|
||||
# legacy cruft, make sure we dont leave it laying around #143205
|
||||
rm -f "${ROOT}/usr/bin/${CTARGET}-cc"
|
||||
# Only install cpp if switching to a native one
|
||||
if ! is_cross_compiler && [[ ${CTARGET} != *-solaris* ]] ; then
|
||||
rm -f "${ROOT}/lib/cpp"
|
||||
cp -f "${wrapper}" "${ROOT}/lib/cpp"
|
||||
fi
|
||||
|
||||
# Relocate random crap
|
||||
if ! is_cross_compiler ; then
|
||||
if [[ -e ${ROOT}/usr/${GENTOO_LIBDIR}/pkgconfig/libgcj-${CC_COMP_VERSION}.pc ]] ; then
|
||||
local mver=${CC_COMP_VERSION:0:3}
|
||||
for x in "" "-${mver}" ; do
|
||||
x="${ROOT}/usr/lib/pkgconfig/libgcj${x}.pc"
|
||||
rm -f "${x}"
|
||||
ln -s libgcj-${CC_COMP_VERSION}.pc "${x}"
|
||||
done
|
||||
fi
|
||||
fi
|
||||
|
||||
# We need to make sure that libgcc_s.so / libunwind.so make it into /lib.
|
||||
# On many systems (x86/amd64/etc...), this will probably never matter,
|
||||
# but on other systems (arm/mips/etc...), this is quite critical.
|
||||
# http://bugs.gentoo.org/60190
|
||||
#
|
||||
# The funky move magic is required for proper updating of in-use files.
|
||||
if ! is_cross_compiler ; then
|
||||
# Need to cut out extra paths in multilib case and pray the first path
|
||||
# is the "root" multilib path ... maybe some day change this to use
|
||||
# `gcc -print-file-name` ...
|
||||
LDPATH=${LDPATH%%:*}
|
||||
for multilib in $("${ROOT}/${GCC_PATH}"/gcc -print-multi-lib); do
|
||||
multiarg=${multilib#*;}
|
||||
multiarg=${multiarg/@/-}
|
||||
multilibdir=${multilib%;*}
|
||||
libdir="lib/"$("${ROOT}/${GCC_PATH}"/gcc ${multiarg} -print-multi-os-directory)
|
||||
if mkdir -p "${ROOT}/${libdir}"/.gcc.config.new ; then
|
||||
for gcclib in gcc_s unwind ; do
|
||||
if [[ -n $(ls "${ROOT}/${LDPATH}/${multilibdir}"/lib${gcclib}.so.* 2>/dev/null) ]]; then
|
||||
cp -pP "${ROOT}/${LDPATH}/${multilibdir}"/lib${gcclib}.so.* "${ROOT}/${libdir}"/.gcc.config.new/
|
||||
# no need to sanity remove this as the `mv` should take
|
||||
# care of it. we also need this step to be completly atomic
|
||||
# for systems that have even `mv` linked against libgcc_s.so.
|
||||
# http://bugs.gentoo.org/150257
|
||||
#rm -f "${ROOT}/${libdir}"/lib${gcclib}.so*
|
||||
mv -f "${ROOT}/${libdir}"/.gcc.config.new/* "${ROOT}/${libdir}"/
|
||||
fi
|
||||
done
|
||||
rmdir "${ROOT}/${libdir}"/.gcc.config.new
|
||||
fi
|
||||
done
|
||||
unset multilib
|
||||
unset multilibdir
|
||||
unset multiarg
|
||||
unset libdir
|
||||
fi
|
||||
|
||||
if [[ ${ROOT} == "/" ]] && [[ ${OLD_CC_COMP} != ${CC_COMP} || ${FORCE} == "yes" ]] ; then
|
||||
# in case python is broken ...
|
||||
if ! env-update ; then
|
||||
echo ""
|
||||
ewarn "env-update failed to work properly; making sure ld.so.conf paths"
|
||||
ewarn "are setup properly. Please rerun gcc-config with the -f option."
|
||||
echo ""
|
||||
grep -h ^LDPATH= "${ROOT}"/etc/env.d/05gcc-${CTARGET} \
|
||||
| sed -e 's:^LDPATH=::' -e 's:"::g' -e 's|:|\n|g' \
|
||||
>> /etc/ld.so.conf
|
||||
ldconfig
|
||||
fi
|
||||
fi
|
||||
|
||||
eend 0
|
||||
|
||||
if [[ ${ROOT} == "/" ]] && [[ ${OLD_CC_COMP} != ${CC_COMP} ]] ; then
|
||||
echo
|
||||
ewarn "If you intend to use the gcc from the new profile in an already"
|
||||
ewarn "running shell, please remember to do:"
|
||||
echo
|
||||
ewarn " . /etc/profile"
|
||||
echo
|
||||
fi
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
get_current_profile() {
|
||||
local conf="${GCC_ENV_D}/config"
|
||||
if [[ ! -f ${conf} ]] ; then
|
||||
conf="${GCC_ENV_D}/config-${CTARGET}"
|
||||
elif [[ -n ${CC_COMP} ]] && is_cross_compiler ; then
|
||||
conf="${conf}-${CC_COMP}"
|
||||
fi
|
||||
|
||||
if [[ ! -f ${conf} ]] ; then
|
||||
eerror "${argv0}: No gcc profile is active!"
|
||||
return 1
|
||||
fi
|
||||
|
||||
CURRENT=$(source "${conf}"; echo ${CURRENT})
|
||||
|
||||
if [[ -z ${CURRENT} ]] ; then
|
||||
eerror "${argv0}: No gcc profile is active!"
|
||||
return 1
|
||||
elif [[ ! -f ${GCC_ENV_D}/${CURRENT} ]] ; then
|
||||
eerror "${argv0}: Active gcc profile is invalid!"
|
||||
return 1
|
||||
fi
|
||||
|
||||
echo "${CURRENT}"
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
list_profiles() {
|
||||
local i=0
|
||||
local filter=
|
||||
|
||||
if [[ ${ROOT} != "/" ]] ; then
|
||||
echo "Using gcc-config info in ${ROOT}"
|
||||
fi
|
||||
|
||||
if [[ ! -f ${GCC_ENV_D}/config-${CTARGET} ]] ; then
|
||||
if ! is_cross_compiler && [[ -e ${GCC_ENV_D}/config ]] ; then
|
||||
[[ -w ${GCC_ENV_D}/config ]] && mv ${GCC_ENV_D}/config ${GCC_ENV_D}/config-${CTARGET}
|
||||
else
|
||||
eerror "${argv0}: No gcc profile is active; please select one!"
|
||||
filter=${CTARGET}
|
||||
fi
|
||||
fi
|
||||
|
||||
eval $(grep -s ^CURRENT= "${GCC_ENV_D}"/config-${CTARGET})
|
||||
CURRENT_NATIVE=${CURRENT}
|
||||
local target=
|
||||
for x in "${GCC_ENV_D}"/* ; do
|
||||
if [[ -f ${x} ]] && [[ ${x/\/config} == ${x} ]] ; then
|
||||
CTARGET=$(unset CTARGET; source "${x}"; echo ${CTARGET})
|
||||
|
||||
((++i))
|
||||
|
||||
[[ -n ${filter} ]] && [[ ${filter} != ${CTARGET:-${REAL_CHOST}} ]] && continue
|
||||
|
||||
if [[ ${target} != ${CTARGET} ]] ; then
|
||||
[[ -n ${target} ]] && echo
|
||||
target=${CTARGET}
|
||||
CTARGET=""
|
||||
fi
|
||||
|
||||
x=${x##*/}
|
||||
if [[ ${x} == ${CURRENT_NATIVE} ]] ; then
|
||||
x="${x} ${GOOD}*${NORMAL}"
|
||||
elif [[ -e ${GCC_ENV_D}/config-${target} ]] ; then
|
||||
source "${GCC_ENV_D}/config-${target}"
|
||||
[[ ${x} == ${CURRENT} ]] && x="${x} ${HILITE}*${NORMAL}"
|
||||
fi
|
||||
echo " [${i}] ${x}"
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
print_environ() {
|
||||
local GCC_PATH=
|
||||
local ENV_CMD=
|
||||
local SET_ELEMENT=
|
||||
|
||||
GCC_PATH=$(source "${GCC_ENV_D}/${CC_COMP}"; echo ${GCC_PATH:-${PATH}})
|
||||
|
||||
case ${SHELL} in
|
||||
*/csh|*/tcsh)
|
||||
ENV_CMD="setenv"
|
||||
SET_ELEMENT=" "
|
||||
;;
|
||||
*)
|
||||
ENV_CMD="export"
|
||||
SET_ELEMENT="="
|
||||
;;
|
||||
esac
|
||||
|
||||
(
|
||||
PATH=${GCC_PATH}:${PATH}
|
||||
for var in PATH GCC_SPECS ; do
|
||||
echo "${ENV_CMD} ${var}${SET_ELEMENT}\"${!var}\""
|
||||
done
|
||||
)
|
||||
}
|
||||
|
||||
get_bin_path() {
|
||||
if [[ -e ${GCC_ENV_D}/${CC_COMP} ]] ; then
|
||||
(
|
||||
unset PATH GCC_PATH
|
||||
source "${GCC_ENV_D}/${CC_COMP}"
|
||||
echo "${GCC_PATH:-${PATH}}"
|
||||
)
|
||||
else
|
||||
echo "no-config"
|
||||
echo "${GCC_ENV_D}/${CC_COMP} doesnt exist" 1>&2
|
||||
fi
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
get_lib_path() {
|
||||
if [[ -e ${GCC_ENV_D}/${CC_COMP} ]] ; then
|
||||
(
|
||||
unset LDPATH
|
||||
source "${GCC_ENV_D}/${CC_COMP}"
|
||||
echo "${LDPATH}"
|
||||
)
|
||||
else
|
||||
echo "no-config"
|
||||
echo "${GCC_ENV_D}/${CC_COMP} doesnt exist" 1>&2
|
||||
fi
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
get_stdcxx_incdir() {
|
||||
# XXX: we should prob scrub this ...
|
||||
if [[ -e ${GCC_ENV_D}/${CC_COMP} ]] ; then
|
||||
(
|
||||
unset LDPATH STDCXX_INCDIR
|
||||
source "${GCC_ENV_D}/${CC_COMP}"
|
||||
echo "${LDPATH}/include/${STDCXX_INCDIR}"
|
||||
)
|
||||
else
|
||||
echo "no-config"
|
||||
echo "${GCC_ENV_D}/${CC_COMP} doesnt exist" 1>&2
|
||||
fi
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
split_gcc_ver() {
|
||||
# Split up the gcc profile into components:
|
||||
# TARGET-VER[-specs] -> TARGET VER [specs]
|
||||
# arm-linux-3.3.6 -> arm-linux 3.3.6
|
||||
# x86_64-linux-4.0.1-pre1234 -> x86_64-linux 4.0.1-pre1234
|
||||
# sh-linux-3.4.4-hardened -> sh-linux 3.4.4 hardened
|
||||
#
|
||||
# So below we will start at the end and run a small state machine ...
|
||||
# specs [3]
|
||||
# accept everything
|
||||
# specs -> version transition [3->2]
|
||||
# when we find a version component
|
||||
# version [2]
|
||||
# accept only version components (see the regex)
|
||||
# version -> target transition [2->1]
|
||||
# when we hit a non version component
|
||||
# target [1]
|
||||
# accept everything we have left
|
||||
#
|
||||
echo "$@" | awk -F- '
|
||||
function pushit(onme, pushee) {
|
||||
return (onme == "" ? pushee : pushee"-"onme);
|
||||
}
|
||||
{
|
||||
state=3
|
||||
targ=""
|
||||
ver=""
|
||||
spec=""
|
||||
for (i=NF; i > 0; --i) {
|
||||
if (state >= 2) {
|
||||
if ($i ~ /^(alpha|beta|pre|rc|p)?[[:digit:].]+$/) {
|
||||
ver=pushit(ver, $i)
|
||||
state=2
|
||||
} else if (state == 3)
|
||||
spec=pushit(spec, $i)
|
||||
else
|
||||
state=1
|
||||
}
|
||||
if (state == 1)
|
||||
targ = pushit(targ, $i)
|
||||
}
|
||||
|
||||
if (targ == "") {
|
||||
if (ver == "") {
|
||||
ver=spec
|
||||
spec=""
|
||||
}
|
||||
targ=ver
|
||||
ver=""
|
||||
}
|
||||
print targ " " ver (spec != "" ? " " spec : "")
|
||||
}'
|
||||
}
|
||||
chop_gcc_ver_spec() {
|
||||
local splitTED=$(split_gcc_ver $@) # target ver spec
|
||||
splitTED=${splitTED#* } # ver spec
|
||||
echo ${splitTED/ /-} # ver-spec
|
||||
}
|
||||
|
||||
SET_X=false
|
||||
NEED_ACTION="yes"
|
||||
DOIT="switch_profile"
|
||||
CHECK_CHOST="no"
|
||||
FORCE="no"
|
||||
|
||||
CC_COMP=
|
||||
[[ -z ${ROOT} ]] && ROOT="/"
|
||||
[[ ${ROOT:0-1} != "/" ]] && ROOT="${ROOT}/"
|
||||
ENV_D="${ROOT}etc/env.d"
|
||||
GCC_ENV_D="${ENV_D}/gcc"
|
||||
|
||||
for x in "$@" ; do
|
||||
case "${x}" in
|
||||
# Only use specified compiler if one is not already selected.
|
||||
-O|--use-old)
|
||||
CTARGET=${CTARGET:-$(try_real_hard_to_find_CHOST)}
|
||||
if get_current_profile &>/dev/null ; then
|
||||
CC_COMP=$(get_current_profile)
|
||||
else
|
||||
eerror "No profile selected, unable to utilize --use-old"
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
-f|--force)
|
||||
FORCE="yes"
|
||||
;;
|
||||
-P|--use-portage-chost)
|
||||
CHECK_CHOST="yes"
|
||||
;;
|
||||
-c|--get-current-profile)
|
||||
if [[ ${NEED_ACTION} == "yes" ]] ; then
|
||||
NEED_ACTION="no"
|
||||
DOIT="get_current_profile"
|
||||
fi
|
||||
;;
|
||||
-l|--list-profiles)
|
||||
if [[ ${NEED_ACTION} == "yes" ]] ; then
|
||||
NEED_ACTION="no"
|
||||
DOIT="list_profiles"
|
||||
fi
|
||||
;;
|
||||
-S|--split-profile)
|
||||
if [[ ( $1 != "-S" && $1 != "--split-profile" ) || $# -eq 1 ]] ; then
|
||||
usage 1
|
||||
fi
|
||||
shift # push -S out
|
||||
for x in "$@" ; do
|
||||
split_gcc_ver ${x}
|
||||
done
|
||||
exit 0
|
||||
;;
|
||||
-E|--print-environ)
|
||||
if [[ ${NEED_ACTION} == "yes" ]] ; then
|
||||
NEED_ACTION="no"
|
||||
DOIT="print_environ"
|
||||
fi
|
||||
;;
|
||||
-B|--get-bin-path)
|
||||
if [[ ${NEED_ACTION} == "yes" ]] ; then
|
||||
NEED_ACTION="no"
|
||||
DOIT="get_bin_path"
|
||||
fi
|
||||
;;
|
||||
-L|--get-lib-path)
|
||||
if [[ ${NEED_ACTION} == "yes" ]] ; then
|
||||
NEED_ACTION="no"
|
||||
DOIT="get_lib_path"
|
||||
fi
|
||||
;;
|
||||
-X|--get-stdcxx-incdir)
|
||||
if [[ ${NEED_ACTION} == "yes" ]] ; then
|
||||
NEED_ACTION="no"
|
||||
DOIT="get_stdcxx_incdir"
|
||||
fi
|
||||
;;
|
||||
-x|--debug)
|
||||
SET_X=true
|
||||
;;
|
||||
-C|--nocolor)
|
||||
# nothing to do; functions.sh parsed this for us
|
||||
;;
|
||||
-h|--help)
|
||||
usage 0
|
||||
;;
|
||||
-V|--version)
|
||||
rcsfile="$RCSfile: gcc-config-1.4.1,v $"
|
||||
rcsfile=${rcsfile#: }
|
||||
rcsfile=${rcsfile%,v*}
|
||||
cvsrev="$Revision: 1.12 $"
|
||||
cvsrev=${cvsrev#: }
|
||||
cvsdate="$Date: 2011/12/07 05:42:19 $"
|
||||
cvsdate=${cvsdate#: }
|
||||
echo "${rcsfile} (r${cvsrev% *} @ ${cvsdate% *})"
|
||||
exit 0
|
||||
;;
|
||||
-*)
|
||||
eerror "${argv0}: Invalid switch! Run ${argv0} without parameters for help."
|
||||
exit 1
|
||||
;;
|
||||
*)
|
||||
${SET_X} && set -x
|
||||
if [[ -z ${CC_COMP} ]] ; then
|
||||
if [[ -z $(echo ${x} | tr -d '[:digit:]') ]] ; then
|
||||
# User gave us a # representing the profile
|
||||
i=1
|
||||
for y in "${GCC_ENV_D}"/* ; do
|
||||
[[ -f ${y} ]] || continue
|
||||
[[ ${y/\/config} != ${y} ]] && continue
|
||||
|
||||
if [[ -f ${y} ]] && [[ ${x} == ${i} ]] ; then
|
||||
CC_COMP=${y##*/}
|
||||
break
|
||||
fi
|
||||
((++i))
|
||||
done
|
||||
else
|
||||
# User gave us a full HOST-gccver
|
||||
x=${x##*/}
|
||||
if [[ ${DOIT} == "get_current_profile" && -z $(ls "${GCC_ENV_D}"/${x}-* 2>/dev/null) ]] || \
|
||||
[[ ${DOIT} != "get_current_profile" && ! -f ${GCC_ENV_D}/${x} ]]
|
||||
then
|
||||
# Maybe they just gave us a gccver ...
|
||||
get_real_chost
|
||||
if [[ -f ${GCC_ENV_D}/${REAL_CHOST}-${x} ]] ; then
|
||||
x=${REAL_CHOST}-${x}
|
||||
else
|
||||
eerror "${argv0}: Could not locate '$x' in '${GCC_ENV_D}/' !"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
CC_COMP=${x}
|
||||
fi
|
||||
else
|
||||
eerror "${argv0}: Too many arguments! Run ${argv0} without parameters for help."
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
${SET_X} && set -x
|
||||
|
||||
get_real_chost
|
||||
[[ ${DOIT} == "get_current_profile" ]] \
|
||||
&& CTARGET=${CTARGET:-${CC_COMP:-${REAL_CHOST}}} \
|
||||
|| CTARGET=${CTARGET:-${REAL_CHOST}}
|
||||
|
||||
if [[ ${DOIT} == "switch_profile" ]] && [[ -z ${CC_COMP} ]] ; then
|
||||
usage 1
|
||||
fi
|
||||
|
||||
if [[ -z ${CC_COMP} ]] ; then
|
||||
CC_COMP=$(get_current_profile)
|
||||
if [[ $? -ne 0 ]] ; then
|
||||
echo "${CC_COMP}"
|
||||
list_profiles
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ ${DOIT} != "get_current_profile" ]] ; then
|
||||
GCC_LIB=$(
|
||||
LDPATH=$(source "${GCC_ENV_D}/${CC_COMP}"; echo ${LDPATH})
|
||||
echo ${LDPATH} | awk -F/ '{ print "/"$2"/"$3"/"$4"/" }'
|
||||
)
|
||||
|
||||
CC_COMP_VERSION=$(chop_gcc_ver_spec ${CC_COMP})
|
||||
CC_COMP_TARGET=${CC_COMP%-${CC_COMP_VERSION}*}
|
||||
|
||||
if [[ ! -d ${ROOT}/${GCC_LIB}/${CC_COMP_TARGET}/${CC_COMP_VERSION} ]]; then
|
||||
CC_COMP_VERSION=${CC_COMP_VERSION%-*}
|
||||
fi
|
||||
|
||||
if [[ ! -d ${ROOT}/${GCC_LIB}/${CC_COMP_TARGET}/${CC_COMP_VERSION} ]] || \
|
||||
[[ ! -f ${GCC_ENV_D}/${CC_COMP} ]]
|
||||
then
|
||||
eerror "${argv0}: Profile does not exist or invalid setting for ${GCC_ENV_D}/${CC_COMP}" 1>&2
|
||||
#exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ ${CHECK_CHOST} == "yes" ]] ; then
|
||||
# Chosen CHOST are not the same as the real CHOST according to
|
||||
# make.conf, and --use-portage-chost option was given, so do nothing
|
||||
get_real_chost
|
||||
CC_COMP_VERSION=$(chop_gcc_ver_spec ${CC_COMP})
|
||||
CC_COMP_TARGET=${CC_COMP:0:${#CC_COMP}-${#CC_COMP_VERSION}-1}
|
||||
[[ ${CC_COMP_TARGET} != ${REAL_CHOST} ]] && exit 0
|
||||
fi
|
||||
|
||||
eval ${DOIT}
|
||||
|
||||
# vim:ts=4
|
||||
740
sdk_container/src/third_party/portage-stable/sys-devel/gcc-config/files/gcc-config-1.5
vendored
Executable file
740
sdk_container/src/third_party/portage-stable/sys-devel/gcc-config/files/gcc-config-1.5
vendored
Executable file
@ -0,0 +1,740 @@
|
||||
#!/bin/bash
|
||||
# Copyright 1999-2011 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
# $Header: /var/cvsroot/gentoo-x86/sys-devel/gcc-config/files/gcc-config-1.5,v 1.7 2011/12/07 05:42:19 vapier Exp $
|
||||
|
||||
# Format of /etc/env.d/gcc/:
|
||||
# config-TARGET: CURRENT=version for TARGET
|
||||
# TARGET-VER: has a TARGET and VER variable
|
||||
|
||||
: ${ROOT:=/}
|
||||
[[ ${ROOT} != */ ]] && ROOT="${ROOT}/"
|
||||
[[ ${ROOT} != /* ]] && ROOT="${PWD}${ROOT}"
|
||||
|
||||
cd /
|
||||
|
||||
trap ":" INT QUIT TSTP
|
||||
|
||||
argv0=${0##*/}
|
||||
source /etc/init.d/functions.sh || {
|
||||
echo "${argv0}: Could not source /etc/init.d/functions.sh!" 1>&2
|
||||
exit 1
|
||||
}
|
||||
esyslog() { :; }
|
||||
umask 022
|
||||
|
||||
die_eerror() {
|
||||
eerror "${argv0}: $*"
|
||||
exit 1
|
||||
}
|
||||
|
||||
# *BSD are plain stupid ... copy a GNU extension but don't just copy it,
|
||||
# change it so it works differently. Wish Darwin did selective evolution
|
||||
# on software developers.
|
||||
SED=$(type -P gsed)
|
||||
: ${SED:=$(type -P sed)}
|
||||
|
||||
# Further pain: `tac` is not available everywhere #390179
|
||||
if ! type -P tac >/dev/null ; then
|
||||
tac() { ${SED} -e '1!G;h;$!d' "$@" ; }
|
||||
fi
|
||||
|
||||
GENTOO_LIBDIR="@GENTOO_LIBDIR@"
|
||||
[[ ${GENTOO_LIBDIR} == @*@ ]] && GENTOO_LIBDIR="lib"
|
||||
|
||||
usage() {
|
||||
cat << "USAGE_END"
|
||||
Usage: gcc-config [options] [CC Profile]
|
||||
Change the current cc/gcc profile, or give info about profiles.
|
||||
|
||||
Options:
|
||||
-C, --nocolor Disable color output
|
||||
-O, --use-old Use the old profile if one was selected.
|
||||
-f, --force Make sure all config files are regenerated.
|
||||
-P, --use-portage-chost Only set to given profile if its CHOST is the
|
||||
same as that set in /etc/portage/make.conf
|
||||
(or one of other portage config files...).
|
||||
-c, --get-current-profile Print current used gcc profile.
|
||||
-l, --list-profiles Print a list of available profiles.
|
||||
-S, --split-profile Split profiles into their components
|
||||
-E, --print-environ Print environment that can be used to setup the
|
||||
current gcc profile, or a specified one.
|
||||
-B, --get-bin-path Print path where binaries of the given/current
|
||||
profile are located.
|
||||
-L, --get-lib-path Print path where libraries of the given/current
|
||||
profile are located.
|
||||
|
||||
Profile names are of the form: <CHOST>-<gcc version>
|
||||
For example: i686-pc-linux-gnu-3.2.1
|
||||
USAGE_END
|
||||
exit ${1:-1}
|
||||
}
|
||||
[[ $# -lt 1 ]] && usage 1
|
||||
|
||||
# Usage: source_var <var> <file> [default value]
|
||||
source_var() {
|
||||
unset $1
|
||||
local val=$(source "$2"; echo ${!1})
|
||||
: ${val:=$3}
|
||||
eval $1=\"${val}\"
|
||||
}
|
||||
show_var() {
|
||||
source_var "$@"
|
||||
echo "${!1}"
|
||||
}
|
||||
|
||||
try_real_hard_to_find_CHOST() {
|
||||
#
|
||||
# First we read make.conf
|
||||
#
|
||||
|
||||
local varname=${1:-CHOST}
|
||||
local conf=${ROOT}/etc/portage/make.conf
|
||||
if [[ ! -e ${conf} && -e ${ROOT}/etc/make.conf ]] ; then
|
||||
conf=${ROOT}/etc/make.conf
|
||||
fi
|
||||
local ret=$(source "${conf}" 2>/dev/null ; echo ${!varname})
|
||||
if [[ -z ${ret} ]] ; then
|
||||
# newer portage supports spaces between the var and =
|
||||
# CHOST = "this-is-retarded"
|
||||
ret=$(eval $(
|
||||
sed -n \
|
||||
-e 's:[[:space:]]::g' \
|
||||
-e "/^${varname}=/p" \
|
||||
"${conf}"
|
||||
) ; echo ${!varname}
|
||||
)
|
||||
fi
|
||||
|
||||
if [[ -n ${ret} ]] ; then
|
||||
echo ${ret}
|
||||
return 0
|
||||
fi
|
||||
|
||||
#
|
||||
# Then we try /etc/env.d/gcc/config-${CTARGET}
|
||||
#
|
||||
if [[ -s ${ROOT}/etc/env.d/gcc/config-${CTARGET} ]] ; then
|
||||
ret=$(split_gcc_ver $(show_var CURRENT "${ROOT}"/etc/env.d/gcc/config-${CTARGET}))
|
||||
echo ${ret% *}
|
||||
fi
|
||||
}
|
||||
|
||||
get_real_chost() {
|
||||
[[ -n ${REAL_CHOST} ]] && return 0
|
||||
|
||||
# shortcut for switching compilers in a cross chroot
|
||||
if [[ -n ${CHOST} && ${ROOT} != "/" ]] ; then
|
||||
REAL_CHOST=${CHOST}
|
||||
return 0
|
||||
fi
|
||||
|
||||
# make sure portage isnt broken
|
||||
if python -V &>/dev/null ; then
|
||||
export REAL_CHOST=$(env -i portageq envvar CHOST 2>/dev/null)
|
||||
else
|
||||
ewarn "Python seems to be broken, attempting to locate CHOST ourselves ..."
|
||||
export REAL_CHOST=$(try_real_hard_to_find_CHOST)
|
||||
fi
|
||||
|
||||
if [[ -z ${REAL_CHOST} ]] ; then
|
||||
eerror "${argv0}: Could not get portage CHOST!"
|
||||
eerror "${argv0}: You should verify that CHOST is set in one of these places:"
|
||||
eerror "${argv0}: - ${ROOT}/etc/portage/make.conf"
|
||||
eerror "${argv0}: - active environment"
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
is_cross_compiler() {
|
||||
get_real_chost
|
||||
[[ ${CC_COMP/${REAL_CHOST}} == ${CC_COMP} ]]
|
||||
}
|
||||
|
||||
convert_profile_paths() {
|
||||
# Older gcc's used PATH= and ROOTPATH= in the env.d files.
|
||||
# Newer one's only use GCC_PATH=. Convert old to new here.
|
||||
cp -p "${GCC_ENV_D}/${CC_COMP}" "${GCC_ENV_D}/${CC_COMP}.gcc-config-ref" || return 1
|
||||
GCC_PATH=$(
|
||||
unset GCC_PATH PATH ROOTPATH
|
||||
source "${GCC_ENV_D}/${CC_COMP}"
|
||||
echo ${GCC_PATH:-${PATH:-${ROOTPATH}}}
|
||||
)
|
||||
${SED} -i \
|
||||
-e '/^PATH=/d' \
|
||||
-e '/^ROOTPATH=/d' \
|
||||
-e '/^GCC_PATH=/d' \
|
||||
"${GCC_ENV_D}/${CC_COMP}" || return 1
|
||||
echo "GCC_PATH=\"${GCC_PATH}\"" >> "${GCC_ENV_D}/${CC_COMP}" || return 1
|
||||
touch -r "${GCC_ENV_D}/${CC_COMP}.gcc-config-ref" "${GCC_ENV_D}/${CC_COMP}" || return 1
|
||||
rm -f "${GCC_ENV_D}/${CC_COMP}.gcc-config-ref" || return 1
|
||||
return 0
|
||||
}
|
||||
|
||||
update_wrappers() {
|
||||
local CTARGET=$1
|
||||
|
||||
# Find the bin wrapper
|
||||
local wrapper
|
||||
for wrapper in ${GENTOO_LIBDIR} lib lib64 lib32 lib ; do
|
||||
wrapper="${ROOT}usr/${wrapper}/misc/gcc-config"
|
||||
[[ -e ${wrapper} ]] && break
|
||||
done
|
||||
|
||||
# Update the wrappers for this profile. We maintain this list
|
||||
# by hand as the tools that are available can come & go if the
|
||||
# user re-emerges gcc with dif USE flags. We need to clean out
|
||||
# the old wrappers if the functionality no longer exists.
|
||||
# XXX: Future work: save the list of wrappers we generated in
|
||||
# the generated env.d file so we can scrub things better.
|
||||
# After that, we can use a dynamic list based on what tools are
|
||||
# actually available in ${GCC_PATH}/.
|
||||
for x in {,${CTARGET}-}{cpp,cc,gcc,c++,g++,f77,g77,gcj,gcjh,gcov,gdc,gdmd,gfortran,gccgo} ; do
|
||||
# Obviously don't want to touch native stuff for cross-compilers
|
||||
[[ ${x} != ${CTARGET}-* ]] && is_cross_compiler && continue
|
||||
|
||||
# Make sure we have no stale wrappers
|
||||
rm -f "${ROOT}/usr/bin/${x}"
|
||||
[[ ${x:${#x}-3} == "gcc" || ${x:${#x}-3} == "g++" ]] \
|
||||
&& rm -f "${ROOT}/usr/bin/${x}"{32,64}
|
||||
|
||||
# Only install a wrapper if the binary exists ...
|
||||
# We want to figure out the 'reference file' for each
|
||||
# wrapper (the binary we're 'wrapping') so that we can
|
||||
# sync mtimes together. This makes things like ccache
|
||||
# happy. See Bug #70548 for more info.
|
||||
local ref
|
||||
case ${x} in
|
||||
cc) ref=gcc;;
|
||||
f77) ref=g77;;
|
||||
*) ref=${x};;
|
||||
esac
|
||||
ref="${ROOT}/${GCC_PATH}/${ref}"
|
||||
if [[ -x ${ref} ]] ; then
|
||||
cp -f "${wrapper}" "${ROOT}/usr/bin/${x}"
|
||||
touch -r "${ref}" "${ROOT}/usr/bin/${x}"
|
||||
fi
|
||||
done
|
||||
# legacy cruft, make sure we dont leave it laying around #143205
|
||||
rm -f "${ROOT}/usr/bin/${CTARGET}-cc"
|
||||
|
||||
# install the canonical cpp wrapper
|
||||
[[ ${CTARGET} == *-solaris* ]] && return 0
|
||||
if ! is_cross_compiler ; then
|
||||
cp -f "${wrapper}" "${ROOT}/lib/cpp"
|
||||
touch -r "${ROOT}/usr/bin/${CTARGET}-cpp" "${ROOT}/lib/cpp"
|
||||
fi
|
||||
}
|
||||
|
||||
mv_if_diff() {
|
||||
if cmp -s "$1" "$2" ; then
|
||||
rm -f "$1"
|
||||
return 0
|
||||
else
|
||||
mv -f "$1" "$2"
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
switch_profile() {
|
||||
local MY_LDPATH=
|
||||
local GCC_PROFILES=
|
||||
local OLD_CC_COMP=
|
||||
local GCC_PATH=
|
||||
|
||||
[[ $(id -u) != "0" ]] && die_eerror "Must be root"
|
||||
|
||||
if is_cross_compiler ; then
|
||||
ebegin "Switching cross-compiler to ${CC_COMP}"
|
||||
else
|
||||
ebegin "Switching native-compiler to ${CC_COMP}"
|
||||
fi
|
||||
|
||||
if egrep -q '^(PATH|ROOTPATH)=' "${GCC_ENV_D}/${CC_COMP}" ; then
|
||||
convert_profile_paths "${GCC_ENV_D}/${CC_COMP}" || return 1
|
||||
fi
|
||||
source_var GCC_PATH "${GCC_ENV_D}/${CC_COMP}"
|
||||
|
||||
# Setup things properly again for this profile
|
||||
unset GCC_SPECS LDPATH
|
||||
source "${GCC_ENV_D}/${CC_COMP}"
|
||||
# Ignore active profile errors here since we're switching away
|
||||
OLD_CC_COMP=$(get_current_profile 2>/dev/null)
|
||||
|
||||
# GCC_SPECS have long been stable, and people messing with
|
||||
# them know better than to install bad paths, so don't bother
|
||||
# with sanity checks.
|
||||
local envd="${ENV_D}/05gcc-${CTARGET}"
|
||||
cat <<-EOF > "${envd}.tmp"
|
||||
PATH="${GCC_PATH}"
|
||||
ROOTPATH="${GCC_PATH}"
|
||||
GCC_SPECS="${GCC_SPECS}"
|
||||
EOF
|
||||
echo "CURRENT=${CC_COMP}" > "${GCC_ENV_D}/config-${CTARGET}"
|
||||
if ! is_cross_compiler ; then
|
||||
# Order our profiles to have the default first ...
|
||||
# We do this so that we can have them ordered with default
|
||||
# first in /etc/ld.so.conf, as the logical is that all
|
||||
# compilers for default CHOST will be used to compile stuff,
|
||||
# and thus we want all their lib paths in /etc/ld.so.conf ...
|
||||
get_real_chost
|
||||
MY_LDPATH=$(${SED} -n \
|
||||
-e '/^LDPATH=/{s|LDPATH=||;s|"||g;s|:|\n|g;p}' \
|
||||
"${GCC_ENV_D}"/${REAL_CHOST}-* \
|
||||
"${GCC_ENV_D}"/${CC_COMP} | tac
|
||||
)
|
||||
|
||||
# Pass all by default
|
||||
awk '!/^(STDCXX_INCDIR|LDPATH|CC|CXX|CTARGET|GCCBITS|GCC_SPECS|GCC_PATH)=/ {print $0}' \
|
||||
"${GCC_ENV_D}/${CC_COMP}" >> "${envd}.tmp"
|
||||
if [[ -d ${ROOT}/etc/ld.so.conf.d ]] ; then
|
||||
echo "${MY_LDPATH}" > "${ROOT}"/etc/ld.so.conf.d/05gcc-${CTARGET}.conf
|
||||
else
|
||||
echo "LDPATH=\"${MY_LDPATH}\"" >> "${envd}.tmp"
|
||||
fi
|
||||
|
||||
# Punt old files; maybe globs too much, but oh well
|
||||
rm -f \
|
||||
"${GCC_ENV_D}/NATIVE" "${GCC_ENV_D}/.NATIVE" \
|
||||
"${ENV_D}/05gcc" "${GCC_ENV_D}/config" \
|
||||
"${ENV_D}/05gcc-${CTARGET}"-* "${GCC_ENV_D}/config-${CTARGET}"-*
|
||||
|
||||
# Help out the gcc wrapper
|
||||
ln -sf ${CC_COMP} "${GCC_ENV_D}/.NATIVE"
|
||||
|
||||
|
||||
# Relocate random crap
|
||||
if [[ -e ${ROOT}/usr/${GENTOO_LIBDIR}/pkgconfig/libgcj-${CC_COMP_VERSION}.pc ]] ; then
|
||||
local mver=${CC_COMP_VERSION:0:3}
|
||||
for x in "" "-${mver}" ; do
|
||||
x="${ROOT}/usr/lib/pkgconfig/libgcj${x}.pc"
|
||||
rm -f "${x}"
|
||||
ln -s libgcj-${CC_COMP_VERSION}.pc "${x}"
|
||||
done
|
||||
fi
|
||||
|
||||
# We need to make sure that libgcc_s.so / libunwind.so make it into /lib.
|
||||
# On many systems (x86/amd64/etc...), this will probably never matter,
|
||||
# but on other systems (arm/mips/etc...), this is quite critical.
|
||||
# http://bugs.gentoo.org/60190
|
||||
#
|
||||
# The funky move magic is required for proper updating of in-use files.
|
||||
#
|
||||
# Need to cut out extra paths in multilib case and pray the first path
|
||||
# is the "root" multilib path ... maybe some day change this to use
|
||||
# `gcc -print-file-name` ...
|
||||
LDPATH=${LDPATH%%:*}
|
||||
for multilib in $("${ROOT}/${GCC_PATH}"/gcc -print-multi-lib); do
|
||||
multiarg=${multilib#*;}
|
||||
multiarg=${multiarg/@/-}
|
||||
multilibdir=${multilib%;*}
|
||||
libdir="lib/"$("${ROOT}/${GCC_PATH}"/gcc ${multiarg} -print-multi-os-directory)
|
||||
if mkdir -p "${ROOT}/${libdir}"/.gcc.config.new ; then
|
||||
for gcclib in gcc_s unwind ; do
|
||||
if [[ -n $(ls "${ROOT}/${LDPATH}/${multilibdir}"/lib${gcclib}.so.* 2>/dev/null) ]]; then
|
||||
cp -pP "${ROOT}/${LDPATH}/${multilibdir}"/lib${gcclib}.so.* "${ROOT}/${libdir}"/.gcc.config.new/
|
||||
# no need to sanity remove this as the `mv` should take
|
||||
# care of it. we also need this step to be completly atomic
|
||||
# for systems that have even `mv` linked against libgcc_s.so.
|
||||
# http://bugs.gentoo.org/150257
|
||||
#rm -f "${ROOT}/${libdir}"/lib${gcclib}.so*
|
||||
mv -f "${ROOT}/${libdir}"/.gcc.config.new/* "${ROOT}/${libdir}"/
|
||||
fi
|
||||
done
|
||||
rmdir "${ROOT}/${libdir}"/.gcc.config.new
|
||||
fi
|
||||
done
|
||||
unset multilib
|
||||
unset multilibdir
|
||||
unset multiarg
|
||||
unset libdir
|
||||
fi
|
||||
mv_if_diff "${envd}.tmp" "${envd}"
|
||||
local envd_changed=$?
|
||||
|
||||
update_wrappers ${CTARGET}
|
||||
|
||||
if [[ ${ROOT} == "/" ]] && \
|
||||
[[ ${OLD_CC_COMP} != ${CC_COMP} || ${FORCE} == "yes" ]] && \
|
||||
[[ ${envd_changed} -eq 1 ]]
|
||||
then
|
||||
# in case python is broken ...
|
||||
if ! env-update ; then
|
||||
echo ""
|
||||
ewarn "env-update failed to work properly; making sure ld.so.conf paths"
|
||||
ewarn "are setup properly. Please rerun gcc-config with the -f option."
|
||||
echo ""
|
||||
if [[ ! -d /etc/ld.so.conf.d ]] ; then
|
||||
show_var LDPATH "${ROOT}"/etc/env.d/05gcc-${CTARGET} \
|
||||
| sed -e 's|:|\n|g' >> /etc/ld.so.conf
|
||||
fi
|
||||
ldconfig
|
||||
fi
|
||||
else
|
||||
envd_changed=0
|
||||
fi
|
||||
|
||||
eend 0
|
||||
|
||||
if [[ ${envd_changed} -ne 0 ]] ; then
|
||||
echo
|
||||
ewarn "If you intend to use the gcc from the new profile in an already"
|
||||
ewarn "running shell, please remember to do:"
|
||||
echo
|
||||
ewarn " . /etc/profile"
|
||||
echo
|
||||
fi
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
get_current_profile() {
|
||||
local conf="${GCC_ENV_D}/config-${CTARGET}"
|
||||
if [[ ! -f ${conf} ]] ; then
|
||||
conf="${GCC_ENV_D}/config" # old name
|
||||
elif [[ -n ${CC_COMP} ]] && is_cross_compiler ; then
|
||||
conf="${conf}-${CC_COMP}"
|
||||
fi
|
||||
|
||||
if [[ ! -f ${conf} ]] ; then
|
||||
eerror "${argv0}: No gcc profile is active!"
|
||||
return 1
|
||||
fi
|
||||
|
||||
source_var CURRENT "${conf}"
|
||||
|
||||
if [[ -z ${CURRENT} ]] ; then
|
||||
eerror "${argv0}: No gcc profile is active!"
|
||||
return 1
|
||||
elif [[ ! -f ${GCC_ENV_D}/${CURRENT} ]] ; then
|
||||
eerror "${argv0}: Active gcc profile is invalid!"
|
||||
return 1
|
||||
fi
|
||||
|
||||
echo "${CURRENT}"
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
list_profiles() {
|
||||
local i=0
|
||||
local filter=
|
||||
|
||||
if [[ ${ROOT} != "/" ]] ; then
|
||||
echo "Using gcc-config info in ${ROOT}"
|
||||
fi
|
||||
|
||||
if [[ ! -f ${GCC_ENV_D}/config-${CTARGET} ]] ; then
|
||||
if ! is_cross_compiler && [[ -e ${GCC_ENV_D}/config ]] ; then
|
||||
[[ -w ${GCC_ENV_D}/config ]] && mv ${GCC_ENV_D}/config ${GCC_ENV_D}/config-${CTARGET}
|
||||
else
|
||||
# get_current_profile already warns
|
||||
#eerror "${argv0}: No gcc profile is active; please select one!"
|
||||
filter=${CTARGET}
|
||||
fi
|
||||
fi
|
||||
|
||||
source_var CURRENT "${GCC_ENV_D}"/config-${CTARGET}
|
||||
CURRENT_NATIVE=${CURRENT}
|
||||
local target=
|
||||
for x in "${GCC_ENV_D}"/* ; do
|
||||
[[ -f ${x} ]] || continue
|
||||
[[ ${x} == */config* ]] && continue
|
||||
|
||||
source_var CTARGET "${x}"
|
||||
|
||||
((++i))
|
||||
|
||||
[[ -n ${filter} ]] && [[ ${filter} != ${CTARGET} ]] && continue
|
||||
|
||||
if [[ ${target} != ${CTARGET} ]] ; then
|
||||
[[ ${i} -gt 1 ]] && echo
|
||||
target=${CTARGET}
|
||||
CTARGET=""
|
||||
fi
|
||||
|
||||
x=${x##*/}
|
||||
if [[ ${x} == ${CURRENT_NATIVE} ]] ; then
|
||||
x="${x} ${GOOD}*${NORMAL}"
|
||||
elif [[ -e ${GCC_ENV_D}/config-${target} ]] ; then
|
||||
source "${GCC_ENV_D}/config-${target}"
|
||||
[[ ${x} == ${CURRENT} ]] && x="${x} ${HILITE}*${NORMAL}"
|
||||
fi
|
||||
echo " [${i}] ${x}"
|
||||
done
|
||||
}
|
||||
|
||||
print_environ() {
|
||||
local GCC_PATH=
|
||||
local ENV_CMD=
|
||||
local SET_ELEMENT=
|
||||
|
||||
source_var GCC_PATH "${GCC_ENV_D}/${CC_COMP}" "${PATH}"
|
||||
|
||||
case ${SHELL} in
|
||||
*/csh|*/tcsh)
|
||||
ENV_CMD="setenv"
|
||||
SET_ELEMENT=" "
|
||||
;;
|
||||
*)
|
||||
ENV_CMD="export"
|
||||
SET_ELEMENT="="
|
||||
;;
|
||||
esac
|
||||
|
||||
(
|
||||
PATH=${GCC_PATH}:${PATH}
|
||||
for var in PATH GCC_SPECS ; do
|
||||
echo "${ENV_CMD} ${var}${SET_ELEMENT}\"${!var}\""
|
||||
done
|
||||
)
|
||||
}
|
||||
|
||||
get_bin_path() { show_var GCC_PATH "${GCC_ENV_D}/${CC_COMP}" ; }
|
||||
get_lib_path() { show_var LDPATH "${GCC_ENV_D}/${CC_COMP}" ; }
|
||||
|
||||
split_gcc_ver() {
|
||||
# Split up the gcc profile into components:
|
||||
# TARGET-VER[-specs] -> TARGET VER [specs]
|
||||
# arm-linux-3.3.6 -> arm-linux 3.3.6
|
||||
# x86_64-linux-4.0.1-pre1234 -> x86_64-linux 4.0.1-pre1234
|
||||
# sh-linux-3.4.4-hardened -> sh-linux 3.4.4 hardened
|
||||
#
|
||||
# So below we will start at the end and run a small state machine ...
|
||||
# specs [3]
|
||||
# accept everything
|
||||
# specs -> version transition [3->2]
|
||||
# when we find a version component
|
||||
# version [2]
|
||||
# accept only version components (see the regex)
|
||||
# version -> target transition [2->1]
|
||||
# when we hit a non version component
|
||||
# target [1]
|
||||
# accept everything we have left
|
||||
#
|
||||
echo "$@" | awk -F- '
|
||||
function pushit(onme, pushee) {
|
||||
return (onme == "" ? pushee : pushee"-"onme);
|
||||
}
|
||||
{
|
||||
state=3
|
||||
targ=""
|
||||
ver=""
|
||||
spec=""
|
||||
for (i=NF; i > 0; --i) {
|
||||
if (state >= 2) {
|
||||
if ($i ~ /^(alpha|beta|pre|rc|p)?[[:digit:].]+$/) {
|
||||
ver=pushit(ver, $i)
|
||||
state=2
|
||||
} else if (state == 3)
|
||||
spec=pushit(spec, $i)
|
||||
else
|
||||
state=1
|
||||
}
|
||||
if (state == 1)
|
||||
targ = pushit(targ, $i)
|
||||
}
|
||||
|
||||
if (targ == "") {
|
||||
if (ver == "") {
|
||||
ver=spec
|
||||
spec=""
|
||||
}
|
||||
targ=ver
|
||||
ver=""
|
||||
}
|
||||
print targ " " ver (spec != "" ? " " spec : "")
|
||||
}'
|
||||
}
|
||||
chop_gcc_ver_spec() {
|
||||
local splitTED=$(split_gcc_ver $@) # target ver spec
|
||||
splitTED=${splitTED#* } # ver spec
|
||||
echo ${splitTED/ /-} # ver-spec
|
||||
}
|
||||
|
||||
SET_X=false
|
||||
NEED_ACTION="yes"
|
||||
DOIT="switch_profile"
|
||||
CHECK_CHOST="no"
|
||||
FORCE="no"
|
||||
|
||||
CC_COMP=
|
||||
ENV_D="${ROOT}etc/env.d"
|
||||
GCC_ENV_D="${ENV_D}/gcc"
|
||||
|
||||
for x in "$@" ; do
|
||||
case "${x}" in
|
||||
# Only use specified compiler if one is not already selected.
|
||||
-O|--use-old)
|
||||
: ${CTARGET:=$(try_real_hard_to_find_CHOST)}
|
||||
if get_current_profile &>/dev/null ; then
|
||||
CC_COMP=$(get_current_profile)
|
||||
else
|
||||
die_eerror "No profile selected, unable to utilize --use-old"
|
||||
fi
|
||||
;;
|
||||
-f|--force)
|
||||
FORCE="yes"
|
||||
;;
|
||||
-P|--use-portage-chost)
|
||||
CHECK_CHOST="yes"
|
||||
;;
|
||||
-c|--get-current-profile)
|
||||
if [[ ${NEED_ACTION} == "yes" ]] ; then
|
||||
NEED_ACTION="no"
|
||||
DOIT="get_current_profile"
|
||||
fi
|
||||
;;
|
||||
-l|--list-profiles)
|
||||
if [[ ${NEED_ACTION} == "yes" ]] ; then
|
||||
NEED_ACTION="no"
|
||||
DOIT="list_profiles"
|
||||
fi
|
||||
;;
|
||||
-S|--split-profile)
|
||||
if [[ ( $1 != "-S" && $1 != "--split-profile" ) || $# -eq 1 ]] ; then
|
||||
usage 1
|
||||
fi
|
||||
shift # push -S out
|
||||
for x in "$@" ; do
|
||||
split_gcc_ver ${x}
|
||||
done
|
||||
exit 0
|
||||
;;
|
||||
-E|--print-environ)
|
||||
if [[ ${NEED_ACTION} == "yes" ]] ; then
|
||||
NEED_ACTION="no"
|
||||
DOIT="print_environ"
|
||||
fi
|
||||
;;
|
||||
-B|--get-bin-path)
|
||||
if [[ ${NEED_ACTION} == "yes" ]] ; then
|
||||
NEED_ACTION="no"
|
||||
DOIT="get_bin_path"
|
||||
fi
|
||||
;;
|
||||
-L|--get-lib-path)
|
||||
if [[ ${NEED_ACTION} == "yes" ]] ; then
|
||||
NEED_ACTION="no"
|
||||
DOIT="get_lib_path"
|
||||
fi
|
||||
;;
|
||||
-x|--debug)
|
||||
SET_X=true
|
||||
;;
|
||||
-C|--nocolor)
|
||||
# nothing to do; functions.sh parsed this for us
|
||||
;;
|
||||
-h|--help)
|
||||
usage 0
|
||||
;;
|
||||
-V|--version)
|
||||
unset RCSfile Revision Date
|
||||
rcsfile="$RCSfile: gcc-config-1.5,v $"
|
||||
rcsfile=${rcsfile#: }
|
||||
rcsfile=${rcsfile%,v*}
|
||||
cvsrev="$Revision: 1.7 $"
|
||||
cvsrev=${cvsrev#: }
|
||||
cvsdate="$Date: 2011/12/07 05:42:19 $"
|
||||
cvsdate=${cvsdate#: }
|
||||
echo "${rcsfile} (r${cvsrev% *} @ ${cvsdate% *})"
|
||||
exit 0
|
||||
;;
|
||||
-*)
|
||||
die_eerror "Invalid switch! Run ${argv0} without parameters for help."
|
||||
;;
|
||||
*)
|
||||
${SET_X} && set -x
|
||||
if [[ -z ${CC_COMP} ]] ; then
|
||||
if [[ -z $(echo ${x} | tr -d '[:digit:]') ]] ; then
|
||||
# User gave us a # representing the profile
|
||||
i=1
|
||||
for y in "${GCC_ENV_D}"/* ; do
|
||||
[[ -f ${y} ]] || continue
|
||||
[[ ${y} == */config* ]] && continue
|
||||
|
||||
if [[ -f ${y} ]] && [[ ${x} == ${i} ]] ; then
|
||||
CC_COMP=${y##*/}
|
||||
break
|
||||
fi
|
||||
((++i))
|
||||
done
|
||||
if [[ -z ${CC_COMP} ]] ; then
|
||||
die_eerror "Could not locate profile #$x !"
|
||||
fi
|
||||
else
|
||||
# User gave us a full HOST-gccver
|
||||
x=${x##*/}
|
||||
if [[ ${DOIT} == "get_current_profile" && -z $(ls "${GCC_ENV_D}"/${x}-* 2>/dev/null) ]] || \
|
||||
[[ ${DOIT} != "get_current_profile" && ! -f ${GCC_ENV_D}/${x} ]]
|
||||
then
|
||||
# Maybe they just gave us a gccver ...
|
||||
get_real_chost
|
||||
if [[ -f ${GCC_ENV_D}/${REAL_CHOST}-${x} ]] ; then
|
||||
x=${REAL_CHOST}-${x}
|
||||
else
|
||||
die_eerror "Could not locate '$x' in '${GCC_ENV_D}/' !"
|
||||
fi
|
||||
fi
|
||||
CC_COMP=${x}
|
||||
fi
|
||||
else
|
||||
die_eerror "Too many arguments! Run ${argv0} without parameters for help."
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
${SET_X} && set -x
|
||||
|
||||
if [[ ${DOIT} == "switch_profile" ]] && [[ -z ${CC_COMP} ]] ; then
|
||||
usage 1
|
||||
fi
|
||||
|
||||
get_real_chost
|
||||
[[ ${DOIT} == "get_current_profile" ]] \
|
||||
&& : ${CTARGET:=${CC_COMP:-${REAL_CHOST}}} \
|
||||
|| : ${CTARGET:=${REAL_CHOST}}
|
||||
|
||||
if [[ -z ${CC_COMP} ]] ; then
|
||||
CC_COMP=$(get_current_profile)
|
||||
if [[ $? -ne 0 ]] ; then
|
||||
echo "${CC_COMP}"
|
||||
list_profiles
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ ${DOIT} != "get_current_profile" ]] ; then
|
||||
GCC_LIB=$(
|
||||
show_var LDPATH "${GCC_ENV_D}/${CC_COMP}" | \
|
||||
awk -F/ '{ print "/"$2"/"$3"/"$4"/" }'
|
||||
)
|
||||
|
||||
CC_COMP_VERSION=$(chop_gcc_ver_spec ${CC_COMP})
|
||||
CC_COMP_TARGET=${CC_COMP%-${CC_COMP_VERSION}*}
|
||||
|
||||
if [[ ! -d ${ROOT}/${GCC_LIB}/${CC_COMP_TARGET}/${CC_COMP_VERSION} ]]; then
|
||||
CC_COMP_VERSION=${CC_COMP_VERSION%-*}
|
||||
fi
|
||||
|
||||
if [[ ! -d ${ROOT}/${GCC_LIB}/${CC_COMP_TARGET}/${CC_COMP_VERSION} ]] || \
|
||||
[[ ! -f ${GCC_ENV_D}/${CC_COMP} ]]
|
||||
then
|
||||
eerror "${argv0}: Profile does not exist or invalid setting for ${GCC_ENV_D}/${CC_COMP}" 1>&2
|
||||
#exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ ${CHECK_CHOST} == "yes" ]] ; then
|
||||
# Chosen CHOST are not the same as the real CHOST according to
|
||||
# make.conf, and --use-portage-chost option was given, so do nothing
|
||||
get_real_chost
|
||||
CC_COMP_VERSION=$(chop_gcc_ver_spec ${CC_COMP})
|
||||
CC_COMP_TARGET=${CC_COMP:0:${#CC_COMP}-${#CC_COMP_VERSION}-1}
|
||||
[[ ${CC_COMP_TARGET} != ${REAL_CHOST} ]] && exit 0
|
||||
fi
|
||||
|
||||
${DOIT}
|
||||
|
||||
# vim:ts=4
|
||||
763
sdk_container/src/third_party/portage-stable/sys-devel/gcc-config/files/gcc-config-1.5.1
vendored
Executable file
763
sdk_container/src/third_party/portage-stable/sys-devel/gcc-config/files/gcc-config-1.5.1
vendored
Executable file
@ -0,0 +1,763 @@
|
||||
#!/bin/bash
|
||||
# Copyright 1999-2012 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
# $Header: /var/cvsroot/gentoo-x86/sys-devel/gcc-config/files/gcc-config-1.5.1,v 1.2 2012/03/15 01:16:44 vapier Exp $
|
||||
|
||||
# Format of /etc/env.d/gcc/:
|
||||
# config-TARGET: CURRENT=version for TARGET
|
||||
# TARGET-VER: has a TARGET and VER variable
|
||||
|
||||
: ${ROOT:=/}
|
||||
[[ ${ROOT} != */ ]] && ROOT="${ROOT}/"
|
||||
[[ ${ROOT} != /* ]] && ROOT="${PWD}${ROOT}"
|
||||
|
||||
cd /
|
||||
|
||||
trap ":" INT QUIT TSTP
|
||||
|
||||
argv0=${0##*/}
|
||||
source /etc/init.d/functions.sh || {
|
||||
echo "${argv0}: Could not source /etc/init.d/functions.sh!" 1>&2
|
||||
exit 1
|
||||
}
|
||||
esyslog() { :; }
|
||||
umask 022
|
||||
|
||||
die_eerror() {
|
||||
eerror "${argv0}: $*"
|
||||
exit 1
|
||||
}
|
||||
|
||||
# *BSD are plain stupid ... copy a GNU extension but don't just copy it,
|
||||
# change it so it works differently. Wish Darwin did selective evolution
|
||||
# on software developers.
|
||||
SED=$(type -P gsed)
|
||||
: ${SED:=$(type -P sed)}
|
||||
|
||||
# Further pain: `tac` is not available everywhere #390179
|
||||
if ! type -P tac >/dev/null ; then
|
||||
tac() { ${SED} -e '1!G;h;$!d' "$@" ; }
|
||||
fi
|
||||
|
||||
GENTOO_LIBDIR="@GENTOO_LIBDIR@"
|
||||
[[ ${GENTOO_LIBDIR} == @*@ ]] && GENTOO_LIBDIR="lib"
|
||||
|
||||
usage() {
|
||||
cat << "USAGE_END"
|
||||
Usage: gcc-config [options] [CC Profile]
|
||||
Change the current cc/gcc profile, or give info about profiles.
|
||||
|
||||
Options:
|
||||
-C, --nocolor Disable color output
|
||||
-O, --use-old Use the old profile if one was selected.
|
||||
-f, --force Make sure all config files are regenerated.
|
||||
-P, --use-portage-chost Only set to given profile if its CHOST is the
|
||||
same as that set in /etc/portage/make.conf
|
||||
(or one of other portage config files...).
|
||||
-c, --get-current-profile Print current used gcc profile.
|
||||
-l, --list-profiles Print a list of available profiles.
|
||||
-S, --split-profile Split profiles into their components
|
||||
-E, --print-environ Print environment that can be used to setup the
|
||||
current gcc profile, or a specified one.
|
||||
-B, --get-bin-path Print path where binaries of the given/current
|
||||
profile are located.
|
||||
-L, --get-lib-path Print path where libraries of the given/current
|
||||
profile are located.
|
||||
|
||||
Profile names are of the form: <CHOST>-<gcc version>
|
||||
For example: i686-pc-linux-gnu-3.2.1
|
||||
USAGE_END
|
||||
exit ${1:-1}
|
||||
}
|
||||
[[ $# -lt 1 ]] && usage 1
|
||||
|
||||
# Usage: source_var <var> <file> [default value]
|
||||
source_var() {
|
||||
unset $1
|
||||
local val=$(source "$2"; echo "${!1}")
|
||||
: ${val:=$3}
|
||||
eval $1=\"${val}\"
|
||||
}
|
||||
show_var() {
|
||||
source_var "$@"
|
||||
echo "${!1}"
|
||||
}
|
||||
|
||||
try_real_hard_to_find_CHOST() {
|
||||
#
|
||||
# First we read make.conf
|
||||
#
|
||||
|
||||
local varname=${1:-CHOST}
|
||||
local conf=${ROOT}/etc/portage/make.conf
|
||||
if [[ ! -e ${conf} && -e ${ROOT}/etc/make.conf ]] ; then
|
||||
conf=${ROOT}/etc/make.conf
|
||||
fi
|
||||
local ret=$(source "${conf}" 2>/dev/null ; echo ${!varname})
|
||||
if [[ -z ${ret} ]] ; then
|
||||
# newer portage supports spaces between the var and =
|
||||
# CHOST = "this-is-retarded"
|
||||
ret=$(eval $(
|
||||
sed -n \
|
||||
-e 's:[[:space:]]::g' \
|
||||
-e "/^${varname}=/p" \
|
||||
"${conf}"
|
||||
) ; echo ${!varname}
|
||||
)
|
||||
fi
|
||||
|
||||
if [[ -n ${ret} ]] ; then
|
||||
echo ${ret}
|
||||
return 0
|
||||
fi
|
||||
|
||||
#
|
||||
# Then we try /etc/env.d/gcc/config-${CTARGET}
|
||||
#
|
||||
if [[ -s ${ROOT}/etc/env.d/gcc/config-${CTARGET} ]] ; then
|
||||
ret=$(split_gcc_ver $(show_var CURRENT "${ROOT}"/etc/env.d/gcc/config-${CTARGET}))
|
||||
echo ${ret% *}
|
||||
fi
|
||||
}
|
||||
|
||||
get_real_chost() {
|
||||
[[ -n ${REAL_CHOST} ]] && return 0
|
||||
|
||||
# shortcut for switching compilers in a cross chroot
|
||||
if [[ -n ${CHOST} && ${ROOT} != "/" ]] ; then
|
||||
REAL_CHOST=${CHOST}
|
||||
return 0
|
||||
fi
|
||||
|
||||
# make sure portage isnt broken
|
||||
if python -V &>/dev/null ; then
|
||||
export REAL_CHOST=$(env -i portageq envvar CHOST 2>/dev/null)
|
||||
else
|
||||
ewarn "Python seems to be broken, attempting to locate CHOST ourselves ..."
|
||||
export REAL_CHOST=$(try_real_hard_to_find_CHOST)
|
||||
fi
|
||||
|
||||
if [[ -z ${REAL_CHOST} ]] ; then
|
||||
eerror "${argv0}: Could not get portage CHOST!"
|
||||
eerror "${argv0}: You should verify that CHOST is set in one of these places:"
|
||||
eerror "${argv0}: - ${ROOT}/etc/portage/make.conf"
|
||||
eerror "${argv0}: - active environment"
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
is_cross_compiler() {
|
||||
get_real_chost
|
||||
[[ ${CC_COMP/${REAL_CHOST}} == ${CC_COMP} ]]
|
||||
}
|
||||
|
||||
convert_profile_paths() {
|
||||
# Older gcc's used PATH= and ROOTPATH= in the env.d files.
|
||||
# Newer one's only use GCC_PATH=. Convert old to new here.
|
||||
cp -p "${GCC_ENV_D}/${CC_COMP}" "${GCC_ENV_D}/${CC_COMP}.gcc-config-ref" || return 1
|
||||
GCC_PATH=$(
|
||||
unset GCC_PATH PATH ROOTPATH
|
||||
source "${GCC_ENV_D}/${CC_COMP}"
|
||||
echo ${GCC_PATH:-${PATH:-${ROOTPATH}}}
|
||||
)
|
||||
${SED} -i \
|
||||
-e '/^PATH=/d' \
|
||||
-e '/^ROOTPATH=/d' \
|
||||
-e '/^GCC_PATH=/d' \
|
||||
"${GCC_ENV_D}/${CC_COMP}" || return 1
|
||||
echo "GCC_PATH=\"${GCC_PATH}\"" >> "${GCC_ENV_D}/${CC_COMP}" || return 1
|
||||
touch -r "${GCC_ENV_D}/${CC_COMP}.gcc-config-ref" "${GCC_ENV_D}/${CC_COMP}" || return 1
|
||||
rm -f "${GCC_ENV_D}/${CC_COMP}.gcc-config-ref" || return 1
|
||||
return 0
|
||||
}
|
||||
|
||||
update_wrappers() {
|
||||
local CTARGET=$1
|
||||
|
||||
# Find the bin wrapper
|
||||
local wrapper
|
||||
for wrapper in ${GENTOO_LIBDIR} lib lib64 lib32 lib ; do
|
||||
wrapper="${ROOT}usr/${wrapper}/misc/gcc-config"
|
||||
[[ -e ${wrapper} ]] && break
|
||||
done
|
||||
|
||||
# Update the wrappers for this profile. We maintain this list
|
||||
# by hand as the tools that are available can come & go if the
|
||||
# user re-emerges gcc with dif USE flags. We need to clean out
|
||||
# the old wrappers if the functionality no longer exists.
|
||||
# XXX: Future work: save the list of wrappers we generated in
|
||||
# the generated env.d file so we can scrub things better.
|
||||
# After that, we can use a dynamic list based on what tools are
|
||||
# actually available in ${GCC_PATH}/.
|
||||
for x in {,${CTARGET}-}{cpp,cc,gcc,c++,g++,f77,g77,gcj,gcjh,gcov,gdc,gdmd,gfortran,gccgo} ; do
|
||||
# Obviously don't want to touch native stuff for cross-compilers
|
||||
[[ ${x} != ${CTARGET}-* ]] && is_cross_compiler && continue
|
||||
|
||||
# Make sure we have no stale wrappers
|
||||
rm -f "${ROOT}/usr/bin/${x}"
|
||||
[[ ${x:${#x}-3} == "gcc" || ${x:${#x}-3} == "g++" ]] \
|
||||
&& rm -f "${ROOT}/usr/bin/${x}"{32,64}
|
||||
|
||||
# Only install a wrapper if the binary exists ...
|
||||
# We want to figure out the 'reference file' for each
|
||||
# wrapper (the binary we're 'wrapping') so that we can
|
||||
# sync mtimes together. This makes things like ccache
|
||||
# happy. See Bug #70548 for more info.
|
||||
local ref
|
||||
case ${x} in
|
||||
cc) ref=gcc;;
|
||||
f77) ref=g77;;
|
||||
*) ref=${x};;
|
||||
esac
|
||||
ref="${ROOT}/${GCC_PATH}/${ref}"
|
||||
if [[ -x ${ref} ]] ; then
|
||||
cp -f "${wrapper}" "${ROOT}/usr/bin/${x}"
|
||||
touch -r "${ref}" "${ROOT}/usr/bin/${x}"
|
||||
fi
|
||||
done
|
||||
# legacy cruft, make sure we dont leave it laying around #143205
|
||||
rm -f "${ROOT}/usr/bin/${CTARGET}-cc"
|
||||
|
||||
# install the canonical cpp wrapper
|
||||
[[ ${CTARGET} == *-solaris* ]] && return 0
|
||||
if ! is_cross_compiler ; then
|
||||
cp -f "${wrapper}" "${ROOT}/lib/cpp"
|
||||
touch -r "${ROOT}/usr/bin/${CTARGET}-cpp" "${ROOT}/lib/cpp"
|
||||
fi
|
||||
}
|
||||
|
||||
mv_if_diff() {
|
||||
if cmp -s "$1" "$2" ; then
|
||||
rm -f "$1"
|
||||
return 0
|
||||
else
|
||||
mv -f "$1" "$2"
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
switch_profile() {
|
||||
local GCC_PROFILES=
|
||||
local OLD_CC_COMP=
|
||||
local GCC_PATH=
|
||||
|
||||
[[ $(id -u) != "0" ]] && die_eerror "Must be root"
|
||||
|
||||
if is_cross_compiler ; then
|
||||
ebegin "Switching cross-compiler to ${CC_COMP}"
|
||||
else
|
||||
ebegin "Switching native-compiler to ${CC_COMP}"
|
||||
fi
|
||||
|
||||
if egrep -q '^(PATH|ROOTPATH)=' "${GCC_ENV_D}/${CC_COMP}" ; then
|
||||
convert_profile_paths "${GCC_ENV_D}/${CC_COMP}" || return 1
|
||||
fi
|
||||
source_var GCC_PATH "${GCC_ENV_D}/${CC_COMP}"
|
||||
|
||||
# Setup things properly again for this profile
|
||||
unset GCC_SPECS LDPATH
|
||||
source "${GCC_ENV_D}/${CC_COMP}"
|
||||
# Ignore active profile errors here since we're switching away
|
||||
OLD_CC_COMP=$(get_current_profile 2>/dev/null)
|
||||
|
||||
# GCC_SPECS have long been stable, and people messing with
|
||||
# them know better than to install bad paths, so don't bother
|
||||
# with sanity checks.
|
||||
local envd="${ENV_D}/05gcc-${CTARGET}"
|
||||
cat <<-EOF > "${envd}.tmp"
|
||||
PATH="${GCC_PATH}"
|
||||
ROOTPATH="${GCC_PATH}"
|
||||
GCC_SPECS="${GCC_SPECS}"
|
||||
EOF
|
||||
echo "CURRENT=${CC_COMP}" > "${GCC_ENV_D}/config-${CTARGET}"
|
||||
if ! is_cross_compiler ; then
|
||||
# Regardless of the profile selected, keep the runtime lookup
|
||||
# paths stable. Otherwise, all the apps that were built with
|
||||
# a new compiler will start trying to use older versions of
|
||||
# the libs, and life gets sad. We work off the assumption
|
||||
# that every shared library gcc ships is ABI compatible (as
|
||||
# is the point of SONAMEs). We don't have to worry about
|
||||
# static libraries here as gcc itself will take care of
|
||||
# linking against its own internal paths first. #297685
|
||||
local MY_LDPATH
|
||||
get_real_chost
|
||||
MY_LDPATH=$(${SED} -n \
|
||||
-e '/^LDPATH=/{s|LDPATH=||;s|"||g;s|:|\n|g;p}' \
|
||||
"${GCC_ENV_D}"/${REAL_CHOST}-* | tac
|
||||
)
|
||||
|
||||
# Pass all by default
|
||||
awk '!/^(STDCXX_INCDIR|LDPATH|CC|CXX|CTARGET|GCCBITS|GCC_SPECS|GCC_PATH)=/ {print $0}' \
|
||||
"${GCC_ENV_D}/${CC_COMP}" >> "${envd}.tmp"
|
||||
if [[ -d ${ROOT}/etc/ld.so.conf.d ]] ; then
|
||||
echo "${MY_LDPATH}" > "${ROOT}"/etc/ld.so.conf.d/05gcc-${CTARGET}.conf
|
||||
else
|
||||
echo "LDPATH=\"${MY_LDPATH}\"" >> "${envd}.tmp"
|
||||
fi
|
||||
|
||||
# Punt old files; maybe globs too much, but oh well
|
||||
rm -f \
|
||||
"${GCC_ENV_D}/NATIVE" "${GCC_ENV_D}/.NATIVE" \
|
||||
"${ENV_D}/05gcc" "${GCC_ENV_D}/config" \
|
||||
"${ENV_D}/05gcc-${CTARGET}"-* "${GCC_ENV_D}/config-${CTARGET}"-*
|
||||
|
||||
# Help out the gcc wrapper
|
||||
ln -sf ${CC_COMP} "${GCC_ENV_D}/.NATIVE"
|
||||
|
||||
# Relocate random crap
|
||||
if [[ -e ${ROOT}/usr/${GENTOO_LIBDIR}/pkgconfig/libgcj-${CC_COMP_VERSION}.pc ]] ; then
|
||||
local mver=${CC_COMP_VERSION:0:3}
|
||||
for x in "" "-${mver}" ; do
|
||||
x="${ROOT}/usr/lib/pkgconfig/libgcj${x}.pc"
|
||||
rm -f "${x}"
|
||||
ln -s libgcj-${CC_COMP_VERSION}.pc "${x}"
|
||||
done
|
||||
fi
|
||||
|
||||
# We need to make sure that libgcc_s.so / libunwind.so make it into /lib.
|
||||
# On many systems (x86/amd64/etc...), this will probably never matter,
|
||||
# but on other systems (arm/mips/etc...), this is quite critical.
|
||||
# http://bugs.gentoo.org/60190
|
||||
#
|
||||
# The funky move magic is required for proper updating of in-use files.
|
||||
#
|
||||
# XXX: This fails when configuring the native target in a cross-compiled
|
||||
# ROOT. Only way around that is to store the multilib configuration
|
||||
# in the gcc profile when we compiled it and then read that instead
|
||||
# of executing the gcc. Some day.
|
||||
#
|
||||
# We use the same ordering logic as mentioned in the MY_LDPATH setup.
|
||||
# We get the libs from the latest version available.
|
||||
local LATEST_GCC_PATH gcc LATEST_GCC_LDPATH
|
||||
|
||||
LATEST_GCC_PATH=$(gawk -F= '
|
||||
$1 == "GCC_PATH" {
|
||||
p = gensub("\"","","g",$2)
|
||||
}
|
||||
END { print p }
|
||||
' "${GCC_ENV_D}"/${REAL_CHOST}-*
|
||||
)
|
||||
gcc="${ROOT}${LATEST_GCC_PATH}/gcc"
|
||||
|
||||
local multilib
|
||||
for multilib in $("${gcc}" -print-multi-lib); do
|
||||
local multiarg=${multilib#*;}
|
||||
multiarg=${multiarg/@/-}
|
||||
local multilibdir=${multilib%;*}
|
||||
local libdir="${ROOT}lib/"$("${gcc}" ${multiarg} -print-multi-os-directory)
|
||||
|
||||
mkdir -p "${libdir}"/.gcc.config.new || continue # !?!?!
|
||||
|
||||
local gcclib
|
||||
for gcclib in gcc_s unwind ; do
|
||||
# This assumes that we always have the .so symlink,
|
||||
# but for now, that should be safe ...
|
||||
gcclib=$("${gcc}" -print-file-name="lib${gcclib}.so")
|
||||
if [[ ${gcclib} == */* ]] ; then
|
||||
cp -pP "${ROOT}${gcclib}".* "${libdir}"/.gcc.config.new/
|
||||
# no need to sanity remove this as the `mv` should take
|
||||
# care of it. we also need this step to be completly atomic
|
||||
# for systems that have even `mv` linked against libgcc_s.so.
|
||||
# http://bugs.gentoo.org/150257
|
||||
#rm -f "${libdir}"/lib${gcclib}.so*
|
||||
mv -f "${libdir}"/.gcc.config.new/* "${libdir}"/
|
||||
fi
|
||||
done
|
||||
rmdir "${libdir}"/.gcc.config.new
|
||||
done
|
||||
fi
|
||||
mv_if_diff "${envd}.tmp" "${envd}"
|
||||
local envd_changed=$?
|
||||
|
||||
update_wrappers ${CTARGET}
|
||||
|
||||
if [[ ${ROOT} == "/" ]] && \
|
||||
[[ ${OLD_CC_COMP} != ${CC_COMP} || ${FORCE} == "yes" ]] && \
|
||||
[[ ${envd_changed} -eq 1 ]]
|
||||
then
|
||||
# in case python is broken ...
|
||||
if ! env-update ; then
|
||||
echo ""
|
||||
ewarn "env-update failed to work properly; making sure ld.so.conf paths"
|
||||
ewarn "are setup properly. Please rerun gcc-config with the -f option."
|
||||
echo ""
|
||||
if [[ ! -d /etc/ld.so.conf.d ]] ; then
|
||||
show_var LDPATH "${ROOT}"/etc/env.d/05gcc-${CTARGET} \
|
||||
| sed -e 's|:|\n|g' >> /etc/ld.so.conf
|
||||
fi
|
||||
ldconfig
|
||||
fi
|
||||
else
|
||||
envd_changed=0
|
||||
fi
|
||||
|
||||
eend 0
|
||||
|
||||
if [[ ${envd_changed} -ne 0 ]] ; then
|
||||
echo
|
||||
ewarn "If you intend to use the gcc from the new profile in an already"
|
||||
ewarn "running shell, please remember to do:"
|
||||
echo
|
||||
ewarn " . /etc/profile"
|
||||
echo
|
||||
fi
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
get_current_profile() {
|
||||
local conf="${GCC_ENV_D}/config-${CTARGET}"
|
||||
if [[ ! -f ${conf} ]] ; then
|
||||
conf="${GCC_ENV_D}/config" # old name
|
||||
elif [[ -n ${CC_COMP} ]] && is_cross_compiler ; then
|
||||
conf="${conf}-${CC_COMP}"
|
||||
fi
|
||||
|
||||
if [[ ! -f ${conf} ]] ; then
|
||||
eerror "${argv0}: No gcc profile is active!"
|
||||
return 1
|
||||
fi
|
||||
|
||||
source_var CURRENT "${conf}"
|
||||
|
||||
if [[ -z ${CURRENT} ]] ; then
|
||||
eerror "${argv0}: No gcc profile is active!"
|
||||
return 1
|
||||
elif [[ ! -f ${GCC_ENV_D}/${CURRENT} ]] ; then
|
||||
eerror "${argv0}: Active gcc profile is invalid!"
|
||||
return 1
|
||||
fi
|
||||
|
||||
echo "${CURRENT}"
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
list_profiles() {
|
||||
local i=0
|
||||
local filter=
|
||||
|
||||
if [[ ${ROOT} != "/" ]] ; then
|
||||
echo "Using gcc-config info in ${ROOT}"
|
||||
fi
|
||||
|
||||
if [[ ! -f ${GCC_ENV_D}/config-${CTARGET} ]] ; then
|
||||
if ! is_cross_compiler && [[ -e ${GCC_ENV_D}/config ]] ; then
|
||||
[[ -w ${GCC_ENV_D}/config ]] && mv ${GCC_ENV_D}/config ${GCC_ENV_D}/config-${CTARGET}
|
||||
else
|
||||
# get_current_profile already warns
|
||||
#eerror "${argv0}: No gcc profile is active; please select one!"
|
||||
filter=${CTARGET}
|
||||
fi
|
||||
fi
|
||||
|
||||
source_var CURRENT "${GCC_ENV_D}"/config-${CTARGET}
|
||||
CURRENT_NATIVE=${CURRENT}
|
||||
local target=
|
||||
for x in "${GCC_ENV_D}"/* ; do
|
||||
[[ -f ${x} ]] || continue
|
||||
[[ ${x} == */config* ]] && continue
|
||||
|
||||
source_var CTARGET "${x}"
|
||||
|
||||
((++i))
|
||||
|
||||
[[ -n ${filter} ]] && [[ ${filter} != ${CTARGET} ]] && continue
|
||||
|
||||
if [[ ${target} != ${CTARGET} ]] ; then
|
||||
[[ ${i} -gt 1 ]] && echo
|
||||
target=${CTARGET}
|
||||
CTARGET=""
|
||||
fi
|
||||
|
||||
x=${x##*/}
|
||||
if [[ ${x} == ${CURRENT_NATIVE} ]] ; then
|
||||
x="${x} ${GOOD}*${NORMAL}"
|
||||
elif [[ -e ${GCC_ENV_D}/config-${target} ]] ; then
|
||||
source "${GCC_ENV_D}/config-${target}"
|
||||
[[ ${x} == ${CURRENT} ]] && x="${x} ${HILITE}*${NORMAL}"
|
||||
fi
|
||||
echo " [${i}] ${x}"
|
||||
done
|
||||
}
|
||||
|
||||
print_environ() {
|
||||
local ENV_CMD SET_ELEMENT
|
||||
case ${SHELL} in
|
||||
*/csh|*/tcsh)
|
||||
ENV_CMD="setenv"
|
||||
SET_ELEMENT=" "
|
||||
;;
|
||||
*)
|
||||
ENV_CMD="export"
|
||||
SET_ELEMENT="="
|
||||
;;
|
||||
esac
|
||||
|
||||
local var
|
||||
for var in GCC_SPECS GCC_PATH ; do
|
||||
local ${var}
|
||||
source_var ${var} "${GCC_ENV_D}/${CC_COMP}"
|
||||
done
|
||||
|
||||
(
|
||||
[[ -n ${GCC_PATH} ]] && PATH=${GCC_PATH}:${PATH}
|
||||
for var in PATH GCC_SPECS ; do
|
||||
echo "${ENV_CMD} ${var}${SET_ELEMENT}\"${!var}\""
|
||||
done
|
||||
)
|
||||
}
|
||||
|
||||
get_bin_path() { show_var GCC_PATH "${GCC_ENV_D}/${CC_COMP}" ; }
|
||||
get_lib_path() { show_var LDPATH "${GCC_ENV_D}/${CC_COMP}" ; }
|
||||
|
||||
split_gcc_ver() {
|
||||
# Split up the gcc profile into components:
|
||||
# TARGET-VER[-specs] -> TARGET VER [specs]
|
||||
# arm-linux-3.3.6 -> arm-linux 3.3.6
|
||||
# x86_64-linux-4.0.1-pre1234 -> x86_64-linux 4.0.1-pre1234
|
||||
# sh-linux-3.4.4-hardened -> sh-linux 3.4.4 hardened
|
||||
#
|
||||
# So below we will start at the end and run a small state machine ...
|
||||
# specs [3]
|
||||
# accept everything
|
||||
# specs -> version transition [3->2]
|
||||
# when we find a version component
|
||||
# version [2]
|
||||
# accept only version components (see the regex)
|
||||
# version -> target transition [2->1]
|
||||
# when we hit a non version component
|
||||
# target [1]
|
||||
# accept everything we have left
|
||||
#
|
||||
echo "$@" | awk -F- '
|
||||
function pushit(onme, pushee) {
|
||||
return (onme == "" ? pushee : pushee"-"onme);
|
||||
}
|
||||
{
|
||||
state=3
|
||||
targ=""
|
||||
ver=""
|
||||
spec=""
|
||||
for (i=NF; i > 0; --i) {
|
||||
if (state >= 2) {
|
||||
if ($i ~ /^(alpha|beta|pre|rc|p)?[[:digit:].]+$/) {
|
||||
ver=pushit(ver, $i)
|
||||
state=2
|
||||
} else if (state == 3)
|
||||
spec=pushit(spec, $i)
|
||||
else
|
||||
state=1
|
||||
}
|
||||
if (state == 1)
|
||||
targ = pushit(targ, $i)
|
||||
}
|
||||
|
||||
if (targ == "") {
|
||||
if (ver == "") {
|
||||
ver=spec
|
||||
spec=""
|
||||
}
|
||||
targ=ver
|
||||
ver=""
|
||||
}
|
||||
print targ " " ver (spec != "" ? " " spec : "")
|
||||
}'
|
||||
}
|
||||
chop_gcc_ver_spec() {
|
||||
local splitTED=$(split_gcc_ver "$@") # target ver spec
|
||||
splitTED=${splitTED#* } # ver spec
|
||||
echo ${splitTED/ /-} # ver-spec
|
||||
}
|
||||
|
||||
SET_X=false
|
||||
NEED_ACTION="yes"
|
||||
DOIT="switch_profile"
|
||||
CHECK_CHOST="no"
|
||||
FORCE="no"
|
||||
|
||||
CC_COMP=
|
||||
ENV_D="${ROOT}etc/env.d"
|
||||
GCC_ENV_D="${ENV_D}/gcc"
|
||||
|
||||
for x in "$@" ; do
|
||||
case "${x}" in
|
||||
# Only use specified compiler if one is not already selected.
|
||||
-O|--use-old)
|
||||
: ${CTARGET:=$(try_real_hard_to_find_CHOST)}
|
||||
if get_current_profile &>/dev/null ; then
|
||||
CC_COMP=$(get_current_profile)
|
||||
else
|
||||
die_eerror "No profile selected, unable to utilize --use-old"
|
||||
fi
|
||||
;;
|
||||
-f|--force)
|
||||
FORCE="yes"
|
||||
;;
|
||||
-P|--use-portage-chost)
|
||||
CHECK_CHOST="yes"
|
||||
;;
|
||||
-c|--get-current-profile)
|
||||
if [[ ${NEED_ACTION} == "yes" ]] ; then
|
||||
NEED_ACTION="no"
|
||||
DOIT="get_current_profile"
|
||||
fi
|
||||
;;
|
||||
-l|--list-profiles)
|
||||
if [[ ${NEED_ACTION} == "yes" ]] ; then
|
||||
NEED_ACTION="no"
|
||||
DOIT="list_profiles"
|
||||
fi
|
||||
;;
|
||||
-S|--split-profile)
|
||||
if [[ ( $1 != "-S" && $1 != "--split-profile" ) || $# -eq 1 ]] ; then
|
||||
usage 1
|
||||
fi
|
||||
shift # push -S out
|
||||
for x in "$@" ; do
|
||||
split_gcc_ver ${x}
|
||||
done
|
||||
exit 0
|
||||
;;
|
||||
-E|--print-environ)
|
||||
if [[ ${NEED_ACTION} == "yes" ]] ; then
|
||||
NEED_ACTION="no"
|
||||
DOIT="print_environ"
|
||||
fi
|
||||
;;
|
||||
-B|--get-bin-path)
|
||||
if [[ ${NEED_ACTION} == "yes" ]] ; then
|
||||
NEED_ACTION="no"
|
||||
DOIT="get_bin_path"
|
||||
fi
|
||||
;;
|
||||
-L|--get-lib-path)
|
||||
if [[ ${NEED_ACTION} == "yes" ]] ; then
|
||||
NEED_ACTION="no"
|
||||
DOIT="get_lib_path"
|
||||
fi
|
||||
;;
|
||||
-x|--debug)
|
||||
SET_X=true
|
||||
;;
|
||||
-C|--nocolor)
|
||||
# nothing to do; functions.sh parsed this for us
|
||||
;;
|
||||
-h|--help)
|
||||
usage 0
|
||||
;;
|
||||
-V|--version)
|
||||
unset RCSfile Revision Date
|
||||
rcsfile="$RCSfile: gcc-config-1.5.1,v $"
|
||||
rcsfile=${rcsfile#: }
|
||||
rcsfile=${rcsfile%,v*}
|
||||
cvsrev="$Revision: 1.2 $"
|
||||
cvsrev=${cvsrev#: }
|
||||
cvsdate="$Date: 2012/03/15 01:16:44 $"
|
||||
cvsdate=${cvsdate#: }
|
||||
echo "${rcsfile} (r${cvsrev% *} @ ${cvsdate% *})"
|
||||
exit 0
|
||||
;;
|
||||
-*)
|
||||
die_eerror "Invalid switch! Run ${argv0} without parameters for help."
|
||||
;;
|
||||
*)
|
||||
${SET_X} && set -x
|
||||
if [[ -z ${CC_COMP} ]] ; then
|
||||
if [[ -z $(echo ${x} | tr -d '[:digit:]') ]] ; then
|
||||
# User gave us a # representing the profile
|
||||
i=1
|
||||
for y in "${GCC_ENV_D}"/* ; do
|
||||
[[ -f ${y} ]] || continue
|
||||
[[ ${y} == */config* ]] && continue
|
||||
|
||||
if [[ -f ${y} ]] && [[ ${x} == ${i} ]] ; then
|
||||
CC_COMP=${y##*/}
|
||||
break
|
||||
fi
|
||||
((++i))
|
||||
done
|
||||
if [[ -z ${CC_COMP} ]] ; then
|
||||
die_eerror "Could not locate profile #$x !"
|
||||
fi
|
||||
else
|
||||
# User gave us a full HOST-gccver
|
||||
x=${x##*/}
|
||||
if [[ ${DOIT} == "get_current_profile" && -z $(ls "${GCC_ENV_D}"/${x}-* 2>/dev/null) ]] || \
|
||||
[[ ${DOIT} != "get_current_profile" && ! -f ${GCC_ENV_D}/${x} ]]
|
||||
then
|
||||
# Maybe they just gave us a gccver ...
|
||||
get_real_chost
|
||||
if [[ -f ${GCC_ENV_D}/${REAL_CHOST}-${x} ]] ; then
|
||||
x=${REAL_CHOST}-${x}
|
||||
else
|
||||
die_eerror "Could not locate '$x' in '${GCC_ENV_D}/' !"
|
||||
fi
|
||||
fi
|
||||
CC_COMP=${x}
|
||||
fi
|
||||
else
|
||||
die_eerror "Too many arguments! Run ${argv0} without parameters for help."
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
${SET_X} && set -x
|
||||
|
||||
if [[ ${DOIT} == "switch_profile" ]] && [[ -z ${CC_COMP} ]] ; then
|
||||
usage 1
|
||||
fi
|
||||
|
||||
get_real_chost
|
||||
[[ ${DOIT} == "get_current_profile" ]] \
|
||||
&& : ${CTARGET:=${CC_COMP:-${REAL_CHOST}}} \
|
||||
|| : ${CTARGET:=${REAL_CHOST}}
|
||||
|
||||
if [[ -z ${CC_COMP} ]] ; then
|
||||
CC_COMP=$(get_current_profile)
|
||||
if [[ $? -ne 0 ]] ; then
|
||||
echo "${CC_COMP}"
|
||||
list_profiles
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ ${DOIT} != "get_current_profile" ]] ; then
|
||||
GCC_LIB=$(get_lib_path | awk -F/ '{ print "/"$2"/"$3"/"$4"/" }')
|
||||
|
||||
# For people who insist on using funky version strings ("4.6.x"
|
||||
# rather than "4.6.2"), allow them to manually specify it.
|
||||
source_var GCC_VER "${GCC_ENV_D}/${CC_COMP}"
|
||||
|
||||
CC_COMP_VERSION=${GCC_VER:-$(chop_gcc_ver_spec ${CC_COMP})}
|
||||
CC_COMP_TARGET=$(show_var CTARGET "${GCC_ENV_D}/${CC_COMP}")
|
||||
if [[ -z ${CC_COMP_TARGET} ]] ; then
|
||||
# Native configs don't have CTARGET in there.
|
||||
CC_COMP_TARGET=${CC_COMP%-${CC_COMP_VERSION}*}
|
||||
fi
|
||||
|
||||
if [[ ! -d ${ROOT}/${GCC_LIB}/${CC_COMP_TARGET}/${CC_COMP_VERSION} ]]; then
|
||||
CC_COMP_VERSION=${CC_COMP_VERSION%-*}
|
||||
fi
|
||||
|
||||
if [[ ! -d ${ROOT}/${GCC_LIB}/${CC_COMP_TARGET}/${CC_COMP_VERSION} ]] || \
|
||||
[[ ! -f ${GCC_ENV_D}/${CC_COMP} ]]
|
||||
then
|
||||
eerror "${argv0}: Profile does not exist or invalid setting for ${GCC_ENV_D}/${CC_COMP}" 1>&2
|
||||
#exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ ${CHECK_CHOST} == "yes" ]] ; then
|
||||
# Chosen CHOST are not the same as the real CHOST according to
|
||||
# make.conf, and --use-portage-chost option was given, so do nothing
|
||||
get_real_chost
|
||||
CC_COMP_VERSION=$(chop_gcc_ver_spec ${CC_COMP})
|
||||
CC_COMP_TARGET=${CC_COMP:0:${#CC_COMP}-${#CC_COMP_VERSION}-1}
|
||||
[[ ${CC_COMP_TARGET} != ${REAL_CHOST} ]] && exit 0
|
||||
fi
|
||||
|
||||
${DOIT}
|
||||
|
||||
# vim:ts=4
|
||||
372
sdk_container/src/third_party/portage-stable/sys-devel/gcc-config/files/wrapper-1.5.1.c
vendored
Normal file
372
sdk_container/src/third_party/portage-stable/sys-devel/gcc-config/files/wrapper-1.5.1.c
vendored
Normal file
@ -0,0 +1,372 @@
|
||||
/*
|
||||
* Copyright 1999-2008 Gentoo Foundation
|
||||
* Distributed under the terms of the GNU General Public License v2
|
||||
* $Header: /var/cvsroot/gentoo-x86/sys-devel/gcc-config/files/wrapper-1.5.1.c,v 1.2 2009/01/02 00:43:32 vapier Exp $
|
||||
* Author: Martin Schlemmer <azarah@gentoo.org>
|
||||
* az's lackey: Mike Frysinger <vapier@gentoo.org>
|
||||
*/
|
||||
|
||||
#ifdef DEBUG
|
||||
# define USE_DEBUG 1
|
||||
#else
|
||||
# define USE_DEBUG 0
|
||||
#endif
|
||||
|
||||
#include <errno.h>
|
||||
#include <libgen.h>
|
||||
#include <limits.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#define GCC_CONFIG "/usr/bin/gcc-config"
|
||||
#define ENVD_BASE "/etc/env.d/05gcc"
|
||||
|
||||
#define ARRAY_SIZE(arr) (sizeof(arr)/sizeof(arr[0]))
|
||||
|
||||
/* basename(3) is allowed to modify memory */
|
||||
#undef basename
|
||||
#define basename(path) \
|
||||
({ \
|
||||
char *__path = path; \
|
||||
char *__ret = strrchr(__path, '/'); \
|
||||
__ret ? __ret + 1 : __path; \
|
||||
})
|
||||
|
||||
struct wrapper_data {
|
||||
char *name, *fullname, *bin, *path;
|
||||
};
|
||||
|
||||
static const struct {
|
||||
char *alias;
|
||||
char *target;
|
||||
} wrapper_aliases[] = {
|
||||
{ "cc", "gcc" },
|
||||
{ "f77", "g77" },
|
||||
};
|
||||
|
||||
#define wrapper_warn(fmt, ...) fprintf(stderr, "%s" fmt "\n", "gcc-config: ", ## __VA_ARGS__)
|
||||
#define wrapper_err(fmt, ...) ({ wrapper_warn("%s" fmt, "error: ", ## __VA_ARGS__); exit(1); })
|
||||
#define wrapper_errp(fmt, ...) wrapper_err(fmt ": %s", ## __VA_ARGS__, strerror(errno))
|
||||
#define wrapper_dbg(fmt, ...) ({ if (USE_DEBUG) wrapper_warn(fmt, ## __VA_ARGS__); })
|
||||
|
||||
#define xmemwrap(func, proto, use) \
|
||||
static void *x ## func proto \
|
||||
{ \
|
||||
void *ret = func use; \
|
||||
if (!ret) \
|
||||
wrapper_err(#func "%s", ": out of memory"); \
|
||||
return ret; \
|
||||
}
|
||||
xmemwrap(malloc, (size_t size), (size))
|
||||
xmemwrap(calloc, (size_t nemb, size_t size), (nemb, size))
|
||||
xmemwrap(strdup, (const char *s), (s))
|
||||
|
||||
/* check_for_target checks in path for the file we are seeking
|
||||
* it returns 1 if found (with data->bin setup), 0 if not and
|
||||
* negative on error
|
||||
*/
|
||||
static int check_for_target(char *path, struct wrapper_data *data)
|
||||
{
|
||||
struct stat sbuf;
|
||||
char str[PATH_MAX + 1];
|
||||
size_t path_len = strlen(path);
|
||||
size_t len = path_len + strlen(data->name) + 2;
|
||||
|
||||
if (sizeof(str) < len)
|
||||
wrapper_warn("path too long: %s", path);
|
||||
|
||||
strcpy(str, path);
|
||||
str[path_len] = '/';
|
||||
str[path_len+1] = '\0';
|
||||
strcat(str, data->name);
|
||||
|
||||
/* Stat possible file to check that
|
||||
* 1) it exist and is a regular file, and
|
||||
* 2) it is not the wrapper itself, and
|
||||
* 3) it is in a /gcc-bin/ directory tree
|
||||
*/
|
||||
if (strcmp(str, data->fullname) != 0 &&
|
||||
strstr(str, "/gcc-bin/") != NULL &&
|
||||
stat(str, &sbuf) == 0 &&
|
||||
(S_ISREG(sbuf.st_mode) || S_ISLNK(sbuf.st_mode)))
|
||||
{
|
||||
wrapper_dbg("%s: found in %s", data->name, path);
|
||||
data->bin = xstrdup(str);
|
||||
return 1;
|
||||
}
|
||||
|
||||
wrapper_dbg("%s: did not find in %s", data->name, path);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int find_target_in_path(struct wrapper_data *data)
|
||||
{
|
||||
char *token = NULL, *state;
|
||||
char *str;
|
||||
|
||||
if (data->path == NULL)
|
||||
return 0;
|
||||
|
||||
/* Make a copy since strtok_r will modify path */
|
||||
str = xstrdup(data->path);
|
||||
|
||||
/* Find the first file with suitable name in PATH. The idea here is
|
||||
* that we do not want to bind ourselfs to something static like the
|
||||
* default profile, or some odd environment variable, but want to be
|
||||
* able to build something with a non default gcc by just tweaking
|
||||
* the PATH ... */
|
||||
token = strtok_r(str, ":", &state);
|
||||
while (token != NULL) {
|
||||
if (check_for_target(token, data))
|
||||
return 1;
|
||||
token = strtok_r(NULL, ":", &state);
|
||||
}
|
||||
|
||||
wrapper_dbg("%s: did not find in PATH", data->name);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* find_target_in_envd parses /etc/env.d/05gcc, and tries to
|
||||
* extract PATH, which is set to the current profile's bin
|
||||
* directory ...
|
||||
*/
|
||||
static int find_target_in_envd(struct wrapper_data *data, int cross_compile)
|
||||
{
|
||||
FILE *envfile = NULL;
|
||||
char *token = NULL, *state;
|
||||
char str[PATH_MAX + 1];
|
||||
char *strp = str;
|
||||
char envd_file[PATH_MAX + 1];
|
||||
|
||||
if (!cross_compile) {
|
||||
/* for the sake of speed, we'll keep a symlink around for
|
||||
* the native compiler. #190260
|
||||
*/
|
||||
snprintf(envd_file, sizeof(envd_file)-1, "/etc/env.d/gcc/.NATIVE");
|
||||
} else {
|
||||
char *ctarget, *end = strrchr(data->name, '-');
|
||||
if (end == NULL)
|
||||
return 0;
|
||||
ctarget = xstrdup(data->name);
|
||||
ctarget[end - data->name] = '\0';
|
||||
snprintf(envd_file, PATH_MAX, "%s-%s", ENVD_BASE, ctarget);
|
||||
free(ctarget);
|
||||
}
|
||||
|
||||
envfile = fopen(envd_file, "r");
|
||||
if (envfile == NULL)
|
||||
return 0;
|
||||
|
||||
while (fgets(strp, PATH_MAX, envfile) != NULL) {
|
||||
/* Keep reading ENVD_FILE until we get a line that
|
||||
* starts with 'GCC_PATH=' ... keep 'PATH=' around
|
||||
* for older gcc versions.
|
||||
*/
|
||||
if (strncmp(strp, "GCC_PATH=", strlen("GCC_PATH=")) &&
|
||||
strncmp(strp, "PATH=", strlen("PATH=")))
|
||||
continue;
|
||||
|
||||
token = strtok_r(strp, "=", &state);
|
||||
if ((token != NULL) && token[0])
|
||||
/* The second token should be the value of PATH .. */
|
||||
token = strtok_r(NULL, "=", &state);
|
||||
else
|
||||
goto bail;
|
||||
|
||||
if ((token != NULL) && token[0]) {
|
||||
strp = token;
|
||||
/* A bash variable may be unquoted, quoted with " or
|
||||
* quoted with ', so extract the value without those ..
|
||||
*/
|
||||
token = strtok(strp, "\n\"\'");
|
||||
|
||||
while (token != NULL) {
|
||||
if (check_for_target(token, data)) {
|
||||
fclose(envfile);
|
||||
return 1;
|
||||
}
|
||||
|
||||
token = strtok(NULL, "\n\"\'");
|
||||
}
|
||||
}
|
||||
|
||||
strp = str;
|
||||
}
|
||||
|
||||
bail:
|
||||
fclose(envfile);
|
||||
return (cross_compile ? 0 : find_target_in_envd(data, 1));
|
||||
}
|
||||
|
||||
static void find_wrapper_target(struct wrapper_data *data)
|
||||
{
|
||||
if (find_target_in_path(data))
|
||||
return;
|
||||
|
||||
if (find_target_in_envd(data, 0))
|
||||
return;
|
||||
|
||||
/* Only our wrapper is in PATH, so get the CC path using
|
||||
* gcc-config and execute the real binary in there ...
|
||||
*/
|
||||
FILE *inpipe = popen(GCC_CONFIG " --get-bin-path", "r");
|
||||
if (inpipe == NULL)
|
||||
wrapper_errp("could not open pipe");
|
||||
|
||||
char str[PATH_MAX + 1];
|
||||
if (fgets(str, PATH_MAX, inpipe) == 0)
|
||||
wrapper_errp("could not get compiler binary path");
|
||||
|
||||
/* chomp! */
|
||||
size_t plen = strlen(str);
|
||||
if (str[plen-1] == '\n')
|
||||
str[plen-1] = '\0';
|
||||
|
||||
data->bin = xmalloc(plen + 1 + strlen(data->name) + 1);
|
||||
sprintf(data->bin, "%s/%s", str, data->name);
|
||||
|
||||
pclose(inpipe);
|
||||
}
|
||||
|
||||
/* This function modifies PATH to have gcc's bin path appended */
|
||||
static void modify_path(struct wrapper_data *data)
|
||||
{
|
||||
char *newpath = NULL, *token = NULL, *state;
|
||||
char dname_data[PATH_MAX + 1], str[PATH_MAX + 1];
|
||||
char *str2 = dname_data, *dname = dname_data;
|
||||
size_t len = 0;
|
||||
|
||||
if (data->bin == NULL)
|
||||
return;
|
||||
|
||||
if (data->path == NULL)
|
||||
return;
|
||||
|
||||
snprintf(str2, PATH_MAX + 1, "%s", data->bin);
|
||||
|
||||
if ((dname = dirname(str2)) == NULL)
|
||||
return;
|
||||
|
||||
/* Make a copy since strtok_r will modify path */
|
||||
snprintf(str, PATH_MAX + 1, "%s", data->path);
|
||||
|
||||
token = strtok_r(str, ":", &state);
|
||||
|
||||
/* Check if we already appended our bin location to PATH */
|
||||
if ((token != NULL) && token[0])
|
||||
if (!strcmp(token, dname))
|
||||
return;
|
||||
|
||||
len = strlen(dname) + strlen(data->path) + 2 + strlen("PATH") + 1;
|
||||
|
||||
newpath = xmalloc(len);
|
||||
memset(newpath, 0, len);
|
||||
|
||||
snprintf(newpath, len, "PATH=%s:%s", dname, data->path);
|
||||
putenv(newpath);
|
||||
}
|
||||
|
||||
static char *abi_flags[] = {
|
||||
"-m32", "-m64", "-mabi",
|
||||
};
|
||||
static char **build_new_argv(char **argv, const char *newflags_str)
|
||||
{
|
||||
#define MAX_NEWFLAGS 32
|
||||
char *newflags[MAX_NEWFLAGS];
|
||||
char **retargv;
|
||||
unsigned int argc, i;
|
||||
char *state, *flags_tokenized;
|
||||
|
||||
retargv = argv;
|
||||
|
||||
/* make sure user hasn't specified any ABI flags already ...
|
||||
* if they have, lets just get out of here ... this of course
|
||||
* is by no means complete, it's merely a hack that works most
|
||||
* of the time ...
|
||||
*/
|
||||
for (argc = 0; argv[argc]; ++argc)
|
||||
for (i = 0; i < ARRAY_SIZE(abi_flags); ++i)
|
||||
if (!strncmp(argv[argc], abi_flags[i], strlen(abi_flags[i])))
|
||||
return retargv;
|
||||
|
||||
/* Tokenize the flag list and put it into newflags array */
|
||||
flags_tokenized = xstrdup(newflags_str);
|
||||
i = 0;
|
||||
newflags[i] = strtok_r(flags_tokenized, " \t\n", &state);
|
||||
while (newflags[i] != NULL && i < MAX_NEWFLAGS-1)
|
||||
newflags[++i] = strtok_r(NULL, " \t\n", &state);
|
||||
|
||||
/* allocate memory for our spiffy new argv */
|
||||
retargv = xcalloc(argc + i + 1, sizeof(char*));
|
||||
/* start building retargv */
|
||||
retargv[0] = argv[0];
|
||||
/* insert the ABI flags first so cmdline always overrides ABI flags */
|
||||
memcpy(retargv+1, newflags, i * sizeof(char*));
|
||||
/* copy over the old argv */
|
||||
if (argc > 1)
|
||||
memcpy(retargv+1+i, argv+1, (argc-1) * sizeof(char*));
|
||||
|
||||
return retargv;
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
struct wrapper_data data;
|
||||
|
||||
memset(&data, 0, sizeof(data));
|
||||
|
||||
if (getenv("PATH"))
|
||||
data.path = xstrdup(getenv("PATH"));
|
||||
|
||||
/* What should we find ? */
|
||||
data.name = basename(argv[0]);
|
||||
|
||||
/* Allow for common compiler names like cc->gcc */
|
||||
size_t i;
|
||||
for (i = 0; i < ARRAY_SIZE(wrapper_aliases); ++i)
|
||||
if (!strcmp(data.name, wrapper_aliases[i].alias))
|
||||
data.name = wrapper_aliases[i].target;
|
||||
|
||||
/* What is the full name of our wrapper? */
|
||||
data.fullname = xmalloc(strlen(data.name) + sizeof("/usr/bin/") + 1);
|
||||
sprintf(data.fullname, "/usr/bin/%s", data.name);
|
||||
|
||||
find_wrapper_target(&data);
|
||||
|
||||
modify_path(&data);
|
||||
|
||||
free(data.path);
|
||||
data.path = NULL;
|
||||
|
||||
/* Set argv[0] to the correct binary, else gcc can't find internal headers
|
||||
* http://bugs.gentoo.org/8132
|
||||
*/
|
||||
argv[0] = data.bin;
|
||||
|
||||
/* If $ABI is in env, add appropriate env flags */
|
||||
char **newargv = argv;
|
||||
if (getenv("ABI")) {
|
||||
char envvar[50];
|
||||
|
||||
/* We use CFLAGS_${ABI} for gcc, g++, g77, etc as the flags that would
|
||||
* be in there are the same no matter which compiler we are using.
|
||||
*/
|
||||
snprintf(envvar, sizeof(envvar), "CFLAGS_%s", getenv("ABI"));
|
||||
envvar[sizeof(envvar)-1] = '\0';
|
||||
|
||||
if (getenv(envvar))
|
||||
newargv = build_new_argv(argv, getenv(envvar));
|
||||
}
|
||||
|
||||
/* Ok, lets do it one more time ... */
|
||||
execv(data.bin, newargv);
|
||||
|
||||
/* shouldn't have made it here if things worked ... */
|
||||
wrapper_err("could not run/locate '%s'", data.name);
|
||||
|
||||
return 123;
|
||||
}
|
||||
315
sdk_container/src/third_party/portage-stable/sys-devel/gcc-config/files/wrapper-1.5.2.c
vendored
Normal file
315
sdk_container/src/third_party/portage-stable/sys-devel/gcc-config/files/wrapper-1.5.2.c
vendored
Normal file
@ -0,0 +1,315 @@
|
||||
/*
|
||||
* Copyright 1999-2011 Gentoo Foundation
|
||||
* Distributed under the terms of the GNU General Public License v2
|
||||
* $Header: /var/cvsroot/gentoo-x86/sys-devel/gcc-config/files/wrapper-1.5.2.c,v 1.2 2011/06/18 18:46:23 vapier Exp $
|
||||
* Author: Martin Schlemmer <azarah@gentoo.org>
|
||||
* az's lackey: Mike Frysinger <vapier@gentoo.org>
|
||||
*/
|
||||
|
||||
#ifdef DEBUG
|
||||
# define USE_DEBUG 1
|
||||
#else
|
||||
# define USE_DEBUG 0
|
||||
#endif
|
||||
|
||||
#include <errno.h>
|
||||
#include <libgen.h>
|
||||
#include <limits.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#define GCC_CONFIG "/usr/bin/gcc-config"
|
||||
#define ENVD_BASE "/etc/env.d/05gcc"
|
||||
|
||||
#define ARRAY_SIZE(arr) (sizeof(arr)/sizeof(arr[0]))
|
||||
|
||||
/* basename(3) is allowed to modify memory */
|
||||
#undef basename
|
||||
#define basename(path) \
|
||||
({ \
|
||||
char *__path = path; \
|
||||
char *__ret = strrchr(__path, '/'); \
|
||||
__ret ? __ret + 1 : __path; \
|
||||
})
|
||||
|
||||
struct wrapper_data {
|
||||
const char *name;
|
||||
char *fullname, *bin, *path;
|
||||
};
|
||||
|
||||
static const struct {
|
||||
const char *alias;
|
||||
const char *target;
|
||||
} wrapper_aliases[] = {
|
||||
{ "cc", "gcc" },
|
||||
{ "f77", "gfortran" },
|
||||
{ "f95", "gfortran" },
|
||||
};
|
||||
|
||||
#define wrapper_warn(fmt, ...) fprintf(stderr, "%s" fmt "\n", "gcc-config: ", ## __VA_ARGS__)
|
||||
#define wrapper_err(fmt, ...) ({ wrapper_warn("%s" fmt, "error: ", ## __VA_ARGS__); exit(1); })
|
||||
#define wrapper_errp(fmt, ...) wrapper_err(fmt ": %s", ## __VA_ARGS__, strerror(errno))
|
||||
#define wrapper_dbg(fmt, ...) ({ if (USE_DEBUG) wrapper_warn(fmt, ## __VA_ARGS__); })
|
||||
|
||||
#define xmemwrap(func, proto, use) \
|
||||
static void *x ## func proto \
|
||||
{ \
|
||||
void *ret = func use; \
|
||||
if (!ret) \
|
||||
wrapper_err(#func "%s", ": out of memory"); \
|
||||
return ret; \
|
||||
}
|
||||
xmemwrap(malloc, (size_t size), (size))
|
||||
xmemwrap(strdup, (const char *s), (s))
|
||||
|
||||
/* check_for_target checks in path for the file we are seeking
|
||||
* it returns 1 if found (with data->bin setup), 0 if not and
|
||||
* negative on error
|
||||
*/
|
||||
static int check_for_target(char *path, struct wrapper_data *data)
|
||||
{
|
||||
struct stat sbuf;
|
||||
char str[PATH_MAX + 1];
|
||||
size_t path_len = strlen(path);
|
||||
size_t len = path_len + strlen(data->name) + 2;
|
||||
|
||||
if (sizeof(str) < len)
|
||||
wrapper_warn("path too long: %s", path);
|
||||
|
||||
strcpy(str, path);
|
||||
str[path_len] = '/';
|
||||
str[path_len+1] = '\0';
|
||||
strcat(str, data->name);
|
||||
|
||||
/* Stat possible file to check that
|
||||
* 1) it exist and is a regular file, and
|
||||
* 2) it is not the wrapper itself, and
|
||||
* 3) it is in a /gcc-bin/ directory tree
|
||||
*/
|
||||
if (strcmp(str, data->fullname) != 0 &&
|
||||
strstr(str, "/gcc-bin/") != NULL &&
|
||||
stat(str, &sbuf) == 0 &&
|
||||
(S_ISREG(sbuf.st_mode) || S_ISLNK(sbuf.st_mode)))
|
||||
{
|
||||
wrapper_dbg("%s: found in %s", data->name, path);
|
||||
data->bin = xstrdup(str);
|
||||
return 1;
|
||||
}
|
||||
|
||||
wrapper_dbg("%s: did not find in %s", data->name, path);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int find_target_in_path(struct wrapper_data *data)
|
||||
{
|
||||
char *token = NULL, *state = NULL;
|
||||
char *str;
|
||||
|
||||
if (data->path == NULL)
|
||||
return 0;
|
||||
|
||||
/* Make a copy since strtok_r will modify path */
|
||||
str = xstrdup(data->path);
|
||||
|
||||
/* Find the first file with suitable name in PATH. The idea here is
|
||||
* that we do not want to bind ourselfs to something static like the
|
||||
* default profile, or some odd environment variable, but want to be
|
||||
* able to build something with a non default gcc by just tweaking
|
||||
* the PATH ... */
|
||||
token = strtok_r(str, ":", &state);
|
||||
while (token != NULL) {
|
||||
if (check_for_target(token, data))
|
||||
return 1;
|
||||
token = strtok_r(NULL, ":", &state);
|
||||
}
|
||||
|
||||
wrapper_dbg("%s: did not find in PATH", data->name);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* find_target_in_envd parses /etc/env.d/05gcc, and tries to
|
||||
* extract PATH, which is set to the current profile's bin
|
||||
* directory ...
|
||||
*/
|
||||
static int find_target_in_envd(struct wrapper_data *data, int cross_compile)
|
||||
{
|
||||
FILE *envfile = NULL;
|
||||
char *token = NULL, *state;
|
||||
char str[PATH_MAX + 1];
|
||||
char *strp = str;
|
||||
char envd_file[PATH_MAX + 1];
|
||||
|
||||
if (!cross_compile) {
|
||||
/* for the sake of speed, we'll keep a symlink around for
|
||||
* the native compiler. #190260
|
||||
*/
|
||||
snprintf(envd_file, sizeof(envd_file)-1, "/etc/env.d/gcc/.NATIVE");
|
||||
} else {
|
||||
char *ctarget, *end = strrchr(data->name, '-');
|
||||
if (end == NULL)
|
||||
return 0;
|
||||
ctarget = xstrdup(data->name);
|
||||
ctarget[end - data->name] = '\0';
|
||||
snprintf(envd_file, PATH_MAX, "%s-%s", ENVD_BASE, ctarget);
|
||||
free(ctarget);
|
||||
}
|
||||
|
||||
envfile = fopen(envd_file, "r");
|
||||
if (envfile == NULL)
|
||||
return 0;
|
||||
|
||||
while (fgets(strp, PATH_MAX, envfile) != NULL) {
|
||||
/* Keep reading ENVD_FILE until we get a line that
|
||||
* starts with 'GCC_PATH=' ... keep 'PATH=' around
|
||||
* for older gcc versions.
|
||||
*/
|
||||
if (strncmp(strp, "GCC_PATH=", strlen("GCC_PATH=")) &&
|
||||
strncmp(strp, "PATH=", strlen("PATH=")))
|
||||
continue;
|
||||
|
||||
token = strtok_r(strp, "=", &state);
|
||||
if ((token != NULL) && token[0])
|
||||
/* The second token should be the value of PATH .. */
|
||||
token = strtok_r(NULL, "=", &state);
|
||||
else
|
||||
goto bail;
|
||||
|
||||
if ((token != NULL) && token[0]) {
|
||||
strp = token;
|
||||
/* A bash variable may be unquoted, quoted with " or
|
||||
* quoted with ', so extract the value without those ..
|
||||
*/
|
||||
token = strtok(strp, "\n\"\'");
|
||||
|
||||
while (token != NULL) {
|
||||
if (check_for_target(token, data)) {
|
||||
fclose(envfile);
|
||||
return 1;
|
||||
}
|
||||
|
||||
token = strtok(NULL, "\n\"\'");
|
||||
}
|
||||
}
|
||||
|
||||
strp = str;
|
||||
}
|
||||
|
||||
bail:
|
||||
fclose(envfile);
|
||||
return (cross_compile ? 0 : find_target_in_envd(data, 1));
|
||||
}
|
||||
|
||||
static void find_wrapper_target(struct wrapper_data *data)
|
||||
{
|
||||
if (find_target_in_path(data))
|
||||
return;
|
||||
|
||||
if (find_target_in_envd(data, 0))
|
||||
return;
|
||||
|
||||
/* Only our wrapper is in PATH, so get the CC path using
|
||||
* gcc-config and execute the real binary in there ...
|
||||
*/
|
||||
FILE *inpipe = popen(GCC_CONFIG " --get-bin-path", "r");
|
||||
if (inpipe == NULL)
|
||||
wrapper_errp("could not open pipe");
|
||||
|
||||
char str[PATH_MAX + 1];
|
||||
if (fgets(str, PATH_MAX, inpipe) == 0)
|
||||
wrapper_errp("could not get compiler binary path");
|
||||
|
||||
/* chomp! */
|
||||
size_t plen = strlen(str);
|
||||
if (str[plen-1] == '\n')
|
||||
str[plen-1] = '\0';
|
||||
|
||||
data->bin = xmalloc(plen + 1 + strlen(data->name) + 1);
|
||||
sprintf(data->bin, "%s/%s", str, data->name);
|
||||
|
||||
pclose(inpipe);
|
||||
}
|
||||
|
||||
/* This function modifies PATH to have gcc's bin path appended */
|
||||
static void modify_path(struct wrapper_data *data)
|
||||
{
|
||||
char *newpath = NULL, *token = NULL, *state;
|
||||
char dname_data[PATH_MAX + 1], str[PATH_MAX + 1];
|
||||
char *str2 = dname_data, *dname = dname_data;
|
||||
size_t len = 0;
|
||||
|
||||
if (data->bin == NULL)
|
||||
return;
|
||||
|
||||
if (data->path == NULL)
|
||||
return;
|
||||
|
||||
snprintf(str2, PATH_MAX + 1, "%s", data->bin);
|
||||
|
||||
if ((dname = dirname(str2)) == NULL)
|
||||
return;
|
||||
|
||||
/* Make a copy since strtok_r will modify path */
|
||||
snprintf(str, PATH_MAX + 1, "%s", data->path);
|
||||
|
||||
token = strtok_r(str, ":", &state);
|
||||
|
||||
/* Check if we already appended our bin location to PATH */
|
||||
if ((token != NULL) && token[0])
|
||||
if (!strcmp(token, dname))
|
||||
return;
|
||||
|
||||
len = strlen(dname) + strlen(data->path) + 2 + strlen("PATH") + 1;
|
||||
|
||||
newpath = xmalloc(len);
|
||||
memset(newpath, 0, len);
|
||||
|
||||
snprintf(newpath, len, "PATH=%s:%s", dname, data->path);
|
||||
putenv(newpath);
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
struct wrapper_data data;
|
||||
|
||||
memset(&data, 0, sizeof(data));
|
||||
|
||||
if (getenv("PATH"))
|
||||
data.path = xstrdup(getenv("PATH"));
|
||||
|
||||
/* What should we find ? */
|
||||
data.name = basename(argv[0]);
|
||||
|
||||
/* Allow for common compiler names like cc->gcc */
|
||||
size_t i;
|
||||
for (i = 0; i < ARRAY_SIZE(wrapper_aliases); ++i)
|
||||
if (!strcmp(data.name, wrapper_aliases[i].alias))
|
||||
data.name = wrapper_aliases[i].target;
|
||||
|
||||
/* What is the full name of our wrapper? */
|
||||
data.fullname = xmalloc(strlen(data.name) + sizeof("/usr/bin/") + 1);
|
||||
sprintf(data.fullname, "/usr/bin/%s", data.name);
|
||||
|
||||
find_wrapper_target(&data);
|
||||
|
||||
modify_path(&data);
|
||||
|
||||
free(data.path);
|
||||
data.path = NULL;
|
||||
|
||||
/* Set argv[0] to the correct binary, else gcc can't find internal headers
|
||||
* http://bugs.gentoo.org/8132
|
||||
*/
|
||||
argv[0] = data.bin;
|
||||
|
||||
/* Ok, lets do it one more time ... */
|
||||
execv(data.bin, argv);
|
||||
|
||||
/* shouldn't have made it here if things worked ... */
|
||||
wrapper_err("could not run/locate '%s'", data.name);
|
||||
|
||||
return 123;
|
||||
}
|
||||
59
sdk_container/src/third_party/portage-stable/sys-devel/gcc-config/gcc-config-1.4.1-r1.ebuild
vendored
Normal file
59
sdk_container/src/third_party/portage-stable/sys-devel/gcc-config/gcc-config-1.4.1-r1.ebuild
vendored
Normal file
@ -0,0 +1,59 @@
|
||||
# Copyright 1999-2011 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
# $Header: /var/cvsroot/gentoo-x86/sys-devel/gcc-config/gcc-config-1.4.1-r1.ebuild,v 1.1 2011/04/28 23:27:02 halcy0n Exp $
|
||||
|
||||
inherit flag-o-matic toolchain-funcs multilib
|
||||
|
||||
# Version of .c wrapper to use
|
||||
W_VER="1.5.1"
|
||||
|
||||
DESCRIPTION="Utility to change the gcc compiler being used"
|
||||
HOMEPAGE="http://www.gentoo.org/"
|
||||
SRC_URI=""
|
||||
|
||||
LICENSE="GPL-2"
|
||||
SLOT="0"
|
||||
KEYWORDS="alpha amd64 arm hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc ~sparc-fbsd x86 ~x86-fbsd"
|
||||
IUSE=""
|
||||
|
||||
RDEPEND="!app-admin/eselect-compiler"
|
||||
|
||||
S=${WORKDIR}
|
||||
|
||||
src_unpack() {
|
||||
cp "${FILESDIR}"/wrapper-${W_VER}.c "${S}"/wrapper.c || die
|
||||
}
|
||||
|
||||
src_compile() {
|
||||
strip-flags
|
||||
emake CC="$(tc-getCC)" wrapper || die "compile wrapper"
|
||||
}
|
||||
|
||||
src_install() {
|
||||
newbin "${FILESDIR}"/${PN}-${PV} ${PN} || die "install gcc-config"
|
||||
sed -i \
|
||||
-e "s:@GENTOO_LIBDIR@:$(get_libdir):g" \
|
||||
"${D}"/usr/bin/${PN}
|
||||
|
||||
exeinto /usr/$(get_libdir)/misc
|
||||
newexe wrapper gcc-config || die "install wrapper"
|
||||
}
|
||||
|
||||
pkg_postinst() {
|
||||
# Scrub eselect-compiler remains
|
||||
if [[ -e ${ROOT}/etc/env.d/05compiler ]] ; then
|
||||
rm -f "${ROOT}"/etc/env.d/05compiler
|
||||
fi
|
||||
|
||||
# Make sure old versions dont exist #79062
|
||||
rm -f "${ROOT}"/usr/sbin/gcc-config
|
||||
|
||||
# Do we have a valid multi ver setup ?
|
||||
if gcc-config --get-current-profile &>/dev/null ; then
|
||||
# We not longer use the /usr/include/g++-v3 hacks, as
|
||||
# it is not needed ...
|
||||
[[ -L ${ROOT}/usr/include/g++ ]] && rm -f "${ROOT}"/usr/include/g++
|
||||
[[ -L ${ROOT}/usr/include/g++-v3 ]] && rm -f "${ROOT}"/usr/include/g++-v3
|
||||
gcc-config $(/usr/bin/gcc-config --get-current-profile)
|
||||
fi
|
||||
}
|
||||
61
sdk_container/src/third_party/portage-stable/sys-devel/gcc-config/gcc-config-1.5-r1.ebuild
vendored
Normal file
61
sdk_container/src/third_party/portage-stable/sys-devel/gcc-config/gcc-config-1.5-r1.ebuild
vendored
Normal file
@ -0,0 +1,61 @@
|
||||
# Copyright 1999-2011 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
# $Header: /var/cvsroot/gentoo-x86/sys-devel/gcc-config/gcc-config-1.5-r1.ebuild,v 1.3 2011/11/11 12:15:40 aballier Exp $
|
||||
|
||||
inherit flag-o-matic toolchain-funcs multilib
|
||||
|
||||
# Version of .c wrapper to use
|
||||
W_VER="1.5.2"
|
||||
|
||||
DESCRIPTION="Utility to change the gcc compiler being used"
|
||||
HOMEPAGE="http://www.gentoo.org/"
|
||||
SRC_URI=""
|
||||
|
||||
LICENSE="GPL-2"
|
||||
SLOT="0"
|
||||
KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 -sparc-fbsd -x86-fbsd"
|
||||
IUSE=""
|
||||
|
||||
RDEPEND="!app-admin/eselect-compiler"
|
||||
|
||||
S=${WORKDIR}
|
||||
|
||||
src_unpack() {
|
||||
cp "${FILESDIR}"/wrapper-${W_VER}.c "${S}"/wrapper.c || die
|
||||
}
|
||||
|
||||
src_compile() {
|
||||
strip-flags
|
||||
emake CC="$(tc-getCC)" wrapper || die "compile wrapper"
|
||||
}
|
||||
|
||||
src_install() {
|
||||
newbin "${FILESDIR}"/${PN}-${PV} ${PN} || die "install gcc-config"
|
||||
sed -i \
|
||||
-e "s:@GENTOO_LIBDIR@:$(get_libdir):g" \
|
||||
"${D}"/usr/bin/${PN}
|
||||
|
||||
exeinto /usr/$(get_libdir)/misc
|
||||
newexe wrapper gcc-config || die "install wrapper"
|
||||
}
|
||||
|
||||
pkg_postinst() {
|
||||
# Scrub eselect-compiler remains
|
||||
if [[ -e ${ROOT}/etc/env.d/05compiler ]] ; then
|
||||
rm -f "${ROOT}"/etc/env.d/05compiler
|
||||
fi
|
||||
|
||||
# Make sure old versions dont exist #79062
|
||||
rm -f "${ROOT}"/usr/sbin/gcc-config
|
||||
|
||||
# We not longer use the /usr/include/g++-v3 hacks, as
|
||||
# it is not needed ...
|
||||
[[ -L ${ROOT}/usr/include/g++ ]] && rm -f "${ROOT}"/usr/include/g++
|
||||
[[ -L ${ROOT}/usr/include/g++-v3 ]] && rm -f "${ROOT}"/usr/include/g++-v3
|
||||
|
||||
# Do we have a valid multi ver setup ?
|
||||
local x
|
||||
for x in $(gcc-config -C -l 2>/dev/null | awk '$NF == "*" { print $2 }') ; do
|
||||
gcc-config ${x}
|
||||
done
|
||||
}
|
||||
61
sdk_container/src/third_party/portage-stable/sys-devel/gcc-config/gcc-config-1.5-r2.ebuild
vendored
Normal file
61
sdk_container/src/third_party/portage-stable/sys-devel/gcc-config/gcc-config-1.5-r2.ebuild
vendored
Normal file
@ -0,0 +1,61 @@
|
||||
# Copyright 1999-2012 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
# $Header: /var/cvsroot/gentoo-x86/sys-devel/gcc-config/gcc-config-1.5-r2.ebuild,v 1.7 2012/03/15 15:45:05 vapier Exp $
|
||||
|
||||
inherit flag-o-matic toolchain-funcs multilib
|
||||
|
||||
# Version of .c wrapper to use
|
||||
W_VER="1.5.2"
|
||||
|
||||
DESCRIPTION="Utility to change the gcc compiler being used"
|
||||
HOMEPAGE="http://www.gentoo.org/"
|
||||
SRC_URI=""
|
||||
|
||||
LICENSE="GPL-2"
|
||||
SLOT="0"
|
||||
KEYWORDS="alpha amd64 arm hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~sparc-fbsd ~x86-fbsd"
|
||||
IUSE=""
|
||||
|
||||
RDEPEND="!app-admin/eselect-compiler"
|
||||
|
||||
S=${WORKDIR}
|
||||
|
||||
src_unpack() {
|
||||
cp "${FILESDIR}"/wrapper-${W_VER}.c "${S}"/wrapper.c || die
|
||||
}
|
||||
|
||||
src_compile() {
|
||||
strip-flags
|
||||
emake CC="$(tc-getCC)" wrapper || die "compile wrapper"
|
||||
}
|
||||
|
||||
src_install() {
|
||||
newbin "${FILESDIR}"/${PN}-${PV} ${PN} || die "install gcc-config"
|
||||
sed -i \
|
||||
-e "s:@GENTOO_LIBDIR@:$(get_libdir):g" \
|
||||
"${D}"/usr/bin/${PN}
|
||||
|
||||
exeinto /usr/$(get_libdir)/misc
|
||||
newexe wrapper gcc-config || die "install wrapper"
|
||||
}
|
||||
|
||||
pkg_postinst() {
|
||||
# Scrub eselect-compiler remains
|
||||
if [[ -e ${ROOT}/etc/env.d/05compiler ]] ; then
|
||||
rm -f "${ROOT}"/etc/env.d/05compiler
|
||||
fi
|
||||
|
||||
# Make sure old versions dont exist #79062
|
||||
rm -f "${ROOT}"/usr/sbin/gcc-config
|
||||
|
||||
# We not longer use the /usr/include/g++-v3 hacks, as
|
||||
# it is not needed ...
|
||||
[[ -L ${ROOT}/usr/include/g++ ]] && rm -f "${ROOT}"/usr/include/g++
|
||||
[[ -L ${ROOT}/usr/include/g++-v3 ]] && rm -f "${ROOT}"/usr/include/g++-v3
|
||||
|
||||
# Do we have a valid multi ver setup ?
|
||||
local x
|
||||
for x in $(gcc-config -C -l 2>/dev/null | awk '$NF == "*" { print $2 }') ; do
|
||||
gcc-config ${x}
|
||||
done
|
||||
}
|
||||
61
sdk_container/src/third_party/portage-stable/sys-devel/gcc-config/gcc-config-1.5.1-r1.ebuild
vendored
Normal file
61
sdk_container/src/third_party/portage-stable/sys-devel/gcc-config/gcc-config-1.5.1-r1.ebuild
vendored
Normal file
@ -0,0 +1,61 @@
|
||||
# Copyright 1999-2012 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
# $Header: /var/cvsroot/gentoo-x86/sys-devel/gcc-config/gcc-config-1.5.1-r1.ebuild,v 1.1 2012/03/15 01:16:44 vapier Exp $
|
||||
|
||||
inherit flag-o-matic toolchain-funcs multilib
|
||||
|
||||
# Version of .c wrapper to use
|
||||
W_VER="1.5.2"
|
||||
|
||||
DESCRIPTION="Utility to change the gcc compiler being used"
|
||||
HOMEPAGE="http://www.gentoo.org/"
|
||||
SRC_URI=""
|
||||
|
||||
LICENSE="GPL-2"
|
||||
SLOT="0"
|
||||
KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~sparc-fbsd ~x86-fbsd"
|
||||
IUSE=""
|
||||
|
||||
RDEPEND="!app-admin/eselect-compiler"
|
||||
|
||||
S=${WORKDIR}
|
||||
|
||||
src_unpack() {
|
||||
cp "${FILESDIR}"/wrapper-${W_VER}.c "${S}"/wrapper.c || die
|
||||
}
|
||||
|
||||
src_compile() {
|
||||
strip-flags
|
||||
emake CC="$(tc-getCC)" wrapper || die "compile wrapper"
|
||||
}
|
||||
|
||||
src_install() {
|
||||
newbin "${FILESDIR}"/${PN}-${PV} ${PN} || die "install gcc-config"
|
||||
sed -i \
|
||||
-e "s:@GENTOO_LIBDIR@:$(get_libdir):g" \
|
||||
"${D}"/usr/bin/${PN}
|
||||
|
||||
exeinto /usr/$(get_libdir)/misc
|
||||
newexe wrapper gcc-config || die "install wrapper"
|
||||
}
|
||||
|
||||
pkg_postinst() {
|
||||
# Scrub eselect-compiler remains
|
||||
if [[ -e ${ROOT}/etc/env.d/05compiler ]] ; then
|
||||
rm -f "${ROOT}"/etc/env.d/05compiler
|
||||
fi
|
||||
|
||||
# Make sure old versions dont exist #79062
|
||||
rm -f "${ROOT}"/usr/sbin/gcc-config
|
||||
|
||||
# We not longer use the /usr/include/g++-v3 hacks, as
|
||||
# it is not needed ...
|
||||
[[ -L ${ROOT}/usr/include/g++ ]] && rm -f "${ROOT}"/usr/include/g++
|
||||
[[ -L ${ROOT}/usr/include/g++-v3 ]] && rm -f "${ROOT}"/usr/include/g++-v3
|
||||
|
||||
# Do we have a valid multi ver setup ?
|
||||
local x
|
||||
for x in $(gcc-config -C -l 2>/dev/null | awk '$NF == "*" { print $2 }') ; do
|
||||
gcc-config ${x}
|
||||
done
|
||||
}
|
||||
61
sdk_container/src/third_party/portage-stable/sys-devel/gcc-config/gcc-config-1.5.1.ebuild
vendored
Normal file
61
sdk_container/src/third_party/portage-stable/sys-devel/gcc-config/gcc-config-1.5.1.ebuild
vendored
Normal file
@ -0,0 +1,61 @@
|
||||
# Copyright 1999-2012 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
# $Header: /var/cvsroot/gentoo-x86/sys-devel/gcc-config/gcc-config-1.5.1.ebuild,v 1.1 2012/02/29 20:16:56 vapier Exp $
|
||||
|
||||
inherit flag-o-matic toolchain-funcs multilib
|
||||
|
||||
# Version of .c wrapper to use
|
||||
W_VER="1.5.2"
|
||||
|
||||
DESCRIPTION="Utility to change the gcc compiler being used"
|
||||
HOMEPAGE="http://www.gentoo.org/"
|
||||
SRC_URI=""
|
||||
|
||||
LICENSE="GPL-2"
|
||||
SLOT="0"
|
||||
KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~sparc-fbsd ~x86-fbsd"
|
||||
IUSE=""
|
||||
|
||||
RDEPEND="!app-admin/eselect-compiler"
|
||||
|
||||
S=${WORKDIR}
|
||||
|
||||
src_unpack() {
|
||||
cp "${FILESDIR}"/wrapper-${W_VER}.c "${S}"/wrapper.c || die
|
||||
}
|
||||
|
||||
src_compile() {
|
||||
strip-flags
|
||||
emake CC="$(tc-getCC)" wrapper || die "compile wrapper"
|
||||
}
|
||||
|
||||
src_install() {
|
||||
newbin "${FILESDIR}"/${PN}-${PV} ${PN} || die "install gcc-config"
|
||||
sed -i \
|
||||
-e "s:@GENTOO_LIBDIR@:$(get_libdir):g" \
|
||||
"${D}"/usr/bin/${PN}
|
||||
|
||||
exeinto /usr/$(get_libdir)/misc
|
||||
newexe wrapper gcc-config || die "install wrapper"
|
||||
}
|
||||
|
||||
pkg_postinst() {
|
||||
# Scrub eselect-compiler remains
|
||||
if [[ -e ${ROOT}/etc/env.d/05compiler ]] ; then
|
||||
rm -f "${ROOT}"/etc/env.d/05compiler
|
||||
fi
|
||||
|
||||
# Make sure old versions dont exist #79062
|
||||
rm -f "${ROOT}"/usr/sbin/gcc-config
|
||||
|
||||
# We not longer use the /usr/include/g++-v3 hacks, as
|
||||
# it is not needed ...
|
||||
[[ -L ${ROOT}/usr/include/g++ ]] && rm -f "${ROOT}"/usr/include/g++
|
||||
[[ -L ${ROOT}/usr/include/g++-v3 ]] && rm -f "${ROOT}"/usr/include/g++-v3
|
||||
|
||||
# Do we have a valid multi ver setup ?
|
||||
local x
|
||||
for x in $(gcc-config -C -l 2>/dev/null | awk '$NF == "*" { print $2 }') ; do
|
||||
gcc-config ${x}
|
||||
done
|
||||
}
|
||||
47
sdk_container/src/third_party/portage-stable/sys-devel/gcc-config/gcc-config-1.6.ebuild
vendored
Normal file
47
sdk_container/src/third_party/portage-stable/sys-devel/gcc-config/gcc-config-1.6.ebuild
vendored
Normal file
@ -0,0 +1,47 @@
|
||||
# Copyright 1999-2012 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
# $Header: /var/cvsroot/gentoo-x86/sys-devel/gcc-config/gcc-config-1.6.ebuild,v 1.9 2012/07/08 15:39:00 armin76 Exp $
|
||||
|
||||
inherit unpacker toolchain-funcs multilib
|
||||
|
||||
DESCRIPTION="utility to manage compilers"
|
||||
HOMEPAGE="http://git.overlays.gentoo.org/gitweb/?p=proj/gcc-config.git"
|
||||
SRC_URI="mirror://gentoo/${P}.tar.xz
|
||||
http://dev.gentoo.org/~vapier/dist/${P}.tar.xz"
|
||||
|
||||
LICENSE="GPL-2"
|
||||
SLOT="0"
|
||||
KEYWORDS="alpha amd64 arm hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~sparc-fbsd ~x86-fbsd"
|
||||
IUSE=""
|
||||
|
||||
src_compile() {
|
||||
emake CC="$(tc-getCC)" || die
|
||||
}
|
||||
|
||||
src_install() {
|
||||
emake \
|
||||
DESTDIR="${D}" \
|
||||
PV="${PV}" \
|
||||
SUBLIBDIR="$(get_libdir)" \
|
||||
install || die
|
||||
}
|
||||
|
||||
pkg_postinst() {
|
||||
# Scrub eselect-compiler remains
|
||||
rm -f "${ROOT}"/etc/env.d/05compiler &
|
||||
|
||||
# Make sure old versions dont exist #79062
|
||||
rm -f "${ROOT}"/usr/sbin/gcc-config &
|
||||
|
||||
# We not longer use the /usr/include/g++-v3 hacks, as
|
||||
# it is not needed ...
|
||||
rm -f "${ROOT}"/usr/include/g++{,-v3} &
|
||||
|
||||
# Do we have a valid multi ver setup ?
|
||||
local x
|
||||
for x in $(gcc-config -C -l 2>/dev/null | awk '$NF == "*" { print $2 }') ; do
|
||||
gcc-config ${x}
|
||||
done
|
||||
|
||||
wait
|
||||
}
|
||||
47
sdk_container/src/third_party/portage-stable/sys-devel/gcc-config/gcc-config-1.7.1.ebuild
vendored
Normal file
47
sdk_container/src/third_party/portage-stable/sys-devel/gcc-config/gcc-config-1.7.1.ebuild
vendored
Normal file
@ -0,0 +1,47 @@
|
||||
# Copyright 1999-2012 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
# $Header: /var/cvsroot/gentoo-x86/sys-devel/gcc-config/gcc-config-1.7.1.ebuild,v 1.1 2012/05/13 20:14:06 vapier Exp $
|
||||
|
||||
inherit unpacker toolchain-funcs multilib
|
||||
|
||||
DESCRIPTION="utility to manage compilers"
|
||||
HOMEPAGE="http://git.overlays.gentoo.org/gitweb/?p=proj/gcc-config.git"
|
||||
SRC_URI="mirror://gentoo/${P}.tar.xz
|
||||
http://dev.gentoo.org/~vapier/dist/${P}.tar.xz"
|
||||
|
||||
LICENSE="GPL-2"
|
||||
SLOT="0"
|
||||
KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd"
|
||||
IUSE=""
|
||||
|
||||
src_compile() {
|
||||
emake CC="$(tc-getCC)" || die
|
||||
}
|
||||
|
||||
src_install() {
|
||||
emake \
|
||||
DESTDIR="${D}" \
|
||||
PV="${PV}" \
|
||||
SUBLIBDIR="$(get_libdir)" \
|
||||
install || die
|
||||
}
|
||||
|
||||
pkg_postinst() {
|
||||
# Scrub eselect-compiler remains
|
||||
rm -f "${ROOT}"/etc/env.d/05compiler &
|
||||
|
||||
# Make sure old versions dont exist #79062
|
||||
rm -f "${ROOT}"/usr/sbin/gcc-config &
|
||||
|
||||
# We not longer use the /usr/include/g++-v3 hacks, as
|
||||
# it is not needed ...
|
||||
rm -f "${ROOT}"/usr/include/g++{,-v3} &
|
||||
|
||||
# Do we have a valid multi ver setup ?
|
||||
local x
|
||||
for x in $(gcc-config -C -l 2>/dev/null | awk '$NF == "*" { print $2 }') ; do
|
||||
gcc-config ${x}
|
||||
done
|
||||
|
||||
wait
|
||||
}
|
||||
47
sdk_container/src/third_party/portage-stable/sys-devel/gcc-config/gcc-config-1.7.2.ebuild
vendored
Normal file
47
sdk_container/src/third_party/portage-stable/sys-devel/gcc-config/gcc-config-1.7.2.ebuild
vendored
Normal file
@ -0,0 +1,47 @@
|
||||
# Copyright 1999-2012 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
# $Header: /var/cvsroot/gentoo-x86/sys-devel/gcc-config/gcc-config-1.7.2.ebuild,v 1.1 2012/05/31 04:32:38 vapier Exp $
|
||||
|
||||
inherit unpacker toolchain-funcs multilib
|
||||
|
||||
DESCRIPTION="utility to manage compilers"
|
||||
HOMEPAGE="http://git.overlays.gentoo.org/gitweb/?p=proj/gcc-config.git"
|
||||
SRC_URI="mirror://gentoo/${P}.tar.xz
|
||||
http://dev.gentoo.org/~vapier/dist/${P}.tar.xz"
|
||||
|
||||
LICENSE="GPL-2"
|
||||
SLOT="0"
|
||||
KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd"
|
||||
IUSE=""
|
||||
|
||||
src_compile() {
|
||||
emake CC="$(tc-getCC)" || die
|
||||
}
|
||||
|
||||
src_install() {
|
||||
emake \
|
||||
DESTDIR="${D}" \
|
||||
PV="${PV}" \
|
||||
SUBLIBDIR="$(get_libdir)" \
|
||||
install || die
|
||||
}
|
||||
|
||||
pkg_postinst() {
|
||||
# Scrub eselect-compiler remains
|
||||
rm -f "${ROOT}"/etc/env.d/05compiler &
|
||||
|
||||
# Make sure old versions dont exist #79062
|
||||
rm -f "${ROOT}"/usr/sbin/gcc-config &
|
||||
|
||||
# We not longer use the /usr/include/g++-v3 hacks, as
|
||||
# it is not needed ...
|
||||
rm -f "${ROOT}"/usr/include/g++{,-v3} &
|
||||
|
||||
# Do we have a valid multi ver setup ?
|
||||
local x
|
||||
for x in $(gcc-config -C -l 2>/dev/null | awk '$NF == "*" { print $2 }') ; do
|
||||
gcc-config ${x}
|
||||
done
|
||||
|
||||
wait
|
||||
}
|
||||
@ -1,6 +1,6 @@
|
||||
# Copyright 1999-2012 Gentoo Foundation
|
||||
# Copyright 1999-2014 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
# $Header: /var/cvsroot/gentoo-x86/sys-devel/gcc-config/gcc-config-1.7.3.ebuild,v 1.1 2012/06/10 04:03:13 vapier Exp $
|
||||
# $Header: /var/cvsroot/gentoo-x86/sys-devel/gcc-config/gcc-config-1.7.3.ebuild,v 1.8 2014/01/18 03:08:29 vapier Exp $
|
||||
|
||||
inherit unpacker toolchain-funcs multilib
|
||||
|
||||
@ -11,7 +11,7 @@ SRC_URI="mirror://gentoo/${P}.tar.xz
|
||||
|
||||
LICENSE="GPL-2"
|
||||
SLOT="0"
|
||||
KEYWORDS="~alpha amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd"
|
||||
KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd"
|
||||
IUSE=""
|
||||
|
||||
src_compile() {
|
||||
|
||||
47
sdk_container/src/third_party/portage-stable/sys-devel/gcc-config/gcc-config-1.7.ebuild
vendored
Normal file
47
sdk_container/src/third_party/portage-stable/sys-devel/gcc-config/gcc-config-1.7.ebuild
vendored
Normal file
@ -0,0 +1,47 @@
|
||||
# Copyright 1999-2012 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
# $Header: /var/cvsroot/gentoo-x86/sys-devel/gcc-config/gcc-config-1.7.ebuild,v 1.2 2012/04/26 12:30:41 aballier Exp $
|
||||
|
||||
inherit unpacker toolchain-funcs multilib
|
||||
|
||||
DESCRIPTION="utility to manage compilers"
|
||||
HOMEPAGE="http://git.overlays.gentoo.org/gitweb/?p=proj/gcc-config.git"
|
||||
SRC_URI="mirror://gentoo/${P}.tar.xz
|
||||
http://dev.gentoo.org/~vapier/dist/${P}.tar.xz"
|
||||
|
||||
LICENSE="GPL-2"
|
||||
SLOT="0"
|
||||
KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd"
|
||||
IUSE=""
|
||||
|
||||
src_compile() {
|
||||
emake CC="$(tc-getCC)" || die
|
||||
}
|
||||
|
||||
src_install() {
|
||||
emake \
|
||||
DESTDIR="${D}" \
|
||||
PV="${PV}" \
|
||||
SUBLIBDIR="$(get_libdir)" \
|
||||
install || die
|
||||
}
|
||||
|
||||
pkg_postinst() {
|
||||
# Scrub eselect-compiler remains
|
||||
rm -f "${ROOT}"/etc/env.d/05compiler &
|
||||
|
||||
# Make sure old versions dont exist #79062
|
||||
rm -f "${ROOT}"/usr/sbin/gcc-config &
|
||||
|
||||
# We not longer use the /usr/include/g++-v3 hacks, as
|
||||
# it is not needed ...
|
||||
rm -f "${ROOT}"/usr/include/g++{,-v3} &
|
||||
|
||||
# Do we have a valid multi ver setup ?
|
||||
local x
|
||||
for x in $(gcc-config -C -l 2>/dev/null | awk '$NF == "*" { print $2 }') ; do
|
||||
gcc-config ${x}
|
||||
done
|
||||
|
||||
wait
|
||||
}
|
||||
47
sdk_container/src/third_party/portage-stable/sys-devel/gcc-config/gcc-config-1.8.ebuild
vendored
Normal file
47
sdk_container/src/third_party/portage-stable/sys-devel/gcc-config/gcc-config-1.8.ebuild
vendored
Normal file
@ -0,0 +1,47 @@
|
||||
# Copyright 1999-2014 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
# $Header: /var/cvsroot/gentoo-x86/sys-devel/gcc-config/gcc-config-1.8.ebuild,v 1.2 2014/01/18 03:08:29 vapier Exp $
|
||||
|
||||
inherit unpacker toolchain-funcs multilib
|
||||
|
||||
DESCRIPTION="utility to manage compilers"
|
||||
HOMEPAGE="http://git.overlays.gentoo.org/gitweb/?p=proj/gcc-config.git"
|
||||
SRC_URI="mirror://gentoo/${P}.tar.xz
|
||||
http://dev.gentoo.org/~vapier/dist/${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 ~sparc-fbsd ~x86-fbsd"
|
||||
IUSE=""
|
||||
|
||||
src_compile() {
|
||||
emake CC="$(tc-getCC)" || die
|
||||
}
|
||||
|
||||
src_install() {
|
||||
emake \
|
||||
DESTDIR="${D}" \
|
||||
PV="${PV}" \
|
||||
SUBLIBDIR="$(get_libdir)" \
|
||||
install || die
|
||||
}
|
||||
|
||||
pkg_postinst() {
|
||||
# Scrub eselect-compiler remains
|
||||
rm -f "${ROOT}"/etc/env.d/05compiler &
|
||||
|
||||
# Make sure old versions dont exist #79062
|
||||
rm -f "${ROOT}"/usr/sbin/gcc-config &
|
||||
|
||||
# We not longer use the /usr/include/g++-v3 hacks, as
|
||||
# it is not needed ...
|
||||
rm -f "${ROOT}"/usr/include/g++{,-v3} &
|
||||
|
||||
# Do we have a valid multi ver setup ?
|
||||
local x
|
||||
for x in $(gcc-config -C -l 2>/dev/null | awk '$NF == "*" { print $2 }') ; do
|
||||
gcc-config ${x}
|
||||
done
|
||||
|
||||
wait
|
||||
}
|
||||
5
sdk_container/src/third_party/portage-stable/sys-devel/gcc-config/metadata.xml
vendored
Normal file
5
sdk_container/src/third_party/portage-stable/sys-devel/gcc-config/metadata.xml
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
|
||||
<pkgmetadata>
|
||||
<herd>toolchain</herd>
|
||||
</pkgmetadata>
|
||||
Loading…
x
Reference in New Issue
Block a user