home *** CD-ROM | disk | FTP | other *** search
- /* Edge macro: hn_compilesettings
- **
- ** $VER: hn_compilesettings.edge 1.0 (16-Feb-93 00:15:52)
- **
- ** Usage: hn_compileoptions [COMPILER|OUTDIR|LINK|ARGUMENTS]
- **
- ** Synopsis: Change settings for hn_compile
- **
- ** Author: Henrik Nordström
- ** Ängsvägen 1
- ** S 756 45 Uppsala
- */
-
- options results
-
- parse upper arg mode
-
- 'getenvvar _fe_user8 RAW'
- settings=replacestar(result)
- parse var settings compilerflags ',' linkoptions ',' outdir ',' arguments
-
- select
- when mode='COMPILER' then do
- 'requeststring title "Compiler flags?" default "'compilerflags'"'
- ret=RC
- compilerflags=replacestar(RESULT)
- end
- when mode='OUTDIR' then do
- 'getenvvar _fe_path' /* Get file path */
- filepath=result
- 'currentdir "'filepath'"' /* And set it as working directory */
- oldcurdir=result;
- /* Request new output directory */
- 'requestfile TITLE "Compiler output directory?" PATH "'outdir'" DIR GETDIR'
- ret=RC
- outdir=RESULT
- if ret~=0 then exit(ret)
- 'currentdir "'oldcurdir'"' /* Restore working directory */
- if outdir~='' then do
- /* Make path absolute */
- call pragma('d',filepath);
- call pragma('d',outdir)
- outdir=pragma(d)
- if right(outdir,1)~=':' then
- outdir=outdir||'/'
- end
- end
- when mode='LINK' then do
- 'requeststring title "BLink options? ($**=obj $@=name)" default "'linkoptions'"'
- ret=RC
- linkoptions=replacestar(RESULT)
- end
- when mode='ARGUMENTS' then do
- 'requeststring title "Command arguments?" default "'arguments'"'
- ret=RC
- arguments=replacestar(RESULT);
- end
- otherwise do
- say 'MODE: "'mode'" unknown'
- say 'USAGE: hn_compilesettings [COMPILER|OUTDIR|LINK|ARGUMENTS]'
- exit(10)
- end
- end
-
- if ret=0 then 'putenvvar _fe_user8 "'compilerflags','linkoptions','outdir','arguments'"'
-
- exit(ret)
-
- /* Replace * with ** */
- replacestar: procedure
- str=arg(1)
- i=index(str,'*',1)
- do while i>0
- str=insert('*',str,i)
- i=index(str,'*',i+2)
- end
- return str
-