options.pas 46 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487
  1. {
  2. $Id$
  3. Copyright (c) 1993-98 by the FPC development team
  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' : utilsdirectory:=FixPath(More,true);
  492. 'e' : SetRedirectFile(More);
  493. 'E' : OutputExeDir:=FixPath(More,true);
  494. 'i' : if ispara then
  495. ParaIncludePath.AddPath(More,false)
  496. else
  497. includesearchpath.AddPath(More,false);
  498. 'g' : Message2(option_obsolete_switch_use_new,'-Fg','-Fl');
  499. 'l' : if ispara then
  500. ParaLibraryPath.AddPath(More,false)
  501. else
  502. LibrarySearchPath.AddPath(More,false);
  503. 'L' : if More<>'' then
  504. ParaDynamicLinker:=More
  505. else
  506. IllegalPara(opt);
  507. 'o' : if ispara then
  508. ParaObjectPath.AddPath(More,false)
  509. else
  510. ObjectSearchPath.AddPath(More,false);
  511. 'r' : Msgfilename:=More;
  512. 'u' : if ispara then
  513. ParaUnitPath.AddPath(More,false)
  514. else
  515. unitsearchpath.AddPath(More,false);
  516. 'U' : OutputUnitDir:=FixPath(More,true);
  517. else
  518. IllegalPara(opt);
  519. end;
  520. end;
  521. 'g' : begin
  522. if UnsetBool(More, 0) then
  523. initmoduleswitches:=initmoduleswitches-[cs_debuginfo]
  524. else
  525. begin
  526. {$ifdef GDB}
  527. initmoduleswitches:=initmoduleswitches+[cs_debuginfo];
  528. if not RelocSectionSetExplicitly then
  529. RelocSection:=false;
  530. for j:=1 to length(more) do
  531. case more[j] of
  532. 'd' : initglobalswitches:=initglobalswitches+[cs_gdb_dbx];
  533. 'g' : initglobalswitches:=initglobalswitches+[cs_gdb_gsym];
  534. 'h' : initglobalswitches:=initglobalswitches+[cs_gdb_heaptrc];
  535. 'c' : initglobalswitches:=initglobalswitches+[cs_checkpointer];
  536. {$ifdef EXTDEBUG}
  537. 'p' : only_one_pass:=true;
  538. {$endif EXTDEBUG}
  539. else
  540. IllegalPara(opt);
  541. end;
  542. {$else GDB}
  543. Message(option_no_debug_support);
  544. Message(option_no_debug_support_recompile_fpc);
  545. {$endif GDB}
  546. end;
  547. end;
  548. 'h' : begin
  549. NoPressEnter:=true;
  550. WriteHelpPages;
  551. end;
  552. 'i' : if more='' then
  553. WriteInfo
  554. else
  555. begin
  556. { Specific info, which can be used in Makefiles }
  557. case More[1] of
  558. 'S' : begin
  559. case More[2] of
  560. 'O' : QuickInfo(source_os.shortname);
  561. {$ifdef Delphi !!!!!!!!!}
  562. 'P' : QuickInfo('unknown');
  563. {$else}
  564. 'P' : QuickInfo(source_cpu_string);
  565. {$endif}
  566. end;
  567. end;
  568. 'T' : begin
  569. case More[2] of
  570. 'O' : QuickInfo(target_os.shortname);
  571. 'P' : QuickInfo(target_cpu_string);
  572. end;
  573. end;
  574. 'V' : QuickInfo(version_string);
  575. 'D' : QuickInfo(date_string);
  576. else
  577. IllegalPara(Opt);
  578. end;
  579. end;
  580. 'I' : if ispara then
  581. ParaIncludePath.AddPath(More,false)
  582. else
  583. includesearchpath.AddPath(More,false);
  584. 'k' : if more<>'' then
  585. ParaLinkOptions:=ParaLinkOptions+' '+More
  586. else
  587. IllegalPara(opt);
  588. 'l' : if more='' then
  589. DoWriteLogo:=true
  590. else
  591. IllegalPara(opt);
  592. 'm' : parapreprocess:=true;
  593. 'n' : if More='' then
  594. read_configfile:=false
  595. else
  596. IllegalPara(opt);
  597. 'o' : if More<>'' then
  598. Fsplit(More,d,OutputFile,e)
  599. else
  600. IllegalPara(opt);
  601. 'p' : begin
  602. if UnsetBool(More, 0) then
  603. begin
  604. initmoduleswitches:=initmoduleswitches-[cs_profile];
  605. undef_symbol('FPC_PROFILE');
  606. end
  607. else
  608. case more[1] of
  609. 'g' : if (length(opt)=3) and UnsetBool(more, 1) then
  610. begin
  611. initmoduleswitches:=initmoduleswitches-[cs_profile];
  612. undef_symbol('FPC_PROFILE');
  613. end
  614. else
  615. begin
  616. initmoduleswitches:=initmoduleswitches+[cs_profile];
  617. def_symbol('FPC_PROFILE');
  618. end;
  619. else
  620. IllegalPara(opt);
  621. end;
  622. end;
  623. {$ifdef linux}
  624. 'P' : initglobalswitches:=initglobalswitches+[cs_asm_pipe];
  625. {$endif}
  626. 's' : initglobalswitches:=initglobalswitches+[cs_asm_extern,cs_link_extern];
  627. 'S' : begin
  628. for j:=1 to length(more) do
  629. case more[j] of
  630. '2' : initmodeswitches:=objfpcmodeswitches;
  631. 'c' : initmoduleswitches:=initmoduleswitches+[cs_support_c_operators];
  632. 'd' : initmodeswitches:=delphimodeswitches;
  633. 'e' : begin
  634. val(copy(more,j+1,length(more)-j),l,code);
  635. if (code<>0) then
  636. SetMaxErrorCount(1)
  637. else
  638. begin
  639. SetMaxErrorCount(l);
  640. break;
  641. end;
  642. end;
  643. 'g' : initmoduleswitches:=initmoduleswitches+[cs_support_goto];
  644. 'h' : initlocalswitches:=initlocalswitches+[cs_ansistrings];
  645. 'i' : initmoduleswitches:=initmoduleswitches+[cs_support_inline];
  646. 'm' : initmoduleswitches:=initmoduleswitches+[cs_support_macro];
  647. 'o': initmodeswitches:=tpmodeswitches;
  648. 'p' : initmodeswitches:=gpcmodeswitches;
  649. 's' : initglobalswitches:=initglobalswitches+[cs_constructor_name];
  650. 't' : initmoduleswitches:=initmoduleswitches+[cs_static_keyword];
  651. 'v' : Message1(option_obsolete_switch,'-Sv');
  652. else
  653. IllegalPara(opt);
  654. end;
  655. end;
  656. 'T' : begin
  657. more:=Upper(More);
  658. if not target_is_set then
  659. begin
  660. { remove old target define }
  661. undef_symbol(target_info.short_name);
  662. { load new target }
  663. if not(set_string_target(More)) then
  664. IllegalPara(opt);
  665. { set new define }
  666. def_symbol(target_info.short_name);
  667. if not asm_is_set then
  668. initoutputformat:=target_asm.id;
  669. target_is_set:=true;
  670. end
  671. else
  672. if More<>target_info.short_name then
  673. Message1(option_target_is_already_set,target_info.short_name);
  674. end;
  675. 'u' : undef_symbol(upper(More));
  676. 'U' : begin
  677. for j:=1 to length(more) do
  678. case more[j] of
  679. {$ifdef UNITALIASES}
  680. 'a' : begin
  681. AddUnitAlias(Copy(More,j+1,255));
  682. break;
  683. end;
  684. {$endif UNITALIASES}
  685. 'n' : initglobalswitches:=initglobalswitches-[cs_check_unit_name];
  686. 'p' : begin
  687. Message2(option_obsolete_switch_use_new,'-Up','-Fu');
  688. break;
  689. end;
  690. 's' : initmoduleswitches:=initmoduleswitches+[cs_compilesystem];
  691. else
  692. IllegalPara(opt);
  693. end;
  694. end;
  695. 'v' : if not setverbosity(More) then
  696. IllegalPara(opt);
  697. 'W' : begin
  698. for j:=1 to length(More) do
  699. case More[j] of
  700. 'B': {bind_win32_dll:=true}
  701. begin
  702. { -WB200000 means set prefered base address
  703. to $200000, but does not change relocsection boolean
  704. this way we can create both relocatble and
  705. non relocatable DLL at a specific base address PM }
  706. if (length(More)>j) then
  707. begin
  708. if DLLImageBase=nil then
  709. DLLImageBase:=StringDup(Copy(More,j+1,255));
  710. end
  711. else
  712. begin
  713. RelocSection:=true;
  714. RelocSectionSetExplicitly:=true;
  715. end;
  716. break;
  717. end;
  718. 'C': apptype:=at_cui;
  719. 'D': ForceDeffileForExport:=true;
  720. 'G': apptype:=at_gui;
  721. 'N': begin
  722. RelocSection:=false;
  723. RelocSectionSetExplicitly:=true;
  724. end;
  725. 'R': begin
  726. RelocSection:=true;
  727. RelocSectionSetExplicitly:=true;
  728. end;
  729. else
  730. IllegalPara(opt);
  731. end;
  732. end;
  733. 'X' : begin
  734. for j:=1 to length(More) do
  735. case More[j] of
  736. 'c' : initglobalswitches:=initglobalswitches+[cs_link_toc];
  737. 's' : initglobalswitches:=initglobalswitches+[cs_link_strip];
  738. 'D' : begin
  739. def_symbol('FPC_LINK_DYNAMIC');
  740. undef_symbol('FPC_LINK_SMART');
  741. undef_symbol('FPC_LINK_STATIC');
  742. initglobalswitches:=initglobalswitches+[cs_link_shared];
  743. initglobalswitches:=initglobalswitches-[cs_link_static,cs_link_smart];
  744. end;
  745. 'S' : begin
  746. def_symbol('FPC_LINK_STATIC');
  747. undef_symbol('FPC_LINK_SMART');
  748. undef_symbol('FPC_LINK_DYNAMIC');
  749. initglobalswitches:=initglobalswitches+[cs_link_static];
  750. initglobalswitches:=initglobalswitches-[cs_link_shared,cs_link_smart];
  751. end;
  752. 'X' : begin
  753. def_symbol('FPC_LINK_SMART');
  754. undef_symbol('FPC_LINK_STATIC');
  755. undef_symbol('FPC_LINK_DYNAMIC');
  756. initglobalswitches:=initglobalswitches+[cs_link_smart];
  757. initglobalswitches:=initglobalswitches-[cs_link_shared,cs_link_static];
  758. end;
  759. else
  760. IllegalPara(opt);
  761. end;
  762. end;
  763. { give processor specific options a chance }
  764. else
  765. interpret_proc_specific_options(opt);
  766. end;
  767. end;
  768. '@' : begin
  769. Message(option_no_nested_response_file);
  770. Stop;
  771. end;
  772. else
  773. begin
  774. if (length(param_file)<>0) then
  775. Message(option_only_one_source_support);
  776. param_file:=opt;
  777. end;
  778. end;
  779. end;
  780. procedure Toption.Interpret_file(const filename : string);
  781. procedure RemoveSep(var fn:string);
  782. var
  783. i : longint;
  784. begin
  785. i:=0;
  786. while (i<length(fn)) and (fn[i+1] in [',',' ',#9]) do
  787. inc(i);
  788. Delete(fn,1,i);
  789. i:=length(fn);
  790. while (i>0) and (fn[i] in [',',' ',#9]) do
  791. dec(i);
  792. fn:=copy(fn,1,i);
  793. end;
  794. function GetName(var fn:string):string;
  795. var
  796. i : longint;
  797. begin
  798. i:=0;
  799. while (i<length(fn)) and (fn[i+1] in ['a'..'z','A'..'Z','0'..'9','_','-']) do
  800. inc(i);
  801. GetName:=Copy(fn,1,i);
  802. Delete(fn,1,i);
  803. end;
  804. const
  805. maxlevel=16;
  806. var
  807. f : text;
  808. s,
  809. opts : string;
  810. skip : array[0..maxlevel-1] of boolean;
  811. level : longint;
  812. begin
  813. { avoid infinite loop }
  814. Inc(FileLevel);
  815. If FileLevel>MaxLevel then
  816. Message(option_too_many_cfg_files);
  817. { open file }
  818. assign(f,filename);
  819. {$ifdef extdebug}
  820. Comment(V_Info,'trying to open file: '+filename);
  821. {$endif extdebug}
  822. {$I-}
  823. reset(f);
  824. {$I+}
  825. if ioresult<>0 then
  826. begin
  827. Message1(option_unable_open_file,filename);
  828. exit;
  829. end;
  830. fillchar(skip,sizeof(skip),0);
  831. level:=0;
  832. while not eof(f) do
  833. begin
  834. readln(f,opts);
  835. RemoveSep(opts);
  836. if (opts<>'') then
  837. begin
  838. if opts[1]='#' then
  839. begin
  840. Delete(opts,1,1);
  841. s:=upper(GetName(opts));
  842. if (s='SECTION') then
  843. begin
  844. RemoveSep(opts);
  845. s:=upper(GetName(opts));
  846. if level=0 then
  847. skip[level]:=not (check_symbol(s) or (s='COMMON'));
  848. end
  849. else
  850. if (s='IFDEF') then
  851. begin
  852. RemoveSep(opts);
  853. if Level>=maxlevel then
  854. begin
  855. Message(option_too_many_ifdef);
  856. stop;
  857. end;
  858. inc(Level);
  859. skip[level]:=(skip[level-1] or (not check_symbol(upper(GetName(opts)))));
  860. end
  861. else
  862. if (s='IFNDEF') then
  863. begin
  864. RemoveSep(opts);
  865. if Level>=maxlevel then
  866. begin
  867. Message(option_too_many_ifdef);
  868. stop;
  869. end;
  870. inc(Level);
  871. skip[level]:=(skip[level-1] or (check_symbol(upper(GetName(opts)))));
  872. end
  873. else
  874. if (s='ELSE') then
  875. skip[level]:=skip[level-1] or (not skip[level])
  876. else
  877. if (s='ENDIF') then
  878. begin
  879. skip[level]:=false;
  880. if Level=0 then
  881. begin
  882. Message(option_too_many_endif);
  883. stop;
  884. end;
  885. dec(level);
  886. end
  887. else
  888. if (not skip[level]) then
  889. begin
  890. if (s='DEFINE') then
  891. begin
  892. RemoveSep(opts);
  893. def_symbol(upper(GetName(opts)));
  894. end
  895. else
  896. if (s='UNDEF') then
  897. begin
  898. RemoveSep(opts);
  899. undef_symbol(upper(GetName(opts)));
  900. end
  901. else
  902. if (s='WRITE') then
  903. begin
  904. Delete(opts,1,1);
  905. WriteLn(opts);
  906. end
  907. else
  908. if (s='INCLUDE') then
  909. begin
  910. Delete(opts,1,1);
  911. Interpret_file(opts);
  912. end;
  913. end;
  914. end
  915. else
  916. begin
  917. if (not skip[level]) and (opts[1]='-') then
  918. interpret_option(opts,false)
  919. end;
  920. end;
  921. end;
  922. if Level>0 then
  923. Message(option_too_less_endif);
  924. Close(f);
  925. Dec(FileLevel);
  926. end;
  927. procedure Toption.Interpret_envvar(const envname : string);
  928. var
  929. argstart,
  930. env,
  931. pc : pchar;
  932. arglen : longint;
  933. quote : set of char;
  934. hs : string;
  935. begin
  936. env:=GetEnvPChar(envname);
  937. pc:=env;
  938. repeat
  939. { skip leading spaces }
  940. while pc^ in [' ',#9,#13] do
  941. inc(pc);
  942. case pc^ of
  943. #0 : break;
  944. '"' : begin
  945. quote:=['"'];
  946. inc(pc);
  947. end;
  948. '''' : begin
  949. quote:=[''''];
  950. inc(pc);
  951. end;
  952. else
  953. quote:=[' ',#9,#13];
  954. end;
  955. { scan until the end of the argument }
  956. argstart:=pc;
  957. while (pc^<>#0) and not(pc^ in quote) do
  958. inc(pc);
  959. { create argument }
  960. arglen:=pc-argstart;
  961. hs[0]:=chr(arglen);
  962. move(argstart^,hs[1],arglen);
  963. interpret_option(hs,true);
  964. { skip quote }
  965. if pc^ in quote then
  966. inc(pc);
  967. until false;
  968. FreeEnvPChar(env);
  969. end;
  970. procedure toption.read_parameters;
  971. var
  972. opts : string;
  973. paramindex : longint;
  974. begin
  975. paramindex:=0;
  976. while paramindex<paramcount do
  977. begin
  978. inc(paramindex);
  979. opts:=paramstr(paramindex);
  980. case opts[1] of
  981. '@' :
  982. begin
  983. Delete(opts,1,1);
  984. if not firstpass then
  985. Message1(option_reading_further_from,opts);
  986. interpret_file(opts);
  987. end;
  988. '!' :
  989. begin
  990. Delete(opts,1,1);
  991. if not firstpass then
  992. Message1(option_reading_further_from,'(env) '+opts);
  993. interpret_envvar(opts);
  994. end;
  995. else
  996. interpret_option(opts,true);
  997. end;
  998. end;
  999. end;
  1000. procedure toption.parsecmd(cmd:string);
  1001. var
  1002. i : longint;
  1003. opts : string;
  1004. begin
  1005. while (cmd<>'') do
  1006. begin
  1007. while cmd[1]=' ' do
  1008. delete(cmd,1,1);
  1009. i:=pos(' ',cmd);
  1010. if i=0 then
  1011. i:=255;
  1012. opts:=Copy(cmd,1,i-1);
  1013. Delete(cmd,1,i);
  1014. case opts[1] of
  1015. '@' :
  1016. begin
  1017. Delete(opts,1,1);
  1018. if not firstpass then
  1019. Message1(option_reading_further_from,opts);
  1020. interpret_file(opts);
  1021. end;
  1022. '!' :
  1023. begin
  1024. Delete(opts,1,1);
  1025. if not firstpass then
  1026. Message1(option_reading_further_from,'(env) '+opts);
  1027. interpret_envvar(opts);
  1028. end;
  1029. else
  1030. interpret_option(opts,true);
  1031. end;
  1032. end;
  1033. end;
  1034. constructor TOption.Init;
  1035. begin
  1036. DoWriteLogo:=false;
  1037. NoPressEnter:=false;
  1038. FirstPass:=false;
  1039. FileLevel:=0;
  1040. ParaIncludePath.Init;
  1041. ParaObjectPath.Init;
  1042. ParaUnitPath.Init;
  1043. ParaLibraryPath.Init;
  1044. end;
  1045. destructor TOption.Done;
  1046. begin
  1047. ParaIncludePath.Done;
  1048. ParaObjectPath.Done;
  1049. ParaUnitPath.Done;
  1050. ParaLibraryPath.Done;
  1051. end;
  1052. {****************************************************************************
  1053. Callable Routines
  1054. ****************************************************************************}
  1055. procedure read_arguments(cmd:string);
  1056. var
  1057. configpath : pathstr;
  1058. option : poption;
  1059. begin
  1060. {$ifdef Delphi}
  1061. option:=new(poption386,Init);
  1062. {$endif Delphi}
  1063. {$ifdef i386}
  1064. option:=new(poption386,Init);
  1065. {$endif}
  1066. {$ifdef m68k}
  1067. option:=new(poption68k,Init);
  1068. {$endif}
  1069. {$ifdef alpha}
  1070. option:=new(poption,Init);
  1071. {$endif}
  1072. {$ifdef powerpc}
  1073. option:=new(poption,Init);
  1074. {$endif}
  1075. { Load messages }
  1076. if (cmd='') and (paramcount=0) then
  1077. Option^.WriteHelpPages;
  1078. { default defines }
  1079. def_symbol(target_info.short_name);
  1080. def_symbol('FPK');
  1081. def_symbol('FPC');
  1082. def_symbol('VER'+version_nr);
  1083. def_symbol('VER'+version_nr+'_'+release_nr);
  1084. def_symbol('VER'+version_nr+'_'+release_nr+'_'+patch_nr);
  1085. {$ifdef newcg}
  1086. def_symbol('WITHNEWCG');
  1087. {$endif}
  1088. { Temporary defines, until things settle down }
  1089. def_symbol('INT64');
  1090. def_symbol('HASRESOURCESTRINGS');
  1091. def_symbol('HASSAVEREGISTERS');
  1092. def_symbol('NEWVMTOFFSET');
  1093. def_symbol('HASINTERNMATH');
  1094. def_symbol('SYSTEMTVARREC');
  1095. def_symbol('INCLUDEOK');
  1096. def_symbol('NEWMM');
  1097. def_symbol('HASWIDECHAR');
  1098. {$ifdef cardinalmulfix}
  1099. { for the compiler }
  1100. def_symbol('CARDINALMULFIX');
  1101. { for the RTL }
  1102. def_symbol('CARDINALMULFIXED');
  1103. {$endif cardinalmulfix}
  1104. { some stuff for TP compatibility }
  1105. {$ifdef i386}
  1106. def_symbol('CPU86');
  1107. def_symbol('CPU87');
  1108. {$endif}
  1109. {$ifdef m68k}
  1110. def_symbol('CPU68');
  1111. {$endif}
  1112. { new processor stuff }
  1113. {$ifdef i386}
  1114. def_symbol('CPUI386');
  1115. {$endif}
  1116. {$ifdef m68k}
  1117. def_symbol('CPU68K');
  1118. {$endif}
  1119. {$ifdef ALPHA}
  1120. def_symbol('CPUALPHA');
  1121. {$endif}
  1122. {$ifdef powerpc}
  1123. def_symbol('CPUPOWERPC');
  1124. {$endif}
  1125. { get default messagefile }
  1126. {$ifdef Delphi}
  1127. msgfilename:=dmisc.getenv('PPC_ERROR_FILE');
  1128. {$else Delphi}
  1129. msgfilename:=dos.getenv('PPC_ERROR_FILE');
  1130. {$endif Delphi}
  1131. { default configfile }
  1132. if (cmd<>'') and (cmd[1]='[') then
  1133. begin
  1134. ppccfg:=Copy(cmd,2,pos(']',cmd)-2);
  1135. Delete(cmd,1,pos(']',cmd));
  1136. end
  1137. else
  1138. begin
  1139. {$ifdef i386}
  1140. ppccfg:='ppc386.cfg';
  1141. {$endif i386}
  1142. {$ifdef m68k}
  1143. ppccfg:='ppc.cfg';
  1144. {$endif}
  1145. {$ifdef alpha}
  1146. ppccfg:='ppcalpha.cfg';
  1147. {$endif}
  1148. {$ifdef powerpc}
  1149. ppccfg:='ppcppc.cfg';
  1150. {$endif}
  1151. end;
  1152. { Order to read ppc386.cfg:
  1153. 1 - current dir
  1154. 2 - configpath
  1155. 3 - compiler path }
  1156. {$ifdef Delphi}
  1157. configpath:=FixPath(dmisc.getenv('PPC_CONFIG_PATH'),false);
  1158. {$else Delphi}
  1159. configpath:=FixPath(dos.getenv('PPC_CONFIG_PATH'),false);
  1160. {$endif Delphi}
  1161. {$ifdef linux}
  1162. if configpath='' then
  1163. configpath:='/etc/';
  1164. {$endif}
  1165. if ppccfg<>'' then
  1166. begin
  1167. read_configfile:=true;
  1168. if not FileExists(ppccfg) then
  1169. begin
  1170. {$ifdef linux}
  1171. if (dos.getenv('HOME')<>'') and FileExists(FixPath(dos.getenv('HOME'),false)+'.'+ppccfg) then
  1172. ppccfg:=FixPath(dos.getenv('HOME'),false)+'.'+ppccfg
  1173. else
  1174. {$endif}
  1175. if FileExists(configpath+ppccfg) then
  1176. ppccfg:=configpath+ppccfg
  1177. else
  1178. {$ifndef linux}
  1179. if FileExists(exepath+ppccfg) then
  1180. ppccfg:=exepath+ppccfg
  1181. else
  1182. {$endif}
  1183. read_configfile:=false;
  1184. end;
  1185. end
  1186. else
  1187. read_configfile:=false;
  1188. { Read commandline and configfile }
  1189. target_is_set:=false;
  1190. asm_is_set:=false;
  1191. param_file:='';
  1192. if read_configfile then
  1193. begin
  1194. { read the parameters quick, only -v -T }
  1195. option^.firstpass:=true;
  1196. if cmd<>'' then
  1197. option^.parsecmd(cmd)
  1198. else
  1199. option^.read_parameters;
  1200. option^.firstpass:=false;
  1201. if read_configfile then
  1202. begin
  1203. {$ifdef EXTDEBUG}
  1204. Comment(V_Debug,'read config file: '+ppccfg);
  1205. {$endif EXTDEBUG}
  1206. option^.interpret_file(ppccfg);
  1207. end;
  1208. end;
  1209. if cmd<>'' then
  1210. option^.parsecmd(cmd)
  1211. else
  1212. option^.read_parameters;
  1213. { Stop if errors in options }
  1214. if ErrorCount>0 then
  1215. Stop;
  1216. { write logo if set }
  1217. if option^.DoWriteLogo then
  1218. option^.WriteLogo;
  1219. { Check file to compile }
  1220. if param_file='' then
  1221. begin
  1222. Message(option_no_source_found);
  1223. Stop;
  1224. end;
  1225. {$ifndef linux}
  1226. param_file:=FixFileName(param_file);
  1227. {$endif}
  1228. fsplit(param_file,inputdir,inputfile,inputextension);
  1229. if inputextension='' then
  1230. begin
  1231. if FileExists(inputdir+inputfile+target_os.sourceext) then
  1232. inputextension:=target_os.sourceext
  1233. else
  1234. if FileExists(inputdir+inputfile+target_os.pasext) then
  1235. inputextension:=target_os.pasext;
  1236. end;
  1237. { Add paths specified with parameters to the searchpaths }
  1238. UnitSearchPath.AddList(Option^.ParaUnitPath,true);
  1239. ObjectSearchPath.AddList(Option^.ParaObjectPath,true);
  1240. IncludeSearchPath.AddList(Option^.ParaIncludePath,true);
  1241. LibrarySearchPath.AddList(Option^.ParaLibraryPath,true);
  1242. { add unit environment and exepath to the unit search path }
  1243. if inputdir<>'' then
  1244. Unitsearchpath.AddPath(inputdir,true);
  1245. {$ifdef Delphi}
  1246. UnitSearchPath.AddPath(dmisc.getenv(target_info.unit_env),false);
  1247. {$else}
  1248. UnitSearchPath.AddPath(dos.getenv(target_info.unit_env),false);
  1249. {$endif Delphi}
  1250. {$ifdef linux}
  1251. UnitSearchPath.AddPath('/usr/lib/fpc/'+version_string+'/units/'+lower(target_info.short_name),false);
  1252. UnitSearchPath.AddPath('/usr/lib/fpc/'+version_string+'/rtl/'+lower(target_info.short_name),false);
  1253. {$else}
  1254. UnitSearchPath.AddPath(ExePath+'../units/'+lower(target_info.short_name),false);
  1255. UnitSearchPath.AddPath(ExePath+'../rtl/'+lower(target_info.short_name),false);
  1256. {$endif}
  1257. UnitSearchPath.AddPath(ExePath,false);
  1258. { Add unit dir to the object and library path }
  1259. objectsearchpath.AddList(unitsearchpath,false);
  1260. librarysearchpath.AddList(unitsearchpath,false);
  1261. { switch assembler if it's binary and we got -a on the cmdline }
  1262. if (cs_asm_leave in initglobalswitches) and
  1263. (target_asm.id in binassem) then
  1264. begin
  1265. Message(option_switch_bin_to_src_assembler);
  1266. set_target_asm(target_info.assemsrc);
  1267. initoutputformat:=target_asm.id;
  1268. end;
  1269. { turn off stripping if compiling with debuginfo or profile }
  1270. if (cs_debuginfo in initmoduleswitches) or
  1271. (cs_profile in initmoduleswitches) then
  1272. initglobalswitches:=initglobalswitches-[cs_link_strip];
  1273. { Set defines depending on the target }
  1274. if (target_info.target in [target_i386_GO32V1,target_i386_GO32V2]) then
  1275. def_symbol('DPMI'); { MSDOS is not defined in BP when target is DPMI }
  1276. MaybeLoadMessageFile;
  1277. dispose(option,Done);
  1278. end;
  1279. end.
  1280. {
  1281. $Log$
  1282. Revision 1.45 1999-12-20 23:23:30 pierre
  1283. + $description $version
  1284. Revision 1.44 1999/12/20 21:42:36 pierre
  1285. + dllversion global variable
  1286. * FPC_USE_CPREFIX code removed, not necessary anymore
  1287. as we use .edata direct writing by default now.
  1288. Revision 1.43 1999/12/18 14:55:21 florian
  1289. * very basic widestring support
  1290. Revision 1.42 1999/12/11 18:53:31 jonas
  1291. * fixed type conversions of results of operations with cardinals
  1292. (between -dcardinalmulfix)
  1293. Revision 1.41 1999/12/10 10:03:54 peter
  1294. * fixed parameter orderning
  1295. Revision 1.40 1999/12/08 10:40:01 pierre
  1296. + allow use of unit var in exports of DLL for win32
  1297. by using direct export writing by default instead of use of DEFFILE
  1298. that does not allow assembler labels that do not
  1299. start with an underscore.
  1300. Use -WD to force use of Deffile for Win32 DLL
  1301. Revision 1.39 1999/12/06 18:21:03 peter
  1302. * support !ENVVAR for long commandlines
  1303. * win32/go32v2 write short pathnames to link.res so c:\Program Files\ is
  1304. finally supported as installdir.
  1305. Revision 1.38 1999/12/02 17:34:34 peter
  1306. * preprocessor support. But it fails on the caret in type blocks
  1307. Revision 1.37 1999/11/20 01:22:19 pierre
  1308. + cond FPC_USE_CPREFIX (needs also some RTL changes)
  1309. this allows to use unit global vars as DLL exports
  1310. (the underline prefix seems needed by dlltool)
  1311. Revision 1.36 1999/11/15 17:42:40 pierre
  1312. * -g disables reloc section for win32
  1313. Revision 1.35 1999/11/12 11:03:50 peter
  1314. * searchpaths changed to stringqueue object
  1315. Revision 1.34 1999/11/09 23:06:45 peter
  1316. * esi_offset -> selfpointer_offset to be newcg compatible
  1317. * hcogegen -> cgbase fixes for newcg
  1318. Revision 1.33 1999/11/06 14:34:21 peter
  1319. * truncated log to 20 revs
  1320. Revision 1.32 1999/11/04 23:13:25 peter
  1321. * moved unit alias support into ifdef
  1322. Revision 1.31 1999/11/04 10:54:03 peter
  1323. + -Ua<oldname>=<newname> unit alias support
  1324. Revision 1.30 1999/11/03 23:43:09 peter
  1325. * default units/rtl paths
  1326. Revision 1.29 1999/10/30 17:35:26 peter
  1327. * fpc_freemem fpc_getmem new callings updated
  1328. Revision 1.28 1999/10/28 11:13:36 pierre
  1329. * fix for cygwin make problem with -iTP
  1330. Revision 1.27 1999/10/26 13:13:47 peter
  1331. * define INCLUDEOK, which seems to work correct
  1332. Revision 1.26 1999/10/14 14:57:52 florian
  1333. - removed the hcodegen use in the new cg, use cgbase instead
  1334. Revision 1.25 1999/10/13 10:24:49 peter
  1335. * dpmi can only be set after reading the options
  1336. Revision 1.24 1999/10/03 19:44:41 peter
  1337. * removed objpasunit reference, tvarrec is now searched in systemunit
  1338. where it already was located
  1339. Revision 1.23 1999/09/20 16:38:59 peter
  1340. * cs_create_smart instead of cs_smartlink
  1341. * -CX is create smartlink
  1342. * -CD is create dynamic, but does nothing atm.
  1343. Revision 1.22 1999/09/16 11:34:56 pierre
  1344. * typo correction
  1345. Revision 1.21 1999/09/15 20:35:40 florian
  1346. * small fix to operator overloading when in MMX mode
  1347. + the compiler uses now fldz and fld1 if possible
  1348. + some fixes to floating point registers
  1349. + some math. functions (arctan, ln, sin, cos, sqrt, sqr, pi) are now inlined
  1350. * .... ???
  1351. Revision 1.20 1999/09/03 09:31:22 peter
  1352. * reading of search paths fixed to work as expected
  1353. Revision 1.19 1999/09/01 22:07:20 peter
  1354. * turn off stripping if profiling or debugging
  1355. Revision 1.18 1999/08/28 17:46:10 peter
  1356. * resources are working correct
  1357. Revision 1.17 1999/08/28 15:34:19 florian
  1358. * bug 519 fixed
  1359. Revision 1.16 1999/08/27 10:45:03 pierre
  1360. options -Ca sets simply_ppu to true
  1361. Revision 1.15 1999/08/25 22:51:00 pierre
  1362. * remove trailing space in cfg files
  1363. Revision 1.14 1999/08/16 15:35:26 pierre
  1364. * fix for DLL relocation problems
  1365. * external bss vars had wrong stabs for pecoff
  1366. + -WB11000000 to specify default image base, allows to
  1367. load several DLLs with debugging info included
  1368. (relocatable DLL are stripped because the relocation
  1369. of the .Stab section is misplaced by ldw)
  1370. Revision 1.13 1999/08/11 17:26:35 peter
  1371. * tlinker object is now inherited for win32 and dos
  1372. * postprocessexecutable is now a method of tlinker
  1373. }