DaemonForums  

Go Back   DaemonForums > OpenBSD > OpenBSD General

OpenBSD General Other questions regarding OpenBSD which do not fit in any of the categories below.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 11th September 2010
laraaj laraaj is offline
New User
 
Join Date: Sep 2010
Posts: 2
Default shc unistd.h:239: error: syntax error before '&' token

Hello i'm trying to use the SHC scripts encryption tool datsi.fi.upm.es/~frosal/sources/shc.html
when i run "make" the program compiles successfully but it asks me to run the "make test" which issue an error message
Code:
 
shc: cc -Wall -O6 match.x.c -o match.x
In file included from match.x.c:123:
/usr/include/unistd.h:239: error: syntax error before '&' token
./shc: Undefined error: 0
*** Error code 1

Stop in /home/laraaj/shc-3.8.7 (line 43 of Makefile).
and i keep getting the same message when i try to use the compiled binary.

does anyone have any idea what's wrong, i only have this problem on BSD while it
works perfectly on Linux.
Reply With Quote
  #2   (View Single Post)  
Old 11th September 2010
ocicat ocicat is offline
Administrator
 
Join Date: Apr 2008
Posts: 3,318
Default

Quote:
Originally Posted by laraaj View Post
i only have this problem on BSD while it
works perfectly on Linux.
...which should tell you that the code was designed for Linux & not coded in a generic POSIX fashion.

Linux != OpenBSD. If you compare the hier(7) manpages between Linux & any of the *BSD family, you will see that there are significant differences. Likewise, while there are some common libraries between the two platforms, there are also differences here too.

The error cited in your OP looks like the effect of compiler differences. You did not specify which version of OpenBSD is being used, but I suspect the gcc version is 3.x. Most Linux distro's I have limited knowledge have moved to 4.x. OpenBSD 4.8 is the first version which uses 4.x as its default. Your other choice is to determine whether gcc 4.x is available in the packages/ports tree of whatever version of OpenBSD you are running & install the appropriate packages. The choice is yours.

Be aware that in general, this site only provides limited porting support. Porting can be very involved, & it requires significant experience. Unfortunately, supporting porting efforts generally requires significant knowledge of the problem domain, & to expect this level of support is not always realistic. However on occasion, regulars find particular problems interesting to explore.

So, take these comments & determine the compiler versions used. If you want to continue porting this application, you should download a snapshot of OpenBSD 4.8-current which may provide you with a compatible compiler similar to what you have on Linux.
Reply With Quote
  #3   (View Single Post)  
Old 11th September 2010
laraaj laraaj is offline
New User
 
Join Date: Sep 2010
Posts: 2
Default

Thanks alot for your quick replay.
shc is a very lightweight program all it does is to convert a shell script into a C binary
program that runs and invoke the specified shell then feed it the encrypted commands
from the original script.
the BSD's i tried to compile the program on are all remote server i can access through ssh accounts.
one of them is Openbsd version 4.7 with gcc version 3.3.5 (propolice).
here is a part of the make file of the program i think it's already made to run on
all Unix compatible operating systems not just Linux.
Code:
# Makefile
#

INSTALL_PATH = /usr/local

# For SCO
CFLAGS = -b elf -O -D_SVID

# For IRIX
CFLAGS = -xansi -fullwarn -O3 -g0

# For Solaris
CFLAGS = -fast -xO4 -s -v -Xa

# For HPUX
CFLAGS = -Wall -O -Ae

# For OSF1
CFLAGS = -w -verbose -fast -std1 -g0

# For GNU C compiler
CFLAGS = -Wall -O6 # -pedantic

SHELL = /bin/sh

all: shc ask_for_test

shc: shc.c
	$(CC) $(CFLAGS) $@.c -o $@
i just thought i would consult some BSD expects who may have came across the
same error message before and may have any idea how to solve it or if it doesn't
have any solutions.

after checking the header file /usr/include/unistd.h line 239. "int rfork(int opts);"
i think there is something wrong with a call to rfork function.
Reply With Quote
  #4   (View Single Post)  
Old 11th September 2010
ocicat ocicat is offline
Administrator
 
Join Date: Apr 2008
Posts: 3,318
Default

Quote:
Originally Posted by laraaj View Post
i just thought i would consult some BSD expects who may have came across the
same error message before...
Most of the regular members here do not port applications on a regular basis. However, you should be aware that make(1) in the *BSD world is not the same preached by GNU. For compatibility to the Richard Stallman world, you should ensure you are using gmake:

http://openports.se/devel/gmake
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Error with kdeaccessibility... valorisa OpenBSD Packages and Ports 3 10th June 2009 08:58 PM
help error darken FreeBSD General 1 21st September 2008 09:28 PM
VLC run error mfaridi OpenBSD Packages and Ports 14 29th May 2008 05:38 PM
error kde darken FreeBSD General 1 5th May 2008 08:45 PM
relayd (and hoststated) give syntax error for 'check script' gwl OpenBSD Security 2 2nd May 2008 04:53 PM


All times are GMT. The time now is 02:37 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick