Help with shc

Hi all,

I'm trying to install shc on my clean solaris 10 so that I could do some encrypting on my shell scripts.

I've tried several ways but it gave me these error messages


# make
cc -Wall -O6 shc.c -o shc
cc: illegal option -Wall
*** Error code 1
make: Fatal error: Command failed for target `shc'
# make install
cc -Wall -O6 shc.c -o shc
cc: illegal option -Wall
*** Error code 1
make: Fatal error: Command failed for target `shc'
# install -c /usr/local/bin -s shc /usr/local/bin
cp: cannot access shc
install: cp shc /usr/local/bin/shc failed 
# install -c /usr/local/man/man1 -s shc.1 /usr/local/man/man1
cp: cannot create /usr/local/man/man1/shc.1: No such file or directory
install: cp shc.1 /usr/local/man/man1/shc.1 failed 

Is there dependencies that I'm lacking? Or is there any extra packages that I need to install?

It seems obvious the error is:

Did you check your version of cc and see how the -Wall switch works?

I'm not a Solaris cc expert, but it seems that the -Wall switch is not supported, when we read the Solaris cc man page:

     -Wc,arg
          Passes the argument arg to c.  Each argument must be
          separated from the preceding by only a comma.  (A comma
          can be part of an argument by escaping it by an immedi-
          ately preceding backslash (\) character; the backslash
          is removed from the resulting argument.)  All -W argu-
          ments are passed after the regular command-line argu-
          ments.
          c can be one of the following:

               a    Assembler: (fbe), (gas)
               c    C code generator: (cg)(SPARC)
               d    cc driver (1)
               h    Intermediate code translator (ir2hf)(x86)
               i    Interprocedure analysis (ube_ipa)(x86)
               l    Link editor (ld)
               m    mcs
               0    (Captial letter 'o') Interprocedural optim-
                    izer
               o    Postoptimizer
               p    Preprocessor (cpp)
               u    C code generator (ube), (x86)
               0    (The number zero) Compiler (acomp) (ssbd
                    SPARC)
               2    Optimizer: (iropt)

          (1) Note: You cannot use -Wd to pass the cc options
          listed in this man page to the C compiler.

          For example, -Wa,-o,objfile passes -o and objfile to
          the assembler, in that order; also -Wl,-I,name causes
          the linking phase to override the default name of the
          dynamic linker, /usr/lib/ld.so.1.

          The order in which the argument(s) are passed to a tool
          with respect to the other specified command line
          options may change.

My cc version is:

 cc: Sun C 5.9 SunOS_i386 2007/05/03 

I downloaded the shc install package from

http://www.datsi.fi.upm.es/~frosal/

In the Makefile you'll find several CFLAGS definitions. Try commenting out every CFLAGS definition except:

CFLAGS = -fast -xO4 -s -v -Xa

Thanks Scrutinizer. I had the "make" command running without any errors.

However, I'm facing errors with "make install" command, which gave me the following error:

# make install
***     Installing shc and shc.1 on /usr/local
-n ***  Do you want to continue? 
yes
install -c -s shc /usr/local/bin/
install: The -c, -f, -n options each require a directory following!
*** Error code 2
make: Fatal error: Command failed for target `install'

If you are happy with this setting in the Makefile:

INSTALL_PATH = /usr/local

then create the directories first:

mkdir -p /usr/local/bin /usr/local/man/man1

I'm still getting the same error. Is it because my solaris machine does not recognize the "install" command? It seems that the error is related to "install"