No cc/gcc installed on SunOS 5.10

Hi All: this work machine has no gcc installed, the only cc is located at: /usr/ucb/cc but this does not do a make, I get error:

"/usr/ucb/cc: language optional software package not installed".

Meaning cc is not fully installed, correct?
I do not want to get root/sysadmin involved on this.

Question is: Can I download a local cc/gcc copy and install it locally under my home? If so, can I point it to /usr/include? (I checked and we do have that installed) Also keep in mind, I am doing a Pro*c code, and the "proc" in oracle, nicely converts the PC to C already, which means I will need to include the <sqlca.h> and I checked and we have that at: /usr/include/pgsql/sqlca.h

So will a local copy be able to include all that and compile my code.

Right now I am installing Solaris 10 (I hope exact same as sunos 5.10 on my home machine) and will compile there and x-fer back to work the result and hoping the generated binary can run fine on it..but as you can imagine this is a looong task, former is a lot faster and easier.

Thanks
Steve

You can either download Sun Studio 12 Compilers from Oracle ..., which are now "free" or you can download Sun Freeware gcc compiler package from sunfreeware DOT com. I can't seem to post URLs yet. Just google for Sun Studio 12 and there will be a download site.

1 Like

Double check gcc isn't installed on /usr/sfw/bin/gcc which is its default path on Solaris 10.

1 Like

At work (sunos 5.10), no, I got this:
> ls -l /usr/sfw/bin/gcc
/usr/sfw/bin/gcc: No such file or directory

But at home, (solaris 10), which I just finished installing, Yes, it's there!

But by default it's not in the PATH, can I just add it to the path and expect it to work? I notice gmake is also there.... should I add that plus the /usr/include for all the headers and it will do?

Just add /usr/sfw/bin to your PATH and you are done.

Just ask your admin to install gcc. It takes me less than 5 minutes to do it when app departments ask for it. It's a very common request, and causes no down time. Your admin can quickly grab it off of sunfreeware.

Trust me, I beleive you, politics, I don't want visibility on this task.

I have new issue: tar xvf does not work on my own machine...I am root, when I tar it says "cannot create" on all the files...

I think you're looking for the command "tar cvf" to create files.... x is for extracting.

no, I am trying to extract

maybe a bad tar file or you ran out of disk space

no, space is fine.
same file got exyracted on cygwin fine.

see if you can extract it: http://www.datsi.fi.upm.es/~frosal/sources/shc-3.8.7.tgz it's a .gz

---------- Post updated at 12:28 AM ---------- Previous update was at 12:15 AM ----------

first you have to gunzip that...
then do tar xvf...

I get "cannot create"..I am logged in as root, so maybe something to do with write permissions...even though I can create files...so beats me.

I was able to extract it just fine.

