options.pas 45 KB

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