From 84ddacd01746de3167a9d0f872ccdb64bf49b18b Mon Sep 17 00:00:00 2001 From: Jonas Maebe Date: Fri, 3 Aug 2007 12:42:49 +0000 Subject: [PATCH] + support for creating a bundle instead of a library on Darwin (-Wb) git-svn-id: trunk@8217 - --- compiler/msg/errore.msg | 3 +++ compiler/msgidx.inc | 2 +- compiler/msgtxt.inc | 39 ++++++++++++++++++++------------------ compiler/options.pas | 10 ++++++++++ compiler/systems/t_bsd.pas | 15 +++++++++++++-- 5 files changed, 48 insertions(+), 21 deletions(-) diff --git a/compiler/msg/errore.msg b/compiler/msg/errore.msg index 7e4486dd93..e28fe12c86 100644 --- a/compiler/msg/errore.msg +++ b/compiler/msg/errore.msg @@ -2658,6 +2658,9 @@ S*2Tlinux_Linux 3*1W_Target-specific options (targets) A*1W_Target-specific options (targets) P*1W_Target-specific options (targets) +3*2Wb_Create a bundle instead of a library (Darwin) +P*2Wb_Create a bundle instead of a library (Darwin) +p*2Wb_Create a bundle instead of a library (Darwin) 3*2WB_Create a relocatable image (Windows) A*2WB_Create a relocatable image (Windows, Symbian) 3*2WC_Specify console type application (EMX, OS/2, Windows) diff --git a/compiler/msgidx.inc b/compiler/msgidx.inc index 5d77d73682..292302fbe8 100644 --- a/compiler/msgidx.inc +++ b/compiler/msgidx.inc @@ -730,7 +730,7 @@ const option_info=11024; option_help_pages=11025; - MsgTxtSize = 44748; + MsgTxtSize = 44907; MsgIdxMax : array[1..20] of longint=( 24,85,237,83,63,49,107,22,135,60, diff --git a/compiler/msgtxt.inc b/compiler/msgtxt.inc index a695f2b8a1..e52f587142 100644 --- a/compiler/msgtxt.inc +++ b/compiler/msgtxt.inc @@ -1,7 +1,7 @@ {$ifdef Delphi} -const msgtxt : array[0..000186] of string[240]=( +const msgtxt : array[0..000187] of string[240]=( {$else Delphi} -const msgtxt : array[0..000186,1..240] of char=( +const msgtxt : array[0..000187,1..240] of char=( {$endif Delphi} '01000_T_Compiler: $1'#000+ '01001_D_Compiler OS: $1'#000+ @@ -1036,41 +1036,44 @@ const msgtxt : array[0..000186,1..240] of char=( '3*1W_Target-specific options',' (targets)'#010+ 'A*1W_Target-specific options (targets)'#010+ 'P*1W_Target-specific options (targets)'#010+ + '3*2Wb_Create a bundle instead of a library (Darwin)'#010+ + 'P*2Wb_Create a bundle instead of a library (Darwin)'#010+ + 'p*2Wb_Create a bundle instead of a librar','y (Darwin)'#010+ '3*2WB_Create a relocatable image (Windows)'#010+ 'A*2WB_Create a relocatable image (Windows, Symbian)'#010+ - '3*2WC_Specify console type application (EMX, OS/2,',' Windows)'#010+ + '3*2WC_Specify console type application (EMX, OS/2, Windows)'#010+ 'A*2WC_Specify console type application (Windows)'#010+ - 'P*2WC_Specify console type application (Classic Mac OS)'#010+ + 'P*2WC_Specify console typ','e application (Classic Mac OS)'#010+ '3*2WD_Use DEFFILE to export functions of DLL or EXE (Windows)'#010+ 'A*2WD_Use DEFFILE to export functions of DLL or EXE (Windows)'#010+ - '3','*2WF_Specify full-screen type application (EMX, OS/2)'#010+ - '3*2WG_Specify graphic type application (EMX, OS/2, Windows)'#010+ + '3*2WF_Specify full-screen type application (EMX, OS/2)'#010+ + '3*2WG_Specify graphic type app','lication (EMX, OS/2, Windows)'#010+ 'A*2WG_Specify graphic type application (Windows)'#010+ 'P*2WG_Specify graphic type application (Classic Mac OS)'#010+ - '3*2WN_Do not generate',' relocation code, needed for debugging (Windows'+ + '3*2WN_Do not generate relocation code, needed for debugging (Windows)'#010+ + 'A*2WN_Do not generate relocation co','de, needed for debugging (Windows'+ ')'#010+ - 'A*2WN_Do not generate relocation code, needed for debugging (Windows)'#010+ '3*2WR_Generate relocation code (Windows)'#010+ 'A*2WR_Generate relocation code (Windows)'#010+ - 'P*2WT_Specify MPW tool type application',' (Classic Mac OS)'#010+ + 'P*2WT_Specify MPW tool type application (Classic Mac OS)'#010+ '**1X_Executable options:'#010+ - '**2Xc_Pass --shared/-dynamic to the linker (BeOS, Darwin, FreeBSD, Lin'+ - 'ux)'#010+ + '**2Xc_Pass --shared/-dynamic to the linke','r (BeOS, Darwin, FreeBSD, L'+ + 'inux)'#010+ '**2Xd_Do not use standard library search path (needed for cross compil'+ 'e)'#010+ '**2Xe_Use external linker'#010+ - '**2XD_Try to link units ','dynamic (defines FPC_LINK_DYNAMIC)'#010+ + '**2XD_Try to link units dynamically (defines FPC_LINK_DYNAMIC)'#010+ '**2Xi_Use internal linker'#010+ - '**2Xm_Generate link map'#010+ + '**2Xm_Generate',' link map'#010+ '**2XM_Set the name of the '#039'main'#039' program routine (default i'+ 's '#039'main'#039')'#010+ '**2XP_Prepend the binutils names with the prefix '#010+ - '**2Xr_Set libra','ry search path to (needed for cross compile)'#010+ - '**2Xs_Strip all symbols from executable'#010+ - '**2XS_Try to link units static (default) (defines FPC_LINK_STATIC)'#010+ + '**2Xr_Set library search path to (needed for cross compile)'#010+ + '**2Xs_Strip all symbols from execut','able'#010+ + '**2XS_Try to link units statically (default, defines FPC_LINK_STATIC)'#010+ '**2Xt_Link with static libraries (-static is passed to linker)'#010+ - '**2XX_Try to smartlin','k units (defines FPC_LINK_SMART)'#010+ + '**2XX_Try to smartlink units (defines FPC_LINK_SMART)'#010+ '**1*_'#010+ '**1?_Show this help'#010+ - '**1h_Shows this help without waiting'#000 + '**1h_Shows',' this help without waiting'#000 ); diff --git a/compiler/options.pas b/compiler/options.pas index 3a7b5586de..fd24607940 100644 --- a/compiler/options.pas +++ b/compiler/options.pas @@ -263,6 +263,9 @@ begin {$ifdef powerpc} 'P', {$endif} +{$ifdef powerpc64} + 'p', +{$endif} {$ifdef sparc} 'S', {$endif} @@ -1253,6 +1256,13 @@ begin else apptype:=app_cui; end; + 'b': + begin + if (target_info.system in systems_darwin) then + RelocSection:=not UnsetBool(More, j) + else + IllegalPara(opt); + end; 'B': begin { -WB200000 means set trefered base address diff --git a/compiler/systems/t_bsd.pas b/compiler/systems/t_bsd.pas index 9c3b210bb7..5893a702d9 100644 --- a/compiler/systems/t_bsd.pas +++ b/compiler/systems/t_bsd.pas @@ -234,7 +234,10 @@ begin else begin ExeCmd[1]:='ld $OPT $DYNLINK $STATIC $GCSECTIONS $STRIP -multiply_defined suppress -L. -o $EXE `cat $RES`'; - DllCmd[1]:='libtool $OPT -dynamic -multiply_defined suppress -L. -o $EXE `cat $RES`' + if (not RelocSection) then + DllCmd[1]:='libtool $OPT -dynamic -multiply_defined suppress -L. -o $EXE `cat $RES`' + else + DllCmd[1]:='ld $OPT -dynamic -bundle -multiply_defined suppress -L. -o $EXE `cat $RES`' end end else @@ -354,7 +357,15 @@ begin end else begin - prtobj:=''; + if RelocSection then + begin + if librarysearchpath.FindFile('bundle1.o',false,s) then + prtobj:=s + else + prtobj:='/usr/lib/bundle1.o' + end + else + prtobj:='' end; end;