summaryrefslogtreecommitdiff
path: root/packages/fcl-process
diff options
context:
space:
mode:
authorflorian <florian@3ad0048d-3df7-0310-abae-a5850022a9f2>2008-07-07 18:41:10 +0000
committerflorian <florian@3ad0048d-3df7-0310-abae-a5850022a9f2>2008-07-07 18:41:10 +0000
commit86839ca5ce2309807c769416a6ff01d259c9ab11 (patch)
tree0e2230d0a419d944f6cc797b646c9fa9dc69e8d4 /packages/fcl-process
parenta4208b0af9a1bc5f1a12c58535a71fed0ce28431 (diff)
downloadfpc-86839ca5ce2309807c769416a6ff01d259c9ab11.tar.gz
* empty tprocess command line results on windows now in the same exception as on unix
* some code unified git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@11343 3ad0048d-3df7-0310-abae-a5850022a9f2
Diffstat (limited to 'packages/fcl-process')
-rw-r--r--packages/fcl-process/Makefile89
-rw-r--r--packages/fcl-process/Makefile.fpc15
-rw-r--r--packages/fcl-process/src/process.pp14
-rw-r--r--packages/fcl-process/src/unix/process.inc22
-rw-r--r--packages/fcl-process/src/win/process.inc36
-rw-r--r--packages/fcl-process/src/wince/process.inc33
6 files changed, 158 insertions, 51 deletions
diff --git a/packages/fcl-process/Makefile b/packages/fcl-process/Makefile
index 1f169d342f..29c4463c95 100644
--- a/packages/fcl-process/Makefile
+++ b/packages/fcl-process/Makefile
@@ -1,5 +1,5 @@
#
-# Don't edit, this file is generated by FPCMake Version 2.0.0 [2008/06/15]
+# Don't edit, this file is generated by FPCMake Version 2.0.0 [2008/07/07]
#
default: all
MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-haiku 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-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded avr-embedded armeb-linux armeb-embedded
@@ -437,11 +437,14 @@ endif
ifeq ($(FULL_TARGET),i386-linux)
override TARGET_RSTS+=process simpleipc
endif
+ifeq ($(FULL_TARGET),i386-go32v2)
+override TARGET_RSTS+=process simpleipc
+endif
ifeq ($(FULL_TARGET),i386-win32)
-override TARGET_RSTS+=simpleipc
+override TARGET_RSTS+=process simpleipc
endif
ifeq ($(FULL_TARGET),i386-os2)
-override TARGET_RSTS+=simpleipc
+override TARGET_RSTS+=process simpleipc
endif
ifeq ($(FULL_TARGET),i386-freebsd)
override TARGET_RSTS+=process simpleipc
@@ -461,17 +464,35 @@ endif
ifeq ($(FULL_TARGET),i386-qnx)
override TARGET_RSTS+=process simpleipc
endif
+ifeq ($(FULL_TARGET),i386-netware)
+override TARGET_RSTS+=process simpleipc
+endif
ifeq ($(FULL_TARGET),i386-openbsd)
override TARGET_RSTS+=process simpleipc
endif
+ifeq ($(FULL_TARGET),i386-wdosx)
+override TARGET_RSTS+=process simpleipc
+endif
ifeq ($(FULL_TARGET),i386-darwin)
override TARGET_RSTS+=process simpleipc
endif
ifeq ($(FULL_TARGET),i386-emx)
-override TARGET_RSTS+=simpleipc
+override TARGET_RSTS+=process simpleipc
+endif
+ifeq ($(FULL_TARGET),i386-watcom)
+override TARGET_RSTS+=process simpleipc
+endif
+ifeq ($(FULL_TARGET),i386-netwlibc)
+override TARGET_RSTS+=process simpleipc
endif
ifeq ($(FULL_TARGET),i386-wince)
-override TARGET_RSTS+=simpleipc
+override TARGET_RSTS+=process simpleipc
+endif
+ifeq ($(FULL_TARGET),i386-embedded)
+override TARGET_RSTS+=process simpleipc
+endif
+ifeq ($(FULL_TARGET),i386-symbian)
+override TARGET_RSTS+=process simpleipc
endif
ifeq ($(FULL_TARGET),m68k-linux)
override TARGET_RSTS+=process simpleipc
@@ -482,18 +503,42 @@ endif
ifeq ($(FULL_TARGET),m68k-netbsd)
override TARGET_RSTS+=process simpleipc
endif
+ifeq ($(FULL_TARGET),m68k-amiga)
+override TARGET_RSTS+=process simpleipc
+endif
+ifeq ($(FULL_TARGET),m68k-atari)
+override TARGET_RSTS+=process simpleipc
+endif
ifeq ($(FULL_TARGET),m68k-openbsd)
override TARGET_RSTS+=process simpleipc
endif
+ifeq ($(FULL_TARGET),m68k-palmos)
+override TARGET_RSTS+=process simpleipc
+endif
+ifeq ($(FULL_TARGET),m68k-embedded)
+override TARGET_RSTS+=process simpleipc
+endif
ifeq ($(FULL_TARGET),powerpc-linux)
override TARGET_RSTS+=process simpleipc
endif
ifeq ($(FULL_TARGET),powerpc-netbsd)
override TARGET_RSTS+=process simpleipc
endif
+ifeq ($(FULL_TARGET),powerpc-amiga)
+override TARGET_RSTS+=process simpleipc
+endif
+ifeq ($(FULL_TARGET),powerpc-macos)
+override TARGET_RSTS+=process simpleipc
+endif
ifeq ($(FULL_TARGET),powerpc-darwin)
override TARGET_RSTS+=process simpleipc
endif
+ifeq ($(FULL_TARGET),powerpc-morphos)
+override TARGET_RSTS+=process simpleipc
+endif
+ifeq ($(FULL_TARGET),powerpc-embedded)
+override TARGET_RSTS+=process simpleipc
+endif
ifeq ($(FULL_TARGET),sparc-linux)
override TARGET_RSTS+=process simpleipc
endif
@@ -503,6 +548,9 @@ endif
ifeq ($(FULL_TARGET),sparc-solaris)
override TARGET_RSTS+=process simpleipc
endif
+ifeq ($(FULL_TARGET),sparc-embedded)
+override TARGET_RSTS+=process simpleipc
+endif
ifeq ($(FULL_TARGET),x86_64-linux)
override TARGET_RSTS+=process simpleipc
endif
@@ -513,16 +561,34 @@ ifeq ($(FULL_TARGET),x86_64-darwin)
override TARGET_RSTS+=process simpleipc
endif
ifeq ($(FULL_TARGET),x86_64-win64)
-override TARGET_RSTS+=simpleipc
+override TARGET_RSTS+=process simpleipc
+endif
+ifeq ($(FULL_TARGET),x86_64-embedded)
+override TARGET_RSTS+=process simpleipc
endif
ifeq ($(FULL_TARGET),arm-linux)
override TARGET_RSTS+=process simpleipc
endif
+ifeq ($(FULL_TARGET),arm-palmos)
+override TARGET_RSTS+=process simpleipc
+endif
ifeq ($(FULL_TARGET),arm-darwin)
override TARGET_RSTS+=process simpleipc
endif
ifeq ($(FULL_TARGET),arm-wince)
-override TARGET_RSTS+=simpleipc
+override TARGET_RSTS+=process simpleipc
+endif
+ifeq ($(FULL_TARGET),arm-gba)
+override TARGET_RSTS+=process simpleipc
+endif
+ifeq ($(FULL_TARGET),arm-nds)
+override TARGET_RSTS+=process simpleipc
+endif
+ifeq ($(FULL_TARGET),arm-embedded)
+override TARGET_RSTS+=process simpleipc
+endif
+ifeq ($(FULL_TARGET),arm-symbian)
+override TARGET_RSTS+=process simpleipc
endif
ifeq ($(FULL_TARGET),powerpc64-linux)
override TARGET_RSTS+=process simpleipc
@@ -530,9 +596,18 @@ endif
ifeq ($(FULL_TARGET),powerpc64-darwin)
override TARGET_RSTS+=process simpleipc
endif
+ifeq ($(FULL_TARGET),powerpc64-embedded)
+override TARGET_RSTS+=process simpleipc
+endif
+ifeq ($(FULL_TARGET),avr-embedded)
+override TARGET_RSTS+=process simpleipc
+endif
ifeq ($(FULL_TARGET),armeb-linux)
override TARGET_RSTS+=process simpleipc
endif
+ifeq ($(FULL_TARGET),armeb-embedded)
+override TARGET_RSTS+=process simpleipc
+endif
override INSTALL_FPCPACKAGE=y
ifeq ($(FULL_TARGET),i386-linux)
override COMPILER_OPTIONS+=-S2h
diff --git a/packages/fcl-process/Makefile.fpc b/packages/fcl-process/Makefile.fpc
index 4abdcbe1a1..1956a0c485 100644
--- a/packages/fcl-process/Makefile.fpc
+++ b/packages/fcl-process/Makefile.fpc
@@ -22,20 +22,7 @@ units_wince=simpleipc dbugmsg dbugintf
units_qnx=simpleipc dbugmsg dbugintf
units_os2=simpleipc dbugmsg dbugintf
units_emx=simpleipc dbugmsg dbugintf
-rsts_beos=process simpleipc
-rsts_haiku=process simpleipc
-rsts_freebsd=process simpleipc
-rsts_darwin=process simpleipc
-rsts_solaris=process simpleipc
-rsts_netbsd=process simpleipc
-rsts_openbsd=process simpleipc
-rsts_linux=process simpleipc
-rsts_qnx=process simpleipc
-rsts_win32=simpleipc
-rsts_win64=simpleipc
-rsts_wince=simpleipc
-rsts_os2=simpleipc
-rsts_emx=simpleipc
+rsts=process simpleipc
[compiler]
options=-S2h
diff --git a/packages/fcl-process/src/process.pp b/packages/fcl-process/src/process.pp
index 6c732c9c85..ca5186de7a 100644
--- a/packages/fcl-process/src/process.pp
+++ b/packages/fcl-process/src/process.pp
@@ -139,6 +139,20 @@ Type
implementation
+{$ifdef WINDOWS}
+Uses
+ Windows;
+{$endif WINDOWS}
+{$ifdef UNIX}
+uses
+ Unix,
+ Baseunix;
+{$endif UNIX}
+
+Resourcestring
+ SNoCommandLine = 'Cannot execute empty command-line';
+ SErrNoSuchProgram = 'Executable not found: "%s"';
+
{$i process.inc}
Constructor TProcess.Create (AOwner : TComponent);
diff --git a/packages/fcl-process/src/unix/process.inc b/packages/fcl-process/src/unix/process.inc
index 5ae60d24c1..c1d269e571 100644
--- a/packages/fcl-process/src/unix/process.inc
+++ b/packages/fcl-process/src/unix/process.inc
@@ -1,14 +1,15 @@
{
- Unix Process .inc.
-}
+ This file is part of the Free Component Library (FCL)
+ Copyright (c) 1999-2008 by the Free Pascal development team
-uses
- Unix,
- Baseunix;
+ See the file COPYING.FPC, included in this distribution,
+ for details about the copyright.
-resourcestring
- SErrNoSuchProgram = 'Executable not found: "%s"';
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ **********************************************************************}
Const
PriorityConstants : Array [TProcessPriority] of Integer =
(20,20,0,-20);
@@ -17,8 +18,6 @@ Const
GeometryOption : String = '-geometry';
TitleOption : String ='-title';
-
-
procedure TProcess.CloseProcessHandles;
begin
@@ -133,14 +132,11 @@ end;
Function MakeCommand(P : TProcess) : PPchar;
-Const
- SNoCommandLine = 'Cannot execute empty command-line';
-
Var
Cmd : String;
S : TStringList;
G : String;
-
+
begin
if (P.ApplicationName='') then
begin
diff --git a/packages/fcl-process/src/win/process.inc b/packages/fcl-process/src/win/process.inc
index 0661175958..9e9ee188a7 100644
--- a/packages/fcl-process/src/win/process.inc
+++ b/packages/fcl-process/src/win/process.inc
@@ -1,8 +1,15 @@
{
- Win32 Process .inc.
-}
+ This file is part of the Free Component Library (FCL)
+ Copyright (c) 1999-2008 by the Free Pascal development team
-uses Windows;
+ See the file COPYING.FPC, included in this distribution,
+ for details about the copyright.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ **********************************************************************}
Const
PriorityConstants : Array [TProcessPriority] of Cardinal =
@@ -150,8 +157,6 @@ end;
Procedure TProcess.Execute;
-
-
Var
PName,PDir,PCommandLine : PChar;
FEnv: pointer;
@@ -161,16 +166,27 @@ Var
FProcessInformation : TProcessInformation;
FStartupInfo : STARTUPINFO;
HI,HO,HE : THandle;
-
begin
FInheritHandles:=True;
PName:=Nil;
PCommandLine:=Nil;
PDir:=Nil;
- If FApplicationName<>'' then
- PName:=Pchar(FApplicationName);
- If FCommandLine<>'' then
- PCommandLine:=Pchar(FCommandLine);
+
+ if (FApplicationName='') then
+ begin
+ If (FCommandLine='') then
+ Raise EProcess.Create(SNoCommandline);
+ PCommandLine:=Pchar(FCommandLine)
+ end
+ else
+ begin
+ PName:=Pchar(FApplicationName);
+ If (FCommandLine='') then
+ PCommandLine:=Pchar(FApplicationName)
+ else
+ PCommandLine:=Pchar(FCommandLine)
+ end;
+
If FCurrentDirectory<>'' then
PDir:=Pchar(FCurrentDirectory);
if FEnvironment.Count<>0 then
diff --git a/packages/fcl-process/src/wince/process.inc b/packages/fcl-process/src/wince/process.inc
index a3f358dcc2..626df7a814 100644
--- a/packages/fcl-process/src/wince/process.inc
+++ b/packages/fcl-process/src/wince/process.inc
@@ -1,8 +1,15 @@
{
- Wince Process .inc.
-}
+ This file is part of the Free Component Library (FCL)
+ Copyright (c) 1999-2008 by the Free Pascal development team
-uses Windows;
+ See the file COPYING.FPC, included in this distribution,
+ for details about the copyright.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ **********************************************************************}
Const
PriorityConstants : Array [TProcessPriority] of Cardinal =
@@ -167,10 +174,22 @@ begin
PName:=Nil;
PCommandLine:=Nil;
PDir:=Nil;
- If FApplicationName<>'' then
- PName:=PWidechar(FApplicationName);
- If FCommandLine<>'' then
- PCommandLine:=PWidechar(FCommandLine);
+
+ if (FApplicationName='') then
+ begin
+ If (FCommandLine='') then
+ Raise EProcess.Create(SNoCommandline);
+ PCommandLine:=PWidechar(FCommandLine)
+ end
+ else
+ begin
+ PName:=PWidechar(FApplicationName);
+ If (FCommandLine='') then
+ PCommandLine:=PWidechar(FApplicationName)
+ else
+ PCommandLine:=PWidechar(FCommandLine)
+ end;
+
If FCurrentDirectory<>'' then
PDir:=PWidechar(FCurrentDirectory);
if FEnvironment.Count<>0 then