Browse Source

* Cleanup demodir.

git-svn-id: trunk@7895 -
marco 18 years ago
parent
commit
6f30ee3775

+ 255 - 54
packages/base/paszlib/Makefile

@@ -231,7 +231,7 @@ UNITSDIR:=$(wildcard $(FPCDIR)/units/$(OS_TARGET))
 endif
 endif
 PACKAGESDIR:=$(wildcard $(FPCDIR) $(FPCDIR)/packages $(FPCDIR)/packages/base $(FPCDIR)/packages/extra)
 PACKAGESDIR:=$(wildcard $(FPCDIR) $(FPCDIR)/packages $(FPCDIR)/packages/base $(FPCDIR)/packages/extra)
 override PACKAGE_NAME=paszlib
 override PACKAGE_NAME=paszlib
-override PACKAGE_VERSION=2.0.0
+override PACKAGE_VERSION=2.2.0
 ifeq ($(FULL_TARGET),i386-linux)
 ifeq ($(FULL_TARGET),i386-linux)
 override TARGET_UNITS+=paszlib adler gzio infblock infcodes inffast inftrees infutil trees zcompres zdeflate zinflate zbase zuncompr zip ziputils unzip
 override TARGET_UNITS+=paszlib adler gzio infblock infcodes inffast inftrees infutil trees zcompres zdeflate zinflate zbase zuncompr zip ziputils unzip
 endif
 endif
@@ -389,160 +389,160 @@ ifeq ($(FULL_TARGET),powerpc64-embedded)
 override TARGET_UNITS+=paszlib adler gzio infblock infcodes inffast inftrees infutil trees zcompres zdeflate zinflate zbase zuncompr zip ziputils unzip
 override TARGET_UNITS+=paszlib adler gzio infblock infcodes inffast inftrees infutil trees zcompres zdeflate zinflate zbase zuncompr zip ziputils unzip
 endif
 endif
 ifeq ($(FULL_TARGET),i386-linux)
 ifeq ($(FULL_TARGET),i386-linux)
-override TARGET_EXAMPLES+=demo
+override TARGET_EXAMPLEDIRS+=demo
 endif
 endif
 ifeq ($(FULL_TARGET),i386-go32v2)
 ifeq ($(FULL_TARGET),i386-go32v2)
-override TARGET_EXAMPLES+=demo
+override TARGET_EXAMPLEDIRS+=demo
 endif
 endif
 ifeq ($(FULL_TARGET),i386-win32)
 ifeq ($(FULL_TARGET),i386-win32)
-override TARGET_EXAMPLES+=demo
+override TARGET_EXAMPLEDIRS+=demo
 endif
 endif
 ifeq ($(FULL_TARGET),i386-os2)
 ifeq ($(FULL_TARGET),i386-os2)
-override TARGET_EXAMPLES+=demo
+override TARGET_EXAMPLEDIRS+=demo
 endif
 endif
 ifeq ($(FULL_TARGET),i386-freebsd)
 ifeq ($(FULL_TARGET),i386-freebsd)
-override TARGET_EXAMPLES+=demo
+override TARGET_EXAMPLEDIRS+=demo
 endif
 endif
 ifeq ($(FULL_TARGET),i386-beos)
 ifeq ($(FULL_TARGET),i386-beos)
-override TARGET_EXAMPLES+=demo
+override TARGET_EXAMPLEDIRS+=demo
 endif
 endif
 ifeq ($(FULL_TARGET),i386-netbsd)
 ifeq ($(FULL_TARGET),i386-netbsd)
-override TARGET_EXAMPLES+=demo
+override TARGET_EXAMPLEDIRS+=demo
 endif
 endif
 ifeq ($(FULL_TARGET),i386-solaris)
 ifeq ($(FULL_TARGET),i386-solaris)
-override TARGET_EXAMPLES+=demo
+override TARGET_EXAMPLEDIRS+=demo
 endif
 endif
 ifeq ($(FULL_TARGET),i386-qnx)
 ifeq ($(FULL_TARGET),i386-qnx)
-override TARGET_EXAMPLES+=demo
+override TARGET_EXAMPLEDIRS+=demo
 endif
 endif
 ifeq ($(FULL_TARGET),i386-netware)
 ifeq ($(FULL_TARGET),i386-netware)
-override TARGET_EXAMPLES+=demo
+override TARGET_EXAMPLEDIRS+=demo
 endif
 endif
 ifeq ($(FULL_TARGET),i386-openbsd)
 ifeq ($(FULL_TARGET),i386-openbsd)
-override TARGET_EXAMPLES+=demo
+override TARGET_EXAMPLEDIRS+=demo
 endif
 endif
 ifeq ($(FULL_TARGET),i386-wdosx)
 ifeq ($(FULL_TARGET),i386-wdosx)
-override TARGET_EXAMPLES+=demo
+override TARGET_EXAMPLEDIRS+=demo
 endif
 endif
 ifeq ($(FULL_TARGET),i386-darwin)
 ifeq ($(FULL_TARGET),i386-darwin)
