Bläddra i källkod

Merged revisions 1912,1926,1928-1930,1932 via svnmerge from
http://[email protected]/svn/fpc/trunk

........
r1912 | florian | 2005-12-10 17:42:28 +0100 (Sat, 10 Dec 2005) | 2 lines

* improved variant type casts

........
r1926 | florian | 2005-12-10 23:15:00 +0100 (Sat, 10 Dec 2005) | 2 lines

* fixed declaration of NullHandle

........
r1928 | daniel | 2005-12-11 17:58:35 +0100 (Sun, 11 Dec 2005) | 2 lines

* Less bloated ttyname implementation

........
r1929 | daniel | 2005-12-11 19:33:58 +0100 (Sun, 11 Dec 2005) | 2 lines

* Add info about Linux

........
r1930 | daniel | 2005-12-11 19:37:15 +0100 (Sun, 11 Dec 2005) | 2 lines

* Fix typo, markup

........
r1932 | florian | 2005-12-12 00:11:21 +0100 (Mon, 12 Dec 2005) | 3 lines

- removed 1.0 defines
+ call ld with -E

........

git-svn-id: branches/fixes_2_0@1934 -

peter 20 år sedan
förälder
incheckning
050caabcd4
6 ändrade filer med 109 tillägg och 22 borttagningar
  1. 1 0
      .gitattributes
  2. 32 19
      compiler/utils/ppumove.pp
  3. 39 0
      ide/readme.ide
  4. 29 2
      rtl/linux/termio.pp
  5. 1 1
      rtl/unix/dynlibs.inc
  6. 7 0
      tests/test/testv10.pp

+ 1 - 0
.gitattributes

@@ -5064,6 +5064,7 @@ tests/test/testmovd.pp svneol=native#text/plain
 tests/test/tests.pp svneol=native#text/plain
 tests/test/testsse2.pp svneol=native#text/plain
 tests/test/testv1.pp svneol=native#text/plain
+tests/test/testv10.pp svneol=native#text/plain
 tests/test/testv2.pp svneol=native#text/plain
 tests/test/testv3.pp svneol=native#text/plain
 tests/test/testv4.pp svneol=native#text/plain

+ 32 - 19
compiler/utils/ppumove.pp

@@ -24,11 +24,7 @@
 Program ppumove;
 uses
 {$ifdef unix}
-  {$ifdef ver1_0}
-  linux,
-  {$else}
   Baseunix,Unix, UnixUtil,
-  {$endif}
 {$else unix}
   dos,
 {$endif unix}
@@ -36,9 +32,9 @@ uses
   getopts;
 
 const
-  Version   = 'Version 1.00';
+  Version   = 'Version 1.0.2';
   Title     = 'PPU-Mover';
-  Copyright = 'Copyright (c) 1998-2002 by the Free Pascal Development Team';
+  Copyright = 'Copyright (c) 1998-2005 by the Free Pascal Development Team';
 
   ShortOpts = 'o:e:d:qhsvbw';
   BufSize = 4096;
@@ -74,12 +70,14 @@ Var
   DestPath,
   PPLExt,
   LibExt      : string;
+  DoStrip,
   Batch,
   Quiet,
   MakeStatic  : boolean;
   Buffer      : Pointer;
   ObjFiles    : PLinkOEnt;
   BatchFile   : Text;
