Ver código fonte

Merged revisions 8733,8743-8744,8747-8751,8766-8769,8774,8797,8800,8822,8831-8832,8848-8849,8851,8870,8875 via svnmerge from
http://svn.freepascal.org/svn/fpc/trunk

........
r8733 | vincents | 2007-10-05 14:05:04 +0200 (Fri, 05 Oct 2007) | 1 line

fpdoc: give context of invalid short description
........
r8744 | jonas | 2007-10-08 10:33:03 +0200 (Mon, 08 Oct 2007) | 2 lines

* regenerated for darwin/ppc64
........
r8774 | florian | 2007-10-12 18:30:51 +0200 (Fri, 12 Oct 2007) | 2 lines

* regenerated
........
r8800 | florian | 2007-10-14 20:02:25 +0200 (Sun, 14 Oct 2007) | 2 lines

* patch by J. Peter Mugaas to resolve #7777 and #7778
........
r8832 | sekelsenmat | 2007-10-17 21:05:53 +0200 (Wed, 17 Oct 2007) | 1 line

Added UIQ 2 device support for mksymbian
........
r8870 | micha | 2007-10-21 11:18:19 +0200 (Sun, 21 Oct 2007) | 2 lines

+ implement timeout wrapper call for testsuite (remote only)
* reduce number of remote logins for speed
........
r8875 | jonas | 2007-10-21 12:51:58 +0200 (Sun, 21 Oct 2007) | 3 lines

* improved gcc library path detection for cross-compilation on Linux
x86_64/i386 systems (patch from C. Western, mantis #9699)
........

git-svn-id: branches/fixes_2_2@9080 -

peter 18 anos atrás
pai
commit
398776e707

+ 16 - 2
compiler/utils/Makefile

@@ -1,11 +1,12 @@
 #
-# Don't edit, this file is generated by FPCMake Version 2.0.0 [2007/10/21]
+# Don't edit, this file is generated by FPCMake Version 2.0.0 [2007/11/02]
 #
 default: all
 MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded
 BSDs = freebsd netbsd openbsd darwin
 UNIXs = linux $(BSDs) solaris qnx
 LIMIT83fs = go32v2 os2 emx watcom
+OSNeedsComspecToRunBatch = go32v2 watcom
 FORCE:
 .PHONY: FORCE
 override PATH:=$(patsubst %/,%,$(subst \,/,$(PATH)))
@@ -56,6 +57,11 @@ else
 SRCBATCHEXT=.bat
 endif
 endif
+ifdef COMSPEC
+ifneq ($(findstring $(OS_SOURCE),$(OSNeedsComspecToRunBatch)),)
+RUNBATCH=$(COMSPEC) /C
+endif
+endif
 ifdef inUnix
 PATHSEP=/
 else
@@ -102,7 +108,11 @@ ifndef FPC
 FPCPROG:=$(strip $(wildcard $(addsuffix /fpc$(SRCEXEEXT),$(SEARCHPATH))))
 ifneq ($(FPCPROG),)
 FPCPROG:=$(firstword $(FPCPROG))
+ifneq ($(CPU_TARGET),)
+FPC:=$(shell $(FPCPROG) -P$(CPU_TARGET) -PB)
+else
 FPC:=$(shell $(FPCPROG) -PB)
+endif
 ifneq ($(findstring Error,$(FPC)),)
 override FPC=$(firstword $(strip $(wildcard $(addsuffix /ppc386$(SRCEXEEXT),$(SEARCHPATH)))))
 endif
@@ -1801,7 +1811,7 @@ override FPCOPT+=-FD$(NEW_BINUTILS_PATH)
 endif
 ifndef CROSSBOOTSTRAP
 ifneq ($(BINUTILSPREFIX),)
-override FPCOPT+=-XP$(BINUTILSPREFIX) 
+override FPCOPT+=-XP$(BINUTILSPREFIX)
 endif
 ifneq ($(BINUTILSPREFIX),)
 override FPCOPT+=-Xr$(RLINKPATH)
@@ -1933,9 +1943,13 @@ ifeq (,$(findstring -s ,$(COMPILER)))
 EXECPPAS=
 else
 ifeq ($(FULL_SOURCE),$(FULL_TARGET))
+ifdef RUNBATCH
+EXECPPAS:=@$(RUNBATCH) $(PPAS)
+else
 EXECPPAS:=@$(PPAS)
 endif
 endif
+endif
 .PHONY: fpc_exes
 ifndef CROSSINSTALL
 ifneq ($(TARGET_PROGRAMS),)

+ 31 - 37
compiler/utils/samplecfg

@@ -16,40 +16,17 @@ GCCDIR=`dirname "$GCCSPEC"`
 
 
 setgccdirarch() {
-# Find path to libgcc.a
-GCCSPEC=`(gcc -v -arch $1 2>&1)| head -n 1| awk '{ print $4 } '`
-if [ -z "$GCCSPEC" ] ; then
-  GCCSPEC=`gcc -print-libgcc-file-name -arch $1`
-fi
-
-GCCDIR=`dirname "$GCCSPEC"`
+# First argument is fpc define for CPU type; remaining args are passed to gcc to set corresponding architecture
+FPCDEFINE=$1
+shift
+setgccdir $@
 
 if [ -z "$GCCDIR" ] ; then
   return
 fi
-
-case $1 in
- ppc)
-    GCCDIR="#ifdef cpupowerpc
--Fl$GCCDIR
-#endif"
-     ;;
- ppc64)
-    GCCDIR="#ifdef cpupowerpc64
--Fl$GCCDIR
-#endif"
-     ;;
- i386)
-    GCCDIR="#ifdef cpui386
+GCCDIR="#ifdef $FPCDEFINE
 -Fl$GCCDIR
 #endif"
