Three questions to start.sh in cean distribution
Posted: 05 February 2008 12:23 PM   [ Ignore ]
Newbie
Rank
Total Posts:  6
Joined  2008-02-05

Hi,

as a complete newbee, I have three questions related to the start.sh script:

-how exactly works ${1+"$@"} in the last line of start.sh ? I know what “$@” is, I also know the overall effect of this line, but not what happens here in detail ?

- What is erlexec, which is called by the last line in start.sh ? Is it a special kind of erl, or only a launcher ?

And the root of all these questions:
- How can I give a include directory to start.sh ? If I say “./start.sh -compile ... -I aDir” the aDir is ignored. Even if I add -include option or rearrange it. If I use erlc directly, it starts the shell but compile nothing.

I am using MacBook on latest MacOS X

Thanks for any help !

-Hans

Profile
 
 
Posted: 11 February 2008 08:51 PM   [ Ignore ]   [ # 1 ]
Moderator
Avatar
RankRankRank
Total Posts:  97
Joined  2006-11-13

default erl script calls erlexec ${1+"$@"}
start.sh script calls erlexec ${1+"$@"} as well
i don’t know exactly what the + is doing here anyway.
erlexec is the beam (VM) launcher
I have no clue why include does not work, you can add
set -x
into start.sh before the erlexec call, so we can see exactly what makes it different with calling erl directly.

Profile
 
 
Posted: 11 February 2008 10:30 PM   [ Ignore ]   [ # 2 ]
Newbie
Rank
Total Posts:  6
Joined  2008-02-05

Hi Christophe,

Christophe Romain - 11 February 2008 08:51 PM

I have no clue why include does not work, you can add
set -x
into start.sh before the erlexec call, so we can see exactly what makes it different with calling erl directly.

thanks for your answer. Calling .../cean/bin/erl directly (using set -x) seems to throw away all the command line arguments. start.sh does this right.

But I get not information to see why start.sh (or better said erlexec) is ignoring the -I switch. Calling ...../darwin-x86/bin/erlc directly results in message “erlc: Error 2 executing ‘erl’ “. Can it be that this erlc file is simply wrong ? It seems it is not the original erlc (you said in the other topic that erlc is not changed). Any way, I am completely confused

Best regards

Hans

Profile
 
 
Posted: 11 February 2008 10:34 PM   [ Ignore ]   [ # 3 ]
Newbie
Rank
Total Posts:  6
Joined  2008-02-05

Hi Christophe,

addition: calling ...../cean/bin/erlc (using set -x in start.sh) shows that here also all command line arguments are dropped out.

Best Regards

Hans

Profile
 
 
Posted: 11 February 2008 10:55 PM   [ Ignore ]   [ # 4 ]
Moderator
Avatar
RankRankRank
Total Posts:  97
Joined  2006-11-13

yes, erlc is not changed. but it might be stripped by the way.
there is one difference between start.sh and the official erl script: the PROGNAME variable.
into start.sh you have
PROGNAME=`echo $0 | sed ‘s/.*\///’`
change it to
PROGNAME=erl

i guess this might be the problem.

Profile
 
 
Posted: 11 February 2008 11:00 PM   [ Ignore ]   [ # 5 ]
Moderator
Avatar
RankRankRank
Total Posts:  97
Joined  2006-11-13

concerning the “erlc: Error 2 executing ‘erl’” error, i’m a bit surprised.
may your cean bin directory not added to your PATH ?
bin directory contains erl that calls start.sh. the reason for that is that CEANized erlang must be started some variables set such as your specific arch directory and the cean package mirror.

Profile
 
 
Posted: 12 February 2008 06:53 AM   [ Ignore ]   [ # 6 ]
Newbie
Rank
Total Posts:  6
Joined  2008-02-05

Hi Christophe,

Christophe Romain - 11 February 2008 10:55 PM

PROGNAME=`echo $0 | sed ‘s/.*\///’`
change it to
PROGNAME=erl

in my start.sh there is nothing like this. Instead, I have a line PROGNAME = cean. But I have set this one to PROGNAME=erl, nothing changed

Best Regards

Hans

Profile
 
 
Posted: 12 February 2008 07:01 AM   [ Ignore ]   [ # 7 ]
Newbie
Rank
Total Posts:  6
Joined  2008-02-05

Hi Christophe,

Christophe Romain - 11 February 2008 11:00 PM

concerning the “erlc: Error 2 executing ‘erl’” error, i’m a bit surprised.
may your cean bin directory not added to your PATH ?

Indeed, I added this to my PATH, the Error is gone. But as the guy in the other posting said:  it seems it calls simply erl (or the start.sh), because I see the debugging output (set -x) from start.sh. And no compilation happens, only Erlang shell comes up. If it calls erl, which itself calls start.sh, but dropping all arguments, it would be clear why there is no compilation.

Must be the “originial” erlc also an script ? Or in other words, the erl and erlc are both only launcher for the erlexec which starts the VM and core system ? Have I understood this right ?

Best regards

Hans

Profile