Tom G. Christensen a1791f9367 gcc40: rename and rebuild
This updates the build to use the common gcc build
infrastructure.
Additionally the package is renamed from gcc404 to gcc40
to match tgcwarev2.
2013-11-23 23:51:11 +01:00

97 lines
2.0 KiB
Bash
Executable File

#!/bin/bash
# This is a buildpkg build.sh script
# build.sh helper functions
. ${BUILDPKG_SCRIPTS}/build.sh.functions
#
###########################################################
# Check the following 4 variables before running the script
topdir=gcc
version=4.0.4
pkgver=2
source[0]=$topdir-$version.tar.bz2
## If there are no patches, simply comment this
patch[0]=gcc-4.0.4-new-makeinfo.patch
patch[1]=gcc-4.0.4-new-gas.patch
# Source function library
. ${BUILDPKG_SCRIPTS}/buildpkg.functions
# Common settings for gcc
. ${BUILDPKG_BASE}/gcc/build.sh.gcc.common
# Global settings
# This compiler is bootstrapped with gcc 3.4.6
export PATH=/usr/tgcware/gcc34/bin:$PATH
reg prep
prep()
{
generic_prep
setdir source
# Set bugurl and vendor version
${__gsed} -i "s|URL:[^>]*|URL:$gccbugurl|" gcc/version.c
${__gsed} -i "s/$version/$version (release)/" gcc/version.c
${__gsed} -i "s/(release)/($gccpkgversion)/" gcc/version.c
}
reg build
build()
{
setup_tools
${__mkdir} -p ${srcdir}/$objdir
generic_build ../$objdir
}
reg install
install()
{
clean stage
setdir ${srcdir}/${objdir}
${__make} DESTDIR=$stagedir install
custom_install=1
generic_install
${__find} ${stagedir} -name '*.la' -print | ${__xargs} ${__rm} -f
# Rearrange libraries
redo_libs
# Remove obsolete gccbug script
${__rm} -f $stagedir$prefix/bin/gccbug
# Turn all the hardlinks in bin into symlinks
redo_bin
# Place share/docs in the regular location
prefix=$topinstalldir
doc COPYING* BUGS FAQ MAINTAINERS NEWS
}
reg check
check()
{
setdir source
setdir ../$objdir
${__make} -k check
}
reg pack
pack()
{
iprefix=${topdir}${abbrev_majorminor}
generic_pack
}
reg distclean
distclean()
{
META_CLEAN="$META_CLEAN compver.*"
clean distclean
${__rm} -rf $srcdir/$objdir
}
###################################################
# No need to look below here
###################################################
build_sh $*