options.pas 47 KB

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