I am working on Solaris 8. I have a few questions:
How do I determine if I have the CC compiler? I know it isn't in my $PATH, so how do I find it?
How do you install wget? I have read the INSTALL file, but I am not familar with the switches, i.e. ./configure --? . The file dosen't say specifically how to install. It is very fague for me as a new user of wget and GCC/CC compilers.
Try typing "gcc" at the command prompt. 'cc' is a purchased Sun compiler that most folks don't have. If that doesn't work, try:
$ grep gcc /var/sadm/install/contents
That might tell you where it was installed if it's a package installation. Otherwise you can try
# find / -name gcc -print
Note that you're root on that one.
If you want to install gcc, head out to http://www.sunfreeware.com and download it. There should be instructions on the site on how to install packages. If you're looking for gcc just so you can install wget, just retrieve wget from sunfreeware instead and install that.
On Solaris, (usually) if you haven't explicitly installed a C compiler, you won't be having one. Run 'pkginfo | grep -i compiler' or some such and check. If you don't get anything, you probably don't have it installed.
If you want to install gcc, I suggest that you go to sunfreeware.com and download the package directly. Don't fiddle around with the sources. Once you get that, just pkgadd and voila! You have gcc.
Regarding wget, just download the sources, extract from the tar. Then go to the directory where you have extracted the source and run "./configure". If you want to specify a specific path to install to, you can specify "./configure --prefix=your_install_path". There are a several other ways to configure, just check the README file. After the configuration is done, run "make" and then "make install". After this, with the default options, you will have wget in the /usr/local/bin directory.
Here is the output I received from grep gcc /var/sadm/install/contents
/usr/local/lib/libgcc_s.so=libgcc_s.so.1 s none SMClibgcc
/usr/local/lib/libgcc_s.so.1 f none 0644 bin bin 165280 24277 1089505610 SMClibgcc
/usr/local/lib/libstdc++.a f none 0644 bin bin 7294388 50147 1089505612 SMClibgcc
/usr/local/lib/libstdc++.la f none 0755 bin bin 1159 31501 1089505612 SMClibgcc
/usr/local/lib/libstdc++.so=libstdc++.so.6.0.1 s none SMClibgcc
/usr/local/lib/libstdc++.so.6=libstdc++.so.6.0.1 s none SMClibgcc
/usr/local/lib/libstdc++.so.6.0.1 f none 0755 bin bin 5348004 43669 1089505614 SMClibgcc
/usr/local/lib/sparcv9 d none 0755 bin bin SMClibgcc
/usr/local/lib/sparcv9/libgcc_s.so.1 f none 0644 bin bin 199936 65055 1089505615 SMClibgcc
/usr/local/lib/sparcv9/libgcc_s_sparcv9.so=libgcc_s.so.1 s none SMClibgcc
/usr/local/lib/sparcv9/libstdc++.a f none 0644 bin bin 10088392 40581 1089505619 SMClibgcc
/usr/local/lib/sparcv9/libstdc++.la f none 0755 bin bin 1368 50022 1089505619 SMClibgcc
/usr/local/lib/sparcv9/libstdc++.so=libstdc++.so.6.0.1 s none SMClibgcc
/usr/local/lib/sparcv9/libstdc++.so.6=libstdc++.so.6.0.1 s none SMClibgcc
/usr/local/lib/sparcv9/libstdc++.so.6.0.1 f none 0755 bin bin 6126992 30880 1089505621 SMClibgcc
Based on this information, I am assuming it is installed.
New question? Is there a switch to turn it on, because I am still getting gcc not found when trying to run ./configure?
I retreived gcc-3.4.6.tar.gz and gunzip and untarred it. I completed the following commands:
cd gcc-3.4.6
mkdir objdir
cd objdir
../configure
Here is what I received:
loading cache ./config.cache
checking host system type... sparc-sun-solaris2.8
checking target system type... sparc-sun-solaris2.8
checking build system type... sparc-sun-solaris2.8
checking for a BSD compatible install... ./install-sh -c
/usr/ucb/cc: language optional software package not installed
*** The command 'cc -o conftest -g conftest.c' failed.
*** You must set the environment variable CC to a working compiler.
I tried the following command from the gcc.gnu.org installation page:
loading cache ./config.cache
checking host system type... sparc-sun-solaris2.8
checking target system type... sparc-sun-solaris2.8
checking build system type... sparc-sun-solaris2.8
checking for a BSD compatible install... ../install-sh -c
../configure: cc: not found
*** The command 'cc -o conftest -g conftest.c' failed.
*** You must set the environment variable CC to a working compiler.
I received the same results...What am I doing incorrectly? How do I set the environment variable CC to a working compiler?
Just to clarify, I can install all packages that have .tar.gz with pkgadd. I was under the impression that in order to install packages with pkgadd, the term "pkgadd" must appear in the bundled software name. ex: "software.pkgadd" The package I retrieved was from sunfreeware. I checked again and there isn't a package with pkgadd in the name.
$ gcc test.c -o test
In file included from test.c:1:
/usr/local/lib/gcc/sparc-sun-solaris2.8/3.4.6/include/stdio.h:36:27: iso/stdio_iso.h: No such file or directory
In file included from test.c:1:
/usr/local/lib/gcc/sparc-sun-solaris2.8/3.4.6/include/stdio.h:194: error: syntax error before '*' token
/usr/local/lib/gcc/sparc-sun-solaris2.8/3.4.6/include/stdio.h:229: error: syntax error before '*' token
/usr/local/lib/gcc/sparc-sun-solaris2.8/3.4.6/include/stdio.h:230: error: syntax error before '*' token
/usr/local/lib/gcc/sparc-sun-solaris2.8/3.4.6/include/stdio.h:236: error: syntax error before "size_t"
/usr/local/lib/gcc/sparc-sun-solaris2.8/3.4.6/include/stdio.h:241: error: syntax error before "size_t"
/usr/local/lib/gcc/sparc-sun-solaris2.8/3.4.6/include/stdio.h:250: error: syntax error before '*' token
/usr/local/lib/gcc/sparc-sun-solaris2.8/3.4.6/include/stdio.h:252: error: syntax error before '*' token
/usr/local/lib/gcc/sparc-sun-solaris2.8/3.4.6/include/stdio.h:276: error: syntax error before '*' token
/usr/local/lib/gcc/sparc-sun-solaris2.8/3.4.6/include/stdio.h:285: error: syntax error before '*' token
/usr/local/lib/gcc/sparc-sun-solaris2.8/3.4.6/include/stdio.h:286: error: syntax error before "FILE"
/usr/local/lib/gcc/sparc-sun-solaris2.8/3.4.6/include/stdio.h:287: error: syntax error before '*' token
I also installed openssl-0.9.8d-sol8-sparc-local. I installed all of those to get pkg-get and wget installed and running. It is my understanding that pkg-get downloads and compiles everything for you, but I am very new to all of this...I could be wrong. I googled your problem and found this website: http://www.openldap.org/lists/openldap-software/200112/index.html\#00426
Look at the "RE: Newbie - Simple? installation problem"
Do I need to compile gcc outside of trying to run scripts? Why did I need to have gcc inorder to install wget and/or pkg-get. I've been back and forth with this for so long I've forgotten why I needed gcc in the first place.
If you are compiling wget from source, you'll need a gcc compiler. If you retrieve the wget binary package from http://www.sunfreeware.com, you can just use pkgadd and have it install the binary and you're ready to go. You might also need the openssl package if the wget binary expects it an you haven't compiled and installed it (you can retrieve the openssl package from the same site and install the binary).
If you really want a c compiler (and I personally believe a unix sysadmin should be able to read and compile source code), retrieve the gcc compiler from http://www.sunfreeware.com, install the package, read the README and INSTALL files for the openssl package. Follow those instructions. Read the README and INSTALL files for the wget package. Follow those instructions.
Once you've compiled and installed the two pieces of software, you'll be good to go.