-override TARGET_EXAMPLES+=demo
+override TARGET_EXAMPLEDIRS+=demo
 endif
 endif
 ifeq ($(FULL_TARGET),i386-emx)
 ifeq ($(FULL_TARGET),i386-emx)
-override TARGET_EXAMPLES+=demo
+override TARGET_EXAMPLEDIRS+=demo
 endif
 endif
 ifeq ($(FULL_TARGET),i386-watcom)
 ifeq ($(FULL_TARGET),i386-watcom)
-override TARGET_EXAMPLES+=demo
+override TARGET_EXAMPLEDIRS+=demo
 endif
 endif
 ifeq ($(FULL_TARGET),i386-netwlibc)
 ifeq ($(FULL_TARGET),i386-netwlibc)
-override TARGET_EXAMPLES+=demo
+override TARGET_EXAMPLEDIRS+=demo
 endif
 endif
 ifeq ($(FULL_TARGET),i386-wince)
 ifeq ($(FULL_TARGET),i386-wince)
-override TARGET_EXAMPLES+=demo
+override TARGET_EXAMPLEDIRS+=demo
 endif
 endif
 ifeq ($(FULL_TARGET),i386-embedded)
 ifeq ($(FULL_TARGET),i386-embedded)
-override TARGET_EXAMPLES+=demo
+override TARGET_EXAMPLEDIRS+=demo
 endif
 endif
 ifeq ($(FULL_TARGET),i386-symbian)
 ifeq ($(FULL_TARGET),i386-symbian)
-override TARGET_EXAMPLES+=demo
+override TARGET_EXAMPLEDIRS+=demo
 endif
 endif
 ifeq ($(FULL_TARGET),m68k-linux)
 ifeq ($(FULL_TARGET),m68k-linux)
-override TARGET_EXAMPLES+=demo
+override TARGET_EXAMPLEDIRS+=demo
 endif
 endif
 ifeq ($(FULL_TARGET),m68k-freebsd)
 ifeq ($(FULL_TARGET),m68k-freebsd)
-override TARGET_EXAMPLES+=demo
+override TARGET_EXAMPLEDIRS+=demo
 endif
 endif
 ifeq ($(FULL_TARGET),m68k-netbsd)
 ifeq ($(FULL_TARGET),m68k-netbsd)
-override TARGET_EXAMPLES+=demo
+override TARGET_EXAMPLEDIRS+=demo
 endif
 endif
 ifeq ($(FULL_TARGET),m68k-amiga)
 ifeq ($(FULL_TARGET),m68k-amiga)
-override TARGET_EXAMPLES+=demo
+override TARGET_EXAMPLEDIRS+=demo
 endif
 endif
 ifeq ($(FULL_TARGET),m68k-atari)
 ifeq ($(FULL_TARGET),m68k-atari)
-override TARGET_EXAMPLES+=demo
+override TARGET_EXAMPLEDIRS+=demo
 endif
 endif
 ifeq ($(FULL_TARGET),m68k-openbsd)
 ifeq ($(FULL_TARGET),m68k-openbsd)
-override TARGET_EXAMPLES+=demo
+override TARGET_EXAMPLEDIRS+=demo
 endif
 endif
 ifeq ($(FULL_TARGET),m68k-palmos)
 ifeq ($(FULL_TARGET),m68k-palmos)
-override TARGET_EXAMPLES+=demo
+override TARGET_EXAMPLEDIRS+=demo
 endif
 endif
 ifeq ($(FULL_TARGET),m68k-embedded)
 ifeq ($(FULL_TARGET),m68k-embedded)
-override TARGET_EXAMPLES+=demo
+override TARGET_EXAMPLEDIRS+=demo
 endif
 endif
 ifeq ($(FULL_TARGET),powerpc-linux)
 ifeq ($(FULL_TARGET),powerpc-linux)
-override TARGET_EXAMPLES+=demo
+override TARGET_EXAMPLEDIRS+=demo
 endif
 endif
 ifeq ($(FULL_TARGET),powerpc-netbsd)
 ifeq ($(FULL_TARGET),powerpc-netbsd)
-override TARGET_EXAMPLES+=demo
+override TARGET_EXAMPLEDIRS+=demo
 endif
 endif
 ifeq ($(FULL_TARGET),powerpc-amiga)
 ifeq ($(FULL_TARGET),powerpc-amiga)
-override TARGET_EXAMPLES+=demo
+override TARGET_EXAMPLEDIRS+=demo
 endif
 endif
 ifeq ($(FULL_TARGET),powerpc-macos)
 ifeq ($(FULL_TARGET),powerpc-macos)
-override TARGET_EXAMPLES+=demo
+override TARGET_EXAMPLEDIRS+=demo
 endif
 endif
 ifeq ($(FULL_TARGET),powerpc-darwin)
 ifeq ($(FULL_TARGET),powerpc-darwin)
-override TARGET_EXAMPLES+=demo
+override TARGET_EXAMPLEDIRS+=demo
 endif
 endif
 ifeq ($(FULL_TARGET),powerpc-morphos)
 ifeq ($(FULL_TARGET),powerpc-morphos)
