Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2007-01

[PATCH] fpcmmain.pp: fixed FPCDIR detection on x86_64

2 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Alexey Tourbin

---
fpcmmain.pp | 15 +++++++++++----
1 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/fpcmmain.pp b/fpcmmain.pp
index 9a1dd3a..a2a9a90 100644
--- a/fpcmmain.pp
+++ b/fpcmmain.pp
@@ -1146,6 +1146,13 @@ implementation

     procedure TFPCMake.AddFPCDefaultVariables;
+      const
+        ppc =
+{$ifdef cpux86_64}
+          'ppcx64';
+{$else}
+          'ppc386';
+{$endif}
       var
         hs,s : string;
       begin
@@ -1182,9 +1189,9 @@ implementation
          begin
 {$ifdef UNIX}
 {$ifndef NO_UNIX_UNIT}
-           if FileExists('/usr/local/bin/ppc386') then
+           if FileExists('/usr/local/bin/'+ppc) then
             begin
-              s:=ExtractFilePath({$ifdef ver1_0}ReadLink{$else}fpReadlink{$endif}('/usr/local/bin/ppc386'));
+              s:=ExtractFilePath({$ifdef ver1_0}ReadLink{$else}fpReadlink{$endif}('/usr/local/bin/'+ppc));
               if s'' then
                begin
                  if s[length(s)]='/' then
@@ -1194,9 +1201,9 @@ implementation
             end;
            if hs='' then
             begin
-              if FileExists('/usr/bin/ppc386') then
+              if FileExists('/usr/bin/'+ppc) then
                begin
-                 s:=ExtractFilePath({$ifdef ver1_0}ReadLink{$else}fpReadLink{$endif}('/usr/bin/ppc386'));
+                 s:=ExtractFilePath({$ifdef ver1_0}ReadLink{$else}fpReadLink{$endif}('/usr/bin/'+ppc));
                  if s'' then
                   begin
                     if s[length(s)]='/' then
1.4.4.3.GIT

Reply by email

Florian Klaempfl
to Alexey Tourbin

Alexey Tourbin schrieb:

Shouldn't we simply change the ppc386 into fpc ?

Show quoted text 46 lines
--- fpcmmain.pp | 15 +++++++++++---- 1 files changed, 11 insertions(+), 4 deletions(-) diff --git a/fpcmmain.pp b/fpcmmain.pp index 9a1dd3a..a2a9a90 100644 --- a/fpcmmain.pp +++ b/fpcmmain.pp @@ -1146,6 +1146,13 @@ implementation procedure TFPCMake.AddFPCDefaultVariables; + const + ppc = +{$ifdef cpux86_64} + 'ppcx64'; +{$else} + 'ppc386'; +{$endif} var hs,s : string; begin @@ -1182,9 +1189,9 @@ implementation begin {$ifdef UNIX} {$ifndef NO_UNIX_UNIT} - if FileExists('/usr/local/bin/ppc386') then + if FileExists('/usr/local/bin/'+ppc) then begin - s:=ExtractFilePath({$ifdef ver1_0}ReadLink{$else}fpReadlink{$endif}('/usr/local/bin/ppc386')); + s:=ExtractFilePath({$ifdef ver1_0}ReadLink{$else}fpReadlink{$endif}('/usr/local/bin/'+ppc)); if s'' then begin if s[length(s)]='/' then @@ -1194,9 +1201,9 @@ implementation end; if hs='' then begin - if FileExists('/usr/bin/ppc386') then + if FileExists('/usr/bin/'+ppc) then begin - s:=ExtractFilePath({$ifdef ver1_0}ReadLink{$else}fpReadLink{$endif}('/usr/bin/ppc386')); + s:=ExtractFilePath({$ifdef ver1_0}ReadLink{$else}fpReadLink{$endif}('/usr/bin/'+ppc)); if s'' then begin if s[length(s)]='/' then

Reply by email