Skip to content

Commit

Permalink
Merge pull request #298 from v4hn/gcc-4.8
Browse files Browse the repository at this point in the history
gcc 4.8 is out.
  • Loading branch information
sofar committed May 4, 2013
2 parents 13c1d88 + 70dc561 commit 569cda3
Show file tree
Hide file tree
Showing 6 changed files with 60 additions and 123 deletions.
72 changes: 31 additions & 41 deletions compilers/gcc/BUILD
@@ -1,51 +1,41 @@
(
# move libstdc++.so.*-gdb.py to libexec dir
patch_it $SOURCE2 1 &&

patch_it $SOURCE_CACHE/$SOURCE2 1 &&
# installwatch fails to track files installed using tar
sedit 's;^\(build_install_headers_dir=\).*;\1install-headers-cp;' gcc/config.build &&

# This will fix an issue where installwatch fail to track installed headers
sedit 's;^\(build_install_headers_dir=\).*;\1install-headers-cp;' gcc/config.build &&
# We use libiberty.a from binutils instead
sedit 's/install_to_$(INSTALL_DEST) //' libiberty/Makefile.in &&

mkdir BUILD &&
cd BUILD &&
#sedit 's/trap 0/trap "" 0/' configure &&

#sedit 's/trap 0/trap "" 0/' ../configure &&
# We use libiberty.a from binutils instead
sedit 's/install_to_$(INSTALL_DEST) //' ../libiberty/Makefile.in &&
mkdir BUILD &&
cd BUILD &&

LANGUAGES="${LANGUAGES:=c++}" &&
LANGUAGES="${LANGUAGES:=c++}" &&

../configure --build=$BUILD \
--host=$BUILD \
--enable-languages=$LANGUAGES \
--prefix=${MODULE_PREFIX} \
--infodir=${MODULE_PREFIX}/share/info \
--mandir=${MODULE_PREFIX}/share/man \
--enable-__cxa_atexit \
--enable-threads \
--disable-nls \
--enable-target-optspace \
--with-gnu-ld \
--with-system-zlib \
--enable-shared \
$OPTS &&
../configure --build=$BUILD \
--host=$BUILD \
--enable-languages=$LANGUAGES \
--prefix=${MODULE_PREFIX} \
--infodir=${MODULE_PREFIX}/share/info \
--mandir=${MODULE_PREFIX}/share/man \
--enable-__cxa_atexit \
--enable-threads \
--disable-nls \
--enable-target-optspace \
--with-gnu-ld \
--with-system-zlib \
--enable-shared \
$OPTS &&

make CFLAGS='-O' LIBCFLAGS='-g -O2' LIBCXXFLAGS='-g -O2 -fno-implicit-templates' bootstrap-lean &&
prepare_install &&
make install &&
make CFLAGS='-O' LIBCFLAGS='-g -O2' LIBCXXFLAGS='-g -O2 -fno-implicit-templates' bootstrap-lean &&
prepare_install &&
make install &&

# This used to be the POST_INSTALL and it really should not have. Doing this sort of thing means
# these files will not be tracked; that is a no-no-no.

cd /usr/lib/gcc/$BUILD/$VERSION &&
ln -sf /usr/bin/cpp cpp &&
cd /lib/ &&
ln -sf /usr/bin/cpp cpp &&

if [ ! -e /usr/bin/cc ] ; then
ln -s gcc /usr/bin/cc
fi &&
ln -sf /usr/bin/cpp /usr/lib/gcc/$BUILD/$VERSION/cpp &&
ln -sf /usr/bin/cpp /lib/cpp &&
ln -sf gcc /usr/bin/cc &&

# remove the offending broken freetype link
rm -f $MODULE_PREFIX/lib/gcc/$BUILD/$VERSION/include-fixed/freetype

) > $C_FIFO 2>&1
rm -f $MODULE_PREFIX/lib/gcc/$BUILD/$VERSION/include-fixed/freetype
53 changes: 0 additions & 53 deletions compilers/gcc/BUILD.x86_64