-     ;;
- x86_64)
-    GCCDIR="#ifdef cpux86_64
--Fl$GCCDIR
-#endif"
-     ;;
-esac
 }
 
 HOSTOS=`uname -s | tr A-Z a-z`
@@ -94,6 +71,13 @@ GCCDIR2=""
 GCCDIR3=""
 GCCDIR4=""
 
+singlearch() {
+  if [ -d "$GCCDIR" ]; then	
+    echo Found libgcc.a in "$GCCDIR"
+    GCCDIR=-Fl$GCCDIR
+  fi
+}
+
 # include ports tree dir for FreeBSDers.
 case $HOSTOS in
  freebsd)
@@ -106,19 +90,29 @@ case $HOSTOS in
    GCCDIR=-Fl/usr/pkg/lib
      ;;
  darwin)
-   setgccdirarch ppc
+   setgccdirarch cpupowerpc -arch ppc
    GCCDIR2="$GCCDIR"
-   setgccdirarch ppc64
+   setgccdirarch cpupowerpc64 -arch ppc64
    GCCDIR3="$GCCDIR"
-   setgccdirarch i386
+   setgccdirarch cpui386 -arch i386
    GCCDIR4="$GCCDIR"
-   setgccdirarch x86_64
+   setgccdirarch cpux86_64 -arch x86_64
      ;;
- *)
-   if [ -d "$GCCDIR" ]; then	
-      echo Found libgcc.a in "$GCCDIR"
-    GCCDIR=-Fl$GCCDIR
-   fi
+  linux)
+    case `"$FPCBIN" -PP` in
+      i?86|x86_64|amd64)
+      # Allow for the possibility of both 32 and 64 bit compilation on same system
+        setgccdirarch cpui386 -m32
+        GCCDIR4="$GCCDIR"
+        setgccdirarch cpux86_64 -m64
+        ;;
+      # Add cases for other linux dual architectures here
+      *) singlearch # Default          
+        ;;
+    esac
+    ;;
+
+ *) singlearch
     ;;
    
 esac

+ 4 - 0
tests/readme.txt

@@ -39,6 +39,8 @@ SKIPTARGET.........Not for these OS targets (win32,macos,etc).
 VERSION............Compiler with at lest this version number required.
 MAXVERSION.........Compiler with at most this version number required.
 RESULT.............Exit code of execution of test expected