-override TARGET_EXAMPLES+=demo
+override TARGET_EXAMPLEDIRS+=demo
 endif
 endif
 ifeq ($(FULL_TARGET),powerpc-embedded)
 ifeq ($(FULL_TARGET),powerpc-embedded)
-override TARGET_EXAMPLES+=demo
+override TARGET_EXAMPLEDIRS+=demo
 endif
 endif
 ifeq ($(FULL_TARGET),sparc-linux)
 ifeq ($(FULL_TARGET),sparc-linux)
-override TARGET_EXAMPLES+=demo
+override TARGET_EXAMPLEDIRS+=demo
 endif
 endif
 ifeq ($(FULL_TARGET),sparc-netbsd)
 ifeq ($(FULL_TARGET),sparc-netbsd)
-override TARGET_EXAMPLES+=demo
+override TARGET_EXAMPLEDIRS+=demo
 endif
 endif
 ifeq ($(FULL_TARGET),sparc-solaris)
 ifeq ($(FULL_TARGET),sparc-solaris)
-override TARGET_EXAMPLES+=demo
+override TARGET_EXAMPLEDIRS+=demo
 endif
 endif
 ifeq ($(FULL_TARGET),sparc-embedded)
 ifeq ($(FULL_TARGET),sparc-embedded)
-override TARGET_EXAMPLES+=demo
+override TARGET_EXAMPLEDIRS+=demo
 endif
 endif
 ifeq ($(FULL_TARGET),x86_64-linux)
 ifeq ($(FULL_TARGET),x86_64-linux)
-override TARGET_EXAMPLES+=demo
+override TARGET_EXAMPLEDIRS+=demo
 endif
 endif
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 ifeq ($(FULL_TARGET),x86_64-freebsd)
-override TARGET_EXAMPLES+=demo
+override TARGET_EXAMPLEDIRS+=demo
 endif
 endif
 ifeq ($(FULL_TARGET),x86_64-win64)
 ifeq ($(FULL_TARGET),x86_64-win64)
-override TARGET_EXAMPLES+=demo
+override TARGET_EXAMPLEDIRS+=demo
 endif
 endif
 ifeq ($(FULL_TARGET),x86_64-embedded)
 ifeq ($(FULL_TARGET),x86_64-embedded)
-override TARGET_EXAMPLES+=demo
+override TARGET_EXAMPLEDIRS+=demo
 endif
 endif
 ifeq ($(FULL_TARGET),arm-linux)
 ifeq ($(FULL_TARGET),arm-linux)
-override TARGET_EXAMPLES+=demo
+override TARGET_EXAMPLEDIRS+=demo
 endif
 endif
 ifeq ($(FULL_TARGET),arm-palmos)
 ifeq ($(FULL_TARGET),arm-palmos)
-override TARGET_EXAMPLES+=demo
+override TARGET_EXAMPLEDIRS+=demo
 endif
 endif
 ifeq ($(FULL_TARGET),arm-wince)
 ifeq ($(FULL_TARGET),arm-wince)
-override TARGET_EXAMPLES+=demo
+override TARGET_EXAMPLEDIRS+=demo
 endif
 endif
 ifeq ($(FULL_TARGET),arm-gba)
 ifeq ($(FULL_TARGET),arm-gba)
-override TARGET_EXAMPLES+=demo
+override TARGET_EXAMPLEDIRS+=demo
 endif
 endif
 ifeq ($(FULL_TARGET),arm-nds)
 ifeq ($(FULL_TARGET),arm-nds)
-override TARGET_EXAMPLES+=demo
+override TARGET_EXAMPLEDIRS+=demo
 endif
 endif
 ifeq ($(FULL_TARGET),arm-embedded)
 ifeq ($(FULL_TARGET),arm-embedded)
-override TARGET_EXAMPLES+=demo
+override TARGET_EXAMPLEDIRS+=demo
 endif
 endif
 ifeq ($(FULL_TARGET),arm-symbian)
 ifeq ($(FULL_TARGET),arm-symbian)
-override TARGET_EXAMPLES+=demo
+override TARGET_EXAMPLEDIRS+=demo
 endif
 endif
 ifeq ($(FULL_TARGET),powerpc64-linux)
 ifeq ($(FULL_TARGET),powerpc64-linux)
-override TARGET_EXAMPLES+=demo
+override TARGET_EXAMPLEDIRS+=demo
 endif
 endif
 ifeq ($(FULL_TARGET),powerpc64-darwin)
 ifeq ($(FULL_TARGET),powerpc64-darwin)
-override TARGET_EXAMPLES+=demo
+override TARGET_EXAMPLEDIRS+=demo
 endif
 endif
 ifeq ($(FULL_TARGET),powerpc64-embedded)
 ifeq ($(FULL_TARGET),powerpc64-embedded)
