ProcessOne SiteCustomer Helpdesk and FeedbackFollow us on Twitter
 
   
 
header files path trouble
Posted: 21 May 2007 06:58 PM   [ Ignore ]
Newbie
Rank
Total Posts:  23
Joined  2007-05-06

Hi all

I was using cean while yaws was still installed at “default” location. Now I switched computers and realized that it is a bit ugly to set include path for the yaws header file inside custom erlang code with hardcoded file names. And even more ugly when updating via cean the yaws version. Anybody has a good idea how to handle that ?

regards
Roberto

Profile
 
 
Posted: 22 May 2007 03:54 PM   [ Ignore ]   [ # 1 ]
Newbie
Rank
Total Posts:  23
Joined  2007-05-06

Also having the same problem with Emakefiles.

In the following example is what I had hardcoded for a yaws non-cean default installation on Ubuntu Linux:
 

{"src/erlyweb/*"[debug_info{outdir"ebin"}{i,"/usr/local/src/yaws/include"}]}

Now I have hardcoded this (for cean-based yaws on OS X)

{"src/erlyweb/*"[debug_info{outdir"ebin"}{i,"/Users/rsaccon/cean/erlang/lib/yaws-1.68/include"}]}


Anybody knows a better (and not hardcoded) way to handle this ?

Roberto

Profile
 
 
Posted: 23 May 2007 10:04 AM   [ Ignore ]   [ # 2 ]
Senior Member
Avatar
RankRankRankRank
Total Posts:  134
Joined  2006-11-13

may ………/cean/erlang/include/yaws being a symlink to ......./cean/erlang/lib/yaws-1.68/include help ?
it would be easy to let cean make such a symlink at install

Profile
 
 
Posted: 23 May 2007 10:44 AM   [ Ignore ]   [ # 3 ]
Newbie
Rank
Total Posts:  23
Joined  2007-05-06

yeah, that for sure would help.

And just a further quick thought here: If cean would set and export and environment variable, other erlang apps theoretically could detect whether there are running in a cean erlang vm. However, I don’t know how this would work along all plattforms.

Profile
 
 
Posted: 04 June 2007 03:31 PM   [ Ignore ]   [ # 4 ]
Senior Member
Avatar
RankRankRankRank
Total Posts:  134
Joined  2006-11-13

automatic generation of include links into pipe for next release, planed next week.
under CEAN, if started with given start.sh, you will ALWAYS have the following variables
- ARCHDIR defined to your platform (linux-x86, darwin-x86, windows, etc…)
- PROGNAME defined to cean

so yes, application can know if running into cean or not.

Profile
 
 
Posted: 04 June 2007 03:32 PM   [ Ignore ]   [ # 5 ]
Senior Member
Avatar
RankRankRankRank
Total Posts:  134
Joined  2006-11-13

i patched start.bat to make that varaibles available under windows as well.

Profile
 
 
Posted: 04 June 2007 03:51 PM   [ Ignore ]   [ # 6 ]
Newbie
Rank
Total Posts:  23
Joined  2007-05-06

One more feature request: can you export also BASEDIR in start.sh ?

Then it will be easy to detect not only whether but also where cean is installed for setting include paths in Emakefiles

Roberto

Profile
 
 
Posted: 04 June 2007 04:07 PM   [ Ignore ]   [ # 7 ]
Senior Member
Avatar
RankRankRankRank
Total Posts:  134
Joined  2006-11-13

you already have ROOTDIR exported, which is BASEDIR/erlang, the effective erlang directory.
the include directory will be located at $ROOTDIR/include

any reason I should export BASEDIR as well ?

Profile
 
 
Posted: 04 June 2007 06:28 PM   [ Ignore ]   [ # 8 ]
Newbie
Rank
Total Posts:  23
Joined  2007-05-06

that’s great, thanks. (wasn’t aware of ROOTDIR)

Roberto

Profile
 
 
Posted: 11 June 2007 05:33 PM   [ Ignore ]   [ # 9 ]
Newbie
Rank
Total Posts:  23
Joined  2007-05-06

Just an other idea to make Emakefiles work in default and cean environment:

Patching make module, so when make:all() gets called with include file options and from within cean, the patched make corrects on-the-fly the include path of include files contained in cean.

start.sh will need to set an “a -pa <Dir>” flag to the erl command.

Does that make sense or do I have missed something ?

Roberto

Profile
 
 
Posted: 15 June 2007 01:14 PM   [ Ignore ]   [ # 10 ]
Senior Member
Avatar
RankRankRankRank
Total Posts:  134
Joined  2006-11-13

i’m not sure this is required, with the include symlinks the only things we need is to call erlc with
-I path/to/cean/include/dependapp -I path/to/cean/include

-include(“header.hrl”) will work
-include(“dependapp/header.hrl”) will also work

Profile
 
 
Posted: 13 August 2010 06:05 AM   [ Ignore ]   [ # 11 ]
Newbie
Rank
Total Posts:  3
Joined  2010-07-12
rsaccon - 11 June 2007 05:33 PM

Just an other idea to make Emakefiles work in default and cean environment:

Patching make module, so when make:all() gets called with include file options and from within cean, the patched make corrects on-the-fly the include path of include files contained in cean.

start.sh will need to set an “a -pa <Dir>” flag to the erl command.

Does that make sense or do I have missed something ?

Roberto

I like this idea, will try and report the result soon. Thanks for sharing.

Profile