+TIMEOUT............Timeout indication for test in seconds (only used if
+                   enabled by defining TEST_TIMEOUT)
 GRAPH..............Requires graph unit
 FAIL...............Compilation must fail
 RECOMPILE..........After compiling a test, recompile the test for a second
@@ -102,6 +104,7 @@ TEST_CCOMPILER         defaults to installed gcc compiler, but only
                        if driver and test full-targets are the same.
 TEST_VERBOSE           let dotest be more verbose, only usefull for debugging
 TEST_DELTEMP           delete temporary executable/object/ppu file, default is off
+TEST_TIMEOUT           use timeout wrapper for (remote) execution
 V                      print dotest commandline
 
   (Please add more test options if needed)
@@ -126,6 +129,7 @@ TEST_SSH             set this to use ssh/scp to execute the test
 TEST_PUTTY           test using putty when remote testing (pscp and plink)
 TEST_REMOTEOPT       extra options to remote program
 TEST_REMOTEPATH      set remote path to use, default is /tmp
+TEST_DELBEFORE       delete remote executable before uploading
 TEST_DELTEMP         delete executable after running, so the remote system
                      doesn't need much free disk space
 TEST_REMOTEPW        pass a password with -pw to remote tools, mainly usefull for putty

+ 1 - 1
utils/fpdoc/dw_html.pp

@@ -1280,7 +1280,7 @@ begin
     PushOutputNode(Parent);
     try
       if not ConvertShort(AContext,TDomElement(DocNode.ShortDescr)) then
-        WriteLn(SErrInvalidShortDescr);
+        Warning(AContext, SErrInvalidShortDescr)
     finally
       PopOutputNode;
     end;

+ 15 - 5
utils/h2pas/options.pas

@@ -92,6 +92,17 @@ begin
    MaybeExtension:=Hstr;
 end;
 
