options.pas 47 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501
  1. {
  2. $Id$
  3. Copyright (c) 1998-2000 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. interface
  20. uses
  21. globtype,globals,verbose;
  22. type
  23. POption=^TOption;
  24. TOption=object
  25. FirstPass,
  26. NoPressEnter,
  27. DoWriteLogo : boolean;
  28. FileLevel : longint;
  29. ParaIncludePath,
  30. ParaUnitPath,
  31. ParaObjectPath,
  32. ParaLibraryPath : TSearchPathList;
  33. Constructor Init;
  34. Destructor Done;
  35. procedure WriteLogo;
  36. procedure WriteInfo;
  37. procedure WriteHelpPages;
  38. procedure QuickInfo(const s:string);
  39. procedure IllegalPara(const opt:string);
  40. function Unsetbool(const opts:string; pos: Longint):boolean;
  41. procedure interpret_proc_specific_options(const opt:string);virtual;
  42. procedure interpret_option(const opt :string;ispara:boolean);
  43. procedure Interpret_envvar(const envname : string);
  44. procedure Interpret_file(const filename : string);
  45. procedure Read_Parameters;
  46. procedure parsecmd(cmd:string);
  47. end;
  48. procedure read_arguments(cmd:string);
  49. implementation
  50. uses
  51. {$ifdef Delphi}
  52. dmisc,
  53. {$else Delphi}
  54. dos,
  55. {$endif Delphi}
  56. version,systems,
  57. cobjects,
  58. symtable,scanner,link,messages
  59. {$ifdef BrowserLog}
  60. ,browlog
  61. {$endif BrowserLog}
  62. {$ifdef i386}
  63. ,opts386
  64. {$endif}
  65. {$ifdef m68k}
  66. ,opts68k
  67. {$endif}
  68. ;
  69. const
  70. page_size = 24;
  71. var
  72. read_configfile, { read config file, set when a cfgfile is found }
  73. target_is_set : boolean; { do not allow contradictory target settings }
  74. asm_is_set : boolean; { -T also change initoutputformat if not set idrectly }
  75. ppccfg,
  76. msgfilename,
  77. param_file : string; { file to compile specified on the commandline }
  78. {****************************************************************************
  79. Defines
  80. ****************************************************************************}
  81. procedure def_symbol(const s : string);
  82. begin
  83. if s='' then
  84. exit;
  85. initdefines.concat(new(pstring_item,init(upper(s))));
  86. end;
  87. procedure undef_symbol(const s : string);
  88. var
  89. item,next : pstring_item;
  90. begin
  91. if s='' then
  92. exit;
  93. item:=pstring_item(initdefines.first);
  94. while assigned(item) do
  95. begin
  96. if (item^.str^=s) then
  97. begin
  98. next:=pstring_item(item^.next);
  99. initdefines.remove(item);
  100. dispose(item,done);
  101. item:=next;
  102. end
  103. else
  104. if item<>pstring_item(item^.next) then
  105. item:=pstring_item(item^.next)
  106. else
  107. break;
  108. end;
  109. end;
  110. function check_symbol(const s:string):boolean;
  111. var
  112. hp : pstring_item;
  113. begin
  114. hp:=pstring_item(initdefines.first);
  115. while assigned(hp) do
  116. begin
  117. if (hp^.str^=s) then
  118. begin
  119. check_symbol:=true;
  120. exit;
  121. end;
  122. hp:=pstring_item(hp^.next);
  123. end;
  124. check_symbol:=false;
  125. end;
  126. procedure MaybeLoadMessageFile;
  127. begin
  128. { Load new message file }
  129. if (msgfilename<>'') then
  130. begin
  131. if fileexists(msgfilename) then
  132. LoadMsgFile(msgfilename);
  133. msgfilename:='';
  134. end;
  135. end;
  136. {****************************************************************************
  137. Toption
  138. ****************************************************************************}
  139. procedure Toption.WriteLogo;
  140. var
  141. i : tmsgconst;
  142. begin
  143. MaybeLoadMessageFile;
  144. for i:=option_logo_start to option_logo_end do
  145. Message1(i,target_cpu_string);
  146. end;
  147. procedure Toption.WriteInfo;
  148. var
  149. i : tmsgconst;
  150. begin
  151. MaybeLoadMessageFile;
  152. for i:=option_info_start to option_info_end do
  153. Message(i);
  154. Stop;
  155. end;
  156. procedure Toption.WriteHelpPages;
  157. function PadEnd(s:string;i:longint):string;
  158. begin
  159. while (length(s)<i) do
  160. s:=s+' ';
  161. PadEnd:=s;
  162. end;
  163. var
  164. idx,
  165. lastident,
  166. j,outline,
  167. ident,
  168. lines : longint;
  169. show : boolean;
  170. opt : string[32];
  171. input,
  172. s : string;
  173. begin
  174. MaybeLoadMessageFile;
  175. Message1(option_usage,paramstr(0));
  176. lastident:=0;
  177. if DoWriteLogo then
  178. lines:=3
  179. else
  180. lines:=1;
  181. for idx:=ord(ol_begin) to ord(ol_end) do
  182. begin
  183. { get a line and reset }
  184. s:=msg^.Get(idx);
  185. ident:=0;
  186. show:=false;
  187. { parse options }
  188. case s[1] of
  189. {$ifdef i386}
  190. '3',
  191. {$endif}
  192. {$ifdef m68k}
  193. '6',
  194. {$endif}
  195. '*' : show:=true;
  196. end;
  197. if show then
  198. begin
  199. case s[2] of
  200. {$ifdef TP}
  201. 't',
  202. {$endif}
  203. {$ifdef GDB}
  204. 'g',
  205. {$endif}
  206. {$ifdef linux}
  207. 'L',
  208. {$endif}
  209. {$ifdef os2}
  210. 'O',
  211. {$endif}
  212. '*' : show:=true;
  213. else
  214. show:=false;
  215. end;
  216. end;
  217. { now we may show the message or not }
  218. if show then
  219. begin
  220. case s[3] of
  221. '0' : begin
  222. ident:=0;
  223. outline:=0;
  224. end;
  225. '1' : begin
  226. ident:=2;
  227. outline:=7;
  228. end;
  229. '2' : begin
  230. ident:=11;
  231. outline:=11;
  232. end;
  233. '3' : begin
  234. ident:=21;
  235. outline:=6;
  236. end;
  237. end;
  238. j:=pos('_',s);
  239. opt:=Copy(s,4,j-4);
  240. if opt='*' then
  241. opt:=''
  242. else
  243. opt:=PadEnd('-'+opt,outline);
  244. if (ident=0) and (lastident<>0) then
  245. begin
  246. Comment(V_Normal,'');
  247. inc(Lines);
  248. end;
  249. { page full ? }
  250. if (lines>=page_size) then
  251. begin
  252. if not NoPressEnter then
  253. begin
  254. write('*** press enter ***');
  255. readln(input);
  256. if upper(input)='Q' then
  257. stop;
  258. end;
  259. lines:=0;
  260. end;
  261. Comment(V_Normal,PadEnd('',ident)+opt+Copy(s,j+1,255));
  262. LastIdent:=Ident;
  263. inc(Lines);
  264. end;
  265. end;
  266. stop;
  267. end;
  268. procedure Toption.QuickInfo(const s:string);
  269. begin
  270. if source_os.newline=#13#10 then
  271. Write(s+#10)
  272. else
  273. Writeln(s);
  274. Stop;
  275. end;
  276. procedure Toption.IllegalPara(const opt:string);
  277. begin
  278. Message1(option_illegal_para,opt);
  279. Message(option_help_pages_para);
  280. stop;
  281. end;
  282. function Toption.Unsetbool(const opts:string; pos: Longint):boolean;
  283. { checks if the character after pos in Opts is a + or a - and returns resp.
  284. false or true. If it is another character (or none), it also returns false }
  285. begin
  286. UnsetBool := (Length(Opts) > Pos) And (Opts[Succ(Pos)] = '-');
  287. end;
  288. procedure TOption.interpret_proc_specific_options(const opt:string);
  289. begin
  290. end;
  291. procedure TOption.interpret_option(const opt:string;ispara:boolean);
  292. var
  293. code : integer;
  294. c : char;
  295. more : string;
  296. major,minor : longint;
  297. error : integer;
  298. j,l : longint;
  299. d : DirStr;
  300. e : ExtStr;
  301. begin
  302. if opt='' then
  303. exit;
  304. { only parse define,undef,target,verbosity and link options the firsttime }
  305. if firstpass and
  306. not((opt[1]='-') and (opt[2] in ['i','d','v','T','u','n','X'])) then
  307. exit;
  308. case opt[1] of
  309. '-' : begin
  310. more:=Copy(opt,3,255);
  311. case opt[2] of
  312. '!' : initlocalswitches:=initlocalswitches+[cs_ansistrings];
  313. '?' : WriteHelpPages;
  314. 'a' : begin
  315. initglobalswitches:=initglobalswitches+[cs_asm_leave];
  316. for j:=1 to length(more) do
  317. case more[j] of
  318. 'l' : initglobalswitches:=initglobalswitches+[cs_asm_source];
  319. 'r' : initglobalswitches:=initglobalswitches+[cs_asm_regalloc];
  320. 't' : initglobalswitches:=initglobalswitches+[cs_asm_tempalloc];
  321. '-' : initglobalswitches:=initglobalswitches-[cs_asm_leave,cs_asm_source,cs_asm_regalloc];
  322. else
  323. IllegalPara(opt);
  324. end;
  325. end;
  326. 'A' : begin
  327. if set_string_asm(More) then
  328. begin
  329. initoutputformat:=target_asm.id;
  330. asm_is_set:=true;
  331. end
  332. else
  333. IllegalPara(opt);
  334. end;
  335. 'b' : begin
  336. {$ifdef BrowserLog}
  337. initglobalswitches:=initglobalswitches+[cs_browser_log];
  338. {$endif}
  339. if More<>'' then
  340. if More='l' then
  341. initmoduleswitches:=initmoduleswitches+[cs_local_browser]
  342. else if More='-' then
  343. begin
  344. initmoduleswitches:=initmoduleswitches-[cs_browser,cs_local_browser];
  345. {$ifdef BrowserLog}
  346. initglobalswitches:=initglobalswitches-[cs_browser_log];
  347. {$endif}
  348. end
  349. else if More<>'+' then
  350. {$ifdef BrowserLog}
  351. browserlog.elements_to_list^.insert(more);
  352. {$else}
  353. IllegalPara(opt);
  354. {$endif}
  355. end;
  356. 'B' : if more='' then
  357. do_build:=true
  358. else
  359. if more = '-' then
  360. do_build := False
  361. else
  362. IllegalPara(opt);
  363. 'C' : begin
  364. j := 1;
  365. while j <= length(more) Do
  366. Begin
  367. case more[j] of
  368. 'a' : Simplify_ppu:=true;
  369. 'h' :
  370. begin
  371. val(copy(more,j+1,length(more)-j),heapsize,code);
  372. if (code<>0) or (heapsize>=67107840) or (heapsize<1024) then
  373. IllegalPara(opt);
  374. break;
  375. end;
  376. 'i' : If UnsetBool(More, j) then
  377. Begin
  378. initlocalswitches:=initlocalswitches-[cs_check_io];
  379. inc(j)
  380. End
  381. else initlocalswitches:=initlocalswitches+[cs_check_io];
  382. 'n' : If UnsetBool(More, j) then
  383. Begin
  384. initglobalswitches:=initglobalswitches-[cs_link_extern];
  385. inc(j)
  386. End
  387. Else initglobalswitches:=initglobalswitches+[cs_link_extern];
  388. 'o' :
  389. If UnsetBool(More, j) then
  390. Begin
  391. initlocalswitches:=initlocalswitches-[cs_check_overflow];
  392. inc(j);
  393. End
  394. Else
  395. initlocalswitches:=initlocalswitches+[cs_check_overflow];
  396. 'r' :
  397. If UnsetBool(More, j) then
  398. Begin
  399. initlocalswitches:=initlocalswitches-[cs_check_range];
  400. inc(j);
  401. End
  402. Else
  403. initlocalswitches:=initlocalswitches+[cs_check_range];
  404. 's' :
  405. begin
  406. val(copy(more,j+1,length(more)-j),stacksize,code);
  407. if (code<>0) or (stacksize>=67107840) or (stacksize<1024) then
  408. IllegalPara(opt);
  409. break;
  410. end;
  411. 't' :
  412. If UnsetBool(More, j) then
  413. Begin
  414. initlocalswitches:=initlocalswitches-[cs_check_stack];
  415. inc(j)
  416. End
  417. Else
  418. initlocalswitches:=initlocalswitches+[cs_check_stack];
  419. 'D' :
  420. If UnsetBool(More, j) then
  421. Begin
  422. initmoduleswitches:=initmoduleswitches-[cs_create_dynamic];
  423. inc(j)
  424. End
  425. Else
  426. initmoduleswitches:=initmoduleswitches+[cs_create_dynamic];
  427. 'X' :
  428. If UnsetBool(More, j) then
  429. Begin
  430. initmoduleswitches:=initmoduleswitches-[cs_create_smart];
  431. inc(j)
  432. End
  433. Else
  434. initmoduleswitches:=initmoduleswitches+[cs_create_smart];
  435. else
  436. IllegalPara(opt);
  437. end;
  438. inc(j);
  439. end;
  440. end;
  441. 'd' : def_symbol(more);
  442. 'D' : begin
  443. initglobalswitches:=initglobalswitches+[cs_link_deffile];
  444. for j:=1 to length(more) do
  445. case more[j] of
  446. 'd' : begin
  447. description:=Copy(more,j+1,255);
  448. break;
  449. end;
  450. 'v' : begin
  451. dllversion:=Copy(more,j+1,255);
  452. l:=pos('.',dllversion);
  453. dllminor:=0;
  454. error:=0;
  455. if l>0 then
  456. begin
  457. valint(copy(dllversion,l+1,255),minor,error);
  458. if (error=0) and
  459. (minor>=0) and (minor<=$ffff) then
  460. dllminor:=minor
  461. else if error=0 then
  462. error:=1;
  463. end;
  464. if l=0 then l:=256;
  465. dllmajor:=1;
  466. if error=0 then
  467. valint(copy(dllversion,1,l-1),major,error);
  468. if (error=0) and (major>=0) and (major<=$ffff) then
  469. dllmajor:=major
  470. else if error=0 then
  471. error:=1;
  472. if error<>0 then
  473. Message1(scan_w_wrong_version_ignored,dllversion);
  474. break;
  475. end;
  476. 'w' : usewindowapi:=true;
  477. else
  478. IllegalPara(opt);
  479. end;
  480. end;
  481. 'e' : exepath:=FixPath(More,true);
  482. { Just used by RHIDE }
  483. 'E' : if (length(more)=0) or (UnsetBool(More, 0)) then
  484. initglobalswitches:=initglobalswitches+[cs_link_extern]
  485. else
  486. initglobalswitches:=initglobalswitches-[cs_link_extern];
  487. 'F' : begin
  488. c:=more[1];
  489. Delete(more,1,1);
  490. case c of
  491. 'D' : begin
  492. if not ispara then
  493. DefaultReplacements(More);
  494. utilsdirectory:=FixPath(More,true);
  495. end;
  496. 'e' : SetRedirectFile(More);
  497. 'E' : OutputExeDir:=FixPath(More,true);
  498. 'i' : if ispara then
  499. ParaIncludePath.AddPath(More,false)
  500. else
  501. includesearchpath.AddPath(More,false);
  502. 'g' : Message2(option_obsolete_switch_use_new,'-Fg','-Fl');
  503. 'l' : if ispara then
  504. ParaLibraryPath.AddPath(More,false)
  505. else
  506. LibrarySearchPath.AddPath(More,false);
  507. 'L' : if More<>'' then
  508. ParaDynamicLinker:=More
  509. else
  510. IllegalPara(opt);
  511. 'o' : if ispara then
  512. ParaObjectPath.AddPath(More,false)
  513. else
  514. ObjectSearchPath.AddPath(More,false);
  515. 'r' : Msgfilename:=More;
  516. 'u' : if ispara then
  517. ParaUnitPath.AddPath(More,false)
  518. else
  519. unitsearchpath.AddPath(More,false);
  520. 'U' : OutputUnitDir:=FixPath(More,true);
  521. else
  522. IllegalPara(opt);
  523. end;
  524. end;
  525. 'g' : begin
  526. if UnsetBool(More, 0) then
  527. initmoduleswitches:=initmoduleswitches-[cs_debuginfo]
  528. else
  529. begin
  530. {$ifdef GDB}
  531. initmoduleswitches:=initmoduleswitches+[cs_debuginfo];
  532. if not RelocSectionSetExplicitly then
  533. RelocSection:=false;
  534. for j:=1 to length(more) do
  535. case more[j] of
  536. 'd' : initglobalswitches:=initglobalswitches+[cs_gdb_dbx];
  537. 'g' : initglobalswitches:=initglobalswitches+[cs_gdb_gsym];
  538. 'h' : initglobalswitches:=initglobalswitches+[cs_gdb_heaptrc];
  539. 'c' : initglobalswitches:=initglobalswitches+[cs_checkpointer];
  540. {$ifdef EXTDEBUG}
  541. 'p' : only_one_pass:=true;
  542. {$endif EXTDEBUG}
  543. else
  544. IllegalPara(opt);
  545. end;
  546. {$else GDB}
  547. Message(option_no_debug_support);
  548. Message(option_no_debug_support_recompile_fpc);
  549. {$endif GDB}
  550. end;
  551. end;
  552. 'h' : begin
  553. NoPressEnter:=true;
  554. WriteHelpPages;
  555. end;
  556. 'i' : if more='' then
  557. WriteInfo
  558. else
  559. begin
  560. { Specific info, which can be used in Makefiles }
  561. case More[1] of
  562. 'S' : begin
  563. case More[2] of
  564. 'O' : QuickInfo(source_os.shortname);
  565. {$ifdef Delphi !!!!!!!!!}
  566. 'P' : QuickInfo('unknown');
  567. {$else}
  568. 'P' : QuickInfo(source_cpu_string);
  569. {$endif}
  570. end;
  571. end;
  572. 'T' : begin
  573. case More[2] of
  574. 'O' : QuickInfo(target_os.shortname);
  575. 'P' : QuickInfo(target_cpu_string);
  576. end;
  577. end;
  578. 'V' : QuickInfo(version_string);
  579. 'D' : QuickInfo(date_string);
  580. else
  581. IllegalPara(Opt);
  582. end;
  583. end;
  584. 'I' : if ispara then
  585. ParaIncludePath.AddPath(More,false)
  586. else
  587. includesearchpath.AddPath(More,false);
  588. 'k' : if more<>'' then
  589. ParaLinkOptions:=ParaLinkOptions+' '+More
  590. else
  591. IllegalPara(opt);
  592. 'l' : if more='' then
  593. DoWriteLogo:=true
  594. else
  595. IllegalPara(opt);
  596. 'm' : parapreprocess:=true;
  597. 'n' : if More='' then
  598. read_configfile:=false
  599. else
  600. IllegalPara(opt);
  601. 'o' : if More<>'' then
  602. Fsplit(More,d,OutputFile,e)
  603. else
  604. IllegalPara(opt);
  605. 'p' : begin
  606. if UnsetBool(More, 0) then
  607. begin
  608. initmoduleswitches:=initmoduleswitches-[cs_profile];
  609. undef_symbol('FPC_PROFILE');
  610. end
  611. else
  612. case more[1] of
  613. 'g' : if (length(opt)=3) and UnsetBool(more, 1) then
  614. begin
  615. initmoduleswitches:=initmoduleswitches-[cs_profile];
  616. undef_symbol('FPC_PROFILE');
  617. end
  618. else
  619. begin
  620. initmoduleswitches:=initmoduleswitches+[cs_profile];
  621. def_symbol('FPC_PROFILE');
  622. end;
  623. else
  624. IllegalPara(opt);
  625. end;
  626. end;
  627. {$ifdef linux}
  628. 'P' : initglobalswitches:=initglobalswitches+[cs_asm_pipe];
  629. {$endif}
  630. 's' : initglobalswitches:=initglobalswitches+[cs_asm_extern,cs_link_extern];
  631. 'S' : begin
  632. for j:=1 to length(more) do
  633. case more[j] of
  634. '2' : initmodeswitches:=objfpcmodeswitches;
  635. 'c' : initmoduleswitches:=initmoduleswitches+[cs_support_c_operators];
  636. 'd' : initmodeswitches:=delphimodeswitches;
  637. 'e' : begin
  638. val(copy(more,j+1,length(more)-j),l,code);
  639. if (code<>0) then
  640. SetMaxErrorCount(1)
  641. else
  642. begin
  643. SetMaxErrorCount(l);
  644. break;
  645. end;
  646. end;
  647. 'g' : initmoduleswitches:=initmoduleswitches+[cs_support_goto];
  648. 'h' : initlocalswitches:=initlocalswitches+[cs_ansistrings];
  649. 'i' : initmoduleswitches:=initmoduleswitches+[cs_support_inline];
  650. 'm' : initmoduleswitches:=initmoduleswitches+[cs_support_macro];
  651. 'o': initmodeswitches:=tpmodeswitches;
  652. 'p' : initmodeswitches:=gpcmodeswitches;
  653. 's' : initglobalswitches:=initglobalswitches+[cs_constructor_name];
  654. 't' : initmoduleswitches:=initmoduleswitches+[cs_static_keyword];
  655. 'v' : Message1(option_obsolete_switch,'-Sv');
  656. else
  657. IllegalPara(opt);
  658. end;
  659. end;
  660. 'T' : begin
  661. more:=Upper(More);
  662. if not target_is_set then
  663. begin
  664. { remove old target define }
  665. undef_symbol(target_info.short_name);
  666. { load new target }
  667. if not(set_string_target(More)) then
  668. IllegalPara(opt);
  669. { set new define }
  670. def_symbol(target_info.short_name);
  671. if not asm_is_set then
  672. initoutputformat:=target_asm.id;
  673. target_is_set:=true;
  674. end
  675. else
  676. if More<>target_info.short_name then
  677. Message1(option_target_is_already_set,target_info.short_name);
  678. end;
  679. 'u' : undef_symbol(upper(More));
  680. 'U' : begin
  681. for j:=1 to length(more) do
  682. case more[j] of
  683. {$ifdef UNITALIASES}
  684. 'a' : begin
  685. AddUnitAlias(Copy(More,j+1,255));
  686. break;
  687. end;
  688. {$endif UNITALIASES}
  689. 'n' : initglobalswitches:=initglobalswitches-[cs_check_unit_name];
  690. 'p' : begin
  691. Message2(option_obsolete_switch_use_new,'-Up','-Fu');
  692. break;
  693. end;
  694. 's' : initmoduleswitches:=initmoduleswitches+[cs_compilesystem];
  695. else
  696. IllegalPara(opt);
  697. end;
  698. end;
  699. 'v' : if not setverbosity(More) then
  700. IllegalPara(opt);
  701. 'W' : begin
  702. for j:=1 to length(More) do
  703. case More[j] of
  704. 'B': {bind_win32_dll:=true}
  705. begin
  706. { -WB200000 means set prefered base address
  707. to $200000, but does not change relocsection boolean
  708. this way we can create both relocatble and
  709. non relocatable DLL at a specific base address PM }
  710. if (length(More)>j) then
  711. begin
  712. if DLLImageBase=nil then
  713. DLLImageBase:=StringDup(Copy(More,j+1,255));
  714. end
  715. else
  716. begin
  717. RelocSection:=true;
  718. RelocSectionSetExplicitly:=true;
  719. end;
  720. break;
  721. end;
  722. 'C': apptype:=at_cui;
  723. 'D': ForceDeffileForExport:=true;
  724. 'G': apptype:=at_gui;
  725. 'N': begin
  726. RelocSection:=false;
  727. RelocSectionSetExplicitly:=true;
  728. end;
  729. 'R': begin
  730. RelocSection:=true;
  731. RelocSectionSetExplicitly:=true;
  732. end;
  733. else
  734. IllegalPara(opt);
  735. end;
  736. end;
  737. 'X' : begin
  738. for j:=1 to length(More) do
  739. case More[j] of
  740. 'c' : initglobalswitches:=initglobalswitches+[cs_link_toc];
  741. 's' : initglobalswitches:=initglobalswitches+[cs_link_strip];
  742. 'D' : begin
  743. def_symbol('FPC_LINK_DYNAMIC');
  744. undef_symbol('FPC_LINK_SMART');
  745. undef_symbol('FPC_LINK_STATIC');
  746. initglobalswitches:=initglobalswitches+[cs_link_shared];
  747. initglobalswitches:=initglobalswitches-[cs_link_static,cs_link_smart];
  748. end;
  749. 'S' : begin
  750. def_symbol('FPC_LINK_STATIC');
  751. undef_symbol('FPC_LINK_SMART');
  752. undef_symbol('FPC_LINK_DYNAMIC');
  753. initglobalswitches:=initglobalswitches+[cs_link_static];
  754. initglobalswitches:=initglobalswitches-[cs_link_shared,cs_link_smart];
  755. end;
  756. 'X' : begin
  757. def_symbol('FPC_LINK_SMART');
  758. undef_symbol('FPC_LINK_STATIC');
  759. undef_symbol('FPC_LINK_DYNAMIC');
  760. initglobalswitches:=initglobalswitches+[cs_link_smart];
  761. initglobalswitches:=initglobalswitches-[cs_link_shared,cs_link_static];
  762. end;
  763. else
  764. IllegalPara(opt);
  765. end;
  766. end;
  767. { give processor specific options a chance }
  768. else
  769. interpret_proc_specific_options(opt);
  770. end;
  771. end;
  772. '@' : begin
  773. Message(option_no_nested_response_file);
  774. Stop;
  775. end;
  776. else
  777. begin
  778. if (length(param_file)<>0) then
  779. Message(option_only_one_source_support);
  780. param_file:=opt;
  781. end;
  782. end;
  783. end;
  784. procedure Toption.Interpret_file(const filename : string);
  785. procedure RemoveSep(var fn:string);
  786. var
  787. i : longint;
  788. begin
  789. i:=0;
  790. while (i<length(fn)) and (fn[i+1] in [',',' ',#9]) do
  791. inc(i);
  792. Delete(fn,1,i);
  793. i:=length(fn);
  794. while (i>0) and (fn[i] in [',',' ',#9]) do
  795. dec(i);
  796. fn:=copy(fn,1,i);
  797. end;
  798. function GetName(var fn:string):string;
  799. var
  800. i : longint;
  801. begin
  802. i:=0;
  803. while (i<length(fn)) and (fn[i+1] in ['a'..'z','A'..'Z','0'..'9','_','-']) do
  804. inc(i);
  805. GetName:=Copy(fn,1,i);
  806. Delete(fn,1,i);
  807. end;
  808. const
  809. maxlevel=16;
  810. var
  811. f : text;
  812. s,
  813. opts : string;
  814. skip : array[0..maxlevel-1] of boolean;
  815. level : longint;
  816. begin
  817. { avoid infinite loop }
  818. Inc(FileLevel);
  819. If FileLevel>MaxLevel then
  820. Message(option_too_many_cfg_files);
  821. { open file }
  822. assign(f,filename);
  823. {$ifdef extdebug}
  824. Comment(V_Info,'trying to open file: '+filename);
  825. {$endif extdebug}
  826. {$I-}
  827. reset(f);
  828. {$I+}
  829. if ioresult<>0 then
  830. begin
  831. Message1(option_unable_open_file,filename);
  832. exit;
  833. end;
  834. fillchar(skip,sizeof(skip),0);
  835. level:=0;
  836. while not eof(f) do
  837. begin
  838. readln(f,opts);
  839. RemoveSep(opts);
  840. if (opts<>'') then
  841. begin
  842. if opts[1]='#' then
  843. begin
  844. Delete(opts,1,1);
  845. s:=upper(GetName(opts));
  846. if (s='SECTION') then
  847. begin
  848. RemoveSep(opts);
  849. s:=upper(GetName(opts));
  850. if level=0 then
  851. skip[level]:=not (check_symbol(s) or (s='COMMON'));
  852. end
  853. else
  854. if (s='IFDEF') then
  855. begin
  856. RemoveSep(opts);
  857. if Level>=maxlevel then
  858. begin
  859. Message(option_too_many_ifdef);
  860. stop;
  861. end;
  862. inc(Level);
  863. skip[level]:=(skip[level-1] or (not check_symbol(upper(GetName(opts)))));
  864. end
  865. else
  866. if (s='IFNDEF') then
  867. begin
  868. RemoveSep(opts);
  869. if Level>=maxlevel then
  870. begin
  871. Message(option_too_many_ifdef);
  872. stop;
  873. end;
  874. inc(Level);
  875. skip[level]:=(skip[level-1] or (check_symbol(upper(GetName(opts)))));
  876. end
  877. else
  878. if (s='ELSE') then
  879. skip[level]:=skip[level-1] or (not skip[level])
  880. else
  881. if (s='ENDIF') then
  882. begin
  883. skip[level]:=false;
  884. if Level=0 then
  885. begin
  886. Message(option_too_many_endif);
  887. stop;
  888. end;
  889. dec(level);
  890. end
  891. else
  892. if (not skip[level]) then
  893. begin
  894. if (s='DEFINE') then
  895. begin
  896. RemoveSep(opts);
  897. def_symbol(upper(GetName(opts)));
  898. end
  899. else
  900. if (s='UNDEF') then
  901. begin
  902. RemoveSep(opts);
  903. undef_symbol(upper(GetName(opts)));
  904. end
  905. else
  906. if (s='WRITE') then
  907. begin
  908. Delete(opts,1,1);
  909. WriteLn(opts);
  910. end
  911. else
  912. if (s='INCLUDE') then
  913. begin
  914. Delete(opts,1,1);
  915. Interpret_file(opts);
  916. end;
  917. end;
  918. end
  919. else
  920. begin
  921. if (not skip[level]) and (opts[1]='-') then
  922. interpret_option(opts,false)
  923. end;
  924. end;
  925. end;
  926. if Level>0 then
  927. Message(option_too_less_endif);
  928. Close(f);
  929. Dec(FileLevel);
  930. end;
  931. procedure Toption.Interpret_envvar(const envname : string);
  932. var
  933. argstart,
  934. env,
  935. pc : pchar;
  936. arglen : longint;
  937. quote : set of char;
  938. hs : string;
  939. begin
  940. env:=GetEnvPChar(envname);
  941. pc:=env;
  942. repeat
  943. { skip leading spaces }
  944. while pc^ in [' ',#9,#13] do
  945. inc(pc);
  946. case pc^ of
  947. #0 : break;
  948. '"' : begin
  949. quote:=['"'];
  950. inc(pc);
  951. end;
  952. '''' : begin
  953. quote:=[''''];
  954. inc(pc);
  955. end;
  956. else
  957. quote:=[' ',#9,#13];
  958. end;
  959. { scan until the end of the argument }
  960. argstart:=pc;
  961. while (pc^<>#0) and not(pc^ in quote) do
  962. inc(pc);
  963. { create argument }
  964. arglen:=pc-argstart;
  965. hs[0]:=chr(arglen);
  966. move(argstart^,hs[1],arglen);
  967. interpret_option(hs,true);
  968. { skip quote }
  969. if pc^ in quote then
  970. inc(pc);
  971. until false;
  972. FreeEnvPChar(env);
  973. end;
  974. procedure toption.read_parameters;
  975. var
  976. opts : string;
  977. paramindex : longint;
  978. begin
  979. paramindex:=0;
  980. while paramindex<paramcount do
  981. begin
  982. inc(paramindex);
  983. opts:=paramstr(paramindex);
  984. case opts[1] of
  985. '@' :
  986. begin
  987. Delete(opts,1,1);
  988. if not firstpass then
  989. Message1(option_reading_further_from,opts);
  990. interpret_file(opts);
  991. end;
  992. '!' :
  993. begin
  994. Delete(opts,1,1);
  995. if not firstpass then
  996. Message1(option_reading_further_from,'(env) '+opts);
  997. interpret_envvar(opts);
  998. end;
  999. else
  1000. interpret_option(opts,true);
  1001. end;
  1002. end;
  1003. end;
  1004. procedure toption.parsecmd(cmd:string);
  1005. var
  1006. i : longint;
  1007. opts : string;
  1008. begin
  1009. while (cmd<>'') do
  1010. begin
  1011. while cmd[1]=' ' do
  1012. delete(cmd,1,1);
  1013. i:=pos(' ',cmd);
  1014. if i=0 then
  1015. i:=255;
  1016. opts:=Copy(cmd,1,i-1);
  1017. Delete(cmd,1,i);
  1018. case opts[1] of
  1019. '@' :
  1020. begin
  1021. Delete(opts,1,1);
  1022. if not firstpass then
  1023. Message1(option_reading_further_from,opts);
  1024. interpret_file(opts);
  1025. end;
  1026. '!' :
  1027. begin
  1028. Delete(opts,1,1);
  1029. if not firstpass then
  1030. Message1(option_reading_further_from,'(env) '+opts);
  1031. interpret_envvar(opts);
  1032. end;
  1033. else
  1034. interpret_option(opts,true);
  1035. end;
  1036. end;
  1037. end;
  1038. constructor TOption.Init;
  1039. begin
  1040. DoWriteLogo:=false;
  1041. NoPressEnter:=false;
  1042. FirstPass:=false;
  1043. FileLevel:=0;
  1044. ParaIncludePath.Init;
  1045. ParaObjectPath.Init;
  1046. ParaUnitPath.Init;
  1047. ParaLibraryPath.Init;
  1048. end;
  1049. destructor TOption.Done;
  1050. begin
  1051. ParaIncludePath.Done;
  1052. ParaObjectPath.Done;
  1053. ParaUnitPath.Done;
  1054. ParaLibraryPath.Done;
  1055. end;
  1056. {****************************************************************************
  1057. Callable Routines
  1058. ****************************************************************************}
  1059. procedure read_arguments(cmd:string);
  1060. var
  1061. configpath : pathstr;
  1062. option : poption;
  1063. begin
  1064. {$ifdef Delphi}
  1065. option:=new(poption386,Init);
  1066. {$endif Delphi}
  1067. {$ifdef i386}
  1068. option:=new(poption386,Init);
  1069. {$endif}
  1070. {$ifdef m68k}
  1071. option:=new(poption68k,Init);
  1072. {$endif}
  1073. {$ifdef alpha}
  1074. option:=new(poption,Init);
  1075. {$endif}
  1076. {$ifdef powerpc}
  1077. option:=new(poption,Init);
  1078. {$endif}
  1079. { Load messages }
  1080. if (cmd='') and (paramcount=0) then
  1081. Option^.WriteHelpPages;
  1082. { default defines }
  1083. def_symbol(target_info.short_name);
  1084. def_symbol('FPK');
  1085. def_symbol('FPC');
  1086. def_symbol('VER'+version_nr);
  1087. def_symbol('VER'+version_nr+'_'+release_nr);
  1088. def_symbol('VER'+version_nr+'_'+release_nr+'_'+patch_nr);
  1089. {$ifdef newcg}
  1090. def_symbol('WITHNEWCG');
  1091. {$endif}
  1092. { Temporary defines, until things settle down }
  1093. def_symbol('INT64');
  1094. def_symbol('HASRESOURCESTRINGS');
  1095. def_symbol('HASSAVEREGISTERS');
  1096. def_symbol('NEWVMTOFFSET');
  1097. def_symbol('HASINTERNMATH');
  1098. def_symbol('SYSTEMTVARREC');
  1099. def_symbol('INCLUDEOK');
  1100. def_symbol('NEWMM');
  1101. def_symbol('HASWIDECHAR');
  1102. {$ifdef cardinalmulfix}
  1103. { for the compiler }
  1104. def_symbol('CARDINALMULFIX');
  1105. { for the RTL }
  1106. def_symbol('CARDINALMULFIXED');
  1107. {$endif cardinalmulfix}
  1108. { some stuff for TP compatibility }
  1109. {$ifdef i386}
  1110. def_symbol('CPU86');
  1111. def_symbol('CPU87');
  1112. {$endif}
  1113. {$ifdef m68k}
  1114. def_symbol('CPU68');
  1115. {$endif}
  1116. { new processor stuff }
  1117. {$ifdef i386}
  1118. def_symbol('CPUI386');
  1119. {$endif}
  1120. {$ifdef m68k}
  1121. def_symbol('CPU68K');
  1122. {$endif}
  1123. {$ifdef ALPHA}
  1124. def_symbol('CPUALPHA');
  1125. {$endif}
  1126. {$ifdef powerpc}
  1127. def_symbol('CPUPOWERPC');
  1128. {$endif}
  1129. { get default messagefile }
  1130. {$ifdef Delphi}
  1131. msgfilename:=dmisc.getenv('PPC_ERROR_FILE');
  1132. {$else Delphi}
  1133. msgfilename:=dos.getenv('PPC_ERROR_FILE');
  1134. {$endif Delphi}
  1135. { default configfile }
  1136. if (cmd<>'') and (cmd[1]='[') then
  1137. begin
  1138. ppccfg:=Copy(cmd,2,pos(']',cmd)-2);
  1139. Delete(cmd,1,pos(']',cmd));
  1140. end
  1141. else
  1142. begin
  1143. {$ifdef i386}
  1144. ppccfg:='ppc386.cfg';
  1145. {$endif i386}
  1146. {$ifdef m68k}
  1147. ppccfg:='ppc.cfg';
  1148. {$endif}
  1149. {$ifdef alpha}
  1150. ppccfg:='ppcalpha.cfg';
  1151. {$endif}
  1152. {$ifdef powerpc}
  1153. ppccfg:='ppcppc.cfg';
  1154. {$endif}
  1155. end;
  1156. { Order to read ppc386.cfg:
  1157. 1 - current dir
  1158. 2 - configpath
  1159. 3 - compiler path }
  1160. {$ifdef Delphi}
  1161. configpath:=FixPath(dmisc.getenv('PPC_CONFIG_PATH'),false);
  1162. {$else Delphi}
  1163. configpath:=FixPath(dos.getenv('PPC_CONFIG_PATH'),false);
  1164. {$endif Delphi}
  1165. {$ifdef linux}
  1166. if configpath='' then
  1167. configpath:='/etc/';
  1168. {$endif}
  1169. if ppccfg<>'' then
  1170. begin
  1171. read_configfile:=true;
  1172. if not FileExists(ppccfg) then
  1173. begin
  1174. {$ifdef linux}
  1175. if (dos.getenv('HOME')<>'') and FileExists(FixPath(dos.getenv('HOME'),false)+'.'+ppccfg) then
  1176. ppccfg:=FixPath(dos.getenv('HOME'),false)+'.'+ppccfg
  1177. else
  1178. {$endif}
  1179. if FileExists(configpath+ppccfg) then
  1180. ppccfg:=configpath+ppccfg
  1181. else
  1182. {$ifndef linux}
  1183. if FileExists(exepath+ppccfg) then
  1184. ppccfg:=exepath+ppccfg
  1185. else
  1186. {$endif}
  1187. read_configfile:=false;
  1188. end;
  1189. end
  1190. else
  1191. read_configfile:=false;
  1192. { Read commandline and configfile }
  1193. target_is_set:=false;
  1194. asm_is_set:=false;
  1195. param_file:='';
  1196. if read_configfile then
  1197. begin
  1198. { read the parameters quick, only -v -T }
  1199. option^.firstpass:=true;
  1200. if cmd<>'' then
  1201. option^.parsecmd(cmd)
  1202. else
  1203. option^.read_parameters;
  1204. option^.firstpass:=false;
  1205. if read_configfile then
  1206. begin
  1207. {$ifdef EXTDEBUG}
  1208. Comment(V_Debug,'read config file: '+ppccfg);
  1209. {$endif EXTDEBUG}
  1210. option^.interpret_file(ppccfg);
  1211. end;
  1212. end;
  1213. if cmd<>'' then
  1214. option^.parsecmd(cmd)
  1215. else
  1216. option^.read_parameters;
  1217. { Stop if errors in options }
  1218. if ErrorCount>0 then
  1219. Stop;
  1220. { write logo if set }
  1221. if option^.DoWriteLogo then
  1222. option^.WriteLogo;
  1223. { Check file to compile }
  1224. if param_file='' then
  1225. begin
  1226. Message(option_no_source_found);
  1227. Stop;
  1228. end;
  1229. {$ifndef linux}
  1230. param_file:=FixFileName(param_file);
  1231. {$endif}
  1232. fsplit(param_file,inputdir,inputfile,inputextension);
  1233. if inputextension='' then
  1234. begin
  1235. if FileExists(inputdir+inputfile+target_os.sourceext) then
  1236. inputextension:=target_os.sourceext
  1237. else
  1238. if FileExists(inputdir+inputfile+target_os.pasext) then
  1239. inputextension:=target_os.pasext;
  1240. end;
  1241. { Add paths specified with parameters to the searchpaths }
  1242. UnitSearchPath.AddList(Option^.ParaUnitPath,true);
  1243. ObjectSearchPath.AddList(Option^.ParaObjectPath,true);
  1244. IncludeSearchPath.AddList(Option^.ParaIncludePath,true);
  1245. LibrarySearchPath.AddList(Option^.ParaLibraryPath,true);
  1246. { add unit environment and exepath to the unit search path }
  1247. if inputdir<>'' then
  1248. Unitsearchpath.AddPath(inputdir,true);
  1249. {$ifdef Delphi}
  1250. UnitSearchPath.AddPath(dmisc.getenv(target_info.unit_env),false);
  1251. {$else}
  1252. UnitSearchPath.AddPath(dos.getenv(target_info.unit_env),false);
  1253. {$endif Delphi}
  1254. {$ifdef linux}
  1255. UnitSearchPath.AddPath('/usr/lib/fpc/'+version_string+'/units/'+lower(target_info.short_name),false);
  1256. UnitSearchPath.AddPath('/usr/lib/fpc/'+version_string+'/units/'+lower(target_info.short_name)+'/rtl',false);
  1257. {$else}
  1258. UnitSearchPath.AddPath(ExePath+'../units/'+lower(target_info.short_name),false);
  1259. UnitSearchPath.AddPath(ExePath+'../units/'+lower(target_info.short_name)+'/rtl',false);
  1260. {$endif}
  1261. UnitSearchPath.AddPath(ExePath,false);
  1262. { Add unit dir to the object and library path }
  1263. objectsearchpath.AddList(unitsearchpath,false);
  1264. librarysearchpath.AddList(unitsearchpath,false);
  1265. { switch assembler if it's binary and we got -a on the cmdline }
  1266. if (cs_asm_leave in initglobalswitches) and
  1267. (target_asm.id in binassem) then
  1268. begin
  1269. Message(option_switch_bin_to_src_assembler);
  1270. set_target_asm(target_info.assemsrc);
  1271. initoutputformat:=target_asm.id;
  1272. end;
  1273. { turn off stripping if compiling with debuginfo or profile }
  1274. if (cs_debuginfo in initmoduleswitches) or
  1275. (cs_profile in initmoduleswitches) then
  1276. initglobalswitches:=initglobalswitches-[cs_link_strip];
  1277. { Set defines depending on the target }
  1278. if (target_info.target in [target_i386_GO32V1,target_i386_GO32V2]) then
  1279. def_symbol('DPMI'); { MSDOS is not defined in BP when target is DPMI }
  1280. MaybeLoadMessageFile;
  1281. dispose(option,Done);
  1282. end;
  1283. end.
  1284. {
  1285. $Log$
  1286. Revision 1.48 2000-01-07 22:22:02 marco
  1287. * Added $target support for -FD
  1288. Revision 1.47 2000/01/07 01:14:27 peter
  1289. * updated copyright to 2000
  1290. Revision 1.46 2000/01/06 15:48:59 peter
  1291. * wildcard support for directory adding, this allows the use of units/*
  1292. in ppc386.cfg
  1293. Revision 1.45 1999/12/20 23:23:30 pierre
  1294. + $description $version
  1295. Revision 1.44 1999/12/20 21:42:36 pierre
  1296. + dllversion global variable
  1297. * FPC_USE_CPREFIX code removed, not necessary anymore
  1298. as we use .edata direct writing by default now.
  1299. Revision 1.43 1999/12/18 14:55:21 florian
  1300. * very basic widestring support
  1301. Revision 1.42 1999/12/11 18:53:31 jonas
  1302. * fixed type conversions of results of operations with cardinals
  1303. (between -dcardinalmulfix)
  1304. Revision 1.41 1999/12/10 10:03:54 peter
  1305. * fixed parameter orderning
  1306. Revision 1.40 1999/12/08 10:40:01 pierre
  1307. + allow use of unit var in exports of DLL for win32
  1308. by using direct export writing by default instead of use of DEFFILE
  1309. that does not allow assembler labels that do not
  1310. start with an underscore.
  1311. Use -WD to force use of Deffile for Win32 DLL
  1312. Revision 1.39 1999/12/06 18:21:03 peter
  1313. * support !ENVVAR for long commandlines
  1314. * win32/go32v2 write short pathnames to link.res so c:\Program Files\ is
  1315. finally supported as installdir.
  1316. Revision 1.38 1999/12/02 17:34:34 peter
  1317. * preprocessor support. But it fails on the caret in type blocks
  1318. Revision 1.37 1999/11/20 01:22:19 pierre
  1319. + cond FPC_USE_CPREFIX (needs also some RTL changes)
  1320. this allows to use unit global vars as DLL exports
  1321. (the underline prefix seems needed by dlltool)
  1322. Revision 1.36 1999/11/15 17:42:40 pierre
  1323. * -g disables reloc section for win32
  1324. Revision 1.35 1999/11/12 11:03:50 peter
  1325. * searchpaths changed to stringqueue object
  1326. Revision 1.34 1999/11/09 23:06:45 peter
  1327. * esi_offset -> selfpointer_offset to be newcg compatible
  1328. * hcogegen -> cgbase fixes for newcg
  1329. Revision 1.33 1999/11/06 14:34:21 peter
  1330. * truncated log to 20 revs
  1331. Revision 1.32 1999/11/04 23:13:25 peter
  1332. * moved unit alias support into ifdef
  1333. Revision 1.31 1999/11/04 10:54:03 peter
  1334. + -Ua<oldname>=<newname> unit alias support
  1335. Revision 1.30 1999/11/03 23:43:09 peter
  1336. * default units/rtl paths
  1337. Revision 1.29 1999/10/30 17:35:26 peter
  1338. * fpc_freemem fpc_getmem new callings updated
  1339. Revision 1.28 1999/10/28 11:13:36 pierre
  1340. * fix for cygwin make problem with -iTP
  1341. Revision 1.27 1999/10/26 13:13:47 peter
  1342. * define INCLUDEOK, which seems to work correct
  1343. Revision 1.26 1999/10/14 14:57:52 florian
  1344. - removed the hcodegen use in the new cg, use cgbase instead
  1345. Revision 1.25 1999/10/13 10:24:49 peter
  1346. * dpmi can only be set after reading the options
  1347. Revision 1.24 1999/10/03 19:44:41 peter
  1348. * removed objpasunit reference, tvarrec is now searched in systemunit
  1349. where it already was located
  1350. Revision 1.23 1999/09/20 16:38:59 peter
  1351. * cs_create_smart instead of cs_smartlink
  1352. * -CX is create smartlink
  1353. * -CD is create dynamic, but does nothing atm.
  1354. Revision 1.22 1999/09/16 11:34:56 pierre
  1355. * typo correction
  1356. Revision 1.21 1999/09/15 20:35:40 florian
  1357. * small fix to operator overloading when in MMX mode
  1358. + the compiler uses now fldz and fld1 if possible
  1359. + some fixes to floating point registers
  1360. + some math. functions (arctan, ln, sin, cos, sqrt, sqr, pi) are now inlined
  1361. * .... ???
  1362. Revision 1.20 1999/09/03 09:31:22 peter
  1363. * reading of search paths fixed to work as expected
  1364. Revision 1.19 1999/09/01 22:07:20 peter
  1365. * turn off stripping if profiling or debugging
  1366. Revision 1.18 1999/08/28 17:46:10 peter
  1367. * resources are working correct
  1368. Revision 1.17 1999/08/28 15:34:19 florian
  1369. * bug 519 fixed
  1370. Revision 1.16 1999/08/27 10:45:03 pierre
  1371. options -Ca sets simply_ppu to true
  1372. Revision 1.15 1999/08/25 22:51:00 pierre
  1373. * remove trailing space in cfg files
  1374. Revision 1.14 1999/08/16 15:35:26 pierre
  1375. * fix for DLL relocation problems
  1376. * external bss vars had wrong stabs for pecoff
  1377. + -WB11000000 to specify default image base, allows to
  1378. load several DLLs with debugging info included
  1379. (relocatable DLL are stripped because the relocation
  1380. of the .Stab section is misplaced by ldw)
  1381. Revision 1.13 1999/08/11 17:26:35 peter
  1382. * tlinker object is now inherited for win32 and dos
  1383. * postprocessexecutable is now a method of tlinker
  1384. }