+  Libs        : ansistring;
 
 {*****************************************************************************
                                  Helpers
@@ -112,7 +110,7 @@ begin
      exit;
    end;
 {$ifdef unix}
-  Shell:={$ifdef ver1_0}linux{$else}unix{$endif}.shell(s);
+  Shell:=unix.shell(s);
 {$else}
   exec(getenv('COMSPEC'),'/C '+s);
   Shell:=DosExitCode;
@@ -132,7 +130,7 @@ Var
 {$endif}
 begin
 {$ifdef unix}
-  FileExists:={$ifdef VER1_0}FStat{$ELSE}FpStat{$endif} (F,Info){$ifndef VER1_0}=0{$endif};
+  FileExists:=FpStat(F,Info)=0;
 {$else}
   FindFirst (F,anyfile,Info);
   FileExists:=DosError=0;
@@ -372,10 +370,22 @@ begin
   { don't write ibend, that's written automaticly }
     if b<>ibend then
      begin
-       repeat
-         inppu.getdatabuf(buffer^,bufsize,l);
-         outppu.putdata(buffer^,l);
-       until l<bufsize;
+       if b=iblinkothersharedlibs then
+         begin
+           while not inppu.endofentry do
+             begin
+               s:=inppu.getstring;
+               m:=inppu.getlongint;
+               libs:=libs+' -l'+s;
+               outppu.putstring(s);
+               outppu.putlongint(m);
+             end;
+         end
+       else
+         repeat
+           inppu.getdatabuf(buffer^,bufsize,l);
+           outppu.putdata(buffer^,l);
+         until l<bufsize;
        outppu.writeentry(b);
      end;
   until b=ibend;
@@ -458,21 +468,21 @@ begin
      exit;
    end;
   If not Quiet then
-   WriteLn(names);
+    WriteLn(names+Libs);
 { Run ar or ld to create the lib }
   If MakeStatic then
    Err:=Shell(arbin+' rs '+outputfile+' '+names)<>0
   else
    begin
-     Err:=Shell(ldbin+' -shared -o '+OutputFile+' '+names)<>0;
-     if not Err then
+     Err:=Shell(ldbin+' -shared -E -o '+OutputFile+' '+names+' '+libs)<>0;
+     if (not Err) and dostrip then
       Shell(stripbin+' --strip-unneeded '+OutputFile);
    end;
   If Err then
    Error('Fatal: Library building stage failed.',true);
 { fix permission to 644, so it's not 755 }
 {$ifdef unix}
-  {$ifdef VER1_0}ChMod{$ELSE}FPChmod{$endif}(OutputFile,420);
+  FPChmod(OutputFile,420);
 {$endif}
 { Rename to the destpath }
   if DestPath<>'' then
@@ -488,7 +498,7 @@ Procedure usage;
   Print usage and exit.
 }
 begin
-  Writeln(paramstr(0),': [-qhwvbs] [-e ext] [-o name] [-d path] file [file ...]');
+  Writeln(paramstr(0),': [-qhwvbsS] [-e ext] [-o name] [-d path] file [file ...]');
   Halt(0);
 end;
 
@@ -507,6 +517,7 @@ begin
   ObjFiles:=Nil;
   Quiet:=False;
   Batch:=False;
+  DoStrip:=False;
   OutputFile:='';
   PPLExt:='ppu';
   ArBin:='ar';
@@ -516,7 +527,7 @@ begin
     c:=Getopt (ShortOpts);
     Case C of
       EndOfOptions : break;
-      's' : MakeStatic:=True;
+      'S' : MakeStatic:=True;
       'o' : OutputFile:=OptArg;
       'd' : DestPath:=OptArg;
       'e' : PPLext:=OptArg;
@@ -526,6 +537,7 @@ begin
               LdBin:='ldw';
             end;
       'b' : Batch:=true;
+      's' : DoStrip:=true;
       '?' : Usage;
       'h' : Usage;
     end;
@@ -545,6 +557,7 @@ end;
 var
   i : longint;
 begin
+  Libs:='';
   ProcessOpts;
 { Write Header }
   if not Quiet then
@@ -604,7 +617,7 @@ begin
       Writeln('Writing pmove'+BatchExt);
      Close(BatchFile);
 {$ifdef unix}
-  {$ifdef VER1_0}ChMod{$ELSE}FPChmod{$endif}('pmove'+BatchExt,493);
+  FPChmod('pmove'+BatchExt,493);
 {$endif}
    end;
 { The End }

+ 39 - 0
ide/readme.ide

@@ -86,6 +86,45 @@
  help system by going to Help menu, selecting Files and
  adding them to the list.
 
+  Linux and FreeBSD Ü
+ ßßßßßßßßßßßßßßßßßßßß
+ Free Vision, the windowing library on which the IDE is
+ based, is more advanced than a VT100 terminal can
+ handle. Unfortunately, Unix terminal emulators provide
+ mostly VT100 functionality, and do not allow access to
+ all VGA characters.
+
+ On a VT100 compatible terminal, Free Vision replaces VGA
+ characters as good as possible using the characters that
+ the VT100 does have. This works very well, but it means
+ that window borders arrows and other characters do not
+ look optimal. Free Vision uses a slightly enhanced
+ version of this VT100 mode on FreeBSD.
+
+ When running on the Linux console (no X) Free Vision
+ switches into Linux console mode and makes use of the
+ /dev/vcsa* devices to display the full character set. To
+ make use of this mode, you must use a VGA console font in
+ codepage 437, 850, 852 etc. encoding. If your distrib-
+ ution uses /etc/sysconfig/console, these are good values
+ to put into that file:
+
+ CONSOLE_FONT="cp850-8x16"
+ CONSOLE_SCREENMAP="8859-1_to_uni.trans"
+ CONSOLE_UNICODEMAP=""
+
+ To allow non-root users to use the Linux console mode you
+ must make sure they have permission to use /dev/vcsa*.
+ The best way to do this is to make sure the utility
+ "grab_vcsa" is in a directory pointed to by the
+ environment variable "PATH" and configured setuid root.
+ It will change the ownership of the /dev/vcsa device the
+ user is using to him until he logs out.
+
+ The Linux console mode can be combined with fbdev. At
+ high resolutions, i.e. 1024x768, the IDE becomes very
+ pleasant to work with.
+
   More information Ü
  ßßßßßßßßßßßßßßßßßßß
  If you need more informations you can:

+ 29 - 2
rtl/linux/termio.pp

@@ -36,7 +36,34 @@ implementation
 // load implementation for prototypes from current dir.
 {$i termiosproc.inc}
 
-// load ttyname from unix dir.
-{$i ttyname.inc}
+{We can implement ttyname more efficiently using proc than by including the
+ generic ttyname.inc file.}
+
+function TTYName(Handle:cint):string;
+
+{ Return the name of the current tty described by handle f.
+  returns empty string in case of an error.}
+
+var s:string[32];
+    t:string[64];
+
+begin
+  ttyname:='';
+  if isatty(handle)=1 then
+    begin
+      str(handle,s);
+      t:='/proc/self/fd/'+s+#0;
+      fpreadlink(@t[1],@ttyname[1],255);
+      ttyname[0]:=char(strlen(@ttyname[1]));
+    end;
+end;
+
+function TTYName(var F:Text):string;inline;
+{
+  Idem as previous, only now for text variables;
+}
+begin
+  TTYName:=TTYName(textrec(f).handle);
+end;
 
 end.

+ 1 - 1
rtl/unix/dynlibs.inc

@@ -24,7 +24,7 @@ Type
   TLibHandle = PtrInt;
 
 Const
-  NilHandle : TLibHandle = 0;
+  NilHandle = TLibHandle(0);
 
 {$else}
 

+ 7 - 0
tests/test/testv10.pp

@@ -0,0 +1,7 @@
+uses
+  variants;
+var
+  lVar : Variant;
+begin
+  lVar := VarAsType('',varEmpty);
+end.