Browse Source

* changed darwin checks to use systems_darwin constant

git-svn-id: branches/fpc_2_3@6432 -
Jonas Maebe 18 years ago
parent
commit
09ece87be2
1 changed files with 13 additions and 9 deletions
  1. 13 9
      compiler/systems/t_bsd.pas

+ 13 - 9
compiler/systems/t_bsd.pas

@@ -207,7 +207,7 @@ Constructor TLinkerBSD.Create;
 begin
 begin
   Inherited Create;
   Inherited Create;
   if not Dontlinkstdlibpath Then
   if not Dontlinkstdlibpath Then
-   if not(target_info.system in [system_powerpc_darwin,system_i386_darwin]) then
+   if not(target_info.system in systems_darwin) then
      LibrarySearchPath.AddPath('/lib;/usr/lib;/usr/X11R6/lib',true)
      LibrarySearchPath.AddPath('/lib;/usr/lib;/usr/X11R6/lib',true)
    else
    else
      { Mac OS X doesn't have a /lib }
      { Mac OS X doesn't have a /lib }
@@ -221,12 +221,12 @@ procedure TLinkerBSD.SetDefaultInfo;
 }
 }
 begin
 begin
   LibrarySuffix:=' ';
   LibrarySuffix:=' ';
-  LdSupportsNoResponseFile := (target_info.system in [system_m68k_netbsd,system_powerpc_darwin,system_i386_darwin]);
+  LdSupportsNoResponseFile := (target_info.system in ([system_m68k_netbsd]+systems_darwin));
   with Info do
   with Info do
    begin
    begin
      if LdSupportsNoResponseFile then
      if LdSupportsNoResponseFile then
        begin
        begin
-         if not(target_info.system in [system_powerpc_darwin,system_i386_darwin]) then
+         if not(target_info.system in systems_darwin) then
            begin
            begin
              ExeCmd[1]:='ld $OPT $DYNLINK $STATIC $GCSECTIONS $STRIP -L. -o $EXE `cat $RES`';
              ExeCmd[1]:='ld $OPT $DYNLINK $STATIC $GCSECTIONS $STRIP -L. -o $EXE `cat $RES`';
              DllCmd[1]:='ld $OPT -shared -L. -o $EXE `cat $RES`'
              DllCmd[1]:='ld $OPT -shared -L. -o $EXE `cat $RES`'
@@ -242,7 +242,7 @@ begin
          ExeCmd[1]:='ld $OPT $DYNLINK $STATIC  $GCSECTIONS $STRIP -L. -o $EXE $RES';
          ExeCmd[1]:='ld $OPT $DYNLINK $STATIC  $GCSECTIONS $STRIP -L. -o $EXE $RES';
          DllCmd[1]:='ld $OPT $INIT $FINI $SONAME -shared -L. -o $EXE $RES';
          DllCmd[1]:='ld $OPT $INIT $FINI $SONAME -shared -L. -o $EXE $RES';
        end;
        end;
-     if not(target_info.system in [system_powerpc_darwin,system_i386_darwin]) then
+     if not(target_info.system in systems_darwin) then
        DllCmd[2]:='strip --strip-unneeded $EXE'
        DllCmd[2]:='strip --strip-unneeded $EXE'
      else
      else
        DllCmd[2]:='strip -x $EXE';
        DllCmd[2]:='strip -x $EXE';
@@ -254,7 +254,7 @@ procedure TLinkerBSD.LoadPredefinedLibraryOrder;
 // put your linkorder/linkalias overrides here.
 // put your linkorder/linkalias overrides here.
 // Note: assumes only called when reordering/aliasing is used.
 // Note: assumes only called when reordering/aliasing is used.
 Begin
 Begin
-  if not(target_info.system in [system_powerpc_darwin,system_i386_darwin]) then
+  if not(target_info.system in systems_darwin) then
     begin
     begin
       if (target_info.system =system_i386_freebsd) and
       if (target_info.system =system_i386_freebsd) and
          not (cs_link_no_default_lib_order in  current_settings.globalswitches) Then
          not (cs_link_no_default_lib_order in  current_settings.globalswitches) Then
@@ -294,7 +294,7 @@ Var
 begin
 begin
   WriteResponseFile:=False;
   WriteResponseFile:=False;
   ReOrder:=False;
   ReOrder:=False;
-  IsDarwin:=target_info.system in [system_powerpc_darwin,system_i386_darwin];
+  IsDarwin:=target_info.system in systems_darwin;
 { set special options for some targets }
 { set special options for some targets }
   if not IsDarwin Then
   if not IsDarwin Then
     begin
     begin
@@ -369,6 +369,10 @@ begin
            LinkRes.Add('-arch ppc');
            LinkRes.Add('-arch ppc');
         system_i386_darwin:
         system_i386_darwin:
            LinkRes.Add('-arch i386');
            LinkRes.Add('-arch i386');
+        system_powerpc64_darwin:
+           LinkRes.Add('-arch ppc64');
+        system_x86_64_darwin:
+           LinkRes.Add('-arch x86_64');
       end;
       end;
   end;
   end;
   { Write path to search libraries }
   { Write path to search libraries }
@@ -529,20 +533,20 @@ begin
 
 
   if (cs_link_smart in current_settings.globalswitches) and
   if (cs_link_smart in current_settings.globalswitches) and
      (tf_smartlink_sections in target_info.flags) then
      (tf_smartlink_sections in target_info.flags) then
-    if not(target_info.system in [system_powerpc_darwin,system_i386_darwin]) then
+    if not(target_info.system in systems_darwin) then
       GCSectionsStr:='--gc-sections'
       GCSectionsStr:='--gc-sections'
     else
     else
       // warning: this option only exists for 32 bit under Mac OS X, maybe the default for 64 bit?
       // warning: this option only exists for 32 bit under Mac OS X, maybe the default for 64 bit?
       GCSectionsStr:='-dead_strip';
       GCSectionsStr:='-dead_strip';
 
 
-   if(not(target_info.system in [system_powerpc_darwin,system_i386_darwin]) and
+   if(not(target_info.system in systems_darwin) and
       (cs_profile in current_settings.moduleswitches)) or
       (cs_profile in current_settings.moduleswitches)) or
      ((Info.DynamicLinker<>'') and (not SharedLibFiles.Empty)) then
      ((Info.DynamicLinker<>'') and (not SharedLibFiles.Empty)) then
    DynLinkStr:='-dynamic-linker='+Info.DynamicLinker;
    DynLinkStr:='-dynamic-linker='+Info.DynamicLinker;
 
 
   if CShared Then
   if CShared Then
    begin
    begin
-   if not(target_info.system in [system_powerpc_darwin,system_i386_darwin]) then
+   if not(target_info.system in systems_darwin) then
      DynLinKStr:=DynLinkStr+' --shared'
      DynLinKStr:=DynLinkStr+' --shared'
     else
     else
      DynLinKStr:=DynLinkStr+' -dynamic'; // one dash!
      DynLinKStr:=DynLinkStr+' -dynamic'; // one dash!