This file was deleted.

1 change: 0 additions & 1 deletion compilers/gcc/CONFIGURE
@@ -1,4 +1,3 @@

# only lin -r gcc will trigger the language selector!
if [ -n "$RECONFIGURE" ] ; then

Expand Down
6 changes: 3 additions & 3 deletions compilers/gcc/DETAILS
@@ -1,16 +1,16 @@
MODULE=gcc
VERSION=4.7.3
VERSION=4.8.0
SOURCE=$MODULE-$VERSION.tar.bz2
SOURCE2=$MODULE-4.5.0-python.patch.bz2
SOURCE_URL[0]=$GNU_URL/gcc/$MODULE-$VERSION
SOURCE_URL[1]=ftp://gcc.gnu.org/pub/gcc/releases/gcc-$VERSION
SOURCE_URL[2]=http://www.online-mirror.org/gcc/$MODULE-$VERSION
SOURCE2_URL=$PATCH_URL
SOURCE_VFY=sha1:69e02737bd6e1a7c6047d801600d39c32b9427ca
SOURCE_VFY=sha1:b4ee6e9bdebc65223f95067d0cc1a634b59dad72
SOURCE2_VFY=sha1:7c1fc0b526b74cce301b85acee04011ed6e5aa5a
WEB_SITE=http://gcc.gnu.org
ENTERED=20020628
UPDATED=20130414
UPDATED=20130403
SHORT="GNU compiler collection"

cat << EOF
Expand Down
2 changes: 2 additions & 0 deletions compilers/gcc/PRE_BUILD.x86_64
@@ -0,0 +1,2 @@
OPTS+=" --disable-multilib" &&
default_pre_build
@@ -1,16 +1,16 @@
#
# gcc-4.7.x compiler optimizations plugin
# gcc-4.8.x compiler optimizations plugin
#

plugin_compiler_gcc_4_7_optimize()
plugin_compiler_gcc_4_8_optimize()
{
if [ "${LUNAR_COMPILER:-GCC_4_7}" != "GCC_4_7" ]; then
if [ "${LUNAR_COMPILER:-GCC_4_8}" != "GCC_4_8" ]; then
return 2
fi

debug_msg "plugin_compiler_gcc_4_7_optimize($@)"
if [ -f /etc/lunar/local/optimizations.GCC_4_7 ]; then
. /etc/lunar/local/optimizations.GCC_4_7
debug_msg "plugin_compiler_gcc_4_8_optimize($@)"
if [ -f /etc/lunar/local/optimizations.GCC_4_8 ]; then
. /etc/lunar/local/optimizations.GCC_4_8
fi

# some local macro's
Expand Down Expand Up @@ -49,7 +49,7 @@ plugin_compiler_gcc_4_7_optimize()
if [ "$CPU" != "None" -a -n "$CPU" ]; then
c_cxx_flags_add "-march=$CPU"
fi
# CFLAGS -mtune cpu-specific tuning
# CFLAGS -mtune cpu-specific tuning
if [ "$CPUTUNE" != "None" -a -n "$CPUTUNE" ]; then
c_cxx_flags_add "-mtune=$CPUTUNE"
fi
Expand Down Expand Up @@ -159,26 +159,26 @@ plugin_compiler_gcc_4_7_optimize()
}


plugin_compiler_gcc_4_7_menu()
plugin_compiler_gcc_4_8_menu()
{
# The main code calls this function WITHOUT $1 to find out which
# compiler optimization plugins exist. It then returns the plugin
# identifier which can be saved in $LUNAR_COMPILER as the user's
# choice for COMPILERS
if [ -z "$1" ]; then
echo "GCC_4_7"
echo "GNU C Compiler suite version 4.7.x"
echo "GCC_4_8"
echo "GNU C Compiler suite version 4.8.x"
return 2
elif [ "$1" != "GCC_4_7" ]; then
elif [ "$1" != "GCC_4_8" ]; then
# we don't display anything when the user selected a
# different menu
return 2
fi

# now we are done with determining if we are really the menu
# that the user wants - so we can display it
menu()
{
menu()
{
unset RESULT
if [ "$1" == "checklist" ]; then
RESULT=`$DIALOG --no-cancel --item-help --separate-output --checklist "$2" 0 0 0 "${OPTIONS[@]}"`
Expand All @@ -198,7 +198,7 @@ plugin_compiler_gcc_4_7_menu()
save_optimizations()
{
debug_msg "save_optimizations($@)"
cat >/etc/lunar/local/optimizations.GCC_4_7 <<EOF
cat >/etc/lunar/local/optimizations.GCC_4_8 <<EOF
CPU=$CPU
CPUTUNE=$CPUTUNE
BOPT=$BOPT
Expand All @@ -210,8 +210,8 @@ STACK=$STACK
EOF
}

if [ -f /etc/lunar/local/optimizations.GCC_4_7 ]; then
. /etc/lunar/local/optimizations.GCC_4_7
if [ -f /etc/lunar/local/optimizations.GCC_4_8 ]; then
. /etc/lunar/local/optimizations.GCC_4_8
fi

export IFS=$'\t\n'
Expand All @@ -221,7 +221,7 @@ EOF

while true; do
unset OPTIONS
IS_DEFAULT=$([ "$(get_local_config LUNAR_COMPILER)" == "GCC_4_7" ] && echo DEFAULT || get_local_config LUNAR_COMPILER)
IS_DEFAULT=$([ "$(get_local_config LUNAR_COMPILER)" == "GCC_4_8" ] && echo DEFAULT || get_local_config LUNAR_COMPILER)
DEFAULT=${CHOICE:-safe}
CHOICE=`$DIALOG --title "$TITLE" --ok-label "Select" --cancel-label "Close" --default-item "$DEFAULT" --item-help --menu "" 0 0 0 $(
echo "default"
Expand Down Expand Up @@ -270,11 +270,11 @@ EOF
return
fi

case $CHOICE in
case $CHOICE in
default)
if [ "$IS_DEFAULT" != "DEFAULT" ]; then
set_local_config LUNAR_COMPILER GCC_4_7
$DIALOG --msgbox "Gcc 4.7 is now the default compiler!" 6 60
set_local_config LUNAR_COMPILER GCC_4_8
$DIALOG --msgbox "Gcc 4.8 is now the default compiler!" 6 60
fi
;;
safe)
Expand Down Expand Up @@ -496,7 +496,7 @@ EOF
OPTIONS=(
"None" "Use compiler default" $([ "$FPM" == "None" ] && echo "on" || echo "off" ) "Use compiler default"
)
case $PLATFORM in
case $PLATFORM in
x86|x86_64)
if grep '^fpu' /proc/cpuinfo | grep -qw yes; then
OPTIONS=(
Expand Down Expand Up @@ -549,7 +549,7 @@ EOF
fi
if grep -qw sse /proc/cpuinfo; then
OPTIONS=(
${OPTIONS[@]}
${OPTIONS[@]}
"SSE" "SSE" $( echo ${XTRA[@]} | grep -q "SSE" && echo "on" || echo "off" ) "Streaming SIMD (Single Instruction, Multiple Data) Extensions"
)
fi
Expand Down Expand Up @@ -665,6 +665,5 @@ EOF
}


plugin_register BUILD_BUILD plugin_compiler_gcc_4_7_optimize
plugin_register OPTIMIZE_MENU plugin_compiler_gcc_4_7_menu

plugin_register BUILD_BUILD plugin_compiler_gcc_4_8_optimize
plugin_register OPTIMIZE_MENU plugin_compiler_gcc_4_8_menu

0 comments on commit 569cda3

Please sign in to comment.