+function ExtractFileName(const AFilePath : String): String;
+var i : Integer;
+begin
+  i := Length(AFilePath);
+  while (i>0) and (AFilePath[i]<>DirectorySeparator) and
+    (AFilePath[i]<>DriveSeparator) do
+  begin
+    Dec(i);
+  end;
+  ExtractFileName := Copy(AFilePath,i+1,Length(AFilePath)); 
+end;
 
 {*****************************************************************************
                                 Options
@@ -232,11 +243,10 @@ begin
     Usage;
   if UnitName='' then
    begin
-     i:=pos('.',outputfilename)-1;
-     if i<=0 then
-      UnitName:=outputfilename
-     else
-      UnitName:=Copy(OutputFileName,1,i);
+     UnitName := ExtractFileName(outputfilename);
+     i:=pos('.',UnitName)-1;
+     if i>0 then
+      UnitName:=Copy(UnitName,1,i);
    end;
 end;
 

+ 7 - 6
utils/h2pas/scan.l

@@ -801,31 +801,31 @@ D [0-9]
                         end;
 "void"                  if NotInCPlusBlock then return(VOID) else skip_until_eol;
 "VOID"                  if NotInCPlusBlock then return(VOID) else skip_until_eol;
-"#ifdef __cplusplus"[ \t]*\n"extern \"C\" {"\n"#endif"
+"#ifdef"[ \t]*"__cplusplus"[ \t]*\n"extern \"C\" {"\n"#endif"
                         begin
                           if not stripinfo then
                             writeln(outfile,'{ C++ extern C conditionnal removed }');
                         end;
-"#ifdef cplusplus"[ \t]*\n"extern \"C\" {"\n"#endif"
+"#ifdef"[ \t]*"cplusplus"[ \t]*\n"extern \"C\" {"\n"#endif"
                         begin
                           if not stripinfo then
                             writeln(outfile,'{ C++ extern C conditionnal removed }');
                         end;
-"#ifdef __cplusplus"[ \t]*\n"}"\n"#endif"
+"#ifdef"[ \t]*"__cplusplus"[ \t]*\n"}"\n"#endif"
                         begin
                           if not stripinfo then
                             writeln(outfile,'{ C++ end of extern C conditionnal removed }');
                         end;
-"#ifdef cplusplus"[ \t]*\n"}"\n"#endif"
+"#ifdef"[ \t]*"cplusplus"[ \t]*\n"}"\n"#endif"
                         begin
                           if not stripinfo then
                             writeln(outfile,'{ C++ end of extern C conditionnal removed }');
                         end;
-"#ifdef cplusplus"[ \t]*
+"#ifdef"[ \t]*"cplusplus"[ \t]*
                         begin
                           Inc(cplusblocklevel);
                         end;
-"#ifdef __cplusplus"[ \t]*
+"#ifdef"[ \t]*"__cplusplus"[ \t]*
                         begin
                           Inc(cplusblocklevel);
                         end;
@@ -1081,3 +1081,4 @@ end.
 
 
 
+

Diferenças do arquivo suprimidas por serem muito extensas
+ 475 - 472
utils/h2pas/scan.pas


+ 3 - 2
utils/mksymbian/cmdline.pas

@@ -72,7 +72,7 @@ begin
   WriteLn('');
   WriteLn('Possible commands: ');
   WriteLn('');
-  WriteLn('build    - Builds a application');
+  WriteLn('build    - Builds an application');
   WriteLn('bindings - Builds the c++ bindings for pascal');
   WriteLn('showpath - Show the paths the tool is using');
   WriteLn('');
@@ -92,7 +92,8 @@ procedure TCmdLine.ShowPath;
 begin
   WriteLn('mksymbian - Build tool for Free Pascal for SymbianOS');
   WriteLn('');
-  WriteLn('Location of UIQ 3 SDK: ' + vSDKUtil.SDKFolder);
+  WriteLn('SDK Version: ' + vSDKUtil.StrSDKVersion);
+  WriteLn('Location of SDK: ' + vSDKUtil.SDKFolder);
   WriteLn('Location of Free Pascal Compiler: ' + vProject.CompilerPath);
   WriteLn('');
 end;

+ 118 - 1
utils/mksymbian/compiler.pas

@@ -47,6 +47,8 @@ type
     destructor Destroy; override;
     procedure FileCopy(source, dest: string);
     procedure MakeBuildPascal;
+    procedure MakeBuildPascal_UIQ21_ARM;
+    procedure MakeBuildPascal_UIQ3_Emulator;
     procedure MakeBuildCpp;
     procedure MakeBuildBindings;
     procedure BuildUIDFile;
@@ -151,6 +153,121 @@ end;
 *
 *******************************************************************}
 procedure TCompiler.MakeBuildPascal;
+begin
+  case vSDKUtil.SDKVersion of
+   sdkUIQ21: MakeBuildPascal_UIQ21_ARM;
+   sdkUIQ3:  MakeBuildPascal_UIQ3_Emulator;
+  end;
+end;
+
+procedure TCompiler.MakeBuildPascal_UIQ21_ARM;
+var
+  EPOCSTATLINKUREL, EPOCLINKUREL, LIBSUREL: string;
+begin
+  WriteLn('');
+  WriteLn('Preparations for compiling');
+  WriteLn('');
+
+  { Creation of directories }
+
+  { Compiling the source files }
+
+  WriteLn('');
+  WriteLn('Compiling the source files');
+  WriteLn('');
+
+  { Linking and library creation }
+  
+  WriteLn('');
+  WriteLn('Linking and library creation');
+  WriteLn('');
+
+  EPOCSTATLINKUREL := vSDKUtil.SDKPartialFolder + 'EPOC32\RELEASE\THUMB\UREL\';
+  EPOCLINKUREL := vSDKUtil.SDKPartialFolder + 'EPOC32\RELEASE\THUMB\UREL\';
+
+  LIBSUREL := EPOCSTATLINKUREL + 'EDLLSTUB.LIB '
+    + EPOCSTATLINKUREL + 'EGCC.LIB '
+    + EPOCLINKUREL + 'EUSER.LIB '
+    + EPOCLINKUREL + 'APPARC.LIB '
+    + EPOCLINKUREL + 'CONE.LIB '
+    + EPOCLINKUREL + 'EIKCORE.LIB '
+    + EPOCLINKUREL + 'EIKCOCTL.LIB ';
+
+  AProcess.CommandLine := 'dlltool -m thumb '
+   + '--output-def "' + MakePartialFolder + 'HELLOWORLD.inf" "'
+   + MakePartialFolder + 'HELLOWORLD.in" ';
+  WriteLn('');
+  WriteLn(AProcess.CommandLine);
+  WriteLn('');
+  AProcess.Execute;
+
+  AProcess.CommandLine := 'perl -S ' + vSdkUtil.SDKFolder + Str_Path_UIQ2_Makmake
+   + ' -Deffile "' + MakePartialFolder + 'HELLOWORLD.inf" -1 NewApplication__Fv "'
+   + MakePartialFolder + 'HELLOWORLD.dev"';
+  WriteLn('');
+  WriteLn(AProcess.CommandLine);
+  WriteLn('');
+  AProcess.Execute;
+
+{ -$(ERASE) "$(EPOCBLDUREL)\HELLOWORLD.inf" }
+
+  AProcess.CommandLine := 'dlltool -m thumb --def "'
+   + MakePartialFolder + 'HELLOWORLD.def" --output-exp "'
+   + MakePartialFolder + 'HELLOWORLD.exp" --dllname "HELLOWORLD[101f6163].APP"';
+  WriteLn('');
+  WriteLn(AProcess.CommandLine);
+  WriteLn('');
+  AProcess.Execute;
+
+  AProcess.CommandLine := 'ld  -s --thumb-entry _E32Dll '
+   + '-u _E32Dll "' + MakePartialFolder + 'HELLOWORLD.exp" '
+   + '--dll --base-file "' + MakePartialFolder + 'HELLOWORLD.bas" '
+   + '-o "' + MakePartialFolder + 'HELLOWORLD.APP" "'
+   + EPOCSTATLINKUREL + 'EDLL.LIB" '
+   + '--whole-archive "' + MakePartialFolder + 'HELLOWORLD.in" '
+   + '--no-whole-archive ' + LIBSUREL;
+  WriteLn('');
+  WriteLn(AProcess.CommandLine);
+  WriteLn('');
+  AProcess.Execute;
+
+{	-$(ERASE) "$(EPOCBLDUREL)\HELLOWORLD.exp"
+	-$(ERASE) "$(EPOCBLDUREL)\HELLOWORLD.APP"
+ }
+
+  AProcess.CommandLine := 'dlltool -m thumb '
+   + '--def "' + MakePartialFolder + 'HELLOWORLD.def" '
+   + '--dllname "HELLOWORLD[101f6163].APP" '
+   + '--base-file "' + MakePartialFolder + 'HELLOWORLD.bas" '
+   + '--output-exp ' + MakePartialFolder + 'HELLOWORLD.exp"';
+  WriteLn('');
+  WriteLn(AProcess.CommandLine);
+  WriteLn('');
+  AProcess.Execute;
+
+  AProcess.CommandLine := 'ld  -s --thumb-entry _E32Dll -u _E32Dll --dll "'
+   + MakePartialFolder + 'HELLOWORLD.exp" -Map "'
+   + MakePartialFolder + 'HELLOWORLD.APP.map" -o "'
+   + MakePartialFolder + 'HELLOWORLD.APP" "'
+   + EPOCSTATLINKUREL + 'EDLL.LIB" --whole-archive "'
+   + MakePartialFolder + 'HELLOWORLD.in" --no-whole-archive '
+   + LIBSUREL;
+  WriteLn('');
+  WriteLn(AProcess.CommandLine);
+  WriteLn('');
+  AProcess.Execute;
+
+  AProcess.CommandLine := 'petran  "'
+   + MakePartialFolder + 'HELLOWORLD.APP" "'
+   + MakePartialFolder + 'HELLOWORLD.APP" '
+   + '-nocall -uid1 0x10000079 -uid2 0x100039ce -uid3 0x101f6163';
+  WriteLn('');
+  WriteLn(AProcess.CommandLine);
+  WriteLn('');
+  AProcess.Execute;
+end;
+
+procedure TCompiler.MakeBuildPascal_UIQ3_Emulator;
 var
   STR_LINK_FLAGSUDEB, STR_EPOCBLDUDEB, STR_LINK_OBJSUDEB: string;
   STR_FPC_RTL_OBJECTS: string;
@@ -180,7 +297,7 @@ begin
   WriteLn('');
   WriteLn('Compiling file ' + vProject.MainSource);
   WriteLn('');
-  
+
   AProcess.CommandLine := vProject.CompilerPath + ' -a -s -Fu' + vProject.RTLUnitsDir +
     ' -Tsymbian QPasHello.pas';
   WriteLn(AProcess.CommandLine);

+ 13 - 0
utils/mksymbian/constants.pas

@@ -42,6 +42,14 @@ type
     ProjectFile: string;
   end;
 
+{ Constants and types for the SDK version }
+type
+  TSDKVersion = (sdkUIQ21, sdkUIQ3);
+
+const
+  Str_UIQ21 = 'UIQ 2.1';
+  Str_UIQ3  = 'UIQ 3';
+
 { Commands }
 
 const
@@ -51,6 +59,11 @@ const
 
 { Paths on the SDK }
 const
+  { UIQ 2 Paths }
+  Str_Path_UIQ2_ARM_BINUTILS = 'epoc32\gcc\bin\';
+  Str_Path_UIQ2_Makmake = 'epoc32\tools\makmake.pl';
+
+  { UIQ 3 Paths }
   Str_Path_CWTools = 'epoc32\tools\nokia_compiler\Symbian_Tools\Command_Line_Tools\';
   Str_Path_RComp = 'epoc32\tools\rcomp.exe';
   Str_Path_Cpp = 'epoc32\tools\scpp.exe';

+ 11 - 10
utils/mksymbian/mksymbian.pas

@@ -36,10 +36,10 @@ var
   opts: TMkSymbianOptions;
 begin
 
+  vProject := TProject.Create;
   vSDKUtil := TSDKUtil.Create;
   vCmdLine := TCmdLine.Create;
   vCompiler := TCompiler.Create;
-  vProject := TProject.Create;
 
   try
     vCmdLine.ParseCmdLineOptions(opts);
@@ -54,22 +54,26 @@ begin
         vProject.ParseFile;
         
         { compilation }
+        
         if CompareText(vProject.Language, STR_OPT_Cpp) = 0 then
          vCompiler.MakeBuildCpp
         else
          vCompiler.MakeBuildPascal;
 
-        { Main resource file }
+        if vSDKUtil.SDKVersion = sdkUIQ3 then
+        begin
+          { Main resource file }
         
-        vCompiler.BuildResource(vProject.MainResource);
+          vCompiler.BuildResource(vProject.MainResource);
 
-        vCompiler.InstallResource(vProject.MainResource);
+          vCompiler.InstallResource(vProject.MainResource);
 
-        { Registration resource file }
+          { Registration resource file }
         
-        vCompiler.BuildResource(vProject.RegResource);
+          vCompiler.BuildResource(vProject.RegResource);
 
-        vCompiler.RegisterInEmulator;
+          vCompiler.RegisterInEmulator;
+        end;
       end;
 
       stBuildBindings:
@@ -78,7 +82,6 @@ begin
 
         vCompiler.MakeBuildBindings;
       end;
-      
     end;
     
   finally
@@ -86,8 +89,6 @@ begin
     vSDKUtil.Free;
     vCompiler.Free;
     vProject.Free;
-
   end;
-  
 end.
 

+ 6 - 1
utils/mksymbian/projectparser.pas

@@ -40,7 +40,8 @@ type
   public
     opts: TMkSymbianOptions;
     { Main section }
-    ExeName, Language: string;
+    ExeName, Language, ProjectType, SDK, SDKVersion: string;
+    Emulator: Boolean;
     { FPC section }
     CompilerPath, AssemblerPath, RTLUnitsDir: string;
     { UIDs section }
@@ -94,6 +95,10 @@ begin
   try
     ExeName := IniFile.ReadString(STR_PRJ_Files, STR_PRJ_ExeName, 'default.exe');
     Language := IniFile.ReadString(STR_PRJ_Files, STR_PRJ_Language, 'Pascal');
