• Advertisement
Sign in to follow this  

Trying to install gcc

This topic is 4432 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi I'm using Solaris 8, and I am trying to install the gcc compiler. I've unzipped the core and c++ gcc files into the gcc-4.0.2 directory, and I have tried calling ./configure, from inside the gcc directory. But it says this:
Quote:
# ./configure deloading cache ./config.cache checking host system type... i386-pc-solaris2.10 checking target system type... i386-pc-solaris2.10 checking build system type... i386-pc-solaris2.10 checking for a BSD compatible install... ./install-sh -c checking whether ln works... yes checking whether ln -s works... yes configure: error: Building in the source directory is not supported in this release. See http://gcc.gnu.org/install/configure.html for more details.
I then went to that link provided, but being fairly new to unix, I don't have a clue on how to install it. How would I install the gcc compiler? Thanks

Share this post


Link to post
Share on other sites
Advertisement
Create a new directory (preferrably one that isn't a subdirectory of where you untarred the source files), change directories to that directory and run configure from there.

Share this post


Link to post
Share on other sites
Here are the steps to compile gcc:

1. Unpack the sources to a folder, i.e. ~/gcc-4.0.2
2. Create a folder for building and cd to it, i.e. 'mkdir ~/build' and 'cd ~/build'
3. Call configure: '../gcc-4.0.2/configure --enable-languages=c,c++'
4. Build the compiler: 'make'
5. Install the compiler: 'sudo make install'

By default the gcc will be installed to /usr/local. After installing the compiler, you can delete the 'build' directory. To find out the configuration of your current gcc, try 'gcc -v'. You may also want to read the installation manual to find out about other configuration options:
http://gcc.gnu.org/install/configure.html

In some cases it may be necessary to bootstrap the compiler. This will create a basic version of the gcc which is used to compile the gcc suite. You can bootstrap your gcc by using 'make bootstrap' in step 4 instead of just 'make'.

Share this post


Link to post
Share on other sites
thanks,

The problem is I don't have the cc compiler installed in the first place to be able to compiler the gcc :(

I've searched over the internet, where people have mentioned the solaris cc compiler being a trial version which you download, so you can then use it to compile the gcc.

Unfortuently I can't find this cc trial compiler anywhere.

Share this post


Link to post
Share on other sites
You will at least need a C-compiler to create your gcc bootstrap compiler.
You can download a pre-build compiler from http://www.sunfreeware.com/

Another solution would be cross-compilation, i.e. from linux to solaris. But that is even more complicate.

Share this post


Link to post
Share on other sites
The stock development utilities are in /usr/ccs/bin. Make sure that is in your path. They are not the GNU versions, so you'll probably run into trouble building some software. You will want to replace those with the GNU versions at some point.

All of the GNU dev tools are at sunfreeware.com site in binary form.

Share this post


Link to post
Share on other sites
Quote:
Original post by igni ferroque
The stock development utilities are in /usr/ccs/bin. Make sure that is in your path. They are not the GNU versions, so you'll probably run into trouble building some software. You will want to replace those with the GNU versions at some point.

All of the GNU dev tools are at sunfreeware.com site in binary form.


Thanks, I added that to the path now.

I've also installed the gcc ver 2.95.2 from the sunfreeware site.

Now I'm trying to install the latest version gcc 4.0.2 which isn't provided at the sunfreeware site.

After calling "make" from the same directory ("/gcc") where I has previously called /sand/gcc-4.0.2/configure from, it gives me this error:
Quote:

# make
Configuring in fixincludes
configure: creating cache ./config.cache
checking build system type... i386-pc-solaris2.10
checking host system type... i386-pc-solaris2.10
checking target system type... i386-pc-solaris2.10
checking for i386-pc-solaris2.10-gcc... gcc
checking for C compiler default output file name... configure: error: C compiler cannot create executables
See `config.log' for more details.
*** Error code 1
The following command caused the error:
test ! -f fixincludes/Makefile || exit 0; [ -d fixincludes ] || mkdir fixincludes; r=`${PWDCMD-pwd}`; export r; s=`cd /sand/gcc-4.0.2; ${PWDCMD-pwd}`; export s; FLEX="`if [ -f $r/build-i386-pc-solaris2.10/flex/flex ] ; then echo $r/build-i386-pc-solaris2.10/flex/flex ; else echo /sand/gcc-4.0.2/missing flex ; fi`"; export FLEX; LEX="`if [ -f $r/build-i386-pc-solaris2.10/flex/flex ] ; then echo $r/build-i386-pc-solaris2.10/flex/flex ; else echo /sand/gcc-4.0.2/missing flex ; fi`"; export LEX; BISON="`if [ -f $r/build-i386-pc-solaris2.10/bison/tests/bison ] ; then echo $r/build-i386-pc-solaris2.10/bison/tests/bison ; else echo /sand/gcc-4.0.2/missing bison ; fi`"; export BISON; YACC="`if [ -f $r/build-i386-pc-solaris2.10/bison/tests/bison ] ; then echo $r/build-i386-pc-solaris2.10/bison/tests/bison -y ; elif [ -f $r/build-i386-pc-solaris2.10/byacc/byacc ] ; then echo $r/build-i386-pc-solaris2.10/byacc/byacc ; else echo /sand/gcc-4.0.2/missing bison -y ; fi`"; export YACC; M4="`if [ -f $r/build-i386-pc-solaris2.10/m4/m4 ] ; then echo $r/build-i386-pc-solaris2.10/m4/m4 ; else echo /sand/gcc-4.0.2/missing m4 ; fi`"; export M4; MAKEINFO="`if [ -f $r/build-i386-pc-solaris2.10/texinfo/makeinfo/Makefile ] ; then echo $r/build-i386-pc-solaris2.10/texinfo/makeinfo/makeinfo ; else if (/sand/gcc-4.0.2/missing makeinfo --version | egrep 'texinfo[^0-9]*([1-3][0-9]|4\.[2-9]|[5-9])') >/dev/null 2>&1; then echo /sand/gcc-4.0.2/missing makeinfo; else echo $s/missing makeinfo; fi; fi`"; export MAKEINFO; CC="gcc"; export CC; CFLAGS="-g -O2"; export CFLAGS; CONFIG_SHELL="/bin/sh"; export CONFIG_SHELL; CXX="c++"; export CXX; CXXFLAGS="-g -O2"; export CXXFLAGS; AR="ar"; export AR; AS="as"; export AS; CC_FOR_BUILD="gcc"; export CC_FOR_BUILD; DLLTOOL="dlltool"; export DLLTOOL; LD="/usr/ccs/bin/ld"; export LD; LDFLAGS=""; export LDFLAGS; NM="nm"; export NM; RANLIB=":"; export RANLIB; WINDRES="windres"; export WINDRES; OBJCOPY=""; export OBJCOPY; OBJDUMP=""; export OBJDUMP; TOPLEVEL_CONFIGURE_ARGUMENTS="/sand/gcc-4.0.2/configure --enable-languages=c,c++"; export TOPLEVEL_CONFIGURE_ARGUMENTS; GMPLIBS="-lmpfr -lgmp"; export GMPLIBS; GMPINC=""; export GMPINC; SET_GCC_LIB_PATH_CMD="LD_LIBRARY_PATH=/gcc/gcc; export LD_LIBRARY_PATH;"; export SET_GCC_LIB_PATH_CMD; LD_LIBRARY_PATH=/gcc/gcc; export LD_LIBRARY_PATH; echo Configuring in fixincludes; cd fixincludes || exit 1; case /sand/gcc-4.0.2 in \.) srcdiroption="--srcdir=."; libsrcdir=".";; /* | [A-Za-z]:[\\/]*) srcdiroption="--srcdir=/sand/gcc-4.0.2/fixincludes"; libsrcdir="$s/fixincludes";; *) srcdiroption="--srcdir=..//sand/gcc-4.0.2/fixincludes"; libsrcdir="$s/fixincludes";; esac; /bin/sh ${libsrcdir}/configure --cache-file=./config.cache --build=i386-pc-solaris2.10 --host=i386-pc-solaris2.10 --target=i386-pc-solaris2.10 --with-gcc-version-trigger=/sand/gcc-4.0.2/gcc/version.c --enable-languages=c,c++ --program-transform-name='s,y,y,' ${srcdiroption} || exit 1
make: Fatal error: Command failed for target `configure-fixincludes'



Any idea what this means?

Share this post


Link to post
Share on other sites
It sounds a lot like that the compiler you downloaded isn't installed correctly.

Share this post


Link to post
Share on other sites
Probably it would be a much better bet to install a precompiled gcc binary for solaris. I believe that sunfreeware.com has this sort of thing.

Mark

Share this post


Link to post
Share on other sites
Quote:
Original post by SiCrane
It sounds a lot like that the compiler you downloaded isn't installed correctly.


I went through a tutorial which says to call pkginfo -l SMCgcc to see if the installation worked, which is says it does,
Quote:

# pkginfo -l SMCgcc
PKGINST: SMCgcc
NAME: gcc
CATEGORY: application
ARCH: i86pc
VERSION: 2.95.2
BASEDIR: /usr/local
VENDOR: Free Software Foundation
PSTAMP: Steve Christensen
INSTDATE: Jan 02 2006 14:07
EMAIL: steve@smc.vnet.net
STATUS: completely installed
FILES: 351 installed pathnames
2 linked files
22 directories
23 executables
121048 blocks used (approx)



Could this possibly be a PATH problem? eg I haven't set all the required paths?

My current PATHs are /usr/sbin:/usr/bin
Thanks

Share this post


Link to post
Share on other sites
Quote:
Original post by johnnyBravo
After calling "make" from the same directory ("/gcc") where I has previously called /sand/gcc-4.0.2/configure from, it gives me this error:

...
Configuring in fixincludes
...

Any idea what this means?


The fixincludes utility is generated during the make process to modify some include files for your system. If this doesnt work you can try searching for a fixinlcudes patch. Also try 'make bootstrap' instead of just 'make'.

Share this post


Link to post
Share on other sites
I installed a patch for the fixincludes, but it didn't seem to make a difference.
Quote:

# patchadd -u gcc-2.95.3-no-fixinc.patch
Validating patches...

Loading patches installed on the system...

Done!

Loading patches requested to install.

Done!

No patches to check dependency.


I also tried the make bootstrap, which just gave me:
Quote:

# /usr/ccs/bin/make bootstrap
Configuring in build-i386-pc-solaris2.10/libiberty
configure: loading cache ../config.cache
checking whether to enable maintainer-specific portions of Makefiles... no
checking for makeinfo... /sand/gcc-4.0.2/missing makeinfo
configure: WARNING:
*** Makeinfo is missing. Info documentation will not be built.
checking for perl... perl
checking build system type... i386-pc-solaris2.10
checking host system type... i386-pc-solaris2.10
checking for i386-pc-solaris2.10-ar... no
checking for ar... no
checking for i386-pc-solaris2.10-ranlib... no
checking for ranlib... :
checking for i386-pc-solaris2.10-gcc... gcc
checking for suffix of object files... configure: error: cannot compute suffix of object files: cannot compile
See `config.log' for more details.
*** Error code 1
The following command caused the error:
test ! -f build-i386-pc-solaris2.10/libiberty/Makefile || exit 0; /bin/sh /sand/gcc-4.0.2/mkinstalldirs build-i386-pc-solaris2.10/libiberty ; r=`${PWDCMD-pwd}`; export r; s=`cd /sand/gcc-4.0.2; ${PWDCMD-pwd}`; export s; FLEX="`if [ -f $r/build-i386-pc-solaris2.10/flex/flex ] ; then echo $r/build-i386-pc-solaris2.10/flex/flex ; else echo /sand/gcc-4.0.2/missing flex ; fi`"; export FLEX; LEX="`if [ -f $r/build-i386-pc-solaris2.10/flex/flex ] ; then echo $r/build-i386-pc-solaris2.10/flex/flex ; else echo /sand/gcc-4.0.2/missing flex ; fi`"; export LEX; BISON="`if [ -f $r/build-i386-pc-solaris2.10/bison/tests/bison ] ; then echo $r/build-i386-pc-solaris2.10/bison/tests/bison ; else echo /sand/gcc-4.0.2/missing bison ; fi`"; export BISON; YACC="`if [ -f $r/build-i386-pc-solaris2.10/bison/tests/bison ] ; then echo $r/build-i386-pc-solaris2.10/bison/tests/bison -y ; elif [ -f $r/build-i386-pc-solaris2.10/byacc/byacc ] ; then echo $r/build-i386-pc-solaris2.10/byacc/byacc ; else echo /sand/gcc-4.0.2/missing bison -y ; fi`"; export YACC; M4="`if [ -f $r/build-i386-pc-solaris2.10/m4/m4 ] ; then echo $r/build-i386-pc-solaris2.10/m4/m4 ; else echo /sand/gcc-4.0.2/missing m4 ; fi`"; export M4; MAKEINFO="`if [ -f $r/build-i386-pc-solaris2.10/texinfo/makeinfo/Makefile ] ; then echo $r/build-i386-pc-solaris2.10/texinfo/makeinfo/makeinfo ; else if (/sand/gcc-4.0.2/missing makeinfo --version | egrep 'texinfo[^0-9]*([1-3][0-9]|4\.[2-9]|[5-9])') >/dev/null 2>&1; then echo /sand/gcc-4.0.2/missing makeinfo; else echo $s/missing makeinfo; fi; fi`"; export MAKEINFO; AR=""; export AR; AS=""; export AS; CC="gcc"; export CC; CFLAGS="-g -O2"; export CFLAGS; CONFIG_SHELL="/bin/sh"; export CONFIG_SHELL; CXX="c++"; export CXX; CXXFLAGS=""; export CXXFLAGS; GCJ=""; export GCJ; GFORTRAN=""; export GFORTRAN; DLLTOOL=""; export DLLTOOL; LD=""; export LD; LDFLAGS=""; export LDFLAGS; NM=""; export NM; RANLIB=""; export RANLIB; WINDRES=""; export WINDRES; echo Configuring in build-i386-pc-solaris2.10/libiberty; cd "build-i386-pc-solaris2.10/libiberty" || exit 1; case /sand/gcc-4.0.2 in /* | [A-Za-z]:[\\/]*) topdir=/sand/gcc-4.0.2 ;; *) case "build-i386-pc-solaris2.10" in .) topdir="..//sand/gcc-4.0.2" ;; *) topdir="../..//sand/gcc-4.0.2" ;; esac ;; esac; if [ "/sand/gcc-4.0.2" = "." ] ; then if [ "build-i386-pc-solaris2.10" != "." ] ; then if /bin/sh $s/symlink-tree ${topdir}/libiberty "no-such-file" ; then if [ -f Makefile ]; then if /usr/ccs/bin/make distclean; then true; else exit 1; fi; else true; fi; else exit 1; fi; else true; fi; srcdiroption="--srcdir=."; libsrcdir="."; else srcdiroption="--srcdir=${topdir}/libiberty"; libsrcdir="$s/libiberty"; fi; rm -f no-such-file || : ; CONFIG_SITE=no-such-file /bin/sh ${libsrcdir}/configure --cache-file=../config.cache --build=i386-pc-solaris2.10 --host=i386-pc-solaris2.10 --target=i386-pc-solaris2.10 --with-gcc-version-trigger=/sand/gcc-4.0.2/gcc/version.c --enable-languages=c,c++ --program-transform-name='s,y,y,' ${srcdiroption} --with-build-subdir="build-i386-pc-solaris2.10" || exit 1
make: Fatal error: Command failed for target `configure-build-libiberty'



Sorry to bombard you with all these menial task :)

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement