diff options
Diffstat (limited to 'ide')
-rw-r--r-- | ide/Makefile | 96 | ||||
-rw-r--r-- | ide/Makefile.fpc | 35 | ||||
-rw-r--r-- | ide/Makefile.fpc.fpcmake | 2 | ||||
-rw-r--r-- | ide/compiler/Makefile | 82 | ||||
-rw-r--r-- | ide/fakegdb/Makefile | 55 | ||||
-rw-r--r-- | ide/fp.pas | 18 | ||||
-rw-r--r-- | ide/fpconst.pas | 47 | ||||
-rw-r--r-- | ide/fpdebug.pas | 153 | ||||
-rw-r--r-- | ide/fphelp.pas | 10 | ||||
-rw-r--r-- | ide/fpide.pas | 37 | ||||
-rw-r--r-- | ide/fpini.pas | 38 | ||||
-rw-r--r-- | ide/fpmake.pp | 27 | ||||
-rw-r--r-- | ide/fpmdebug.inc | 41 | ||||
-rw-r--r-- | ide/fpmingw.pas | 4 | ||||
-rw-r--r-- | ide/fpmopts.inc | 49 | ||||
-rw-r--r-- | ide/fpredir.pas | 8 | ||||
-rw-r--r-- | ide/fptemplt.pas | 4 | ||||
-rw-r--r-- | ide/fpusrscr.pas | 165 | ||||
-rw-r--r-- | ide/fputils.pas | 12 | ||||
-rw-r--r-- | ide/fpvars.pas | 21 | ||||
-rw-r--r-- | ide/fpviews.pas | 9 | ||||
-rw-r--r-- | ide/globdir.inc | 28 | ||||
-rw-r--r-- | ide/wconsole.pas | 3 | ||||
-rw-r--r-- | ide/wconstse.inc | 10 | ||||
-rw-r--r-- | ide/whelp.pas | 22 | ||||
-rw-r--r-- | ide/winclip.pas | 55 | ||||
-rw-r--r-- | ide/wini.pas | 65 | ||||
-rw-r--r-- | ide/wutils.pas | 12 |
28 files changed, 848 insertions, 260 deletions
diff --git a/ide/Makefile b/ide/Makefile index 21694b00ac..221152abf3 100644 --- a/ide/Makefile +++ b/ide/Makefile @@ -1,9 +1,9 @@ # -# Don't edit, this file is generated by FPCMake Version 2.0.0 [2014-02-06 rev 26692] +# Don't edit, this file is generated by FPCMake Version 2.0.0 [2014-12-07 rev 29213] # 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 i386-nativent i386-iphonesim i386-android 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 powerpc-wii powerpc-aix sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-netbsd x86_64-solaris x86_64-openbsd 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 arm-android powerpc64-linux powerpc64-darwin powerpc64-embedded powerpc64-aix avr-embedded armeb-linux armeb-embedded mips-linux mipsel-linux mipsel-android jvm-java jvm-android i8086-msdos -BSDs = freebsd netbsd openbsd darwin +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 i386-nativent i386-iphonesim i386-android i386-aros 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 powerpc-wii powerpc-aix sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-netbsd x86_64-solaris x86_64-openbsd x86_64-darwin x86_64-win64 x86_64-embedded x86_64-dragonfly arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian arm-android powerpc64-linux powerpc64-darwin powerpc64-embedded powerpc64-aix avr-embedded armeb-linux armeb-embedded mips-linux mipsel-linux mipsel-embedded mipsel-android jvm-java jvm-android i8086-msdos +BSDs = freebsd netbsd openbsd darwin dragonfly UNIXs = linux $(BSDs) solaris qnx haiku aix LIMIT83fs = go32v2 os2 emx watcom msdos OSNeedsComspecToRunBatch = go32v2 watcom @@ -184,6 +184,12 @@ $(error When compiling for arm-embedded, a sub-architecture (e.g. SUBARCH=armv4t endif override FPCOPT+=-Cp$(SUBARCH) endif +ifeq ($(FULL_TARGET),mipsel-embedded) +ifeq ($(SUBARCH),) +$(error When compiling for mipsel-embedded, a sub-architecture (e.g. SUBARCH=pic32mx) must be defined) +endif +override FPCOPT+=-Cp$(SUBARCH) +endif ifneq ($(findstring $(OS_SOURCE),$(LIMIT83fs)),) TARGETSUFFIX=$(OS_TARGET) SOURCESUFFIX=$(OS_SOURCE) @@ -575,6 +581,12 @@ EXEEXT= HASSHAREDLIB=1 SHORTSUFFIX=lnx endif +ifeq ($(OS_TARGET),dragonfly) +BATCHEXT=.sh +EXEEXT= +HASSHAREDLIB=1 +SHORTSUFFIX=df +endif ifeq ($(OS_TARGET),freebsd) BATCHEXT=.sh EXEEXT= @@ -620,6 +632,11 @@ EXEEXT= SHAREDLIBEXT=.library SHORTSUFFIX=amg endif +ifeq ($(OS_TARGET),aros) +EXEEXT= +SHAREDLIBEXT=.library +SHORTSUFFIX=aros +endif ifeq ($(OS_TARGET),morphos) EXEEXT= SHAREDLIBEXT=.library @@ -1156,6 +1173,14 @@ REQUIRE_PACKAGES_HASH=1 REQUIRE_PACKAGES_LIBTAR=1 REQUIRE_PACKAGES_FPMKUNIT=1 endif +ifeq ($(FULL_TARGET),i386-aros) +REQUIRE_PACKAGES_RTL=1 +REQUIRE_PACKAGES_PASZLIB=1 +REQUIRE_PACKAGES_FCL-PROCESS=1 +REQUIRE_PACKAGES_HASH=1 +REQUIRE_PACKAGES_LIBTAR=1 +REQUIRE_PACKAGES_FPMKUNIT=1 +endif ifeq ($(FULL_TARGET),m68k-linux) REQUIRE_PACKAGES_RTL=1 REQUIRE_PACKAGES_PASZLIB=1 @@ -1388,6 +1413,14 @@ REQUIRE_PACKAGES_HASH=1 REQUIRE_PACKAGES_LIBTAR=1 REQUIRE_PACKAGES_FPMKUNIT=1 endif +ifeq ($(FULL_TARGET),x86_64-dragonfly) +REQUIRE_PACKAGES_RTL=1 +REQUIRE_PACKAGES_PASZLIB=1 +REQUIRE_PACKAGES_FCL-PROCESS=1 +REQUIRE_PACKAGES_HASH=1 +REQUIRE_PACKAGES_LIBTAR=1 +REQUIRE_PACKAGES_FPMKUNIT=1 +endif ifeq ($(FULL_TARGET),arm-linux) REQUIRE_PACKAGES_RTL=1 REQUIRE_PACKAGES_PASZLIB=1 @@ -1532,6 +1565,14 @@ REQUIRE_PACKAGES_HASH=1 REQUIRE_PACKAGES_LIBTAR=1 REQUIRE_PACKAGES_FPMKUNIT=1 endif +ifeq ($(FULL_TARGET),mipsel-embedded) +REQUIRE_PACKAGES_RTL=1 +REQUIRE_PACKAGES_PASZLIB=1 +REQUIRE_PACKAGES_FCL-PROCESS=1 +REQUIRE_PACKAGES_HASH=1 +REQUIRE_PACKAGES_LIBTAR=1 +REQUIRE_PACKAGES_FPMKUNIT=1 +endif ifeq ($(FULL_TARGET),mipsel-android) REQUIRE_PACKAGES_RTL=1 REQUIRE_PACKAGES_PASZLIB=1 @@ -1905,7 +1946,7 @@ endif ifdef CREATESHARED override FPCOPT+=-Cg endif -ifneq ($(findstring $(OS_TARGET),freebsd openbsd netbsd linux solaris),) +ifneq ($(findstring $(OS_TARGET),dragonfly freebsd openbsd netbsd linux solaris),) ifeq ($(CPU_TARGET),x86_64) override FPCOPT+=-Cg endif @@ -1935,17 +1976,23 @@ ifdef ACROSSCOMPILE override FPCOPT+=$(CROSSOPT) endif override COMPILER:=$(strip $(FPC) $(FPCOPT)) -ifeq (,$(findstring -s ,$(COMPILER))) +ifneq (,$(findstring -sh ,$(COMPILER))) +UseEXECPPAS=1 +endif +ifneq (,$(findstring -s ,$(COMPILER))) +ifeq ($(FULL_SOURCE),$(FULL_TARGET)) +UseEXECPPAS=1 +endif +endif +ifneq ($(UseEXECPPAS),1) EXECPPAS= else -ifeq ($(FULL_SOURCE),$(FULL_TARGET)) ifdef RUNBATCH EXECPPAS:=@$(RUNBATCH) $(PPAS) else EXECPPAS:=@$(PPAS) endif endif -endif ifdef TARGET_RSTS override RSTFILES=$(addsuffix $(RSTEXT),$(TARGET_RSTS)) override CLEANRSTFILES+=$(RSTFILES) @@ -2139,11 +2186,10 @@ examples: shared: sourceinstall: exampleinstall: -zipsourceinstall: zipexampleinstall: info: fpc_info makefiles: fpc_makefiles -.PHONY: units examples shared sourceinstall exampleinstall zipsourceinstall zipexampleinstall info makefiles +.PHONY: units examples shared sourceinstall exampleinstall zipexampleinstall info makefiles ifneq ($(wildcard fpcmake.loc),) include fpcmake.loc endif @@ -2168,15 +2214,15 @@ ifdef PPC_TARGET FPMAKE_OPT+=--CompilerTarget=$(PPC_TARGET) endif .NOTPARALLEL: -fpmake: fpmake.pp +fpmake$(SRCEXEEXT): fpmake.pp $(FPCFPMAKE) fpmake.pp $(FPMAKE_SKIP_CONFIG) $(addprefix -Fu,$(COMPILER_FPMAKE_UNITDIR)) $(FPCMAKEOPT) $(OPT) -all: fpmake +all: fpmake$(SRCEXEEXT) $(LOCALFPMAKE) compile $(FPMAKE_OPT) -smart: fpmake +smart: fpmake$(SRCEXEEXT) $(LOCALFPMAKE) compile $(FPMAKE_OPT) -o -XX -o -CX -release: fpmake +release: fpmake$(SRCEXEEXT) $(LOCALFPMAKE) compile $(FPMAKE_OPT) -o -dRELEASE -debug: fpmake +debug: fpmake$(SRCEXEEXT) $(LOCALFPMAKE) compile $(FPMAKE_OPT) -o -dDEBUG ifeq ($(FPMAKE_BIN_CLEAN),) clean: @@ -2201,19 +2247,25 @@ endif -$(DEL) fpmake.dbg endif cleanall: distclean -install: fpmake +install: fpmake$(SRCEXEEXT) ifdef UNIXHier $(LOCALFPMAKE) install $(FPMAKE_OPT) --prefix=$(INSTALL_PREFIX) --baseinstalldir=$(INSTALL_LIBDIR)/fpc/$(FPC_VERSION) $(FPMAKE_INSTALL_OPT) else - $(LOCALFPMAKE) install $(FPMAKE_OPT) --prefix=$(INSTALL_BASEDIR) $(FPMAKE_INSTALL_OPT) + $(LOCALFPMAKE) install $(FPMAKE_OPT) --prefix=$(INSTALL_BASEDIR) --baseinstalldir=$(INSTALL_BASEDIR) $(FPMAKE_INSTALL_OPT) endif -distinstall: fpmake +distinstall: fpmake$(SRCEXEEXT) ifdef UNIXHier - $(LOCALFPMAKE) install $(FPMAKE_OPT) --prefix=$(INSTALL_PREFIX) --baseinstalldir=$(INSTALL_LIBDIR)/fpc/$(FPC_VERSION) $(FPMAKE_INSTALL_OPT) -ie + $(LOCALFPMAKE) install $(FPMAKE_OPT) --prefix=$(INSTALL_PREFIX) --baseinstalldir=$(INSTALL_LIBDIR)/fpc/$(FPC_VERSION) $(FPMAKE_INSTALL_OPT) -ie -fsp 0 else - $(LOCALFPMAKE) install $(FPMAKE_OPT) --prefix=$(INSTALL_BASEDIR) $(FPMAKE_INSTALL_OPT) -ie + $(LOCALFPMAKE) install $(FPMAKE_OPT) --prefix=$(INSTALL_BASEDIR) --baseinstalldir=$(INSTALL_BASEDIR) $(FPMAKE_INSTALL_OPT) -ie -fsp 0 endif -zipinstall: fpmake +zipinstall: fpmake$(SRCEXEEXT) $(LOCALFPMAKE) zipinstall $(FPMAKE_OPT) --zipprefix=$(DIST_DESTDIR)/$(ZIPPREFIX) -zipdistinstall: fpmake - $(LOCALFPMAKE) zipinstall $(FPMAKE_OPT) --zipprefix=$(DIST_DESTDIR)/$(ZIPPREFIX) -ie +zipdistinstall: fpmake$(SRCEXEEXT) + $(LOCALFPMAKE) zipinstall $(FPMAKE_OPT) --zipprefix=$(DIST_DESTDIR)/$(ZIPPREFIX) -ie -fsp 0 +zipsourceinstall: fpmake$(SRCEXEEXT) +ifdef UNIXHier + $(LOCALFPMAKE) archive $(FPMAKE_OPT) --zipprefix=$(DIST_DESTDIR)/$(ZIPPREFIX) --prefix=share/src/fpc-\$$\(PACKAGEVERSION\)/$(INSTALL_FPCSUBDIR)/\$$\(PACKAGEDIRECTORY\) +else + $(LOCALFPMAKE) archive $(FPMAKE_OPT) --zipprefix=$(DIST_DESTDIR)/$(ZIPPREFIX) --prefix=source\\$(INSTALL_FPCSUBDIR)\\\$$\(PACKAGEDIRECTORY\) +endif diff --git a/ide/Makefile.fpc b/ide/Makefile.fpc index e2a2492455..b330a20430 100644 --- a/ide/Makefile.fpc +++ b/ide/Makefile.fpc @@ -53,15 +53,15 @@ FPMAKE_OPT+=--CompilerTarget=$(PPC_TARGET) endif .NOTPARALLEL: -fpmake: fpmake.pp +fpmake$(SRCEXEEXT): fpmake.pp $(FPCFPMAKE) fpmake.pp $(FPMAKE_SKIP_CONFIG) $(addprefix -Fu,$(COMPILER_FPMAKE_UNITDIR)) $(FPCMAKEOPT) $(OPT) -all: fpmake +all: fpmake$(SRCEXEEXT) $(LOCALFPMAKE) compile $(FPMAKE_OPT) -smart: fpmake +smart: fpmake$(SRCEXEEXT) $(LOCALFPMAKE) compile $(FPMAKE_OPT) -o -XX -o -CX -release: fpmake +release: fpmake$(SRCEXEEXT) $(LOCALFPMAKE) compile $(FPMAKE_OPT) -o -dRELEASE -debug: fpmake +debug: fpmake$(SRCEXEEXT) $(LOCALFPMAKE) compile $(FPMAKE_OPT) -o -dDEBUG # If no fpmake exists and (dist)clean is called, do not try to build fpmake, it will # most often fail because the dependencies are cleared. @@ -93,20 +93,27 @@ endif -$(DEL) fpmake.dbg endif cleanall: distclean -install: fpmake +install: fpmake$(SRCEXEEXT) ifdef UNIXHier $(LOCALFPMAKE) install $(FPMAKE_OPT) --prefix=$(INSTALL_PREFIX) --baseinstalldir=$(INSTALL_LIBDIR)/fpc/$(FPC_VERSION) $(FPMAKE_INSTALL_OPT) else - $(LOCALFPMAKE) install $(FPMAKE_OPT) --prefix=$(INSTALL_BASEDIR) $(FPMAKE_INSTALL_OPT) + $(LOCALFPMAKE) install $(FPMAKE_OPT) --prefix=$(INSTALL_BASEDIR) --baseinstalldir=$(INSTALL_BASEDIR) $(FPMAKE_INSTALL_OPT) endif -# distinstall also installs the example-sources -distinstall: fpmake +# distinstall also installs the example-sources and omits the location of the source- +# files from the fpunits.cfg files. +distinstall: fpmake$(SRCEXEEXT) ifdef UNIXHier - $(LOCALFPMAKE) install $(FPMAKE_OPT) --prefix=$(INSTALL_PREFIX) --baseinstalldir=$(INSTALL_LIBDIR)/fpc/$(FPC_VERSION) $(FPMAKE_INSTALL_OPT) -ie + $(LOCALFPMAKE) install $(FPMAKE_OPT) --prefix=$(INSTALL_PREFIX) --baseinstalldir=$(INSTALL_LIBDIR)/fpc/$(FPC_VERSION) $(FPMAKE_INSTALL_OPT) -ie -fsp 0 else - $(LOCALFPMAKE) install $(FPMAKE_OPT) --prefix=$(INSTALL_BASEDIR) $(FPMAKE_INSTALL_OPT) -ie + $(LOCALFPMAKE) install $(FPMAKE_OPT) --prefix=$(INSTALL_BASEDIR) --baseinstalldir=$(INSTALL_BASEDIR) $(FPMAKE_INSTALL_OPT) -ie -fsp 0 endif -zipinstall: fpmake +zipinstall: fpmake$(SRCEXEEXT) $(LOCALFPMAKE) zipinstall $(FPMAKE_OPT) --zipprefix=$(DIST_DESTDIR)/$(ZIPPREFIX) -zipdistinstall: fpmake - $(LOCALFPMAKE) zipinstall $(FPMAKE_OPT) --zipprefix=$(DIST_DESTDIR)/$(ZIPPREFIX) -ie +zipdistinstall: fpmake$(SRCEXEEXT) + $(LOCALFPMAKE) zipinstall $(FPMAKE_OPT) --zipprefix=$(DIST_DESTDIR)/$(ZIPPREFIX) -ie -fsp 0 +zipsourceinstall: fpmake$(SRCEXEEXT) +ifdef UNIXHier + $(LOCALFPMAKE) archive $(FPMAKE_OPT) --zipprefix=$(DIST_DESTDIR)/$(ZIPPREFIX) --prefix=share/src/fpc-\$$\(PACKAGEVERSION\)/$(INSTALL_FPCSUBDIR)/\$$\(PACKAGEDIRECTORY\) +else + $(LOCALFPMAKE) archive $(FPMAKE_OPT) --zipprefix=$(DIST_DESTDIR)/$(ZIPPREFIX) --prefix=source\\$(INSTALL_FPCSUBDIR)\\\$$\(PACKAGEDIRECTORY\) +endif diff --git a/ide/Makefile.fpc.fpcmake b/ide/Makefile.fpc.fpcmake index 3ab4ec31d8..3e331dec4e 100644 --- a/ide/Makefile.fpc.fpcmake +++ b/ide/Makefile.fpc.fpcmake @@ -6,7 +6,7 @@ [package] name=ide -version=2.7.1 +version=3.1.1 [target] dirs=compiler diff --git a/ide/compiler/Makefile b/ide/compiler/Makefile index fd728ffa91..6ae5b9efbc 100644 --- a/ide/compiler/Makefile +++ b/ide/compiler/Makefile @@ -1,9 +1,9 @@ # -# Don't edit, this file is generated by FPCMake Version 2.0.0 [2014-02-06 rev 26692] +# Don't edit, this file is generated by FPCMake Version 2.0.0 [2014-12-07 rev 29213] # 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 i386-nativent i386-iphonesim i386-android 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 powerpc-wii powerpc-aix sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-netbsd x86_64-solaris x86_64-openbsd 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 arm-android powerpc64-linux powerpc64-darwin powerpc64-embedded powerpc64-aix avr-embedded armeb-linux armeb-embedded mips-linux mipsel-linux mipsel-android jvm-java jvm-android i8086-msdos -BSDs = freebsd netbsd openbsd darwin +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 i386-nativent i386-iphonesim i386-android i386-aros 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 powerpc-wii powerpc-aix sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-netbsd x86_64-solaris x86_64-openbsd x86_64-darwin x86_64-win64 x86_64-embedded x86_64-dragonfly arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian arm-android powerpc64-linux powerpc64-darwin powerpc64-embedded powerpc64-aix avr-embedded armeb-linux armeb-embedded mips-linux mipsel-linux mipsel-embedded mipsel-android jvm-java jvm-android i8086-msdos +BSDs = freebsd netbsd openbsd darwin dragonfly UNIXs = linux $(BSDs) solaris qnx haiku aix LIMIT83fs = go32v2 os2 emx watcom msdos OSNeedsComspecToRunBatch = go32v2 watcom @@ -184,6 +184,12 @@ $(error When compiling for arm-embedded, a sub-architecture (e.g. SUBARCH=armv4t endif override FPCOPT+=-Cp$(SUBARCH) endif +ifeq ($(FULL_TARGET),mipsel-embedded) +ifeq ($(SUBARCH),) +$(error When compiling for mipsel-embedded, a sub-architecture (e.g. SUBARCH=pic32mx) must be defined) +endif +override FPCOPT+=-Cp$(SUBARCH) +endif ifneq ($(findstring $(OS_SOURCE),$(LIMIT83fs)),) TARGETSUFFIX=$(OS_TARGET) SOURCESUFFIX=$(OS_SOURCE) @@ -418,6 +424,9 @@ endif ifeq ($(FULL_TARGET),i386-android) override TARGET_UNITS+=compunit endif +ifeq ($(FULL_TARGET),i386-aros) +override TARGET_UNITS+=compunit +endif ifeq ($(FULL_TARGET),m68k-linux) override TARGET_UNITS+=compunit endif @@ -505,6 +514,9 @@ endif ifeq ($(FULL_TARGET),x86_64-embedded) override TARGET_UNITS+=compunit endif +ifeq ($(FULL_TARGET),x86_64-dragonfly) +override TARGET_UNITS+=compunit +endif ifeq ($(FULL_TARGET),arm-linux) override TARGET_UNITS+=compunit endif @@ -559,6 +571,9 @@ endif ifeq ($(FULL_TARGET),mipsel-linux) override TARGET_UNITS+=compunit endif +ifeq ($(FULL_TARGET),mipsel-embedded) +override TARGET_UNITS+=compunit +endif ifeq ($(FULL_TARGET),mipsel-android) override TARGET_UNITS+=compunit endif @@ -641,6 +656,9 @@ endif ifeq ($(FULL_TARGET),i386-android) override COMPILER_OPTIONS+=-Ur -dNOCATCH endif +ifeq ($(FULL_TARGET),i386-aros) +override COMPILER_OPTIONS+=-Ur -dNOCATCH +endif ifeq ($(FULL_TARGET),m68k-linux) override COMPILER_OPTIONS+=-Ur -dNOCATCH endif @@ -728,6 +746,9 @@ endif ifeq ($(FULL_TARGET),x86_64-embedded) override COMPILER_OPTIONS+=-Ur -dNOCATCH endif +ifeq ($(FULL_TARGET),x86_64-dragonfly) +override COMPILER_OPTIONS+=-Ur -dNOCATCH +endif ifeq ($(FULL_TARGET),arm-linux) override COMPILER_OPTIONS+=-Ur -dNOCATCH endif @@ -782,6 +803,9 @@ endif ifeq ($(FULL_TARGET),mipsel-linux) override COMPILER_OPTIONS+=-Ur -dNOCATCH endif +ifeq ($(FULL_TARGET),mipsel-embedded) +override COMPILER_OPTIONS+=-Ur -dNOCATCH +endif ifeq ($(FULL_TARGET),mipsel-android) override COMPILER_OPTIONS+=-Ur -dNOCATCH endif @@ -863,6 +887,9 @@ endif ifeq ($(FULL_TARGET),i386-android) override COMPILER_INCLUDEDIR+=$(COMPILERDIR) $(COMPILERDIR)/$(PPC_TARGET) endif +ifeq ($(FULL_TARGET),i386-aros) +override COMPILER_INCLUDEDIR+=$(COMPILERDIR) $(COMPILERDIR)/$(PPC_TARGET) +endif ifeq ($(FULL_TARGET),m68k-linux) override COMPILER_INCLUDEDIR+=$(COMPILERDIR) $(COMPILERDIR)/$(PPC_TARGET) endif @@ -950,6 +977,9 @@ endif ifeq ($(FULL_TARGET),x86_64-embedded) override COMPILER_INCLUDEDIR+=$(COMPILERDIR) $(COMPILERDIR)/$(PPC_TARGET) endif +ifeq ($(FULL_TARGET),x86_64-dragonfly) +override COMPILER_INCLUDEDIR+=$(COMPILERDIR) $(COMPILERDIR)/$(PPC_TARGET) +endif ifeq ($(FULL_TARGET),arm-linux) override COMPILER_INCLUDEDIR+=$(COMPILERDIR) $(COMPILERDIR)/$(PPC_TARGET) endif @@ -1004,6 +1034,9 @@ endif ifeq ($(FULL_TARGET),mipsel-linux) override COMPILER_INCLUDEDIR+=$(COMPILERDIR) $(COMPILERDIR)/$(PPC_TARGET) endif +ifeq ($(FULL_TARGET),mipsel-embedded) +override COMPILER_INCLUDEDIR+=$(COMPILERDIR) $(COMPILERDIR)/$(PPC_TARGET) +endif ifeq ($(FULL_TARGET),mipsel-android) override COMPILER_INCLUDEDIR+=$(COMPILERDIR) $(COMPILERDIR)/$(PPC_TARGET) endif @@ -1085,6 +1118,9 @@ endif ifeq ($(FULL_TARGET),i386-android) override COMPILER_UNITDIR+=$(COMPILERDIR) $(COMPILERDIR)/$(PPC_TARGET) $(COMPILERDIR)/targets $(COMPILERDIR)/systems endif +ifeq ($(FULL_TARGET),i386-aros) +override COMPILER_UNITDIR+=$(COMPILERDIR) $(COMPILERDIR)/$(PPC_TARGET) $(COMPILERDIR)/targets $(COMPILERDIR)/systems +endif ifeq ($(FULL_TARGET),m68k-linux) override COMPILER_UNITDIR+=$(COMPILERDIR) $(COMPILERDIR)/$(PPC_TARGET) $(COMPILERDIR)/targets $(COMPILERDIR)/systems endif @@ -1172,6 +1208,9 @@ endif ifeq ($(FULL_TARGET),x86_64-embedded) override COMPILER_UNITDIR+=$(COMPILERDIR) $(COMPILERDIR)/$(PPC_TARGET) $(COMPILERDIR)/targets $(COMPILERDIR)/systems endif +ifeq ($(FULL_TARGET),x86_64-dragonfly) +override COMPILER_UNITDIR+=$(COMPILERDIR) $(COMPILERDIR)/$(PPC_TARGET) $(COMPILERDIR)/targets $(COMPILERDIR)/systems +endif ifeq ($(FULL_TARGET),arm-linux) override COMPILER_UNITDIR+=$(COMPILERDIR) $(COMPILERDIR)/$(PPC_TARGET) $(COMPILERDIR)/targets $(COMPILERDIR)/systems endif @@ -1226,6 +1265,9 @@ endif ifeq ($(FULL_TARGET),mipsel-linux) override COMPILER_UNITDIR+=$(COMPILERDIR) $(COMPILERDIR)/$(PPC_TARGET) $(COMPILERDIR)/targets $(COMPILERDIR)/systems endif +ifeq ($(FULL_TARGET),mipsel-embedded) +override COMPILER_UNITDIR+=$(COMPILERDIR) $(COMPILERDIR)/$(PPC_TARGET) $(COMPILERDIR)/targets $(COMPILERDIR)/systems +endif ifeq ($(FULL_TARGET),mipsel-android) override COMPILER_UNITDIR+=$(COMPILERDIR) $(COMPILERDIR)/$(PPC_TARGET) $(COMPILERDIR)/targets $(COMPILERDIR)/systems endif @@ -1480,6 +1522,12 @@ EXEEXT= HASSHAREDLIB=1 SHORTSUFFIX=lnx endif +ifeq ($(OS_TARGET),dragonfly) +BATCHEXT=.sh +EXEEXT= +HASSHAREDLIB=1 +SHORTSUFFIX=df +endif ifeq ($(OS_TARGET),freebsd) BATCHEXT=.sh EXEEXT= @@ -1525,6 +1573,11 @@ EXEEXT= SHAREDLIBEXT=.library SHORTSUFFIX=amg endif +ifeq ($(OS_TARGET),aros) +EXEEXT= +SHAREDLIBEXT=.library +SHORTSUFFIX=aros +endif ifeq ($(OS_TARGET),morphos) EXEEXT= SHAREDLIBEXT=.library @@ -1946,6 +1999,9 @@ endif ifeq ($(FULL_TARGET),i386-android) REQUIRE_PACKAGES_RTL=1 endif +ifeq ($(FULL_TARGET),i386-aros) +REQUIRE_PACKAGES_RTL=1 +endif ifeq ($(FULL_TARGET),m68k-linux) REQUIRE_PACKAGES_RTL=1 endif @@ -2033,6 +2089,9 @@ endif ifeq ($(FULL_TARGET),x86_64-embedded) REQUIRE_PACKAGES_RTL=1 endif +ifeq ($(FULL_TARGET),x86_64-dragonfly) +REQUIRE_PACKAGES_RTL=1 +endif ifeq ($(FULL_TARGET),arm-linux) REQUIRE_PACKAGES_RTL=1 endif @@ -2087,6 +2146,9 @@ endif ifeq ($(FULL_TARGET),mipsel-linux) REQUIRE_PACKAGES_RTL=1 endif +ifeq ($(FULL_TARGET),mipsel-embedded) +REQUIRE_PACKAGES_RTL=1 +endif ifeq ($(FULL_TARGET),mipsel-android) REQUIRE_PACKAGES_RTL=1 endif @@ -2250,7 +2312,7 @@ endif ifdef CREATESHARED override FPCOPT+=-Cg endif -ifneq ($(findstring $(OS_TARGET),freebsd openbsd netbsd linux solaris),) +ifneq ($(findstring $(OS_TARGET),dragonfly freebsd openbsd netbsd linux solaris),) ifeq ($(CPU_TARGET),x86_64) override FPCOPT+=-Cg endif @@ -2280,17 +2342,23 @@ ifdef ACROSSCOMPILE override FPCOPT+=$(CROSSOPT) endif override COMPILER:=$(strip $(FPC) $(FPCOPT)) -ifeq (,$(findstring -s ,$(COMPILER))) +ifneq (,$(findstring -sh ,$(COMPILER))) +UseEXECPPAS=1 +endif +ifneq (,$(findstring -s ,$(COMPILER))) +ifeq ($(FULL_SOURCE),$(FULL_TARGET)) +UseEXECPPAS=1 +endif +endif +ifneq ($(UseEXECPPAS),1) EXECPPAS= else -ifeq ($(FULL_SOURCE),$(FULL_TARGET)) ifdef RUNBATCH EXECPPAS:=@$(RUNBATCH) $(PPAS) else EXECPPAS:=@$(PPAS) endif endif -endif .PHONY: fpc_units ifneq ($(TARGET_UNITS)$(TARGET_IMPLICITUNITS),) override ALLTARGET+=fpc_units diff --git a/ide/fakegdb/Makefile b/ide/fakegdb/Makefile index f6a93407bd..5340eddc66 100644 --- a/ide/fakegdb/Makefile +++ b/ide/fakegdb/Makefile @@ -1,9 +1,9 @@ # -# Don't edit, this file is generated by FPCMake Version 2.0.0 [2014-02-06 rev 26692] +# Don't edit, this file is generated by FPCMake Version 2.0.0 [2014-12-07 rev 29213] # 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 i386-nativent i386-iphonesim i386-android 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 powerpc-wii powerpc-aix sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-netbsd x86_64-solaris x86_64-openbsd 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 arm-android powerpc64-linux powerpc64-darwin powerpc64-embedded powerpc64-aix avr-embedded armeb-linux armeb-embedded mips-linux mipsel-linux mipsel-android jvm-java jvm-android i8086-msdos -BSDs = freebsd netbsd openbsd darwin +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 i386-nativent i386-iphonesim i386-android i386-aros 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 powerpc-wii powerpc-aix sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-netbsd x86_64-solaris x86_64-openbsd x86_64-darwin x86_64-win64 x86_64-embedded x86_64-dragonfly arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian arm-android powerpc64-linux powerpc64-darwin powerpc64-embedded powerpc64-aix avr-embedded armeb-linux armeb-embedded mips-linux mipsel-linux mipsel-embedded mipsel-android jvm-java jvm-android i8086-msdos +BSDs = freebsd netbsd openbsd darwin dragonfly UNIXs = linux $(BSDs) solaris qnx haiku aix LIMIT83fs = go32v2 os2 emx watcom msdos OSNeedsComspecToRunBatch = go32v2 watcom @@ -184,6 +184,12 @@ $(error When compiling for arm-embedded, a sub-architecture (e.g. SUBARCH=armv4t endif override FPCOPT+=-Cp$(SUBARCH) endif +ifeq ($(FULL_TARGET),mipsel-embedded) +ifeq ($(SUBARCH),) +$(error When compiling for mipsel-embedded, a sub-architecture (e.g. SUBARCH=pic32mx) must be defined) +endif +override FPCOPT+=-Cp$(SUBARCH) +endif ifneq ($(findstring $(OS_SOURCE),$(LIMIT83fs)),) TARGETSUFFIX=$(OS_TARGET) SOURCESUFFIX=$(OS_SOURCE) @@ -390,6 +396,9 @@ endif ifeq ($(FULL_TARGET),i386-android) override TARGET_UNITS+=gdbcon gdbint endif +ifeq ($(FULL_TARGET),i386-aros) +override TARGET_UNITS+=gdbcon gdbint +endif ifeq ($(FULL_TARGET),m68k-linux) override TARGET_UNITS+=gdbcon gdbint endif @@ -477,6 +486,9 @@ endif ifeq ($(FULL_TARGET),x86_64-embedded) override TARGET_UNITS+=gdbcon gdbint endif +ifeq ($(FULL_TARGET),x86_64-dragonfly) +override TARGET_UNITS+=gdbcon gdbint +endif ifeq ($(FULL_TARGET),arm-linux) override TARGET_UNITS+=gdbcon gdbint endif @@ -531,6 +543,9 @@ endif ifeq ($(FULL_TARGET),mipsel-linux) override TARGET_UNITS+=gdbcon gdbint endif +ifeq ($(FULL_TARGET),mipsel-embedded) +override TARGET_UNITS+=gdbcon gdbint +endif ifeq ($(FULL_TARGET),mipsel-android) override TARGET_UNITS+=gdbcon gdbint endif @@ -786,6 +801,12 @@ EXEEXT= HASSHAREDLIB=1 SHORTSUFFIX=lnx endif +ifeq ($(OS_TARGET),dragonfly) +BATCHEXT=.sh +EXEEXT= +HASSHAREDLIB=1 +SHORTSUFFIX=df +endif ifeq ($(OS_TARGET),freebsd) BATCHEXT=.sh EXEEXT= @@ -831,6 +852,11 @@ EXEEXT= SHAREDLIBEXT=.library SHORTSUFFIX=amg endif +ifeq ($(OS_TARGET),aros) +EXEEXT= +SHAREDLIBEXT=.library +SHORTSUFFIX=aros +endif ifeq ($(OS_TARGET),morphos) EXEEXT= SHAREDLIBEXT=.library @@ -1252,6 +1278,9 @@ endif ifeq ($(FULL_TARGET),i386-android) REQUIRE_PACKAGES_RTL=1 endif +ifeq ($(FULL_TARGET),i386-aros) +REQUIRE_PACKAGES_RTL=1 +endif ifeq ($(FULL_TARGET),m68k-linux) REQUIRE_PACKAGES_RTL=1 endif @@ -1339,6 +1368,9 @@ endif ifeq ($(FULL_TARGET),x86_64-embedded) REQUIRE_PACKAGES_RTL=1 endif +ifeq ($(FULL_TARGET),x86_64-dragonfly) +REQUIRE_PACKAGES_RTL=1 +endif ifeq ($(FULL_TARGET),arm-linux) REQUIRE_PACKAGES_RTL=1 endif @@ -1393,6 +1425,9 @@ endif ifeq ($(FULL_TARGET),mipsel-linux) REQUIRE_PACKAGES_RTL=1 endif +ifeq ($(FULL_TARGET),mipsel-embedded) +REQUIRE_PACKAGES_RTL=1 +endif ifeq ($(FULL_TARGET),mipsel-android) REQUIRE_PACKAGES_RTL=1 endif @@ -1556,7 +1591,7 @@ endif ifdef CREATESHARED override FPCOPT+=-Cg endif -ifneq ($(findstring $(OS_TARGET),freebsd openbsd netbsd linux solaris),) +ifneq ($(findstring $(OS_TARGET),dragonfly freebsd openbsd netbsd linux solaris),) ifeq ($(CPU_TARGET),x86_64) override FPCOPT+=-Cg endif @@ -1586,17 +1621,23 @@ ifdef ACROSSCOMPILE override FPCOPT+=$(CROSSOPT) endif override COMPILER:=$(strip $(FPC) $(FPCOPT)) -ifeq (,$(findstring -s ,$(COMPILER))) +ifneq (,$(findstring -sh ,$(COMPILER))) +UseEXECPPAS=1 +endif +ifneq (,$(findstring -s ,$(COMPILER))) +ifeq ($(FULL_SOURCE),$(FULL_TARGET)) +UseEXECPPAS=1 +endif +endif +ifneq ($(UseEXECPPAS),1) EXECPPAS= else -ifeq ($(FULL_SOURCE),$(FULL_TARGET)) ifdef RUNBATCH EXECPPAS:=@$(RUNBATCH) $(PPAS) else EXECPPAS:=@$(PPAS) endif endif -endif .PHONY: fpc_units ifneq ($(TARGET_UNITS)$(TARGET_IMPLICITUNITS),) override ALLTARGET+=fpc_units diff --git a/ide/fp.pas b/ide/fp.pas index 3ebb44b5b5..f1de80bf15 100644 --- a/ide/fp.pas +++ b/ide/fp.pas @@ -328,15 +328,23 @@ procedure InitCompilerSwitches; default_settings.localswitches:=[cs_typed_const_writable]; end; - +{$IFDEF HASAMIGA} +procedure SetAmigaWindowTitle; +begin + { window title first, then screen title, shown when the window is active } + Video.SetWindowTitle( + 'Free Pascal IDE', + 'Free Pascal IDE '+VersionStr+' ['+{$i %date%}+'] - Compiler '+Full_Version_String); +end; +{$ENDIF} {The square bullet needs an MS-DOS code page. On Unix it is for sure the code page is not available before video is initialized. (And only in certain circumstances after that, so, use a plain ascii character as bullet on Unix.)} -{$if defined(unix) or defined(amiga) or defined(morphos)} +{$if defined(unix) or defined(HASAMIGA)} const bullet='*'; {$else} -const bullet='þ'; +const bullet=#254; {$endif} BEGIN @@ -424,6 +432,10 @@ BEGIN from command line PM } ParseUserScreen; +{$IFDEF HASAMIGA} + SetAmigaWindowTitle; +{$ENDIF} + { Update IDE } IDEApp.Update; IDEApp.UpdateMode; diff --git a/ide/fpconst.pas b/ide/fpconst.pas index 113343edf4..1d1f223507 100644 --- a/ide/fpconst.pas +++ b/ide/fpconst.pas @@ -31,24 +31,35 @@ const CompilerStatusUpdateDelay = 0.1; { in secs } {$undef USE_SPECIAL_BASENAME} -{$ifdef m68k} - {$ifdef cpui386} - {$define USE_SPECIAL_BASENAME} - FPBaseName = 'fpm68k'; - {$endif cpui386} -{$endif m68k} -{$ifdef powerpc} - {$ifdef cpui386} - {$define USE_SPECIAL_BASENAME} - FPBaseName = 'fpppc'; - {$endif powerpc} -{$endif m68k} -{$ifdef i386} - {$ifdef cpu68k} - {$define USE_SPECIAL_BASENAME} - FPBaseName = 'fpi386'; - {$endif cpu68k} -{$endif i386} +{$ifdef USE_FPBASENAME} + { FPBaseName set through environment variable FPBASENAME } + FPBaseName = {$i %FPBASENAME%}; + {$define USE_SPECIAL_BASENAME} +{$else} + {$ifdef m68k} + {$ifdef cpui386} + {$define USE_SPECIAL_BASENAME} + FPBaseName = 'fpm68k'; + {$endif cpui386} + {$endif m68k} + {$ifdef powerpc} + {$ifdef cpui386} + {$define USE_SPECIAL_BASENAME} + FPBaseName = 'fpppc'; + {$endif powerpc} + {$endif m68k} + {$ifdef i386} + {$ifdef cpu68k} + {$define USE_SPECIAL_BASENAME} + FPBaseName = 'fpi386'; + {$endif cpu68k} + {$endif i386} + {$ifdef SUPPORT_REMOTE} + {$define USE_SPECIAL_BASENAME} + { this uses PPC_TARGET env. variable from Makefile } + FPBaseName = 'fp_'+{$i %PPC_TARGET%}; + {$endif SUPPORT_REMOTE} +{$endif not USE_FPBASENAME} {$ifndef USE_SPECIAL_BASENAME} FPBaseName = 'fp'; {$endif not USE_SPECIAL_BASENAME} diff --git a/ide/fpdebug.pas b/ide/fpdebug.pas index a4caf9b9b5..6222d44999 100644 --- a/ide/fpdebug.pas +++ b/ide/fpdebug.pas @@ -54,7 +54,10 @@ type TBreakNumber : longint; FPCBreakErrorNumber : longint; {$ifdef SUPPORT_REMOTE} - isRemoteDebugging:boolean; + isRemoteDebugging, + isFirstRemote, + isConnectedToRemote, + usessh :boolean; {$endif SUPPORT_REMOTE} constructor Init; procedure SetExe(const exefn:string); @@ -330,6 +333,9 @@ procedure RegisterFPDebugViews; procedure UpdateDebugViews; +{$ifdef SUPPORT_REMOTE} +function TransformRemoteString(st : string) : string; +{$endif SUPPORT_REMOTE} implementation @@ -339,7 +345,7 @@ uses {$ifdef DOS} fpusrscr, {$endif DOS} - + fpredir, App,Strings, FVConsts, MsgBox, @@ -350,7 +356,7 @@ uses termio, {$endif Unix} Systems,Globals, - FPRegs, + FPRegs,FPTools, FPVars,FPUtils,FPConst,FPSwitch, FPIntf,FPCompil,FPIde,FPHelp, Validate,WUtils,Wconsts; @@ -615,7 +621,8 @@ procedure UpdateDebugViews; begin {$ifdef SUPPORT_REMOTE} - if isRemoteDebugging then + if assigned(Debugger) and + Debugger^.isRemoteDebugging then PushStatus(msg_getting_info_on+RemoteMachine); {$endif SUPPORT_REMOTE} DeskTop^.Lock; @@ -633,7 +640,8 @@ procedure UpdateDebugViews; VectorWindow^.Update; DeskTop^.UnLock; {$ifdef SUPPORT_REMOTE} - if isRemoteDebugging then + if assigned(Debugger) and + Debugger^.isRemoteDebugging then PopStatus; {$endif SUPPORT_REMOTE} end; @@ -652,6 +660,13 @@ begin switch_to_user:=true; GetDir(0,OrigPwd); Command('set print object off'); +{$ifdef SUPPORT_REMOTE} + isFirstRemote:=true; +{$ifdef FPC_ARMEL32} + { GDB needs advice on exact file type } + Command('set gnutarget elf32-littlearm'); +{$endif FPC_ARMEL32} +{$endif SUPPORT_REMOTE} end; procedure TDebugController.SetExe(const exefn:string); @@ -815,18 +830,22 @@ const TargetProtocol = 'palmos'; {$else} const - TargetProtocol = 'remote'; + TargetProtocol = 'extended-remote'; {$endif PALMOSGDB} {$ifdef SUPPORT_REMOTE} var S,ErrorStr : string; + ErrorVal : longint; {$endif SUPPORT_REMOTE} begin ResetBreakpointsValues; {$ifdef SUPPORT_REMOTE} NoSwitch:=true; isRemoteDebugging:=false; + if TargetProtocol<>'extended-remote' then + isConnectedToRemote:=false; + usessh:=true; {$ifndef CROSSGDB} If (RemoteMachine<>'') and (RemotePort<>'') then {$else CROSSGDB} @@ -834,7 +853,38 @@ begin {$endif CROSSGDB} begin isRemoteDebugging:=true; - S:=RemoteMachine; + if UseSsh and not isConnectedToRemote then + begin + s:=TransformRemoteString(RemoteSshExecCommand); + PushStatus(S); +{$ifdef Unix} + error:=0; + { return without waiting for the function to end } + s:= s+' &'; + If fpsystem(s)=-1 Then + ErrorVal:=fpgeterrno; +{$else} + IDEApp.DoExecute(GetEnv('COMSPEC'),'/C '+s,'','ssh__.out','ssh___.err',exNormal); + ErrorVal:=DosError; +{$endif} + PopStatus; + // if errorval <> 0 then + // AdvMessageBoxRect(var R: TRect; const Msg: String; Params: Pointer; AOptions: longint): Word; + AddToolMessage('',#3'Start'#13#3+s+#13#3'returned '+ + IntToStr(Errorval),0,0); + + end + else if not UseSsh then + begin + s:=TransformRemoteString(RemoteExecCommand); + MessageBox(#3'Start in remote'#13#3+s,nil,mfOKbutton); + end; + if usessh then + { we use ssh port redirection } + S:='localhost' + //S:=TransformRemoteString('$REMOTEMACHINE') + else + S:=RemoteMachine; If pos('@',S)>0 then S:=copy(S,pos('@',S)+1,High(S)); If RemotePort<>'' then @@ -845,16 +895,19 @@ begin S:='localhost:2000'; {$endif PALMOSGDB} PushStatus(msg_connectingto+S); - Command('target '+TargetProtocol+' '+S); + AddToolMessage('',msg_connectingto+S,0,0); + UpdateToolMessages; + if not isConnectedToRemote then + Command('target '+TargetProtocol+' '+S); if Error then begin ErrorStr:=strpas(GetError); ErrorBox(#3'Error in "target '+TargetProtocol+'"'#13#3+ErrorStr,nil); PopStatus; exit; - end; - s:=IDEApp.GetRemoteExecString; - MessageBox(#3'Start in remote'#13#3+s,nil,mfOKbutton); + end + else + isConnectedToRemote:=true; PopStatus; end else @@ -910,17 +963,24 @@ begin GDBWindow^.Editor^.Lock; {$ifdef SUPPORT_REMOTE} if isRemoteDebugging then - begin - inc(init_count); - { pass the stop in start code } - Command('continue'); - end else + begin + inc(init_count); + { pass the stop in start code } + if isFirstRemote then + Command('continue') + else + Command ('start'); + isFirstRemote:=false; + end + else {$endif SUPPORT_REMOTE} - { Set cwd for debuggee } - SetDir(GetRunDir); - inherited Run; - { Restore cwd for IDE } - SetDir(StartupDir); + begin + { Set cwd for debuggee } + SetDir(GetRunDir); + inherited Run; + { Restore cwd for IDE } + SetDir(StartupDir); + end; DebuggerScreen; If assigned(GDBWindow) then GDBWindow^.Editor^.UnLock; @@ -1093,6 +1153,15 @@ procedure TDebugController.Reset; var old_reset : boolean; begin +{$ifdef SUPPORT_REMOTE} + if isConnectedToRemote then + begin + Command('monitor exit'); + Command('disconnect'); + isConnectedToRemote:=false; + isFirstRemote:=true; + end; +{$endif SUPPORT_REMOTE} inherited Reset; { we need to free the executable if we want to recompile it } @@ -3618,6 +3687,48 @@ end; inherited done; end; + + +{$ifdef SUPPORT_REMOTE} +{**************************************************************************** + TransformRemoteString +****************************************************************************} +function TransformRemoteString(st : string) : string; +begin + If RemoteConfig<>'' then + ReplaceStrI(St,'$CONFIG','-F '+RemoteConfig) + else + ReplaceStrI(St,'$CONFIG',''); + If RemoteIdent<>'' then + ReplaceStrI(St,'$IDENT','-i '+RemoteIdent) + else + ReplaceStrI(St,'$IDENT',''); + If RemotePuttySession<>'' then + ReplaceStrI(St,'$PUTTYSESSION','-load '+RemotePuttySession) + else + ReplaceStrI(St,'$PUTTYSESSION',''); + ReplaceStrI(St,'$LOCALFILENAME',NameAndExtOf(ExeFile)); + ReplaceStrI(St,'$LOCALFILE',ExeFile); + ReplaceStrI(St,'$REMOTEDIR',RemoteDir); + ReplaceStrI(St,'$REMOTEPORT',RemotePort); + ReplaceStrI(St,'$REMOTEMACHINE',RemoteMachine); + ReplaceStrI(St,'$REMOTEGDBSERVER',maybequoted(remotegdbserver)); + ReplaceStrI(St,'$REMOTECOPY',maybequoted(RemoteCopy)); + ReplaceStrI(St,'$REMOTESHELL',maybequoted(RemoteShell)); + { avoid infinite recursion here !!! } + if Pos('$REMOTEEXECCOMMAND',UpcaseSTr(St))>0 then + ReplaceStrI(St,'$REMOTEEXECCOMMAND',TransformRemoteString(RemoteExecCommand)); +{$ifdef WINDOWS} + ReplaceStrI(St,'$START','start "Shell to remote"'); + ReplaceStrI(St,'$DOITINBACKGROUND',''); +{$else} + ReplaceStrI(St,'$START',''); + ReplaceStrI(St,'$DOITINBACKGROUND',' &'); +{$endif} + TransformRemoteString:=st; +end; +{$endif SUPPORT_REMOTE} + {**************************************************************************** Init/Final ****************************************************************************} diff --git a/ide/fphelp.pas b/ide/fphelp.pas index aafc1b8fa9..3315790e29 100644 --- a/ide/fphelp.pas +++ b/ide/fphelp.pas @@ -115,8 +115,18 @@ const hint_editcut = 'Remove the selected text and put it in the clipboard'; hint_editcopy = 'Copy the selected text in the clipboard'; hint_editpaste = 'Insert selected text from the clipboard at the cursor position'; + {$ifdef HASAMIGA} + {$ifdef AROS} + hint_editcopywin = 'Copy the selected text in AROS clipboard'; + hint_editpastewin = 'Insert selected text from AROS clipboard at the cursor position'; + {$else} + hint_editcopywin = 'Copy the selected text to the system clipboard'; + hint_editpastewin = 'Insert selected text from the system clipboard at the cursor position'; + {$endif} + {$else} hint_editcopywin = 'Copy the selected text in windows clipboard'; hint_editpastewin = 'Insert selected text from windows clipboard at the cursor position'; + {$endif} hint_editclear = 'Delete the selected text'; hint_editselectall = 'Select the whole text'; hint_editunselect = 'Unselect everything'; diff --git a/ide/fpide.pas b/ide/fpide.pas index dacea17928..2d89e5ec3c 100644 --- a/ide/fpide.pas +++ b/ide/fpide.pas @@ -235,8 +235,18 @@ resourcestring menu_local_gotosource = '~G~oto source'; menu_file_exit = 'E~x~it'; menu_edit = '~E~dit'; + {$ifdef HASAMIGA} + {$ifdef AROS} + menu_edit_copywin = 'Cop~y~ to AROS'; + menu_edit_pastewin = 'Paste from A~R~OS'; + {$else} + menu_edit_copywin = 'Cop~y~ to System'; + menu_edit_pastewin = 'Paste from Syste~m~'; + {$endif} + {$else} menu_edit_copywin = 'Cop~y~ to Windows'; menu_edit_pastewin = 'Paste from ~W~indows'; + {$endif} menu_edit_undo = '~U~ndo'; menu_edit_redo = '~R~edo'; menu_edit_cut = 'Cu~t~'; @@ -380,6 +390,8 @@ resourcestring menu_local_gotosource = '~G~oto source'; menu_key_edit_copy_microsoft = menu_key_common_copy_microsoft; menu_key_edit_paste_microsoft = 'Ctrl+V'; menu_key_edit_clear = 'Ctrl+Del'; + menu_key_edit_all_microsoft = 'Ctrl+A'; + menu_key_edit_all_borland = ''; menu_key_run_run = 'Ctrl+F9'; menu_key_run_stepover = 'F8'; @@ -572,9 +584,12 @@ resourcestring menu_local_gotosource = '~G~oto source'; label_remote_dir = 'Remote ~d~irectory'; label_remote_config = 'Remote config ~o~ptions'; label_remote_ident = 'Remote ~i~dent'; - label_remote_command = 'Remote ~c~ommand'; - label_remote_scp = 'Scp executable'; - label_remote_ssh = 'Ssh executable'; + label_remote_send_command = 'Remote ~S~end command'; + label_remote_exec_command = 'Remote ~E~xec command'; + label_remote_ssh_exec_command = 'Remote Ss~h~ exec command'; + label_remote_copy = 'Remote copy executable'; + label_remote_shell = 'Remote shell executable'; + label_remote_gdbserver = 'Remote gdbserver executable'; {Directories dialog.} dialog_directories = 'Directories'; @@ -878,7 +893,7 @@ begin NewItem(menu_edit_copy,menu_key_edit_copy, copy_key, cmCopy, hcCopy, NewItem(menu_edit_paste,menu_key_edit_paste, paste_key, cmPaste, hcPaste, NewItem(menu_edit_clear,menu_key_edit_clear, kbCtrlDel, cmClear, hcClear, - NewItem(menu_edit_selectall,'', kbNoKey, cmSelectAll, hcSelectAll, + NewItem(menu_edit_selectall,menu_key_edit_all, all_Key, cmSelectAll, hcSelectAll, NewItem(menu_edit_unselect,'', kbNoKey, cmUnselect, hcUnselect, NewLine( NewItem(menu_edit_showclipboard,'', kbNoKey, cmShowClipboard, hcShowClipboard, @@ -1041,20 +1056,24 @@ begin menu_key_edit_cut:=menu_key_edit_cut_microsoft; menu_key_edit_copy:=menu_key_edit_copy_microsoft; menu_key_edit_paste:=menu_key_edit_paste_microsoft; + menu_key_edit_all:=menu_key_edit_all_microsoft; menu_key_hlplocal_copy:=menu_key_hlplocal_copy_microsoft; cut_key:=kbCtrlX; copy_key:=kbCtrlC; paste_key:=kbCtrlV; + all_key:=kbCtrlA; end; ekm_borland: begin menu_key_edit_cut:=menu_key_edit_cut_borland; menu_key_edit_copy:=menu_key_edit_copy_borland; menu_key_edit_paste:=menu_key_edit_paste_borland; + menu_key_edit_all:=menu_key_edit_all_borland; menu_key_hlplocal_copy:=menu_key_hlplocal_copy_borland; cut_key:=kbShiftDel; copy_key:=kbCtrlIns; paste_key:=kbShiftIns; + all_key:=kbNoKey; end; end; loadmenubar; @@ -1468,7 +1487,6 @@ begin if Assigned(UserScreen) then UserScreen^.SwitchBackToIDEScreen; - Video.SetCursorType(crHidden); {$ifdef Windows} { This message was sent when the VideoBuffer was smaller than was the IdeApp thought => writes to random memory and random crashes... PM } @@ -1543,7 +1561,9 @@ begin Writeln('Running "'+ProgramPath+' '+Params+'"'); { DO NOT use COMSPEC for exe files as the ExitCode is lost in those cases PM } - +{$ifdef HASAMIGA} + DosExecute(ProgramPath, Params); +{$else} {$ifndef Unix} posexe:=Pos('.EXE',UpCaseStr(ProgramPath)); { if programpath was three char long => bug } @@ -1570,6 +1590,7 @@ begin InFile,OutFile,ErrFile); end; {$endif Unix} +{$endif HASAMIGA} {$ifdef Unix} if (DebuggeeTTY='') and (OutFile='') and (ExecType<>exDosShell) then @@ -1718,6 +1739,9 @@ procedure TIDEApp.DosShell; var s : string; begin +{$ifdef HASAMIGA} + s := 'C:NewShell'; +{$else} {$ifdef Unix} s:=GetEnv('SHELL'); if s='' then @@ -1735,6 +1759,7 @@ begin s:=''; end; {$endif} +{$endif} if s='' then ErrorBox(msg_errorexecutingshell,nil) else diff --git a/ide/fpini.pas b/ide/fpini.pas index a5b32de075..a4ede2221b 100644 --- a/ide/fpini.pas +++ b/ide/fpini.pas @@ -32,6 +32,7 @@ procedure SetPrinterDevice(const Device: string); implementation uses + sysutils, { used for SameFileName function } Dos,Objects,Drivers, FVConsts, Version, @@ -102,10 +103,17 @@ const ieDebuggeeRedir = 'DebugRedirection'; ieRemoteMachine = 'RemoteMachine'; ieRemotePort = 'RemotePort'; + ieRemotePuttySession = 'RemotePuttySession'; ieRemoteSendCommand = 'RemoteSendCommand'; + ieRemoteExecCommand = 'RemoteExecCommand'; + ieRemoteSshExecCommand = 'RemoteSshExecCommand'; ieRemoteConfig = 'RemoteSendConfig'; ieRemoteIdent = 'RemoteSendIdent'; ieRemoteDirectory = 'RemoteDirectory'; + ieRemoteCopy = 'RemoteCopy'; + ieRemoteShell = 'RemoteShell'; + ieRemoteGdbServer = 'gdbserver'; + iePrimaryFile = 'PrimaryFile'; ieCompileMode = 'CompileMode'; iePalette = 'Palette'; @@ -226,10 +234,17 @@ begin ErrorBox(FormatStrStr(msg_errorwritingfile,CurDir+IniName),nil) else IniFileName:=CurDir+IniName; - if CopyFile(SwitchesPath,CurDir+SwitchesName)=false then - ErrorBox(FormatStrStr(msg_errorwritingfile,CurDir+SwitchesName),nil) - else - SwitchesPath:=CurDir+SwitchesName; + { copy also SwitchesPath to current dir, but only if + 1) SwitchesPath exists + 2) SwitchesPath is different from CurDir+SwitchesName } + if ExistsFile(SwitchesPath) and + not SameFileName(SwitchesPath,CurDir+SwitchesName) then + begin + if CopyFile(SwitchesPath,CurDir+SwitchesName)=false then + ErrorBox(FormatStrStr(msg_errorwritingfile,CurDir+SwitchesName),nil) + else + SwitchesPath:=CurDir+SwitchesName; + end; end; end else @@ -420,10 +435,16 @@ begin {$ifdef SUPPORT_REMOTE} RemoteMachine :=INIFile^.GetEntry(secRun,ieRemoteMachine,RemoteMachine); RemotePort :=INIFile^.GetEntry(secRun,ieRemotePort,RemotePort); + RemotePuttySession :=INIFile^.GetEntry(secRun,ieRemotePuttySession,RemotePuttySession); RemoteSendCommand :=INIFile^.GetEntry(secRun,ieRemoteSendCommand,RemoteSendCommand); + RemoteExecCommand :=INIFile^.GetEntry(secRun,ieRemoteExecCommand,RemoteExecCommand); + RemoteSshExecCommand :=INIFile^.GetEntry(secRun,ieRemoteSshExecCommand,RemoteSshExecCommand); RemoteConfig :=INIFile^.GetEntry(secRun,ieRemoteConfig,RemoteConfig); RemoteIdent :=INIFile^.GetEntry(secRun,ieRemoteIdent,RemoteIdent); RemoteDir :=INIFile^.GetEntry(secRun,ieRemoteDirectory,RemoteDir); + RemoteGDBServer :=INIFile^.GetEntry(secRun,ieRemoteGDBServer,RemoteGDBServer); + RemoteCopy :=INIFile^.GetEntry(secRun,ieRemoteCopy,RemoteCopy); + RemoteShell :=INIFile^.GetEntry(secRun,ieRemoteShell,RemoteShell); {$endif SUPPORT_REMOTE} { Compile } S:=INIFile^.GetEntry(secCompile,ieCompileMode,''); @@ -637,10 +658,19 @@ begin {$ifdef SUPPORT_REMOTE} INIFile^.SetEntry(secRun,ieRemoteMachine,RemoteMachine); INIFile^.SetEntry(secRun,ieRemotePort,RemotePort); + INIFile^.SetEntry(secRun,ieRemotePuttySession,RemotePuttySession); INIFile^.SetEntry(secRun,ieRemoteSendCommand,RemoteSendCommand); INIFile^.SetEntry(secRun,ieRemoteConfig,RemoteConfig); INIFile^.SetEntry(secRun,ieRemoteIdent,RemoteIdent); INIFile^.SetEntry(secRun,ieRemoteDirectory,RemoteDir); + INIFile^.SetEntry(secRun,ieRemoteExecCommand,RemoteExecCommand); + INIFile^.SetEntry(secRun,ieRemoteSshExecCommand,RemoteSshExecCommand); + INIFile^.SetEntry(secRun,ieRemoteConfig,RemoteConfig); + INIFile^.SetEntry(secRun,ieRemoteIdent,RemoteIdent); + INIFile^.SetEntry(secRun,ieRemoteDirectory,RemoteDir); + INIFile^.SetEntry(secRun,ieRemoteGDBServer,RemoteGDBServer); + INIFile^.SetEntry(secRun,ieRemoteCopy,RemoteCopy); + INIFile^.SetEntry(secRun,ieRemoteShell,RemoteShell); {$endif SUPPORT_REMOTE} { Compile } INIFile^.SetEntry(secCompile,iePrimaryFile,PrimaryFile); diff --git a/ide/fpmake.pp b/ide/fpmake.pp index 34594b201d..162a85fa95 100644 --- a/ide/fpmake.pp +++ b/ide/fpmake.pp @@ -153,19 +153,18 @@ begin CompilerTarget:=Defaults.CPU; P:=AddPackage('ide'); - P.Version:='2.7.1'; + P.Version:='3.1.1'; {$ifdef ALLPACKAGES} P.Directory:=ADirectory; {$endif ALLPACKAGES} - P.Dependencies.Add('rtl'); P.Dependencies.Add('rtl-extra'); P.Dependencies.Add('fv'); P.Dependencies.Add('chm'); { This one is only needed if DEBUG is set } P.Dependencies.Add('regexpr'); if not (NoGDBOption) then - P.Dependencies.Add('gdbint',AllOSes-[morphos]); + P.Dependencies.Add('gdbint',AllOSes-AllAmigaLikeOSes); P.Dependencies.Add('graph',[go32v2]); P.SupportBuildModes:=[bmOneByOne]; @@ -201,17 +200,17 @@ begin T.Directory:='compiler'; T.Install:=false; - P.InstallFiles.Add('fp.ans','$(BININSTALLDIR)'); - P.InstallFiles.Add('gplprog.pt','$(BININSTALLDIR)'); - P.InstallFiles.Add('gplunit.pt','$(BININSTALLDIR)'); - P.InstallFiles.Add('program.pt','$(BININSTALLDIR)'); - P.InstallFiles.Add('unit.pt','$(BININSTALLDIR)'); - P.InstallFiles.Add('cvsco.tdf','$(BININSTALLDIR)'); - P.InstallFiles.Add('cvsdiff.tdf','$(BININSTALLDIR)'); - P.InstallFiles.Add('cvsup.tdf','$(BININSTALLDIR)'); - P.InstallFiles.Add('grep.tdf','$(BININSTALLDIR)'); - P.InstallFiles.Add('tpgrep.tdf','$(BININSTALLDIR)'); - P.InstallFiles.Add('fp32.ico', [win32, win64], '$(BININSTALLDIR)'); + P.InstallFiles.Add('fp.ans','$(bininstalldir)'); + P.InstallFiles.Add('gplprog.pt','$(bininstalldir)'); + P.InstallFiles.Add('gplunit.pt','$(bininstalldir)'); + P.InstallFiles.Add('program.pt','$(bininstalldir)'); + P.InstallFiles.Add('unit.pt','$(bininstalldir)'); + P.InstallFiles.Add('cvsco.tdf','$(bininstalldir)'); + P.InstallFiles.Add('cvsdiff.tdf','$(bininstalldir)'); + P.InstallFiles.Add('cvsup.tdf','$(bininstalldir)'); + P.InstallFiles.Add('grep.tdf','$(bininstalldir)'); + P.InstallFiles.Add('tpgrep.tdf','$(bininstalldir)'); + P.InstallFiles.Add('fp32.ico', [win32, win64], '$(bininstalldir)'); P.Sources.AddDoc('readme.ide'); diff --git a/ide/fpmdebug.inc b/ide/fpmdebug.inc index 8cad30cb25..4251f8164f 100644 --- a/ide/fpmdebug.inc +++ b/ide/fpmdebug.inc @@ -14,46 +14,26 @@ **********************************************************************} {$ifdef SUPPORT_REMOTE} -function GetRemoteString : string; -var - St : string; -begin - St:=RemoteSendCommand; - If RemoteConfig<>'' then - ReplaceStrI(St,'$CONFIG','-F '+RemoteConfig) - else - ReplaceStrI(St,'$CONFIG',''); - If RemoteIdent<>'' then - ReplaceStrI(St,'$IDENT','-i '+RemoteIdent) - else - ReplaceStrI(St,'$IDENT',''); - ReplaceStrI(St,'$LOCALFILE',GDBFileName(ExeFile)); - ReplaceStrI(St,'$REMOTEDIR',RemoteDir); - ReplaceStrI(St,'$REMOTEMACHINE',RemoteMachine); - GetRemoteString:=st; -end; - procedure TIDEApp.TransferRemote; var - S,SendCommand : string; + DoSendCommand : string; Executed : boolean; begin - SendCommand:=GetRemoteString; - if SendCommand<>'' then + DoSendCommand:=TransformRemoteString(RemoteSendCommand); + if DoSendCommand<>'' then begin - s:='scp'+exeext; - if LocateExeFile(s) then - Executed:=DoExecute(s,SendCommand,'','','',exNormal) - else - Executed:=DoExecute('scp',SendCommand,'','','',exNormal); + Executed:=DoExecute(DoSendCommand,'','','send___.out','send___.err',exNormal); if Executed then begin if (DosError<>0) or (DosExitCode<>0) then - ErrorBox(#3'Execution of'#13#3+s+' '+SendCommand+#13#3+ + ErrorBox(#3'Execution of'#13#3+DoSendCommand+#13#3+ 'returned ('+inttostr(DosError)+','+inttostr(DosExitCode)+')',nil); + ProcessMessageFile('send___.out'); + ProcessMessageFile('send___.err'); + UpdateToolMessages; end else - ErrorBox(#3'Unable to execute'#13#3+s+' '+SendCommand,nil); + ErrorBox(#3'Unable to execute'#13#3+DoSendCommand,nil); end else @@ -63,6 +43,9 @@ end; procedure TIDEApp.DoUserScreenWindow; begin + {$ifdef HASAMIGA} + Exit; // Do not open the Userscreen on AMIGA systems, its not closeable + {$endif} if UserScreenWindow=nil then begin New(UserScreenWindow, Init(UserScreen, SearchFreeWindowNo)); diff --git a/ide/fpmingw.pas b/ide/fpmingw.pas index c4d98c09f5..8c25b517f0 100644 --- a/ide/fpmingw.pas +++ b/ide/fpmingw.pas @@ -14,6 +14,8 @@ unit fpmingw; **********************************************************************} +{$I globdir.inc} + interface // mingw put atexit in binaries, so that it can have one atexit, and call it from @@ -72,9 +74,11 @@ procedure doinit; begin // not (yet) done: set mingw exception handlers: // SetUnhandledExceptionFilter (_gnu_exception_handler); +{$ifndef DISABLE_CPU_FEATURES_INIT} {$ifdef win32} __cpu_features_init; // load CPU features. Might be useful for debugger :-) {$endif win32} +{$endif ndef DISABLE_CPU_FEATURES_INIT} // fpreset; // don't do this, we init our own fp mask diff --git a/ide/fpmopts.inc b/ide/fpmopts.inc index 38e3418524..0f7edefd00 100644 --- a/ide/fpmopts.inc +++ b/ide/fpmopts.inc @@ -584,10 +584,11 @@ end; procedure TIDEApp.DoRemote; var R,R2: TRect; - IL1,IL2,IL3,IL4,IL5,IL6: PEditorInputLine; + IL1,IL2,IL3,IL4,IL5,IL6,IL7,IL8: PEditorInputLine; + IL9,IL10,IL11 : PEditorInputLine; D: PCenterDialog; const - FieldLines = 6; + FieldLines = 11; begin { RemoteMachine : string = ''; @@ -641,13 +642,48 @@ begin Insert(IL5); R2.Move(0,-1); Insert(New(PLabel, Init(R2,label_remote_ident, IL5))); - { remote machine command } + { remote machine send command } R2.Move(0,3); New(IL6, Init(R2, 255)); IL6^.Data^:=RemoteSendCommand; Insert(IL6); R2.Move(0,-1); - Insert(New(PLabel, Init(R2,label_remote_command, IL6))); + Insert(New(PLabel, Init(R2,label_remote_send_command, IL6))); + { remote machine exec command } + R2.Move(0,3); + New(IL7, Init(R2, 255)); + IL7^.Data^:=RemoteExecCommand; + Insert(IL7); + R2.Move(0,-1); + Insert(New(PLabel, Init(R2,label_remote_exec_command, IL7))); + { remote machine exec command using ssh } + R2.Move(0,3); + New(IL8, Init(R2, 255)); + IL8^.Data^:=RemoteSshExecCommand; + Insert(IL8); + R2.Move(0,-1); + Insert(New(PLabel, Init(R2,label_remote_ssh_exec_command, IL8))); + { Remote shell executable } + R2.Move(0,3); + New(IL9, Init(R2, 255)); + IL9^.Data^:=RemoteShell; + Insert(IL9); + R2.Move(0,-1); + Insert(New(PLabel, Init(R2,label_remote_shell, IL9))); + { Remote copy executable } + R2.Move(0,3); + New(IL10, Init(R2, 255)); + IL10^.Data^:=RemoteCopy; + Insert(IL10); + R2.Move(0,-1); + Insert(New(PLabel, Init(R2,label_remote_copy, IL10))); + R2.Move(0,3); + { Remote gdbserver } + New(IL11, Init(R2, 255)); + IL11^.Data^:=RemoteGdbServer; + Insert(IL11); + R2.Move(0,-1); + Insert(New(PLabel, Init(R2,label_remote_gdbserver, IL11))); end; InsertButtons(D); if Desktop^.ExecView(D)=cmOK then @@ -658,6 +694,11 @@ begin RemoteConfig:=IL4^.Data^; RemoteIdent:=IL5^.Data^; RemoteSendCommand:=IL6^.Data^; + RemoteExecCommand:=IL7^.Data^; + RemoteSshExecCommand:=IL8^.Data^; + RemoteShell:=IL9^.Data^; + RemoteCopy:=IL10^.Data^; + RemoteGdbServer:=IL11^.Data^; end; Dispose(D, Done); end; diff --git a/ide/fpredir.pas b/ide/fpredir.pas index 66f8a569ba..aa50c8c826 100644 --- a/ide/fpredir.pas +++ b/ide/fpredir.pas @@ -56,6 +56,7 @@ Var procedure InitRedir; function ExecuteRedir (Const ProgName, ComLine, RedirStdIn, RedirStdOut, RedirStdErr : String) : boolean; procedure DosExecute(ProgName, ComLine : String); +function MaybeQuoted(const s:string):string; function ChangeRedirOut(Const Redir : String; AppendToFile : Boolean) : Boolean; procedure RestoreRedirOut; @@ -788,8 +789,12 @@ end; {............................................................................} - procedure DosExecute(ProgName, ComLine : String); +{$ifdef HASAMIGA} + begin + Dos.Exec(ProgName, ComLine); + end; +{$else} {$ifdef Windows} var StoreInherit : BOOL; @@ -845,6 +850,7 @@ end; end; {$endif CPU86} End; +{$endif HASAMIGA} {***************************************************************************** Initialize diff --git a/ide/fptemplt.pas b/ide/fptemplt.pas index c40678e938..d22933be12 100644 --- a/ide/fptemplt.pas +++ b/ide/fptemplt.pas @@ -255,7 +255,11 @@ procedure InitTemplates; PT : PTemplate; i : sw_integer; begin + {$ifdef HASAMIGA} + if (copy(Dir,length(Dir),1)<>DirSep) and (copy(Dir,length(Dir),1)<>DriveSeparator) then Dir:=Dir+DirSep; + {$else} if copy(Dir,length(Dir),1)<>DirSep then Dir:=Dir+DirSep; + {$endif} FindFirst(Dir+'*'+TemplateExt,AnyFile,SR); while (DosError=0) do begin diff --git a/ide/fpusrscr.pas b/ide/fpusrscr.pas index 92e03b9f36..1dd6c1aa76 100644 --- a/ide/fpusrscr.pas +++ b/ide/fpusrscr.pas @@ -86,6 +86,11 @@ type {$DEFINE AMIGASCREEN} {$ENDIF} +{$IFDEF AROS} + {$DEFINE AMIGASCREEN} +{$ENDIF} + + {$IFDEF AMIGASCREEN} PAmigaScreen = ^TAmigaScreen; TAmigaScreen = object(TScreen) @@ -179,7 +184,8 @@ type GraphModeName : string; GraphXres,GraphYres : longint; GraphBuffer : pointer; - ConsoleGraphDriver, ConsoleGraphMode : word; + GraphCGABkColor: Integer; + ConsoleGraphDriver, ConsoleGraphMode : smallint; {$endif USE_GRAPH_SWITCH} function GetLineStartOfs(Line: integer): word; procedure GetBuffer(Size: word); @@ -478,7 +484,9 @@ begin GetMem(VIDEBuffer,IDEVideoInfo.ScreenSize); VIDEBufferSize:=IDEVideoInfo.ScreenSize; end; + HideMouse; DosmemGet(VSeg,SOfs,VIDEBuffer^,IDEVideoInfo.ScreenSize); + ShowMouse; end; procedure TDosScreen.SaveConsoleScreen; @@ -502,54 +510,75 @@ begin (ConsoleVideoInfo.Mode=$13) or (ConsoleVideoInfo.Mode=$12) or (ConsoleVideoInfo.Mode=$10) or - (ConsoleVideoInfo.Mode=$E) then + (ConsoleVideoInfo.Mode=$E) or + (ConsoleVideoInfo.Mode=$6) or + (ConsoleVideoInfo.Mode=$4) then begin - if VesaSetMode(ConsoleVideoInfo.Mode or $8000) then + Graph.DontClearGraphMemory:=true; + if ConsoleVideoInfo.Mode>=$100 then begin - Graph.DontClearGraphMemory:=true; - if ConsoleVideoInfo.Mode>=$100 then - begin - GraphDriver:=Graph.Vesa; - GraphMode:=ConsoleVideoInfo.Mode and $fff; - end - else - begin - GraphDriver:=Graph.VGA; - case ConsoleVideoInfo.Mode of - $E : GraphMode:=VGALo; - $10 : GraphMode:=VGAMed; - $12 : GraphMode:=VGAHi; - $13 : begin - GraphDriver:=Graph.LowRes; - GraphMode:=0; - end; - end; - end; - Graph.InitGraph(GraphDriver,GraphMode,''); - if graphresult=grOk then - begin - ConsoleGraphDriver:=GraphDriver; - GraphDriverName:=GetDriverName; - GraphModeName:=GetModeName(GraphMode); - ConsoleGraphMode:=GraphMode; - Graph.DontClearGraphMemory:=false; - GraphXres:=Graph.GetmaxX; - GraphYres:=Graph.GetmaxY; - GraphImageSize:=ImageSize(0,0,GraphXres,GraphYres); - GetMem(GraphBuffer,GraphImageSize); - FillChar(GraphBuffer^,GraphImageSize,#0); - GetImage(0,0,GraphXres,GraphYres,GraphBuffer^); - ConsoleVideoInfo.Rows:=GraphYres div 8; - ConsoleVideoInfo.Cols:=GraphXres div 8; - {FreeBuffer;} - saved:=true; - end + GraphDriver:=Graph.Vesa; + GraphMode:=ConsoleVideoInfo.Mode and $fff; + end + else + begin + case ConsoleVideoInfo.Mode of + $4 : begin + GraphDriver:=Graph.CGA; + case (Mem[$40:$66] shr 4) and 3 of + 0: GraphMode:=CGAC2; + 1: GraphMode:=CGAC0; + 2: GraphMode:=CGAC3; + 3: GraphMode:=CGAC1; + end; + GraphCGABkColor:=Mem[$40:$66] and $0F; + end; + $6 : begin + GraphDriver:=Graph.CGA; + GraphMode:=CGAHi; + end; + $E : begin + GraphDriver:=Graph.VGA; + GraphMode:=VGALo; + end; + $10 : begin + GraphDriver:=Graph.VGA; + GraphMode:=VGAMed; + end; + $12 : begin + GraphDriver:=Graph.VGA; + GraphMode:=VGAHi; + end; + $13 : begin + GraphDriver:=Graph.LowRes; + GraphMode:=0; + end; + end; + end; + Graph.InitGraph(GraphDriver,GraphMode,''); + if graphresult=grOk then + begin + ConsoleGraphDriver:=GraphDriver; + GraphDriverName:=GetDriverName; + GraphModeName:=GetModeName(GraphMode); + ConsoleGraphMode:=GraphMode; + Graph.DontClearGraphMemory:=false; + GraphXres:=Graph.GetmaxX; + GraphYres:=Graph.GetmaxY; + GraphImageSize:=ImageSize(0,0,GraphXres,GraphYres); + GetMem(GraphBuffer,GraphImageSize); + FillChar(GraphBuffer^,GraphImageSize,#0); + GetImage(0,0,GraphXres,GraphYres,GraphBuffer^); + ConsoleVideoInfo.Rows:=GraphYres div 8; + ConsoleVideoInfo.Cols:=GraphXres div 8; + {FreeBuffer;} + saved:=true; + end {$ifdef DEBUG} - else - Writeln(stderr,'Error in InitGraph ',Graphdriver, ' ',Graphmode) + else + Writeln(stderr,'Error in InitGraph ',Graphdriver, ' ',Graphmode) {$endif DEBUG} - ; - end; + ; end; { mode < $100 so use standard Save code } if not saved then @@ -571,51 +600,31 @@ var VSeg,SOfs: word; {$ifdef USE_GRAPH_SWITCH} restored : boolean; - GraphDriver,GraphMode : integer; {$endif USE_GRAPH_SWITCH} begin - SetVideoMode(ConsoleVideoInfo); {$ifdef USE_GRAPH_SWITCH} restored:=false; if assigned(GraphBuffer) then begin - if VesaSetMode(ConsoleVideoInfo.Mode) then + Graph.InitGraph(ConsoleGraphDriver,ConsoleGraphMode,''); + if graphresult=grOk then begin - if ConsoleVideoInfo.Mode>=$100 then - begin - GraphDriver:=Graph.Vesa; - GraphMode:=ConsoleVideoInfo.Mode and $fff; - end - else - begin - GraphDriver:=Graph.VGA; - case ConsoleVideoInfo.Mode of - $E : GraphMode:=VGALo; - $10 : GraphMode:=VGAMed; - $12 : GraphMode:=VGAHi; - $13 : begin - GraphDriver:=Graph.LowRes; - GraphMode:=0; - end; - end; - end; - if (ConsoleGraphDriver<>GraphDriver) or - (ConsoleGraphMode<>GraphMode) then - Graph.InitGraph(GraphDriver,GraphMode,''); - if graphresult=grOk then - begin - PutImage(0,0,GraphBuffer^,CopyPut); - FreeMem(GraphBuffer,GraphImageSize); - GraphBuffer:=nil; - GraphImageSize:=0; - restored:=true; - end; + if (ConsoleGraphDriver=CGA) and + (ConsoleGraphMode>=CGAC0) and + (ConsoleGraphMode<=CGAC3) then + SetBkColor(GraphCGABkColor); + PutImage(0,0,GraphBuffer^,CopyPut); + FreeMem(GraphBuffer,GraphImageSize); + GraphBuffer:=nil; + GraphImageSize:=0; + restored:=true; end; end; { mode < $100 so use standard Save code } if not restored then {$endif USE_GRAPH_SWITCH} begin + SetVideoMode(ConsoleVideoInfo); if ConsoleVideoInfo.Mode=7 then VSeg:=SegB000 else @@ -1572,7 +1581,7 @@ begin UserScreen:=New(PNWLScreen, Init); {$else} {$ifdef AMIGASCREEN} - UserScreen:=nil; //New(PAmigaScreen, Init); + UserScreen:=New(PAmigaScreen, Init); {$else} UserScreen:=New(PScreen, Init); {$endif AMIGASCREEN} diff --git a/ide/fputils.pas b/ide/fputils.pas index 25f89a2966..4026211284 100644 --- a/ide/fputils.pas +++ b/ide/fputils.pas @@ -29,12 +29,20 @@ const pasext = '.pas'; ppext = '.pp'; {$else} + {$ifdef HASAMIGA} + listsep = [';']; + exeext = ''; + pasext = '.pas'; + ppext = '.pp'; + {$else HASAMIGA} listsep = [';']; exeext = '.exe'; pasext = '.pas'; ppext = '.pp'; + {$endif HASAMIGA} {$endif} + function SmartPath(Path: string): string; Function FixPath(s:string;allowdot:boolean):string; function FixFileName(const s:string):string; @@ -97,7 +105,11 @@ function SmartPath(Path: string): string; var S: string; begin GetDir(0,S); +{$ifdef HASAMIGA} + if (copy(S,length(S),1)<>DirSep) and (copy(S,length(S),1)<>DriveSeparator) then S:=S+DirSep; +{$else} if copy(S,length(S),1)<>DirSep then S:=S+DirSep; +{$endif} {$ifdef FSCaseInsensitive} if (LowerCaseStr(copy(Path,1,length(S)))=LowerCaseStr(S)) {and (Pos('\',copy(Path,length(S)+1,High(S)))=0)} then {$else} diff --git a/ide/fpvars.pas b/ide/fpvars.pas index a5a1d0850e..02ec192baa 100644 --- a/ide/fpvars.pas +++ b/ide/fpvars.pas @@ -90,7 +90,7 @@ const ClipboardWindow : PClipboardWindow = nil; ShowStatusOnError: boolean = true; StartupDir : string = '.'+DirSep; IDEDir : string = '.'+DirSep; -{$if defined(WINDOWS) or defined(Unix)} +{$if defined(WINDOWS) or defined(Unix) or defined(Aros)} SystemIDEDir : string = ''; {$endif defined(WINDOWS) or defined(Unix)} INIFileName : string = ININame; @@ -121,11 +121,28 @@ const ClipboardWindow : PClipboardWindow = nil; {$ifdef SUPPORT_REMOTE} RemoteMachine : string = ''; + RemotePuttySession : string = ''; RemotePort : string = '2345'; RemoteConfig : string = ''; RemoteIdent : string = ''; RemoteDir : string = ''; - RemoteSendCommand : string = 'scp $CONFIG $IDENT $LOCALFILE $REMOTEMACHINE:$REMOTEDIR'; + RemoteGDBServer : string = 'gdbserver'; +{$ifdef Windows} + RemoteCopy : string = 'pscp.exe'; + RemoteShell : string = 'plink.exe'; +{$else not windows} + RemoteCopy : string = 'scp'; + RemoteShell : string = 'ssh'; +{$endif not windows} + + RemoteSendCommand : string = + '$REMOTECOPY $CONFIG $IDENT $LOCALFILE $REMOTEMACHINE:$REMOTEDIR'; + RemoteExecCommand : string = + '"cd $REMOTEDIR; chmod u+x ./$LOCALFILENAME;'+ + ' $REMOTEGDBSERVER :$REMOTEPORT ./$LOCALFILENAME"'; + RemoteSshExecCommand : string = + '$START $REMOTESHELL $CONFIG $IDENT -L $REMOTEPORT:localhost:$REMOTEPORT $REMOTEMACHINE '+ + '"$REMOTEEXECCOMMAND" $DOITINBACKGROUND'; {$endif SUPPORT_REMOTE} DebuggeeTTY : string = ''; diff --git a/ide/fpviews.pas b/ide/fpviews.pas index 3319a882c4..e1d8ce457d 100644 --- a/ide/fpviews.pas +++ b/ide/fpviews.pas @@ -510,6 +510,7 @@ const menu_key_common_copy_borland = 'Ctrl+Ins'; menu_key_edit_cut_microsoft = 'Ctrl+X'; menu_key_edit_copy_microsoft = menu_key_common_copy_microsoft; menu_key_edit_paste_microsoft = 'Ctrl+V'; + menu_key_edit_all_borland = ''; menu_key_edit_clear = 'Ctrl+Del'; menu_key_common_helpindex = 'Shift+F1'; @@ -530,10 +531,12 @@ const menu_key_common_copy_borland = 'Ctrl+Ins'; const menu_key_edit_cut:string[63]=menu_key_edit_cut_borland; menu_key_edit_copy:string[63]=menu_key_edit_copy_borland; menu_key_edit_paste:string[63]=menu_key_edit_paste_borland; + menu_key_edit_all:string[63]=menu_key_edit_all_borland; menu_key_hlplocal_copy:string[63]=menu_key_hlplocal_copy_borland; cut_key:word=kbShiftDel; copy_key:word=kbCtrlIns; paste_key:word=kbShiftIns; + all_key:word=kbNoKey; procedure RegisterFPViews; @@ -4238,7 +4241,7 @@ begin HelpCtx:=hcAbout; GetExtent(R); R.Grow(-3,-2); R2.Copy(R); R2.B.Y:=R2.A.Y+1; - Insert(New(PStaticText, Init(R2, ^C'FreePascal IDE for '+source_info.name))); + Insert(New(PStaticText, Init(R2, ^C'Free Pascal IDE for '+source_info.name))); R2.Move(0,1); Insert(New(PStaticText, Init(R2, ^C'Target CPU: '+target_cpu_string))); R2.Move(0,1); @@ -4354,7 +4357,7 @@ end; procedure TFPASCIIChart.HandleEvent(var Event: TEvent); var W: PSourceWindow; begin - writeln(stderr,'all what=',event.what,' cmd=', event.command); + {writeln(stderr,'all what=',event.what,' cmd=', event.command);} case Event.What of evKeyDown : case Event.KeyCode of @@ -4366,7 +4369,7 @@ begin end; evCommand : begin - writeln(stderr,'fpascii what=',event.what, ' cmd=', event.command, ' ',cmtransfer,' ',cmsearchwindow); + {writeln(stderr,'fpascii what=',event.what, ' cmd=', event.command, ' ',cmtransfer,' ',cmsearchwindow);} if Event.Command=(AsciiTableCommandBase+1) then // variable begin W:=FirstEditorWindow; diff --git a/ide/globdir.inc b/ide/globdir.inc index fd28d478a1..520779f3e6 100644 --- a/ide/globdir.inc +++ b/ide/globdir.inc @@ -31,11 +31,9 @@ {$define SignalIsCdecl} {$define FSCaseInsensitive} {$define HasSysMsgUnit} - {$ifdef DEBUG} - {$ifndef NOVESA} - {$define USE_GRAPH_SWITCH} - {$endif not NOVESA} - {$endif DEBUG} + {$ifndef NOVESA} + {$define USE_GRAPH_SWITCH} + {$endif not NOVESA} {$endif} {$ifdef Linux} @@ -102,10 +100,17 @@ {$ifdef Amiga} {$define FSCaseInsensitive} + {$define WinClipSupported} {$endif} {$ifdef MorphOS} {$define FSCaseInsensitive} + {$define WinClipSupported} +{$endif} + +{$ifdef AROS} + {$define FSCaseInsensitive} + {$define WinClipSupported} {$endif} { --- Exclude debugger support --- } @@ -177,3 +182,16 @@ {$ifdef CROSSGDB} {$define SUPPORT_REMOTE} {$endif CROSSGDB} + +{$ifdef FPC_ARMEL} + {$define FPC_ARMEL32} +{$endif FPC_ARMEL} +{$ifdef FPC_ARMEB} + {$define FPC_ARMEB32} +{$endif FPC_ARMEB} +{$ifdef FPC_OARM} + {$define FPC_ARMEL32} +{$endif FPC_OARM} +{$ifdef FPC_ARMHF} + {$define FPC_ARMEL32} +{$endif FPC_ARMHF} diff --git a/ide/wconsole.pas b/ide/wconsole.pas index cf1906eda7..dad7e4b8b9 100644 --- a/ide/wconsole.pas +++ b/ide/wconsole.pas @@ -43,6 +43,9 @@ interface {$ifdef morphos} longint {$endif morphos} +{$ifdef aros} + longint +{$endif aros} ; Procedure SaveConsoleMode(var ConsoleMode : TConsoleMode); Procedure RestoreConsoleMode(const ConsoleMode : TConsoleMode); diff --git a/ide/wconstse.inc b/ide/wconstse.inc index f6db04f4b2..81ec61df67 100644 --- a/ide/wconstse.inc +++ b/ide/wconstse.inc @@ -99,11 +99,11 @@ msg_cutting = 'Cutting'; { Help system } - msg_nohelpfilesinstalled1 = 'To keep the size of the FPC download reasonably low, it comes without html formatted docs'; - msg_nohelpfilesinstalled2 = 'which are necessary for the IDE.'; - msg_nohelpfilesinstalled3 = 'To get these docs, go to http://www.freepascal.org/down/docs/docs.var and get one'; - msg_nohelpfilesinstalled4 = 'of the html doc archives and unpack the enclosed contents into your FPC directory.'; - msg_nohelpfilesinstalled5 = 'Add fpctoc.html via Help|Files ... to the IDE help file system.'; + msg_nohelpfilesinstalled1 = 'To keep the size of the FPC download reasonably low, the CHM help files'; + msg_nohelpfilesinstalled2 = 'which are necessary for the IDE help to function, are omitted.'; + msg_nohelpfilesinstalled3 = 'To get these docs, go to ftp://ftp.freepascal.org/pub/fpc/dist/ and get doc-chm.zip'; + msg_nohelpfilesinstalled4 = 'for your version. Extract the CHM files and add them to the IDE using Help|Files,'; + msg_nohelpfilesinstalled5 = 'add toc.chm first.'; msg_helpindex = 'Help index'; msg_nohelpavailabelforthistopic = 'No help available for this topic.'; msg_pagenotavailable = 'Page not available'; diff --git a/ide/whelp.pas b/ide/whelp.pas index 4c35cbd4eb..02630d8a51 100644 --- a/ide/whelp.pas +++ b/ide/whelp.pas @@ -192,6 +192,9 @@ uses {$ifdef netware_clib} nwserv, {$endif} +{$ifdef HASAMIGA} + dos, +{$endif} Strings, WConsts; @@ -202,6 +205,11 @@ type procedure FreeItem(Item: Pointer); virtual; end; +{$ifdef HASAMIGA} +var + StartupTicks: Int64; +{$endif} + const HelpFileTypes : PHelpFileTypeCollection = nil; @@ -306,14 +314,9 @@ begin GetDosTicks := Nwserv.GetCurrentTicks; end; {$endif} -{$ifdef amiga} +{$ifdef HASAMIGA} begin - GetDosTicks := -1; -end; -{$endif} -{$ifdef morphos} -begin - GetDosTicks := -1; + GetDosTicks := ((dos.GetMsCount div 55) - StartupTicks) and $7FFFFFFF; end; {$endif} @@ -992,4 +995,9 @@ begin Dispose(HelpFiles, Done); end; +{$ifdef HASAMIGA} +INITIALIZATION + StartupTicks := dos.GetMsCount div 55; +{$endif} + END. diff --git a/ide/winclip.pas b/ide/winclip.pas index 327648d1a0..68cbc6cc8d 100644 --- a/ide/winclip.pas +++ b/ide/winclip.pas @@ -46,6 +46,12 @@ implementation strings,windows; {$endif Windows} +{$ifdef HASAMIGA} + uses + clipboard,cliputils; +{$endif} + + {$ifdef DOS} function WinClipboardSupported : boolean; var @@ -129,6 +135,36 @@ begin end; {$endif Windows} +{$ifdef HASAMIGA} +function WinClipboardSupported: Boolean; +begin + WinClipboardSupported := True; +end; + +function OpenWinClipboard: boolean; +begin + OpenWinClipboard := True; +end; + +function EmptyWinClipboard: boolean; +begin + EmptyWinClipboard := GetTextFromClip(PRIMARY_CLIP) = ''; +end; + +function CloseWinClipboard : boolean; +begin + CloseWinClipboard:= True; +end; + +function InternGetDataSize: LongInt; +var + Text: string; +begin + Text := GetTextFromClip(PRIMARY_CLIP); + InternGetDataSize := Length(Text); +end; +{$endif HASAMIGA} + function GetTextWinClipboardSize : longint; begin @@ -147,6 +183,10 @@ var h : HGlobal; pp : pchar; {$endif Windows} +{$ifdef HASAMIGA} + Text: AnsiString; + pp: PChar; +{$endif HASAMIGA} begin p:=nil; GetTextWinClipBoardData:=False; @@ -181,6 +221,14 @@ begin end; GetTextWinClipBoardData:=h<>0; {$endif Windows} +{$ifdef HASAMIGA} + Text := GetTextFromClip(0) + #0; + PP := @Text[1]; + l := Length(Text); + GetMem(p,l); + Move(pp^,p^,l); + GetTextWinClipBoardData := True; +{$endif HASAMIGA} CloseWinClipBoard; {$ifdef DOS} M.MoveDataFrom(l,P^); @@ -199,6 +247,10 @@ var pp : pchar; res : boolean; {$endif Windows} +{$ifdef HASAMIGA} + pp: PChar; + Test: AnsiString; +{$endif HASAMIGA} begin SetTextWinClipBoardData:=False; if (l=0) or (l>65520) then @@ -239,6 +291,9 @@ begin GlobalUnlock(h); SetTextWinClipBoardData:=res; {$endif Windows} +{$ifdef HASAMIGA} + PutTextToClip(0, AnsiString(p)); +{$endif HASAMIGA} CloseWinClipBoard; end; diff --git a/ide/wini.pas b/ide/wini.pas index 53f5bc392d..4cef370c71 100644 --- a/ide/wini.pas +++ b/ide/wini.pas @@ -123,13 +123,40 @@ end; function TINIEntry.GetText: string; var S,CoS: string; + delimiter : char; + i : longint; begin if Text=nil then begin CoS:=GetComment; S:=GetTag+'='+GetValue; if Trim(S)='=' then S:=CoS else - if CoS<>'' then S:=S+' '+CommentChar+' '+CoS; + if CoS<>'' then + begin + { if Value contains CommentChar, we need to add delimiters } + if pos(CommentChar,S)>0 then + begin + delimiter:=#0; + while delimiter < #255 do + begin + if (delimiter in ValidStrDelimiters) and + (pos(delimiter,S)=0) then + break; + delimiter:=succ(delimiter); + end; + if delimiter=#255 then + delimiter:='"'; + { we use \", but we also need to escape \ itself } + for i:=length(s) downto 1 do + if (s[i]=delimiter) then + s:=copy(s,1,i-1)+'\'+delimiter+copy(s,i+1,length(s)) + else if (s[i]='\') then + s:=copy(s,1,i-1)+'\\'+copy(s,i+1,length(s)); + + s:=delimiter+s+delimiter; + end; + S:=S+' '+CommentChar+' '+CoS; + end end else S:=Text^; GetText:=S; @@ -176,7 +203,8 @@ var S,ValueS: string; begin S:=GetText; Delimiter:=#0; P:=Pos('=',S); P2:=Pos(CommentChar,S); - if (P2<>0) and (P2<P) then P:=0; + if (P2<>0) and (P2<P) then + P:=0; if P<>0 then begin Tag:=NewStr(copy(S,1,P-1)); @@ -186,15 +214,38 @@ begin while (P2<=length(S)) do begin C:=S[P2]; - if (P2=StartP) and (C in ValidStrDelimiters) then begin Delimiter:=C; InString:=true; end else - if C=Delimiter then InString:=not InString else - if (C=CommentChar) and (InString=false) then Break else - ValueS:=ValueS+C; + if (P2=StartP) and (C in ValidStrDelimiters) then + begin + Delimiter:=C; + InString:=true; + end + { if Value is delimited with ' or ", handle escaping } + else if (Delimiter<>#0) and (C='\') and (P2<length(S)) then + begin + inc(P2); + C:=S[P2]; + ValueS:=ValueS+C; + end + else if C=Delimiter then + InString:=not InString + else if (C=CommentChar) and (InString=false) then + Break + else + ValueS:=ValueS+C; Inc(P2); end; Value:=NewStr(Trim(ValueS)); Comment:=NewStr(copy(S,P2+1,High(S))); - end else + { dispose raw text as special treatment is needed for + write } + if assigned(Comment) and assigned(Text) and + (delimiter<>#0) then + begin + DisposeStr(Text); + Text:=nil; + end; + end + else begin Tag:=nil; TagHash:=0; diff --git a/ide/wutils.pas b/ide/wutils.pas index 4e890a1994..e7242bc385 100644 --- a/ide/wutils.pas +++ b/ide/wutils.pas @@ -514,7 +514,11 @@ function DirOf(const S: string): string; var D: DirStr; E: ExtStr; N: NameStr; begin FSplit(S,D,N,E); - if (D<>'') and (D[Length(D)]<>DirSep) then + if (D<>'') and (D[Length(D)]<>DirSep) + {$ifdef HASAMIGA} + and (D[Length(D)]<>DriveSeparator) + {$endif} + then DirOf:=D+DirSep else DirOf:=D; @@ -1220,7 +1224,11 @@ function GetCurDir: string; var S: string; begin GetDir(0,S); +{$ifdef HASAMIGA} + if (copy(S,length(S),1)<>DirSep) and (copy(S,length(S),1)<>DriveSeparator) then S:=S+DirSep; +{$else} if copy(S,length(S),1)<>DirSep then S:=S+DirSep; +{$endif} GetCurDir:=S; end; @@ -1233,7 +1241,7 @@ var Dir: string; begin Dir:=GetEnv('TEMP'); if Dir='' then Dir:=GetEnv('TMP'); -{$if defined(morphos) or defined(amiga)} +{$ifdef HASAMIGA} if Dir='' then Dir:='T:'; {$endif} if (Dir<>'') then if not ExistsDir(Dir) then Dir:=''; |