options.pas 45 KB

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