Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Sat 10 Dec 2016, 12:50
All times are UTC - 4
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Compiling
GCC 4.7.3, 4.8.1 and 4.9.2 for Precise Puppy
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [7 Posts]  
Author Message
jlst

Joined: 23 Nov 2012
Posts: 510

PostPosted: Mon 02 Mar 2015, 23:33    Post subject:  GCC 4.7.3, 4.8.1 and 4.9.2 for Precise Puppy  

You must first load/install devx_precise_5.7.1.sfs

Download: gcc-4.7.3_4.8.1_4.9.2-ppa-precise.sfs

----------------------------------------------------------------------------------------

While I was looking for a way to compile applications that require a newer GCC version than the one in Precise Puppy, I found this page:

https://launchpad.net/~ubuntu-toolchain-r/+archive/ubuntu/test/+packages?field.name_filter=&field.status_filter=published&field.series_filter=precise

I downloaded the deb files and chose the ones related to GCC, then I made a single package.

I have only tested GCC 4.7.3... seems to work as I compiled Audacious 3.6.

I also wrote a simple script to switch between the GCC versions available, it is called 'gnugcc'.

This is how it works:

Back to top
View user's profile Send private message 
Jan99

Joined: 01 Jan 2013
Posts: 10

PostPosted: Mon 30 Mar 2015, 05:54    Post subject: GCC 4.7.3, 4.8.1 and 4.9.2 for Precise Puppy  

Thanks ,

Was able to compile libbpg (static) .
See http://murga-linux.com/puppy/viewtopic.php?t=97170

Only thing your scrip does 4.6 and 4.7
4.8 and 4.9 go to 4.7 (can easily be changed in script)
I did not do that as V4.7 worked for me.
Back to top
View user's profile Send private message 
Hesse James


Joined: 08 Feb 2010
Posts: 54

PostPosted: Sat 13 Jun 2015, 17:32    Post subject:  

Hi
My experience with this and Puppy Tahr:

As Jan99 said, you have to modify the script /sbin/gnugcc to switch the gcc versions.
You should replace in the file the exelist="gcc47" in line 107, 111 and 115 by the correct value "gcc48" or "gcc49" or "gcc410". ->Seems it was a copy and paste mistake.

Another thing: Tahr misses the lib "libmpc.so.2".

With this it should work also for you.

Best regards.
Christian
libmpc2_0.9-4_i386.deb.tar.gz
Description 
gz

 Download 
Filename  libmpc2_0.9-4_i386.deb.tar.gz 
Filesize  39.54 KB 
Downloaded  183 Time(s) 
Back to top
View user's profile Send private message 
jlst

Joined: 23 Nov 2012
Posts: 510

PostPosted: Sun 19 Jul 2015, 17:39    Post subject:  

Yes, thanks Hesse, I did fix that mistake the next week after I uploaded the file.
It's just that I'm very lazy to publish updates.

So besides that, here is a new update

/usr/bin/cc
/usr/bin/c++
were not being updated at all.

That could lead to compile errors, it happened to me.

Most apps look for gcc & g++ & cpp, but some just look for cc & c++

I paste here the code, in case anyone is interested

Code:

#!/bin/sh
#jlst 2015

#if ! which gcc 1>/dev/null 2>&1 ; then
#   echo "* ERROR: gcc is not present" ; exit 1;
#fi

echo '----------------------------------------'
[ -f /usr/bin/cc ] && file /usr/bin/cc
[ -f /usr/bin/c++ ] && file /usr/bin/c++
[ -f /usr/bin/cpp ] && file /usr/bin/cpp
[ -f /usr/bin/gcc ] && file /usr/bin/gcc
[ -f /usr/bin/g++ ] && file /usr/bin/g++
echo '----------------------------------------'

gcc46='/usr/bin/cpp-4.6
/usr/bin/g++-4.6
/usr/bin/gcc-4.6
/usr/bin/gcc-ar-4.6
/usr/bin/gccgo-4.6
/usr/bin/gcc-nm-4.6
/usr/bin/gcc-ranlib-4.6
/usr/bin/gcov-4.6
/usr/bin/gfortran-4.6
/usr/bin/gdc-4.7'

gcc47='/usr/bin/cpp-4.7
/usr/bin/g++-4.7
/usr/bin/gcc-4.7
/usr/bin/gcc-ar-4.7
/usr/bin/gccgo-4.7
/usr/bin/gcc-nm-4.7
/usr/bin/gcc-ranlib-4.7
/usr/bin/gcov-4.7
/usr/bin/gfortran-4.7
/usr/bin/gdc-4.7'

gcc48='/usr/bin/cpp-4.8
/usr/bin/g++-4.8
/usr/bin/gcc-4.8
/usr/bin/gcc-ar-4.8
/usr/bin/gccgo-4.8
/usr/bin/gcc-nm-4.8
/usr/bin/gcc-ranlib-4.8
/usr/bin/gcov-4.8
/usr/bin/gdc-4.8'

