options.pas 62 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167
  1. {
  2. $Id$
  3. Copyright (c) 1998-2002 by Florian Klaempfl and Peter Vreman
  4. Reads command line options and config files
  5. This program is free software; you can redistribute it and/or modify
  6. it under the terms of the GNU General Public License as published by
  7. the Free Software Foundation; either version 2 of the License, or
  8. (at your option) any later version.
  9. This program is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License for more details.
  13. You should have received a copy of the GNU General Public License
  14. along with this program; if not, write to the Free Software
  15. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  16. ****************************************************************************
  17. }
  18. unit options;
  19. {$i fpcdefs.inc}
  20. interface
  21. uses
  22. globtype,globals,verbose,systems,cpuinfo;
  23. type
  24. TOption=class
  25. FirstPass,
  26. NoPressEnter,
  27. DoWriteLogo : boolean;
  28. FileLevel : longint;
  29. QuickInfo : string;
  30. ParaIncludePath,
  31. ParaUnitPath,
  32. ParaObjectPath,
  33. ParaLibraryPath : TSearchPathList;
  34. ParaAlignment : TAlignmentInfo;
  35. Constructor Create;
  36. Destructor Destroy;override;
  37. procedure WriteLogo;
  38. procedure WriteInfo;
  39. procedure WriteHelpPages;
  40. procedure WriteQuickInfo;
  41. procedure IllegalPara(const opt:string);
  42. function Unsetbool(var Opts:string; Pos: Longint):boolean;
  43. procedure interpret_proc_specific_options(const opt:string);virtual;
  44. procedure interpret_option(const opt :string;ispara:boolean);
  45. procedure Interpret_envvar(const envname : string);
  46. procedure Interpret_file(const filename : string);
  47. procedure Read_Parameters;
  48. procedure parsecmd(cmd:string);
  49. procedure TargetDefines(def:boolean);
  50. end;
  51. TOptionClass=class of toption;
  52. var
  53. coption : TOptionClass;
  54. procedure read_arguments(cmd:string);
  55. implementation
  56. uses
  57. widestr,
  58. {$IFDEF USE_SYSUTILS}
  59. SysUtils,
  60. {$ELSE USE_SYSUTILS}
  61. dos,
  62. {$ENDIF USE_SYSUTILS}
  63. version,
  64. cutils,cmsgs
  65. {$ifdef BrowserLog}
  66. ,browlog
  67. {$endif BrowserLog}
  68. ;
  69. const
  70. page_size = 24;
  71. var
  72. option : toption;
  73. read_configfile, { read config file, set when a cfgfile is found }
  74. disable_configfile,
  75. target_is_set : boolean; { do not allow contradictory target settings }
  76. asm_is_set : boolean; { -T also change initoutputformat if not set idrectly }
  77. fpcdir,
  78. ppccfg,
  79. ppcaltcfg,
  80. param_file : string; { file to compile specified on the commandline }
  81. {****************************************************************************
  82. Defines
  83. ****************************************************************************}
  84. procedure def_symbol(const s : string);
  85. begin
  86. if s='' then
  87. exit;
  88. initdefines.insert(upper(s));
  89. Message1(option_defining_symbol,s);
  90. end;
  91. procedure undef_symbol(const s : string);
  92. begin
  93. if s='' then
  94. exit;
  95. InitDefines.Remove(s);
  96. Message1(option_undefining_symbol,s);
  97. end;
  98. function check_symbol(const s:string):boolean;
  99. begin
  100. check_symbol:=(initdefines.find(s)<>nil);
  101. end;
  102. procedure set_default_link_type;
  103. begin
  104. { win32 and wdosx need smartlinking by default to prevent including too much
  105. dll dependencies }
  106. if (target_info.system in [system_i386_win32,system_i386_wdosx]) then
  107. begin
  108. def_symbol('FPC_LINK_SMART');
  109. undef_symbol('FPC_LINK_STATIC');
  110. undef_symbol('FPC_LINK_DYNAMIC');
  111. initglobalswitches:=initglobalswitches+[cs_link_smart];
  112. initglobalswitches:=initglobalswitches-[cs_link_shared,cs_link_static];
  113. end
  114. else
  115. begin
  116. undef_symbol('FPC_LINK_SMART');
  117. def_symbol('FPC_LINK_STATIC');
  118. undef_symbol('FPC_LINK_DYNAMIC');
  119. initglobalswitches:=initglobalswitches+[cs_link_static];
  120. initglobalswitches:=initglobalswitches-[cs_link_shared,cs_link_smart];
  121. end;
  122. end;
  123. {****************************************************************************
  124. Toption
  125. ****************************************************************************}
  126. procedure StopOptions(err:longint);
  127. begin
  128. if assigned(Option) then
  129. begin
  130. Option.free;
  131. Option:=nil;
  132. end;
  133. DoneVerbose;
  134. Stop(err);
  135. end;
  136. procedure Toption.WriteLogo;
  137. var
  138. p : pchar;
  139. begin
  140. p:=MessagePchar(option_logo);
  141. while assigned(p) do
  142. Comment(V_Normal,GetMsgLine(p));
  143. end;
  144. procedure Toption.WriteInfo;
  145. var
  146. p : pchar;
  147. hs,hs1,s : TCmdStr;
  148. target : tsystem;
  149. begin
  150. p:=MessagePchar(option_info);
  151. while assigned(p) do
  152. begin
  153. s:=GetMsgLine(p);
  154. { list OS Targets }
  155. if pos('$OSTARGETS',s)>0 then
  156. begin
  157. for target:=low(tsystem) to high(tsystem) do
  158. if assigned(targetinfos[target]) then
  159. begin
  160. hs:=s;
  161. hs1:=targetinfos[target]^.name;
  162. if tf_under_development in targetinfos[target]^.flags then
  163. hs1:=hs1+' (under development)';
  164. Replace(hs,'$OSTARGETS',hs1);
  165. Comment(V_Normal,hs);
  166. end;
  167. end
  168. else
  169. Comment(V_Normal,s);
  170. end;
  171. StopOptions(0);
  172. end;
  173. procedure Toption.WriteHelpPages;
  174. function PadEnd(s:string;i:longint):string;
  175. begin
  176. while (length(s)<i) do
  177. s:=s+' ';
  178. PadEnd:=s;
  179. end;
  180. var
  181. lastident,
  182. j,outline,
  183. ident,
  184. lines : longint;
  185. show : boolean;
  186. opt : string[32];
  187. input,
  188. s : string;
  189. p : pchar;
  190. begin
  191. WriteLogo;
  192. Lines:=4;
  193. Message1(option_usage,system.paramstr(0));
  194. lastident:=0;
  195. p:=MessagePChar(option_help_pages);
  196. while assigned(p) do
  197. begin
  198. { get a line and reset }
  199. s:=GetMsgLine(p);
  200. ident:=0;
  201. show:=false;
  202. { parse options }
  203. case s[1] of
  204. {$ifdef UNITALIASES}
  205. 'a',
  206. {$endif}
  207. {$ifdef EXTDEBUG}
  208. 'e',
  209. {$endif EXTDEBUG}
  210. {$ifdef i386}
  211. '3',
  212. {$endif}
  213. {$ifdef x86_64}
  214. '4',
  215. {$endif}
  216. {$ifdef m68k}
  217. '6',
  218. {$endif}
  219. {$ifdef arm}
  220. 'S',
  221. {$endif}
  222. {$ifdef powerpc}
  223. 'P',
  224. {$endif}
  225. {$ifdef sparc}
  226. 'S',
  227. {$endif}
  228. {$ifdef vis}
  229. 'V',
  230. {$endif}
  231. '*' : show:=true;
  232. end;
  233. if show then
  234. begin
  235. case s[2] of
  236. {$ifdef GDB}
  237. 'g',
  238. {$endif}
  239. {$ifdef Unix}
  240. 'L',
  241. {$endif}
  242. {$ifdef os2}
  243. 'O',
  244. {$endif}
  245. '*' : show:=true;
  246. else
  247. show:=false;
  248. end;
  249. end;
  250. { now we may show the message or not }
  251. if show then
  252. begin
  253. case s[3] of
  254. '0' : begin
  255. ident:=0;
  256. outline:=0;
  257. end;
  258. '1' : begin
  259. ident:=2;
  260. outline:=7;
  261. end;
  262. '2' : begin
  263. ident:=6;
  264. outline:=11;
  265. end;
  266. '3' : begin
  267. ident:=9;
  268. outline:=6;
  269. end;
  270. end;
  271. j:=pos('_',s);
  272. opt:=Copy(s,4,j-4);
  273. if opt='*' then
  274. opt:=''
  275. else
  276. if opt=' ' then
  277. opt:=PadEnd(opt,outline)
  278. else
  279. opt:=PadEnd('-'+opt,outline);
  280. if (ident=0) and (lastident<>0) then
  281. begin
  282. Comment(V_Normal,'');
  283. inc(Lines);
  284. end;
  285. { page full ? }
  286. if (lines >= page_size - 1) then
  287. begin
  288. if not NoPressEnter then
  289. begin
  290. Message(option_help_press_enter);
  291. readln(input);
  292. if upper(input)='Q' then
  293. StopOptions(0);
  294. end;
  295. lines:=0;
  296. end;
  297. Comment(V_Normal,PadEnd('',ident)+opt+Copy(s,j+1,255));
  298. LastIdent:=Ident;
  299. inc(Lines);
  300. end;
  301. end;
  302. StopOptions(0);
  303. end;
  304. procedure Toption.IllegalPara(const opt:string);
  305. begin
  306. Message1(option_illegal_para,opt);
  307. Message(option_help_pages_para);
  308. StopOptions(1);
  309. end;
  310. function Toption.Unsetbool(var Opts:string; Pos: Longint):boolean;
  311. { checks if the character after pos in Opts is a + or a - and returns resp.
  312. false or true. If it is another character (or none), it also returns false }
  313. begin
  314. UnsetBool := false;
  315. if Length(Opts)>Pos then
  316. begin
  317. inc(Pos);
  318. UnsetBool := Opts[Pos] = '-';
  319. if Opts[Pos] in ['-','+']then
  320. delete(Opts,Pos,1);
  321. end;
  322. end;
  323. procedure TOption.interpret_proc_specific_options(const opt:string);
  324. begin
  325. end;
  326. procedure TOption.interpret_option(const opt:string;ispara:boolean);
  327. var
  328. code : integer;
  329. c : char;
  330. more : string;
  331. major,minor : longint;
  332. error : integer;
  333. j,l : longint;
  334. d : DirStr;
  335. e : ExtStr;
  336. s : string;
  337. forceasm : tasm;
  338. begin
  339. if opt='' then
  340. exit;
  341. { only parse define,undef,target,verbosity and link options the firsttime }
  342. if firstpass and
  343. not((opt[1]='-') and (opt[2] in ['i','d','v','T','u','n','X'])) then
  344. exit;
  345. Message1(option_handling_option,opt);
  346. case opt[1] of
  347. '-' :
  348. begin
  349. more:=Copy(opt,3,255);
  350. if firstpass then
  351. Message1(option_interpreting_firstpass_option,opt)
  352. else
  353. Message1(option_interpreting_option,opt);
  354. case opt[2] of
  355. '?' :
  356. WriteHelpPages;
  357. 'a' :
  358. begin
  359. include(initglobalswitches,cs_asm_leave);
  360. j:=1;
  361. while j<=length(more) do
  362. begin
  363. case more[j] of
  364. 'l' :
  365. include(initglobalswitches,cs_asm_source);
  366. 'r' :
  367. include(initglobalswitches,cs_asm_regalloc);
  368. 't' :
  369. include(initglobalswitches,cs_asm_tempalloc);
  370. 'n' :
  371. include(initglobalswitches,cs_asm_nodes);
  372. 'p' :
  373. begin
  374. exclude(initglobalswitches,cs_asm_leave);
  375. if UnsetBool(More, 0) then
  376. exclude(initglobalswitches,cs_asm_pipe)
  377. else
  378. include(initglobalswitches,cs_asm_pipe);
  379. end;
  380. '-' :
  381. initglobalswitches:=initglobalswitches -
  382. [cs_asm_leave, cs_asm_source,cs_asm_regalloc, cs_asm_tempalloc,
  383. cs_asm_nodes, cs_asm_pipe];
  384. else
  385. IllegalPara(opt);
  386. end;
  387. inc(j);
  388. end;
  389. end;
  390. 'A' :
  391. begin
  392. if set_target_asm_by_string(More) then
  393. asm_is_set:=true
  394. else
  395. IllegalPara(opt);
  396. end;
  397. 'b' :
  398. begin
  399. {$ifdef supportbrowser}
  400. if UnsetBool(More,0) then
  401. begin
  402. exclude(initmoduleswitches,cs_browser);
  403. exclude(initmoduleswitches,cs_local_browser);
  404. {$ifdef BrowserLog}
  405. exclude(initglobalswitches,cs_browser_log);
  406. {$endif}
  407. end
  408. else
  409. begin
  410. include(initmoduleswitches,cs_browser);
  411. {$ifdef BrowserLog}
  412. include(initglobalswitches,cs_browser_log);
  413. {$endif}
  414. end;
  415. if More<>'' then
  416. if (More='l') or (More='l+') then
  417. include(initmoduleswitches,cs_local_browser)
  418. else
  419. if More='l-' then
  420. exclude(initmoduleswitches,cs_local_browser)
  421. else
  422. {$ifdef BrowserLog}
  423. browserlog.elements_to_list.insert(more);
  424. {$else}
  425. IllegalPara(opt);
  426. {$endif}
  427. {$endif supportbrowser}
  428. end;
  429. 'B' :
  430. do_build:=not UnSetBool(more,0);
  431. 'C' :
  432. begin
  433. j:=1;
  434. while j<=length(more) do
  435. begin
  436. case more[j] of
  437. 'a' :
  438. Message2(option_obsolete_switch_use_new,'-Ca','-Or');
  439. 'c' :
  440. begin
  441. if not SetAktProcCall(upper(copy(more,j+1,length(more)-j)),true) then
  442. IllegalPara(opt);
  443. break;
  444. end;
  445. {$ifdef cpufpemu}
  446. 'e' :
  447. begin
  448. If UnsetBool(More, j) then
  449. exclude(initmoduleswitches,cs_fp_emulation)
  450. Else
  451. include(initmoduleswitches,cs_fp_emulation);
  452. end;
  453. {$endif cpufpemu}
  454. 'f' :
  455. begin
  456. s:=upper(copy(more,j+1,length(more)-j));
  457. if not(SetFpuType(s,true)) then
  458. IllegalPara(opt);
  459. break;
  460. end;
  461. 'g' :
  462. include(initmoduleswitches,cs_create_pic);
  463. 'h' :
  464. begin
  465. val(copy(more,j+1,length(more)-j),heapsize,code);
  466. if (code<>0) or (heapsize<1024) then
  467. IllegalPara(opt);
  468. break;
  469. end;
  470. 'i' :
  471. If UnsetBool(More, j) then
  472. exclude(initlocalswitches,cs_check_io)
  473. else
  474. include(initlocalswitches,cs_check_io);
  475. 'n' :
  476. If UnsetBool(More, j) then
  477. exclude(initglobalswitches,cs_link_extern)
  478. Else
  479. include(initglobalswitches,cs_link_extern);
  480. 'o' :
  481. If UnsetBool(More, j) then
  482. exclude(initlocalswitches,cs_check_overflow)
  483. Else
  484. include(initlocalswitches,cs_check_overflow);
  485. 'p' :
  486. begin
  487. s:=upper(copy(more,j+1,length(more)-j));
  488. if not(SetProcessor(s,true)) then
  489. IllegalPara(opt);
  490. break;
  491. end;
  492. 'r' :
  493. If UnsetBool(More, j) then
  494. exclude(initlocalswitches,cs_check_range)
  495. Else
  496. include(initlocalswitches,cs_check_range);
  497. 'R' :
  498. If UnsetBool(More, j) then
  499. begin
  500. exclude(initlocalswitches,cs_check_range);
  501. exclude(initlocalswitches,cs_check_object);
  502. end
  503. Else
  504. begin
  505. include(initlocalswitches,cs_check_range);
  506. include(initlocalswitches,cs_check_object);
  507. end;
  508. 's' :
  509. begin
  510. val(copy(more,j+1,length(more)-j),stacksize,code);
  511. if (code<>0) or (stacksize>=67107840) or (stacksize<1024) then
  512. IllegalPara(opt);
  513. break;
  514. end;
  515. 't' :
  516. If UnsetBool(More, j) then
  517. exclude(initlocalswitches,cs_check_stack)
  518. Else
  519. include(initlocalswitches,cs_check_stack);
  520. 'D' :
  521. If UnsetBool(More, j) then
  522. exclude(initmoduleswitches,cs_create_dynamic)
  523. Else
  524. include(initmoduleswitches,cs_create_dynamic);
  525. 'X' :
  526. If UnsetBool(More, j) then
  527. exclude(initmoduleswitches,cs_create_smart)
  528. Else
  529. include(initmoduleswitches,cs_create_smart);
  530. else
  531. IllegalPara(opt);
  532. end;
  533. inc(j);
  534. end;
  535. end;
  536. 'd' :
  537. def_symbol(more);
  538. 'D' :
  539. begin
  540. include(initglobalswitches,cs_link_deffile);
  541. j:=1;
  542. while j<=length(more) do
  543. begin
  544. case more[j] of
  545. 'd' :
  546. begin
  547. description:=Copy(more,j+1,255);
  548. break;
  549. end;
  550. 'v' :
  551. begin
  552. dllversion:=Copy(more,j+1,255);
  553. l:=pos('.',dllversion);
  554. dllminor:=0;
  555. error:=0;
  556. if l>0 then
  557. begin
  558. valint(copy(dllversion,l+1,255),minor,error);
  559. if (error=0) and
  560. (minor>=0) and (minor<=$ffff) then
  561. dllminor:=minor
  562. else
  563. if error=0 then
  564. error:=1;
  565. end;
  566. if l=0 then
  567. l:=256;
  568. dllmajor:=1;
  569. if error=0 then
  570. valint(copy(dllversion,1,l-1),major,error);
  571. if (error=0) and (major>=0) and (major<=$ffff) then
  572. dllmajor:=major
  573. else
  574. if error=0 then
  575. error:=1;
  576. if error<>0 then
  577. Message1(scan_w_wrong_version_ignored,dllversion);
  578. break;
  579. end;
  580. 'w' :
  581. usewindowapi:=true;
  582. '-' :
  583. begin
  584. exclude(initglobalswitches,cs_link_deffile);
  585. usewindowapi:=false;
  586. end;
  587. else
  588. IllegalPara(opt);
  589. end;
  590. inc(j);
  591. end;
  592. end;
  593. 'e' :
  594. exepath:=FixPath(More,true);
  595. 'E' :
  596. begin
  597. if UnsetBool(More, 0) then
  598. exclude(initglobalswitches,cs_link_extern)
  599. else
  600. include(initglobalswitches,cs_link_extern);
  601. end;
  602. 'F' :
  603. begin
  604. c:=more[1];
  605. Delete(more,1,1);
  606. DefaultReplacements(More);
  607. case c of
  608. 'c' :
  609. begin
  610. if not(cpavailable(more)) then
  611. Message1(option_code_page_not_available,more)
  612. else
  613. initsourcecodepage:=more;
  614. end;
  615. 'D' :
  616. utilsdirectory:=FixPath(More,true);
  617. 'e' :
  618. SetRedirectFile(More);
  619. 'E' :
  620. OutputExeDir:=FixPath(More,true);
  621. 'i' :
  622. begin
  623. if ispara then
  624. ParaIncludePath.AddPath(More,false)
  625. else
  626. includesearchpath.AddPath(More,true);
  627. end;
  628. 'g' :
  629. Message2(option_obsolete_switch_use_new,'-Fg','-Fl');
  630. 'l' :
  631. begin
  632. if ispara then
  633. ParaLibraryPath.AddPath(More,false)
  634. else
  635. LibrarySearchPath.AddPath(More,true);
  636. end;
  637. 'L' :
  638. begin
  639. if More<>'' then
  640. ParaDynamicLinker:=More
  641. else
  642. IllegalPara(opt);
  643. end;
  644. 'o' :
  645. begin
  646. if ispara then
  647. ParaObjectPath.AddPath(More,false)
  648. else
  649. ObjectSearchPath.AddPath(More,true);
  650. end;
  651. 'r' :
  652. Msgfilename:=More;
  653. 'u' :
  654. begin
  655. if ispara then
  656. ParaUnitPath.AddPath(More,false)
  657. else
  658. unitsearchpath.AddPath(More,true);
  659. end;
  660. 'U' :
  661. OutputUnitDir:=FixPath(More,true);
  662. else
  663. IllegalPara(opt);
  664. end;
  665. end;
  666. 'g' : begin
  667. if UnsetBool(More, 0) then
  668. begin
  669. exclude(initmoduleswitches,cs_debuginfo);
  670. exclude(initglobalswitches,cs_gdb_dbx);
  671. exclude(initglobalswitches,cs_gdb_gsym);
  672. exclude(initglobalswitches,cs_gdb_heaptrc);
  673. exclude(initglobalswitches,cs_gdb_lineinfo);
  674. exclude(initlocalswitches,cs_checkpointer);
  675. end
  676. else
  677. begin
  678. {$ifdef GDB}
  679. include(initmoduleswitches,cs_debuginfo);
  680. {$else GDB}
  681. Message(option_no_debug_support);
  682. Message(option_no_debug_support_recompile_fpc);
  683. {$endif GDB}
  684. end;
  685. {$ifdef GDB}
  686. if not RelocSectionSetExplicitly then
  687. RelocSection:=false;
  688. j:=1;
  689. while j<=length(more) do
  690. begin
  691. case more[j] of
  692. 'd' :
  693. begin
  694. if UnsetBool(More, j) then
  695. exclude(initglobalswitches,cs_gdb_dbx)
  696. else
  697. include(initglobalswitches,cs_gdb_dbx);
  698. end;
  699. 'g' :
  700. begin
  701. if UnsetBool(More, j) then
  702. exclude(initglobalswitches,cs_gdb_gsym)
  703. else
  704. include(initglobalswitches,cs_gdb_gsym);
  705. end;
  706. 'h' :
  707. begin
  708. if UnsetBool(More, j) then
  709. exclude(initglobalswitches,cs_gdb_heaptrc)
  710. else
  711. include(initglobalswitches,cs_gdb_heaptrc);
  712. end;
  713. 'l' :
  714. begin
  715. if UnsetBool(More, j) then
  716. exclude(initglobalswitches,cs_gdb_lineinfo)
  717. else
  718. include(initglobalswitches,cs_gdb_lineinfo);
  719. end;
  720. 'c' :
  721. begin
  722. if UnsetBool(More, j) then
  723. exclude(initlocalswitches,cs_checkpointer)
  724. else
  725. include(initlocalswitches,cs_checkpointer);
  726. end;
  727. 'v' :
  728. begin
  729. if UnsetBool(More, j) then
  730. exclude(initglobalswitches,cs_gdb_valgrind)
  731. else
  732. include(initglobalswitches,cs_gdb_valgrind);
  733. end;
  734. 'w' :
  735. begin
  736. if UnsetBool(More, j) then
  737. exclude(initglobalswitches,cs_gdb_dwarf)
  738. else
  739. include(initglobalswitches,cs_gdb_dwarf);
  740. end;
  741. else
  742. IllegalPara(opt);
  743. end;
  744. inc(j);
  745. end;
  746. {$endif GDB}
  747. end;
  748. 'h' :
  749. begin
  750. NoPressEnter:=true;
  751. WriteHelpPages;
  752. end;
  753. 'i' :
  754. begin
  755. if More='' then
  756. WriteInfo
  757. else
  758. QuickInfo:=QuickInfo+More;
  759. end;
  760. 'I' :
  761. begin
  762. if ispara then
  763. ParaIncludePath.AddPath(More,false)
  764. else
  765. includesearchpath.AddPath(More,false);
  766. end;
  767. 'k' :
  768. begin
  769. if more<>'' then
  770. ParaLinkOptions:=ParaLinkOptions+' '+More
  771. else
  772. IllegalPara(opt);
  773. end;
  774. 'l' :
  775. DoWriteLogo:=not UnSetBool(more,0);
  776. 'm' :
  777. parapreprocess:=not UnSetBool(more,0);
  778. 'M' :
  779. begin
  780. more:=Upper(more);
  781. if not SetCompileMode(more, true) then
  782. IllegalPara(opt);
  783. end;
  784. 'n' :
  785. begin
  786. if More='' then
  787. disable_configfile:=true
  788. else
  789. IllegalPara(opt);
  790. end;
  791. 'o' :
  792. begin
  793. if More<>'' then
  794. {$IFDEF USE_SYSUTILS}
  795. begin
  796. d := SplitPath(More);
  797. OutputFile := SplitFileName(More);
  798. end
  799. {$ELSE USE_SYSUTILS}
  800. Fsplit(More,d,OutputFile,e)
  801. {$ENDIF USE_SYSUTILS}
  802. else
  803. IllegalPara(opt);
  804. end;
  805. 'p' :
  806. begin
  807. if UnsetBool(More, 0) then
  808. begin
  809. initmoduleswitches:=initmoduleswitches-[cs_profile];
  810. undef_symbol('FPC_PROFILE');
  811. end
  812. else
  813. if Length(More)=0 then
  814. IllegalPara(opt)
  815. else
  816. case more[1] of
  817. 'g' : if UnsetBool(more, 1) then
  818. begin
  819. exclude(initmoduleswitches,cs_profile);
  820. undef_symbol('FPC_PROFILE');
  821. end
  822. else
  823. begin
  824. include(initmoduleswitches,cs_profile);
  825. def_symbol('FPC_PROFILE');
  826. end;
  827. else
  828. IllegalPara(opt);
  829. end;
  830. end;
  831. 'P' : ; { Ignore used by fpc.pp }
  832. 's' :
  833. begin
  834. if UnsetBool(More, 0) then
  835. begin
  836. initglobalswitches:=initglobalswitches-[cs_asm_extern,cs_link_extern];
  837. if more<>'' then
  838. IllegalPara(opt);
  839. end
  840. else
  841. begin
  842. initglobalswitches:=initglobalswitches+[cs_asm_extern,cs_link_extern];
  843. if more='h' then
  844. initglobalswitches:=initglobalswitches-[cs_link_on_target]
  845. else if more='t' then
  846. initglobalswitches:=initglobalswitches+[cs_link_on_target]
  847. else if more='r' then
  848. initglobalswitches:=initglobalswitches+[cs_asm_leave,cs_no_regalloc]
  849. else if more<>'' then
  850. IllegalPara(opt);
  851. end;
  852. end;
  853. 'S' :
  854. begin
  855. if more[1]='I' then
  856. begin
  857. if upper(more)='ICOM' then
  858. initinterfacetype:=it_interfacecom
  859. else if upper(more)='ICORBA' then
  860. initinterfacetype:=it_interfacecorba
  861. else
  862. IllegalPara(opt);
  863. end
  864. else
  865. begin
  866. j:=1;
  867. while j<=length(more) do
  868. begin
  869. case more[j] of
  870. '2' : //an alternative to -Mobjfpc
  871. SetCompileMode('OBJFPC',true);
  872. 'a' :
  873. include(initlocalswitches,cs_do_assertion);
  874. 'c' :
  875. include(initmoduleswitches,cs_support_c_operators);
  876. 'd' : //an alternative to -Mdelphi
  877. SetCompileMode('DELPHI',true);
  878. 'e' :
  879. begin
  880. SetErrorFlags(copy(more,j+1,length(more)));
  881. break;
  882. end;
  883. 'g' :
  884. include(initmoduleswitches,cs_support_goto);
  885. 'h' :
  886. include(initlocalswitches,cs_ansistrings);
  887. 'i' :
  888. include(initmoduleswitches,cs_support_inline);
  889. 'm' :
  890. include(initmoduleswitches,cs_support_macro);
  891. 'o' : //an alternative to -Mtp
  892. SetCompileMode('TP',true);
  893. 'p' : //an alternative to -Mgpc
  894. SetCompileMode('GPC',true);
  895. 's' :
  896. include(initglobalswitches,cs_constructor_name);
  897. 't' :
  898. include(initmoduleswitches,cs_static_keyword);
  899. '-' :
  900. begin
  901. exclude(initglobalswitches,cs_constructor_name);
  902. initlocalswitches:=InitLocalswitches - [cs_do_assertion, cs_ansistrings];
  903. initmoduleswitches:=initmoduleswitches - [cs_support_c_operators, cs_support_goto,
  904. cs_support_inline, cs_support_macro,
  905. cs_static_keyword];
  906. end;
  907. else
  908. IllegalPara(opt);
  909. end;
  910. inc(j);
  911. end;
  912. end;
  913. end;
  914. 'T' :
  915. begin
  916. more:=Upper(More);
  917. if not target_is_set then
  918. begin
  919. { remove old target define }
  920. TargetDefines(false);
  921. { Save assembler if set }
  922. if asm_is_set then
  923. forceasm:=target_asm.id;
  924. { load new target }
  925. if not(set_target_by_string(More)) then
  926. IllegalPara(opt);
  927. { also initialize assembler if not explicitly set }
  928. if asm_is_set then
  929. set_target_asm(forceasm);
  930. { set new define }
  931. TargetDefines(true);
  932. target_is_set:=true;
  933. end
  934. else
  935. if More<>upper(target_info.shortname) then
  936. Message1(option_target_is_already_set,target_info.shortname);
  937. end;
  938. 'u' :
  939. undef_symbol(upper(More));
  940. 'U' :
  941. begin
  942. j:=1;
  943. while j<=length(more) do
  944. begin
  945. case more[j] of
  946. {$ifdef UNITALIASES}
  947. 'a' :
  948. begin
  949. AddUnitAlias(Copy(More,j+1,255));
  950. break;
  951. end;
  952. {$endif UNITALIASES}
  953. 'n' :
  954. exclude(initglobalswitches,cs_check_unit_name);
  955. 'p' :
  956. begin
  957. Message2(option_obsolete_switch_use_new,'-Up','-Fu');
  958. break;
  959. end;
  960. 'r' :
  961. do_release:=true;
  962. 's' :
  963. include(initmoduleswitches,cs_compilesystem);
  964. '-' :
  965. begin
  966. exclude(initmoduleswitches,cs_compilesystem);
  967. exclude(initglobalswitches,cs_check_unit_name);
  968. end;
  969. else
  970. IllegalPara(opt);
  971. end;
  972. inc(j);
  973. end;
  974. end;
  975. 'v' :
  976. begin
  977. if not setverbosity(More) then
  978. IllegalPara(opt);
  979. end;
  980. 'V' : ; { Ignore used by fpc }
  981. 'W' :
  982. begin
  983. j:=1;
  984. while j<=length(More) do
  985. begin
  986. case More[j] of
  987. 'B':
  988. begin
  989. { -WB200000 means set trefered base address
  990. to $200000, but does not change relocsection boolean
  991. this way we can create both relocatble and
  992. non relocatable DLL at a specific base address PM }
  993. if (length(More)>j) then
  994. begin
  995. if DLLImageBase=nil then
  996. DLLImageBase:=StringDup(Copy(More,j+1,255));
  997. end
  998. else
  999. begin
  1000. RelocSection:=true;
  1001. RelocSectionSetExplicitly:=true;
  1002. end;
  1003. break;
  1004. end;
  1005. 'C':
  1006. begin
  1007. if UnsetBool(More, j) then
  1008. apptype:=app_gui
  1009. else
  1010. apptype:=app_cui;
  1011. end;
  1012. 'D':
  1013. begin
  1014. UseDeffileForExports:=not UnsetBool(More, j);
  1015. UseDeffileForExportsSetExplicitly:=true;
  1016. end;
  1017. 'F':
  1018. begin
  1019. if UnsetBool(More, j) then
  1020. apptype:=app_cui
  1021. else
  1022. apptype:=app_fs;
  1023. end;
  1024. 'G':
  1025. begin
  1026. if UnsetBool(More, j) then
  1027. apptype:=app_cui
  1028. else
  1029. apptype:=app_gui;
  1030. end;
  1031. 'T':
  1032. begin
  1033. if UnsetBool(More, j) then
  1034. apptype:=app_cui
  1035. else
  1036. apptype:=app_tool;
  1037. end;
  1038. 'N':
  1039. begin
  1040. RelocSection:=UnsetBool(More,j);
  1041. RelocSectionSetExplicitly:=true;
  1042. end;
  1043. 'R':
  1044. begin
  1045. { support -WR+ / -WR- as synonyms to -WR / -WN }
  1046. RelocSection:=not UnsetBool(More,j);
  1047. RelocSectionSetExplicitly:=true;
  1048. end;
  1049. else
  1050. IllegalPara(opt);
  1051. end;
  1052. inc(j);
  1053. end;
  1054. end;
  1055. 'X' :
  1056. begin
  1057. j:=1;
  1058. while j<=length(more) do
  1059. begin
  1060. case More[j] of
  1061. 'i' :
  1062. include(initglobalswitches,cs_link_internal);
  1063. 'm' :
  1064. include(initglobalswitches,cs_link_map);
  1065. 'f' :
  1066. include(initglobalswitches,cs_link_pthread);
  1067. 's' :
  1068. include(initglobalswitches,cs_link_strip);
  1069. 'c' : Cshared:=TRUE;
  1070. 't' :
  1071. include(initglobalswitches,cs_link_staticflag);
  1072. 'D' :
  1073. begin
  1074. def_symbol('FPC_LINK_DYNAMIC');
  1075. undef_symbol('FPC_LINK_SMART');
  1076. undef_symbol('FPC_LINK_STATIC');
  1077. exclude(initglobalswitches,cs_link_static);
  1078. exclude(initglobalswitches,cs_link_smart);
  1079. include(initglobalswitches,cs_link_shared);
  1080. LinkTypeSetExplicitly:=true;
  1081. end;
  1082. 'd' : Dontlinkstdlibpath:=TRUE;
  1083. 'P' : Begin
  1084. utilsprefix:=Copy(more,2,length(More)-1);
  1085. More:='';
  1086. End;
  1087. 'r' : Begin
  1088. rlinkpath:=Copy(more,2,length(More)-1);
  1089. More:='';
  1090. end;
  1091. 'S' :
  1092. begin
  1093. def_symbol('FPC_LINK_STATIC');
  1094. undef_symbol('FPC_LINK_SMART');
  1095. undef_symbol('FPC_LINK_DYNAMIC');
  1096. include(initglobalswitches,cs_link_static);
  1097. exclude(initglobalswitches,cs_link_smart);
  1098. exclude(initglobalswitches,cs_link_shared);
  1099. LinkTypeSetExplicitly:=true;
  1100. end;
  1101. 'X' :
  1102. begin
  1103. def_symbol('FPC_LINK_SMART');
  1104. undef_symbol('FPC_LINK_STATIC');
  1105. undef_symbol('FPC_LINK_DYNAMIC');
  1106. exclude(initglobalswitches,cs_link_static);
  1107. include(initglobalswitches,cs_link_smart);
  1108. exclude(initglobalswitches,cs_link_shared);
  1109. LinkTypeSetExplicitly:=true;
  1110. end;
  1111. '-' :
  1112. begin
  1113. exclude(initglobalswitches,cs_link_staticflag);
  1114. exclude(initglobalswitches,cs_link_strip);
  1115. exclude(initglobalswitches,cs_link_map);
  1116. set_default_link_type;
  1117. end;
  1118. else
  1119. IllegalPara(opt);
  1120. end;
  1121. inc(j);
  1122. end;
  1123. end;
  1124. { give processor specific options a chance }
  1125. else
  1126. interpret_proc_specific_options(opt);
  1127. end;
  1128. end;
  1129. '@' :
  1130. begin
  1131. Message(option_no_nested_response_file);
  1132. StopOptions(1);
  1133. end;
  1134. else
  1135. begin
  1136. if (length(param_file)<>0) then
  1137. Message(option_only_one_source_support);
  1138. param_file:=opt;
  1139. Message1(option_found_file,opt);
  1140. end;
  1141. end;
  1142. end;
  1143. procedure Toption.Interpret_file(const filename : string);
  1144. procedure RemoveSep(var fn:string);
  1145. var
  1146. i : longint;
  1147. begin
  1148. i:=0;
  1149. while (i<length(fn)) and (fn[i+1] in [',',' ',#9]) do
  1150. inc(i);
  1151. Delete(fn,1,i);
  1152. i:=length(fn);
  1153. while (i>0) and (fn[i] in [',',' ',#9]) do
  1154. dec(i);
  1155. fn:=copy(fn,1,i);
  1156. end;
  1157. function GetName(var fn:string):string;
  1158. var
  1159. i : longint;
  1160. begin
  1161. i:=0;
  1162. while (i<length(fn)) and (fn[i+1] in ['a'..'z','A'..'Z','0'..'9','_','-']) do
  1163. inc(i);
  1164. GetName:=Copy(fn,1,i);
  1165. Delete(fn,1,i);
  1166. end;
  1167. const
  1168. maxlevel=16;
  1169. var
  1170. f : text;
  1171. s,
  1172. opts : string;
  1173. skip : array[0..maxlevel-1] of boolean;
  1174. level : longint;
  1175. option_read : boolean;
  1176. begin
  1177. { avoid infinite loop }
  1178. Inc(FileLevel);
  1179. Option_read:=false;
  1180. If FileLevel>MaxLevel then
  1181. Message(option_too_many_cfg_files);
  1182. { open file }
  1183. Message1(option_using_file,filename);
  1184. assign(f,filename);
  1185. {$I-}
  1186. reset(f);
  1187. {$I+}
  1188. if ioresult<>0 then
  1189. begin
  1190. Message1(option_unable_open_file,filename);
  1191. exit;
  1192. end;
  1193. Message1(option_start_reading_configfile,filename);
  1194. fillchar(skip,sizeof(skip),0);
  1195. level:=0;
  1196. while not eof(f) do
  1197. begin
  1198. readln(f,opts);
  1199. RemoveSep(opts);
  1200. if (opts<>'') and (opts[1]<>';') then
  1201. begin
  1202. if opts[1]='#' then
  1203. begin
  1204. Message1(option_interpreting_file_option,opts);
  1205. Delete(opts,1,1);
  1206. s:=upper(GetName(opts));
  1207. if (s='SECTION') then
  1208. begin
  1209. RemoveSep(opts);
  1210. s:=upper(GetName(opts));
  1211. if level=0 then
  1212. skip[level]:=not (check_symbol(s) or (s='COMMON'));
  1213. end
  1214. else
  1215. if (s='IFDEF') then
  1216. begin
  1217. RemoveSep(opts);
  1218. if Level>=maxlevel then
  1219. begin
  1220. Message(option_too_many_ifdef);
  1221. stopOptions(1);
  1222. end;
  1223. inc(Level);
  1224. skip[level]:=(skip[level-1] or (not check_symbol(upper(GetName(opts)))));
  1225. end
  1226. else
  1227. if (s='IFNDEF') then
  1228. begin
  1229. RemoveSep(opts);
  1230. if Level>=maxlevel then
  1231. begin
  1232. Message(option_too_many_ifdef);
  1233. stopOptions(1);
  1234. end;
  1235. inc(Level);
  1236. skip[level]:=(skip[level-1] or (check_symbol(upper(GetName(opts)))));
  1237. end
  1238. else
  1239. if (s='ELSE') then
  1240. skip[level]:=skip[level-1] or (not skip[level])
  1241. else
  1242. if (s='ENDIF') then
  1243. begin
  1244. skip[level]:=false;
  1245. if Level=0 then
  1246. begin
  1247. Message(option_too_many_endif);
  1248. stopOptions(1);
  1249. end;
  1250. dec(level);
  1251. end
  1252. else
  1253. if (not skip[level]) then
  1254. begin
  1255. if (s='DEFINE') then
  1256. begin
  1257. RemoveSep(opts);
  1258. def_symbol(upper(GetName(opts)));
  1259. end
  1260. else
  1261. if (s='UNDEF') then
  1262. begin
  1263. RemoveSep(opts);
  1264. undef_symbol(upper(GetName(opts)));
  1265. end
  1266. else
  1267. if (s='WRITE') then
  1268. begin
  1269. Delete(opts,1,1);
  1270. WriteLn(opts);
  1271. end
  1272. else
  1273. if (s='INCLUDE') then
  1274. begin
  1275. Delete(opts,1,1);
  1276. Interpret_file(opts);
  1277. end;
  1278. end;
  1279. end
  1280. else
  1281. begin
  1282. if (opts[1]='-') or (opts[1]='@') then
  1283. begin
  1284. if (not skip[level]) then
  1285. interpret_option(opts,false);
  1286. Option_read:=true;
  1287. end
  1288. else
  1289. Message1(option_illegal_para,opts);
  1290. end;
  1291. end;
  1292. end;
  1293. if Level>0 then
  1294. Message(option_too_less_endif);
  1295. if Not Option_read then
  1296. Message1(option_no_option_found,filename)
  1297. else
  1298. Message1(option_end_reading_configfile,filename);
  1299. Close(f);
  1300. Dec(FileLevel);
  1301. end;
  1302. procedure Toption.Interpret_envvar(const envname : string);
  1303. var
  1304. argstart,
  1305. env,
  1306. pc : pchar;
  1307. arglen : longint;
  1308. quote : set of char;
  1309. hs : string;
  1310. begin
  1311. Message1(option_using_env,envname);
  1312. env:=GetEnvPChar(envname);
  1313. pc:=env;
  1314. if assigned(pc) then
  1315. begin
  1316. repeat
  1317. { skip leading spaces }
  1318. while pc^ in [' ',#9,#13] do
  1319. inc(pc);
  1320. case pc^ of
  1321. #0 :
  1322. break;
  1323. '"' :
  1324. begin
  1325. quote:=['"'];
  1326. inc(pc);
  1327. end;
  1328. '''' :
  1329. begin
  1330. quote:=[''''];
  1331. inc(pc);
  1332. end;
  1333. else
  1334. quote:=[' ',#9,#13];
  1335. end;
  1336. { scan until the end of the argument }
  1337. argstart:=pc;
  1338. while (pc^<>#0) and not(pc^ in quote) do
  1339. inc(pc);
  1340. { create argument }
  1341. arglen:=pc-argstart;
  1342. hs[0]:=chr(arglen);
  1343. move(argstart^,hs[1],arglen);
  1344. interpret_option(hs,true);
  1345. { skip quote }
  1346. if pc^ in quote then
  1347. inc(pc);
  1348. until false;
  1349. end
  1350. else
  1351. Message1(option_no_option_found,'(env) '+envname);
  1352. FreeEnvPChar(env);
  1353. end;
  1354. procedure toption.read_parameters;
  1355. var
  1356. opts : string;
  1357. paramindex : longint;
  1358. begin
  1359. paramindex:=0;
  1360. while paramindex<paramcount do
  1361. begin
  1362. inc(paramindex);
  1363. opts:=system.paramstr(paramindex);
  1364. case opts[1] of
  1365. '@' :
  1366. if not firstpass then
  1367. begin
  1368. Delete(opts,1,1);
  1369. Message1(option_reading_further_from,opts);
  1370. interpret_file(opts);
  1371. end;
  1372. '!' :
  1373. if not firstpass then
  1374. begin
  1375. Delete(opts,1,1);
  1376. Message1(option_reading_further_from,'(env) '+opts);
  1377. interpret_envvar(opts);
  1378. end;
  1379. else
  1380. interpret_option(opts,true);
  1381. end;
  1382. end;
  1383. end;
  1384. procedure toption.parsecmd(cmd:string);
  1385. var
  1386. i,ps : longint;
  1387. opts : string;
  1388. begin
  1389. while (cmd<>'') do
  1390. begin
  1391. while cmd[1]=' ' do
  1392. delete(cmd,1,1);
  1393. i:=pos(' ',cmd);
  1394. if i=0 then
  1395. i:=256;
  1396. opts:=Copy(cmd,1,i-1);
  1397. Delete(cmd,1,i);
  1398. case opts[1] of
  1399. '@' :
  1400. if not firstpass then
  1401. begin
  1402. Delete(opts,1,1);
  1403. Message1(option_reading_further_from,opts);
  1404. interpret_file(opts);
  1405. end;
  1406. '!' :
  1407. if not firstpass then
  1408. begin
  1409. Delete(opts,1,1);
  1410. Message1(option_reading_further_from,'(env) '+opts);
  1411. interpret_envvar(opts);
  1412. end;
  1413. '"' :
  1414. begin
  1415. Delete(opts,1,1);
  1416. ps:=pos('"',cmd);
  1417. if (i<>256) and (ps>0) then
  1418. begin
  1419. opts:=opts + ' '+ copy(cmd,1,ps-1);
  1420. cmd:=copy(cmd,ps+1,255);
  1421. end;
  1422. interpret_option(opts,true);
  1423. end;
  1424. else
  1425. interpret_option(opts,true);
  1426. end;
  1427. end;
  1428. end;
  1429. procedure toption.writequickinfo;
  1430. var
  1431. s : string;
  1432. i : longint;
  1433. procedure addinfo(const hs:string);
  1434. begin
  1435. if s<>'' then
  1436. s:=s+' '+hs
  1437. else
  1438. s:=hs;
  1439. end;
  1440. begin
  1441. s:='';
  1442. i:=0;
  1443. while (i<length(quickinfo)) do
  1444. begin
  1445. inc(i);
  1446. case quickinfo[i] of
  1447. 'S' :
  1448. begin
  1449. inc(i);
  1450. case quickinfo[i] of
  1451. 'O' :
  1452. addinfo(lower(source_info.shortname));
  1453. 'P' :
  1454. addinfo(source_cpu_string);
  1455. else
  1456. IllegalPara('-i'+QuickInfo);
  1457. end;
  1458. end;
  1459. 'T' :
  1460. begin
  1461. inc(i);
  1462. case quickinfo[i] of
  1463. 'O' :
  1464. addinfo(lower(target_info.shortname));
  1465. 'P' :
  1466. AddInfo(target_cpu_string);
  1467. else
  1468. IllegalPara('-i'+QuickInfo);
  1469. end;
  1470. end;
  1471. 'V' :
  1472. AddInfo(version_string);
  1473. 'D' :
  1474. AddInfo(date_string);
  1475. '_' :
  1476. ;
  1477. else
  1478. IllegalPara('-i'+QuickInfo);
  1479. end;
  1480. end;
  1481. if s<>'' then
  1482. begin
  1483. writeln(s);
  1484. stopoptions(0);
  1485. end;
  1486. end;
  1487. procedure TOption.TargetDefines(def:boolean);
  1488. var
  1489. s : string;
  1490. i : integer;
  1491. begin
  1492. if def then
  1493. def_symbol(upper(target_info.shortname))
  1494. else
  1495. undef_symbol(upper(target_info.shortname));
  1496. s:=target_info.extradefines;
  1497. while (s<>'') do
  1498. begin
  1499. i:=pos(';',s);
  1500. if i=0 then
  1501. i:=length(s)+1;
  1502. if def then
  1503. def_symbol(Copy(s,1,i-1))
  1504. else
  1505. undef_symbol(Copy(s,1,i-1));
  1506. delete(s,1,i);
  1507. end;
  1508. end;
  1509. constructor TOption.create;
  1510. begin
  1511. DoWriteLogo:=false;
  1512. NoPressEnter:=false;
  1513. FirstPass:=false;
  1514. FileLevel:=0;
  1515. Quickinfo:='';
  1516. ParaIncludePath:=TSearchPathList.Create;
  1517. ParaObjectPath:=TSearchPathList.Create;
  1518. ParaUnitPath:=TSearchPathList.Create;
  1519. ParaLibraryPath:=TSearchPathList.Create;
  1520. FillChar(ParaAlignment,sizeof(ParaAlignment),0);
  1521. end;
  1522. destructor TOption.destroy;
  1523. begin
  1524. ParaIncludePath.Free;
  1525. ParaObjectPath.Free;
  1526. ParaUnitPath.Free;
  1527. ParaLibraryPath.Free;
  1528. end;
  1529. {****************************************************************************
  1530. Callable Routines
  1531. ****************************************************************************}
  1532. function check_configfile(const fn:string;var foundfn:string):boolean;
  1533. function CfgFileExists(const fn:string):boolean;
  1534. begin
  1535. Comment(V_Tried,'Configfile search: '+fn);
  1536. CfgFileExists:=FileExists(fn);
  1537. end;
  1538. var
  1539. configpath : pathstr;
  1540. begin
  1541. foundfn:=fn;
  1542. check_configfile:=true;
  1543. { retrieve configpath }
  1544. {$IFDEF USE_SYSUTILS}
  1545. configpath:=FixPath(GetEnvironmentVariable('PPC_CONFIG_PATH'),false);
  1546. {$ELSE USE_SYSUTILS}
  1547. configpath:=FixPath(dos.getenv('PPC_CONFIG_PATH'),false);
  1548. {$ENDIF USE_SYSUTILS}
  1549. {$ifdef Unix}
  1550. if configpath='' then
  1551. configpath:='/etc/';
  1552. {$endif}
  1553. {
  1554. Order to read configuration file :
  1555. try reading fpc.cfg in :
  1556. 1 - current dir
  1557. 2 - configpath
  1558. 3 - compiler path
  1559. }
  1560. if not FileExists(fn) then
  1561. begin
  1562. {$ifdef Unix}
  1563. {$IFDEF USE_SYSUTILS}
  1564. if (GetEnvironmentVariable('HOME')<>'') and CfgFileExists(FixPath(GetEnvironmentVariable('HOME'),false)+'.'+fn) then
  1565. foundfn:=FixPath(GetEnvironmentVariable('HOME'),false)+'.'+fn
  1566. {$ELSE USE_SYSUTILS}
  1567. if (dos.getenv('HOME')<>'') and CfgFileExists(FixPath(dos.getenv('HOME'),false)+'.'+fn) then
  1568. foundfn:=FixPath(dos.getenv('HOME'),false)+'.'+fn
  1569. {$ENDIF USE_SYSUTILS}
  1570. else
  1571. {$endif}
  1572. if CfgFileExists(configpath+fn) then
  1573. foundfn:=configpath+fn
  1574. else
  1575. {$ifndef Unix}
  1576. if CfgFileExists(exepath+fn) then
  1577. foundfn:=exepath+fn
  1578. else
  1579. {$endif}
  1580. check_configfile:=false;
  1581. end;
  1582. end;
  1583. procedure read_arguments(cmd:string);
  1584. begin
  1585. option:=coption.create;
  1586. disable_configfile:=false;
  1587. { default defines }
  1588. def_symbol(upper(target_info.shortname));
  1589. def_symbol('FPC');
  1590. def_symbol('VER'+version_nr);
  1591. def_symbol('VER'+version_nr+'_'+release_nr);
  1592. def_symbol('VER'+version_nr+'_'+release_nr+'_'+patch_nr);
  1593. { Temporary defines, until things settle down }
  1594. def_symbol('HASWIDECHAR');
  1595. def_symbol('HASWIDESTRING');
  1596. def_symbol('HASOUT');
  1597. def_symbol('HASGLOBALPROPERTY');
  1598. def_symbol('FPC_HASPREFETCH');
  1599. def_symbol('FPC_LINEEND_IN_TEXTREC');
  1600. def_symbol('FPC_ALIGNSRTTI');
  1601. {$ifdef i386}
  1602. def_symbol('HASINTF');
  1603. def_symbol('HASVARIANT');
  1604. {$endif i386}
  1605. {$ifdef x86_64}
  1606. def_symbol('HASINTF');
  1607. def_symbol('HASVARIANT');
  1608. {$endif x86_64}
  1609. {$ifdef powerpc}
  1610. def_symbol('HASINTF');
  1611. def_symbol('HASVARIANT');
  1612. def_symbol('FPC_MTFSB0_CORRECTED');
  1613. {$endif powerpc}
  1614. {$ifdef arm}
  1615. def_symbol('HASINTF');
  1616. def_symbol('HASVARIANT');
  1617. {$endif arm}
  1618. {$ifdef sparc}
  1619. def_symbol('HASINTF');
  1620. def_symbol('HASVARIANT');
  1621. {$endif sparc}
  1622. def_symbol('INTERNSETLENGTH');
  1623. def_symbol('INTERNLENGTH');
  1624. def_symbol('INTERNCOPY');
  1625. def_symbol('INT64FUNCRESOK');
  1626. def_symbol('HAS_ADDR_STACK_ON_STACK');
  1627. def_symbol('NOBOUNDCHECK');
  1628. def_symbol('HASCOMPILERPROC');
  1629. def_symbol('VALUEGETMEM');
  1630. def_symbol('VALUEFREEMEM');
  1631. def_symbol('HASCURRENCY');
  1632. def_symbol('HASTHREADVAR');
  1633. def_symbol('HAS_GENERICCONSTRUCTOR');
  1634. def_symbol('NOCLASSHELPERS');
  1635. if pocall_default = pocall_register then
  1636. def_symbol('REGCALL');
  1637. def_symbol('DECRREFNOTNIL');
  1638. def_symbol('HAS_INTERNAL_INTTYPES');
  1639. def_symbol('STR_USES_VALINT');
  1640. def_symbol('NOSAVEREGISTERS');
  1641. def_symbol('SHORTSTRCOMPAREINREG');
  1642. { using a case is pretty useless here (FK) }
  1643. { some stuff for TP compatibility }
  1644. {$ifdef i386}
  1645. def_symbol('CPU86');
  1646. def_symbol('CPU87');
  1647. {$endif}
  1648. {$ifdef m68k}
  1649. def_symbol('CPU68');
  1650. {$endif}
  1651. { new processor stuff }
  1652. {$ifdef i386}
  1653. def_symbol('CPUI386');
  1654. def_symbol('CPU32');
  1655. def_symbol('FPC_HAS_TYPE_EXTENDED');
  1656. def_symbol('FPC_HAS_TYPE_DOUBLE');
  1657. def_symbol('FPC_HAS_TYPE_SINGLE');
  1658. {$endif}
  1659. {$ifdef m68k}
  1660. def_symbol('CPU68K');
  1661. def_symbol('CPUM68K');
  1662. def_symbol('CPU32');
  1663. def_symbol('FPC_CURRENCY_IS_INT64');
  1664. def_symbol('FPC_COMP_IS_INT64');
  1665. {$endif}
  1666. {$ifdef ALPHA}
  1667. def_symbol('CPUALPHA');
  1668. def_symbol('CPU64');
  1669. {$endif}
  1670. {$ifdef powerpc}
  1671. def_symbol('CPUPOWERPC');
  1672. def_symbol('CPUPOWERPC32');
  1673. def_symbol('CPU32');
  1674. def_symbol('FPC_HAS_TYPE_DOUBLE');
  1675. def_symbol('FPC_HAS_TYPE_SINGLE');
  1676. def_symbol('FPC_INCLUDE_SOFTWARE_INT64_TO_DOUBLE');
  1677. def_symbol('FPC_CURRENCY_IS_INT64');
  1678. def_symbol('FPC_COMP_IS_INT64');
  1679. {$endif}
  1680. {$ifdef iA64}
  1681. def_symbol('CPUIA64');
  1682. def_symbol('CPU64');
  1683. {$endif}
  1684. {$ifdef x86_64}
  1685. def_symbol('CPUX86_64');
  1686. def_symbol('CPUAMD64');
  1687. def_symbol('CPU64');
  1688. { not supported for now, afaik (FK)
  1689. def_symbol('FPC_HAS_TYPE_FLOAT128'); }
  1690. def_symbol('FPC_HAS_TYPE_EXTENDED');
  1691. def_symbol('FPC_HAS_TYPE_DOUBLE');
  1692. def_symbol('FPC_HAS_TYPE_SINGLE');
  1693. {$endif}
  1694. {$ifdef sparc}
  1695. def_symbol('CPUSPARC');
  1696. def_symbol('CPUSPARC32');
  1697. def_symbol('CPU32');
  1698. def_symbol('FPC_HAS_TYPE_DOUBLE');
  1699. def_symbol('FPC_HAS_TYPE_SINGLE');
  1700. def_symbol('FPC_INCLUDE_SOFTWARE_INT64_TO_DOUBLE');
  1701. def_symbol('FPC_CURRENCY_IS_INT64');
  1702. def_symbol('FPC_COMP_IS_INT64');
  1703. def_symbol('FPC_REQUIRES_PROPER_ALIGNMENT');
  1704. {$endif}
  1705. {$ifdef vis}
  1706. def_symbol('CPUVIS');
  1707. def_symbol('CPU32');
  1708. {$endif}
  1709. {$ifdef arm}
  1710. def_symbol('CPUARM');
  1711. def_symbol('CPU32');
  1712. def_symbol('FPC_HAS_TYPE_DOUBLE');
  1713. def_symbol('FPC_HAS_TYPE_SINGLE');
  1714. def_symbol('FPC_INCLUDE_SOFTWARE_INT64_TO_DOUBLE');
  1715. def_symbol('FPC_CURRENCY_IS_INT64');
  1716. def_symbol('FPC_COMP_IS_INT64');
  1717. def_symbol('FPC_REQUIRES_PROPER_ALIGNMENT');
  1718. {$endif arm}
  1719. { get default messagefile }
  1720. {$IFDEF USE_SYSUTILS}
  1721. msgfilename:=GetEnvironmentVariable('PPC_ERROR_FILE');
  1722. {$ELSE USE_SYSUTILS}
  1723. msgfilename:=dos.getenv('PPC_ERROR_FILE');
  1724. {$ENDIF USE_SYSUTILS}
  1725. { default configfile can be specified on the commandline,
  1726. remove it first }
  1727. if (cmd<>'') and (cmd[1]='[') then
  1728. begin
  1729. ppccfg:=Copy(cmd,2,pos(']',cmd)-2);
  1730. Delete(cmd,1,pos(']',cmd));
  1731. end
  1732. else
  1733. begin
  1734. ppccfg:='fpc.cfg';
  1735. ppcaltcfg:='ppc386.cfg';
  1736. end;
  1737. { read the parameters quick, only -i -v -T }
  1738. option.firstpass:=true;
  1739. if cmd<>'' then
  1740. option.parsecmd(cmd)
  1741. else
  1742. begin
  1743. option.read_parameters;
  1744. { Write only quickinfo }
  1745. if option.quickinfo<>'' then
  1746. option.writequickinfo;
  1747. end;
  1748. option.firstpass:=false;
  1749. { read configuration file }
  1750. if (not disable_configfile) and
  1751. (ppccfg<>'') then
  1752. begin
  1753. read_configfile:=check_configfile(ppccfg,ppccfg);
  1754. { Maybe alternative configfile ? }
  1755. if (not read_configfile) and
  1756. (ppcaltcfg<>'') then
  1757. read_configfile:=check_configfile(ppcaltcfg,ppccfg);
  1758. end
  1759. else
  1760. read_configfile := false;
  1761. { Read commandline and configfile }
  1762. target_is_set:=false;
  1763. asm_is_set:=false;
  1764. param_file:='';
  1765. { read configfile }
  1766. if read_configfile then
  1767. option.interpret_file(ppccfg);
  1768. { read parameters again to override config file }
  1769. if cmd<>'' then
  1770. option.parsecmd(cmd)
  1771. else
  1772. begin
  1773. option.read_parameters;
  1774. { Write only quickinfo }
  1775. if option.quickinfo<>'' then
  1776. option.writequickinfo;
  1777. end;
  1778. { Write help pages }
  1779. if (cmd='') and (paramcount=0) then
  1780. Option.WriteHelpPages;
  1781. { Stop if errors in options }
  1782. if ErrorCount>0 then
  1783. StopOptions(1);
  1784. { Non-core target defines }
  1785. Option.TargetDefines(true);
  1786. { endian define }
  1787. case target_info.endian of
  1788. endian_little :
  1789. begin
  1790. def_symbol('ENDIAN_LITTLE');
  1791. def_symbol('FPC_LITTLE_ENDIAN');
  1792. end;
  1793. endian_big :
  1794. begin
  1795. def_symbol('ENDIAN_BIG');
  1796. def_symbol('FPC_BIG_ENDIAN');
  1797. end;
  1798. end;
  1799. { abi define }
  1800. case target_info.abi of
  1801. abi_powerpc_sysv :
  1802. def_symbol('FPC_ABI_SYSV');
  1803. abi_powerpc_aix :
  1804. def_symbol('FPC_ABI_AIX');
  1805. end;
  1806. {$ifdef m68k}
  1807. if initoptprocessor=MC68020 then
  1808. def_symbol('CPUM68020');
  1809. {$endif m68k}
  1810. { write logo if set }
  1811. if option.DoWriteLogo then
  1812. option.WriteLogo;
  1813. { Check file to compile }
  1814. if param_file='' then
  1815. begin
  1816. Message(option_no_source_found);
  1817. StopOptions(1);
  1818. end;
  1819. {$ifndef Unix}
  1820. param_file:=FixFileName(param_file);
  1821. {$endif}
  1822. {$IFDEF USE_SYSUTILS}
  1823. inputdir := SplitPath(param_file);
  1824. inputfile := SplitName(param_file);
  1825. inputextension := SplitExtension(param_file);
  1826. {$ELSE USE_SYSUTILS}
  1827. fsplit(param_file,inputdir,inputfile,inputextension);
  1828. {$ENDIF USE_SYSUTILS}
  1829. if inputextension='' then
  1830. begin
  1831. if FileExists(inputdir+inputfile+target_info.sourceext) then
  1832. inputextension:=target_info.sourceext
  1833. else if FileExists(inputdir+inputfile+target_info.pasext) then
  1834. inputextension:=target_info.pasext
  1835. else if (m_mac in aktmodeswitches) and FileExists(inputdir+inputfile+'.p') then
  1836. inputextension:='.p';
  1837. end;
  1838. { Check output dir }
  1839. if (OutputExeDir<>'') and
  1840. not PathExists(OutputExeDir) then
  1841. begin
  1842. Message1(general_e_path_does_not_exist,OutputExeDir);
  1843. StopOptions(1);
  1844. end;
  1845. { Add paths specified with parameters to the searchpaths }
  1846. UnitSearchPath.AddList(option.ParaUnitPath,true);
  1847. ObjectSearchPath.AddList(option.ParaObjectPath,true);
  1848. IncludeSearchPath.AddList(option.ParaIncludePath,true);
  1849. LibrarySearchPath.AddList(option.ParaLibraryPath,true);
  1850. { add unit environment and exepath to the unit search path }
  1851. if inputdir<>'' then
  1852. Unitsearchpath.AddPath(inputdir,true);
  1853. if not disable_configfile then
  1854. begin
  1855. {$IFDEF USE_SYSUTILS}
  1856. UnitSearchPath.AddPath(GetEnvironmentVariable(target_info.unit_env),false);
  1857. {$ELSE USE_SYSUTILS}
  1858. UnitSearchPath.AddPath(dos.getenv(target_info.unit_env),false);
  1859. {$ENDIF USE_SYSUTILS}
  1860. end;
  1861. {$ifdef Unix}
  1862. {$IFDEF USE_SYSUTILS}
  1863. fpcdir:=FixPath(GetEnvironmentVariable('FPCDIR'),false);
  1864. {$ELSE USE_SYSUTILS}
  1865. fpcdir:=FixPath(getenv('FPCDIR'),false);
  1866. {$ENDIF USE_SYSUTILS}
  1867. if fpcdir='' then
  1868. begin
  1869. if PathExists('/usr/local/lib/fpc/'+version_string) then
  1870. fpcdir:='/usr/local/lib/fpc/'+version_string+'/'
  1871. else
  1872. fpcdir:='/usr/lib/fpc/'+version_string+'/';
  1873. end;
  1874. {$else}
  1875. {$IFDEF USE_SYSUTILS}
  1876. fpcdir:=FixPath(GetEnvironmentVariable('FPCDIR'),false);
  1877. {$ELSE USE_SYSUTILS}
  1878. fpcdir:=FixPath(getenv('FPCDIR'),false);
  1879. {$ENDIF USE_SYSUTILS}
  1880. if fpcdir='' then
  1881. begin
  1882. fpcdir:=ExePath+'../';
  1883. if not(PathExists(fpcdir+'/units')) and
  1884. not(PathExists(fpcdir+'/rtl')) then
  1885. fpcdir:=fpcdir+'../';
  1886. end;
  1887. {$endif}
  1888. { first try development RTL, else use the default installation path }
  1889. if not disable_configfile then
  1890. begin
  1891. if PathExists(FpcDir+'rtl') then
  1892. UnitSearchPath.AddPath(FpcDir+'rtl/'+target_full_string,false)
  1893. else
  1894. UnitSearchPath.AddPath(FpcDir+'units/'+target_full_string+'/rtl',false);
  1895. end;
  1896. { Add exepath if the exe is not in the current dir, because that is always searched already.
  1897. Do not add it when linking on the target because then we can maybe already find
  1898. .o files that are not for the target }
  1899. if (ExePath<>GetCurrentDir) and
  1900. not(cs_link_on_target in initglobalswitches) then
  1901. UnitSearchPath.AddPath(ExePath,false);
  1902. { Add unit dir to the object and library path }
  1903. objectsearchpath.AddList(unitsearchpath,false);
  1904. librarysearchpath.AddList(unitsearchpath,false);
  1905. { switch assembler if it's binary and we got -a on the cmdline }
  1906. if (cs_asm_leave in initglobalswitches) and
  1907. (af_outputbinary in target_asm.flags) then
  1908. begin
  1909. Message(option_switch_bin_to_src_assembler);
  1910. set_target_asm(target_info.assemextern);
  1911. end;
  1912. if (target_asm.supported_target <> system_any) and
  1913. (target_asm.supported_target <> target_info.system) then
  1914. begin
  1915. Message2(option_incompatible_asm,target_asm.idtxt,target_info.name);
  1916. set_target_asm(target_info.assemextern);
  1917. Message1(option_asm_forced,target_asm.idtxt);
  1918. end;
  1919. { turn off stripping if compiling with debuginfo or profile }
  1920. if (cs_debuginfo in initmoduleswitches) or
  1921. (cs_profile in initmoduleswitches) then
  1922. exclude(initglobalswitches,cs_link_strip);
  1923. {$ifdef x86_64}
  1924. {$warning HACK: turn off smartlinking}
  1925. exclude(initmoduleswitches,cs_create_smart);
  1926. {$endif}
  1927. if not LinkTypeSetExplicitly then
  1928. set_default_link_type;
  1929. { Default alignment settings,
  1930. 1. load the defaults for the target
  1931. 2. override with generic optimizer setting (little size)
  1932. 3. override with the user specified -Oa }
  1933. UpdateAlignment(initalignment,target_info.alignment);
  1934. if (cs_littlesize in aktglobalswitches) then
  1935. begin
  1936. initalignment.procalign:=1;
  1937. initalignment.jumpalign:=1;
  1938. initalignment.loopalign:=1;
  1939. end;
  1940. UpdateAlignment(initalignment,option.paraalignment);
  1941. option.free;
  1942. Option:=nil;
  1943. end;
  1944. initialization
  1945. coption:=toption;
  1946. finalization
  1947. if assigned(option) then
  1948. option.free;
  1949. end.
  1950. {
  1951. $Log$
  1952. Revision 1.152 2004-11-01 12:43:28 peter
  1953. * shortstr compare with empty string fixed
  1954. * removed special i386 code
  1955. Revision 1.151 2004/10/31 19:09:54 peter
  1956. * default paths fixed
  1957. Revision 1.150 2004/10/26 15:11:01 peter
  1958. * -Ch for heapsize added again
  1959. * __heapsize contains the heapsize
  1960. Revision 1.149 2004/10/25 15:38:41 peter
  1961. * heap and heapsize removed
  1962. * checkpointer fixes
  1963. Revision 1.148 2004/10/24 20:01:08 peter
  1964. * remove saveregister calling convention
  1965. Revision 1.147 2004/10/15 09:14:17 mazen
  1966. - remove $IFDEF DELPHI and related code
  1967. - remove $IFDEF FPCPROCVAR and related code
  1968. Revision 1.146 2004/10/14 14:03:02 mazen
  1969. * Merge is complete for this file, cycles !
  1970. Revision 1.145 2004/10/05 20:21:02 florian
  1971. * bootstrapping with rtti alignment fixed
  1972. Revision 1.144 2004/09/21 23:33:43 hajny
  1973. * better PathExists, fix for too long command line, correction of message
  1974. Revision 1.143 2004/09/21 17:25:12 peter
  1975. * paraloc branch merged
  1976. Revision 1.142 2004/09/16 16:31:53 peter
  1977. * Use FExpand on paths passed to compiler
  1978. Revision 1.141 2004/09/10 21:00:23 jonas
  1979. * exit with exit code 0 instead of 1 after writing out quick options
  1980. (such as -iV)
  1981. Revision 1.140 2004/09/08 11:23:31 michael
  1982. + Check if outputdir exists, Fix exitcode when displaying help pages
  1983. Revision 1.139.4.1 2004/09/19 20:53:33 peter
  1984. * fixed compile without gdb
  1985. Revision 1.139 2004/08/27 21:59:26 peter
  1986. browser disabled
  1987. uf_local_symtable ppu flag when a localsymtable is stored
  1988. Revision 1.138 2004/07/05 21:26:28 olle
  1989. + allow fileextension .p, in mode macpas
  1990. Revision 1.137 2004/07/04 12:24:04 jonas
  1991. * fixed "-g-l" (and other "-g-*" combinations)
  1992. Revision 1.136 2004/06/20 08:55:30 florian
  1993. * logs truncated
  1994. Revision 1.135 2004/06/16 20:07:09 florian
  1995. * dwarf branch merged
  1996. Revision 1.134 2004/05/06 20:30:51 florian
  1997. * m68k compiler compilation fixed
  1998. Revision 1.133.2.10 2004/05/18 20:24:03 florian
  1999. * fixed crash with unknown symbols
  2000. Revision 1.133.2.9 2004/05/13 20:10:38 florian
  2001. * released variant and interface support
  2002. Revision 1.133.2.8 2004/05/03 14:59:57 peter
  2003. * no dlltool needed for win32 linking executables
  2004. }