-override TARGET_EXAMPLES+=demo
+override TARGET_EXAMPLEDIRS+=demo
 endif
 endif
 override INSTALL_FPCPACKAGE=y
 override INSTALL_FPCPACKAGE=y
 ifdef REQUIRE_UNITSDIR
 ifdef REQUIRE_UNITSDIR
@@ -2132,6 +2132,207 @@ endif
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
 fpc_makefiles: fpc_makefile fpc_makefile_dirs
 fpc_makefiles: fpc_makefile fpc_makefile_dirs
+ifeq ($(FULL_TARGET),i386-linux)
+TARGET_EXAMPLEDIRS_DEMO=1
+endif
+ifeq ($(FULL_TARGET),i386-go32v2)
+TARGET_EXAMPLEDIRS_DEMO=1
+endif
+ifeq ($(FULL_TARGET),i386-win32)
+TARGET_EXAMPLEDIRS_DEMO=1
+endif
+ifeq ($(FULL_TARGET),i386-os2)
+TARGET_EXAMPLEDIRS_DEMO=1
+endif
+ifeq ($(FULL_TARGET),i386-freebsd)
+TARGET_EXAMPLEDIRS_DEMO=1
+endif
+ifeq ($(FULL_TARGET),i386-beos)
+TARGET_EXAMPLEDIRS_DEMO=1
+endif
+ifeq ($(FULL_TARGET),i386-netbsd)
+TARGET_EXAMPLEDIRS_DEMO=1
+endif
+ifeq ($(FULL_TARGET),i386-solaris)
+TARGET_EXAMPLEDIRS_DEMO=1
+endif
+ifeq ($(FULL_TARGET),i386-qnx)
+TARGET_EXAMPLEDIRS_DEMO=1
+endif
+ifeq ($(FULL_TARGET),i386-netware)
+TARGET_EXAMPLEDIRS_DEMO=1
+endif
+ifeq ($(FULL_TARGET),i386-openbsd)
+TARGET_EXAMPLEDIRS_DEMO=1
+endif
+ifeq ($(FULL_TARGET),i386-wdosx)
+TARGET_EXAMPLEDIRS_DEMO=1
+endif
+ifeq ($(FULL_TARGET),i386-darwin)
+TARGET_EXAMPLEDIRS_DEMO=1
+endif
+ifeq ($(FULL_TARGET),i386-emx)
+TARGET_EXAMPLEDIRS_DEMO=1
+endif
+ifeq ($(FULL_TARGET),i386-watcom)
+TARGET_EXAMPLEDIRS_DEMO=1
+endif
+ifeq ($(FULL_TARGET),i386-netwlibc)
+TARGET_EXAMPLEDIRS_DEMO=1
+endif
+ifeq ($(FULL_TARGET),i386-wince)
+TARGET_EXAMPLEDIRS_DEMO=1
+endif
+ifeq ($(FULL_TARGET),i386-embedded)
+TARGET_EXAMPLEDIRS_DEMO=1
+endif
+ifeq ($(FULL_TARGET),i386-symbian)
+TARGET_EXAMPLEDIRS_DEMO=1
+endif
+ifeq ($(FULL_TARGET),m68k-linux)
+TARGET_EXAMPLEDIRS_DEMO=1
+endif
+ifeq ($(FULL_TARGET),m68k-freebsd)
+TARGET_EXAMPLEDIRS_DEMO=1
+endif
+ifeq ($(FULL_TARGET),m68k-netbsd)
+TARGET_EXAMPLEDIRS_DEMO=1
+endif
+ifeq ($(FULL_TARGET),m68k-amiga)
+TARGET_EXAMPLEDIRS_DEMO=1
+endif
+ifeq ($(FULL_TARGET),m68k-atari)
+TARGET_EXAMPLEDIRS_DEMO=1
+endif
+ifeq ($(FULL_TARGET),m68k-openbsd)
+TARGET_EXAMPLEDIRS_DEMO=1
+endif
+ifeq ($(FULL_TARGET),m68k-palmos)
+TARGET_EXAMPLEDIRS_DEMO=1
+endif
+ifeq ($(FULL_TARGET),m68k-embedded)
+TARGET_EXAMPLEDIRS_DEMO=1
+endif
+ifeq ($(FULL_TARGET),powerpc-linux)
+TARGET_EXAMPLEDIRS_DEMO=1
+endif
+ifeq ($(FULL_TARGET),powerpc-netbsd)
+TARGET_EXAMPLEDIRS_DEMO=1
+endif
+ifeq ($(FULL_TARGET),powerpc-amiga)
+TARGET_EXAMPLEDIRS_DEMO=1
+endif
+ifeq ($(FULL_TARGET),powerpc-macos)
+TARGET_EXAMPLEDIRS_DEMO=1
+endif
+ifeq ($(FULL_TARGET),powerpc-darwin)
+TARGET_EXAMPLEDIRS_DEMO=1
+endif
+ifeq ($(FULL_TARGET),powerpc-morphos)
+TARGET_EXAMPLEDIRS_DEMO=1
+endif
+ifeq ($(FULL_TARGET),powerpc-embedded)
+TARGET_EXAMPLEDIRS_DEMO=1
+endif
+ifeq ($(FULL_TARGET),sparc-linux)
+TARGET_EXAMPLEDIRS_DEMO=1
+endif
+ifeq ($(FULL_TARGET),sparc-netbsd)
+TARGET_EXAMPLEDIRS_DEMO=1
+endif
+ifeq ($(FULL_TARGET),sparc-solaris)
+TARGET_EXAMPLEDIRS_DEMO=1
+endif
+ifeq ($(FULL_TARGET),sparc-embedded)
+TARGET_EXAMPLEDIRS_DEMO=1
+endif
+ifeq ($(FULL_TARGET),x86_64-linux)
+TARGET_EXAMPLEDIRS_DEMO=1
+endif
+ifeq ($(FULL_TARGET),x86_64-freebsd)
+TARGET_EXAMPLEDIRS_DEMO=1
+endif
+ifeq ($(FULL_TARGET),x86_64-win64)
+TARGET_EXAMPLEDIRS_DEMO=1
+endif
+ifeq ($(FULL_TARGET),x86_64-embedded)
+TARGET_EXAMPLEDIRS_DEMO=1
+endif
+ifeq ($(FULL_TARGET),arm-linux)
+TARGET_EXAMPLEDIRS_DEMO=1
+endif
+ifeq ($(FULL_TARGET),arm-palmos)
+TARGET_EXAMPLEDIRS_DEMO=1
+endif
+ifeq ($(FULL_TARGET),arm-wince)
+TARGET_EXAMPLEDIRS_DEMO=1
+endif
+ifeq ($(FULL_TARGET),arm-gba)
+TARGET_EXAMPLEDIRS_DEMO=1
+endif
+ifeq ($(FULL_TARGET),arm-nds)
+TARGET_EXAMPLEDIRS_DEMO=1
+endif
+ifeq ($(FULL_TARGET),arm-embedded)
+TARGET_EXAMPLEDIRS_DEMO=1
+endif
+ifeq ($(FULL_TARGET),arm-symbian)
+TARGET_EXAMPLEDIRS_DEMO=1
+endif
+ifeq ($(FULL_TARGET),powerpc64-linux)
+TARGET_EXAMPLEDIRS_DEMO=1
+endif
+ifeq ($(FULL_TARGET),powerpc64-darwin)
+TARGET_EXAMPLEDIRS_DEMO=1
+endif
+ifeq ($(FULL_TARGET),powerpc64-embedded)
+TARGET_EXAMPLEDIRS_DEMO=1
+endif
+ifdef TARGET_EXAMPLEDIRS_DEMO
+demo_all:
+	$(MAKE) -C demo all
+demo_debug:
+	$(MAKE) -C demo debug
+demo_smart:
+	$(MAKE) -C demo smart
+demo_release:
+	$(MAKE) -C demo release
+demo_units:
+	$(MAKE) -C demo units
+demo_examples:
+	$(MAKE) -C demo examples
+demo_shared:
+	$(MAKE) -C demo shared
+demo_install:
+	$(MAKE) -C demo install
+demo_sourceinstall:
+	$(MAKE) -C demo sourceinstall
+demo_exampleinstall:
+	$(MAKE) -C demo exampleinstall
+demo_distinstall:
+	$(MAKE) -C demo distinstall
+demo_zipinstall:
+	$(MAKE) -C demo zipinstall
+demo_zipsourceinstall:
+	$(MAKE) -C demo zipsourceinstall
+demo_zipexampleinstall:
+	$(MAKE) -C demo zipexampleinstall
+demo_zipdistinstall:
+	$(MAKE) -C demo zipdistinstall
+demo_clean:
+	$(MAKE) -C demo clean
+demo_distclean:
+	$(MAKE) -C demo distclean
+demo_cleanall:
+	$(MAKE) -C demo cleanall
+demo_info:
+	$(MAKE) -C demo info
+demo_makefiles:
+	$(MAKE) -C demo makefiles
+demo:
+	$(MAKE) -C demo all
+.PHONY: demo_all demo_debug demo_smart demo_release demo_units demo_examples demo_shared demo_install demo_sourceinstall demo_exampleinstall demo_distinstall demo_zipinstall demo_zipsourceinstall demo_zipexampleinstall demo_zipdistinstall demo_clean demo_distclean demo_cleanall demo_info demo_makefiles demo
+endif
 all: fpc_all
 all: fpc_all
 debug: fpc_debug
 debug: fpc_debug
 smart: fpc_smart
 smart: fpc_smart
