summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Severance2017-07-30 13:26:23 -0400
committerChris Severance2017-07-30 13:26:23 -0400
commitbe4d58fd6ecbe9486bf91fa9784c2a0253a33dde (patch)
treecefd5a350365309d3616b7931550900209bd133f
parent03d01a656761788816c93273a83077fdd9361619 (diff)
downloadaur-be4d58fd6ecbe9486bf91fa9784c2a0253a33dde.tar.gz
Update for gcc 4.9
-rw-r--r--.SRCINFO7
-rw-r--r--PKGBUILD178
2 files changed, 120 insertions, 65 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 5480f120976e..9fe377ce143f 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,3 +1,5 @@
+# Generated by mksrcinfo v8
+# Sun Jul 30 17:26:06 UTC 2017
pkgbase = gcc44
pkgdesc = The GNU Compiler Collection (4.4.x)
pkgver = 4.4.7
@@ -9,14 +11,15 @@ pkgbase = gcc44
license = LGPL
license = custom
makedepends = setconf
+ makedepends = gcc49
depends = binutils
depends = mpfr
depends = cloog
depends = zlib
depends = elfutils
- options = !libtool
- options = !buildflags
+ conflicts = gcc44-multilib
options = staticlibs
+ options = !libtool
source = http://www.mirrorservice.org/sites/sourceware.org/pub/gcc/releases/gcc-4.4.7/gcc-4.4.7.tar.bz2
source = gcc-hash-style-both.patch
source = gcc_pure64.patch
diff --git a/PKGBUILD b/PKGBUILD
index 77967f1a098b..10a89253d477 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,4 +1,5 @@
-# Maintainer: Alexander Rødseth <rodseth@gmail.com>
+# Maintainer: Chris Severance aur.severach aATt spamgourmet dott com
+# Contributor: Alexander Rødseth <rodseth@gmail.com>
# Contributor: Vlad-Mihai Sima <vladmihaisima@yahoo.com>
# Contributor: Carson Reynolds <carson@k2.t.u-tokyo.ac.jp>
# Contributor: Mikhail Vorozhtsov <mikhail.vorozhtsov@gmail.com>
@@ -7,90 +8,141 @@
# Contributor: progtologist <arissynod@gmail.com>
# Contributor: pelluch <pablo.lluch@gmail.com>
-pkgname=gcc44
-pkgver=4.4.7
-pkgrel=6
-pkgdesc='The GNU Compiler Collection (4.4.x)'
+set -u
+_pkgver='4.4'
+pkgname="gcc${_pkgver//\./}"
+pkgver="${_pkgver}.7"
+pkgrel='6'
+pkgdesc="The GNU Compiler Collection (${_pkgver}.x)"
arch=('x86_64' 'i686')
url='http://gcc.gnu.org/'
license=('GPL' 'LGPL' 'custom')
depends=('binutils' 'mpfr' 'cloog' 'zlib' 'elfutils')
makedepends=('setconf')
-options=('!libtool' '!buildflags' 'staticlibs')
-source=("http://www.mirrorservice.org/sites/sourceware.org/pub/gcc/releases/gcc-$pkgver/gcc-$pkgver.tar.bz2"
- 'gcc-hash-style-both.patch'
- 'gcc_pure64.patch'
- 'siginfo_t_fix.patch')
+makedepends+=('gcc49')
+conflicts=("gcc${_pkgver//\./}-multilib")
+options=('staticlibs' '!libtool')
+source=(
+ "http://www.mirrorservice.org/sites/sourceware.org/pub/gcc/releases/gcc-${pkgver}/gcc-${pkgver}.tar.bz2"
+ 'gcc-hash-style-both.patch'
+ 'gcc_pure64.patch'
+ 'siginfo_t_fix.patch'
+)
sha256sums=('5ff75116b8f763fa0fb5621af80fc6fb3ea0f1b1a57520874982f03f26cd607f'
'a600550d3d2b2fb8ee6a547c68c3a08a2af7579290b340c35ee5598c9bb305a5'
'2d369cf93c6e15c3559c3560bce581e0ae5f1f34dc86bca013ac67ef1c1a9ff9'
'4df866dcfd528835393d2b6897651158faf6d84852158fbf2e4ffc113ec7d201')
+PKGEXT='.pkg.tar.gz'
+
+ _basedir="gcc-${pkgver}"
prepare() {
- cd "gcc-$pkgver"
+ set -u
+ cd "${_basedir}"
# Do not install libiberty
- sed -i -e 's:install_to_$(INSTALL_DEST) ::' libiberty/Makefile.in
+ sed -e 's/install_to_$(INSTALL_DEST) //' -i 'libiberty/Makefile.in'
+
# Do not run fixincludes
- sed -i -e 's:\./fixinc\.sh:-c true:' gcc/Makefile.in
+ sed -e 's@\./fixinc\.sh@-c true@' -i 'gcc/Makefile.in'
- patch -Np0 -i "$srcdir/gcc-hash-style-both.patch"
- patch -Np1 -i "$srcdir/siginfo_t_fix.patch"
- if [[ "$CARCH" == "x86_64" ]]; then
- patch -Np1 -i "$srcdir/gcc_pure64.patch"
- fi
- echo "$pkgver" > gcc/BASE-VER
+ patch -Np0 -i "${srcdir}/gcc-hash-style-both.patch"
+
+ patch -Np1 -i "${srcdir}/siginfo_t_fix.patch"
+
+ case "${CARCH}" in
+ 'x86_64') patch -Np1 -i '../gcc_pure64.patch';;
+ esac
+
+ echo "${pkgver}" > 'gcc/BASE-VER'
- setconf gcc/configure BUILD_INFO ''
+ setconf 'gcc/configure' 'BUILD_INFO' ''
+
+ rm -rf 'gcc-build'
+ mkdir 'gcc-build'
+
+ set +u
}
build() {
- cd "gcc-$pkgver"
-
- rm -rf build
- mkdir build
- cd build
-
- ../configure \
- --prefix=/usr \
- --mandir=/usr/share/man \
- --infodir=/usr/share/info \
- --libdir=/usr/lib \
- --libexecdir=/usr/lib \
- --program-suffix=-4.4 \
- --enable-shared \
- --enable-languages=c,c++,fortran,objc,obj-c++ \
- --enable-__cxa_atexit \
- --disable-libstdcxx-pch \
- --disable-multilib \
- --enable-libgomp \
- --disable-libmudflap \
- --disable-libssp \
- --enable-clocale=gnu \
- --with-tune=generic \
- --with-cloog \
- --with-ppl \
- --with-system-zlib
- make
+ set -u
+ cd "${_basedir}/gcc-build"
+
+ if [ ! -s 'Makefile' ]; then
+ # Doesn't like FORTIFY_SOURCE
+ CPPFLAGS="${CPPFLAGS//-D_FORTIFY_SOURCE=?/}"
+
+ # Doesn't like -fstack-protector-strong
+ CFLAGS="${CFLAGS//-fstack-protector-strong/-fstack-protector}"
+ CXXFLAGS="${CXXFLAGS//-fstack-protector-strong/-fstack-protector}"
+
+ # using -pipe causes spurious test-suite failures
+ # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48565
+ CFLAGS="${CFLAGS/-pipe/}"
+ CXXFLAGS="${CXXFLAGS/-pipe/}"
+
+ # Flags from new compilers that old compilers don't recognize
+ CFLAGS="${CFLAGS/-fno-plt/}"
+ CXXFLAGS="${CXXFLAGS/-fno-plt/}"
+
+ CFLAGS="${CFLAGS/-Wformat-overflow=[0-9]/}"
+ CXXFLAGS="${CXXFLAGS/-Wformat-overflow=[0-9]/}"
+
+ # The following options are one per line, mostly sorted so they are easy to diff compare to other gcc packages.
+ ../configure \
+ --build="${CHOST}" \
+ --enable-libgomp \
+ --disable-libmudflap \
+ --disable-libssp \
+ --disable-libstdcxx-pch \
+ --disable-multilib \
+ --enable-__cxa_atexit \
+ --enable-clocale='gnu' \
+ --enable-languages='c,c++,fortran,objc,obj-c++' \
+ --enable-shared \
+ --enable-threads='posix' \
+ --enable-version-specific-runtime-libs \
+ --infodir='/usr/share/info' \
+ --libdir='/usr/lib' \
+ --libexecdir='/usr/lib' \
+ --mandir='/usr/share/man' \
+ --program-suffix="-${_pkgver}" \
+ --with-cloog \
+ --with-ppl \
+ --with-system-zlib \
+ --with-tune='generic' \
+ --prefix='/usr' \
+ CXX='g++-4.9' CC='gcc-4.9'
+ fi
+
+ local _nproc="$(nproc)"; _nproc=$((_nproc>8?8:_nproc))
+ nice make -s -j "${_nproc}"
+ set +u
}
package() {
- cd "gcc-$pkgver/build"
+ set -u
+ cd "${_basedir}/gcc-build"
+
+ make -s -j1 DESTDIR="${pkgdir}" install
+
+ ## Lazy way of dealing with conflicting man and info pages and locales...
+ rm -rf "${pkgdir}/usr/share/man/man7"
+ rm -rf "${pkgdir}/usr/share/locale"
+
+ mv "${pkgdir}/usr/lib/gcc/${CHOST}"/lib* "${pkgdir}/usr/lib/gcc/${CHOST}/${pkgver}/"
+
+ # Create links for gcc build environment (useful for CUDA)
+ mkdir -p "${pkgdir}/opt/gcc-${_pkgver}"
+ ln -s "/usr/bin/gcc-${_pkgver}" "${pkgdir}/opt/gcc-${_pkgver}/gcc"
+ ln -s "/usr/bin/g++-${_pkgver}" "${pkgdir}/opt/gcc-${_pkgver}/g++"
- make DESTDIR="$pkgdir" install
- rm -rf "$pkgdir/usr/share/man/man7"
- rm -rf "$pkgdir/usr/share/locale"
- mv "$pkgdir"/usr/lib/lib* \
- "$pkgdir/usr/lib/gcc/$CHOST/$pkgver/"
- # Install Runtime Library Exception
- install -Dm644 ../COPYING.RUNTIME \
- "$pkgdir/usr/share/licenses/$pkgname/RUNTIME.LIBRARY.EXCEPTION" \
- # Create links for gcc-4.4 build environment (useful for CUDA)
- mkdir -p "$pkgdir/opt/gcc-4.4"
- ln -s /usr/bin/gcc-4.4 "$pkgdir/opt/gcc-4.4/gcc"
- ln -s /usr/bin/g++-4.4 "$pkgdir/opt/gcc-4.4/g++"
# Avoid file conflicts when enabling libgomp
- rm -rf "$pkgdir/usr/share/info"
-}
+ rm -rf "${pkgdir}/usr/share/info"
-# vim:set ts=2 sw=2 et:
+ # Install Runtime Library Exception
+ install -Dpm644 '../COPYING.RUNTIME' \
+ "${pkgdir}/usr/share/licenses/${pkgname}/RUNTIME.LIBRARY.EXCEPTION" || :
+ set +u
+}
+set +u