Jump to content
  • Advertisement
Sign in to follow this  
johnnyBravo

Trying to install gcc

This topic is 4524 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
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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!