@@ -2147,7 +2348,7 @@ zipinstall: fpc_zipinstall
 zipsourceinstall: fpc_zipsourceinstall
 zipsourceinstall: fpc_zipsourceinstall
 zipexampleinstall: fpc_zipexampleinstall
 zipexampleinstall: fpc_zipexampleinstall
 zipdistinstall: fpc_zipdistinstall
 zipdistinstall: fpc_zipdistinstall
-clean: fpc_clean
+clean: fpc_clean $(addsuffix _clean,$(TARGET_EXAMPLEDIRS))
 distclean: fpc_distclean
 distclean: fpc_distclean
 cleanall: fpc_cleanall
 cleanall: fpc_cleanall
 info: fpc_info
 info: fpc_info

+ 2 - 2
packages/base/paszlib/Makefile.fpc

@@ -4,14 +4,14 @@
 
 
 [package]
 [package]
 name=paszlib
 name=paszlib
-version=2.0.0
+version=2.2.0
 
 
 [require]
 [require]
 packages=hash
 packages=hash
 
 
 [target]
 [target]
 units=paszlib adler gzio infblock infcodes inffast inftrees infutil trees zcompres zdeflate zinflate zbase zuncompr zip ziputils unzip
 units=paszlib adler gzio infblock infcodes inffast inftrees infutil trees zcompres zdeflate zinflate zbase zuncompr zip ziputils unzip