gcc49='/usr/bin/cpp-4.9
/usr/bin/g++-4.9
/usr/bin/gcc-4.9
/usr/bin/gcc-ar-4.9
/usr/bin/gccgo-4.9
/usr/bin/gcc-nm-4.9
/usr/bin/gcc-ranlib-4.9
/usr/bin/gcov-4.9
/usr/bin/gdc-4.9'

gcc410=''

read -r testx <<< "$gcc46"
if [ -x $testx ] ; then
   gcc46ok=1 ; GCC=1
fi

read -r testx <<< "$gcc47"
if [ -x "$testx" ] ; then
   gcc47ok=1 ; GCC=1
fi

read -r testx <<< "$gcc48"
if [ -x "$testx" ] ; then
   gcc48ok=1 ; GCC=1
fi

read -r testx <<< "$gcc49"
if [ -x "$testx" ] ; then
   gcc49ok=1 ; GCC=1
fi

read -r testx <<< "$gcc410"
if [ -x "$testx" ] ; then
   gcc410ok=1 ; GCC=1
fi

#could not find any
if [ ! "$GCC" ] ; then
   echo "* Could not find any GCC version..."
   [ -f /usr/lib/gcc/i686-linux-gnu/4.6/cc1 ] && $0 4.6
   [ -f /usr/lib/gcc/i686-linux-gnu/4.7/cc1 ] && $0 4.7
   [ -f /usr/lib/gcc/i686-linux-gnu/4.8/cc1 ] && $0 4.8
   [ -f /usr/lib/gcc/i686-linux-gnu/4.9/cc1 ] && $0 4.9
fi

###########################

version="$1"

if [ ! "$version" ] ; then
   echo "* Choose one of the following available GCC versions: "
   [ "$gcc46ok" ] && echo "   4.6"
   [ "$gcc47ok" ] && echo "   4.7"
   [ "$gcc48ok" ] && echo "   4.8"
   [ "$gcc49ok" ] && echo "   4.9"
   [ "$gcc410ok" ] && echo "   4.10"
   echo
   echo -n "Type a version number: "
   read version
fi

case $version in
   "4.6")
      [ ! "$gcc46ok" ] && echo "* ERROR" && exit
      exelist="$gcc46"
      ;;
   "4.7")
      [ ! "$gcc47ok" ] && echo "* ERROR" && exit
      exelist="$gcc47"
      ;;
   "4.8")
      [ ! "$gcc48ok" ] && echo "* ERROR" && exit
      exelist="$gcc48"
      ;;
   "4.9")
      [ ! "$gcc49ok" ] && echo "* ERROR" && exit
      exelist="$gcc49"
      ;;
   *)
      echo "* ERROR" && exit
      ;;
esac

if [ "$exelist" ] ; then
   rm -f /usr/bin/cc
   rm -f /usr/bin/c++
   ln -sfv gcc-${version} /usr/bin/cc
   ln -sfv g++-${version} /usr/bin/c++
   echo "$exelist" | while read exe ; do
      if [ -f $exe ] ; then
         name=${exe##*/}
         dir=${exe%/*}
         shortexe=${name%-*}
         rm -f ${dir}/${shortexe}
         ln -sfv ${name} ${dir}/${shortexe}
      fi
   done
fi

### END ###
Back to top
View user's profile Send private message 
jlst

Joined: 23 Nov 2012
Posts: 510

PostPosted: Mon 20 Jul 2015, 14:57    Post subject:  

I forgot to mention that (IN PRECISE PUPPY) if you compile with GCC 4.8 or 4.9, you will need the
updated GCC runtime libs, the ones from GCC 4.9.

Once you unload the SFS file, you won't be able to run apps compiled with GCC 4.8 or 4.9

These are the updated GCC runtime libs I've taken from GCC 4.9

----------------------------------------------------------------------
gcc-4.9.2-ppa-precise-runtime-i686.pet
----------------------------------------------------------------------
Back to top
View user's profile Send private message 
stemsee

Joined: 27 Jun 2013
Posts: 1844
Location: In The Way

PostPosted: Wed 05 Aug 2015, 05:39    Post subject:  

Thanks for this.

I made it all into one pet for tahr @ 97.9mb
in term run 'whichgcc'

https://drive.google.com/uc?id=0B4GhZVmB2Rkwbkp6MVdKaDNfa1E
Back to top
View user's profile Send private message MSN Messenger 
Layman806

Joined: 06 Oct 2016
Posts: 1

PostPosted: Thu 06 Oct 2016, 07:30    Post subject:  Thanks  

stemsee wrote:
Thanks for this.

I made it all into one pet for tahr @ 97.9mb
in term run 'whichgcc'

https://drive.google.com/uc?id=0B4GhZVmB2Rkwbkp6MVdKaDNfa1E


Thank you very much!! Surprised Very Happy
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 1 [7 Posts]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Compiling
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0474s ][ Queries: 12 (0.0042s) ][ GZIP on ]