Indy10 for C++ builder 6 編譯筆記

1、在$(BCB)目錄下創建一個名爲indy10C6/Source的目錄;
2、下載indy.zip,改名爲indy-10-2004-06-09.zip,將indy-10-2004-06-09.zip解壓到Source目錄下;
3、設置環境變量
SET NDC6=C:/tools/CBC6
SET NDWINSYS=C:/WINDOWS/System32
4、幾個package之間的依賴關係(從*60.dpk文件中得到):
========> IndySystem60 <=================||
||            ^^                         ||
||            ||                         ||
||        IndyCore60  <== dclIndyCore60  ||
||           ^^  ^^                 ^^   ||
||           ||  ==============||   ||   ||
||           ||                ||   ||   ||
||======= IndyProtocols60 <== dclIndyProtocols60
            ^^
            ||
        ?IndySuperCore <== dclSuperCore (好像只有dehpi7.0版本的,不知C++ Builder 6能否支持?)

5、手工編譯
創建$(BCB)/indy10C6/buildC6及$(BCB)/indy10C6/objs目錄
Copy每個包所需要的.pas、.inc、.dpk、.res、.obj(IndyProtocols60的Zlib有用到)文件到$(BCB)/indy10C6/buildC6目錄下(不會用-I及-U選項,老有問題,纔出如此下策)
5.1先編譯IndySystem60:
dcc32.exe IndySystem60.dpk /O../objs /DBCB /M /H /W /JPHN -$d-l-n+p+r-s-t-w-y-
dcc32.exe IndySystem60.dpk /O../objs /DBCB /M /H /W -$d-l-n+p+r-s-t-w-y-
../Source/Win32/LspFix IndySystem60.lsp
tlib.exe IndySystem60.lib /P32 @IndySystem60.lsp
完成IndySystem60.bpl及IndySystem60.lib的編譯。

5.2、接着編譯IndyCore60
dcc32.exe IndyCore60.dpk /O../objs /DBCB /M /H /W /JPHN -$d-l-n+p+r-s-t-w-y-
dcc32.exe IndyCore60.dpk /O../objs /DBCB /M /H /W -$d-l-n+p+r-s-t-w-y-
../Source/Win32/LspFix IndyCore60.lsp
tlib.exe IndyCore60.lib /P32 @IndyCore60.lsp





編譯IndyProtocols60.dpk之前,單獨編譯IdCompressionIntercept.pas及IdDummyUnit.pas
dcc32.exe IdCompressionIntercept.pas /O../Source/objs /DBCB /M /H /W /JPHN -$d-l-n+p+r-s-t-w-y-
dcc32.exe IdDummyUnit.pas /LIndy60.dcp /DBCB /O../Source/objs /M /H /W /JPHN -$d-l-n+p+r-s-t-w-y-











附錄:編譯命令分析
%NDC6%/bin/dcc32.exe IndyCore60.dpk /O../Source/objs /DBCB /M /H /W /JPHN -$d-l-n+p+r-s-t-w-y- %2 %3 %4
%NDC6%/bin/dcc32.exe IdCompressionIntercept.pas /M /DBCB /O../Source/objs /H /W /JPHN -$d-l-n+p+r-s-t-w-y- %2 %3 %4
1、%NDC6%/bin/dcc32.exe
這是編譯pascal編譯工具;
2、/M
根據Indy相關的文件描述,不能用/B參數,用這個來一個一個地編譯;
3、/DBCB
定義一個BCB編譯宏;
4、/O
指示目標碼的目錄,好像不起作用,不能放在相應的地方;
5、/H
編譯輸出提示信息;
6、/JPHN
沒有完全搞明白,/JP是說明要生成C++用的obj文件,但是多了HN是做些什麼呢?
7、-$d-l-n+p+r-s-t-w-y-
-$編譯開關起始符,含義如下:
d-:表示不要生成調試信息;
l-:去掉本地調試符號;
n+:沒有搞明白;
p+:開啓字符串參數;
r-:不做範圍檢查;
s-:沒有搞明白;
t-:Typed @ operator,off;
w-:Generate stack frames,off;
y-:Symbol reference info,off;

dcc32完整的參數表:
Syntax: dcc32 [options] filename [options]
  -A<unit>=<alias> = Set unit alias  -LU<package> = Use package        
  -B = Build all units               -M = Make modified units         
  -CC = Console target               -N<path> = DCU output directory  
  -CG = GUI target                   -O<paths> = Object directories   
  -D<syms> = Define conditionals     -P = look for 8.3 file names also
  -E<path> = EXE output directory    -Q = Quiet compile               
  -F<offset> = Find error            -R<paths> = Resource directories
  -GD = Detailed map file            -U<paths> = Unit directories     
  -GP = Map file with publics        -V = Debug information in EXE    
  -GS = Map file with segments       -VR = Generate remote debug (RSM)
  -H = Output hint messages          -W = Output warning messages     
  -I<paths> = Include directories    -Z = Output 'never build' DCPs   
  -J = Generate .obj file            -$<dir> = Compiler directive     
  -JP = Generate C++ .obj file       --help = Show this help screen   
  -K<addr> = Set image base addr     --version = Show name and version
Compiler switches: -$<letter><state> (defaults are shown below)
  A8  Aligned record fields           P+  Open string params            
  B-  Full boolean Evaluation         Q-  Integer overflow checking     
  C+  Evaluate assertions at runtime  R-  Range checking                
  D+  Debug information               T-  Typed @ operator              
  G+  Use imported data references    U-  Pentium(tm)-safe divide       
  H+  Use long strings by default     V+  Strict var-strings            
  I+  I/O checking                    W-  Generate stack frames         
  J-  Writeable structured consts     X+  Extended syntax               
  L+  Local debug symbols             Y+  Symbol reference info         
  M-  Runtime type info               Z1  Minimum size of enum types    
  O+  Optimization                  

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章