-examples=demo
+exampledirs=demo
 
 
 [install]
 [install]
 fpcpackage=y
 fpcpackage=y

+ 1 - 2
packages/base/paszlib/demo/example.pas

@@ -18,7 +18,6 @@ program example;
 
 
 uses
 uses
   strings,
   strings,
-  zutil,
   zbase,
   zbase,
   gzio,
   gzio,
   zinflate,
   zinflate,
@@ -390,7 +389,7 @@ begin
   err := deflate(c_stream, Z_FULL_FLUSH);
   err := deflate(c_stream, Z_FULL_FLUSH);
   CHECK_ERR(err, 'deflate');
   CHECK_ERR(err, 'deflate');
 
 
-  Inc(pzByteArray(compr)^[3]); { force an error in first compressed block }
+  Inc(pchar(compr)[3]); { force an error in first compressed block }
   c_stream.avail_in := len - 3;
   c_stream.avail_in := len - 3;
 
 
   err := deflate(c_stream, Z_FINISH);
   err := deflate(c_stream, Z_FINISH);

+ 36 - 42
packages/base/paszlib/demo/miniunz.pas

@@ -19,13 +19,13 @@ program MiniUnz;
   {$endif}
   {$endif}
 {$endif}
 {$endif}
 
 
-uses {$ifdef Delphi}
-  SysUtils,
+uses
+  sysutils,
+  {$ifdef Delphi}
   Windows,
   Windows,
- {$else}
-   {$endif}
-  zutil,
-  //zlib,
+  {$else}
+   zlib,ctypes,
+  {$endif}
   ziputils,
   ziputils,
   unzip;
   unzip;
 
 
@@ -55,7 +55,7 @@ const
   end;
   end;
 
 
 {$else}
 {$else}
-  {$ifdef FPC}
+{$if defined(FPC) and defined(win32)}
 var
 var
   hFile : THandle;
   hFile : THandle;
   ftm,ftLocal,ftCreate,ftLastAcc,ftLastWrite : TFileTime;
   ftm,ftLocal,ftCreate,ftLastAcc,ftLastWrite : TFileTime;
@@ -69,14 +69,8 @@ begin
   CloseHandle(hFile);
   CloseHandle(hFile);
 end;
 end;
   {$else} {  msdos }
   {$else} {  msdos }
-var
-  f: file;
 begin
 begin
-  Assign(f, filename);
-  Reset(f, 1); { open file for reading }
-   { (Otherwise, close will update time) }
-  SetFTime(f,dosDate);
-  Close(f);
+  FileSetDate(filename,dosdate);
 end;
 end;
   {$endif}
   {$endif}
 {$endif}
 {$endif}
@@ -99,7 +93,7 @@ end;
   var
   var
     buffer: PChar;
     buffer: PChar;
     p:      PChar;
     p:      PChar;
-    len:    int;
+    len:    cint;
   var
   var
     hold:   char;
     hold:   char;
   begin
   begin
@@ -109,7 +103,7 @@ end;
     if (len <= 0) then
     if (len <= 0) then
       exit;
       exit;
 
 
-    buffer := PChar(zcalloc(nil, len + 1, 1));
+    buffer := PChar(allocmem( len + 1));
 
 
     strcopy(buffer, newdir);
     strcopy(buffer, newdir);
 
 
@@ -119,7 +113,7 @@ end;
     if mymkdir(buffer) then
     if mymkdir(buffer) then
     begin
     begin
       if Assigned(buffer) then
       if Assigned(buffer) then
-        zcfree(nil, buffer);
+        freemem( buffer);
       makedir := True;
       makedir := True;
       exit;
       exit;
     end;
     end;
@@ -135,7 +129,7 @@ end;
       begin
       begin
         WriteLn('couldn''t create directory ', buffer);
         WriteLn('couldn''t create directory ', buffer);
         if Assigned(buffer) then
         if Assigned(buffer) then
