Help with shc


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Help with shc
# 1  
Old 11-21-2010
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

Code:
# 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?
# 2  
Old 11-21-2010
It seems obvious the error is:
Quote:
cc -Wall -O6 shc.c -o shc
cc: illegal option -Wall
*** Error code 1
make: Fatal error: Command failed for target `shc'
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:
Code:
     -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.

# 3  
Old 11-21-2010
My cc version is:
Code:
 cc: Sun C 5.9 SunOS_i386 2007/05/03

I downloaded the shc install package from

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

# 4  
Old 11-21-2010
In the Makefile you'll find several CFLAGS definitions. Try commenting out every CFLAGS definition except:
Code:
CFLAGS = -fast -xO4 -s -v -Xa


Last edited by Scrutinizer; 11-21-2010 at 06:31 AM..
# 5  
Old 11-21-2010
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:

Code:
# 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'

# 6  
Old 11-21-2010
If you are happy with this setting in the Makefile:
Code:
INSTALL_PATH = /usr/local

then create the directories first:
Code:
mkdir -p /usr/local/bin /usr/local/man/man1

# 7  
Old 11-21-2010
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"
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Issue when executing shc command

Hi All, I am trying to create an executable using shc. I have a script which is creating 10 executables. The executables being created have the below issue. The message "Please contact your provider" is displayed even though I am not using the “-e” option. This message is coming for some... (5 Replies)
Discussion started by: temp_user
5 Replies

2. Red Hat

shc utility for background jobs

I have used shc utillity to convert a shell script to it's compiled version.Inside this script i have called another shell script which is also in compled version. Example:- Main script:- main.sh.x child script:- child.sh.x (this is called inside main.sh.x) This child script will run in... (2 Replies)
Discussion started by: millan
2 Replies

3. UNIX for Dummies Questions & Answers

Shc on SUN 5.10 SPARC

Hello, I would like to use shc on SUN 5.10 SPARC and HP UX Itanium 11.31 so that I could do some encrypting on my shell scripts. But on these machines I don"t have cc or gcc. I find a man who can download shc.c and send me the binary files. You can download it here : www datsi fi upm es... (3 Replies)
Discussion started by: peg
3 Replies

4. Shell Programming and Scripting

SHC Cron help-me

Hello, I have some shellscripts internal company more by the need to conceal the code to protect passwords and others, we are using the SHC. the shellscripts always worked without error, including cron. after the SHC, if I run manually (. / shellscript) it works if I put the same command... (3 Replies)
Discussion started by: c0i0t3
3 Replies

5. Shell Programming and Scripting

shc compiler issue

I am using the shc shell compiler, it works fine, just that when i execute it, it displays the code at the terminal. Is there any way to hide this as well? otherwise it beats the purpose of hiding the code. Thanks ! (7 Replies)
Discussion started by: ysvsr1
7 Replies

6. Shell Programming and Scripting

Need help - shc

I have two scripts test1.sh and test2.sh. test1.sh is calling test2.sh. test2.sh is having some functions and password which we are using in test1.sh test1.sh #!/bin/sh . test2.sh echo "$test"test2.sh #!/bin/sh test=pravinO/P pravin Now use shc to protect my test2.sh and i modified... (5 Replies)
Discussion started by: pravin27
5 Replies

7. Shell Programming and Scripting

Problems using shc

Hi all! First of all, sorry for my poor english :-S Well, I have some scripts in a SuSe server to encrypt... but all them must still working when I encrypt it, ok? About the server, I have root access: # id uid=0(root) gid=0(root) groups=0(root) # uname -a Linux servername... (4 Replies)
Discussion started by: Magius
4 Replies

8. Shell Programming and Scripting

SHC Compiler [ERROR] AIX

Hello there, I’m compiling a shell script under UNIX AIX 5.3 operating system. I’m facing a “glitch” when I tried to run the .x file AIX sent the error message “Killed”. # rpm -qa libgcc-4.2.0-3 libstdc++-4.2.0-3 gcc-4.2.0-3 libstdc++-devel-4.2.0-3 gcc-c++-4.2.0-3 # make *** ... (2 Replies)
Discussion started by: micrinho
2 Replies

9. Programming

How to call the c library created by shc

I have written a shell script called square, which prints the square of the input number, eg. > square 4 16 There is a program called shc which compiles the shell scirpt and create a executable file and a c library file, namely square.x and square.x.c repectively. If I would like to... (1 Reply)
Discussion started by: alfredo
1 Replies

10. Shell Programming and Scripting

shc: shell compiler?

Has anyone ever gotten shc compiler program to work. I am trying to encrypt a bash script on centos. When I run the command "shc -f test.sh", the binary actually gets created; however, when I try to run the binary I get the following the error: # ./test.sh.x ./test.sh.x: No such file or... (1 Reply)
Discussion started by: cstovall
1 Replies
Login or Register to Ask a Question