+    ProjectType := IniFile.ReadString(STR_PRJ_Files, STR_PRJ_ProjectType, 'EXE');
+    SDK := IniFile.ReadString(STR_PRJ_Files, STR_PRJ_SDK, 'UIQ');
+    SDKVersion := IniFile.ReadString(STR_PRJ_Files, STR_PRJ_SDKVersion, '2.1');
+    Emulator := IniFile.ReadBool(STR_PRJ_Files, STR_PRJ_Emulator, False);
 
     CompilerPath := IniFile.ReadString(STR_PRJ_FPC, STR_PRJ_CompilerPath, 'C:\Programas\fpc21\compiler\ppc386.exe');
     AssemblerPath := IniFile.ReadString(STR_PRJ_FPC, STR_PRJ_AssemblerPath, 'C:\Programas\lazarus20\fpc\2.1.5\bin\i386-win32\as.exe');

+ 31 - 17
utils/mksymbian/sdkutil.pas

@@ -29,21 +29,19 @@ unit sdkutil;
 interface
 
 uses
-  Classes, SysUtils, registry;
+  Classes, SysUtils, registry, constants;
 
 type
 
   { TSDKUtil }
 
   TSDKUtil = class(TObject)
-  private
-    vSDKFolder, vSDKPartialFolder: string;
   public
+    SDKFolder, SDKPartialFolder, StrSDKVersion: string;
+    SDKVersion: TSDKVersion;
     constructor Create;
-    procedure LocateSDK;
-
-    property SDKFolder: string read vSDKFolder;
-    property SDKPartialFolder: string read vSDKPartialFolder;
+    procedure LocateUIQ2SDK;
+    procedure LocateUIQ3SDK;
   end;
 
 var
@@ -51,9 +49,30 @@ var
 
 implementation
 
+uses projectparser;
+
 { TSDKUtil }
 
-procedure TSDKUtil.LocateSDK;
+constructor TSDKUtil.Create;
+begin
+  StrSDKVersion := vProject.SDK + ' ' + vProject.SDKVersion;
+
+  if StrSDKVersion = Str_UIQ21 then SDKVersion := sdkUIQ21
+  else if StrSDKVersion = Str_UIQ3 then SDKVersion := sdkUIQ3;
+
+  case SDKVersion of
+   sdkUIQ21: LocateUIQ2SDK;
+   sdkUIQ3:  LocateUIQ3SDK;
+  end;
+end;
+
+procedure TSDKUtil.LocateUIQ2SDK;
+begin
+  SDKPartialFolder := '\Programas\UIQ21\';
+  SDKFolder := 'C:' + SDKPartialFolder;
+end;
+
+procedure TSDKUtil.LocateUIQ3SDK;
 var
   Reg: TRegistry;
   BufferStr: string;
@@ -65,24 +84,19 @@ begin
     if Reg.OpenKey('\SOFTWARE\Symbian\UIQ\SDK\UIQ3SDK', False) then
     begin
       BufferStr := Reg.ReadString('InstallPath');
-      vSDKFolder := IncludeTrailingBackslash(BufferStr);
-      vSDKPartialFolder := Copy(vSDKFolder, 3, Length(vSDKFolder) - 2);
+      SDKFolder := IncludeTrailingBackslash(BufferStr);
+      SDKPartialFolder := Copy(SDKFolder, 3, Length(SDKFolder) - 2);
     end
     else
     begin
       WriteLn('  ERROR: Could not locate the SDK, using default values');
-      vSDKPartialFolder := '\Symbian\UIQ3SDK\';
-      vSDKFolder := 'C:' + vSDKPartialFolder;
+      SDKPartialFolder := '\Symbian\UIQ3SDK\';
+      SDKFolder := 'C:' + SDKPartialFolder;
     end;
   finally
     Reg.Free;
   end;
 end;
 
-constructor TSDKUtil.Create;
-begin
-  LocateSDK;
-end;
-
 end.
 

Alguns arquivos não foram mostrados porque muitos arquivos mudaram nesse diff