-          zcfree(nil, buffer);
+          freemem( buffer);
         exit;
         exit;
       end;
       end;
       if (hold = #0) then
       if (hold = #0) then
@@ -144,7 +138,7 @@ end;
       Inc(p);
       Inc(p);
     end;
     end;
     if Assigned(buffer) then
     if Assigned(buffer) then
-      zcfree(nil, buffer);
+      freemem( buffer);
     makedir := True;
     makedir := True;
   end;
   end;
 
 
@@ -172,13 +166,13 @@ end;
     LeadingZero := s;
     LeadingZero := s;
   end;
   end;
 
 
-  function HexToStr(w: long): string;
+  function HexToStr(w: clong): string;
   const
   const
     ByteToChar: array[0..$F] of char = '0123456789ABCDEF';
     ByteToChar: array[0..$F] of char = '0123456789ABCDEF';
   var
   var
     s: string;
     s: string;
-    i: int;
-    x: long;
+    i: cint;
+    x: clong;
   begin
   begin
     s := '';
     s := '';
     x := w;
     x := w;
@@ -190,18 +184,18 @@ end;
     HexToStr := s;
     HexToStr := s;
   end;
   end;
 
 
-  function do_list(uf: unzFile): int;
+  function do_list(uf: unzFile): cint;
   var
   var
     i:      longword;
     i:      longword;
     gi:     unz_global_info;
     gi:     unz_global_info;
-    err:    int;
+    err:    cint;
   var
   var
     filename_inzip: array[0..255] of char;
     filename_inzip: array[0..255] of char;
     file_info: unz_file_info;
     file_info: unz_file_info;
     ratio:  longword;
     ratio:  longword;
     string_method: string[255];
     string_method: string[255];
   var
   var
-    iLevel: uInt;
+    iLevel: cuInt;
   begin
   begin
     err := unzGetGlobalInfo(uf, gi);
     err := unzGetGlobalInfo(uf, gi);
     if (err <> UNZ_OK) then
     if (err <> UNZ_OK) then
@@ -225,7 +219,7 @@ end;
       else
       else
       if (file_info.compression_method = Z_DEFLATED) then
       if (file_info.compression_method = Z_DEFLATED) then
       begin
       begin
-        iLevel := uInt((file_info.flag and $06) div 2);
+        iLevel := cuInt((file_info.flag and $06) div 2);
         case iLevel of
         case iLevel of
           0: string_method    := 'Defl:N';
           0: string_method    := 'Defl:N';
           1: string_method    := 'Defl:X';
           1: string_method    := 'Defl:X';
@@ -261,19 +255,19 @@ end;
   end;
   end;
 
 
 
 
-  function do_extract_currentfile(uf: unzFile; const popt_extract_without_path: int; var popt_overwrite: int): int;
+  function do_extract_currentfile(uf: unzFile; const popt_extract_without_path: cint; var popt_overwrite: cint): cint;
   var
   var
     filename_inzip: packed array[0..255] of char;
     filename_inzip: packed array[0..255] of char;
     filename_withoutpath: PChar;
     filename_withoutpath: PChar;
     p:      PChar;
     p:      PChar;
-    err:    int;
+    err:    cint;
     fout:   FILEptr;
     fout:   FILEptr;
     buf:    pointer;
     buf:    pointer;
-    size_buf: uInt;
+    size_buf: cuInt;
     file_info: unz_file_info;
     file_info: unz_file_info;
   var
   var
     write_filename: PChar;
     write_filename: PChar;
-    skip:   int;
+    skip:   cint;
   var
   var
     rep:    char;
     rep:    char;
     ftestexist: FILEptr;
     ftestexist: FILEptr;
@@ -295,7 +289,7 @@ end;
     end;
     end;
 
 
     size_buf := WRITEBUFFERSIZE;
     size_buf := WRITEBUFFERSIZE;
-    buf      := zcalloc(nil, size_buf, 1);
+    buf      := allocmem(size_buf);
     if (buf = nil) then
     if (buf = nil) then
     begin
     begin
       WriteLn('Error allocating memory');
       WriteLn('Error allocating memory');
@@ -415,16 +409,16 @@ end;
     end;
     end;
 
 
     if buf <> nil then
     if buf <> nil then
-      zcfree(nil, buf);
+      freemem( buf);
     do_extract_currentfile := err;
     do_extract_currentfile := err;
   end;
   end;
 
 
 
 
-  function do_extract(uf: unzFile; opt_extract_without_path: int; opt_overwrite: int): int;
+  function do_extract(uf: unzFile; opt_extract_without_path: cint; opt_overwrite: cint): cint;
   var
   var
     i:   longword;
     i:   longword;
     gi:  unz_global_info;
     gi:  unz_global_info;
-    err: int;
+    err: cint;
   begin
   begin
     err := unzGetGlobalInfo(uf, gi);
     err := unzGetGlobalInfo(uf, gi);
     if (err <> UNZ_OK) then
     if (err <> UNZ_OK) then
@@ -450,7 +444,7 @@ end;
     do_extract := 0;
     do_extract := 0;
   end;
   end;
 
 
-  function do_extract_onefile(uf: unzFile; const filename: PChar; opt_extract_without_path: int; opt_overwrite: int): int;
+  function do_extract_onefile(uf: unzFile; const filename: PChar; opt_extract_without_path: cint; opt_overwrite: cint): cint;
   begin
   begin
     if (unzLocateFile(uf, filename, CASESENSITIVITY) <> UNZ_OK) then
     if (unzLocateFile(uf, filename, CASESENSITIVITY) <> UNZ_OK) then
     begin
     begin
@@ -467,20 +461,20 @@ end;
   end;
   end;
 
 
   { -------------------------------------------------------------------- }
   { -------------------------------------------------------------------- }
-  function main: int;
+  function main: cint;
   const
   const
     zipfilename: PChar = nil;
     zipfilename: PChar = nil;
     filename_to_extract: PChar = nil;
     filename_to_extract: PChar = nil;
   var
   var
-    i:    int;
-    opt_do_list: int;
-    opt_do_extract: int;
-    opt_do_extract_withoutpath: int;
-    opt_overwrite: int;
+    i:    cint;
+    opt_do_list: cint;
+    opt_do_extract: cint;
+    opt_do_extract_withoutpath: cint;
+    opt_overwrite: cint;
     filename_try: array[0..512 - 1] of char;
     filename_try: array[0..512 - 1] of char;
     uf:   unzFile;
     uf:   unzFile;
   var
   var
-    p:    int;
+    p:    cint;
     pstr: string[255];
     pstr: string[255];
     c:    char;
     c:    char;
   begin
   begin

+ 20 - 23
packages/base/paszlib/demo/minizip.pas

@@ -11,18 +11,22 @@ program MiniZip;
   Pascal tranlastion
   Pascal tranlastion
   Copyright (C) 2000 by Jacques Nomssi Nzali
   Copyright (C) 2000 by Jacques Nomssi Nzali
   For conditions of distribution and use, see copyright notice in readme.txt
   For conditions of distribution and use, see copyright notice in readme.txt
-}{$ifdef WIN32}
+}
+
+{$ifdef WIN32}
   {$define Delphi}
   {$define Delphi}
   {$ifndef FPC}
   {$ifndef FPC}
     {$define Delphi32}
     {$define Delphi32}
   {$endif}
   {$endif}
 {$endif}
 {$endif}
 
 