-bash-3.00$ mkdir temp2
-bash-3.00$ cd temp2
-bash-3.00$ ls
shc-3.8.7.tgz
-bash-3.00$ gunzip shc-3.8.7.tgz
-bash-3.00$ ls
shc-3.8.7.tar
-bash-3.00$ tar xfv shc-3.8.7.tar
x shc-3.8.7/CHANGES, 3637 bytes, 8 tape blocks
x shc-3.8.7/Copying, 17982 bytes, 36 tape blocks
x shc-3.8.7/Makefile, 1940 bytes, 4 tape blocks
x shc-3.8.7/match, 336 bytes, 1 tape blocks
x shc-3.8.7/pru.sh, 155 bytes, 1 tape blocks
x shc-3.8.7/shc-3.8.7.c, 24962 bytes, 49 tape blocks
x shc-3.8.7/shc.1, 3136 bytes, 7 tape blocks
x shc-3.8.7/shc.README, 1544 bytes, 4 tape blocks
x shc-3.8.7/shc.c symbolic link to shc-3.8.7.c
x shc-3.8.7/shc.html, 4558 bytes, 9 tape blocks
x shc-3.8.7/test.bash, 138 bytes, 1 tape blocks
x shc-3.8.7/test.csh, 52 bytes, 1 tape blocks
x shc-3.8.7/test.ksh, 142 bytes, 1 tape blocks
-bash-3.00$ ls -la
total 146
drwxr-xr-x 3 chris sysadmin 512 Sep 6 08:33 .
drwxr-xr-x 22 chris sysadmin 1024 Sep 6 08:32 ..
drwxr-xr-x 2 chris sysadmin 512 Sep 6 08:33 shc-3.8.7
-rw-r--r-- 1 chris sysadmin 71680 Sep 6 08:30 shc-3.8.7.tar
-bash-3.00$ cd shc-3.8.7
-bash-3.00$ ls
CHANGES Makefile pru.sh shc.1 shc.c test.bash test.ksh
Copying match shc-3.8.7.c shc.README shc.html test.csh
-bash-3.00$ ls -la
total 136
drwxr-xr-x 2 chris sysadmin 512 Sep 6 08:33 .
drwxr-xr-x 3 chris sysadmin 512 Sep 6 08:33 ..
-rw-r----- 1 chris sysadmin 3637 Feb 10 2010 CHANGES
-rw-r----- 1 chris sysadmin 17982 May 9 1996 Copying
-rw-r----- 1 chris sysadmin 1940 Feb 10 2010 Makefile
-rwxr-x--- 1 chris sysadmin 336 Feb 21 2003 match
-rwxr-x--- 1 chris sysadmin 155 Jun 19 2003 pru.sh
-rw-r----- 1 chris sysadmin 24962 Feb 10 2010 shc-3.8.7.c
-rw-r----- 1 chris sysadmin 3136 Jul 8 2004 shc.1
-rw-r----- 1 chris sysadmin 1544 Jun 19 2003 shc.README
lrwxrwxrwx 1 chris sysadmin 11 Sep 6 08:33 shc.c -> shc-3.8.7.c
-rw-r----- 1 chris sysadmin 4558 Jul 8 2004 shc.html
-rwxr-x--- 1 chris sysadmin 138 Nov 12 2004 test.bash
-rwxr-x--- 1 chris sysadmin 52 Jun 19 2003 test.csh
-rwxr-x--- 1 chris sysadmin 142 Jan 18 2008 test.ksh
-bash-3.00$ head -30 shc.README

Purpose:

    A generic shell script compiler. Shc takes a script, which is
    specified on the command line and produces C source code. The
    generated source code is then compiled and linked to produce a
    stripped binary executable. Use with care.

Building:

    Just do a "make"

Testing:

Try: "make test"
or: "shc -v -f match" then "match.x sh"

    Caveat emptor: see Copyright

    The results look fine to me, but I havn't used this in anger, but
    the author has used shc for his work widely over SunOS, Solaris and
    Linux, and done some testing on Irix and HPUX.

    We tested it on a few SMALL ksh scripts - big tasks should probably
    be written in C in the first place \(see \_SC\_ARG_MAX below\)!

Bugs:

-bash-3.00$

I noticed 2 things:

1) the link I sent you has ".tgz" as the link, but the actual downloaded file is ".gz"....yet you gunzipped "tgz", did you rename it?

2) once you gunzip the file, in my case, I do not get a "tar" extension, in your case I see a ".tar" at the end of the filename. Again, how is this different and why?

It's not a zip file, it's a gzip. You have to use the gunzip command, followed by the tar command.

If it were Linux you could just do a tar xfvz, but the z option doesn't exist Solaris, so you have to gunzip it first. You could do it all one one command using pipe, but I just did it in two separate commands.

the extension ".tar" makes a difference! It's dumb.
I renamed the file to file.tar and it untarred fine.

If it does not have tar extension, tar on Solaris 10 did not do it! Even though it is the same file.

".tgz" files are normally short for "tar.gz"

1 Like

ahh... hence a manual rename step is needed in between for Solaris.

Again, it is really dumb that Solaris cannot untar a file which simply does not have a .tar extension

It would be dumb if it was real.
Just like most of Unix utilities, Solaris tar doesn't require any specific extension (or extension at all) for its input or output files.