-uses {$ifdef Delphi}
-  SysUtils,
-//  Windows,
+uses
+ Sysutils,
+ {$ifdef Delphi}
+  Windows,
  {$else}
  {$else}
-   {$endif}
+   zlib,ctypes,
+ {$endif}
   //zutil,
   //zutil,
   //zlib,
   //zlib,
   ziputils,
   ziputils,
@@ -56,7 +60,7 @@ const
   end;
   end;
 
 
 {$else}
 {$else}
-{$ifdef FPC}
+{$ifdef delphi)} // fpcwin32
 function filetime(f : PChar;               { name of file to get info on }
 function filetime(f : PChar;               { name of file to get info on }
    var tmzip : tm_zip; { return value: access, modific. and creation times }
    var tmzip : tm_zip; { return value: access, modific. and creation times }
    var dt : uLong) : uLong;                { dostime }
    var dt : uLong) : uLong;                { dostime }
@@ -81,29 +85,22 @@ end;
 {$else}
 {$else}
 function filetime(f : PChar;               { name of file to get info on }
 function filetime(f : PChar;               { name of file to get info on }
    var tmzip : tm_zip; { return value: access, modific. and creation times }
    var tmzip : tm_zip; { return value: access, modific. and creation times }
-   var dt : uLong) : uLong;                { dostime }
+   var dt : cuLong) : cuLong;                { dostime }
 var
 var
   fl : file;
   fl : file;
   yy, mm, dd, dow : Word;
   yy, mm, dd, dow : Word;
   h, m, s, hund : Word; { For GetTime}
   h, m, s, hund : Word; { For GetTime}
   dtrec : TDateTime; { For Pack/UnpackTime}
   dtrec : TDateTime; { For Pack/UnpackTime}
+  stime:tsystemtime;
 begin
 begin
-  {$i-}
-  Assign(fl, f);
-  Reset(fl, 1);
-  if IOresult = 0 then
-  begin
-    GetFTime(fl,dt); { Get creation time }
-    UnpackTime(dt, dtrec);
-    Close(fl);
-    tmzip.tm_sec  := dtrec.sec;
-    tmzip.tm_min  := dtrec.min;
-    tmzip.tm_hour := dtrec.hour;
-    tmzip.tm_mday := dtrec.day;
-    tmzip.tm_mon  := dtrec.month;
-    tmzip.tm_year := dtrec.year;
-  end;
-
+  dtrec:=FileDateToDateTime(fileage(f));
+  datetimetosystemtime(dtrec,stime);
+  tmzip.tm_sec  := stime.second;
+  tmzip.tm_min  := stime.minute;
+  tmzip.tm_hour := stime.hour;
+  tmzip.tm_mday := stime.day;
+  tmzip.tm_mon  := stime.month;
+  tmzip.tm_year := stime.year;
   filetime := 0;
   filetime := 0;
 end;
 end;
 {$endif}
 {$endif}